svn commit: r307664 - stable/11/sys/netinet
Author: rmacklem Date: Thu Oct 20 02:03:19 2016 New Revision: 307664 URL: https://svnweb.freebsd.org/changeset/base/307664 Log: MFC: r306559 r297225 broke udp_output() for the case where the "addr" argument is NULL and the function jumps to the "release:" label. For this case, the "inp" was write locked, but the code attempted to read unlock it. This patch fixes the problem. This case could occur for NFS over UDP mounts, where the server was down for a few minutes under certain circumstances. Modified: stable/11/sys/netinet/udp_usrreq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/udp_usrreq.c == --- stable/11/sys/netinet/udp_usrreq.c Thu Oct 20 01:21:10 2016 (r307663) +++ stable/11/sys/netinet/udp_usrreq.c Thu Oct 20 02:03:19 2016 (r307664) @@ -1559,12 +1559,18 @@ udp_output(struct inpcb *inp, struct mbu release: if (unlock_udbinfo == UH_WLOCKED) { + KASSERT(unlock_inp == UH_WLOCKED, + ("%s: excl udbinfo lock, shared inp lock", __func__)); INP_HASH_WUNLOCK(pcbinfo); INP_WUNLOCK(inp); } else if (unlock_udbinfo == UH_RLOCKED) { + KASSERT(unlock_inp == UH_RLOCKED, + ("%s: shared udbinfo lock, excl inp lock", __func__)); INP_HASH_RUNLOCK(pcbinfo); INP_RUNLOCK(inp); - } else + } else if (unlock_inp == UH_WLOCKED) + INP_WUNLOCK(inp); + else INP_RUNLOCK(inp); m_freem(m); return (error); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307663 - head/sys/kern
Author: kevlo Date: Thu Oct 20 01:21:10 2016 New Revision: 307663 URL: https://svnweb.freebsd.org/changeset/base/307663 Log: Remove register keyword. Reviewed by: kib Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c == --- head/sys/kern/init_main.c Thu Oct 20 01:19:37 2016(r307662) +++ head/sys/kern/init_main.c Thu Oct 20 01:21:10 2016(r307663) @@ -204,9 +204,9 @@ void mi_startup(void) { - register struct sysinit **sipp; /* system initialization*/ - register struct sysinit **xipp; /* interior loop of sort*/ - register struct sysinit *save; /* bubble*/ + struct sysinit **sipp; /* system initialization*/ + struct sysinit **xipp; /* interior loop of sort*/ + struct sysinit *save; /* bubble*/ #if defined(VERBOSE_SYSINIT) int last; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307662 - head/sys/kern
Author: kevlo Date: Thu Oct 20 01:19:37 2016 New Revision: 307662 URL: https://svnweb.freebsd.org/changeset/base/307662 Log: Remove a sentence about putting initialization in init_proc.c or kern_proc.c and useless comment. Reviewed by: kib Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c == --- head/sys/kern/init_main.c Wed Oct 19 22:19:38 2016(r307661) +++ head/sys/kern/init_main.c Thu Oct 20 01:19:37 2016(r307662) @@ -316,15 +316,6 @@ restart: /* NOTREACHED*/ } - -/* - *** - - The following SYSINIT's belong elsewhere, but have not yet - been moved. - - *** - */ static void print_caddr_t(void *data) { @@ -418,17 +409,10 @@ struct sysentvec null_sysvec = { }; /* - *** - - The two following SYSINIT's are proc0 specific glue code. I am not - convinced that they can not be safely combined, but their order of - operation has been maintained as the same as the original init_main.c - for right now. - - These probably belong in init_proc.c or kern_proc.c, since they - deal with proc0 (the fork template process). - - *** + * The two following SYSINIT's are proc0 specific glue code. I am not + * convinced that they can not be safely combined, but their order of + * operation has been maintained as the same as the original init_main.c + * for right now. */ /* ARGSUSED*/ static void @@ -662,16 +646,6 @@ SYSINIT(random, SI_SUB_RANDOM, SI_ORDER_ *** */ - -/* - *** - - The following code probably belongs in another file, like - kern/init_init.c. - - *** - */ - /* * List of paths to try when searching for "init". */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307326 - head/sys/boot/efi/loader
On Wed, Oct 19, 2016 at 04:33:39PM -0600, Warner Losh wrote: > On Wed, Oct 19, 2016 at 11:34 AM, John Baldwinwrote: > > On Wednesday, October 19, 2016 02:01:18 AM Warner Losh wrote: > >> One of my systems would export these as sysctls: > >> > >> smbios.bios.reldate="07/05/2013" > >> smbios.bios.vendor="American Megatrends Inc." > >> smbios.bios.version="3.00" > >> smbios.chassis.maker="Supermicro" > >> smbios.chassis.serial="0123456789" > >> smbios.chassis.tag="To Be Filled By O.E.M." > >> smbios.chassis.version="0123456789" > >> smbios.memory.enabled="268435456" > >> smbios.planar.location="To be filled by O.E.M." > >> smbios.planar.maker="Supermicro" > >> smbios.planar.product="X9SRH-7F/7TF" > >> smbios.planar.serial="VM13CS028237" > >> smbios.planar.tag="To be filled by O.E.M." > >> smbios.planar.version="0123456789" > >> smbios.socket.enabled="1" > >> smbios.socket.populated="1" > >> smbios.system.family="To be filled by O.E.M." > >> smbios.system.maker="Supermicro" > >> smbios.system.product="X9SRH-7F/7TF" > >> smbios.system.serial="0123456789" > >> smbios.system.sku="To be filled by O.E.M." > >> smbios.system.uuid="----002590e4d0ec" > >> smbios.system.version="0123456789" > >> smbios.version="2.7" > >> > >> though some of them are silly due to the BIOS writer being silly... > > > > So are you planning to just duplicate the existing kenv vars as sysctl > > nodes? Can't you parse the output of kenv instead? > > I often get sysctl -a from ailing systems. I never or rarely get kenv. > This adds to the information available when I'm looking into problems > since it gives me more data about the system where the problem occurs. Look like we need show-tech in base system :) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r272211 - head/sys/net
On Sat, Sep 27, 2014 at 7:57 AM, Alexander V. Chernikovwrote: > Author: melifaro > Date: Sat Sep 27 13:57:48 2014 > New Revision: 272211 > URL: http://svnweb.freebsd.org/changeset/base/272211 > > Log: > Use underlying ports counters to get lagg statistics instead of > per-packet accounting. > This introduce user-visible changes like aggregating error counters. > > Reviewed by: asomers (prev.version), glebius > CR: D781 > MFC after:2 weeks > Sponsored by: Yandex LLC > > Modified: > head/sys/net/if_lagg.c > head/sys/net/if_lagg.h > head/sys/net/if_var.h > I think this change is causing a LOR and deadlock. It happens if I create a lagg and then quickly destroy it. The deadlocked threads have these stack traces: Tracing command ifconfig pid 7334 tid 100823 td 0xf8014ff34000 sched_switch() at sched_switch+0x48a/frame 0xfe20b3771470 mi_switch() at mi_switch+0x167/frame 0xfe20b37714a0 turnstile_wait() at turnstile_wait+0x3be/frame 0xfe20b37714f0 __mtx_lock_sleep() at __mtx_lock_sleep+0x196/frame 0xfe20b3771570 __mtx_lock_flags() at __mtx_lock_flags+0x10d/frame 0xfe20b37715c0 _rm_rlock() at _rm_rlock+0x28b/frame 0xfe20b3771600 _rm_rlock_debug() at _rm_rlock_debug+0x11f/frame 0xfe20b3771640 lagg_get_counter() at lagg_get_counter+0x4c/frame 0xfe20b37716c0 if_data_copy() at if_data_copy+0xa1/frame 0xfe20b37716e0 sysctl_rtsock() at sysctl_rtsock+0x56c/frame 0xfe20b3771860 sysctl_root_handler_locked() at sysctl_root_handler_locked+0x8a/frame 0xfe20b37718a0 sysctl_root() at sysctl_root+0x188/frame 0xfe20b3771920 userland_sysctl() at userland_sysctl+0x16e/frame 0xfe20b37719c0 sys___sysctl() at sys___sysctl+0x74/frame 0xfe20b3771a70 amd64_syscall() at amd64_syscall+0x314/frame 0xfe20b3771bf0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfe20b3771bf0 --- syscall (202, FreeBSD ELF64, sys___sysctl), rip = 0x800fceeea, rsp = 0x7fffe408, rbp = 0x7fffe440 --- Tracing command ifconfig pid 7331 tid 100796 td 0xf80066df5a00 sched_switch() at sched_switch+0x48a/frame 0xfe20b36ea630 mi_switch() at mi_switch+0x167/frame 0xfe20b36ea660 turnstile_wait() at turnstile_wait+0x3be/frame 0xfe20b36ea6b0 __rw_wlock_hard() at __rw_wlock_hard+0xb5/frame 0xfe20b36ea740 _rw_wlock_cookie() at _rw_wlock_cookie+0xbc/frame 0xfe20b36ea780 lagg_ether_cmdmulti() at lagg_ether_cmdmulti+0x5c/frame 0xfe20b36ea7c0 lagg_ioctl() at lagg_ioctl+0x115a/frame 0xfe20b36ea8a0 ifioctl() at ifioctl+0xdc1/frame 0xfe20b36ea930 kern_ioctl() at kern_ioctl+0x246/frame 0xfe20b36ea990 sys_ioctl() at sys_ioctl+0x171/frame 0xfe20b36eaa70 amd64_syscall() at amd64_syscall+0x314/frame 0xfe20b36eabf0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfe20b36eabf0 --- syscall (54, FreeBSD ELF64, sys_ioctl), rip = 0x800fd417a, rsp = 0x7fffe228, rbp = 0x7fffe2a0 --- The problem is that lagg_get_counter calls LAGG_RLOCK after calling IF_ADDR_RLOCK at rtsock.c:1717. Meanwhile, another thread called IF_ADDR_WLOCK at if_lagg.c:1581 after having already called LAGG_WLOCK at f_lagg.c:1530. I think this revision introduced the problem because reading the lagg's counters did not previously require the LAGG_RLOCK. Do you have any ideas on how to fix it? -Alan ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307659 - head/gnu/usr.bin
On 19 October 2016 at 21:43, Matteo Riondatowrote: > > This seems to have broken buildworld with WITHOUT_GPL_DTC=y in src.conf . What error do you get? ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307469 - head/etc
What missing quotes? It seemed to work find on the system I brought up... I didn't do the case statement because it would be three extra big useless syntactical boogers in the code :) I do like the idea of using checkyesno. Warner On Wed, Oct 19, 2016 at 2:26 PM, Jilles Tjoelkerwrote: > On Mon, Oct 17, 2016 at 04:07:13AM +, Warner Losh wrote: >> Author: imp >> Date: Mon Oct 17 04:07:13 2016 >> New Revision: 307469 >> URL: https://svnweb.freebsd.org/changeset/base/307469 > >> Log: >> Allow root_rw_mount to be both lower and upper case. Before, if it was >> upper case, you'd wind up with a read-only filesystem when you should >> sometimes. > >> PR: 213549 > >> Modified: >> head/etc/rc > >> Modified: head/etc/rc >> == >> --- head/etc/rc Mon Oct 17 04:07:12 2016(r307468) >> +++ head/etc/rc Mon Oct 17 04:07:13 2016(r307469) >> @@ -135,16 +135,16 @@ done >> # Note: this assumes firstboot_sentinel is on / when we have >> # a read-only /, or that it is on media that's writable. >> if [ -e ${firstboot_sentinel} ]; then >> - [ ${root_rw_mount} = "yes" ] || mount -uw / >> + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -uw / >> chflags -R 0 ${firstboot_sentinel} >> rm -rf ${firstboot_sentinel} >> if [ -e ${firstboot_sentinel}-reboot ]; then >> chflags -R 0 ${firstboot_sentinel}-reboot >> rm -rf ${firstboot_sentinel}-reboot >> - [ ${root_rw_mount} = "yes" ] || mount -ur / >> + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur / >> kill -INT 1 >> fi >> - [ ${root_rw_mount} = "yes" ] || mount -ur / >> + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur / >> fi >> >> echo '' > > Although I have not tested this, it looks like this will always do the > remounts since the condition is either false or invalid due to missing > quotes. > > Perhaps we can use the checkyesno function from rc.subr or use the same > check that rc.d/root uses (case statement where [Nn][Oo] and the empty > string are no and the rest is yes). > > -- > Jilles Tjoelker ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307326 - head/sys/boot/efi/loader
On Wed, Oct 19, 2016 at 11:34 AM, John Baldwinwrote: > On Wednesday, October 19, 2016 02:01:18 AM Warner Losh wrote: >> One of my systems would export these as sysctls: >> >> smbios.bios.reldate="07/05/2013" >> smbios.bios.vendor="American Megatrends Inc." >> smbios.bios.version="3.00" >> smbios.chassis.maker="Supermicro" >> smbios.chassis.serial="0123456789" >> smbios.chassis.tag="To Be Filled By O.E.M." >> smbios.chassis.version="0123456789" >> smbios.memory.enabled="268435456" >> smbios.planar.location="To be filled by O.E.M." >> smbios.planar.maker="Supermicro" >> smbios.planar.product="X9SRH-7F/7TF" >> smbios.planar.serial="VM13CS028237" >> smbios.planar.tag="To be filled by O.E.M." >> smbios.planar.version="0123456789" >> smbios.socket.enabled="1" >> smbios.socket.populated="1" >> smbios.system.family="To be filled by O.E.M." >> smbios.system.maker="Supermicro" >> smbios.system.product="X9SRH-7F/7TF" >> smbios.system.serial="0123456789" >> smbios.system.sku="To be filled by O.E.M." >> smbios.system.uuid="----002590e4d0ec" >> smbios.system.version="0123456789" >> smbios.version="2.7" >> >> though some of them are silly due to the BIOS writer being silly... > > So are you planning to just duplicate the existing kenv vars as sysctl > nodes? Can't you parse the output of kenv instead? I often get sysctl -a from ailing systems. I never or rarely get kenv. This adds to the information available when I'm looking into problems since it gives me more data about the system where the problem occurs. Warner ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307650 - head/sys/kern
On Wed, Oct 19, 2016 at 06:29:52PM +, Mateusz Guzik wrote: M> Author: mjg M> Date: Wed Oct 19 18:29:52 2016 M> New Revision: 307650 M> URL: https://svnweb.freebsd.org/changeset/base/307650 M> M> Log: M> cache: split negative entry LRU into multiple lists M> M> This splits the ncneg_mtx lock while preserving the hit ratio at least M> during buildworld. M> M> Create N dedicated lists for new negative entries. M> M> Entries with at least one hit get promoted to the hot list, where they M> get requeued every M hits. M> M> Shrinking demotes one hot entry and performs a round-robin shrinking of M> regular lists. M> M> Reviewed by: kib This instapanics: panic: Assertion ncp->nc_flag & NCF_NEGATIVE failed at /usr/src/head/sys/kern/vfs_cache.c:815 -- Totus tuus, Glebius. ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307660 - head/usr.bin/jot
Author: cem Date: Wed Oct 19 21:50:57 2016 New Revision: 307660 URL: https://svnweb.freebsd.org/changeset/base/307660 Log: Capsicum support for jot(1) Limit descriptors and enter capability mode in jot(1). Submitted by: brueffer (earlier version) Reviewed by: emaste, jonathan (earlier version) Sponsored by: Dell EMC Isilon Differential Revision:https://reviews.freebsd.org/D1345 Modified: head/usr.bin/jot/jot.c Modified: head/usr.bin/jot/jot.c == --- head/usr.bin/jot/jot.c Wed Oct 19 21:25:59 2016(r307659) +++ head/usr.bin/jot/jot.c Wed Oct 19 21:50:57 2016(r307660) @@ -47,8 +47,11 @@ __FBSDID("$FreeBSD$"); * Author: John Kunze, Office of Comp. Affairs, UCB */ +#include +#include #include #include +#include #include #include #include @@ -89,6 +92,7 @@ static void usage(void); int main(int argc, char **argv) { + cap_rights_t rights; boolhave_format = false; boolinfinity = false; boolnofinalnl = false; @@ -105,6 +109,21 @@ main(int argc, char **argv) longi; longreps = REPS_DEF; + if (caph_limit_stdio() < 0) + err(1, "unable to limit rights for stdio"); + cap_rights_init(); + if (cap_rights_limit(STDIN_FILENO, ) < 0 && errno != ENOSYS) + err(1, "unable to limit rights for stdin"); + + /* +* Cache NLS data, for strerror, for err(3), before entering capability +* mode. +*/ + caph_cache_catpages(); + + if (cap_enter() < 0 && errno != ENOSYS) + err(1, "unable to enter capability mode"); + while ((ch = getopt(argc, argv, "b:cnp:rs:w:")) != -1) switch (ch) { case 'b': ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307659 - head/gnu/usr.bin
> On Oct 19, 2016, at 5:25 PM, Ed Mastewrote: > > Author: emaste > Date: Wed Oct 19 21:25:59 2016 > New Revision: 307659 > URL: https://svnweb.freebsd.org/changeset/base/307659 > > Log: > Switch gnu/usr.bin/Makefile to SUBDIR.${MK_*} optional subdir style This seems to have broken buildworld with WITHOUT_GPL_DTC=y in src.conf . Matteo ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307659 - head/gnu/usr.bin
Author: emaste Date: Wed Oct 19 21:25:59 2016 New Revision: 307659 URL: https://svnweb.freebsd.org/changeset/base/307659 Log: Switch gnu/usr.bin/Makefile to SUBDIR.${MK_*} optional subdir style Modified: head/gnu/usr.bin/Makefile Modified: head/gnu/usr.bin/Makefile == --- head/gnu/usr.bin/Makefile Wed Oct 19 21:07:17 2016(r307658) +++ head/gnu/usr.bin/Makefile Wed Oct 19 21:25:59 2016(r307659) @@ -2,48 +2,27 @@ .include -SUBDIR= ${_binutils} \ - ${_cc} \ - diff \ +SUBDIR= diff \ diff3 \ - ${_dtc} \ - ${_gdb} \ - ${_gperf} \ - grep \ - ${_groff} \ - ${_tests} + grep SUBDIR_DEPEND_gdb= ${_binutils} .if ${MK_CXX} != "no" -.if ${MK_GCC} != "no" -_gperf=gperf -.endif -.if ${MK_GROFF} != "no" -_groff=groff -.endif +SUBDIR.${MK_GCC}+= gperf +SUBDIR.${MK_GROFF}+= groff .endif -.if ${MK_GPL_DTC} != "no" -_dtc= dtc -.endif - -.if ${MK_TESTS} != "no" -_tests=tests -.endif +SUBDIR.${MK_BINUTILS}+=binutils +SUBDIR.${MK_DIALOG}+= dialog .if ${MK_BINUTILS} != "no" -_binutils= binutils -.if ${MK_GDB} != "no" -_gdb= gdb -.endif +SUBDIR.${MK_GDB}+= gdb .endif -.if ${MK_GCC} != "no" -_cc= cc -.endif - -SUBDIR.${MK_DIALOG}+= dialog +SUBDIR.${MK_GCC}+= cc +SUBDIR.${MK_GPL_DTC}+= dtc +SUBDIR.${MK_TESTS}+= tests SUBDIR_PARALLEL= ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307658 - head/sbin/md5
Author: emaste Date: Wed Oct 19 21:07:17 2016 New Revision: 307658 URL: https://svnweb.freebsd.org/changeset/base/307658 Log: md5: enter capability on last fd or when acting as a filter Reviewed by: allanjude, cem MFC after:2 months Sponsored by: The FreeBSD Foundation Differential Revision:https://reviews.freebsd.org/D8271 Modified: head/sbin/md5/md5.c Modified: head/sbin/md5/md5.c == --- head/sbin/md5/md5.c Wed Oct 19 21:01:24 2016(r307657) +++ head/sbin/md5/md5.c Wed Oct 19 21:07:17 2016(r307658) @@ -21,8 +21,10 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include +#include #include #include #include @@ -74,7 +76,7 @@ typedef struct Algorithm_t { DIGEST_Update *Update; DIGEST_End *End; char *(*Data)(const void *, unsigned int, char *); - char *(*File)(const char *, char *); + char *(*Fd)(int, char *); } Algorithm_t; static void MD5_Update(MD5_CTX *, const unsigned char *, size_t); @@ -106,34 +108,34 @@ typedef union { static const struct Algorithm_t Algorithm[] = { { "md5", "MD5", , (DIGEST_Init*), (DIGEST_Update*)_Update, (DIGEST_End*), - , }, + , }, { "sha1", "SHA1", _TestOutput, (DIGEST_Init*)_Init, (DIGEST_Update*)_Update, (DIGEST_End*)_End, - _Data, _File }, + _Data, _Fd }, { "sha256", "SHA256", _TestOutput, (DIGEST_Init*)_Init, (DIGEST_Update*)_Update, (DIGEST_End*)_End, - _Data, _File }, + _Data, _Fd }, { "sha384", "SHA384", _TestOutput, (DIGEST_Init*)_Init, (DIGEST_Update*)_Update, (DIGEST_End*)_End, - _Data, _File }, + _Data, _Fd }, { "sha512", "SHA512", _TestOutput, (DIGEST_Init*)_Init, (DIGEST_Update*)_Update, (DIGEST_End*)_End, - _Data, _File }, + _Data, _Fd }, { "sha512t256", "SHA512t256", _TestOutput, (DIGEST_Init*)_256_Init, (DIGEST_Update*)_256_Update, (DIGEST_End*)_256_End, - _256_Data, _256_File }, + _256_Data, _256_Fd }, { "rmd160", "RMD160", _TestOutput, (DIGEST_Init*)_Init, (DIGEST_Update*)_Update, - (DIGEST_End*)_End, _Data, _File }, + (DIGEST_End*)_End, _Data, _Fd }, { "skein256", "Skein256", _TestOutput, (DIGEST_Init*)_Init, (DIGEST_Update*)_Update, - (DIGEST_End*)_End, _Data, _File }, + (DIGEST_End*)_End, _Data, _Fd }, { "skein512", "Skein512", _TestOutput, (DIGEST_Init*)_Init, (DIGEST_Update*)_Update, - (DIGEST_End*)_End, _Data, _File }, + (DIGEST_End*)_End, _Data, _Fd }, { "skein1024", "Skein1024", _TestOutput, (DIGEST_Init*)_Init, (DIGEST_Update*)_Update, - (DIGEST_End*)_End, _Data, _File } + (DIGEST_End*)_End, _Data, _Fd } }; static void @@ -154,7 +156,8 @@ Arguments (may be any combination): int main(int argc, char *argv[]) { - int ch; + cap_rights_trights; + int ch, fd; char *p; charbuf[HEX_DIGEST_LENGTH]; int failed; @@ -206,10 +209,30 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if (caph_limit_stdout() < 0 || caph_limit_stderr() < 0) + err(1, "unable to limit rights for stdio"); + if (*argv) { do { - p = Algorithm[digest].File(*argv, buf); - if (!p) { + if ((fd = open(*argv, O_RDONLY)) < 0) { + warn("%s", *argv); + failed++; + continue; + } + /* +* XXX Enter capability mode on the last argv file. +* When a casper file service or other approach is +* available, switch to that and enter capability mode +* earlier. +*/ + if (*(argv + 1) == NULL) { + cap_rights_init(, CAP_READ); + if ((cap_rights_limit(fd, ) < 0 && + errno != ENOSYS) || + (cap_enter() < 0 && errno != ENOSYS)) + err(1, "capsicum"); + } + if ((p = Algorithm[digest].Fd(fd, buf)) == NULL) { warn("%s", *argv); failed++; } else { @@ -229,8 +252,12 @@ main(int argc, char *argv[]) printf("\n");
svn commit: r307657 - head/sys/kern
Author: sbruno Date: Wed Oct 19 21:01:24 2016 New Revision: 307657 URL: https://svnweb.freebsd.org/changeset/base/307657 Log: Resolve whitespace diff to NextBSD. Check to see that the taskqueue thread count requires us to acutally iterate over the thread count to bind to cpus. Submitted by: mm...@nextbsd.org Modified: head/sys/kern/subr_gtaskqueue.c Modified: head/sys/kern/subr_gtaskqueue.c == --- head/sys/kern/subr_gtaskqueue.c Wed Oct 19 20:56:21 2016 (r307656) +++ head/sys/kern/subr_gtaskqueue.c Wed Oct 19 21:01:24 2016 (r307657) @@ -52,7 +52,6 @@ static MALLOC_DEFINE(M_GTASKQUEUE, "task static voidgtaskqueue_thread_enqueue(void *); static voidgtaskqueue_thread_loop(void *arg); - struct gtaskqueue_busy { struct gtask*tb_running; TAILQ_ENTRY(gtaskqueue_busy) tb_link; @@ -655,11 +654,11 @@ taskqgroup_attach_deferred(struct taskqg if (gtask->gt_irq != -1) { mtx_unlock(>tqg_lock); - CPU_ZERO(); - CPU_SET(cpu, ); - intr_setaffinity(gtask->gt_irq, ); + CPU_ZERO(); + CPU_SET(cpu, ); + intr_setaffinity(gtask->gt_irq, ); - mtx_lock(>tqg_lock); + mtx_lock(>tqg_lock); } qgroup->tqg_queue[qid].tgc_cnt++; @@ -789,6 +788,9 @@ taskqgroup_bind(struct taskqgroup *qgrou * Bind taskqueue threads to specific CPUs, if they have been assigned * one. */ + if (qgroup->tqg_cnt == 1) + return; + for (i = 0; i < qgroup->tqg_cnt; i++) { gtask = malloc(sizeof (*gtask), M_DEVBUF, M_WAITOK); GTASK_INIT(>bt_task, 0, 0, taskqgroup_binder, gtask); @@ -855,7 +857,6 @@ _taskqgroup_adjust(struct taskqgroup *qg LIST_INSERT_HEAD(_head, gtask, gt_list); } } - mtx_unlock(>tqg_lock); while ((gtask = LIST_FIRST(_head))) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307656 - head/gnu/lib
Author: emaste Date: Wed Oct 19 20:56:21 2016 New Revision: 307656 URL: https://svnweb.freebsd.org/changeset/base/307656 Log: Put each SUBDIR on a separate line for ease of maintenance Additional patches to this file are in progress, and having each SUBDIR entry on a separate line makes it easier to change the order in which the patches are reviewed, tested, and applied. Modified: head/gnu/lib/Makefile Modified: head/gnu/lib/Makefile == --- head/gnu/lib/Makefile Wed Oct 19 19:57:36 2016(r307655) +++ head/gnu/lib/Makefile Wed Oct 19 20:56:21 2016(r307656) @@ -2,7 +2,9 @@ .include -SUBDIR= csu libgcc libregex +SUBDIR=csu +SUBDIR+= libgcc +SUBDIR+= libregex SUBDIR.${MK_DIALOG}+= libdialog SUBDIR.${MK_GCC}+= libgcov libgomp ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307394 - in head: share/man/man4 sys/conf sys/dev/netmap sys/modules/netmap sys/net tools/tools/netmap
On Wed, Oct 19, 2016 at 12:23:24PM -0400, Shawn Webb wrote: > On Sun, Oct 16, 2016 at 02:13:32PM +, Luigi Rizzo wrote: > > Author: luigi > > Date: Sun Oct 16 14:13:32 2016 > > New Revision: 307394 > > URL: https://svnweb.freebsd.org/changeset/base/307394 > > > > Log: > > Import the current version of netmap, aligned with the one on github. > > > > This commit, long overdue, contains contributions in the last 2 years > > from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, including: > > + fixes on monitor ports > > + the 'ptnet' virtual device driver, and ptnetmap backend, for > > high speed virtual passthrough on VMs (bhyve fixes in an upcoming > > commit) > > + improved emulated netmap mode > > + more robust error handling > > + removal of stale code > > + various fixes to code and documentation (some mixup between RX and TX > > parameters, and private and public variables) > > > > We also include an additional tool, nmreplay, which is functionally > > equivalent to tcpreplay but operating on netmap ports. > > > > Added: > > head/tools/tools/netmap/ctrs.h (contents, props changed) > > head/tools/tools/netmap/nmreplay.8 (contents, props changed) > > head/tools/tools/netmap/nmreplay.c (contents, props changed) > > Modified: > > head/share/man/man4/netmap.4 > > head/sys/conf/files > > head/sys/dev/netmap/if_ixl_netmap.h > > head/sys/dev/netmap/if_lem_netmap.h > > head/sys/dev/netmap/ixgbe_netmap.h > > head/sys/dev/netmap/netmap.c > > head/sys/dev/netmap/netmap_freebsd.c > > head/sys/dev/netmap/netmap_generic.c > > head/sys/dev/netmap/netmap_kern.h > > head/sys/dev/netmap/netmap_mbq.c > > head/sys/dev/netmap/netmap_mbq.h > > head/sys/dev/netmap/netmap_mem2.c > > head/sys/dev/netmap/netmap_mem2.h > > head/sys/dev/netmap/netmap_monitor.c > > head/sys/dev/netmap/netmap_offloadings.c > > head/sys/dev/netmap/netmap_pipe.c > > head/sys/dev/netmap/netmap_vale.c > > head/sys/modules/netmap/Makefile > > head/sys/net/netmap.h > > head/sys/net/netmap_user.h > > head/tools/tools/netmap/Makefile > > head/tools/tools/netmap/bridge.c > > head/tools/tools/netmap/pkt-gen.c > > head/tools/tools/netmap/vale-ctl.c > > Looks like this broke VIMAGE builds: > > /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclared > identifier 'rd' > CURVNET_SET(TD_TO_VNET(rd)); >^ > /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclared > identifier 'rd' > /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclared > identifier 'rd' > /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclared > identifier 'rd' > 4 errors generated. > --- netmap_freebsd.o --- > *** [netmap_freebsd.o] Error code 1 The attached patch fixes the build. In case it doesn't make it to the list, it's also posted here: http://ix.io/1xFU Thanks, -- Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE diff --git a/sys/dev/netmap/netmap_freebsd.c b/sys/dev/netmap/netmap_freebsd.c index 50e2d0f..a3ad322 100644 --- a/sys/dev/netmap/netmap_freebsd.c +++ b/sys/dev/netmap/netmap_freebsd.c @@ -48,6 +48,7 @@ #include +#include #include #include /* sockaddrs */ #include @@ -1407,7 +1408,7 @@ freebsd_netmap_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, int error; struct netmap_priv_d *priv; - CURVNET_SET(TD_TO_VNET(rd)); + CURVNET_SET(TD_TO_VNET(td)); error = devfs_get_cdevpriv((void **)); if (error) { /* XXX ENOENT should be impossible, since the priv signature.asc Description: PGP signature
Re: svn commit: r307469 - head/etc
On Mon, Oct 17, 2016 at 04:07:13AM +, Warner Losh wrote: > Author: imp > Date: Mon Oct 17 04:07:13 2016 > New Revision: 307469 > URL: https://svnweb.freebsd.org/changeset/base/307469 > Log: > Allow root_rw_mount to be both lower and upper case. Before, if it was > upper case, you'd wind up with a read-only filesystem when you should > sometimes. > PR: 213549 > Modified: > head/etc/rc > Modified: head/etc/rc > == > --- head/etc/rc Mon Oct 17 04:07:12 2016(r307468) > +++ head/etc/rc Mon Oct 17 04:07:13 2016(r307469) > @@ -135,16 +135,16 @@ done > # Note: this assumes firstboot_sentinel is on / when we have > # a read-only /, or that it is on media that's writable. > if [ -e ${firstboot_sentinel} ]; then > - [ ${root_rw_mount} = "yes" ] || mount -uw / > + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -uw / > chflags -R 0 ${firstboot_sentinel} > rm -rf ${firstboot_sentinel} > if [ -e ${firstboot_sentinel}-reboot ]; then > chflags -R 0 ${firstboot_sentinel}-reboot > rm -rf ${firstboot_sentinel}-reboot > - [ ${root_rw_mount} = "yes" ] || mount -ur / > + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur / > kill -INT 1 > fi > - [ ${root_rw_mount} = "yes" ] || mount -ur / > + [ ${root_rw_mount#[Yy][Ee][Ss]} = "" ] || mount -ur / > fi > > echo '' Although I have not tested this, it looks like this will always do the remounts since the condition is either false or invalid due to missing quotes. Perhaps we can use the checkyesno function from rc.subr or use the same check that rc.d/root uses (case statement where [Nn][Oo] and the empty string are no and the rest is yes). -- Jilles Tjoelker ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307655 - head/share/mk
Author: emaste Date: Wed Oct 19 19:57:36 2016 New Revision: 307655 URL: https://svnweb.freebsd.org/changeset/base/307655 Log: Force MK_GDB to no if MK_BINUTILS == no This is currently encoded in conditional blocks in gnu/lib/Makefile and gnu/usr.bin/Makefile. Set it via src.opts.mk to make GDB's dependency on binutils more clear. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk == --- head/share/mk/src.opts.mk Wed Oct 19 19:50:09 2016(r307654) +++ head/share/mk/src.opts.mk Wed Oct 19 19:57:36 2016(r307655) @@ -300,6 +300,10 @@ MK_${var}:=no MK_LLVM_LIBUNWIND:=no .endif +.if ${MK_BINUTILS} == "no" +MK_GDB:= no +.endif + .if ${MK_LIBPTHREAD} == "no" MK_LIBTHR:=no .endif ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307654 - head/sys/vm
Author: glebius Date: Wed Oct 19 19:50:09 2016 New Revision: 307654 URL: https://svnweb.freebsd.org/changeset/base/307654 Log: Fix incorrect assertion that could miss overflows. Reviewed by: kib Modified: head/sys/vm/vnode_pager.c Modified: head/sys/vm/vnode_pager.c == --- head/sys/vm/vnode_pager.c Wed Oct 19 19:42:01 2016(r307653) +++ head/sys/vm/vnode_pager.c Wed Oct 19 19:50:09 2016(r307654) @@ -953,7 +953,7 @@ vnode_pager_generic_getpages(struct vnod if (a_rahead) *a_rahead = bp->b_pgafter; - KASSERT(bp->b_npages <= sizeof(bp->b_pages), + KASSERT(bp->b_npages <= nitems(bp->b_pages), ("%s: buf %p overflowed", __func__, bp)); /* ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307653 - in head/sys: kern x86/x86
Author: mjg Date: Wed Oct 19 19:42:01 2016 New Revision: 307653 URL: https://svnweb.freebsd.org/changeset/base/307653 Log: Mark a bunch of mpsafe sysctls as such. This gives me a sysctl Giant-free buildworld. Modified: head/sys/kern/kern_exec.c head/sys/kern/kern_mib.c head/sys/x86/x86/identcpu.c Modified: head/sys/kern/kern_exec.c == --- head/sys/kern/kern_exec.c Wed Oct 19 19:32:06 2016(r307652) +++ head/sys/kern/kern_exec.c Wed Oct 19 19:42:01 2016(r307653) @@ -118,14 +118,14 @@ static int do_execve(struct thread *td, struct mac *mac_p); /* XXX This should be vm_size_t. */ -SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD, -NULL, 0, sysctl_kern_ps_strings, "LU", ""); +SYSCTL_PROC(_kern, KERN_PS_STRINGS, ps_strings, CTLTYPE_ULONG|CTLFLAG_RD| +CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_ps_strings, "LU", ""); /* XXX This should be vm_size_t. */ SYSCTL_PROC(_kern, KERN_USRSTACK, usrstack, CTLTYPE_ULONG|CTLFLAG_RD| -CTLFLAG_CAPRD, NULL, 0, sysctl_kern_usrstack, "LU", ""); +CTLFLAG_CAPRD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_usrstack, "LU", ""); -SYSCTL_PROC(_kern, OID_AUTO, stackprot, CTLTYPE_INT|CTLFLAG_RD, +SYSCTL_PROC(_kern, OID_AUTO, stackprot, CTLTYPE_INT|CTLFLAG_RD|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_stackprot, "I", ""); u_long ps_arg_cache_limit = PAGE_SIZE / 16; Modified: head/sys/kern/kern_mib.c == --- head/sys/kern/kern_mib.cWed Oct 19 19:32:06 2016(r307652) +++ head/sys/kern/kern_mib.cWed Oct 19 19:42:01 2016(r307653) @@ -135,7 +135,7 @@ SYSCTL_INT(_kern, KERN_SAVED_IDS, saved_ char kernelname[MAXPATHLEN] = "/kernel"; /* XXX bloat */ -SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW, +SYSCTL_STRING(_kern, KERN_BOOTFILE, bootfile, CTLFLAG_RW | CTLFLAG_MPSAFE, kernelname, sizeof kernelname, "Name of kernel file booted"); SYSCTL_INT(_kern, KERN_MAXPHYS, maxphys, CTLFLAG_RD | CTLFLAG_CAPRD, @@ -257,8 +257,9 @@ sysctl_hw_machine_arch(SYSCTL_HANDLER_AR return (error); } -SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD, -NULL, 0, sysctl_hw_machine_arch, "A", "System architecture"); +SYSCTL_PROC(_hw, HW_MACHINE_ARCH, machine_arch, CTLTYPE_STRING | CTLFLAG_RD | +CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine_arch, "A", +"System architecture"); SYSCTL_STRING(_kern, OID_AUTO, supported_archs, CTLFLAG_RD | CTLFLAG_MPSAFE, #ifdef COMPAT_FREEBSD32 @@ -386,8 +387,8 @@ SYSCTL_PROC(_kern, KERN_SECURELVL, secur /* Actual kernel configuration options. */ extern char kernconfstring[]; -SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD, kernconfstring, 0, -"Kernel configuration file"); +SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD | CTLFLAG_MPSAFE, +kernconfstring, 0, "Kernel configuration file"); #endif static int Modified: head/sys/x86/x86/identcpu.c == --- head/sys/x86/x86/identcpu.c Wed Oct 19 19:32:06 2016(r307652) +++ head/sys/x86/x86/identcpu.c Wed Oct 19 19:42:01 2016(r307653) @@ -148,15 +148,15 @@ sysctl_hw_machine(SYSCTL_HANDLER_ARGS) return (error); } -SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD, -NULL, 0, sysctl_hw_machine, "A", "Machine class"); +SYSCTL_PROC(_hw, HW_MACHINE, machine, CTLTYPE_STRING | CTLFLAG_RD | +CTLFLAG_MPSAFE, NULL, 0, sysctl_hw_machine, "A", "Machine class"); #else SYSCTL_STRING(_hw, HW_MACHINE, machine, CTLFLAG_RD, machine, 0, "Machine class"); #endif static char cpu_model[128]; -SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD, +SYSCTL_STRING(_hw, HW_MODEL, model, CTLFLAG_RD | CTLFLAG_MPSAFE, cpu_model, 0, "Machine model"); static int hw_clockrate; @@ -165,8 +165,8 @@ SYSCTL_INT(_hw, OID_AUTO, clockrate, CTL u_int hv_high; char hv_vendor[16]; -SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD, hv_vendor, 0, -"Hypervisor vendor"); +SYSCTL_STRING(_hw, OID_AUTO, hv_vendor, CTLFLAG_RD | CTLFLAG_MPSAFE, hv_vendor, +0, "Hypervisor vendor"); static eventhandler_tag tsc_post_tag; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307652 - head/gnu/lib
Author: emaste Date: Wed Oct 19 19:32:06 2016 New Revision: 307652 URL: https://svnweb.freebsd.org/changeset/base/307652 Log: Switch gnu/lib/Makefile to SUBDIR.${MK_*} optional subdir style Compound conditions are left unchanged Modified: head/gnu/lib/Makefile Modified: head/gnu/lib/Makefile == --- head/gnu/lib/Makefile Wed Oct 19 18:45:06 2016(r307651) +++ head/gnu/lib/Makefile Wed Oct 19 19:32:06 2016(r307652) @@ -5,18 +5,9 @@ SUBDIR= csu libgcc libregex SUBDIR.${MK_DIALOG}+= libdialog - -.if ${MK_GCC} != "no" -SUBDIR+= libgcov libgomp -.endif - -.if ${MK_SSP} != "no" -SUBDIR+= libssp -.endif - -.if ${MK_TESTS} != "no" -SUBDIR+= tests -.endif +SUBDIR.${MK_GCC}+= libgcov libgomp +SUBDIR.${MK_SSP}+= libssp +SUBDIR.${MK_TESTS}+= tests .if ${MK_BINUTILS} != "no" && ${MK_GDB} != "no" SUBDIR+= libreadline ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307651 - head/sys/dev/sound/usb
Author: hselasky Date: Wed Oct 19 18:45:06 2016 New Revision: 307651 URL: https://svnweb.freebsd.org/changeset/base/307651 Log: Add support for adjusting the hardware buffering delay for USB audio. Requested by: Goran MekicMFC after:1 week Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c == --- head/sys/dev/sound/usb/uaudio.c Wed Oct 19 18:29:52 2016 (r307650) +++ head/sys/dev/sound/usb/uaudio.c Wed Oct 19 18:45:06 2016 (r307651) @@ -95,6 +95,7 @@ __FBSDID("$FreeBSD$"); static int uaudio_default_rate = 0;/* use rate list */ static int uaudio_default_bits = 32; static int uaudio_default_channels = 0;/* use default */ +static int uaudio_buffer_ms = 8; #ifdef USB_DEBUG static int uaudio_debug = 0; @@ -109,9 +110,32 @@ SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, def _default_bits, 0, "uaudio default sample bits"); SYSCTL_INT(_hw_usb_uaudio, OID_AUTO, default_channels, CTLFLAG_RWTUN, _default_channels, 0, "uaudio default sample channels"); + +static int +uaudio_buffer_ms_sysctl(SYSCTL_HANDLER_ARGS) +{ + int err, val; + + val = uaudio_buffer_ms; + err = sysctl_handle_int(oidp, , 0, req); + + if (err != 0 || req->newptr == NULL || val == uaudio_buffer_ms) + return (err); + + if (val > 8) + val = 8; + else if (val < 2) + val = 2; + + uaudio_buffer_ms = val; + + return (0); +} +SYSCTL_PROC(_hw_usb_uaudio, OID_AUTO, buffer_ms, CTLTYPE_INT | CTLFLAG_RWTUN, +0, sizeof(int), uaudio_buffer_ms_sysctl, "I", +"uaudio buffering delay from 2ms to 8ms"); #endif -#defineUAUDIO_IRQS (8000 / UAUDIO_NFRAMES) /* interrupts per second */ #defineUAUDIO_NFRAMES 64 /* must be factor of 8 due HS-USB */ #defineUAUDIO_NCHANBUFS2 /* number of outstanding request */ #defineUAUDIO_RECURSE_LIMIT255 /* rounds */ @@ -1278,10 +1302,10 @@ uaudio_configure_msg_sub(struct uaudio_s if (fps < 8000) { /* FULL speed USB */ - frames = 8; + frames = uaudio_buffer_ms; } else { /* HIGH speed USB */ - frames = UAUDIO_NFRAMES; + frames = uaudio_buffer_ms * 8; } fps_shift = usbd_xfer_get_fps_shift(chan->xfer[0]); @@ -2158,8 +2182,9 @@ tr_setup: } /* start the SYNC transfer one time per second, if any */ - if (++(ch->intr_counter) >= UAUDIO_IRQS) { - ch->intr_counter = 0; + ch->intr_counter += ch->intr_frames; + if (ch->intr_counter >= ch->frames_per_second) { + ch->intr_counter -= ch->frames_per_second; usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307650 - head/sys/kern
Author: mjg Date: Wed Oct 19 18:29:52 2016 New Revision: 307650 URL: https://svnweb.freebsd.org/changeset/base/307650 Log: cache: split negative entry LRU into multiple lists This splits the ncneg_mtx lock while preserving the hit ratio at least during buildworld. Create N dedicated lists for new negative entries. Entries with at least one hit get promoted to the hot list, where they get requeued every M hits. Shrinking demotes one hot entry and performs a round-robin shrinking of regular lists. Reviewed by: kib Modified: head/sys/kern/vfs_cache.c Modified: head/sys/kern/vfs_cache.c == --- head/sys/kern/vfs_cache.c Wed Oct 19 18:15:44 2016(r307649) +++ head/sys/kern/vfs_cache.c Wed Oct 19 18:29:52 2016(r307650) @@ -84,8 +84,10 @@ SDT_PROBE_DEFINE1(vfs, namecache, purge_ SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *"); SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *", -"char *"); +SDT_PROBE_DEFINE3(vfs, namecache, zap_negative, done, "struct vnode *", +"char *", "int"); +SDT_PROBE_DEFINE3(vfs, namecache, shrink_negative, done, "struct vnode *", +"char *", "int"); /* * This structure describes the elements in the cache of recent @@ -97,7 +99,10 @@ struct namecache { LIST_ENTRY(namecache) nc_src; /* source vnode list */ TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ struct vnode *nc_dvp; /* vnode of parent of name */ - struct vnode *nc_vp; /* vnode the name refers to */ + union { + struct vnode *nu_vp; /* vnode the name refers to */ + u_int nu_neghits; /* negative entry hits */ + } n_un; u_char nc_flag;/* flag bits */ u_char nc_nlen;/* length of name */ charnc_name[0]; /* segment name + nul */ @@ -116,7 +121,10 @@ struct namecache_ts { LIST_ENTRY(namecache) nc_src; /* source vnode list */ TAILQ_ENTRY(namecache) nc_dst; /* destination vnode list */ struct vnode *nc_dvp; /* vnode of parent of name */ - struct vnode *nc_vp; /* vnode the name refers to */ + union { + struct vnode *nu_vp; /* vnode the name refers to */ + u_int nu_neghits; /* negative entry hits */ + } n_un; u_char nc_flag;/* flag bits */ u_char nc_nlen;/* length of name */ struct timespec nc_time; /* timespec provided by fs */ @@ -125,6 +133,9 @@ struct namecache_ts { charnc_name[0]; /* segment name + nul */ }; +#definenc_vp n_un.nu_vp +#definenc_neghits n_un.nu_neghits + /* * Flags in namecache.nc_flag */ @@ -133,6 +144,8 @@ struct namecache_ts { #defineNCF_TS 0x04 #defineNCF_DTS 0x08 #defineNCF_DVDROP 0x10 +#defineNCF_NEGATIVE0x20 +#defineNCF_HOTNEGATIVE 0x40 /* * Name caching works as follows: @@ -154,7 +167,7 @@ struct namecache_ts { * NAMETYPEROLE * vnodelock mtx vnode lists and v_cache_dd field protection * bucketlock rwlock for access to given set of hash buckets - * ncneg_mtx mtx negative entry LRU management + * neglist mtx negative entry LRU management * * Additionally, ncneg_shrink_lock mtx is used to have at most one thread * shrinking the LRU list. @@ -188,7 +201,6 @@ struct namecache_ts { #define NCHHASH(hash) \ ([(hash) & nchash]) static LIST_HEAD(nchashhead, namecache) *nchashtbl;/* Hash Table */ -static TAILQ_HEAD(, namecache) ncneg; /* Hash Table */ static u_long nchash; /* size of hash table */ SYSCTL_ULONG(_debug, OID_AUTO, nchash, CTLFLAG_RD, , 0, "Size of namecache hash table"); @@ -210,6 +222,9 @@ SYSCTL_UINT(_vfs, OID_AUTO, ncsizefactor static u_int ncpurgeminvnodes; SYSCTL_UINT(_vfs, OID_AUTO, ncpurgeminvnodes, CTLFLAG_RW, , 0, "Number of vnodes below which purgevfs ignores the request"); +static u_int ncneghitsrequeue = 8; +SYSCTL_UINT(_vfs, OID_AUTO, ncneghitsrequeue, CTLFLAG_RW, , 0, +"Number of hits to requeue a negative entry in the LRU list"); struct nchstatsnchstats; /* cache effectiveness statistics */ @@ -217,8 +232,23 @@ static struct mtx ncneg_shrink_loc MTX_SYSINIT(vfscache_shrink_neg, _shrink_lock, "Name Cache shrink neg", MTX_DEF); -static struct mtx_padalign ncneg_mtx; -MTX_SYSINIT(vfscache_neg, _mtx, "ncneg", MTX_DEF); +struct neglist { + struct mtx nl_lock; + TAILQ_HEAD(, namecache) nl_list; +} __aligned(CACHE_LINE_SIZE); +
svn commit: r307649 - head/sys/dev/e1000
Author: kib Date: Wed Oct 19 18:15:44 2016 New Revision: 307649 URL: https://svnweb.freebsd.org/changeset/base/307649 Log: Partial workaround for Intel PCI adapters reading past the end of the host-programmed DMA regions. This change seemingly fixes the descriptor fetches, but the packet memory accesses are left problematic. Reviewed by: emaste, erj, sbruno Sponsored by: The FreeBSD Foundation MFC after:2 weeks Differential revision:https://reviews.freebsd.org/D8282 Modified: head/sys/dev/e1000/if_lem.c Modified: head/sys/dev/e1000/if_lem.c == --- head/sys/dev/e1000/if_lem.c Wed Oct 19 17:42:45 2016(r307648) +++ head/sys/dev/e1000/if_lem.c Wed Oct 19 18:15:44 2016(r307649) @@ -543,8 +543,16 @@ lem_attach(device_t dev) */ adapter->hw.mac.report_tx_early = 1; - tsize = roundup2(adapter->num_tx_desc * sizeof(struct e1000_tx_desc), - EM_DBA_ALIGN); + /* +* It seems that the descriptor DMA engine on some PCI cards +* fetches memory past the end of the last descriptor in the +* ring. These reads are problematic when VT-d (DMAR) busdma +* is used. Allocate the scratch space to avoid getting +* faults from DMAR, by requesting scratch memory for one more +* descriptor. +*/ + tsize = roundup2((adapter->num_tx_desc + 1) * + sizeof(struct e1000_tx_desc), EM_DBA_ALIGN); /* Allocate Transmit Descriptor ring */ if (lem_dma_malloc(adapter, tsize, >txdma, BUS_DMA_NOWAIT)) { @@ -555,8 +563,11 @@ lem_attach(device_t dev) adapter->tx_desc_base = (struct e1000_tx_desc *)adapter->txdma.dma_vaddr; - rsize = roundup2(adapter->num_rx_desc * sizeof(struct e1000_rx_desc), - EM_DBA_ALIGN); + /* +* See comment above txdma allocation for rationale behind +1. +*/ + rsize = roundup2((adapter->num_rx_desc + 1) * + sizeof(struct e1000_rx_desc), EM_DBA_ALIGN); /* Allocate Receive Descriptor ring */ if (lem_dma_malloc(adapter, rsize, >rxdma, BUS_DMA_NOWAIT)) { ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307326 - head/sys/boot/efi/loader
On Wednesday, October 19, 2016 02:01:18 AM Warner Losh wrote: > One of my systems would export these as sysctls: > > smbios.bios.reldate="07/05/2013" > smbios.bios.vendor="American Megatrends Inc." > smbios.bios.version="3.00" > smbios.chassis.maker="Supermicro" > smbios.chassis.serial="0123456789" > smbios.chassis.tag="To Be Filled By O.E.M." > smbios.chassis.version="0123456789" > smbios.memory.enabled="268435456" > smbios.planar.location="To be filled by O.E.M." > smbios.planar.maker="Supermicro" > smbios.planar.product="X9SRH-7F/7TF" > smbios.planar.serial="VM13CS028237" > smbios.planar.tag="To be filled by O.E.M." > smbios.planar.version="0123456789" > smbios.socket.enabled="1" > smbios.socket.populated="1" > smbios.system.family="To be filled by O.E.M." > smbios.system.maker="Supermicro" > smbios.system.product="X9SRH-7F/7TF" > smbios.system.serial="0123456789" > smbios.system.sku="To be filled by O.E.M." > smbios.system.uuid="----002590e4d0ec" > smbios.system.version="0123456789" > smbios.version="2.7" > > though some of them are silly due to the BIOS writer being silly... So are you planning to just duplicate the existing kenv vars as sysctl nodes? Can't you parse the output of kenv instead? -- John Baldwin ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307648 - head
> On Oct 19, 2016, at 10:42, Ed Mastewrote: > > Author: emaste > Date: Wed Oct 19 17:42:45 2016 > New Revision: 307648 > URL: https://svnweb.freebsd.org/changeset/base/307648 > > Log: > Fix MK_SHAREDOCS test from r306864 > > Groff is needed only if MK_GROFF and MK_SHAREDOCS are both true. Thank you!! -Ngie > Modified: > head/Makefile.inc1 > > Modified: head/Makefile.inc1 > == > --- head/Makefile.inc1Wed Oct 19 17:32:38 2016(r307647) > +++ head/Makefile.inc1Wed Oct 19 17:42:45 2016(r307648) > @@ -1586,7 +1586,7 @@ _strfile=usr.bin/fortune/strfile > _gperf=gnu/usr.bin/gperf > .endif > > -.if ${MK_SHAREDOCS} != "no" || ${MK_GROFF} != "no" > +.if ${MK_SHAREDOCS} != "no" && ${MK_GROFF} != "no" > _groff=gnu/usr.bin/groff \ >usr.bin/soelim > .endif > ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307648 - head
Author: emaste Date: Wed Oct 19 17:42:45 2016 New Revision: 307648 URL: https://svnweb.freebsd.org/changeset/base/307648 Log: Fix MK_SHAREDOCS test from r306864 Groff is needed only if MK_GROFF and MK_SHAREDOCS are both true. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Wed Oct 19 17:32:38 2016(r307647) +++ head/Makefile.inc1 Wed Oct 19 17:42:45 2016(r307648) @@ -1586,7 +1586,7 @@ _strfile= usr.bin/fortune/strfile _gperf=gnu/usr.bin/gperf .endif -.if ${MK_SHAREDOCS} != "no" || ${MK_GROFF} != "no" +.if ${MK_SHAREDOCS} != "no" && ${MK_GROFF} != "no" _groff=gnu/usr.bin/groff \ usr.bin/soelim .endif ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307647 - stable/11/usr.sbin/rtsold
Author: markj Date: Wed Oct 19 17:32:38 2016 New Revision: 307647 URL: https://svnweb.freebsd.org/changeset/base/307647 Log: MFC r306571: rtsold: Log messages about unexpected RAs at LOG_DEBUG. Modified: stable/11/usr.sbin/rtsold/rtsol.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/rtsold/rtsol.c == --- stable/11/usr.sbin/rtsold/rtsol.c Wed Oct 19 17:31:59 2016 (r307646) +++ stable/11/usr.sbin/rtsold/rtsol.c Wed Oct 19 17:32:38 2016 (r307647) @@ -347,7 +347,7 @@ rtsol_input(int s) /* xxx: more validation? */ if ((ifi = find_ifinfo(pi->ipi6_ifindex)) == NULL) { - warnmsg(LOG_INFO, __func__, + warnmsg(LOG_DEBUG, __func__, "received RA from %s on an unexpected IF(%s)", inet_ntop(AF_INET6, _addr, ntopbuf, sizeof(ntopbuf)), ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307646 - stable/10/usr.sbin/rtsold
Author: markj Date: Wed Oct 19 17:31:59 2016 New Revision: 307646 URL: https://svnweb.freebsd.org/changeset/base/307646 Log: MFC r306571: rtsold: Log messages about unexpected RAs at LOG_DEBUG. Modified: stable/10/usr.sbin/rtsold/rtsol.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/rtsold/rtsol.c == --- stable/10/usr.sbin/rtsold/rtsol.c Wed Oct 19 17:24:36 2016 (r307645) +++ stable/10/usr.sbin/rtsold/rtsol.c Wed Oct 19 17:31:59 2016 (r307646) @@ -347,7 +347,7 @@ rtsol_input(int s) /* xxx: more validation? */ if ((ifi = find_ifinfo(pi->ipi6_ifindex)) == NULL) { - warnmsg(LOG_INFO, __func__, + warnmsg(LOG_DEBUG, __func__, "received RA from %s on an unexpected IF(%s)", inet_ntop(AF_INET6, _addr, ntopbuf, sizeof(ntopbuf)), ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307645 - stable/11/sys/geom/mirror
Author: markj Date: Wed Oct 19 17:24:36 2016 New Revision: 307645 URL: https://svnweb.freebsd.org/changeset/base/307645 Log: MFC r306742: gmirror: Use bool instead of boolean_t. Modified: stable/11/sys/geom/mirror/g_mirror.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/geom/mirror/g_mirror.c == --- stable/11/sys/geom/mirror/g_mirror.cWed Oct 19 17:23:50 2016 (r307644) +++ stable/11/sys/geom/mirror/g_mirror.cWed Oct 19 17:24:36 2016 (r307645) @@ -99,7 +99,7 @@ struct g_class g_mirror_class = { static void g_mirror_destroy_provider(struct g_mirror_softc *sc); static int g_mirror_update_disk(struct g_mirror_disk *disk, u_int state); -static void g_mirror_update_device(struct g_mirror_softc *sc, boolean_t force); +static void g_mirror_update_device(struct g_mirror_softc *sc, bool force); static void g_mirror_dumpconf(struct sbuf *sb, const char *indent, struct g_geom *gp, struct g_consumer *cp, struct g_provider *pp); static void g_mirror_sync_stop(struct g_mirror_disk *disk, int type); @@ -1822,7 +1822,7 @@ g_mirror_worker(void *arg) "Running event for device %s.", sc->sc_name); ep->e_error = 0; - g_mirror_update_device(sc, 1); + g_mirror_update_device(sc, true); } else { /* Update disk status. */ G_MIRROR_DEBUG(3, "Running event for disk %s.", @@ -1830,7 +1830,7 @@ g_mirror_worker(void *arg) ep->e_error = g_mirror_update_disk(ep->e_disk, ep->e_state); if (ep->e_error == 0) - g_mirror_update_device(sc, 0); + g_mirror_update_device(sc, false); } if ((ep->e_flags & G_MIRROR_EVENT_DONTWAIT) != 0) { KASSERT(ep->e_error == 0, @@ -2228,7 +2228,7 @@ g_mirror_determine_state(struct g_mirror * Update device state. */ static void -g_mirror_update_device(struct g_mirror_softc *sc, boolean_t force) +g_mirror_update_device(struct g_mirror_softc *sc, bool force) { struct g_mirror_disk *disk; u_int state; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307644 - stable/11/sys/netinet6
Author: markj Date: Wed Oct 19 17:23:50 2016 New Revision: 307644 URL: https://svnweb.freebsd.org/changeset/base/307644 Log: MFC r306792-r306795, r306826, r306828: Miscellaneous ND6 code cleanups. Modified: stable/11/sys/netinet6/nd6.c stable/11/sys/netinet6/nd6_rtr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet6/nd6.c == --- stable/11/sys/netinet6/nd6.cWed Oct 19 17:21:39 2016 (r307643) +++ stable/11/sys/netinet6/nd6.cWed Oct 19 17:23:50 2016 (r307644) @@ -1227,7 +1227,7 @@ nd6_is_new_addr_neighbor(const struct so struct ifaddr *dstaddr; struct rt_addrinfo info; struct sockaddr_in6 rt_key; - struct sockaddr *dst6; + const struct sockaddr *dst6; int fibnum; /* @@ -1273,7 +1273,7 @@ nd6_is_new_addr_neighbor(const struct so if (!(pr->ndpr_stateflags & NDPRF_ONLINK)) { /* Always use the default FIB here. */ - dst6 = (struct sockaddr *)>ndpr_prefix; + dst6 = (const struct sockaddr *)>ndpr_prefix; /* Restore length field before retrying lookup */ rt_key.sin6_len = sizeof(rt_key); Modified: stable/11/sys/netinet6/nd6_rtr.c == --- stable/11/sys/netinet6/nd6_rtr.cWed Oct 19 17:21:39 2016 (r307643) +++ stable/11/sys/netinet6/nd6_rtr.cWed Oct 19 17:23:50 2016 (r307644) @@ -76,17 +76,16 @@ static int prelist_update(struct nd_pref struct mbuf *, int); static struct in6_ifaddr *in6_ifadd(struct nd_prefixctl *, int); static struct nd_pfxrouter *pfxrtr_lookup(struct nd_prefix *, - struct nd_defrouter *); +struct nd_defrouter *); static void pfxrtr_add(struct nd_prefix *, struct nd_defrouter *); static void pfxrtr_del(struct nd_pfxrouter *); -static struct nd_pfxrouter *find_pfxlist_reachable_router -(struct nd_prefix *); +static struct nd_pfxrouter *find_pfxlist_reachable_router(struct nd_prefix *); static void defrouter_delreq(struct nd_defrouter *); static void nd6_rtmsg(int, struct rtentry *); static int in6_init_prefix_ltimes(struct nd_prefix *); static void in6_init_address_ltimes(struct nd_prefix *, - struct in6_addrlifetime *); +struct in6_addrlifetime *); static int nd6_prefix_onlink(struct nd_prefix *); static int nd6_prefix_offlink(struct nd_prefix *); @@ -1432,7 +1431,7 @@ find_pfxlist_reachable_router(struct nd_ * we have moved from the network but the lifetime of the prefix has not * expired yet. So we should not use the prefix if there is another prefix * that has an available router. - * But, if there is no prefix that has an available router, we still regards + * But, if there is no prefix that has an available router, we still regard * all the prefixes as on-link. This is because we can't tell if all the * routers are simply dead or if we really moved from the network and there * is no router around us. @@ -1485,40 +1484,26 @@ pfxlist_onlink_check(void) */ LIST_FOREACH(pr, _nd_prefix, ndpr_entry) { /* XXX: a link-local prefix should never be detached */ - if (IN6_IS_ADDR_LINKLOCAL(>ndpr_prefix.sin6_addr)) - continue; - - /* -* we aren't interested in prefixes without the L bit -* set. -*/ - if (pr->ndpr_raf_onlink == 0) - continue; - - if (pr->ndpr_raf_auto == 0) + if (IN6_IS_ADDR_LINKLOCAL(>ndpr_prefix.sin6_addr) || + pr->ndpr_raf_onlink == 0 || + pr->ndpr_raf_auto == 0) continue; if ((pr->ndpr_stateflags & NDPRF_DETACHED) == 0 && find_pfxlist_reachable_router(pr) == NULL) pr->ndpr_stateflags |= NDPRF_DETACHED; - if ((pr->ndpr_stateflags & NDPRF_DETACHED) != 0 && + else if ((pr->ndpr_stateflags & NDPRF_DETACHED) != 0 && find_pfxlist_reachable_router(pr) != NULL) pr->ndpr_stateflags &= ~NDPRF_DETACHED; } } else { /* there is no prefix that has a reachable router */ LIST_FOREACH(pr, _nd_prefix, ndpr_entry) { - if (IN6_IS_ADDR_LINKLOCAL(>ndpr_prefix.sin6_addr)) + if (IN6_IS_ADDR_LINKLOCAL(>ndpr_prefix.sin6_addr) || + pr->ndpr_raf_onlink == 0 || + pr->ndpr_raf_auto == 0)
svn commit: r307643 - stable/11/usr.sbin/pmcstat
Author: markj Date: Wed Oct 19 17:21:39 2016 New Revision: 307643 URL: https://svnweb.freebsd.org/changeset/base/307643 Log: MFC r307384: Remove an unused field from struct pmcstat_image. Modified: stable/11/usr.sbin/pmcstat/pmcstat_log.h Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/pmcstat/pmcstat_log.h == --- stable/11/usr.sbin/pmcstat/pmcstat_log.hWed Oct 19 17:18:48 2016 (r307642) +++ stable/11/usr.sbin/pmcstat/pmcstat_log.hWed Oct 19 17:21:39 2016 (r307643) @@ -76,7 +76,6 @@ enum pmcstat_image_type { struct pmcstat_image { LIST_ENTRY(pmcstat_image) pi_next; /* hash link */ - TAILQ_ENTRY(pmcstat_image) pi_lru; /* LRU list */ pmcstat_interned_string pi_execpath;/* cookie */ pmcstat_interned_string pi_samplename; /* sample path name */ pmcstat_interned_string pi_fullpath;/* path to FS object */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307642 - stable/11/libexec/ypxfr
Author: markj Date: Wed Oct 19 17:18:48 2016 New Revision: 307642 URL: https://svnweb.freebsd.org/changeset/base/307642 Log: MFC r307398: Reference the libc symbols ypresp_{allfn,data} instead of local symbols. PR: 213506 Modified: stable/11/libexec/ypxfr/ypxfr_getmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/ypxfr/ypxfr_getmap.c == --- stable/11/libexec/ypxfr/ypxfr_getmap.c Wed Oct 19 16:40:38 2016 (r307641) +++ stable/11/libexec/ypxfr/ypxfr_getmap.c Wed Oct 19 17:18:48 2016 (r307642) @@ -43,8 +43,8 @@ __FBSDID("$FreeBSD$"); extern bool_t xdr_ypresp_all_seq(XDR *, unsigned long *); -static int (*ypresp_allfn)(); -static void *ypresp_data; +extern int (*ypresp_allfn)(); +extern void *ypresp_data; extern DB *specdbp; extern enum ypstat yp_errno; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307641 - stable/10/lib/libc/db/btree
Author: pfg Date: Wed Oct 19 16:40:38 2016 New Revision: 307641 URL: https://svnweb.freebsd.org/changeset/base/307641 Log: MFC r306332: btree(3): don't shortcut closing if the metadata is dirty. Obtained from:NetBSD (from krb5 tree) Modified: stable/10/lib/libc/db/btree/bt_close.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/db/btree/bt_close.c == --- stable/10/lib/libc/db/btree/bt_close.c Wed Oct 19 16:33:43 2016 (r307640) +++ stable/10/lib/libc/db/btree/bt_close.c Wed Oct 19 16:40:38 2016 (r307641) @@ -134,7 +134,8 @@ __bt_sync(const DB *dbp, u_int flags) return (RET_ERROR); } - if (F_ISSET(t, B_INMEM | B_RDONLY) || !F_ISSET(t, B_MODIFIED)) + if (F_ISSET(t, B_INMEM | B_RDONLY) || + !F_ISSET(t, B_MODIFIED | B_METADIRTY)) return (RET_SUCCESS); if (F_ISSET(t, B_METADIRTY) && bt_meta(t) == RET_ERROR) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307640 - stable/11/lib/libc/db/btree
Author: pfg Date: Wed Oct 19 16:33:43 2016 New Revision: 307640 URL: https://svnweb.freebsd.org/changeset/base/307640 Log: MFC r306332: btree(3): don't shortcut closing if the metadata is dirty. Obtained from:NetBSD (from krb5 tree) Modified: stable/11/lib/libc/db/btree/bt_close.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/db/btree/bt_close.c == --- stable/11/lib/libc/db/btree/bt_close.c Wed Oct 19 15:13:08 2016 (r307639) +++ stable/11/lib/libc/db/btree/bt_close.c Wed Oct 19 16:33:43 2016 (r307640) @@ -134,7 +134,8 @@ __bt_sync(const DB *dbp, u_int flags) return (RET_ERROR); } - if (F_ISSET(t, B_INMEM | B_RDONLY) || !F_ISSET(t, B_MODIFIED)) + if (F_ISSET(t, B_INMEM | B_RDONLY) || + !F_ISSET(t, B_MODIFIED | B_METADIRTY)) return (RET_SUCCESS); if (F_ISSET(t, B_METADIRTY) && bt_meta(t) == RET_ERROR) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
Re: svn commit: r307394 - in head: share/man/man4 sys/conf sys/dev/netmap sys/modules/netmap sys/net tools/tools/netmap
On Sun, Oct 16, 2016 at 02:13:32PM +, Luigi Rizzo wrote: > Author: luigi > Date: Sun Oct 16 14:13:32 2016 > New Revision: 307394 > URL: https://svnweb.freebsd.org/changeset/base/307394 > > Log: > Import the current version of netmap, aligned with the one on github. > > This commit, long overdue, contains contributions in the last 2 years > from Stefano Garzarella, Giuseppe Lettieri, Vincenzo Maffione, including: > + fixes on monitor ports > + the 'ptnet' virtual device driver, and ptnetmap backend, for > high speed virtual passthrough on VMs (bhyve fixes in an upcoming commit) > + improved emulated netmap mode > + more robust error handling > + removal of stale code > + various fixes to code and documentation (some mixup between RX and TX > parameters, and private and public variables) > > We also include an additional tool, nmreplay, which is functionally > equivalent to tcpreplay but operating on netmap ports. > > Added: > head/tools/tools/netmap/ctrs.h (contents, props changed) > head/tools/tools/netmap/nmreplay.8 (contents, props changed) > head/tools/tools/netmap/nmreplay.c (contents, props changed) > Modified: > head/share/man/man4/netmap.4 > head/sys/conf/files > head/sys/dev/netmap/if_ixl_netmap.h > head/sys/dev/netmap/if_lem_netmap.h > head/sys/dev/netmap/ixgbe_netmap.h > head/sys/dev/netmap/netmap.c > head/sys/dev/netmap/netmap_freebsd.c > head/sys/dev/netmap/netmap_generic.c > head/sys/dev/netmap/netmap_kern.h > head/sys/dev/netmap/netmap_mbq.c > head/sys/dev/netmap/netmap_mbq.h > head/sys/dev/netmap/netmap_mem2.c > head/sys/dev/netmap/netmap_mem2.h > head/sys/dev/netmap/netmap_monitor.c > head/sys/dev/netmap/netmap_offloadings.c > head/sys/dev/netmap/netmap_pipe.c > head/sys/dev/netmap/netmap_vale.c > head/sys/modules/netmap/Makefile > head/sys/net/netmap.h > head/sys/net/netmap_user.h > head/tools/tools/netmap/Makefile > head/tools/tools/netmap/bridge.c > head/tools/tools/netmap/pkt-gen.c > head/tools/tools/netmap/vale-ctl.c Looks like this broke VIMAGE builds: /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclared identifier 'rd' CURVNET_SET(TD_TO_VNET(rd)); ^ /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclared identifier 'rd' /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclared identifier 'rd' /usr/src/sys/dev/netmap/netmap_freebsd.c:1410:25: error: use of undeclared identifier 'rd' 4 errors generated. --- netmap_freebsd.o --- *** [netmap_freebsd.o] Error code 1 Thanks, -- Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE signature.asc Description: PGP signature
svn commit: r307639 - head
Author: imp Date: Wed Oct 19 15:13:08 2016 New Revision: 307639 URL: https://svnweb.freebsd.org/changeset/base/307639 Log: After deeper software archaeology, reports that 10.3R was affected turned out to be mistaken. Adjust the entry and fix a few typos. Modified: head/UPDATING Modified: head/UPDATING == --- head/UPDATING Wed Oct 19 14:51:25 2016(r307638) +++ head/UPDATING Wed Oct 19 15:13:08 2016(r307639) @@ -29,21 +29,22 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 machines to maximize performance. (To completely disable malloc debugging, define MALLOC_PRODUCTION in /etc/make.conf, or to merely disable the most expensive debugging functionality run - "ln -s 'abort:false,junk:false' /etc/malloc. + "ln -s 'abort:false,junk:false' /etc/malloc.conf".) ** SPECIAL WARNING: ** Due to a bug in some versions of clang that's very hard to workaround in the upgrade process, to upgrade to -current you must first upgrade - either stable/9 after r286035 or stable/10 after r286033 or current - after r286007 (including stable/11 and 11.0-RELEASE). These revisions - post-date 10.3-RELEASE and 9.3-RELEASE, so you'll need to take the - unusual step of upgrading to the tip of the stable branch before moving - to 11 or -current via a source upgrade. stable/11 and 11.0-RELEASE - post-date the fix so you can move from them to -current. This differs - from the historical situation where one coule upgrade from anywhere on - the last couple of stable branches, so be careful. + either stable/9 after r286035 or stable/10 after r286033 (including + 10.3-RELEASE) or current after r286007 (including stable/11 and + 11.0-RELEASE). These revisions post-date the 10.2 and 9.3 releases, so + you'll need to take the unusual step of upgrading to the tip of the + stable branch before moving to 11 or -current via a source upgrade. + stable/11 and 11.0-RELEASE post-date the fix so you can move from them + to -current. This differs from the historical situation where one could + upgrade from anywhere on the last couple of stable branches, so be + careful. ** SPECIAL WARNING: ** ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307638 - head/usr.bin/printenv
Author: gahr (ports committer) Date: Wed Oct 19 14:51:25 2016 New Revision: 307638 URL: https://svnweb.freebsd.org/changeset/base/307638 Log: Chase a cornercase in printenv and sync its behaviour with builtin's The cornercase is when printenv is passed a parameter in the form VAR=val, where VAR=val exists in the environment. In this case, printenv would print a spurious newline and returns 0. Approved by: cognet MFC after:1 week Modified: head/usr.bin/printenv/printenv.c Modified: head/usr.bin/printenv/printenv.c == --- head/usr.bin/printenv/printenv.cWed Oct 19 14:28:51 2016 (r307637) +++ head/usr.bin/printenv/printenv.cWed Oct 19 14:51:25 2016 (r307638) @@ -83,8 +83,8 @@ main(int argc, char *argv[]) for (ep = environ; *ep; ep++) if (!memcmp(*ep, *argv, len)) { cp = *ep + len; - if (!*cp || *cp == '=') { - (void)printf("%s\n", *cp ? cp + 1 : cp); + if (*cp == '=') { + (void)printf("%s\n", cp + 1); exit(0); } } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307637 - head/sys/arm/nvidia/tegra124
Author: mmel Date: Wed Oct 19 14:28:51 2016 New Revision: 307637 URL: https://svnweb.freebsd.org/changeset/base/307637 Log: TEGRA: Raise minimum voltage for CPU, original 0.9 V was too optimistic. While I'm in, remove duplicated line from CPU frequency table. MFC after: 2 weeks Modified: head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Modified: head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c == --- head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Wed Oct 19 13:45:51 2016(r307636) +++ head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c Wed Oct 19 14:28:51 2016(r307637) @@ -141,7 +141,7 @@ static struct speedo_entry tegra124_spee static struct cpu_volt_def tegra124_cpu_volt_pllx_def = { - .min_uvolt = 90, /* 0.9 V */ + .min_uvolt = 100, /* XXX 0.9 V doesn't work on all boards */ .max_uvolt = 126, /* 1.26 */ .step_uvolt = 1, /* 10 mV */ .speedo_scale = 100, @@ -172,7 +172,6 @@ static uint64_t cpu_freq_tbl[] = { 211600ULL, 221800ULL, 232000ULL, - 232000ULL, 242200ULL, 252400ULL, }; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307636 - head
Author: imp Date: Wed Oct 19 13:45:51 2016 New Revision: 307636 URL: https://svnweb.freebsd.org/changeset/base/307636 Log: Document the unique requirements for upgrading more prominently. Unlike in the past (dating back to the 4.x branch point), you cannot upgrade from any point on the past couple of stable branches to -current. Due to a bug in clang that existed before r286035 in stable/9 or r286033 in stable/10, we cannot compile llvm that's in 11.x or -current. Unfortunately, these revisions are after 9.3R and 10.3R on their respective branches. stable/11 and 11.0R are not affected. This also affects the upgrade path to 11 (including 11.0R) from stable/9 and stable/10 (which would otherwise work, were it not for this bug). We also need to amend the 11.0R release notes. MFC After: 3 days Modified: head/UPDATING Modified: head/UPDATING == --- head/UPDATING Wed Oct 19 13:42:40 2016(r307635) +++ head/UPDATING Wed Oct 19 13:45:51 2016(r307636) @@ -29,7 +29,23 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 12 machines to maximize performance. (To completely disable malloc debugging, define MALLOC_PRODUCTION in /etc/make.conf, or to merely disable the most expensive debugging functionality run - "ln -s 'abort:false,junk:false' /etc/malloc.conf".) + "ln -s 'abort:false,junk:false' /etc/malloc. + + +** SPECIAL WARNING: ** + + Due to a bug in some versions of clang that's very hard to workaround in + the upgrade process, to upgrade to -current you must first upgrade + either stable/9 after r286035 or stable/10 after r286033 or current + after r286007 (including stable/11 and 11.0-RELEASE). These revisions + post-date 10.3-RELEASE and 9.3-RELEASE, so you'll need to take the + unusual step of upgrading to the tip of the stable branch before moving + to 11 or -current via a source upgrade. stable/11 and 11.0-RELEASE + post-date the fix so you can move from them to -current. This differs + from the historical situation where one coule upgrade from anywhere on + the last couple of stable branches, so be careful. + +** SPECIAL WARNING: ** 20161017: The urtwn(4) driver was merged into rtwn(4) and now consists of @@ -1467,11 +1483,15 @@ COMMON ITEMS: your build attempts in an "environmental clean room", prefix all make commands with 'env -i '. See the env(1) manual page for more details. - When upgrading from one major version to another it is generally best - to upgrade to the latest code in the currently installed branch first, - then do an upgrade to the new branch. This is the best-tested upgrade - path, and has the highest probability of being successful. Please try - this approach before reporting problems with a major version upgrade. + When upgrading from one major version to another it is generally best to + upgrade to the latest code in the currently installed branch first, then + do an upgrade to the new branch. This is the best-tested upgrade path, + and has the highest probability of being successful. Please try this + approach if you encounter problems with a major version upgrade. Since + the stable 4.x branch point, one has generally been able to upgade from + anywhere in the most recent stable branch to head / current (or even the + last couple of stable branches). See the top of this file when there's + an exception. When upgrading a live system, having a root shell around before installing anything can help undo problems. Not having a root shell ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307635 - stable/10/sys/dev/kbd
Author: emaste Date: Wed Oct 19 13:42:40 2016 New Revision: 307635 URL: https://svnweb.freebsd.org/changeset/base/307635 Log: MFC r307145: Use M_WAITOK in PIO_KEYMAP ioctl The malloc return value is not checked. Modified: stable/10/sys/dev/kbd/kbd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/kbd/kbd.c == --- stable/10/sys/dev/kbd/kbd.c Wed Oct 19 13:37:43 2016(r307634) +++ stable/10/sys/dev/kbd/kbd.c Wed Oct 19 13:42:40 2016(r307635) @@ -888,7 +888,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo case PIO_KEYMAP:/* set keyboard translation table */ case OPIO_KEYMAP: /* set keyboard translation table (compat) */ #ifndef KBD_DISABLE_KEYMAP_LOAD - mapp = malloc(sizeof *mapp, M_TEMP, M_NOWAIT); + mapp = malloc(sizeof *mapp, M_TEMP, M_WAITOK); if (cmd == OPIO_KEYMAP) { omapp = (okeymap_t *)arg; mapp->n_keys = omapp->n_keys; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307634 - stable/11/sys/dev/kbd
Author: emaste Date: Wed Oct 19 13:37:43 2016 New Revision: 307634 URL: https://svnweb.freebsd.org/changeset/base/307634 Log: MFC r307145: Use M_WAITOK in PIO_KEYMAP ioctl The malloc return value is not checked. Modified: stable/11/sys/dev/kbd/kbd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/kbd/kbd.c == --- stable/11/sys/dev/kbd/kbd.c Wed Oct 19 13:36:52 2016(r307633) +++ stable/11/sys/dev/kbd/kbd.c Wed Oct 19 13:37:43 2016(r307634) @@ -888,7 +888,7 @@ genkbd_commonioctl(keyboard_t *kbd, u_lo case PIO_KEYMAP:/* set keyboard translation table */ case OPIO_KEYMAP: /* set keyboard translation table (compat) */ #ifndef KBD_DISABLE_KEYMAP_LOAD - mapp = malloc(sizeof *mapp, M_TEMP, M_NOWAIT); + mapp = malloc(sizeof *mapp, M_TEMP, M_WAITOK); if (cmd == OPIO_KEYMAP) { omapp = (okeymap_t *)arg; mapp->n_keys = omapp->n_keys; ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307633 - stable/11/sys/mips/conf
Author: emaste Date: Wed Oct 19 13:36:52 2016 New Revision: 307633 URL: https://svnweb.freebsd.org/changeset/base/307633 Log: MFC r307152: Add COMPAT_FREEBSD10 to the MIPS ERL kernel config As of r302092, pipe is a wrapper around pipe2 and the pipe syscall is no longer used. It is included only with the COMPAT_FREEBSD10 kernel option. Add the compat option to support upgrades from systems with an earlier userland. Modified: stable/11/sys/mips/conf/ERL Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/mips/conf/ERL == --- stable/11/sys/mips/conf/ERL Wed Oct 19 13:26:07 2016(r307632) +++ stable/11/sys/mips/conf/ERL Wed Oct 19 13:36:52 2016(r307633) @@ -73,6 +73,7 @@ options PSEUDOFS# Pseudo-filesystem f optionsGEOM_PART_GPT # GUID Partition Tables. optionsGEOM_LABEL # Provides labelization optionsCOMPAT_FREEBSD32# Compatible with o32 binaries +optionsCOMPAT_FREEBSD10# Compatible with FreeBSD10 optionsSCSI_DELAY=5000 # Delay (in ms) before probing SCSI optionsKTRACE # ktrace(1) support optionsSTACK # stack(9) support ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307632 - in stable/11: lib/libstand sys/boot/common sys/boot/efi/loader sys/boot/i386/libi386 sys/boot/i386/loader sys/boot/pc98/loader
Author: bapt Date: Wed Oct 19 13:26:07 2016 New Revision: 307632 URL: https://svnweb.freebsd.org/changeset/base/307632 Log: MFC: 304677, 304680, 305125, 305770, 305769 r304677: Add tftpfs support for the EFI loader Allow netbooting on efi without having to setup any NFS server by rebuilding the loader with LOADER_TFTP_SUPPORT like for the i386 pxeloader r305125: Netboot: allow both tftpfs and nfs in both pxeboot and loader.efi Add a new 'netproto' variable which can be set for now to NET_TFTP or NET_NFS (default to NET_NONE) From the dhcp options if one sets the root-path option to: "ip:path", the loader will consider it is booting over NFS (meaning same behaviour as the default current behaviour) if the dhcp option "tftp server address" is set (option 150) the loader will consider it is booting over tftpfs, it will then consider the root-path options with 2 possible case 1. "path" then the IP of the tftp server will be the one passed by the option 150, and the files will be retrieved under "path" on the tftp server 2. "ip:path" then the IP of the tftp server will be the one passed in the option "overwritting the IP from the option 150. We could not "abuse" the rootpath option in the form or tftp://ip:path because this is already used for other purpose by iPXE preventing any chainload from iPXE to the FreeBSD loader. Given at each open(), the loader loops over all available filesystems and keep the "best" error, we needed to prevent tftpfs to fallback on nfs and vice versa. the tftpfs and nfs implementation in libstand now return EINVAL early if 'netproto' for that purpose. Relnotes: yes Sponsored by: Gandi.net Modified: stable/11/lib/libstand/bootp.c stable/11/lib/libstand/bootp.h stable/11/lib/libstand/globals.c stable/11/lib/libstand/net.h stable/11/lib/libstand/nfs.c stable/11/lib/libstand/tftp.c stable/11/sys/boot/common/dev_net.c stable/11/sys/boot/efi/loader/conf.c stable/11/sys/boot/i386/libi386/pxe.c stable/11/sys/boot/i386/loader/conf.c stable/11/sys/boot/pc98/loader/conf.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libstand/bootp.c == --- stable/11/lib/libstand/bootp.c Wed Oct 19 13:19:45 2016 (r307631) +++ stable/11/lib/libstand/bootp.c Wed Oct 19 13:26:07 2016 (r307632) @@ -411,6 +411,10 @@ vend_rfc1048(cp, len) bcopy(cp, _serverip.s_addr, sizeof(dhcp_serverip.s_addr)); } + if (tag == TAG_TFTP_SERVER) { + bcopy(cp, _addr, + sizeof(tftpip.s_addr)); + } #endif cp += size; } Modified: stable/11/lib/libstand/bootp.h == --- stable/11/lib/libstand/bootp.h Wed Oct 19 13:19:45 2016 (r307631) +++ stable/11/lib/libstand/bootp.h Wed Oct 19 13:26:07 2016 (r307632) @@ -106,6 +106,7 @@ struct bootp { #define TAG_T2 ((unsigned char) 59) #define TAG_CLASSID((unsigned char) 60) #define TAG_CLIENTID ((unsigned char) 61) +#define TAG_TFTP_SERVER((unsigned char) 150) #endif #define TAG_END((unsigned char) 255) Modified: stable/11/lib/libstand/globals.c == --- stable/11/lib/libstand/globals.cWed Oct 19 13:19:45 2016 (r307631) +++ stable/11/lib/libstand/globals.cWed Oct 19 13:26:07 2016 (r307632) @@ -25,12 +25,14 @@ charhostname[FNAME_SIZE]; /* our hostn inthostnamelen; char domainname[FNAME_SIZE]; /* our DNS domain */ intdomainnamelen; +intnetproto = NET_NONE;/* Network prototol */ char ifname[IFNAME_SIZE];/* name of interface (e.g. "le0") */ struct in_addr myip; /* my ip address */ struct in_addr nameip; /* DNS server ip address */ struct in_addr rootip; /* root ip address */ struct in_addr swapip; /* swap ip address */ struct in_addr gateip; /* gateway ip address */ +struct in_addr tftpip; /* TFTP ip address */ n_long netmask = 0xff00; /* subnet or net mask */ u_int intf_mtu; /* interface mtu from bootp/dhcp */ interrno; /* our old friend */ Modified: stable/11/lib/libstand/net.h == --- stable/11/lib/libstand/net.hWed Oct 19 13:19:45 2016 (r307631) +++ stable/11/lib/libstand/net.hWed Oct 19 13:26:07 2016 (r307632) @@ -36,6 +36,8 @@ * $FreeBSD$ */ +#ifndef
svn commit: r307631 - stable/11/gnu/usr.bin/groff
Author: emaste Date: Wed Oct 19 13:19:45 2016 New Revision: 307631 URL: https://svnweb.freebsd.org/changeset/base/307631 Log: MFC r306740, r307150: groff: use changelog date in man pages r306740: groff: use changelog date rather than file modification date in man pages The source checkout date is not particularly relevant, and this makes groff man pages build reproducibly. r307150: Avoid using 'head' in generating groff doc date It may not be available in certain cross build cases. Note that this is a slight change in functionality, in that now only the first line of the source ChangeLog file is processed. This is acceptable as groff will be retired and we won't encounter a possibly-different ChangeLog format. Added: stable/11/gnu/usr.bin/groff/mdate.sh - copied, changed from r306740, head/gnu/usr.bin/groff/mdate.sh Modified: stable/11/gnu/usr.bin/groff/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/gnu/usr.bin/groff/Makefile.inc == --- stable/11/gnu/usr.bin/groff/Makefile.incWed Oct 19 12:33:58 2016 (r307630) +++ stable/11/gnu/usr.bin/groff/Makefile.incWed Oct 19 13:19:45 2016 (r307631) @@ -119,7 +119,7 @@ revision=`sed -e 's/^0$$//' -e 's/^[1-9] -e "s;@TMAC_MDIR@;$(tmacdir)/mm;g" \ -e "s;@BROKEN_SPOOLER_FLAGS@;$(BROKEN_SPOOLER_FLAGS);g" \ -e "s;@VERSION@;$(version)$(revision);g" \ - -e "s;@MDATE@;`$(SHELL) ${GROFF_DIST}/mdate.sh $<`;g" \ + -e "s;@MDATE@;$(MDATE);g" \ -e "s;@g@;$(g);g" \ -e "s;@G@;`echo $(g) | LC_ALL=C tr a-z A-Z`;g" \ $< >$@ @@ -141,4 +141,5 @@ TOPREL?=.. GROFF_DIST=${.CURDIR}/${TOPREL}/../../../contrib/groff DIST_SUBDIR?= ${.CURDIR:T} DIST_DIR= ${GROFF_DIST}/${DIST_SUBDIR} +MDATE!=sh ${.CURDIR}/${TOPREL}/mdate.sh ${GROFF_DIST}/ChangeLog .PATH: ${DIST_DIR} Copied and modified: stable/11/gnu/usr.bin/groff/mdate.sh (from r306740, head/gnu/usr.bin/groff/mdate.sh) == --- head/gnu/usr.bin/groff/mdate.sh Wed Oct 5 23:25:29 2016 (r306740, copy source) +++ stable/11/gnu/usr.bin/groff/mdate.shWed Oct 19 13:19:45 2016 (r307631) @@ -4,6 +4,5 @@ set -e test -r "$1" export LC_ALL=C -changelog_date=$(sed -E -n 's/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*$/\1/p' "$1" |\ -head -n 1) +changelog_date=$(sed -E -n '1s/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*$/\1/p' "$1") echo $(date -j -f %Y-%m-%d +"%e %B %Y" $changelog_date) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307629 - head/bin/pkill/tests
Author: br Date: Wed Oct 19 12:23:02 2016 New Revision: 307629 URL: https://svnweb.freebsd.org/changeset/base/307629 Log: Increase timeouts so tests have more chances to succeed on MIPS64EB in QEMU. Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Modified: head/bin/pkill/tests/pgrep-j_test.sh head/bin/pkill/tests/pkill-j_test.sh Modified: head/bin/pkill/tests/pgrep-j_test.sh == --- head/bin/pkill/tests/pgrep-j_test.shWed Oct 19 11:51:17 2016 (r307628) +++ head/bin/pkill/tests/pgrep-j_test.shWed Oct 19 12:23:02 2016 (r307629) @@ -54,7 +54,7 @@ fi wait name="pgrep -j any" -sleep_amount=6 +sleep_amount=16 jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount & @@ -75,7 +75,7 @@ fi wait name="pgrep -j none" -sleep_amount=7 +sleep_amount=17 daemon -p ${PWD}/${base}_3_1.pid $sleep $sleep_amount & jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_3_2.pid $sleep $sleep_amount & @@ -92,7 +92,7 @@ wait # test 4 is like test 1 except with jname instead of jid. name="pgrep -j " -sleep_amount=8 +sleep_amount=18 jail -c path=/ name=${base}_4_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_4_1.pid $sleep $sleep_amount & Modified: head/bin/pkill/tests/pkill-j_test.sh == --- head/bin/pkill/tests/pkill-j_test.shWed Oct 19 11:51:17 2016 (r307628) +++ head/bin/pkill/tests/pkill-j_test.shWed Oct 19 12:23:02 2016 (r307629) @@ -20,7 +20,7 @@ sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep name="pkill -j " -sleep_amount=5 +sleep_amount=15 jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount & @@ -54,7 +54,7 @@ fi 2>/dev/null wait name="pkill -j any" -sleep_amount=6 +sleep_amount=16 jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount & @@ -76,7 +76,7 @@ fi 2>/dev/null wait name="pkill -j none" -sleep_amount=7 +sleep_amount=17 daemon -p ${PWD}/${base}_3_1.pid $sleep $sleep_amount jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_3_2.pid $sleep $sleep_amount & @@ -94,7 +94,7 @@ wait # test 4 is like test 1 except with jname instead of jid. name="pkill -j " -sleep_amount=8 +sleep_amount=18 jail -c path=/ name=${base}_4_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_4_1.pid $sleep $sleep_amount & ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307628 - head/sys/netpfil/ipfw
Author: ae Date: Wed Oct 19 11:51:17 2016 New Revision: 307628 URL: https://svnweb.freebsd.org/changeset/base/307628 Log: Fix `ipfw table lookup` handler to return entry value, but not its index. Submitted by: loos MFC after:1 week Modified: head/sys/netpfil/ipfw/ip_fw_table.c Modified: head/sys/netpfil/ipfw/ip_fw_table.c == --- head/sys/netpfil/ipfw/ip_fw_table.c Wed Oct 19 11:21:23 2016 (r307627) +++ head/sys/netpfil/ipfw/ip_fw_table.c Wed Oct 19 11:51:17 2016 (r307628) @@ -1087,6 +1087,7 @@ find_table_entry(struct ip_fw_chain *ch, struct table_config *tc; struct table_algo *ta; struct table_info *kti; + struct table_value *pval; struct namedobj_instance *ni; int error; size_t sz; @@ -1132,7 +1133,10 @@ find_table_entry(struct ip_fw_chain *ch, return (ENOTSUP); error = ta->find_tentry(tc->astate, kti, tent); - + if (error == 0) { + pval = get_table_value(ch, tc, tent->v.kidx); + ipfw_export_table_value_v1(pval, >v.value); + } IPFW_UH_RUNLOCK(ch); return (error); ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307626 - head/sys/ufs/ffs
Author: kib Date: Wed Oct 19 11:09:29 2016 New Revision: 307626 URL: https://svnweb.freebsd.org/changeset/base/307626 Log: Add FFS pager, which uses buffer cache read operation to validate pages. See the comments for more detailed description of the algorithm. The pager is used unconditionally when the block size of the underlying device is larger than the machine page size, since local vnode pager cannot handle the configuration [1]. Otherwise, the vfs.ffs.use_buf_pager sysctl allows to switch to the local pager. Measurements demonstrated no regression in the ever-important buildworld benchmark, and small (~5%) throughput improvements in the special microbenchmark configuration for dbench over swap-backed md(4). Code can be generalized and reused for other filesystems which use buffer cache. Reported by: Anton Yuzhaninov[1] Tested by:pho Benchmarked by: mjg, pho Reviewed by: alc, markj, mckusick (previous version) Sponsored by: The FreeBSD Foundation MFC after:2 weeks Differential revision:https://reviews.freebsd.org/D8198 Modified: head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_vnops.c == --- head/sys/ufs/ffs/ffs_vnops.cWed Oct 19 10:01:04 2016 (r307625) +++ head/sys/ufs/ffs/ffs_vnops.cWed Oct 19 11:09:29 2016 (r307626) @@ -77,6 +77,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -86,6 +87,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -102,8 +104,9 @@ __FBSDID("$FreeBSD$"); #ifdef DIRECTIO extern int ffs_rawread(struct vnode *vp, struct uio *uio, int *workdone); #endif -static vop_fsync_t ffs_fsync; static vop_fdatasync_t ffs_fdatasync; +static vop_fsync_t ffs_fsync; +static vop_getpages_t ffs_getpages; static vop_lock1_t ffs_lock; static vop_read_t ffs_read; static vop_write_t ffs_write; @@ -119,13 +122,12 @@ static vop_openextattr_t ffs_openextattr static vop_setextattr_tffs_setextattr; static vop_vptofh_tffs_vptofh; - /* Global vfs data structures for ufs. */ struct vop_vector ffs_vnodeops1 = { .vop_default = _vnodeops, .vop_fsync =ffs_fsync, .vop_fdatasync =ffs_fdatasync, - .vop_getpages = vnode_pager_local_getpages, + .vop_getpages = ffs_getpages, .vop_getpages_async = vnode_pager_local_getpages_async, .vop_lock1 =ffs_lock, .vop_read = ffs_read, @@ -147,7 +149,7 @@ struct vop_vector ffs_vnodeops2 = { .vop_default = _vnodeops, .vop_fsync =ffs_fsync, .vop_fdatasync =ffs_fdatasync, - .vop_getpages = vnode_pager_local_getpages, + .vop_getpages = ffs_getpages, .vop_getpages_async = vnode_pager_local_getpages_async, .vop_lock1 =ffs_lock, .vop_read = ffs_read, @@ -1784,3 +1786,165 @@ vop_vptofh { ufhp->ufid_gen = ip->i_gen; return (0); } + +SYSCTL_DECL(_vfs_ffs); +static int use_buf_pager = 1; +SYSCTL_INT(_vfs_ffs, OID_AUTO, use_buf_pager, CTLFLAG_RWTUN, _buf_pager, 0, +"Always use buffer pager instead of bmap"); +static int buf_pager_relbuf; +SYSCTL_INT(_vfs_ffs, OID_AUTO, buf_pager_relbuf, CTLFLAG_RWTUN, +_pager_relbuf, 0, +"Make buffer pager release buffers after reading"); + +/* + * The FFS pager. It uses buffer reads to validate pages. + * + * In contrast to the generic local pager from vm/vnode_pager.c, this + * pager correctly and easily handles volumes where the underlying + * device block size is greater than the machine page size. The + * buffer cache transparently extends the requested page run to be + * aligned at the block boundary, and does the necessary bogus page + * replacements in the addends to avoid obliterating already valid + * pages. + * + * The only non-trivial issue is that the exclusive busy state for + * pages, which is assumed by the vm_pager_getpages() interface, is + * incompatible with the VMIO buffer cache's desire to share-busy the + * pages. This function performs a trivial downgrade of the pages' + * state before reading buffers, and a less trivial upgrade from the + * shared-busy to excl-busy state after the read. + */ +static int +ffs_getpages(struct vop_getpages_args *ap) +{ + struct vnode *vp; + vm_page_t *ma, m; + vm_object_t object; + struct buf *bp; + struct ufsmount *um; + ufs_lbn_t lbn, lbnp; + vm_ooffset_t la, lb; + long bsize; + int bo_bs, count, error, i; + bool redo, lpart; + + vp = ap->a_vp; + ma = ap->a_m; + count = ap->a_count; + + um = VFSTOUFS(ap->a_vp->v_mount); + bo_bs = um->um_devvp->v_bufobj.bo_bsize; +
svn commit: r307625 - head/tests/sys/geom/class/uzip
Author: br Date: Wed Oct 19 10:01:04 2016 New Revision: 307625 URL: https://svnweb.freebsd.org/changeset/base/307625 Log: Add big-endian uzip file system and choose right file system to proceed tests with. Reviewed by: jmmv, ngie Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision:https://reviews.freebsd.org/D8073 Added: head/tests/sys/geom/class/uzip/1_endian_big.img.uzip.uue (contents, props changed) head/tests/sys/geom/class/uzip/1_endian_little.img.uzip.uue (contents, props changed) Deleted: head/tests/sys/geom/class/uzip/test-1.img.uzip.uue Modified: head/tests/sys/geom/class/uzip/1_test.sh head/tests/sys/geom/class/uzip/Makefile Added: head/tests/sys/geom/class/uzip/1_endian_big.img.uzip.uue == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/geom/class/uzip/1_endian_big.img.uzip.uueWed Oct 19 10:01:04 2016(r307625) @@ -0,0 +1,87 @@ +# +# $FreeBSD$ +# + +begin 644 1_endian_big.img.uzip
svn commit: r307624 - in head/sys/dev/hyperv: include vmbus
Author: sephe Date: Wed Oct 19 09:12:14 2016 New Revision: 307624 URL: https://svnweb.freebsd.org/changeset/base/307624 Log: hyperv/vmbus: Expose channel management taskqueue for driver to use. MFC after:3 days Sponsored by: Microsoft Modified: head/sys/dev/hyperv/include/vmbus.h head/sys/dev/hyperv/vmbus/vmbus_chan.c Modified: head/sys/dev/hyperv/include/vmbus.h == --- head/sys/dev/hyperv/include/vmbus.h Wed Oct 19 08:45:19 2016 (r307623) +++ head/sys/dev/hyperv/include/vmbus.h Wed Oct 19 09:12:14 2016 (r307624) @@ -118,6 +118,7 @@ struct vmbus_chan_br { struct vmbus_channel; struct hyperv_guid; struct task; +struct taskqueue; typedef void (*vmbus_chan_callback_t)(struct vmbus_channel *, void *); @@ -179,5 +180,7 @@ int vmbus_chan_prplist_nelem(int br_siz int dlen_max); bool vmbus_chan_rx_empty(const struct vmbus_channel *chan); bool vmbus_chan_tx_empty(const struct vmbus_channel *chan); +struct taskqueue * + vmbus_chan_mgmt_tq(const struct vmbus_channel *chan); #endif /* !_VMBUS_H_ */ Modified: head/sys/dev/hyperv/vmbus/vmbus_chan.c == --- head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Oct 19 08:45:19 2016 (r307623) +++ head/sys/dev/hyperv/vmbus/vmbus_chan.c Wed Oct 19 09:12:14 2016 (r307624) @@ -1721,3 +1721,10 @@ vmbus_chan_run_task(struct vmbus_channel taskqueue_enqueue(chan->ch_tq, task); taskqueue_drain(chan->ch_tq, task); } + +struct taskqueue * +vmbus_chan_mgmt_tq(const struct vmbus_channel *chan) +{ + + return (chan->ch_mgmt_tq); +} ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307623 - stable/10/sys/dev/hyperv/storvsc
Author: sephe Date: Wed Oct 19 08:45:19 2016 New Revision: 307623 URL: https://svnweb.freebsd.org/changeset/base/307623 Log: MFC 307261 hyperv/stor: Fix off-by-one bug; this brings back TRIM support. Submitted by: Hongjiang Zhang Reported by:Lili Deng Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8238 Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Oct 19 08:43:20 2016(r307622) +++ stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Oct 19 08:45:19 2016(r307623) @@ -2210,7 +2210,7 @@ storvsc_io_done(struct hv_storvsc_reques resp_buf[3], resp_buf[4]); } if (vm_srb->srb_status == SRB_STATUS_SUCCESS && - data_len > SHORT_INQUIRY_LENGTH) { + data_len >= SHORT_INQUIRY_LENGTH) { char vendor[16]; cam_strvis(vendor, inq_data->vendor, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307622 - stable/10/sys/net
Author: sephe Date: Wed Oct 19 08:43:20 2016 New Revision: 307622 URL: https://svnweb.freebsd.org/changeset/base/307622 Log: MFC 307078 ifnet: Use if_link_state snapshot to invoke ifnet_link_event So that everyone in this task have consistent view of link state. Reviewed by:ae Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8214 Modified: stable/10/sys/net/if.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/net/if.c == --- stable/10/sys/net/if.c Wed Oct 19 08:40:24 2016(r307621) +++ stable/10/sys/net/if.c Wed Oct 19 08:43:20 2016(r307622) @@ -2171,7 +2171,7 @@ do_link_state_change(void *arg, int pend if (log_link_state_change) log(LOG_NOTICE, "%s: link state changed to %s\n", ifp->if_xname, (link_state == LINK_STATE_UP) ? "UP" : "DOWN" ); - EVENTHANDLER_INVOKE(ifnet_link_event, ifp, ifp->if_link_state); + EVENTHANDLER_INVOKE(ifnet_link_event, ifp, link_state); CURVNET_RESTORE(); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307621 - in stable/10/sys/dev/hyperv: include netvsc vmbus
Author: sephe Date: Wed Oct 19 08:40:24 2016 New Revision: 307621 URL: https://svnweb.freebsd.org/changeset/base/307621 Log: MFC 307012,307013,307262 307012 hyperv/vmbus: Allow driver to inject synchronous task into channel taskq. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8208 307013 hyperv/hn: Rework link status support. This is the preamble for network device SR-IOV and NDIS_STATUS_NETWORK_CHANGE handling. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8209 307262 hyperv/hn: Management parts always need suspend and resume. Sponsored by: Microsoft Modified: stable/10/sys/dev/hyperv/include/vmbus.h stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h stable/10/sys/dev/hyperv/vmbus/vmbus_chan.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/vmbus.h == --- stable/10/sys/dev/hyperv/include/vmbus.hWed Oct 19 08:32:24 2016 (r307620) +++ stable/10/sys/dev/hyperv/include/vmbus.hWed Oct 19 08:40:24 2016 (r307621) @@ -118,6 +118,7 @@ struct vmbus_chan_br { struct vmbus_channel; struct hyperv_guid; +struct task; typedef void (*vmbus_chan_callback_t)(struct vmbus_channel *, void *); @@ -135,6 +136,8 @@ int vmbus_chan_open_br(struct vmbus_cha int udlen, vmbus_chan_callback_t cb, void *cbarg); void vmbus_chan_close(struct vmbus_channel *chan); void vmbus_chan_intr_drain(struct vmbus_channel *chan); +void vmbus_chan_run_task(struct vmbus_channel *chan, + struct task *task); intvmbus_chan_gpadl_connect(struct vmbus_channel *chan, bus_addr_t paddr, int size, uint32_t *gpadl); Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h == --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Oct 19 08:32:24 2016(r307620) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Oct 19 08:40:24 2016(r307621) @@ -234,6 +234,10 @@ struct hn_softc { struct vmbus_xact_ctx *hn_xact; uint32_thn_nvs_ver; + struct taskqueue*hn_mgmt_taskq; + struct taskqueue*hn_mgmt_taskq0; + struct task hn_link_task; + uint32_thn_caps;/* HN_CAP_ */ uint32_thn_flags; /* HN_FLAG_ */ void*hn_rxbuf; @@ -272,7 +276,6 @@ struct hn_softc { */ struct hn_send_ctx; -void netvsc_linkstatus_callback(struct hn_softc *sc, uint32_t status); int hv_nv_on_send(struct vmbus_channel *chan, uint32_t rndis_mtype, struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt); Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 19 08:32:24 2016(r307620) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 19 08:40:24 2016(r307621) @@ -336,6 +336,8 @@ static void hn_fixup_tx_data(struct hn_s static void hn_destroy_tx_data(struct hn_softc *); static void hn_start_taskfunc(void *, int); static void hn_start_txeof_taskfunc(void *, int); +static void hn_link_taskfunc(void *, int); +static void hn_suspend_mgmt_taskfunc(void *, int); static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); static int hn_create_rx_data(struct hn_softc *sc, int); static void hn_destroy_rx_data(struct hn_softc *sc); @@ -351,7 +353,11 @@ static int hn_synth_attach(struct hn_sof static void hn_synth_detach(struct hn_softc *); static bool hn_tx_ring_pending(struct hn_tx_ring *); static void hn_suspend(struct hn_softc *); +static void hn_suspend_data(struct hn_softc *); +static void hn_suspend_mgmt(struct hn_softc *); static void hn_resume(struct hn_softc *); +static void hn_resume_data(struct hn_softc *); +static void hn_resume_mgmt(struct hn_softc *); static void hn_rx_drain(struct vmbus_channel *); static void hn_tx_resume(struct hn_softc *, int); static void hn_tx_ring_qflush(struct hn_tx_ring *); @@ -533,7 +539,6 @@ netvsc_attach(device_t dev) struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx; uint8_t eaddr[ETHER_ADDR_LEN]; - uint32_t link_status; struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; @@ -567,6 +572,15 @@ netvsc_attach(device_t dev) } /* +* Setup taskqueue for mangement tasks, e.g. link status. +*/ +
svn commit: r307620 - in stable/10/sys: dev/hyperv/netvsc net
Author: sephe Date: Wed Oct 19 08:32:24 2016 New Revision: 307620 URL: https://svnweb.freebsd.org/changeset/base/307620 Log: MFC 306936-306939 306936 hyperv/hn: Fix checksum offload settings The _correct_ way to identify the supported checksum offloading and TSO parameters is to query OID_TCP_OFFLOAD_HARDWARE_CAPABILITIES. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8088 306937 hyperv/hn: Fix if_hw_tsomax setup. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8089 306938 hyperv/hn: Generalize RSS capabilities query. - Support NDIS < 6.30. - Stringent response checks. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8090 306939 hyperv/hn: Suffix NDIS offload size with NDIS version. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8091 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/10/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/10/sys/dev/hyperv/netvsc/if_hnvar.h stable/10/sys/dev/hyperv/netvsc/ndis.h stable/10/sys/net/rndis.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h == --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Oct 19 08:23:54 2016(r307619) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Oct 19 08:32:24 2016(r307620) @@ -245,6 +245,8 @@ struct hn_softc { uint32_thn_rndis_rid; uint32_thn_ndis_ver; + int hn_ndis_tso_szmax; + int hn_ndis_tso_sgmin; struct ndis_rssprm_toeplitz hn_rss; }; Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 19 08:23:54 2016(r307619) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 19 08:32:24 2016(r307620) @@ -232,7 +232,7 @@ SYSCTL_INT(_hw_hn, OID_AUTO, trust_hosti "when csum info is missing (global setting)"); /* Limit TSO burst size */ -static int hn_tso_maxlen = 0; +static int hn_tso_maxlen = IP_MAXPACKET; SYSCTL_INT(_hw_hn, OID_AUTO, tso_maxlen, CTLFLAG_RDTUN, _tso_maxlen, 0, "TSO burst limit"); @@ -340,6 +340,7 @@ static int hn_encap(struct hn_tx_ring *, static int hn_create_rx_data(struct hn_softc *sc, int); static void hn_destroy_rx_data(struct hn_softc *sc); static void hn_set_chim_size(struct hn_softc *, int); +static void hn_set_tso_maxsize(struct hn_softc *, int, int); static int hn_chan_attach(struct hn_softc *, struct vmbus_channel *); static void hn_chan_detach(struct hn_softc *, struct vmbus_channel *); static int hn_attach_subchans(struct hn_softc *); @@ -535,7 +536,6 @@ netvsc_attach(device_t dev) uint32_t link_status; struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; - int tso_maxlen; sc->hn_dev = dev; sc->hn_prichan = vmbus_get_channel(dev); @@ -736,18 +736,16 @@ netvsc_attach(device_t dev) /* Enable all available capabilities by default. */ ifp->if_capenable = ifp->if_capabilities; - tso_maxlen = hn_tso_maxlen; - if (tso_maxlen <= 0 || tso_maxlen > IP_MAXPACKET) - tso_maxlen = IP_MAXPACKET; - ifp->if_hw_tsomaxsegcount = HN_TX_DATA_SEGCNT_MAX; - ifp->if_hw_tsomaxsegsize = PAGE_SIZE; - ifp->if_hw_tsomax = tso_maxlen - - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + if (ifp->if_capabilities & (IFCAP_TSO6 | IFCAP_TSO4)) { + hn_set_tso_maxsize(sc, hn_tso_maxlen, ETHERMTU); + ifp->if_hw_tsomaxsegcount = HN_TX_DATA_SEGCNT_MAX; + ifp->if_hw_tsomaxsegsize = PAGE_SIZE; + } ether_ifattach(ifp, eaddr); - if (bootverbose) { - if_printf(ifp, "TSO: %u/%u/%u\n", ifp->if_hw_tsomax, + if ((ifp->if_capabilities & (IFCAP_TSO6 | IFCAP_TSO4)) && bootverbose) { + if_printf(ifp, "TSO segcnt %u segsz %u\n", ifp->if_hw_tsomaxsegcount, ifp->if_hw_tsomaxsegsize); } @@ -1692,6 +1690,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, if (sc->hn_tx_ring[0].hn_chim_size > sc->hn_chim_szmax) hn_set_chim_size(sc, sc->hn_chim_szmax); + hn_set_tso_maxsize(sc, hn_tso_maxlen, ifr->ifr_mtu); /* All done! Resume now. */ if (ifp->if_drv_flags & IFF_DRV_RUNNING) @@ -2939,6 +2938,34 @@ hn_set_chim_size(struct hn_softc *sc, in } static void +hn_set_tso_maxsize(struct hn_softc *sc, int
svn commit: r307619 - stable/11/usr.bin/ul
Author: gahr (ports committer) Date: Wed Oct 19 08:23:54 2016 New Revision: 307619 URL: https://svnweb.freebsd.org/changeset/base/307619 Log: MFC r302558: Do not truncate lines longer than 512 chars. PR: 210344 MFC after:1 week Differential Revision:https://reviews.freebsd.org/D6881 Modified: stable/11/usr.bin/ul/ul.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/ul/ul.c == --- stable/11/usr.bin/ul/ul.c Wed Oct 19 07:46:20 2016(r307618) +++ stable/11/usr.bin/ul/ul.c Wed Oct 19 08:23:54 2016(r307619) @@ -78,7 +78,9 @@ structCHAR{ int c_width;/* width or -1 if multi-column char. filler */ } ; -static struct CHARobuf[MAXBUF]; +static struct CHARsobuf[MAXBUF]; /* static output buffer */ +static struct CHAR*obuf = sobuf; +static int buflen = MAXBUF; static int col, maxcol; static int mode; static int halfpos; @@ -151,6 +153,9 @@ main(int argc, char **argv) else filter(f); } + if (obuf != sobuf) { + free(obuf); + } exit(0); } @@ -166,128 +171,148 @@ filter(FILE *f) { wint_t c; int i, w; + int copy; + + copy = 0; + + while ((c = getwc(f)) != WEOF) { + if (col == buflen) { + if (obuf == sobuf) { + obuf = NULL; + copy = 1; + } + obuf = realloc(obuf, sizeof(*obuf) * 2 * buflen); + if (obuf == NULL) { + obuf = sobuf; + break; + } else if (copy) { + memcpy(obuf, sobuf, sizeof(*obuf) * buflen); + copy = 0; + } + bzero((char *)(obuf + buflen), sizeof(*obuf) * buflen); + buflen *= 2; + } + switch(c) { + case '\b': + if (col > 0) + col--; + continue; - while ((c = getwc(f)) != WEOF && col < MAXBUF) switch(c) { + case '\t': + col = (col+8) & ~07; + if (col > maxcol) + maxcol = col; + continue; - case '\b': - if (col > 0) - col--; - continue; - - case '\t': - col = (col+8) & ~07; - if (col > maxcol) - maxcol = col; - continue; - - case '\r': - col = 0; - continue; - - case SO: - mode |= ALTSET; - continue; - - case SI: - mode &= ~ALTSET; - continue; - - case IESC: - switch (c = getwc(f)) { - - case HREV: - if (halfpos == 0) { - mode |= SUPERSC; - halfpos--; - } else if (halfpos > 0) { - mode &= ~SUBSC; - halfpos--; - } else { - halfpos = 0; - reverse(); - } + case '\r': + col = 0; continue; - case HFWD: - if (halfpos == 0) { - mode |= SUBSC; - halfpos++; - } else if (halfpos < 0) { - mode &= ~SUPERSC; - halfpos++; - } else { - halfpos = 0; - fwd(); - } + case SO: + mode |= ALTSET; continue; - case FREV: - reverse(); + case SI: + mode &= ~ALTSET; continue; - default: - errx(1, "unknown escape sequence in input: %o, %o", IESC, c); - } - continue; + case IESC: + switch (c = getwc(f)) { - case '_': - if (obuf[col].c_char || obuf[col].c_width < 0) { - while (col > 0 && obuf[col].c_width < 0) - col--; - w = obuf[col].c_width; - for (i = 0; i < w; i++) - obuf[col++].c_mode |= UNDERL | mode; +
Re: svn commit: r307326 - head/sys/boot/efi/loader
On Wed, Oct 19, 2016 at 12:20 AM, John Baldwinwrote: > On Tuesday, October 18, 2016 11:44:52 PM Warner Losh wrote: >> On Mon, Oct 17, 2016 at 11:40 AM, John Baldwin wrote: >> > On Friday, October 14, 2016 12:25:54 PM Warner Losh wrote: >> >> On Oct 14, 2016 11:55 AM, "Doug Ambrisko" wrote: >> >> > >> >> > On Fri, Oct 14, 2016 at 10:33:15AM -0700, Ravi Pokala wrote: >> >> > | -Original Message- >> >> > | > From: on behalf of Doug Ambrisko >> >> > < >> >> ambri...@ambrisko.com> >> >> > | > Date: 2016-10-14, Friday at 10:27 >> >> > | > To: Warner Losh >> >> > | > Cc: Doug Ambrisko , src-committers < >> >> src-committ...@freebsd.org>, "svn-src-all@freebsd.org" < >> >> svn-src-all@freebsd.org>, "svn-src-h...@freebsd.org" < >> >> svn-src-h...@freebsd.org> >> >> > | > Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader >> >> > | > >> >> > | > On Fri, Oct 14, 2016 at 11:16:02AM -0600, Warner Losh wrote: >> >> > | > | Love the functionality, but don't like using the 'hint' namespace >> >> for >> >> > | > | this. Can we change it now before too many things depend on it? We >> >> had >> >> > | > | similar issues in ACPI and moved it to the 'acpi' space. Can we >> >> > move >> >> > | > | this to the 'smbios' space please? >> >> > | > | >> >> > | > | The reason is that 'hint' is special and sometimes filtered out, >> >> > so >> >> it >> >> > | > | is a poor choice to export data from the boot loader to the >> >> > kernel. >> >> > | > >> >> > | > The reason I picked hint was it could be put /boot/device.hints >> >> > | > to make it work as well and that it was a hint. Other standards in >> >> the >> >> > | > future might use other methods. Looking back over the email I had >> >> > | > with John he had suggested hint.smbios.0.anchor to make this look >> >> > | > different. This code had been hanging around for so long I forgot >> >> > | > about that and we were using hint.smbios.0.mem in our shipping code >> >> base. >> >> > | > >> >> > | > However, I hope that nothing would use this except for smbios(4) and >> >> > | > for people to make smbios(4) useful for this info. >> >> > | >> >> > | Doug's looking at me when he says that. :-) >> >> > | >> >> > | We talked about this last night at BAFUG; right now, even if smbios(4) >> >> > | is able to find the SMBIOS info -- it currently only looks at the >> >> > | aforementioned 0xf - 0xf range, so it can't find it on UEFI -- >> >> > | smbios(4) doesn't actually provide any interface for that information. >> >> > | Doug and I have talked about making smbios(4) useful, by parsing the >> >> > | data and providing KPIs and APIs, for years now; I think I'll >> >> > *finally* >> >> > | have the time and motivation to do so "soon". >> >> > >> >> > I've actually talked to a few people. However, your the first to >> >> > step up. This needs to be designed and will take some time and >> >> > review. I would hope that except for smbios(4), nothing else would >> >> > use this kenv but there is nothing to prevent that :-( I could name >> >> > it super_secret_dont_use. >> >> > >> >> > BTW, to get you started this patch prevents smbios(4) from blowing >> >> > chunks >> >> > when it gets a anchor in high memory and works on legacy machines. >> >> > >> >> > --- /sys/x86/bios/smbios.c 2013-10-01 14:28:25.0 -0700 >> >> > +++ ./smbios.c 2016-04-11 11:58:03.234969000 -0700 >> >> > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD: release/9.2.0/sys/x8 >> >> > #include >> >> > #include >> >> > #include >> >> > +#include >> >> > >> >> > #include >> >> > #include >> >> > @@ -59,7 +60,7 @@ struct smbios_softc { >> >> > }; >> >> > >> >> > #defineRES2EPS(res)((struct smbios_eps >> >> *)rman_get_virtual(res)) >> >> > -#defineADDR2EPS(addr) ((struct smbios_eps >> >> *)BIOS_PADDRTOVADDR(addr)) >> >> > +#defineADDR2EPS(addr) ((struct smbios_eps >> >> > *)PHYS_TO_DMAP(addr)) >> >> > >> >> > static devclass_t smbios_devclass; >> >> > >> >> > @@ -71,19 +72,26 @@ static int smbios_modevent (module_t, in >> >> > >> >> > static int smbios_cksum(struct smbios_eps *); >> >> > >> >> > +static unsigned long addr; >> >> > +static SYSCTL_NODE(_hw, OID_AUTO, smbios, CTLFLAG_RD, 0, >> >> > +"SMBIOS driver parameters"); >> >> > +SYSCTL_LONG(_hw_smbios, OID_AUTO, mem, CTLFLAG_RW, >> >> > +, 0, ""); >> >> > + >> >> > static void >> >> > smbios_identify (driver_t *driver, device_t parent) >> >> > { >> >> > device_t child; >> >> > - u_int32_t addr; >> >> > int length; >> >> > int rid; >> >> > >> >> > if (!device_is_alive(parent)) >> >> > return; >> >> > >> >> > - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, >> >> > - SMBIOS_STEP, SMBIOS_OFF); >> >> > + if
svn commit: r307618 - stable/11/sys/dev/hyperv/vmbus
Author: sephe Date: Wed Oct 19 07:46:20 2016 New Revision: 307618 URL: https://svnweb.freebsd.org/changeset/base/307618 Log: MFC 307263 hyperv/vmbus: Add __FBSDID Sponsored by: Microsoft Modified: stable/11/sys/dev/hyperv/vmbus/vmbus_br.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/vmbus/vmbus_br.c == --- stable/11/sys/dev/hyperv/vmbus/vmbus_br.c Wed Oct 19 07:43:39 2016 (r307617) +++ stable/11/sys/dev/hyperv/vmbus/vmbus_br.c Wed Oct 19 07:46:20 2016 (r307618) @@ -26,6 +26,9 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307617 - stable/11/sys/dev/hyperv/storvsc
Author: sephe Date: Wed Oct 19 07:43:39 2016 New Revision: 307617 URL: https://svnweb.freebsd.org/changeset/base/307617 Log: MFC 307261 hyperv/stor: Fix off-by-one bug; this brings back TRIM support. Submitted by: Hongjiang Zhang Reported by:Lili Deng Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8238 Modified: stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c == --- stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Oct 19 07:40:51 2016(r307616) +++ stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Oct 19 07:43:39 2016(r307617) @@ -2210,7 +2210,7 @@ storvsc_io_done(struct hv_storvsc_reques resp_buf[3], resp_buf[4]); } if (vm_srb->srb_status == SRB_STATUS_SUCCESS && - data_len > SHORT_INQUIRY_LENGTH) { + data_len >= SHORT_INQUIRY_LENGTH) { char vendor[16]; cam_strvis(vendor, inq_data->vendor, ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307616 - head/tools/tools/nanobsd/embedded
Author: imp Date: Wed Oct 19 07:40:51 2016 New Revision: 307616 URL: https://svnweb.freebsd.org/changeset/base/307616 Log: RPI3 is retired in preference to GENERIC-UP. Use that instead. Modified: head/tools/tools/nanobsd/embedded/rpi3.cfg Modified: head/tools/tools/nanobsd/embedded/rpi3.cfg == --- head/tools/tools/nanobsd/embedded/rpi3.cfg Wed Oct 19 07:33:43 2016 (r307615) +++ head/tools/tools/nanobsd/embedded/rpi3.cfg Wed Oct 19 07:40:51 2016 (r307616) @@ -27,7 +27,7 @@ # NANO_ARCH=aarch64 -NANO_KERNEL=RPI3 +NANO_KERNEL=GENERIC-UP NANO_DRIVE=mmcsd0 NANO_NAME=rpi3 NANO_BOOT_PKG=u-boot-rpi3 ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307615 - stable/11/sys/net
Author: sephe Date: Wed Oct 19 07:33:43 2016 New Revision: 307615 URL: https://svnweb.freebsd.org/changeset/base/307615 Log: MFC 307078 ifnet: Use if_link_state snapshot to invoke ifnet_link_event So that everyone in this task have consistent view of link state. Reviewed by:ae Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8214 Modified: stable/11/sys/net/if.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if.c == --- stable/11/sys/net/if.c Wed Oct 19 07:27:45 2016(r307614) +++ stable/11/sys/net/if.c Wed Oct 19 07:33:43 2016(r307615) @@ -2206,7 +2206,7 @@ do_link_state_change(void *arg, int pend if (log_link_state_change) log(LOG_NOTICE, "%s: link state changed to %s\n", ifp->if_xname, (link_state == LINK_STATE_UP) ? "UP" : "DOWN" ); - EVENTHANDLER_INVOKE(ifnet_link_event, ifp, ifp->if_link_state); + EVENTHANDLER_INVOKE(ifnet_link_event, ifp, link_state); CURVNET_RESTORE(); } ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307614 - in stable/11/sys/dev/hyperv: include netvsc vmbus
Author: sephe Date: Wed Oct 19 07:27:45 2016 New Revision: 307614 URL: https://svnweb.freebsd.org/changeset/base/307614 Log: MFC 307012,307013,307262 307012 hyperv/vmbus: Allow driver to inject synchronous task into channel taskq. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8208 307013 hyperv/hn: Rework link status support. This is the preamble for network device SR-IOV and NDIS_STATUS_NETWORK_CHANGE handling. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8209 307262 hyperv/hn: Management parts always need suspend and resume. Sponsored by: Microsoft Modified: stable/11/sys/dev/hyperv/include/vmbus.h stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/11/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/11/sys/dev/hyperv/netvsc/if_hnvar.h stable/11/sys/dev/hyperv/vmbus/vmbus_chan.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/include/vmbus.h == --- stable/11/sys/dev/hyperv/include/vmbus.hWed Oct 19 07:24:32 2016 (r307613) +++ stable/11/sys/dev/hyperv/include/vmbus.hWed Oct 19 07:27:45 2016 (r307614) @@ -117,6 +117,7 @@ struct vmbus_chan_br { struct vmbus_channel; struct hyperv_guid; +struct task; typedef void (*vmbus_chan_callback_t)(struct vmbus_channel *, void *); @@ -134,6 +135,8 @@ int vmbus_chan_open_br(struct vmbus_cha int udlen, vmbus_chan_callback_t cb, void *cbarg); void vmbus_chan_close(struct vmbus_channel *chan); void vmbus_chan_intr_drain(struct vmbus_channel *chan); +void vmbus_chan_run_task(struct vmbus_channel *chan, + struct task *task); intvmbus_chan_gpadl_connect(struct vmbus_channel *chan, bus_addr_t paddr, int size, uint32_t *gpadl); Modified: stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.h == --- stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Oct 19 07:24:32 2016(r307613) +++ stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Oct 19 07:27:45 2016(r307614) @@ -233,6 +233,10 @@ struct hn_softc { struct vmbus_xact_ctx *hn_xact; uint32_thn_nvs_ver; + struct taskqueue*hn_mgmt_taskq; + struct taskqueue*hn_mgmt_taskq0; + struct task hn_link_task; + uint32_thn_caps;/* HN_CAP_ */ uint32_thn_flags; /* HN_FLAG_ */ void*hn_rxbuf; @@ -271,7 +275,6 @@ struct hn_softc { */ struct hn_send_ctx; -void netvsc_linkstatus_callback(struct hn_softc *sc, uint32_t status); int hv_nv_on_send(struct vmbus_channel *chan, uint32_t rndis_mtype, struct hn_send_ctx *sndc, struct vmbus_gpa *gpa, int gpa_cnt); Modified: stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 19 07:24:32 2016(r307613) +++ stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 19 07:27:45 2016(r307614) @@ -334,6 +334,8 @@ static void hn_fixup_tx_data(struct hn_s static void hn_destroy_tx_data(struct hn_softc *); static void hn_start_taskfunc(void *, int); static void hn_start_txeof_taskfunc(void *, int); +static void hn_link_taskfunc(void *, int); +static void hn_suspend_mgmt_taskfunc(void *, int); static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); static int hn_create_rx_data(struct hn_softc *sc, int); static void hn_destroy_rx_data(struct hn_softc *sc); @@ -349,7 +351,11 @@ static int hn_synth_attach(struct hn_sof static void hn_synth_detach(struct hn_softc *); static bool hn_tx_ring_pending(struct hn_tx_ring *); static void hn_suspend(struct hn_softc *); +static void hn_suspend_data(struct hn_softc *); +static void hn_suspend_mgmt(struct hn_softc *); static void hn_resume(struct hn_softc *); +static void hn_resume_data(struct hn_softc *); +static void hn_resume_mgmt(struct hn_softc *); static void hn_rx_drain(struct vmbus_channel *); static void hn_tx_resume(struct hn_softc *, int); static void hn_tx_ring_qflush(struct hn_tx_ring *); @@ -518,7 +524,6 @@ netvsc_attach(device_t dev) struct sysctl_oid_list *child; struct sysctl_ctx_list *ctx; uint8_t eaddr[ETHER_ADDR_LEN]; - uint32_t link_status; struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; @@ -551,6 +556,15 @@ netvsc_attach(device_t dev) } /* +* Setup taskqueue for mangement tasks, e.g. link status. +*/ +
svn commit: r307613 - in stable/11/sys: dev/hyperv/netvsc net
Author: sephe Date: Wed Oct 19 07:24:32 2016 New Revision: 307613 URL: https://svnweb.freebsd.org/changeset/base/307613 Log: MFC 306936-306939 306936 hyperv/hn: Fix checksum offload settings The _correct_ way to identify the supported checksum offloading and TSO parameters is to query OID_TCP_OFFLOAD_HARDWARE_CAPABILITIES. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8088 306937 hyperv/hn: Fix if_hw_tsomax setup. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8089 306938 hyperv/hn: Generalize RSS capabilities query. - Support NDIS < 6.30. - Stringent response checks. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8090 306939 hyperv/hn: Suffix NDIS offload size with NDIS version. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8091 Modified: stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c stable/11/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/11/sys/dev/hyperv/netvsc/if_hnvar.h stable/11/sys/dev/hyperv/netvsc/ndis.h stable/11/sys/net/rndis.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.h == --- stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Oct 19 07:16:26 2016(r307612) +++ stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Oct 19 07:24:32 2016(r307613) @@ -244,6 +244,8 @@ struct hn_softc { uint32_thn_rndis_rid; uint32_thn_ndis_ver; + int hn_ndis_tso_szmax; + int hn_ndis_tso_sgmin; struct ndis_rssprm_toeplitz hn_rss; }; Modified: stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 19 07:16:26 2016(r307612) +++ stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 19 07:24:32 2016(r307613) @@ -230,7 +230,7 @@ SYSCTL_INT(_hw_hn, OID_AUTO, trust_hosti "when csum info is missing (global setting)"); /* Limit TSO burst size */ -static int hn_tso_maxlen = 0; +static int hn_tso_maxlen = IP_MAXPACKET; SYSCTL_INT(_hw_hn, OID_AUTO, tso_maxlen, CTLFLAG_RDTUN, _tso_maxlen, 0, "TSO burst limit"); @@ -338,6 +338,7 @@ static int hn_encap(struct hn_tx_ring *, static int hn_create_rx_data(struct hn_softc *sc, int); static void hn_destroy_rx_data(struct hn_softc *sc); static void hn_set_chim_size(struct hn_softc *, int); +static void hn_set_tso_maxsize(struct hn_softc *, int, int); static int hn_chan_attach(struct hn_softc *, struct vmbus_channel *); static void hn_chan_detach(struct hn_softc *, struct vmbus_channel *); static int hn_attach_subchans(struct hn_softc *); @@ -520,7 +521,6 @@ netvsc_attach(device_t dev) uint32_t link_status; struct ifnet *ifp = NULL; int error, ring_cnt, tx_ring_cnt; - int tso_maxlen; sc->hn_dev = dev; sc->hn_prichan = vmbus_get_channel(dev); @@ -720,18 +720,16 @@ netvsc_attach(device_t dev) /* Enable all available capabilities by default. */ ifp->if_capenable = ifp->if_capabilities; - tso_maxlen = hn_tso_maxlen; - if (tso_maxlen <= 0 || tso_maxlen > IP_MAXPACKET) - tso_maxlen = IP_MAXPACKET; - ifp->if_hw_tsomaxsegcount = HN_TX_DATA_SEGCNT_MAX; - ifp->if_hw_tsomaxsegsize = PAGE_SIZE; - ifp->if_hw_tsomax = tso_maxlen - - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); + if (ifp->if_capabilities & (IFCAP_TSO6 | IFCAP_TSO4)) { + hn_set_tso_maxsize(sc, hn_tso_maxlen, ETHERMTU); + ifp->if_hw_tsomaxsegcount = HN_TX_DATA_SEGCNT_MAX; + ifp->if_hw_tsomaxsegsize = PAGE_SIZE; + } ether_ifattach(ifp, eaddr); - if (bootverbose) { - if_printf(ifp, "TSO: %u/%u/%u\n", ifp->if_hw_tsomax, + if ((ifp->if_capabilities & (IFCAP_TSO6 | IFCAP_TSO4)) && bootverbose) { + if_printf(ifp, "TSO segcnt %u segsz %u\n", ifp->if_hw_tsomaxsegcount, ifp->if_hw_tsomaxsegsize); } @@ -1672,6 +1670,7 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, if (sc->hn_tx_ring[0].hn_chim_size > sc->hn_chim_szmax) hn_set_chim_size(sc, sc->hn_chim_szmax); + hn_set_tso_maxsize(sc, hn_tso_maxlen, ifr->ifr_mtu); /* All done! Resume now. */ if (ifp->if_drv_flags & IFF_DRV_RUNNING) @@ -2919,6 +2918,34 @@ hn_set_chim_size(struct hn_softc *sc, in } static void +hn_set_tso_maxsize(struct hn_softc *sc, int
svn commit: r307612 - in stable/11/sys: dev/hyperv/netvsc modules/hyperv/vmbus net
Author: sephe Date: Wed Oct 19 07:16:26 2016 New Revision: 307612 URL: https://svnweb.freebsd.org/changeset/base/307612 Log: MFC 306484,306485 306484 hyperv/vmbus: Add missing vmbus_if.c to module build. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8067 306485 hyperv/hn: Add stubs for OFFLOAD_CURRENT_CONFIG and NETWORK_CHANGE status Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8068 Modified: stable/11/sys/dev/hyperv/netvsc/hv_rndis_filter.c stable/11/sys/modules/hyperv/vmbus/Makefile stable/11/sys/net/rndis.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/hv_rndis_filter.c == --- stable/11/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Oct 19 07:08:28 2016(r307611) +++ stable/11/sys/dev/hyperv/netvsc/hv_rndis_filter.c Wed Oct 19 07:16:26 2016(r307612) @@ -155,6 +155,15 @@ hv_rf_receive_indicate_status(struct hn_ netvsc_linkstatus_callback(sc, 0); break; + case RNDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG: + /* Not really useful; ignore. */ + break; + + case RNDIS_STATUS_NETWORK_CHANGE: + /* TODO */ + if_printf(sc->hn_ifp, "network changed\n"); + break; + default: /* TODO: */ if_printf(sc->hn_ifp, "unknown RNDIS status 0x%08x\n", Modified: stable/11/sys/modules/hyperv/vmbus/Makefile == --- stable/11/sys/modules/hyperv/vmbus/Makefile Wed Oct 19 07:08:28 2016 (r307611) +++ stable/11/sys/modules/hyperv/vmbus/Makefile Wed Oct 19 07:16:26 2016 (r307612) @@ -11,6 +11,7 @@ SRCS= hyperv.c \ vmbus_br.c \ vmbus_chan.c \ vmbus_et.c \ + vmbus_if.c \ vmbus_xact.c SRCS+= acpi_if.h bus_if.h device_if.h opt_acpi.h vmbus_if.h Modified: stable/11/sys/net/rndis.h == --- stable/11/sys/net/rndis.h Wed Oct 19 07:08:28 2016(r307611) +++ stable/11/sys/net/rndis.h Wed Oct 19 07:16:26 2016(r307612) @@ -31,6 +31,8 @@ #defineRNDIS_STATUS_PENDING0x0103L #defineRNDIS_STATUS_MEDIA_CONNECT 0x4001000BL #defineRNDIS_STATUS_MEDIA_DISCONNECT 0x4001000CL +#defineRNDIS_STATUS_NETWORK_CHANGE 0x40010018L +#defineRNDIS_STATUS_TASK_OFFLOAD_CURRENT_CONFIG0x40020006L #defineRNDIS_STATUS_BUFFER_OVERFLOW0x8005L #defineRNDIS_STATUS_FAILURE0xC001L #defineRNDIS_STATUS_NOT_SUPPORTED 0xC0BBL ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307611 - stable/11/sys/dev/hyperv/netvsc
Author: sephe Date: Wed Oct 19 07:08:28 2016 New Revision: 307611 URL: https://svnweb.freebsd.org/changeset/base/307611 Log: MFC 306482,306483 306482 hyperv/hn: If synthetic parts are detached, don't touch them. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8065 306483 hyperv/hn: Fix detach and attach error handling. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8066 Modified: stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.h == --- stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Oct 19 07:03:54 2016(r307610) +++ stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Oct 19 07:08:28 2016(r307611) @@ -252,6 +252,7 @@ struct hn_softc { #define HN_FLAG_CHIM_CONNECTED 0x0002 #define HN_FLAG_HAS_RSSKEY 0x0004 #define HN_FLAG_HAS_RSSIND 0x0008 +#define HN_FLAG_SYNTH_ATTACHED 0x0010 #define HN_CAP_VLAN0x0001 #define HN_CAP_MTU 0x0002 Modified: stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 19 07:03:54 2016(r307610) +++ stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 19 07:08:28 2016(r307611) @@ -352,6 +352,7 @@ static void hn_resume(struct hn_softc *) static void hn_rx_drain(struct vmbus_channel *); static void hn_tx_resume(struct hn_softc *, int); static void hn_tx_ring_qflush(struct hn_tx_ring *); +static int netvsc_detach(device_t dev); static void hn_nvs_handle_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt); @@ -405,6 +406,9 @@ hn_rss_reconfig(struct hn_softc *sc) HN_LOCK_ASSERT(sc); + if ((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0) + return (ENXIO); + /* * Disable RSS first. * @@ -736,27 +740,28 @@ netvsc_attach(device_t dev) return (0); failed: - /* TODO: reuse netvsc_detach() */ - hn_destroy_tx_data(sc); - if (ifp != NULL) - if_free(ifp); + if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) + hn_synth_detach(sc); + netvsc_detach(dev); return (error); } -/* - * TODO: Use this for error handling on attach path. - */ static int netvsc_detach(device_t dev) { struct hn_softc *sc = device_get_softc(dev); + struct ifnet *ifp = sc->hn_ifp; - /* TODO: ether_ifdetach */ - - HN_LOCK(sc); - /* TODO: hn_stop */ - hn_synth_detach(sc); - HN_UNLOCK(sc); + if (device_is_attached(dev)) { + HN_LOCK(sc); + if (sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) + hn_stop(sc); + hn_synth_detach(sc); + } + HN_UNLOCK(sc); + ether_ifdetach(ifp); + } ifmedia_removeall(>hn_media); hn_destroy_rx_data(sc); @@ -765,10 +770,12 @@ netvsc_detach(device_t dev) if (sc->hn_tx_taskq != hn_tx_taskq) taskqueue_free(sc->hn_tx_taskq); - vmbus_xact_ctx_destroy(sc->hn_xact); - HN_LOCK_DESTROY(sc); + if (sc->hn_xact != NULL) + vmbus_xact_ctx_destroy(sc->hn_xact); + + if_free(ifp); - /* TODO: if_free */ + HN_LOCK_DESTROY(sc); return (0); } @@ -1618,6 +1625,11 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, HN_LOCK(sc); + if ((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0) { + HN_UNLOCK(sc); + break; + } + if ((sc->hn_caps & HN_CAP_MTU) == 0) { /* Can't change MTU */ HN_UNLOCK(sc); @@ -1671,6 +1683,11 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, case SIOCSIFFLAGS: HN_LOCK(sc); + if ((sc->hn_flags & HN_FLAG_SYNTH_ATTACHED) == 0) { + HN_UNLOCK(sc); + break; + } + if (ifp->if_flags & IFF_UP) { /* * If only the state of the PROMISC flag changed, @@ -1782,6 +1799,9 @@ hn_stop(struct hn_softc *sc) HN_LOCK_ASSERT(sc); + KASSERT(sc->hn_flags & HN_FLAG_SYNTH_ATTACHED, + ("synthetic parts were not attached")); + /* Clear RUNNING bit _before_ hn_suspend() */ atomic_clear_int(>if_drv_flags, IFF_DRV_RUNNING); hn_suspend(sc); @@ -1858,6
svn commit: r307610 - stable/11/sys/x86/x86
Author: sephe Date: Wed Oct 19 07:03:54 2016 New Revision: 307610 URL: https://svnweb.freebsd.org/changeset/base/307610 Log: MFC 306481 x86/ioapic: Fix destination cpu for Hyper-V On Hyper-V: - Stick to the first cpu for all I/O APIC pins. - And don't allow destination cpu changes. Reviewed by:jhb Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7949 Modified: stable/11/sys/x86/x86/io_apic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/io_apic.c == --- stable/11/sys/x86/x86/io_apic.c Wed Oct 19 06:59:45 2016 (r307609) +++ stable/11/sys/x86/x86/io_apic.c Wed Oct 19 07:03:54 2016 (r307610) @@ -412,6 +412,18 @@ ioapic_assign_cpu(struct intsrc *isrc, u u_int old_id; /* +* On Hyper-V: +* - Stick to the first cpu for all I/O APIC pins. +* - And don't allow destination cpu changes. +*/ + if (vm_guest == VM_GUEST_HV) { + if (intpin->io_vector) + return (EINVAL); + else + apic_id = 0; + } + + /* * keep 1st core as the destination for NMI */ if (intpin->io_irq == IRQ_NMI) ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307609 - stable/11/sys/dev/hyperv/netvsc
Author: sephe Date: Wed Oct 19 06:59:45 2016 New Revision: 307609 URL: https://svnweb.freebsd.org/changeset/base/307609 Log: MFC 306433 hyperv/hn: Don't set HASHVAL pktinfo for NDIS < 6.30 This unbreaks packet sending on WS2008R2. Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8057 Modified: stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.h == --- stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Oct 19 06:57:18 2016(r307608) +++ stable/11/sys/dev/hyperv/netvsc/hv_net_vsc.hWed Oct 19 06:59:45 2016(r307609) @@ -168,6 +168,7 @@ struct hn_tx_ring { struct buf_ring *hn_mbuf_br; int hn_oactive; int hn_tx_idx; + int hn_tx_flags; struct mtx hn_tx_lock; struct hn_softc *hn_sc; @@ -194,10 +195,10 @@ struct hn_tx_ring { struct hn_txdesc *hn_txdesc; bus_dma_tag_t hn_tx_rndis_dtag; struct sysctl_oid *hn_tx_sysctl_tree; - int hn_tx_flags; } __aligned(CACHE_LINE_SIZE); #define HN_TX_FLAG_ATTACHED0x1 +#define HN_TX_FLAG_HASHVAL 0x2 /* support HASHVAL pktinfo */ /* * Device-specific softc structure Modified: stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 19 06:57:18 2016(r307608) +++ stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 19 06:59:45 2016(r307609) @@ -1006,14 +1006,16 @@ hn_encap(struct hn_tx_ring *txr, struct pkt->rm_pktinfooffset = sizeof(*pkt); pkt->rm_pktinfolen = 0; - /* -* Set the hash value for this packet, so that the host could -* dispatch the TX done event for this packet back to this TX -* ring's channel. -*/ - pi_data = hn_rndis_pktinfo_append(pkt, HN_RNDIS_PKT_LEN, - HN_NDIS_HASH_VALUE_SIZE, HN_NDIS_PKTINFO_TYPE_HASHVAL); - *pi_data = txr->hn_tx_idx; + if (txr->hn_tx_flags & HN_TX_FLAG_HASHVAL) { + /* +* Set the hash value for this packet, so that the host could +* dispatch the TX done event for this packet back to this TX +* ring's channel. +*/ + pi_data = hn_rndis_pktinfo_append(pkt, HN_RNDIS_PKT_LEN, + HN_NDIS_HASH_VALUE_SIZE, HN_NDIS_PKTINFO_TYPE_HASHVAL); + *pi_data = txr->hn_tx_idx; + } if (m_head->m_flags & M_VLANTAG) { pi_data = hn_rndis_pktinfo_append(pkt, HN_RNDIS_PKT_LEN, @@ -2920,6 +2922,12 @@ hn_fixup_tx_data(struct hn_softc *sc) for (i = 0; i < sc->hn_tx_ring_cnt; ++i) sc->hn_tx_ring[i].hn_csum_assist = csum_assist; + + if (sc->hn_ndis_ver >= HN_NDIS_VERSION_6_30) { + /* Support HASHVAL pktinfo on TX path. */ + for (i = 0; i < sc->hn_tx_ring_cnt; ++i) + sc->hn_tx_ring[i].hn_tx_flags |= HN_TX_FLAG_HASHVAL; + } } static void ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"
svn commit: r307608 - stable/11/sys/dev/hyperv/netvsc
Author: sephe Date: Wed Oct 19 06:57:18 2016 New Revision: 307608 URL: https://svnweb.freebsd.org/changeset/base/307608 Log: MFC 306431,306432 306431 hyperv/hn: Move TX tasks' draining into hn_suspend(). This prepares to consolidate hn_stop() and netvsc_detach(). Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8055 306432 hyperv/hn: Consolidate hn_init() and hn_stop() Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D8056 Modified: stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 19 06:45:53 2016(r307607) +++ stable/11/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Wed Oct 19 06:57:18 2016(r307608) @@ -334,7 +334,6 @@ static void hn_fixup_tx_data(struct hn_s static void hn_destroy_tx_data(struct hn_softc *); static void hn_start_taskfunc(void *, int); static void hn_start_txeof_taskfunc(void *, int); -static void hn_stop_tx_tasks(struct hn_softc *); static int hn_encap(struct hn_tx_ring *, struct hn_txdesc *, struct mbuf **); static int hn_create_rx_data(struct hn_softc *sc, int); static void hn_destroy_rx_data(struct hn_softc *sc); @@ -350,6 +349,8 @@ static void hn_synth_detach(struct hn_so static bool hn_tx_ring_pending(struct hn_tx_ring *); static void hn_suspend(struct hn_softc *); static void hn_resume(struct hn_softc *); +static void hn_rx_drain(struct vmbus_channel *); +static void hn_tx_resume(struct hn_softc *, int); static void hn_tx_ring_qflush(struct hn_tx_ring *); static void hn_nvs_handle_notify(struct hn_softc *sc, @@ -757,8 +758,6 @@ netvsc_detach(device_t dev) hn_synth_detach(sc); HN_UNLOCK(sc); - hn_stop_tx_tasks(sc); - ifmedia_removeall(>hn_media); hn_destroy_rx_data(sc); hn_destroy_tx_data(sc); @@ -1776,25 +1775,19 @@ hn_ioctl(struct ifnet *ifp, u_long cmd, static void hn_stop(struct hn_softc *sc) { - struct ifnet *ifp; + struct ifnet *ifp = sc->hn_ifp; int i; HN_LOCK_ASSERT(sc); - ifp = sc->hn_ifp; - - if (bootverbose) - printf(" Closing Device ...\n"); + /* Clear RUNNING bit _before_ hn_suspend() */ + atomic_clear_int(>if_drv_flags, IFF_DRV_RUNNING); + hn_suspend(sc); - atomic_clear_int(>if_drv_flags, - (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)); + /* Clear OACTIVE bit. */ + atomic_clear_int(>if_drv_flags, IFF_DRV_OACTIVE); for (i = 0; i < sc->hn_tx_ring_inuse; ++i) sc->hn_tx_ring[i].hn_oactive = 0; - - if_link_state_change(ifp, LINK_STATE_DOWN); - - /* Disable RX by clearing RX filter. */ - hn_rndis_set_rxfilter(sc, 0); } /* @@ -1858,27 +1851,29 @@ do_sched: static void hn_init_locked(struct hn_softc *sc) { - struct ifnet *ifp; - int ret, i; + struct ifnet *ifp = sc->hn_ifp; + int i; HN_LOCK_ASSERT(sc); - ifp = sc->hn_ifp; - - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + if (ifp->if_drv_flags & IFF_DRV_RUNNING) return; - } /* TODO: add hn_rx_filter */ - ret = hn_rndis_set_rxfilter(sc, NDIS_PACKET_TYPE_PROMISCUOUS); - if (ret != 0) - return; + hn_rndis_set_rxfilter(sc, NDIS_PACKET_TYPE_PROMISCUOUS); + /* Clear OACTIVE bit. */ atomic_clear_int(>if_drv_flags, IFF_DRV_OACTIVE); for (i = 0; i < sc->hn_tx_ring_inuse; ++i) sc->hn_tx_ring[i].hn_oactive = 0; + /* Clear TX 'suspended' bit. */ + hn_tx_resume(sc, sc->hn_tx_ring_inuse); + + /* Everything is ready; unleash! */ atomic_set_int(>if_drv_flags, IFF_DRV_RUNNING); + + /* TODO: check RNDIS link status. */ if_link_state_change(ifp, LINK_STATE_UP); } @@ -2971,19 +2966,6 @@ hn_start_txeof_taskfunc(void *xtxr, int mtx_unlock(>hn_tx_lock); } -static void -hn_stop_tx_tasks(struct hn_softc *sc) -{ - int i; - - for (i = 0; i < sc->hn_tx_ring_inuse; ++i) { - struct hn_tx_ring *txr = >hn_tx_ring[i]; - - taskqueue_drain(txr->hn_tx_taskq, >hn_tx_task); - taskqueue_drain(txr->hn_tx_taskq, >hn_txeof_task); - } -} - static int hn_xmit(struct hn_tx_ring *txr, int len) { @@ -3571,6 +3553,9 @@ hn_suspend(struct hn_softc *sc) /* Wait for all pending sends to finish. */ while (hn_tx_ring_pending(txr)) pause("hnwtx", 1 /* 1 tick */); + + taskqueue_drain(txr->hn_tx_taskq, >hn_tx_task); + taskqueue_drain(txr->hn_tx_taskq, >hn_txeof_task); } /* @@ -3601,9
svn commit: r307607 - in stable/11/sys: conf dev/hyperv/stordisengage dev/hyperv/storvsc modules/hyperv modules/hyperv/stordisengage
Author: sephe Date: Wed Oct 19 06:45:53 2016 New Revision: 307607 URL: https://svnweb.freebsd.org/changeset/base/307607 Log: MFC 306426 hyperv/storvsc: Fix the blkvsc disk attachment issues. - The original 'disengage' ATA controller model does not work properly for all possible disk configurations. Use the newly added ATA disk veto eventhandler to fit into all possible disk configuration. - If the 'invalid LUN' happens on blkvsc controllers, return CAM_DEV_NOT_THERE so that CAM will not destroy attached disks under the blkvsc controllers. Submitted by: Hongjiang Zhang Discussed with: mav Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7693 Deleted: stable/11/sys/dev/hyperv/stordisengage/ stable/11/sys/modules/hyperv/stordisengage/ Modified: stable/11/sys/conf/files.amd64 stable/11/sys/conf/files.i386 stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c stable/11/sys/modules/hyperv/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files.amd64 == --- stable/11/sys/conf/files.amd64 Wed Oct 19 06:15:27 2016 (r307606) +++ stable/11/sys/conf/files.amd64 Wed Oct 19 06:45:53 2016 (r307607) @@ -294,7 +294,6 @@ dev/hwpmc/hwpmc_x86.c optionalhwpmc dev/hyperv/netvsc/hv_net_vsc.c optionalhyperv dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c optionalhyperv dev/hyperv/netvsc/hv_rndis_filter.coptionalhyperv -dev/hyperv/stordisengage/hv_ata_pci_disengage.coptional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.coptionalhyperv dev/hyperv/utilities/hv_heartbeat.coptionalhyperv dev/hyperv/utilities/hv_kvp.c optionalhyperv Modified: stable/11/sys/conf/files.i386 == --- stable/11/sys/conf/files.i386 Wed Oct 19 06:15:27 2016 (r307606) +++ stable/11/sys/conf/files.i386 Wed Oct 19 06:45:53 2016 (r307607) @@ -251,7 +251,6 @@ dev/hwpmc/hwpmc_x86.c optional hwpmc dev/hyperv/netvsc/hv_net_vsc.c optionalhyperv dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c optionalhyperv dev/hyperv/netvsc/hv_rndis_filter.coptionalhyperv -dev/hyperv/stordisengage/hv_ata_pci_disengage.coptional hyperv dev/hyperv/storvsc/hv_storvsc_drv_freebsd.coptionalhyperv dev/hyperv/utilities/hv_heartbeat.coptionalhyperv dev/hyperv/utilities/hv_kvp.c optionalhyperv Modified: stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c == --- stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Oct 19 06:15:27 2016(r307606) +++ stable/11/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c Wed Oct 19 06:45:53 2016(r307607) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -202,6 +203,7 @@ struct storvsc_softc { struct vmbus_channel*hs_sel_chan[MAXCPU]; }; +static eventhandler_tag storvsc_handler_tag; /* * The size of the vmscsi_request has changed in win8. The * additional size is for the newly added elements in the @@ -898,21 +900,15 @@ hv_storvsc_on_channel_callback(struct vm static int storvsc_probe(device_t dev) { - int ata_disk_enable = 0; int ret = ENXIO; switch (storvsc_get_storage_type(dev)) { case DRIVER_BLKVSC: if(bootverbose) - device_printf(dev, "DRIVER_BLKVSC-Emulated ATA/IDE probe\n"); - if (!getenv_int("hw.ata.disk_enable", _disk_enable)) { - if(bootverbose) - device_printf(dev, - "Enlightened ATA/IDE detected\n"); - device_set_desc(dev, g_drv_props_table[DRIVER_BLKVSC].drv_desc); - ret = BUS_PROBE_DEFAULT; - } else if(bootverbose) - device_printf(dev, "Emulated ATA/IDE set (hw.ata.disk_enable set)\n"); + device_printf(dev, + "Enlightened ATA/IDE detected\n"); + device_set_desc(dev, g_drv_props_table[DRIVER_BLKVSC].drv_desc); + ret = BUS_PROBE_DEFAULT; break; case DRIVER_STORVSC: if(bootverbose) @@ -2155,27 +2151,45 @@ storvsc_io_done(struct hv_storvsc_reques ccb->ccb_h.status &= ~CAM_STATUS_MASK;
Re: svn commit: r307326 - head/sys/boot/efi/loader
On Tuesday, October 18, 2016 11:44:52 PM Warner Losh wrote: > On Mon, Oct 17, 2016 at 11:40 AM, John Baldwinwrote: > > On Friday, October 14, 2016 12:25:54 PM Warner Losh wrote: > >> On Oct 14, 2016 11:55 AM, "Doug Ambrisko" wrote: > >> > > >> > On Fri, Oct 14, 2016 at 10:33:15AM -0700, Ravi Pokala wrote: > >> > | -Original Message- > >> > | > From: on behalf of Doug Ambrisko < > >> ambri...@ambrisko.com> > >> > | > Date: 2016-10-14, Friday at 10:27 > >> > | > To: Warner Losh > >> > | > Cc: Doug Ambrisko , src-committers < > >> src-committ...@freebsd.org>, "svn-src-all@freebsd.org" < > >> svn-src-all@freebsd.org>, "svn-src-h...@freebsd.org" < > >> svn-src-h...@freebsd.org> > >> > | > Subject: Re: svn commit: r307326 - head/sys/boot/efi/loader > >> > | > > >> > | > On Fri, Oct 14, 2016 at 11:16:02AM -0600, Warner Losh wrote: > >> > | > | Love the functionality, but don't like using the 'hint' namespace > >> for > >> > | > | this. Can we change it now before too many things depend on it? We > >> had > >> > | > | similar issues in ACPI and moved it to the 'acpi' space. Can we > >> > move > >> > | > | this to the 'smbios' space please? > >> > | > | > >> > | > | The reason is that 'hint' is special and sometimes filtered out, so > >> it > >> > | > | is a poor choice to export data from the boot loader to the kernel. > >> > | > > >> > | > The reason I picked hint was it could be put /boot/device.hints > >> > | > to make it work as well and that it was a hint. Other standards in > >> the > >> > | > future might use other methods. Looking back over the email I had > >> > | > with John he had suggested hint.smbios.0.anchor to make this look > >> > | > different. This code had been hanging around for so long I forgot > >> > | > about that and we were using hint.smbios.0.mem in our shipping code > >> base. > >> > | > > >> > | > However, I hope that nothing would use this except for smbios(4) and > >> > | > for people to make smbios(4) useful for this info. > >> > | > >> > | Doug's looking at me when he says that. :-) > >> > | > >> > | We talked about this last night at BAFUG; right now, even if smbios(4) > >> > | is able to find the SMBIOS info -- it currently only looks at the > >> > | aforementioned 0xf - 0xf range, so it can't find it on UEFI -- > >> > | smbios(4) doesn't actually provide any interface for that information. > >> > | Doug and I have talked about making smbios(4) useful, by parsing the > >> > | data and providing KPIs and APIs, for years now; I think I'll *finally* > >> > | have the time and motivation to do so "soon". > >> > > >> > I've actually talked to a few people. However, your the first to > >> > step up. This needs to be designed and will take some time and > >> > review. I would hope that except for smbios(4), nothing else would > >> > use this kenv but there is nothing to prevent that :-( I could name > >> > it super_secret_dont_use. > >> > > >> > BTW, to get you started this patch prevents smbios(4) from blowing chunks > >> > when it gets a anchor in high memory and works on legacy machines. > >> > > >> > --- /sys/x86/bios/smbios.c 2013-10-01 14:28:25.0 -0700 > >> > +++ ./smbios.c 2016-04-11 11:58:03.234969000 -0700 > >> > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD: release/9.2.0/sys/x8 > >> > #include > >> > #include > >> > #include > >> > +#include > >> > > >> > #include > >> > #include > >> > @@ -59,7 +60,7 @@ struct smbios_softc { > >> > }; > >> > > >> > #defineRES2EPS(res)((struct smbios_eps > >> *)rman_get_virtual(res)) > >> > -#defineADDR2EPS(addr) ((struct smbios_eps > >> *)BIOS_PADDRTOVADDR(addr)) > >> > +#defineADDR2EPS(addr) ((struct smbios_eps *)PHYS_TO_DMAP(addr)) > >> > > >> > static devclass_t smbios_devclass; > >> > > >> > @@ -71,19 +72,26 @@ static int smbios_modevent (module_t, in > >> > > >> > static int smbios_cksum(struct smbios_eps *); > >> > > >> > +static unsigned long addr; > >> > +static SYSCTL_NODE(_hw, OID_AUTO, smbios, CTLFLAG_RD, 0, > >> > +"SMBIOS driver parameters"); > >> > +SYSCTL_LONG(_hw_smbios, OID_AUTO, mem, CTLFLAG_RW, > >> > +, 0, ""); > >> > + > >> > static void > >> > smbios_identify (driver_t *driver, device_t parent) > >> > { > >> > device_t child; > >> > - u_int32_t addr; > >> > int length; > >> > int rid; > >> > > >> > if (!device_is_alive(parent)) > >> > return; > >> > > >> > - addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, SMBIOS_LEN, > >> > - SMBIOS_STEP, SMBIOS_OFF); > >> > + if (resource_long_value("smbios", 0, "mem", ) != 0 || > >> > + addr == 0) > >> > + addr = bios_sigsearch(SMBIOS_START, SMBIOS_SIG, > >> SMBIOS_LEN, > >> > + SMBIOS_STEP, SMBIOS_OFF); > >> >
svn commit: r307606 - in stable/11/sys: cam/ata sys
Author: sephe Date: Wed Oct 19 06:15:27 2016 New Revision: 307606 URL: https://svnweb.freebsd.org/changeset/base/307606 Log: MFC 306396 cam/ata: Allow drivers to veto ATA disk attachment. This eventhandler is mainly used by VMs, e.g. Hyper-V, whose disk controllers share the disks with the simulated ATA controllers. Submitted by: Hongjiang Zhang Discussed with: mav Sponsored by: Microsoft Differential Revision: https://reviews.freebsd.org/D7693 Modified: stable/11/sys/cam/ata/ata_xpt.c stable/11/sys/sys/eventhandler.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ata/ata_xpt.c == --- stable/11/sys/cam/ata/ata_xpt.c Wed Oct 19 05:53:43 2016 (r307605) +++ stable/11/sys/cam/ata/ata_xpt.c Wed Oct 19 06:15:27 2016 (r307606) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -824,12 +825,24 @@ noerror: { struct ccb_pathinq cpi; int16_t *ptr; + int veto = 0; ident_buf = >ident_data; for (ptr = (int16_t *)ident_buf; ptr < (int16_t *)ident_buf + sizeof(struct ata_params)/2; ptr++) { *ptr = le16toh(*ptr); } + + /* +* Allow others to veto this ATA disk attachment. This +* is mainly used by VMs, whose disk controllers may +* share the disks with the simulated ATA controllers. +*/ + EVENTHANDLER_INVOKE(ada_probe_veto, path, ident_buf, ); + if (veto) { + goto device_fail; + } + if (strncmp(ident_buf->model, "FX", 2) && strncmp(ident_buf->model, "NEC", 3) && strncmp(ident_buf->model, "Pioneer", 7) && Modified: stable/11/sys/sys/eventhandler.h == --- stable/11/sys/sys/eventhandler.hWed Oct 19 05:53:43 2016 (r307605) +++ stable/11/sys/sys/eventhandler.hWed Oct 19 06:15:27 2016 (r307606) @@ -270,4 +270,11 @@ typedef void (*unregister_framebuffer_fn EVENTHANDLER_DECLARE(register_framebuffer, register_framebuffer_fn); EVENTHANDLER_DECLARE(unregister_framebuffer, unregister_framebuffer_fn); +/* Veto ada attachment */ +struct cam_path; +struct ata_params; +typedef void (*ada_probe_veto_fn)(void *, struct cam_path *, +struct ata_params *, int *); +EVENTHANDLER_DECLARE(ada_probe_veto, ada_probe_veto_fn); + #endif /* _SYS_EVENTHANDLER_H_ */ ___ svn-src-all@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"