Re: svn commit: r343772 - head/sys/dev/netmap
On Tue, Feb 05, 2019 at 12:10:49PM +, Vincenzo Maffione wrote: > Author: vmaffione > Date: Tue Feb 5 12:10:48 2019 > New Revision: 343772 > URL: https://svnweb.freebsd.org/changeset/base/343772 > > Log: > netmap: refactor logging macros and pipes > > Changelist: > - Replace ND, D and RD macros with nm_prdis, nm_prinf, nm_prerr > and nm_prlim, to avoid possible naming conflicts. > - Add netmap_krings_mode_commit() helper function and use that > to reduce code duplication. > - Refactor pipes control code to export some functions that > can be reused by the veth driver (on Linux) and epair(4). > - Add check to reject API requests with version less than 11. > - Small code refactoring for the null adapter. Hello Vincenzo, this change causes interface attachment output to look somewhat deformed ("000.000395 [3717] netmap_attach_ext" debug info and an extra newline): em0: port 0xe000-0xe01f mem 0xf7d0-0xf7d1,0xf7d2-0xf7d23fff irq 17 at device 0.0 on pci3 em0: Using 1024 TX descriptors and 1024 RX descriptors em0: Using 2 RX queues 2 TX queues em0: Using MSI-X interrupts with 3 vectors em0: Ethernet address: 60:a4:4c:24:0b:4c 000.000395 [3717] netmap_attach_ext em0: netmap queues/slots: TX 2/1024, RX 2/1024 pcib5: irq 19 at device 28.7 on pci0 Could we please get this part back to match the pre-r343772 output again? Marius ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r343772 - head/sys/dev/netmap
Il giorno gio 7 feb 2019 alle ore 11:45 Marius Strobl ha scritto: > On Tue, Feb 05, 2019 at 12:10:49PM +, Vincenzo Maffione wrote: > > Author: vmaffione > > Date: Tue Feb 5 12:10:48 2019 > > New Revision: 343772 > > URL: https://svnweb.freebsd.org/changeset/base/343772 > > > > Log: > > netmap: refactor logging macros and pipes > > > > Changelist: > > - Replace ND, D and RD macros with nm_prdis, nm_prinf, nm_prerr > > and nm_prlim, to avoid possible naming conflicts. > > - Add netmap_krings_mode_commit() helper function and use that > > to reduce code duplication. > > - Refactor pipes control code to export some functions that > > can be reused by the veth driver (on Linux) and epair(4). > > - Add check to reject API requests with version less than 11. > > - Small code refactoring for the null adapter. > > Hello Vincenzo, > > this change causes interface attachment output to look somewhat > deformed ("000.000395 [3717] netmap_attach_ext" debug info and > an extra newline): > em0: port 0xe000-0xe01f mem > 0xf7d0-0xf7d1,0xf7d2-0xf7d23fff irq 17 at device 0.0 on pci3 > em0: Using 1024 TX descriptors and 1024 RX descriptors > em0: Using 2 RX queues 2 TX queues > em0: Using MSI-X interrupts with 3 vectors > em0: Ethernet address: 60:a4:4c:24:0b:4c > 000.000395 [3717] netmap_attach_ext em0: netmap queues/slots: TX > 2/1024, RX 2/1024 > > pcib5: irq 19 at device 28.7 on pci0 > > Could we please get this part back to match the pre-r343772 > output again? > The additional newline slipped through, sorry for that. I was trying to make logging macros uniform across netmap, that's why I did that change (that's the only place in netmap where if_printf() is used). But I understand this is inconvenient for users, so I will revert this specific log line. Cheers, Vincenzo > > Marius > > -- Vincenzo ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343867 - head/sys/dev/netmap
Author: vmaffione Date: Thu Feb 7 11:28:53 2019 New Revision: 343867 URL: https://svnweb.freebsd.org/changeset/base/343867 Log: netmap: revert netmap_attach_ext() to pre-r343772 Reported by: marius MFC after:1 week Modified: head/sys/dev/netmap/netmap.c Modified: head/sys/dev/netmap/netmap.c == --- head/sys/dev/netmap/netmap.cThu Feb 7 10:44:53 2019 (r343866) +++ head/sys/dev/netmap/netmap.cThu Feb 7 11:28:53 2019 (r343867) @@ -3711,8 +3711,7 @@ netmap_attach_ext(struct netmap_adapter *arg, size_t s hwna->up.nm_dtor = netmap_hw_dtor; } - nm_prinf("%s: netmap queues/slots: TX %d/%d, RX %d/%d\n", - hwna->up.name, + if_printf(ifp, "netmap queues/slots: TX %d/%d, RX %d/%d\n", hwna->up.num_tx_rings, hwna->up.num_tx_desc, hwna->up.num_rx_rings, hwna->up.num_rx_desc); return 0; ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343868 - head/tools/build/mk
Author: avos Date: Thu Feb 7 13:12:43 2019 New Revision: 343868 URL: https://svnweb.freebsd.org/changeset/base/343868 Log: Correct ypldap(8) install path in OptionalObsoleteFiles.inc It's installed to /usr/sbin, not to /usr/bin (and was always here). While here, add missing manpages and /var/yp directory to the list. MFC after:1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc == --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Feb 7 11:28:53 2019(r343867) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Feb 7 13:12:43 2019(r343868) @@ -6522,7 +6522,6 @@ OLD_FILES+=usr/bin/ypcat OLD_FILES+=usr/bin/ypchfn OLD_FILES+=usr/bin/ypchpass OLD_FILES+=usr/bin/ypchsh -OLD_FILES+=usr/bin/ypldap OLD_FILES+=usr/bin/ypmatch OLD_FILES+=usr/bin/yppasswd OLD_FILES+=usr/bin/ypwhich @@ -6546,6 +6545,7 @@ OLD_FILES+=usr/sbin/rpc.ypxfrd OLD_FILES+=usr/sbin/yp_mkdb OLD_FILES+=usr/sbin/ypbind OLD_FILES+=usr/sbin/ypinit +OLD_FILES+=usr/sbin/ypldap OLD_FILES+=usr/sbin/yppoll OLD_FILES+=usr/sbin/yppush OLD_FILES+=usr/sbin/ypserv @@ -6558,6 +6558,7 @@ OLD_FILES+=usr/share/man/man1/ypmatch.1.gz OLD_FILES+=usr/share/man/man1/yppasswd.1.gz OLD_FILES+=usr/share/man/man1/ypwhich.1.gz OLD_FILES+=usr/share/man/man5/netid.5.gz +OLD_FILES+=usr/share/man/man5/ypldap.conf.5.gz OLD_FILES+=usr/share/man/man8/mknetid.8.gz OLD_FILES+=usr/share/man/man8/rpc.yppasswdd.8.gz OLD_FILES+=usr/share/man/man8/rpc.ypxfrd.8.gz @@ -6568,6 +6569,7 @@ OLD_FILES+=usr/share/man/man8/nis.8.gz OLD_FILES+=usr/share/man/man8/yp_mkdb.8.gz OLD_FILES+=usr/share/man/man8/ypbind.8.gz OLD_FILES+=usr/share/man/man8/ypinit.8.gz +OLD_FILES+=usr/share/man/man8/ypldap.8.gz OLD_FILES+=usr/share/man/man8/yppoll.8.gz OLD_FILES+=usr/share/man/man8/yppush.8.gz OLD_FILES+=usr/share/man/man8/ypserv.8.gz @@ -6575,6 +6577,7 @@ OLD_FILES+=usr/share/man/man8/ypset.8.gz OLD_FILES+=usr/share/man/man8/ypxfr.8.gz OLD_FILES+=var/yp/Makefile OLD_FILES+=var/yp/Makefile.dist +OLD_DIRS+=var/yp .endif .if ${MK_NLS} == no ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343869 - head/tools/build/options
Author: emaste Date: Thu Feb 7 14:05:21 2019 New Revision: 343869 URL: https://svnweb.freebsd.org/changeset/base/343869 Log: Mention clang-format in WITH_CLANG_EXTRAS It's a useful tool and gives a further hint at the types of additional binaries enabled by the option. Modified: head/tools/build/options/WITH_CLANG_EXTRAS Modified: head/tools/build/options/WITH_CLANG_EXTRAS == --- head/tools/build/options/WITH_CLANG_EXTRAS Thu Feb 7 13:12:43 2019 (r343868) +++ head/tools/build/options/WITH_CLANG_EXTRAS Thu Feb 7 14:05:21 2019 (r343869) @@ -1,2 +1,3 @@ .\" $FreeBSD$ -Set to build additional clang and llvm tools, such as bugpoint. +Set to build additional clang and llvm tools, such as bugpoint and +clang-format. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343870 - head/usr.bin/ipcs
Author: avos Date: Thu Feb 7 14:29:45 2019 New Revision: 343870 URL: https://svnweb.freebsd.org/changeset/base/343870 Log: ipcs(1): drop obsolete error checking This code is not reached since r77551. PR: 201728 MFC after:5 days Modified: head/usr.bin/ipcs/ipcs.c Modified: head/usr.bin/ipcs/ipcs.c == --- head/usr.bin/ipcs/ipcs.cThu Feb 7 14:05:21 2019(r343869) +++ head/usr.bin/ipcs/ipcs.cThu Feb 7 14:29:45 2019(r343870) @@ -199,7 +199,7 @@ main(int argc, char *argv[]) } kget(X_MSGINFO, &msginfo, sizeof(msginfo)); - if ((display & (MSGINFO | MSGTOTAL))) { + if (display & (MSGINFO | MSGTOTAL)) { if (display & MSGTOTAL) print_kmsqtotal(msginfo); @@ -227,15 +227,10 @@ main(int argc, char *argv[]) printf("\n"); } - } else - if (display & (MSGINFO | MSGTOTAL)) { - fprintf(stderr, - "SVID messages facility " - "not configured in the system\n"); - } + } kget(X_SHMINFO, &shminfo, sizeof(shminfo)); - if ((display & (SHMINFO | SHMTOTAL))) { + if (display & (SHMINFO | SHMTOTAL)) { if (display & SHMTOTAL) print_kshmtotal(shminfo); @@ -262,15 +257,10 @@ main(int argc, char *argv[]) } printf("\n"); } - } else - if (display & (SHMINFO | SHMTOTAL)) { - fprintf(stderr, - "SVID shared memory facility " - "not configured in the system\n"); - } + } kget(X_SEMINFO, &seminfo, sizeof(seminfo)); - if ((display & (SEMINFO | SEMTOTAL))) { + if (display & (SEMINFO | SEMTOTAL)) { struct semid_kernel *kxsema; size_t kxsema_len; @@ -299,12 +289,7 @@ main(int argc, char *argv[]) printf("\n"); } - } else - if (display & (SEMINFO | SEMTOTAL)) { - fprintf(stderr, - "SVID semaphores facility " - "not configured in the system\n"); - } + } if (!use_sysctl) kvm_close(kd); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343871 - head/sbin/recoverdisk
Author: avos Date: Thu Feb 7 14:40:28 2019 New Revision: 343871 URL: https://svnweb.freebsd.org/changeset/base/343871 Log: recoverdisk(1): fclose() file supplied via '-r readlist' parameter when it's no longer needed PR: 204952 Reported by: David Binderman MFC after:5 days Modified: head/sbin/recoverdisk/recoverdisk.c Modified: head/sbin/recoverdisk/recoverdisk.c == --- head/sbin/recoverdisk/recoverdisk.c Thu Feb 7 14:29:45 2019 (r343870) +++ head/sbin/recoverdisk/recoverdisk.c Thu Feb 7 14:40:28 2019 (r343871) @@ -125,6 +125,7 @@ read_worklist(off_t t) new_lump(s, l, state); d -= l; } + fclose(file); (void)fprintf(stderr, " done.\n"); /* * Return the number of bytes already read ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343872 - head/sys/powerpc/powerpc
Author: luporl Date: Thu Feb 7 17:30:44 2019 New Revision: 343872 URL: https://svnweb.freebsd.org/changeset/base/343872 Log: [ppc64] fix /dev/kmem For direct mapped kernel addresses, ppc64 function was not performing the dmap to physical conversion, before jumping to the code that fetched the value from physical memory. Reviewed by: jhibbits Differential Revision:https://reviews.freebsd.org/D19086 Modified: head/sys/powerpc/powerpc/mem.c Modified: head/sys/powerpc/powerpc/mem.c == --- head/sys/powerpc/powerpc/mem.c Thu Feb 7 14:40:28 2019 (r343871) +++ head/sys/powerpc/powerpc/mem.c Thu Feb 7 17:30:44 2019 (r343872) @@ -112,9 +112,9 @@ memrw(struct cdev *dev, struct uio *uio, int flags) continue; } if (dev2unit(dev) == CDEV_MINOR_MEM) { -kmem_direct_mapped:v = uio->uio_offset; + v = uio->uio_offset; - off = uio->uio_offset & PAGE_MASK; +kmem_direct_mapped:off = v & PAGE_MASK; cnt = PAGE_SIZE - ((vm_offset_t)iov->iov_base & PAGE_MASK); cnt = min(cnt, PAGE_SIZE - off); @@ -137,8 +137,10 @@ kmem_direct_mapped:v = uio->uio_offset; else if (dev2unit(dev) == CDEV_MINOR_KMEM) { va = uio->uio_offset; - if ((va < VM_MIN_KERNEL_ADDRESS) || (va > virtual_end)) + if ((va < VM_MIN_KERNEL_ADDRESS) || (va > virtual_end)) { + v = DMAP_TO_PHYS(va); goto kmem_direct_mapped; + } va = trunc_page(uio->uio_offset); eva = round_page(uio->uio_offset ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343873 - head/sys/modules/dtb/allwinner
Author: manu Date: Thu Feb 7 18:07:17 2019 New Revision: 343873 URL: https://svnweb.freebsd.org/changeset/base/343873 Log: arm64: dtb: allwinner: Add the new pine64-lts dtb file to the build MFC after:1 month X-MFC-With: r342936 Modified: head/sys/modules/dtb/allwinner/Makefile Modified: head/sys/modules/dtb/allwinner/Makefile == --- head/sys/modules/dtb/allwinner/Makefile Thu Feb 7 17:30:44 2019 (r343872) +++ head/sys/modules/dtb/allwinner/Makefile Thu Feb 7 18:07:17 2019 (r343873) @@ -40,6 +40,7 @@ LINKS= \ DTS= \ allwinner/sun50i-a64-nanopi-a64.dts \ allwinner/sun50i-a64-olinuxino.dts \ + allwinner/sun50i-a64-pine64-lts.dts \ allwinner/sun50i-a64-pine64-plus.dts \ allwinner/sun50i-a64-pine64.dts \ allwinner/sun50i-a64-sopine-baseboard.dts \ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343874 - head/etc/mtree
Author: manu Date: Thu Feb 7 18:54:25 2019 New Revision: 343874 URL: https://svnweb.freebsd.org/changeset/base/343874 Log: mtree: Add dtb subdir to the mtree file makefs will fails otherwise Reported by: emaste MFC after:1 week Modified: head/etc/mtree/BSD.root.dist Modified: head/etc/mtree/BSD.root.dist == --- head/etc/mtree/BSD.root.distThu Feb 7 18:07:17 2019 (r343873) +++ head/etc/mtree/BSD.root.distThu Feb 7 18:54:25 2019 (r343874) @@ -11,7 +11,11 @@ defaults .. dtb +allwinner tags=package=runtime +.. overlays tags=package=runtime +.. +rockchip tags=package=runtime .. .. firmware ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343875 - head/sys/arm64/arm64
Author: andrew Date: Thu Feb 7 20:50:39 2019 New Revision: 343875 URL: https://svnweb.freebsd.org/changeset/base/343875 Log: Add a missing data barrier to the start of arm64_tlb_flushID. We need to ensure the page table store has happened before the tlbi. Reported by: jchandra Tested by:jchandra Sponsored by: DARPA, AFRL Differential Revision:https://reviews.freebsd.org/D19097 Modified: head/sys/arm64/arm64/cpufunc_asm.S Modified: head/sys/arm64/arm64/cpufunc_asm.S == --- head/sys/arm64/arm64/cpufunc_asm.S Thu Feb 7 18:54:25 2019 (r343874) +++ head/sys/arm64/arm64/cpufunc_asm.S Thu Feb 7 20:50:39 2019 (r343875) @@ -96,6 +96,7 @@ ENTRY(arm64_setttb) END(arm64_setttb) ENTRY(arm64_tlb_flushID) + dsb ishst #ifdef SMP tlbivmalle1is #else ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343876 - head/sys/arm64/arm64
Author: andrew Date: Thu Feb 7 20:58:45 2019 New Revision: 343876 URL: https://svnweb.freebsd.org/changeset/base/343876 Log: Add missing data barriers after storeing a new valid pagetable entry. When moving from an invalid to a valid entry we don't need to invalidate the tlb, however we do need to ensure the store is ordered before later memory accesses. This is because this later access may be to a virtual address within the newly mapped region. Add the needed barriers to places where we don't later invalidate the tlb. When we do invalidate the tlb there will be a barrier to correctly order this. This fixes a panic on boot on ThunderX2 when INVARIANTS is turned off: panic: vm_fault_hold: fault on nofault entry, addr: 0x40c11000 Reported by: jchandra Tested by:jchandra Sponsored by: DARPA, AFRL Differential Revision:https://reviews.freebsd.org/D19097 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c == --- head/sys/arm64/arm64/pmap.c Thu Feb 7 20:50:39 2019(r343875) +++ head/sys/arm64/arm64/pmap.c Thu Feb 7 20:58:45 2019(r343876) @@ -2862,6 +2862,7 @@ pmap_update_entry(pmap_t pmap, pd_entry_t *pte, pd_ent /* Create the new mapping */ pmap_load_store(pte, newpte); + dsb(ishst); critical_exit(); intr_restore(intr); @@ -3281,6 +3282,7 @@ validate: } else { /* New mappig */ pmap_load_store(l3, new_l3); + dsb(ishst); } #if VM_NRESERVLEVEL > 0 @@ -3435,6 +3437,7 @@ pmap_enter_l2(pmap_t pmap, vm_offset_t va, pd_entry_t * Map the superpage. */ (void)pmap_load_store(l2, new_l2); + dsb(ishst); atomic_add_long(&pmap_l2_mappings, 1); CTR2(KTR_PMAP, "pmap_enter_l2: success for va %#lx in pmap %p", ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343877 - head/sbin/ipfw
Author: bdrewery Date: Thu Feb 7 21:05:44 2019 New Revision: 343877 URL: https://svnweb.freebsd.org/changeset/base/343877 Log: ipfw table list: Fix showing header outside of 'all'. Properly pass down is_all to table_show_list(). This restores the behavior before r272840 so that only 'ipfw table all list' shows the headers. MFC after:2 weeks Relnotes: yes Modified: head/sbin/ipfw/tables.c Modified: head/sbin/ipfw/tables.c == --- head/sbin/ipfw/tables.c Thu Feb 7 20:58:45 2019(r343876) +++ head/sbin/ipfw/tables.c Thu Feb 7 21:05:44 2019(r343877) @@ -282,13 +282,14 @@ ipfw_table_handler(int ac, char *av[]) } break; case TOK_LIST: + arg = is_all ? (void*)1 : (void*)0; if (is_all == 0) { ipfw_xtable_info i; if ((error = table_get_info(&oh, &i)) != 0) err(EX_OSERR, "failed to request table info"); - table_show_one(&i, NULL); + table_show_one(&i, arg); } else { - error = tables_foreach(table_show_one, NULL, 1); + error = tables_foreach(table_show_one, arg, 1); if (error != 0) err(EX_OSERR, "failed to request tables list"); } @@ -821,13 +822,14 @@ table_show_one(ipfw_xtable_info *i, void *arg) { ipfw_obj_header *oh; int error; + int is_all = (int)arg; if ((error = table_do_get_list(i, &oh)) != 0) { err(EX_OSERR, "Error requesting table %s list", i->tablename); return (error); } - table_show_list(oh, 1); + table_show_list(oh, is_all); free(oh); return (0); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343880 - head/sbin/ipfw
Author: bdrewery Date: Thu Feb 7 21:41:27 2019 New Revision: 343880 URL: https://svnweb.freebsd.org/changeset/base/343880 Log: Fix build of r343877 MFC after:2 weeks X-MFC-with: r343877 Pointyhat to: bdrewery Modified: head/sbin/ipfw/tables.c Modified: head/sbin/ipfw/tables.c == --- head/sbin/ipfw/tables.c Thu Feb 7 21:37:06 2019(r343879) +++ head/sbin/ipfw/tables.c Thu Feb 7 21:41:27 2019(r343880) @@ -282,7 +282,7 @@ ipfw_table_handler(int ac, char *av[]) } break; case TOK_LIST: - arg = is_all ? (void*)1 : (void*)0; + arg = is_all ? (void*)1 : NULL; if (is_all == 0) { ipfw_xtable_info i; if ((error = table_get_info(&oh, &i)) != 0) @@ -822,7 +822,9 @@ table_show_one(ipfw_xtable_info *i, void *arg) { ipfw_obj_header *oh; int error; - int is_all = (int)arg; + int is_all; + + is_all = arg == NULL ? 0 : 1; if ((error = table_do_get_list(i, &oh)) != 0) { err(EX_OSERR, "Error requesting table %s list", i->tablename); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343881 - head/lib/libutil
Author: sef Date: Thu Feb 7 21:51:39 2019 New Revision: 343881 URL: https://svnweb.freebsd.org/changeset/base/343881 Log: r339008 broke repquota for UFS. This rectifies that. Refactor the function calls and tests so that, on UFS, the proper fields are filled out. PR: 233849 Reported by: Andre Albsmeier Reviewed by: mav, delphij MFC after:1 month Sponsored by: iXsystems Inc Differential Revision:https://reviews.freebsd.org/D18785 Modified: head/lib/libutil/quotafile.c Modified: head/lib/libutil/quotafile.c == --- head/lib/libutil/quotafile.cThu Feb 7 21:41:27 2019 (r343880) +++ head/lib/libutil/quotafile.cThu Feb 7 21:51:39 2019 (r343881) @@ -119,6 +119,7 @@ quota_open(struct fstab *fs, int quotatype, int openfl struct group *grp; struct stat st; int qcmd, serrno; + int ufs; if ((qf = calloc(1, sizeof(*qf))) == NULL) return (NULL); @@ -129,15 +130,21 @@ quota_open(struct fstab *fs, int quotatype, int openfl goto error; qf->dev = st.st_dev; qcmd = QCMD(Q_GETQUOTASIZE, quotatype); + ufs = strcmp(fs->fs_vfstype, "ufs") == 0; + /* +* On UFS, hasquota() fills in qf->qfname. But we only care about +* this for UFS. So we need to call hasquota() for UFS, first. +*/ + if (ufs) { + serrno = hasquota(fs, quotatype, qf->qfname, + sizeof(qf->qfname)); + } if (quotactl(qf->fsname, qcmd, 0, &qf->wordsize) == 0) return (qf); - /* We only check the quota file for ufs */ - if (strcmp(fs->fs_vfstype, "ufs")) { + if (!ufs) { errno = 0; goto error; - } - serrno = hasquota(fs, quotatype, qf->qfname, sizeof(qf->qfname)); - if (serrno == 0) { + } else if (serrno == 0) { errno = EOPNOTSUPP; goto error; } ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r343881 - head/lib/libutil
On 2/7/19 1:51 PM, Sean Eric Fagan wrote: > Author: sef > Date: Thu Feb 7 21:51:39 2019 > New Revision: 343881 > URL: https://svnweb.freebsd.org/changeset/base/343881 > > Log: > r339008 broke repquota for UFS. This rectifies that. > > Refactor the function calls and tests so that, on UFS, the proper fields > are filled out. > > PR: 233849 > Reported by:Andre Albsmeier > Reviewed by:mav, delphij > MFC after: 1 month > Sponsored by: iXsystems Inc > Differential Revision: https://reviews.freebsd.org/D18785 > > Modified: > head/lib/libutil/quotafile.c > > Modified: head/lib/libutil/quotafile.c > == > --- head/lib/libutil/quotafile.c Thu Feb 7 21:41:27 2019 > (r343880) > +++ head/lib/libutil/quotafile.c Thu Feb 7 21:51:39 2019 > (r343881) > @@ -119,6 +119,7 @@ quota_open(struct fstab *fs, int quotatype, int openfl > struct group *grp; > struct stat st; > int qcmd, serrno; > + int ufs; > > if ((qf = calloc(1, sizeof(*qf))) == NULL) > return (NULL); > @@ -129,15 +130,21 @@ quota_open(struct fstab *fs, int quotatype, int openfl > goto error; > qf->dev = st.st_dev; > qcmd = QCMD(Q_GETQUOTASIZE, quotatype); > + ufs = strcmp(fs->fs_vfstype, "ufs") == 0; > + /* > + * On UFS, hasquota() fills in qf->qfname. But we only care about > + * this for UFS. So we need to call hasquota() for UFS, first. > + */ > + if (ufs) { > + serrno = hasquota(fs, quotatype, qf->qfname, > + sizeof(qf->qfname)); > + } > if (quotactl(qf->fsname, qcmd, 0, &qf->wordsize) == 0) > return (qf); > - /* We only check the quota file for ufs */ > - if (strcmp(fs->fs_vfstype, "ufs")) { > + if (!ufs) { > errno = 0; > goto error; > - } > - serrno = hasquota(fs, quotatype, qf->qfname, sizeof(qf->qfname)); > - if (serrno == 0) { > + } else if (serrno == 0) { > errno = EOPNOTSUPP; > goto error; > } > /usr/src/lib/libutil/quotafile.c:121: warning: 'serrno' may be used uninitialized in this function -- Regards, Bryan Drewery signature.asc Description: OpenPGP digital signature
svn commit: r343882 - head/lib/libutil
Author: sef Date: Thu Feb 7 22:10:20 2019 New Revision: 343882 URL: https://svnweb.freebsd.org/changeset/base/343882 Log: r343881 had an uninitialized error. This fixes that. PR: 233849 Reported by:Andre Albsmeier MFC after: 1 month Sponsored by: iXsystems Inc Differential Revision: https://reviews.freebsd.org/D18785 Modified: head/lib/libutil/quotafile.c Modified: head/lib/libutil/quotafile.c == --- head/lib/libutil/quotafile.cThu Feb 7 21:51:39 2019 (r343881) +++ head/lib/libutil/quotafile.cThu Feb 7 22:10:20 2019 (r343882) @@ -118,7 +118,7 @@ quota_open(struct fstab *fs, int quotatype, int openfl struct dqhdr64 dqh; struct group *grp; struct stat st; - int qcmd, serrno; + int qcmd, serrno = 0; int ufs; if ((qf = calloc(1, sizeof(*qf))) == NULL) ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343884 - head/lib/libc/stdio
Author: brooks Date: Thu Feb 7 23:17:44 2019 New Revision: 343884 URL: https://svnweb.freebsd.org/changeset/base/343884 Log: GC a historical artifact. Back in 1993, the fgetln (then fgetline) interface was changed to not return a C string. The change was accomplished by ifdefing out the code that did the termination. Changing the interface would violate our API stability rules so remove the old implementation. Sponsored by: DARPA, AFRL Modified: head/lib/libc/stdio/fgetln.c Modified: head/lib/libc/stdio/fgetln.c == --- head/lib/libc/stdio/fgetln.cThu Feb 7 22:49:49 2019 (r343883) +++ head/lib/libc/stdio/fgetln.cThu Feb 7 23:17:44 2019 (r343884) @@ -50,19 +50,12 @@ __FBSDID("$FreeBSD$"); /* * Expand the line buffer. Return -1 on error. -#ifdef notdef - * The `new size' does not account for a terminating '\0', - * so we add 1 here. -#endif */ int __slbexpand(FILE *fp, size_t newsize) { void *p; -#ifdef notdef - ++newsize; -#endif if (fp->_lb._size >= newsize) return (0); if (newsize > INT_MAX) { @@ -160,9 +153,6 @@ fgetln(FILE *fp, size_t *lenp) break; } *lenp = len; -#ifdef notdef - fp->_lb._base[len] = '\0'; -#endif ret = (char *)fp->_lb._base; end: FUNLOCKFILE_CANCELSAFE(); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343889 - head/sys/dev/cxgbe
Author: np Date: Fri Feb 8 03:31:38 2019 New Revision: 343889 URL: https://svnweb.freebsd.org/changeset/base/343889 Log: cxgbev(4): Initialize debug_flags from the environment like in the PF driver. Modified: head/sys/dev/cxgbe/t4_vf.c Modified: head/sys/dev/cxgbe/t4_vf.c == --- head/sys/dev/cxgbe/t4_vf.c Fri Feb 8 03:29:17 2019(r343888) +++ head/sys/dev/cxgbe/t4_vf.c Fri Feb 8 03:31:38 2019(r343889) @@ -479,6 +479,7 @@ t4vf_attach(device_t dev) sc->params.pci.mps = pci_get_max_payload(dev); sc->flags |= IS_VF; + TUNABLE_INT_FETCH("hw.cxgbe.dflags", &sc->debug_flags); sc->sge_gts_reg = VF_SGE_REG(A_SGE_VF_GTS); sc->sge_kdoorbell_reg = VF_SGE_REG(A_SGE_VF_KDOORBELL); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343890 - head/sys/kern
Author: kib Date: Fri Feb 8 04:06:48 2019 New Revision: 343890 URL: https://svnweb.freebsd.org/changeset/base/343890 Log: do_execve(): lock vnode when needed. Code after exec_fail_dealloc label expects that the image vnode is locked if present. When copyout() of the strings or auxv vectors fails, goto to the error handling did not relocked the vnode as required. The copyout() can be made failing e.g. by creating an ELF image with PT_GNU_STACK segment disabling the write. Reported by: Jonathan Stuart (found by fuzzing) Sponsored by: The FreeBSD Foundation MFC after:3 days Modified: head/sys/kern/kern_exec.c Modified: head/sys/kern/kern_exec.c == --- head/sys/kern/kern_exec.c Fri Feb 8 03:31:38 2019(r343889) +++ head/sys/kern/kern_exec.c Fri Feb 8 04:06:48 2019(r343890) @@ -696,8 +696,10 @@ interpret: else error = suword(--stack_base, imgp->args->argc) == 0 ? 0 : EFAULT; - if (error != 0) + if (error != 0) { + vn_lock(imgp->vp, LK_SHARED | LK_RETRY); goto exec_fail_dealloc; + } if (args->fdp != NULL) { /* Install a brand new file descriptor table. */ ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343891 - in head/sys: kern sys
Author: kib Date: Fri Feb 8 04:18:17 2019 New Revision: 343891 URL: https://svnweb.freebsd.org/changeset/base/343891 Log: Fix renameat(2) for CAPABILITIES kernels. When renameat(2) is used with: - absolute path for to; - tofd not set to AT_FDCWD; - the target exists kern_renameat() requires CAP_UNLINK capability on tofd, but corresponding namei ni_filecap is not initialized at all because the lookup is absolute. As result, the check was done against empty filecap and syscall fails erronously. Fix it by creating a return flags namei member and reporting if the lookup was absolute, then do not touch to.ni_filecaps at all. PR: 58 Reviewed by: jilles, ngie Sponsored by: The FreeBSD Foundation MFC after:1 week X-MFC-note: KBI breakage Differential revision:https://reviews.freebsd.org/D19096 Modified: head/sys/kern/vfs_lookup.c head/sys/kern/vfs_syscalls.c head/sys/sys/namei.h Modified: head/sys/kern/vfs_lookup.c == --- head/sys/kern/vfs_lookup.c Fri Feb 8 04:06:48 2019(r343890) +++ head/sys/kern/vfs_lookup.c Fri Feb 8 04:18:17 2019(r343891) @@ -410,6 +410,7 @@ namei(struct nameidata *ndp) dp = NULL; cnp->cn_nameptr = cnp->cn_pnbuf; if (cnp->cn_pnbuf[0] == '/') { + ndp->ni_resflags |= NIRES_ABS; error = namei_handle_root(ndp, &dp); } else { if (ndp->ni_startdir != NULL) { @@ -1302,6 +1303,7 @@ NDINIT_ALL(struct nameidata *ndp, u_long op, u_long fl ndp->ni_dirp = namep; ndp->ni_dirfd = dirfd; ndp->ni_startdir = startdir; + ndp->ni_resflags = 0; filecaps_init(&ndp->ni_filecaps); ndp->ni_cnd.cn_thread = td; if (rightsp != NULL) Modified: head/sys/kern/vfs_syscalls.c == --- head/sys/kern/vfs_syscalls.cFri Feb 8 04:06:48 2019 (r343890) +++ head/sys/kern/vfs_syscalls.cFri Feb 8 04:18:17 2019 (r343891) @@ -3544,10 +3544,10 @@ again: goto out; } #ifdef CAPABILITIES - if (newfd != AT_FDCWD) { + if (newfd != AT_FDCWD && (tond.ni_resflags & NIRES_ABS) == 0) { /* * If the target already exists we require CAP_UNLINKAT -* from 'newfd'. +* from 'newfd', when newfd was used for the lookup. */ error = cap_check(&tond.ni_filecaps.fc_rights, &cap_unlinkat_rights); Modified: head/sys/sys/namei.h == --- head/sys/sys/namei.hFri Feb 8 04:06:48 2019(r343890) +++ head/sys/sys/namei.hFri Feb 8 04:18:17 2019(r343891) @@ -88,6 +88,10 @@ struct nameidata { struct vnode *ni_vp; /* vnode of result */ struct vnode *ni_dvp; /* vnode of intermediate directory */ /* +* Results: flags returned from namei +*/ + u_int ni_resflags; + /* * Shared between namei and lookup/commit routines. */ size_t ni_pathlen; /* remaining chars in path */ @@ -158,6 +162,11 @@ struct nameidata { #defineTRAILINGSLASH 0x1000 /* path ended in a slash */ #defineNOCAPCHECK 0x2000 /* do not perform capability checks */ #definePARAMASK0x3e00 /* mask of parameter descriptors */ + +/* + * Namei results flags + */ +#defineNIRES_ABS 0x0001 /* Path was absolute */ /* * Flags in ni_lcf, valid for the duration of the namei call. ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343895 - in head: share/man/man4 sys/netgraph
Author: glebius Date: Fri Feb 8 06:19:28 2019 New Revision: 343895 URL: https://svnweb.freebsd.org/changeset/base/343895 Log: Allow some nesting of ng_iface(4) interfaces and add a configuration knob. PR: 235500 MFC after:1 week Modified: head/share/man/man4/ng_iface.4 head/sys/netgraph/ng_iface.c Modified: head/share/man/man4/ng_iface.4 == --- head/share/man/man4/ng_iface.4 Fri Feb 8 04:48:12 2019 (r343894) +++ head/share/man/man4/ng_iface.4 Fri Feb 8 06:19:28 2019 (r343895) @@ -35,7 +35,7 @@ .\" $FreeBSD$ .\" $Whistle: ng_iface.8,v 1.5 1999/01/25 23:46:26 archie Exp $ .\" -.Dd January 12, 2015 +.Dd February 6, 2019 .Dt NG_IFACE 4 .Os .Sh NAME @@ -144,6 +144,17 @@ In case when your graph ends up with some kind of seri synchronous or modem, the .Nm is the right place to turn ALTQ on. +.Sh Nesting +.Nm +supports nesting, a configuration when traffic of one +.Nm +interface flows through the other. +The default maximum allowed nesting level is 2. +It can be changed at runtime setting +.Xr sysctl 8 +variable +.Va net.graph.iface.max_nesting +to the desired level of nesting. .Sh SEE ALSO .Xr altq 4 , .Xr bpf 4 , @@ -151,6 +162,7 @@ is the right place to turn ALTQ on. .Xr ng_cisco 4 , .Xr ifconfig 8 , .Xr ngctl 8 +.Xr sysctl .Sh HISTORY The .Nm iface Modified: head/sys/netgraph/ng_iface.c == --- head/sys/netgraph/ng_iface.cFri Feb 8 04:48:12 2019 (r343894) +++ head/sys/netgraph/ng_iface.cFri Feb 8 06:19:28 2019 (r343895) @@ -68,6 +68,7 @@ #include #include #include +#include #include #include @@ -92,6 +93,13 @@ static MALLOC_DEFINE(M_NETGRAPH_IFACE, "netgraph_iface #define M_NETGRAPH_IFACE M_NETGRAPH #endif +static SYSCTL_NODE(_net_graph, OID_AUTO, iface, CTLFLAG_RW, 0, +"Point to point netgraph interface"); +VNET_DEFINE_STATIC(int, ng_iface_max_nest) = 2; +#defineV_ng_iface_max_nest VNET(ng_iface_max_nest) +SYSCTL_INT(_net_graph_iface, OID_AUTO, max_nesting, CTLFLAG_VNET | CTLFLAG_RW, +&VNET_NAME(ng_iface_max_nest), 0, "Max nested tunnels"); + /* This struct describes one address family */ struct iffam { sa_family_t family; /* Address family */ @@ -355,7 +363,8 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m, } /* Protect from deadly infinite recursion. */ - error = if_tunnel_check_nesting(ifp, m, NGM_IFACE_COOKIE, 1); + error = if_tunnel_check_nesting(ifp, m, NGM_IFACE_COOKIE, + V_ng_iface_max_nest); if (error) { m_freem(m); return (error); ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r343896 - head/sbin/dhclient
Author: kib Date: Fri Feb 8 07:36:08 2019 New Revision: 343896 URL: https://svnweb.freebsd.org/changeset/base/343896 Log: Correctly return exit status from the exited process. This is also OpenBSD rev. 1.117, as pointed out by Ryan Moeller . Submitted by: Nash Kaminski MFC after:1 week Modified: head/sbin/dhclient/dhclient.c Modified: head/sbin/dhclient/dhclient.c == --- head/sbin/dhclient/dhclient.c Fri Feb 8 06:19:28 2019 (r343895) +++ head/sbin/dhclient/dhclient.c Fri Feb 8 07:36:08 2019 (r343896) @@ -2348,7 +2348,7 @@ priv_script_go(void) if (ip) script_flush_env(ip->client); - return (wstatus & 0xff); + return WEXITSTATUS(wstatus); } void ___ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"