Re: svn commit: r301849 - head/sys/mips/mips
I'll test that now. Thanks! -a On 13 June 2016 at 18:36, Alexander Kabaevwrote: > On Mon, 13 Jun 2016 03:17:00 + (UTC) > Adrian Chadd wrote: > >> Author: adrian >> Date: Mon Jun 13 03:17:00 2016 >> New Revision: 301849 >> URL: https://svnweb.freebsd.org/changeset/base/301849 >> >> Log: >> [mips] set hardfloat for fpu instruction generation for >> gcc/binutils 5.x >> This allows -HEAD to be compiled again using the gcc-5 mips port >> compiler. >> Reviewed by:imp >> Approved by:re@ >> >> Modified: >> head/sys/mips/mips/swtch.S >> >> Modified: head/sys/mips/mips/swtch.S >> == >> --- head/sys/mips/mips/swtch.SMon Jun 13 03:03:08 2016 >> (r301848) +++ head/sys/mips/mips/swtch.S Mon Jun 13 03:17:00 >> 2016 (r301849) @@ -400,6 +400,7 @@ END(cpu_switch) >> * >> >> * >> */ >> +.set hardfloat >> LEAF(MipsSwitchFPState) >> mfc0t1, MIPS_COP_0_STATUS # Save old SR >> li t0, MIPS_SR_COP_1_BIT # enable the >> coprocessor > > Hi, > > https://github.com/akabaev/freebsd/commit/5735b8108c8831a5a649815318391789e977a198 > > is a bit more complete version that only enables hardfloat in routines > that need it, not in random place of the file and for the rest of it. > > -- > Alexander Kabaev ___ 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: r300770 - in head: . contrib/libc++/include contrib/libc++/include/experimental contrib/libc++/include/ext contrib/libc++/src contrib/libc++/src/include contrib/libc++/src/support lib/
On 5/27/16 9:19 AM, Dimitry Andric wrote: > This is most likely caused by the option: > > -isystem > /scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include > > because that forces this path to become before any auto-detected system > include directory. Note that this option is not needed, since the other > option: > > --sysroot=/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32 > > is already taking care of adding the right include directories. It even > warns about the duplicate directory: > > ignoring duplicate directory > "/scratch/tmp/asomers/obj/home/asomers/freebsd/head/lib32/usr/include" Argh, I wish GCC cross-compiler wasn't so dumb. It does require -isystem despite --sysroot. It's working currently due to a mistake of having X_COMPILER_TYPE set even for native GCC builds. This is just a reminder that GCC --sysroot is not nearly as useful and obvious as clang's. I'm unwinding some bugs from this and other related X_COMPILER changes. -- Regards, Bryan Drewery signature.asc Description: OpenPGP digital signature
svn commit: r301877 - head/sys/compat/linuxkpi/common/src
Author: markj Date: Tue Jun 14 03:57:00 2016 New Revision: 301877 URL: https://svnweb.freebsd.org/changeset/base/301877 Log: Add a missing error check for a malloc() call in idr_get(). Submitted by: Matt JorasApproved by: re (gjb) MFC after:1 week Sponsored by: EMC / Isilon Storage Division Modified: head/sys/compat/linuxkpi/common/src/linux_idr.c Modified: head/sys/compat/linuxkpi/common/src/linux_idr.c == --- head/sys/compat/linuxkpi/common/src/linux_idr.c Mon Jun 13 23:36:15 2016(r301876) +++ head/sys/compat/linuxkpi/common/src/linux_idr.c Tue Jun 14 03:57:00 2016(r301877) @@ -292,7 +292,8 @@ idr_get(struct idr *idr) return (il); } il = malloc(sizeof(*il), M_IDR, M_ZERO | M_NOWAIT); - bitmap_fill(>bitmap, IDR_SIZE); + if (il != NULL) + bitmap_fill(>bitmap, IDR_SIZE); return (il); } ___ 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: r301814 - in head/sys: conf modules
On 6/13/16, 8:24 PM, "Bryan Drewery"wrote: >no description found for WITH_EXTRA_TCP_STACKS, skipping >A src.conf.5 handler is needed for this. > > >Please add a WITH_EXTRA_TCP_STACKS file into tools/build/options, svn >commit, svn up, and then >run from that directory: > >./makeman > ../../../share/man/man5/src.conf.5 > >Then commit ../../../share/man/man5/src.conf.5 > >(That's the process at least, both commits need re@ approval) Thanks for the info! I'll add it to our existing "to do" item to add documentation for this feature. (In theory, that will happen in the next week or so.) Jonathan ___ 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: r301849 - head/sys/mips/mips
On Mon, 13 Jun 2016 03:17:00 + (UTC) Adrian Chaddwrote: > Author: adrian > Date: Mon Jun 13 03:17:00 2016 > New Revision: 301849 > URL: https://svnweb.freebsd.org/changeset/base/301849 > > Log: > [mips] set hardfloat for fpu instruction generation for > gcc/binutils 5.x > This allows -HEAD to be compiled again using the gcc-5 mips port > compiler. > Reviewed by:imp > Approved by:re@ > > Modified: > head/sys/mips/mips/swtch.S > > Modified: head/sys/mips/mips/swtch.S > == > --- head/sys/mips/mips/swtch.SMon Jun 13 03:03:08 2016 > (r301848) +++ head/sys/mips/mips/swtch.S Mon Jun 13 03:17:00 > 2016 (r301849) @@ -400,6 +400,7 @@ END(cpu_switch) > * > > * > */ > +.set hardfloat > LEAF(MipsSwitchFPState) > mfc0t1, MIPS_COP_0_STATUS # Save old SR > li t0, MIPS_SR_COP_1_BIT # enable the > coprocessor Hi, https://github.com/akabaev/freebsd/commit/5735b8108c8831a5a649815318391789e977a198 is a bit more complete version that only enables hardfloat in routines that need it, not in random place of the file and for the rest of it. -- Alexander Kabaev pgpc4ovEuZDdH.pgp Description: Цифровая подпись OpenPGP
Re: svn commit: r301814 - in head/sys: conf modules
On 6/10/2016 12:06 PM, Jonathan T. Looney wrote: > Author: jtl > Date: Fri Jun 10 19:06:11 2016 > New Revision: 301814 > URL: https://svnweb.freebsd.org/changeset/base/301814 > > Log: > Change the default build behavior so we don't compile extra TCP modules by > default. At least initially, the feature to support multiple TCP stacks is > aimed at supporting advanced use cases and TCP development, but it is not > necessarily aimed at a wide audience. Therefore, there is no need to build > and install the extra TCP stacks by default. Instead, the people who are > using or developing this functionality can add the extra option to build/ > install the extra TCP stacks. > > However, we do want to build the extra TCP stacks as part of test builds > (e.g. LINT or tinderbox) to ensure that developers who are testing their > changes will know that their changes do not break the additional TCP > stack modules. > > After this change, a user will need to add WITH_EXTRA_TCP_STACKS=1 to > make.conf or the kernel config in order to build the extra TCP modules. > > Differential Revision: https://reviews.freebsd.org/D6795 > Reviewed by:sjg > Approved by:re (kib) > > Modified: > head/sys/conf/kern.opts.mk > head/sys/conf/kern.post.mk > head/sys/modules/Makefile > > Modified: head/sys/conf/kern.opts.mk > == > --- head/sys/conf/kern.opts.mkFri Jun 10 18:47:11 2016 > (r301813) > +++ head/sys/conf/kern.opts.mkFri Jun 10 19:06:11 2016 > (r301814) > @@ -45,6 +45,7 @@ __DEFAULT_YES_OPTIONS = \ > > __DEFAULT_NO_OPTIONS = \ > EISA \ > +EXTRA_TCP_STACKS \ > NAND \ > OFED no description found for WITH_EXTRA_TCP_STACKS, skipping A src.conf.5 handler is needed for this. Please add a WITH_EXTRA_TCP_STACKS file into tools/build/options, svn commit, svn up, and then run from that directory: ./makeman > ../../../share/man/man5/src.conf.5 Then commit ../../../share/man/man5/src.conf.5 (That's the process at least, both commits need re@ approval) -- Regards, Bryan Drewery signature.asc Description: OpenPGP digital signature
svn commit: r301876 - head/usr.bin/calendar/calendars
Author: mahrens Date: Mon Jun 13 23:36:15 2016 New Revision: 301876 URL: https://svnweb.freebsd.org/changeset/base/301876 Log: Add myself (mahrens) to calendar.freebsd Approved by: mckusick Approved by: re (gjb) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd == --- head/usr.bin/calendar/calendars/calendar.freebsdMon Jun 13 22:31:16 2016(r301875) +++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jun 13 23:36:15 2016(r301876) @@ -338,6 +338,7 @@ 10/25 Eric Melvilleborn in Los Gatos, California, United States, 1980 10/25 Julien Laffaye born in Toulouse, France, 1988 10/25 Ashish SHUKLA born in Kanpur, India, 1985 +10/26 Matthew Ahrens born in United States, 1979 10/26 Philip M. Gollucci born in Silver Spring, Maryland, United States, 1979 10/27 Takanori Watanabe born in Numazu, Shizuoka, Japan, 1972 11/05 M. Warner Losh born in Kansas City, Kansas, United States, 1966 ___ 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: r301875 - head/sys/netinet6
Author: pfg Date: Mon Jun 13 22:31:16 2016 New Revision: 301875 URL: https://svnweb.freebsd.org/changeset/base/301875 Log: Remove the SIOCSIFALIFETIME_IN6 ioctl. The SIOCSIFALIFETIME_IN6 provided by the kame project is unused, it can't really be used safely and has been completely removed from NetBSD and OpenBSD. Obtained from:NetBSD (kern/35897) PR: 210148 (exp-run) Reviewed by: ae, hrs Relnotes: yes Approved by: re (glebius) Differential Revision:https://reviews.freebsd.org/D5491 Modified: head/sys/netinet6/in6.c head/sys/netinet6/in6_var.h Modified: head/sys/netinet6/in6.c == --- head/sys/netinet6/in6.c Mon Jun 13 22:00:44 2016(r301874) +++ head/sys/netinet6/in6.c Mon Jun 13 22:31:16 2016(r301875) @@ -360,7 +360,6 @@ in6_control(struct socket *so, u_long cm case SIOCSPFXFLUSH_IN6: case SIOCSRTRFLUSH_IN6: case SIOCGIFALIFETIME_IN6: - case SIOCSIFALIFETIME_IN6: case SIOCGIFSTAT_IN6: case SIOCGIFSTAT_ICMP6: sa6 = >ifr_addr; @@ -459,34 +458,6 @@ in6_control(struct socket *so, u_long cm goto out; } break; - - case SIOCSIFALIFETIME_IN6: - { - struct in6_addrlifetime *lt; - - if (td != NULL) { - error = priv_check(td, PRIV_NETINET_ALIFETIME6); - if (error) - goto out; - } - if (ia == NULL) { - error = EADDRNOTAVAIL; - goto out; - } - /* sanity for overflow - beware unsigned */ - lt = >ifr_ifru.ifru_lifetime; - if (lt->ia6t_vltime != ND6_INFINITE_LIFETIME && - lt->ia6t_vltime + time_uptime < time_uptime) { - error = EINVAL; - goto out; - } - if (lt->ia6t_pltime != ND6_INFINITE_LIFETIME && - lt->ia6t_pltime + time_uptime < time_uptime) { - error = EINVAL; - goto out; - } - break; - } } switch (cmd) { @@ -572,21 +543,6 @@ in6_control(struct socket *so, u_long cm } break; - case SIOCSIFALIFETIME_IN6: - ia->ia6_lifetime = ifr->ifr_ifru.ifru_lifetime; - /* for sanity */ - if (ia->ia6_lifetime.ia6t_vltime != ND6_INFINITE_LIFETIME) { - ia->ia6_lifetime.ia6t_expire = - time_uptime + ia->ia6_lifetime.ia6t_vltime; - } else - ia->ia6_lifetime.ia6t_expire = 0; - if (ia->ia6_lifetime.ia6t_pltime != ND6_INFINITE_LIFETIME) { - ia->ia6_lifetime.ia6t_preferred = - time_uptime + ia->ia6_lifetime.ia6t_pltime; - } else - ia->ia6_lifetime.ia6t_preferred = 0; - break; - case SIOCAIFADDR_IN6: { struct nd_prefixctl pr0; Modified: head/sys/netinet6/in6_var.h == --- head/sys/netinet6/in6_var.h Mon Jun 13 22:00:44 2016(r301874) +++ head/sys/netinet6/in6_var.h Mon Jun 13 22:31:16 2016(r301875) @@ -453,7 +453,6 @@ struct in6_rrenumreq { #define SIOCSRTRFLUSH_IN6 _IOWR('i', 80, struct in6_ifreq) #define SIOCGIFALIFETIME_IN6 _IOWR('i', 81, struct in6_ifreq) -#define SIOCSIFALIFETIME_IN6 _IOWR('i', 82, struct in6_ifreq) #define SIOCGIFSTAT_IN6_IOWR('i', 83, struct in6_ifreq) #define SIOCGIFSTAT_ICMP6 _IOWR('i', 84, struct in6_ifreq) ___ 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: r301874 - head/usr.sbin/extattr/tests
Author: asomers Date: Mon Jun 13 22:00:44 2016 New Revision: 301874 URL: https://svnweb.freebsd.org/changeset/base/301874 Log: Fix usr.sbin/extattr testcases on tmpfs Skip the usr.sbin/extattr testscases if $TMPDIR is tmpfs, which doesn't support extended attributes PR: 210184 Reported by: ngie Reviewed by: ngie Approved by: re (glebius) MFC after:4 weeks Differential Revision:https://reviews.freebsd.org/D6802 Sponsored by: Spectra Logic Corp Modified: head/usr.sbin/extattr/tests/extattr_test.sh Modified: head/usr.sbin/extattr/tests/extattr_test.sh == --- head/usr.sbin/extattr/tests/extattr_test.sh Mon Jun 13 18:39:13 2016 (r301873) +++ head/usr.sbin/extattr/tests/extattr_test.sh Mon Jun 13 22:00:44 2016 (r301874) @@ -30,6 +30,7 @@ bad_namespace_head() { atf_set "descr" "Can't set attributes for nonexistent namespaces" } bad_namespace_body() { + check_fs touch foo atf_check -s not-exit:0 -e match:"Invalid argument" \ setextattr badnamespace myattr X foo @@ -42,6 +43,7 @@ hex_head() { atf_set "descr" "Set and get attribute values in hexadecimal" } hex_body() { + check_fs touch foo atf_check -s exit:0 -o empty setextattr user myattr XYZ foo atf_check -s exit:0 -o inline:"58 59 5a\n" \ @@ -53,6 +55,7 @@ hex_nonascii_head() { atf_set "descr" "Get binary attribute values in hexadecimal" } hex_nonascii_body() { + check_fs touch foo BINSTUFF=`echo $'\x20\x30\x40\x55\x66\x70\x81\xa2\xb3\xee\xff'` atf_check -s exit:0 -o empty setextattr user myattr "$BINSTUFF" foo @@ -66,6 +69,7 @@ long_name_head() { atf_set "descr" "A maximum length attribute name" } long_name_body() { + check_fs # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208965 atf_expect_fail "BUG 208965 extattr(2) doesn't allow maxlen attr names" @@ -84,6 +88,7 @@ loud_head() { atf_set "descr" "Loud (non -q) output for each command" } loud_body() { + check_fs touch foo # setextattr(8) and friends print hard tabs. Use printf to convert # them to spaces before checking the output. @@ -101,6 +106,7 @@ noattrs_head() { atf_set "descr" "A file with no extended attributes" } noattrs_body() { + check_fs touch foo atf_check -s exit:0 -o empty lsextattr -q user foo } @@ -110,6 +116,7 @@ nonexistent_file_head() { atf_set "descr" "A file that does not exist" } nonexistent_file_body() { + check_fs atf_check -s exit:1 -e match:"No such file or directory" \ lsextattr user foo atf_check -s exit:1 -e match:"No such file or directory" \ @@ -125,6 +132,7 @@ null_head() { atf_set "descr" "NUL-terminate an attribute value" } null_body() { + check_fs touch foo atf_check -s exit:0 -o empty setextattr -n user myattr myvalue foo atf_check -s exit:0 -o inline:"myvalue\0\n" getextattr -q user myattr foo @@ -135,6 +143,7 @@ one_user_attr_head() { atf_set "descr" "A file with one extended attribute" } one_user_attr_body() { + check_fs touch foo atf_check -s exit:0 -o empty setextattr user myattr myvalue foo atf_check -s exit:0 -o inline:"myattr\n" lsextattr -q user foo @@ -149,6 +158,7 @@ one_system_attr_head() { atf_set "require.user" "root" } one_system_attr_body() { + check_fs touch foo atf_check -s exit:0 -o empty setextattr system myattr myvalue foo atf_check -s exit:0 -o inline:"myattr\n" lsextattr -q system foo @@ -162,6 +172,7 @@ stdin_head() { atf_set "descr" "Set attribute value from stdin" } stdin_body() { + check_fs dd if=/dev/random of=infile bs=1k count=8 touch foo setextattr -i user myattr foo < infile || atf_fail "setextattr failed" @@ -175,6 +186,7 @@ stringify_head() { atf_set "descr" "Stringify the output of getextattr" } stringify_body() { + check_fs touch foo atf_check -s exit:0 -o empty setextattr user myattr "my value" foo atf_check -s exit:0 -o inline:"\"my\\\040value\"\n" \ @@ -186,6 +198,7 @@ symlink_head() { atf_set "descr" "A symlink to an ordinary file" } symlink_body() { + check_fs touch foo ln -s foo foolink atf_check -s exit:0 -o empty setextattr user myattr myvalue foolink @@ -199,6 +212,7 @@ symlink_nofollow_head() { atf_set "descr" "Operating directly on a symlink" } symlink_nofollow_body() { + check_fs touch foo ln -s foo foolink # Check that with -h we can operate directly on the link @@ -221,6 +235,7 @@ system_and_user_attrs_head() { atf_set "require.user" "root" } system_and_user_attrs_body() { + check_fs touch
Re: svn commit: r300943 - in head: . lib/libc++ lib/libcxxrt share/mk
On 6/12/2016 1:02 PM, Andreas Tobler wrote: > Hi Bryan, > > On 29.05.16 08:20, Bryan Drewery wrote: >> Author: bdrewery >> Date: Sun May 29 06:20:15 2016 >> New Revision: 300943 >> URL: https://svnweb.freebsd.org/changeset/base/300943 >> >> Log: >> GCC External: Revert r300886, r300904, r300917, r300918 >> >> The fix in r300873 is mostly enough. A fix for lib32 will be >> committed.separately. > > Did this commit already happen? > > I still suffer a broken buildworld on powerpc64 for 32-bit with internal > tools. > > Unknown option -std=c++11... Try with this patch please, number of -j doesn't matter. https://people.freebsd.org/~bdrewery/patches/libcompat-xgcc-c++11.diff -- Regards, Bryan Drewery signature.asc Description: OpenPGP digital signature
svn commit: r301873 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: avg Date: Mon Jun 13 18:39:13 2016 New Revision: 301873 URL: https://svnweb.freebsd.org/changeset/base/301873 Log: l2arc: reset b_tmp_cdata to NULL in the case of unset b_daddr The change is in arc_buf_l2_cdata_free(). Without this we can trip the assertion in arc_hdr_realloc() if INVARIANTS option is enabled. Approved by: re (kib) MFC after:1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Jun 13 16:48:27 2016(r301872) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Jun 13 18:39:13 2016(r301873) @@ -2249,6 +2249,7 @@ arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr ASSERT3P(hdr->b_l1hdr.b_tmp_cdata, ==, hdr->b_l1hdr.b_buf->b_data); ASSERT3U(hdr->b_l2hdr.b_compress, ==, ZIO_COMPRESS_OFF); + hdr->b_l1hdr.b_tmp_cdata = NULL; return; } ___ 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: r301872 - head/sys/arm/include
Author: ian Date: Mon Jun 13 16:48:27 2016 New Revision: 301872 URL: https://svnweb.freebsd.org/changeset/base/301872 Log: Do not define __NO_STRICT_ALIGNMENT for armv6. While the requirements are no longer natural-alignment strict, there are still some restrictions. FreeBSD network code assumes data is naturally-aligned or is running on a platform with no restrictions; pointers are not annotated to indicate the data pointed to may be packed or unaligned. The clang optimizer can sometimes combine the load or store of a pair of adjacent 32-bit values into a single doubleword load/store, and that operation requires at least 4-byte alignment. __NO_STRICT_ALIGNMENT can lead to tcp headers being only 2-byte aligned. Note that alignment faults remain disabled on armv6, this change reverts only the defining of the symbol which leads to some overly-agressive code shortcuts when building common/shared drivers and network code for arm. Approved by: re(kib) Modified: head/sys/arm/include/_types.h Modified: head/sys/arm/include/_types.h == --- head/sys/arm/include/_types.h Mon Jun 13 11:19:06 2016 (r301871) +++ head/sys/arm/include/_types.h Mon Jun 13 16:48:27 2016 (r301872) @@ -43,10 +43,6 @@ #error this file needs sys/cdefs.h as a prerequisite #endif -#if __ARM_ARCH >= 6 -#define __NO_STRICT_ALIGNMENT -#endif - /* * Basic types upon which most other types are built. */ ___ 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: r300943 - in head: . lib/libc++ lib/libcxxrt share/mk
On 6/12/2016 1:02 PM, Andreas Tobler wrote: > Hi Bryan, > > On 29.05.16 08:20, Bryan Drewery wrote: >> Author: bdrewery >> Date: Sun May 29 06:20:15 2016 >> New Revision: 300943 >> URL: https://svnweb.freebsd.org/changeset/base/300943 >> >> Log: >> GCC External: Revert r300886, r300904, r300917, r300918 >> >> The fix in r300873 is mostly enough. A fix for lib32 will be >> committed.separately. > > Did this commit already happen? > > I still suffer a broken buildworld on powerpc64 for 32-bit with internal > tools. > > Unknown option -std=c++11... Can you tee the entire build and send me the log please? -- Regards, Bryan Drewery signature.asc Description: OpenPGP digital signature
svn commit: r301871 - head/usr.sbin/rpc.lockd
Author: ngie Date: Mon Jun 13 11:19:06 2016 New Revision: 301871 URL: https://svnweb.freebsd.org/changeset/base/301871 Log: Add missing break in lock_partialfilelock(..) with NFS_RESERR This will help ensure that the right error is trickled up when the function is called if the lock status is NFS_RESERR Differential Revision: https://reviews.freebsd.org/D6622 Reviewed by: rmacklem Approved by: re (gjb) Tested with: fsx; svn info/svnversion (uses bdb locking); locktests from Bull http://nfsv4.bullopensource.org/tools/tests/locktest.php MFC after: 2 weeks Reported by: Coverity CID: 1008161, 1304956 Sponsored by: EMC / Isilon Storage Division Modified: head/usr.sbin/rpc.lockd/lockd_lock.c Modified: head/usr.sbin/rpc.lockd/lockd_lock.c == --- head/usr.sbin/rpc.lockd/lockd_lock.cMon Jun 13 10:53:34 2016 (r301870) +++ head/usr.sbin/rpc.lockd/lockd_lock.cMon Jun 13 11:19:06 2016 (r301871) @@ -1426,6 +1426,7 @@ lock_partialfilelock(struct file_lock *f break; case NFS_RESERR: retval = PFL_NFSRESERR; + break; default: debuglog("Unmatched lnlstatus %d\n"); retval = PFL_NFSDENIED_NOLOCK; ___ 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: r301870 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: avg Date: Mon Jun 13 10:53:34 2016 New Revision: 301870 URL: https://svnweb.freebsd.org/changeset/base/301870 Log: zfs_vptocnp: check for an invalid znode ... which can arise after the receive or rollback and failed zfs_rezget(). Approved by: re (kib) MFC after:1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Jun 13 10:35:11 2016(r301869) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Jun 13 10:53:34 2016(r301870) @@ -7170,16 +7170,24 @@ zfs_vptocnp(struct vop_vptocnp_args *ap) int ltype; int error; + ZFS_ENTER(zfsvfs); + ZFS_VERIFY_ZP(zp); + /* * If we are a snapshot mounted under .zfs, run the operation * on the covered vnode. */ if ((error = sa_lookup(zp->z_sa_hdl, - SA_ZPL_PARENT(zfsvfs), , sizeof (parent))) != 0) + SA_ZPL_PARENT(zfsvfs), , sizeof (parent))) != 0) { + ZFS_EXIT(zfsvfs); return (error); + } - if (zp->z_id != parent || zfsvfs->z_parent == zfsvfs) + if (zp->z_id != parent || zfsvfs->z_parent == zfsvfs) { + ZFS_EXIT(zfsvfs); return (vop_stdvptocnp(ap)); + } + ZFS_EXIT(zfsvfs); covered_vp = vp->v_mount->mnt_vnodecovered; vhold(covered_vp); ___ 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: r301869 - in head: share/misc usr.bin/calendar/calendars usr.sbin/sysrc
Author: ngie Date: Mon Jun 13 10:35:11 2016 New Revision: 301869 URL: https://svnweb.freebsd.org/changeset/base/301869 Log: Change my given name from "Garrett" to "Ngie" A legal name change from "Garrett" to "Ngie", as well as a FreeBSD account name change, is pending. Approved by: re (hrs) Modified: head/share/misc/committers-src.dot head/usr.bin/calendar/calendars/calendar.freebsd head/usr.sbin/sysrc/sysrc.8 Directory Properties: head/ (props changed) Modified: head/share/misc/committers-src.dot == --- head/share/misc/committers-src.dot Mon Jun 13 10:30:49 2016 (r301868) +++ head/share/misc/committers-src.dot Mon Jun 13 10:35:11 2016 (r301869) @@ -244,7 +244,7 @@ mp [label="Mark Peek\n...@freebsd.org\n20 mr [label="Michael Reifenberger\n...@freebsd.org\n2001/09/30"] neel [label="Neel Natu\nn...@freebsd.org\n2009/09/20"] netchild [label="Alexander Leidinger\nnetch...@freebsd.org\n2005/03/31"] -ngie [label="Garrett Cooper\nn...@freebsd.org\n2014/07/27"] +ngie [label="Ngie Cooper\nn...@freebsd.org\n2014/07/27"] nork [label="Norikatsu Shigemura\nn...@freebsd.org\n2009/06/09"] np [label="Navdeep Parhar\n...@freebsd.org\n2009/06/05"] nwhitehorn [label="Nathan Whitehorn\nnwhiteh...@freebsd.org\n2008/07/03"] Modified: head/usr.bin/calendar/calendars/calendar.freebsd == --- head/usr.bin/calendar/calendars/calendar.freebsdMon Jun 13 10:30:49 2016(r301868) +++ head/usr.bin/calendar/calendars/calendar.freebsdMon Jun 13 10:35:11 2016(r301869) @@ -36,7 +36,7 @@ 01/26 Andrew Gallatinborn in Buffalo, New York, United States, 1970 01/27 Nick Sayer born in San Diego, California, United States, 1968 01/27 Jacques Anthony Vidrine born in Baton Rouge, Louisiana, United States, 1971 -01/27 Garrett Cooper born in Seattle, Washington, United States, 1984 +01/27 Ngie Cooper born in Seattle, Washington, United States, 1984 01/31 Hidetoshi Shimokawa born in Yokohama, Kanagawa, Japan, 1970 02/01 Doug Rabson born in London, England, 1966 02/01 Nicola Vitale born in Busto Arsizio, Varese, Italy, 1976 Modified: head/usr.sbin/sysrc/sysrc.8 == --- head/usr.sbin/sysrc/sysrc.8 Mon Jun 13 10:30:49 2016(r301868) +++ head/usr.sbin/sysrc/sysrc.8 Mon Jun 13 10:35:11 2016(r301869) @@ -480,6 +480,6 @@ utility first appeared in .Sh AUTHORS .An Devin Teske Aq Mt dte...@freebsd.org .Sh THANKS TO -Brandon Gooch, Garrett Cooper, Julian Elischer, Pawel Jakub Dawidek, +Brandon Gooch, Ngie Cooper, Julian Elischer, Pawel Jakub Dawidek, Cyrille Lefevre, Ross West, Stefan Esser, Marco Steinbach, Jilles Tjoelker, Allan Jude, and Lars Engels for suggestions, help, and testing. ___ 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: r301867 - head/sys/security/audit
Author: rwatson Date: Mon Jun 13 09:22:20 2016 New Revision: 301867 URL: https://svnweb.freebsd.org/changeset/base/301867 Log: Implement AUE_PREAD and AUE_PWRITE BSM conversion support, eliminating console warnings when pread(2) and pwrite(2) are used with full system-call auditing enabled. We audit the same file-descriptor data for these calls as we do read(2) and write(2). Approved by: re (kib) MFC after:3 days Sponsored by: DARPA, AFRL Modified: head/sys/security/audit/audit_bsm.c Modified: head/sys/security/audit/audit_bsm.c == --- head/sys/security/audit/audit_bsm.c Mon Jun 13 09:02:08 2016 (r301866) +++ head/sys/security/audit/audit_bsm.c Mon Jun 13 09:22:20 2016 (r301867) @@ -952,6 +952,8 @@ kaudit_to_bsm(struct kaudit_record *kar, case AUE_GETDIRENTRIESATTR: case AUE_LSEEK: case AUE_POLL: + case AUE_PREAD: + case AUE_PWRITE: case AUE_READ: case AUE_READV: case AUE_WRITE: ___ 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: r301866 - in stable/10/sys: conf dev/hyperv/include dev/hyperv/storvsc dev/hyperv/utilities dev/hyperv/vmbus modules/hyperv/utilities
Author: sephe Date: Mon Jun 13 09:02:08 2016 New Revision: 301866 URL: https://svnweb.freebsd.org/changeset/base/301866 Log: MFC 295919,295958,295964 295919 hyperv/stor: Fix print format Detected by:PVS Static Analysis MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5388 295958 hyperv/utils: Code rearrange and cleanup Split heartbeat, shutdown and timesync out of utils code and name them properly. Submitted by: Jun Su Reviewed by:adrian, sephe, Hongjiang Zhang MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5216 295964 hyperv/vmbus: Use free(9) for interrupt page; it is allocated by malloc(9) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5417 Added: stable/10/sys/dev/hyperv/utilities/hv_heartbeat.c - copied unchanged from r295958, head/sys/dev/hyperv/utilities/hv_heartbeat.c stable/10/sys/dev/hyperv/utilities/hv_shutdown.c - copied unchanged from r295958, head/sys/dev/hyperv/utilities/hv_shutdown.c stable/10/sys/dev/hyperv/utilities/hv_timesync.c - copied unchanged from r295958, head/sys/dev/hyperv/utilities/hv_timesync.c stable/10/sys/dev/hyperv/utilities/hv_util.h - copied unchanged from r295958, head/sys/dev/hyperv/utilities/hv_util.h Modified: stable/10/sys/conf/files.amd64 stable/10/sys/conf/files.i386 stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c stable/10/sys/dev/hyperv/utilities/hv_kvp.c stable/10/sys/dev/hyperv/utilities/hv_kvp.h stable/10/sys/dev/hyperv/utilities/hv_util.c stable/10/sys/dev/hyperv/vmbus/hv_connection.c stable/10/sys/modules/hyperv/utilities/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files.amd64 == --- stable/10/sys/conf/files.amd64 Mon Jun 13 08:44:29 2016 (r301865) +++ stable/10/sys/conf/files.amd64 Mon Jun 13 09:02:08 2016 (r301866) @@ -266,7 +266,10 @@ dev/hyperv/netvsc/hv_netvsc_drv_freebsd. 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 +dev/hyperv/utilities/hv_shutdown.c optionalhyperv +dev/hyperv/utilities/hv_timesync.c optionalhyperv dev/hyperv/utilities/hv_util.c optionalhyperv dev/hyperv/vmbus/hv_channel.c optionalhyperv dev/hyperv/vmbus/hv_channel_mgmt.c optionalhyperv Modified: stable/10/sys/conf/files.i386 == --- stable/10/sys/conf/files.i386 Mon Jun 13 08:44:29 2016 (r301865) +++ stable/10/sys/conf/files.i386 Mon Jun 13 09:02:08 2016 (r301866) @@ -242,7 +242,10 @@ dev/hyperv/netvsc/hv_netvsc_drv_freebsd. 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 +dev/hyperv/utilities/hv_shutdown.c optionalhyperv +dev/hyperv/utilities/hv_timesync.c optionalhyperv dev/hyperv/utilities/hv_util.c optionalhyperv dev/hyperv/vmbus/hv_channel.c optionalhyperv dev/hyperv/vmbus/hv_channel_mgmt.c optionalhyperv Modified: stable/10/sys/dev/hyperv/include/hyperv.h == --- stable/10/sys/dev/hyperv/include/hyperv.h Mon Jun 13 08:44:29 2016 (r301865) +++ stable/10/sys/dev/hyperv/include/hyperv.h Mon Jun 13 09:02:08 2016 (r301866) @@ -919,40 +919,5 @@ hv_get_phys_addr(void *virt) return (ret); } - -/** - * KVP related structures - * - */ -typedef struct hv_vmbus_service { -hv_guid guid; /* Hyper-V GUID */ -char *name;/* name of service */ -boolean_t enabled; /* service enabled */ - void* context; -
svn commit: r301865 - stable/10/sys/dev/hyperv/netvsc
Author: sephe Date: Mon Jun 13 08:44:29 2016 New Revision: 301865 URL: https://svnweb.freebsd.org/changeset/base/301865 Log: hyperv/hn: Hide unused function Sponsored by: Microsoft OSTC Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 08:38:04 2016(r301864) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 08:44:29 2016(r301865) @@ -294,9 +294,10 @@ static int hn_trust_hcsum_sysctl(SYSCTL_ static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS); #if __FreeBSD_version < 1100095 static int hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARGS); +#else +static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); #endif static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); -static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_conf_int_sysctl(SYSCTL_HANDLER_ARGS); static int hn_check_iplen(const struct mbuf *, int); @@ -1825,56 +1826,57 @@ hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARG } return 0; } -#endif - +#else static int -hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) +hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; int ofs = arg2, i, error; struct hn_rx_ring *rxr; - u_long stat; + uint64_t stat; stat = 0; for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = >hn_rx_ring[i]; - stat += *((u_long *)((uint8_t *)rxr + ofs)); + stat += *((uint64_t *)((uint8_t *)rxr + ofs)); } - error = sysctl_handle_long(oidp, , 0, req); + error = sysctl_handle_64(oidp, , 0, req); if (error || req->newptr == NULL) return error; /* Zero out this stat. */ for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = >hn_rx_ring[i]; - *((u_long *)((uint8_t *)rxr + ofs)) = 0; + *((uint64_t *)((uint8_t *)rxr + ofs)) = 0; } return 0; } +#endif + static int -hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS) +hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) { struct hn_softc *sc = arg1; int ofs = arg2, i, error; struct hn_rx_ring *rxr; - uint64_t stat; + u_long stat; stat = 0; for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = >hn_rx_ring[i]; - stat += *((uint64_t *)((uint8_t *)rxr + ofs)); + stat += *((u_long *)((uint8_t *)rxr + ofs)); } - error = sysctl_handle_64(oidp, , 0, req); + error = sysctl_handle_long(oidp, , 0, req); if (error || req->newptr == NULL) return error; /* Zero out this stat. */ for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { rxr = >hn_rx_ring[i]; - *((uint64_t *)((uint8_t *)rxr + ofs)) = 0; + *((u_long *)((uint8_t *)rxr + ofs)) = 0; } return 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: r301864 - stable/10/sys/dev/hyperv/netvsc
Author: sephe Date: Mon Jun 13 08:38:04 2016 New Revision: 301864 URL: https://svnweb.freebsd.org/changeset/base/301864 Log: MFC 295875,295876,295877,295916,295918 295875 hyperv/hn: Rename TX related function and struct fields a bit Preamble to implement the ifnet.if_transmit method. Reviewed by:adrian Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5344 295876 hyperv/hn: Staticize and rename packet TX done function It is only used in hv_netvsc_drv_freebsd.c; and rename it to hn_tx_done() mainly to reserve "xmit" for ifnet.if_transmit implement. While I'm here, remove unapplied comment. Reviewed by:adrian Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5345 295877 hyperv/hn: Add TX method for txeof processing. Preamble to implement ifnet.if_transmit method. Reviewed by:adrian Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5346 295916 hyperv/hn: Factor out hn_send_pkt() from hn_start_locked() It will be shared w/ the upcoming ifnet.if_transmit method implementation. No functional change. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5385 295918 hyperv/hn: Use IFQ_DRV_PREPEND instead of IF_PREPEND IF_PREPEND promises out-of-order packet sending when the TX desc list is depleted. It was overlooked and copied blindly when the transmission path was partially rewritten. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5386 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c 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.hMon Jun 13 08:18:45 2016(r301863) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hMon Jun 13 08:38:04 2016(r301864) @@ -1026,11 +1026,12 @@ struct hn_tx_ring { #endif int hn_txdesc_cnt; int hn_txdesc_avail; - int hn_txeof; + int hn_has_txeof; int hn_sched_tx; + void(*hn_txeof)(struct hn_tx_ring *); struct taskqueue *hn_tx_taskq; - struct task hn_start_task; + struct task hn_tx_task; struct task hn_txeof_task; struct mtx hn_tx_lock; @@ -1087,7 +1088,6 @@ typedef struct hn_softc { extern int hv_promisc_mode; void netvsc_linkstatus_callback(struct hv_device *device_obj, uint32_t status); -void netvsc_xmit_completion(void *context); void hv_nv_on_receive_completion(struct hv_device *device, uint64_t tid, uint32_t status); netvsc_dev *hv_nv_on_device_add(struct hv_device *device, Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 08:18:45 2016(r301863) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 08:38:04 2016(r301864) @@ -304,8 +304,8 @@ static int hn_create_tx_ring(struct hn_s static void hn_destroy_tx_ring(struct hn_tx_ring *); static int hn_create_tx_data(struct hn_softc *); static void hn_destroy_tx_data(struct hn_softc *); -static void hn_start_taskfunc(void *xsc, int pending); -static void hn_txeof_taskfunc(void *xsc, int pending); +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 void hn_create_rx_data(struct hn_softc *sc); @@ -673,17 +673,10 @@ hn_txdesc_hold(struct hn_txdesc *txd) atomic_add_int(>refs, 1); } -/* - * Send completion processing - * - * Note: It looks like offset 0 of buf is reserved to hold the softc - * pointer. The sc pointer is not currently needed in this function, and - * it is not presently populated by the TX function. - */ -void -netvsc_xmit_completion(void *context) +static void +hn_tx_done(void *xpkt) { - netvsc_packet *packet = context; + netvsc_packet *packet = xpkt; struct hn_txdesc *txd; struct hn_tx_ring *txr; @@ -691,7 +684,7 @@
svn commit: r301863 - stable/10/sys/dev/hyperv/netvsc
Author: sephe Date: Mon Jun 13 08:18:45 2016 New Revision: 301863 URL: https://svnweb.freebsd.org/changeset/base/301863 Log: hyperv/hn: Fix mis-merge introduced by r301861. Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 08:03:53 2016(r301862) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 08:18:45 2016(r301863) @@ -292,6 +292,9 @@ static int hn_lro_ackcnt_sysctl(SYSCTL_H #endif static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS); +#if __FreeBSD_version < 1100095 +static int hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARGS); +#endif static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); static int hn_rx_stat_u64_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS); @@ -1783,6 +1786,34 @@ hn_tx_chimney_size_sysctl(SYSCTL_HANDLER return 0; } +#if __FreeBSD_version < 1100095 +static int +hn_rx_stat_int_sysctl(SYSCTL_HANDLER_ARGS) +{ + struct hn_softc *sc = arg1; + int ofs = arg2, i, error; + struct hn_rx_ring *rxr; + uint64_t stat; + + stat = 0; + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + rxr = >hn_rx_ring[i]; + stat += *((int *)((uint8_t *)rxr + ofs)); + } + + error = sysctl_handle_64(oidp, , 0, req); + if (error || req->newptr == NULL) + return error; + + /* Zero out this stat. */ + for (i = 0; i < sc->hn_rx_ring_cnt; ++i) { + rxr = >hn_rx_ring[i]; + *((int *)((uint8_t *)rxr + ofs)) = 0; + } + return 0; +} +#endif + static int hn_rx_stat_ulong_sysctl(SYSCTL_HANDLER_ARGS) { @@ -2031,11 +2062,21 @@ hn_create_rx_data(struct hn_softc *sc) SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_queued", CTLTYPE_U64 | CTLFLAG_RW, sc, __offsetof(struct hn_rx_ring, hn_lro.lro_queued), - hn_rx_stat_u64_sysctl, "LU", "LRO queued"); +#if __FreeBSD_version < 1100095 + hn_rx_stat_int_sysctl, +#else + hn_rx_stat_u64_sysctl, +#endif + "LU", "LRO queued"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_flushed", CTLTYPE_U64 | CTLFLAG_RW, sc, __offsetof(struct hn_rx_ring, hn_lro.lro_flushed), - hn_rx_stat_u64_sysctl, "LU", "LRO flushed"); +#if __FreeBSD_version < 1100095 + hn_rx_stat_int_sysctl, +#else + hn_rx_stat_u64_sysctl, +#endif + "LU", "LRO flushed"); SYSCTL_ADD_PROC(ctx, child, OID_AUTO, "lro_tried", CTLTYPE_ULONG | CTLFLAG_RW, sc, __offsetof(struct hn_rx_ring, hn_lro_tried), ___ 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: r301862 - stable/10/sys/dev/hyperv/netvsc
Author: sephe Date: Mon Jun 13 08:03:53 2016 New Revision: 301862 URL: https://svnweb.freebsd.org/changeset/base/301862 Log: MFC 295748,295792,295793,295794 295748 hyperv/hn: Use buf_ring for txdesc list So one spinlock is avoided, which would be potentially dangerous for virtual machine, if the spinlock holder was scheduled out by the host, as noted by royger. Old spinlock based txdesc list is still kept around, so we could have a safe fallback. No performance regression nor improvement is observed. Reviewed by:adrian Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5290 295792 hyperv/hn: Add option to bind TX taskqueues to the specified CPU It will be used to help tracking host side transmission ring selection issue; and it will be turned on by default, once we have concrete result. Reviewed by:adrian, Jun Su Approved by:adrian (mento) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5316 295793 hyperv/hn: Enable IP header checksum offloading for WIN8 (WinServ2012) Tested on Windows Server 2012. Reviewed by:adrian Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5317 295794 hyperv/hn: Free the txdesc buf_ring when the TX ring is destroyed Reviewed by:adrian Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5318 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c 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.hMon Jun 13 07:30:54 2016(r301861) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hMon Jun 13 08:03:53 2016(r301862) @@ -58,6 +58,8 @@ #include +#define HN_USE_TXDESC_BUFRING + MALLOC_DECLARE(M_NETVSC); #define NVSP_INVALID_PROTOCOL_VERSION (0x) @@ -990,8 +992,12 @@ typedef struct { hv_bool_uint8_t link_state; } netvsc_device_info; +#ifndef HN_USE_TXDESC_BUFRING struct hn_txdesc; SLIST_HEAD(hn_txdesc_list, hn_txdesc); +#else +struct buf_ring; +#endif struct hn_rx_ring { struct lro_ctrl hn_lro; @@ -1012,8 +1018,12 @@ struct hn_rx_ring { #define HN_TRUST_HCSUM_UDP 0x0004 struct hn_tx_ring { +#ifndef HN_USE_TXDESC_BUFRING struct mtx hn_txlist_spin; struct hn_txdesc_list hn_txlist; +#else + struct buf_ring *hn_txdesc_br; +#endif int hn_txdesc_cnt; int hn_txdesc_avail; int hn_txeof; Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 07:30:54 2016(r301861) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 08:03:53 2016(r301862) @@ -66,10 +66,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include #include @@ -151,7 +153,9 @@ __FBSDID("$FreeBSD$"); #define HN_DIRECT_TX_SIZE_DEF 128 struct hn_txdesc { +#ifndef HN_USE_TXDESC_BUFRING SLIST_ENTRY(hn_txdesc) link; +#endif struct mbuf *m; struct hn_tx_ring *txr; int refs; @@ -173,7 +177,7 @@ struct hn_txdesc { * later. UDP checksum offloading doesn't work on earlier * Windows releases. */ -#define HN_CSUM_ASSIST_WIN8(CSUM_TCP) +#define HN_CSUM_ASSIST_WIN8(CSUM_IP | CSUM_TCP) #define HN_CSUM_ASSIST (CSUM_IP | CSUM_UDP | CSUM_TCP) #define HN_LRO_LENLIM_DEF (25 * ETHERMTU) @@ -258,6 +262,18 @@ SYSCTL_INT(_hw_hn, OID_AUTO, share_tx_ta static struct taskqueue*hn_tx_taskq; +#ifndef HN_USE_TXDESC_BUFRING +static int hn_use_txdesc_bufring = 0; +#else +static int hn_use_txdesc_bufring = 1; +#endif +SYSCTL_INT(_hw_hn, OID_AUTO, use_txdesc_bufring, CTLFLAG_RD, +_use_txdesc_bufring, 0, "Use buf_ring for TX descriptors"); + +static int hn_bind_tx_taskq = -1; +SYSCTL_INT(_hw_hn, OID_AUTO, bind_tx_taskq, CTLFLAG_RDTUN, +_bind_tx_taskq, 0, "Bind TX taskqueue to the specified cpu"); + /* * Forward declarations */ @@ -343,6 +359,19 @@ netvsc_probe(device_t dev) return (ENXIO); } +static void
svn commit: r301861 - stable/10/sys/dev/hyperv/netvsc
Author: sephe Date: Mon Jun 13 07:30:54 2016 New Revision: 301861 URL: https://svnweb.freebsd.org/changeset/base/301861 Log: MFC 295743,295744,295745,295746,295747 295743 hyperv/hn: Change global tunable prefix to hw.hn And use SYSCTL+CTLFLAG_RDTUN for them. Suggested by: adrian Reviewed by:adrian, Hongjiang Zhang Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5274 295744 hyperv/hn: Split RX ring data structure out of softc This paves the way for upcoming vRSS stuffs and eases more code cleanup. Reviewed by:adrian Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5275 295745 hyperv/hn: Use taskqueue_enqueue() This also eases experiment on the non-fast taskqueue. Reviewed by:adrian, Jun Su Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5276 295746 hyperv/hn: Use non-fast taskqueue for transmission Performance stays same; so no need to use fast taskqueue here. 295747 hyperv/hn: Split TX ring data structure out of softc This paves the way for upcoming vRSS stuffs and eases more code cleanup. Reviewed by:adrian Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5283 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c 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.hMon Jun 13 07:03:00 2016(r301860) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hMon Jun 13 07:30:54 2016(r301861) @@ -993,31 +993,25 @@ typedef struct { struct hn_txdesc; SLIST_HEAD(hn_txdesc_list, hn_txdesc); -/* - * Device-specific softc structure - */ -typedef struct hn_softc { - struct ifnet*hn_ifp; - struct arpcom arpcom; - struct ifmedia hn_media; - device_thn_dev; - uint8_t hn_unit; - int hn_carrier; - int hn_if_flags; - struct mtx hn_lock; - int hn_initdone; - /* See hv_netvsc_drv_freebsd.c for rules on how to use */ - int temp_unusable; - struct hv_device *hn_dev_obj; - netvsc_dev *net_dev; +struct hn_rx_ring { + struct lro_ctrl hn_lro; - struct hn_txdesc *hn_txdesc; - bus_dma_tag_t hn_tx_data_dtag; - bus_dma_tag_t hn_tx_rndis_dtag; - int hn_tx_chimney_size; - int hn_tx_chimney_max; - uint64_thn_csum_assist; + /* Trust csum verification on host side */ + int hn_trust_hcsum; /* HN_TRUST_HCSUM_ */ + + u_long hn_csum_ip; + u_long hn_csum_tcp; + u_long hn_csum_udp; + u_long hn_csum_trusted; + u_long hn_lro_tried; + u_long hn_small_pkts; +} __aligned(CACHE_LINE_SIZE); + +#define HN_TRUST_HCSUM_IP 0x0001 +#define HN_TRUST_HCSUM_TCP 0x0002 +#define HN_TRUST_HCSUM_UDP 0x0004 +struct hn_tx_ring { struct mtx hn_txlist_spin; struct hn_txdesc_list hn_txlist; int hn_txdesc_cnt; @@ -1025,32 +1019,57 @@ typedef struct hn_softc { int hn_txeof; int hn_sched_tx; - int hn_direct_tx_size; struct taskqueue *hn_tx_taskq; struct task hn_start_task; struct task hn_txeof_task; - struct lro_ctrl hn_lro; + struct mtx hn_tx_lock; + struct hn_softc *hn_sc; - /* Trust csum verification on host side */ - int hn_trust_hcsum; /* HN_TRUST_HCSUM_ */ + int hn_direct_tx_size; + int hn_tx_chimney_size; + bus_dma_tag_t hn_tx_data_dtag; + uint64_thn_csum_assist; - u_long hn_csum_ip; - u_long hn_csum_tcp; - u_long hn_csum_udp; - u_long hn_csum_trusted; - u_long hn_lro_tried; - u_long hn_small_pkts; u_long hn_no_txdescs; u_long hn_send_failed; u_long hn_txdma_failed; u_long hn_tx_collapsed; u_long hn_tx_chimney; -} hn_softc_t; -#define HN_TRUST_HCSUM_IP
svn commit: r301860 - stable/10/sys/dev/hyperv/netvsc
Author: sephe Date: Mon Jun 13 07:03:00 2016 New Revision: 301860 URL: https://svnweb.freebsd.org/changeset/base/301860 Log: MFC 295740,295741,295742 295740 hyperv/hn: Set the TCP ACK/data segment aggregation limit Set TCP ACK append limit to 1, i.e. aggregate 2 ACKs at most. Aggregating anything more than 2 hurts TCP sending performance in hyperv. This significantly improves the TCP sending performance when the number of concurrent connetion is low (2~8). And it greatly stabilizes the TCP sending performance in other cases. Set TCP data segments aggregation length limit to 37500. Without this limitation, hn(4) could aggregate ~45 TCP data segments for each connection (even at 64 or more connections) before dispatching them to socket code; large aggregation slows down ACK sending and eventually hurts/destabilizes TCP reception performance. This setting stabilizes and improves TCP reception performance for >4 concurrent connections significantly. Make them sysctls so they could be adjusted. Reviewed by:adrian, gallatin (previous version), hselasky (previous version) Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5185 295741 hyperv/hn: Add option to allow sharing TX taskq between hn instances It is off by default. This eases further experimenting on this driver. Reviewed by:adrian Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5272 295742 hyperv/hn: Always do transmission scheduling. This one gives the best performance so far. Reviewed by:adrian Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5273 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c 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.hMon Jun 13 06:38:46 2016(r301859) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hMon Jun 13 07:03:00 2016(r301860) @@ -1031,7 +1031,6 @@ typedef struct hn_softc { struct task hn_txeof_task; struct lro_ctrl hn_lro; - int hn_lro_hiwat; /* Trust csum verification on host side */ int hn_trust_hcsum; /* HN_TRUST_HCSUM_ */ Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 06:38:46 2016(r301859) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 07:03:00 2016(r301860) @@ -176,14 +176,11 @@ struct hn_txdesc { #define HN_CSUM_ASSIST_WIN8(CSUM_TCP) #define HN_CSUM_ASSIST (CSUM_IP | CSUM_UDP | CSUM_TCP) -/* XXX move to netinet/tcp_lro.h */ -#define HN_LRO_HIWAT_MAX 65535 -#define HN_LRO_HIWAT_DEF HN_LRO_HIWAT_MAX +#define HN_LRO_LENLIM_DEF (25 * ETHERMTU) /* YYY 2*MTU is a bit rough, but should be good enough. */ -#define HN_LRO_HIWAT_MTULIM(ifp) (2 * (ifp)->if_mtu) -#define HN_LRO_HIWAT_ISVALID(sc, hiwat)\ -((hiwat) >= HN_LRO_HIWAT_MTULIM((sc)->hn_ifp) || \ - (hiwat) <= HN_LRO_HIWAT_MAX) +#define HN_LRO_LENLIM_MIN(ifp) (2 * (ifp)->if_mtu) + +#define HN_LRO_ACKCNT_DEF 1 /* * Be aware that this sleepable mutex will exhibit WITNESS errors when @@ -241,6 +238,11 @@ TUNABLE_INT("dev.hn.lro_entry_count", #endif #endif +static int hn_share_tx_taskq = 0; +TUNABLE_INT("hw.hn.share_tx_taskq", _share_tx_taskq); + +static struct taskqueue*hn_tx_taskq; + /* * Forward declarations */ @@ -253,8 +255,9 @@ static void hn_start(struct ifnet *ifp); static void hn_start_txeof(struct ifnet *ifp); static int hn_ifmedia_upd(struct ifnet *ifp); static void hn_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr); -#ifdef HN_LRO_HIWAT -static int hn_lro_hiwat_sysctl(SYSCTL_HANDLER_ARGS); +#if __FreeBSD_version >= 1100099 +static int hn_lro_lenlim_sysctl(SYSCTL_HANDLER_ARGS); +static int hn_lro_ackcnt_sysctl(SYSCTL_HANDLER_ARGS); #endif static int hn_trust_hcsum_sysctl(SYSCTL_HANDLER_ARGS); static int hn_tx_chimney_size_sysctl(SYSCTL_HANDLER_ARGS); @@ -265,15 +268,6 @@ static void hn_start_taskfunc(void *xsc, static void
svn commit: r301859 - in stable/10/sys/dev/hyperv: include netvsc utilities vmbus
Author: sephe Date: Mon Jun 13 06:38:46 2016 New Revision: 301859 URL: https://svnweb.freebsd.org/changeset/base/301859 Log: MFC 295307,295308,295309,295606 295307 hyperv: Use standard taskqueue instead of hv_work_queue HyperV code was ported from Linux. There is an implementation of work queue called hv_work_queue. In FreeBSD, taskqueue could be used for the same purpose. Convert all the consumer of hv_work_queue to use taskqueue, and remove work queue implementation. Submitted by: Jun Su Reviewed by:adrian, Hongjiang Zhang Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D4963 295308 hyperv: Use WAITOK in the places where we can wait And convert rndis non-hot path spinlock to mutex. Submitted by: Jun Su Reviewed by:adrian, sephe Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5081 295309 hyperv: Use malloc for page allocation. We will eventually convert them to use busdma. Submitted by: Jun Su Reviewed by:adrian, sephe, Dexuan Cui Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5087 295606 hyperv/hn: Fix typo in comment Noticed by: avos Reviewed by:adrian, avos, Hongjiang Zhang Approved by:adrian MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5199 Modified: stable/10/sys/dev/hyperv/include/hyperv.h stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c 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/utilities/hv_kvp.c stable/10/sys/dev/hyperv/utilities/hv_util.c stable/10/sys/dev/hyperv/vmbus/hv_channel.c stable/10/sys/dev/hyperv/vmbus/hv_channel_mgmt.c stable/10/sys/dev/hyperv/vmbus/hv_connection.c stable/10/sys/dev/hyperv/vmbus/hv_hv.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c stable/10/sys/dev/hyperv/vmbus/hv_vmbus_priv.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/include/hyperv.h == --- stable/10/sys/dev/hyperv/include/hyperv.h Mon Jun 13 06:24:41 2016 (r301858) +++ stable/10/sys/dev/hyperv/include/hyperv.h Mon Jun 13 06:38:46 2016 (r301859) @@ -908,30 +908,6 @@ inthv_vmbus_channel_teardown_gpdal( struct hv_vmbus_channel* vmbus_select_outgoing_channel(struct hv_vmbus_channel *promary); -/* - * Work abstraction defines - */ -typedef struct hv_work_queue { - struct taskqueue* queue; - struct proc*proc; - struct sema*work_sema; -} hv_work_queue; - -typedef struct hv_work_item { - struct task work; - void(*callback)(void *); - void* context; - hv_work_queue* wq; -} hv_work_item; - -struct hv_work_queue* hv_work_queue_create(char* name); - -void hv_work_queue_close(struct hv_work_queue* wq); - -inthv_queue_work_item( - hv_work_queue* wq, - void(*callback)(void *), - void* context); /** * @brief Get physical address from virtual */ @@ -952,8 +928,8 @@ typedef struct hv_vmbus_service { hv_guid guid; /* Hyper-V GUID */ char *name;/* name of service */ boolean_t enabled; /* service enabled */ -hv_work_queue *work_queue; /* background work queue */ - + void* context; + struct task task; /* * function to initialize service */ @@ -963,6 +939,11 @@ typedef struct hv_vmbus_service { * function to process Hyper-V messages */ void (*callback)(void *); + + /* +* function to uninitilize service +*/ + int (*uninit)(struct hv_vmbus_service *); } hv_vmbus_service; extern uint8_t* receive_buffer[]; Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c == --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cMon Jun 13 06:24:41 2016(r301858) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cMon Jun 13 06:38:46 2016(r301859) @@ -73,10 +73,7 @@ hv_nv_alloc_net_device(struct hv_device netvsc_dev *net_dev; hn_softc_t *sc =
svn commit: r301858 - stable/10/sys/dev/hyperv/netvsc
Author: sephe Date: Mon Jun 13 06:24:41 2016 New Revision: 301858 URL: https://svnweb.freebsd.org/changeset/base/301858 Log: MFC 295304,295305,295306 295304 hyperv/hn: Increase LRO entry count to 128 by default hn(4) only has one RX ring currently, so default 8 LRO entries are too small. Reviewed by:adrian Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5166 295305 hyperv/hn: Move LRO flush to the channel processing rollup This significantly increases LRO aggregation ratio when there are large amount of connections (improves reception performance a lot). Reviewed by:adrian Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5167 295306 hyperv/hn: Add an option to always do transmission scheduling It is off by default. This eases more experiment on hn(4). Reviewed by:adrian, Hongjiang Zhang Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5175 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.h stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c 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.hMon Jun 13 06:09:02 2016(r301857) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.hMon Jun 13 06:24:41 2016(r301858) @@ -1024,6 +1024,7 @@ typedef struct hn_softc { int hn_txdesc_avail; int hn_txeof; + int hn_sched_tx; int hn_direct_tx_size; struct taskqueue *hn_tx_taskq; struct task hn_start_task; Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 06:09:02 2016(r301857) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 06:24:41 2016(r301858) @@ -132,6 +132,8 @@ __FBSDID("$FreeBSD$"); /* YYY should get it from the underlying channel */ #define HN_TX_DESC_CNT 512 +#define HN_LROENT_CNT_DEF 128 + #define HN_RNDIS_MSG_LEN \ (sizeof(rndis_msg) + \ RNDIS_VLAN_PPI_SIZE + \ @@ -232,6 +234,13 @@ TUNABLE_INT("dev.hn.tx_chimney_size", static int hn_direct_tx_size = HN_DIRECT_TX_SIZE_DEF; TUNABLE_INT("dev.hn.direct_tx_size", _direct_tx_size); +#if defined(INET) || defined(INET6) +#if __FreeBSD_version >= 1100095 +static int hn_lro_entry_count = HN_LROENT_CNT_DEF; +TUNABLE_INT("dev.hn.lro_entry_count", _lro_entry_count); +#endif +#endif + /* * Forward declarations */ @@ -335,6 +344,11 @@ netvsc_attach(device_t dev) #if __FreeBSD_version >= 1100045 int tso_maxlen; #endif +#if defined(INET) || defined(INET6) +#if __FreeBSD_version >= 1100095 + int lroent_cnt; +#endif +#endif sc = device_get_softc(dev); if (sc == NULL) { @@ -417,9 +431,17 @@ netvsc_attach(device_t dev) } #if defined(INET) || defined(INET6) +#if __FreeBSD_version >= 1100095 + lroent_cnt = hn_lro_entry_count; + if (lroent_cnt < TCP_LRO_ENTRIES) + lroent_cnt = TCP_LRO_ENTRIES; + tcp_lro_init_args(>hn_lro, ifp, lroent_cnt, 0); + device_printf(dev, "LRO: entry count %d\n", lroent_cnt); +#else tcp_lro_init(>hn_lro); /* Driver private LRO settings */ sc->hn_lro.ifp = ifp; +#endif #ifdef HN_LRO_HIWAT sc->hn_lro.lro_hiwat = sc->hn_lro_hiwat; #endif @@ -512,6 +534,10 @@ netvsc_attach(device_t dev) SYSCTL_ADD_INT(ctx, child, OID_AUTO, "direct_tx_size", CTLFLAG_RW, >hn_direct_tx_size, 0, "Size of the packet for direct transmission"); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "sched_tx", + CTLFLAG_RW, >hn_sched_tx, 0, + "Always schedule transmission " + "instead of doing direct transmission"); if (unit == 0) { struct sysctl_ctx_list *dc_ctx; @@ -547,6 +573,12 @@ netvsc_attach(device_t dev) SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "direct_tx_size", CTLFLAG_RD, _direct_tx_size, 0, "Size of the packet for direct transmission"); +#if defined(INET) || defined(INET6) +#if __FreeBSD_version >= 1100095 + SYSCTL_ADD_INT(dc_ctx, dc_child, OID_AUTO, "lro_entry_count", + CTLFLAG_RD,
svn commit: r301857 - stable/10/sys/dev/hyperv/netvsc
Author: sephe Date: Mon Jun 13 06:09:02 2016 New Revision: 301857 URL: https://svnweb.freebsd.org/changeset/base/301857 Log: MFC 295302,295303 295302 hyperv/hn: Factor out hn_encap() from hn_start_locked() It will be shared w/ upcoming ifnet.if_transmit implementaion. No functional changes. Reviewed by:adrian Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5158 295303 hyperv/hn: Recover half of the chimney sending space We lost half of the chimney sending space, because we mis-used ffs() on a 64 bits mask, where ffsl() should be used. While I'm here: - Use system atomic operation instead. - Stringent chimney sending index assertion. Reviewed by:adrian Approved by:adrian (mentor) MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D5159 Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.c == --- stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cMon Jun 13 05:43:42 2016(r301856) +++ stable/10/sys/dev/hyperv/netvsc/hv_net_vsc.cMon Jun 13 06:09:02 2016(r301857) @@ -135,15 +135,15 @@ hv_nv_get_next_send_section(netvsc_dev * int i; for (i = 0; i < bitsmap_words; i++) { - idx = ffs(~bitsmap[i]); + idx = ffsl(~bitsmap[i]); if (0 == idx) continue; idx--; - if (i * BITS_PER_LONG + idx >= net_dev->send_section_count) - return (ret); + KASSERT(i * BITS_PER_LONG + idx < net_dev->send_section_count, + ("invalid i %d and idx %lu", i, idx)); - if (synch_test_and_set_bit(idx, [i])) + if (atomic_testandset_long([i], idx)) continue; ret = i * BITS_PER_LONG + idx; @@ -788,8 +788,27 @@ hv_nv_on_send_completion(netvsc_dev *net if (NULL != net_vsc_pkt) { if (net_vsc_pkt->send_buf_section_idx != NVSP_1_CHIMNEY_SEND_INVALID_SECTION_INDEX) { - synch_change_bit(net_vsc_pkt->send_buf_section_idx, - net_dev->send_section_bitsmap); + u_long mask; + int idx; + + idx = net_vsc_pkt->send_buf_section_idx / + BITS_PER_LONG; + KASSERT(idx < net_dev->bitsmap_words, + ("invalid section index %u", +net_vsc_pkt->send_buf_section_idx)); + mask = 1UL << + (net_vsc_pkt->send_buf_section_idx % +BITS_PER_LONG); + + KASSERT(net_dev->send_section_bitsmap[idx] & + mask, + ("index bitmap 0x%lx, section index %u, " +"bitmap idx %d, bitmask 0x%lx", +net_dev->send_section_bitsmap[idx], +net_vsc_pkt->send_buf_section_idx, +idx, mask)); + atomic_clear_long( + _dev->send_section_bitsmap[idx], mask); } /* Notify the layer above us */ Modified: stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c == --- stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 05:43:42 2016(r301856) +++ stable/10/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c Mon Jun 13 06:09:02 2016(r301857) @@ -254,6 +254,7 @@ static int hn_create_tx_ring(struct hn_s static void hn_destroy_tx_ring(struct hn_softc *sc); static void hn_start_taskfunc(void *xsc, int pending); static void hn_txeof_taskfunc(void *xsc, int pending); +static int hn_encap(struct hn_softc *, struct hn_txdesc *, struct mbuf **); static __inline void hn_set_lro_hiwat(struct hn_softc *sc, int hiwat) @@ -744,31 +745,235 @@ netvsc_channel_rollup(struct hv_device * } /* - * Start a transmit of one or more packets + * NOTE: + * This this function fails, then both txd and m_head0 will be freed */ static int -hn_start_locked(struct ifnet *ifp, int len)