From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 04:50:15 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27E2569D; Sun, 30 Nov 2014 04:50:15 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F093824E; Sun, 30 Nov 2014 04:50:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAU4oEoc028549; Sun, 30 Nov 2014 04:50:14 GMT (envelope-from peterj@FreeBSD.org) Received: (from peterj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAU4oEug028544; Sun, 30 Nov 2014 04:50:14 GMT (envelope-from peterj@FreeBSD.org) Message-Id: <201411300450.sAU4oEug028544@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peterj set sender to peterj@FreeBSD.org using -f From: Peter Jeremy Date: Sun, 30 Nov 2014 04:50:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275298 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 04:50:15 -0000 Author: peterj Date: Sun Nov 30 04:50:13 2014 New Revision: 275298 URL: https://svnweb.freebsd.org/changeset/base/275298 Log: Cross reference tap(4) and tun(4) and include a short explanation as to how they differ. This will assist users in selecting which interface is more appropriate for their purposes. Approved by: grog (co-mentor) MFC after: 2 week Modified: head/share/man/man4/tap.4 head/share/man/man4/tun.4 Modified: head/share/man/man4/tap.4 ============================================================================== --- head/share/man/man4/tap.4 Sun Nov 30 03:02:20 2014 (r275297) +++ head/share/man/man4/tap.4 Sun Nov 30 04:50:13 2014 (r275298) @@ -1,7 +1,7 @@ .\" $FreeBSD$ .\" Based on PR#2411 .\" -.Dd November 4, 2014 +.Dd November 30, 2014 .Dt TAP 4 .Os .Sh NAME @@ -34,6 +34,17 @@ or a terminal for and a character-special device .Dq control interface. +A client program transfers Ethernet frames to or from the +.Nm +.Dq control +interface. +The +.Xr tun 4 +interface provides similar functionality at the network layer: +a client will transfer IP (by default) packets to or from a +.Xr tun 4 +.Dq control +interface. .Pp The network interfaces are named .Dq Li tap0 , @@ -314,4 +325,5 @@ VMware .El .Sh SEE ALSO .Xr inet 4 , -.Xr intro 4 +.Xr intro 4 , +.Xr tun 4 Modified: head/share/man/man4/tun.4 ============================================================================== --- head/share/man/man4/tun.4 Sun Nov 30 03:02:20 2014 (r275297) +++ head/share/man/man4/tun.4 Sun Nov 30 04:50:13 2014 (r275298) @@ -2,7 +2,7 @@ .\" $FreeBSD$ .\" Based on PR#2411 .\" -.Dd February 4, 2007 +.Dd November 30, 2014 .Dt TUN 4 .Os .Sh NAME @@ -35,6 +35,17 @@ or a terminal for and a character-special device .Dq control interface. +A client program transfers IP (by default) packets to or from the +.Nm +.Dq control +interface. +The +.Xr tap 4 +interface provides similar functionality at the Ethernet layer: +a client will transfer Ethernet frames to or from a +.Xr tap 4 +.Dq control +interface. .Pp The network interfaces are named .Dq Li tun0 , @@ -307,6 +318,7 @@ them pile up. .Xr inet 4 , .Xr intro 4 , .Xr pty 4 , +.Xr tap 4 , .Xr ifconfig 8 .Sh AUTHORS This manual page was originally obtained from From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 06:04:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78FE8B6B; Sun, 30 Nov 2014 06:04:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CE15A70; Sun, 30 Nov 2014 06:04:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAU6412a064406; Sun, 30 Nov 2014 06:04:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAU640Zv064394; Sun, 30 Nov 2014 06:04:00 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411300604.sAU640Zv064394@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 30 Nov 2014 06:04:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275299 - in head/etc: defaults rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 06:04:01 -0000 Author: ngie Date: Sun Nov 30 06:03:59 2014 New Revision: 275299 URL: https://svnweb.freebsd.org/changeset/base/275299 Log: Remove etc/rc.d/mrouted mrouted has been available in ports for the last 8 years as net/mrouted . An equivalent rc.d script has been present in the port. Remove all corresponding variables from etc/defaults/rc.conf Relnotes: yes Deleted: head/etc/rc.d/mrouted Modified: head/etc/defaults/rc.conf head/etc/rc.d/Makefile head/etc/rc.d/NETWORKING Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Sun Nov 30 04:50:13 2014 (r275298) +++ head/etc/defaults/rc.conf Sun Nov 30 06:03:59 2014 (r275299) @@ -390,12 +390,6 @@ gateway_enable="NO" # Set to YES if thi routed_enable="NO" # Set to YES to enable a routing daemon. routed_program="/sbin/routed" # Name of routing daemon to use if enabled. routed_flags="-q" # Flags for routing daemon. -mrouted_enable="NO" # Do IPv4 multicast routing. -mrouted_program="/usr/local/sbin/mrouted" # Name of IPv4 multicast - # routing daemon. You need to - # install it from package or - # port. -mrouted_flags="" # Flags for multicast routing daemon. arpproxy_all="NO" # replaces obsolete kernel option ARP_PROXYALL. forward_sourceroute="NO" # do source routing (only if gateway_enable is set to "YES") accept_sourceroute="NO" # accept source routed packets to us Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sun Nov 30 04:50:13 2014 (r275298) +++ head/etc/rc.d/Makefile Sun Nov 30 06:03:59 2014 (r275299) @@ -90,7 +90,6 @@ FILES= DAEMON \ mountd \ moused \ mroute6d \ - mrouted \ msgs \ natd \ netif \ Modified: head/etc/rc.d/NETWORKING ============================================================================== --- head/etc/rc.d/NETWORKING Sun Nov 30 04:50:13 2014 (r275298) +++ head/etc/rc.d/NETWORKING Sun Nov 30 06:03:59 2014 (r275299) @@ -5,7 +5,7 @@ # PROVIDE: NETWORKING NETWORK # REQUIRE: netif netoptions routing ppp ipfw stf -# REQUIRE: defaultroute routed mrouted route6d mroute6d resolv bridge +# REQUIRE: defaultroute routed route6d mroute6d resolv bridge # REQUIRE: static_arp static_ndp local_unbound # This is a dummy dependency, for services which require networking From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 08:43:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3321E93E; Sun, 30 Nov 2014 08:43:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1E1B594D; Sun, 30 Nov 2014 08:43:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAU8htpI038036; Sun, 30 Nov 2014 08:43:55 GMT (envelope-from rdivacky@FreeBSD.org) Received: (from rdivacky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAU8htBa038035; Sun, 30 Nov 2014 08:43:55 GMT (envelope-from rdivacky@FreeBSD.org) Message-Id: <201411300843.sAU8htBa038035@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rdivacky set sender to rdivacky@FreeBSD.org using -f From: Roman Divacky Date: Sun, 30 Nov 2014 08:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275305 - head/sys/boot/i386/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 08:43:56 -0000 Author: rdivacky Date: Sun Nov 30 08:43:55 2014 New Revision: 275305 URL: https://svnweb.freebsd.org/changeset/base/275305 Log: Unbreak the code for non-digits below '0' by casting the expression to unsigned int. Pointed out by: bde Modified: head/sys/boot/i386/boot2/boot2.c Modified: head/sys/boot/i386/boot2/boot2.c ============================================================================== --- head/sys/boot/i386/boot2/boot2.c Sun Nov 30 08:34:46 2014 (r275304) +++ head/sys/boot/i386/boot2/boot2.c Sun Nov 30 08:43:55 2014 (r275305) @@ -418,7 +418,7 @@ parse() #if SERIAL } else if (c == 'S') { j = 0; - while ((i = *arg++ - '0') <= 9) + while ((unsigned int)(i = *arg++ - '0') <= 9) j = j * 10 + i; if (j > 0 && i == -'0') { comspeed = j; From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 11:02:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E743C14D; Sun, 30 Nov 2014 11:02:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D390C6A4; Sun, 30 Nov 2014 11:02:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUB28EF003379; Sun, 30 Nov 2014 11:02:08 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUB284H003376; Sun, 30 Nov 2014 11:02:08 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411301102.sAUB284H003376@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 30 Nov 2014 11:02:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275312 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 11:02:09 -0000 Author: glebius Date: Sun Nov 30 11:02:07 2014 New Revision: 275312 URL: https://svnweb.freebsd.org/changeset/base/275312 Log: Make sballoc() and sbfree() functions. Ideally, they could be marked as static, but unfortunately Infiniband (ab)uses them. Sponsored by: Nginx, Inc. Modified: head/sys/kern/uipc_sockbuf.c head/sys/sys/sockbuf.h Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Sun Nov 30 10:55:01 2014 (r275311) +++ head/sys/kern/uipc_sockbuf.c Sun Nov 30 11:02:07 2014 (r275312) @@ -69,6 +69,60 @@ static struct mbuf *sbcut_internal(struc static void sbflush_internal(struct sockbuf *sb); /* + * Adjust sockbuf state reflecting allocation of m. + */ +void +sballoc(struct sockbuf *sb, struct mbuf *m) +{ + + SOCKBUF_LOCK_ASSERT(sb); + + sb->sb_cc += m->m_len; + + if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) + sb->sb_ctl += m->m_len; + + sb->sb_mbcnt += MSIZE; + sb->sb_mcnt += 1; + + if (m->m_flags & M_EXT) { + sb->sb_mbcnt += m->m_ext.ext_size; + sb->sb_ccnt += 1; + } +} + +/* + * Adjust sockbuf state reflecting freeing of m. + */ +void +sbfree(struct sockbuf *sb, struct mbuf *m) +{ + +#if 0 /* XXX: not yet: soclose() call path comes here w/o lock. */ + SOCKBUF_LOCK_ASSERT(sb); +#endif + + sb->sb_cc -= m->m_len; + + if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) + sb->sb_ctl -= m->m_len; + + sb->sb_mbcnt -= MSIZE; + sb->sb_mcnt -= 1; + if (m->m_flags & M_EXT) { + sb->sb_mbcnt -= m->m_ext.ext_size; + sb->sb_ccnt -= 1; + } + + if (sb->sb_sndptr == m) { + sb->sb_sndptr = NULL; + sb->sb_sndptroff = 0; + } + if (sb->sb_sndptroff != 0) + sb->sb_sndptroff -= m->m_len; +} + +/* * Socantsendmore indicates that no more data will be sent on the socket; it * would normally be applied to a socket when the user informs the system * that no more data is to be sent, by the protocol code (in case Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Sun Nov 30 10:55:01 2014 (r275311) +++ head/sys/sys/sockbuf.h Sun Nov 30 11:02:07 2014 (r275312) @@ -164,6 +164,8 @@ void sbtoxsockbuf(struct sockbuf *sb, st int sbwait(struct sockbuf *sb); int sblock(struct sockbuf *sb, int flags); void sbunlock(struct sockbuf *sb); +void sballoc(struct sockbuf *, struct mbuf *); +void sbfree(struct sockbuf *, struct mbuf *); /* * Return how much data is available to be taken out of socket @@ -213,38 +215,6 @@ sbspace(struct sockbuf *sb) return((bleft < mleft) ? bleft : mleft); } -/* adjust counters in sb reflecting allocation of m */ -#define sballoc(sb, m) { \ - (sb)->sb_cc += (m)->m_len; \ - if ((m)->m_type != MT_DATA && (m)->m_type != MT_OOBDATA) \ - (sb)->sb_ctl += (m)->m_len; \ - (sb)->sb_mbcnt += MSIZE; \ - (sb)->sb_mcnt += 1; \ - if ((m)->m_flags & M_EXT) { \ - (sb)->sb_mbcnt += (m)->m_ext.ext_size; \ - (sb)->sb_ccnt += 1; \ - } \ -} - -/* adjust counters in sb reflecting freeing of m */ -#define sbfree(sb, m) { \ - (sb)->sb_cc -= (m)->m_len; \ - if ((m)->m_type != MT_DATA && (m)->m_type != MT_OOBDATA) \ - (sb)->sb_ctl -= (m)->m_len; \ - (sb)->sb_mbcnt -= MSIZE; \ - (sb)->sb_mcnt -= 1; \ - if ((m)->m_flags & M_EXT) { \ - (sb)->sb_mbcnt -= (m)->m_ext.ext_size; \ - (sb)->sb_ccnt -= 1; \ - } \ - if ((sb)->sb_sndptr == (m)) { \ - (sb)->sb_sndptr = NULL; \ - (sb)->sb_sndptroff = 0; \ - } \ - if ((sb)->sb_sndptroff != 0) \ - (sb)->sb_sndptroff -= (m)->m_len; \ -} - #define SB_EMPTY_FIXUP(sb) do { \ if ((sb)->sb_mb == NULL) { \ (sb)->sb_mbtail = NULL; \ From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 11:22:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83B5A8C3; Sun, 30 Nov 2014 11:22:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 648E28AC; Sun, 30 Nov 2014 11:22:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUBMeRc013371; Sun, 30 Nov 2014 11:22:40 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUBMdSu013369; Sun, 30 Nov 2014 11:22:39 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411301122.sAUBMdSu013369@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 30 Nov 2014 11:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275315 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 11:22:40 -0000 Author: glebius Date: Sun Nov 30 11:22:39 2014 New Revision: 275315 URL: https://svnweb.freebsd.org/changeset/base/275315 Log: - Move sbcheck() declaration under SOCKBUF_DEBUG. - Improve SOCKBUF_DEBUG macros. - Improve sbcheck(). Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/kern/uipc_sockbuf.c head/sys/sys/sockbuf.h Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Sun Nov 30 11:14:49 2014 (r275314) +++ head/sys/kern/uipc_sockbuf.c Sun Nov 30 11:22:39 2014 (r275315) @@ -607,28 +607,36 @@ sbappendstream(struct sockbuf *sb, struc #ifdef SOCKBUF_DEBUG void -sbcheck(struct sockbuf *sb) +sbcheck(struct sockbuf *sb, const char *file, int line) { - struct mbuf *m; - struct mbuf *n = 0; - u_long len = 0, mbcnt = 0; + struct mbuf *m, *n; + u_long cc, mbcnt; SOCKBUF_LOCK_ASSERT(sb); + cc = mbcnt = 0; + for (m = sb->sb_mb; m; m = n) { n = m->m_nextpkt; for (; m; m = m->m_next) { - len += m->m_len; + if (m->m_len == 0) { + printf("sb %p empty mbuf %p\n", sb, m); + goto fail; + } + cc += m->m_len; mbcnt += MSIZE; if (m->m_flags & M_EXT) /*XXX*/ /* pretty sure this is bogus */ mbcnt += m->m_ext.ext_size; } } - if (len != sb->sb_cc || mbcnt != sb->sb_mbcnt) { - printf("cc %ld != %u || mbcnt %ld != %u\n", len, sb->sb_cc, + if (cc != sb->sb_cc || mbcnt != sb->sb_mbcnt) { + printf("cc %ld != %u || mbcnt %ld != %u\n", cc, sb->sb_cc, mbcnt, sb->sb_mbcnt); - panic("sbcheck"); + goto fail; } + return; +fail: + panic("%s from %s:%u", __func__, file, line); } #endif Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Sun Nov 30 11:14:49 2014 (r275314) +++ head/sys/sys/sockbuf.h Sun Nov 30 11:22:39 2014 (r275315) @@ -136,7 +136,6 @@ int sbappendcontrol_locked(struct sockbu struct mbuf *control); void sbappendrecord(struct sockbuf *sb, struct mbuf *m0); void sbappendrecord_locked(struct sockbuf *sb, struct mbuf *m0); -void sbcheck(struct sockbuf *sb); void sbcompress(struct sockbuf *sb, struct mbuf *m, struct mbuf *n); struct mbuf * sbcreatecontrol(caddr_t p, int size, int type, int level); @@ -224,13 +223,15 @@ sbspace(struct sockbuf *sb) #ifdef SOCKBUF_DEBUG void sblastrecordchk(struct sockbuf *, const char *, int); -#define SBLASTRECORDCHK(sb) sblastrecordchk((sb), __FILE__, __LINE__) - void sblastmbufchk(struct sockbuf *, const char *, int); +void sbcheck(struct sockbuf *, const char *, int); +#define SBLASTRECORDCHK(sb) sblastrecordchk((sb), __FILE__, __LINE__) #define SBLASTMBUFCHK(sb) sblastmbufchk((sb), __FILE__, __LINE__) +#define SBCHECK(sb) sbcheck((sb), __FILE__, __LINE__) #else -#define SBLASTRECORDCHK(sb) /* nothing */ -#define SBLASTMBUFCHK(sb) /* nothing */ +#define SBLASTRECORDCHK(sb) do {} while (0) +#define SBLASTMBUFCHK(sb) do {} while (0) +#define SBCHECK(sb) do {} while (0) #endif /* SOCKBUF_DEBUG */ #endif /* _KERNEL */ From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 12:11:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 54E392FB; Sun, 30 Nov 2014 12:11:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 41BE8C1B; Sun, 30 Nov 2014 12:11:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUCB2Ve034975; Sun, 30 Nov 2014 12:11:02 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUCB2iv034974; Sun, 30 Nov 2014 12:11:02 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411301211.sAUCB2iv034974@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 30 Nov 2014 12:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275320 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 12:11:02 -0000 Author: glebius Date: Sun Nov 30 12:11:01 2014 New Revision: 275320 URL: https://svnweb.freebsd.org/changeset/base/275320 Log: Missed in r274421: use sbavail() instead of bare access to sb_cc. Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Sun Nov 30 11:59:20 2014 (r275319) +++ head/sys/netinet/tcp_usrreq.c Sun Nov 30 12:11:01 2014 (r275320) @@ -925,7 +925,7 @@ tcp_usr_send(struct socket *so, int flag tp->snd_wnd = TTCP_CLIENT_SND_WND; tcp_mss(tp, -1); } - tp->snd_up = tp->snd_una + so->so_snd.sb_cc; + tp->snd_up = tp->snd_una + sbavail(&so->so_snd); tp->t_flags |= TF_FORCEDATA; error = tcp_output(tp); tp->t_flags &= ~TF_FORCEDATA; From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 12:20:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D619B66C; Sun, 30 Nov 2014 12:20:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C2C3BCE9; Sun, 30 Nov 2014 12:20:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUCKPYg037910; Sun, 30 Nov 2014 12:20:25 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUCKPrB037906; Sun, 30 Nov 2014 12:20:25 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201411301220.sAUCKPrB037906@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 30 Nov 2014 12:20:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275321 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 12:20:25 -0000 Author: andrew Date: Sun Nov 30 12:20:24 2014 New Revision: 275321 URL: https://svnweb.freebsd.org/changeset/base/275321 Log: Remove extra labels, ENTRY_NP already provides them. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/cpufunc_asm_armv5.S head/sys/arm/arm/cpufunc_asm_xscale_c3.S Modified: head/sys/arm/arm/cpufunc_asm_armv5.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv5.S Sun Nov 30 12:11:01 2014 (r275320) +++ head/sys/arm/arm/cpufunc_asm_armv5.S Sun Nov 30 12:20:24 2014 (r275321) @@ -194,7 +194,6 @@ ENTRY(armv5_idcache_wbinv_range) END(armv5_idcache_wbinv_range) ENTRY_NP(armv5_idcache_wbinv_all) -armv5_idcache_wbinv_all: .Larmv5_idcache_wbinv_all: /* * We assume that the code here can never be out of sync with the Modified: head/sys/arm/arm/cpufunc_asm_xscale_c3.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_xscale_c3.S Sun Nov 30 12:11:01 2014 (r275320) +++ head/sys/arm/arm/cpufunc_asm_xscale_c3.S Sun Nov 30 12:20:24 2014 (r275321) @@ -144,7 +144,6 @@ __FBSDID("$FreeBSD$"); ENTRY_NP(xscalec3_cache_syncI) -xscalec3_cache_purgeID: EENTRY_NP(xscalec3_cache_purgeID) mcr p15, 0, r0, c7, c5, 0 /* flush I cache (D cleaned below) */ EENTRY_NP(xscalec3_cache_cleanID) From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 12:25:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFE577E6; Sun, 30 Nov 2014 12:25:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD230D98; Sun, 30 Nov 2014 12:25:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUCP58A041869; Sun, 30 Nov 2014 12:25:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUCP5C3041867; Sun, 30 Nov 2014 12:25:05 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201411301225.sAUCP5C3041867@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 30 Nov 2014 12:25:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275322 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 12:25:05 -0000 Author: andrew Date: Sun Nov 30 12:25:04 2014 New Revision: 275322 URL: https://svnweb.freebsd.org/changeset/base/275322 Log: Correctly a few incorrect uses of ENTRY/EENTRY and END/EEND Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/fusu.S head/sys/arm/arm/support.S Modified: head/sys/arm/arm/fusu.S ============================================================================== --- head/sys/arm/arm/fusu.S Sun Nov 30 12:20:24 2014 (r275321) +++ head/sys/arm/arm/fusu.S Sun Nov 30 12:25:04 2014 (r275322) @@ -129,7 +129,7 @@ EENTRY_NP(fuword32) str r1, [r2, #PCB_ONFAULT] mov r0, r3 RET -END(fuword32) +EEND(fuword32) END(fuword) /* @@ -295,7 +295,7 @@ EENTRY_NP(suword32) mov r0, #0x00000000 str r0, [r2, #PCB_ONFAULT] RET -END(suword32) +EEND(suword32) END(suword) /* Modified: head/sys/arm/arm/support.S ============================================================================== --- head/sys/arm/arm/support.S Sun Nov 30 12:20:24 2014 (r275321) +++ head/sys/arm/arm/support.S Sun Nov 30 12:25:04 2014 (r275322) @@ -130,7 +130,7 @@ ENTRY(bzero) .Lnormal0: mov r3, #0x00 b do_memset -EEND(bzero) +END(bzero) /* LINTSTUB: Func: void *memset(void *, int, size_t) */ ENTRY(memset) and r3, r1, #0xff /* We deal with bytes */ From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 12:32:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6CE1C9B8; Sun, 30 Nov 2014 12:32:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4044DE59; Sun, 30 Nov 2014 12:32:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUCWHis046196; Sun, 30 Nov 2014 12:32:17 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUCWHvC046195; Sun, 30 Nov 2014 12:32:17 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411301232.sAUCWHvC046195@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 30 Nov 2014 12:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275323 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 12:32:17 -0000 Author: ngie Date: Sun Nov 30 12:32:16 2014 New Revision: 275323 URL: https://svnweb.freebsd.org/changeset/base/275323 Log: Add mergeinfo for r275302 Modified: Directory Properties: head/ (props changed) From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 12:34:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 459CCB2F; Sun, 30 Nov 2014 12:34:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 32C19E67; Sun, 30 Nov 2014 12:34:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUCYnbQ046572; Sun, 30 Nov 2014 12:34:49 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUCYmAT046570; Sun, 30 Nov 2014 12:34:48 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201411301234.sAUCYmAT046570@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 30 Nov 2014 12:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275324 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 12:34:49 -0000 Author: ngie Date: Sun Nov 30 12:34:48 2014 New Revision: 275324 URL: https://svnweb.freebsd.org/changeset/base/275324 Log: Remove duplicate FILESYSTEMS REQUIRE from etc/rc.d/ipmon and etc/rc.d/pflog Modified: head/etc/rc.d/ipmon head/etc/rc.d/pflog Directory Properties: head/ (props changed) head/etc/ (props changed) Modified: head/etc/rc.d/ipmon ============================================================================== --- head/etc/rc.d/ipmon Sun Nov 30 12:32:16 2014 (r275323) +++ head/etc/rc.d/ipmon Sun Nov 30 12:34:48 2014 (r275324) @@ -4,7 +4,7 @@ # # PROVIDE: ipmon -# REQUIRE: FILESYSTEMS hostname sysctl FILESYSTEMS ipfilter +# REQUIRE: FILESYSTEMS hostname sysctl ipfilter # BEFORE: SERVERS # KEYWORD: nojail Modified: head/etc/rc.d/pflog ============================================================================== --- head/etc/rc.d/pflog Sun Nov 30 12:32:16 2014 (r275323) +++ head/etc/rc.d/pflog Sun Nov 30 12:34:48 2014 (r275324) @@ -4,7 +4,7 @@ # # PROVIDE: pflog -# REQUIRE: FILESYSTEMS netif FILESYSTEMS +# REQUIRE: FILESYSTEMS netif # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 12:52:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E60D1E0C; Sun, 30 Nov 2014 12:52:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D02D9FD8; Sun, 30 Nov 2014 12:52:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUCqdRA055641; Sun, 30 Nov 2014 12:52:39 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUCqYXm055601; Sun, 30 Nov 2014 12:52:34 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411301252.sAUCqYXm055601@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 30 Nov 2014 12:52:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275326 - in head: sys/dev/cxgbe/tom sys/kern sys/netinet sys/sys usr.bin/bluetooth/btsockstat usr.bin/netstat usr.bin/systat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 12:52:40 -0000 Author: glebius Date: Sun Nov 30 12:52:33 2014 New Revision: 275326 URL: https://svnweb.freebsd.org/changeset/base/275326 Log: Merge from projects/sendfile: o Introduce a notion of "not ready" mbufs in socket buffers. These mbufs are now being populated by some I/O in background and are referenced outside. This forces following implications: - An mbuf which is "not ready" can't be taken out of the buffer. - An mbuf that is behind a "not ready" in the queue neither. - If sockbet buffer is flushed, then "not ready" mbufs shouln't be freed. o In struct sockbuf the sb_cc field is split into sb_ccc and sb_acc. The sb_ccc stands for ""claimed character count", or "committed character count". And the sb_acc is "available character count". Consumers of socket buffer API shouldn't already access them directly, but use sbused() and sbavail() respectively. o Not ready mbufs are marked with M_NOTREADY, and ready but blocked ones with M_BLOCKED. o New field sb_fnrdy points to the first not ready mbuf, to avoid linear search. o New function sbready() is provided to activate certain amount of mbufs in a socket buffer. A special note on SCTP: SCTP has its own sockbufs. Unfortunately, FreeBSD stack doesn't yet allow protocol specific sockbufs. Thus, SCTP does some hacks to make itself compatible with FreeBSD: it manages sockbufs on its own, but keeps sb_cc updated to inform the stack of amount of data in them. The new notion of "not ready" data isn't supported by SCTP. Instead, only a mechanical substitute is done: s/sb_cc/sb_ccc/. A proper solution would be to take away struct sockbuf from struct socket and allow protocols to implement their own socket buffers, like SCTP already does. This was discussed with rrs@. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/kern/uipc_debug.c head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_socket.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctp_var.h head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h head/sys/sys/sockbuf.h head/usr.bin/bluetooth/btsockstat/btsockstat.c head/usr.bin/netstat/inet.c head/usr.bin/netstat/netgraph.c head/usr.bin/netstat/unix.c head/usr.bin/systat/netstat.c Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Sun Nov 30 12:52:33 2014 (r275326) @@ -971,8 +971,9 @@ handle_ddp(struct socket *so, struct uio */ rc = sbwait(sb); while (toep->ddp_flags & buf_flag) { + /* XXXGL: shouldn't here be sbwait() call? */ sb->sb_flags |= SB_WAIT; - msleep(&sb->sb_cc, &sb->sb_mtx, PSOCK , "sbwait", 0); + msleep(&sb->sb_acc, &sb->sb_mtx, PSOCK , "sbwait", 0); } unwire_ddp_buffer(db); return (rc); Modified: head/sys/kern/uipc_debug.c ============================================================================== --- head/sys/kern/uipc_debug.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/kern/uipc_debug.c Sun Nov 30 12:52:33 2014 (r275326) @@ -401,7 +401,8 @@ db_print_sockbuf(struct sockbuf *sb, con db_printf("sb_sndptroff: %u\n", sb->sb_sndptroff); db_print_indent(indent); - db_printf("sb_cc: %u ", sb->sb_cc); + db_printf("sb_acc: %u ", sb->sb_acc); + db_printf("sb_ccc: %u ", sb->sb_ccc); db_printf("sb_hiwat: %u ", sb->sb_hiwat); db_printf("sb_mbcnt: %u ", sb->sb_mbcnt); db_printf("sb_mbmax: %u\n", sb->sb_mbmax); Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/kern/uipc_sockbuf.c Sun Nov 30 12:52:33 2014 (r275326) @@ -69,6 +69,43 @@ static struct mbuf *sbcut_internal(struc static void sbflush_internal(struct sockbuf *sb); /* + * Mark ready "count" mbufs starting with "m". + */ +int +sbready(struct sockbuf *sb, struct mbuf *m, int count) +{ + u_int blocker; + + SOCKBUF_LOCK_ASSERT(sb); + KASSERT(sb->sb_fnrdy != NULL, ("%s: sb %p NULL fnrdy", __func__, sb)); + + blocker = (sb->sb_fnrdy == m) ? M_BLOCKED : 0; + + for (int i = 0; i < count; i++, m = m->m_next) { + KASSERT(m->m_flags & M_NOTREADY, + ("%s: m %p !M_NOTREADY", __func__, m)); + m->m_flags &= ~(M_NOTREADY | blocker); + if (blocker) + sb->sb_acc += m->m_len; + } + + if (!blocker) + return (EINPROGRESS); + + /* This one was blocking all the queue. */ + for (; m && (m->m_flags & M_NOTREADY) == 0; m = m->m_next) { + KASSERT(m->m_flags & M_BLOCKED, + ("%s: m %p !M_BLOCKED", __func__, m)); + m->m_flags &= ~M_BLOCKED; + sb->sb_acc += m->m_len; + } + + sb->sb_fnrdy = m; + + return (0); +} + +/* * Adjust sockbuf state reflecting allocation of m. */ void @@ -77,7 +114,15 @@ sballoc(struct sockbuf *sb, struct mbuf SOCKBUF_LOCK_ASSERT(sb); - sb->sb_cc += m->m_len; + sb->sb_ccc += m->m_len; + + if (sb->sb_fnrdy == NULL) { + if (m->m_flags & M_NOTREADY) + sb->sb_fnrdy = m; + else + sb->sb_acc += m->m_len; + } else + m->m_flags |= M_BLOCKED; if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) sb->sb_ctl += m->m_len; @@ -102,7 +147,25 @@ sbfree(struct sockbuf *sb, struct mbuf * SOCKBUF_LOCK_ASSERT(sb); #endif - sb->sb_cc -= m->m_len; + sb->sb_ccc -= m->m_len; + + if (!(m->m_flags & M_NOTAVAIL)) + sb->sb_acc -= m->m_len; + + if (m == sb->sb_fnrdy) { + struct mbuf *n; + + KASSERT(m->m_flags & M_NOTREADY, + ("%s: m %p !M_NOTREADY", __func__, m)); + + n = m->m_next; + while (n != NULL && !(n->m_flags & M_NOTREADY)) { + n->m_flags &= ~M_BLOCKED; + sb->sb_acc += n->m_len; + n = n->m_next; + } + sb->sb_fnrdy = n; + } if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) sb->sb_ctl -= m->m_len; @@ -181,7 +244,7 @@ sbwait(struct sockbuf *sb) SOCKBUF_LOCK_ASSERT(sb); sb->sb_flags |= SB_WAIT; - return (msleep_sbt(&sb->sb_cc, &sb->sb_mtx, + return (msleep_sbt(&sb->sb_acc, &sb->sb_mtx, (sb->sb_flags & SB_NOINTR) ? PSOCK : PSOCK | PCATCH, "sbwait", sb->sb_timeo, 0, 0)); } @@ -238,7 +301,7 @@ sowakeup(struct socket *so, struct sockb sb->sb_flags &= ~SB_SEL; if (sb->sb_flags & SB_WAIT) { sb->sb_flags &= ~SB_WAIT; - wakeup(&sb->sb_cc); + wakeup(&sb->sb_acc); } KNOTE_LOCKED(&sb->sb_sel.si_note, 0); if (sb->sb_upcall != NULL) { @@ -609,12 +672,13 @@ sbappendstream(struct sockbuf *sb, struc void sbcheck(struct sockbuf *sb, const char *file, int line) { - struct mbuf *m, *n; - u_long cc, mbcnt; + struct mbuf *m, *n, *fnrdy; + u_long acc, ccc, mbcnt; SOCKBUF_LOCK_ASSERT(sb); - cc = mbcnt = 0; + acc = ccc = mbcnt = 0; + fnrdy = NULL; for (m = sb->sb_mb; m; m = n) { n = m->m_nextpkt; @@ -623,15 +687,31 @@ sbcheck(struct sockbuf *sb, const char * printf("sb %p empty mbuf %p\n", sb, m); goto fail; } - cc += m->m_len; + if ((m->m_flags & M_NOTREADY) && fnrdy == NULL) { + if (m != sb->sb_fnrdy) { + printf("sb %p: fnrdy %p != m %p\n", + sb, sb->sb_fnrdy, m); + goto fail; + } + fnrdy = m; + } + if (fnrdy) { + if (!(m->m_flags & M_NOTAVAIL)) { + printf("sb %p: fnrdy %p, m %p is avail\n", + sb, sb->sb_fnrdy, m); + goto fail; + } + } else + acc += m->m_len; + ccc += m->m_len; mbcnt += MSIZE; if (m->m_flags & M_EXT) /*XXX*/ /* pretty sure this is bogus */ mbcnt += m->m_ext.ext_size; } } - if (cc != sb->sb_cc || mbcnt != sb->sb_mbcnt) { - printf("cc %ld != %u || mbcnt %ld != %u\n", cc, sb->sb_cc, - mbcnt, sb->sb_mbcnt); + if (acc != sb->sb_acc || ccc != sb->sb_ccc || mbcnt != sb->sb_mbcnt) { + printf("acc %ld/%u ccc %ld/%u mbcnt %ld/%u\n", + acc, sb->sb_acc, ccc, sb->sb_ccc, mbcnt, sb->sb_mbcnt); goto fail; } return; @@ -832,8 +912,8 @@ sbappendcontrol(struct sockbuf *sb, stru * * (2) The mbuf may be coalesced -- i.e., data in the mbuf may be copied into * an mbuf already in the socket buffer. This can occur if an - * appropriate mbuf exists, there is room, and no merging of data types - * will occur. + * appropriate mbuf exists, there is room, both mbufs are not marked as + * not ready, and no merging of data types will occur. * * (3) The mbuf may be appended to the end of the existing mbuf chain. * @@ -862,13 +942,17 @@ sbcompress(struct sockbuf *sb, struct mb if (n && (n->m_flags & M_EOR) == 0 && M_WRITABLE(n) && ((sb->sb_flags & SB_NOCOALESCE) == 0) && + !(m->m_flags & M_NOTREADY) && + !(n->m_flags & M_NOTREADY) && m->m_len <= MCLBYTES / 4 && /* XXX: Don't copy too much */ m->m_len <= M_TRAILINGSPACE(n) && n->m_type == m->m_type) { bcopy(mtod(m, caddr_t), mtod(n, caddr_t) + n->m_len, (unsigned)m->m_len); n->m_len += m->m_len; - sb->sb_cc += m->m_len; + sb->sb_ccc += m->m_len; + if (sb->sb_fnrdy == NULL) + sb->sb_acc += m->m_len; if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) /* XXX: Probably don't need.*/ sb->sb_ctl += m->m_len; @@ -905,13 +989,13 @@ sbflush_internal(struct sockbuf *sb) * Don't call sbcut(sb, 0) if the leading mbuf is non-empty: * we would loop forever. Panic instead. */ - if (!sb->sb_cc && (sb->sb_mb == NULL || sb->sb_mb->m_len)) + if (sb->sb_ccc == 0 && (sb->sb_mb == NULL || sb->sb_mb->m_len)) break; - m_freem(sbcut_internal(sb, (int)sb->sb_cc)); + m_freem(sbcut_internal(sb, (int)sb->sb_ccc)); } - if (sb->sb_cc || sb->sb_mb || sb->sb_mbcnt) - panic("sbflush_internal: cc %u || mb %p || mbcnt %u", - sb->sb_cc, (void *)sb->sb_mb, sb->sb_mbcnt); + KASSERT(sb->sb_ccc == 0 && sb->sb_mb == 0 && sb->sb_mbcnt == 0, + ("%s: ccc %u mb %p mbcnt %u", __func__, + sb->sb_ccc, (void *)sb->sb_mb, sb->sb_mbcnt)); } void @@ -937,7 +1021,7 @@ sbflush(struct sockbuf *sb) static struct mbuf * sbcut_internal(struct sockbuf *sb, int len) { - struct mbuf *m, *n, *next, *mfree; + struct mbuf *m, *next, *mfree; next = (m = sb->sb_mb) ? m->m_nextpkt : 0; mfree = NULL; @@ -949,9 +1033,12 @@ sbcut_internal(struct sockbuf *sb, int l next = m->m_nextpkt; } if (m->m_len > len) { + KASSERT(!(m->m_flags & M_NOTAVAIL), + ("%s: m %p M_NOTAVAIL", __func__, m)); m->m_len -= len; m->m_data += len; - sb->sb_cc -= len; + sb->sb_ccc -= len; + sb->sb_acc -= len; if (sb->sb_sndptroff != 0) sb->sb_sndptroff -= len; if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) @@ -960,10 +1047,20 @@ sbcut_internal(struct sockbuf *sb, int l } len -= m->m_len; sbfree(sb, m); - n = m->m_next; - m->m_next = mfree; - mfree = m; - m = n; + /* + * Do not put M_NOTREADY buffers to the free list, they + * are referenced from outside. + */ + if (m->m_flags & M_NOTREADY) + m = m->m_next; + else { + struct mbuf *n; + + n = m->m_next; + m->m_next = mfree; + mfree = m; + m = n; + } } if (m) { sb->sb_mb = m; @@ -1030,8 +1127,8 @@ sbsndptr(struct sockbuf *sb, u_int off, struct mbuf *m, *ret; KASSERT(sb->sb_mb != NULL, ("%s: sb_mb is NULL", __func__)); - KASSERT(off + len <= sb->sb_cc, ("%s: beyond sb", __func__)); - KASSERT(sb->sb_sndptroff <= sb->sb_cc, ("%s: sndptroff broken", __func__)); + KASSERT(off + len <= sb->sb_acc, ("%s: beyond sb", __func__)); + KASSERT(sb->sb_sndptroff <= sb->sb_acc, ("%s: sndptroff broken", __func__)); /* * Is off below stored offset? Happens on retransmits. @@ -1180,7 +1277,7 @@ void sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb) { - xsb->sb_cc = sb->sb_cc; + xsb->sb_cc = sb->sb_ccc; xsb->sb_hiwat = sb->sb_hiwat; xsb->sb_mbcnt = sb->sb_mbcnt; xsb->sb_mcnt = sb->sb_mcnt; Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/kern/uipc_socket.c Sun Nov 30 12:52:33 2014 (r275326) @@ -1706,7 +1706,8 @@ dontblock: */ moff = 0; offset = 0; - while (m != NULL && uio->uio_resid > 0 && error == 0) { + while (m != NULL && !(m->m_flags & M_NOTAVAIL) && uio->uio_resid > 0 + && error == 0) { /* * If the type of mbuf has changed since the last mbuf * examined ('type'), end the receive operation. @@ -2044,6 +2045,8 @@ deliver: for (m = sb->sb_mb; m != NULL && m->m_len <= len; m = m->m_next) { + KASSERT(!(m->m_flags & M_NOTAVAIL), + ("%s: m %p not available", __func__, m)); len -= m->m_len; uio->uio_resid -= m->m_len; sbfree(sb, m); Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/netinet/sctp_indata.c Sun Nov 30 12:52:33 2014 (r275326) @@ -70,14 +70,14 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, st /* * This is really set wrong with respect to a 1-2-m socket. Since - * the sb_cc is the count that everyone as put up. When we re-write + * the sb_ccc is the count that everyone as put up. When we re-write * sctp_soreceive then we will fix this so that ONLY this * associations data is taken into account. */ if (stcb->sctp_socket == NULL) return (calc); - if (stcb->asoc.sb_cc == 0 && + if (stcb->asoc.sb_ccc == 0 && asoc->size_on_reasm_queue == 0 && asoc->size_on_all_streams == 0) { /* Full rwnd granted */ @@ -1363,7 +1363,7 @@ sctp_process_a_data_chunk(struct sctp_tc * When we have NO room in the rwnd we check to make sure * the reader is doing its job... */ - if (stcb->sctp_socket->so_rcv.sb_cc) { + if (stcb->sctp_socket->so_rcv.sb_ccc) { /* some to read, wake-up */ #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/netinet/sctp_input.c Sun Nov 30 12:52:33 2014 (r275326) @@ -1032,7 +1032,7 @@ sctp_handle_shutdown_ack(struct sctp_shu if (stcb->sctp_socket) { if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - stcb->sctp_socket->so_snd.sb_cc = 0; + stcb->sctp_socket->so_snd.sb_ccc = 0; } sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); } Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/netinet/sctp_os_bsd.h Sun Nov 30 12:52:33 2014 (r275326) @@ -399,7 +399,7 @@ typedef struct callout sctp_os_timer_t; #define SCTP_SOWAKEUP(so) wakeup(&(so)->so_timeo) /* clear the socket buffer state */ #define SCTP_SB_CLEAR(sb) \ - (sb).sb_cc = 0; \ + (sb).sb_ccc = 0; \ (sb).sb_mb = NULL; \ (sb).sb_mbcnt = 0; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/netinet/sctp_output.c Sun Nov 30 12:52:33 2014 (r275326) @@ -7250,7 +7250,7 @@ one_more_time: if ((stcb->sctp_socket != NULL) && \ ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { - atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc, sp->length); + atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_ccc, sp->length); } if (sp->data) { sctp_m_freem(sp->data); @@ -11532,7 +11532,7 @@ jump_out: drp->current_onq = htonl(asoc->size_on_reasm_queue + asoc->size_on_all_streams + asoc->my_rwnd_control_len + - stcb->sctp_socket->so_rcv.sb_cc); + stcb->sctp_socket->so_rcv.sb_ccc); } else { /*- * If my rwnd is 0, possibly from mbuf depletion as well as Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/netinet/sctp_pcb.c Sun Nov 30 12:52:33 2014 (r275326) @@ -3397,7 +3397,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, if ((asoc->asoc.size_on_reasm_queue > 0) || (asoc->asoc.control_pdapi) || (asoc->asoc.size_on_all_streams > 0) || - (so && (so->so_rcv.sb_cc > 0))) { + (so && (so->so_rcv.sb_ccc > 0))) { /* Left with Data unread */ struct mbuf *op_err; @@ -3625,7 +3625,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, TAILQ_REMOVE(&inp->read_queue, sq, next); sctp_free_remote_addr(sq->whoFrom); if (so) - so->so_rcv.sb_cc -= sq->length; + so->so_rcv.sb_ccc -= sq->length; if (sq->data) { sctp_m_freem(sq->data); sq->data = NULL; @@ -4853,7 +4853,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, inp->sctp_flags |= SCTP_PCB_FLAGS_WAS_CONNECTED; if (so) { SOCK_LOCK(so); - if (so->so_rcv.sb_cc == 0) { + if (so->so_rcv.sb_ccc == 0) { so->so_state &= ~(SS_ISCONNECTING | SS_ISDISCONNECTING | SS_ISCONFIRMING | Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/netinet/sctp_pcb.h Sun Nov 30 12:52:33 2014 (r275326) @@ -369,7 +369,7 @@ struct sctp_inpcb { } ip_inp; - /* Socket buffer lock protects read_queue and of course sb_cc */ + /* Socket buffer lock protects read_queue and of course sb_ccc */ struct sctp_readhead read_queue; LIST_ENTRY(sctp_inpcb) sctp_list; /* lists all endpoints */ Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/netinet/sctp_structs.h Sun Nov 30 12:52:33 2014 (r275326) @@ -990,7 +990,7 @@ struct sctp_association { uint32_t total_output_queue_size; - uint32_t sb_cc; /* shadow of sb_cc */ + uint32_t sb_ccc; /* shadow of sb_ccc */ uint32_t sb_send_resv; /* amount reserved on a send */ uint32_t my_rwnd_control_len; /* shadow of sb_mbcnt used for rwnd * control */ Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/netinet/sctp_usrreq.c Sun Nov 30 12:52:33 2014 (r275326) @@ -586,7 +586,7 @@ sctp_must_try_again: if (((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) && (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) { if (((so->so_options & SO_LINGER) && (so->so_linger == 0)) || - (so->so_rcv.sb_cc > 0)) { + (so->so_rcv.sb_ccc > 0)) { #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 13); #endif @@ -751,7 +751,7 @@ sctp_disconnect(struct socket *so) } if (((so->so_options & SO_LINGER) && (so->so_linger == 0)) || - (so->so_rcv.sb_cc > 0)) { + (so->so_rcv.sb_ccc > 0)) { if (SCTP_GET_STATE(asoc) != SCTP_STATE_COOKIE_WAIT) { /* Left with Data unread */ @@ -916,7 +916,7 @@ sctp_flush(struct socket *so, int how) inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_CANT_READ; SCTP_INP_READ_UNLOCK(inp); SCTP_INP_WUNLOCK(inp); - so->so_rcv.sb_cc = 0; + so->so_rcv.sb_ccc = 0; so->so_rcv.sb_mbcnt = 0; so->so_rcv.sb_mb = NULL; } @@ -925,7 +925,7 @@ sctp_flush(struct socket *so, int how) * First make sure the sb will be happy, we don't use these * except maybe the count */ - so->so_snd.sb_cc = 0; + so->so_snd.sb_ccc = 0; so->so_snd.sb_mbcnt = 0; so->so_snd.sb_mb = NULL; Modified: head/sys/netinet/sctp_var.h ============================================================================== --- head/sys/netinet/sctp_var.h Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/netinet/sctp_var.h Sun Nov 30 12:52:33 2014 (r275326) @@ -82,9 +82,9 @@ extern struct pr_usrreqs sctp_usrreqs; #define sctp_maxspace(sb) (max((sb)->sb_hiwat,SCTP_MINIMAL_RWND)) -#define sctp_sbspace(asoc, sb) ((long) ((sctp_maxspace(sb) > (asoc)->sb_cc) ? (sctp_maxspace(sb) - (asoc)->sb_cc) : 0)) +#define sctp_sbspace(asoc, sb) ((long) ((sctp_maxspace(sb) > (asoc)->sb_ccc) ? (sctp_maxspace(sb) - (asoc)->sb_ccc) : 0)) -#define sctp_sbspace_failedmsgs(sb) ((long) ((sctp_maxspace(sb) > (sb)->sb_cc) ? (sctp_maxspace(sb) - (sb)->sb_cc) : 0)) +#define sctp_sbspace_failedmsgs(sb) ((long) ((sctp_maxspace(sb) > (sb)->sb_ccc) ? (sctp_maxspace(sb) - (sb)->sb_ccc) : 0)) #define sctp_sbspace_sub(a,b) ((a > b) ? (a - b) : 0) @@ -195,10 +195,10 @@ extern struct pr_usrreqs sctp_usrreqs; } #define sctp_sbfree(ctl, stcb, sb, m) { \ - SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_cc, SCTP_BUF_LEN((m))); \ + SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_ccc, SCTP_BUF_LEN((m))); \ SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_mbcnt, MSIZE); \ if (((ctl)->do_not_ref_stcb == 0) && stcb) {\ - SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.sb_cc, SCTP_BUF_LEN((m))); \ + SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.sb_ccc, SCTP_BUF_LEN((m))); \ SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.my_rwnd_control_len, MSIZE); \ } \ if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \ @@ -207,10 +207,10 @@ extern struct pr_usrreqs sctp_usrreqs; } #define sctp_sballoc(stcb, sb, m) { \ - atomic_add_int(&(sb)->sb_cc,SCTP_BUF_LEN((m))); \ + atomic_add_int(&(sb)->sb_ccc,SCTP_BUF_LEN((m))); \ atomic_add_int(&(sb)->sb_mbcnt, MSIZE); \ if (stcb) { \ - atomic_add_int(&(stcb)->asoc.sb_cc,SCTP_BUF_LEN((m))); \ + atomic_add_int(&(stcb)->asoc.sb_ccc,SCTP_BUF_LEN((m))); \ atomic_add_int(&(stcb)->asoc.my_rwnd_control_len, MSIZE); \ } \ if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \ Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/netinet/sctputil.c Sun Nov 30 12:52:33 2014 (r275326) @@ -67,9 +67,9 @@ sctp_sblog(struct sockbuf *sb, struct sc struct sctp_cwnd_log sctp_clog; sctp_clog.x.sb.stcb = stcb; - sctp_clog.x.sb.so_sbcc = sb->sb_cc; + sctp_clog.x.sb.so_sbcc = sb->sb_ccc; if (stcb) - sctp_clog.x.sb.stcb_sbcc = stcb->asoc.sb_cc; + sctp_clog.x.sb.stcb_sbcc = stcb->asoc.sb_ccc; else sctp_clog.x.sb.stcb_sbcc = 0; sctp_clog.x.sb.incr = incr; @@ -4363,7 +4363,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp { /* * Here we must place the control on the end of the socket read - * queue AND increment sb_cc so that select will work properly on + * queue AND increment sb_ccc so that select will work properly on * read. */ struct mbuf *m, *prev = NULL; @@ -4489,7 +4489,7 @@ sctp_append_to_readq(struct sctp_inpcb * * the reassembly queue. * * If PDAPI this means we need to add m to the end of the data. - * Increase the length in the control AND increment the sb_cc. + * Increase the length in the control AND increment the sb_ccc. * Otherwise sb is NULL and all we need to do is put it at the end * of the mbuf chain. */ @@ -4701,10 +4701,10 @@ sctp_free_bufspace(struct sctp_tcb *stcb if (stcb->sctp_socket && (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) || ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)))) { - if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { - stcb->sctp_socket->so_snd.sb_cc -= tp1->book_size; + if (stcb->sctp_socket->so_snd.sb_ccc >= tp1->book_size) { + stcb->sctp_socket->so_snd.sb_ccc -= tp1->book_size; } else { - stcb->sctp_socket->so_snd.sb_cc = 0; + stcb->sctp_socket->so_snd.sb_ccc = 0; } } @@ -5254,11 +5254,11 @@ sctp_sorecvmsg(struct socket *so, in_eeor_mode = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RECV_RWND_LOGGING_ENABLE) { sctp_misc_ints(SCTP_SORECV_ENTER, - rwnd_req, in_eeor_mode, so->so_rcv.sb_cc, uio->uio_resid); + rwnd_req, in_eeor_mode, so->so_rcv.sb_ccc, uio->uio_resid); } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RECV_RWND_LOGGING_ENABLE) { sctp_misc_ints(SCTP_SORECV_ENTERPL, - rwnd_req, block_allowed, so->so_rcv.sb_cc, uio->uio_resid); + rwnd_req, block_allowed, so->so_rcv.sb_ccc, uio->uio_resid); } error = sblock(&so->so_rcv, (block_allowed ? SBL_WAIT : 0)); if (error) { @@ -5277,23 +5277,23 @@ restart_nosblocks: (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { goto out; } - if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && (so->so_rcv.sb_cc == 0)) { + if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && (so->so_rcv.sb_ccc == 0)) { if (so->so_error) { error = so->so_error; if ((in_flags & MSG_PEEK) == 0) so->so_error = 0; goto out; } else { - if (so->so_rcv.sb_cc == 0) { + if (so->so_rcv.sb_ccc == 0) { /* indicate EOF */ error = 0; goto out; } } } - if ((so->so_rcv.sb_cc <= held_length) && block_allowed) { + if ((so->so_rcv.sb_ccc <= held_length) && block_allowed) { /* we need to wait for data */ - if ((so->so_rcv.sb_cc == 0) && + if ((so->so_rcv.sb_ccc == 0) && ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { if ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0) { @@ -5329,7 +5329,7 @@ restart_nosblocks: } held_length = 0; goto restart_nosblocks; - } else if (so->so_rcv.sb_cc == 0) { + } else if (so->so_rcv.sb_ccc == 0) { if (so->so_error) { error = so->so_error; if ((in_flags & MSG_PEEK) == 0) @@ -5386,11 +5386,11 @@ restart_nosblocks: SCTP_INP_READ_LOCK(inp); } control = TAILQ_FIRST(&inp->read_queue); - if ((control == NULL) && (so->so_rcv.sb_cc != 0)) { + if ((control == NULL) && (so->so_rcv.sb_ccc != 0)) { #ifdef INVARIANTS panic("Huh, its non zero and nothing on control?"); #endif - so->so_rcv.sb_cc = 0; + so->so_rcv.sb_ccc = 0; } SCTP_INP_READ_UNLOCK(inp); hold_rlock = 0; @@ -5511,11 +5511,11 @@ restart_nosblocks: } /* * if we reach here, not suitable replacement is available - * fragment interleave is NOT on. So stuff the sb_cc + * fragment interleave is NOT on. So stuff the sb_ccc * into the our held count, and its time to sleep again. */ - held_length = so->so_rcv.sb_cc; - control->held_length = so->so_rcv.sb_cc; + held_length = so->so_rcv.sb_ccc; + control->held_length = so->so_rcv.sb_ccc; goto restart; } /* Clear the held length since there is something to read */ @@ -5812,10 +5812,10 @@ get_more_data: if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, cp_len); } - atomic_subtract_int(&so->so_rcv.sb_cc, cp_len); + atomic_subtract_int(&so->so_rcv.sb_ccc, cp_len); if ((control->do_not_ref_stcb == 0) && stcb) { - atomic_subtract_int(&stcb->asoc.sb_cc, cp_len); + atomic_subtract_int(&stcb->asoc.sb_ccc, cp_len); } copied_so_far += cp_len; freed_so_far += cp_len; @@ -5960,7 +5960,7 @@ wait_some_more: (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_FRAG_INTERLEAVE))) { goto release; } - if (so->so_rcv.sb_cc <= control->held_length) { + if (so->so_rcv.sb_ccc <= control->held_length) { error = sbwait(&so->so_rcv); if (error) { goto release; @@ -5987,8 +5987,8 @@ wait_some_more: } goto done_with_control; } - if (so->so_rcv.sb_cc > held_length) { - control->held_length = so->so_rcv.sb_cc; + if (so->so_rcv.sb_ccc > held_length) { + control->held_length = so->so_rcv.sb_ccc; held_length = 0; } goto wait_some_more; @@ -6135,13 +6135,13 @@ out: freed_so_far, ((uio) ? (slen - uio->uio_resid) : slen), stcb->asoc.my_rwnd, - so->so_rcv.sb_cc); + so->so_rcv.sb_ccc); } else { sctp_misc_ints(SCTP_SORECV_DONE, freed_so_far, ((uio) ? (slen - uio->uio_resid) : slen), 0, - so->so_rcv.sb_cc); + so->so_rcv.sb_ccc); } } stage_left: Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/netinet/sctputil.h Sun Nov 30 12:52:33 2014 (r275326) @@ -286,10 +286,10 @@ do { \ } \ if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ - if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { \ - atomic_subtract_int(&((stcb)->sctp_socket->so_snd.sb_cc), tp1->book_size); \ + if (stcb->sctp_socket->so_snd.sb_ccc >= tp1->book_size) { \ + atomic_subtract_int(&((stcb)->sctp_socket->so_snd.sb_ccc), tp1->book_size); \ } else { \ - stcb->sctp_socket->so_snd.sb_cc = 0; \ + stcb->sctp_socket->so_snd.sb_ccc = 0; \ } \ } \ } \ @@ -307,10 +307,10 @@ do { \ } \ if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ - if (stcb->sctp_socket->so_snd.sb_cc >= sp->length) { \ - atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc,sp->length); \ + if (stcb->sctp_socket->so_snd.sb_ccc >= sp->length) { \ + atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_ccc,sp->length); \ } else { \ - stcb->sctp_socket->so_snd.sb_cc = 0; \ + stcb->sctp_socket->so_snd.sb_ccc = 0; \ } \ } \ } \ @@ -322,7 +322,7 @@ do { \ if ((stcb->sctp_socket != NULL) && \ ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ - atomic_add_int(&stcb->sctp_socket->so_snd.sb_cc,sz); \ + atomic_add_int(&stcb->sctp_socket->so_snd.sb_ccc,sz); \ } \ } while (0) Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Sun Nov 30 12:37:20 2014 (r275325) +++ head/sys/sys/sockbuf.h Sun Nov 30 12:52:33 2014 (r275326) @@ -89,8 +89,10 @@ struct sockbuf { struct mbuf *sb_lastrecord; /* (c/d) first mbuf of last * record in socket buffer */ struct mbuf *sb_sndptr; /* (c/d) pointer into mbuf chain */ + struct mbuf *sb_fnrdy; /* (c/d) pointer to first not ready buffer */ u_int sb_sndptroff; /* (c/d) byte offset of ptr into chain */ - u_int sb_cc; /* (c/d) actual chars in buffer */ + u_int sb_acc; /* (c/d) available chars in buffer */ + u_int sb_ccc; /* (c/d) claimed chars in buffer */ u_int sb_hiwat; /* (c/d) max actual char count */ u_int sb_mbcnt; /* (c/d) chars of mbufs used */ u_int sb_mcnt; /* (c/d) number of mbufs in buffer */ @@ -120,6 +122,13 @@ struct sockbuf { #define SOCKBUF_LOCK_ASSERT(_sb) mtx_assert(SOCKBUF_MTX(_sb), MA_OWNED) #define SOCKBUF_UNLOCK_ASSERT(_sb) mtx_assert(SOCKBUF_MTX(_sb), MA_NOTOWNED) +/* + * Socket buffer private mbuf(9) flags. + */ +#define M_NOTREADY M_PROTO1 /* m_data not populated yet */ +#define M_BLOCKED M_PROTO2 /* M_NOTREADY in front of m */ +#define M_NOTAVAIL (M_NOTREADY | M_BLOCKED) + void sbappend(struct sockbuf *sb, struct mbuf *m); void sbappend_locked(struct sockbuf *sb, struct mbuf *m); void sbappendstream(struct sockbuf *sb, struct mbuf *m); @@ -165,10 +174,11 @@ int sblock(struct sockbuf *sb, int flags void sbunlock(struct sockbuf *sb); void sballoc(struct sockbuf *, struct mbuf *); void sbfree(struct sockbuf *, struct mbuf *); +int sbready(struct sockbuf *, struct mbuf *, int); /* * Return how much data is available to be taken out of socket - * bufffer right now. + * buffer right now. */ static inline u_int sbavail(struct sockbuf *sb) @@ -177,7 +187,7 @@ sbavail(struct sockbuf *sb) #if 0 SOCKBUF_LOCK_ASSERT(sb); #endif - return (sb->sb_cc); + return (sb->sb_acc); } /* @@ -191,27 +201,30 @@ sbused(struct sockbuf *sb) #if 0 SOCKBUF_LOCK_ASSERT(sb); #endif - return (sb->sb_cc); + return (sb->sb_ccc); } /* * How much space is there in a socket buffer (so->so_snd or so->so_rcv)? * This is problematical if the fields are unsigned, as the space might - * still be negative (cc > hiwat or mbcnt > mbmax). Should detect - * overflow and return 0. Should use "lmin" but it doesn't exist now. + * still be negative (ccc > hiwat or mbcnt > mbmax). */ -static __inline -long +static inline long sbspace(struct sockbuf *sb) { - long bleft; - long mleft; + long bleft, mleft; + +#if 0 + SOCKBUF_LOCK_ASSERT(sb); +#endif if (sb->sb_flags & SB_STOP) return(0); - bleft = sb->sb_hiwat - sb->sb_cc; + + bleft = sb->sb_hiwat - sb->sb_ccc; mleft = sb->sb_mbmax - sb->sb_mbcnt; - return((bleft < mleft) ? bleft : mleft); + + return ((bleft < mleft) ? bleft : mleft); } #define SB_EMPTY_FIXUP(sb) do { \ Modified: head/usr.bin/bluetooth/btsockstat/btsockstat.c ============================================================================== --- head/usr.bin/bluetooth/btsockstat/btsockstat.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/usr.bin/bluetooth/btsockstat/btsockstat.c Sun Nov 30 12:52:33 2014 (r275326) @@ -255,8 +255,8 @@ hcirawpr(kvm_t *kvmd, u_long addr) (unsigned long) pcb.so, (unsigned long) this, pcb.flags, - so.so_rcv.sb_cc, - so.so_snd.sb_cc, + so.so_rcv.sb_ccc, + so.so_snd.sb_ccc, pcb.addr.hci_node); } } /* hcirawpr */ @@ -303,8 +303,8 @@ l2caprawpr(kvm_t *kvmd, u_long addr) "%-8lx %-8lx %6d %6d %-17.17s\n", (unsigned long) pcb.so, (unsigned long) this, - so.so_rcv.sb_cc, - so.so_snd.sb_cc, + so.so_rcv.sb_ccc, + so.so_snd.sb_ccc, bdaddrpr(&pcb.src, NULL, 0)); } } /* l2caprawpr */ @@ -361,8 +361,8 @@ l2cappr(kvm_t *kvmd, u_long addr) fprintf(stdout, "%-8lx %6d %6d %-17.17s/%-5d %-17.17s %-5d %s\n", (unsigned long) this, - so.so_rcv.sb_cc, - so.so_snd.sb_cc, + so.so_rcv.sb_ccc, + so.so_snd.sb_ccc, bdaddrpr(&pcb.src, local, sizeof(local)), pcb.psm, bdaddrpr(&pcb.dst, remote, sizeof(remote)), @@ -467,8 +467,8 @@ rfcommpr(kvm_t *kvmd, u_long addr) fprintf(stdout, "%-8lx %6d %6d %-17.17s %-17.17s %-4d %-4d %s\n", (unsigned long) this, - so.so_rcv.sb_cc, - so.so_snd.sb_cc, + so.so_rcv.sb_ccc, + so.so_snd.sb_ccc, bdaddrpr(&pcb.src, local, sizeof(local)), bdaddrpr(&pcb.dst, remote, sizeof(remote)), pcb.channel, Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/usr.bin/netstat/inet.c Sun Nov 30 12:52:33 2014 (r275326) @@ -137,7 +137,7 @@ pcblist_sysctl(int proto, const char *na static void sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb) { - xsb->sb_cc = sb->sb_cc; + xsb->sb_cc = sb->sb_ccc; xsb->sb_hiwat = sb->sb_hiwat; xsb->sb_mbcnt = sb->sb_mbcnt; xsb->sb_mcnt = sb->sb_mcnt; @@ -479,7 +479,8 @@ protopr(u_long off, const char *name, in printf("%6u %6u %6u ", tp->t_sndrexmitpack, tp->t_rcvoopack, tp->t_sndzerowin); } else { - printf("%6u %6u ", so->so_rcv.sb_cc, so->so_snd.sb_cc); + printf("%6u %6u ", + so->so_rcv.sb_cc, so->so_snd.sb_cc); } if (numeric_port) { if (inp->inp_vflag & INP_IPV4) { Modified: head/usr.bin/netstat/netgraph.c ============================================================================== --- head/usr.bin/netstat/netgraph.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/usr.bin/netstat/netgraph.c Sun Nov 30 12:52:33 2014 (r275326) @@ -119,7 +119,7 @@ netgraphprotopr(u_long off, const char * if (Aflag) printf("%8lx ", (u_long) this); printf("%-5.5s %6u %6u ", - name, sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc); + name, sockb.so_rcv.sb_ccc, sockb.so_snd.sb_ccc); /* Get info on associated node */ if (ngpcb.node_id == 0 || csock == -1) Modified: head/usr.bin/netstat/unix.c ============================================================================== --- head/usr.bin/netstat/unix.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/usr.bin/netstat/unix.c Sun Nov 30 12:52:33 2014 (r275326) @@ -287,7 +287,8 @@ unixdomainpr(struct xunpcb *xunp, struct } else { printf("%8lx %-6.6s %6u %6u %8lx %8lx %8lx %8lx", (long)so->so_pcb, socktype[so->so_type], so->so_rcv.sb_cc, - so->so_snd.sb_cc, (long)unp->unp_vnode, (long)unp->unp_conn, + so->so_snd.sb_cc, (long)unp->unp_vnode, + (long)unp->unp_conn, (long)LIST_FIRST(&unp->unp_refs), (long)LIST_NEXT(unp, unp_reflink)); } Modified: head/usr.bin/systat/netstat.c ============================================================================== --- head/usr.bin/systat/netstat.c Sun Nov 30 12:37:20 2014 (r275325) +++ head/usr.bin/systat/netstat.c Sun Nov 30 12:52:33 2014 (r275326) @@ -333,8 +333,8 @@ enter_kvm(struct inpcb *inp, struct sock struct netinfo *p; if ((p = enter(inp, state, proto)) != NULL) { - p->ni_rcvcc = so->so_rcv.sb_cc; - p->ni_sndcc = so->so_snd.sb_cc; + p->ni_rcvcc = so->so_rcv.sb_ccc; + p->ni_sndcc = so->so_snd.sb_ccc; } } From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 13:13:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C821B2FA; Sun, 30 Nov 2014 13:13:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A7DD1CA; Sun, 30 Nov 2014 13:13:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUDDl4L065258; Sun, 30 Nov 2014 13:13:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUDDkGf065254; Sun, 30 Nov 2014 13:13:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411301313.sAUDDkGf065254@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 30 Nov 2014 13:13:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275328 - in head/contrib/ofed/librdmacm/examples/build: cmatose mckey rping udaddy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 13:13:47 -0000 Author: hselasky Date: Sun Nov 30 13:13:46 2014 New Revision: 275328 URL: https://svnweb.freebsd.org/changeset/base/275328 Log: Add missing libraries when linking. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/contrib/ofed/librdmacm/examples/build/cmatose/Makefile head/contrib/ofed/librdmacm/examples/build/mckey/Makefile head/contrib/ofed/librdmacm/examples/build/rping/Makefile head/contrib/ofed/librdmacm/examples/build/udaddy/Makefile Modified: head/contrib/ofed/librdmacm/examples/build/cmatose/Makefile ============================================================================== --- head/contrib/ofed/librdmacm/examples/build/cmatose/Makefile Sun Nov 30 13:03:46 2014 (r275327) +++ head/contrib/ofed/librdmacm/examples/build/cmatose/Makefile Sun Nov 30 13:13:46 2014 (r275328) @@ -6,5 +6,6 @@ PROG= cmatose MAN= SRCS= cmatose.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: head/contrib/ofed/librdmacm/examples/build/mckey/Makefile ============================================================================== --- head/contrib/ofed/librdmacm/examples/build/mckey/Makefile Sun Nov 30 13:03:46 2014 (r275327) +++ head/contrib/ofed/librdmacm/examples/build/mckey/Makefile Sun Nov 30 13:13:46 2014 (r275328) @@ -6,5 +6,6 @@ PROG= mckey MAN= SRCS= mckey.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: head/contrib/ofed/librdmacm/examples/build/rping/Makefile ============================================================================== --- head/contrib/ofed/librdmacm/examples/build/rping/Makefile Sun Nov 30 13:03:46 2014 (r275327) +++ head/contrib/ofed/librdmacm/examples/build/rping/Makefile Sun Nov 30 13:13:46 2014 (r275328) @@ -6,5 +6,6 @@ PROG= rping MAN= SRCS= rping.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: head/contrib/ofed/librdmacm/examples/build/udaddy/Makefile ============================================================================== --- head/contrib/ofed/librdmacm/examples/build/udaddy/Makefile Sun Nov 30 13:03:46 2014 (r275327) +++ head/contrib/ofed/librdmacm/examples/build/udaddy/Makefile Sun Nov 30 13:13:46 2014 (r275328) @@ -6,5 +6,6 @@ PROG= udaddy MAN= SRCS= udaddy.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 13:24:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFB875EA; Sun, 30 Nov 2014 13:24:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA5782B1; Sun, 30 Nov 2014 13:24:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUDOPqG069995; Sun, 30 Nov 2014 13:24:25 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUDOM6M069975; Sun, 30 Nov 2014 13:24:22 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411301324.sAUDOM6M069975@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 30 Nov 2014 13:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275329 - in head/sys: dev/cxgb/ulp/tom dev/cxgbe/tom kern netinet ofed/drivers/infiniband/ulp/sdp sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 13:24:26 -0000 Author: glebius Date: Sun Nov 30 13:24:21 2014 New Revision: 275329 URL: https://svnweb.freebsd.org/changeset/base/275329 Log: Merge from projects/sendfile: extend protocols API to support sending not ready data: o Add new flag to pru_send() flags - PRUS_NOTREADY. o Add new protocol method pru_ready(). Sponsored by: Nginx, Inc. Sponsored by: Netflix Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c head/sys/dev/cxgbe/tom/t4_cpl_io.c head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/kern/uipc_domain.c head/sys/kern/uipc_mbuf.c head/sys/kern/uipc_sockbuf.c head/sys/kern/uipc_socket.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_reass.c head/sys/netinet/tcp_usrreq.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c head/sys/sys/mbuf.h head/sys/sys/protosw.h head/sys/sys/sockbuf.h Modified: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Sun Nov 30 13:13:46 2014 (r275328) +++ head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Sun Nov 30 13:24:21 2014 (r275329) @@ -1199,7 +1199,7 @@ do_rx_data(struct sge_qset *qs, struct r } toep->tp_enqueued += m->m_pkthdr.len; - sbappendstream_locked(so_rcv, m); + sbappendstream_locked(so_rcv, m, 0); sorwakeup_locked(so); SOCKBUF_UNLOCK_ASSERT(so_rcv); Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Sun Nov 30 13:13:46 2014 (r275328) +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Sun Nov 30 13:24:21 2014 (r275329) @@ -1086,7 +1086,7 @@ do_peer_close(struct sge_iq *iq, const s #ifdef USE_DDP_RX_FLOW_CONTROL toep->rx_credits -= m->m_len; /* adjust for F_RX_FC_DDP */ #endif - sbappendstream_locked(sb, m); + sbappendstream_locked(sb, m, 0); toep->sb_cc = sbused(sb); } socantrcvmore_locked(so); /* unlocks the sockbuf */ @@ -1586,7 +1586,7 @@ do_rx_data(struct sge_iq *iq, const stru ("%s: sb %p has more data (%d) than last time (%d).", __func__, sb, sbused(sb), toep->sb_cc)); toep->rx_credits += toep->sb_cc - sbused(sb); - sbappendstream_locked(sb, m); + sbappendstream_locked(sb, m, 0); toep->sb_cc = sbused(sb); sorwakeup_locked(so); SOCKBUF_UNLOCK_ASSERT(sb); Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Sun Nov 30 13:13:46 2014 (r275328) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Sun Nov 30 13:24:21 2014 (r275329) @@ -231,7 +231,7 @@ insert_ddp_data(struct toepcb *toep, uin #ifdef USE_DDP_RX_FLOW_CONTROL toep->rx_credits -= n; /* adjust for F_RX_FC_DDP */ #endif - sbappendstream_locked(sb, m); + sbappendstream_locked(sb, m, 0); toep->sb_cc = sbused(sb); } @@ -466,7 +466,7 @@ handle_ddp_data(struct toepcb *toep, __b #ifdef USE_DDP_RX_FLOW_CONTROL toep->rx_credits -= len; /* adjust for F_RX_FC_DDP */ #endif - sbappendstream_locked(sb, m); + sbappendstream_locked(sb, m, 0); toep->sb_cc = sbused(sb); wakeup: KASSERT(toep->ddp_flags & db_flag, Modified: head/sys/kern/uipc_domain.c ============================================================================== --- head/sys/kern/uipc_domain.c Sun Nov 30 13:13:46 2014 (r275328) +++ head/sys/kern/uipc_domain.c Sun Nov 30 13:24:21 2014 (r275329) @@ -152,6 +152,7 @@ protosw_init(struct protosw *pr) DEFAULT(pu->pru_sosend, sosend_generic); DEFAULT(pu->pru_soreceive, soreceive_generic); DEFAULT(pu->pru_sopoll, sopoll_generic); + DEFAULT(pu->pru_ready, pru_ready_notsupp); #undef DEFAULT if (pr->pr_init) (*pr->pr_init)(); Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sun Nov 30 13:13:46 2014 (r275328) +++ head/sys/kern/uipc_mbuf.c Sun Nov 30 13:24:21 2014 (r275329) @@ -388,7 +388,7 @@ mb_dupcl(struct mbuf *n, struct mbuf *m) * cleaned too. */ void -m_demote(struct mbuf *m0, int all) +m_demote(struct mbuf *m0, int all, int flags) { struct mbuf *m; @@ -400,7 +400,7 @@ m_demote(struct mbuf *m0, int all) m->m_flags &= ~M_PKTHDR; bzero(&m->m_pkthdr, sizeof(struct pkthdr)); } - m->m_flags = m->m_flags & (M_EXT|M_RDONLY|M_NOFREE); + m->m_flags = m->m_flags & (M_EXT | M_RDONLY | M_NOFREE | flags); } } @@ -997,7 +997,7 @@ m_catpkt(struct mbuf *m, struct mbuf *n) M_ASSERTPKTHDR(n); m->m_pkthdr.len += n->m_pkthdr.len; - m_demote(n, 1); + m_demote(n, 1, 0); m_cat(m, n); } Modified: head/sys/kern/uipc_sockbuf.c ============================================================================== --- head/sys/kern/uipc_sockbuf.c Sun Nov 30 13:13:46 2014 (r275328) +++ head/sys/kern/uipc_sockbuf.c Sun Nov 30 13:24:21 2014 (r275329) @@ -636,7 +636,7 @@ sbappend(struct sockbuf *sb, struct mbuf * that is, a stream protocol (such as TCP). */ void -sbappendstream_locked(struct sockbuf *sb, struct mbuf *m) +sbappendstream_locked(struct sockbuf *sb, struct mbuf *m, int flags) { SOCKBUF_LOCK_ASSERT(sb); @@ -646,8 +646,8 @@ sbappendstream_locked(struct sockbuf *sb SBLASTMBUFCHK(sb); /* Remove all packet headers and mbuf tags to get a pure data chain. */ - m_demote(m, 1); - + m_demote(m, 1, flags & PRUS_NOTREADY ? M_NOTREADY : 0); + sbcompress(sb, m, sb->sb_mbtail); sb->sb_lastrecord = sb->sb_mb; @@ -660,11 +660,11 @@ sbappendstream_locked(struct sockbuf *sb * that is, a stream protocol (such as TCP). */ void -sbappendstream(struct sockbuf *sb, struct mbuf *m) +sbappendstream(struct sockbuf *sb, struct mbuf *m, int flags) { SOCKBUF_LOCK(sb); - sbappendstream_locked(sb, m); + sbappendstream_locked(sb, m, flags); SOCKBUF_UNLOCK(sb); } Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Sun Nov 30 13:13:46 2014 (r275328) +++ head/sys/kern/uipc_socket.c Sun Nov 30 13:24:21 2014 (r275329) @@ -3178,6 +3178,13 @@ pru_send_notsupp(struct socket *so, int return EOPNOTSUPP; } +int +pru_ready_notsupp(struct socket *so, struct mbuf *m, int count) +{ + + return (EOPNOTSUPP); +} + /* * This isn't really a ``null'' operation, but it's the default one and * doesn't do anything destructive. Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sun Nov 30 13:13:46 2014 (r275328) +++ head/sys/netinet/tcp_input.c Sun Nov 30 13:24:21 2014 (r275329) @@ -1855,7 +1855,7 @@ tcp_do_segment(struct mbuf *m, struct tc newsize, so, NULL)) so->so_rcv.sb_flags &= ~SB_AUTOSIZE; m_adj(m, drop_hdrlen); /* delayed header drop */ - sbappendstream_locked(&so->so_rcv, m); + sbappendstream_locked(&so->so_rcv, m, 0); } /* NB: sorwakeup_locked() does an implicit unlock. */ sorwakeup_locked(so); @@ -2882,7 +2882,7 @@ dodata: /* XXX */ if (so->so_rcv.sb_state & SBS_CANTRCVMORE) m_freem(m); else - sbappendstream_locked(&so->so_rcv, m); + sbappendstream_locked(&so->so_rcv, m, 0); /* NB: sorwakeup_locked() does an implicit unlock. */ sorwakeup_locked(so); } else { Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Sun Nov 30 13:13:46 2014 (r275328) +++ head/sys/netinet/tcp_reass.c Sun Nov 30 13:24:21 2014 (r275329) @@ -262,7 +262,7 @@ present: m_freem(mq); else { mq->m_nextpkt = NULL; - sbappendstream_locked(&so->so_rcv, mq); + sbappendstream_locked(&so->so_rcv, mq, 0); wakeup = 1; } } Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Sun Nov 30 13:13:46 2014 (r275328) +++ head/sys/netinet/tcp_usrreq.c Sun Nov 30 13:24:21 2014 (r275329) @@ -843,7 +843,7 @@ tcp_usr_send(struct socket *so, int flag m_freem(control); /* empty control, just free it */ } if (!(flags & PRUS_OOB)) { - sbappendstream(&so->so_snd, m); + sbappendstream(&so->so_snd, m, flags); if (nam && tp->t_state < TCPS_SYN_SENT) { /* * Do implied connect if not yet connected, @@ -901,7 +901,7 @@ tcp_usr_send(struct socket *so, int flag * of data past the urgent section. * Otherwise, snd_up should be one lower. */ - sbappendstream_locked(&so->so_snd, m); + sbappendstream_locked(&so->so_snd, m, flags); SOCKBUF_UNLOCK(&so->so_snd); if (nam && tp->t_state < TCPS_SYN_SENT) { /* Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Sun Nov 30 13:13:46 2014 (r275328) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Sun Nov 30 13:24:21 2014 (r275329) @@ -889,7 +889,7 @@ sdp_append(struct sdp_sock *ssk, struct m_adj(mb, SDP_HEAD_SIZE); n->m_pkthdr.len += mb->m_pkthdr.len; n->m_flags |= mb->m_flags & (M_PUSH | M_URG); - m_demote(mb, 1); + m_demote(mb, 1, 0); sbcompress(sb, mb, sb->sb_mbtail); return; } Modified: head/sys/sys/mbuf.h ============================================================================== --- head/sys/sys/mbuf.h Sun Nov 30 13:13:46 2014 (r275328) +++ head/sys/sys/mbuf.h Sun Nov 30 13:24:21 2014 (r275329) @@ -950,7 +950,7 @@ struct mbuf *m_copypacket(struct mbuf *, void m_copy_pkthdr(struct mbuf *, struct mbuf *); struct mbuf *m_copyup(struct mbuf *, int, int); struct mbuf *m_defrag(struct mbuf *, int); -void m_demote(struct mbuf *, int); +void m_demote(struct mbuf *, int, int); struct mbuf *m_devget(char *, int, int, struct ifnet *, void (*)(char *, caddr_t, u_int)); struct mbuf *m_dup(struct mbuf *, int); Modified: head/sys/sys/protosw.h ============================================================================== --- head/sys/sys/protosw.h Sun Nov 30 13:13:46 2014 (r275328) +++ head/sys/sys/protosw.h Sun Nov 30 13:24:21 2014 (r275329) @@ -208,6 +208,8 @@ struct pr_usrreqs { #define PRUS_OOB 0x1 #define PRUS_EOF 0x2 #define PRUS_MORETOCOME 0x4 +#define PRUS_NOTREADY 0x8 + int (*pru_ready)(struct socket *so, struct mbuf *m, int count); int (*pru_sense)(struct socket *so, struct stat *sb); int (*pru_shutdown)(struct socket *so); int (*pru_flush)(struct socket *so, int direction); @@ -251,6 +253,7 @@ int pru_rcvd_notsupp(struct socket *so, int pru_rcvoob_notsupp(struct socket *so, struct mbuf *m, int flags); int pru_send_notsupp(struct socket *so, int flags, struct mbuf *m, struct sockaddr *addr, struct mbuf *control, struct thread *td); +int pru_ready_notsupp(struct socket *so, struct mbuf *m, int count); int pru_sense_null(struct socket *so, struct stat *sb); int pru_shutdown_notsupp(struct socket *so); int pru_sockaddr_notsupp(struct socket *so, struct sockaddr **nam); Modified: head/sys/sys/sockbuf.h ============================================================================== --- head/sys/sys/sockbuf.h Sun Nov 30 13:13:46 2014 (r275328) +++ head/sys/sys/sockbuf.h Sun Nov 30 13:24:21 2014 (r275329) @@ -131,8 +131,8 @@ struct sockbuf { void sbappend(struct sockbuf *sb, struct mbuf *m); void sbappend_locked(struct sockbuf *sb, struct mbuf *m); -void sbappendstream(struct sockbuf *sb, struct mbuf *m); -void sbappendstream_locked(struct sockbuf *sb, struct mbuf *m); +void sbappendstream(struct sockbuf *sb, struct mbuf *m, int flags); +void sbappendstream_locked(struct sockbuf *sb, struct mbuf *m, int flags); int sbappendaddr(struct sockbuf *sb, const struct sockaddr *asa, struct mbuf *m0, struct mbuf *control); int sbappendaddr_locked(struct sockbuf *sb, const struct sockaddr *asa, From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 13:28:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C662074F; Sun, 30 Nov 2014 13:28:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A76BB2D9; Sun, 30 Nov 2014 13:28:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUDS074070493; Sun, 30 Nov 2014 13:28:00 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUDRwQc070477; Sun, 30 Nov 2014 13:27:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411301327.sAUDRwQc070477@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 30 Nov 2014 13:27:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275330 - in head/contrib/ofed: management/infiniband-diags/src usr.bin X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 13:28:00 -0000 Author: hselasky Date: Sun Nov 30 13:27:58 2014 New Revision: 275330 URL: https://svnweb.freebsd.org/changeset/base/275330 Log: Fix building of some infiniband utilities by updating some header file locations and compiler include directives. MFC after: 3 days Sponsored by: Mellanox Technologies Modified: head/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c head/contrib/ofed/management/infiniband-diags/src/ibroute.c head/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c head/contrib/ofed/management/infiniband-diags/src/ibtracert.c head/contrib/ofed/management/infiniband-diags/src/saquery.c head/contrib/ofed/management/infiniband-diags/src/smpquery.c head/contrib/ofed/usr.bin/Makefile.inc Modified: head/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c ============================================================================== --- head/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c Sun Nov 30 13:24:21 2014 (r275329) +++ head/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c Sun Nov 30 13:27:58 2014 (r275330) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include "ibnetdiscover.h" #include "grouping.h" Modified: head/contrib/ofed/management/infiniband-diags/src/ibroute.c ============================================================================== --- head/contrib/ofed/management/infiniband-diags/src/ibroute.c Sun Nov 30 13:24:21 2014 (r275329) +++ head/contrib/ofed/management/infiniband-diags/src/ibroute.c Sun Nov 30 13:27:58 2014 (r275330) @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include "ibdiag_common.h" Modified: head/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c ============================================================================== --- head/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c Sun Nov 30 13:24:21 2014 (r275329) +++ head/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c Sun Nov 30 13:27:58 2014 (r275330) @@ -43,7 +43,7 @@ #include #include -#include +#include #include "ibdiag_common.h" Modified: head/contrib/ofed/management/infiniband-diags/src/ibtracert.c ============================================================================== --- head/contrib/ofed/management/infiniband-diags/src/ibtracert.c Sun Nov 30 13:24:21 2014 (r275329) +++ head/contrib/ofed/management/infiniband-diags/src/ibtracert.c Sun Nov 30 13:27:58 2014 (r275330) @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include "ibdiag_common.h" Modified: head/contrib/ofed/management/infiniband-diags/src/saquery.c ============================================================================== --- head/contrib/ofed/management/infiniband-diags/src/saquery.c Sun Nov 30 13:24:21 2014 (r275329) +++ head/contrib/ofed/management/infiniband-diags/src/saquery.c Sun Nov 30 13:27:58 2014 (r275330) @@ -50,12 +50,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include Modified: head/contrib/ofed/management/infiniband-diags/src/smpquery.c ============================================================================== --- head/contrib/ofed/management/infiniband-diags/src/smpquery.c Sun Nov 30 13:24:21 2014 (r275329) +++ head/contrib/ofed/management/infiniband-diags/src/smpquery.c Sun Nov 30 13:27:58 2014 (r275330) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include "ibdiag_common.h" Modified: head/contrib/ofed/usr.bin/Makefile.inc ============================================================================== --- head/contrib/ofed/usr.bin/Makefile.inc Sun Nov 30 13:24:21 2014 (r275329) +++ head/contrib/ofed/usr.bin/Makefile.inc Sun Nov 30 13:27:58 2014 (r275330) @@ -1,4 +1,9 @@ DIAGPATH= ${.CURDIR}/../../management/infiniband-diags BINDIR?= /usr/bin CFLAGS+= -I${.CURDIR}/../../include/infiniband +CFLAGS+= -I${.CURDIR}/../../include CFLAGS+= -I${.CURDIR}/../../management/opensm/include/ +CFLAGS+= -I${.CURDIR}/../../management/opensm +CFLAGS+= -I${.CURDIR}/../../management/libibcommon/include +CFLAGS+= -I${.CURDIR}/../../management/libibumad/include +CFLAGS+= -I${.CURDIR}/../../management/libibmad/include From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 13:40:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 651A0AD9; Sun, 30 Nov 2014 13:40:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52482635; Sun, 30 Nov 2014 13:40:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUDexM8077274; Sun, 30 Nov 2014 13:40:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUDexEP077273; Sun, 30 Nov 2014 13:40:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411301340.sAUDexEP077273@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 30 Nov 2014 13:40:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275332 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 13:40:59 -0000 Author: glebius Date: Sun Nov 30 13:40:58 2014 New Revision: 275332 URL: https://svnweb.freebsd.org/changeset/base/275332 Log: Merge from projects/sendfile: Provide pru_ready for AF_LOCAL sockets. Local sockets sendsdata directly to the receive buffer of the peer, thus pru_ready also works on the peer socket. Sponsored by: Netflix Sponsored by: Nginx, Inc. Modified: head/sys/kern/uipc_usrreq.c Modified: head/sys/kern/uipc_usrreq.c ============================================================================== --- head/sys/kern/uipc_usrreq.c Sun Nov 30 13:28:21 2014 (r275331) +++ head/sys/kern/uipc_usrreq.c Sun Nov 30 13:40:58 2014 (r275332) @@ -1048,6 +1048,32 @@ release: } static int +uipc_ready(struct socket *so, struct mbuf *m, int count) +{ + struct unpcb *unp, *unp2; + struct socket *so2; + int error; + + unp = sotounpcb(so); + + UNP_LINK_RLOCK(); + unp2 = unp->unp_conn; + UNP_PCB_LOCK(unp2); + so2 = unp2->unp_socket; + + SOCKBUF_LOCK(&so2->so_rcv); + if ((error = sbready(&so2->so_rcv, m, count)) == 0) + sorwakeup_locked(so2); + else + SOCKBUF_UNLOCK(&so2->so_rcv); + + UNP_PCB_UNLOCK(unp2); + UNP_LINK_RUNLOCK(); + + return (error); +} + +static int uipc_sense(struct socket *so, struct stat *sb) { struct unpcb *unp; @@ -1161,6 +1187,7 @@ static struct pr_usrreqs uipc_usrreqs_st .pru_peeraddr = uipc_peeraddr, .pru_rcvd = uipc_rcvd, .pru_send = uipc_send, + .pru_ready = uipc_ready, .pru_sense = uipc_sense, .pru_shutdown = uipc_shutdown, .pru_sockaddr = uipc_sockaddr, From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 13:43:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E76FCBB; Sun, 30 Nov 2014 13:43:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00B29655; Sun, 30 Nov 2014 13:43:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUDhqQV079308; Sun, 30 Nov 2014 13:43:52 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUDhqwa079307; Sun, 30 Nov 2014 13:43:52 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201411301343.sAUDhqwa079307@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 30 Nov 2014 13:43:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275333 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 13:43:53 -0000 Author: glebius Date: Sun Nov 30 13:43:52 2014 New Revision: 275333 URL: https://svnweb.freebsd.org/changeset/base/275333 Log: Merge from projects/sendfile: - Provide pru_ready function for TCP. - Don't call tcp_output() from tcp_usr_send() if no ready data was put into the socket buffer. - In case of dropped connection don't try to m_freem() not ready data. Sponsored by: Nginx, Inc. Sponsored by: Netflix Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Sun Nov 30 13:40:58 2014 (r275332) +++ head/sys/netinet/tcp_usrreq.c Sun Nov 30 13:43:52 2014 (r275333) @@ -821,7 +821,11 @@ tcp_usr_send(struct socket *so, int flag if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { if (control) m_freem(control); - if (m) + /* + * In case of PRUS_NOTREADY, tcp_usr_ready() is responsible + * for freeing memory. + */ + if (m && (flags & PRUS_NOTREADY) == 0) m_freem(m); error = ECONNRESET; goto out; @@ -875,7 +879,8 @@ tcp_usr_send(struct socket *so, int flag socantsendmore(so); tcp_usrclosed(tp); } - if (!(inp->inp_flags & INP_DROPPED)) { + if (!(inp->inp_flags & INP_DROPPED) && + !(flags & PRUS_NOTREADY)) { if (flags & PRUS_MORETOCOME) tp->t_flags |= TF_MORETOCOME; error = tcp_output(tp); @@ -926,9 +931,11 @@ tcp_usr_send(struct socket *so, int flag tcp_mss(tp, -1); } tp->snd_up = tp->snd_una + sbavail(&so->so_snd); - tp->t_flags |= TF_FORCEDATA; - error = tcp_output(tp); - tp->t_flags &= ~TF_FORCEDATA; + if (!(flags & PRUS_NOTREADY)) { + tp->t_flags |= TF_FORCEDATA; + error = tcp_output(tp); + tp->t_flags &= ~TF_FORCEDATA; + } } out: TCPDEBUG2((flags & PRUS_OOB) ? PRU_SENDOOB : @@ -939,6 +946,33 @@ out: return (error); } +static int +tcp_usr_ready(struct socket *so, struct mbuf *m, int count) +{ + struct inpcb *inp; + struct tcpcb *tp; + int error; + + inp = sotoinpcb(so); + INP_WLOCK(inp); + if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) { + INP_WUNLOCK(inp); + for (int i = 0; i < count; i++) + m = m_free(m); + return (ECONNRESET); + } + tp = intotcpcb(inp); + + SOCKBUF_LOCK(&so->so_snd); + error = sbready(&so->so_snd, m, count); + SOCKBUF_UNLOCK(&so->so_snd); + if (error == 0) + error = tcp_output(tp); + INP_WUNLOCK(inp); + + return (error); +} + /* * Abort the TCP. Drop the connection abruptly. */ @@ -1073,6 +1107,7 @@ struct pr_usrreqs tcp_usrreqs = { .pru_rcvd = tcp_usr_rcvd, .pru_rcvoob = tcp_usr_rcvoob, .pru_send = tcp_usr_send, + .pru_ready = tcp_usr_ready, .pru_shutdown = tcp_usr_shutdown, .pru_sockaddr = in_getsockaddr, .pru_sosetlabel = in_pcbsosetlabel, @@ -1095,6 +1130,7 @@ struct pr_usrreqs tcp6_usrreqs = { .pru_rcvd = tcp_usr_rcvd, .pru_rcvoob = tcp_usr_rcvoob, .pru_send = tcp_usr_send, + .pru_ready = tcp_usr_ready, .pru_shutdown = tcp_usr_shutdown, .pru_sockaddr = in6_mapped_sockaddr, .pru_sosetlabel = in_pcbsosetlabel, From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 16:36:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 15FFA5CA; Sun, 30 Nov 2014 16:36:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 018FC6B9; Sun, 30 Nov 2014 16:36:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUGaQiq057909; Sun, 30 Nov 2014 16:36:26 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUGaQKc057908; Sun, 30 Nov 2014 16:36:26 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201411301636.sAUGaQKc057908@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sun, 30 Nov 2014 16:36:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275335 - head/sys/dev/virtio/block X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 16:36:27 -0000 Author: bryanv Date: Sun Nov 30 16:36:26 2014 New Revision: 275335 URL: https://svnweb.freebsd.org/changeset/base/275335 Log: Cleanup and performance improvement of the virtio_blk driver - Add support for GEOM direct completion. Depending on the benchmark, this tends to give a ~30% improvement w.r.t IOPs and BW. - Remove an invariants check in the strategy routine. This assertion is caught later on by an existing panic. - Rename and resort various related functions to make more sense. MFC after: 1 month Modified: head/sys/dev/virtio/block/virtio_blk.c Modified: head/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- head/sys/dev/virtio/block/virtio_blk.c Sun Nov 30 14:35:01 2014 (r275334) +++ head/sys/dev/virtio/block/virtio_blk.c Sun Nov 30 16:36:26 2014 (r275335) @@ -58,7 +58,6 @@ struct vtblk_request { struct virtio_blk_outhdr vbr_hdr; struct bio *vbr_bp; uint8_t vbr_ack; - TAILQ_ENTRY(vtblk_request) vbr_link; }; @@ -132,53 +131,60 @@ static int vtblk_dump(void *, void *, vm static void vtblk_strategy(struct bio *); static void vtblk_negotiate_features(struct vtblk_softc *); +static void vtblk_setup_features(struct vtblk_softc *); static int vtblk_maximum_segments(struct vtblk_softc *, struct virtio_blk_config *); static int vtblk_alloc_virtqueue(struct vtblk_softc *); static void vtblk_resize_disk(struct vtblk_softc *, uint64_t); -static void vtblk_set_write_cache(struct vtblk_softc *, int); -static int vtblk_write_cache_enabled(struct vtblk_softc *sc, - struct virtio_blk_config *); -static int vtblk_write_cache_sysctl(SYSCTL_HANDLER_ARGS); static void vtblk_alloc_disk(struct vtblk_softc *, struct virtio_blk_config *); static void vtblk_create_disk(struct vtblk_softc *); -static int vtblk_quiesce(struct vtblk_softc *); -static void vtblk_startio(struct vtblk_softc *); -static struct vtblk_request * vtblk_bio_request(struct vtblk_softc *); -static int vtblk_execute_request(struct vtblk_softc *, +static int vtblk_request_prealloc(struct vtblk_softc *); +static void vtblk_request_free(struct vtblk_softc *); +static struct vtblk_request * + vtblk_request_dequeue(struct vtblk_softc *); +static void vtblk_request_enqueue(struct vtblk_softc *, struct vtblk_request *); +static struct vtblk_request * + vtblk_request_next_ready(struct vtblk_softc *); +static void vtblk_request_requeue_ready(struct vtblk_softc *, + struct vtblk_request *); +static struct vtblk_request * + vtblk_request_next(struct vtblk_softc *); +static struct vtblk_request * + vtblk_request_bio(struct vtblk_softc *); +static int vtblk_request_execute(struct vtblk_softc *, + struct vtblk_request *); +static int vtblk_request_error(struct vtblk_request *); -static void vtblk_vq_intr(void *); +static void vtblk_queue_completed(struct vtblk_softc *, + struct bio_queue *); +static void vtblk_done_completed(struct vtblk_softc *, + struct bio_queue *); +static void vtblk_drain_vq(struct vtblk_softc *, int); +static void vtblk_drain(struct vtblk_softc *); -static void vtblk_stop(struct vtblk_softc *); +static void vtblk_startio(struct vtblk_softc *); +static void vtblk_bio_done(struct vtblk_softc *, struct bio *, int); static void vtblk_read_config(struct vtblk_softc *, struct virtio_blk_config *); -static void vtblk_get_ident(struct vtblk_softc *); -static void vtblk_prepare_dump(struct vtblk_softc *); -static int vtblk_write_dump(struct vtblk_softc *, void *, off_t, size_t); -static int vtblk_flush_dump(struct vtblk_softc *); +static void vtblk_ident(struct vtblk_softc *); static int vtblk_poll_request(struct vtblk_softc *, struct vtblk_request *); +static int vtblk_quiesce(struct vtblk_softc *); +static void vtblk_vq_intr(void *); +static void vtblk_stop(struct vtblk_softc *); -static void vtblk_finish_completed(struct vtblk_softc *); -static void vtblk_drain_vq(struct vtblk_softc *, int); -static void vtblk_drain(struct vtblk_softc *); - -static int vtblk_alloc_requests(struct vtblk_softc *); -static void vtblk_free_requests(struct vtblk_softc *); -static struct vtblk_request * vtblk_dequeue_request(struct vtblk_softc *); -static void vtblk_enqueue_request(struct vtblk_softc *, - struct vtblk_request *); - -static struct vtblk_request * vtblk_dequeue_ready(struct vtblk_softc *); -static void vtblk_enqueue_ready(struct vtblk_softc *, - struct vtblk_request *); +static void vtblk_dump_prepare(struct vtblk_softc *); +static int vtblk_dump_write(struct vtblk_softc *, void *, off_t, size_t); +static int vtblk_dump_flush(struct vtblk_softc *); -static int vtblk_request_error(struct vtblk_request *); -static void vtblk_finish_bio(struct bio *, int); +static void vtblk_set_write_cache(struct vtblk_softc *, int); +static int vtblk_write_cache_enabled(struct vtblk_softc *sc, + struct virtio_blk_config *); +static int vtblk_write_cache_sysctl(SYSCTL_HANDLER_ARGS); static void vtblk_setup_sysctl(struct vtblk_softc *); static int vtblk_tunable_int(struct vtblk_softc *, const char *, int); @@ -290,30 +296,18 @@ vtblk_attach(device_t dev) struct virtio_blk_config blkcfg; int error; + virtio_set_feature_desc(dev, vtblk_feature_desc); + sc = device_get_softc(dev); sc->vtblk_dev = dev; - VTBLK_LOCK_INIT(sc, device_get_nameunit(dev)); - bioq_init(&sc->vtblk_bioq); TAILQ_INIT(&sc->vtblk_req_free); TAILQ_INIT(&sc->vtblk_req_ready); - virtio_set_feature_desc(dev, vtblk_feature_desc); - vtblk_negotiate_features(sc); - - if (virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC)) - sc->vtblk_flags |= VTBLK_FLAG_INDIRECT; - if (virtio_with_feature(dev, VIRTIO_BLK_F_RO)) - sc->vtblk_flags |= VTBLK_FLAG_READONLY; - if (virtio_with_feature(dev, VIRTIO_BLK_F_BARRIER)) - sc->vtblk_flags |= VTBLK_FLAG_BARRIER; - if (virtio_with_feature(dev, VIRTIO_BLK_F_CONFIG_WCE)) - sc->vtblk_flags |= VTBLK_FLAG_WC_CONFIG; - vtblk_setup_sysctl(sc); + vtblk_setup_features(sc); - /* Get local copy of config. */ vtblk_read_config(sc, &blkcfg); /* @@ -352,7 +346,7 @@ vtblk_attach(device_t dev) goto fail; } - error = vtblk_alloc_requests(sc); + error = vtblk_request_prealloc(sc); if (error) { device_printf(dev, "cannot preallocate requests\n"); goto fail; @@ -519,14 +513,14 @@ vtblk_dump(void *arg, void *virtual, vm_ VTBLK_LOCK(sc); if ((sc->vtblk_flags & VTBLK_FLAG_DUMPING) == 0) { - vtblk_prepare_dump(sc); + vtblk_dump_prepare(sc); sc->vtblk_flags |= VTBLK_FLAG_DUMPING; } if (length > 0) - error = vtblk_write_dump(sc, virtual, offset, length); + error = vtblk_dump_write(sc, virtual, offset, length); else if (virtual == NULL && offset == 0) - error = vtblk_flush_dump(sc); + error = vtblk_dump_flush(sc); else { error = EINVAL; sc->vtblk_flags &= ~VTBLK_FLAG_DUMPING; @@ -543,7 +537,7 @@ vtblk_strategy(struct bio *bp) struct vtblk_softc *sc; if ((sc = bp->bio_disk->d_drv1) == NULL) { - vtblk_finish_bio(bp, EINVAL); + vtblk_bio_done(NULL, bp, EINVAL); return; } @@ -553,37 +547,21 @@ vtblk_strategy(struct bio *bp) */ if (sc->vtblk_flags & VTBLK_FLAG_READONLY && (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) { - vtblk_finish_bio(bp, EROFS); + vtblk_bio_done(sc, bp, EROFS); return; } -#ifdef INVARIANTS - /* - * Prevent read/write buffers spanning too many segments from - * getting into the queue. This should only trip if d_maxsize - * was incorrectly set. - */ - if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { - int nsegs, max_nsegs; - - nsegs = sglist_count(bp->bio_data, bp->bio_bcount); - max_nsegs = sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS; + VTBLK_LOCK(sc); - KASSERT(nsegs <= max_nsegs, - ("%s: bio %p spanned too many segments: %d, max: %d", - __func__, bp, nsegs, max_nsegs)); + if (sc->vtblk_flags & VTBLK_FLAG_DETACH) { + VTBLK_UNLOCK(sc); + vtblk_bio_done(sc, bp, ENXIO); + return; } -#endif - VTBLK_LOCK(sc); - if (sc->vtblk_flags & VTBLK_FLAG_DETACH) - vtblk_finish_bio(bp, ENXIO); - else { - bioq_insert_tail(&sc->vtblk_bioq, bp); + bioq_insert_tail(&sc->vtblk_bioq, bp); + vtblk_startio(sc); - if ((sc->vtblk_flags & VTBLK_FLAG_SUSPEND) == 0) - vtblk_startio(sc); - } VTBLK_UNLOCK(sc); } @@ -599,6 +577,25 @@ vtblk_negotiate_features(struct vtblk_so sc->vtblk_features = virtio_negotiate_features(dev, features); } +static void +vtblk_setup_features(struct vtblk_softc *sc) +{ + device_t dev; + + dev = sc->vtblk_dev; + + vtblk_negotiate_features(sc); + + if (virtio_with_feature(dev, VIRTIO_RING_F_INDIRECT_DESC)) + sc->vtblk_flags |= VTBLK_FLAG_INDIRECT; + if (virtio_with_feature(dev, VIRTIO_BLK_F_RO)) + sc->vtblk_flags |= VTBLK_FLAG_READONLY; + if (virtio_with_feature(dev, VIRTIO_BLK_F_BARRIER)) + sc->vtblk_flags |= VTBLK_FLAG_BARRIER; + if (virtio_with_feature(dev, VIRTIO_BLK_F_CONFIG_WCE)) + sc->vtblk_flags |= VTBLK_FLAG_WC_CONFIG; +} + static int vtblk_maximum_segments(struct vtblk_softc *sc, struct virtio_blk_config *blkcfg) @@ -660,59 +657,6 @@ vtblk_resize_disk(struct vtblk_softc *sc } static void -vtblk_set_write_cache(struct vtblk_softc *sc, int wc) -{ - - /* Set either writeback (1) or writethrough (0) mode. */ - virtio_write_dev_config_1(sc->vtblk_dev, - offsetof(struct virtio_blk_config, writeback), wc); -} - -static int -vtblk_write_cache_enabled(struct vtblk_softc *sc, - struct virtio_blk_config *blkcfg) -{ - int wc; - - if (sc->vtblk_flags & VTBLK_FLAG_WC_CONFIG) { - wc = vtblk_tunable_int(sc, "writecache_mode", - vtblk_writecache_mode); - if (wc >= 0 && wc < VTBLK_CACHE_MAX) - vtblk_set_write_cache(sc, wc); - else - wc = blkcfg->writeback; - } else - wc = virtio_with_feature(sc->vtblk_dev, VIRTIO_BLK_F_WCE); - - return (wc); -} - -static int -vtblk_write_cache_sysctl(SYSCTL_HANDLER_ARGS) -{ - struct vtblk_softc *sc; - int wc, error; - - sc = oidp->oid_arg1; - wc = sc->vtblk_write_cache; - - error = sysctl_handle_int(oidp, &wc, 0, req); - if (error || req->newptr == NULL) - return (error); - if ((sc->vtblk_flags & VTBLK_FLAG_WC_CONFIG) == 0) - return (EPERM); - if (wc < 0 || wc >= VTBLK_CACHE_MAX) - return (EINVAL); - - VTBLK_LOCK(sc); - sc->vtblk_write_cache = wc; - vtblk_set_write_cache(sc, sc->vtblk_write_cache); - VTBLK_UNLOCK(sc); - - return (0); -} - -static void vtblk_alloc_disk(struct vtblk_softc *sc, struct virtio_blk_config *blkcfg) { device_t dev; @@ -728,7 +672,8 @@ vtblk_alloc_disk(struct vtblk_softc *sc, dp->d_name = VTBLK_DISK_NAME; dp->d_unit = device_get_unit(dev); dp->d_drv1 = sc; - dp->d_flags = DISKFLAG_CANFLUSHCACHE | DISKFLAG_UNMAPPED_BIO; + dp->d_flags = DISKFLAG_CANFLUSHCACHE | DISKFLAG_UNMAPPED_BIO | + DISKFLAG_DIRECT_COMPLETION; dp->d_hba_vendor = virtio_get_vendor(dev); dp->d_hba_device = virtio_get_device(dev); dp->d_hba_subvendor = virtio_get_subvendor(dev); @@ -789,11 +734,7 @@ vtblk_create_disk(struct vtblk_softc *sc dp = sc->vtblk_disk; - /* - * Retrieving the identification string must be done after - * the virtqueue interrupt is setup otherwise it will hang. - */ - vtblk_get_ident(sc); + vtblk_ident(sc); device_printf(sc->vtblk_dev, "%juMB (%ju %u byte sectors)\n", (uintmax_t) dp->d_mediasize >> 20, @@ -804,57 +745,107 @@ vtblk_create_disk(struct vtblk_softc *sc } static int -vtblk_quiesce(struct vtblk_softc *sc) +vtblk_request_prealloc(struct vtblk_softc *sc) { - int error; + struct vtblk_request *req; + int i, nreqs; - error = 0; + nreqs = virtqueue_size(sc->vtblk_vq); - VTBLK_LOCK_ASSERT(sc); + /* + * Preallocate sufficient requests to keep the virtqueue full. Each + * request consumes VTBLK_MIN_SEGMENTS or more descriptors so reduce + * the number allocated when indirect descriptors are not available. + */ + if ((sc->vtblk_flags & VTBLK_FLAG_INDIRECT) == 0) + nreqs /= VTBLK_MIN_SEGMENTS; - while (!virtqueue_empty(sc->vtblk_vq)) { - if (mtx_sleep(&sc->vtblk_vq, VTBLK_MTX(sc), PRIBIO, "vtblkq", - VTBLK_QUIESCE_TIMEOUT) == EWOULDBLOCK) { - error = EBUSY; - break; - } + for (i = 0; i < nreqs; i++) { + req = malloc(sizeof(struct vtblk_request), M_DEVBUF, M_NOWAIT); + if (req == NULL) + return (ENOMEM); + + MPASS(sglist_count(&req->vbr_hdr, sizeof(req->vbr_hdr)) == 1); + MPASS(sglist_count(&req->vbr_ack, sizeof(req->vbr_ack)) == 1); + + sc->vtblk_request_count++; + vtblk_request_enqueue(sc, req); } - return (error); + return (0); } static void -vtblk_startio(struct vtblk_softc *sc) +vtblk_request_free(struct vtblk_softc *sc) { - struct virtqueue *vq; struct vtblk_request *req; - int enq; - vq = sc->vtblk_vq; - enq = 0; + MPASS(TAILQ_EMPTY(&sc->vtblk_req_ready)); - VTBLK_LOCK_ASSERT(sc); + while ((req = vtblk_request_dequeue(sc)) != NULL) { + sc->vtblk_request_count--; + free(req, M_DEVBUF); + } - while (!virtqueue_full(vq)) { - if ((req = vtblk_dequeue_ready(sc)) == NULL) - req = vtblk_bio_request(sc); - if (req == NULL) - break; + KASSERT(sc->vtblk_request_count == 0, + ("%s: leaked %d requests", __func__, sc->vtblk_request_count)); +} - if (vtblk_execute_request(sc, req) != 0) { - vtblk_enqueue_ready(sc, req); - break; - } +static struct vtblk_request * +vtblk_request_dequeue(struct vtblk_softc *sc) +{ + struct vtblk_request *req; - enq++; + req = TAILQ_FIRST(&sc->vtblk_req_free); + if (req != NULL) { + TAILQ_REMOVE(&sc->vtblk_req_free, req, vbr_link); + bzero(req, sizeof(struct vtblk_request)); } - if (enq > 0) - virtqueue_notify(vq); + return (req); +} + +static void +vtblk_request_enqueue(struct vtblk_softc *sc, struct vtblk_request *req) +{ + + TAILQ_INSERT_HEAD(&sc->vtblk_req_free, req, vbr_link); +} + +static struct vtblk_request * +vtblk_request_next_ready(struct vtblk_softc *sc) +{ + struct vtblk_request *req; + + req = TAILQ_FIRST(&sc->vtblk_req_ready); + if (req != NULL) + TAILQ_REMOVE(&sc->vtblk_req_ready, req, vbr_link); + + return (req); +} + +static void +vtblk_request_requeue_ready(struct vtblk_softc *sc, struct vtblk_request *req) +{ + + /* NOTE: Currently, there will be at most one request in the queue. */ + TAILQ_INSERT_HEAD(&sc->vtblk_req_ready, req, vbr_link); +} + +static struct vtblk_request * +vtblk_request_next(struct vtblk_softc *sc) +{ + struct vtblk_request *req; + + req = vtblk_request_next_ready(sc); + if (req != NULL) + return (req); + + return (vtblk_request_bio(sc)); } static struct vtblk_request * -vtblk_bio_request(struct vtblk_softc *sc) +vtblk_request_bio(struct vtblk_softc *sc) { struct bio_queue_head *bioq; struct vtblk_request *req; @@ -865,7 +856,7 @@ vtblk_bio_request(struct vtblk_softc *sc if (bioq_first(bioq) == NULL) return (NULL); - req = vtblk_dequeue_request(sc); + req = vtblk_request_dequeue(sc); if (req == NULL) return (NULL); @@ -890,11 +881,14 @@ vtblk_bio_request(struct vtblk_softc *sc panic("%s: bio with unhandled cmd: %d", __func__, bp->bio_cmd); } + if (bp->bio_flags & BIO_ORDERED) + req->vbr_hdr.type |= VIRTIO_BLK_T_BARRIER; + return (req); } static int -vtblk_execute_request(struct vtblk_softc *sc, struct vtblk_request *req) +vtblk_request_execute(struct vtblk_softc *sc, struct vtblk_request *req) { struct virtqueue *vq; struct sglist *sg; @@ -907,26 +901,20 @@ vtblk_execute_request(struct vtblk_softc ordered = 0; writable = 0; - VTBLK_LOCK_ASSERT(sc); - /* - * Wait until the ordered request completes before - * executing subsequent requests. + * Some hosts (such as bhyve) do not implement the barrier feature, + * so we emulate it in the driver by allowing the barrier request + * to be the only one in flight. */ - if (sc->vtblk_req_ordered != NULL) - return (EBUSY); - - if (bp->bio_flags & BIO_ORDERED) { - if ((sc->vtblk_flags & VTBLK_FLAG_BARRIER) == 0) { - /* - * This request will be executed once all - * the in-flight requests are completed. - */ + if ((sc->vtblk_flags & VTBLK_FLAG_BARRIER) == 0) { + if (sc->vtblk_req_ordered != NULL) + return (EBUSY); + if (bp->bio_flags & BIO_ORDERED) { if (!virtqueue_empty(vq)) return (EBUSY); ordered = 1; - } else - req->vbr_hdr.type |= VIRTIO_BLK_T_BARRIER; + req->vbr_hdr.type &= ~VIRTIO_BLK_T_BARRIER; + } } sglist_reset(sg); @@ -935,7 +923,7 @@ vtblk_execute_request(struct vtblk_softc if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { error = sglist_append_bio(sg, bp); if (error || sg->sg_nseg == sg->sg_maxseg) { - panic("%s: data buffer too big bio:%p error:%d", + panic("%s: bio %p data buffer too big %d", __func__, bp, error); } @@ -955,44 +943,156 @@ vtblk_execute_request(struct vtblk_softc return (error); } -static void -vtblk_vq_intr(void *xsc) +static int +vtblk_request_error(struct vtblk_request *req) { - struct vtblk_softc *sc; - struct virtqueue *vq; - - sc = xsc; - vq = sc->vtblk_vq; + int error; -again: - VTBLK_LOCK(sc); - if (sc->vtblk_flags & VTBLK_FLAG_DETACH) { - VTBLK_UNLOCK(sc); - return; + switch (req->vbr_ack) { + case VIRTIO_BLK_S_OK: + error = 0; + break; + case VIRTIO_BLK_S_UNSUPP: + error = ENOTSUP; + break; + default: + error = EIO; + break; } - vtblk_finish_completed(sc); + return (error); +} - if ((sc->vtblk_flags & VTBLK_FLAG_SUSPEND) == 0) - vtblk_startio(sc); - else - wakeup(&sc->vtblk_vq); +static void +vtblk_queue_completed(struct vtblk_softc *sc, struct bio_queue *queue) +{ + struct vtblk_request *req; + struct bio *bp; - if (virtqueue_enable_intr(vq) != 0) { - virtqueue_disable_intr(vq); - VTBLK_UNLOCK(sc); - goto again; + while ((req = virtqueue_dequeue(sc->vtblk_vq, NULL)) != NULL) { + if (sc->vtblk_req_ordered != NULL) { + MPASS(sc->vtblk_req_ordered == req); + sc->vtblk_req_ordered = NULL; + } + + bp = req->vbr_bp; + bp->bio_error = vtblk_request_error(req); + TAILQ_INSERT_TAIL(queue, bp, bio_queue); + + vtblk_request_enqueue(sc, req); } +} - VTBLK_UNLOCK(sc); +static void +vtblk_done_completed(struct vtblk_softc *sc, struct bio_queue *queue) +{ + struct bio *bp, *tmp; + + TAILQ_FOREACH_SAFE(bp, queue, bio_queue, tmp) { + if (bp->bio_error != 0) + disk_err(bp, "hard error", -1, 1); + vtblk_bio_done(sc, bp, bp->bio_error); + } } static void -vtblk_stop(struct vtblk_softc *sc) +vtblk_drain_vq(struct vtblk_softc *sc, int skip_done) { + struct virtqueue *vq; + struct vtblk_request *req; + int last; - virtqueue_disable_intr(sc->vtblk_vq); - virtio_stop(sc->vtblk_dev); + vq = sc->vtblk_vq; + last = 0; + + while ((req = virtqueue_drain(vq, &last)) != NULL) { + if (!skip_done) + vtblk_bio_done(sc, req->vbr_bp, ENXIO); + + vtblk_request_enqueue(sc, req); + } + + sc->vtblk_req_ordered = NULL; + KASSERT(virtqueue_empty(vq), ("virtqueue not empty")); +} + +static void +vtblk_drain(struct vtblk_softc *sc) +{ + struct bio_queue queue; + struct bio_queue_head *bioq; + struct vtblk_request *req; + struct bio *bp; + + bioq = &sc->vtblk_bioq; + TAILQ_INIT(&queue); + + if (sc->vtblk_vq != NULL) { + vtblk_queue_completed(sc, &queue); + vtblk_done_completed(sc, &queue); + + vtblk_drain_vq(sc, 0); + } + + while ((req = vtblk_request_next_ready(sc)) != NULL) { + vtblk_bio_done(sc, req->vbr_bp, ENXIO); + vtblk_request_enqueue(sc, req); + } + + while (bioq_first(bioq) != NULL) { + bp = bioq_takefirst(bioq); + vtblk_bio_done(sc, bp, ENXIO); + } + + vtblk_request_free(sc); +} + +static void +vtblk_startio(struct vtblk_softc *sc) +{ + struct virtqueue *vq; + struct vtblk_request *req; + int enq; + + VTBLK_LOCK_ASSERT(sc); + vq = sc->vtblk_vq; + enq = 0; + + if (sc->vtblk_flags & VTBLK_FLAG_SUSPEND) + return; + + while (!virtqueue_full(vq)) { + req = vtblk_request_next(sc); + if (req == NULL) + break; + + if (vtblk_request_execute(sc, req) != 0) { + vtblk_request_requeue_ready(sc, req); + break; + } + + enq++; + } + + if (enq > 0) + virtqueue_notify(vq); +} + +static void +vtblk_bio_done(struct vtblk_softc *sc, struct bio *bp, int error) +{ + + /* Because of GEOM direct dispatch, we cannot hold any locks. */ + if (sc != NULL) + VTBLK_LOCK_ASSERT_NOTOWNED(sc); + + if (error) { + bp->bio_resid = bp->bio_bcount; + bp->bio_error = error; + bp->bio_flags |= BIO_ERROR; + } + + biodone(bp); } #define VTBLK_GET_CONFIG(_dev, _feature, _field, _cfg) \ @@ -1027,7 +1127,7 @@ vtblk_read_config(struct vtblk_softc *sc #undef VTBLK_GET_CONFIG static void -vtblk_get_ident(struct vtblk_softc *sc) +vtblk_ident(struct vtblk_softc *sc) { struct bio buf; struct disk *dp; @@ -1040,7 +1140,7 @@ vtblk_get_ident(struct vtblk_softc *sc) if (vtblk_tunable_int(sc, "no_ident", vtblk_no_ident) != 0) return; - req = vtblk_dequeue_request(sc); + req = vtblk_request_dequeue(sc); if (req == NULL) return; @@ -1060,7 +1160,7 @@ vtblk_get_ident(struct vtblk_softc *sc) error = vtblk_poll_request(sc, req); VTBLK_UNLOCK(sc); - vtblk_enqueue_request(sc, req); + vtblk_request_enqueue(sc, req); if (error) { device_printf(sc->vtblk_dev, @@ -1068,77 +1168,6 @@ vtblk_get_ident(struct vtblk_softc *sc) } } -static void -vtblk_prepare_dump(struct vtblk_softc *sc) -{ - device_t dev; - struct virtqueue *vq; - - dev = sc->vtblk_dev; - vq = sc->vtblk_vq; - - vtblk_stop(sc); - - /* - * Drain all requests caught in-flight in the virtqueue, - * skipping biodone(). When dumping, only one request is - * outstanding at a time, and we just poll the virtqueue - * for the response. - */ - vtblk_drain_vq(sc, 1); - - if (virtio_reinit(dev, sc->vtblk_features) != 0) { - panic("%s: cannot reinit VirtIO block device during dump", - device_get_nameunit(dev)); - } - - virtqueue_disable_intr(vq); - virtio_reinit_complete(dev); -} - -static int -vtblk_write_dump(struct vtblk_softc *sc, void *virtual, off_t offset, - size_t length) -{ - struct bio buf; - struct vtblk_request *req; - - req = &sc->vtblk_dump_request; - req->vbr_ack = -1; - req->vbr_hdr.type = VIRTIO_BLK_T_OUT; - req->vbr_hdr.ioprio = 1; - req->vbr_hdr.sector = offset / 512; - - req->vbr_bp = &buf; - bzero(&buf, sizeof(struct bio)); - - buf.bio_cmd = BIO_WRITE; - buf.bio_data = virtual; - buf.bio_bcount = length; - - return (vtblk_poll_request(sc, req)); -} - -static int -vtblk_flush_dump(struct vtblk_softc *sc) -{ - struct bio buf; - struct vtblk_request *req; - - req = &sc->vtblk_dump_request; - req->vbr_ack = -1; - req->vbr_hdr.type = VIRTIO_BLK_T_FLUSH; - req->vbr_hdr.ioprio = 1; - req->vbr_hdr.sector = 0; - - req->vbr_bp = &buf; - bzero(&buf, sizeof(struct bio)); - - buf.bio_cmd = BIO_FLUSH; - - return (vtblk_poll_request(sc, req)); -} - static int vtblk_poll_request(struct vtblk_softc *sc, struct vtblk_request *req) { @@ -1150,7 +1179,7 @@ vtblk_poll_request(struct vtblk_softc *s if (!virtqueue_empty(vq)) return (EBUSY); - error = vtblk_execute_request(sc, req); + error = vtblk_request_execute(sc, req); if (error) return (error); @@ -1166,212 +1195,188 @@ vtblk_poll_request(struct vtblk_softc *s return (error); } -static void -vtblk_finish_completed(struct vtblk_softc *sc) +static int +vtblk_quiesce(struct vtblk_softc *sc) { - struct vtblk_request *req; - struct bio *bp; int error; - while ((req = virtqueue_dequeue(sc->vtblk_vq, NULL)) != NULL) { - bp = req->vbr_bp; + VTBLK_LOCK_ASSERT(sc); + error = 0; - if (sc->vtblk_req_ordered != NULL) { - /* This should be the only outstanding request. */ - MPASS(sc->vtblk_req_ordered == req); - sc->vtblk_req_ordered = NULL; + while (!virtqueue_empty(sc->vtblk_vq)) { + if (mtx_sleep(&sc->vtblk_vq, VTBLK_MTX(sc), PRIBIO, "vtblkq", + VTBLK_QUIESCE_TIMEOUT) == EWOULDBLOCK) { + error = EBUSY; + break; } - - error = vtblk_request_error(req); - if (error) - disk_err(bp, "hard error", -1, 1); - - vtblk_finish_bio(bp, error); - vtblk_enqueue_request(sc, req); } + + return (error); } static void -vtblk_drain_vq(struct vtblk_softc *sc, int skip_done) +vtblk_vq_intr(void *xsc) { + struct vtblk_softc *sc; struct virtqueue *vq; - struct vtblk_request *req; - int last; + struct bio_queue queue; + sc = xsc; vq = sc->vtblk_vq; - last = 0; - - while ((req = virtqueue_drain(vq, &last)) != NULL) { - if (!skip_done) - vtblk_finish_bio(req->vbr_bp, ENXIO); + TAILQ_INIT(&queue); - vtblk_enqueue_request(sc, req); - } - - sc->vtblk_req_ordered = NULL; - KASSERT(virtqueue_empty(vq), ("virtqueue not empty")); -} - -static void -vtblk_drain(struct vtblk_softc *sc) -{ - struct bio_queue_head *bioq; - struct vtblk_request *req; - struct bio *bp; + VTBLK_LOCK(sc); - bioq = &sc->vtblk_bioq; +again: + if (sc->vtblk_flags & VTBLK_FLAG_DETACH) + goto out; - if (sc->vtblk_vq != NULL) { - vtblk_finish_completed(sc); - vtblk_drain_vq(sc, 0); - } + vtblk_queue_completed(sc, &queue); + vtblk_startio(sc); - while ((req = vtblk_dequeue_ready(sc)) != NULL) { - vtblk_finish_bio(req->vbr_bp, ENXIO); - vtblk_enqueue_request(sc, req); + if (virtqueue_enable_intr(vq) != 0) { + virtqueue_disable_intr(vq); + goto again; } - while (bioq_first(bioq) != NULL) { - bp = bioq_takefirst(bioq); - vtblk_finish_bio(bp, ENXIO); - } + if (sc->vtblk_flags & VTBLK_FLAG_SUSPEND) + wakeup(&sc->vtblk_vq); - vtblk_free_requests(sc); +out: + VTBLK_UNLOCK(sc); + vtblk_done_completed(sc, &queue); } -#ifdef INVARIANTS static void -vtblk_request_invariants(struct vtblk_request *req) +vtblk_stop(struct vtblk_softc *sc) { - int hdr_nsegs, ack_nsegs; - - hdr_nsegs = sglist_count(&req->vbr_hdr, sizeof(req->vbr_hdr)); - ack_nsegs = sglist_count(&req->vbr_ack, sizeof(req->vbr_ack)); - KASSERT(hdr_nsegs == 1, ("request header crossed page boundary")); - KASSERT(ack_nsegs == 1, ("request ack crossed page boundary")); + virtqueue_disable_intr(sc->vtblk_vq); + virtio_stop(sc->vtblk_dev); } -#endif -static int -vtblk_alloc_requests(struct vtblk_softc *sc) +static void +vtblk_dump_prepare(struct vtblk_softc *sc) { - struct vtblk_request *req; - int i, nreqs; + device_t dev; + struct virtqueue *vq; - nreqs = virtqueue_size(sc->vtblk_vq); + dev = sc->vtblk_dev; + vq = sc->vtblk_vq; + + vtblk_stop(sc); /* - * Preallocate sufficient requests to keep the virtqueue full. Each - * request consumes VTBLK_MIN_SEGMENTS or more descriptors so reduce - * the number allocated when indirect descriptors are not available. + * Drain all requests caught in-flight in the virtqueue, + * skipping biodone(). When dumping, only one request is + * outstanding at a time, and we just poll the virtqueue + * for the response. */ - if ((sc->vtblk_flags & VTBLK_FLAG_INDIRECT) == 0) - nreqs /= VTBLK_MIN_SEGMENTS; - - for (i = 0; i < nreqs; i++) { - req = malloc(sizeof(struct vtblk_request), M_DEVBUF, M_NOWAIT); - if (req == NULL) - return (ENOMEM); - -#ifdef INVARIANTS - vtblk_request_invariants(req); -#endif + vtblk_drain_vq(sc, 1); - sc->vtblk_request_count++; - vtblk_enqueue_request(sc, req); + if (virtio_reinit(dev, sc->vtblk_features) != 0) { + panic("%s: cannot reinit VirtIO block device during dump", + device_get_nameunit(dev)); } - return (0); + virtqueue_disable_intr(vq); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 17:27:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1844DE80; Sun, 30 Nov 2014 17:27:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 04157B65; Sun, 30 Nov 2014 17:27:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUHROSH081216; Sun, 30 Nov 2014 17:27:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUHROqU081215; Sun, 30 Nov 2014 17:27:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201411301727.sAUHROqU081215@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 30 Nov 2014 17:27:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275336 - head/contrib/binutils/bfd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 17:27:25 -0000 Author: andrew Date: Sun Nov 30 17:27:24 2014 New Revision: 275336 URL: https://svnweb.freebsd.org/changeset/base/275336 Log: Use llabs when getting the absolute value of a long long. Sponsored by: ABT Ststems Ltd Modified: head/contrib/binutils/bfd/elf32-arm.c Modified: head/contrib/binutils/bfd/elf32-arm.c ============================================================================== --- head/contrib/binutils/bfd/elf32-arm.c Sun Nov 30 16:36:26 2014 (r275335) +++ head/contrib/binutils/bfd/elf32-arm.c Sun Nov 30 17:27:24 2014 (r275336) @@ -4960,7 +4960,7 @@ elf32_arm_final_link_relocate (reloc_how + input_section->output_offset + rel->r_offset); - value = abs (relocation); + value = llabs (relocation); if (value >= 0x1000) return bfd_reloc_overflow; @@ -4998,7 +4998,7 @@ elf32_arm_final_link_relocate (reloc_how + input_section->output_offset + rel->r_offset); - value = abs (relocation); + value = llabs (relocation); if (value >= 0x1000) return bfd_reloc_overflow; @@ -5984,7 +5984,7 @@ elf32_arm_final_link_relocate (reloc_how /* Calculate the value of the relevant G_n, in encoded constant-with-rotation format. */ - g_n = calculate_group_reloc_mask (abs (signed_value), group, + g_n = calculate_group_reloc_mask (llabs (signed_value), group, &residual); /* Check for overflow if required. */ @@ -5998,7 +5998,7 @@ elf32_arm_final_link_relocate (reloc_how (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } @@ -6077,7 +6077,7 @@ elf32_arm_final_link_relocate (reloc_how /* Calculate the value of the relevant G_{n-1} to obtain the residual at that stage. */ - calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + calculate_group_reloc_mask (llabs (signed_value), group - 1, &residual); /* Check for overflow. */ if (residual >= 0x1000) @@ -6085,7 +6085,7 @@ elf32_arm_final_link_relocate (reloc_how (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } @@ -6160,7 +6160,7 @@ elf32_arm_final_link_relocate (reloc_how /* Calculate the value of the relevant G_{n-1} to obtain the residual at that stage. */ - calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + calculate_group_reloc_mask (llabs (signed_value), group - 1, &residual); /* Check for overflow. */ if (residual >= 0x100) @@ -6168,7 +6168,7 @@ elf32_arm_final_link_relocate (reloc_how (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } @@ -6243,7 +6243,7 @@ elf32_arm_final_link_relocate (reloc_how /* Calculate the value of the relevant G_{n-1} to obtain the residual at that stage. */ - calculate_group_reloc_mask (abs (signed_value), group - 1, &residual); + calculate_group_reloc_mask (llabs (signed_value), group - 1, &residual); /* Check for overflow. (The absolute value to go in the place must be divisible by four and, after having been divided by four, must @@ -6253,7 +6253,7 @@ elf32_arm_final_link_relocate (reloc_how (*_bfd_error_handler) (_("%B(%A+0x%lx): Overflow whilst splitting 0x%lx for group relocation %s"), input_bfd, input_section, - (long) rel->r_offset, abs (signed_value), howto->name); + (long) rel->r_offset, llabs (signed_value), howto->name); return bfd_reloc_overflow; } From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 17:29:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12BD1FD4; Sun, 30 Nov 2014 17:29:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2F9DB79; Sun, 30 Nov 2014 17:29:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUHTnW6081531; Sun, 30 Nov 2014 17:29:49 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUHTndV081530; Sun, 30 Nov 2014 17:29:49 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201411301729.sAUHTndV081530@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 30 Nov 2014 17:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275337 - head/contrib/gcc/config/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 17:29:50 -0000 Author: andrew Date: Sun Nov 30 17:29:49 2014 New Revision: 275337 URL: https://svnweb.freebsd.org/changeset/base/275337 Log: There is no need to use FUNC_END with aeabi_ldiv0 or aeabi_idiv0 as they are aliases. Sponsored by: ABT Systems Ltd Modified: head/contrib/gcc/config/arm/lib1funcs.asm Modified: head/contrib/gcc/config/arm/lib1funcs.asm ============================================================================== --- head/contrib/gcc/config/arm/lib1funcs.asm Sun Nov 30 17:27:24 2014 (r275336) +++ head/contrib/gcc/config/arm/lib1funcs.asm Sun Nov 30 17:29:49 2014 (r275337) @@ -980,8 +980,6 @@ LSYM(Lover12): RET - FUNC_END aeabi_ldiv0 - FUNC_END aeabi_idiv0 FUNC_END div0 #endif /* L_divmodsi_tools */ From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 17:55:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AD09C3F; Sun, 30 Nov 2014 17:55:07 +0000 (UTC) Received: from mail-wi0-x22e.google.com (mail-wi0-x22e.google.com [IPv6:2a00:1450:400c:c05::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA177DFB; Sun, 30 Nov 2014 17:55:06 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id h11so22532139wiw.1 for ; Sun, 30 Nov 2014 09:55:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=3LxTFft3nmjFhYRJg+rWfSnYZqy0XQiitCaMMVYIH00=; b=NAIwvcMTWfOxuEk80hUhcFrNcvWSS+EzEB+QXaIhWqLlszfoz+zISaUNp1yk9xBZqR LGwupI926khlLm1R4+Fe/PIBmzSoV0NR3mmhDGAc7o+Y/ZT9UN8Ud3VhxB69h1fqohuj uazRqJGUocD0JZiE1CKTkAoRzjP5ncedsVGAvhKRRiD03LmYqZp418LsFQvy5hyU9qfd rVuH3jltBNoupTuVdkrIkaCSoKPDOabw8b1C+EYrSanfJ2fM+Dwdw1hgmCJIKkLzGE8p TRK/RRzHJfYDw039kuyJsI4VB5ZMpiAeqvLhkWI9dmsl49l4vaVRwOYRbF67Qg/mpBMH ZOYQ== MIME-Version: 1.0 X-Received: by 10.194.24.103 with SMTP id t7mr67298359wjf.15.1417370105111; Sun, 30 Nov 2014 09:55:05 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.106.195 with HTTP; Sun, 30 Nov 2014 09:55:05 -0800 (PST) In-Reply-To: <201411301252.sAUCqYXm055601@svn.freebsd.org> References: <201411301252.sAUCqYXm055601@svn.freebsd.org> Date: Sun, 30 Nov 2014 09:55:05 -0800 X-Google-Sender-Auth: _4OWZA8qL7fwZd8jZe0nC5PB29s Message-ID: Subject: Re: svn commit: r275326 - in head: sys/dev/cxgbe/tom sys/kern sys/netinet sys/sys usr.bin/bluetooth/btsockstat usr.bin/netstat usr.bin/systat From: Adrian Chadd To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 17:55:07 -0000 Hi, I really wished that these commits got individual reviews before they went in. The whole idea of an mbuf whose data isn't quite there yet makes debugging issues rather amusing, as now you may have VM issues to debug at the same time as you're debugging network related stuff. I really think this could've been done without all the back-handed VM work. The mbufs and IO buffers both have completion function calls; it would've been much less intrusive to do it that way. -adrian On 30 November 2014 at 04:52, Gleb Smirnoff wrote: > Author: glebius > Date: Sun Nov 30 12:52:33 2014 > New Revision: 275326 > URL: https://svnweb.freebsd.org/changeset/base/275326 > > Log: > Merge from projects/sendfile: > > o Introduce a notion of "not ready" mbufs in socket buffers. These > mbufs are now being populated by some I/O in background and are > referenced outside. This forces following implications: > - An mbuf which is "not ready" can't be taken out of the buffer. > - An mbuf that is behind a "not ready" in the queue neither. > - If sockbet buffer is flushed, then "not ready" mbufs shouln't be > freed. > > o In struct sockbuf the sb_cc field is split into sb_ccc and sb_acc. > The sb_ccc stands for ""claimed character count", or "committed > character count". And the sb_acc is "available character count". > Consumers of socket buffer API shouldn't already access them directly, > but use sbused() and sbavail() respectively. > o Not ready mbufs are marked with M_NOTREADY, and ready but blocked ones > with M_BLOCKED. > o New field sb_fnrdy points to the first not ready mbuf, to avoid linear > search. > o New function sbready() is provided to activate certain amount of mbufs > in a socket buffer. > > A special note on SCTP: > SCTP has its own sockbufs. Unfortunately, FreeBSD stack doesn't yet > allow protocol specific sockbufs. Thus, SCTP does some hacks to make > itself compatible with FreeBSD: it manages sockbufs on its own, but keeps > sb_cc updated to inform the stack of amount of data in them. The new > notion of "not ready" data isn't supported by SCTP. Instead, only a > mechanical substitute is done: s/sb_cc/sb_ccc/. > A proper solution would be to take away struct sockbuf from struct > socket and allow protocols to implement their own socket buffers, like > SCTP already does. This was discussed with rrs@. > > Sponsored by: Netflix > Sponsored by: Nginx, Inc. > > Modified: > head/sys/dev/cxgbe/tom/t4_ddp.c > head/sys/kern/uipc_debug.c > head/sys/kern/uipc_sockbuf.c > head/sys/kern/uipc_socket.c > head/sys/netinet/sctp_indata.c > head/sys/netinet/sctp_input.c > head/sys/netinet/sctp_os_bsd.h > head/sys/netinet/sctp_output.c > head/sys/netinet/sctp_pcb.c > head/sys/netinet/sctp_pcb.h > head/sys/netinet/sctp_structs.h > head/sys/netinet/sctp_usrreq.c > head/sys/netinet/sctp_var.h > head/sys/netinet/sctputil.c > head/sys/netinet/sctputil.h > head/sys/sys/sockbuf.h > head/usr.bin/bluetooth/btsockstat/btsockstat.c > head/usr.bin/netstat/inet.c > head/usr.bin/netstat/netgraph.c > head/usr.bin/netstat/unix.c > head/usr.bin/systat/netstat.c > > Modified: head/sys/dev/cxgbe/tom/t4_ddp.c > ============================================================================== > --- head/sys/dev/cxgbe/tom/t4_ddp.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/dev/cxgbe/tom/t4_ddp.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -971,8 +971,9 @@ handle_ddp(struct socket *so, struct uio > */ > rc = sbwait(sb); > while (toep->ddp_flags & buf_flag) { > + /* XXXGL: shouldn't here be sbwait() call? */ > sb->sb_flags |= SB_WAIT; > - msleep(&sb->sb_cc, &sb->sb_mtx, PSOCK , "sbwait", 0); > + msleep(&sb->sb_acc, &sb->sb_mtx, PSOCK , "sbwait", 0); > } > unwire_ddp_buffer(db); > return (rc); > > Modified: head/sys/kern/uipc_debug.c > ============================================================================== > --- head/sys/kern/uipc_debug.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/kern/uipc_debug.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -401,7 +401,8 @@ db_print_sockbuf(struct sockbuf *sb, con > db_printf("sb_sndptroff: %u\n", sb->sb_sndptroff); > > db_print_indent(indent); > - db_printf("sb_cc: %u ", sb->sb_cc); > + db_printf("sb_acc: %u ", sb->sb_acc); > + db_printf("sb_ccc: %u ", sb->sb_ccc); > db_printf("sb_hiwat: %u ", sb->sb_hiwat); > db_printf("sb_mbcnt: %u ", sb->sb_mbcnt); > db_printf("sb_mbmax: %u\n", sb->sb_mbmax); > > Modified: head/sys/kern/uipc_sockbuf.c > ============================================================================== > --- head/sys/kern/uipc_sockbuf.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/kern/uipc_sockbuf.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -69,6 +69,43 @@ static struct mbuf *sbcut_internal(struc > static void sbflush_internal(struct sockbuf *sb); > > /* > + * Mark ready "count" mbufs starting with "m". > + */ > +int > +sbready(struct sockbuf *sb, struct mbuf *m, int count) > +{ > + u_int blocker; > + > + SOCKBUF_LOCK_ASSERT(sb); > + KASSERT(sb->sb_fnrdy != NULL, ("%s: sb %p NULL fnrdy", __func__, sb)); > + > + blocker = (sb->sb_fnrdy == m) ? M_BLOCKED : 0; > + > + for (int i = 0; i < count; i++, m = m->m_next) { > + KASSERT(m->m_flags & M_NOTREADY, > + ("%s: m %p !M_NOTREADY", __func__, m)); > + m->m_flags &= ~(M_NOTREADY | blocker); > + if (blocker) > + sb->sb_acc += m->m_len; > + } > + > + if (!blocker) > + return (EINPROGRESS); > + > + /* This one was blocking all the queue. */ > + for (; m && (m->m_flags & M_NOTREADY) == 0; m = m->m_next) { > + KASSERT(m->m_flags & M_BLOCKED, > + ("%s: m %p !M_BLOCKED", __func__, m)); > + m->m_flags &= ~M_BLOCKED; > + sb->sb_acc += m->m_len; > + } > + > + sb->sb_fnrdy = m; > + > + return (0); > +} > + > +/* > * Adjust sockbuf state reflecting allocation of m. > */ > void > @@ -77,7 +114,15 @@ sballoc(struct sockbuf *sb, struct mbuf > > SOCKBUF_LOCK_ASSERT(sb); > > - sb->sb_cc += m->m_len; > + sb->sb_ccc += m->m_len; > + > + if (sb->sb_fnrdy == NULL) { > + if (m->m_flags & M_NOTREADY) > + sb->sb_fnrdy = m; > + else > + sb->sb_acc += m->m_len; > + } else > + m->m_flags |= M_BLOCKED; > > if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) > sb->sb_ctl += m->m_len; > @@ -102,7 +147,25 @@ sbfree(struct sockbuf *sb, struct mbuf * > SOCKBUF_LOCK_ASSERT(sb); > #endif > > - sb->sb_cc -= m->m_len; > + sb->sb_ccc -= m->m_len; > + > + if (!(m->m_flags & M_NOTAVAIL)) > + sb->sb_acc -= m->m_len; > + > + if (m == sb->sb_fnrdy) { > + struct mbuf *n; > + > + KASSERT(m->m_flags & M_NOTREADY, > + ("%s: m %p !M_NOTREADY", __func__, m)); > + > + n = m->m_next; > + while (n != NULL && !(n->m_flags & M_NOTREADY)) { > + n->m_flags &= ~M_BLOCKED; > + sb->sb_acc += n->m_len; > + n = n->m_next; > + } > + sb->sb_fnrdy = n; > + } > > if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) > sb->sb_ctl -= m->m_len; > @@ -181,7 +244,7 @@ sbwait(struct sockbuf *sb) > SOCKBUF_LOCK_ASSERT(sb); > > sb->sb_flags |= SB_WAIT; > - return (msleep_sbt(&sb->sb_cc, &sb->sb_mtx, > + return (msleep_sbt(&sb->sb_acc, &sb->sb_mtx, > (sb->sb_flags & SB_NOINTR) ? PSOCK : PSOCK | PCATCH, "sbwait", > sb->sb_timeo, 0, 0)); > } > @@ -238,7 +301,7 @@ sowakeup(struct socket *so, struct sockb > sb->sb_flags &= ~SB_SEL; > if (sb->sb_flags & SB_WAIT) { > sb->sb_flags &= ~SB_WAIT; > - wakeup(&sb->sb_cc); > + wakeup(&sb->sb_acc); > } > KNOTE_LOCKED(&sb->sb_sel.si_note, 0); > if (sb->sb_upcall != NULL) { > @@ -609,12 +672,13 @@ sbappendstream(struct sockbuf *sb, struc > void > sbcheck(struct sockbuf *sb, const char *file, int line) > { > - struct mbuf *m, *n; > - u_long cc, mbcnt; > + struct mbuf *m, *n, *fnrdy; > + u_long acc, ccc, mbcnt; > > SOCKBUF_LOCK_ASSERT(sb); > > - cc = mbcnt = 0; > + acc = ccc = mbcnt = 0; > + fnrdy = NULL; > > for (m = sb->sb_mb; m; m = n) { > n = m->m_nextpkt; > @@ -623,15 +687,31 @@ sbcheck(struct sockbuf *sb, const char * > printf("sb %p empty mbuf %p\n", sb, m); > goto fail; > } > - cc += m->m_len; > + if ((m->m_flags & M_NOTREADY) && fnrdy == NULL) { > + if (m != sb->sb_fnrdy) { > + printf("sb %p: fnrdy %p != m %p\n", > + sb, sb->sb_fnrdy, m); > + goto fail; > + } > + fnrdy = m; > + } > + if (fnrdy) { > + if (!(m->m_flags & M_NOTAVAIL)) { > + printf("sb %p: fnrdy %p, m %p is avail\n", > + sb, sb->sb_fnrdy, m); > + goto fail; > + } > + } else > + acc += m->m_len; > + ccc += m->m_len; > mbcnt += MSIZE; > if (m->m_flags & M_EXT) /*XXX*/ /* pretty sure this is bogus */ > mbcnt += m->m_ext.ext_size; > } > } > - if (cc != sb->sb_cc || mbcnt != sb->sb_mbcnt) { > - printf("cc %ld != %u || mbcnt %ld != %u\n", cc, sb->sb_cc, > - mbcnt, sb->sb_mbcnt); > + if (acc != sb->sb_acc || ccc != sb->sb_ccc || mbcnt != sb->sb_mbcnt) { > + printf("acc %ld/%u ccc %ld/%u mbcnt %ld/%u\n", > + acc, sb->sb_acc, ccc, sb->sb_ccc, mbcnt, sb->sb_mbcnt); > goto fail; > } > return; > @@ -832,8 +912,8 @@ sbappendcontrol(struct sockbuf *sb, stru > * > * (2) The mbuf may be coalesced -- i.e., data in the mbuf may be copied into > * an mbuf already in the socket buffer. This can occur if an > - * appropriate mbuf exists, there is room, and no merging of data types > - * will occur. > + * appropriate mbuf exists, there is room, both mbufs are not marked as > + * not ready, and no merging of data types will occur. > * > * (3) The mbuf may be appended to the end of the existing mbuf chain. > * > @@ -862,13 +942,17 @@ sbcompress(struct sockbuf *sb, struct mb > if (n && (n->m_flags & M_EOR) == 0 && > M_WRITABLE(n) && > ((sb->sb_flags & SB_NOCOALESCE) == 0) && > + !(m->m_flags & M_NOTREADY) && > + !(n->m_flags & M_NOTREADY) && > m->m_len <= MCLBYTES / 4 && /* XXX: Don't copy too much */ > m->m_len <= M_TRAILINGSPACE(n) && > n->m_type == m->m_type) { > bcopy(mtod(m, caddr_t), mtod(n, caddr_t) + n->m_len, > (unsigned)m->m_len); > n->m_len += m->m_len; > - sb->sb_cc += m->m_len; > + sb->sb_ccc += m->m_len; > + if (sb->sb_fnrdy == NULL) > + sb->sb_acc += m->m_len; > if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) > /* XXX: Probably don't need.*/ > sb->sb_ctl += m->m_len; > @@ -905,13 +989,13 @@ sbflush_internal(struct sockbuf *sb) > * Don't call sbcut(sb, 0) if the leading mbuf is non-empty: > * we would loop forever. Panic instead. > */ > - if (!sb->sb_cc && (sb->sb_mb == NULL || sb->sb_mb->m_len)) > + if (sb->sb_ccc == 0 && (sb->sb_mb == NULL || sb->sb_mb->m_len)) > break; > - m_freem(sbcut_internal(sb, (int)sb->sb_cc)); > + m_freem(sbcut_internal(sb, (int)sb->sb_ccc)); > } > - if (sb->sb_cc || sb->sb_mb || sb->sb_mbcnt) > - panic("sbflush_internal: cc %u || mb %p || mbcnt %u", > - sb->sb_cc, (void *)sb->sb_mb, sb->sb_mbcnt); > + KASSERT(sb->sb_ccc == 0 && sb->sb_mb == 0 && sb->sb_mbcnt == 0, > + ("%s: ccc %u mb %p mbcnt %u", __func__, > + sb->sb_ccc, (void *)sb->sb_mb, sb->sb_mbcnt)); > } > > void > @@ -937,7 +1021,7 @@ sbflush(struct sockbuf *sb) > static struct mbuf * > sbcut_internal(struct sockbuf *sb, int len) > { > - struct mbuf *m, *n, *next, *mfree; > + struct mbuf *m, *next, *mfree; > > next = (m = sb->sb_mb) ? m->m_nextpkt : 0; > mfree = NULL; > @@ -949,9 +1033,12 @@ sbcut_internal(struct sockbuf *sb, int l > next = m->m_nextpkt; > } > if (m->m_len > len) { > + KASSERT(!(m->m_flags & M_NOTAVAIL), > + ("%s: m %p M_NOTAVAIL", __func__, m)); > m->m_len -= len; > m->m_data += len; > - sb->sb_cc -= len; > + sb->sb_ccc -= len; > + sb->sb_acc -= len; > if (sb->sb_sndptroff != 0) > sb->sb_sndptroff -= len; > if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) > @@ -960,10 +1047,20 @@ sbcut_internal(struct sockbuf *sb, int l > } > len -= m->m_len; > sbfree(sb, m); > - n = m->m_next; > - m->m_next = mfree; > - mfree = m; > - m = n; > + /* > + * Do not put M_NOTREADY buffers to the free list, they > + * are referenced from outside. > + */ > + if (m->m_flags & M_NOTREADY) > + m = m->m_next; > + else { > + struct mbuf *n; > + > + n = m->m_next; > + m->m_next = mfree; > + mfree = m; > + m = n; > + } > } > if (m) { > sb->sb_mb = m; > @@ -1030,8 +1127,8 @@ sbsndptr(struct sockbuf *sb, u_int off, > struct mbuf *m, *ret; > > KASSERT(sb->sb_mb != NULL, ("%s: sb_mb is NULL", __func__)); > - KASSERT(off + len <= sb->sb_cc, ("%s: beyond sb", __func__)); > - KASSERT(sb->sb_sndptroff <= sb->sb_cc, ("%s: sndptroff broken", __func__)); > + KASSERT(off + len <= sb->sb_acc, ("%s: beyond sb", __func__)); > + KASSERT(sb->sb_sndptroff <= sb->sb_acc, ("%s: sndptroff broken", __func__)); > > /* > * Is off below stored offset? Happens on retransmits. > @@ -1180,7 +1277,7 @@ void > sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb) > { > > - xsb->sb_cc = sb->sb_cc; > + xsb->sb_cc = sb->sb_ccc; > xsb->sb_hiwat = sb->sb_hiwat; > xsb->sb_mbcnt = sb->sb_mbcnt; > xsb->sb_mcnt = sb->sb_mcnt; > > Modified: head/sys/kern/uipc_socket.c > ============================================================================== > --- head/sys/kern/uipc_socket.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/kern/uipc_socket.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -1706,7 +1706,8 @@ dontblock: > */ > moff = 0; > offset = 0; > - while (m != NULL && uio->uio_resid > 0 && error == 0) { > + while (m != NULL && !(m->m_flags & M_NOTAVAIL) && uio->uio_resid > 0 > + && error == 0) { > /* > * If the type of mbuf has changed since the last mbuf > * examined ('type'), end the receive operation. > @@ -2044,6 +2045,8 @@ deliver: > for (m = sb->sb_mb; > m != NULL && m->m_len <= len; > m = m->m_next) { > + KASSERT(!(m->m_flags & M_NOTAVAIL), > + ("%s: m %p not available", __func__, m)); > len -= m->m_len; > uio->uio_resid -= m->m_len; > sbfree(sb, m); > > Modified: head/sys/netinet/sctp_indata.c > ============================================================================== > --- head/sys/netinet/sctp_indata.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_indata.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -70,14 +70,14 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, st > > /* > * This is really set wrong with respect to a 1-2-m socket. Since > - * the sb_cc is the count that everyone as put up. When we re-write > + * the sb_ccc is the count that everyone as put up. When we re-write > * sctp_soreceive then we will fix this so that ONLY this > * associations data is taken into account. > */ > if (stcb->sctp_socket == NULL) > return (calc); > > - if (stcb->asoc.sb_cc == 0 && > + if (stcb->asoc.sb_ccc == 0 && > asoc->size_on_reasm_queue == 0 && > asoc->size_on_all_streams == 0) { > /* Full rwnd granted */ > @@ -1363,7 +1363,7 @@ sctp_process_a_data_chunk(struct sctp_tc > * When we have NO room in the rwnd we check to make sure > * the reader is doing its job... > */ > - if (stcb->sctp_socket->so_rcv.sb_cc) { > + if (stcb->sctp_socket->so_rcv.sb_ccc) { > /* some to read, wake-up */ > #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) > struct socket *so; > > Modified: head/sys/netinet/sctp_input.c > ============================================================================== > --- head/sys/netinet/sctp_input.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_input.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -1032,7 +1032,7 @@ sctp_handle_shutdown_ack(struct sctp_shu > if (stcb->sctp_socket) { > if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || > (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { > - stcb->sctp_socket->so_snd.sb_cc = 0; > + stcb->sctp_socket->so_snd.sb_ccc = 0; > } > sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); > } > > Modified: head/sys/netinet/sctp_os_bsd.h > ============================================================================== > --- head/sys/netinet/sctp_os_bsd.h Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_os_bsd.h Sun Nov 30 12:52:33 2014 (r275326) > @@ -399,7 +399,7 @@ typedef struct callout sctp_os_timer_t; > #define SCTP_SOWAKEUP(so) wakeup(&(so)->so_timeo) > /* clear the socket buffer state */ > #define SCTP_SB_CLEAR(sb) \ > - (sb).sb_cc = 0; \ > + (sb).sb_ccc = 0; \ > (sb).sb_mb = NULL; \ > (sb).sb_mbcnt = 0; > > > Modified: head/sys/netinet/sctp_output.c > ============================================================================== > --- head/sys/netinet/sctp_output.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_output.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -7250,7 +7250,7 @@ one_more_time: > if ((stcb->sctp_socket != NULL) && \ > ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || > (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { > - atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc, sp->length); > + atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_ccc, sp->length); > } > if (sp->data) { > sctp_m_freem(sp->data); > @@ -11532,7 +11532,7 @@ jump_out: > drp->current_onq = htonl(asoc->size_on_reasm_queue + > asoc->size_on_all_streams + > asoc->my_rwnd_control_len + > - stcb->sctp_socket->so_rcv.sb_cc); > + stcb->sctp_socket->so_rcv.sb_ccc); > } else { > /*- > * If my rwnd is 0, possibly from mbuf depletion as well as > > Modified: head/sys/netinet/sctp_pcb.c > ============================================================================== > --- head/sys/netinet/sctp_pcb.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_pcb.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -3397,7 +3397,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, > if ((asoc->asoc.size_on_reasm_queue > 0) || > (asoc->asoc.control_pdapi) || > (asoc->asoc.size_on_all_streams > 0) || > - (so && (so->so_rcv.sb_cc > 0))) { > + (so && (so->so_rcv.sb_ccc > 0))) { > /* Left with Data unread */ > struct mbuf *op_err; > > @@ -3625,7 +3625,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, > TAILQ_REMOVE(&inp->read_queue, sq, next); > sctp_free_remote_addr(sq->whoFrom); > if (so) > - so->so_rcv.sb_cc -= sq->length; > + so->so_rcv.sb_ccc -= sq->length; > if (sq->data) { > sctp_m_freem(sq->data); > sq->data = NULL; > @@ -4853,7 +4853,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, > inp->sctp_flags |= SCTP_PCB_FLAGS_WAS_CONNECTED; > if (so) { > SOCK_LOCK(so); > - if (so->so_rcv.sb_cc == 0) { > + if (so->so_rcv.sb_ccc == 0) { > so->so_state &= ~(SS_ISCONNECTING | > SS_ISDISCONNECTING | > SS_ISCONFIRMING | > > Modified: head/sys/netinet/sctp_pcb.h > ============================================================================== > --- head/sys/netinet/sctp_pcb.h Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_pcb.h Sun Nov 30 12:52:33 2014 (r275326) > @@ -369,7 +369,7 @@ struct sctp_inpcb { > } ip_inp; > > > - /* Socket buffer lock protects read_queue and of course sb_cc */ > + /* Socket buffer lock protects read_queue and of course sb_ccc */ > struct sctp_readhead read_queue; > > LIST_ENTRY(sctp_inpcb) sctp_list; /* lists all endpoints */ > > Modified: head/sys/netinet/sctp_structs.h > ============================================================================== > --- head/sys/netinet/sctp_structs.h Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_structs.h Sun Nov 30 12:52:33 2014 (r275326) > @@ -990,7 +990,7 @@ struct sctp_association { > > uint32_t total_output_queue_size; > > - uint32_t sb_cc; /* shadow of sb_cc */ > + uint32_t sb_ccc; /* shadow of sb_ccc */ > uint32_t sb_send_resv; /* amount reserved on a send */ > uint32_t my_rwnd_control_len; /* shadow of sb_mbcnt used for rwnd > * control */ > > Modified: head/sys/netinet/sctp_usrreq.c > ============================================================================== > --- head/sys/netinet/sctp_usrreq.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_usrreq.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -586,7 +586,7 @@ sctp_must_try_again: > if (((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) && > (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) { > if (((so->so_options & SO_LINGER) && (so->so_linger == 0)) || > - (so->so_rcv.sb_cc > 0)) { > + (so->so_rcv.sb_ccc > 0)) { > #ifdef SCTP_LOG_CLOSING > sctp_log_closing(inp, NULL, 13); > #endif > @@ -751,7 +751,7 @@ sctp_disconnect(struct socket *so) > } > if (((so->so_options & SO_LINGER) && > (so->so_linger == 0)) || > - (so->so_rcv.sb_cc > 0)) { > + (so->so_rcv.sb_ccc > 0)) { > if (SCTP_GET_STATE(asoc) != > SCTP_STATE_COOKIE_WAIT) { > /* Left with Data unread */ > @@ -916,7 +916,7 @@ sctp_flush(struct socket *so, int how) > inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_CANT_READ; > SCTP_INP_READ_UNLOCK(inp); > SCTP_INP_WUNLOCK(inp); > - so->so_rcv.sb_cc = 0; > + so->so_rcv.sb_ccc = 0; > so->so_rcv.sb_mbcnt = 0; > so->so_rcv.sb_mb = NULL; > } > @@ -925,7 +925,7 @@ sctp_flush(struct socket *so, int how) > * First make sure the sb will be happy, we don't use these > * except maybe the count > */ > - so->so_snd.sb_cc = 0; > + so->so_snd.sb_ccc = 0; > so->so_snd.sb_mbcnt = 0; > so->so_snd.sb_mb = NULL; > > > Modified: head/sys/netinet/sctp_var.h > ============================================================================== > --- head/sys/netinet/sctp_var.h Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_var.h Sun Nov 30 12:52:33 2014 (r275326) > @@ -82,9 +82,9 @@ extern struct pr_usrreqs sctp_usrreqs; > > #define sctp_maxspace(sb) (max((sb)->sb_hiwat,SCTP_MINIMAL_RWND)) > > -#define sctp_sbspace(asoc, sb) ((long) ((sctp_maxspace(sb) > (asoc)->sb_cc) ? (sctp_maxspace(sb) - (asoc)->sb_cc) : 0)) > +#define sctp_sbspace(asoc, sb) ((long) ((sctp_maxspace(sb) > (asoc)->sb_ccc) ? (sctp_maxspace(sb) - (asoc)->sb_ccc) : 0)) > > -#define sctp_sbspace_failedmsgs(sb) ((long) ((sctp_maxspace(sb) > (sb)->sb_cc) ? (sctp_maxspace(sb) - (sb)->sb_cc) : 0)) > +#define sctp_sbspace_failedmsgs(sb) ((long) ((sctp_maxspace(sb) > (sb)->sb_ccc) ? (sctp_maxspace(sb) - (sb)->sb_ccc) : 0)) > > #define sctp_sbspace_sub(a,b) ((a > b) ? (a - b) : 0) > > @@ -195,10 +195,10 @@ extern struct pr_usrreqs sctp_usrreqs; > } > > #define sctp_sbfree(ctl, stcb, sb, m) { \ > - SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_cc, SCTP_BUF_LEN((m))); \ > + SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_ccc, SCTP_BUF_LEN((m))); \ > SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_mbcnt, MSIZE); \ > if (((ctl)->do_not_ref_stcb == 0) && stcb) {\ > - SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.sb_cc, SCTP_BUF_LEN((m))); \ > + SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.sb_ccc, SCTP_BUF_LEN((m))); \ > SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.my_rwnd_control_len, MSIZE); \ > } \ > if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \ > @@ -207,10 +207,10 @@ extern struct pr_usrreqs sctp_usrreqs; > } > > #define sctp_sballoc(stcb, sb, m) { \ > - atomic_add_int(&(sb)->sb_cc,SCTP_BUF_LEN((m))); \ > + atomic_add_int(&(sb)->sb_ccc,SCTP_BUF_LEN((m))); \ > atomic_add_int(&(sb)->sb_mbcnt, MSIZE); \ > if (stcb) { \ > - atomic_add_int(&(stcb)->asoc.sb_cc,SCTP_BUF_LEN((m))); \ > + atomic_add_int(&(stcb)->asoc.sb_ccc,SCTP_BUF_LEN((m))); \ > atomic_add_int(&(stcb)->asoc.my_rwnd_control_len, MSIZE); \ > } \ > if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \ > > Modified: head/sys/netinet/sctputil.c > ============================================================================== > --- head/sys/netinet/sctputil.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctputil.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -67,9 +67,9 @@ sctp_sblog(struct sockbuf *sb, struct sc > struct sctp_cwnd_log sctp_clog; > > sctp_clog.x.sb.stcb = stcb; > - sctp_clog.x.sb.so_sbcc = sb->sb_cc; > + sctp_clog.x.sb.so_sbcc = sb->sb_ccc; > if (stcb) > - sctp_clog.x.sb.stcb_sbcc = stcb->asoc.sb_cc; > + sctp_clog.x.sb.stcb_sbcc = stcb->asoc.sb_ccc; > else > sctp_clog.x.sb.stcb_sbcc = 0; > sctp_clog.x.sb.incr = incr; > @@ -4363,7 +4363,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp > { > /* > * Here we must place the control on the end of the socket read > - * queue AND increment sb_cc so that select will work properly on > + * queue AND increment sb_ccc so that select will work properly on > * read. > */ > struct mbuf *m, *prev = NULL; > @@ -4489,7 +4489,7 @@ sctp_append_to_readq(struct sctp_inpcb * > * the reassembly queue. > * > * If PDAPI this means we need to add m to the end of the data. > - * Increase the length in the control AND increment the sb_cc. > + * Increase the length in the control AND increment the sb_ccc. > * Otherwise sb is NULL and all we need to do is put it at the end > * of the mbuf chain. > */ > @@ -4701,10 +4701,10 @@ sctp_free_bufspace(struct sctp_tcb *stcb > > if (stcb->sctp_socket && (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) || > ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)))) { > - if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { > - stcb->sctp_socket->so_snd.sb_cc -= tp1->book_size; > + if (stcb->sctp_socket->so_snd.sb_ccc >= tp1->book_size) { > + stcb->sctp_socket->so_snd.sb_ccc -= tp1->book_size; > } else { > - stcb->sctp_socket->so_snd.sb_cc = 0; > + stcb->sctp_socket->so_snd.sb_ccc = 0; > > } > } > @@ -5254,11 +5254,11 @@ sctp_sorecvmsg(struct socket *so, > in_eeor_mode = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR); > if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RECV_RWND_LOGGING_ENABLE) { > sctp_misc_ints(SCTP_SORECV_ENTER, > - rwnd_req, in_eeor_mode, so->so_rcv.sb_cc, uio->uio_resid); > + rwnd_req, in_eeor_mode, so->so_rcv.sb_ccc, uio->uio_resid); > } > if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RECV_RWND_LOGGING_ENABLE) { > sctp_misc_ints(SCTP_SORECV_ENTERPL, > - rwnd_req, block_allowed, so->so_rcv.sb_cc, uio->uio_resid); > + rwnd_req, block_allowed, so->so_rcv.sb_ccc, uio->uio_resid); > } > error = sblock(&so->so_rcv, (block_allowed ? SBL_WAIT : 0)); > if (error) { > @@ -5277,23 +5277,23 @@ restart_nosblocks: > (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { > goto out; > } > - if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && (so->so_rcv.sb_cc == 0)) { > + if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && (so->so_rcv.sb_ccc == 0)) { > if (so->so_error) { > error = so->so_error; > if ((in_flags & MSG_PEEK) == 0) > so->so_error = 0; > goto out; > } else { > - if (so->so_rcv.sb_cc == 0) { > + if (so->so_rcv.sb_ccc == 0) { > /* indicate EOF */ > error = 0; > goto out; > } > } > } > - if ((so->so_rcv.sb_cc <= held_length) && block_allowed) { > + if ((so->so_rcv.sb_ccc <= held_length) && block_allowed) { > /* we need to wait for data */ > - if ((so->so_rcv.sb_cc == 0) && > + if ((so->so_rcv.sb_ccc == 0) && > ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || > (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { > if ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0) { > @@ -5329,7 +5329,7 @@ restart_nosblocks: > } > held_length = 0; > goto restart_nosblocks; > - } else if (so->so_rcv.sb_cc == 0) { > + } else if (so->so_rcv.sb_ccc == 0) { > if (so->so_error) { > error = so->so_error; > if ((in_flags & MSG_PEEK) == 0) > @@ -5386,11 +5386,11 @@ restart_nosblocks: > SCTP_INP_READ_LOCK(inp); > } > control = TAILQ_FIRST(&inp->read_queue); > - if ((control == NULL) && (so->so_rcv.sb_cc != 0)) { > + if ((control == NULL) && (so->so_rcv.sb_ccc != 0)) { > #ifdef INVARIANTS > panic("Huh, its non zero and nothing on control?"); > #endif > - so->so_rcv.sb_cc = 0; > + so->so_rcv.sb_ccc = 0; > } > SCTP_INP_READ_UNLOCK(inp); > hold_rlock = 0; > @@ -5511,11 +5511,11 @@ restart_nosblocks: > } > /* > * if we reach here, not suitable replacement is available > - * fragment interleave is NOT on. So stuff the sb_cc > + * fragment interleave is NOT on. So stuff the sb_ccc > * into the our held count, and its time to sleep again. > */ > - held_length = so->so_rcv.sb_cc; > - control->held_length = so->so_rcv.sb_cc; > + held_length = so->so_rcv.sb_ccc; > + control->held_length = so->so_rcv.sb_ccc; > goto restart; > } > /* Clear the held length since there is something to read */ > @@ -5812,10 +5812,10 @@ get_more_data: > if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { > sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, cp_len); > } > - atomic_subtract_int(&so->so_rcv.sb_cc, cp_len); > + atomic_subtract_int(&so->so_rcv.sb_ccc, cp_len); > if ((control->do_not_ref_stcb == 0) && > stcb) { > - atomic_subtract_int(&stcb->asoc.sb_cc, cp_len); > + atomic_subtract_int(&stcb->asoc.sb_ccc, cp_len); > } > copied_so_far += cp_len; > freed_so_far += cp_len; > @@ -5960,7 +5960,7 @@ wait_some_more: > (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_FRAG_INTERLEAVE))) { > goto release; > } > - if (so->so_rcv.sb_cc <= control->held_length) { > + if (so->so_rcv.sb_ccc <= control->held_length) { > error = sbwait(&so->so_rcv); > if (error) { > goto release; > @@ -5987,8 +5987,8 @@ wait_some_more: > } > goto done_with_control; > } > - if (so->so_rcv.sb_cc > held_length) { > - control->held_length = so->so_rcv.sb_cc; > + if (so->so_rcv.sb_ccc > held_length) { > + control->held_length = so->so_rcv.sb_ccc; > held_length = 0; > } > goto wait_some_more; > @@ -6135,13 +6135,13 @@ out: > freed_so_far, > ((uio) ? (slen - uio->uio_resid) : slen), > stcb->asoc.my_rwnd, > - so->so_rcv.sb_cc); > + so->so_rcv.sb_ccc); > } else { > sctp_misc_ints(SCTP_SORECV_DONE, > freed_so_far, > ((uio) ? (slen - uio->uio_resid) : slen), > 0, > - so->so_rcv.sb_cc); > + so->so_rcv.sb_ccc); > } > } > stage_left: > > Modified: head/sys/netinet/sctputil.h > ============================================================================== > --- head/sys/netinet/sctputil.h Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctputil.h Sun Nov 30 12:52:33 2014 (r275326) > @@ -286,10 +286,10 @@ do { \ > } \ > if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ > (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ > - if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { \ > - atomic_subtract_int(&((stcb)->sctp_socket->so_snd.sb_cc), tp1->book_size); \ > + if (stcb->sctp_socket->so_snd.sb_ccc >= tp1->book_size) { \ > + atomic_subtract_int(&((stcb)->sctp_socket->so_snd.sb_ccc), tp1->book_size); \ > } else { \ > - stcb->sctp_socket->so_snd.sb_cc = 0; \ > + stcb->sctp_socket->so_snd.sb_ccc = 0; \ > } \ > } \ > } \ > @@ -307,10 +307,10 @@ do { \ > } \ > if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ > (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ > - if (stcb->sctp_socket->so_snd.sb_cc >= sp->length) { \ > - atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc,sp->length); \ > + if (stcb->sctp_socket->so_snd.sb_ccc >= sp->length) { \ > + atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_ccc,sp->length); \ > } else { \ > - stcb->sctp_socket->so_snd.sb_cc = 0; \ > + stcb->sctp_socket->so_snd.sb_ccc = 0; \ > } \ > } \ > } \ > @@ -322,7 +322,7 @@ do { \ > if ((stcb->sctp_socket != NULL) && \ > ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ > (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ > - atomic_add_int(&stcb->sctp_socket->so_snd.sb_cc,sz); \ > + atomic_add_int(&stcb->sctp_socket->so_snd.sb_ccc,sz); \ > } \ > } while (0) > > > Modified: head/sys/sys/sockbuf.h > ============================================================================== > --- head/sys/sys/sockbuf.h Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/sys/sockbuf.h Sun Nov 30 12:52:33 2014 (r275326) > @@ -89,8 +89,10 @@ struct sockbuf { > struct mbuf *sb_lastrecord; /* (c/d) first mbuf of last > * record in socket buffer */ > struct mbuf *sb_sndptr; /* (c/d) pointer into mbuf chain */ > + struct mbuf *sb_fnrdy; /* (c/d) pointer to first not ready buffer */ > u_int sb_sndptroff; /* (c/d) byte offset of ptr into chain */ > - u_int sb_cc; /* (c/d) actual chars in buffer */ > + u_int sb_acc; /* (c/d) available chars in buffer */ > + u_int sb_ccc; /* (c/d) claimed chars in buffer */ > u_int sb_hiwat; /* (c/d) max actual char count */ > u_int sb_mbcnt; /* (c/d) chars of mbufs used */ > u_int sb_mcnt; /* (c/d) number of mbufs in buffer */ > @@ -120,6 +122,13 @@ struct sockbuf { > #define SOCKBUF_LOCK_ASSERT(_sb) mtx_assert(SOCKBUF_MTX(_sb), MA_OWNED) > #define SOCKBUF_UNLOCK_ASSERT(_sb) mtx_assert(SOCKBUF_MTX(_sb), MA_NOTOWNED) > > +/* > + * Socket buffer private mbuf(9) flags. > + */ > +#define M_NOTREADY M_PROTO1 /* m_data not populated yet */ > +#define M_BLOCKED M_PROTO2 /* M_NOTREADY in front of m */ > +#define M_NOTAVAIL (M_NOTREADY | M_BLOCKED) > + > void sbappend(struct sockbuf *sb, struct mbuf *m); > void sbappend_locked(struct sockbuf *sb, struct mbuf *m); > void sbappendstream(struct sockbuf *sb, struct mbuf *m); > @@ -165,10 +174,11 @@ int sblock(struct sockbuf *sb, int flags > void sbunlock(struct sockbuf *sb); > void sballoc(struct sockbuf *, struct mbuf *); > void sbfree(struct sockbuf *, struct mbuf *); > +int sbready(struct sockbuf *, struct mbuf *, int); > > /* > * Return how much data is available to be taken out of socket > - * bufffer right now. > + * buffer right now. > */ > static inline u_int > sbavail(struct sockbuf *sb) > @@ -177,7 +187,7 @@ sbavail(struct sockbuf *sb) > #if 0 > SOCKBUF_LOCK_ASSERT(sb); > #endif > - return (sb->sb_cc); > + return (sb->sb_acc); > } > > /* > @@ -191,27 +201,30 @@ sbused(struct sockbuf *sb) > #if 0 > SOCKBUF_LOCK_ASSERT(sb); > #endif > - return (sb->sb_cc); > + return (sb->sb_ccc); > } > > /* > * How much space is there in a socket buffer (so->so_snd or so->so_rcv)? > * This is problematical if the fields are unsigned, as the space might > - * still be negative (cc > hiwat or mbcnt > mbmax). Should detect > - * overflow and return 0. Should use "lmin" but it doesn't exist now. > + * still be negative (ccc > hiwat or mbcnt > mbmax). > */ > -static __inline > -long > +static inline long > sbspace(struct sockbuf *sb) > { > - long bleft; > - long mleft; > + long bleft, mleft; > + > +#if 0 > + SOCKBUF_LOCK_ASSERT(sb); > +#endif > > if (sb->sb_flags & SB_STOP) > return(0); > - bleft = sb->sb_hiwat - sb->sb_cc; > + > + bleft = sb->sb_hiwat - sb->sb_ccc; > mleft = sb->sb_mbmax - sb->sb_mbcnt; > - return((bleft < mleft) ? bleft : mleft); > + > + return ((bleft < mleft) ? bleft : mleft); > } > > #define SB_EMPTY_FIXUP(sb) do { \ > > Modified: head/usr.bin/bluetooth/btsockstat/btsockstat.c > ============================================================================== > --- head/usr.bin/bluetooth/btsockstat/btsockstat.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/usr.bin/bluetooth/btsockstat/btsockstat.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -255,8 +255,8 @@ hcirawpr(kvm_t *kvmd, u_long addr) > (unsigned long) pcb.so, > (unsigned long) this, > pcb.flags, > - so.so_rcv.sb_cc, > - so.so_snd.sb_cc, > + so.so_rcv.sb_ccc, > + so.so_snd.sb_ccc, > pcb.addr.hci_node); > } > } /* hcirawpr */ > @@ -303,8 +303,8 @@ l2caprawpr(kvm_t *kvmd, u_long addr) > "%-8lx %-8lx %6d %6d %-17.17s\n", > (unsigned long) pcb.so, > (unsigned long) this, > - so.so_rcv.sb_cc, > - so.so_snd.sb_cc, > + so.so_rcv.sb_ccc, > + so.so_snd.sb_ccc, > bdaddrpr(&pcb.src, NULL, 0)); > } > } /* l2caprawpr */ > @@ -361,8 +361,8 @@ l2cappr(kvm_t *kvmd, u_long addr) > fprintf(stdout, > "%-8lx %6d %6d %-17.17s/%-5d %-17.17s %-5d %s\n", > (unsigned long) this, > - so.so_rcv.sb_cc, > - so.so_snd.sb_cc, > + so.so_rcv.sb_ccc, > + so.so_snd.sb_ccc, > bdaddrpr(&pcb.src, local, sizeof(local)), > pcb.psm, > bdaddrpr(&pcb.dst, remote, sizeof(remote)), > @@ -467,8 +467,8 @@ rfcommpr(kvm_t *kvmd, u_long addr) > fprintf(stdout, > "%-8lx %6d %6d %-17.17s %-17.17s %-4d %-4d %s\n", > (unsigned long) this, > - so.so_rcv.sb_cc, > - so.so_snd.sb_cc, > + so.so_rcv.sb_ccc, > + so.so_snd.sb_ccc, > bdaddrpr(&pcb.src, local, sizeof(local)), > bdaddrpr(&pcb.dst, remote, sizeof(remote)), > pcb.channel, > > Modified: head/usr.bin/netstat/inet.c > ============================================================================== > --- head/usr.bin/netstat/inet.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/usr.bin/netstat/inet.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -137,7 +137,7 @@ pcblist_sysctl(int proto, const char *na > static void > sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb) > { > - xsb->sb_cc = sb->sb_cc; > + xsb->sb_cc = sb->sb_ccc; > xsb->sb_hiwat = sb->sb_hiwat; > xsb->sb_mbcnt = sb->sb_mbcnt; > xsb->sb_mcnt = sb->sb_mcnt; > @@ -479,7 +479,8 @@ protopr(u_long off, const char *name, in > printf("%6u %6u %6u ", tp->t_sndrexmitpack, > tp->t_rcvoopack, tp->t_sndzerowin); > } else { > - printf("%6u %6u ", so->so_rcv.sb_cc, so->so_snd.sb_cc); > + printf("%6u %6u ", > + so->so_rcv.sb_cc, so->so_snd.sb_cc); > } > if (numeric_port) { > if (inp->inp_vflag & INP_IPV4) { > > Modified: head/usr.bin/netstat/netgraph.c > ============================================================================== > --- head/usr.bin/netstat/netgraph.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/usr.bin/netstat/netgraph.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -119,7 +119,7 @@ netgraphprotopr(u_long off, const char * > if (Aflag) > printf("%8lx ", (u_long) this); > printf("%-5.5s %6u %6u ", > - name, sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc); > + name, sockb.so_rcv.sb_ccc, sockb.so_snd.sb_ccc); > > /* Get info on associated node */ > if (ngpcb.node_id == 0 || csock == -1) > > Modified: head/usr.bin/netstat/unix.c > ============================================================================== > --- head/usr.bin/netstat/unix.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/usr.bin/netstat/unix.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -287,7 +287,8 @@ unixdomainpr(struct xunpcb *xunp, struct > } else { > printf("%8lx %-6.6s %6u %6u %8lx %8lx %8lx %8lx", > (long)so->so_pcb, socktype[so->so_type], so->so_rcv.sb_cc, > - so->so_snd.sb_cc, (long)unp->unp_vnode, (long)unp->unp_conn, > + so->so_snd.sb_cc, (long)unp->unp_vnode, > + (long)unp->unp_conn, > (long)LIST_FIRST(&unp->unp_refs), > (long)LIST_NEXT(unp, unp_reflink)); > } > > Modified: head/usr.bin/systat/netstat.c > ============================================================================== > --- head/usr.bin/systat/netstat.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/usr.bin/systat/netstat.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -333,8 +333,8 @@ enter_kvm(struct inpcb *inp, struct sock > struct netinfo *p; > > if ((p = enter(inp, state, proto)) != NULL) { > - p->ni_rcvcc = so->so_rcv.sb_cc; > - p->ni_sndcc = so->so_snd.sb_cc; > + p->ni_rcvcc = so->so_rcv.sb_ccc; > + p->ni_sndcc = so->so_snd.sb_ccc; > } > } > > From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 18:11:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CE65C16C; Sun, 30 Nov 2014 18:11:05 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id B6125F25; Sun, 30 Nov 2014 18:11:05 +0000 (UTC) Received: from AlfredMacbookAir.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id 5B8DA341F84E; Sun, 30 Nov 2014 10:11:04 -0800 (PST) Message-ID: <547B5DB1.2030003@freebsd.org> Date: Sun, 30 Nov 2014 10:10:57 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Adrian Chadd , Gleb Smirnoff Subject: Re: svn commit: r275326 - in head: sys/dev/cxgbe/tom sys/kern sys/netinet sys/sys usr.bin/bluetooth/btsockstat usr.bin/netstat usr.bin/systat References: <201411301252.sAUCqYXm055601@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 18:11:05 -0000 Agree, this was already discussed as quite possibly an incorrect way forward some months ago. Where is the actual review for this huge change to the networking stack? Splitting this into the mbuf layer adds a huge level of complexity where again, there are already completion paths in the socket layer to do this. I am completely confused as to why this couldn't just be done with the socket callback system already in place. Very open to being educated on this! The concept of "not filled mbufs" in a socket buffer seems absolutely wrong at a glance, I'm sure with some better explanation this would all make sense, but really am still not convinced this is at all the right way to go on this. Does any other OS do this for any reason? Or is this just a short sighted hack for an experiment in sendfile? I am really trying very hard to rationalize this change, so I will ask, is there something about keeping TCP windows open that you are hoping to accomplish that you can not otherwise do without sb_ccc and sb_acc? If not then why is all this stuff being stuffed into mbufs as opposed to using callbacks? It really seems wrong, my thoughts are "this is like kse for mbufs" something done with good intentions, but is complex and will have to be ripped out later. Am I wrong here? -Alfred On 11/30/14, 9:55 AM, Adrian Chadd wrote: > Hi, > > I really wished that these commits got individual reviews before they went in. > > The whole idea of an mbuf whose data isn't quite there yet makes > debugging issues rather amusing, as now you may have VM issues to > debug at the same time as you're debugging network related stuff. > > I really think this could've been done without all the back-handed VM > work. The mbufs and IO buffers both have completion function calls; it > would've been much less intrusive to do it that way. > > > > -adrian > > > On 30 November 2014 at 04:52, Gleb Smirnoff wrote: >> Author: glebius >> Date: Sun Nov 30 12:52:33 2014 >> New Revision: 275326 >> URL: https://svnweb.freebsd.org/changeset/base/275326 >> >> Log: >> Merge from projects/sendfile: >> >> o Introduce a notion of "not ready" mbufs in socket buffers. These >> mbufs are now being populated by some I/O in background and are >> referenced outside. This forces following implications: >> - An mbuf which is "not ready" can't be taken out of the buffer. >> - An mbuf that is behind a "not ready" in the queue neither. >> - If sockbet buffer is flushed, then "not ready" mbufs shouln't be >> freed. >> >> o In struct sockbuf the sb_cc field is split into sb_ccc and sb_acc. >> The sb_ccc stands for ""claimed character count", or "committed >> character count". And the sb_acc is "available character count". >> Consumers of socket buffer API shouldn't already access them directly, >> but use sbused() and sbavail() respectively. >> o Not ready mbufs are marked with M_NOTREADY, and ready but blocked ones >> with M_BLOCKED. >> o New field sb_fnrdy points to the first not ready mbuf, to avoid linear >> search. >> o New function sbready() is provided to activate certain amount of mbufs >> in a socket buffer. >> >> A special note on SCTP: >> SCTP has its own sockbufs. Unfortunately, FreeBSD stack doesn't yet >> allow protocol specific sockbufs. Thus, SCTP does some hacks to make >> itself compatible with FreeBSD: it manages sockbufs on its own, but keeps >> sb_cc updated to inform the stack of amount of data in them. The new >> notion of "not ready" data isn't supported by SCTP. Instead, only a >> mechanical substitute is done: s/sb_cc/sb_ccc/. >> A proper solution would be to take away struct sockbuf from struct >> socket and allow protocols to implement their own socket buffers, like >> SCTP already does. This was discussed with rrs@. >> >> Sponsored by: Netflix >> Sponsored by: Nginx, Inc. >> >> Modified: >> head/sys/dev/cxgbe/tom/t4_ddp.c >> head/sys/kern/uipc_debug.c >> head/sys/kern/uipc_sockbuf.c >> head/sys/kern/uipc_socket.c >> head/sys/netinet/sctp_indata.c >> head/sys/netinet/sctp_input.c >> head/sys/netinet/sctp_os_bsd.h >> head/sys/netinet/sctp_output.c >> head/sys/netinet/sctp_pcb.c >> head/sys/netinet/sctp_pcb.h >> head/sys/netinet/sctp_structs.h >> head/sys/netinet/sctp_usrreq.c >> head/sys/netinet/sctp_var.h >> head/sys/netinet/sctputil.c >> head/sys/netinet/sctputil.h >> head/sys/sys/sockbuf.h >> head/usr.bin/bluetooth/btsockstat/btsockstat.c >> head/usr.bin/netstat/inet.c >> head/usr.bin/netstat/netgraph.c >> head/usr.bin/netstat/unix.c >> head/usr.bin/systat/netstat.c >> >> Modified: head/sys/dev/cxgbe/tom/t4_ddp.c >> ============================================================================== >> --- head/sys/dev/cxgbe/tom/t4_ddp.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/dev/cxgbe/tom/t4_ddp.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -971,8 +971,9 @@ handle_ddp(struct socket *so, struct uio >> */ >> rc = sbwait(sb); >> while (toep->ddp_flags & buf_flag) { >> + /* XXXGL: shouldn't here be sbwait() call? */ >> sb->sb_flags |= SB_WAIT; >> - msleep(&sb->sb_cc, &sb->sb_mtx, PSOCK , "sbwait", 0); >> + msleep(&sb->sb_acc, &sb->sb_mtx, PSOCK , "sbwait", 0); >> } >> unwire_ddp_buffer(db); >> return (rc); >> >> Modified: head/sys/kern/uipc_debug.c >> ============================================================================== >> --- head/sys/kern/uipc_debug.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/kern/uipc_debug.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -401,7 +401,8 @@ db_print_sockbuf(struct sockbuf *sb, con >> db_printf("sb_sndptroff: %u\n", sb->sb_sndptroff); >> >> db_print_indent(indent); >> - db_printf("sb_cc: %u ", sb->sb_cc); >> + db_printf("sb_acc: %u ", sb->sb_acc); >> + db_printf("sb_ccc: %u ", sb->sb_ccc); >> db_printf("sb_hiwat: %u ", sb->sb_hiwat); >> db_printf("sb_mbcnt: %u ", sb->sb_mbcnt); >> db_printf("sb_mbmax: %u\n", sb->sb_mbmax); >> >> Modified: head/sys/kern/uipc_sockbuf.c >> ============================================================================== >> --- head/sys/kern/uipc_sockbuf.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/kern/uipc_sockbuf.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -69,6 +69,43 @@ static struct mbuf *sbcut_internal(struc >> static void sbflush_internal(struct sockbuf *sb); >> >> /* >> + * Mark ready "count" mbufs starting with "m". >> + */ >> +int >> +sbready(struct sockbuf *sb, struct mbuf *m, int count) >> +{ >> + u_int blocker; >> + >> + SOCKBUF_LOCK_ASSERT(sb); >> + KASSERT(sb->sb_fnrdy != NULL, ("%s: sb %p NULL fnrdy", __func__, sb)); >> + >> + blocker = (sb->sb_fnrdy == m) ? M_BLOCKED : 0; >> + >> + for (int i = 0; i < count; i++, m = m->m_next) { >> + KASSERT(m->m_flags & M_NOTREADY, >> + ("%s: m %p !M_NOTREADY", __func__, m)); >> + m->m_flags &= ~(M_NOTREADY | blocker); >> + if (blocker) >> + sb->sb_acc += m->m_len; >> + } >> + >> + if (!blocker) >> + return (EINPROGRESS); >> + >> + /* This one was blocking all the queue. */ >> + for (; m && (m->m_flags & M_NOTREADY) == 0; m = m->m_next) { >> + KASSERT(m->m_flags & M_BLOCKED, >> + ("%s: m %p !M_BLOCKED", __func__, m)); >> + m->m_flags &= ~M_BLOCKED; >> + sb->sb_acc += m->m_len; >> + } >> + >> + sb->sb_fnrdy = m; >> + >> + return (0); >> +} >> + >> +/* >> * Adjust sockbuf state reflecting allocation of m. >> */ >> void >> @@ -77,7 +114,15 @@ sballoc(struct sockbuf *sb, struct mbuf >> >> SOCKBUF_LOCK_ASSERT(sb); >> >> - sb->sb_cc += m->m_len; >> + sb->sb_ccc += m->m_len; >> + >> + if (sb->sb_fnrdy == NULL) { >> + if (m->m_flags & M_NOTREADY) >> + sb->sb_fnrdy = m; >> + else >> + sb->sb_acc += m->m_len; >> + } else >> + m->m_flags |= M_BLOCKED; >> >> if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) >> sb->sb_ctl += m->m_len; >> @@ -102,7 +147,25 @@ sbfree(struct sockbuf *sb, struct mbuf * >> SOCKBUF_LOCK_ASSERT(sb); >> #endif >> >> - sb->sb_cc -= m->m_len; >> + sb->sb_ccc -= m->m_len; >> + >> + if (!(m->m_flags & M_NOTAVAIL)) >> + sb->sb_acc -= m->m_len; >> + >> + if (m == sb->sb_fnrdy) { >> + struct mbuf *n; >> + >> + KASSERT(m->m_flags & M_NOTREADY, >> + ("%s: m %p !M_NOTREADY", __func__, m)); >> + >> + n = m->m_next; >> + while (n != NULL && !(n->m_flags & M_NOTREADY)) { >> + n->m_flags &= ~M_BLOCKED; >> + sb->sb_acc += n->m_len; >> + n = n->m_next; >> + } >> + sb->sb_fnrdy = n; >> + } >> >> if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) >> sb->sb_ctl -= m->m_len; >> @@ -181,7 +244,7 @@ sbwait(struct sockbuf *sb) >> SOCKBUF_LOCK_ASSERT(sb); >> >> sb->sb_flags |= SB_WAIT; >> - return (msleep_sbt(&sb->sb_cc, &sb->sb_mtx, >> + return (msleep_sbt(&sb->sb_acc, &sb->sb_mtx, >> (sb->sb_flags & SB_NOINTR) ? PSOCK : PSOCK | PCATCH, "sbwait", >> sb->sb_timeo, 0, 0)); >> } >> @@ -238,7 +301,7 @@ sowakeup(struct socket *so, struct sockb >> sb->sb_flags &= ~SB_SEL; >> if (sb->sb_flags & SB_WAIT) { >> sb->sb_flags &= ~SB_WAIT; >> - wakeup(&sb->sb_cc); >> + wakeup(&sb->sb_acc); >> } >> KNOTE_LOCKED(&sb->sb_sel.si_note, 0); >> if (sb->sb_upcall != NULL) { >> @@ -609,12 +672,13 @@ sbappendstream(struct sockbuf *sb, struc >> void >> sbcheck(struct sockbuf *sb, const char *file, int line) >> { >> - struct mbuf *m, *n; >> - u_long cc, mbcnt; >> + struct mbuf *m, *n, *fnrdy; >> + u_long acc, ccc, mbcnt; >> >> SOCKBUF_LOCK_ASSERT(sb); >> >> - cc = mbcnt = 0; >> + acc = ccc = mbcnt = 0; >> + fnrdy = NULL; >> >> for (m = sb->sb_mb; m; m = n) { >> n = m->m_nextpkt; >> @@ -623,15 +687,31 @@ sbcheck(struct sockbuf *sb, const char * >> printf("sb %p empty mbuf %p\n", sb, m); >> goto fail; >> } >> - cc += m->m_len; >> + if ((m->m_flags & M_NOTREADY) && fnrdy == NULL) { >> + if (m != sb->sb_fnrdy) { >> + printf("sb %p: fnrdy %p != m %p\n", >> + sb, sb->sb_fnrdy, m); >> + goto fail; >> + } >> + fnrdy = m; >> + } >> + if (fnrdy) { >> + if (!(m->m_flags & M_NOTAVAIL)) { >> + printf("sb %p: fnrdy %p, m %p is avail\n", >> + sb, sb->sb_fnrdy, m); >> + goto fail; >> + } >> + } else >> + acc += m->m_len; >> + ccc += m->m_len; >> mbcnt += MSIZE; >> if (m->m_flags & M_EXT) /*XXX*/ /* pretty sure this is bogus */ >> mbcnt += m->m_ext.ext_size; >> } >> } >> - if (cc != sb->sb_cc || mbcnt != sb->sb_mbcnt) { >> - printf("cc %ld != %u || mbcnt %ld != %u\n", cc, sb->sb_cc, >> - mbcnt, sb->sb_mbcnt); >> + if (acc != sb->sb_acc || ccc != sb->sb_ccc || mbcnt != sb->sb_mbcnt) { >> + printf("acc %ld/%u ccc %ld/%u mbcnt %ld/%u\n", >> + acc, sb->sb_acc, ccc, sb->sb_ccc, mbcnt, sb->sb_mbcnt); >> goto fail; >> } >> return; >> @@ -832,8 +912,8 @@ sbappendcontrol(struct sockbuf *sb, stru >> * >> * (2) The mbuf may be coalesced -- i.e., data in the mbuf may be copied into >> * an mbuf already in the socket buffer. This can occur if an >> - * appropriate mbuf exists, there is room, and no merging of data types >> - * will occur. >> + * appropriate mbuf exists, there is room, both mbufs are not marked as >> + * not ready, and no merging of data types will occur. >> * >> * (3) The mbuf may be appended to the end of the existing mbuf chain. >> * >> @@ -862,13 +942,17 @@ sbcompress(struct sockbuf *sb, struct mb >> if (n && (n->m_flags & M_EOR) == 0 && >> M_WRITABLE(n) && >> ((sb->sb_flags & SB_NOCOALESCE) == 0) && >> + !(m->m_flags & M_NOTREADY) && >> + !(n->m_flags & M_NOTREADY) && >> m->m_len <= MCLBYTES / 4 && /* XXX: Don't copy too much */ >> m->m_len <= M_TRAILINGSPACE(n) && >> n->m_type == m->m_type) { >> bcopy(mtod(m, caddr_t), mtod(n, caddr_t) + n->m_len, >> (unsigned)m->m_len); >> n->m_len += m->m_len; >> - sb->sb_cc += m->m_len; >> + sb->sb_ccc += m->m_len; >> + if (sb->sb_fnrdy == NULL) >> + sb->sb_acc += m->m_len; >> if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) >> /* XXX: Probably don't need.*/ >> sb->sb_ctl += m->m_len; >> @@ -905,13 +989,13 @@ sbflush_internal(struct sockbuf *sb) >> * Don't call sbcut(sb, 0) if the leading mbuf is non-empty: >> * we would loop forever. Panic instead. >> */ >> - if (!sb->sb_cc && (sb->sb_mb == NULL || sb->sb_mb->m_len)) >> + if (sb->sb_ccc == 0 && (sb->sb_mb == NULL || sb->sb_mb->m_len)) >> break; >> - m_freem(sbcut_internal(sb, (int)sb->sb_cc)); >> + m_freem(sbcut_internal(sb, (int)sb->sb_ccc)); >> } >> - if (sb->sb_cc || sb->sb_mb || sb->sb_mbcnt) >> - panic("sbflush_internal: cc %u || mb %p || mbcnt %u", >> - sb->sb_cc, (void *)sb->sb_mb, sb->sb_mbcnt); >> + KASSERT(sb->sb_ccc == 0 && sb->sb_mb == 0 && sb->sb_mbcnt == 0, >> + ("%s: ccc %u mb %p mbcnt %u", __func__, >> + sb->sb_ccc, (void *)sb->sb_mb, sb->sb_mbcnt)); >> } >> >> void >> @@ -937,7 +1021,7 @@ sbflush(struct sockbuf *sb) >> static struct mbuf * >> sbcut_internal(struct sockbuf *sb, int len) >> { >> - struct mbuf *m, *n, *next, *mfree; >> + struct mbuf *m, *next, *mfree; >> >> next = (m = sb->sb_mb) ? m->m_nextpkt : 0; >> mfree = NULL; >> @@ -949,9 +1033,12 @@ sbcut_internal(struct sockbuf *sb, int l >> next = m->m_nextpkt; >> } >> if (m->m_len > len) { >> + KASSERT(!(m->m_flags & M_NOTAVAIL), >> + ("%s: m %p M_NOTAVAIL", __func__, m)); >> m->m_len -= len; >> m->m_data += len; >> - sb->sb_cc -= len; >> + sb->sb_ccc -= len; >> + sb->sb_acc -= len; >> if (sb->sb_sndptroff != 0) >> sb->sb_sndptroff -= len; >> if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) >> @@ -960,10 +1047,20 @@ sbcut_internal(struct sockbuf *sb, int l >> } >> len -= m->m_len; >> sbfree(sb, m); >> - n = m->m_next; >> - m->m_next = mfree; >> - mfree = m; >> - m = n; >> + /* >> + * Do not put M_NOTREADY buffers to the free list, they >> + * are referenced from outside. >> + */ >> + if (m->m_flags & M_NOTREADY) >> + m = m->m_next; >> + else { >> + struct mbuf *n; >> + >> + n = m->m_next; >> + m->m_next = mfree; >> + mfree = m; >> + m = n; >> + } >> } >> if (m) { >> sb->sb_mb = m; >> @@ -1030,8 +1127,8 @@ sbsndptr(struct sockbuf *sb, u_int off, >> struct mbuf *m, *ret; >> >> KASSERT(sb->sb_mb != NULL, ("%s: sb_mb is NULL", __func__)); >> - KASSERT(off + len <= sb->sb_cc, ("%s: beyond sb", __func__)); >> - KASSERT(sb->sb_sndptroff <= sb->sb_cc, ("%s: sndptroff broken", __func__)); >> + KASSERT(off + len <= sb->sb_acc, ("%s: beyond sb", __func__)); >> + KASSERT(sb->sb_sndptroff <= sb->sb_acc, ("%s: sndptroff broken", __func__)); >> >> /* >> * Is off below stored offset? Happens on retransmits. >> @@ -1180,7 +1277,7 @@ void >> sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb) >> { >> >> - xsb->sb_cc = sb->sb_cc; >> + xsb->sb_cc = sb->sb_ccc; >> xsb->sb_hiwat = sb->sb_hiwat; >> xsb->sb_mbcnt = sb->sb_mbcnt; >> xsb->sb_mcnt = sb->sb_mcnt; >> >> Modified: head/sys/kern/uipc_socket.c >> ============================================================================== >> --- head/sys/kern/uipc_socket.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/kern/uipc_socket.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -1706,7 +1706,8 @@ dontblock: >> */ >> moff = 0; >> offset = 0; >> - while (m != NULL && uio->uio_resid > 0 && error == 0) { >> + while (m != NULL && !(m->m_flags & M_NOTAVAIL) && uio->uio_resid > 0 >> + && error == 0) { >> /* >> * If the type of mbuf has changed since the last mbuf >> * examined ('type'), end the receive operation. >> @@ -2044,6 +2045,8 @@ deliver: >> for (m = sb->sb_mb; >> m != NULL && m->m_len <= len; >> m = m->m_next) { >> + KASSERT(!(m->m_flags & M_NOTAVAIL), >> + ("%s: m %p not available", __func__, m)); >> len -= m->m_len; >> uio->uio_resid -= m->m_len; >> sbfree(sb, m); >> >> Modified: head/sys/netinet/sctp_indata.c >> ============================================================================== >> --- head/sys/netinet/sctp_indata.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/netinet/sctp_indata.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -70,14 +70,14 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, st >> >> /* >> * This is really set wrong with respect to a 1-2-m socket. Since >> - * the sb_cc is the count that everyone as put up. When we re-write >> + * the sb_ccc is the count that everyone as put up. When we re-write >> * sctp_soreceive then we will fix this so that ONLY this >> * associations data is taken into account. >> */ >> if (stcb->sctp_socket == NULL) >> return (calc); >> >> - if (stcb->asoc.sb_cc == 0 && >> + if (stcb->asoc.sb_ccc == 0 && >> asoc->size_on_reasm_queue == 0 && >> asoc->size_on_all_streams == 0) { >> /* Full rwnd granted */ >> @@ -1363,7 +1363,7 @@ sctp_process_a_data_chunk(struct sctp_tc >> * When we have NO room in the rwnd we check to make sure >> * the reader is doing its job... >> */ >> - if (stcb->sctp_socket->so_rcv.sb_cc) { >> + if (stcb->sctp_socket->so_rcv.sb_ccc) { >> /* some to read, wake-up */ >> #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) >> struct socket *so; >> >> Modified: head/sys/netinet/sctp_input.c >> ============================================================================== >> --- head/sys/netinet/sctp_input.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/netinet/sctp_input.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -1032,7 +1032,7 @@ sctp_handle_shutdown_ack(struct sctp_shu >> if (stcb->sctp_socket) { >> if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || >> (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { >> - stcb->sctp_socket->so_snd.sb_cc = 0; >> + stcb->sctp_socket->so_snd.sb_ccc = 0; >> } >> sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); >> } >> >> Modified: head/sys/netinet/sctp_os_bsd.h >> ============================================================================== >> --- head/sys/netinet/sctp_os_bsd.h Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/netinet/sctp_os_bsd.h Sun Nov 30 12:52:33 2014 (r275326) >> @@ -399,7 +399,7 @@ typedef struct callout sctp_os_timer_t; >> #define SCTP_SOWAKEUP(so) wakeup(&(so)->so_timeo) >> /* clear the socket buffer state */ >> #define SCTP_SB_CLEAR(sb) \ >> - (sb).sb_cc = 0; \ >> + (sb).sb_ccc = 0; \ >> (sb).sb_mb = NULL; \ >> (sb).sb_mbcnt = 0; >> >> >> Modified: head/sys/netinet/sctp_output.c >> ============================================================================== >> --- head/sys/netinet/sctp_output.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/netinet/sctp_output.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -7250,7 +7250,7 @@ one_more_time: >> if ((stcb->sctp_socket != NULL) && \ >> ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || >> (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { >> - atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc, sp->length); >> + atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_ccc, sp->length); >> } >> if (sp->data) { >> sctp_m_freem(sp->data); >> @@ -11532,7 +11532,7 @@ jump_out: >> drp->current_onq = htonl(asoc->size_on_reasm_queue + >> asoc->size_on_all_streams + >> asoc->my_rwnd_control_len + >> - stcb->sctp_socket->so_rcv.sb_cc); >> + stcb->sctp_socket->so_rcv.sb_ccc); >> } else { >> /*- >> * If my rwnd is 0, possibly from mbuf depletion as well as >> >> Modified: head/sys/netinet/sctp_pcb.c >> ============================================================================== >> --- head/sys/netinet/sctp_pcb.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/netinet/sctp_pcb.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -3397,7 +3397,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, >> if ((asoc->asoc.size_on_reasm_queue > 0) || >> (asoc->asoc.control_pdapi) || >> (asoc->asoc.size_on_all_streams > 0) || >> - (so && (so->so_rcv.sb_cc > 0))) { >> + (so && (so->so_rcv.sb_ccc > 0))) { >> /* Left with Data unread */ >> struct mbuf *op_err; >> >> @@ -3625,7 +3625,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, >> TAILQ_REMOVE(&inp->read_queue, sq, next); >> sctp_free_remote_addr(sq->whoFrom); >> if (so) >> - so->so_rcv.sb_cc -= sq->length; >> + so->so_rcv.sb_ccc -= sq->length; >> if (sq->data) { >> sctp_m_freem(sq->data); >> sq->data = NULL; >> @@ -4853,7 +4853,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, >> inp->sctp_flags |= SCTP_PCB_FLAGS_WAS_CONNECTED; >> if (so) { >> SOCK_LOCK(so); >> - if (so->so_rcv.sb_cc == 0) { >> + if (so->so_rcv.sb_ccc == 0) { >> so->so_state &= ~(SS_ISCONNECTING | >> SS_ISDISCONNECTING | >> SS_ISCONFIRMING | >> >> Modified: head/sys/netinet/sctp_pcb.h >> ============================================================================== >> --- head/sys/netinet/sctp_pcb.h Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/netinet/sctp_pcb.h Sun Nov 30 12:52:33 2014 (r275326) >> @@ -369,7 +369,7 @@ struct sctp_inpcb { >> } ip_inp; >> >> >> - /* Socket buffer lock protects read_queue and of course sb_cc */ >> + /* Socket buffer lock protects read_queue and of course sb_ccc */ >> struct sctp_readhead read_queue; >> >> LIST_ENTRY(sctp_inpcb) sctp_list; /* lists all endpoints */ >> >> Modified: head/sys/netinet/sctp_structs.h >> ============================================================================== >> --- head/sys/netinet/sctp_structs.h Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/netinet/sctp_structs.h Sun Nov 30 12:52:33 2014 (r275326) >> @@ -990,7 +990,7 @@ struct sctp_association { >> >> uint32_t total_output_queue_size; >> >> - uint32_t sb_cc; /* shadow of sb_cc */ >> + uint32_t sb_ccc; /* shadow of sb_ccc */ >> uint32_t sb_send_resv; /* amount reserved on a send */ >> uint32_t my_rwnd_control_len; /* shadow of sb_mbcnt used for rwnd >> * control */ >> >> Modified: head/sys/netinet/sctp_usrreq.c >> ============================================================================== >> --- head/sys/netinet/sctp_usrreq.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/netinet/sctp_usrreq.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -586,7 +586,7 @@ sctp_must_try_again: >> if (((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) && >> (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) { >> if (((so->so_options & SO_LINGER) && (so->so_linger == 0)) || >> - (so->so_rcv.sb_cc > 0)) { >> + (so->so_rcv.sb_ccc > 0)) { >> #ifdef SCTP_LOG_CLOSING >> sctp_log_closing(inp, NULL, 13); >> #endif >> @@ -751,7 +751,7 @@ sctp_disconnect(struct socket *so) >> } >> if (((so->so_options & SO_LINGER) && >> (so->so_linger == 0)) || >> - (so->so_rcv.sb_cc > 0)) { >> + (so->so_rcv.sb_ccc > 0)) { >> if (SCTP_GET_STATE(asoc) != >> SCTP_STATE_COOKIE_WAIT) { >> /* Left with Data unread */ >> @@ -916,7 +916,7 @@ sctp_flush(struct socket *so, int how) >> inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_CANT_READ; >> SCTP_INP_READ_UNLOCK(inp); >> SCTP_INP_WUNLOCK(inp); >> - so->so_rcv.sb_cc = 0; >> + so->so_rcv.sb_ccc = 0; >> so->so_rcv.sb_mbcnt = 0; >> so->so_rcv.sb_mb = NULL; >> } >> @@ -925,7 +925,7 @@ sctp_flush(struct socket *so, int how) >> * First make sure the sb will be happy, we don't use these >> * except maybe the count >> */ >> - so->so_snd.sb_cc = 0; >> + so->so_snd.sb_ccc = 0; >> so->so_snd.sb_mbcnt = 0; >> so->so_snd.sb_mb = NULL; >> >> >> Modified: head/sys/netinet/sctp_var.h >> ============================================================================== >> --- head/sys/netinet/sctp_var.h Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/netinet/sctp_var.h Sun Nov 30 12:52:33 2014 (r275326) >> @@ -82,9 +82,9 @@ extern struct pr_usrreqs sctp_usrreqs; >> >> #define sctp_maxspace(sb) (max((sb)->sb_hiwat,SCTP_MINIMAL_RWND)) >> >> -#define sctp_sbspace(asoc, sb) ((long) ((sctp_maxspace(sb) > (asoc)->sb_cc) ? (sctp_maxspace(sb) - (asoc)->sb_cc) : 0)) >> +#define sctp_sbspace(asoc, sb) ((long) ((sctp_maxspace(sb) > (asoc)->sb_ccc) ? (sctp_maxspace(sb) - (asoc)->sb_ccc) : 0)) >> >> -#define sctp_sbspace_failedmsgs(sb) ((long) ((sctp_maxspace(sb) > (sb)->sb_cc) ? (sctp_maxspace(sb) - (sb)->sb_cc) : 0)) >> +#define sctp_sbspace_failedmsgs(sb) ((long) ((sctp_maxspace(sb) > (sb)->sb_ccc) ? (sctp_maxspace(sb) - (sb)->sb_ccc) : 0)) >> >> #define sctp_sbspace_sub(a,b) ((a > b) ? (a - b) : 0) >> >> @@ -195,10 +195,10 @@ extern struct pr_usrreqs sctp_usrreqs; >> } >> >> #define sctp_sbfree(ctl, stcb, sb, m) { \ >> - SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_cc, SCTP_BUF_LEN((m))); \ >> + SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_ccc, SCTP_BUF_LEN((m))); \ >> SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_mbcnt, MSIZE); \ >> if (((ctl)->do_not_ref_stcb == 0) && stcb) {\ >> - SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.sb_cc, SCTP_BUF_LEN((m))); \ >> + SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.sb_ccc, SCTP_BUF_LEN((m))); \ >> SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.my_rwnd_control_len, MSIZE); \ >> } \ >> if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \ >> @@ -207,10 +207,10 @@ extern struct pr_usrreqs sctp_usrreqs; >> } >> >> #define sctp_sballoc(stcb, sb, m) { \ >> - atomic_add_int(&(sb)->sb_cc,SCTP_BUF_LEN((m))); \ >> + atomic_add_int(&(sb)->sb_ccc,SCTP_BUF_LEN((m))); \ >> atomic_add_int(&(sb)->sb_mbcnt, MSIZE); \ >> if (stcb) { \ >> - atomic_add_int(&(stcb)->asoc.sb_cc,SCTP_BUF_LEN((m))); \ >> + atomic_add_int(&(stcb)->asoc.sb_ccc,SCTP_BUF_LEN((m))); \ >> atomic_add_int(&(stcb)->asoc.my_rwnd_control_len, MSIZE); \ >> } \ >> if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \ >> >> Modified: head/sys/netinet/sctputil.c >> ============================================================================== >> --- head/sys/netinet/sctputil.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/netinet/sctputil.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -67,9 +67,9 @@ sctp_sblog(struct sockbuf *sb, struct sc >> struct sctp_cwnd_log sctp_clog; >> >> sctp_clog.x.sb.stcb = stcb; >> - sctp_clog.x.sb.so_sbcc = sb->sb_cc; >> + sctp_clog.x.sb.so_sbcc = sb->sb_ccc; >> if (stcb) >> - sctp_clog.x.sb.stcb_sbcc = stcb->asoc.sb_cc; >> + sctp_clog.x.sb.stcb_sbcc = stcb->asoc.sb_ccc; >> else >> sctp_clog.x.sb.stcb_sbcc = 0; >> sctp_clog.x.sb.incr = incr; >> @@ -4363,7 +4363,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp >> { >> /* >> * Here we must place the control on the end of the socket read >> - * queue AND increment sb_cc so that select will work properly on >> + * queue AND increment sb_ccc so that select will work properly on >> * read. >> */ >> struct mbuf *m, *prev = NULL; >> @@ -4489,7 +4489,7 @@ sctp_append_to_readq(struct sctp_inpcb * >> * the reassembly queue. >> * >> * If PDAPI this means we need to add m to the end of the data. >> - * Increase the length in the control AND increment the sb_cc. >> + * Increase the length in the control AND increment the sb_ccc. >> * Otherwise sb is NULL and all we need to do is put it at the end >> * of the mbuf chain. >> */ >> @@ -4701,10 +4701,10 @@ sctp_free_bufspace(struct sctp_tcb *stcb >> >> if (stcb->sctp_socket && (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) || >> ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)))) { >> - if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { >> - stcb->sctp_socket->so_snd.sb_cc -= tp1->book_size; >> + if (stcb->sctp_socket->so_snd.sb_ccc >= tp1->book_size) { >> + stcb->sctp_socket->so_snd.sb_ccc -= tp1->book_size; >> } else { >> - stcb->sctp_socket->so_snd.sb_cc = 0; >> + stcb->sctp_socket->so_snd.sb_ccc = 0; >> >> } >> } >> @@ -5254,11 +5254,11 @@ sctp_sorecvmsg(struct socket *so, >> in_eeor_mode = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR); >> if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RECV_RWND_LOGGING_ENABLE) { >> sctp_misc_ints(SCTP_SORECV_ENTER, >> - rwnd_req, in_eeor_mode, so->so_rcv.sb_cc, uio->uio_resid); >> + rwnd_req, in_eeor_mode, so->so_rcv.sb_ccc, uio->uio_resid); >> } >> if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RECV_RWND_LOGGING_ENABLE) { >> sctp_misc_ints(SCTP_SORECV_ENTERPL, >> - rwnd_req, block_allowed, so->so_rcv.sb_cc, uio->uio_resid); >> + rwnd_req, block_allowed, so->so_rcv.sb_ccc, uio->uio_resid); >> } >> error = sblock(&so->so_rcv, (block_allowed ? SBL_WAIT : 0)); >> if (error) { >> @@ -5277,23 +5277,23 @@ restart_nosblocks: >> (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { >> goto out; >> } >> - if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && (so->so_rcv.sb_cc == 0)) { >> + if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && (so->so_rcv.sb_ccc == 0)) { >> if (so->so_error) { >> error = so->so_error; >> if ((in_flags & MSG_PEEK) == 0) >> so->so_error = 0; >> goto out; >> } else { >> - if (so->so_rcv.sb_cc == 0) { >> + if (so->so_rcv.sb_ccc == 0) { >> /* indicate EOF */ >> error = 0; >> goto out; >> } >> } >> } >> - if ((so->so_rcv.sb_cc <= held_length) && block_allowed) { >> + if ((so->so_rcv.sb_ccc <= held_length) && block_allowed) { >> /* we need to wait for data */ >> - if ((so->so_rcv.sb_cc == 0) && >> + if ((so->so_rcv.sb_ccc == 0) && >> ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || >> (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { >> if ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0) { >> @@ -5329,7 +5329,7 @@ restart_nosblocks: >> } >> held_length = 0; >> goto restart_nosblocks; >> - } else if (so->so_rcv.sb_cc == 0) { >> + } else if (so->so_rcv.sb_ccc == 0) { >> if (so->so_error) { >> error = so->so_error; >> if ((in_flags & MSG_PEEK) == 0) >> @@ -5386,11 +5386,11 @@ restart_nosblocks: >> SCTP_INP_READ_LOCK(inp); >> } >> control = TAILQ_FIRST(&inp->read_queue); >> - if ((control == NULL) && (so->so_rcv.sb_cc != 0)) { >> + if ((control == NULL) && (so->so_rcv.sb_ccc != 0)) { >> #ifdef INVARIANTS >> panic("Huh, its non zero and nothing on control?"); >> #endif >> - so->so_rcv.sb_cc = 0; >> + so->so_rcv.sb_ccc = 0; >> } >> SCTP_INP_READ_UNLOCK(inp); >> hold_rlock = 0; >> @@ -5511,11 +5511,11 @@ restart_nosblocks: >> } >> /* >> * if we reach here, not suitable replacement is available >> - * fragment interleave is NOT on. So stuff the sb_cc >> + * fragment interleave is NOT on. So stuff the sb_ccc >> * into the our held count, and its time to sleep again. >> */ >> - held_length = so->so_rcv.sb_cc; >> - control->held_length = so->so_rcv.sb_cc; >> + held_length = so->so_rcv.sb_ccc; >> + control->held_length = so->so_rcv.sb_ccc; >> goto restart; >> } >> /* Clear the held length since there is something to read */ >> @@ -5812,10 +5812,10 @@ get_more_data: >> if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { >> sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, cp_len); >> } >> - atomic_subtract_int(&so->so_rcv.sb_cc, cp_len); >> + atomic_subtract_int(&so->so_rcv.sb_ccc, cp_len); >> if ((control->do_not_ref_stcb == 0) && >> stcb) { >> - atomic_subtract_int(&stcb->asoc.sb_cc, cp_len); >> + atomic_subtract_int(&stcb->asoc.sb_ccc, cp_len); >> } >> copied_so_far += cp_len; >> freed_so_far += cp_len; >> @@ -5960,7 +5960,7 @@ wait_some_more: >> (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_FRAG_INTERLEAVE))) { >> goto release; >> } >> - if (so->so_rcv.sb_cc <= control->held_length) { >> + if (so->so_rcv.sb_ccc <= control->held_length) { >> error = sbwait(&so->so_rcv); >> if (error) { >> goto release; >> @@ -5987,8 +5987,8 @@ wait_some_more: >> } >> goto done_with_control; >> } >> - if (so->so_rcv.sb_cc > held_length) { >> - control->held_length = so->so_rcv.sb_cc; >> + if (so->so_rcv.sb_ccc > held_length) { >> + control->held_length = so->so_rcv.sb_ccc; >> held_length = 0; >> } >> goto wait_some_more; >> @@ -6135,13 +6135,13 @@ out: >> freed_so_far, >> ((uio) ? (slen - uio->uio_resid) : slen), >> stcb->asoc.my_rwnd, >> - so->so_rcv.sb_cc); >> + so->so_rcv.sb_ccc); >> } else { >> sctp_misc_ints(SCTP_SORECV_DONE, >> freed_so_far, >> ((uio) ? (slen - uio->uio_resid) : slen), >> 0, >> - so->so_rcv.sb_cc); >> + so->so_rcv.sb_ccc); >> } >> } >> stage_left: >> >> Modified: head/sys/netinet/sctputil.h >> ============================================================================== >> --- head/sys/netinet/sctputil.h Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/netinet/sctputil.h Sun Nov 30 12:52:33 2014 (r275326) >> @@ -286,10 +286,10 @@ do { \ >> } \ >> if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ >> (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ >> - if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { \ >> - atomic_subtract_int(&((stcb)->sctp_socket->so_snd.sb_cc), tp1->book_size); \ >> + if (stcb->sctp_socket->so_snd.sb_ccc >= tp1->book_size) { \ >> + atomic_subtract_int(&((stcb)->sctp_socket->so_snd.sb_ccc), tp1->book_size); \ >> } else { \ >> - stcb->sctp_socket->so_snd.sb_cc = 0; \ >> + stcb->sctp_socket->so_snd.sb_ccc = 0; \ >> } \ >> } \ >> } \ >> @@ -307,10 +307,10 @@ do { \ >> } \ >> if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ >> (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ >> - if (stcb->sctp_socket->so_snd.sb_cc >= sp->length) { \ >> - atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc,sp->length); \ >> + if (stcb->sctp_socket->so_snd.sb_ccc >= sp->length) { \ >> + atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_ccc,sp->length); \ >> } else { \ >> - stcb->sctp_socket->so_snd.sb_cc = 0; \ >> + stcb->sctp_socket->so_snd.sb_ccc = 0; \ >> } \ >> } \ >> } \ >> @@ -322,7 +322,7 @@ do { \ >> if ((stcb->sctp_socket != NULL) && \ >> ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ >> (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ >> - atomic_add_int(&stcb->sctp_socket->so_snd.sb_cc,sz); \ >> + atomic_add_int(&stcb->sctp_socket->so_snd.sb_ccc,sz); \ >> } \ >> } while (0) >> >> >> Modified: head/sys/sys/sockbuf.h >> ============================================================================== >> --- head/sys/sys/sockbuf.h Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/sys/sys/sockbuf.h Sun Nov 30 12:52:33 2014 (r275326) >> @@ -89,8 +89,10 @@ struct sockbuf { >> struct mbuf *sb_lastrecord; /* (c/d) first mbuf of last >> * record in socket buffer */ >> struct mbuf *sb_sndptr; /* (c/d) pointer into mbuf chain */ >> + struct mbuf *sb_fnrdy; /* (c/d) pointer to first not ready buffer */ >> u_int sb_sndptroff; /* (c/d) byte offset of ptr into chain */ >> - u_int sb_cc; /* (c/d) actual chars in buffer */ >> + u_int sb_acc; /* (c/d) available chars in buffer */ >> + u_int sb_ccc; /* (c/d) claimed chars in buffer */ >> u_int sb_hiwat; /* (c/d) max actual char count */ >> u_int sb_mbcnt; /* (c/d) chars of mbufs used */ >> u_int sb_mcnt; /* (c/d) number of mbufs in buffer */ >> @@ -120,6 +122,13 @@ struct sockbuf { >> #define SOCKBUF_LOCK_ASSERT(_sb) mtx_assert(SOCKBUF_MTX(_sb), MA_OWNED) >> #define SOCKBUF_UNLOCK_ASSERT(_sb) mtx_assert(SOCKBUF_MTX(_sb), MA_NOTOWNED) >> >> +/* >> + * Socket buffer private mbuf(9) flags. >> + */ >> +#define M_NOTREADY M_PROTO1 /* m_data not populated yet */ >> +#define M_BLOCKED M_PROTO2 /* M_NOTREADY in front of m */ >> +#define M_NOTAVAIL (M_NOTREADY | M_BLOCKED) >> + >> void sbappend(struct sockbuf *sb, struct mbuf *m); >> void sbappend_locked(struct sockbuf *sb, struct mbuf *m); >> void sbappendstream(struct sockbuf *sb, struct mbuf *m); >> @@ -165,10 +174,11 @@ int sblock(struct sockbuf *sb, int flags >> void sbunlock(struct sockbuf *sb); >> void sballoc(struct sockbuf *, struct mbuf *); >> void sbfree(struct sockbuf *, struct mbuf *); >> +int sbready(struct sockbuf *, struct mbuf *, int); >> >> /* >> * Return how much data is available to be taken out of socket >> - * bufffer right now. >> + * buffer right now. >> */ >> static inline u_int >> sbavail(struct sockbuf *sb) >> @@ -177,7 +187,7 @@ sbavail(struct sockbuf *sb) >> #if 0 >> SOCKBUF_LOCK_ASSERT(sb); >> #endif >> - return (sb->sb_cc); >> + return (sb->sb_acc); >> } >> >> /* >> @@ -191,27 +201,30 @@ sbused(struct sockbuf *sb) >> #if 0 >> SOCKBUF_LOCK_ASSERT(sb); >> #endif >> - return (sb->sb_cc); >> + return (sb->sb_ccc); >> } >> >> /* >> * How much space is there in a socket buffer (so->so_snd or so->so_rcv)? >> * This is problematical if the fields are unsigned, as the space might >> - * still be negative (cc > hiwat or mbcnt > mbmax). Should detect >> - * overflow and return 0. Should use "lmin" but it doesn't exist now. >> + * still be negative (ccc > hiwat or mbcnt > mbmax). >> */ >> -static __inline >> -long >> +static inline long >> sbspace(struct sockbuf *sb) >> { >> - long bleft; >> - long mleft; >> + long bleft, mleft; >> + >> +#if 0 >> + SOCKBUF_LOCK_ASSERT(sb); >> +#endif >> >> if (sb->sb_flags & SB_STOP) >> return(0); >> - bleft = sb->sb_hiwat - sb->sb_cc; >> + >> + bleft = sb->sb_hiwat - sb->sb_ccc; >> mleft = sb->sb_mbmax - sb->sb_mbcnt; >> - return((bleft < mleft) ? bleft : mleft); >> + >> + return ((bleft < mleft) ? bleft : mleft); >> } >> >> #define SB_EMPTY_FIXUP(sb) do { \ >> >> Modified: head/usr.bin/bluetooth/btsockstat/btsockstat.c >> ============================================================================== >> --- head/usr.bin/bluetooth/btsockstat/btsockstat.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/usr.bin/bluetooth/btsockstat/btsockstat.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -255,8 +255,8 @@ hcirawpr(kvm_t *kvmd, u_long addr) >> (unsigned long) pcb.so, >> (unsigned long) this, >> pcb.flags, >> - so.so_rcv.sb_cc, >> - so.so_snd.sb_cc, >> + so.so_rcv.sb_ccc, >> + so.so_snd.sb_ccc, >> pcb.addr.hci_node); >> } >> } /* hcirawpr */ >> @@ -303,8 +303,8 @@ l2caprawpr(kvm_t *kvmd, u_long addr) >> "%-8lx %-8lx %6d %6d %-17.17s\n", >> (unsigned long) pcb.so, >> (unsigned long) this, >> - so.so_rcv.sb_cc, >> - so.so_snd.sb_cc, >> + so.so_rcv.sb_ccc, >> + so.so_snd.sb_ccc, >> bdaddrpr(&pcb.src, NULL, 0)); >> } >> } /* l2caprawpr */ >> @@ -361,8 +361,8 @@ l2cappr(kvm_t *kvmd, u_long addr) >> fprintf(stdout, >> "%-8lx %6d %6d %-17.17s/%-5d %-17.17s %-5d %s\n", >> (unsigned long) this, >> - so.so_rcv.sb_cc, >> - so.so_snd.sb_cc, >> + so.so_rcv.sb_ccc, >> + so.so_snd.sb_ccc, >> bdaddrpr(&pcb.src, local, sizeof(local)), >> pcb.psm, >> bdaddrpr(&pcb.dst, remote, sizeof(remote)), >> @@ -467,8 +467,8 @@ rfcommpr(kvm_t *kvmd, u_long addr) >> fprintf(stdout, >> "%-8lx %6d %6d %-17.17s %-17.17s %-4d %-4d %s\n", >> (unsigned long) this, >> - so.so_rcv.sb_cc, >> - so.so_snd.sb_cc, >> + so.so_rcv.sb_ccc, >> + so.so_snd.sb_ccc, >> bdaddrpr(&pcb.src, local, sizeof(local)), >> bdaddrpr(&pcb.dst, remote, sizeof(remote)), >> pcb.channel, >> >> Modified: head/usr.bin/netstat/inet.c >> ============================================================================== >> --- head/usr.bin/netstat/inet.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/usr.bin/netstat/inet.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -137,7 +137,7 @@ pcblist_sysctl(int proto, const char *na >> static void >> sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb) >> { >> - xsb->sb_cc = sb->sb_cc; >> + xsb->sb_cc = sb->sb_ccc; >> xsb->sb_hiwat = sb->sb_hiwat; >> xsb->sb_mbcnt = sb->sb_mbcnt; >> xsb->sb_mcnt = sb->sb_mcnt; >> @@ -479,7 +479,8 @@ protopr(u_long off, const char *name, in >> printf("%6u %6u %6u ", tp->t_sndrexmitpack, >> tp->t_rcvoopack, tp->t_sndzerowin); >> } else { >> - printf("%6u %6u ", so->so_rcv.sb_cc, so->so_snd.sb_cc); >> + printf("%6u %6u ", >> + so->so_rcv.sb_cc, so->so_snd.sb_cc); >> } >> if (numeric_port) { >> if (inp->inp_vflag & INP_IPV4) { >> >> Modified: head/usr.bin/netstat/netgraph.c >> ============================================================================== >> --- head/usr.bin/netstat/netgraph.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/usr.bin/netstat/netgraph.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -119,7 +119,7 @@ netgraphprotopr(u_long off, const char * >> if (Aflag) >> printf("%8lx ", (u_long) this); >> printf("%-5.5s %6u %6u ", >> - name, sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc); >> + name, sockb.so_rcv.sb_ccc, sockb.so_snd.sb_ccc); >> >> /* Get info on associated node */ >> if (ngpcb.node_id == 0 || csock == -1) >> >> Modified: head/usr.bin/netstat/unix.c >> ============================================================================== >> --- head/usr.bin/netstat/unix.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/usr.bin/netstat/unix.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -287,7 +287,8 @@ unixdomainpr(struct xunpcb *xunp, struct >> } else { >> printf("%8lx %-6.6s %6u %6u %8lx %8lx %8lx %8lx", >> (long)so->so_pcb, socktype[so->so_type], so->so_rcv.sb_cc, >> - so->so_snd.sb_cc, (long)unp->unp_vnode, (long)unp->unp_conn, >> + so->so_snd.sb_cc, (long)unp->unp_vnode, >> + (long)unp->unp_conn, >> (long)LIST_FIRST(&unp->unp_refs), >> (long)LIST_NEXT(unp, unp_reflink)); >> } >> >> Modified: head/usr.bin/systat/netstat.c >> ============================================================================== >> --- head/usr.bin/systat/netstat.c Sun Nov 30 12:37:20 2014 (r275325) >> +++ head/usr.bin/systat/netstat.c Sun Nov 30 12:52:33 2014 (r275326) >> @@ -333,8 +333,8 @@ enter_kvm(struct inpcb *inp, struct sock >> struct netinfo *p; >> >> if ((p = enter(inp, state, proto)) != NULL) { >> - p->ni_rcvcc = so->so_rcv.sb_cc; >> - p->ni_sndcc = so->so_snd.sb_cc; >> + p->ni_rcvcc = so->so_rcv.sb_ccc; >> + p->ni_sndcc = so->so_snd.sb_ccc; >> } >> } >> >> From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 18:38:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 584455B0; Sun, 30 Nov 2014 18:38:06 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id CC72A222; Sun, 30 Nov 2014 18:38:04 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id sAUIc0GO027823 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 30 Nov 2014 21:38:00 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id sAUIc0uL027822; Sun, 30 Nov 2014 21:38:00 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 30 Nov 2014 21:38:00 +0300 From: Gleb Smirnoff To: Adrian Chadd , Alfred Perlstein Subject: Re: svn commit: r275326 - in head: sys/dev/cxgbe/tom sys/kern sys/netinet sys/sys usr.bin/bluetooth/btsockstat usr.bin/netstat usr.bin/systat Message-ID: <20141130183800.GA47144@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <547B5DB1.2030003@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 18:38:06 -0000 Adrian & Alfred, On Sun, Nov 30, 2014 at 09:55:05AM -0800, Adrian Chadd wrote: A> I really wished that these commits got individual reviews before they went in. On Sun, Nov 30, 2014 at 10:10:57AM -0800, Alfred Perlstein wrote: A> Agree, this was already discussed as quite possibly an incorrect way A> forward some months ago. A> A> Where is the actual review for this huge change to the networking stack? A> The development was going on in the open branch, and I've been sending the diff on the new sendfile constantly during this year. Last time I sent the diff, the discussion very quickly moved to Lua in kernel, script(2) and other buzz, actually ignoring my review and test request and hijacking my thread: https://lists.freebsd.org/pipermail/freebsd-arch/2014-September/015861.html Yes, Alfred did ask me why can't this be accomplished with socket upcalls, and replied I to him, but discussion ended there: https://lists.freebsd.org/pipermail/freebsd-arch/2014-September/015858.html Probably the script(2) topic was more appealing. If you don't mind, I will make a separate replies on your actual technical questions. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 18:59:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B02E2176; Sun, 30 Nov 2014 18:59:22 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D142640; Sun, 30 Nov 2014 18:59:20 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id sAUIxIWV027920 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 30 Nov 2014 21:59:18 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id sAUIxIAe027919; Sun, 30 Nov 2014 21:59:18 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 30 Nov 2014 21:59:18 +0300 From: Gleb Smirnoff To: Alfred Perlstein Subject: Re: svn commit: r275326 - in head: sys/dev/cxgbe/tom sys/kern sys/netinet sys/sys usr.bin/bluetooth/btsockstat usr.bin/netstat usr.bin/systat Message-ID: <20141130185918.GB47144@FreeBSD.org> References: <201411301252.sAUCqYXm055601@svn.freebsd.org> <547B5DB1.2030003@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <547B5DB1.2030003@freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 18:59:22 -0000 Alfred, On Sun, Nov 30, 2014 at 10:10:57AM -0800, Alfred Perlstein wrote: A> Splitting this into the mbuf layer adds a huge level of complexity where A> again, there are already completion paths in the socket layer to do A> this. I am completely confused as to why this couldn't just be done A> with the socket callback system already in place. Very open to being A> educated on this! As said in September, I can't understand how socket buffer upcall system can be used here. It does the opposite: wakes up something in kernel when data arrives to socket. So I am also very open to being explained on how can I apply it here. A> The concept of "not filled mbufs" in a socket buffer seems absolutely A> wrong at a glance, I'm sure with some better explanation this would all A> make sense, but really am still not convinced this is at all the right A> way to go on this. I'll put a longer explanation in the end of this email. A> Does any other OS do this for any reason? Or is this just a short A> sighted hack for an experiment in sendfile? Well, we also have plans to put TLS into kernel, that would use them as well. :) There might be more consumers. Note, that sf_bufs were initially a "just a short sighted hack" for sendfile(2), and now are used in several places in kernel. A> I am really trying very hard to rationalize this change, so I will ask, A> is there something about keeping TCP windows open that you are hoping to A> accomplish that you can not otherwise do without sb_ccc and sb_acc? If A> not then why is all this stuff being stuffed into mbufs as opposed to A> using callbacks? It really seems wrong, my thoughts are "this is like A> kse for mbufs" something done with good intentions, but is complex and A> will have to be ripped out later. Am I wrong here? No, this has nothing to do with keeping TCP windows. Here is longer explanation: the new sendfile(2) is going to be non-blocking on disk. That means, that syscalls returns back to application without completing I/O, immediately. Application can do its work further. It can write(2) to the socket as well. Or run another sendfile(2) on the same socket. Probably now you see the problem. If the non-blocking sendfile doesn't put a placeholder for its data into the socket buffer, then data in the socket buffer is going to be mixed randomly. Please note, that I don't move anything to the mbuf layer, as you claim it. Neither mbuf.h, not kern_mbuf.c, uipc_mbuf.c are modified. This is a new feature held internally in the socket buffer code. Yes, the sweep of changing sb_cc to sbavail() and sbused() was large. This is the problem of socket buffers being exposed to the stack and stack lurking in the structure. If decades ago socket code was developed more self-contained, then no sweep would be needed. As I already noted in the commit message, my opinion is that socket buffers need to be made protocol dependent and more opaque. The SCTP code taught me that. As for TCP/UDP, right now our socket buffer structure supports SOCK_STREAM and SOCK_DGRAM but this is achieved through code complication, and I see no good reason to keep it so generic. Original BSD soreceive() functions was a hell, before it was divorced to soreceive_stream() and soreceive_dgram(). Splitting the sockbuf to two different types would finish that. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 19:03:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E1F743F5; Sun, 30 Nov 2014 19:03:16 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6044F74E; Sun, 30 Nov 2014 19:03:15 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id sAUJ3DRs027964 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 30 Nov 2014 22:03:13 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id sAUJ3DlN027963; Sun, 30 Nov 2014 22:03:13 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 30 Nov 2014 22:03:13 +0300 From: Gleb Smirnoff To: Adrian Chadd Subject: Re: svn commit: r275326 - in head: sys/dev/cxgbe/tom sys/kern sys/netinet sys/sys usr.bin/bluetooth/btsockstat usr.bin/netstat usr.bin/systat Message-ID: <20141130190313.GC47144@FreeBSD.org> References: <201411301252.sAUCqYXm055601@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 19:03:17 -0000 Adrian, On Sun, Nov 30, 2014 at 09:55:05AM -0800, Adrian Chadd wrote: A> The whole idea of an mbuf whose data isn't quite there yet makes A> debugging issues rather amusing, as now you may have VM issues to A> debug at the same time as you're debugging network related stuff. I don't see how VM issues are related. The mbufs are referencing allocated, mapped and wired pages via sf_bufs. The same way as they did it since 1998. The only difference is that pages aren't populated with data. No VM changes happen to the pages while the mbufs that reference them sit in the socket buffer. A> I really think this could've been done without all the back-handed VM A> work. The mbufs and IO buffers both have completion function calls; it A> would've been much less intrusive to do it that way. If you can describe the alternative design at least in some detail, I am listening. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 19:03:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9676B576; Sun, 30 Nov 2014 19:03:49 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id 7F9C7754; Sun, 30 Nov 2014 19:03:49 +0000 (UTC) Received: from AlfredMacbookAir.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id 0B114341F84E; Sun, 30 Nov 2014 11:03:49 -0800 (PST) Message-ID: <547B6A0C.6050303@freebsd.org> Date: Sun, 30 Nov 2014 11:03:40 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Gleb Smirnoff , Adrian Chadd Subject: Re: svn commit: r275326 - in head: sys/dev/cxgbe/tom sys/kern sys/netinet sys/sys usr.bin/bluetooth/btsockstat usr.bin/netstat usr.bin/systat References: <20141130183800.GA47144@FreeBSD.org> In-Reply-To: <20141130183800.GA47144@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 19:03:49 -0000 On 11/30/14, 10:38 AM, Gleb Smirnoff wrote: > Adrian & Alfred, > > On Sun, Nov 30, 2014 at 09:55:05AM -0800, Adrian Chadd wrote: > A> I really wished that these commits got individual reviews before they went in. > > On Sun, Nov 30, 2014 at 10:10:57AM -0800, Alfred Perlstein wrote: > A> Agree, this was already discussed as quite possibly an incorrect way > A> forward some months ago. > A> > A> Where is the actual review for this huge change to the networking stack? > A> > > The development was going on in the open branch, and I've been sending the > diff on the new sendfile constantly during this year. Last time I sent the > diff, the discussion very quickly moved to Lua in kernel, script(2) and > other buzz, actually ignoring my review and test request and hijacking > my thread: > > https://lists.freebsd.org/pipermail/freebsd-arch/2014-September/015861.html > > Yes, Alfred did ask me why can't this be accomplished with socket > upcalls, and replied I to him, but discussion ended there: > > https://lists.freebsd.org/pipermail/freebsd-arch/2014-September/015858.html > > Probably the script(2) topic was more appealing. > > If you don't mind, I will make a separate replies on your actual > technical questions. > Gleb, Maybe I misread your reply to 'https://lists.freebsd.org/pipermail/freebsd-arch/2014-September/015858.html' but my interpretation of your reply was that you would reconsider your approach because the suggestion to use socket callback was a valid one. I am very open to being wrong on this issue, but with all due respect I don't see a good reason why not to use socket callbacks to even implement what you have right now. I appreciate what seem to be kind words saying my idea is good, but it didn't really answer the question nor address the issue I raised. I am currently sorting out why this approach was taken and here's what I have so far, this is me trying to find the best here: 1) Possible that the socket buffer accounting needs to be done to keep TCP window open for send? (Could this be forced via setsockopt(2) option instead)? 2) Lock order issues in the socket callback. 3) There is only a single socket callback func and arg (maybe we need more?) 4) Properly asserting backpressure and actual blocking in sendfile(2) becomes very difficult otherwise, meaning that if you don't have the complexity in socketbuffer, then you need to sort of implement this inside a private control block AND do accounting there. 5) This is a "cool feature" and maybe other things can make use of it eventually? <- hoping this is more of a good thing as opposed to (sorry) kse. 6) Alllows one to mix async sendfile write WITH sync write and the correct thing happens? Am I right in assuming that socketbuffers can wind up with mbufs as such: M_NOTREADY, M_READY, M_NOTREADY, M_READY, M_NOTREADY, M_READY ? If so that is pretty interesting and useful. Again my proposal would be to use socket callback and callback arg would basically be something like: socket_sendfile_cb_arg { struct mbuf *head; /* list of mbufs queued */ } When the callback is fired just pop off the front of the queue and put on the socketbuffer. This however has the following drawbacks: 1) May have trouble if anyone else is using the sbcallback as well? aio? (might need to allow multiple callbacks now). 2) Can't do M_NOTREADY, M_READY, M_NOTREADY, M_READY, M_NOTREADY, M_READY, basically write(2) can get in front of async sendfile. I know you have put a lot of effort into this and these are just my semi-random thoughts on the issue, so I apologize if I'm making you repeat a lot of your thinking on the issue, I would just like to understand a bit better why this was done and if we really need to do it. -Alfred From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 19:32:01 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6842FC25; Sun, 30 Nov 2014 19:32:01 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 547149F4; Sun, 30 Nov 2014 19:32:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUJW1mj042605; Sun, 30 Nov 2014 19:32:01 GMT (envelope-from gibbs@FreeBSD.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUJW14p042602; Sun, 30 Nov 2014 19:32:01 GMT (envelope-from gibbs@FreeBSD.org) Message-Id: <201411301932.sAUJW14p042602@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gibbs set sender to gibbs@FreeBSD.org using -f From: "Justin T. Gibbs" Date: Sun, 30 Nov 2014 19:32:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275345 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 19:32:01 -0000 Author: gibbs Date: Sun Nov 30 19:32:00 2014 New Revision: 275345 URL: https://svnweb.freebsd.org/changeset/base/275345 Log: Remove trailing whitespace. Modified: head/sys/kern/subr_taskqueue.c Modified: head/sys/kern/subr_taskqueue.c ============================================================================== --- head/sys/kern/subr_taskqueue.c Sun Nov 30 18:51:10 2014 (r275344) +++ head/sys/kern/subr_taskqueue.c Sun Nov 30 19:32:00 2014 (r275345) @@ -661,11 +661,11 @@ taskqueue_thread_enqueue(void *context) TASKQUEUE_DEFINE(swi, taskqueue_swi_enqueue, NULL, swi_add(NULL, "task queue", taskqueue_swi_run, NULL, SWI_TQ, - INTR_MPSAFE, &taskqueue_ih)); + INTR_MPSAFE, &taskqueue_ih)); TASKQUEUE_DEFINE(swi_giant, taskqueue_swi_giant_enqueue, NULL, swi_add(NULL, "Giant taskq", taskqueue_swi_giant_run, - NULL, SWI_TQ_GIANT, 0, &taskqueue_giant_ih)); + NULL, SWI_TQ_GIANT, 0, &taskqueue_giant_ih)); TASKQUEUE_DEFINE_THREAD(thread); From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 20:12:49 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04D516FC; Sun, 30 Nov 2014 20:12:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E5269DDF; Sun, 30 Nov 2014 20:12:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUKCmT4061706; Sun, 30 Nov 2014 20:12:48 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUKCm9a061704; Sun, 30 Nov 2014 20:12:48 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201411302012.sAUKCm9a061704@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 30 Nov 2014 20:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275346 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 20:12:49 -0000 Author: jilles Date: Sun Nov 30 20:12:47 2014 New Revision: 275346 URL: https://svnweb.freebsd.org/changeset/base/275346 Log: sh: Remove special case for '=' in set -x; always quote it in outqstr(). I plan to make set -x output always printable using $'...'; avoiding quoting words containing '=' is not worth the extra complexity. Modified: head/bin/sh/eval.c head/bin/sh/output.c Modified: head/bin/sh/eval.c ============================================================================== --- head/bin/sh/eval.c Sun Nov 30 19:32:00 2014 (r275345) +++ head/bin/sh/eval.c Sun Nov 30 20:12:47 2014 (r275346) @@ -774,15 +774,7 @@ xtracecommand(struct arglist *varlist, s for (sp = arglist->list ; sp ; sp = sp->next) { if (sep != 0) out2c(' '); - /* Disambiguate command looking like assignment. */ - if (sp == arglist->list && - strchr(sp->text, '=') != NULL && - strchr(sp->text, '\'') == NULL) { - out2c('\''); - out2str(sp->text); - out2c('\''); - } else - out2qstr(sp->text); + out2qstr(sp->text); sep = ' '; } out2c('\n'); Modified: head/bin/sh/output.c ============================================================================== --- head/bin/sh/output.c Sun Nov 30 19:32:00 2014 (r275345) +++ head/bin/sh/output.c Sun Nov 30 20:12:47 2014 (r275346) @@ -122,8 +122,7 @@ outqstr(const char *p, struct output *fi outstr("''", file); return; } - /* Caller will handle '=' if necessary */ - if (p[strcspn(p, "|&;<>()$`\\\"' \t\n*?[~#")] == '\0' || + if (p[strcspn(p, "|&;<>()$`\\\"' \t\n*?[~#=")] == '\0' || strcmp(p, "[") == 0) { outstr(p, file); return; From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 20:20:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 43A37918; Sun, 30 Nov 2014 20:20:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FDDFE14; Sun, 30 Nov 2014 20:20:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAUKKujP065685; Sun, 30 Nov 2014 20:20:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUKKuET065684; Sun, 30 Nov 2014 20:20:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201411302020.sAUKKuET065684@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Nov 2014 20:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275347 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 20:20:56 -0000 Author: kib Date: Sun Nov 30 20:20:55 2014 New Revision: 275347 URL: https://svnweb.freebsd.org/changeset/base/275347 Log: Provide mutual exclusion between zone allocation/destruction and uma_reclaim(). Reclamation code must not see half-constructed or destructed zones. Do this by bracing uma_zcreate() and uma_zdestroy() into a shared-locked sx, and take the sx exclusively in uma_reclaim(). Usually zones are not created/destroyed during the system operation, but tmpfs mounts do cause zone operations and exposed the bug. Another solution could be to only expose a new keg on uma_kegs list after the corresponding zone is fully constructed, and similar treatment for the destruction. But it probably requires more risky code rearrangement as well. Reported and tested by: pho Discussed with: avg Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Sun Nov 30 20:12:47 2014 (r275346) +++ head/sys/vm/uma_core.c Sun Nov 30 20:20:55 2014 (r275347) @@ -146,6 +146,8 @@ static LIST_HEAD(,uma_slab) uma_boot_pag /* This mutex protects the boot time pages list */ static struct mtx_padalign uma_boot_pages_mtx; +static struct sx uma_drain_lock; + /* Is the VM done starting up? */ static int booted = 0; #define UMA_STARTUP 1 @@ -1876,6 +1878,7 @@ uma_startup2(void) { booted = UMA_STARTUP2; bucket_enable(); + sx_init(&uma_drain_lock, "umadrain"); #ifdef UMA_DEBUG printf("UMA startup2 complete.\n"); #endif @@ -1930,6 +1933,8 @@ uma_zcreate(const char *name, size_t siz { struct uma_zctor_args args; + uma_zone_t res; + bool locked; /* This stuff is essential for the zone ctor */ memset(&args, 0, sizeof(args)); @@ -1943,7 +1948,16 @@ uma_zcreate(const char *name, size_t siz args.flags = flags; args.keg = NULL; - return (zone_alloc_item(zones, &args, M_WAITOK)); + if (booted < UMA_STARTUP2) { + locked = false; + } else { + sx_slock(&uma_drain_lock); + locked = true; + } + res = zone_alloc_item(zones, &args, M_WAITOK); + if (locked) + sx_sunlock(&uma_drain_lock); + return (res); } /* See uma.h */ @@ -1953,6 +1967,8 @@ uma_zsecond_create(char *name, uma_ctor { struct uma_zctor_args args; uma_keg_t keg; + uma_zone_t res; + bool locked; keg = zone_first_keg(master); memset(&args, 0, sizeof(args)); @@ -1966,8 +1982,17 @@ uma_zsecond_create(char *name, uma_ctor args.flags = keg->uk_flags | UMA_ZONE_SECONDARY; args.keg = keg; + if (booted < UMA_STARTUP2) { + locked = false; + } else { + sx_slock(&uma_drain_lock); + locked = true; + } /* XXX Attaches only one keg of potentially many. */ - return (zone_alloc_item(zones, &args, M_WAITOK)); + res = zone_alloc_item(zones, &args, M_WAITOK); + if (locked) + sx_sunlock(&uma_drain_lock); + return (res); } /* See uma.h */ @@ -2085,7 +2110,9 @@ void uma_zdestroy(uma_zone_t zone) { + sx_slock(&uma_drain_lock); zone_free_item(zones, zone, NULL, SKIP_NONE); + sx_sunlock(&uma_drain_lock); } /* See uma.h */ @@ -3205,6 +3232,7 @@ uma_reclaim(void) #ifdef UMA_DEBUG printf("UMA: vm asked us to release pages!\n"); #endif + sx_xlock(&uma_drain_lock); bucket_enable(); zone_foreach(zone_drain); if (vm_page_count_min()) { @@ -3219,6 +3247,7 @@ uma_reclaim(void) zone_drain(slabzone); zone_drain(slabrefzone); bucket_zone_drain(); + sx_xunlock(&uma_drain_lock); } /* See uma.h */ From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 21:33:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 738D9913; Sun, 30 Nov 2014 21:33:51 +0000 (UTC) Received: from cyrus.watson.org (cyrus.watson.org [198.74.231.69]) by mx1.freebsd.org (Postfix) with ESMTP id 082E9803; Sun, 30 Nov 2014 21:33:51 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [198.74.231.63]) by cyrus.watson.org (Postfix) with ESMTPS id 38BEA46B0D; Sun, 30 Nov 2014 16:33:50 -0500 (EST) Date: Sun, 30 Nov 2014 21:33:50 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Gleb Smirnoff Subject: Re: svn commit: r275326 - in head: sys/dev/cxgbe/tom sys/kern sys/netinet sys/sys usr.bin/bluetooth/btsockstat usr.bin/netstat usr.bin/systat In-Reply-To: <201411301252.sAUCqYXm055601@svn.freebsd.org> Message-ID: References: <201411301252.sAUCqYXm055601@svn.freebsd.org> User-Agent: Alpine 2.11 (BSF 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 21:33:51 -0000 Hi Gleb: Randall had mentioned these in-flight changes to me, and I can see how these might substantially reduce latency in usefully filling the TCP pipe when the window is opening rapidly (among other things). As with others, I'm a bit cautious about further increases in asynchrony within mbufs -- but think that the design choice to limit asynchronous access to mbuf data, rather than metadata, is a sensible one. I am especially pleased that the near-invariant that access to mbuf fields of mbufs owned by the socket buffer occurs only with the socket-buffer mutex held (note that there are one or two known nasty exceptions to this rule -- e.g., in MSG_PEEK that it is worth being aware of). I tend to agree with the view that socket upcalls are not the right mechanism to use here, as those both serve another function, and can run into locking difficulties due to their calling contexts (I am aware of some potential outstanding issues here for existing upcall consumers, in fact). I do have a substantial worry about 'compatibility' -- which is to say, the risk of not only running into trouble with more obscure bits of the network stack, but also third-party extensions in local code bases that may make previously reasonable assumptions about mbuf behaviour. One way to bound the scope of that issue is to ensure, very firmly, that these flags can never leak out of the socket-buffer/protocol components that explicitly support it. I think I might feel more comfortable if these were globally visible mbuf flags, which we could assert never passed through certain types of interfaces -- e.g., made it to ip_output(); it might also be useful to assert that these flags are never set when an mbuf is freed back to the mbuf allocator. I also worry that leakage of M_PROTO flags from other components could lead to quite hard-to-debug problems, and so it would be good to ensure that subsystems that will use these flags assert that they are never set as they arrive in the subsystem (e.g., tcp_input()). I'm not sure how we're doing on mbuf flags, but we might soon find we require another field in struct mbuf for them. Anywhere we can use assertions to help us with this kind of problem, I think it's a big win. Although these changes have clearly been refined over an extended period, and were developed in a Subversion project branch, I think it would have been nice to be able to have more "Reviewed by:" entries in the commit message. I've been really happy to see a gradual change over the last few years towards a large percentage of network-stack commits having that tag, and think it's worth pursuing this pretty vigorously. A phabricator round to networks@ (or whatever the recently created alias/group was) would not go amiss in the future. While everyone is busy, creating an environment of mutual review (I'll scratch your back if you scratch mine) is very valuable -- especially for subsystems as subtle as the network stack. Looking back in the e-mail archives, I see that you did post a phabricator link to an earlier version of this work in May -- I suspect more armtwisting was required, but would in general be worth it. (I've been very tuned out the last few months due to ongoing things outside of the FreeBSD world -- but please do feel free to ping me if there's a critical patch like this in flight where I can at least lend a hand with a quick read.) Although not an immediate issue, it may be worth looking at what happens to performance with these changes in the presence of lower-latency storage devices, such as nvme. Where there is substantial latency due to a spinning disk, or even a congested SATA-attached SSD, it's easy to see how these changes would improve performance. I do worry that with lower latency, you might see increases in lock contention -- or at least shifts, which would be worth understanding. I'm not sure if your testing environment is suitable for that (nor, I think, the FreeBSD Project's netperf cluster -- we've just received our first nvme device at the Computer Laboratory for network-stack performance work .. and it will be interesting to see how that plays out. With <30us RTT on I/O, multiqueue support, etc, the dynamics are changing quite a lot.) The concern would be that we might now be doing many more socket-buffer locking/wakeup-style events than before, and that if they are paced too quickly the threads will bump into each other. FWIW, I think it would be worth pondering adding an aio_sendfile(), if only because it would make it easier to expose this kernel asynchrony to userspace concurrency frameworks like libdispatch. Robert On Sun, 30 Nov 2014, Gleb Smirnoff wrote: > Author: glebius > Date: Sun Nov 30 12:52:33 2014 > New Revision: 275326 > URL: https://svnweb.freebsd.org/changeset/base/275326 > > Log: > Merge from projects/sendfile: > > o Introduce a notion of "not ready" mbufs in socket buffers. These > mbufs are now being populated by some I/O in background and are > referenced outside. This forces following implications: > - An mbuf which is "not ready" can't be taken out of the buffer. > - An mbuf that is behind a "not ready" in the queue neither. > - If sockbet buffer is flushed, then "not ready" mbufs shouln't be > freed. > > o In struct sockbuf the sb_cc field is split into sb_ccc and sb_acc. > The sb_ccc stands for ""claimed character count", or "committed > character count". And the sb_acc is "available character count". > Consumers of socket buffer API shouldn't already access them directly, > but use sbused() and sbavail() respectively. > o Not ready mbufs are marked with M_NOTREADY, and ready but blocked ones > with M_BLOCKED. > o New field sb_fnrdy points to the first not ready mbuf, to avoid linear > search. > o New function sbready() is provided to activate certain amount of mbufs > in a socket buffer. > > A special note on SCTP: > SCTP has its own sockbufs. Unfortunately, FreeBSD stack doesn't yet > allow protocol specific sockbufs. Thus, SCTP does some hacks to make > itself compatible with FreeBSD: it manages sockbufs on its own, but keeps > sb_cc updated to inform the stack of amount of data in them. The new > notion of "not ready" data isn't supported by SCTP. Instead, only a > mechanical substitute is done: s/sb_cc/sb_ccc/. > A proper solution would be to take away struct sockbuf from struct > socket and allow protocols to implement their own socket buffers, like > SCTP already does. This was discussed with rrs@. > > Sponsored by: Netflix > Sponsored by: Nginx, Inc. > > Modified: > head/sys/dev/cxgbe/tom/t4_ddp.c > head/sys/kern/uipc_debug.c > head/sys/kern/uipc_sockbuf.c > head/sys/kern/uipc_socket.c > head/sys/netinet/sctp_indata.c > head/sys/netinet/sctp_input.c > head/sys/netinet/sctp_os_bsd.h > head/sys/netinet/sctp_output.c > head/sys/netinet/sctp_pcb.c > head/sys/netinet/sctp_pcb.h > head/sys/netinet/sctp_structs.h > head/sys/netinet/sctp_usrreq.c > head/sys/netinet/sctp_var.h > head/sys/netinet/sctputil.c > head/sys/netinet/sctputil.h > head/sys/sys/sockbuf.h > head/usr.bin/bluetooth/btsockstat/btsockstat.c > head/usr.bin/netstat/inet.c > head/usr.bin/netstat/netgraph.c > head/usr.bin/netstat/unix.c > head/usr.bin/systat/netstat.c > > Modified: head/sys/dev/cxgbe/tom/t4_ddp.c > ============================================================================== > --- head/sys/dev/cxgbe/tom/t4_ddp.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/dev/cxgbe/tom/t4_ddp.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -971,8 +971,9 @@ handle_ddp(struct socket *so, struct uio > */ > rc = sbwait(sb); > while (toep->ddp_flags & buf_flag) { > + /* XXXGL: shouldn't here be sbwait() call? */ > sb->sb_flags |= SB_WAIT; > - msleep(&sb->sb_cc, &sb->sb_mtx, PSOCK , "sbwait", 0); > + msleep(&sb->sb_acc, &sb->sb_mtx, PSOCK , "sbwait", 0); > } > unwire_ddp_buffer(db); > return (rc); > > Modified: head/sys/kern/uipc_debug.c > ============================================================================== > --- head/sys/kern/uipc_debug.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/kern/uipc_debug.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -401,7 +401,8 @@ db_print_sockbuf(struct sockbuf *sb, con > db_printf("sb_sndptroff: %u\n", sb->sb_sndptroff); > > db_print_indent(indent); > - db_printf("sb_cc: %u ", sb->sb_cc); > + db_printf("sb_acc: %u ", sb->sb_acc); > + db_printf("sb_ccc: %u ", sb->sb_ccc); > db_printf("sb_hiwat: %u ", sb->sb_hiwat); > db_printf("sb_mbcnt: %u ", sb->sb_mbcnt); > db_printf("sb_mbmax: %u\n", sb->sb_mbmax); > > Modified: head/sys/kern/uipc_sockbuf.c > ============================================================================== > --- head/sys/kern/uipc_sockbuf.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/kern/uipc_sockbuf.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -69,6 +69,43 @@ static struct mbuf *sbcut_internal(struc > static void sbflush_internal(struct sockbuf *sb); > > /* > + * Mark ready "count" mbufs starting with "m". > + */ > +int > +sbready(struct sockbuf *sb, struct mbuf *m, int count) > +{ > + u_int blocker; > + > + SOCKBUF_LOCK_ASSERT(sb); > + KASSERT(sb->sb_fnrdy != NULL, ("%s: sb %p NULL fnrdy", __func__, sb)); > + > + blocker = (sb->sb_fnrdy == m) ? M_BLOCKED : 0; > + > + for (int i = 0; i < count; i++, m = m->m_next) { > + KASSERT(m->m_flags & M_NOTREADY, > + ("%s: m %p !M_NOTREADY", __func__, m)); > + m->m_flags &= ~(M_NOTREADY | blocker); > + if (blocker) > + sb->sb_acc += m->m_len; > + } > + > + if (!blocker) > + return (EINPROGRESS); > + > + /* This one was blocking all the queue. */ > + for (; m && (m->m_flags & M_NOTREADY) == 0; m = m->m_next) { > + KASSERT(m->m_flags & M_BLOCKED, > + ("%s: m %p !M_BLOCKED", __func__, m)); > + m->m_flags &= ~M_BLOCKED; > + sb->sb_acc += m->m_len; > + } > + > + sb->sb_fnrdy = m; > + > + return (0); > +} > + > +/* > * Adjust sockbuf state reflecting allocation of m. > */ > void > @@ -77,7 +114,15 @@ sballoc(struct sockbuf *sb, struct mbuf > > SOCKBUF_LOCK_ASSERT(sb); > > - sb->sb_cc += m->m_len; > + sb->sb_ccc += m->m_len; > + > + if (sb->sb_fnrdy == NULL) { > + if (m->m_flags & M_NOTREADY) > + sb->sb_fnrdy = m; > + else > + sb->sb_acc += m->m_len; > + } else > + m->m_flags |= M_BLOCKED; > > if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) > sb->sb_ctl += m->m_len; > @@ -102,7 +147,25 @@ sbfree(struct sockbuf *sb, struct mbuf * > SOCKBUF_LOCK_ASSERT(sb); > #endif > > - sb->sb_cc -= m->m_len; > + sb->sb_ccc -= m->m_len; > + > + if (!(m->m_flags & M_NOTAVAIL)) > + sb->sb_acc -= m->m_len; > + > + if (m == sb->sb_fnrdy) { > + struct mbuf *n; > + > + KASSERT(m->m_flags & M_NOTREADY, > + ("%s: m %p !M_NOTREADY", __func__, m)); > + > + n = m->m_next; > + while (n != NULL && !(n->m_flags & M_NOTREADY)) { > + n->m_flags &= ~M_BLOCKED; > + sb->sb_acc += n->m_len; > + n = n->m_next; > + } > + sb->sb_fnrdy = n; > + } > > if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) > sb->sb_ctl -= m->m_len; > @@ -181,7 +244,7 @@ sbwait(struct sockbuf *sb) > SOCKBUF_LOCK_ASSERT(sb); > > sb->sb_flags |= SB_WAIT; > - return (msleep_sbt(&sb->sb_cc, &sb->sb_mtx, > + return (msleep_sbt(&sb->sb_acc, &sb->sb_mtx, > (sb->sb_flags & SB_NOINTR) ? PSOCK : PSOCK | PCATCH, "sbwait", > sb->sb_timeo, 0, 0)); > } > @@ -238,7 +301,7 @@ sowakeup(struct socket *so, struct sockb > sb->sb_flags &= ~SB_SEL; > if (sb->sb_flags & SB_WAIT) { > sb->sb_flags &= ~SB_WAIT; > - wakeup(&sb->sb_cc); > + wakeup(&sb->sb_acc); > } > KNOTE_LOCKED(&sb->sb_sel.si_note, 0); > if (sb->sb_upcall != NULL) { > @@ -609,12 +672,13 @@ sbappendstream(struct sockbuf *sb, struc > void > sbcheck(struct sockbuf *sb, const char *file, int line) > { > - struct mbuf *m, *n; > - u_long cc, mbcnt; > + struct mbuf *m, *n, *fnrdy; > + u_long acc, ccc, mbcnt; > > SOCKBUF_LOCK_ASSERT(sb); > > - cc = mbcnt = 0; > + acc = ccc = mbcnt = 0; > + fnrdy = NULL; > > for (m = sb->sb_mb; m; m = n) { > n = m->m_nextpkt; > @@ -623,15 +687,31 @@ sbcheck(struct sockbuf *sb, const char * > printf("sb %p empty mbuf %p\n", sb, m); > goto fail; > } > - cc += m->m_len; > + if ((m->m_flags & M_NOTREADY) && fnrdy == NULL) { > + if (m != sb->sb_fnrdy) { > + printf("sb %p: fnrdy %p != m %p\n", > + sb, sb->sb_fnrdy, m); > + goto fail; > + } > + fnrdy = m; > + } > + if (fnrdy) { > + if (!(m->m_flags & M_NOTAVAIL)) { > + printf("sb %p: fnrdy %p, m %p is avail\n", > + sb, sb->sb_fnrdy, m); > + goto fail; > + } > + } else > + acc += m->m_len; > + ccc += m->m_len; > mbcnt += MSIZE; > if (m->m_flags & M_EXT) /*XXX*/ /* pretty sure this is bogus */ > mbcnt += m->m_ext.ext_size; > } > } > - if (cc != sb->sb_cc || mbcnt != sb->sb_mbcnt) { > - printf("cc %ld != %u || mbcnt %ld != %u\n", cc, sb->sb_cc, > - mbcnt, sb->sb_mbcnt); > + if (acc != sb->sb_acc || ccc != sb->sb_ccc || mbcnt != sb->sb_mbcnt) { > + printf("acc %ld/%u ccc %ld/%u mbcnt %ld/%u\n", > + acc, sb->sb_acc, ccc, sb->sb_ccc, mbcnt, sb->sb_mbcnt); > goto fail; > } > return; > @@ -832,8 +912,8 @@ sbappendcontrol(struct sockbuf *sb, stru > * > * (2) The mbuf may be coalesced -- i.e., data in the mbuf may be copied into > * an mbuf already in the socket buffer. This can occur if an > - * appropriate mbuf exists, there is room, and no merging of data types > - * will occur. > + * appropriate mbuf exists, there is room, both mbufs are not marked as > + * not ready, and no merging of data types will occur. > * > * (3) The mbuf may be appended to the end of the existing mbuf chain. > * > @@ -862,13 +942,17 @@ sbcompress(struct sockbuf *sb, struct mb > if (n && (n->m_flags & M_EOR) == 0 && > M_WRITABLE(n) && > ((sb->sb_flags & SB_NOCOALESCE) == 0) && > + !(m->m_flags & M_NOTREADY) && > + !(n->m_flags & M_NOTREADY) && > m->m_len <= MCLBYTES / 4 && /* XXX: Don't copy too much */ > m->m_len <= M_TRAILINGSPACE(n) && > n->m_type == m->m_type) { > bcopy(mtod(m, caddr_t), mtod(n, caddr_t) + n->m_len, > (unsigned)m->m_len); > n->m_len += m->m_len; > - sb->sb_cc += m->m_len; > + sb->sb_ccc += m->m_len; > + if (sb->sb_fnrdy == NULL) > + sb->sb_acc += m->m_len; > if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) > /* XXX: Probably don't need.*/ > sb->sb_ctl += m->m_len; > @@ -905,13 +989,13 @@ sbflush_internal(struct sockbuf *sb) > * Don't call sbcut(sb, 0) if the leading mbuf is non-empty: > * we would loop forever. Panic instead. > */ > - if (!sb->sb_cc && (sb->sb_mb == NULL || sb->sb_mb->m_len)) > + if (sb->sb_ccc == 0 && (sb->sb_mb == NULL || sb->sb_mb->m_len)) > break; > - m_freem(sbcut_internal(sb, (int)sb->sb_cc)); > + m_freem(sbcut_internal(sb, (int)sb->sb_ccc)); > } > - if (sb->sb_cc || sb->sb_mb || sb->sb_mbcnt) > - panic("sbflush_internal: cc %u || mb %p || mbcnt %u", > - sb->sb_cc, (void *)sb->sb_mb, sb->sb_mbcnt); > + KASSERT(sb->sb_ccc == 0 && sb->sb_mb == 0 && sb->sb_mbcnt == 0, > + ("%s: ccc %u mb %p mbcnt %u", __func__, > + sb->sb_ccc, (void *)sb->sb_mb, sb->sb_mbcnt)); > } > > void > @@ -937,7 +1021,7 @@ sbflush(struct sockbuf *sb) > static struct mbuf * > sbcut_internal(struct sockbuf *sb, int len) > { > - struct mbuf *m, *n, *next, *mfree; > + struct mbuf *m, *next, *mfree; > > next = (m = sb->sb_mb) ? m->m_nextpkt : 0; > mfree = NULL; > @@ -949,9 +1033,12 @@ sbcut_internal(struct sockbuf *sb, int l > next = m->m_nextpkt; > } > if (m->m_len > len) { > + KASSERT(!(m->m_flags & M_NOTAVAIL), > + ("%s: m %p M_NOTAVAIL", __func__, m)); > m->m_len -= len; > m->m_data += len; > - sb->sb_cc -= len; > + sb->sb_ccc -= len; > + sb->sb_acc -= len; > if (sb->sb_sndptroff != 0) > sb->sb_sndptroff -= len; > if (m->m_type != MT_DATA && m->m_type != MT_OOBDATA) > @@ -960,10 +1047,20 @@ sbcut_internal(struct sockbuf *sb, int l > } > len -= m->m_len; > sbfree(sb, m); > - n = m->m_next; > - m->m_next = mfree; > - mfree = m; > - m = n; > + /* > + * Do not put M_NOTREADY buffers to the free list, they > + * are referenced from outside. > + */ > + if (m->m_flags & M_NOTREADY) > + m = m->m_next; > + else { > + struct mbuf *n; > + > + n = m->m_next; > + m->m_next = mfree; > + mfree = m; > + m = n; > + } > } > if (m) { > sb->sb_mb = m; > @@ -1030,8 +1127,8 @@ sbsndptr(struct sockbuf *sb, u_int off, > struct mbuf *m, *ret; > > KASSERT(sb->sb_mb != NULL, ("%s: sb_mb is NULL", __func__)); > - KASSERT(off + len <= sb->sb_cc, ("%s: beyond sb", __func__)); > - KASSERT(sb->sb_sndptroff <= sb->sb_cc, ("%s: sndptroff broken", __func__)); > + KASSERT(off + len <= sb->sb_acc, ("%s: beyond sb", __func__)); > + KASSERT(sb->sb_sndptroff <= sb->sb_acc, ("%s: sndptroff broken", __func__)); > > /* > * Is off below stored offset? Happens on retransmits. > @@ -1180,7 +1277,7 @@ void > sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb) > { > > - xsb->sb_cc = sb->sb_cc; > + xsb->sb_cc = sb->sb_ccc; > xsb->sb_hiwat = sb->sb_hiwat; > xsb->sb_mbcnt = sb->sb_mbcnt; > xsb->sb_mcnt = sb->sb_mcnt; > > Modified: head/sys/kern/uipc_socket.c > ============================================================================== > --- head/sys/kern/uipc_socket.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/kern/uipc_socket.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -1706,7 +1706,8 @@ dontblock: > */ > moff = 0; > offset = 0; > - while (m != NULL && uio->uio_resid > 0 && error == 0) { > + while (m != NULL && !(m->m_flags & M_NOTAVAIL) && uio->uio_resid > 0 > + && error == 0) { > /* > * If the type of mbuf has changed since the last mbuf > * examined ('type'), end the receive operation. > @@ -2044,6 +2045,8 @@ deliver: > for (m = sb->sb_mb; > m != NULL && m->m_len <= len; > m = m->m_next) { > + KASSERT(!(m->m_flags & M_NOTAVAIL), > + ("%s: m %p not available", __func__, m)); > len -= m->m_len; > uio->uio_resid -= m->m_len; > sbfree(sb, m); > > Modified: head/sys/netinet/sctp_indata.c > ============================================================================== > --- head/sys/netinet/sctp_indata.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_indata.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -70,14 +70,14 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, st > > /* > * This is really set wrong with respect to a 1-2-m socket. Since > - * the sb_cc is the count that everyone as put up. When we re-write > + * the sb_ccc is the count that everyone as put up. When we re-write > * sctp_soreceive then we will fix this so that ONLY this > * associations data is taken into account. > */ > if (stcb->sctp_socket == NULL) > return (calc); > > - if (stcb->asoc.sb_cc == 0 && > + if (stcb->asoc.sb_ccc == 0 && > asoc->size_on_reasm_queue == 0 && > asoc->size_on_all_streams == 0) { > /* Full rwnd granted */ > @@ -1363,7 +1363,7 @@ sctp_process_a_data_chunk(struct sctp_tc > * When we have NO room in the rwnd we check to make sure > * the reader is doing its job... > */ > - if (stcb->sctp_socket->so_rcv.sb_cc) { > + if (stcb->sctp_socket->so_rcv.sb_ccc) { > /* some to read, wake-up */ > #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) > struct socket *so; > > Modified: head/sys/netinet/sctp_input.c > ============================================================================== > --- head/sys/netinet/sctp_input.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_input.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -1032,7 +1032,7 @@ sctp_handle_shutdown_ack(struct sctp_shu > if (stcb->sctp_socket) { > if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || > (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { > - stcb->sctp_socket->so_snd.sb_cc = 0; > + stcb->sctp_socket->so_snd.sb_ccc = 0; > } > sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); > } > > Modified: head/sys/netinet/sctp_os_bsd.h > ============================================================================== > --- head/sys/netinet/sctp_os_bsd.h Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_os_bsd.h Sun Nov 30 12:52:33 2014 (r275326) > @@ -399,7 +399,7 @@ typedef struct callout sctp_os_timer_t; > #define SCTP_SOWAKEUP(so) wakeup(&(so)->so_timeo) > /* clear the socket buffer state */ > #define SCTP_SB_CLEAR(sb) \ > - (sb).sb_cc = 0; \ > + (sb).sb_ccc = 0; \ > (sb).sb_mb = NULL; \ > (sb).sb_mbcnt = 0; > > > Modified: head/sys/netinet/sctp_output.c > ============================================================================== > --- head/sys/netinet/sctp_output.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_output.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -7250,7 +7250,7 @@ one_more_time: > if ((stcb->sctp_socket != NULL) && \ > ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || > (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { > - atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc, sp->length); > + atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_ccc, sp->length); > } > if (sp->data) { > sctp_m_freem(sp->data); > @@ -11532,7 +11532,7 @@ jump_out: > drp->current_onq = htonl(asoc->size_on_reasm_queue + > asoc->size_on_all_streams + > asoc->my_rwnd_control_len + > - stcb->sctp_socket->so_rcv.sb_cc); > + stcb->sctp_socket->so_rcv.sb_ccc); > } else { > /*- > * If my rwnd is 0, possibly from mbuf depletion as well as > > Modified: head/sys/netinet/sctp_pcb.c > ============================================================================== > --- head/sys/netinet/sctp_pcb.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_pcb.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -3397,7 +3397,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, > if ((asoc->asoc.size_on_reasm_queue > 0) || > (asoc->asoc.control_pdapi) || > (asoc->asoc.size_on_all_streams > 0) || > - (so && (so->so_rcv.sb_cc > 0))) { > + (so && (so->so_rcv.sb_ccc > 0))) { > /* Left with Data unread */ > struct mbuf *op_err; > > @@ -3625,7 +3625,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, > TAILQ_REMOVE(&inp->read_queue, sq, next); > sctp_free_remote_addr(sq->whoFrom); > if (so) > - so->so_rcv.sb_cc -= sq->length; > + so->so_rcv.sb_ccc -= sq->length; > if (sq->data) { > sctp_m_freem(sq->data); > sq->data = NULL; > @@ -4853,7 +4853,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, > inp->sctp_flags |= SCTP_PCB_FLAGS_WAS_CONNECTED; > if (so) { > SOCK_LOCK(so); > - if (so->so_rcv.sb_cc == 0) { > + if (so->so_rcv.sb_ccc == 0) { > so->so_state &= ~(SS_ISCONNECTING | > SS_ISDISCONNECTING | > SS_ISCONFIRMING | > > Modified: head/sys/netinet/sctp_pcb.h > ============================================================================== > --- head/sys/netinet/sctp_pcb.h Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_pcb.h Sun Nov 30 12:52:33 2014 (r275326) > @@ -369,7 +369,7 @@ struct sctp_inpcb { > } ip_inp; > > > - /* Socket buffer lock protects read_queue and of course sb_cc */ > + /* Socket buffer lock protects read_queue and of course sb_ccc */ > struct sctp_readhead read_queue; > > LIST_ENTRY(sctp_inpcb) sctp_list; /* lists all endpoints */ > > Modified: head/sys/netinet/sctp_structs.h > ============================================================================== > --- head/sys/netinet/sctp_structs.h Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_structs.h Sun Nov 30 12:52:33 2014 (r275326) > @@ -990,7 +990,7 @@ struct sctp_association { > > uint32_t total_output_queue_size; > > - uint32_t sb_cc; /* shadow of sb_cc */ > + uint32_t sb_ccc; /* shadow of sb_ccc */ > uint32_t sb_send_resv; /* amount reserved on a send */ > uint32_t my_rwnd_control_len; /* shadow of sb_mbcnt used for rwnd > * control */ > > Modified: head/sys/netinet/sctp_usrreq.c > ============================================================================== > --- head/sys/netinet/sctp_usrreq.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_usrreq.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -586,7 +586,7 @@ sctp_must_try_again: > if (((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) && > (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) { > if (((so->so_options & SO_LINGER) && (so->so_linger == 0)) || > - (so->so_rcv.sb_cc > 0)) { > + (so->so_rcv.sb_ccc > 0)) { > #ifdef SCTP_LOG_CLOSING > sctp_log_closing(inp, NULL, 13); > #endif > @@ -751,7 +751,7 @@ sctp_disconnect(struct socket *so) > } > if (((so->so_options & SO_LINGER) && > (so->so_linger == 0)) || > - (so->so_rcv.sb_cc > 0)) { > + (so->so_rcv.sb_ccc > 0)) { > if (SCTP_GET_STATE(asoc) != > SCTP_STATE_COOKIE_WAIT) { > /* Left with Data unread */ > @@ -916,7 +916,7 @@ sctp_flush(struct socket *so, int how) > inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_CANT_READ; > SCTP_INP_READ_UNLOCK(inp); > SCTP_INP_WUNLOCK(inp); > - so->so_rcv.sb_cc = 0; > + so->so_rcv.sb_ccc = 0; > so->so_rcv.sb_mbcnt = 0; > so->so_rcv.sb_mb = NULL; > } > @@ -925,7 +925,7 @@ sctp_flush(struct socket *so, int how) > * First make sure the sb will be happy, we don't use these > * except maybe the count > */ > - so->so_snd.sb_cc = 0; > + so->so_snd.sb_ccc = 0; > so->so_snd.sb_mbcnt = 0; > so->so_snd.sb_mb = NULL; > > > Modified: head/sys/netinet/sctp_var.h > ============================================================================== > --- head/sys/netinet/sctp_var.h Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctp_var.h Sun Nov 30 12:52:33 2014 (r275326) > @@ -82,9 +82,9 @@ extern struct pr_usrreqs sctp_usrreqs; > > #define sctp_maxspace(sb) (max((sb)->sb_hiwat,SCTP_MINIMAL_RWND)) > > -#define sctp_sbspace(asoc, sb) ((long) ((sctp_maxspace(sb) > (asoc)->sb_cc) ? (sctp_maxspace(sb) - (asoc)->sb_cc) : 0)) > +#define sctp_sbspace(asoc, sb) ((long) ((sctp_maxspace(sb) > (asoc)->sb_ccc) ? (sctp_maxspace(sb) - (asoc)->sb_ccc) : 0)) > > -#define sctp_sbspace_failedmsgs(sb) ((long) ((sctp_maxspace(sb) > (sb)->sb_cc) ? (sctp_maxspace(sb) - (sb)->sb_cc) : 0)) > +#define sctp_sbspace_failedmsgs(sb) ((long) ((sctp_maxspace(sb) > (sb)->sb_ccc) ? (sctp_maxspace(sb) - (sb)->sb_ccc) : 0)) > > #define sctp_sbspace_sub(a,b) ((a > b) ? (a - b) : 0) > > @@ -195,10 +195,10 @@ extern struct pr_usrreqs sctp_usrreqs; > } > > #define sctp_sbfree(ctl, stcb, sb, m) { \ > - SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_cc, SCTP_BUF_LEN((m))); \ > + SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_ccc, SCTP_BUF_LEN((m))); \ > SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_mbcnt, MSIZE); \ > if (((ctl)->do_not_ref_stcb == 0) && stcb) {\ > - SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.sb_cc, SCTP_BUF_LEN((m))); \ > + SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.sb_ccc, SCTP_BUF_LEN((m))); \ > SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.my_rwnd_control_len, MSIZE); \ > } \ > if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \ > @@ -207,10 +207,10 @@ extern struct pr_usrreqs sctp_usrreqs; > } > > #define sctp_sballoc(stcb, sb, m) { \ > - atomic_add_int(&(sb)->sb_cc,SCTP_BUF_LEN((m))); \ > + atomic_add_int(&(sb)->sb_ccc,SCTP_BUF_LEN((m))); \ > atomic_add_int(&(sb)->sb_mbcnt, MSIZE); \ > if (stcb) { \ > - atomic_add_int(&(stcb)->asoc.sb_cc,SCTP_BUF_LEN((m))); \ > + atomic_add_int(&(stcb)->asoc.sb_ccc,SCTP_BUF_LEN((m))); \ > atomic_add_int(&(stcb)->asoc.my_rwnd_control_len, MSIZE); \ > } \ > if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \ > > Modified: head/sys/netinet/sctputil.c > ============================================================================== > --- head/sys/netinet/sctputil.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctputil.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -67,9 +67,9 @@ sctp_sblog(struct sockbuf *sb, struct sc > struct sctp_cwnd_log sctp_clog; > > sctp_clog.x.sb.stcb = stcb; > - sctp_clog.x.sb.so_sbcc = sb->sb_cc; > + sctp_clog.x.sb.so_sbcc = sb->sb_ccc; > if (stcb) > - sctp_clog.x.sb.stcb_sbcc = stcb->asoc.sb_cc; > + sctp_clog.x.sb.stcb_sbcc = stcb->asoc.sb_ccc; > else > sctp_clog.x.sb.stcb_sbcc = 0; > sctp_clog.x.sb.incr = incr; > @@ -4363,7 +4363,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp > { > /* > * Here we must place the control on the end of the socket read > - * queue AND increment sb_cc so that select will work properly on > + * queue AND increment sb_ccc so that select will work properly on > * read. > */ > struct mbuf *m, *prev = NULL; > @@ -4489,7 +4489,7 @@ sctp_append_to_readq(struct sctp_inpcb * > * the reassembly queue. > * > * If PDAPI this means we need to add m to the end of the data. > - * Increase the length in the control AND increment the sb_cc. > + * Increase the length in the control AND increment the sb_ccc. > * Otherwise sb is NULL and all we need to do is put it at the end > * of the mbuf chain. > */ > @@ -4701,10 +4701,10 @@ sctp_free_bufspace(struct sctp_tcb *stcb > > if (stcb->sctp_socket && (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) || > ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)))) { > - if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { > - stcb->sctp_socket->so_snd.sb_cc -= tp1->book_size; > + if (stcb->sctp_socket->so_snd.sb_ccc >= tp1->book_size) { > + stcb->sctp_socket->so_snd.sb_ccc -= tp1->book_size; > } else { > - stcb->sctp_socket->so_snd.sb_cc = 0; > + stcb->sctp_socket->so_snd.sb_ccc = 0; > > } > } > @@ -5254,11 +5254,11 @@ sctp_sorecvmsg(struct socket *so, > in_eeor_mode = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR); > if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RECV_RWND_LOGGING_ENABLE) { > sctp_misc_ints(SCTP_SORECV_ENTER, > - rwnd_req, in_eeor_mode, so->so_rcv.sb_cc, uio->uio_resid); > + rwnd_req, in_eeor_mode, so->so_rcv.sb_ccc, uio->uio_resid); > } > if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RECV_RWND_LOGGING_ENABLE) { > sctp_misc_ints(SCTP_SORECV_ENTERPL, > - rwnd_req, block_allowed, so->so_rcv.sb_cc, uio->uio_resid); > + rwnd_req, block_allowed, so->so_rcv.sb_ccc, uio->uio_resid); > } > error = sblock(&so->so_rcv, (block_allowed ? SBL_WAIT : 0)); > if (error) { > @@ -5277,23 +5277,23 @@ restart_nosblocks: > (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { > goto out; > } > - if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && (so->so_rcv.sb_cc == 0)) { > + if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && (so->so_rcv.sb_ccc == 0)) { > if (so->so_error) { > error = so->so_error; > if ((in_flags & MSG_PEEK) == 0) > so->so_error = 0; > goto out; > } else { > - if (so->so_rcv.sb_cc == 0) { > + if (so->so_rcv.sb_ccc == 0) { > /* indicate EOF */ > error = 0; > goto out; > } > } > } > - if ((so->so_rcv.sb_cc <= held_length) && block_allowed) { > + if ((so->so_rcv.sb_ccc <= held_length) && block_allowed) { > /* we need to wait for data */ > - if ((so->so_rcv.sb_cc == 0) && > + if ((so->so_rcv.sb_ccc == 0) && > ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || > (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { > if ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0) { > @@ -5329,7 +5329,7 @@ restart_nosblocks: > } > held_length = 0; > goto restart_nosblocks; > - } else if (so->so_rcv.sb_cc == 0) { > + } else if (so->so_rcv.sb_ccc == 0) { > if (so->so_error) { > error = so->so_error; > if ((in_flags & MSG_PEEK) == 0) > @@ -5386,11 +5386,11 @@ restart_nosblocks: > SCTP_INP_READ_LOCK(inp); > } > control = TAILQ_FIRST(&inp->read_queue); > - if ((control == NULL) && (so->so_rcv.sb_cc != 0)) { > + if ((control == NULL) && (so->so_rcv.sb_ccc != 0)) { > #ifdef INVARIANTS > panic("Huh, its non zero and nothing on control?"); > #endif > - so->so_rcv.sb_cc = 0; > + so->so_rcv.sb_ccc = 0; > } > SCTP_INP_READ_UNLOCK(inp); > hold_rlock = 0; > @@ -5511,11 +5511,11 @@ restart_nosblocks: > } > /* > * if we reach here, not suitable replacement is available > - * fragment interleave is NOT on. So stuff the sb_cc > + * fragment interleave is NOT on. So stuff the sb_ccc > * into the our held count, and its time to sleep again. > */ > - held_length = so->so_rcv.sb_cc; > - control->held_length = so->so_rcv.sb_cc; > + held_length = so->so_rcv.sb_ccc; > + control->held_length = so->so_rcv.sb_ccc; > goto restart; > } > /* Clear the held length since there is something to read */ > @@ -5812,10 +5812,10 @@ get_more_data: > if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { > sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, cp_len); > } > - atomic_subtract_int(&so->so_rcv.sb_cc, cp_len); > + atomic_subtract_int(&so->so_rcv.sb_ccc, cp_len); > if ((control->do_not_ref_stcb == 0) && > stcb) { > - atomic_subtract_int(&stcb->asoc.sb_cc, cp_len); > + atomic_subtract_int(&stcb->asoc.sb_ccc, cp_len); > } > copied_so_far += cp_len; > freed_so_far += cp_len; > @@ -5960,7 +5960,7 @@ wait_some_more: > (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_FRAG_INTERLEAVE))) { > goto release; > } > - if (so->so_rcv.sb_cc <= control->held_length) { > + if (so->so_rcv.sb_ccc <= control->held_length) { > error = sbwait(&so->so_rcv); > if (error) { > goto release; > @@ -5987,8 +5987,8 @@ wait_some_more: > } > goto done_with_control; > } > - if (so->so_rcv.sb_cc > held_length) { > - control->held_length = so->so_rcv.sb_cc; > + if (so->so_rcv.sb_ccc > held_length) { > + control->held_length = so->so_rcv.sb_ccc; > held_length = 0; > } > goto wait_some_more; > @@ -6135,13 +6135,13 @@ out: > freed_so_far, > ((uio) ? (slen - uio->uio_resid) : slen), > stcb->asoc.my_rwnd, > - so->so_rcv.sb_cc); > + so->so_rcv.sb_ccc); > } else { > sctp_misc_ints(SCTP_SORECV_DONE, > freed_so_far, > ((uio) ? (slen - uio->uio_resid) : slen), > 0, > - so->so_rcv.sb_cc); > + so->so_rcv.sb_ccc); > } > } > stage_left: > > Modified: head/sys/netinet/sctputil.h > ============================================================================== > --- head/sys/netinet/sctputil.h Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/netinet/sctputil.h Sun Nov 30 12:52:33 2014 (r275326) > @@ -286,10 +286,10 @@ do { \ > } \ > if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ > (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ > - if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { \ > - atomic_subtract_int(&((stcb)->sctp_socket->so_snd.sb_cc), tp1->book_size); \ > + if (stcb->sctp_socket->so_snd.sb_ccc >= tp1->book_size) { \ > + atomic_subtract_int(&((stcb)->sctp_socket->so_snd.sb_ccc), tp1->book_size); \ > } else { \ > - stcb->sctp_socket->so_snd.sb_cc = 0; \ > + stcb->sctp_socket->so_snd.sb_ccc = 0; \ > } \ > } \ > } \ > @@ -307,10 +307,10 @@ do { \ > } \ > if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ > (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ > - if (stcb->sctp_socket->so_snd.sb_cc >= sp->length) { \ > - atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc,sp->length); \ > + if (stcb->sctp_socket->so_snd.sb_ccc >= sp->length) { \ > + atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_ccc,sp->length); \ > } else { \ > - stcb->sctp_socket->so_snd.sb_cc = 0; \ > + stcb->sctp_socket->so_snd.sb_ccc = 0; \ > } \ > } \ > } \ > @@ -322,7 +322,7 @@ do { \ > if ((stcb->sctp_socket != NULL) && \ > ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ > (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ > - atomic_add_int(&stcb->sctp_socket->so_snd.sb_cc,sz); \ > + atomic_add_int(&stcb->sctp_socket->so_snd.sb_ccc,sz); \ > } \ > } while (0) > > > Modified: head/sys/sys/sockbuf.h > ============================================================================== > --- head/sys/sys/sockbuf.h Sun Nov 30 12:37:20 2014 (r275325) > +++ head/sys/sys/sockbuf.h Sun Nov 30 12:52:33 2014 (r275326) > @@ -89,8 +89,10 @@ struct sockbuf { > struct mbuf *sb_lastrecord; /* (c/d) first mbuf of last > * record in socket buffer */ > struct mbuf *sb_sndptr; /* (c/d) pointer into mbuf chain */ > + struct mbuf *sb_fnrdy; /* (c/d) pointer to first not ready buffer */ > u_int sb_sndptroff; /* (c/d) byte offset of ptr into chain */ > - u_int sb_cc; /* (c/d) actual chars in buffer */ > + u_int sb_acc; /* (c/d) available chars in buffer */ > + u_int sb_ccc; /* (c/d) claimed chars in buffer */ > u_int sb_hiwat; /* (c/d) max actual char count */ > u_int sb_mbcnt; /* (c/d) chars of mbufs used */ > u_int sb_mcnt; /* (c/d) number of mbufs in buffer */ > @@ -120,6 +122,13 @@ struct sockbuf { > #define SOCKBUF_LOCK_ASSERT(_sb) mtx_assert(SOCKBUF_MTX(_sb), MA_OWNED) > #define SOCKBUF_UNLOCK_ASSERT(_sb) mtx_assert(SOCKBUF_MTX(_sb), MA_NOTOWNED) > > +/* > + * Socket buffer private mbuf(9) flags. > + */ > +#define M_NOTREADY M_PROTO1 /* m_data not populated yet */ > +#define M_BLOCKED M_PROTO2 /* M_NOTREADY in front of m */ > +#define M_NOTAVAIL (M_NOTREADY | M_BLOCKED) > + > void sbappend(struct sockbuf *sb, struct mbuf *m); > void sbappend_locked(struct sockbuf *sb, struct mbuf *m); > void sbappendstream(struct sockbuf *sb, struct mbuf *m); > @@ -165,10 +174,11 @@ int sblock(struct sockbuf *sb, int flags > void sbunlock(struct sockbuf *sb); > void sballoc(struct sockbuf *, struct mbuf *); > void sbfree(struct sockbuf *, struct mbuf *); > +int sbready(struct sockbuf *, struct mbuf *, int); > > /* > * Return how much data is available to be taken out of socket > - * bufffer right now. > + * buffer right now. > */ > static inline u_int > sbavail(struct sockbuf *sb) > @@ -177,7 +187,7 @@ sbavail(struct sockbuf *sb) > #if 0 > SOCKBUF_LOCK_ASSERT(sb); > #endif > - return (sb->sb_cc); > + return (sb->sb_acc); > } > > /* > @@ -191,27 +201,30 @@ sbused(struct sockbuf *sb) > #if 0 > SOCKBUF_LOCK_ASSERT(sb); > #endif > - return (sb->sb_cc); > + return (sb->sb_ccc); > } > > /* > * How much space is there in a socket buffer (so->so_snd or so->so_rcv)? > * This is problematical if the fields are unsigned, as the space might > - * still be negative (cc > hiwat or mbcnt > mbmax). Should detect > - * overflow and return 0. Should use "lmin" but it doesn't exist now. > + * still be negative (ccc > hiwat or mbcnt > mbmax). > */ > -static __inline > -long > +static inline long > sbspace(struct sockbuf *sb) > { > - long bleft; > - long mleft; > + long bleft, mleft; > + > +#if 0 > + SOCKBUF_LOCK_ASSERT(sb); > +#endif > > if (sb->sb_flags & SB_STOP) > return(0); > - bleft = sb->sb_hiwat - sb->sb_cc; > + > + bleft = sb->sb_hiwat - sb->sb_ccc; > mleft = sb->sb_mbmax - sb->sb_mbcnt; > - return((bleft < mleft) ? bleft : mleft); > + > + return ((bleft < mleft) ? bleft : mleft); > } > > #define SB_EMPTY_FIXUP(sb) do { \ > > Modified: head/usr.bin/bluetooth/btsockstat/btsockstat.c > ============================================================================== > --- head/usr.bin/bluetooth/btsockstat/btsockstat.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/usr.bin/bluetooth/btsockstat/btsockstat.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -255,8 +255,8 @@ hcirawpr(kvm_t *kvmd, u_long addr) > (unsigned long) pcb.so, > (unsigned long) this, > pcb.flags, > - so.so_rcv.sb_cc, > - so.so_snd.sb_cc, > + so.so_rcv.sb_ccc, > + so.so_snd.sb_ccc, > pcb.addr.hci_node); > } > } /* hcirawpr */ > @@ -303,8 +303,8 @@ l2caprawpr(kvm_t *kvmd, u_long addr) > "%-8lx %-8lx %6d %6d %-17.17s\n", > (unsigned long) pcb.so, > (unsigned long) this, > - so.so_rcv.sb_cc, > - so.so_snd.sb_cc, > + so.so_rcv.sb_ccc, > + so.so_snd.sb_ccc, > bdaddrpr(&pcb.src, NULL, 0)); > } > } /* l2caprawpr */ > @@ -361,8 +361,8 @@ l2cappr(kvm_t *kvmd, u_long addr) > fprintf(stdout, > "%-8lx %6d %6d %-17.17s/%-5d %-17.17s %-5d %s\n", > (unsigned long) this, > - so.so_rcv.sb_cc, > - so.so_snd.sb_cc, > + so.so_rcv.sb_ccc, > + so.so_snd.sb_ccc, > bdaddrpr(&pcb.src, local, sizeof(local)), > pcb.psm, > bdaddrpr(&pcb.dst, remote, sizeof(remote)), > @@ -467,8 +467,8 @@ rfcommpr(kvm_t *kvmd, u_long addr) > fprintf(stdout, > "%-8lx %6d %6d %-17.17s %-17.17s %-4d %-4d %s\n", > (unsigned long) this, > - so.so_rcv.sb_cc, > - so.so_snd.sb_cc, > + so.so_rcv.sb_ccc, > + so.so_snd.sb_ccc, > bdaddrpr(&pcb.src, local, sizeof(local)), > bdaddrpr(&pcb.dst, remote, sizeof(remote)), > pcb.channel, > > Modified: head/usr.bin/netstat/inet.c > ============================================================================== > --- head/usr.bin/netstat/inet.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/usr.bin/netstat/inet.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -137,7 +137,7 @@ pcblist_sysctl(int proto, const char *na > static void > sbtoxsockbuf(struct sockbuf *sb, struct xsockbuf *xsb) > { > - xsb->sb_cc = sb->sb_cc; > + xsb->sb_cc = sb->sb_ccc; > xsb->sb_hiwat = sb->sb_hiwat; > xsb->sb_mbcnt = sb->sb_mbcnt; > xsb->sb_mcnt = sb->sb_mcnt; > @@ -479,7 +479,8 @@ protopr(u_long off, const char *name, in > printf("%6u %6u %6u ", tp->t_sndrexmitpack, > tp->t_rcvoopack, tp->t_sndzerowin); > } else { > - printf("%6u %6u ", so->so_rcv.sb_cc, so->so_snd.sb_cc); > + printf("%6u %6u ", > + so->so_rcv.sb_cc, so->so_snd.sb_cc); > } > if (numeric_port) { > if (inp->inp_vflag & INP_IPV4) { > > Modified: head/usr.bin/netstat/netgraph.c > ============================================================================== > --- head/usr.bin/netstat/netgraph.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/usr.bin/netstat/netgraph.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -119,7 +119,7 @@ netgraphprotopr(u_long off, const char * > if (Aflag) > printf("%8lx ", (u_long) this); > printf("%-5.5s %6u %6u ", > - name, sockb.so_rcv.sb_cc, sockb.so_snd.sb_cc); > + name, sockb.so_rcv.sb_ccc, sockb.so_snd.sb_ccc); > > /* Get info on associated node */ > if (ngpcb.node_id == 0 || csock == -1) > > Modified: head/usr.bin/netstat/unix.c > ============================================================================== > --- head/usr.bin/netstat/unix.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/usr.bin/netstat/unix.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -287,7 +287,8 @@ unixdomainpr(struct xunpcb *xunp, struct > } else { > printf("%8lx %-6.6s %6u %6u %8lx %8lx %8lx %8lx", > (long)so->so_pcb, socktype[so->so_type], so->so_rcv.sb_cc, > - so->so_snd.sb_cc, (long)unp->unp_vnode, (long)unp->unp_conn, > + so->so_snd.sb_cc, (long)unp->unp_vnode, > + (long)unp->unp_conn, > (long)LIST_FIRST(&unp->unp_refs), > (long)LIST_NEXT(unp, unp_reflink)); > } > > Modified: head/usr.bin/systat/netstat.c > ============================================================================== > --- head/usr.bin/systat/netstat.c Sun Nov 30 12:37:20 2014 (r275325) > +++ head/usr.bin/systat/netstat.c Sun Nov 30 12:52:33 2014 (r275326) > @@ -333,8 +333,8 @@ enter_kvm(struct inpcb *inp, struct sock > struct netinfo *p; > > if ((p = enter(inp, state, proto)) != NULL) { > - p->ni_rcvcc = so->so_rcv.sb_cc; > - p->ni_sndcc = so->so_snd.sb_cc; > + p->ni_rcvcc = so->so_rcv.sb_ccc; > + p->ni_sndcc = so->so_snd.sb_ccc; > } > } > > > From owner-svn-src-head@FreeBSD.ORG Sun Nov 30 23:21:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C2E6936; Sun, 30 Nov 2014 23:21:33 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 40AA919A; Sun, 30 Nov 2014 23:21:30 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id sAUNLEJm029343 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 1 Dec 2014 02:21:14 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id sAUNLEeh029342; Mon, 1 Dec 2014 02:21:14 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 1 Dec 2014 02:21:14 +0300 From: Gleb Smirnoff To: Robert Watson Subject: Re: svn commit: r275326 - in head: sys/dev/cxgbe/tom sys/kern sys/netinet sys/sys usr.bin/bluetooth/btsockstat usr.bin/netstat usr.bin/systat Message-ID: <20141130232114.GG47144@FreeBSD.org> References: <201411301252.sAUCqYXm055601@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 23:21:33 -0000 Robert, thanks for longer reply! On Sun, Nov 30, 2014 at 09:33:50PM +0000, Robert Watson wrote: R> I do have a substantial worry about 'compatibility' -- which is to say, the R> risk of not only running into trouble with more obscure bits of the network R> stack, but also third-party extensions in local code bases that may make R> previously reasonable assumptions about mbuf behaviour. >From viewpoint of outer code that deals with socket buffer code via APIs like sbappendstream(), sbdrop(), etc, the change is backward compatible. We still accept mbufs as we did before. Changes are applied only when we are explicitly called with PRUS_NOTREADY. Those who would suffer incompatibilities, are those who touch struct sockbuf itself, like SCTP does. Well, this isn't a right thing to do! Of course, the BSD stack didn't provide API for sockbufs, and our current stack doesn't provide an excellent API. In a very perfect case struct sockbuf should be private to uipc_sockbuf.c. We are very far from that, but we should head into that direction. R> One way to bound the R> scope of that issue is to ensure, very firmly, that these flags can never leak R> out of the socket-buffer/protocol components that explicitly support it. I R> think I might feel more comfortable if these were globally visible mbuf flags, R> which we could assert never passed through certain types of interfaces -- R> e.g., made it to ip_output(); it might also be useful to assert that these R> flags are never set when an mbuf is freed back to the mbuf allocator. I also R> worry that leakage of M_PROTO flags from other components could lead to quite R> hard-to-debug problems, and so it would be good to ensure that subsystems that R> will use these flags assert that they are never set as they arrive in the R> subsystem (e.g., tcp_input()). I'm not sure how we're doing on mbuf flags, R> but we might soon find we require another field in struct mbuf for them. R> Anywhere we can use assertions to help us with this kind of problem, I think R> it's a big win. Andre did a lot on asserting that M_PROTOs do not leak between protocol boundaries and subsystems. Probably, we can add more there. I don't like the idea of declaring these flags at global scope, although we used that during debugging. We actually should emphasize that they are local and hide them. The assertions can and should use M_PROTO defines. If we use M_NOTREADY define in assertions outside socket buffer code, that could be very misleading once such assertion fires. A developer would seek for the bug in socket buffer code, while a culprit could be any other code that uses M_PROTO1. If we move M_NOTREADY out of the M_PROTO* pool of bits, then we can very soon run out of bits. R> Although these changes have clearly been refined over an extended period, and R> were developed in a Subversion project branch, I think it would have been nice R> to be able to have more "Reviewed by:" entries in the commit message. I've R> been really happy to see a gradual change over the last few years towards a R> large percentage of network-stack commits having that tag, and think it's R> worth pursuing this pretty vigorously. A phabricator round to networks@ (or R> whatever the recently created alias/group was) would not go amiss in the R> future. While everyone is busy, creating an environment of mutual review R> (I'll scratch your back if you scratch mine) is very valuable -- especially R> for subsystems as subtle as the network stack. Looking back in the e-mail R> archives, I see that you did post a phabricator link to an earlier version of R> this work in May -- I suspect more armtwisting was required, but would in R> general be worth it. (I've been very tuned out the last few months due to R> ongoing things outside of the FreeBSD world -- but please do feel free to ping R> me if there's a critical patch like this in flight where I can at least lend a R> hand with a quick read.) Yes, I'm very sorry for not forcing people enough, but please understand that guilt is mutual there between me and potential reviewers. I didn't hide the upcoming patch under a carpet. I posted it several times. If you can do a post commit review, that would be much appreciated. I've split the changes into as small self-contained chunks as possible to make that easier. R> Although not an immediate issue, it may be worth looking at what happens to R> performance with these changes in the presence of lower-latency storage R> devices, such as nvme. Where there is substantial latency due to a spinning R> disk, or even a congested SATA-attached SSD, it's easy to see how these R> changes would improve performance. I do worry that with lower latency, you R> might see increases in lock contention -- or at least shifts, which would be R> worth understanding. I'm not sure if your testing environment is suitable for R> that (nor, I think, the FreeBSD Project's netperf cluster -- we've just R> received our first nvme device at the Computer Laboratory for network-stack R> performance work .. and it will be interesting to see how that plays out. R> With <30us RTT on I/O, multiqueue support, etc, the dynamics are changing R> quite a lot.) The concern would be that we might now be doing many more R> socket-buffer locking/wakeup-style events than before, and that if they are R> paced too quickly the threads will bump into each other. While I was working on the new sendfile, all the people who observed my work (scottl@, Igor Sysoev, others including myself) predicted that HDD based servers would benefit from new sendfile much more than SSD based servers. And now according to Netflix production, we mistaken :) I don't have a nice explanation for that phenomena right now. Regarding lock contention/wakeups. No, that wouldn't be many more, would be less. Let me count. Note that any software that wants to push above 10 Gig with heavy disk I/O via sendfile() now utilizes SF_NODISKIO. What happens: app -> sendfile() SOCKBUF_LOCK() at preamble for sbspace(); <- EBUSY app -> aio_read() app -> kevent <- aio done app -> sendfile() SOCKBUF_LOCK() at preamble for sbspace(); SOCKBUF_LOCK() at pru_send With new code: app -> sendfile() SOCKBUF_LOCK() at preamble for sbspace(); SOCKBUF_LOCK() at pru_send <- 0 cam -> sf_iodone() SOCKBUF_LOCK() at pru_ready Even less amount of locking the sockbuf, when serving a small request, that can be populated into VM cache with single aio_read(). If request is larger, app can bounce between sendfile returning EBUSY and aio_read several times. Anyway, all these acquisions of socket buffer lock are quite short. We used to profile contention on socket buffer locks at Netflix and we found only sbdrop() being a long one. This yilded in the sbcut() optimisation r256185. R> FWIW, I think it would be worth pondering adding an aio_sendfile(), if only R> because it would make it easier to expose this kernel asynchrony to userspace R> concurrency frameworks like libdispatch. We decided not to go for aio_sendfile() for the following two reasons: 1) The aio(4) is quite a heavy framework. It has kernel daemons, that have context etc. All AIO is actually serialized through queues, etc. We don't need all this heaviness for such simple task as sf_iodone(). We actually tried to implement aio_sendfile(), I tried and Adrian tried. This was not about to yield in a good code. 2) We aren't the most popular OS. If we introduce new API, no matter how cool it is, we also need all the software around to accept it and adopt. The new sendfile(2), not blocking on I/O, is not a new API. It is a drop in replacement or old implementation. Any software: nginx, varnish, lighttpd, etc, doesn't need recompilation neither code changes. Just upgrade to FreeBSD 11 and get some benefits. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 08:14:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 119612C0; Mon, 1 Dec 2014 08:14:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E56A0273; Mon, 1 Dec 2014 08:14:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB18EQjQ095077; Mon, 1 Dec 2014 08:14:26 GMT (envelope-from gleb@FreeBSD.org) Received: (from gleb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB18EQiF095072; Mon, 1 Dec 2014 08:14:26 GMT (envelope-from gleb@FreeBSD.org) Message-Id: <201412010814.sB18EQiF095072@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gleb set sender to gleb@FreeBSD.org using -f From: Gleb Kurtsou Date: Mon, 1 Dec 2014 08:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275354 - in head/tools/tools/shlib-compat: . test X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 08:14:27 -0000 Author: gleb Date: Mon Dec 1 08:14:25 2014 New Revision: 275354 URL: https://svnweb.freebsd.org/changeset/base/275354 Log: Update tools/shlib-compat. - Update dwarfdump / compiler support. Use hex instead of decimal for integers. Add boolean and restrict type definitions. Add options for specifing dwarfdump and objdump executables. - Fix reporting missing symbol definitions as matching. - Compare external variable definitions. - Exclude special symbols like _init, _end by default. - Fix test build. Modified: head/tools/tools/shlib-compat/shlib-compat.py head/tools/tools/shlib-compat/test/Makefile.inc head/tools/tools/shlib-compat/test/regress.sh Modified: head/tools/tools/shlib-compat/shlib-compat.py ============================================================================== --- head/tools/tools/shlib-compat/shlib-compat.py Mon Dec 1 07:37:29 2014 (r275353) +++ head/tools/tools/shlib-compat/shlib-compat.py Mon Dec 1 08:14:25 2014 (r275354) @@ -60,6 +60,14 @@ class Config(object): origfile = FileConfig() newfile = FileConfig() + exclude_sym_default = [ + '^__bss_start$', + '^_edata$', + '^_end$', + '^_fini$', + '^_init$', + ] + @classmethod def init(cls): cls.version_filter = StrFilter() @@ -338,15 +346,17 @@ class BaseTypeDef(Def): def _pp(self, pp): if self.encoding in self.inttypes: sign = '' if self.encoding == 'DW_ATE_signed' else 'u' - bits = int(self.byte_size) * 8 + bits = int(self.byte_size, 0) * 8 return '%sint%s_t' % (sign, bits) - elif self.encoding == 'DW_ATE_signed_char' and int(self.byte_size) == 1: + elif self.encoding == 'DW_ATE_signed_char' and int(self.byte_size, 0) == 1: return 'char'; + elif self.encoding == 'DW_ATE_boolean' and int(self.byte_size, 0) == 1: + return 'bool'; elif self.encoding == 'DW_ATE_float': - return self._mapval(self.byte_size, { - '16': 'long double', - '8': 'double', - '4': 'float', + return self._mapval(int(self.byte_size, 0), { + 16: 'long double', + 8: 'double', + 4: 'float', }) raise NotImplementedError('Invalid encoding: %s' % self) @@ -374,6 +384,11 @@ class VolatileTypeDef(AnonymousDef): def _pp(self, pp): return 'volatile ' + self.type._pp(pp) +class RestrictTypeDef(AnonymousDef): + _is_alias = True + def _pp(self, pp): + return 'restrict ' + self.type._pp(pp) + class ArrayDef(AnonymousDef): def _pp(self, pp): t = pp.run(self.type) @@ -411,6 +426,11 @@ class ParameterDef(Def): t = pp.run(self.type) return "%s %s" % (t, self._name_opt()) +class VariableDef(Def): + def _pp(self, pp): + t = pp.run(self.type) + return "%s %s" % (t, self._name_opt()) + # TODO class StructForwardDef(Def): pass @@ -485,6 +505,10 @@ class Dwarf(object): result = self._build_optarg_type(raw) return FunctionDef(raw.id, raw.name, params=params, result=result) + def build_variable(self, raw): + type = self._build_optarg_type(raw) + return VariableDef(raw.id, raw.optname, type=type) + def build_subroutine_type(self, raw): params = [ self.build(x) for x in raw.nested ] result = self._build_optarg_type(raw) @@ -547,6 +571,10 @@ class Dwarf(object): type = self._build_optarg_type(raw) return VolatileTypeDef(raw.id, type=type) + def build_restrict_type(self, raw): + type = self._build_optarg_type(raw) + return RestrictTypeDef(raw.id, type=type) + def build_enumeration_type(self, raw): # TODO handle DW_TAG_enumerator ??? return EnumerationTypeDef(raw.id, name=raw.optname, @@ -574,7 +602,7 @@ class Dwarf(object): return int(id) except ValueError: if (id.startswith('<') and id.endswith('>')): - return int(id[1:-1]) + return int(id[1:-1], 0) else: raise ValueError("Invalid dwarf id: %s" % id) @@ -782,7 +810,7 @@ class DwarfdumpParser(Parser): class Tag(object): def __init__(self, unit, data): self.unit = unit - self.id = int(data['id']) + self.id = int(data['id'], 0) self.level = int(data['level']) self.tag = data['tag'] self.args = {} @@ -816,7 +844,7 @@ class DwarfdumpParser(Parser): def __repr__(self): return "Tag(%d, %d, %s)" % (self.level, self.id, self.tag) - re_header = re.compile('<(?P\d+)><(?P\d+\+*\d*)><(?P\w+)>') + re_header = re.compile('<(?P\d+)><(?P[0xX0-9a-fA-F]+(?:\+(0[xX])?[0-9a-fA-F]+)?)><(?P\w+)>') re_argname = re.compile('(?P\w+)<') re_argunknown = re.compile('<[^<>]+>') @@ -827,6 +855,10 @@ class DwarfdumpParser(Parser): 'DW_TAG_variable', ]) + external_tags = set([ + 'DW_TAG_variable', + ]) + def __init__(self, libfile): Parser.__init__(self, "%s -di %s" % (Config.dwarfdump, libfile)) self.current_unit = None @@ -888,9 +920,19 @@ class DwarfdumpParser(Parser): while args: args = self.parse_arg(tag, args) tag.unit.tags[tag.id] = tag - if tag.args.has_key('DW_AT_low_pc') and \ - tag.tag not in DwarfdumpParser.skip_tags: - offset = int(tag.args['DW_AT_low_pc'], 16) + def parse_offset(tag): + if tag.args.has_key('DW_AT_low_pc'): + return int(tag.args['DW_AT_low_pc'], 16) + elif tag.args.has_key('DW_AT_location'): + location = tag.args['DW_AT_location'] + if location.startswith('DW_OP_addr'): + return int(location.replace('DW_OP_addr', ''), 16) + return None + offset = parse_offset(tag) + if offset is not None and \ + (tag.tag not in DwarfdumpParser.skip_tags or \ + (tag.args.has_key('DW_AT_external') and \ + tag.tag in DwarfdumpParser.external_tags)): if self.offsetmap.has_key(offset): raise ValueError("Dwarf dump parse error: " + "symbol is aleady defined at offset 0x%x" % offset) @@ -963,10 +1005,15 @@ def cmp_symbols(commonver): names.sort() for symname in names: sym = ver.symbols[symname] - match = sym.origsym.definition == sym.newsym.definition + missing = sym.origsym.definition is None or sym.newsym.definition is None + match = not missing and sym.origsym.definition == sym.newsym.definition if not match: App.result_code = 1 if Config.verbose >= 1 or not match: + if missing: + print '%s: missing definition' % \ + (sym.origsym.name_ver,) + continue print '%s: definitions %smatch' % \ (sym.origsym.name_ver, "" if match else "mis") if Config.dump or (not match and not Config.no_dump): @@ -1035,10 +1082,16 @@ if __name__ == '__main__': help="result output file for original library", metavar="ORIGFILE") parser.add_option('--out-new', action='store', help="result output file for new library", metavar="NEWFILE") + parser.add_option('--dwarfdump', action='store', + help="path to dwarfdump executable", metavar="DWARFDUMP") + parser.add_option('--objdump', action='store', + help="path to objdump executable", metavar="OBJDUMP") parser.add_option('--exclude-ver', action='append', metavar="RE") parser.add_option('--include-ver', action='append', metavar="RE") parser.add_option('--exclude-sym', action='append', metavar="RE") parser.add_option('--include-sym', action='append', metavar="RE") + parser.add_option('--no-exclude-sym-default', action='store_true', + help="don't exclude special symbols like _init, _end, __bss_start") for opt in ['alias', 'cached', 'symbol']: parser.add_option("--w-" + opt, action="store_true", dest="w_" + opt) @@ -1049,6 +1102,10 @@ if __name__ == '__main__': if len(args) != 2: parser.print_help() sys.exit(-1) + if opts.dwarfdump: + Config.dwarfdump = opts.dwarfdump + if opts.objdump: + Config.objdump = opts.objdump if opts.out_orig: Config.origfile.init(opts.out_orig) if opts.out_new: @@ -1071,6 +1128,8 @@ if __name__ == '__main__': opt = getattr(opts, a + k) if opt: getattr(v, a).extend(opt) + if not opts.no_exclude_sym_default: + Config.symbol_filter.exclude.extend(Config.exclude_sym_default) Config.version_filter.compile() Config.symbol_filter.compile() for w in ['w_alias', 'w_cached', 'w_symbol']: Modified: head/tools/tools/shlib-compat/test/Makefile.inc ============================================================================== --- head/tools/tools/shlib-compat/test/Makefile.inc Mon Dec 1 07:37:29 2014 (r275353) +++ head/tools/tools/shlib-compat/test/Makefile.inc Mon Dec 1 08:14:25 2014 (r275354) @@ -11,3 +11,5 @@ DEBUG_FLAGS?= -g VERSION_DEF= ${.CURDIR}/../Versions.def SYMBOL_MAPS= ${.CURDIR}/Symbol.map + +MK_DEBUG_FILES= yes Modified: head/tools/tools/shlib-compat/test/regress.sh ============================================================================== --- head/tools/tools/shlib-compat/test/regress.sh Mon Dec 1 07:37:29 2014 (r275353) +++ head/tools/tools/shlib-compat/test/regress.sh Mon Dec 1 08:14:25 2014 (r275354) @@ -1,7 +1,7 @@ #!/bin/sh # $FreeBSD$ -run() { ../shlib-compat.py --no-dump -vv libtest$1/libtest$1.so.0.debug libtest$2/libtest$2.so.0.debug; } +run() { ../shlib-compat.py --no-dump -vv libtest$1/libtest$1.so.0.full libtest$2/libtest$2.so.0.full; } echo 1..9 REGRESSION_START($1) REGRESSION_TEST(`1-1', `run 1 1') From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 10:17:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBAAA2DB; Mon, 1 Dec 2014 10:17:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A84F0C7; Mon, 1 Dec 2014 10:17:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1AHOJx051186; Mon, 1 Dec 2014 10:17:24 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1AHONS051185; Mon, 1 Dec 2014 10:17:24 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201412011017.sB1AHONS051185@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Mon, 1 Dec 2014 10:17:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275355 - head/tools/tools/sysbuild X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 10:17:24 -0000 Author: phk Date: Mon Dec 1 10:17:23 2014 New Revision: 275355 URL: https://svnweb.freebsd.org/changeset/base/275355 Log: Face the fact that we have no idea where the ports tree really lives. Modified: head/tools/tools/sysbuild/sysbuild.sh Modified: head/tools/tools/sysbuild/sysbuild.sh ============================================================================== --- head/tools/tools/sysbuild/sysbuild.sh Mon Dec 1 08:14:25 2014 (r275354) +++ head/tools/tools/sysbuild/sysbuild.sh Mon Dec 1 10:17:23 2014 (r275355) @@ -226,8 +226,7 @@ ports_build() ( t=`echo $p | sed 's,/usr/ports/,,'` pn=`cd $p && make package-name` - if [ "x$p" == "x/usr/ports/ports-mgmt/pkg" -o \ - "x$p" == "x/freebsd/ports/ports-mgmt/pkg" ] ; then + if [ "x`basename $p`" == "xpkg" ] ; then log_it "Very Special: $t ($pn)" ( From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 11:45:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5B5C0ABA; Mon, 1 Dec 2014 11:45:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4472CAD; Mon, 1 Dec 2014 11:45:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1Bjap0092952; Mon, 1 Dec 2014 11:45:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1BjPEI092904; Mon, 1 Dec 2014 11:45:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412011145.sB1BjPEI092904@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 1 Dec 2014 11:45:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275358 - in head/sys: dev/bxe dev/cxgb dev/cxgbe dev/e1000 dev/ixgbe dev/ixl dev/mxge dev/netmap dev/oce dev/qlxgbe dev/qlxge dev/sfxge dev/virtio/network dev/vmware/vmxnet3 dev/vxge n... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 11:45:36 -0000 Author: hselasky Date: Mon Dec 1 11:45:24 2014 New Revision: 275358 URL: https://svnweb.freebsd.org/changeset/base/275358 Log: Start process of removing the use of the deprecated "M_FLOWID" flag from the FreeBSD network code. The flag is still kept around in the "sys/mbuf.h" header file, but does no longer have any users. Instead the "m_pkthdr.rsstype" field in the mbuf structure is now used to decide the meaning of the "m_pkthdr.flowid" field. To modify the "m_pkthdr.rsstype" field please use the existing "M_HASHTYPE_XXX" macros as defined in the "sys/mbuf.h" header file. This patch introduces new behaviour in the transmit direction. Previously network drivers checked if "M_FLOWID" was set in "m_flags" before using the "m_pkthdr.flowid" field. This check has now now been replaced by checking if "M_HASHTYPE_GET(m)" is different from "M_HASHTYPE_NONE". In the future more hashtypes will be added, for example hashtypes for hardware dedicated flows. "M_HASHTYPE_OPAQUE" indicates that the "m_pkthdr.flowid" value is valid and has no particular type. This change removes the need for an "if" statement in TCP transmit code checking for the presence of a valid flowid value. The "if" statement mentioned above is now a direct variable assignment which is then later checked by the respective network drivers like before. Additional notes: - The SCTP code changes will be committed as a separate patch. - Removal of the "M_FLOWID" flag will also be done separately. - The FreeBSD version has been bumped. MFC after: 1 month Sponsored by: Mellanox Technologies Modified: head/sys/dev/bxe/bxe.c head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c head/sys/dev/ixgbe/ixv.c head/sys/dev/ixl/ixl_txrx.c head/sys/dev/mxge/if_mxge.c head/sys/dev/netmap/netmap_freebsd.c head/sys/dev/oce/oce_if.c head/sys/dev/qlxgbe/ql_isr.c head/sys/dev/qlxgbe/ql_os.c head/sys/dev/qlxge/qls_isr.c head/sys/dev/qlxge/qls_os.c head/sys/dev/sfxge/sfxge_rx.c head/sys/dev/sfxge/sfxge_tx.c head/sys/dev/virtio/network/if_vtnet.c head/sys/dev/vmware/vmxnet3/if_vmx.c head/sys/dev/vxge/vxge.c head/sys/net/flowtable.c head/sys/net/ieee8023ad_lacp.c head/sys/net/if_lagg.c head/sys/net/if_lagg.h head/sys/net/if_vxlan.c head/sys/net/netisr.c head/sys/netinet/in_pcb.h head/sys/netinet/in_rss.c head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_syncache.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/in6_pcb.c head/sys/netinet6/ip6_output.c head/sys/netinet6/udp6_usrreq.c head/sys/ofed/drivers/net/mlx4/en_rx.c head/sys/ofed/drivers/net/mlx4/en_tx.c head/sys/sys/param.h Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/bxe/bxe.c Mon Dec 1 11:45:24 2014 (r275358) @@ -3219,7 +3219,7 @@ bxe_tpa_stop(struct bxe_softc * #if __FreeBSD_version >= 800000 /* specify what RSS queue was used for this flow */ m->m_pkthdr.flowid = fp->index; - m->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); #endif if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); @@ -3454,7 +3454,7 @@ bxe_rxeof(struct bxe_softc *sc, #if __FreeBSD_version >= 800000 /* specify what RSS queue was used for this flow */ m->m_pkthdr.flowid = fp->index; - m->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); #endif next_rx: @@ -6037,10 +6037,9 @@ bxe_tx_mq_start(struct ifnet *ifp, fp_index = 0; /* default is the first queue */ - /* change the queue if using flow ID */ - if ((m->m_flags & M_FLOWID) != 0) { + /* check if flowid is set */ + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) fp_index = (m->m_pkthdr.flowid % sc->num_queues); - } fp = &sc->fp[fp_index]; Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/cxgb/cxgb_sge.c Mon Dec 1 11:45:24 2014 (r275358) @@ -1733,8 +1733,9 @@ cxgb_transmit(struct ifnet *ifp, struct m_freem(m); return (0); } - - if (m->m_flags & M_FLOWID) + + /* check if flowid is set */ + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) qidx = (m->m_pkthdr.flowid % pi->nqsets) + pi->first_qset; qs = &pi->adapter->sge.qs[qidx]; @@ -2899,9 +2900,10 @@ process_responses(adapter_t *adap, struc eop = get_packet(adap, drop_thresh, qs, mh, r); if (eop) { - if (r->rss_hdr.hash_type && !adap->timestamp) - mh->mh_head->m_flags |= M_FLOWID; - mh->mh_head->m_pkthdr.flowid = rss_hash; + if (r->rss_hdr.hash_type && !adap->timestamp) { + M_HASHTYPE_SET(mh->mh_head, M_HASHTYPE_OPAQUE); + mh->mh_head->m_pkthdr.flowid = rss_hash; + } } ethpad = 2; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/cxgbe/t4_main.c Mon Dec 1 11:45:24 2014 (r275358) @@ -1440,7 +1440,8 @@ cxgbe_transmit(struct ifnet *ifp, struct return (ENETDOWN); } - if (m->m_flags & M_FLOWID) + /* check if flowid is set */ + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) txq += ((m->m_pkthdr.flowid % (pi->ntxq - pi->rsrv_noflowq)) + pi->rsrv_noflowq); br = txq->br; Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/cxgbe/t4_sge.c Mon Dec 1 11:45:24 2014 (r275358) @@ -1734,7 +1734,7 @@ t4_eth_rx(struct sge_iq *iq, const struc m0->m_data += fl_pktshift; m0->m_pkthdr.rcvif = ifp; - m0->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m0, M_HASHTYPE_OPAQUE); m0->m_pkthdr.flowid = be32toh(rss->hash_val); if (cpl->csum_calc && !cpl->err_vec) { Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/e1000/if_igb.c Mon Dec 1 11:45:24 2014 (r275358) @@ -990,7 +990,7 @@ igb_mq_start(struct ifnet *ifp, struct m * If everything is setup correctly, it should be the * same bucket that the current CPU we're on is. */ - if ((m->m_flags & M_FLOWID) != 0) { + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { #ifdef RSS if (rss_hash2bucket(m->m_pkthdr.flowid, M_HASHTYPE_GET(m), &bucket_id) == 0) { @@ -5166,7 +5166,6 @@ igb_rxeof(struct igb_queue *que, int cou /* XXX set flowtype once this works right */ rxr->fmp->m_pkthdr.flowid = le32toh(cur->wb.lower.hi_dword.rss); - rxr->fmp->m_flags |= M_FLOWID; switch (pkt_info & E1000_RXDADV_RSSTYPE_MASK) { case E1000_RXDADV_RSSTYPE_IPV4_TCP: M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_RSS_TCP_IPV4); @@ -5196,11 +5195,11 @@ igb_rxeof(struct igb_queue *que, int cou default: /* XXX fallthrough */ - M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_NONE); + M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_OPAQUE); } #elif !defined(IGB_LEGACY_TX) rxr->fmp->m_pkthdr.flowid = que->msix; - rxr->fmp->m_flags |= M_FLOWID; + M_HASHTYPE_SET(rxr->fmp, M_HASHTYPE_OPAQUE); #endif sendmp = rxr->fmp; /* Make sure to set M_PKTHDR. */ Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/ixgbe/ixgbe.c Mon Dec 1 11:45:24 2014 (r275358) @@ -833,7 +833,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct * If everything is setup correctly, it should be the * same bucket that the current CPU we're on is. */ - if ((m->m_flags & M_FLOWID) != 0) { + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { #ifdef RSS if (rss_hash2bucket(m->m_pkthdr.flowid, M_HASHTYPE_GET(m), &bucket_id) == 0) { @@ -4764,7 +4764,6 @@ ixgbe_rxeof(struct ix_queue *que) #ifdef RSS sendmp->m_pkthdr.flowid = le32toh(cur->wb.lower.hi_dword.rss); - sendmp->m_flags |= M_FLOWID; switch (pkt_info & IXGBE_RXDADV_RSSTYPE_MASK) { case IXGBE_RXDADV_RSSTYPE_IPV4_TCP: M_HASHTYPE_SET(sendmp, M_HASHTYPE_RSS_TCP_IPV4); @@ -4795,11 +4794,12 @@ ixgbe_rxeof(struct ix_queue *que) break; default: /* XXX fallthrough */ - M_HASHTYPE_SET(sendmp, M_HASHTYPE_NONE); + M_HASHTYPE_SET(sendmp, M_HASHTYPE_OPAQUE); + break; } #else /* RSS */ sendmp->m_pkthdr.flowid = que->msix; - sendmp->m_flags |= M_FLOWID; + M_HASHTYPE_SET(sendmp, M_HASHTYPE_OPAQUE); #endif /* RSS */ #endif /* FreeBSD_version */ } Modified: head/sys/dev/ixgbe/ixv.c ============================================================================== --- head/sys/dev/ixgbe/ixv.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/ixgbe/ixv.c Mon Dec 1 11:45:24 2014 (r275358) @@ -580,7 +580,7 @@ ixv_mq_start(struct ifnet *ifp, struct m int i = 0, err = 0; /* Which queue to use */ - if ((m->m_flags & M_FLOWID) != 0) + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) i = m->m_pkthdr.flowid % adapter->num_queues; txr = &adapter->tx_rings[i]; @@ -3464,7 +3464,7 @@ ixv_rxeof(struct ix_queue *que, int coun ixv_rx_checksum(staterr, sendmp, ptype); #if __FreeBSD_version >= 800000 sendmp->m_pkthdr.flowid = que->msix; - sendmp->m_flags |= M_FLOWID; + M_HASHTYPE_SET(sendmp, M_HASHTYPE_OPAQUE); #endif } next_desc: Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/ixl/ixl_txrx.c Mon Dec 1 11:45:24 2014 (r275358) @@ -66,8 +66,8 @@ ixl_mq_start(struct ifnet *ifp, struct m struct tx_ring *txr; int err, i; - /* Which queue to use */ - if ((m->m_flags & M_FLOWID) != 0) + /* check if flowid is set */ + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) i = m->m_pkthdr.flowid % vsi->num_queues; else i = curcpu % vsi->num_queues; @@ -1543,7 +1543,7 @@ ixl_rxeof(struct ixl_queue *que, int cou if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) ixl_rx_checksum(sendmp, status, error, ptype); sendmp->m_pkthdr.flowid = que->msix; - sendmp->m_flags |= M_FLOWID; + M_HASHTYPE_SET(sendmp, M_HASHTYPE_OPAQUE); } next_desc: bus_dmamap_sync(rxr->dma.tag, rxr->dma.map, Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/mxge/if_mxge.c Mon Dec 1 11:45:24 2014 (r275358) @@ -2719,7 +2719,7 @@ mxge_rx_done_big(struct mxge_slice_state /* flowid only valid if RSS hashing is enabled */ if (sc->num_slices > 1) { m->m_pkthdr.flowid = (ss - sc->ss); - m->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); } /* pass the frame up the stack */ (*ifp->if_input)(ifp, m); @@ -2787,7 +2787,7 @@ mxge_rx_done_small(struct mxge_slice_sta /* flowid only valid if RSS hashing is enabled */ if (sc->num_slices > 1) { m->m_pkthdr.flowid = (ss - sc->ss); - m->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); } /* pass the frame up the stack */ (*ifp->if_input)(ifp, m); Modified: head/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- head/sys/dev/netmap/netmap_freebsd.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/netmap/netmap_freebsd.c Mon Dec 1 11:45:24 2014 (r275358) @@ -204,7 +204,7 @@ netmap_catch_tx(struct netmap_generic_ad * of the transmission does not consume resources. * * On FreeBSD, and on multiqueue cards, we can force the queue using - * if ((m->m_flags & M_FLOWID) != 0) + * if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) * i = m->m_pkthdr.flowid % adapter->num_queues; * else * i = curcpu % adapter->num_queues; @@ -240,7 +240,7 @@ generic_xmit_frame(struct ifnet *ifp, st m->m_len = m->m_pkthdr.len = len; // inc refcount. All ours, we could skip the atomic atomic_fetchadd_int(PNT_MBUF_REFCNT(m), 1); - m->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); m->m_pkthdr.flowid = ring_nr; m->m_pkthdr.rcvif = ifp; /* used for tx notification */ ret = NA(ifp)->if_transmit(ifp, m); Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/oce/oce_if.c Mon Dec 1 11:45:24 2014 (r275358) @@ -563,7 +563,7 @@ oce_multiq_start(struct ifnet *ifp, stru int queue_index = 0; int status = 0; - if ((m->m_flags & M_FLOWID) != 0) + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) queue_index = m->m_pkthdr.flowid % sc->nwqs; wq = sc->wq[queue_index]; @@ -1374,7 +1374,7 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i m->m_pkthdr.flowid = (rq->queue_index - 1); else m->m_pkthdr.flowid = rq->queue_index; - m->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); #endif /* This deternies if vlan tag is Valid */ if (oce_cqe_vtp_valid(sc, cqe)) { Modified: head/sys/dev/qlxgbe/ql_isr.c ============================================================================== --- head/sys/dev/qlxgbe/ql_isr.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/qlxgbe/ql_isr.c Mon Dec 1 11:45:24 2014 (r275358) @@ -159,7 +159,7 @@ qla_rx_intr(qla_host_t *ha, qla_sgl_rcv_ if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); mpf->m_pkthdr.flowid = sgc->rss_hash; - mpf->m_flags |= M_FLOWID; + M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE); (*ifp->if_input)(ifp, mpf); @@ -324,7 +324,7 @@ qla_lro_intr(qla_host_t *ha, qla_sgl_lro mpf->m_pkthdr.csum_data = 0xFFFF; mpf->m_pkthdr.flowid = sgc->rss_hash; - mpf->m_flags |= M_FLOWID; + M_HASHTYPE_SET(mpf, M_HASHTYPE_OPAQUE); if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); Modified: head/sys/dev/qlxgbe/ql_os.c ============================================================================== --- head/sys/dev/qlxgbe/ql_os.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/qlxgbe/ql_os.c Mon Dec 1 11:45:24 2014 (r275358) @@ -1140,7 +1140,8 @@ qla_send(qla_host_t *ha, struct mbuf **m QL_DPRINT8(ha, (ha->pci_dev, "%s: enter\n", __func__)); - if (m_head->m_flags & M_FLOWID) + /* check if flowid is set */ + if (M_HASHTYPE_GET(m_head) != M_HASHTYPE_NONE) txr_idx = m_head->m_pkthdr.flowid & (ha->hw.num_tx_rings - 1); tx_idx = ha->hw.tx_cntxt[txr_idx].txr_next; Modified: head/sys/dev/qlxge/qls_isr.c ============================================================================== --- head/sys/dev/qlxge/qls_isr.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/qlxge/qls_isr.c Mon Dec 1 11:45:24 2014 (r275358) @@ -190,7 +190,7 @@ qls_rx_comp(qla_host_t *ha, uint32_t rxr if ((cq_e->flags1 & Q81_RX_FLAGS1_RSS_MATCH_MASK)) { rxr->rss_int++; mp->m_pkthdr.flowid = cq_e->rss; - mp->m_flags |= M_FLOWID; + M_HASHTYPE_SET(mp, M_HASHTYPE_OPAQUE); } if (cq_e->flags0 & (Q81_RX_FLAGS0_TE | Q81_RX_FLAGS0_NU | Q81_RX_FLAGS0_IE)) { Modified: head/sys/dev/qlxge/qls_os.c ============================================================================== --- head/sys/dev/qlxge/qls_os.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/qlxge/qls_os.c Mon Dec 1 11:45:24 2014 (r275358) @@ -1136,7 +1136,8 @@ qls_send(qla_host_t *ha, struct mbuf **m QL_DPRINT8((ha->pci_dev, "%s: enter\n", __func__)); - if (m_head->m_flags & M_FLOWID) + /* check if flowid is set */ + if (M_HASHTYPE_GET(m_head) != M_HASHTYPE_NONE) txr_idx = m_head->m_pkthdr.flowid & (ha->num_tx_rings - 1); tx_idx = ha->tx_ring[txr_idx].txr_next; Modified: head/sys/dev/sfxge/sfxge_rx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_rx.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/sfxge/sfxge_rx.c Mon Dec 1 11:45:24 2014 (r275358) @@ -302,7 +302,7 @@ sfxge_rx_deliver(struct sfxge_softc *sc, if (rx_desc->flags & EFX_PKT_TCP) { m->m_pkthdr.flowid = EFX_RX_HASH_VALUE(EFX_RX_HASHALG_TOEPLITZ, mtod(m, uint8_t *)); - m->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); } #endif m->m_data += sc->rx_prefix_size; @@ -353,7 +353,7 @@ sfxge_lro_deliver(struct sfxge_lro_state #ifdef SFXGE_HAVE_MQ m->m_pkthdr.flowid = c->conn_hash; - m->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); #endif m->m_pkthdr.csum_flags = csum_flags; __sfxge_rx_deliver(sc, m); Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/sfxge/sfxge_tx.c Mon Dec 1 11:45:24 2014 (r275358) @@ -631,7 +631,8 @@ sfxge_if_transmit(struct ifnet *ifp, str if (m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_TSO)) { int index = 0; - if (m->m_flags & M_FLOWID) { + /* check if flowid is set */ + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { uint32_t hash = m->m_pkthdr.flowid; index = sc->rx_indir_table[hash % SFXGE_RX_SCALE_MAX]; Modified: head/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- head/sys/dev/virtio/network/if_vtnet.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/virtio/network/if_vtnet.c Mon Dec 1 11:45:24 2014 (r275358) @@ -1701,7 +1701,7 @@ vtnet_rxq_input(struct vtnet_rxq *rxq, s } m->m_pkthdr.flowid = rxq->vtnrx_id; - m->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); /* * BMV: FreeBSD does not have the UNNECESSARY and PARTIAL checksum @@ -2347,7 +2347,8 @@ vtnet_txq_mq_start(struct ifnet *ifp, st sc = ifp->if_softc; npairs = sc->vtnet_act_vq_pairs; - if (m->m_flags & M_FLOWID) + /* check if flowid is set */ + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) i = m->m_pkthdr.flowid % npairs; else i = curcpu % npairs; Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c ============================================================================== --- head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/vmware/vmxnet3/if_vmx.c Mon Dec 1 11:45:24 2014 (r275358) @@ -2059,7 +2059,7 @@ vmxnet3_rxq_input(struct vmxnet3_rxqueue } #else m->m_pkthdr.flowid = rxq->vxrxq_id; - m->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); #endif if (!rxcd->no_csum) @@ -3002,7 +3002,8 @@ vmxnet3_txq_mq_start(struct ifnet *ifp, sc = ifp->if_softc; ntxq = sc->vmx_ntxqueues; - if (m->m_flags & M_FLOWID) + /* check if flowid is set */ + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) i = m->m_pkthdr.flowid % ntxq; else i = curcpu % ntxq; Modified: head/sys/dev/vxge/vxge.c ============================================================================== --- head/sys/dev/vxge/vxge.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/dev/vxge/vxge.c Mon Dec 1 11:45:24 2014 (r275358) @@ -660,7 +660,7 @@ vxge_mq_send(ifnet_t ifp, mbuf_t m_head) if (vdev->config.tx_steering) { i = vxge_vpath_get(vdev, m_head); - } else if ((m_head->m_flags & M_FLOWID) != 0) { + } else if (M_HASHTYPE_GET(m_head) != M_HASHTYPE_NONE) { i = m_head->m_pkthdr.flowid % vdev->no_of_vpath; } @@ -1070,7 +1070,7 @@ vxge_rx_compl(vxge_hal_vpath_h vpath_han vxge_rx_checksum(ext_info, mbuf_up); #if __FreeBSD_version >= 800000 - mbuf_up->m_flags |= M_FLOWID; + M_HASHTYPE_SET(mbuf_up, M_HASHTYPE_OPAQUE); mbuf_up->m_pkthdr.flowid = vpath->vp_index; #endif /* Post-Read sync for buffers */ Modified: head/sys/net/flowtable.c ============================================================================== --- head/sys/net/flowtable.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/net/flowtable.c Mon Dec 1 11:45:24 2014 (r275358) @@ -688,8 +688,8 @@ flowtable_lookup(sa_family_t sa, struct if (fle == NULL) return (EHOSTUNREACH); - if (!(m->m_flags & M_FLOWID)) { - m->m_flags |= M_FLOWID; + if (M_HASHTYPE_GET(m) == M_HASHTYPE_NONE) { + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); m->m_pkthdr.flowid = fle->f_hash; } Modified: head/sys/net/ieee8023ad_lacp.c ============================================================================== --- head/sys/net/ieee8023ad_lacp.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/net/ieee8023ad_lacp.c Mon Dec 1 11:45:24 2014 (r275358) @@ -835,7 +835,8 @@ lacp_select_tx_port(struct lagg_softc *s return (NULL); } - if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) && (m->m_flags & M_FLOWID)) + if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) && + M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) hash = m->m_pkthdr.flowid >> sc->flowid_shift; else hash = lagg_hashmbuf(sc, m, lsc->lsc_hashkey); Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/net/if_lagg.c Mon Dec 1 11:45:24 2014 (r275358) @@ -247,14 +247,14 @@ SYSCTL_INT(_net_link_lagg, OID_AUTO, fai &VNET_NAME(lagg_failover_rx_all), 0, "Accept input from any interface in a failover lagg"); -/* Default value for using M_FLOWID */ +/* Default value for using flowid */ static VNET_DEFINE(int, def_use_flowid) = 1; #define V_def_use_flowid VNET(def_use_flowid) SYSCTL_INT(_net_link_lagg, OID_AUTO, default_use_flowid, CTLFLAG_RWTUN, &VNET_NAME(def_use_flowid), 0, "Default setting for using flow id for load sharing"); -/* Default value for using M_FLOWID */ +/* Default value for flowid shift */ static VNET_DEFINE(int, def_flowid_shift) = 16; #define V_def_flowid_shift VNET(def_flowid_shift) SYSCTL_INT(_net_link_lagg, OID_AUTO, default_flowid_shift, CTLFLAG_RWTUN, @@ -2148,7 +2148,8 @@ lagg_lb_start(struct lagg_softc *sc, str struct lagg_port *lp = NULL; uint32_t p = 0; - if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) && (m->m_flags & M_FLOWID)) + if ((sc->sc_opts & LAGG_OPT_USE_FLOWID) && + M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) p = m->m_pkthdr.flowid >> sc->flowid_shift; else p = lagg_hashmbuf(sc, m, lb->lb_key); Modified: head/sys/net/if_lagg.h ============================================================================== --- head/sys/net/if_lagg.h Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/net/if_lagg.h Mon Dec 1 11:45:24 2014 (r275358) @@ -143,9 +143,9 @@ struct lagg_reqopts { int ro_opts; /* Option bitmap */ #define LAGG_OPT_NONE 0x00 -#define LAGG_OPT_USE_FLOWID 0x01 /* use M_FLOWID */ +#define LAGG_OPT_USE_FLOWID 0x01 /* enable use of flowid */ /* Pseudo flags which are used in ro_opts but not stored into sc_opts. */ -#define LAGG_OPT_FLOWIDSHIFT 0x02 /* Set flowid */ +#define LAGG_OPT_FLOWIDSHIFT 0x02 /* set flowid shift */ #define LAGG_OPT_FLOWIDSHIFT_MASK 0x1f /* flowid is uint32_t */ #define LAGG_OPT_LACP_STRICT 0x10 /* LACP strict mode */ #define LAGG_OPT_LACP_TXTEST 0x20 /* LACP debug: txtest */ Modified: head/sys/net/if_vxlan.c ============================================================================== --- head/sys/net/if_vxlan.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/net/if_vxlan.c Mon Dec 1 11:45:24 2014 (r275358) @@ -2236,6 +2236,7 @@ vxlan_pick_source_port(struct vxlan_soft range = sc->vxl_max_port - sc->vxl_min_port + 1; + /* check if flowid is set and not opaque */ if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE && M_HASHTYPE_GET(m) != M_HASHTYPE_OPAQUE) hash = m->m_pkthdr.flowid; Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/net/netisr.c Mon Dec 1 11:45:24 2014 (r275358) @@ -682,12 +682,13 @@ netisr_select_cpuid(struct netisr_proto } if (policy == NETISR_POLICY_FLOW) { - if (!(m->m_flags & M_FLOWID) && npp->np_m2flow != NULL) { + if (M_HASHTYPE_GET(m) == M_HASHTYPE_NONE && + npp->np_m2flow != NULL) { m = npp->np_m2flow(m, source); if (m == NULL) return (NULL); } - if (m->m_flags & M_FLOWID) { + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { *cpuidp = netisr_default_flow2cpu(m->m_pkthdr.flowid); return (m); Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/netinet/in_pcb.h Mon Dec 1 11:45:24 2014 (r275358) @@ -530,8 +530,8 @@ short inp_so_options(const struct inpcb #define INP_ONESBCAST 0x02000000 /* send all-ones broadcast */ #define INP_DROPPED 0x04000000 /* protocol drop flag */ #define INP_SOCKREF 0x08000000 /* strong socket reference */ -#define INP_SW_FLOWID 0x10000000 /* software generated flow id */ -#define INP_HW_FLOWID 0x20000000 /* hardware generated flow id */ +#define INP_RESERVED_0 0x10000000 /* reserved field */ +#define INP_RESERVED_1 0x20000000 /* reserved field */ #define IN6P_RFC2292 0x40000000 /* used RFC2292 API on the socket */ #define IN6P_MTU 0x80000000 /* receive path MTU */ Modified: head/sys/netinet/in_rss.c ============================================================================== --- head/sys/netinet/in_rss.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/netinet/in_rss.c Mon Dec 1 11:45:24 2014 (r275358) @@ -568,6 +568,8 @@ rss_mbuf_software_hash_v4(const struct m const struct ip *ip; const struct tcphdr *th; const struct udphdr *uh; + uint32_t flowid; + uint32_t flowtype; uint8_t proto; int iphlen; int is_frag = 0; @@ -617,12 +619,10 @@ rss_mbuf_software_hash_v4(const struct m * then we shouldn't just "trust" the 2-tuple hash. We need * a 4-tuple hash. */ - if (m->m_flags & M_FLOWID) { - uint32_t flowid, flowtype; - - flowid = m->m_pkthdr.flowid; - flowtype = M_HASHTYPE_GET(m); + flowid = m->m_pkthdr.flowid; + flowtype = M_HASHTYPE_GET(m); + if (flowtype != M_HASHTYPE_NONE) { switch (proto) { case IPPROTO_UDP: if ((rss_gethashconfig_local() & RSS_HASHTYPE_RSS_UDP_IPV4) && @@ -743,7 +743,6 @@ rss_soft_m2cpuid(struct mbuf *m, uintptr /* hash was done; update */ m->m_pkthdr.flowid = hash_val; M_HASHTYPE_SET(m, hash_type); - m->m_flags |= M_FLOWID; *cpuid = rss_hash2cpuid(m->m_pkthdr.flowid, M_HASHTYPE_GET(m)); } else { /* ret < 0 */ /* no hash was done */ Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/netinet/ip_input.c Mon Dec 1 11:45:24 2014 (r275358) @@ -1196,7 +1196,6 @@ found: if (rss_mbuf_software_hash_v4(m, 0, &rss_hash, &rss_type) == 0) { m->m_pkthdr.flowid = rss_hash; M_HASHTYPE_SET(m, rss_type); - m->m_flags |= M_FLOWID; } /* Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/netinet/ip_output.c Mon Dec 1 11:45:24 2014 (r275358) @@ -147,11 +147,9 @@ ip_output(struct mbuf *m, struct mbuf *o if (inp != NULL) { INP_LOCK_ASSERT(inp); M_SETFIB(m, inp->inp_inc.inc_fibnum); - if (((flags & IP_NODEFAULTFLOWID) == 0) && - inp->inp_flags & (INP_HW_FLOWID|INP_SW_FLOWID)) { + if ((flags & IP_NODEFAULTFLOWID) == 0) { m->m_pkthdr.flowid = inp->inp_flowid; M_HASHTYPE_SET(m, inp->inp_flowtype); - m->m_flags |= M_FLOWID; } } Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/netinet/tcp_input.c Mon Dec 1 11:45:24 2014 (r275358) @@ -884,12 +884,10 @@ findpcb: goto dropwithreset; } INP_WLOCK_ASSERT(inp); - if (!(inp->inp_flags & INP_HW_FLOWID) - && (m->m_flags & M_FLOWID) - && ((inp->inp_socket == NULL) - || !(inp->inp_socket->so_options & SO_ACCEPTCONN))) { - inp->inp_flags |= INP_HW_FLOWID; - inp->inp_flags &= ~INP_SW_FLOWID; + if ((inp->inp_flowtype == M_HASHTYPE_NONE) && + (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) && + ((inp->inp_socket == NULL) || + (inp->inp_socket->so_options & SO_ACCEPTCONN) == 0)) { inp->inp_flowid = m->m_pkthdr.flowid; inp->inp_flowtype = M_HASHTYPE_GET(m); } Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/netinet/tcp_syncache.c Mon Dec 1 11:45:24 2014 (r275358) @@ -713,9 +713,7 @@ syncache_socket(struct syncache *sc, str * If there's an mbuf and it has a flowid, then let's initialise the * inp with that particular flowid. */ - if (m != NULL && m->m_flags & M_FLOWID) { - inp->inp_flags |= INP_HW_FLOWID; - inp->inp_flags &= ~INP_SW_FLOWID; + if (m != NULL && M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { inp->inp_flowid = m->m_pkthdr.flowid; inp->inp_flowtype = M_HASHTYPE_GET(m); } Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/netinet/udp_usrreq.c Mon Dec 1 11:45:24 2014 (r275358) @@ -1106,8 +1106,7 @@ udp_output(struct inpcb *inp, struct mbu uint8_t pr; uint16_t cscov = 0; uint32_t flowid = 0; - int flowid_type = 0; - int use_flowid = 0; + uint8_t flowtype = M_HASHTYPE_NONE; /* * udp_output() may need to temporarily bind or connect the current @@ -1184,8 +1183,7 @@ udp_output(struct inpcb *inp, struct mbu error = EINVAL; break; } - flowid_type = *(uint32_t *) CMSG_DATA(cm); - use_flowid = 1; + flowtype = *(uint32_t *) CMSG_DATA(cm); break; #ifdef RSS @@ -1451,10 +1449,9 @@ udp_output(struct inpcb *inp, struct mbu * Once the UDP code decides to set a flowid some other way, * this allows the flowid to be overridden by userland. */ - if (use_flowid) { - m->m_flags |= M_FLOWID; + if (flowtype != M_HASHTYPE_NONE) { m->m_pkthdr.flowid = flowid; - M_HASHTYPE_SET(m, flowid_type); + M_HASHTYPE_SET(m, flowtype); #ifdef RSS } else { uint32_t hash_val, hash_type; @@ -1477,7 +1474,6 @@ udp_output(struct inpcb *inp, struct mbu if (rss_proto_software_hash_v4(faddr, laddr, fport, lport, pr, &hash_val, &hash_type) == 0) { m->m_pkthdr.flowid = hash_val; - m->m_flags |= M_FLOWID; M_HASHTYPE_SET(m, hash_type); } #endif Modified: head/sys/netinet6/in6_pcb.c ============================================================================== --- head/sys/netinet6/in6_pcb.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/netinet6/in6_pcb.c Mon Dec 1 11:45:24 2014 (r275358) @@ -1252,7 +1252,7 @@ in6_pcblookup_mbuf(struct inpcbinfo *pcb * XXXRW: As above, that policy belongs in the pcbgroup code. */ if (in_pcbgroup_enabled(pcbinfo) && - !(M_HASHTYPE_TEST(m, M_HASHTYPE_NONE))) { + M_HASHTYPE_TEST(m, M_HASHTYPE_NONE) == 0) { pcbgroup = in6_pcbgroup_byhash(pcbinfo, M_HASHTYPE_GET(m), m->m_pkthdr.flowid); if (pcbgroup != NULL) Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/netinet6/ip6_output.c Mon Dec 1 11:45:24 2014 (r275358) @@ -267,10 +267,10 @@ ip6_output(struct mbuf *m0, struct ip6_p if (inp != NULL) { M_SETFIB(m, inp->inp_inc.inc_fibnum); - if (((flags & IP_NODEFAULTFLOWID) == 0) && - (inp->inp_flags & (INP_HW_FLOWID|INP_SW_FLOWID))) { + if ((flags & IP_NODEFAULTFLOWID) == 0) { + /* unconditionally set flowid */ m->m_pkthdr.flowid = inp->inp_flowid; - m->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m, inp->inp_flowtype); } } Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/netinet6/udp6_usrreq.c Mon Dec 1 11:45:24 2014 (r275358) @@ -843,7 +843,6 @@ udp6_output(struct inpcb *inp, struct mb */ #ifdef RSS m->m_pkthdr.flowid = rss_hash_ip6_2tuple(*faddr, *laddr); - m->m_flags |= M_FLOWID; M_HASHTYPE_SET(m, M_HASHTYPE_RSS_IPV6); #endif flags = 0; Modified: head/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_rx.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/ofed/drivers/net/mlx4/en_rx.c Mon Dec 1 11:45:24 2014 (r275358) @@ -604,7 +604,7 @@ int mlx4_en_process_rx_cq(struct net_dev } mb->m_pkthdr.flowid = cq->ring; - mb->m_flags |= M_FLOWID; + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); mb->m_pkthdr.rcvif = dev; if (be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_VLAN_PRESENT_MASK) { Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_tx.c Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/ofed/drivers/net/mlx4/en_tx.c Mon Dec 1 11:45:24 2014 (r275358) @@ -720,8 +720,11 @@ u16 mlx4_en_select_queue(struct net_devi up = (vlan_tag >> 13); } - /* hash mbuf */ - queue_index = mlx4_en_hashmbuf(MLX4_F_HASHL3 | MLX4_F_HASHL4, mb, hashrandom); + /* check if flowid is set */ + if (M_HASHTYPE_GET(mb) != M_HASHTYPE_NONE) + queue_index = mb->m_pkthdr.flowid; + else + queue_index = mlx4_en_hashmbuf(MLX4_F_HASHL3 | MLX4_F_HASHL4, mb, hashrandom); return ((queue_index % rings_p_up) + (up * rings_p_up)); } @@ -1066,15 +1069,11 @@ mlx4_en_transmit(struct ifnet *dev, stru struct mlx4_en_priv *priv = netdev_priv(dev); struct mlx4_en_tx_ring *ring; struct mlx4_en_cq *cq; - int i = 0, err = 0; + int i, err = 0; + + /* Compute which queue to use */ + i = mlx4_en_select_queue(dev, m); - /* Which queue to use */ - if ((m->m_flags & (M_FLOWID | M_VLANTAG)) == M_FLOWID) { - i = m->m_pkthdr.flowid % (priv->tx_ring_num - 1); - } - else { - i = mlx4_en_select_queue(dev, m); - } ring = priv->tx_ring[i]; if (spin_trylock(&ring->tx_lock)) { Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Mon Dec 1 11:34:44 2014 (r275357) +++ head/sys/sys/param.h Mon Dec 1 11:45:24 2014 (r275358) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100047 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100048 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 12:17:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27F28483; Mon, 1 Dec 2014 12:17:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1502868E; Mon, 1 Dec 2014 12:17:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1CHgCu007103; Mon, 1 Dec 2014 12:17:42 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1CHgaQ007102; Mon, 1 Dec 2014 12:17:42 GMT (envelope-from des@FreeBSD.org) Message-Id: <201412011217.sB1CHgaQ007102@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Mon, 1 Dec 2014 12:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275359 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 12:17:43 -0000 Author: des Date: Mon Dec 1 12:17:42 2014 New Revision: 275359 URL: https://svnweb.freebsd.org/changeset/base/275359 Log: Allow load_rc_config to be called without a service name. MFC after: 1 week Modified: head/etc/rc.subr Modified: head/etc/rc.subr ============================================================================== --- head/etc/rc.subr Mon Dec 1 11:45:24 2014 (r275358) +++ head/etc/rc.subr Mon Dec 1 12:17:42 2014 (r275359) @@ -1315,9 +1315,6 @@ load_rc_config() { local _name _rcvar_val _var _defval _v _msg _new _d _name=$1 - if [ -z "$_name" ]; then - err 3 'USAGE: load_rc_config name' - fi if ${_rc_conf_loaded:-false}; then : @@ -1333,20 +1330,24 @@ load_rc_config() _rc_conf_loaded=true fi - for _d in /etc ${local_startup%*/rc.d}; do - if [ -f ${_d}/rc.conf.d/"$_name" ]; then - debug "Sourcing ${_d}/rc.conf.d/$_name" - . ${_d}/rc.conf.d/"$_name" - elif [ -d ${_d}/rc.conf.d/"$_name" ] ; then - local _rc - for _rc in ${_d}/rc.conf.d/"$_name"/* ; do - if [ -f "$_rc" ] ; then - debug "Sourcing $_rc" - . "$_rc" - fi - done - fi - done + # If a service name was specified, attempt to load + # service-specific configuration + if [ -n "$_name" ] ; then + for _d in /etc ${local_startup%*/rc.d}; do + if [ -f ${_d}/rc.conf.d/"$_name" ]; then + debug "Sourcing ${_d}/rc.conf.d/$_name" + . ${_d}/rc.conf.d/"$_name" + elif [ -d ${_d}/rc.conf.d/"$_name" ] ; then + local _rc + for _rc in ${_d}/rc.conf.d/"$_name"/* ; do + if [ -f "$_rc" ] ; then + debug "Sourcing $_rc" + . "$_rc" + fi + done + fi + done + fi # Set defaults if defined. for _var in $rcvar $rcvars; do From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 12:30:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9225F9B7; Mon, 1 Dec 2014 12:30:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F21C810; Mon, 1 Dec 2014 12:30:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1CU0MX012060; Mon, 1 Dec 2014 12:30:00 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1CU0MT012059; Mon, 1 Dec 2014 12:30:00 GMT (envelope-from des@FreeBSD.org) Message-Id: <201412011230.sB1CU0MT012059@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Mon, 1 Dec 2014 12:30:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275360 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 12:30:00 -0000 Author: des Date: Mon Dec 1 12:29:59 2014 New Revision: 275360 URL: https://svnweb.freebsd.org/changeset/base/275360 Log: The early-late divider was originally set to mountcritlocal. Since that service does not run in jails, it was necessary to change it to something else when jailed, and NETWORKING was arbitrarily chosen. The divider was later moved to FILESYSTEMS when it was introduced, but the logic to change it to NETWORKING when jailed remained. Remove it, as it no longer serves any purpose. PR: 194975 MFC after: 1 week Modified: head/etc/rc Modified: head/etc/rc ============================================================================== --- head/etc/rc Mon Dec 1 12:17:42 2014 (r275359) +++ head/etc/rc Mon Dec 1 12:29:59 2014 (r275360) @@ -69,19 +69,16 @@ fi # and to make the configuration file variables available to rc itself. # . /etc/rc.subr -load_rc_config 'XXX' +load_rc_config # If we receive a SIGALRM, re-source /etc/rc.conf; this allows rc.d # scripts to perform "boot-time configuration" including enabling and # disabling rc.d scripts which appear later in the boot order. -trap "_rc_conf_loaded=false; load_rc_config 'XXX'" ALRM +trap "_rc_conf_loaded=false; load_rc_config" ALRM skip="-s nostart" if [ `/sbin/sysctl -n security.jail.jailed` -eq 1 ]; then skip="$skip -s nojail" - if [ "$early_late_divider" = "FILESYSTEMS" ]; then - early_late_divider=NETWORKING - fi if [ `/sbin/sysctl -n security.jail.vnet` -ne 1 ]; then skip="$skip -s nojailvnet" fi From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 12:57:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F691F62; Mon, 1 Dec 2014 12:57:11 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id E588EAE5; Mon, 1 Dec 2014 12:57:10 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 5F9BFA5BA; Mon, 1 Dec 2014 12:57:09 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 025D11773; Mon, 1 Dec 2014 13:57:07 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bryan Venteicher Subject: Re: svn commit: r273331 - in head: sbin/ifconfig share/man/man4 sys/conf sys/modules sys/modules/if_vxlan sys/net sys/sys References: <201410201442.s9KEggqt096167@svn.freebsd.org> Date: Mon, 01 Dec 2014 13:57:07 +0100 In-Reply-To: <201410201442.s9KEggqt096167@svn.freebsd.org> (Bryan Venteicher's message of "Mon, 20 Oct 2014 14:42:42 +0000 (UTC)") Message-ID: <86zjb7frz0.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 12:57:11 -0000 Bryan Venteicher writes: > Log: > Add vxlan interface > [...] This breaks the existing "group" command, which means I now have machines that won't boot without manual intervention because their firewall rulesets rely on interface groups. Did you even bother to search for "group" in the code, or even in the man page, before deciding to add a command by that name? DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 12:59:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2A069153; Mon, 1 Dec 2014 12:59:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16C3EAF7; Mon, 1 Dec 2014 12:59:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1CxGIu025814; Mon, 1 Dec 2014 12:59:16 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1CxGcp025813; Mon, 1 Dec 2014 12:59:16 GMT (envelope-from des@FreeBSD.org) Message-Id: <201412011259.sB1CxGcp025813@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: des set sender to des@FreeBSD.org using -f From: Dag-Erling Smørgrav Date: Mon, 1 Dec 2014 12:59:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275361 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 12:59:17 -0000 Author: des Date: Mon Dec 1 12:59:16 2014 New Revision: 275361 URL: https://svnweb.freebsd.org/changeset/base/275361 Log: Disable the vxlan code until the people reponsible for it can come up with new command names that don't conflict with existing commands. Pointy hat to: bryanv Modified: head/sbin/ifconfig/Makefile Modified: head/sbin/ifconfig/Makefile ============================================================================== --- head/sbin/ifconfig/Makefile Mon Dec 1 12:29:59 2014 (r275360) +++ head/sbin/ifconfig/Makefile Mon Dec 1 12:59:16 2014 (r275361) @@ -30,7 +30,7 @@ SRCS+= ifmac.c # MAC support SRCS+= ifmedia.c # SIOC[GS]IFMEDIA support SRCS+= iffib.c # non-default FIB support SRCS+= ifvlan.c # SIOC[GS]ETVLAN support -SRCS+= ifvxlan.c # VXLAN support +#SRCS+= ifvxlan.c # VXLAN support SRCS+= ifgre.c # GRE keys etc SRCS+= ifgif.c # GIF reversed header workaround From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 13:07:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91EE96E3; Mon, 1 Dec 2014 13:07:51 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 515B6C0F; Mon, 1 Dec 2014 13:07:50 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 2B3C1A60C; Mon, 1 Dec 2014 13:07:50 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 423471776; Mon, 1 Dec 2014 14:07:45 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Bryan Venteicher Subject: Re: svn commit: r273331 - in head: sbin/ifconfig share/man/man4 sys/conf sys/modules sys/modules/if_vxlan sys/net sys/sys References: <201410201442.s9KEggqt096167@svn.freebsd.org> <86zjb7frz0.fsf@nine.des.no> Date: Mon, 01 Dec 2014 14:07:45 +0100 In-Reply-To: <86zjb7frz0.fsf@nine.des.no> ("Dag-Erling =?utf-8?Q?Sm=C3=B8r?= =?utf-8?Q?grav=22's?= message of "Mon, 01 Dec 2014 13:57:07 +0100") Message-ID: <86vblvfrha.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 13:07:51 -0000 Dag-Erling Sm=C3=B8rgrav writes: > Bryan Venteicher writes: > > Log: > > Add vxlan interface > > [...] > This breaks the existing "group" command, which means I now have > machines that won't boot without manual intervention because their > firewall rulesets rely on interface groups. I added code to cmd_register() in ifconfig.c to warn about duplicate commands. Here is a complete list of pre-existing commands which the vxlan code shadows: ifconfig: duplicate command: group ifconfig: duplicate command: timeout ifconfig: duplicate command: maxaddr ifconfig: duplicate command: learn ifconfig: duplicate command: -learn ifconfig: duplicate command: flush ifconfig: duplicate command: flushall so, in addition to breaking interface groups, it breaks bridge interfaces. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 13:55:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 959421CE; Mon, 1 Dec 2014 13:55:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 76EF8114; Mon, 1 Dec 2014 13:55:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1DtksE053522; Mon, 1 Dec 2014 13:55:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1DtkBt053521; Mon, 1 Dec 2014 13:55:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412011355.sB1DtkBt053521@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 1 Dec 2014 13:55:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275365 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 13:55:46 -0000 Author: mav Date: Mon Dec 1 13:55:45 2014 New Revision: 275365 URL: https://svnweb.freebsd.org/changeset/base/275365 Log: Move ctlfe_onoffline() out of lock to let it sleep when needed. Do some more other polishing while there. MFC after: 2 weeks Modified: head/sys/cam/ctl/scsi_ctl.c Modified: head/sys/cam/ctl/scsi_ctl.c ============================================================================== --- head/sys/cam/ctl/scsi_ctl.c Mon Dec 1 13:14:39 2014 (r275364) +++ head/sys/cam/ctl/scsi_ctl.c Mon Dec 1 13:55:45 2014 (r275365) @@ -622,6 +622,9 @@ ctlferegister(struct cam_periph *periph, "notify CCBs, status 0x%x\n", __func__, status); return (CAM_REQ_CMP_ERR); } + mtx_lock(&bus_softc->lun_softc_mtx); + STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links); + mtx_unlock(&bus_softc->lun_softc_mtx); return (CAM_REQ_CMP); } @@ -1573,12 +1576,7 @@ ctlfe_onoffline(void *arg, int online) printf("%s: unable to create path!\n", __func__); return; } - ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_NOWAIT | M_ZERO); - if (ccb == NULL) { - printf("%s: unable to malloc CCB!\n", __func__); - xpt_free_path(path); - return; - } + ccb = xpt_alloc_ccb(); xpt_setup_ccb(&ccb->ccb_h, path, CAM_PRIORITY_NONE); /* @@ -1711,10 +1709,7 @@ ctlfe_onoffline(void *arg, int online) } xpt_free_path(path); - - free(ccb, M_TEMP); - - return; + xpt_free_ccb(ccb); } static void @@ -1740,14 +1735,7 @@ ctlfe_online(void *arg) return; } - lun_softc = malloc(sizeof(*lun_softc), M_CTLFE, - M_NOWAIT | M_ZERO); - if (lun_softc == NULL) { - xpt_print(path, "%s: unable to allocate softc for " - "wildcard periph\n", __func__); - xpt_free_path(path); - return; - } + lun_softc = malloc(sizeof(*lun_softc), M_CTLFE, M_WAITOK | M_ZERO); xpt_path_lock(path); periph = cam_periph_find(path, "ctl"); @@ -1780,14 +1768,10 @@ ctlfe_online(void *arg) "cam_periph_alloc()\n", __func__, (entry != NULL) ? entry->status_text : "Unknown", status); free(lun_softc, M_CTLFE); - } else { - mtx_lock(&bus_softc->lun_softc_mtx); - STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, lun_softc, links); - mtx_unlock(&bus_softc->lun_softc_mtx); - ctlfe_onoffline(arg, /*online*/ 1); } xpt_path_unlock(path); + ctlfe_onoffline(arg, /*online*/ 1); xpt_free_path(path); } @@ -1801,6 +1785,8 @@ ctlfe_offline(void *arg) bus_softc = (struct ctlfe_softc *)arg; + ctlfe_onoffline(arg, /*online*/ 0); + /* * Disable the wildcard LUN for this port now that we have taken * the port offline. @@ -1813,14 +1799,9 @@ ctlfe_offline(void *arg) __func__); return; } - xpt_path_lock(path); - - ctlfe_onoffline(arg, /*online*/ 0); - if ((periph = cam_periph_find(path, "ctl")) != NULL) cam_periph_invalidate(periph); - xpt_path_unlock(path); xpt_free_path(path); } @@ -1881,10 +1862,6 @@ ctlfe_lun_enable(void *arg, struct ctl_i "cam_periph_alloc()\n", __func__, (entry != NULL) ? entry->status_text : "Unknown", status); free(softc, M_CTLFE); - } else { - mtx_lock(&bus_softc->lun_softc_mtx); - STAILQ_INSERT_TAIL(&bus_softc->lun_softc_list, softc, links); - mtx_unlock(&bus_softc->lun_softc_mtx); } xpt_path_unlock(path); From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 14:48:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D996EC11; Mon, 1 Dec 2014 14:48:39 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0A7A884; Mon, 1 Dec 2014 14:48:39 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 93891B987; Mon, 1 Dec 2014 09:48:38 -0500 (EST) From: John Baldwin To: Hans Petter Selasky Subject: Re: svn commit: r275358 - in head/sys: dev/bxe dev/cxgb dev/cxgbe dev/e1000 dev/ixgbe dev/ixl dev/mxge dev/netmap dev/oce dev/qlxgbe dev/qlxge dev/sfxge dev/virtio/network dev/vmware/vmxnet3 dev/vxge n... Date: Mon, 01 Dec 2014 09:13:55 -0500 Message-ID: <2301463.0AvfjFzmc1@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201412011145.sB1BjPEI092904@svn.freebsd.org> References: <201412011145.sB1BjPEI092904@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 01 Dec 2014 09:48:38 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 14:48:40 -0000 On Monday, December 01, 2014 11:45:25 AM Hans Petter Selasky wrote: > Author: hselasky > Date: Mon Dec 1 11:45:24 2014 > New Revision: 275358 > URL: https://svnweb.freebsd.org/changeset/base/275358 > > Log: > Start process of removing the use of the deprecated "M_FLOWID" flag > from the FreeBSD network code. The flag is still kept around in the > "sys/mbuf.h" header file, but does no longer have any users. Instead > the "m_pkthdr.rsstype" field in the mbuf structure is now used to > decide the meaning of the "m_pkthdr.flowid" field. To modify the > "m_pkthdr.rsstype" field please use the existing "M_HASHTYPE_XXX" > macros as defined in the "sys/mbuf.h" header file. > > This patch introduces new behaviour in the transmit direction. > Previously network drivers checked if "M_FLOWID" was set in "m_flags" > before using the "m_pkthdr.flowid" field. This check has now now been > replaced by checking if "M_HASHTYPE_GET(m)" is different from > "M_HASHTYPE_NONE". In the future more hashtypes will be added, for > example hashtypes for hardware dedicated flows. > > "M_HASHTYPE_OPAQUE" indicates that the "m_pkthdr.flowid" value is > valid and has no particular type. This change removes the need for an > "if" statement in TCP transmit code checking for the presence of a > valid flowid value. The "if" statement mentioned above is now a direct > variable assignment which is then later checked by the respective > network drivers like before. > > Additional notes: > - The SCTP code changes will be committed as a separate patch. > - Removal of the "M_FLOWID" flag will also be done separately. > - The FreeBSD version has been bumped. > > MFC after: 1 month > Sponsored by: Mellanox Technologies Was this reviewed by anyone? I know I saw at least one thread on reworking M_FLOWID on one list, but it's not clear to me that anyone reviewed these specific changes. If someone did, please be sure to include that type of detail in future commits. If not, I would strongly encourage to still seek review even if changes have been agreed upon in the abstract. Phabricator makes this a lot easier to do than previously. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 14:48:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B472EC0F; Mon, 1 Dec 2014 14:48:39 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 89F74883; Mon, 1 Dec 2014 14:48:39 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 04DB7B923; Mon, 1 Dec 2014 09:48:38 -0500 (EST) From: John Baldwin To: Alfred Perlstein Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys Date: Mon, 01 Dec 2014 09:32:42 -0500 Message-ID: <39377603.10OyiSzjWY@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201411262019.sAQKJaw4043557@svn.freebsd.org> References: <201411262019.sAQKJaw4043557@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 01 Dec 2014 09:48:38 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 14:48:39 -0000 On Wednesday, November 26, 2014 08:19:36 PM Alfred Perlstein wrote: > Author: alfred > Date: Wed Nov 26 20:19:36 2014 > New Revision: 275136 > URL: https://svnweb.freebsd.org/changeset/base/275136 > > Log: > Make igb and ixgbe check tunables at probe time. > > This allows one to make a kernel module to tune the > number of queues before the driver loads. > > This is needed so that a module at SI_SUB_CPU can set > tunables for these drivers to take. Otherwise getenv > is called too early by the TUNABLE macros. > > Reviewed by: smh > Phabric: https://reviews.freebsd.org/D1149 The explicit TUNABLE_INT_FETCH strikes me as the wrong approach and hackish. That is, each time you want to frob a tunable like this you will have to go add a bunch of code to explicitly re-read the tunable, etc. Instead, you could have simply changed your helper module to use kernel_sysctlbyname() to set hw.igb.num_queues. That would have required only a single character change to make the SYSCTL read/write instead of read/only for each tunable in question. To be completely future proof (i.e. to handle loading the module in question post-boot), your module could both do setenv() and kernel_sysctlbyname(). That seems to be a more extensible approach in terms of allowing more of these to be changed in the future without having to do a manual bypass of the existing tunable infrastructure for each tunable. I would much prefer that you revert this part and change the relevant tunables to CTLFLAG_RWTUN and update your out-of-tree module to use kernel_sysctlbyname(). Also, if you didn't run this by the Intel folks (e.g. jfv@) that might have been nice as a courtesy. Also, please use the existing resource_int_value() that uses 'hint.igb.0.foo' instead of inventing a different wheel (device_get_int()). This is what all the other drivers in the tree that provide per-instance tunables use. You could perhaps have device_get_int() as a wrapper around resource_int_value(), but we should use the existing convention, not invent a conflicting one. > Modified: > head/sys/dev/e1000/if_igb.c > head/sys/dev/ixgbe/ixgbe.c > head/sys/kern/subr_bus.c > head/sys/sys/bus.h > > Modified: head/sys/dev/e1000/if_igb.c > ============================================================================ > == --- head/sys/dev/e1000/if_igb.c Wed Nov 26 18:03:25 2014 (r275135) +++ > head/sys/dev/e1000/if_igb.c Wed Nov 26 20:19:36 2014 (r275136) @@ -188,6 > +188,7 @@ static char *igb_strings[] = { > /********************************************************************* > * Function prototypes > *********************************************************************/ > +static int igb_per_unit_num_queues(SYSCTL_HANDLER_ARGS); > static int igb_probe(device_t); > static int igb_attach(device_t); > static int igb_detach(device_t); > @@ -493,6 +494,11 @@ igb_attach(device_t dev) > OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, > igb_sysctl_nvm_info, "I", "NVM Information"); > > + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), > + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), > + OID_AUTO, "num_queues", CTLTYPE_INT | CTLFLAG_RD, > + adapter, 0, igb_per_unit_num_queues, "I", "Number of Queues"); > + You don't need igb_per_unit_num_queues(). SYSCTL_ADD_INT(..., &adapter->num_queues) should have been used instead. > @@ -2831,6 +2837,7 @@ igb_setup_msix(struct adapter *adapter) > { > device_t dev = adapter->dev; > int bar, want, queues, msgs, maxqueues; > + int n_queues; > > /* tuneable override */ > if (igb_enable_msix == 0) > @@ -2858,8 +2865,18 @@ igb_setup_msix(struct adapter *adapter) > goto msi; > } > > - /* Figure out a reasonable auto config value */ > - queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; > + n_queues = 0; > + /* try more specific tunable, then global, then finally default to boot > time tunable if set. */ + if (device_getenv_int(dev, "num_queues", > &n_queues) != 0) { > + device_printf(dev, "using specific tunable num_queues=%d", n_queues); > + } else if (TUNABLE_INT_FETCH("hw.igb.num_queues", &n_queues) != 0) { > + if (igb_num_queues != n_queues) { > + device_printf(dev, "using global tunable hw.igb.num_queues=%d", > n_queues); + igb_num_queues = n_queues; > + } > + } else { > + n_queues = igb_num_queues; > + } > > #ifdef RSS > /* If we're doing RSS, clamp at the number of RSS buckets */ > @@ -2867,10 +2884,12 @@ igb_setup_msix(struct adapter *adapter) > queues = rss_getnumbuckets(); > #endif > > - > - /* Manual override */ > - if (igb_num_queues != 0) > - queues = igb_num_queues; > + if (n_queues != 0) { > + queues = n_queues; > + } else { > + /* Figure out a reasonable auto config value */ > + queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; > + } This moves the mp_ncpus auto config below the RSS bits, so now you are ignoring the RSS value. You probably should have left the mp_ncpus line where it was. One old bug here is that igb checked the tunable value twice. It should only check it once at the end of all the auto-tuning. > /* Sanity check based on HW */ > switch (adapter->hw.mac.type) { > @@ -2893,12 +2912,17 @@ igb_setup_msix(struct adapter *adapter) > maxqueues = 1; > break; > } > - if (queues > maxqueues) > + if (queues > maxqueues) { > + device_printf(adapter->dev, "requested %d queues, but max for this > adapter is %d\n", + queues, maxqueues); > queues = maxqueues; > - > - /* Manual override */ > - if (igb_num_queues != 0) > - queues = igb_num_queues; > + } else if (queues == 0) { > + queues = 1; > + } else if (queues < 0) { > + device_printf(adapter->dev, "requested %d queues, but min for this > adapter is %d\n", + queues, 1); > + queues = 1; > + } So here is where I would check the tunable to allow it to override. Assuming you revert the TUNABLE_INT_FETCH business then this only needs: /* Manual override */ if (device_get_int(&n_queues) != 0) n_queues = igb_num_queues; if (n_queues != 0) { if (n_queues > maxqueues || n_queues < 0) /* whine */ else queues = n_queues; } -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:02:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F4049EB2; Mon, 1 Dec 2014 15:02:49 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DCB5BA46; Mon, 1 Dec 2014 15:02:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1F2nLJ086020; Mon, 1 Dec 2014 15:02:49 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1F2nd7086019; Mon, 1 Dec 2014 15:02:49 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412011502.sB1F2nd7086019@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 1 Dec 2014 15:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275366 - head/contrib/libc++/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:02:50 -0000 Author: dim Date: Mon Dec 1 15:02:49 2014 New Revision: 275366 URL: https://svnweb.freebsd.org/changeset/base/275366 Log: Pull in r209785 from upstream libc++ trunk (by Marshall Clow): Fix a problem exposed by r208825, which caused bind (and other bits of libc++) to stop working. And tests This fix is needed to support clang 3.5.0 and higher, which are more strict about forming pointer-to-function types with cv-qualifiers or ref-qualifiers. See also the upstream PR and Reported by: amdmi3 MFC after: 3 days Modified: head/contrib/libc++/include/type_traits Modified: head/contrib/libc++/include/type_traits ============================================================================== --- head/contrib/libc++/include/type_traits Mon Dec 1 13:55:45 2014 (r275365) +++ head/contrib/libc++/include/type_traits Mon Dec 1 15:02:49 2014 (r275366) @@ -439,8 +439,26 @@ template struct _LIBCPP_TYPE // is_member_function_pointer -template struct __libcpp_is_member_function_pointer : public false_type {}; -template struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; +// template struct __libcpp_is_member_function_pointer : public false_type {}; +// template struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; +// + +template +struct __member_pointer_traits_imp +{ // forward declaration; specializations later +}; + + +namespace __libcpp_is_member_function_pointer_imp { + template + char __test(typename std::__member_pointer_traits_imp<_Tp, true, false>::_FnType *); + + template + std::__two __test(...); +}; + +template struct __libcpp_is_member_function_pointer + : public integral_constant(nullptr)) == 1> {}; template struct _LIBCPP_TYPE_VIS_ONLY is_member_function_pointer : public __libcpp_is_member_function_pointer::type> {}; @@ -1593,11 +1611,6 @@ __decay_copy(const _Tp& __t) #endif -template -struct __member_pointer_traits_imp -{ -}; - #ifndef _LIBCPP_HAS_NO_VARIADICS template @@ -1605,6 +1618,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1612,6 +1626,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1619,6 +1634,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1626,6 +1642,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; #if __has_feature(cxx_reference_qualified_functions) @@ -1635,6 +1652,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1642,6 +1660,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1649,6 +1668,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1656,6 +1676,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1663,6 +1684,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1670,6 +1692,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1677,6 +1700,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; template @@ -1684,6 +1708,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile&& _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_Param...); }; #endif // __has_feature(cxx_reference_qualified_functions) @@ -1695,6 +1720,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1702,6 +1728,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1709,6 +1736,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1716,6 +1744,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; template @@ -1723,6 +1752,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1730,6 +1760,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1737,6 +1768,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1744,6 +1776,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; template @@ -1751,6 +1784,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1758,6 +1792,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1765,6 +1800,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1772,6 +1808,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; template @@ -1779,6 +1816,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (); }; template @@ -1786,6 +1824,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0); }; template @@ -1793,6 +1832,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1); }; template @@ -1800,6 +1840,7 @@ struct __member_pointer_traits_imp<_Rp ( { typedef _Class const volatile _ClassType; typedef _Rp _ReturnType; + typedef _Rp (_FnType) (_P0, _P1, _P2); }; #endif // _LIBCPP_HAS_NO_VARIADICS @@ -1819,6 +1860,7 @@ struct __member_pointer_traits { // typedef ... _ClassType; // typedef ... _ReturnType; +// typedef ... _FnType; }; // result_of @@ -2526,6 +2568,15 @@ template struct _LIBCPP_TYPE // is_nothrow_constructible +#if 0 +template +struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible + : public integral_constant +{ +}; + +#else + #ifndef _LIBCPP_HAS_NO_VARIADICS #if __has_feature(cxx_noexcept) @@ -2664,6 +2715,7 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_ }; #endif // _LIBCPP_HAS_NO_VARIADICS +#endif // __has_feature(is_nothrow_constructible) // is_nothrow_default_constructible From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:09:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D164F6FC; Mon, 1 Dec 2014 15:09:52 +0000 (UTC) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 936EDABC; Mon, 1 Dec 2014 15:09:52 +0000 (UTC) Received: by mail-ig0-f171.google.com with SMTP id z20so9086333igj.16 for ; Mon, 01 Dec 2014 07:09:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=IYmOehHWkzomBfWsiPqVtIIVPKS7ovet2seUoOgwaRI=; b=rZ/ysOEySYYrPPHk1bfXa6apxShX+cQxXrzIlaHFh+sdondxLI1BBBerkHJW7HiFzF XfJq5NhP3itRtWZMNSWo+8W18fv/NHu22YLQ9Q+jvwY5GDVSRu5rRXqsDcAMPZUBtut+ PFdRsG4MEg8NmQaTE0HXiFq5haE1vinB17HtIbEAawr/cJDGW6EnlLJzFtL9OUyYj14G WG07538VuARBwXTU3vqHyQutOwyz0TaORtL8ZPo+X5O2uSiYe1nc5m6HjwAulBvL4NSV G5U8NEfghdsSkJut4jQrWodPkSzpzS50d+Iui4CoerC7mkae/ZnPrQBtruPxM/7iQhiI wLGQ== X-Received: by 10.50.79.166 with SMTP id k6mr46296111igx.0.1417446592009; Mon, 01 Dec 2014 07:09:52 -0800 (PST) MIME-Version: 1.0 Sender: mr.kodiak@gmail.com Received: by 10.64.0.171 with HTTP; Mon, 1 Dec 2014 07:09:21 -0800 (PST) In-Reply-To: <86zjb7frz0.fsf@nine.des.no> References: <201410201442.s9KEggqt096167@svn.freebsd.org> <86zjb7frz0.fsf@nine.des.no> From: Bryan Venteicher Date: Mon, 1 Dec 2014 09:09:21 -0600 X-Google-Sender-Auth: Ew6b1X7qZKJm-XC8tGcyo1G0SqA Message-ID: Subject: Re: svn commit: r273331 - in head: sbin/ifconfig share/man/man4 sys/conf sys/modules sys/modules/if_vxlan sys/net sys/sys To: =?UTF-8?Q?Dag=2DErling_Sm=C3=B8rgrav?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , Bryan Venteicher , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:09:53 -0000 On Mon, Dec 1, 2014 at 6:57 AM, Dag-Erling Sm=C3=B8rgrav wrote= : > Bryan Venteicher writes: > > Log: > > Add vxlan interface > > [...] > > This breaks the existing "group" command, which means I now have > machines that won't boot without manual intervention because their > firewall rulesets rely on interface groups. > > Did you even bother to search for "group" in the code, or even in the > man page, before deciding to add a command by that name? > > This stems from my misunderstanding that these commands were scoped. I'll work on fix shortly. > DES > -- > Dag-Erling Sm=C3=B8rgrav - des@des.no > From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:15:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBCC0BE2; Mon, 1 Dec 2014 15:15:25 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A63BBA4; Mon, 1 Dec 2014 15:15:25 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id AC3C01FE022; Mon, 1 Dec 2014 16:15:22 +0100 (CET) Message-ID: <547C8625.3030000@selasky.org> Date: Mon, 01 Dec 2014 16:15:49 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r275358 - in head/sys: dev/bxe dev/cxgb dev/cxgbe dev/e1000 dev/ixgbe dev/ixl dev/mxge dev/netmap dev/oce dev/qlxgbe dev/qlxge dev/sfxge dev/virtio/network dev/vmware/vmxnet3 dev/vxge n... References: <201412011145.sB1BjPEI092904@svn.freebsd.org> <2301463.0AvfjFzmc1@ralph.baldwin.cx> In-Reply-To: <2301463.0AvfjFzmc1@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:15:25 -0000 Hi John, These patches were sent to the -current mailing list for review for 12 days. No big issues were mentioned. Also a review has been made at "reviews.freebsd.org": https://reviews.freebsd.org/D1243 No response yet. If I missed someone for the review process please let me know. --HPS From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:21:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 646B6F43; Mon, 1 Dec 2014 15:21:55 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50D6CC8C; Mon, 1 Dec 2014 15:21:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1FLtul095504; Mon, 1 Dec 2014 15:21:55 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1FLtZK095503; Mon, 1 Dec 2014 15:21:55 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412011521.sB1FLtZK095503@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 1 Dec 2014 15:21:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275368 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:21:55 -0000 Author: mav Date: Mon Dec 1 15:21:54 2014 New Revision: 275368 URL: https://svnweb.freebsd.org/changeset/base/275368 Log: When passing LUN IDs through treat ASCII values as fixed-length, not interpreating NULLs as EOLs, but converting them to spaces. SPC-4 does not tell that T10-based IDs should be NULL-terminated/padded. And while it tells that it should include only ASCII chars (0x20-0x7F), there are some USB sticks (SanDisk Ultra Fit), that have NULLs inside the value. Treating NULLs as EOLs there made those LUN IDs non-unique. MFC after: 1 week Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Dec 1 15:11:29 2014 (r275367) +++ head/sys/cam/cam_xpt.c Mon Dec 1 15:21:54 2014 (r275368) @@ -1136,8 +1136,15 @@ xpt_getattr(char *buf, size_t len, const if (idd == NULL) goto out; ret = 0; - if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == SVPD_ID_CODESET_ASCII || - (idd->proto_codeset & SVPD_ID_CODESET_MASK) == SVPD_ID_CODESET_UTF8) { + if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == SVPD_ID_CODESET_ASCII) { + if (idd->length < len) { + for (l = 0; l < idd->length; l++) + buf[l] = idd->identifier[l] ? + idd->identifier[l] : ' '; + buf[l] = 0; + } else + ret = EFAULT; + } else if ((idd->proto_codeset & SVPD_ID_CODESET_MASK) == SVPD_ID_CODESET_UTF8) { l = strnlen(idd->identifier, idd->length); if (l < len) { bcopy(idd->identifier, buf, l); From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:26:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A02833B; Mon, 1 Dec 2014 15:26:09 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39740CC1; Mon, 1 Dec 2014 15:26:09 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id EC1091FE022; Mon, 1 Dec 2014 16:26:06 +0100 (CET) Message-ID: <547C88A9.1070007@selasky.org> Date: Mon, 01 Dec 2014 16:26:33 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Alfred Perlstein , John Baldwin Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> In-Reply-To: <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:26:09 -0000 On 12/01/14 16:19, Alfred Perlstein wrote: > It makes little sense to have a rw sysctl that only takes effect "some times". This violates POLA at the expense of making code appear cleaner. Expectation is that writable sysctls take Hi, I think you are missing a new feature in 11-current, that if you add "CTLFLAG_TUN" to even dynamic sysctls, they get initialized from the enviroment, if any. That way you can just skip the TUNABLE_INT_FETCH() stuff! --HPS From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:29:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B4FB4671; Mon, 1 Dec 2014 15:29:29 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 91625CFA; Mon, 1 Dec 2014 15:29:29 +0000 (UTC) Received: from [100.93.87.91] (184.sub-70-197-13.myvzw.com [70.197.13.184]) by elvis.mu.org (Postfix) with ESMTPSA id 2D045341F872; Mon, 1 Dec 2014 07:29:29 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys From: Alfred Perlstein X-Mailer: iPhone Mail (12B436) In-Reply-To: <547C88A9.1070007@selasky.org> Date: Mon, 1 Dec 2014 07:29:28 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> To: Hans Petter Selasky Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:29:29 -0000 > On Dec 1, 2014, at 7:26 AM, Hans Petter Selasky wrote: >=20 >> On 12/01/14 16:19, Alfred Perlstein wrote: >> It makes little sense to have a rw sysctl that only takes effect "some ti= mes". This violates POLA at the expense of making code appear cleaner. Expec= tation is that writable sysctls take >=20 > Hi, >=20 > I think you are missing a new feature in 11-current, that if you add "CTLFL= AG_TUN" to even dynamic sysctls, they get initialized from the enviroment, i= f any. That way you can just skip the TUNABLE_INT_FETCH() stuff! >=20 Ok I can probably switch to that.=20 Any objection if I mfc this feature to -stable if it does what I need? > --HPS >=20 From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:34:28 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BBE987FC; Mon, 1 Dec 2014 15:34:28 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5022ADAD; Mon, 1 Dec 2014 15:34:28 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 37E981FE022; Mon, 1 Dec 2014 16:34:26 +0100 (CET) Message-ID: <547C8A9C.4080603@selasky.org> Date: Mon, 01 Dec 2014 16:34:52 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> In-Reply-To: <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:34:28 -0000 On 12/01/14 16:29, Alfred Perlstein wrote: > > >> On Dec 1, 2014, at 7:26 AM, Hans Petter Selasky wrote: >> >>> On 12/01/14 16:19, Alfred Perlstein wrote: >>> It makes little sense to have a rw sysctl that only takes effect "some times". This violates POLA at the expense of making code appear cleaner. Expectation is that writable sysctls take >> >> Hi, >> >> I think you are missing a new feature in 11-current, that if you add "CTLFLAG_TUN" to even dynamic sysctls, they get initialized from the enviroment, if any. That way you can just skip the TUNABLE_INT_FETCH() stuff! >> > > Ok I can probably switch to that. > > Any objection if I mfc this feature to -stable if it does what I need? > Hi, No objections from me at least, but it might require some work from your side, because there was a lot of cleanup about removing duplicate definitions, like static SYSCTLS which have already CTLFLAG_TUN and a TUNABLE fetch statement, which makes the variable init twice. Just look at the revision history for "kern/kern_sysctl.c" in 11-current. --HPS From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:39:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C8EE9AF; Mon, 1 Dec 2014 15:39:06 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id B224EDEC; Mon, 1 Dec 2014 15:39:05 +0000 (UTC) Received: from [100.93.87.91] (184.sub-70-197-13.myvzw.com [70.197.13.184]) by elvis.mu.org (Postfix) with ESMTPSA id 85BC5341F84F; Mon, 1 Dec 2014 07:39:05 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys From: Alfred Perlstein X-Mailer: iPhone Mail (12B436) In-Reply-To: <547C8A9C.4080603@selasky.org> Date: Mon, 1 Dec 2014 07:39:04 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> To: Hans Petter Selasky Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:39:06 -0000 > On Dec 1, 2014, at 7:34 AM, Hans Petter Selasky wrote: >=20 >> On 12/01/14 16:29, Alfred Perlstein wrote: >>=20 >>=20 >>>> On Dec 1, 2014, at 7:26 AM, Hans Petter Selasky wrote= : >>>>=20 >>>> On 12/01/14 16:19, Alfred Perlstein wrote: >>>> It makes little sense to have a rw sysctl that only takes effect "some t= imes". This violates POLA at the expense of making code appear cleaner. Expe= ctation is that writable sysctls take >>>=20 >>> Hi, >>>=20 >>> I think you are missing a new feature in 11-current, that if you add "CT= LFLAG_TUN" to even dynamic sysctls, they get initialized from the enviroment= , if any. That way you can just skip the TUNABLE_INT_FETCH() stuff! >>=20 >> Ok I can probably switch to that. >>=20 >> Any objection if I mfc this feature to -stable if it does what I need? >=20 > Hi, >=20 > No objections from me at least, but it might require some work from your s= ide, because there was a lot of cleanup about removing duplicate definitions= , like static SYSCTLS which have already CTLFLAG_TUN and a TUNABLE fetch sta= tement, which makes the variable init twice. Just look at the revision histo= ry for "kern/kern_sysctl.c" in 11-current. >=20 > --HPS >=20 >=20 One question though... For the global sysctl for all nodes.... When is the var fetched? If it's before SI_SUB_CPU it is not useful. =20= From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:43:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6F913BF6; Mon, 1 Dec 2014 15:43:06 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72091EBE; Mon, 1 Dec 2014 15:43:05 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 6949D1FE022; Mon, 1 Dec 2014 16:43:03 +0100 (CET) Message-ID: <547C8CA2.8040305@selasky.org> Date: Mon, 01 Dec 2014 16:43:30 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:43:06 -0000 On 12/01/14 16:39, Alfred Perlstein wrote: > > >> On Dec 1, 2014, at 7:34 AM, Hans Petter Selasky wrote: >> >>> On 12/01/14 16:29, Alfred Perlstein wrote: >>> >>> >>>>> On Dec 1, 2014, at 7:26 AM, Hans Petter Selasky wrote: >>>>> >>>>> On 12/01/14 16:19, Alfred Perlstein wrote: >>>>> It makes little sense to have a rw sysctl that only takes effect "some times". This violates POLA at the expense of making code appear cleaner. Expectation is that writable sysctls take >>>> >>>> Hi, >>>> >>>> I think you are missing a new feature in 11-current, that if you add "CTLFLAG_TUN" to even dynamic sysctls, they get initialized from the enviroment, if any. That way you can just skip the TUNABLE_INT_FETCH() stuff! >>> >>> Ok I can probably switch to that. >>> >>> Any objection if I mfc this feature to -stable if it does what I need? >> >> Hi, >> >> No objections from me at least, but it might require some work from your side, because there was a lot of cleanup about removing duplicate definitions, like static SYSCTLS which have already CTLFLAG_TUN and a TUNABLE fetch statement, which makes the variable init twice. Just look at the revision history for "kern/kern_sysctl.c" in 11-current. >> >> --HPS >> >> > > One question though... For the global sysctl for all nodes.... > > When is the var fetched? If it's before SI_SUB_CPU it is not useful. > Hi, It is quite early, actually: SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0); In some parts of the machine independent, MI, code you neee to keep the TUNABLE_FETCH'es, because its run before SI_SUB_KMEM ! --HPS From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:45:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97763DB5; Mon, 1 Dec 2014 15:45:05 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id 7F138ED9; Mon, 1 Dec 2014 15:45:05 +0000 (UTC) Received: from [100.93.87.91] (184.sub-70-197-13.myvzw.com [70.197.13.184]) by elvis.mu.org (Postfix) with ESMTPSA id 3FDBF341F84F; Mon, 1 Dec 2014 07:45:05 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys From: Alfred Perlstein X-Mailer: iPhone Mail (12B436) In-Reply-To: <547C8CA2.8040305@selasky.org> Date: Mon, 1 Dec 2014 07:45:03 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> <547C8CA2.8040305@selasky.org> To: Hans Petter Selasky Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:45:05 -0000 > On Dec 1, 2014, at 7:43 AM, Hans Petter Selasky wrote: >=20 >> On 12/01/14 16:39, Alfred Perlstein wrote: >>=20 >>=20 >>>> On Dec 1, 2014, at 7:34 AM, Hans Petter Selasky wrote= : >>>>=20 >>>> On 12/01/14 16:29, Alfred Perlstein wrote: >>>>=20 >>>>=20 >>>>>> On Dec 1, 2014, at 7:26 AM, Hans Petter Selasky wro= te: >>>>>>=20 >>>>>> On 12/01/14 16:19, Alfred Perlstein wrote: >>>>>> It makes little sense to have a rw sysctl that only takes effect "som= e times". This violates POLA at the expense of making code appear cleaner. E= xpectation is that writable sysctls take >>>>>=20 >>>>> Hi, >>>>>=20 >>>>> I think you are missing a new feature in 11-current, that if you add "= CTLFLAG_TUN" to even dynamic sysctls, they get initialized from the envirome= nt, if any. That way you can just skip the TUNABLE_INT_FETCH() stuff! >>>>=20 >>>> Ok I can probably switch to that. >>>>=20 >>>> Any objection if I mfc this feature to -stable if it does what I need? >>>=20 >>> Hi, >>>=20 >>> No objections from me at least, but it might require some work from your= side, because there was a lot of cleanup about removing duplicate definitio= ns, like static SYSCTLS which have already CTLFLAG_TUN and a TUNABLE fetch s= tatement, which makes the variable init twice. Just look at the revision his= tory for "kern/kern_sysctl.c" in 11-current. >>>=20 >>> --HPS >>=20 >> One question though... For the global sysctl for all nodes.... >>=20 >> When is the var fetched? If it's before SI_SUB_CPU it is not useful. >=20 > Hi, >=20 > It is quite early, actually: >=20 > SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0); >=20 > In some parts of the machine independent, MI, code you neee to keep the TU= NABLE_FETCH'es, because its run before SI_SUB_KMEM ! Then it will not work unless I move the global n_queues sysctl creation into= the driver's mod load function.=20 Is that ok? >=20 > --HPS >=20 >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:48:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D5D7F77; Mon, 1 Dec 2014 15:48:39 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 190D2F0A; Mon, 1 Dec 2014 15:48:39 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0D23D1FE022; Mon, 1 Dec 2014 16:48:37 +0100 (CET) Message-ID: <547C8DEF.5020809@selasky.org> Date: Mon, 01 Dec 2014 16:49:03 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> <547C8CA2.8040305@selasky.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:48:39 -0000 On 12/01/14 16:45, Alfred Perlstein wrote: > > > Hi, >> >> It is quite early, actually: >> >> SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0); >> >> In some parts of the machine independent, MI, code you neee to keep the TUNABLE_FETCH'es, because its run before SI_SUB_KMEM ! > > Then it will not work unless I move the global n_queues sysctl creation into the driver's mod load function. > > Is that ok? Are you asking me? --HPS From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:49:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D752D150; Mon, 1 Dec 2014 15:49:21 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACA82F17; Mon, 1 Dec 2014 15:49:21 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 10981B94E; Mon, 1 Dec 2014 10:49:20 -0500 (EST) From: John Baldwin To: Alfred Perlstein Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys Date: Mon, 01 Dec 2014 10:49:16 -0500 Message-ID: <1762770.yx1cv63jp7@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 01 Dec 2014 10:49:20 -0500 (EST) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:49:22 -0000 On Monday, December 01, 2014 07:19:13 AM Alfred Perlstein wrote: > John, > > Will work on a new revision based on feedback. > > Two things to note however: > > Already explored the idea of using kernel_sysctlbyname but rejected due to > following: > > It makes little sense to have a rw sysctl that only takes effect "some > times". This violates POLA at the expense of making code appear cleaner. > Expectation is that writable sysctls take effect or are read only. They are > not to be "write sometimes" unless we are to introduce a new flag. Instead > of going to a confusing model we consider some form of rw sysctl that can > set itself ro somehow. Otherwise people will be confused as to why nic > queues says N while actually M. What the rw->ro api would look like I have > no idea. Suggestions? This is only somewhat true. In the near distant future we will have a devctl tool which would let you do 'devctl detach igb0 && devctl attach igb0' which would honor your post-boot setting of hw.igb.num_queues. Instead what is important to understand about this particular sysctl node is that it only takes affect when a device is attached. However, there are other control knobs that also only affect future operations and not existing instances of objects, so I don't think this is that big of a leap. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:49:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1C400323; Mon, 1 Dec 2014 15:49:23 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BCA52F1A; Mon, 1 Dec 2014 15:49:23 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id AA71CB9BA; Mon, 1 Dec 2014 10:49:22 -0500 (EST) From: John Baldwin To: Hans Petter Selasky Subject: Re: svn commit: r275358 - in head/sys: dev/bxe dev/cxgb dev/cxgbe dev/e1000 dev/ixgbe dev/ixl dev/mxge dev/netmap dev/oce dev/qlxgbe dev/qlxge dev/sfxge dev/virtio/network dev/vmware/vmxnet3 dev/vxge n... Date: Mon, 01 Dec 2014 10:34:37 -0500 Message-ID: <2020433.4XkkFeczi5@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <547C8625.3030000@selasky.org> References: <201412011145.sB1BjPEI092904@svn.freebsd.org> <2301463.0AvfjFzmc1@ralph.baldwin.cx> <547C8625.3030000@selasky.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 01 Dec 2014 10:49:22 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:49:24 -0000 On Monday, December 01, 2014 04:15:49 PM Hans Petter Selasky wrote: > Hi John, > > These patches were sent to the -current mailing list for review for 12 > days. No big issues were mentioned. > > Also a review has been made at "reviews.freebsd.org": > https://reviews.freebsd.org/D1243 > > No response yet. > > If I missed someone for the review process please let me know. Even if no one comments, please include the review URL in the "Differential Review" field. Also, I think you could probably have put 'Discussed with: adrian, kmacy' in the commit. Arguably from the followups in that thread you might have been able to put "Reviewed by: adrian" as well if this is just the cleanup patches that he said were ok. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:55:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CACD974A; Mon, 1 Dec 2014 15:55:59 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id B4F4F29; Mon, 1 Dec 2014 15:55:59 +0000 (UTC) Received: from [100.93.87.91] (184.sub-70-197-13.myvzw.com [70.197.13.184]) by elvis.mu.org (Postfix) with ESMTPSA id 77A87341F867; Mon, 1 Dec 2014 07:55:59 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys From: Alfred Perlstein X-Mailer: iPhone Mail (12B436) In-Reply-To: <1762770.yx1cv63jp7@ralph.baldwin.cx> Date: Mon, 1 Dec 2014 07:55:57 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <6753416A-D6FD-47F4-A62E-99A6ABB9B4B2@mu.org> References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <1762770.yx1cv63jp7@ralph.baldwin.cx> To: John Baldwin Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:55:59 -0000 > On Dec 1, 2014, at 7:49 AM, John Baldwin wrote: >=20 >> On Monday, December 01, 2014 07:19:13 AM Alfred Perlstein wrote: >> John, >>=20 >> Will work on a new revision based on feedback. >>=20 >> Two things to note however: >>=20 >> Already explored the idea of using kernel_sysctlbyname but rejected due t= o >> following: >>=20 >> It makes little sense to have a rw sysctl that only takes effect "some >> times". This violates POLA at the expense of making code appear cleaner. >> Expectation is that writable sysctls take effect or are read only. They a= re >> not to be "write sometimes" unless we are to introduce a new flag. Instea= d >> of going to a confusing model we consider some form of rw sysctl that can= >> set itself ro somehow. Otherwise people will be confused as to why nic >> queues says N while actually M. What the rw->ro api would look like I ha= ve >> no idea. Suggestions? >=20 > This is only somewhat true. In the near distant future we will have a dev= ctl=20 > tool which would let you do 'devctl detach igb0 && devctl attach igb0' whi= ch=20 > would honor your post-boot setting of hw.igb.num_queues. Instead what is=20= > important to understand about this particular sysctl node is that it only=20= > takes affect when a device is attached. However, there are other control=20= > knobs that also only affect future operations and not existing instances o= f=20 > objects, so I don't think this is that big of a leap. >=20 Strongly disagree here. If I were not able to grok the c code I would be ve= ry confused by such a thing. In fact even with the fact that I do grok c cod= e I would be very discouraged to find such behavior and strongly object to w= ritable sysctls that do nothing.=20 The ux is that the user has a bunch of dials on their dashboard that functio= n as a busybox as opposed to doing what they are advertised to do. Sort of l= ike those crossing light buttons in New York City that aren't actually hooke= d to anything.=20 So: No. Frankly would rather back out the change entirely and keep this chan= ge local to us than expose users to such a UX.=20 I will however like to discuss the possibility of a tunable/sysctl system th= at makes sense.=20 -Alfred.=20 > --=20 > John Baldwin >=20 From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 15:56:51 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 472DA88D; Mon, 1 Dec 2014 15:56:51 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id CE30760; Mon, 1 Dec 2014 15:56:50 +0000 (UTC) Received: from [100.93.87.91] (184.sub-70-197-13.myvzw.com [70.197.13.184]) by elvis.mu.org (Postfix) with ESMTPSA id BF4FF341F84F; Mon, 1 Dec 2014 07:56:50 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys From: Alfred Perlstein X-Mailer: iPhone Mail (12B436) In-Reply-To: <547C8DEF.5020809@selasky.org> Date: Mon, 1 Dec 2014 07:56:50 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> <547C8CA2.8040305@selasky.org> <547C8DEF.5020809@selasky.org> To: Hans Petter Selasky Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 15:56:51 -0000 > On Dec 1, 2014, at 7:49 AM, Hans Petter Selasky wrote: >=20 >> On 12/01/14 16:45, Alfred Perlstein wrote: >>=20 >> > Hi, >>>=20 >>> It is quite early, actually: >>>=20 >>> SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0); >>>=20 >>> In some parts of the machine independent, MI, code you neee to keep the T= UNABLE_FETCH'es, because its run before SI_SUB_KMEM ! >>=20 >> Then it will not work unless I move the global n_queues sysctl creation i= nto the driver's mod load function. >>=20 >> Is that ok? >=20 > Are you asking me? In soviet russia no one is ever sure whom to ask for permission to proceed.=20= (Also you have significant commits to the driver so it makes sense. ) >=20 > --HPS >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 16:05:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BDF34B8A; Mon, 1 Dec 2014 16:05:46 +0000 (UTC) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FF1F188; Mon, 1 Dec 2014 16:05:46 +0000 (UTC) Received: by mail-wi0-f171.google.com with SMTP id bs8so25049846wib.16 for ; Mon, 01 Dec 2014 08:05:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=yWBInz3/WtrFT99C6UK0zEZvTwP5W51GpbP1dg6wvvw=; b=TJ/GY3mFiUqM3ajb4OiFLDc1BTpSnYjO4rdr0ivP0KUGkSIwzSxrNvi1ZRHruNbKnj c0j4pyhqiBEAqyz3UqIPAO2lWcHhxRDo2EA+AxGDz79n7N392IQ5U1AvguJJpU+mUcED 3kOggIsv8GHh+KLDbrFV2kMNjTIf/VD8kTF6cUmR/07nRWitqdxk/T08Aa52FnOPUytF wWHIWXitnOriUhrwHB8sta8ah10n29V3HrHYZTx9i6drIFBGSzcqBgEKj41P9UkCsHlb MHQ/+wrI9xU8y+tkSqMK1CzvHqGWOw0ZWOYS5+nmbM7cSBjIMzwr+W25N+BuheVigIEi UY0w== MIME-Version: 1.0 X-Received: by 10.194.92.116 with SMTP id cl20mr97439201wjb.71.1417449943581; Mon, 01 Dec 2014 08:05:43 -0800 (PST) Received: by 10.194.81.233 with HTTP; Mon, 1 Dec 2014 08:05:43 -0800 (PST) In-Reply-To: References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> <547C8CA2.8040305@selasky.org> <547C8DEF.5020809@selasky.org> Date: Mon, 1 Dec 2014 08:05:43 -0800 Message-ID: Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys From: Jack Vogel To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: Hans Petter Selasky , "src-committers@freebsd.org" , John Baldwin , "svn-src-all@freebsd.org" , Alfred Perlstein , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 16:05:46 -0000 There is no mystery about who's drivers these are, and its not like it would take a lot of effort to figure out ownership and ask us for review. Remove this commit until I have had time to look it over! Jack On Mon, Dec 1, 2014 at 7:56 AM, Alfred Perlstein wrote: > > > > On Dec 1, 2014, at 7:49 AM, Hans Petter Selasky wrote: > > > >> On 12/01/14 16:45, Alfred Perlstein wrote: > >> > >> > Hi, > >>> > >>> It is quite early, actually: > >>> > >>> SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0); > >>> > >>> In some parts of the machine independent, MI, code you neee to keep > the TUNABLE_FETCH'es, because its run before SI_SUB_KMEM ! > >> > >> Then it will not work unless I move the global n_queues sysctl creation > into the driver's mod load function. > >> > >> Is that ok? > > > > Are you asking me? > > In soviet russia no one is ever sure whom to ask for permission to proceed. > > (Also you have significant commits to the driver so it makes sense. ) > > > > > > --HPS > > > > > > From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 16:07:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AE0ACCF1; Mon, 1 Dec 2014 16:07:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A0271AA; Mon, 1 Dec 2014 16:07:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1G7XVc015498; Mon, 1 Dec 2014 16:07:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1G7WTT015493; Mon, 1 Dec 2014 16:07:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412011607.sB1G7WTT015493@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 1 Dec 2014 16:07:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275369 - in head/contrib/elftoolchain: elfcopy libelftc nm strings X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 16:07:33 -0000 Author: emaste Date: Mon Dec 1 16:07:31 2014 New Revision: 275369 URL: https://svnweb.freebsd.org/changeset/base/275369 Log: Fix elftoolchain tools in-tree build * make variables static * add header for uint*_t typedefs Modified: head/contrib/elftoolchain/elfcopy/ascii.c head/contrib/elftoolchain/elfcopy/segments.c head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c head/contrib/elftoolchain/nm/nm.c head/contrib/elftoolchain/strings/strings.c Modified: head/contrib/elftoolchain/elfcopy/ascii.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/ascii.c Mon Dec 1 15:21:54 2014 (r275368) +++ head/contrib/elftoolchain/elfcopy/ascii.c Mon Dec 1 16:07:31 2014 (r275369) @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include Modified: head/contrib/elftoolchain/elfcopy/segments.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/segments.c Mon Dec 1 15:21:54 2014 (r275368) +++ head/contrib/elftoolchain/elfcopy/segments.c Mon Dec 1 16:07:31 2014 (r275369) @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include Modified: head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c ============================================================================== --- head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Mon Dec 1 15:21:54 2014 (r275368) +++ head/contrib/elftoolchain/libelftc/libelftc_dem_gnu3.c Mon Dec 1 16:07:31 2014 (r275369) @@ -156,7 +156,7 @@ static int vector_type_qualifier_init(st static int vector_type_qualifier_push(struct vector_type_qualifier *, enum type_qualifier); -int cpp_demangle_gnu3_push_head; +static int cpp_demangle_gnu3_push_head; /** * @brief Decode the input string by IA-64 C++ ABI style. Modified: head/contrib/elftoolchain/nm/nm.c ============================================================================== --- head/contrib/elftoolchain/nm/nm.c Mon Dec 1 15:21:54 2014 (r275368) +++ head/contrib/elftoolchain/nm/nm.c Mon Dec 1 16:07:31 2014 (r275369) @@ -65,7 +65,7 @@ typedef void (*fn_sym_print)(const GElf_ typedef int (*fn_filter)(char, const GElf_Sym *, const char *); /* output filter list */ -SLIST_HEAD(filter_head, filter_entry) nm_out_filter = +static SLIST_HEAD(filter_head, filter_entry) nm_out_filter = SLIST_HEAD_INITIALIZER(nm_out_filter); struct filter_entry { Modified: head/contrib/elftoolchain/strings/strings.c ============================================================================== --- head/contrib/elftoolchain/strings/strings.c Mon Dec 1 15:21:54 2014 (r275368) +++ head/contrib/elftoolchain/strings/strings.c Mon Dec 1 16:07:31 2014 (r275369) @@ -75,9 +75,9 @@ enum encoding_style { (encoding == ENCODING_8BIT && (c) > 127))) -int encoding_size, entire_file, min_len, show_filename, show_loc; -enum encoding_style encoding; -enum radix_style radix; +static int encoding_size, entire_file, min_len, show_filename, show_loc; +static enum encoding_style encoding; +static enum radix_style radix; static struct option strings_longopts[] = { { "all", no_argument, NULL, 'a'}, From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 16:09:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 08DDAE4F; Mon, 1 Dec 2014 16:09:00 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id DCC361C0; Mon, 1 Dec 2014 16:08:59 +0000 (UTC) Received: from [100.93.87.91] (184.sub-70-197-13.myvzw.com [70.197.13.184]) by elvis.mu.org (Postfix) with ESMTPSA id C2244341F84F; Mon, 1 Dec 2014 08:08:59 -0800 (PST) Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys From: Alfred Perlstein X-Mailer: iPhone Mail (12B436) In-Reply-To: Date: Mon, 1 Dec 2014 08:08:59 -0800 Message-Id: <92F537D5-E1C8-402E-9EDC-CB6270059BCA@mu.org> References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> <547C8CA2.8040305@selasky.org> <547C8DEF.5020809@selasky.org> To: Jack Vogel Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: Hans Petter Selasky , "src-committers@freebsd.org" , John Baldwin , "svn-src-all@freebsd.org" , Alfred Perlstein , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 16:09:00 -0000 Jack you were asked. Please see the review system.=20 Sent from my iPhone > On Dec 1, 2014, at 8:05 AM, Jack Vogel wrote: >=20 > There is no mystery about who's drivers these are, and its not like it wou= ld > take a lot of effort to figure out ownership and ask us for review.=20 >=20 > Remove this commit until I have had time to look it over! >=20 > Jack >=20 >=20 >> On Mon, Dec 1, 2014 at 7:56 AM, Alfred Perlstein wrote: >>=20 >>=20 >> > On Dec 1, 2014, at 7:49 AM, Hans Petter Selasky wrote= : >> > >> >> On 12/01/14 16:45, Alfred Perlstein wrote: >> >> >> >> > Hi, >> >>> >> >>> It is quite early, actually: >> >>> >> >>> SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0);= >> >>> >> >>> In some parts of the machine independent, MI, code you neee to keep t= he TUNABLE_FETCH'es, because its run before SI_SUB_KMEM ! >> >> >> >> Then it will not work unless I move the global n_queues sysctl creatio= n into the driver's mod load function. >> >> >> >> Is that ok? >> > >> > Are you asking me? >>=20 >> In soviet russia no one is ever sure whom to ask for permission to procee= d. >>=20 >> (Also you have significant commits to the driver so it makes sense. ) >>=20 >>=20 >> > >> > --HPS >> > >> > >=20 From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 16:10:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 654E0FA1; Mon, 1 Dec 2014 16:10:04 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 51A4B1CE; Mon, 1 Dec 2014 16:10:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1GA4Q6015965; Mon, 1 Dec 2014 16:10:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1GA4Kv015964; Mon, 1 Dec 2014 16:10:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412011610.sB1GA4Kv015964@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 1 Dec 2014 16:10:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275370 - head/contrib/elftoolchain/size X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 16:10:04 -0000 Author: emaste Date: Mon Dec 1 16:10:03 2014 New Revision: 275370 URL: https://svnweb.freebsd.org/changeset/base/275370 Log: Temporarily disable non-FreeBSD NT_ note types Modified: head/contrib/elftoolchain/size/size.c Modified: head/contrib/elftoolchain/size/size.c ============================================================================== --- head/contrib/elftoolchain/size/size.c Mon Dec 1 16:07:31 2014 (r275369) +++ head/contrib/elftoolchain/size/size.c Mon Dec 1 16:10:03 2014 (r275370) @@ -269,7 +269,7 @@ handle_core_note(Elf *elf, GElf_Ehdr *el static pid_t pid; uintptr_t ver; Elf32_Nhdr *nhdr, nhdr_l; - static int reg_pseudo = 0, reg2_pseudo = 0, regxfp_pseudo = 0; + static int reg_pseudo = 0, reg2_pseudo = 0 /*, regxfp_pseudo = 0*/; char buf[BUF_SIZE], *data, *name; if (elf == NULL || elfhdr == NULL || phdr == NULL) @@ -360,6 +360,7 @@ handle_core_note(Elf *elf, GElf_Ehdr *el text_size_total += nhdr_l.n_descsz; } break; +#if 0 case NT_AUXV: if (style == STYLE_SYSV) { tbl_append(); @@ -390,6 +391,7 @@ handle_core_note(Elf *elf, GElf_Ehdr *el } break; case NT_PSINFO: +#endif case NT_PRPSINFO: { /* FreeBSD 64-bit */ if (nhdr_l.n_descsz == 0x78 && @@ -415,8 +417,10 @@ handle_core_note(Elf *elf, GElf_Ehdr *el } break; } +#if 0 case NT_PSTATUS: case NT_LWPSTATUS: +#endif default: break; } From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 16:10:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E833167; Mon, 1 Dec 2014 16:10:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 10B051D4; Mon, 1 Dec 2014 16:10:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1GAi4e018981; Mon, 1 Dec 2014 16:10:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1GAiZM018980; Mon, 1 Dec 2014 16:10:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412011610.sB1GAiZM018980@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 1 Dec 2014 16:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275371 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 16:10:45 -0000 Author: emaste Date: Mon Dec 1 16:10:44 2014 New Revision: 275371 URL: https://svnweb.freebsd.org/changeset/base/275371 Log: Track libarchive API change Modified: head/contrib/elftoolchain/elfcopy/archive.c Modified: head/contrib/elftoolchain/elfcopy/archive.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/archive.c Mon Dec 1 16:10:03 2014 (r275370) +++ head/contrib/elftoolchain/elfcopy/archive.c Mon Dec 1 16:10:44 2014 (r275371) @@ -350,12 +350,12 @@ ac_detect_ar(int ifd) r = -1; if ((a = archive_read_new()) == NULL) return (0); - archive_read_support_compression_none(a); + archive_read_support_filter_none(a); archive_read_support_format_ar(a); if (archive_read_open_fd(a, ifd, 10240) == ARCHIVE_OK) r = archive_read_next_header(a, &entry); archive_read_close(a); - archive_read_finish(a); + archive_read_free(a); return (r == ARCHIVE_OK); } @@ -386,7 +386,7 @@ ac_read_objs(struct elfcopy *ecp, int if err(EXIT_FAILURE, "lseek failed"); if ((a = archive_read_new()) == NULL) errx(EXIT_FAILURE, "%s", archive_error_string(a)); - archive_read_support_compression_none(a); + archive_read_support_filter_none(a); archive_read_support_format_ar(a); AC(archive_read_open_fd(a, ifd, 10240)); for(;;) { @@ -435,7 +435,7 @@ ac_read_objs(struct elfcopy *ecp, int if } } AC(archive_read_close(a)); - ACV(archive_read_finish(a)); + ACV(archive_read_free(a)); } static void @@ -449,7 +449,7 @@ ac_write_objs(struct elfcopy *ecp, int o if ((a = archive_write_new()) == NULL) errx(EXIT_FAILURE, "%s", archive_error_string(a)); archive_write_set_format_ar_svr4(a); - archive_write_set_compression_none(a); + archive_write_add_filter_none(a); AC(archive_write_open_fd(a, ofd)); /* Write the archive symbol table, even if it's empty. */ @@ -491,7 +491,7 @@ ac_write_objs(struct elfcopy *ecp, int o } AC(archive_write_close(a)); - ACV(archive_write_finish(a)); + ACV(archive_write_free(a)); } static void From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 16:13:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CC1D52E3; Mon, 1 Dec 2014 16:13:09 +0000 (UTC) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52C3228B; Mon, 1 Dec 2014 16:13:09 +0000 (UTC) Received: by mail-wi0-f179.google.com with SMTP id ex7so17951194wid.0 for ; Mon, 01 Dec 2014 08:13:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Jqn5PnYeAyI1XcUPal+tEvlhSlTH+374Di2CldbJeT0=; b=ZcGyP6SwSWcUIefmTHV+rWCj+F3NKI9h+l4LdS9ZUvmZEJzEh7PyfOkOVe1fYLU2JI qEQ5rhjsnwZ4TVyLpd3yzpePyRXACP/oXfMAIk2KnqGNxspSIzDFA7qOJ4UPTarv/Buz zdElKgRkAB8oEiGiNs9E6Zi9xquRFe5gglVYwDgHUkyRx5eFNb4DvKKOLUILNMjjiTzV HbJgWVhP+50s6B5AIWBm/C+YkszPQ3gn+OrgXxidN/uV9BF84XTFdfbt5lQw4YQ9CSM+ Ot4+wsM9LNfMACLB/HpqjMDgWIJ44PGSN153Dfwr5mocTW7Vd7O7/U6mJv9rwSW6M1lo wHMQ== MIME-Version: 1.0 X-Received: by 10.180.99.1 with SMTP id em1mr86330439wib.29.1417450387617; Mon, 01 Dec 2014 08:13:07 -0800 (PST) Received: by 10.194.81.233 with HTTP; Mon, 1 Dec 2014 08:13:07 -0800 (PST) In-Reply-To: <92F537D5-E1C8-402E-9EDC-CB6270059BCA@mu.org> References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> <547C8CA2.8040305@selasky.org> <547C8DEF.5020809@selasky.org> <92F537D5-E1C8-402E-9EDC-CB6270059BCA@mu.org> Date: Mon, 1 Dec 2014 08:13:07 -0800 Message-ID: Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys From: Jack Vogel To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: Hans Petter Selasky , "src-committers@freebsd.org" , John Baldwin , "svn-src-all@freebsd.org" , Alfred Perlstein , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 16:13:10 -0000 Really, and did I say that I approved, because I do not recall the event? Jack On Mon, Dec 1, 2014 at 8:08 AM, Alfred Perlstein wrote: > Jack you were asked. Please see the review system. > > Sent from my iPhone > > On Dec 1, 2014, at 8:05 AM, Jack Vogel wrote: > > There is no mystery about who's drivers these are, and its not like it > would > take a lot of effort to figure out ownership and ask us for review. > > Remove this commit until I have had time to look it over! > > Jack > > > On Mon, Dec 1, 2014 at 7:56 AM, Alfred Perlstein wrote: > >> >> >> > On Dec 1, 2014, at 7:49 AM, Hans Petter Selasky >> wrote: >> > >> >> On 12/01/14 16:45, Alfred Perlstein wrote: >> >> >> >> > Hi, >> >>> >> >>> It is quite early, actually: >> >>> >> >>> SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0); >> >>> >> >>> In some parts of the machine independent, MI, code you neee to keep >> the TUNABLE_FETCH'es, because its run before SI_SUB_KMEM ! >> >> >> >> Then it will not work unless I move the global n_queues sysctl >> creation into the driver's mod load function. >> >> >> >> Is that ok? >> > >> > Are you asking me? >> >> In soviet russia no one is ever sure whom to ask for permission to >> proceed. >> >> (Also you have significant commits to the driver so it makes sense. ) >> >> >> > >> > --HPS >> > >> > >> >> > From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 16:28:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 49F27888; Mon, 1 Dec 2014 16:28:35 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D8AF5F7; Mon, 1 Dec 2014 16:28:34 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C5D9A1FE022; Mon, 1 Dec 2014 17:28:31 +0100 (CET) Message-ID: <547C974A.9050302@selasky.org> Date: Mon, 01 Dec 2014 17:28:58 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> <547C8CA2.8040305@selasky.org> <547C8DEF.5020809@selasky.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 16:28:35 -0000 On 12/01/14 16:56, Alfred Perlstein wrote: > > >> On Dec 1, 2014, at 7:49 AM, Hans Petter Selasky wrote: >> >>> On 12/01/14 16:45, Alfred Perlstein wrote: >>> >>>> Hi, >>>> >>>> It is quite early, actually: >>>> >>>> SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0); >>>> >>>> In some parts of the machine independent, MI, code you neee to keep the TUNABLE_FETCH'es, because its run before SI_SUB_KMEM ! >>> >>> Then it will not work unless I move the global n_queues sysctl creation into the driver's mod load function. >>> >>> Is that ok? >> >> Are you asking me? > > In soviet russia no one is ever sure whom to ask for permission to proceed. > > (Also you have significant commits to the driver so it makes sense. ) > Ok, You need to check "sys/sys/kernel.h" for the full init order and figure out where exactly your driver code is running and make sure that is running after the SYSCTL/TUNABLE gets init. --HPS From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 16:31:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B8847A10; Mon, 1 Dec 2014 16:31:09 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 7E9A16BF; Mon, 1 Dec 2014 16:31:09 +0000 (UTC) Received: from [100.93.87.91] (184.sub-70-197-13.myvzw.com [70.197.13.184]) by elvis.mu.org (Postfix) with ESMTPSA id 12619341F867; Mon, 1 Dec 2014 08:31:09 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys From: Alfred Perlstein X-Mailer: iPhone Mail (12B436) In-Reply-To: <547C974A.9050302@selasky.org> Date: Mon, 1 Dec 2014 08:31:08 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <4CE4C10D-93B0-4E27-878D-34C0A7CF3C94@mu.org> References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> <547C8CA2.8040305@selasky.org> <547C8DEF.5020809@selasky.org> <547C974A.9050302@selasky.org> To: Hans Petter Selasky Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 16:31:09 -0000 > On Dec 1, 2014, at 8:28 AM, Hans Petter Selasky wrote: >=20 >> On 12/01/14 16:56, Alfred Perlstein wrote: >>=20 >>=20 >>>> On Dec 1, 2014, at 7:49 AM, Hans Petter Selasky wrote= : >>>>=20 >>>>> On 12/01/14 16:45, Alfred Perlstein wrote: >>>>>=20 >>>>> Hi, >>>>>=20 >>>>> It is quite early, actually: >>>>>=20 >>>>> SYSINIT(sysctl, SI_SUB_KMEM, SI_ORDER_FIRST, sysctl_register_all, 0); >>>>>=20 >>>>> In some parts of the machine independent, MI, code you neee to keep th= e TUNABLE_FETCH'es, because its run before SI_SUB_KMEM ! >>>>=20 >>>> Then it will not work unless I move the global n_queues sysctl creation= into the driver's mod load function. >>>>=20 >>>> Is that ok? >>>=20 >>> Are you asking me? >>=20 >> In soviet russia no one is ever sure whom to ask for permission to procee= d. >>=20 >> (Also you have significant commits to the driver so it makes sense. ) >=20 > Ok, >=20 > You need to check "sys/sys/kernel.h" for the full init order and figure ou= t where exactly your driver code is running and make sure that is running af= ter the SYSCTL/TUNABLE gets init. Yes that is why it is being done by hand in the probe routine. I think prope= r thing might be a way to sort out how to get tunables to run at a driver lo= ad event? Is that possible? >=20 > --HPS >=20 >=20 From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 16:37:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1232C90; Mon, 1 Dec 2014 16:37:22 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0314B758; Mon, 1 Dec 2014 16:37:22 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0070A1FE022; Mon, 1 Dec 2014 17:37:19 +0100 (CET) Message-ID: <547C995A.2060005@selasky.org> Date: Mon, 01 Dec 2014 17:37:46 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Alfred Perlstein Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> <547C8CA2.8040305@selasky.org> <547C8DEF.5020809@selasky.org> <547C974A.9050302@selasky.org> <4CE4C10D-93B0-4E27-878D-34C0A7CF3C94@mu.org> In-Reply-To: <4CE4C10D-93B0-4E27-878D-34C0A7CF3C94@mu.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 16:37:22 -0000 Hi, I think you maybe missed a point .... On 12/01/14 17:31, Alfred Perlstein wrote: > > Yes that is why it is being done by hand in the probe routine. I think proper thing might be a way to sort out how to get tunables to run at a driver load event? Is that possible? All sysctls are tried init when they are created, both so-called "static" and "dynamic" ones. If the sysctl is created inside the probe routine and has the tunable flag set, it will get init before the creation is complete, if present in the boot environment. If the sysctl is of a "static" kind, it will be created and initialized when SI_SUB_KMEM is executing! --HPS From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 16:39:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B987DDE2; Mon, 1 Dec 2014 16:39:22 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78052766; Mon, 1 Dec 2014 16:39:22 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 2C470B923; Mon, 1 Dec 2014 11:39:21 -0500 (EST) From: John Baldwin To: Alfred Perlstein Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys Date: Mon, 01 Dec 2014 11:39:07 -0500 Message-ID: <1558372.GUDICe5l9S@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <6753416A-D6FD-47F4-A62E-99A6ABB9B4B2@mu.org> References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <1762770.yx1cv63jp7@ralph.baldwin.cx> <6753416A-D6FD-47F4-A62E-99A6ABB9B4B2@mu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 01 Dec 2014 11:39:21 -0500 (EST) Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 16:39:22 -0000 On Monday, December 01, 2014 07:55:57 AM Alfred Perlstein wrote: > > On Dec 1, 2014, at 7:49 AM, John Baldwin wrote: > >> On Monday, December 01, 2014 07:19:13 AM Alfred Perlstein wrote: > >> John, > >> > >> Will work on a new revision based on feedback. > >> > >> Two things to note however: > >> > >> Already explored the idea of using kernel_sysctlbyname but rejected due > >> to > >> following: > >> > >> It makes little sense to have a rw sysctl that only takes effect "some > >> times". This violates POLA at the expense of making code appear cleaner. > >> Expectation is that writable sysctls take effect or are read only. They > >> are > >> not to be "write sometimes" unless we are to introduce a new flag. > >> Instead > >> of going to a confusing model we consider some form of rw sysctl that can > >> set itself ro somehow. Otherwise people will be confused as to why nic > >> queues says N while actually M. What the rw->ro api would look like I > >> have > >> no idea. Suggestions? > > > > This is only somewhat true. In the near distant future we will have a > > devctl tool which would let you do 'devctl detach igb0 && devctl attach > > igb0' which would honor your post-boot setting of hw.igb.num_queues. > > Instead what is important to understand about this particular sysctl node > > is that it only takes affect when a device is attached. However, there > > are other control knobs that also only affect future operations and not > > existing instances of objects, so I don't think this is that big of a > > leap. > > Strongly disagree here. If I were not able to grok the c code I would be > very confused by such a thing. In fact even with the fact that I do grok c > code I would be very discouraged to find such behavior and strongly object > to writable sysctls that do nothing. It's not hard to document this in the way that that sysctls are documented: Index: if_igb.c =================================================================== --- if_igb.c (revision 275032) +++ if_igb.c (working copy) @@ -390,7 +390,7 @@ SYSCTL_INT(_hw_igb, OID_AUTO, header_split, CTLFLA */ static int igb_num_queues = 0; SYSCTL_INT(_hw_igb, OID_AUTO, num_queues, CTLFLAG_RDTUN, &igb_num_queues, 0, - "Number of queues to configure, 0 indicates autoconfigure"); + "Number of queues to configure during attach, 0 indicates autoconfigure"); /* ** Global variable to store last used CPU when binding queues That is fairly clear from 'sysctl -D' (what I'd use first to discern what a sysctl does). The fact that the newly added 'dev.igb.0.num_queues' (which I think is fine to add would be read-only) would make it clear you can't change this at runtime on an existing interface. On the other hand, I do think it makes sense to figure out what meta thing you are trying to do. I assume you simply want a way to disable multiqueue at runtime and you don't want to do this in the loader? (Given you are using an in-house module for this, adding a change to the loader to set the tunable might be even less work and would require no kernel changes at all, even for future drivers for which you may want to set a tunable.) The other option you have for your use case of course is to simply wait to load igb.ko until after you've booted. If you aren't using an NFS root over your igb interfaces, then that seems far simpler than any of the suggested changes. You can even do the work in userland with an rc.d script that uses kenv to set tunables before you load igb.ko. Actually, you can handle even NFS root for this case. Simply load igb from the loader using igb.ko. You can then have the SYSINIT in your special module run at SI_SUB_TUNABLES, SI_ORDER_FIRST. It won't actually run until closer to SI_SUB_KLD, but what happens is that after SI_SUB_KLD runs linker_preload(), all the SYSINITs in the various modules are sorted into the global list and then run in the resulting order. So you can insert a sysinit in your module that runs at SI_SUB_TUNABLES, SI_ORDER_FIRST (the one you currently have at SI_SUB_CPU) and it will run before igb.ko fetches any of its tunables. This will work for any driver so long as you ship it as a module without needing any code changes to any driver, and works for any tunable. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 16:46:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97620BE; Mon, 1 Dec 2014 16:46:33 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id 7B2A5855; Mon, 1 Dec 2014 16:46:33 +0000 (UTC) Received: from [100.93.87.91] (184.sub-70-197-13.myvzw.com [70.197.13.184]) by elvis.mu.org (Postfix) with ESMTPSA id EADEE341F850; Mon, 1 Dec 2014 08:46:32 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys From: Alfred Perlstein X-Mailer: iPhone Mail (12B436) In-Reply-To: <547C995A.2060005@selasky.org> Date: Mon, 1 Dec 2014 08:46:32 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> <547C8CA2.8040305@selasky.org> <547C8DEF.5020809@selasky.org> <547C974A.9050302@selasky.org> <4CE4C10D-93B0-4E27-878D-34C0A7CF3C94@mu.org> <547C995A.2060005@selasky.org> To: Hans Petter Selasky Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 16:46:33 -0000 > On Dec 1, 2014, at 8:37 AM, Hans Petter Selasky wrote: >=20 > Hi, >=20 > I think you maybe missed a point .... >=20 >> On 12/01/14 17:31, Alfred Perlstein wrote: >>=20 >> Yes that is why it is being done by hand in the probe routine. I think pr= oper thing might be a way to sort out how to get tunables to run at a driver= load event? Is that possible? >=20 > All sysctls are tried init when they are created, both so-called "static" a= nd "dynamic" ones. >=20 > If the sysctl is created inside the probe routine and has the tunable flag= set, it will get init before the creation is complete, if present in the bo= ot environment. >=20 > If the sysctl is of a "static" kind, it will be created and initialized wh= en SI_SUB_KMEM is executing! I totally understand this. It is in the phabricator review. :) >=20 > --HPS >=20 From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 17:36:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79BC4C41; Mon, 1 Dec 2014 17:36:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65F7ED5B; Mon, 1 Dec 2014 17:36:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1HaBbZ057633; Mon, 1 Dec 2014 17:36:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1HaABc057631; Mon, 1 Dec 2014 17:36:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412011736.sB1HaABc057631@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 1 Dec 2014 17:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275372 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 17:36:11 -0000 Author: kib Date: Mon Dec 1 17:36:10 2014 New Revision: 275372 URL: https://svnweb.freebsd.org/changeset/base/275372 Log: Disable recursion for the process spinlock. Tested by: pho Discussed with: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 month Modified: head/sys/kern/kern_mutex.c head/sys/kern/kern_proc.c Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Mon Dec 1 16:10:44 2014 (r275371) +++ head/sys/kern/kern_mutex.c Mon Dec 1 17:36:10 2014 (r275372) @@ -968,7 +968,7 @@ mutex_init(void) mtx_init(&blocked_lock, "blocked lock", NULL, MTX_SPIN); blocked_lock.mtx_lock = 0xdeadc0de; /* Always blocked. */ mtx_init(&proc0.p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK); - mtx_init(&proc0.p_slock, "process slock", NULL, MTX_SPIN | MTX_RECURSE); + mtx_init(&proc0.p_slock, "process slock", NULL, MTX_SPIN); mtx_init(&proc0.p_statmtx, "pstatl", NULL, MTX_SPIN); mtx_init(&proc0.p_itimmtx, "pitiml", NULL, MTX_SPIN); mtx_init(&proc0.p_profmtx, "pprofl", NULL, MTX_SPIN); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Dec 1 16:10:44 2014 (r275371) +++ head/sys/kern/kern_proc.c Mon Dec 1 17:36:10 2014 (r275372) @@ -227,7 +227,7 @@ proc_init(void *mem, int size, int flags p->p_sched = (struct p_sched *)&p[1]; bzero(&p->p_mtx, sizeof(struct mtx)); mtx_init(&p->p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK); - mtx_init(&p->p_slock, "process slock", NULL, MTX_SPIN | MTX_RECURSE); + mtx_init(&p->p_slock, "process slock", NULL, MTX_SPIN); mtx_init(&p->p_statmtx, "pstatl", NULL, MTX_SPIN); mtx_init(&p->p_itimmtx, "pitiml", NULL, MTX_SPIN); mtx_init(&p->p_profmtx, "pprofl", NULL, MTX_SPIN); From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 17:49:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DDA839F; Mon, 1 Dec 2014 17:49:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BD5A0E94; Mon, 1 Dec 2014 17:49:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1Hnk2c062825; Mon, 1 Dec 2014 17:49:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1Hnhs1062805; Mon, 1 Dec 2014 17:49:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412011749.sB1Hnhs1062805@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 1 Dec 2014 17:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275373 - in head: . gnu/usr.bin/binutils lib lib/libelftc share/mk tools/build/options usr.bin usr.bin/addr2line usr.bin/elfcopy usr.bin/nm usr.bin/size usr.bin/strings X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 17:49:47 -0000 Author: emaste Date: Mon Dec 1 17:49:42 2014 New Revision: 275373 URL: https://svnweb.freebsd.org/changeset/base/275373 Log: Build infrastructure for elftoolchain tools Set WITH_ELFTOOLCHAIN_TOOLS in src.conf to use the elftoolchain version of the following tools: * addr2line * elfcopy (strip / mcs) * nm * size * strings Reviewed by: bapt (earlier version) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D1224 Added: head/lib/libelftc/ head/lib/libelftc/Makefile (contents, props changed) head/lib/libelftc/elftc_version.c (contents, props changed) head/tools/build/options/WITH_ELFTOOLCHAIN_TOOLS (contents, props changed) head/usr.bin/addr2line/ head/usr.bin/addr2line/Makefile (contents, props changed) head/usr.bin/elfcopy/ head/usr.bin/elfcopy/Makefile (contents, props changed) head/usr.bin/nm/ head/usr.bin/nm/Makefile (contents, props changed) head/usr.bin/size/ head/usr.bin/size/Makefile (contents, props changed) head/usr.bin/strings/ head/usr.bin/strings/Makefile (contents, props changed) Modified: head/Makefile.inc1 head/gnu/usr.bin/binutils/Makefile head/lib/Makefile head/share/mk/src.libnames.mk head/share/mk/src.opts.mk head/usr.bin/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Dec 1 17:36:10 2014 (r275372) +++ head/Makefile.inc1 Mon Dec 1 17:49:42 2014 (r275373) @@ -1415,6 +1415,14 @@ _kgzip= usr.sbin/kgzip # If we're given an XAS, don't build binutils. .if ${XAS:M/*} == "" && ${MK_BINUTILS_BOOTSTRAP} != "no" _binutils= gnu/usr.bin/binutils +.if ${MK_ELFTOOLCHAIN_TOOLS} != "no" +_elftctools= lib/libelftc \ + usr.bin/addr2line \ + usr.bin/elfcopy \ + usr.bin/nm \ + usr.bin/size \ + usr.bin/strings +.endif .endif # If an full path to an external cross compiler is given, don't build @@ -1434,6 +1442,7 @@ cross-tools: .MAKE ${_clang_libs} \ ${_clang} \ ${_binutils} \ + ${_elftctools} \ ${_cc} \ usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \ ${_btxld} \ @@ -1491,6 +1500,7 @@ native-xtools: .MAKE ${_clang_tblgen} \ usr.bin/ar \ ${_binutils} \ + ${_elftctools} \ ${_cc} \ ${_gcc_tools} \ ${_clang_libs} \ @@ -2045,6 +2055,7 @@ _xb-build-tools: _xb-cross-tools: .for _tool in \ ${_binutils} \ + ${_elftctools} \ usr.bin/ar \ ${_clang_libs} \ ${_clang} \ @@ -2077,6 +2088,7 @@ _xi-cross-tools: @echo "_xi-cross-tools" .for _tool in \ ${_binutils} \ + ${_elftctools} \ usr.bin/ar \ ${_clang_libs} \ ${_clang} \ Modified: head/gnu/usr.bin/binutils/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/Makefile Mon Dec 1 17:36:10 2014 (r275372) +++ head/gnu/usr.bin/binutils/Makefile Mon Dec 1 17:49:42 2014 (r275373) @@ -1,19 +1,29 @@ # $FreeBSD$ +.include + SUBDIR= libiberty \ libbfd \ libopcodes \ libbinutils \ - addr2line \ + ${_addr2line} \ as \ ld \ - nm \ + ${_nm} \ objcopy \ objdump \ readelf \ - size \ - strings \ - strip \ + ${_size} \ + ${_strings} \ + ${_strip} \ doc + +.if ${MK_ELFTOOLCHAIN_TOOLS} == "no" +_addr2line= addr2line +_nm= nm +_size= size +_strings= strings +_strip= strip +.endif .include Modified: head/lib/Makefile ============================================================================== --- head/lib/Makefile Mon Dec 1 17:36:10 2014 (r275372) +++ head/lib/Makefile Mon Dec 1 17:49:42 2014 (r275373) @@ -45,6 +45,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ libdpv \ libdwarf \ libedit \ + ${_libelftc} \ ${_libevent} \ libexecinfo \ libexpat \ @@ -190,6 +191,10 @@ _clang= clang _cuse= libcuse .endif +.if ${MK_ELFTOOLCHAIN_TOOLS} != "no" +_libelftc= libelftc +.endif + .if ${MK_GPIB} != "no" _libgpib= libgpib .endif Added: head/lib/libelftc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libelftc/Makefile Mon Dec 1 17:49:42 2014 (r275373) @@ -0,0 +1,30 @@ +# $FreeBSD$ +.include + +INTERNALLIB= + +ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain + +.PATH: ${ELFTCDIR}/libelftc + +LIB= elftc + +SRCS= elftc_bfdtarget.c \ + elftc_copyfile.c \ + elftc_demangle.c \ + elftc_set_timestamps.c \ + elftc_string_table.c \ + elftc_version.c \ + libelftc_bfdtarget.c \ + libelftc_dem_arm.c \ + libelftc_dem_gnu2.c \ + libelftc_dem_gnu3.c \ + libelftc_hash.c \ + libelftc_vstr.c + +INCS= libelftc.h +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common + +NO_MAN= yes + +.include Added: head/lib/libelftc/elftc_version.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libelftc/elftc_version.c Mon Dec 1 17:49:42 2014 (r275373) @@ -0,0 +1,10 @@ +/* $FreeBSD$ */ + +#include +#include + +const char * +elftc_version(void) +{ + return "libelftc r2974"; +} Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Mon Dec 1 17:36:10 2014 (r275372) +++ head/share/mk/src.libnames.mk Mon Dec 1 17:49:42 2014 (r275373) @@ -27,6 +27,7 @@ _INTERNALIBS= \ amu \ bsnmptools \ cron \ + elftc \ event \ fifolog \ ipf \ @@ -286,6 +287,10 @@ LIBATF_CXX?= ${LIBATF_CXXDIR}/libatf-c++ LIBBSDSTATDIR= ${ROOTOBJDIR}/lib/libbsdstat LIBBSDSTAT?= ${LIBBSDSTATDIR}/libbsdstat.a +LIBELFTCDIR= ${ROOTOBJDIR}/lib/libelftc +LDELFTC?= ${LIBELFTCDIR}/libelftc.a +LIBELFTC?= ${LIBELFTCDIR}/libelftc.a + LIBEVENTDIR= ${ROOTOBJDIR}/lib/libevent LIBEVENT?= ${LIBEVENTDIR}/libevent.a Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Mon Dec 1 17:36:10 2014 (r275372) +++ head/share/mk/src.opts.mk Mon Dec 1 17:49:42 2014 (r275373) @@ -160,6 +160,7 @@ __DEFAULT_NO_OPTIONS = \ BSD_GREP \ CLANG_EXTRAS \ EISA \ + ELFTOOLCHAIN_TOOLS \ FMAKE \ HESIOD \ LLDB \ Added: head/tools/build/options/WITH_ELFTOOLCHAIN_TOOLS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_ELFTOOLCHAIN_TOOLS Mon Dec 1 17:49:42 2014 (r275373) @@ -0,0 +1,9 @@ +.\" $FreeBSD$ +Set to use +.Xr addr2line 1 , +.Xr nm 1 , +.Xr size 1 , +.Xr strings 1 , +and +.Xr strip 1 +from the elftoolchain project instead of GNU binutils. Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Mon Dec 1 17:36:10 2014 (r275372) +++ head/usr.bin/Makefile Mon Dec 1 17:49:42 2014 (r275373) @@ -9,7 +9,8 @@ # Moved to secure: bdes # -SUBDIR= alias \ +SUBDIR= ${_addr2line} \ + alias \ apply \ asa \ awk \ @@ -41,6 +42,7 @@ SUBDIR= alias \ du \ ee \ elf2aout \ + ${_elfcopy} \ elfdump \ enigma \ env \ @@ -119,6 +121,7 @@ SUBDIR= alias \ nfsstat \ nice \ nl \ + ${_nm} \ nohup \ opieinfo \ opiekey \ @@ -150,12 +153,14 @@ SUBDIR= alias \ seq \ shar \ showmount \ + ${_size} \ sockstat \ soeliminate \ sort \ split \ stat \ stdbuf \ + ${_strings} \ su \ systat \ tabs \ @@ -236,6 +241,14 @@ SUBDIR+= calendar _clang= clang .endif +.if ${MK_ELFTOOLCHAIN_TOOLS} != "no" +_addr2line= addr2line +_elfcopy= elfcopy +_nm= nm +_size= size +_strings= strings +.endif + .if ${MK_FMAKE} != "no" SUBDIR+= make .endif Added: head/usr.bin/addr2line/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/addr2line/Makefile Mon Dec 1 17:49:42 2014 (r275373) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.include + +ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +ADDR2LINEDIR= ${ELFTCDIR}/addr2line + +.PATH: ${ADDR2LINEDIR} + +PROG= addr2line + +LIBADD= elftc dwarf elf + +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common + +.include Added: head/usr.bin/elfcopy/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/elfcopy/Makefile Mon Dec 1 17:49:42 2014 (r275373) @@ -0,0 +1,24 @@ +# $FreeBSD$ + +.include + +ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +ELFCOPYDIR= ${ELFTCDIR}/elfcopy + +.PATH: ${ELFCOPYDIR} + +PROG= elfcopy + +SRCS= archive.c ascii.c binary.c main.c sections.c segments.c symbols.c + +WARNS?= 5 + +LIBADD= archive elftc elf + +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common + +MAN= elfcopy.1 strip.1 + +LINKS= ${BINDIR}/elfcopy ${BINDIR}/strip + +.include Added: head/usr.bin/nm/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/nm/Makefile Mon Dec 1 17:49:42 2014 (r275373) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.include + +ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +NMDIR= ${ELFTCDIR}/nm + +.PATH: ${NMDIR} + +PROG= nm + +LIBADD= dwarf elftc elf + +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common + +.include Added: head/usr.bin/size/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/size/Makefile Mon Dec 1 17:49:42 2014 (r275373) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +.include + +ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain +SIZEDIR= ${ELFTCDIR}/size + +.PATH: ${SIZEDIR} + +PROG= size + +LIBADD= elftc elf + +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common + +.include Added: head/usr.bin/strings/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/strings/Makefile Mon Dec 1 17:49:42 2014 (r275373) @@ -0,0 +1,15 @@ +# $FreeBSD$ + +.include + +ELFTCDIR= ${.CURDIR}/../../contrib/elftoolchain + +.PATH: ${ELFTCDIR}/strings + +PROG= strings + +LIBADD= elftc elf + +CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common + +.include From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 17:51:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 436A221D; Mon, 1 Dec 2014 17:51:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 305E2F40; Mon, 1 Dec 2014 17:51:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1HpHmW064642; Mon, 1 Dec 2014 17:51:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1HpHlE064641; Mon, 1 Dec 2014 17:51:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412011751.sB1HpHlE064641@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Mon, 1 Dec 2014 17:51:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275374 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 17:51:17 -0000 Author: mav Date: Mon Dec 1 17:51:16 2014 New Revision: 275374 URL: https://svnweb.freebsd.org/changeset/base/275374 Log: Document ISP 2532 support and hint.isp.0.vports tunable. MFC after: 1 week Modified: head/share/man/man4/isp.4 Modified: head/share/man/man4/isp.4 ============================================================================== --- head/share/man/man4/isp.4 Mon Dec 1 17:49:42 2014 (r275373) +++ head/share/man/man4/isp.4 Mon Dec 1 17:51:16 2014 (r275374) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 28, 2007 +.Dd December 1, 2014 .Dt ISP 4 .Os .Sh NAME @@ -136,6 +136,8 @@ Dell Branded version of the QLogic 2312 Qlogic 2422 Optical Fibre Channel PCI cards (4 Gigabit) .It Qlogic 2432 Qlogic 2432 Optical Fibre Channel PCIe cards (4 Gigabit) +.It Qlogic 2432 +Qlogic 2532 Optical Fibre Channel PCIe cards (8 Gigabit) .El .Sh CONFIGURATION OPTIONS Target mode support may be enabled with the @@ -197,6 +199,8 @@ A hint to define default role for isp in A hint value for a driver debug level (see the file .Pa /usr/src/sys/dev/isp/ispvar.h for the values. +.It Va hint.isp.0.vports +A hint to create specified number of additional virtual ports. .El .Sh SYSCTL OPTIONS .Bl -tag -width indent From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 19:02:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53E87735 for ; Mon, 1 Dec 2014 19:02:48 +0000 (UTC) Received: from mail-wg0-f52.google.com (mail-wg0-f52.google.com [74.125.82.52]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D316E969 for ; Mon, 1 Dec 2014 19:02:47 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id a1so15093839wgh.39 for ; Mon, 01 Dec 2014 11:02:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=LXzlJU6Zl1PZxZdq4K4ozU4ujGcRB+yzbPvPO1i0tnw=; b=LU4u1J+CN5Y0kRBT4gh8Qk7gF4jhT1JVkeKfAcCOPp/5hJW5/iNHM+p3Jr47cFOB2F zb9sD4JtskgvBydGqpzsb8fkkPWBPl6x0z1sGAwdCwgrXgdXT05kQhdZ9h+0MVGmi2eY ggK6k+qALShTF8GiQ9p3//QgbkHsgdIOZLZ89TQSX9W+O4TfzSB0II4M3a4MrE16GF8k FGzSwklwFra+jTwi7YA9ZRQBWxQx6cYTxqbSFYrVJb/qPm7CmMq1QaOhVhtTDuDbHAOj u4IpUx4ApZaINKiFrvezmvzrty3EWL2Zn8nGsnCpAA9m9/8WiABkWnyE2l9TykSKWoQO u06w== X-Gm-Message-State: ALoCoQkiwd/q0BHsMTP4nJZqS/mjNnOQwkWLvxbNVwb+KKgs2j8RmZmC0zM+tYDUaMmdILAR6igD X-Received: by 10.180.211.84 with SMTP id na20mr6659584wic.41.1417460560128; Mon, 01 Dec 2014 11:02:40 -0800 (PST) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id eq4sm10289531wjd.42.2014.12.01.11.02.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Dec 2014 11:02:39 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Message-ID: <547CBBC9.2070408@freebsd.org> Date: Mon, 01 Dec 2014 19:04:41 +0000 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Alfred Perlstein , Hans Petter Selasky Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> <547C8CA2.8040305@selasky.org> <547C8DEF.5020809@selasky.org> <547C974A.9050302@selasky.org> <4CE4C10D-93B0-4E27-878D-34C0A7CF3C94@mu.org> <547C995A.2060005@selasky.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , John Baldwin X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 19:02:48 -0000 On 01/12/2014 16:46, Alfred Perlstein wrote: > >> On Dec 1, 2014, at 8:37 AM, Hans Petter Selasky wrote: >> >> Hi, >> >> I think you maybe missed a point .... >> >>> On 12/01/14 17:31, Alfred Perlstein wrote: >>> >>> Yes that is why it is being done by hand in the probe routine. I think proper thing might be a way to sort out how to get tunables to run at a driver load event? Is that possible? >> All sysctls are tried init when they are created, both so-called "static" and "dynamic" ones. >> >> If the sysctl is created inside the probe routine and has the tunable flag set, it will get init before the creation is complete, if present in the boot environment. >> >> If the sysctl is of a "static" kind, it will be created and initialized when SI_SUB_KMEM is executing! > I totally understand this. It is in the phabricator review. :) > As a more general comment, my personal preference when I ask for review is that at least one of the reviewers accepts the final revision before I commit, but preferably all that have taken part in the discussion. This often takes a bit longer and some times takes a little prodding but should be worth it in the long run. I know I commented on this one but I unfortunately didn't get chance to look after changes where made and hence never accepted the revision. Had I done so I would have caveat-ed it with it being accepted by Jack or other Intel delegate in his absence, so sorry about that Jack. No one should take this personally, as know this is still new to everyone, but it does raise the wider question of who should be counted as a "reviewer" from phabric and do we need some additional guidelines on this, or even better can it be automated? Regards Steve From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 19:17:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A985EC56; Mon, 1 Dec 2014 19:17:14 +0000 (UTC) Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F3B2AAE; Mon, 1 Dec 2014 19:17:14 +0000 (UTC) Received: by mail-wi0-f181.google.com with SMTP id r20so18563374wiv.8 for ; Mon, 01 Dec 2014 11:17:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=z7WajObiCzeBQnLHJeKq8GxacTAdHKfGh5hzHkTE0z0=; b=OL53GfjiBYgTIX8Lld3B6bpurfnj7SK/Xm0iD88CDKExpgMiXXabdQbcc8h3AOMVHE QTZPtvHw9TyvOlWZ2RExHuwYIzg3Qv5aoF7xXcVLUWPeU/gFteFrLLerOW9XUaUB6OEo 5osUJFGE/LGfsKmTW5s3oifcRy9fRPCyL01TzapLAE3ehbvcWSse2XL5AENCgkhfsK1I lcyBQ7AiqhcSpiaLP+fzta0K+91LwRUvQTDsQxQvkd0M1GSnMT49YwQfMVAWw4K2Zjmz FhHROziEDCP7M1x0quUVyQhT3Qp2pHV3CTJnEjCwiCnDh+wA8sqdwvpjoLn/D4NqzXyP n6oQ== MIME-Version: 1.0 X-Received: by 10.180.75.199 with SMTP id e7mr87888911wiw.21.1417461432653; Mon, 01 Dec 2014 11:17:12 -0800 (PST) Received: by 10.194.81.233 with HTTP; Mon, 1 Dec 2014 11:17:12 -0800 (PST) In-Reply-To: <547CBBC9.2070408@freebsd.org> References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> <547C8CA2.8040305@selasky.org> <547C8DEF.5020809@selasky.org> <547C974A.9050302@selasky.org> <4CE4C10D-93B0-4E27-878D-34C0A7CF3C94@mu.org> <547C995A.2060005@selasky.org> <547CBBC9.2070408@freebsd.org> Date: Mon, 1 Dec 2014 11:17:12 -0800 Message-ID: Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys From: Jack Vogel To: Steven Hartland Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: Hans Petter Selasky , Alfred Perlstein , John Baldwin , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 19:17:14 -0000 Not taking it personally, in this case I see some style things I don't like, and I'm not at all clear why this is even necessary, what the old way of doing queue config was missing for instance? Thanks Steve, Jack On Mon, Dec 1, 2014 at 11:04 AM, Steven Hartland wrote: > > On 01/12/2014 16:46, Alfred Perlstein wrote: > >> >> On Dec 1, 2014, at 8:37 AM, Hans Petter Selasky wrote: >>> >>> Hi, >>> >>> I think you maybe missed a point .... >>> >>> On 12/01/14 17:31, Alfred Perlstein wrote: >>>> >>>> Yes that is why it is being done by hand in the probe routine. I think >>>> proper thing might be a way to sort out how to get tunables to run at a >>>> driver load event? Is that possible? >>>> >>> All sysctls are tried init when they are created, both so-called >>> "static" and "dynamic" ones. >>> >>> If the sysctl is created inside the probe routine and has the tunable >>> flag set, it will get init before the creation is complete, if present in >>> the boot environment. >>> >>> If the sysctl is of a "static" kind, it will be created and initialized >>> when SI_SUB_KMEM is executing! >>> >> I totally understand this. It is in the phabricator review. :) >> >> As a more general comment, my personal preference when I ask for review > is that at least one of the reviewers accepts the final revision before I > commit, but preferably all that have taken part in the discussion. This > often takes a bit longer and some times takes a little prodding but should > be worth it in the long run. > > I know I commented on this one but I unfortunately didn't get chance to > look after changes where made and hence never accepted the revision. Had I > done so I would have caveat-ed it with it being accepted by Jack or other > Intel delegate in his absence, so sorry about that Jack. > > No one should take this personally, as know this is still new to everyone, > but it does raise the wider question of who should be counted as a > "reviewer" from phabric and do we need some additional guidelines on this, > or even better can it be automated? > > Regards > Steve > > From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 19:27:55 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6DCE0F7B for ; Mon, 1 Dec 2014 19:27:55 +0000 (UTC) Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC312BC2 for ; Mon, 1 Dec 2014 19:27:54 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id b13so15256305wgh.31 for ; Mon, 01 Dec 2014 11:27:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=Bg1zyZzWrDc0YkyHQDF/Eyi0ca/gtUAG+3Uz0ND19VE=; b=ZtSK6Q/CLsxUJsOuKAUF9Xa8jCZexpnlqfLtKtp+RIcJhUhThxbzjLFbB8AgkEAoPm 3Ubr10jYL3blpY7GQM6Kr7/lv2jY+L92ks5qtBKbzyfASV2y6I91hzNLzZJLEsEUB+b+ SD2r/6oVdZkKkCXBHsoDrsbggiqUGtGZ/ePNItrb6uF4BUu/rY8nwpyi0Q8SLpaP44Zc +ZU9cNzoNCUvPi1KmxSx87YLsMZPbxdqCbFZo+P2JUrTuN/3K/DRwyecDr8/srcjZvWD 2TacG5XYZyhf3HpDRURqjmfs5eGOIhURLfBO9oG0lx27O5YKjfsIfuD7L9Yh63mmuk8r /gRQ== X-Gm-Message-State: ALoCoQkw8XBtKDPlZ9jXvuszNv2eQCYiO2ixJNG29eNbzk2ONapEvmCGzeLGNkwQoIL3bPLte0Jw X-Received: by 10.180.73.143 with SMTP id l15mr85824634wiv.24.1417462073016; Mon, 01 Dec 2014 11:27:53 -0800 (PST) Received: from [10.10.1.68] (82-69-141-170.dsl.in-addr.zen.co.uk. [82.69.141.170]) by mx.google.com with ESMTPSA id qg11sm22841639wic.17.2014.12.01.11.27.51 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Dec 2014 11:27:52 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Message-ID: <547CC1B5.3070801@freebsd.org> Date: Mon, 01 Dec 2014 19:29:57 +0000 User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Jack Vogel Subject: Re: svn commit: r275136 - in head/sys: dev/e1000 dev/ixgbe kern sys References: <201411262019.sAQKJaw4043557@svn.freebsd.org> <39377603.10OyiSzjWY@ralph.baldwin.cx> <872C180A-6ADD-469F-A801-3728DF134EEC@mu.org> <547C88A9.1070007@selasky.org> <5E1B6CD4-BBA7-4AD0-9982-E981015AF138@mu.org> <547C8A9C.4080603@selasky.org> <547C8CA2.8040305@selasky.org> <547C8DEF.5020809@selasky.org> <547C974A.9050302@selasky.org> <4CE4C10D-93B0-4E27-878D-34C0A7CF3C94@mu.org> <547C995A.2060005@selasky.org> <547CBBC9.2070408@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: Hans Petter Selasky , Alfred Perlstein , John Baldwin , "svn-src-all@freebsd.org" , Alfred Perlstein , "src-committers@freebsd.org" , "svn-src-head@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 19:27:55 -0000 On 01/12/2014 19:17, Jack Vogel wrote: > Not taking it personally, in this case I see some style things I don't > like, and I'm not at all clear > why this is even necessary, what the old way of doing queue config was > missing for instance? Having asked the same question on the review I think I can take a stab at answering that question; they are looking to tune the number of queues on a NIC by NIC basis based on the available CPU cores via an external module. For reference the original review can be found here: https://reviews.freebsd.org/D1149 Regards Steve From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 19:48:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8541943; Mon, 1 Dec 2014 19:48:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BAE14DC5; Mon, 1 Dec 2014 19:48:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1JmNrm019952; Mon, 1 Dec 2014 19:48:23 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1JmNN2019951; Mon, 1 Dec 2014 19:48:23 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201412011948.sB1JmNN2019951@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Mon, 1 Dec 2014 19:48:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275376 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 19:48:24 -0000 Author: rpaulo Date: Mon Dec 1 19:48:23 2014 New Revision: 275376 URL: https://svnweb.freebsd.org/changeset/base/275376 Log: Allow multiple devices to mmap. It's impossible to prevent this with checks on the open/close functions. MFC after: 1 week Modified: head/sys/arm/ti/ti_pruss.c Modified: head/sys/arm/ti/ti_pruss.c ============================================================================== --- head/sys/arm/ti/ti_pruss.c Mon Dec 1 19:39:38 2014 (r275375) +++ head/sys/arm/ti/ti_pruss.c Mon Dec 1 19:48:23 2014 (r275376) @@ -67,7 +67,6 @@ static device_attach_t ti_pruss_attach; static device_detach_t ti_pruss_detach; static void ti_pruss_intr(void *); static d_open_t ti_pruss_open; -static d_close_t ti_pruss_close; static d_mmap_t ti_pruss_mmap; static void ti_pruss_kq_read_detach(struct knote *); static int ti_pruss_kq_read_event(struct knote *, long); @@ -83,14 +82,12 @@ struct ti_pruss_softc { bus_space_handle_t sc_bh; struct cdev *sc_pdev; struct selinfo sc_selinfo; - uint32_t sc_inuse; }; static struct cdevsw ti_pruss_cdevsw = { .d_version = D_VERSION, .d_name = "ti_pruss", .d_open = ti_pruss_open, - .d_close = ti_pruss_close, .d_mmap = ti_pruss_mmap, .d_kqfilter = ti_pruss_kqfilter, }; @@ -187,11 +184,11 @@ ti_pruss_attach(device_t dev) for (i = 0; i < TI_PRUSS_IRQS; i++) { ti_pruss_irq_args[i].irq = i; ti_pruss_irq_args[i].sc = sc; - if (bus_setup_intr(dev, sc->sc_irq_res[i], + if (bus_setup_intr(dev, sc->sc_irq_res[i], INTR_MPSAFE | INTR_TYPE_MISC, - NULL, ti_pruss_intr, &ti_pruss_irq_args[i], + NULL, ti_pruss_intr, &ti_pruss_irq_args[i], &sc->sc_intr[i]) != 0) { - device_printf(dev, + device_printf(dev, "unable to setup the interrupt handler\n"); ti_pruss_detach(dev); return (ENXIO); @@ -220,7 +217,7 @@ ti_pruss_detach(device_t dev) if (sc->sc_intr[i]) bus_teardown_intr(dev, sc->sc_irq_res[i], sc->sc_intr[i]); if (sc->sc_irq_res[i]) - bus_release_resource(dev, SYS_RES_IRQ, + bus_release_resource(dev, SYS_RES_IRQ, rman_get_rid(sc->sc_irq_res[i]), sc->sc_irq_res[i]); } @@ -246,25 +243,9 @@ ti_pruss_intr(void *arg) } static int -ti_pruss_open(struct cdev *cdev, int oflags, int devtype, struct thread *td) +ti_pruss_open(struct cdev *cdev __unused, int oflags __unused, + int devtype __unused, struct thread *td __unused) { - device_t dev = cdev->si_drv1; - struct ti_pruss_softc *sc = device_get_softc(dev); - - if (atomic_cmpset_32(&sc->sc_inuse, 0, 1) == 0) - return (EBUSY); - else - return (0); -} - -static int -ti_pruss_close(struct cdev *cdev, int fflag, int devtype, struct thread *td) -{ - device_t dev = cdev->si_drv1; - struct ti_pruss_softc *sc = device_get_softc(dev); - - sc->sc_inuse = 0; - return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 20:51:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A966B5F8; Mon, 1 Dec 2014 20:51:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 960BB67C; Mon, 1 Dec 2014 20:51:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1Kp2pl050163; Mon, 1 Dec 2014 20:51:02 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1Kp20Z050162; Mon, 1 Dec 2014 20:51:02 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412012051.sB1Kp20Z050162@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 1 Dec 2014 20:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275377 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 20:51:02 -0000 Author: delphij Date: Mon Dec 1 20:51:01 2014 New Revision: 275377 URL: https://svnweb.freebsd.org/changeset/base/275377 Log: Fix inverted logic introduced in r272154. Noticed by: trasz MFC after: 2 weeks Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Mon Dec 1 19:48:23 2014 (r275376) +++ head/sbin/sysctl/sysctl.c Mon Dec 1 20:51:01 2014 (r275377) @@ -679,15 +679,18 @@ strIKtoi(const char *str, char **endptrp p = &str[len - 1]; if (*p == 'C' || *p == 'F') { temp = strtof(str, endptrp); - if (*endptrp != str && *endptrp == p && errno != 0) { + if (*endptrp != str && *endptrp == p && errno == 0) { if (*p == 'F') temp = (temp - 32) * 5 / 9; + *endptrp = NULL; return (temp * 10 + 2732); } } else { kelv = (int)strtol(str, endptrp, 10); - if (*endptrp != str && *endptrp == p && errno != 0) + if (*endptrp != str && *endptrp == p && errno == 0) { + *endptrp = NULL; return (kelv); + } } errno = ERANGE; From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 21:04:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0ADC3BBD; Mon, 1 Dec 2014 21:04:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB4418A6; Mon, 1 Dec 2014 21:04:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1L4QD6057473; Mon, 1 Dec 2014 21:04:26 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1L4QYF057472; Mon, 1 Dec 2014 21:04:26 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412012104.sB1L4QYF057472@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 1 Dec 2014 21:04:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275378 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 21:04:27 -0000 Author: andrew Date: Mon Dec 1 21:04:26 2014 New Revision: 275378 URL: https://svnweb.freebsd.org/changeset/base/275378 Log: Pull in the NetBSD global offset table handling code. Clang 3.5 creates relocations the linker complains about. Obtained from: NetBSD MFC after: 1 Week Modified: head/sys/arm/include/asm.h Modified: head/sys/arm/include/asm.h ============================================================================== --- head/sys/arm/include/asm.h Mon Dec 1 20:51:01 2014 (r275377) +++ head/sys/arm/include/asm.h Mon Dec 1 21:04:26 2014 (r275378) @@ -112,10 +112,16 @@ ldr x, [x, got] #define GOT_INIT(got,gotsym,pclabel) \ ldr got, gotsym; \ - add got, got, pc; \ - pclabel: + pclabel: add got, got, pc +#ifdef __thumb__ #define GOT_INITSYM(gotsym,pclabel) \ - gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) + (. - (pclabel+4)) + .align 0; \ + gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - (pclabel+4) +#else +#define GOT_INITSYM(gotsym,pclabel) \ + .align 0; \ + gotsym: .word _C_LABEL(_GLOBAL_OFFSET_TABLE_) - (pclabel+8) +#endif #ifdef __STDC__ #define PIC_SYM(x,y) x ## ( ## y ## ) From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 21:07:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6AFADFE; Mon, 1 Dec 2014 21:07:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C30E78E4; Mon, 1 Dec 2014 21:07:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1L7a2I057923; Mon, 1 Dec 2014 21:07:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1L7a8j057922; Mon, 1 Dec 2014 21:07:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412012107.sB1L7a8j057922@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 1 Dec 2014 21:07:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275379 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 21:07:36 -0000 Author: andrew Date: Mon Dec 1 21:07:36 2014 New Revision: 275379 URL: https://svnweb.freebsd.org/changeset/base/275379 Log: Set the correct architecture when targeting ARMv7 MFC after: 1 Week Sponsored by: ABT Systems Ltd Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Mon Dec 1 21:04:26 2014 (r275378) +++ head/share/mk/bsd.cpu.mk Mon Dec 1 21:07:36 2014 (r275379) @@ -99,7 +99,7 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__ . elif ${CPUTYPE} == "armv6" _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1 . elif ${CPUTYPE} == "cortexa" -_CPUCFLAGS = -DARM_ARCH_6=1 -mfpu=vfp +_CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp . else _CPUCFLAGS = -mcpu=${CPUTYPE} . endif From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 21:13:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77BDAED; Mon, 1 Dec 2014 21:13:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63F1B9C1; Mon, 1 Dec 2014 21:13:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1LDmgW062206; Mon, 1 Dec 2014 21:13:48 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1LDmYY062205; Mon, 1 Dec 2014 21:13:48 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412012113.sB1LDmYY062205@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Mon, 1 Dec 2014 21:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275380 - head/contrib/gcc/config/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 21:13:48 -0000 Author: andrew Date: Mon Dec 1 21:13:47 2014 New Revision: 275380 URL: https://svnweb.freebsd.org/changeset/base/275380 Log: Use the floating-point instruction on ARMv7 as the clang 3.5 integrated assembler doesn't allow these two instructions to use co-processor 11. MFC after: 1 Week Sponsored by: ABT Systems Ltd Modified: head/contrib/gcc/config/arm/libunwind.S Modified: head/contrib/gcc/config/arm/libunwind.S ============================================================================== --- head/contrib/gcc/config/arm/libunwind.S Mon Dec 1 21:07:36 2014 (r275379) +++ head/contrib/gcc/config/arm/libunwind.S Mon Dec 1 21:13:47 2014 (r275380) @@ -26,6 +26,13 @@ the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include + +/* Allow the use of VFP instructions */ +#if __ARM_ARCH >= 7 +.fpu vfp +#endif + #ifndef __symbian__ #include "lib1funcs.asm" @@ -66,14 +73,22 @@ ARM_FUNC_START restore_core_regs ARM_FUNC_START gnu_Unwind_Restore_VFP /* Use the generic coprocessor form so that gas doesn't complain on soft-float targets. */ +#if __ARM_ARCH >= 7 + fldmiax r0, {d0-d15} +#else ldc p11,cr0,[r0],{0x21} /* fldmiax r0, {d0-d15} */ +#endif RET /* Store VFR regsters d0-d15 to the address in r0. */ ARM_FUNC_START gnu_Unwind_Save_VFP /* Use the generic coprocessor form so that gas doesn't complain on soft-float targets. */ +#if __ARM_ARCH >= 7 + fstmiax r0, {d0-d15} +#else stc p11,cr0,[r0],{0x21} /* fstmiax r0, {d0-d15} */ +#endif RET /* Wrappers to save core registers, then call the real routine. */ From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 21:36:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C7DC796; Mon, 1 Dec 2014 21:36:26 +0000 (UTC) Received: from mho-01-ewr.mailhop.org (mho-03-ewr.mailhop.org [204.13.248.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3EA0BEE; Mon, 1 Dec 2014 21:36:25 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-01-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XvYds-0004He-20; Mon, 01 Dec 2014 21:36:24 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id sB1LaNFN005751; Mon, 1 Dec 2014 14:36:23 -0700 (MST) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX18EKNs5mj0QQtbbuodll7H6 X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: svn commit: r275379 - head/share/mk From: Ian Lepore To: Andrew Turner In-Reply-To: <201412012107.sB1L7a8j057922@svn.freebsd.org> References: <201412012107.sB1L7a8j057922@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Mon, 01 Dec 2014 14:36:22 -0700 Message-ID: <1417469782.1064.38.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 21:36:26 -0000 On Mon, 2014-12-01 at 21:07 +0000, Andrew Turner wrote: > Author: andrew > Date: Mon Dec 1 21:07:36 2014 > New Revision: 275379 > URL: https://svnweb.freebsd.org/changeset/base/275379 > > Log: > Set the correct architecture when targeting ARMv7 > > MFC after: 1 Week > Sponsored by: ABT Systems Ltd > > Modified: > head/share/mk/bsd.cpu.mk > > Modified: head/share/mk/bsd.cpu.mk > ============================================================================== > --- head/share/mk/bsd.cpu.mk Mon Dec 1 21:04:26 2014 (r275378) > +++ head/share/mk/bsd.cpu.mk Mon Dec 1 21:07:36 2014 (r275379) > @@ -99,7 +99,7 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__ > . elif ${CPUTYPE} == "armv6" > _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1 > . elif ${CPUTYPE} == "cortexa" > -_CPUCFLAGS = -DARM_ARCH_6=1 -mfpu=vfp > +_CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp > . else > _CPUCFLAGS = -mcpu=${CPUTYPE} > . endif > Doesn't cortex-a also imply vfp3? -- Ian From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 22:09:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 660F21C1; Mon, 1 Dec 2014 22:09:33 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 47DF6EF3; Mon, 1 Dec 2014 22:09:32 +0000 (UTC) Received: from bender.lan (97e078e7.skybroadband.com [151.224.120.231]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id B99167328F; Mon, 1 Dec 2014 22:09:30 +0000 (UTC) Date: Mon, 1 Dec 2014 22:09:14 +0000 From: Andrew Turner To: Ian Lepore Subject: Re: svn commit: r275379 - head/share/mk Message-ID: <20141201220914.14b1bf6f@bender.lan> In-Reply-To: <1417469782.1064.38.camel@revolution.hippie.lan> References: <201412012107.sB1L7a8j057922@svn.freebsd.org> <1417469782.1064.38.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: Andrew Turner , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 22:09:33 -0000 On Mon, 01 Dec 2014 14:36:22 -0700 Ian Lepore wrote: > On Mon, 2014-12-01 at 21:07 +0000, Andrew Turner wrote: > > Author: andrew > > Date: Mon Dec 1 21:07:36 2014 > > New Revision: 275379 > > URL: https://svnweb.freebsd.org/changeset/base/275379 > > > > Log: > > Set the correct architecture when targeting ARMv7 > > > > MFC after: 1 Week > > Sponsored by: ABT Systems Ltd > > > > Modified: > > head/share/mk/bsd.cpu.mk > > > > Modified: head/share/mk/bsd.cpu.mk > > ============================================================================== > > --- head/share/mk/bsd.cpu.mk Mon Dec 1 21:04:26 2014 > > (r275378) +++ head/share/mk/bsd.cpu.mk Mon Dec 1 21:07:36 > > 2014 (r275379) @@ -99,7 +99,7 @@ _CPUCFLAGS = -march=armv5te > > -D__XSCALE__ . elif ${CPUTYPE} == "armv6" > > _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1 > > . elif ${CPUTYPE} == "cortexa" > > -_CPUCFLAGS = -DARM_ARCH_6=1 -mfpu=vfp > > +_CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp > > . else > > _CPUCFLAGS = -mcpu=${CPUTYPE} > > . endif > > > > Doesn't cortex-a also imply vfp3? The vfp looks to be incorrect as it's optional on ARMv7. If present I think it will be either a VFPv3 or v4 depending on the core. I also think we could remove the "-DARM_ARCH_6=1" as, if it's used at all, it can be replaced with a combination of and __ARM_ARCH >= 6. Andrew From owner-svn-src-head@FreeBSD.ORG Mon Dec 1 22:39:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 460CB985; Mon, 1 Dec 2014 22:39:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3226C230; Mon, 1 Dec 2014 22:39:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB1Mdak6001089; Mon, 1 Dec 2014 22:39:36 GMT (envelope-from phk@FreeBSD.org) Received: (from phk@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1MdaOS001088; Mon, 1 Dec 2014 22:39:36 GMT (envelope-from phk@FreeBSD.org) Message-Id: <201412012239.sB1MdaOS001088@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: phk set sender to phk@FreeBSD.org using -f From: Poul-Henning Kamp Date: Mon, 1 Dec 2014 22:39:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275384 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 22:39:36 -0000 Author: phk Date: Mon Dec 1 22:39:35 2014 New Revision: 275384 URL: https://svnweb.freebsd.org/changeset/base/275384 Log: Make this work with pkgng, and allow PORTS_OPTS to be passed in Modified: head/tools/tools/nanobsd/fill_pkg.sh Modified: head/tools/tools/nanobsd/fill_pkg.sh ============================================================================== --- head/tools/tools/nanobsd/fill_pkg.sh Mon Dec 1 22:37:36 2014 (r275383) +++ head/tools/tools/nanobsd/fill_pkg.sh Mon Dec 1 22:39:35 2014 (r275384) @@ -57,8 +57,8 @@ ports_recurse() ( else ( cd $d - rd=`make -V RUN_DEPENDS` - ld=`make -V LIB_DEPENDS` + rd=`make -V RUN_DEPENDS ${PORTS_OPTS}` + ld=`make -V LIB_DEPENDS ${PORTS_OPTS}` for x in $rd $ld do @@ -84,8 +84,8 @@ done for i in `cat $PL` do p=`(cd $i && make -V PKGNAME)` - if [ -f $NANO_PKG_DUMP/$p.tbz ] ; then - ln -s $NANO_PKG_DUMP/$p.tbz $NANO_PACKAGE_DIR + if [ -f $NANO_PKG_DUMP/$p.t[bx]z ] ; then + ln -s $NANO_PKG_DUMP/$p.t[bx]z $NANO_PACKAGE_DIR else echo "Package $p misssing in $NANO_PKG_DUMP" 1>&2 exit 1 From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 00:23:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E1B910C; Tue, 2 Dec 2014 00:23:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0E7C1F68; Tue, 2 Dec 2014 00:23:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB20NQEX053334; Tue, 2 Dec 2014 00:23:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB20NQqJ053333; Tue, 2 Dec 2014 00:23:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201412020023.sB20NQqJ053333@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 2 Dec 2014 00:23:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275385 - head/contrib/subversion/subversion/svn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 00:23:27 -0000 Author: bapt Date: Tue Dec 2 00:23:26 2014 New Revision: 275385 URL: https://svnweb.freebsd.org/changeset/base/275385 Log: Sync the svn template with the one from ports Modified: head/contrib/subversion/subversion/svn/util.c Modified: head/contrib/subversion/subversion/svn/util.c ============================================================================== --- head/contrib/subversion/subversion/svn/util.c Mon Dec 1 22:39:35 2014 (r275384) +++ head/contrib/subversion/subversion/svn/util.c Tue Dec 2 00:23:26 2014 (r275385) @@ -333,11 +333,13 @@ truncate_buffer_at_prefix(apr_size_t *ne static const char *prefixes[] = { "PR:", + "Differential Revision:", "Submitted by:", "Reviewed by:", "Approved by:", "Obtained from:", "MFC after:", + "MFH:", "Relnotes:", "Security:", "Sponsored by:" @@ -404,11 +406,13 @@ svn_cl__get_log_message(const char **log default_msg = svn_stringbuf_create(APR_EOL_STR, pool); svn_stringbuf_appendcstr(default_msg, APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "PR:\t\t" APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "Differential Revision:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Submitted by:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Reviewed by:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Approved by:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Obtained from:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "MFC after:\t" APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "MFH:\t\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Relnotes:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Security:\t" APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "Sponsored by:\t" @@ -419,15 +423,17 @@ svn_cl__get_log_message(const char **log svn_stringbuf_appendcstr(default_msg, EDITOR_EOF_PREFIX); svn_stringbuf_appendcstr(default_msg, APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Description of fields to fill in above: 76 columns --|" APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "> PR: If a Bugzilla PR is affected by the change." APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "> Submitted by: If someone else sent in the change." APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "> Reviewed by: If someone else reviewed your modification." APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "> Approved by: If you needed approval for this commit." APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "> Obtained from: If the change is from a third party." APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "> MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email." APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "> Relnotes: Set to 'yes' for mention in release notes." APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "> Security: Vulnerability reference (one per line) or description." APR_EOL_STR); - svn_stringbuf_appendcstr(default_msg, "> Sponsored by: If the change was sponsored by an organization." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> PR: If a Bugzilla PR is affected by the change." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed)." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> Submitted by: If someone else sent in the change." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> Reviewed by: If someone else reviewed your modification." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> Approved by: If you needed approval for this commit." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> Obtained from: If the change is from a third party." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> MFH: Ports tree branch name. Request approval for merge." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> Relnotes: Set to 'yes' for mention in release notes." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> Security: Vulnerability reference (one per line) or description." APR_EOL_STR); + svn_stringbuf_appendcstr(default_msg, "> Sponsored by: If the change was sponsored by an organization." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, "> Empty fields above will be automatically removed." APR_EOL_STR); svn_stringbuf_appendcstr(default_msg, APR_EOL_STR); From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 01:30:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57215C40; Tue, 2 Dec 2014 01:30:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29ACE8ED; Tue, 2 Dec 2014 01:30:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB21Uslv085264; Tue, 2 Dec 2014 01:30:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB21UrTD085262; Tue, 2 Dec 2014 01:30:53 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412020130.sB21UrTD085262@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Tue, 2 Dec 2014 01:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275386 - in head/contrib/binutils/bfd: . po X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 01:30:54 -0000 Author: dim Date: Tue Dec 2 01:30:53 2014 New Revision: 275386 URL: https://svnweb.freebsd.org/changeset/base/275386 Log: Let GNU ld be less obscure about missing symbols and DSOs. If the BFD object looks like a typical shared library, suggest adding '-l', where has the 'lib' prefix and '.so' or '.a' suffix removed. Otherwise, suggest adding '-l:', where is the full DT_SONAME. Submitted by: Conrad Meyer Sponsored by: EMC / Isilon storage division Reviewed by: emaste PR: 194296 MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D1152 Modified: head/contrib/binutils/bfd/elflink.c head/contrib/binutils/bfd/po/bfd.pot Modified: head/contrib/binutils/bfd/elflink.c ============================================================================== --- head/contrib/binutils/bfd/elflink.c Tue Dec 2 00:23:26 2014 (r275385) +++ head/contrib/binutils/bfd/elflink.c Tue Dec 2 01:30:53 2014 (r275386) @@ -4356,9 +4356,38 @@ elf_link_add_object_symbols (bfd *abfd, --no-add-needed is used. */ if ((elf_dyn_lib_class (abfd) & DYN_NO_NEEDED) != 0) { + bfd_boolean looks_soish; + const char *print_name; + int print_len; + size_t len, lend = 0; + + looks_soish = FALSE; + print_name = soname; + print_len = strlen(soname); + if (strncmp(soname, "lib", 3) == 0) + { + len = print_len; + if (len > 5 && strcmp(soname + len - 2, ".a") == 0) + lend = len - 5; + else + { + while (len > 6 && (ISDIGIT(soname[len - 1]) || + soname[len - 1] == '.')) + len--; + if (strncmp(soname + len - 3, ".so", 3) == 0) + lend = len - 6; + } + if (lend != 0) + { + print_name = soname + 3; + print_len = lend; + looks_soish = TRUE; + } + } + (*_bfd_error_handler) - (_("%B: invalid DSO for symbol `%s' definition"), - abfd, name); + (_("undefined reference to symbol `%s' (try adding -l%s%.*s)"), + name, looks_soish? "" : ":", print_len, print_name); bfd_set_error (bfd_error_bad_value); goto error_free_vers; } Modified: head/contrib/binutils/bfd/po/bfd.pot ============================================================================== --- head/contrib/binutils/bfd/po/bfd.pot Tue Dec 2 00:23:26 2014 (r275385) +++ head/contrib/binutils/bfd/po/bfd.pot Tue Dec 2 01:30:53 2014 (r275386) @@ -2438,9 +2438,9 @@ msgstr "" msgid "Warning: size of symbol `%s' changed from %lu in %B to %lu in %B" msgstr "" -#: elflink.c:4309 +#: elflink.c:4389 #, c-format -msgid "%B: invalid DSO for symbol `%s' definition" +msgid "undefined reference to symbol `%s' (try adding -l%s%.*s)" msgstr "" #: elflink.c:5535 From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 02:11:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 57FEC4AF; Tue, 2 Dec 2014 02:11:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 44B5DC91; Tue, 2 Dec 2014 02:11:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB22BA4f003783; Tue, 2 Dec 2014 02:11:10 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB22BAY6003782; Tue, 2 Dec 2014 02:11:10 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412020211.sB22BAY6003782@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 2 Dec 2014 02:11:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275388 - head/tools/build/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 02:11:10 -0000 Author: emaste Date: Tue Dec 2 02:11:09 2014 New Revision: 275388 URL: https://svnweb.freebsd.org/changeset/base/275388 Log: Add elfcopy and man page to OptionalObsoleteFiles Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Dec 2 01:45:04 2014 (r275387) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Dec 2 02:11:09 2014 (r275388) @@ -1198,6 +1198,11 @@ OLD_FILES+=usr/share/dict/words OLD_DIRS+=usr/share/dict .endif +.if ${MK_ELFTOOLCHAIN_TOOLS} == no +OLD_FILES+=usr/bin/elfcopy +OLD_FILES+=usr/share/man/man1/elfcopy.1.gz +.endif + #.if ${MK_EXAMPLES} == no # to be filled in #.endif From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 02:16:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 22DF463F; Tue, 2 Dec 2014 02:16:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F9FCCC3; Tue, 2 Dec 2014 02:16:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB22GUrH005568; Tue, 2 Dec 2014 02:16:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB22GUSF005567; Tue, 2 Dec 2014 02:16:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412020216.sB22GUSF005567@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 2 Dec 2014 02:16:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275389 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 02:16:31 -0000 Author: emaste Date: Tue Dec 2 02:16:30 2014 New Revision: 275389 URL: https://svnweb.freebsd.org/changeset/base/275389 Log: Regenerate src.conf(5) after r275373 Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Dec 2 02:11:09 2014 (r275388) +++ head/share/man/man5/src.conf.5 Tue Dec 2 02:16:30 2014 (r275389) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd November 26, 2014 +.Dd December 1, 2014 .Dt SRC.CONF 5 .Os .Sh NAME @@ -383,6 +383,16 @@ without support for encryption/decryptio .It Va WITH_EISA .\" from FreeBSD: head/tools/build/options/WITH_EISA 264654 2014-04-18 16:53:06Z imp Set to build EISA kernel modules. +.It Va WITH_ELFTOOLCHAIN_TOOLS +.\" from FreeBSD: head/tools/build/options/WITH_ELFTOOLCHAIN_TOOLS 275373 2014-12-01 17:49:42Z emaste +Set to use +.Xr addr2line 1 , +.Xr nm 1 , +.Xr size 1 , +.Xr strings 1 , +and +.Xr strip 1 +from the elftoolchain project instead of GNU binutils. .It Va WITHOUT_EXAMPLES .\" from FreeBSD: head/tools/build/options/WITHOUT_EXAMPLES 156938 2006-03-21 09:06:24Z ru Set to avoid installing examples to From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 02:32:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82A599DB; Tue, 2 Dec 2014 02:32:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FBEAE38; Tue, 2 Dec 2014 02:32:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB22WTQP014680; Tue, 2 Dec 2014 02:32:29 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB22WTjB014679; Tue, 2 Dec 2014 02:32:29 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412020232.sB22WTjB014679@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 2 Dec 2014 02:32:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275390 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 02:32:29 -0000 Author: ae Date: Tue Dec 2 02:32:28 2014 New Revision: 275390 URL: https://svnweb.freebsd.org/changeset/base/275390 Log: Remove unused declartations. Sponsored by: Yandex LLC Modified: head/sys/netipsec/ipsec6.h Modified: head/sys/netipsec/ipsec6.h ============================================================================== --- head/sys/netipsec/ipsec6.h Tue Dec 2 02:16:30 2014 (r275389) +++ head/sys/netipsec/ipsec6.h Tue Dec 2 02:32:28 2014 (r275390) @@ -59,23 +59,13 @@ VNET_DECLARE(int, ip6_ipsec_ecn); #define V_ip6_ipsec_ecn VNET(ip6_ipsec_ecn) struct inpcb; - extern int ipsec6_in_reject __P((struct mbuf *, struct inpcb *)); -struct ip6_hdr; -extern const char *ipsec6_logpacketstr __P((struct ip6_hdr *, u_int32_t)); - struct m_tag; extern int ipsec6_common_input(struct mbuf **mp, int *offp, int proto); extern int ipsec6_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip, int protoff, struct m_tag *mt); extern void esp6_ctlinput(int, struct sockaddr *, void *); - -struct ipsec_output_state; -extern int ipsec6_output_trans __P((struct ipsec_output_state *, u_char *, - struct mbuf *, struct secpolicy *, int, int *)); -extern int ipsec6_output_tunnel __P((struct ipsec_output_state *, - struct secpolicy *, int)); extern int ipsec6_process_packet(struct mbuf *, struct ipsecrequest *); #endif /*_KERNEL*/ From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 02:41:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EAA06BFA; Tue, 2 Dec 2014 02:41:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7F6AE75; Tue, 2 Dec 2014 02:41:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB22fieP019040; Tue, 2 Dec 2014 02:41:44 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB22fiej019039; Tue, 2 Dec 2014 02:41:44 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412020241.sB22fiej019039@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 2 Dec 2014 02:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275391 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 02:41:45 -0000 Author: ae Date: Tue Dec 2 02:41:44 2014 New Revision: 275391 URL: https://svnweb.freebsd.org/changeset/base/275391 Log: Remove unused structure declarations. Sponsored by: Yandex LLC Modified: head/sys/netipsec/ipsec.h Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Tue Dec 2 02:32:28 2014 (r275390) +++ head/sys/netipsec/ipsec.h Tue Dec 2 02:41:44 2014 (r275391) @@ -263,17 +263,6 @@ struct ipsecstat { #ifdef _KERNEL #include -struct ipsec_output_state { - struct mbuf *m; - struct route *ro; - struct sockaddr *dst; -}; - -struct ipsec_history { - int ih_proto; - u_int32_t ih_spi; -}; - VNET_DECLARE(int, ipsec_debug); #define V_ipsec_debug VNET(ipsec_debug) From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 04:20:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1B1E423; Tue, 2 Dec 2014 04:20:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9D022AB1; Tue, 2 Dec 2014 04:20:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB24KuQL066340; Tue, 2 Dec 2014 04:20:56 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB24Kpa9064736; Tue, 2 Dec 2014 04:20:51 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412020420.sB24Kpa9064736@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 2 Dec 2014 04:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275392 - in head/sys: netinet netinet6 netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 04:20:56 -0000 Author: ae Date: Tue Dec 2 04:20:50 2014 New Revision: 275392 URL: https://svnweb.freebsd.org/changeset/base/275392 Log: Remove route chaching support from ipsec code. It isn't used for some time. * remove sa_route_union declaration and route_cache member from struct secashead; * remove key_sa_routechange() call from ICMP and ICMPv6 code; * simplify ip_ipsec_mtu(); * remove #include ; Sponsored by: Yandex LLC Modified: head/sys/netinet/ip_icmp.c head/sys/netinet/ip_ipsec.c head/sys/netinet6/icmp6.c head/sys/netinet6/ip6_ipsec.c head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec.h head/sys/netipsec/ipsec_input.c head/sys/netipsec/ipsec_mbuf.c head/sys/netipsec/ipsec_output.c head/sys/netipsec/key.c head/sys/netipsec/key.h head/sys/netipsec/key_debug.c head/sys/netipsec/keydb.h head/sys/netipsec/keysock.c head/sys/netipsec/xform_ah.c head/sys/netipsec/xform_esp.c head/sys/netipsec/xform_ipcomp.c head/sys/netipsec/xform_ipip.c head/sys/netipsec/xform_tcp.c Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netinet/ip_icmp.c Tue Dec 2 04:20:50 2014 (r275392) @@ -33,7 +33,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" -#include "opt_ipsec.h" #include #include @@ -65,10 +64,6 @@ __FBSDID("$FreeBSD$"); #include #ifdef INET -#ifdef IPSEC -#include -#include -#endif #include @@ -619,9 +614,6 @@ reflect: (struct sockaddr *)&icmpgw, fibnum); } pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&icmpsrc); -#ifdef IPSEC - key_sa_routechange((struct sockaddr *)&icmpsrc); -#endif break; /* Modified: head/sys/netinet/ip_ipsec.c ============================================================================== --- head/sys/netinet/ip_ipsec.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netinet/ip_ipsec.c Tue Dec 2 04:20:50 2014 (r275392) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -206,35 +205,7 @@ ip_ipsec_mtu(struct mbuf *m, int mtu) * tunnel MTU = if MTU - sizeof(IP) - ESP/AH hdrsiz * XXX quickhack!!! */ - struct secpolicy *sp = NULL; - int ipsecerror; - int ipsechdr; - struct route *ro; - sp = ipsec_getpolicybyaddr(m, - IPSEC_DIR_OUTBOUND, - IP_FORWARDING, - &ipsecerror); - if (sp != NULL) { - /* count IPsec header size */ - ipsechdr = ipsec_hdrsiz(m, IPSEC_DIR_OUTBOUND, NULL); - - /* - * find the correct route for outer IPv4 - * header, compute tunnel MTU. - */ - if (sp->req != NULL && - sp->req->sav != NULL && - sp->req->sav->sah != NULL) { - ro = &sp->req->sav->sah->route_cache.sa_route; - if (ro->ro_rt && ro->ro_rt->rt_ifp) { - mtu = ro->ro_rt->rt_mtu ? ro->ro_rt->rt_mtu : - ro->ro_rt->rt_ifp->if_mtu; - mtu -= ipsechdr; - } - } - KEY_FREESP(&sp); - } - return mtu; + return (mtu - ipsec_hdrsiz(m, IPSEC_DIR_OUTBOUND, NULL)); } /* Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netinet6/icmp6.c Tue Dec 2 04:20:50 2014 (r275392) @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#include "opt_ipsec.h" #include #include @@ -110,11 +109,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef IPSEC -#include -#include -#endif - extern struct domain inet6domain; VNET_PCPUSTAT_DEFINE(struct icmp6stat, icmp6stat); @@ -2472,9 +2466,6 @@ icmp6_redirect_input(struct mbuf *m, int sdst.sin6_len = sizeof(struct sockaddr_in6); bcopy(&reddst6, &sdst.sin6_addr, sizeof(struct in6_addr)); pfctlinput(PRC_REDIRECT_HOST, (struct sockaddr *)&sdst); -#ifdef IPSEC - key_sa_routechange((struct sockaddr *)&sdst); -#endif /* IPSEC */ } freeit: Modified: head/sys/netinet6/ip6_ipsec.c ============================================================================== --- head/sys/netinet6/ip6_ipsec.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netinet6/ip6_ipsec.c Tue Dec 2 04:20:50 2014 (r275392) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/ipsec.c Tue Dec 2 04:20:50 2014 (r275392) @@ -56,7 +56,6 @@ #include #include -#include #include #include Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/ipsec.h Tue Dec 2 04:20:50 2014 (r275392) @@ -47,6 +47,10 @@ #ifdef _KERNEL +#include +#include +#include + #define IPSEC_ASSERT(_c,_m) KASSERT(_c, _m) #define IPSEC_IS_PRIVILEGED_SO(_so) \ Modified: head/sys/netipsec/ipsec_input.c ============================================================================== --- head/sys/netipsec/ipsec_input.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/ipsec_input.c Tue Dec 2 04:20:50 2014 (r275392) @@ -58,7 +58,6 @@ #include #include #include -#include #include #include Modified: head/sys/netipsec/ipsec_mbuf.c ============================================================================== --- head/sys/netipsec/ipsec_mbuf.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/ipsec_mbuf.c Tue Dec 2 04:20:50 2014 (r275392) @@ -37,11 +37,8 @@ #include #include -#include #include - #include - #include /* Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/ipsec_output.c Tue Dec 2 04:20:50 2014 (r275392) @@ -46,7 +46,6 @@ #include #include #include -#include #include #include Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/key.c Tue Dec 2 04:20:50 2014 (r275392) @@ -59,7 +59,6 @@ #include #include -#include #include #include @@ -2770,10 +2769,6 @@ key_delsah(sah) /* remove from tree of SA index */ if (__LIST_CHAINED(sah)) LIST_REMOVE(sah, chain); - if (sah->route_cache.sa_route.ro_rt) { - RTFREE(sah->route_cache.sa_route.ro_rt); - sah->route_cache.sa_route.ro_rt = (struct rtentry *)NULL; - } free(sah, M_IPSEC_SAH); } } @@ -7898,26 +7893,6 @@ key_sa_recordxfer(sav, m) return; } -/* dumb version */ -void -key_sa_routechange(dst) - struct sockaddr *dst; -{ - struct secashead *sah; - struct route *ro; - - SAHTREE_LOCK(); - LIST_FOREACH(sah, &V_sahtree, chain) { - ro = &sah->route_cache.sa_route; - if (ro->ro_rt && dst->sa_len == ro->ro_dst.sa_len - && bcmp(dst, &ro->ro_dst, dst->sa_len) == 0) { - RTFREE(ro->ro_rt); - ro->ro_rt = (struct rtentry *)NULL; - } - } - SAHTREE_UNLOCK(); -} - static void key_sa_chgstate(struct secasvar *sav, u_int8_t state) { Modified: head/sys/netipsec/key.h ============================================================================== --- head/sys/netipsec/key.h Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/key.h Tue Dec 2 04:20:50 2014 (r275392) @@ -106,7 +106,6 @@ extern void key_init __P((void)); extern void key_destroy(void); #endif extern void key_sa_recordxfer __P((struct secasvar *, struct mbuf *)); -extern void key_sa_routechange __P((struct sockaddr *)); extern void key_sa_stir_iv __P((struct secasvar *)); #ifdef IPSEC_NAT_T u_int16_t key_portfromsaddr(struct sockaddr *); Modified: head/sys/netipsec/key_debug.c ============================================================================== --- head/sys/netipsec/key_debug.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/key_debug.c Tue Dec 2 04:20:50 2014 (r275392) @@ -45,7 +45,6 @@ #endif #include -#include #include #include Modified: head/sys/netipsec/keydb.h ============================================================================== --- head/sys/netipsec/keydb.h Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/keydb.h Tue Dec 2 04:20:50 2014 (r275392) @@ -85,12 +85,6 @@ struct seclifetime { u_int64_t usetime; }; -union sa_route_union { - struct route sa_route; - struct route sin_route; /* Duplicate for consistency. */ - struct route_in6 sin6_route; -}; - /* Security Association Data Base */ struct secashead { LIST_ENTRY(secashead) chain; @@ -105,8 +99,6 @@ struct secashead { LIST_HEAD(_satree, secasvar) savtree[SADB_SASTATE_MAX+1]; /* SA chain */ /* The first of this list is newer SA */ - - union sa_route_union route_cache; }; struct xformsw; Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/keysock.c Tue Dec 2 04:20:50 2014 (r275392) @@ -54,7 +54,6 @@ #include #include #include -#include #include Modified: head/sys/netipsec/xform_ah.c ============================================================================== --- head/sys/netipsec/xform_ah.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/xform_ah.c Tue Dec 2 04:20:50 2014 (r275392) @@ -58,7 +58,6 @@ #include #include -#include #include #include #include Modified: head/sys/netipsec/xform_esp.c ============================================================================== --- head/sys/netipsec/xform_esp.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/xform_esp.c Tue Dec 2 04:20:50 2014 (r275392) @@ -58,7 +58,6 @@ #include #include -#include #include #include #include Modified: head/sys/netipsec/xform_ipcomp.c ============================================================================== --- head/sys/netipsec/xform_ipcomp.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/xform_ipcomp.c Tue Dec 2 04:20:50 2014 (r275392) @@ -48,7 +48,6 @@ #include #include -#include #include #include Modified: head/sys/netipsec/xform_ipip.c ============================================================================== --- head/sys/netipsec/xform_ipip.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/xform_ipip.c Tue Dec 2 04:20:50 2014 (r275392) @@ -54,7 +54,6 @@ #include #include #include -#include #include #include Modified: head/sys/netipsec/xform_tcp.c ============================================================================== --- head/sys/netipsec/xform_tcp.c Tue Dec 2 02:41:44 2014 (r275391) +++ head/sys/netipsec/xform_tcp.c Tue Dec 2 04:20:50 2014 (r275392) @@ -47,7 +47,6 @@ #include #include -#include #include #include From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 05:28:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8D7A2F57; Tue, 2 Dec 2014 05:28:41 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A6E5CF; Tue, 2 Dec 2014 05:28:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB25Sf80096683; Tue, 2 Dec 2014 05:28:41 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB25SfxW096682; Tue, 2 Dec 2014 05:28:41 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412020528.sB25SfxW096682@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 2 Dec 2014 05:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275393 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 05:28:41 -0000 Author: ae Date: Tue Dec 2 05:28:40 2014 New Revision: 275393 URL: https://svnweb.freebsd.org/changeset/base/275393 Log: Remove unneded check. No need to do m_pullup to the size that we prepended. Sponsored by: Yandex LLC Modified: head/sys/netipsec/keysock.c Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Tue Dec 2 04:20:50 2014 (r275392) +++ head/sys/netipsec/keysock.c Tue Dec 2 05:28:40 2014 (r275393) @@ -148,8 +148,6 @@ key_sendup0(rp, m, promisc) struct sadb_msg *pmsg; M_PREPEND(m, sizeof(struct sadb_msg), M_NOWAIT); - if (m && m->m_len < sizeof(struct sadb_msg)) - m = m_pullup(m, sizeof(struct sadb_msg)); if (!m) { PFKEYSTAT_INC(in_nomem); m_freem(m); From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 05:41:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0C20735E; Tue, 2 Dec 2014 05:41:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED028264; Tue, 2 Dec 2014 05:41:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB25f4Ns002506; Tue, 2 Dec 2014 05:41:04 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB25f4Xe002504; Tue, 2 Dec 2014 05:41:04 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412020541.sB25f4Xe002504@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 2 Dec 2014 05:41:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275394 - in head/sys: net netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 05:41:05 -0000 Author: ae Date: Tue Dec 2 05:41:03 2014 New Revision: 275394 URL: https://svnweb.freebsd.org/changeset/base/275394 Log: Remove unneded check. No need to do m_pullup to the size that we prepended. MFC after: 1 week Sponsored by: Yandex LLC Modified: head/sys/net/if_stf.c head/sys/netinet6/icmp6.c Modified: head/sys/net/if_stf.c ============================================================================== --- head/sys/net/if_stf.c Tue Dec 2 05:28:40 2014 (r275393) +++ head/sys/net/if_stf.c Tue Dec 2 05:41:03 2014 (r275394) @@ -482,8 +482,6 @@ stf_output(struct ifnet *ifp, struct mbu } M_PREPEND(m, sizeof(struct ip), M_NOWAIT); - if (m && m->m_len < sizeof(struct ip)) - m = m_pullup(m, sizeof(struct ip)); if (m == NULL) { if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); return ENOBUFS; Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Tue Dec 2 05:28:40 2014 (r275393) +++ head/sys/netinet6/icmp6.c Tue Dec 2 05:41:03 2014 (r275394) @@ -363,8 +363,6 @@ icmp6_error(struct mbuf *m, int type, in preplen = sizeof(struct ip6_hdr) + sizeof(struct icmp6_hdr); M_PREPEND(m, preplen, M_NOWAIT); /* FIB is also copied over. */ - if (m && m->m_len < preplen) - m = m_pullup(m, preplen); if (m == NULL) { nd6log((LOG_DEBUG, "ENOBUFS in icmp6_error %d\n", __LINE__)); return; From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 06:11:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B37FC7DA; Tue, 2 Dec 2014 06:11:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94B93670; Tue, 2 Dec 2014 06:11:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB26BXER018939; Tue, 2 Dec 2014 06:11:33 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB26BXoI018937; Tue, 2 Dec 2014 06:11:33 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201412020611.sB26BXoI018937@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 2 Dec 2014 06:11:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275395 - head/usr.sbin/gpioctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 06:11:33 -0000 Author: rpaulo Date: Tue Dec 2 06:11:32 2014 New Revision: 275395 URL: https://svnweb.freebsd.org/changeset/base/275395 Log: Rewrite parts of gpioctl(8) to use the gpio(3) library. Modified: head/usr.sbin/gpioctl/Makefile head/usr.sbin/gpioctl/gpioctl.c Modified: head/usr.sbin/gpioctl/Makefile ============================================================================== --- head/usr.sbin/gpioctl/Makefile Tue Dec 2 05:41:03 2014 (r275394) +++ head/usr.sbin/gpioctl/Makefile Tue Dec 2 06:11:32 2014 (r275395) @@ -3,4 +3,9 @@ PROG= gpioctl MAN= gpioctl.8 +CFLAGS+= -I${.CURDIR}/../../lib/libgpio + +DPADD+= ${LIBGPIO} +LDADD+= -lgpio + .include Modified: head/usr.sbin/gpioctl/gpioctl.c ============================================================================== --- head/usr.sbin/gpioctl/gpioctl.c Tue Dec 2 05:41:03 2014 (r275394) +++ head/usr.sbin/gpioctl/gpioctl.c Tue Dec 2 06:11:32 2014 (r275395) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2009, Oleksandr Tymoshenko + * Copyright (c) 2014, Rui Paulo * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include -#include +#include struct flag_desc { const char *name; @@ -100,7 +101,7 @@ str2cap(const char *str) /* * Our handmade function for converting string to number */ -static int +static int str2int(const char *s, int *ok) { char *endptr; @@ -132,44 +133,35 @@ print_caps(int caps) } static void -dump_pins(int fd, int verbose) +dump_pins(gpio_handle_t handle, int verbose) { - int i, maxpin; - struct gpio_pin pin; - struct gpio_req req; - - if (ioctl(fd, GPIOMAXPIN, &maxpin) < 0) { - perror("ioctl(GPIOMAXPIN)"); + int i, maxpin, pinv; + gpio_config_t *cfgs; + gpio_config_t *pin; + + maxpin = gpio_pin_list(handle, &cfgs); + if (maxpin < 0) { + perror("gpio_pin_list"); exit(1); } for (i = 0; i <= maxpin; i++) { - pin.gp_pin = i; - if (ioctl(fd, GPIOGETCONFIG, &pin) < 0) - /* For some reason this pin is inaccessible */ - continue; - - req.gp_pin = i; - if (ioctl(fd, GPIOGET, &req) < 0) { - /* Now, that's wrong */ - perror("ioctl(GPIOGET)"); - exit(1); - } - - printf("pin %02d:\t%d\t%s", pin.gp_pin, req.gp_value, - pin.gp_name); + pin = cfgs + i; + pinv = gpio_pin_get(handle, pin->g_pin); + printf("pin %02d:\t%d\t%s", pin->g_pin, pinv, + pin->g_name); - print_caps(pin.gp_flags); + print_caps(pin->g_flags); if (verbose) { printf(", caps:"); - print_caps(pin.gp_caps); + print_caps(pin->g_caps); } printf("\n"); } } -static void +static void fail(const char *fmt, ...) { va_list ap; @@ -180,15 +172,14 @@ fail(const char *fmt, ...) exit(1); } -int +int main(int argc, char **argv) { int i; - struct gpio_pin pin; - struct gpio_req req; - char defctlfile[] = _PATH_DEVGPIOC "0"; + gpio_config_t pin; + gpio_handle_t handle; char *ctlfile = NULL; - int pinn, pinv, fd, ch; + int pinn, pinv, ch; int flags, flag, ok; int config, toggle, verbose, list; @@ -228,17 +219,17 @@ main(int argc, char **argv) printf("%d/%s\n", i, argv[i]); if (ctlfile == NULL) - ctlfile = defctlfile; - - fd = open(ctlfile, O_RDONLY); - if (fd < 0) { - perror("open"); + handle = gpio_open(0); + else + handle = gpio_open_device(ctlfile); + if (handle == GPIO_INVALID_HANDLE) { + perror("gpio_open"); exit(1); } if (list) { - dump_pins(fd, verbose); - close(fd); + dump_pins(handle, verbose); + gpio_close(handle); exit(0); } @@ -246,19 +237,16 @@ main(int argc, char **argv) /* * -t pin assumes no additional arguments */ - if(argc > 0) { + if (argc > 0) { usage(); exit(1); } - - req.gp_pin = pinn; - if (ioctl(fd, GPIOTOGGLE, &req) < 0) { - perror("ioctl(GPIOTOGGLE)"); + if (gpio_pin_toggle(handle, pinn) < 0) { + perror("gpio_pin_toggle"); exit(1); } - - close(fd); - exit (0); + gpio_close(handle); + exit(0); } if (config) { @@ -269,14 +257,12 @@ main(int argc, char **argv) fail("Invalid flag: %s\n", argv[i]); flags |= flag; } - - pin.gp_pin = pinn; - pin.gp_flags = flags; - if (ioctl(fd, GPIOSETCONFIG, &pin) < 0) { - perror("ioctl(GPIOSETCONFIG)"); + pin.g_pin = pinn; + pin.g_flags = flags; + if (gpio_pin_set_flags(handle, &pin) < 0) { + perror("gpio_pin_set_flags"); exit(1); } - exit(0); } @@ -296,13 +282,13 @@ main(int argc, char **argv) * Read pin value */ if (argc == 1) { - req.gp_pin = pinn; - if (ioctl(fd, GPIOGET, &req) < 0) { - perror("ioctl(GPIOGET)"); + pinv = gpio_pin_get(handle, pinn); + if (pinv < 0) { + perror("gpio_pin_get"); exit(1); } - printf("%d\n", req.gp_value); - exit (0); + printf("%d\n", pinv); + exit(0); } /* Is it valid number (0 or 1) ? */ @@ -313,13 +299,11 @@ main(int argc, char **argv) /* * Set pin value */ - req.gp_pin = pinn; - req.gp_value = pinv; - if (ioctl(fd, GPIOSET, &req) < 0) { - perror("ioctl(GPIOSET)"); + if (gpio_pin_set(handle, pinn, pinv) < 0) { + perror("gpio_pin_set"); exit(1); } - close(fd); + gpio_close(handle); exit(0); } From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 06:24:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD90BD8D; Tue, 2 Dec 2014 06:24:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA14A89A; Tue, 2 Dec 2014 06:24:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB26Okd3024466; Tue, 2 Dec 2014 06:24:46 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB26OksD024465; Tue, 2 Dec 2014 06:24:46 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201412020624.sB26OksD024465@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 2 Dec 2014 06:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275396 - head/lib/libgpio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 06:24:46 -0000 Author: rpaulo Date: Tue Dec 2 06:24:45 2014 New Revision: 275396 URL: https://svnweb.freebsd.org/changeset/base/275396 Log: Fix an off-by-one in gpio_pin_list(). Coverity CID: 1256495 Modified: head/lib/libgpio/gpio.c Modified: head/lib/libgpio/gpio.c ============================================================================== --- head/lib/libgpio/gpio.c Tue Dec 2 06:11:32 2014 (r275395) +++ head/lib/libgpio/gpio.c Tue Dec 2 06:24:45 2014 (r275396) @@ -89,7 +89,7 @@ gpio_pin_list(gpio_handle_t handle, gpio errno = EINVAL; return (-1); } - cfgs = calloc(maxpins, sizeof(*cfgs)); + cfgs = calloc(maxpins + 1, sizeof(*cfgs)); if (cfgs == NULL) return (-1); for (i = 0; i <= maxpins; i++) { From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 07:42:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63693B75; Tue, 2 Dec 2014 07:42:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E5A5F48; Tue, 2 Dec 2014 07:42:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB27gQlL061978; Tue, 2 Dec 2014 07:42:26 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB27gQET061977; Tue, 2 Dec 2014 07:42:26 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201412020742.sB27gQET061977@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 2 Dec 2014 07:42:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275399 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 07:42:26 -0000 Author: trasz Date: Tue Dec 2 07:42:25 2014 New Revision: 275399 URL: https://svnweb.freebsd.org/changeset/base/275399 Log: Fix null pointer dereference. MFC after: 2 weeks Coverity CID: 1256497 Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Tue Dec 2 07:36:02 2014 (r275398) +++ head/usr.sbin/ctld/ctld.c Tue Dec 2 07:42:25 2014 (r275399) @@ -1825,7 +1825,7 @@ conf_apply(struct conf *oldconf, struct error = kernel_port_add(newtarg); if (error != 0) { log_warnx("failed to add target %s", - oldtarg->t_name); + newtarg->t_name); /* * XXX: Uncomment after fixing the root cause. * From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 08:28:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 25F074F1; Tue, 2 Dec 2014 08:28:41 +0000 (UTC) Received: from mail-wi0-x234.google.com (mail-wi0-x234.google.com [IPv6:2a00:1450:400c:c05::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B96263CE; Tue, 2 Dec 2014 08:28:40 +0000 (UTC) Received: by mail-wi0-f180.google.com with SMTP id n3so20064710wiv.7 for ; Tue, 02 Dec 2014 00:28:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=VNkKpGpfGUaN1/Iz25Y3xQlKcvDHKp8VIkJK0o4JaS8=; b=zdxghsDc1JZSwwile1V/C6xDnkU7Z3SHT3uRMBGf0Is+8Mp+ZH+wdctxCwZh6+fqec ZcV0YyLpteD97Q1gp1DFUe3+ptydN56vMV4rDs/G3rg33pUccPwNLnxMgk0phoEF6E2k i2RWXwKMYyx56FUJ/YssuSqEDVLUUC+jtNjZ7sd6UUyrymEiklZNx3tIphh5UdeY4WZh ygEqOonZ6G2OSyr+IjlEwtHzTemuP2yxP4+rvw4/HadHK2f0/gZfjQZfi0uO+89Unr5y Un/9J00KomHH+PK+/zsoDG6Qo7B2W8805Y5N7o3Or0nheccdD/XFkA4CaVLEWX6R2v5t qjSQ== X-Received: by 10.194.190.19 with SMTP id gm19mr101131376wjc.51.1417508919251; Tue, 02 Dec 2014 00:28:39 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id bs2sm13691113wjc.43.2014.12.02.00.28.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Dec 2014 00:28:38 -0800 (PST) Sender: Baptiste Daroussin Date: Tue, 2 Dec 2014 09:28:35 +0100 From: Baptiste Daroussin To: Rui Paulo Subject: Re: svn commit: r275395 - head/usr.sbin/gpioctl Message-ID: <20141202082835.GA35285@ivaldir.etoilebsd.net> References: <201412020611.sB26BXoI018937@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="17pEHd4RhPHOinZp" Content-Disposition: inline In-Reply-To: <201412020611.sB26BXoI018937@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 08:28:41 -0000 --17pEHd4RhPHOinZp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 02, 2014 at 06:11:33AM +0000, Rui Paulo wrote: > Author: rpaulo > Date: Tue Dec 2 06:11:32 2014 > New Revision: 275395 > URL: https://svnweb.freebsd.org/changeset/base/275395 >=20 > Log: > Rewrite parts of gpioctl(8) to use the gpio(3) library. >=20 > Modified: > head/usr.sbin/gpioctl/Makefile > head/usr.sbin/gpioctl/gpioctl.c >=20 > Modified: head/usr.sbin/gpioctl/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.sbin/gpioctl/Makefile Tue Dec 2 05:41:03 2014 (r275394) > +++ head/usr.sbin/gpioctl/Makefile Tue Dec 2 06:11:32 2014 (r275395) > @@ -3,4 +3,9 @@ > PROG=3D gpioctl > MAN=3D gpioctl.8 > =20 > +CFLAGS+=3D -I${.CURDIR}/../../lib/libgpio > + > +DPADD+=3D ${LIBGPIO} > +LDADD+=3D -lgpio > + I have spent a lot of time on adding LIBADD, too bad you are not using it :( Bapt --17pEHd4RhPHOinZp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlR9eDAACgkQ8kTtMUmk6EyCEQCcCp0qdyydo8L0vZtWCV1CCshk kV0AoLJFgkAxzgWopL8uTBNONU8DK0vv =YLP7 -----END PGP SIGNATURE----- --17pEHd4RhPHOinZp-- From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 11:44:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E6A384B; Tue, 2 Dec 2014 11:44:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5ACC0CAB; Tue, 2 Dec 2014 11:44:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2BivZl075246; Tue, 2 Dec 2014 11:44:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2Biv9l075245; Tue, 2 Dec 2014 11:44:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201412021144.sB2Biv9l075245@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 2 Dec 2014 11:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275401 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 11:44:57 -0000 Author: avg Date: Tue Dec 2 11:44:56 2014 New Revision: 275401 URL: https://svnweb.freebsd.org/changeset/base/275401 Log: zfs_putpages: actually update mtime and ctime Reported by: Paul Koch Tested by: Paul Koch MFC after: 2 weeks 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 Tue Dec 2 09:45:07 2014 (r275400) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Dec 2 11:44:56 2014 (r275401) @@ -5969,6 +5969,7 @@ top: &zp->z_pflags, 8); zfs_tstamp_update_setup(zp, CONTENT_MODIFIED, mtime, ctime, B_TRUE); + (void)sa_bulk_update(zp->z_sa_hdl, bulk, count, tx); zfs_log_write(zfsvfs->z_log, tx, TX_WRITE, zp, off, len, 0); zfs_vmobject_wlock(object); From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 12:05:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A68FBFD4; Tue, 2 Dec 2014 12:05:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79BADE93; Tue, 2 Dec 2014 12:05:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2C5jO3085323; Tue, 2 Dec 2014 12:05:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2C5jDm085322; Tue, 2 Dec 2014 12:05:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412021205.sB2C5jDm085322@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 2 Dec 2014 12:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275403 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 12:05:45 -0000 Author: mav Date: Tue Dec 2 12:05:44 2014 New Revision: 275403 URL: https://svnweb.freebsd.org/changeset/base/275403 Log: Removed unused variable and unify some names. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Dec 2 11:47:26 2014 (r275402) +++ head/sys/cam/ctl/ctl.c Tue Dec 2 12:05:44 2014 (r275403) @@ -10962,7 +10962,6 @@ ctl_check_blocked(struct ctl_lun *lun) case CTL_ACTION_SKIP: { struct ctl_softc *softc; const struct ctl_cmd_entry *entry; - uint32_t initidx; int isc_retval; /* @@ -11002,8 +11001,6 @@ ctl_check_blocked(struct ctl_lun *lun) entry = ctl_get_cmd_entry(&cur_blocked->scsiio, NULL); softc = control_softc; - initidx = ctl_get_initindex(&cur_blocked->io_hdr.nexus); - /* * Check this I/O for LUN state changes that may * have happened while this command was blocked. @@ -11840,7 +11837,7 @@ ctl_lun_reset(struct ctl_lun *lun, union { union ctl_io *xio; #if 0 - uint32_t initindex; + uint32_t initidx; #endif int i; @@ -11860,9 +11857,9 @@ ctl_lun_reset(struct ctl_lun *lun, union * This version sets unit attention for every */ #if 0 - initindex = ctl_get_initindex(&io->io_hdr.nexus); + initidx = ctl_get_initindex(&io->io_hdr.nexus); for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (initindex == i) + if (initidx == i) continue; lun->pending_ua[i] |= ua_type; } @@ -11970,9 +11967,9 @@ ctl_i_t_nexus_reset(union ctl_io *io) { struct ctl_softc *softc = control_softc; struct ctl_lun *lun; - uint32_t initindex, residx; + uint32_t initidx, residx; - initindex = ctl_get_initindex(&io->io_hdr.nexus); + initidx = ctl_get_initindex(&io->io_hdr.nexus); residx = ctl_get_resindex(&io->io_hdr.nexus); mtx_lock(&softc->ctl_lock); STAILQ_FOREACH(lun, &softc->lun_list, links) { @@ -11981,11 +11978,11 @@ ctl_i_t_nexus_reset(union ctl_io *io) io->io_hdr.nexus.initid.id, (io->io_hdr.flags & CTL_FLAG_FROM_OTHER_SC) != 0); #ifdef CTL_WITH_CA - ctl_clear_mask(lun->have_ca, initindex); + ctl_clear_mask(lun->have_ca, initidx); #endif if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx == residx)) lun->flags &= ~CTL_LUN_RESERVED; - lun->pending_ua[initindex] |= CTL_UA_I_T_NEXUS_LOSS; + lun->pending_ua[initidx] |= CTL_UA_I_T_NEXUS_LOSS; mtx_unlock(&lun->lun_lock); } mtx_unlock(&softc->ctl_lock); From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 12:31:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CDD88A9; Tue, 2 Dec 2014 12:31:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1DD57159; Tue, 2 Dec 2014 12:31:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2CVSp6098871; Tue, 2 Dec 2014 12:31:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2CVSxT098870; Tue, 2 Dec 2014 12:31:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412021231.sB2CVSxT098870@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 2 Dec 2014 12:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275404 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 12:31:29 -0000 Author: mav Date: Tue Dec 2 12:31:28 2014 New Revision: 275404 URL: https://svnweb.freebsd.org/changeset/base/275404 Log: Reduce code duplication by creating ctl_set_res_ua() helper. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Dec 2 12:05:44 2014 (r275403) +++ head/sys/cam/ctl/ctl.c Tue Dec 2 12:31:28 2014 (r275404) @@ -7867,6 +7867,15 @@ retry: return (CTL_RETVAL_COMPLETE); } +static void +ctl_set_res_ua(struct ctl_lun *lun, uint32_t residx, ctl_ua_type ua) +{ + + if (residx >= persis_offset && + residx < persis_offset + CTL_MAX_INITIATORS) + lun->pending_ua[residx - persis_offset] |= ua; +} + /* * Returns 0 if ctl_persistent_reserve_out() should continue, non-zero if * it should return. @@ -7920,15 +7929,8 @@ ctl_pro_preempt(struct ctl_softc *softc, if (i == residx || lun->pr_keys[i] == 0) continue; - if (!persis_offset - && i pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_REG_PREEMPT; lun->pr_keys[i] = 0; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; lun->res_type = type; @@ -7999,12 +8001,7 @@ ctl_pro_preempt(struct ctl_softc *softc, found = 1; lun->pr_keys[i] = 0; lun->pr_key_count--; - - if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= CTL_UA_REG_PREEMPT; - else if (persis_offset && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } if (!found) { mtx_unlock(&lun->lun_lock); @@ -8079,27 +8076,11 @@ ctl_pro_preempt(struct ctl_softc *softc, if (sa_res_key == lun->pr_keys[i]) { lun->pr_keys[i] = 0; lun->pr_key_count--; - - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type ==SPR_TYPE_EX_AC_RO)){ - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[ - i-persis_offset] |= - CTL_UA_RES_RELEASE; + ctl_set_res_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = type; @@ -8138,15 +8119,7 @@ ctl_pro_preempt(struct ctl_softc *softc, found = 1; lun->pr_keys[i] = 0; lun->pr_key_count--; - - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } if (!found) { @@ -8201,14 +8174,8 @@ ctl_pro_preempt_other(struct ctl_lun *lu lun->pr_keys[i] == 0) continue; - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset && i >= persis_offset) - lun->pending_ua[i - persis_offset] |= - CTL_UA_REG_PREEMPT; lun->pr_keys[i] = 0; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; @@ -8223,15 +8190,7 @@ ctl_pro_preempt_other(struct ctl_lun *lu lun->pr_keys[i] = 0; lun->pr_key_count--; - - if (!persis_offset - && i < persis_offset) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i - persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } } } else { @@ -8243,25 +8202,11 @@ ctl_pro_preempt_other(struct ctl_lun *lu if (sa_res_key == lun->pr_keys[i]) { lun->pr_keys[i] = 0; lun->pr_key_count--; - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_REG_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i - persis_offset] |= - CTL_UA_REG_PREEMPT; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (msg->pr.pr_info.res_type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type == SPR_TYPE_EX_AC_RO)) { - if (!persis_offset - && i < persis_offset) - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i - persis_offset] |= - CTL_UA_RES_RELEASE; + ctl_set_res_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = msg->pr.pr_info.res_type; @@ -8645,14 +8590,8 @@ ctl_persistent_reserve_out(struct ctl_sc for (i=0; i < 2*CTL_MAX_INITIATORS; i++) if (lun->pr_keys[i] != 0) { - if (!persis_offset && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= - CTL_UA_RES_PREEMPT; - else if (persis_offset && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_RES_PREEMPT; - lun->pr_keys[i] = 0; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; mtx_unlock(&lun->lun_lock); @@ -8794,14 +8733,8 @@ ctl_hndl_per_res_out_on_other_sc(union c for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { if (lun->pr_keys[i] == 0) continue; - if (!persis_offset - && i < CTL_MAX_INITIATORS) - lun->pending_ua[i] |= CTL_UA_RES_PREEMPT; - else if (persis_offset - && i >= persis_offset) - lun->pending_ua[i-persis_offset] |= - CTL_UA_RES_PREEMPT; lun->pr_keys[i] = 0; + ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; break; From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 12:38:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4567A80; Tue, 2 Dec 2014 12:38:23 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B5ECD255; Tue, 2 Dec 2014 12:38:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2CcNbJ099822; Tue, 2 Dec 2014 12:38:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2CcN6F099820; Tue, 2 Dec 2014 12:38:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412021238.sB2CcN6F099820@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 2 Dec 2014 12:38:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275405 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 12:38:24 -0000 Author: mav Date: Tue Dec 2 12:38:22 2014 New Revision: 275405 URL: https://svnweb.freebsd.org/changeset/base/275405 Log: Convert persis_offset from global variable to softc field. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_private.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Dec 2 12:31:28 2014 (r275404) +++ head/sys/cam/ctl/ctl.c Tue Dec 2 12:38:22 2014 (r275405) @@ -356,7 +356,6 @@ static struct ctl_logical_block_provisio * XXX KDM move these into the softc. */ static int rcv_sync_msg; -static int persis_offset; static uint8_t ctl_pause_rtr; SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); @@ -1074,7 +1073,7 @@ ctl_init(void) softc->port_offset = 0; } else softc->port_offset = (softc->ha_id - 1) * CTL_MAX_PORTS; - persis_offset = softc->port_offset * CTL_MAX_INIT_PER_PORT; + softc->persis_offset = softc->port_offset * CTL_MAX_INIT_PER_PORT; /* * XXX KDM need to figure out where we want to get our target ID @@ -7870,10 +7869,10 @@ retry: static void ctl_set_res_ua(struct ctl_lun *lun, uint32_t residx, ctl_ua_type ua) { + int off = lun->ctl_softc->persis_offset; - if (residx >= persis_offset && - residx < persis_offset + CTL_MAX_INITIATORS) - lun->pending_ua[residx - persis_offset] |= ua; + if (residx >= off && residx < off + CTL_MAX_INITIATORS) + lun->pending_ua[residx - off] |= ua; } /* @@ -8412,8 +8411,8 @@ ctl_persistent_reserve_out(struct ctl_sc */ for (i = 0; i < CTL_MAX_INITIATORS;i++){ - if (lun->pr_keys[ - i + persis_offset] == 0) + if (lun->pr_keys[i + + softc->persis_offset] == 0) continue; lun->pending_ua[i] |= CTL_UA_RES_RELEASE; @@ -8560,7 +8559,7 @@ ctl_persistent_reserve_out(struct ctl_sc && type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) { if (i == residx || - lun->pr_keys[i + persis_offset] == 0) + lun->pr_keys[i + softc->persis_offset] == 0) continue; lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } @@ -8677,8 +8676,8 @@ ctl_hndl_per_res_out_on_other_sc(union c */ for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i+ - persis_offset] == 0) + if (lun->pr_keys[i + + softc->persis_offset] == 0) continue; lun->pending_ua[i] |= @@ -8711,7 +8710,7 @@ ctl_hndl_per_res_out_on_other_sc(union c if (lun->res_type != SPR_TYPE_EX_AC && lun->res_type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) - if (lun->pr_keys[i+persis_offset] != 0) + if (lun->pr_keys[i + softc->persis_offset] != 0) lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Tue Dec 2 12:31:28 2014 (r275404) +++ head/sys/cam/ctl/ctl_private.h Tue Dec 2 12:38:22 2014 (r275405) @@ -450,6 +450,7 @@ struct ctl_softc { int ha_state; int is_single; int port_offset; + int persis_offset; int inquiry_pq_no_lun; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 12:39:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F956BD1; Tue, 2 Dec 2014 12:39:29 +0000 (UTC) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0B01261; Tue, 2 Dec 2014 12:39:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by woozle.rinet.ru (8.14.5/8.14.5) with ESMTP id sB2Cd4IZ077824; Tue, 2 Dec 2014 15:39:04 +0300 (MSK) (envelope-from marck@rinet.ru) Date: Tue, 2 Dec 2014 15:39:04 +0300 (MSK) From: Dmitry Morozovsky To: Baptiste Daroussin Subject: Re: svn commit: r275385 - head/contrib/subversion/subversion/svn In-Reply-To: <201412020023.sB20NQqJ053333@svn.freebsd.org> Message-ID: References: <201412020023.sB20NQqJ053333@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) X-NCC-RegID: ru.rinet X-OpenPGP-Key-ID: 6B691B03 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (woozle.rinet.ru [0.0.0.0]); Tue, 02 Dec 2014 15:39:04 +0300 (MSK) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 12:39:29 -0000 On Tue, 2 Dec 2014, Baptiste Daroussin wrote: > Author: bapt > Date: Tue Dec 2 00:23:26 2014 > New Revision: 275385 > URL: https://svnweb.freebsd.org/changeset/base/275385 > > Log: > Sync the svn template with the one from ports Possibly dumb question: I we patch this file anyway, could we possibly extract template to external file? and, finally, convince this to upstream? -- Sincerely, D.Marck [DM5020, MCK-RIPE, DM3-RIPN] [ FreeBSD committer: marck@FreeBSD.org ] ------------------------------------------------------------------------ *** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru *** ------------------------------------------------------------------------ From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 13:58:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 692C3780; Tue, 2 Dec 2014 13:58:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54FBAC6E; Tue, 2 Dec 2014 13:58:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2DwwCr037865; Tue, 2 Dec 2014 13:58:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2DwwFq037864; Tue, 2 Dec 2014 13:58:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412021358.sB2DwwFq037864@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 2 Dec 2014 13:58:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275407 - head/tools/tools/usbtest X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 13:58:58 -0000 Author: hselasky Date: Tue Dec 2 13:58:57 2014 New Revision: 275407 URL: https://svnweb.freebsd.org/changeset/base/275407 Log: Add missing Makefile defines so that the program in question can be built as part of buildworld. Modified: head/tools/tools/usbtest/Makefile Modified: head/tools/tools/usbtest/Makefile ============================================================================== --- head/tools/tools/usbtest/Makefile Tue Dec 2 13:46:13 2014 (r275406) +++ head/tools/tools/usbtest/Makefile Tue Dec 2 13:58:57 2014 (r275407) @@ -30,11 +30,13 @@ SRCS+= usbtest.c SRCS+= usb_msc_test.c SRCS+= usb_modem_test.c SRCS+= usb_control_ep_test.c +SYSDIR?= ${.CURDIR}/../../../sys +DPADD+= ${LIBUSB} LDADD+= -lusb WARNS= 3 -CFLAGS+= -I ${.CURDIR}/../../../sys/dev/usb/gadget +CFLAGS+= -I${SYSDIR}/dev/usb/gadget .include From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 14:48:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A61A22D3; Tue, 2 Dec 2014 14:48:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 928811D0; Tue, 2 Dec 2014 14:48:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2EmMY4061652; Tue, 2 Dec 2014 14:48:22 GMT (envelope-from nyan@FreeBSD.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2EmM3M061651; Tue, 2 Dec 2014 14:48:22 GMT (envelope-from nyan@FreeBSD.org) Message-Id: <201412021448.sB2EmM3M061651@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: nyan set sender to nyan@FreeBSD.org using -f From: Takahashi Yoshihiro Date: Tue, 2 Dec 2014 14:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275411 - head/sys/boot/pc98/boot2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 14:48:22 -0000 Author: nyan Date: Tue Dec 2 14:48:21 2014 New Revision: 275411 URL: https://svnweb.freebsd.org/changeset/base/275411 Log: MFi386: r275305 (by rdivacky) Unbreak the code for non-digits below '0' by casting the expression to unsigned int. Modified: head/sys/boot/pc98/boot2/boot2.c Modified: head/sys/boot/pc98/boot2/boot2.c ============================================================================== --- head/sys/boot/pc98/boot2/boot2.c Tue Dec 2 14:21:06 2014 (r275410) +++ head/sys/boot/pc98/boot2/boot2.c Tue Dec 2 14:48:21 2014 (r275411) @@ -557,7 +557,7 @@ parse() #if SERIAL } else if (c == 'S') { j = 0; - while ((i = *arg++ - '0') <= 9) + while ((unsigned int)(i = *arg++ - '0') <= 9) j = j * 10 + i; if (j > 0 && i == -'0') { comspeed = j; From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 16:22:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6952897F; Tue, 2 Dec 2014 16:22:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 55802E63; Tue, 2 Dec 2014 16:22:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2GM995008535; Tue, 2 Dec 2014 16:22:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2GM9j4008534; Tue, 2 Dec 2014 16:22:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412021622.sB2GM9j4008534@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 2 Dec 2014 16:22:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275412 - head/libexec/rtld-elf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 16:22:09 -0000 Author: jhb Date: Tue Dec 2 16:22:08 2014 New Revision: 275412 URL: https://svnweb.freebsd.org/changeset/base/275412 Log: The runtime linker needs to include a path to itself in the link map it exports to the debugger. It currently has two choices: it can use a compiled-in path (/libexec/ld-elf.so.1) or it can use the path stored in the interpreter path in the binary being executed. The runtime linker currently prefers the second. However, this is usually wrong for compat32 binaries since the binary specifies the path of rtld on a 32-bit system (/libexec/ld-elf.so.1) instead of the actual path (/libexec/ld-elf32.so.1). For now, always assume the compiled in path (/libexec/ld-elf32.so.1) as the rtld path and ignore the path in the binary for the 32-bit runtime linker. Differential Revision: https://reviews.freebsd.org/D1236 Reviewed by: kib Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Dec 2 14:48:21 2014 (r275411) +++ head/libexec/rtld-elf/rtld.c Tue Dec 2 16:22:08 2014 (r275412) @@ -503,6 +503,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ aux_info[AT_STACKPROT]->a_un.a_val != 0) stack_prot = aux_info[AT_STACKPROT]->a_un.a_val; +#ifndef COMPAT_32BIT /* * Get the actual dynamic linker pathname from the executable if * possible. (It should always be possible.) That ensures that @@ -515,6 +516,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_ obj_rtld.path = xstrdup(obj_main->interp); __progname = obj_rtld.path; } +#endif digest_dynamic(obj_main, 0); dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 18:12:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1F33B5C; Tue, 2 Dec 2014 18:12:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDC38D47; Tue, 2 Dec 2014 18:12:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2ICH49060895; Tue, 2 Dec 2014 18:12:17 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2ICHYx060894; Tue, 2 Dec 2014 18:12:17 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412021812.sB2ICHYx060894@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 2 Dec 2014 18:12:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275415 - head/contrib/binutils/gas/config X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 18:12:17 -0000 Author: andrew Date: Tue Dec 2 18:12:16 2014 New Revision: 275415 URL: https://svnweb.freebsd.org/changeset/base/275415 Log: Allow the UAL APSR_nzcv format for the mrc and mrc2 instructions. The clang integrated assembler only allows these forms so binutils will need to support them. MFC after: 1 Week Sponsored by: AB Systems Ltd Modified: head/contrib/binutils/gas/config/tc-arm.c Modified: head/contrib/binutils/gas/config/tc-arm.c ============================================================================== --- head/contrib/binutils/gas/config/tc-arm.c Tue Dec 2 17:10:11 2014 (r275414) +++ head/contrib/binutils/gas/config/tc-arm.c Tue Dec 2 18:12:16 2014 (r275415) @@ -15055,7 +15055,7 @@ static const struct asm_opcode insns[] = TCE(stc, c000000, ec000000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TC3(stcl, c400000, ec400000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TCE(mcr, e000010, ee000010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), - TCE(mrc, e100010, ee100010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), + TCE(mrc, e100010, ee100010, 6, (RCP, I7b, APSR_RR, RCN, RCN, oI7b), co_reg, co_reg), #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v2s /* ARM 3 - swp instructions. */ @@ -15114,7 +15114,7 @@ static const struct asm_opcode insns[] = TUF(stc2l, c400000, fc400000, 3, (RCP, RCN, ADDRGLDC), lstc, lstc), TUF(cdp2, e000000, fe000000, 6, (RCP, I15b, RCN, RCN, RCN, oI7b), cdp, cdp), TUF(mcr2, e000010, fe000010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), - TUF(mrc2, e100010, fe100010, 6, (RCP, I7b, RR, RCN, RCN, oI7b), co_reg, co_reg), + TUF(mrc2, e100010, fe100010, 6, (RCP, I7b, APSR_RR, RCN, RCN, oI7b), co_reg, co_reg), #undef ARM_VARIANT #define ARM_VARIANT &arm_ext_v5exp /* ARM Architecture 5TExP. */ From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 18:20:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34A62D49; Tue, 2 Dec 2014 18:20:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 20EC5E2D; Tue, 2 Dec 2014 18:20:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2IKr0u064369; Tue, 2 Dec 2014 18:20:53 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2IKrwi064368; Tue, 2 Dec 2014 18:20:53 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412021820.sB2IKrwi064368@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 2 Dec 2014 18:20:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275416 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 18:20:54 -0000 Author: andrew Date: Tue Dec 2 18:20:53 2014 New Revision: 275416 URL: https://svnweb.freebsd.org/changeset/base/275416 Log: Fix the name of the coprocessor to include the "p" prefix, the clang integrated assembler expects this. MFC after: 1 Week Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/locore.S Modified: head/sys/arm/arm/locore.S ============================================================================== --- head/sys/arm/arm/locore.S Tue Dec 2 18:12:16 2014 (r275415) +++ head/sys/arm/arm/locore.S Tue Dec 2 18:20:53 2014 (r275416) @@ -511,8 +511,8 @@ ENTRY_NP(cpu_halt) * Hurl ourselves into the ROM */ mov r0, #(CPU_CONTROL_32BP_ENABLE | CPU_CONTROL_32BD_ENABLE) - mcr 15, 0, r0, c1, c0, 0 - mcrne 15, 0, r2, c8, c7, 0 /* nail I+D TLB on ARMv4 and greater */ + mcr p15, 0, r0, c1, c0, 0 + mcrne p15, 0, r2, c8, c7, 0 /* nail I+D TLB on ARMv4 and greater */ mov pc, r4 /* From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 18:35:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6EBAB304; Tue, 2 Dec 2014 18:35:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40A48F80; Tue, 2 Dec 2014 18:35:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2IZZYs071265; Tue, 2 Dec 2014 18:35:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2IZYTe071263; Tue, 2 Dec 2014 18:35:34 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412021835.sB2IZYTe071263@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 2 Dec 2014 18:35:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275417 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 18:35:35 -0000 Author: andrew Date: Tue Dec 2 18:35:34 2014 New Revision: 275417 URL: https://svnweb.freebsd.org/changeset/base/275417 Log: Use the APSR_nzcv format of mrc. The clang integrated assembler doesn't support the old usage of r15. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/cpufunc_asm_armv5_ec.S head/sys/arm/arm/cpufunc_asm_sheeva.S Modified: head/sys/arm/arm/cpufunc_asm_armv5_ec.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_armv5_ec.S Tue Dec 2 18:20:53 2014 (r275416) +++ head/sys/arm/arm/cpufunc_asm_armv5_ec.S Tue Dec 2 18:35:34 2014 (r275417) @@ -58,7 +58,7 @@ ENTRY(armv5_ec_setttb) * do it directly and entirely avoid the problem. */ mcr p15, 0, r0, c7, c5, 0 /* Invalidate ICache */ -1: mrc p15, 0, r15, c7, c14, 3 /* Test, clean and invalidate DCache */ +1: mrc p15, 0, APSR_nzcv, c7, c14, 3 /* Test, clean and invalidate DCache */ bne 1b /* More to do? */ mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ @@ -105,7 +105,7 @@ ENTRY_NP(armv5_ec_icache_sync_all) .Larmv5_ec_dcache_wb: 1: - mrc p15, 0, r15, c7, c10, 3 /* Test and clean (don't invalidate) */ + mrc p15, 0, APSR_nzcv, c7, c10, 3 /* Test and clean (don't invalidate) */ bne 1b /* More to do? */ mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ RET @@ -208,7 +208,7 @@ END(armv5_ec_idcache_wbinv_all) ENTRY(armv5_ec_dcache_wbinv_all) .Larmv5_ec_dcache_wbinv_all: -1: mrc p15, 0, r15, c7, c14, 3 /* Test, clean and invalidate DCache */ +1: mrc p15, 0, APSR_nzcv, c7, c14, 3 /* Test, clean and invalidate DCache */ bne 1b /* More to do? */ mcr p15, 0, r0, c7, c10, 4 /* drain the write buffer */ RET Modified: head/sys/arm/arm/cpufunc_asm_sheeva.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_sheeva.S Tue Dec 2 18:20:53 2014 (r275416) +++ head/sys/arm/arm/cpufunc_asm_sheeva.S Tue Dec 2 18:35:34 2014 (r275417) @@ -48,7 +48,7 @@ ENTRY(sheeva_setttb) mov r1, #0 mcr p15, 0, r1, c7, c5, 0 /* Invalidate ICache */ -1: mrc p15, 0, r15, c7, c14, 3 /* Test, clean and invalidate DCache */ +1: mrc p15, 0, APSR_nzcv, c7, c14, 3 /* Test, clean and invalidate DCache */ bne 1b /* More to do? */ mcr p15, 1, r1, c15, c9, 0 /* Clean L2 */ From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 18:37:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E15B1462; Tue, 2 Dec 2014 18:37:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC0FAF9F; Tue, 2 Dec 2014 18:37:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2Ib5FR071608; Tue, 2 Dec 2014 18:37:05 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2Ib4je071501; Tue, 2 Dec 2014 18:37:04 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412021837.sB2Ib4je071501@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 2 Dec 2014 18:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275418 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 18:37:06 -0000 Author: andrew Date: Tue Dec 2 18:37:04 2014 New Revision: 275418 URL: https://svnweb.freebsd.org/changeset/base/275418 Log: Switch to unified syntax so these can be built with clang 3.5. MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/bcopyinout_xscale.S head/sys/arm/arm/blockio.S head/sys/arm/arm/in_cksum_arm.S head/sys/arm/arm/support.S Modified: head/sys/arm/arm/bcopyinout_xscale.S ============================================================================== --- head/sys/arm/arm/bcopyinout_xscale.S Tue Dec 2 18:35:34 2014 (r275417) +++ head/sys/arm/arm/bcopyinout_xscale.S Tue Dec 2 18:37:04 2014 (r275418) @@ -38,6 +38,7 @@ #include __FBSDID("$FreeBSD$"); + .syntax unified .text .align 0 @@ -104,8 +105,8 @@ ENTRY(copyin) ldr r0, =EFAULT str r11, [r10, #PCB_ONFAULT] cmp r3, #0x00 - ldmgtfd sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ - ldmltfd sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ + ldmfdgt sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ + ldmfdlt sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ ldmfd sp!, {r10-r11, pc} .Lcopyin_guts: @@ -138,7 +139,7 @@ ENTRY(copyin) /* Quad-align the destination buffer */ tst r1, #0x07 /* Already quad aligned? */ - ldrnet ip, [r0], #0x04 + ldrtne ip, [r0], #0x04 strne ip, [r1], #0x04 subne r2, r2, #0x04 stmfd sp!, {r4-r9} /* Free up some registers */ @@ -207,7 +208,7 @@ ENTRY(copyin) .Lcopyin_w_lessthan128: adds r2, r2, #0x80 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} RETeq subs r2, r2, #0x20 blt .Lcopyin_w_lessthan32 @@ -232,7 +233,7 @@ ENTRY(copyin) .Lcopyin_w_lessthan32: adds r2, r2, #0x20 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} RETeq /* Return now if done */ and r4, r2, #0x18 @@ -266,17 +267,17 @@ ENTRY(copyin) .Lcopyin_w_less_than8: subs r2, r2, #0x04 - ldrget ip, [r0], #0x04 + ldrtge ip, [r0], #0x04 strge ip, [r1], #0x04 RETeq /* Return now if done */ addlt r2, r2, #0x04 ldrbt ip, [r0], #0x01 cmp r2, #0x02 - ldrgebt r2, [r0], #0x01 + ldrbtge r2, [r0], #0x01 strb ip, [r1], #0x01 - ldrgtbt ip, [r0] - strgeb r2, [r1], #0x01 - strgtb ip, [r1] + ldrbtgt ip, [r0] + strbge r2, [r1], #0x01 + strbgt ip, [r1] RET /* @@ -331,7 +332,7 @@ ENTRY(copyin) bge .Lcopyin_bad1_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x03 @@ -392,7 +393,7 @@ ENTRY(copyin) bge .Lcopyin_bad2_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x02 @@ -453,7 +454,7 @@ ENTRY(copyin) bge .Lcopyin_bad3_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x01 @@ -546,8 +547,8 @@ ENTRY(copyout) ldr r0, =EFAULT str r11, [r10, #PCB_ONFAULT] cmp r3, #0x00 - ldmgtfd sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ - ldmltfd sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ + ldmfdgt sp!, {r4-r7} /* r3 > 0 Restore r4-r7 */ + ldmfdlt sp!, {r4-r9} /* r3 < 0 Restore r4-r9 */ ldmfd sp!, {r10-r11, pc} .Lcopyout_guts: @@ -582,7 +583,7 @@ ENTRY(copyout) tst r0, #0x07 /* Already quad aligned? */ ldrne ip, [r0], #0x04 subne r2, r2, #0x04 - strnet ip, [r1], #0x04 + strtne ip, [r1], #0x04 stmfd sp!, {r4-r9} /* Free up some registers */ mov r3, #-1 /* Signal restore r4-r9 */ @@ -650,7 +651,7 @@ ENTRY(copyout) .Lcopyout_w_lessthan128: adds r2, r2, #0x80 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} RETeq /* Return now if done */ subs r2, r2, #0x20 blt .Lcopyout_w_lessthan32 @@ -675,7 +676,7 @@ ENTRY(copyout) .Lcopyout_w_lessthan32: adds r2, r2, #0x20 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} RETeq /* Return now if done */ and r4, r2, #0x18 @@ -710,16 +711,16 @@ ENTRY(copyout) .Lcopyout_w_less_than8: subs r2, r2, #0x04 ldrge ip, [r0], #0x04 - strget ip, [r1], #0x04 + strtge ip, [r1], #0x04 RETeq /* Return now if done */ addlt r2, r2, #0x04 ldrb ip, [r0], #0x01 cmp r2, #0x02 - ldrgeb r2, [r0], #0x01 + ldrbge r2, [r0], #0x01 strbt ip, [r1], #0x01 - ldrgtb ip, [r0] - strgebt r2, [r1], #0x01 - strgtbt ip, [r1] + ldrbgt ip, [r0] + strbtge r2, [r1], #0x01 + strbtgt ip, [r1] RET /* @@ -774,7 +775,7 @@ ENTRY(copyout) bge .Lcopyout_bad1_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x03 @@ -835,7 +836,7 @@ ENTRY(copyout) bge .Lcopyout_bad2_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x02 @@ -896,7 +897,7 @@ ENTRY(copyout) bge .Lcopyout_bad3_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r0, r0, #0x01 Modified: head/sys/arm/arm/blockio.S ============================================================================== --- head/sys/arm/arm/blockio.S Tue Dec 2 18:35:34 2014 (r275417) +++ head/sys/arm/arm/blockio.S Tue Dec 2 18:37:04 2014 (r275418) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); + .syntax unified + /* * Read bytes from an I/O address into a block of memory * @@ -71,10 +73,10 @@ ENTRY(read_multi_1) cmp r12, #2 ldrb r3, [r0] strb r3, [r1], #1 - ldrgeb r3, [r0] - strgeb r3, [r1], #1 - ldrgtb r3, [r0] - strgtb r3, [r1], #1 + ldrbge r3, [r0] + strbge r3, [r1], #1 + ldrbgt r3, [r0] + strbgt r3, [r1], #1 subs r2, r2, r12 blt .Lrm1_l4 .Lrm1_main: @@ -91,15 +93,15 @@ ENTRY(read_multi_1) bge .Lrm1loop .Lrm1_l4: adds r2, r2, #4 /* r2 = length again */ - ldmeqdb fp, {fp, sp, pc} + ldmdbeq fp, {fp, sp, pc} RETeq cmp r2, #2 ldrb r3, [r0] strb r3, [r1], #1 - ldrgeb r3, [r0] - strgeb r3, [r1], #1 - ldrgtb r3, [r0] - strgtb r3, [r1], #1 + ldrbge r3, [r0] + strbge r3, [r1], #1 + ldrbgt r3, [r0] + strbgt r3, [r1], #1 ldmdb fp, {fp, sp, pc} END(read_multi_1) @@ -124,10 +126,10 @@ ENTRY(write_multi_1) cmp r12, #2 ldrb r3, [r1], #1 strb r3, [r0] - ldrgeb r3, [r1], #1 - strgeb r3, [r0] - ldrgtb r3, [r1], #1 - strgtb r3, [r0] + ldrbge r3, [r1], #1 + strbge r3, [r0] + ldrbgt r3, [r1], #1 + strbgt r3, [r0] subs r2, r2, r12 blt .Lwm1_l4 .Lwm1_main: @@ -144,14 +146,14 @@ ENTRY(write_multi_1) bge .Lwm1loop .Lwm1_l4: adds r2, r2, #4 /* r2 = length again */ - ldmeqdb fp, {fp, sp, pc} + ldmdbeq fp, {fp, sp, pc} cmp r2, #2 ldrb r3, [r1], #1 strb r3, [r0] - ldrgeb r3, [r1], #1 - strgeb r3, [r0] - ldrgtb r3, [r1], #1 - strgtb r3, [r0] + ldrbge r3, [r1], #1 + strbge r3, [r0] + ldrbgt r3, [r1], #1 + strbgt r3, [r0] ldmdb fp, {fp, sp, pc} END(write_multi_1) Modified: head/sys/arm/arm/in_cksum_arm.S ============================================================================== --- head/sys/arm/arm/in_cksum_arm.S Tue Dec 2 18:35:34 2014 (r275417) +++ head/sys/arm/arm/in_cksum_arm.S Tue Dec 2 18:37:04 2014 (r275418) @@ -46,6 +46,7 @@ #include "assym.s" __FBSDID("$FreeBSD$"); + .syntax unified /* * int in_cksum(struct mbuf *m, int len) * @@ -128,9 +129,9 @@ ASENTRY_NP(L_cksumdata) blt .Lcksumdata_endgame cmp r7, #0x02 ldrb r4, [r0], #0x01 /* Fetch 1st byte */ - ldrgeb r5, [r0], #0x01 /* Fetch 2nd byte */ + ldrbge r5, [r0], #0x01 /* Fetch 2nd byte */ movlt r5, #0x00 - ldrgtb r6, [r0], #0x01 /* Fetch 3rd byte */ + ldrbgt r6, [r0], #0x01 /* Fetch 3rd byte */ movle r6, #0x00 /* Combine the three bytes depending on endianness and alignment */ #ifdef __ARMEB__ @@ -196,7 +197,7 @@ ASENTRY_NP(L_cksumdata) adcs r2, r2, r5 adc r2, r2, #0x00 subs r1, r1, #0x40 - ldrged r4, [r0], #0x08 + ldrdge r4, [r0], #0x08 bge .Lcksumdata_bigloop adds r2, r2, r6 /* r6/r7 still need summing */ @@ -241,7 +242,7 @@ ASENTRY_NP(L_cksumdata) cmp r1, #0x20 #ifdef _ARM_ARCH_5E - ldrged r4, [r0], #0x08 /* Avoid stalling pld and result */ + ldrdge r4, [r0], #0x08 /* Avoid stalling pld and result */ blt .Lcksumdata_less_than_32 pld [r0, #0x18] ldrd r6, [r0], #0x08 @@ -319,9 +320,9 @@ ASENTRY_NP(L_cksumdata) .Lcksumdata_endgame: ldrb r3, [r0] /* Fetch first byte */ cmp r1, #0x02 - ldrgeb r4, [r0, #0x01] /* Fetch 2nd and 3rd as necessary */ + ldrbge r4, [r0, #0x01] /* Fetch 2nd and 3rd as necessary */ movlt r4, #0x00 - ldrgtb r5, [r0, #0x02] + ldrbgt r5, [r0, #0x02] movle r5, #0x00 /* Combine the three bytes depending on endianness and alignment */ tst r0, #0x01 Modified: head/sys/arm/arm/support.S ============================================================================== --- head/sys/arm/arm/support.S Tue Dec 2 18:35:34 2014 (r275417) +++ head/sys/arm/arm/support.S Tue Dec 2 18:37:04 2014 (r275418) @@ -91,6 +91,8 @@ __FBSDID("$FreeBSD$"); #include "assym.s" + .syntax unified + .L_arm_memcpy: .word _C_LABEL(_arm_memcpy) .L_arm_bzero: @@ -167,39 +169,39 @@ do_memset: .Lmemset_loop128: subs r1, r1, #0x80 #ifdef _ARM_ARCH_5E - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 -#else - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 +#else + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} #endif bgt .Lmemset_loop128 RETeq /* Zero length so just exit */ @@ -210,15 +212,15 @@ do_memset: .Lmemset_loop32: subs r1, r1, #0x20 #ifdef _ARM_ARCH_5E - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 -#else - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 +#else + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} #endif bgt .Lmemset_loop32 RETeq /* Zero length so just exit */ @@ -227,11 +229,11 @@ do_memset: /* Deal with 16 bytes or more */ #ifdef _ARM_ARCH_5E - strged r2, [ip], #0x08 - strged r2, [ip], #0x08 + strdge r2, [ip], #0x08 + strdge r2, [ip], #0x08 #else - stmgeia ip!, {r2-r3} - stmgeia ip!, {r2-r3} + stmiage ip!, {r2-r3} + stmiage ip!, {r2-r3} #endif RETeq /* Zero length so just exit */ @@ -254,17 +256,17 @@ do_memset: #endif strb r3, [ip], #0x01 /* Set 1 byte */ - strgeb r3, [ip], #0x01 /* Set another byte */ - strgtb r3, [ip] /* and a third */ + strbge r3, [ip], #0x01 /* Set another byte */ + strbgt r3, [ip] /* and a third */ RET /* Exit */ .Lmemset_wordunaligned: rsb r2, r2, #0x004 strb r3, [ip], #0x01 /* Set 1 byte */ cmp r2, #0x02 - strgeb r3, [ip], #0x01 /* Set another byte */ + strbge r3, [ip], #0x01 /* Set another byte */ sub r1, r1, r2 - strgtb r3, [ip], #0x01 /* and a third */ + strbgt r3, [ip], #0x01 /* and a third */ cmp r1, #0x04 /* More than 4 bytes left? */ bge .Lmemset_wordaligned /* Yup */ @@ -273,10 +275,11 @@ do_memset: RETeq /* Zero length so exit */ strb r3, [ip], #0x01 /* Set 1 byte */ cmp r1, #0x02 - strgeb r3, [ip], #0x01 /* Set another byte */ - strgtb r3, [ip] /* and a third */ + strbge r3, [ip], #0x01 /* Set another byte */ + strbgt r3, [ip] /* and a third */ RET /* Exit */ -END(memset) +EEND(memset) +END(bzero) ENTRY(bcmp) mov ip, r0 @@ -286,7 +289,7 @@ ENTRY(bcmp) /* Are both addresses aligned the same way? */ cmp r2, #0x00 - eornes r3, ip, r1 + eorsne r3, ip, r1 RETeq /* len == 0, or same addresses! */ tst r3, #0x03 subne r2, r2, #0x01 @@ -366,23 +369,23 @@ ENTRY(bcmp) ldrb r0, [ip, #0x00] /* r0 = b1#0 */ ldrb r2, [r1, #0x01] /* r2 = b2#1 */ subs r0, r0, r3 /* r0 = b1#0 - b2#0 */ - ldreqb r3, [ip, #0x01] /* r3 = b1#1 */ + ldrbeq r3, [ip, #0x01] /* r3 = b1#1 */ RETne /* Return if mismatch on #0 */ subs r0, r3, r2 /* r0 = b1#1 - b2#1 */ - ldreqb r3, [r1, #0x02] /* r3 = b2#2 */ - ldreqb r0, [ip, #0x02] /* r0 = b1#2 */ + ldrbeq r3, [r1, #0x02] /* r3 = b2#2 */ + ldrbeq r0, [ip, #0x02] /* r0 = b1#2 */ RETne /* Return if mismatch on #1 */ ldrb r2, [r1, #0x03] /* r2 = b2#3 */ subs r0, r0, r3 /* r0 = b1#2 - b2#2 */ - ldreqb r3, [ip, #0x03] /* r3 = b1#3 */ + ldrbeq r3, [ip, #0x03] /* r3 = b1#3 */ RETne /* Return if mismatch on #2 */ subs r0, r3, r2 /* r0 = b1#3 - b2#3 */ - ldreqb r3, [r1, #0x04] /* r3 = b2#4 */ - ldreqb r0, [ip, #0x04] /* r0 = b1#4 */ + ldrbeq r3, [r1, #0x04] /* r3 = b2#4 */ + ldrbeq r0, [ip, #0x04] /* r0 = b1#4 */ RETne /* Return if mismatch on #3 */ ldrb r2, [r1, #0x05] /* r2 = b2#5 */ subs r0, r0, r3 /* r0 = b1#4 - b2#4 */ - ldreqb r3, [ip, #0x05] /* r3 = b1#5 */ + ldrbeq r3, [ip, #0x05] /* r3 = b1#5 */ RETne /* Return if mismatch on #4 */ sub r0, r3, r2 /* r0 = b1#5 - b2#5 */ RET @@ -436,8 +439,8 @@ EENTRY(memmove) bge .Lmemmove_floop32 cmn r2, #0x10 - ldmgeia r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ - stmgeia r0!, {r3, r4, r12, lr} + ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ + stmiage r0!, {r3, r4, r12, lr} subge r2, r2, #0x10 ldmia sp!, {r4} /* return r4 */ @@ -446,9 +449,9 @@ EENTRY(memmove) /* blat 12 bytes at a time */ .Lmemmove_floop12: - ldmgeia r1!, {r3, r12, lr} - stmgeia r0!, {r3, r12, lr} - subges r2, r2, #0x0c + ldmiage r1!, {r3, r12, lr} + stmiage r0!, {r3, r12, lr} + subsge r2, r2, #0x0c bge .Lmemmove_floop12 .Lmemmove_fl12: @@ -458,23 +461,23 @@ EENTRY(memmove) subs r2, r2, #4 ldrlt r3, [r1], #4 strlt r3, [r0], #4 - ldmgeia r1!, {r3, r12} - stmgeia r0!, {r3, r12} + ldmiage r1!, {r3, r12} + stmiage r0!, {r3, r12} subge r2, r2, #4 .Lmemmove_fl4: /* less than 4 bytes to go */ adds r2, r2, #4 - ldmeqia sp!, {r0, pc} /* done */ + ldmiaeq sp!, {r0, pc} /* done */ /* copy the crud byte at a time */ cmp r2, #2 ldrb r3, [r1], #1 strb r3, [r0], #1 - ldrgeb r3, [r1], #1 - strgeb r3, [r0], #1 - ldrgtb r3, [r1], #1 - strgtb r3, [r0], #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + ldrbgt r3, [r1], #1 + strbgt r3, [r0], #1 ldmia sp!, {r0, pc} /* erg - unaligned destination */ @@ -485,10 +488,10 @@ EENTRY(memmove) /* align destination with byte copies */ ldrb r3, [r1], #1 strb r3, [r0], #1 - ldrgeb r3, [r1], #1 - strgeb r3, [r0], #1 - ldrgtb r3, [r1], #1 - strgtb r3, [r0], #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + ldrbgt r3, [r1], #1 + strbgt r3, [r0], #1 subs r2, r2, r12 blt .Lmemmove_fl4 /* less the 4 bytes */ @@ -703,12 +706,12 @@ EENTRY(memmove) .Lmemmove_bl32: cmn r2, #0x10 - ldmgedb r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ - stmgedb r0!, {r3, r4, r12, lr} + ldmdbge r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ + stmdbge r0!, {r3, r4, r12, lr} subge r2, r2, #0x10 adds r2, r2, #0x14 - ldmgedb r1!, {r3, r12, lr} /* blat a remaining 12 bytes */ - stmgedb r0!, {r3, r12, lr} + ldmdbge r1!, {r3, r12, lr} /* blat a remaining 12 bytes */ + stmdbge r0!, {r3, r12, lr} subge r2, r2, #0x0c ldmia sp!, {r4, lr} @@ -718,8 +721,8 @@ EENTRY(memmove) subs r2, r2, #4 ldrlt r3, [r1, #-4]! strlt r3, [r0, #-4]! - ldmgedb r1!, {r3, r12} - stmgedb r0!, {r3, r12} + ldmdbge r1!, {r3, r12} + stmdbge r0!, {r3, r12} subge r2, r2, #4 .Lmemmove_bl4: @@ -731,10 +734,10 @@ EENTRY(memmove) cmp r2, #2 ldrb r3, [r1, #-1]! strb r3, [r0, #-1]! - ldrgeb r3, [r1, #-1]! - strgeb r3, [r0, #-1]! - ldrgtb r3, [r1, #-1]! - strgtb r3, [r0, #-1]! + ldrbge r3, [r1, #-1]! + strbge r3, [r0, #-1]! + ldrbgt r3, [r1, #-1]! + strbgt r3, [r0, #-1]! RET /* erg - unaligned destination */ @@ -744,10 +747,10 @@ EENTRY(memmove) /* align destination with byte copies */ ldrb r3, [r1, #-1]! strb r3, [r0, #-1]! - ldrgeb r3, [r1, #-1]! - strgeb r3, [r0, #-1]! - ldrgtb r3, [r1, #-1]! - strgtb r3, [r0, #-1]! + ldrbge r3, [r1, #-1]! + strbge r3, [r0, #-1]! + ldrbgt r3, [r1, #-1]! + strbgt r3, [r0, #-1]! subs r2, r2, r12 blt .Lmemmove_bl4 /* less than 4 bytes to go */ ands r12, r1, #3 @@ -994,8 +997,8 @@ ENTRY(memcpy) bge .Lmemcpy_loop32 cmn r2, #0x10 - ldmgeia r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ - stmgeia r0!, {r3, r4, r12, lr} + ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ + stmiage r0!, {r3, r4, r12, lr} subge r2, r2, #0x10 ldmia sp!, {r4} /* return r4 */ @@ -1004,9 +1007,9 @@ ENTRY(memcpy) /* blat 12 bytes at a time */ .Lmemcpy_loop12: - ldmgeia r1!, {r3, r12, lr} - stmgeia r0!, {r3, r12, lr} - subges r2, r2, #0x0c + ldmiage r1!, {r3, r12, lr} + stmiage r0!, {r3, r12, lr} + subsge r2, r2, #0x0c bge .Lmemcpy_loop12 .Lmemcpy_l12: @@ -1016,26 +1019,26 @@ ENTRY(memcpy) subs r2, r2, #4 ldrlt r3, [r1], #4 strlt r3, [r0], #4 - ldmgeia r1!, {r3, r12} - stmgeia r0!, {r3, r12} + ldmiage r1!, {r3, r12} + stmiage r0!, {r3, r12} subge r2, r2, #4 .Lmemcpy_l4: /* less than 4 bytes to go */ adds r2, r2, #4 #ifdef __APCS_26_ - ldmeqia sp!, {r0, pc}^ /* done */ + ldmiaeq sp!, {r0, pc}^ /* done */ #else - ldmeqia sp!, {r0, pc} /* done */ + ldmiaeq sp!, {r0, pc} /* done */ #endif /* copy the crud byte at a time */ cmp r2, #2 ldrb r3, [r1], #1 strb r3, [r0], #1 - ldrgeb r3, [r1], #1 - strgeb r3, [r0], #1 - ldrgtb r3, [r1], #1 - strgtb r3, [r0], #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + ldrbgt r3, [r1], #1 + strbgt r3, [r0], #1 ldmia sp!, {r0, pc} /* erg - unaligned destination */ @@ -1046,10 +1049,10 @@ ENTRY(memcpy) /* align destination with byte copies */ ldrb r3, [r1], #1 strb r3, [r0], #1 - ldrgeb r3, [r1], #1 - strgeb r3, [r0], #1 - ldrgtb r3, [r1], #1 - strgtb r3, [r0], #1 + ldrbge r3, [r1], #1 + strbge r3, [r0], #1 + ldrbgt r3, [r1], #1 + strbgt r3, [r0], #1 subs r2, r2, r12 blt .Lmemcpy_l4 /* less the 4 bytes */ @@ -1212,12 +1215,12 @@ ENTRY(memcpy) ldrb ip, [r1], #0x01 sub r2, r2, #0x01 strb ip, [r3], #0x01 - ldrleb ip, [r1], #0x01 + ldrble ip, [r1], #0x01 suble r2, r2, #0x01 - strleb ip, [r3], #0x01 - ldrltb ip, [r1], #0x01 + strble ip, [r3], #0x01 + ldrblt ip, [r1], #0x01 sublt r2, r2, #0x01 - strltb ip, [r3], #0x01 + strblt ip, [r3], #0x01 /* Destination buffer is now word aligned */ .Lmemcpy_wordaligned: @@ -1294,7 +1297,7 @@ ENTRY(memcpy) .Lmemcpy_w_lessthan128: adds r2, r2, #0x80 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} RETeq /* Return now if done */ subs r2, r2, #0x20 blt .Lmemcpy_w_lessthan32 @@ -1319,7 +1322,7 @@ ENTRY(memcpy) .Lmemcpy_w_lessthan32: adds r2, r2, #0x20 /* Adjust for extra sub */ - ldmeqfd sp!, {r4-r9} + ldmfdeq sp!, {r4-r9} RETeq /* Return now if done */ and r4, r2, #0x18 @@ -1355,11 +1358,11 @@ ENTRY(memcpy) addlt r2, r2, #0x04 ldrb ip, [r1], #0x01 cmp r2, #0x02 - ldrgeb r2, [r1], #0x01 + ldrbge r2, [r1], #0x01 strb ip, [r3], #0x01 - ldrgtb ip, [r1] - strgeb r2, [r3], #0x01 - strgtb ip, [r3] + ldrbgt ip, [r1] + strbge r2, [r3], #0x01 + strbgt ip, [r3] RET @@ -1413,7 +1416,7 @@ ENTRY(memcpy) bge .Lmemcpy_bad1_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r1, r1, #0x03 @@ -1474,7 +1477,7 @@ ENTRY(memcpy) bge .Lmemcpy_bad2_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r1, r1, #0x02 @@ -1535,7 +1538,7 @@ ENTRY(memcpy) bge .Lmemcpy_bad3_loop16 adds r2, r2, #0x10 - ldmeqfd sp!, {r4-r7} + ldmfdeq sp!, {r4-r7} RETeq /* Return now if done */ subs r2, r2, #0x04 sublt r1, r1, #0x01 @@ -1564,11 +1567,11 @@ ENTRY(memcpy) RETeq ldrb ip, [r1], #0x01 cmp r2, #0x02 - ldrgeb r2, [r1], #0x01 + ldrbge r2, [r1], #0x01 strb ip, [r3], #0x01 - ldrgtb ip, [r1] - strgeb r2, [r3], #0x01 - strgtb ip, [r3] + ldrbgt ip, [r1] + strbge r2, [r3], #0x01 + strbgt ip, [r3] RET @@ -1598,7 +1601,7 @@ ENTRY(memcpy) ldrb ip, [r1], #0x01 1: subs r2, r2, #0x01 strb ip, [r3], #0x01 - ldrneb ip, [r1], #0x01 + ldrbne ip, [r1], #0x01 bne 1b RET From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 19:41:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E9F8A42B; Tue, 2 Dec 2014 19:41:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D67EF98F; Tue, 2 Dec 2014 19:41:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2JfPVH001699; Tue, 2 Dec 2014 19:41:25 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2JfPGG001697; Tue, 2 Dec 2014 19:41:25 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201412021941.sB2JfPGG001697@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 2 Dec 2014 19:41:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275420 - head/usr.sbin/gpioctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 19:41:26 -0000 Author: rpaulo Date: Tue Dec 2 19:41:25 2014 New Revision: 275420 URL: https://svnweb.freebsd.org/changeset/base/275420 Log: gpioctl: don't print the command line arguments. PR: 195330 Submitted by: Scott Ellis jumpnowtek at gmail.com MFC after: 3 days Modified: head/usr.sbin/gpioctl/gpioctl.c Modified: head/usr.sbin/gpioctl/gpioctl.c ============================================================================== --- head/usr.sbin/gpioctl/gpioctl.c Tue Dec 2 19:02:39 2014 (r275419) +++ head/usr.sbin/gpioctl/gpioctl.c Tue Dec 2 19:41:25 2014 (r275420) @@ -215,9 +215,6 @@ main(int argc, char **argv) } argv += optind; argc -= optind; - for (i = 0; i < argc; i++) - printf("%d/%s\n", i, argv[i]); - if (ctlfile == NULL) handle = gpio_open(0); else From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 19:55:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 534B0D6B; Tue, 2 Dec 2014 19:55:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E2D4AF7; Tue, 2 Dec 2014 19:55:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2Jtj0f009767; Tue, 2 Dec 2014 19:55:45 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2JtiXL009756; Tue, 2 Dec 2014 19:55:44 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201412021955.sB2JtiXL009756@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Tue, 2 Dec 2014 19:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275422 - in head/sys: amd64/conf i386/conf pc98/conf powerpc/conf sparc64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 19:55:45 -0000 Author: gnn Date: Tue Dec 2 19:55:43 2014 New Revision: 275422 URL: https://svnweb.freebsd.org/changeset/base/275422 Log: This configuration file removes several debugging options, including WITNESS and INVARIANTS checking, which are known to have significant performance impact on running systems. When benchmarking new features this kernel should be used instead of the standard GENERIC. This kernel configuration should never appear outside of the HEAD of the FreeBSD tree. Added: head/sys/amd64/conf/GENERIC-NODEBUG (contents, props changed) head/sys/i386/conf/GENERIC-NODEBUG (contents, props changed) head/sys/pc98/conf/GENERIC-NODEBUG (contents, props changed) head/sys/powerpc/conf/GENERIC-NODEBUG (contents, props changed) head/sys/sparc64/conf/GENERIC-NODEBUG (contents, props changed) Added: head/sys/amd64/conf/GENERIC-NODEBUG ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/amd64/conf/GENERIC-NODEBUG Tue Dec 2 19:55:43 2014 (r275422) @@ -0,0 +1,38 @@ +# +# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file +# for FreeBSD/amd64 +# +# This configuration file removes several debugging options, including +# WITNESS and INVARIANTS checking, which are known to have significant +# performance impact on running systems. When benchmarking new features +# this kernel should be used instead of the standard GENERIC. +# This kernel configuration should never appear outside of the HEAD +# of the FreeBSD tree. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include GENERIC + +ident GENERIC-NODEBUG + +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions DEADLKRES + Added: head/sys/i386/conf/GENERIC-NODEBUG ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/i386/conf/GENERIC-NODEBUG Tue Dec 2 19:55:43 2014 (r275422) @@ -0,0 +1,38 @@ +# +# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file +# for FreeBSD/i386 +# +# This configuration file removes several debugging options, including +# WITNESS and INVARIANTS checking, which are known to have significant +# performance impact on running systems. When benchmarking new features +# this kernel should be used instead of the standard GENERIC. +# This kernel configuration should never appear outside of the HEAD +# of the FreeBSD tree. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include GENERIC + +ident GENERIC-NODEBUG + +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions DEADLKRES + Added: head/sys/pc98/conf/GENERIC-NODEBUG ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/pc98/conf/GENERIC-NODEBUG Tue Dec 2 19:55:43 2014 (r275422) @@ -0,0 +1,38 @@ +# +# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file +# for FreeBSD/pc98 +# +# This configuration file removes several debugging options, including +# WITNESS and INVARIANTS checking, which are known to have significant +# performance impact on running systems. When benchmarking new features +# this kernel should be used instead of the standard GENERIC. +# This kernel configuration should never appear outside of the HEAD +# of the FreeBSD tree. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include GENERIC + +ident GENERIC-NODEBUG + +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions DEADLKRES + Added: head/sys/powerpc/conf/GENERIC-NODEBUG ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/conf/GENERIC-NODEBUG Tue Dec 2 19:55:43 2014 (r275422) @@ -0,0 +1,38 @@ +# +# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file +# for FreeBSD/powerpc +# +# This configuration file removes several debugging options, including +# WITNESS and INVARIANTS checking, which are known to have significant +# performance impact on running systems. When benchmarking new features +# this kernel should be used instead of the standard GENERIC. +# This kernel configuration should never appear outside of the HEAD +# of the FreeBSD tree. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include GENERIC + +ident GENERIC-NODEBUG + +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions DEADLKRES + Added: head/sys/sparc64/conf/GENERIC-NODEBUG ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sparc64/conf/GENERIC-NODEBUG Tue Dec 2 19:55:43 2014 (r275422) @@ -0,0 +1,38 @@ +# +# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file +# for FreeBSD/sparc64 +# +# This configuration file removes several debugging options, including +# WITNESS and INVARIANTS checking, which are known to have significant +# performance impact on running systems. When benchmarking new features +# this kernel should be used instead of the standard GENERIC. +# This kernel configuration should never appear outside of the HEAD +# of the FreeBSD tree. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include GENERIC + +ident GENERIC-NODEBUG + +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions DEADLKRES + From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 20:29:33 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 850B26E0; Tue, 2 Dec 2014 20:29:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70D4EDFB; Tue, 2 Dec 2014 20:29:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2KTXL1024946; Tue, 2 Dec 2014 20:29:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2KTUtA024932; Tue, 2 Dec 2014 20:29:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201412022029.sB2KTUtA024932@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Tue, 2 Dec 2014 20:29:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275427 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 20:29:33 -0000 Author: tuexen Date: Tue Dec 2 20:29:29 2014 New Revision: 275427 URL: https://svnweb.freebsd.org/changeset/base/275427 Log: Do the renaming of sb_cc to sb_ccc in a way with less code changes by using a macro. This is an alternate approach to https://svnweb.freebsd.org/changeset/base/275326 which is easier to handle upstream. Discussed with: rrs, glebius Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_os_bsd.h head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctp_var.h head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Tue Dec 2 20:28:05 2014 (r275426) +++ head/sys/netinet/sctp_indata.c Tue Dec 2 20:29:29 2014 (r275427) @@ -70,14 +70,14 @@ sctp_calc_rwnd(struct sctp_tcb *stcb, st /* * This is really set wrong with respect to a 1-2-m socket. Since - * the sb_ccc is the count that everyone as put up. When we re-write + * the sb_cc is the count that everyone as put up. When we re-write * sctp_soreceive then we will fix this so that ONLY this * associations data is taken into account. */ if (stcb->sctp_socket == NULL) return (calc); - if (stcb->asoc.sb_ccc == 0 && + if (stcb->asoc.sb_cc == 0 && asoc->size_on_reasm_queue == 0 && asoc->size_on_all_streams == 0) { /* Full rwnd granted */ @@ -1363,7 +1363,7 @@ sctp_process_a_data_chunk(struct sctp_tc * When we have NO room in the rwnd we check to make sure * the reader is doing its job... */ - if (stcb->sctp_socket->so_rcv.sb_ccc) { + if (stcb->sctp_socket->so_rcv.sb_cc) { /* some to read, wake-up */ #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Tue Dec 2 20:28:05 2014 (r275426) +++ head/sys/netinet/sctp_input.c Tue Dec 2 20:29:29 2014 (r275427) @@ -1032,7 +1032,7 @@ sctp_handle_shutdown_ack(struct sctp_shu if (stcb->sctp_socket) { if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - stcb->sctp_socket->so_snd.sb_ccc = 0; + stcb->sctp_socket->so_snd.sb_cc = 0; } sctp_ulp_notify(SCTP_NOTIFY_ASSOC_DOWN, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); } Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Tue Dec 2 20:28:05 2014 (r275426) +++ head/sys/netinet/sctp_os_bsd.h Tue Dec 2 20:29:29 2014 (r275427) @@ -393,13 +393,15 @@ typedef struct callout sctp_os_timer_t; #define SCTP_CLEAR_SO_NBIO(so) ((so)->so_state &= ~SS_NBIO) /* get the socket type */ #define SCTP_SO_TYPE(so) ((so)->so_type) +/* Use a macro for renaming sb_cc to sb_ccc */ +#define sb_cc sb_ccc /* reserve sb space for a socket */ #define SCTP_SORESERVE(so, send, recv) soreserve(so, send, recv) /* wakeup a socket */ #define SCTP_SOWAKEUP(so) wakeup(&(so)->so_timeo) /* clear the socket buffer state */ #define SCTP_SB_CLEAR(sb) \ - (sb).sb_ccc = 0; \ + (sb).sb_cc = 0; \ (sb).sb_mb = NULL; \ (sb).sb_mbcnt = 0; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Tue Dec 2 20:28:05 2014 (r275426) +++ head/sys/netinet/sctp_output.c Tue Dec 2 20:29:29 2014 (r275427) @@ -7250,7 +7250,7 @@ one_more_time: if ((stcb->sctp_socket != NULL) && \ ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { - atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_ccc, sp->length); + atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc, sp->length); } if (sp->data) { sctp_m_freem(sp->data); @@ -11532,7 +11532,7 @@ jump_out: drp->current_onq = htonl(asoc->size_on_reasm_queue + asoc->size_on_all_streams + asoc->my_rwnd_control_len + - stcb->sctp_socket->so_rcv.sb_ccc); + stcb->sctp_socket->so_rcv.sb_cc); } else { /*- * If my rwnd is 0, possibly from mbuf depletion as well as Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Tue Dec 2 20:28:05 2014 (r275426) +++ head/sys/netinet/sctp_pcb.c Tue Dec 2 20:29:29 2014 (r275427) @@ -3397,7 +3397,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, if ((asoc->asoc.size_on_reasm_queue > 0) || (asoc->asoc.control_pdapi) || (asoc->asoc.size_on_all_streams > 0) || - (so && (so->so_rcv.sb_ccc > 0))) { + (so && (so->so_rcv.sb_cc > 0))) { /* Left with Data unread */ struct mbuf *op_err; @@ -3625,7 +3625,7 @@ sctp_inpcb_free(struct sctp_inpcb *inp, TAILQ_REMOVE(&inp->read_queue, sq, next); sctp_free_remote_addr(sq->whoFrom); if (so) - so->so_rcv.sb_ccc -= sq->length; + so->so_rcv.sb_cc -= sq->length; if (sq->data) { sctp_m_freem(sq->data); sq->data = NULL; @@ -4853,7 +4853,7 @@ sctp_free_assoc(struct sctp_inpcb *inp, inp->sctp_flags |= SCTP_PCB_FLAGS_WAS_CONNECTED; if (so) { SOCK_LOCK(so); - if (so->so_rcv.sb_ccc == 0) { + if (so->so_rcv.sb_cc == 0) { so->so_state &= ~(SS_ISCONNECTING | SS_ISDISCONNECTING | SS_ISCONFIRMING | Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Tue Dec 2 20:28:05 2014 (r275426) +++ head/sys/netinet/sctp_pcb.h Tue Dec 2 20:29:29 2014 (r275427) @@ -369,7 +369,7 @@ struct sctp_inpcb { } ip_inp; - /* Socket buffer lock protects read_queue and of course sb_ccc */ + /* Socket buffer lock protects read_queue and of course sb_cc */ struct sctp_readhead read_queue; LIST_ENTRY(sctp_inpcb) sctp_list; /* lists all endpoints */ Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Tue Dec 2 20:28:05 2014 (r275426) +++ head/sys/netinet/sctp_structs.h Tue Dec 2 20:29:29 2014 (r275427) @@ -990,7 +990,7 @@ struct sctp_association { uint32_t total_output_queue_size; - uint32_t sb_ccc; /* shadow of sb_ccc */ + uint32_t sb_cc; /* shadow of sb_cc */ uint32_t sb_send_resv; /* amount reserved on a send */ uint32_t my_rwnd_control_len; /* shadow of sb_mbcnt used for rwnd * control */ Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Tue Dec 2 20:28:05 2014 (r275426) +++ head/sys/netinet/sctp_usrreq.c Tue Dec 2 20:29:29 2014 (r275427) @@ -586,7 +586,7 @@ sctp_must_try_again: if (((flags & SCTP_PCB_FLAGS_SOCKET_GONE) == 0) && (atomic_cmpset_int(&inp->sctp_flags, flags, (flags | SCTP_PCB_FLAGS_SOCKET_GONE | SCTP_PCB_FLAGS_CLOSE_IP)))) { if (((so->so_options & SO_LINGER) && (so->so_linger == 0)) || - (so->so_rcv.sb_ccc > 0)) { + (so->so_rcv.sb_cc > 0)) { #ifdef SCTP_LOG_CLOSING sctp_log_closing(inp, NULL, 13); #endif @@ -751,7 +751,7 @@ sctp_disconnect(struct socket *so) } if (((so->so_options & SO_LINGER) && (so->so_linger == 0)) || - (so->so_rcv.sb_ccc > 0)) { + (so->so_rcv.sb_cc > 0)) { if (SCTP_GET_STATE(asoc) != SCTP_STATE_COOKIE_WAIT) { /* Left with Data unread */ @@ -916,7 +916,7 @@ sctp_flush(struct socket *so, int how) inp->sctp_flags |= SCTP_PCB_FLAGS_SOCKET_CANT_READ; SCTP_INP_READ_UNLOCK(inp); SCTP_INP_WUNLOCK(inp); - so->so_rcv.sb_ccc = 0; + so->so_rcv.sb_cc = 0; so->so_rcv.sb_mbcnt = 0; so->so_rcv.sb_mb = NULL; } @@ -925,7 +925,7 @@ sctp_flush(struct socket *so, int how) * First make sure the sb will be happy, we don't use these * except maybe the count */ - so->so_snd.sb_ccc = 0; + so->so_snd.sb_cc = 0; so->so_snd.sb_mbcnt = 0; so->so_snd.sb_mb = NULL; Modified: head/sys/netinet/sctp_var.h ============================================================================== --- head/sys/netinet/sctp_var.h Tue Dec 2 20:28:05 2014 (r275426) +++ head/sys/netinet/sctp_var.h Tue Dec 2 20:29:29 2014 (r275427) @@ -82,9 +82,9 @@ extern struct pr_usrreqs sctp_usrreqs; #define sctp_maxspace(sb) (max((sb)->sb_hiwat,SCTP_MINIMAL_RWND)) -#define sctp_sbspace(asoc, sb) ((long) ((sctp_maxspace(sb) > (asoc)->sb_ccc) ? (sctp_maxspace(sb) - (asoc)->sb_ccc) : 0)) +#define sctp_sbspace(asoc, sb) ((long) ((sctp_maxspace(sb) > (asoc)->sb_cc) ? (sctp_maxspace(sb) - (asoc)->sb_cc) : 0)) -#define sctp_sbspace_failedmsgs(sb) ((long) ((sctp_maxspace(sb) > (sb)->sb_ccc) ? (sctp_maxspace(sb) - (sb)->sb_ccc) : 0)) +#define sctp_sbspace_failedmsgs(sb) ((long) ((sctp_maxspace(sb) > (sb)->sb_cc) ? (sctp_maxspace(sb) - (sb)->sb_cc) : 0)) #define sctp_sbspace_sub(a,b) ((a > b) ? (a - b) : 0) @@ -195,10 +195,10 @@ extern struct pr_usrreqs sctp_usrreqs; } #define sctp_sbfree(ctl, stcb, sb, m) { \ - SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_ccc, SCTP_BUF_LEN((m))); \ + SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_cc, SCTP_BUF_LEN((m))); \ SCTP_SAVE_ATOMIC_DECREMENT(&(sb)->sb_mbcnt, MSIZE); \ if (((ctl)->do_not_ref_stcb == 0) && stcb) {\ - SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.sb_ccc, SCTP_BUF_LEN((m))); \ + SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.sb_cc, SCTP_BUF_LEN((m))); \ SCTP_SAVE_ATOMIC_DECREMENT(&(stcb)->asoc.my_rwnd_control_len, MSIZE); \ } \ if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \ @@ -207,10 +207,10 @@ extern struct pr_usrreqs sctp_usrreqs; } #define sctp_sballoc(stcb, sb, m) { \ - atomic_add_int(&(sb)->sb_ccc,SCTP_BUF_LEN((m))); \ + atomic_add_int(&(sb)->sb_cc,SCTP_BUF_LEN((m))); \ atomic_add_int(&(sb)->sb_mbcnt, MSIZE); \ if (stcb) { \ - atomic_add_int(&(stcb)->asoc.sb_ccc,SCTP_BUF_LEN((m))); \ + atomic_add_int(&(stcb)->asoc.sb_cc,SCTP_BUF_LEN((m))); \ atomic_add_int(&(stcb)->asoc.my_rwnd_control_len, MSIZE); \ } \ if (SCTP_BUF_TYPE(m) != MT_DATA && SCTP_BUF_TYPE(m) != MT_HEADER && \ Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Tue Dec 2 20:28:05 2014 (r275426) +++ head/sys/netinet/sctputil.c Tue Dec 2 20:29:29 2014 (r275427) @@ -67,9 +67,9 @@ sctp_sblog(struct sockbuf *sb, struct sc struct sctp_cwnd_log sctp_clog; sctp_clog.x.sb.stcb = stcb; - sctp_clog.x.sb.so_sbcc = sb->sb_ccc; + sctp_clog.x.sb.so_sbcc = sb->sb_cc; if (stcb) - sctp_clog.x.sb.stcb_sbcc = stcb->asoc.sb_ccc; + sctp_clog.x.sb.stcb_sbcc = stcb->asoc.sb_cc; else sctp_clog.x.sb.stcb_sbcc = 0; sctp_clog.x.sb.incr = incr; @@ -4363,7 +4363,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp { /* * Here we must place the control on the end of the socket read - * queue AND increment sb_ccc so that select will work properly on + * queue AND increment sb_cc so that select will work properly on * read. */ struct mbuf *m, *prev = NULL; @@ -4489,7 +4489,7 @@ sctp_append_to_readq(struct sctp_inpcb * * the reassembly queue. * * If PDAPI this means we need to add m to the end of the data. - * Increase the length in the control AND increment the sb_ccc. + * Increase the length in the control AND increment the sb_cc. * Otherwise sb is NULL and all we need to do is put it at the end * of the mbuf chain. */ @@ -4701,10 +4701,10 @@ sctp_free_bufspace(struct sctp_tcb *stcb if (stcb->sctp_socket && (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) || ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE)))) { - if (stcb->sctp_socket->so_snd.sb_ccc >= tp1->book_size) { - stcb->sctp_socket->so_snd.sb_ccc -= tp1->book_size; + if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { + stcb->sctp_socket->so_snd.sb_cc -= tp1->book_size; } else { - stcb->sctp_socket->so_snd.sb_ccc = 0; + stcb->sctp_socket->so_snd.sb_cc = 0; } } @@ -5254,11 +5254,11 @@ sctp_sorecvmsg(struct socket *so, in_eeor_mode = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_EXPLICIT_EOR); if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RECV_RWND_LOGGING_ENABLE) { sctp_misc_ints(SCTP_SORECV_ENTER, - rwnd_req, in_eeor_mode, so->so_rcv.sb_ccc, uio->uio_resid); + rwnd_req, in_eeor_mode, so->so_rcv.sb_cc, uio->uio_resid); } if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_RECV_RWND_LOGGING_ENABLE) { sctp_misc_ints(SCTP_SORECV_ENTERPL, - rwnd_req, block_allowed, so->so_rcv.sb_ccc, uio->uio_resid); + rwnd_req, block_allowed, so->so_rcv.sb_cc, uio->uio_resid); } error = sblock(&so->so_rcv, (block_allowed ? SBL_WAIT : 0)); if (error) { @@ -5277,23 +5277,23 @@ restart_nosblocks: (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_ALLGONE)) { goto out; } - if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && (so->so_rcv.sb_ccc == 0)) { + if ((so->so_rcv.sb_state & SBS_CANTRCVMORE) && (so->so_rcv.sb_cc == 0)) { if (so->so_error) { error = so->so_error; if ((in_flags & MSG_PEEK) == 0) so->so_error = 0; goto out; } else { - if (so->so_rcv.sb_ccc == 0) { + if (so->so_rcv.sb_cc == 0) { /* indicate EOF */ error = 0; goto out; } } } - if ((so->so_rcv.sb_ccc <= held_length) && block_allowed) { + if ((so->so_rcv.sb_cc <= held_length) && block_allowed) { /* we need to wait for data */ - if ((so->so_rcv.sb_ccc == 0) && + if ((so->so_rcv.sb_cc == 0) && ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { if ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0) { @@ -5329,7 +5329,7 @@ restart_nosblocks: } held_length = 0; goto restart_nosblocks; - } else if (so->so_rcv.sb_ccc == 0) { + } else if (so->so_rcv.sb_cc == 0) { if (so->so_error) { error = so->so_error; if ((in_flags & MSG_PEEK) == 0) @@ -5386,11 +5386,11 @@ restart_nosblocks: SCTP_INP_READ_LOCK(inp); } control = TAILQ_FIRST(&inp->read_queue); - if ((control == NULL) && (so->so_rcv.sb_ccc != 0)) { + if ((control == NULL) && (so->so_rcv.sb_cc != 0)) { #ifdef INVARIANTS panic("Huh, its non zero and nothing on control?"); #endif - so->so_rcv.sb_ccc = 0; + so->so_rcv.sb_cc = 0; } SCTP_INP_READ_UNLOCK(inp); hold_rlock = 0; @@ -5511,11 +5511,11 @@ restart_nosblocks: } /* * if we reach here, not suitable replacement is available - * fragment interleave is NOT on. So stuff the sb_ccc + * fragment interleave is NOT on. So stuff the sb_cc * into the our held count, and its time to sleep again. */ - held_length = so->so_rcv.sb_ccc; - control->held_length = so->so_rcv.sb_ccc; + held_length = so->so_rcv.sb_cc; + control->held_length = so->so_rcv.sb_cc; goto restart; } /* Clear the held length since there is something to read */ @@ -5812,10 +5812,10 @@ get_more_data: if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_SB_LOGGING_ENABLE) { sctp_sblog(&so->so_rcv, control->do_not_ref_stcb ? NULL : stcb, SCTP_LOG_SBFREE, cp_len); } - atomic_subtract_int(&so->so_rcv.sb_ccc, cp_len); + atomic_subtract_int(&so->so_rcv.sb_cc, cp_len); if ((control->do_not_ref_stcb == 0) && stcb) { - atomic_subtract_int(&stcb->asoc.sb_ccc, cp_len); + atomic_subtract_int(&stcb->asoc.sb_cc, cp_len); } copied_so_far += cp_len; freed_so_far += cp_len; @@ -5960,7 +5960,7 @@ wait_some_more: (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_FRAG_INTERLEAVE))) { goto release; } - if (so->so_rcv.sb_ccc <= control->held_length) { + if (so->so_rcv.sb_cc <= control->held_length) { error = sbwait(&so->so_rcv); if (error) { goto release; @@ -5987,8 +5987,8 @@ wait_some_more: } goto done_with_control; } - if (so->so_rcv.sb_ccc > held_length) { - control->held_length = so->so_rcv.sb_ccc; + if (so->so_rcv.sb_cc > held_length) { + control->held_length = so->so_rcv.sb_cc; held_length = 0; } goto wait_some_more; @@ -6135,13 +6135,13 @@ out: freed_so_far, ((uio) ? (slen - uio->uio_resid) : slen), stcb->asoc.my_rwnd, - so->so_rcv.sb_ccc); + so->so_rcv.sb_cc); } else { sctp_misc_ints(SCTP_SORECV_DONE, freed_so_far, ((uio) ? (slen - uio->uio_resid) : slen), 0, - so->so_rcv.sb_ccc); + so->so_rcv.sb_cc); } } stage_left: Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Tue Dec 2 20:28:05 2014 (r275426) +++ head/sys/netinet/sctputil.h Tue Dec 2 20:29:29 2014 (r275427) @@ -286,10 +286,10 @@ do { \ } \ if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ - if (stcb->sctp_socket->so_snd.sb_ccc >= tp1->book_size) { \ - atomic_subtract_int(&((stcb)->sctp_socket->so_snd.sb_ccc), tp1->book_size); \ + if (stcb->sctp_socket->so_snd.sb_cc >= tp1->book_size) { \ + atomic_subtract_int(&((stcb)->sctp_socket->so_snd.sb_cc), tp1->book_size); \ } else { \ - stcb->sctp_socket->so_snd.sb_ccc = 0; \ + stcb->sctp_socket->so_snd.sb_cc = 0; \ } \ } \ } \ @@ -307,10 +307,10 @@ do { \ } \ if (stcb->sctp_socket && ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ - if (stcb->sctp_socket->so_snd.sb_ccc >= sp->length) { \ - atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_ccc,sp->length); \ + if (stcb->sctp_socket->so_snd.sb_cc >= sp->length) { \ + atomic_subtract_int(&stcb->sctp_socket->so_snd.sb_cc,sp->length); \ } else { \ - stcb->sctp_socket->so_snd.sb_ccc = 0; \ + stcb->sctp_socket->so_snd.sb_cc = 0; \ } \ } \ } \ @@ -322,7 +322,7 @@ do { \ if ((stcb->sctp_socket != NULL) && \ ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || \ (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { \ - atomic_add_int(&stcb->sctp_socket->so_snd.sb_ccc,sz); \ + atomic_add_int(&stcb->sctp_socket->so_snd.sb_cc,sz); \ } \ } while (0) From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 22:35:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ABA9E42A; Tue, 2 Dec 2014 22:35:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EC1FE71; Tue, 2 Dec 2014 22:35:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2MZisW086312; Tue, 2 Dec 2014 22:35:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2MZihq086311; Tue, 2 Dec 2014 22:35:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412022235.sB2MZihq086311@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 2 Dec 2014 22:35:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275430 - head/contrib/elftoolchain/libelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 22:35:44 -0000 Author: emaste Date: Tue Dec 2 22:35:43 2014 New Revision: 275430 URL: https://svnweb.freebsd.org/changeset/base/275430 Log: libelf: Fix cross-endian ELF note file / memory conversion The namesz and descsz variables need to be used in native endianness. The sizes are in native order after swapping in the file to memory case, and before swapping in the memory to file case. This issue was identified for r273443, but the change was applied to the wrong case. Revert r273443 to fix the to-memory case, and apply the equivalent change to the to-file case. Sponsored by: DARPA, AFRL Reviewed by: adrian, brooks, marcel Differential Revision: https://reviews.freebsd.org/D1257 Modified: head/contrib/elftoolchain/libelf/libelf_convert.m4 Modified: head/contrib/elftoolchain/libelf/libelf_convert.m4 ============================================================================== --- head/contrib/elftoolchain/libelf/libelf_convert.m4 Tue Dec 2 22:04:27 2014 (r275429) +++ head/contrib/elftoolchain/libelf/libelf_convert.m4 Tue Dec 2 22:35:43 2014 (r275430) @@ -947,11 +947,6 @@ _libelf_cvt_NOTE_tom(char *dst, size_t d READ_WORD(src, descsz); READ_WORD(src, type); - sz = namesz; - ROUNDUP2(sz, 4); - sz += descsz; - ROUNDUP2(sz, 4); - /* Translate. */ SWAP_WORD(namesz); SWAP_WORD(descsz); @@ -967,6 +962,11 @@ _libelf_cvt_NOTE_tom(char *dst, size_t d dst += sizeof(Elf_Note); count -= hdrsz; + ROUNDUP2(namesz, 4); + ROUNDUP2(descsz, 4); + + sz = namesz + descsz; + if (count < sz || dsz < sz) /* Buffers are too small. */ return (0); @@ -1005,6 +1005,11 @@ _libelf_cvt_NOTE_tof(char *dst, size_t d descsz = en->n_descsz; type = en->n_type; + sz = namesz; + ROUNDUP2(sz, 4); + sz += descsz; + ROUNDUP2(sz, 4); + SWAP_WORD(namesz); SWAP_WORD(descsz); SWAP_WORD(type); @@ -1015,11 +1020,6 @@ _libelf_cvt_NOTE_tof(char *dst, size_t d src += sizeof(Elf_Note); - ROUNDUP2(namesz, 4); - ROUNDUP2(descsz, 4); - - sz = namesz + descsz; - if (count < sz) sz = count; From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 22:52:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6812B32; Tue, 2 Dec 2014 22:52:38 +0000 (UTC) Received: from mail-wg0-x22c.google.com (mail-wg0-x22c.google.com [IPv6:2a00:1450:400c:c00::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66FF69B; Tue, 2 Dec 2014 22:52:38 +0000 (UTC) Received: by mail-wg0-f44.google.com with SMTP id b13so18512477wgh.31 for ; Tue, 02 Dec 2014 14:52:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=O71lnS5pJrOzl5QZSdMRTUDQWAj4YMuAnWojctXxX6I=; b=v2jj8menxRFNL+HLjSTb+wyI6SGCENF7D3P/j9bPG90ue8Wah3WXI3Zuoyz+9fYky5 PlfS4sUwO3NIqK4KLHDEGGVha9kvhgsA49i7+lp1B4UtCjgCh+9KZTvR7fHMoykIXbvD MI01GuKT4fXhjMK5kwjio1AKLd6ZK9BU1ab5OqvRJGKF4mBv/n+3MDHrWceDPDJk4GHU F8FJ4ylP6qQVxTu7+r96e44Tq4Fi/gNqdUXAERwxlfrlwYlf/7DVgqdF3lfN6+ZOaXqE /DQzE4alSQRBEWpDRU6xyFIpxZVGtZrrT4GKtMw+D0VD93HSMDigbY0RBoYreZLmXzzk VSsg== X-Received: by 10.194.20.98 with SMTP id m2mr2472421wje.52.1417560756643; Tue, 02 Dec 2014 14:52:36 -0800 (PST) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by mx.google.com with ESMTPSA id a2sm34604387wiy.11.2014.12.02.14.52.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Dec 2014 14:52:35 -0800 (PST) Sender: Baptiste Daroussin Date: Tue, 2 Dec 2014 23:52:33 +0100 From: Baptiste Daroussin To: Dmitry Morozovsky Subject: Re: svn commit: r275385 - head/contrib/subversion/subversion/svn Message-ID: <20141202225233.GD50189@ivaldir.etoilebsd.net> References: <201412020023.sB20NQqJ053333@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Hf61M2y+wYpnELGG" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 22:52:38 -0000 --Hf61M2y+wYpnELGG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 02, 2014 at 03:39:04PM +0300, Dmitry Morozovsky wrote: > On Tue, 2 Dec 2014, Baptiste Daroussin wrote: >=20 > > Author: bapt > > Date: Tue Dec 2 00:23:26 2014 > > New Revision: 275385 > > URL: https://svnweb.freebsd.org/changeset/base/275385 > >=20 > > Log: > > Sync the svn template with the one from ports >=20 > Possibly dumb question: >=20 > I we patch this file anyway, could we possibly extract template to extern= al=20 > file? >=20 > and, finally, convince this to upstream? >=20 Yes you are right, someone should talk to upstream to simplify our life :) Best regards, Bapt --Hf61M2y+wYpnELGG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEABECAAYFAlR+Qq8ACgkQ8kTtMUmk6EzzyQCeOcZJw1iAV20ImdTqOaYuV6/3 P2wAn1qEwaCe4W4STidJLrgdSSahQUg0 =Lohb -----END PGP SIGNATURE----- --Hf61M2y+wYpnELGG-- From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 23:02:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CF6DE08; Tue, 2 Dec 2014 23:02:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79BA5183; Tue, 2 Dec 2014 23:02:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2N2wKO002619; Tue, 2 Dec 2014 23:02:58 GMT (envelope-from jfv@FreeBSD.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2N2w9V002617; Tue, 2 Dec 2014 23:02:58 GMT (envelope-from jfv@FreeBSD.org) Message-Id: <201412022302.sB2N2w9V002617@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jfv set sender to jfv@FreeBSD.org using -f From: Jack F Vogel Date: Tue, 2 Dec 2014 23:02:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275431 - in head/sys/dev: e1000 ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 23:02:58 -0000 Author: jfv Date: Tue Dec 2 23:02:57 2014 New Revision: 275431 URL: https://svnweb.freebsd.org/changeset/base/275431 Log: Revert r275136, it was not approved, it was sloppy, if a feature like this is needed please resubmit for Intel's approval. Modified: head/sys/dev/e1000/if_igb.c head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/e1000/if_igb.c ============================================================================== --- head/sys/dev/e1000/if_igb.c Tue Dec 2 22:35:43 2014 (r275430) +++ head/sys/dev/e1000/if_igb.c Tue Dec 2 23:02:57 2014 (r275431) @@ -188,7 +188,6 @@ static char *igb_strings[] = { /********************************************************************* * Function prototypes *********************************************************************/ -static int igb_per_unit_num_queues(SYSCTL_HANDLER_ARGS); static int igb_probe(device_t); static int igb_attach(device_t); static int igb_detach(device_t); @@ -494,11 +493,6 @@ igb_attach(device_t dev) OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, igb_sysctl_nvm_info, "I", "NVM Information"); - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "num_queues", CTLTYPE_INT | CTLFLAG_RD, - adapter, 0, igb_per_unit_num_queues, "I", "Number of Queues"); - igb_set_sysctl_value(adapter, "enable_aim", "Interrupt Moderation", &adapter->enable_aim, igb_enable_aim); @@ -2837,7 +2831,6 @@ igb_setup_msix(struct adapter *adapter) { device_t dev = adapter->dev; int bar, want, queues, msgs, maxqueues; - int n_queues; /* tuneable override */ if (igb_enable_msix == 0) @@ -2865,18 +2858,11 @@ igb_setup_msix(struct adapter *adapter) goto msi; } - n_queues = 0; - /* try more specific tunable, then global, then finally default to boot time tunable if set. */ - if (device_getenv_int(dev, "num_queues", &n_queues) != 0) { - device_printf(dev, "using specific tunable num_queues=%d", n_queues); - } else if (TUNABLE_INT_FETCH("hw.igb.num_queues", &n_queues) != 0) { - if (igb_num_queues != n_queues) { - device_printf(dev, "using global tunable hw.igb.num_queues=%d", n_queues); - igb_num_queues = n_queues; - } - } else { - n_queues = igb_num_queues; - } + queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; + + /* Override via tuneable */ + if (igb_num_queues != 0) + queues = igb_num_queues; #ifdef RSS /* If we're doing RSS, clamp at the number of RSS buckets */ @@ -2884,12 +2870,6 @@ igb_setup_msix(struct adapter *adapter) queues = rss_getnumbuckets(); #endif - if (n_queues != 0) { - queues = n_queues; - } else { - /* Figure out a reasonable auto config value */ - queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; - } /* Sanity check based on HW */ switch (adapter->hw.mac.type) { @@ -2912,17 +2892,10 @@ igb_setup_msix(struct adapter *adapter) maxqueues = 1; break; } - if (queues > maxqueues) { - device_printf(adapter->dev, "requested %d queues, but max for this adapter is %d\n", - queues, maxqueues); + + /* Final clamp on the actual hardware capability */ + if (queues > maxqueues) queues = maxqueues; - } else if (queues == 0) { - queues = 1; - } else if (queues < 0) { - device_printf(adapter->dev, "requested %d queues, but min for this adapter is %d\n", - queues, 1); - queues = 1; - } /* ** One vector (RX/TX pair) per queue @@ -6407,14 +6380,3 @@ igb_sysctl_eee(SYSCTL_HANDLER_ARGS) IGB_CORE_UNLOCK(adapter); return (0); } - -static int -igb_per_unit_num_queues(SYSCTL_HANDLER_ARGS) -{ - struct adapter *adapter; - - adapter = (struct adapter *) arg1; - - return sysctl_handle_int(oidp, &adapter->num_queues, 0, req); -} - Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Tue Dec 2 22:35:43 2014 (r275430) +++ head/sys/dev/ixgbe/ixgbe.c Tue Dec 2 23:02:57 2014 (r275431) @@ -103,7 +103,6 @@ static char *ixgbe_strings[] = { /********************************************************************* * Function prototypes *********************************************************************/ -static int ixgbe_per_unit_num_queues(SYSCTL_HANDLER_ARGS); static int ixgbe_probe(device_t); static int ixgbe_attach(device_t); static int ixgbe_detach(device_t); @@ -476,11 +475,6 @@ ixgbe_attach(device_t dev) SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "num_queues", CTLTYPE_INT | CTLFLAG_RD, - adapter, 0, ixgbe_per_unit_num_queues, "I", "Number of Queues"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "ts", CTLTYPE_INT | CTLFLAG_RW, adapter, 0, ixgbe_set_thermal_test, "I", "Thermal Test"); @@ -2522,7 +2516,6 @@ ixgbe_setup_msix(struct adapter *adapter { device_t dev = adapter->dev; int rid, want, queues, msgs; - int n_queues; /* Override by tuneable */ if (ixgbe_enable_msix == 0) @@ -2549,34 +2542,19 @@ ixgbe_setup_msix(struct adapter *adapter /* Figure out a reasonable auto config value */ queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; + + /* Override based on tuneable */ + if (ixgbe_num_queues != 0) + queues = ixgbe_num_queues; + #ifdef RSS /* If we're doing RSS, clamp at the number of RSS buckets */ if (queues > rss_getnumbuckets()) queues = rss_getnumbuckets(); #endif - /* try more specific tunable, then global, then finally default to boot time tunable if set. */ - if (device_getenv_int(dev, "num_queues", &n_queues) != 0) { - device_printf(dev, "using specific tunable numqueues=%d", n_queues); - } else if (TUNABLE_INT_FETCH("hw.ix.num_queues", &n_queues) != 0) { - if (ixgbe_num_queues != n_queues) { - device_printf(dev, "using global tunable num_queues=%d", n_queues); - ixgbe_num_queues = n_queues; - } - } else { - n_queues = ixgbe_num_queues; - } - - if (n_queues < 0) { - device_printf(dev, "tunable < 0, resetting to default"); - n_queues = 0; - } - - if (n_queues != 0) - queues = n_queues; - /* Set max queues to 8 when autoconfiguring */ - else if ((ixgbe_num_queues == 0) && (queues > 8)) - queues = 8; + /* reflect correct sysctl value */ + ixgbe_num_queues = queues; /* ** Want one vector (RX/TX pair) per queue @@ -5964,15 +5942,6 @@ ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) return error; } -static int -ixgbe_per_unit_num_queues(SYSCTL_HANDLER_ARGS) -{ - struct adapter *adapter; - - adapter = (struct adapter *) arg1; - - return sysctl_handle_int(oidp, &adapter->num_queues, 0, req); -} /* ** Control link advertise speed: From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 23:25:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C89A47B; Tue, 2 Dec 2014 23:25:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 363213E0; Tue, 2 Dec 2014 23:25:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2NP0qr012462; Tue, 2 Dec 2014 23:25:00 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2NOwDT012431; Tue, 2 Dec 2014 23:24:58 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201412022324.sB2NOwDT012431@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 2 Dec 2014 23:24:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275432 - in head: . contrib/mdocml lib/libmandoc usr.bin usr.bin/man usr.bin/mandoc usr.bin/preconv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 23:25:00 -0000 Author: bapt Date: Tue Dec 2 23:24:57 2014 New Revision: 275432 URL: https://svnweb.freebsd.org/changeset/base/275432 Log: Update to mandoc cvs version as of 20141201 - Compatiblity with existing manpages has been improved - Now support ".so" directive with compressed manpages (which fixes a regression we have since we have new man(1)) Added: head/contrib/mdocml/compat_fts.c - copied unchanged from r275431, vendor/mdocml/dist/compat_fts.c head/contrib/mdocml/compat_fts.h - copied unchanged from r275431, vendor/mdocml/dist/compat_fts.h head/contrib/mdocml/configure.local.example - copied unchanged from r275431, vendor/mdocml/dist/configure.local.example head/contrib/mdocml/man.1 - copied unchanged from r275431, vendor/mdocml/dist/man.1 head/contrib/mdocml/test-dirent-namlen.c - copied unchanged from r275431, vendor/mdocml/dist/test-dirent-namlen.c head/contrib/mdocml/test-fts.c - copied unchanged from r275431, vendor/mdocml/dist/test-fts.c head/contrib/mdocml/test-sqlite3.c - copied unchanged from r275431, vendor/mdocml/dist/test-sqlite3.c head/contrib/mdocml/test-wchar.c - copied unchanged from r275431, vendor/mdocml/dist/test-wchar.c Deleted: head/contrib/mdocml/apropos.c head/contrib/mdocml/arch.c head/contrib/mdocml/arch.in head/contrib/mdocml/att.in head/contrib/mdocml/config.h.post head/contrib/mdocml/config.h.pre head/contrib/mdocml/preconv.1 head/contrib/mdocml/vol.c head/contrib/mdocml/vol.in head/usr.bin/preconv/ Modified: head/ObsoleteFiles.inc head/contrib/mdocml/INSTALL head/contrib/mdocml/LICENSE head/contrib/mdocml/Makefile head/contrib/mdocml/Makefile.depend head/contrib/mdocml/NEWS head/contrib/mdocml/TODO head/contrib/mdocml/apropos.1 head/contrib/mdocml/att.c head/contrib/mdocml/cgi.c head/contrib/mdocml/chars.c head/contrib/mdocml/chars.in head/contrib/mdocml/compat_fgetln.c head/contrib/mdocml/compat_getsubopt.c head/contrib/mdocml/compat_ohash.c head/contrib/mdocml/compat_reallocarray.c head/contrib/mdocml/compat_sqlite3_errstr.c head/contrib/mdocml/compat_strcasestr.c head/contrib/mdocml/compat_strlcat.c head/contrib/mdocml/compat_strlcpy.c head/contrib/mdocml/compat_strsep.c head/contrib/mdocml/config.h head/contrib/mdocml/configure head/contrib/mdocml/demandoc.1 head/contrib/mdocml/demandoc.c head/contrib/mdocml/eqn.7 head/contrib/mdocml/eqn.c head/contrib/mdocml/eqn_html.c head/contrib/mdocml/eqn_term.c head/contrib/mdocml/example.style.css head/contrib/mdocml/html.c head/contrib/mdocml/html.h head/contrib/mdocml/lib.c head/contrib/mdocml/libman.h head/contrib/mdocml/libmandoc.h head/contrib/mdocml/libmdoc.h head/contrib/mdocml/libroff.h head/contrib/mdocml/main.c head/contrib/mdocml/main.h head/contrib/mdocml/makewhatis.8 head/contrib/mdocml/man.c head/contrib/mdocml/man.cgi.8 head/contrib/mdocml/man.h head/contrib/mdocml/man_hash.c head/contrib/mdocml/man_html.c head/contrib/mdocml/man_macro.c head/contrib/mdocml/man_term.c head/contrib/mdocml/man_validate.c head/contrib/mdocml/mandoc.1 head/contrib/mdocml/mandoc.3 head/contrib/mdocml/mandoc.c head/contrib/mdocml/mandoc.db.5 head/contrib/mdocml/mandoc.h head/contrib/mdocml/mandoc_aux.c head/contrib/mdocml/mandoc_escape.3 head/contrib/mdocml/mandocdb.c head/contrib/mdocml/manpage.c head/contrib/mdocml/manpath.c head/contrib/mdocml/mansearch.c head/contrib/mdocml/mansearch.h head/contrib/mdocml/mansearch_const.c head/contrib/mdocml/mchars_alloc.3 head/contrib/mdocml/mdoc.7 head/contrib/mdocml/mdoc.c head/contrib/mdocml/mdoc_argv.c head/contrib/mdocml/mdoc_hash.c head/contrib/mdocml/mdoc_html.c head/contrib/mdocml/mdoc_macro.c head/contrib/mdocml/mdoc_man.c head/contrib/mdocml/mdoc_term.c head/contrib/mdocml/mdoc_validate.c head/contrib/mdocml/msec.c head/contrib/mdocml/out.c head/contrib/mdocml/out.h head/contrib/mdocml/preconv.c head/contrib/mdocml/read.c head/contrib/mdocml/roff.7 head/contrib/mdocml/roff.c head/contrib/mdocml/st.c head/contrib/mdocml/st.in head/contrib/mdocml/style.css head/contrib/mdocml/tbl.7 head/contrib/mdocml/tbl.c head/contrib/mdocml/tbl_data.c head/contrib/mdocml/tbl_html.c head/contrib/mdocml/tbl_layout.c head/contrib/mdocml/tbl_opts.c head/contrib/mdocml/tbl_term.c head/contrib/mdocml/term.c head/contrib/mdocml/term.h head/contrib/mdocml/term_ascii.c head/contrib/mdocml/term_ps.c head/contrib/mdocml/test-getsubopt.c head/contrib/mdocml/tree.c head/lib/libmandoc/Makefile head/usr.bin/Makefile head/usr.bin/man/man.sh head/usr.bin/mandoc/Makefile Directory Properties: head/contrib/mdocml/ (props changed) Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Tue Dec 2 23:02:57 2014 (r275431) +++ head/ObsoleteFiles.inc Tue Dec 2 23:24:57 2014 (r275432) @@ -38,6 +38,9 @@ # xargs -n1 | sort | uniq -d; # done +# 20141202: update to mandoc CVS 20141201 +OLD_FILES+=usr.bin/preconv +OLD_FILES+=share/man/man1/preconv.1.gz # 20141129: mrouted rc.d scripts removed from base OLD_FILES+=etc/rc.d/mrouted # 20141126: convert sbin/mdconfig/tests to ATF format tests Modified: head/contrib/mdocml/INSTALL ============================================================================== --- head/contrib/mdocml/INSTALL Tue Dec 2 23:02:57 2014 (r275431) +++ head/contrib/mdocml/INSTALL Tue Dec 2 23:24:57 2014 (r275432) @@ -1,4 +1,4 @@ -$Id: INSTALL,v 1.2 2014/08/10 17:22:26 schwarze Exp $ +$Id: INSTALL,v 1.5 2014/08/18 13:27:47 kristaps Exp $ About mdocml, the portable mandoc distribution ---------------------------------------------- @@ -34,19 +34,52 @@ latest bundled and ported versions of ma systems is maintained at . If mandoc is installed, you can check the version by running "mandoc -V". -The version contained in this distribution tarball is listed near -the beginning of the file "Makefile". +You can find the version contained in this distribution tarball +by running "./configure". Regarding how packages and ports are maintained for your operating system, please consult your operating system documentation. To install mandoc manually, the following steps are needed: -1. Decide whether you want to build the base tools mandoc(1), -preconv(1) and demandoc(1) only or whether you also want to build the -database tools apropos(1) and makewhatis(8). For the latter, -the following dependencies are required: +1. If you want to build the CGI program, man.cgi(8), too, run the +command "echo BUILD_CGI=1 > configure.local". Then run "cp +cgi.h.examples cgi.h" and edit cgi.h as desired. + +2. Run "./configure". +This script attempts autoconfiguration of mandoc for your system. +Read both its standard output and the file "Makefile.local" it +generates. If anything looks wrong or different from what you +wish, read the file "configure.local.example", create and edit +a file "configure.local", and re-run "./configure" until the +result seems right to you. + +3. Run "make". +Any POSIX-compatible make, in particular both BSD make and GNU make, +should work. If the build fails, look at "configure.local.example" +and go back to step 2. + +4. Run "make -n install" and check whether everything will be +installed to the intended places. Otherwise, put some *DIR variables +into "configure.local" and go back to step2. -1.1. The SQLite database system, see . +5. Run "sudo make install". If you intend to build a binary +package using some kind of fake root mechanism, you may need a +command like "make DESTDIR=... install". Read the *-install targets +in the "Makefile" to understand how DESTDIR is used. + +6. To set up a man.cgi(8) server, read its manual page. + +7. To use mandoc(1) as your man(1) formatter, read the "Deployment" +section below. + + +Understanding mandoc dependencies +--------------------------------- +The mandoc(1), preconv(1), and demandoc(1) utilities have no external +dependencies. However, makewhatis(8) and apropos(1) depend on the +following software: + +1. The SQLite database system, see . The recommended version of SQLite is 3.8.4.3 or newer. The mandoc toolset is known to work with version 3.7.5 or newer. Versions older than 3.8.3 may not achieve full performance due to the @@ -57,47 +90,16 @@ problems, apropos(1) is fully usable wit older than 3.7.5 may or may not work, they have not been tested. 1.2. The fts(3) directory traversion functions. -A compatibility version will be bundled for 1.13.2 but is not available -yet. If you want apropos(1) and makewhatis(8) but do not have fts(3), -please stay with mandoc 1.12.3 for now and upgrade first to 1.12.4, -then to 1.13.2 when these versionns are released. Be careful: the +If your system does not have them, the bundled compatibility version +will be used, so you need not worry in that case. But be careful: the glibc version of fts(3) is known to be broken on 32bit platforms, see . +If you run into that problem, set "HAVE_FTS=0" in configure.local. 1.3. Marc Espie's ohash(3) library. If your system does not have it, the bundled compatibility version will be used, so you probably need not worry about it. -2. If you choose to build the database tools, too, decide whether -you also want to build the CGI program, man.cgi(8). - -3. Read the beginning of the file "Makefile" from "USER SETTINGS" -to "END OF USER SETTINGS" and edit it as required. In particular, -disable "BUILD_TARGETS += db-build" if you do not want database -support or enable "BUILD_TARGETS += cgi-build" if you do want -the CGI program. - -4. Run "make". No separate "./configure" or "make depend" steps -are needed. The former is run automatically by "make". The latter -is a maintainer target. If you merely want to build the released -version as opposed to doing active development, there is no need -to regenerate the dependency specifications. Any POSIX-compatible -make, in particular both BSD make and GNU make, should work. - -5. Run "make -n install" and check whether everything will be -installed to the intended places. Otherwise, edit the *DIR variables -in the Makefile until it is. - -6. Run "sudo make install". If you intend to build a binary -package using some kind of fake root mechanism, you may need a -command like "make DESTDIR=... install". Read the *-install targets -in the "Makefile" to understand how DESTDIR is used. - -7. To set up a man.cgi(8) server, read its manual page. - -8. To use mandoc(1) as your man(1) formatter, read the "Deployment" -section below. - Checking autoconfiguration quality ---------------------------------- @@ -130,9 +132,9 @@ please report whatever is missing on you The following steps can be used to manually check the automatic configuration on your platform: -1. Run "make clean". +1. Run "make distclean". -2. Run "make config.h" +2. Run "./configure" 3. Read the file "config.log". It shows the compiler commands used to test the libraries installed on your system and the standard @@ -140,8 +142,7 @@ output and standard error output these c for unexpected failures. Those are most likely to happen if headers or libraries are installed in unusual places or interfaces defined in unusual headers. You can also look at the file "config.h" and -check that no expected "#define HAVE_*" lines are missing. The -list of tests run can be found in the file "configure". +check that no "#define HAVE_*" differ from your expectations. Deployment Modified: head/contrib/mdocml/LICENSE ============================================================================== --- head/contrib/mdocml/LICENSE Tue Dec 2 23:02:57 2014 (r275431) +++ head/contrib/mdocml/LICENSE Tue Dec 2 23:24:57 2014 (r275432) @@ -1,4 +1,4 @@ -$Id: LICENSE,v 1.2 2014/04/23 21:06:41 schwarze Exp $ +$Id: LICENSE,v 1.4 2014/08/21 00:42:38 schwarze Exp $ With the exceptions noted below, all code and documentation contained in the mdocml toolkit is protected by the Copyright @@ -37,8 +37,10 @@ The following files included from outsid other people's Copyright and are distributed under a 3-clause BSD license; see these individual files for details. -compat_getsubopt.c, compat_strcasestr.c, compat_strsep.c: -Copyright (c) 1990, 1993 The Regents of the University of California +compat_fts.c, compat_fts.h, +compat_getsubopt.c, compat_strcasestr.c, compat_strsep.c, +man.1: +Copyright (c) 1989,1990,1993,1994 The Regents of the University of California compat_fgetln.c: Copyright (c) 1998 The NetBSD Foundation, Inc. Modified: head/contrib/mdocml/Makefile ============================================================================== --- head/contrib/mdocml/Makefile Tue Dec 2 23:02:57 2014 (r275431) +++ head/contrib/mdocml/Makefile Tue Dec 2 23:24:57 2014 (r275432) @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.435 2014/08/10 02:45:04 schwarze Exp $ +# $Id: Makefile,v 1.448 2014/11/28 18:57:31 schwarze Exp $ # # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons # Copyright (c) 2011, 2013, 2014 Ingo Schwarze @@ -15,126 +15,31 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -VERSION = 1.13.1 - -# === USER SETTINGS ==================================================== - -# --- user settings relevant for all builds ---------------------------- - -# Specify this if you want to hard-code the operating system to appear -# in the lower-left hand corner of -mdoc manuals. -# -# CFLAGS += -DOSNAME="\"OpenBSD 5.5\"" - -# IFF your system supports multi-byte functions (setlocale(), wcwidth(), -# putwchar()) AND has __STDC_ISO_10646__ (that is, wchar_t is simply a -# UCS-4 value) should you define USE_WCHAR. If you define it and your -# system DOESN'T support this, -Tlocale will produce garbage. -# If you don't define it, -Tlocale is a synonym for -Tacsii. -# -CFLAGS += -DUSE_WCHAR - -CFLAGS += -g -DHAVE_CONFIG_H -CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings -PREFIX = /usr/local -BINDIR = $(PREFIX)/bin -INCLUDEDIR = $(PREFIX)/include/mandoc -LIBDIR = $(PREFIX)/lib/mandoc -MANDIR = $(PREFIX)/man -EXAMPLEDIR = $(PREFIX)/share/examples/mandoc - -INSTALL = install -INSTALL_PROGRAM = $(INSTALL) -m 0555 -INSTALL_DATA = $(INSTALL) -m 0444 -INSTALL_LIB = $(INSTALL) -m 0444 -INSTALL_SOURCE = $(INSTALL) -m 0644 -INSTALL_MAN = $(INSTALL_DATA) - -# --- user settings related to database support ------------------------ - -# Building apropos(1) and makewhatis(8) requires both SQLite3 and fts(3). -# To avoid those dependencies, comment the following line. -# Be careful: the fts(3) implementation in glibc is broken on 32bit -# machines, see: https://sourceware.org/bugzilla/show_bug.cgi?id=15838 -# -BUILD_TARGETS += db-build - -# The remaining settings in this section -# are only relevant if db-build is enabled. -# Otherwise, they have no effect either way. - -# If your system has manpath(1), uncomment this. This is most any -# system that's not OpenBSD or NetBSD. If uncommented, apropos(1) -# and makewhatis(8) will use manpath(1) to get the MANPATH variable. -# -#CFLAGS += -DUSE_MANPATH - -# On some systems, SQLite3 may be installed below /usr/local. -# In that case, uncomment the following two lines. -# -#CFLAGS += -I/usr/local/include -#DBLIB += -L/usr/local/lib - -# OpenBSD has the ohash functions in libutil. -# Comment the following line if your system doesn't. -# -DBLIB += -lutil - -SBINDIR = $(PREFIX)/sbin - -# --- user settings related to man.cgi --------------------------------- - -# To build man.cgi, copy cgi.h.example to cgi.h, edit it, -# and enable the following line. -# Obviously, this requires that db-build is enabled, too. -# -#BUILD_TARGETS += cgi-build - -# The remaining settings in this section -# are only relevant if cgi-build is enabled. -# Otherwise, they have no effect either way. - -# If your system does not support static binaries, comment this, -# for example on Mac OS X. -# -STATIC = -static - -# Linux requires -pthread for statical linking. -# -#STATIC += -pthread - -WWWPREFIX = /var/www -HTDOCDIR = $(WWWPREFIX)/htdocs -CGIBINDIR = $(WWWPREFIX)/cgi-bin - -# === END OF USER SETTINGS ============================================= - -INSTALL_TARGETS = $(BUILD_TARGETS:-build=-install) - -BASEBIN = mandoc preconv demandoc -DBBIN = apropos makewhatis +BASEBIN = mandoc demandoc +DBBIN = makewhatis CGIBIN = man.cgi -DBLIB += -lsqlite3 - -TESTSRCS = test-fgetln.c \ +TESTSRCS = test-dirent-namlen.c \ + test-fgetln.c \ + test-fts.c \ test-getsubopt.c \ test-mmap.c \ test-ohash.c \ test-reallocarray.c \ + test-sqlite3.c \ test-sqlite3_errstr.c \ test-strcasestr.c \ test-strlcat.c \ test-strlcpy.c \ test-strptime.c \ - test-strsep.c + test-strsep.c \ + test-wchar.c -SRCS = apropos.c \ - arch.c \ - att.c \ +SRCS = att.c \ cgi.c \ chars.c \ compat_fgetln.c \ + compat_fts.c \ compat_getsubopt.c \ compat_ohash.c \ compat_reallocarray.c \ @@ -187,7 +92,6 @@ SRCS = apropos.c \ term_ascii.c \ term_ps.c \ tree.c \ - vol.c \ $(TESTSRCS) DISTFILES = INSTALL \ @@ -197,14 +101,12 @@ DISTFILES = INSTALL \ NEWS \ TODO \ apropos.1 \ - arch.in \ - att.in \ cgi.h.example \ chars.in \ + compat_fts.h \ compat_ohash.h \ - config.h.post \ - config.h.pre \ configure \ + configure.local.example \ demandoc.1 \ eqn.7 \ example.style.css \ @@ -218,6 +120,7 @@ DISTFILES = INSTALL \ main.h \ makewhatis.8 \ man-cgi.css \ + man.1 \ man.7 \ man.cgi.8 \ man.h \ @@ -238,7 +141,6 @@ DISTFILES = INSTALL \ mdoc.h \ msec.in \ out.h \ - preconv.1 \ predefs.in \ roff.7 \ st.in \ @@ -246,7 +148,6 @@ DISTFILES = INSTALL \ tbl.3 \ tbl.7 \ term.h \ - vol.in \ $(SRCS) LIBMAN_OBJS = man.o \ @@ -254,16 +155,14 @@ LIBMAN_OBJS = man.o \ man_macro.o \ man_validate.o -LIBMDOC_OBJS = arch.o \ - att.o \ +LIBMDOC_OBJS = att.o \ lib.o \ mdoc.o \ mdoc_argv.o \ mdoc_hash.o \ mdoc_macro.o \ mdoc_validate.o \ - st.o \ - vol.o + st.o LIBROFF_OBJS = eqn.o \ roff.o \ @@ -279,9 +178,11 @@ LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ mandoc.o \ mandoc_aux.o \ msec.o \ + preconv.o \ read.o COMPAT_OBJS = compat_fgetln.o \ + compat_fts.o \ compat_getsubopt.o \ compat_ohash.o \ compat_reallocarray.o \ @@ -314,11 +215,11 @@ MANDOC_OBJS = $(MANDOC_HTML_OBJS) \ out.o \ tree.o -MAKEWHATIS_OBJS = mandocdb.o mansearch_const.o manpath.o +MAN_OBJS = $(MANDOC_OBJS) -PRECONV_OBJS = preconv.o +MAKEWHATIS_OBJS = mandocdb.o mansearch_const.o manpath.o -APROPOS_OBJS = apropos.o mansearch.o mansearch_const.o manpath.o +APROPOS_OBJS = mansearch.o mansearch_const.o manpath.o CGI_OBJS = $(MANDOC_HTML_OBJS) \ cgi.o \ @@ -332,8 +233,8 @@ DEMANDOC_OBJS = demandoc.o WWW_MANS = apropos.1.html \ demandoc.1.html \ + man.1.html \ mandoc.1.html \ - preconv.1.html \ mandoc.3.html \ mandoc_escape.3.html \ mandoc_html.3.html \ @@ -360,9 +261,13 @@ WWW_MANS = apropos.1.html \ WWW_OBJS = mdocml.tar.gz \ mdocml.sha256 +include Makefile.local + +INSTALL_TARGETS = $(BUILD_TARGETS:-build=-install) + # === DEPENDENCY HANDLING ============================================== -all: base-build $(BUILD_TARGETS) +all: base-build $(BUILD_TARGETS) Makefile.local base-build: $(BASEBIN) @@ -374,20 +279,22 @@ install: base-install $(INSTALL_TARGETS) www: $(WWW_OBJS) $(WWW_MANS) +$(WWW_MANS): mandoc + include Makefile.depend # === TARGETS CONTAINING SHELL COMMANDS ================================ +distclean: clean + rm -f Makefile.local config.h config.h.old config.log config.log.old + clean: - rm -f libmandoc.a $(LIBMANDOC_OBJS) - rm -f apropos $(APROPOS_OBJS) + rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS) + rm -f mandoc $(MANDOC_OBJS) $(APROPOS_OBJS) rm -f makewhatis $(MAKEWHATIS_OBJS) - rm -f preconv $(PRECONV_OBJS) rm -f man.cgi $(CGI_OBJS) rm -f manpage $(MANPAGE_OBJS) rm -f demandoc $(DEMANDOC_OBJS) - rm -f mandoc $(MANDOC_OBJS) - rm -f config.h config.log $(COMPAT_OBJS) rm -f $(WWW_MANS) $(WWW_OBJS) rm -rf *.dSYM @@ -403,7 +310,8 @@ base-install: base-build $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h \ $(DESTDIR)$(INCLUDEDIR) - $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) man.1 mandoc.1 demandoc.1 \ + $(DESTDIR)$(MANDIR)/man1 $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 \ @@ -417,8 +325,8 @@ db-install: db-build mkdir -p $(DESTDIR)$(MANDIR)/man3 mkdir -p $(DESTDIR)$(MANDIR)/man5 mkdir -p $(DESTDIR)$(MANDIR)/man8 - $(INSTALL_PROGRAM) apropos $(DESTDIR)$(BINDIR) - ln -f $(DESTDIR)$(BINDIR)/apropos $(DESTDIR)$(BINDIR)/whatis + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/apropos + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/whatis $(INSTALL_PROGRAM) makewhatis $(DESTDIR)$(SBINDIR) $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1 ln -f $(DESTDIR)$(MANDIR)/man1/apropos.1 \ @@ -447,30 +355,29 @@ www-install: www $(INSTALL_DATA) mdocml.sha256 \ $(DESTDIR)$(HTDOCDIR)/snapshots/mdocml-$(VERSION).sha256 +Makefile.local config.h: configure ${TESTSRCS} + @echo "$@ is out of date; please run ./configure" + @exit 1 + depend: config.h mkdep -f Makefile.depend $(CFLAGS) $(SRCS) perl -e 'undef $$/; $$_ = <>; s|/usr/include/\S+||g; \ - s|\\\n||g; s| +| |g; print;' Makefile.depend > Makefile.tmp + s|\\\n||g; s| +| |g; s| $$||mg; print;' \ + Makefile.depend > Makefile.tmp mv Makefile.tmp Makefile.depend libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS) $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) -mandoc: $(MANDOC_OBJS) libmandoc.a - $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a +mandoc: $(MAN_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MAN_OBJS) libmandoc.a $(DBLIB) makewhatis: $(MAKEWHATIS_OBJS) libmandoc.a $(CC) $(LDFLAGS) -o $@ $(MAKEWHATIS_OBJS) libmandoc.a $(DBLIB) -preconv: $(PRECONV_OBJS) - $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS) - manpage: $(MANPAGE_OBJS) libmandoc.a $(CC) $(LDFLAGS) -o $@ $(MANPAGE_OBJS) libmandoc.a $(DBLIB) -apropos: $(APROPOS_OBJS) libmandoc.a - $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB) - man.cgi: $(CGI_OBJS) libmandoc.a $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) @@ -482,18 +389,13 @@ mdocml.sha256: mdocml.tar.gz mdocml.tar.gz: $(DISTFILES) mkdir -p .dist/mdocml-$(VERSION)/ - $(INSTALL_SOURCE) $(DISTFILES) .dist/mdocml-$(VERSION) + $(INSTALL) -m 0644 $(DISTFILES) .dist/mdocml-$(VERSION) chmod 755 .dist/mdocml-$(VERSION)/configure ( cd .dist/ && tar zcf ../$@ mdocml-$(VERSION) ) rm -rf .dist/ -config.h: configure config.h.pre config.h.post $(TESTSRCS) - rm -f config.log - CC="$(CC)" CFLAGS="$(CFLAGS)" DBLIB="$(DBLIB)" \ - VERSION="$(VERSION)" ./configure - .PHONY: base-install cgi-install db-install install www-install -.PHONY: clean depend +.PHONY: clean distclean depend .SUFFIXES: .1 .3 .5 .7 .8 .h .SUFFIXES: .1.html .3.html .5.html .7.html .8.html .h.html Modified: head/contrib/mdocml/Makefile.depend ============================================================================== --- head/contrib/mdocml/Makefile.depend Tue Dec 2 23:02:57 2014 (r275431) +++ head/contrib/mdocml/Makefile.depend Tue Dec 2 23:24:57 2014 (r275432) @@ -1,24 +1,23 @@ -apropos.o: apropos.c config.h manpath.h mansearch.h -arch.o: arch.c config.h mdoc.h libmdoc.h arch.in -att.o: att.c config.h mdoc.h libmdoc.h att.in +att.o: att.c config.h mdoc.h libmdoc.h cgi.o: cgi.c config.h mandoc.h mandoc_aux.h main.h manpath.h mansearch.h cgi.h chars.o: chars.c config.h mandoc.h mandoc_aux.h libmandoc.h chars.in -compat_fgetln.o: compat_fgetln.c config.h -compat_getsubopt.o: compat_getsubopt.c config.h -compat_ohash.o: compat_ohash.c config.h -compat_reallocarray.o: compat_reallocarray.c config.h -compat_sqlite3_errstr.o: compat_sqlite3_errstr.c config.h -compat_strcasestr.o: compat_strcasestr.c config.h -compat_strlcat.o: compat_strlcat.c config.h -compat_strlcpy.o: compat_strlcpy.c config.h -compat_strsep.o: compat_strsep.c config.h +compat_fgetln.o: compat_fgetln.c config.h +compat_fts.o: compat_fts.c config.h compat_fts.h +compat_getsubopt.o: compat_getsubopt.c config.h +compat_ohash.o: compat_ohash.c config.h compat_ohash.h +compat_reallocarray.o: compat_reallocarray.c config.h +compat_sqlite3_errstr.o: compat_sqlite3_errstr.c config.h +compat_strcasestr.o: compat_strcasestr.c config.h +compat_strlcat.o: compat_strlcat.c config.h +compat_strlcpy.o: compat_strlcpy.c config.h +compat_strsep.o: compat_strsep.c config.h demandoc.o: demandoc.c config.h man.h mdoc.h mandoc.h eqn.o: eqn.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h eqn_html.o: eqn_html.c config.h mandoc.h out.h html.h eqn_term.o: eqn_term.c config.h mandoc.h out.h term.h html.o: html.c config.h mandoc.h mandoc_aux.h libmandoc.h out.h html.h main.h lib.o: lib.c config.h mdoc.h libmdoc.h lib.in -main.o: main.c config.h mandoc.h mandoc_aux.h main.h mdoc.h man.h +main.o: main.c config.h mandoc.h mandoc_aux.h main.h mdoc.h man.h manpath.h mansearch.h man.o: man.c config.h man.h mandoc.h mandoc_aux.h libman.h libmandoc.h man_hash.o: man_hash.c config.h man.h mandoc.h libman.h man_html.o: man_html.c config.h mandoc.h mandoc_aux.h out.h html.h man.h main.h @@ -27,10 +26,10 @@ man_term.o: man_term.c config.h mandoc.h man_validate.o: man_validate.c config.h man.h mandoc.h mandoc_aux.h libman.h libmandoc.h mandoc.o: mandoc.c config.h mandoc.h mandoc_aux.h libmandoc.h mandoc_aux.o: mandoc_aux.c config.h mandoc.h mandoc_aux.h -mandocdb.o: mandocdb.c config.h mdoc.h man.h mandoc.h mandoc_aux.h manpath.h mansearch.h +mandocdb.o: mandocdb.c config.h compat_fts.h compat_ohash.h mdoc.h man.h mandoc.h mandoc_aux.h manpath.h mansearch.h manpage.o: manpage.c config.h manpath.h mansearch.h manpath.o: manpath.c config.h mandoc_aux.h manpath.h -mansearch.o: mansearch.c config.h mandoc.h mandoc_aux.h manpath.h mansearch.h +mansearch.o: mansearch.c config.h compat_ohash.h mandoc.h mandoc_aux.h manpath.h mansearch.h mansearch_const.o: mansearch_const.c config.h manpath.h mansearch.h mdoc.o: mdoc.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h mdoc_argv.o: mdoc_argv.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h @@ -42,9 +41,9 @@ mdoc_term.o: mdoc_term.c config.h mandoc mdoc_validate.o: mdoc_validate.c config.h mdoc.h mandoc.h mandoc_aux.h libmdoc.h libmandoc.h msec.o: msec.c config.h mandoc.h libmandoc.h msec.in out.o: out.c config.h mandoc_aux.h mandoc.h out.h -preconv.o: preconv.c config.h +preconv.o: preconv.c config.h mandoc.h libmandoc.h read.o: read.c config.h mandoc.h mandoc_aux.h libmandoc.h mdoc.h man.h main.h -roff.o: roff.c config.h mandoc.h mandoc_aux.h libroff.h libmandoc.h predefs.in +roff.o: roff.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h predefs.in st.o: st.c config.h mdoc.h libmdoc.h st.in tbl.o: tbl.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h tbl_data.o: tbl_data.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h @@ -56,15 +55,18 @@ term.o: term.c config.h mandoc.h mandoc_ term_ascii.o: term_ascii.c config.h mandoc.h mandoc_aux.h out.h term.h main.h term_ps.o: term_ps.c config.h mandoc.h mandoc_aux.h out.h main.h term.h tree.o: tree.c config.h mandoc.h mdoc.h man.h main.h -vol.o: vol.c config.h mdoc.h libmdoc.h vol.in -test-fgetln.o: test-fgetln.c -test-getsubopt.o: test-getsubopt.c -test-mmap.o: test-mmap.c -test-ohash.o: test-ohash.c -test-reallocarray.o: test-reallocarray.c -test-sqlite3_errstr.o: test-sqlite3_errstr.c -test-strcasestr.o: test-strcasestr.c -test-strlcat.o: test-strlcat.c -test-strlcpy.o: test-strlcpy.c -test-strptime.o: test-strptime.c -test-strsep.o: test-strsep.c +test-dirent-namlen.o: test-dirent-namlen.c +test-fgetln.o: test-fgetln.c +test-fts.o: test-fts.c +test-getsubopt.o: test-getsubopt.c +test-mmap.o: test-mmap.c +test-ohash.o: test-ohash.c +test-reallocarray.o: test-reallocarray.c +test-sqlite3.o: test-sqlite3.c +test-sqlite3_errstr.o: test-sqlite3_errstr.c +test-strcasestr.o: test-strcasestr.c +test-strlcat.o: test-strlcat.c +test-strlcpy.o: test-strlcpy.c +test-strptime.o: test-strptime.c +test-strsep.o: test-strsep.c +test-wchar.o: test-wchar.c Modified: head/contrib/mdocml/NEWS ============================================================================== --- head/contrib/mdocml/NEWS Tue Dec 2 23:02:57 2014 (r275431) +++ head/contrib/mdocml/NEWS Tue Dec 2 23:24:57 2014 (r275432) @@ -1,4 +1,4 @@ -$Id: NEWS,v 1.5 2014/08/10 16:32:57 schwarze Exp $ +$Id: NEWS,v 1.6 2014/08/11 01:39:00 schwarze Exp $ This file lists the most important changes in the mdocml.bsd.lv distribution. @@ -7,9 +7,6 @@ Changes in version 1.13.1, released on A --- MAJOR NEW FEATURES --- * A complete apropos(1)/makewhatis(8)/man.cgi(8) suite based on SQLite3 is now included. - CAVEAT: This also requires a working fts(3) implementation. - If your system lacks that *and* you want apropos(1)/makewhatis(8), - stay with 1.12.3 for now, then go to 1.12.4 and 1.13.2. * The roff(7) parser now provides an almost complete implementation of numerical expressions. * Warning and error messages have been improved in many ways. Modified: head/contrib/mdocml/TODO ============================================================================== --- head/contrib/mdocml/TODO Tue Dec 2 23:02:57 2014 (r275431) +++ head/contrib/mdocml/TODO Tue Dec 2 23:24:57 2014 (r275432) @@ -1,8 +1,37 @@ ************************************************************************ * Official mandoc TODO. -* $Id: TODO,v 1.176 2014/08/09 14:24:53 schwarze Exp $ +* $Id: TODO,v 1.189 2014/11/26 21:40:17 schwarze Exp $ ************************************************************************ +Many issues are annotated for difficulty as follows: + + - loc = locality of the issue + * single file issue, affects file only, or very few + ** single module issue, affects several files of one module + *** cross-module issue, significantly impacts multiple modules + and may require substantial changes to internal interfaces + - exist = difficulty of the existing code in this area + * affected code is straightforward and easy to read and change + ** affected code is somewhat complex, but once you understand + the design, not particularly difficult to understand + *** affected code uses a special, exceptionally tricky design + - algo = difficulty of the new algorithm to be written + * the required logic and code is straightforward + ** the required logic is somewhat complex and needs a careful design + *** the required logic is exceptionally tricky, + maybe an approach to solve that is not even known yet + - size = the amount of code to be written or changed + * a small number of lines (at most 100, usually much less) + ** a considerable amount of code (several dozen to a few hundred) + *** a large amount of code (many hundreds, maybe thousands) + - imp = importance of the issue + * mostly for completeness + ** would be nice to have + *** issue causes considerable inconvenience + +Obviously, as the issues have not been solved yet, these annotations +are mere guesses, and some may be wrong. + ************************************************************************ * crashes ************************************************************************ @@ -10,6 +39,7 @@ - The abort() in bufcat(), html.c, can be triggered via buffmt_includes() by running -Thtml -Oincludes on a file containing a long .In argument. Fixing this will probably require reworking the whole bufcat() concept. + loc ** exist * algo * size ** imp ** ************************************************************************ * missing features @@ -25,49 +55,62 @@ .na -- temporarily disable adjustment without changing the mode .ad -- re-enable adjustment without changing the mode Adjustment mode is ignored while in no-fill mode (.nf). + loc *** exist *** algo ** size ** imp ** (parser reorg would help) - .fc (field control) found by naddy@ in xloadimage(1) + loc ** exist *** algo * size * imp * - .nr third argument (auto-increment step size, requires \n+) found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 + loc * exist * algo * size * imp ** - .ns (no-space mode) occurs in xine-config(1) reported by brad@ Sat, 15 Jan 2011 15:45:23 -0500 + loc *** exist *** algo *** size ** imp * - .ta (tab settings) occurs in ircbug(1) and probably gnats(1) reported by brad@ Sat, 15 Jan 2011 15:50:51 -0500 also Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 + loc ** exist *** algo ** size ** imp ** - .ti (temporary indent) found by naddy@ in xloadimage(1) found by bentley@ in nmh(1) Mon, 23 Apr 2012 13:38:28 -0600 + loc ** exist ** algo ** size * imp ** (parser reorg helps a lot) - .while and .shift found by jca@ in ratpoison(1) Sun, 30 Jun 2013 12:01:09 +0200 + loc * exist ** algo ** size ** imp ** - \c (interrupted text) should prevent the line break even inside .Bd literal; that occurs in chat(8) also found in cclive(1) - DocBook output + loc ** exist *** algo ** size * imp * - \h horizontal move found in cclive(1) DocBook output Anthony J. Bentley on discuss@ Sat, 21 Sep 2013 22:29:34 -0600 + loc ** exist ** algo ** size * imp ** (parser reorg helps a lot) - \n+ and \n- numerical register increment and decrement found by bentley@ in sbcl(1) Mon, 9 Dec 2013 18:36:57 -0700 + loc * exist * algo * size * imp ** -- \w'' width measurements +- \w'' improve width measurements would not be very useful without an expression parser, see below needed for Tcl_NewStringObj(3) via wiz@ Wed, 5 Mar 2014 22:27:43 +0100 + loc ** exist *** algo *** size * imp *** - using undefined strings or macros defines them to be empty wl@ Mon, 14 Nov 2011 14:37:01 +0000 + loc * exist * algo * size * imp * --- missing mdoc features ---------------------------------------------- - fix bad block nesting involving multiple identical explicit blocks see the OpenBSD mdoc_macro.c 1.47 commit message + loc * exist *** algo *** size * imp ** - .Bl -column .Xo support is missing ultimate goal: @@ -75,10 +118,12 @@ lib/libc/compat-43/sigvec.3 lib/libc/gen/signal.3 lib/libc/sys/sigaction.2 + loc * exist *** algo *** size * imp ** - edge case: decide how to deal with blk_full bad nesting, e.g. .Sh .Nm .Bk .Nm .Ek .Sh found by jmc@ in ssh-keygen(1) from jmc@ Wed, 14 Jul 2010 18:10:32 +0100 + loc * exist *** algo *** size ** imp ** - \\ is now implemented correctly * when defining strings and macros using .ds and .de @@ -92,18 +137,22 @@ we don't have either. Besides, groff has bug causing text right *before* .Bd -centered to be centered as well. + loc *** exist *** algo ** size ** imp ** (parser reorg would help) - .Bd -filled should not be the same as .Bd -ragged, but align both the left and right margin. In groff, it is implemented in terms of .ad b, which we don't have either. Found in cksum(1). + loc *** exist *** algo ** size ** imp ** (parser reorg would help) - implement blank `Bl -column', such as .Bl -column .It foo Ta bar .El + loc * exist *** algo *** size * imp * - explicitly disallow nested `Bl -column', which would clobber internal flags defined for struct mdoc_macro + loc * exist * algo * size * imp ** - In .Bl -column .It, the end of the line probably has to be regarded as an implicit .Ta, if there could be one, see the following mildly @@ -114,6 +163,7 @@ Default search path. reported by Michal Mazurek via jmc@ Thu, 7 Apr 2011 16:00:53 +0059 + loc * exist *** algo ** size * imp ** - inside `.Bl -column' phrases, punctuation is handled like normal text, e.g. `.Bl -column .It Fl x . Ta ...' should give "-x -." @@ -123,11 +173,14 @@ but should give "ab ." - set a meaningful default if no `Bl' list type is assigned + loc * exist * algo * size * imp ** (already done?) - have a blank `It' head for `Bl -tag' not puke + loc * exist * algo * size * imp ** (already done?) - check whether it is correct that `D1' uses INDENT+1; does it need its own constant? + loc * exist ** algo ** size * imp ** - prohibit `Nm' from having non-text HEAD children (e.g., NetBSD mDNSShared/dns-sd.1) @@ -138,6 +191,7 @@ that one uses NOMBRE because it is spanish... deraadt tends to think that section-dependent macro behaviour is a bad idea in the first place, so this may be irrelevant + loc ** exist ** algo ** size * imp ** - When there is free text in the SYNOPSIS and that free text contains the .Nm macro, groff somehow understands to treat the .Nm as an in-line @@ -146,6 +200,7 @@ should be, needs investigation. uqs@ Thu, 2 Jun 2011 11:03:51 +0200 uqs@ Thu, 2 Jun 2011 11:33:35 +0200 + loc * exist ** algo *** size * imp ** --- missing man features ----------------------------------------------- @@ -155,18 +210,36 @@ - look at the POSIX manuals in the books/man-pages-posix port, they use some unsupported tbl(7) features. + loc * exist ** algo ** size ** imp *** -- investigate tbl(1) errors in sox(1) - see also naddy@ Sat, 16 Oct 2010 23:51:57 +0200 +- use Unicode U+2500 to U+256C for table borders + in tbl(7) -Tutf-8 output + suggested by bentley@ Tue, 14 Oct 2014 04:10:55 -0600 + loc * exist ** algo * size * imp ** - allow standalone `.' to be interpreted as an end-of-layout delimiter instead of being thrown away as a no-op roff line reported by Yuri Pankov, Wed 18 May 2011 11:34:59 CEST + loc ** exist ** algo ** size * imp ** + +--- missing eqn features ----------------------------------------------- + +- The "size" keyword is parsed, but ignored by the formatter. + loc * exist * algo * size * imp * + +- The spacing characters `~', `^', and tab are currently ignored, + see User's Guide (Second Edition) page 2 section 4. + loc * exist * algo ** size * imp ** + +- Mark and lineup are parsed and ignored, + see User's Guide (Second Edition) page 5 section 15. + loc ** exist ** algo ** size ** imp ** --- missing misc features ---------------------------------------------- - italic correction (\/) in PostScript mode Werner LEMBERG on groff at gnu dot org Sun, 10 Nov 2013 12:47:46 + loc ** exist ** algo * size * imp * - When makewhatis(8) encounters a FATAL parse error, it silently treats the file as formatted, which makes no sense @@ -174,13 +247,16 @@ what the manual says at the end of the description. The end result will be ENOENT for file names returned by mansearch() in manpage.file. + loc * exist * algo * size * imp ** - makewhatis(8) for preformatted pages: parse the section number from the header line and compare to the section number from the directory name + loc * exist * algo * size * imp ** - Does makewhatis(8) detect missing NAME sections, missing names, and missing descriptions in all the file formats? + loc * exist * algo * size * imp *** - clean up escape sequence handling, creating three classes: (1) fully implemented, or parsed and ignored without loss of content @@ -188,8 +264,10 @@ or serious mangling of formatting (e.g. \n) -> ERROR see textproc/mgdiff(1) for nice examples (3) undefined, just output the character -> perhaps WARNING + loc *** exist ** algo ** size ** imp *** (parser reorg helps) - kettenis wants base roff, ms, and me Fri, 1 Jan 2010 22:13:15 +0100 (CET) + loc ** exist ** algo ** size *** imp * --- compatibility checks ----------------------------------------------- @@ -199,6 +277,10 @@ - compare output to Heirloom roff, Solaris roff, and http://repo.or.cz/w/neatroff.git http://litcave.rudi.ir/ +- look at AT&T DWB http://www2.research.att.com/sw/download + Carsten Kunze has patches + Mon, 4 Aug 2014 17:01:28 +0200 + - look at pages generated from reStructeredText, e.g. devel/mercurial hg(1) These are a weird mixture of man(7) and custom autogenerated low-level roff stuff. Figure out to what extent we can cope. @@ -224,6 +306,11 @@ - check compatibility with the man(7) formatter https://raw.githubusercontent.com/rofl0r/hardcore-utils/master/man.c +- check compatibility with + http://ikiwiki.info/plugins/contrib/mandoc/ + https://github.com/schmonz/ikiwiki/compare/mandoc + Amitai Schlair Mon, 19 May 2014 14:05:53 -0400 + ************************************************************************ * formatting issues: ugly output ************************************************************************ @@ -236,10 +323,12 @@ ought to render "Key Length" with emphasis, too, see OpenBSD iked.conf(5). reported again Nicolas Joly via wiz@ Wed, 12 Oct 2011 00:20:00 +0200 + loc * exist *** algo *** size ** imp *** - empty phrases in .Bl column produce too few blanks try e.g. .Bl -column It Ta Ta reported by millert Fri, 02 Apr 2010 16:13:46 -0400 + loc * exist *** algo *** size * imp ** - .%T can have trailing punctuation. Currently, it puts the trailing punctuation into a trailing MDOC_TEXT element inside its own scope. @@ -249,11 +338,13 @@ slurp all arguments into one single text element - and one feature of in_line() - put trailing punctuation out of scope. Found in mount_nfs(8) and exports(5), search for "Appendix". + loc ** exist ** algo *** size * imp ** - Trailing punctuation after .%T triggers EOS spacing, at least outside .Rs (eek!). Simply setting ARGSFL_DELIM for .%T is not the right solution, it sends mandoc into an endless loop. reported by Nicolas Joly Sat, 17 Nov 2012 11:49:54 +0100 + loc * exist ** algo ** size * imp ** - global variables in the SYNOPSIS of section 3 pages .Vt vs .Vt/.Va vs .Ft/.Va vs .Ft/.Fa ... @@ -261,6 +352,7 @@ - in enclosures, mandoc sometimes fancies a bogus end of sentence reminded by jmc@ Thu, 23 Sep 2010 18:13:39 +0059 + loc * exist ** algo *** size * imp *** - formatting /usr/local/man/man1/latex2man.1 with groff and mandoc reveals lots of bugs both in groff and mandoc... @@ -273,6 +365,10 @@ Search the text "Routing tables". Also check what PostScript mode does when fixing this. reported by juanfra@ Wed, 04 Jun 2014 21:44:58 +0200 + instructions from juanfra@ Wed, 11 Jun 2014 02:21:01 +0200 + add a new <> block to the PDF files with /BaseFont /Courier + and change the /Name from /F0 to the new font (/F5 (?)). + loc * exist ** algo ** size * imp ** --- HTML issues -------------------------------------------------------- @@ -280,6 +376,20 @@ hints are easy to find on the web, e.g. http://stackoverflow.com/questions/1713048/ see also matthew@ Fri, 18 Jul 2014 19:25:12 -0700 + loc * exist * algo ** size * imp *** + +- jsg on icb, Nov 3, 2014: + try to guess Xr in man(7) for hyperlinking + +- The tables used to render the three-part page headers actually force + the width of the to the max-width given for . + Not yet sure how to fix that... + Observed by an Anonymous Coward on undeadly.org: + http://undeadly.org/cgi?action=article&sid=20140925064244&pid=1 + loc * exist * algo ** size * imp *** *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Tue Dec 2 23:33:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88B3B8A7; Tue, 2 Dec 2014 23:33:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 73CF16CD; Tue, 2 Dec 2014 23:33:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2NXexW017634; Tue, 2 Dec 2014 23:33:40 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2NXc4q017621; Tue, 2 Dec 2014 23:33:38 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201412022333.sB2NXc4q017621@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Tue, 2 Dec 2014 23:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275433 - in head/gnu/usr.bin/binutils: addr2line nm objcopy objdump readelf size strings strip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 23:33:40 -0000 Author: bapt Date: Tue Dec 2 23:33:37 2014 New Revision: 275433 URL: https://svnweb.freebsd.org/changeset/base/275433 Log: Revert r274953, r274934 mandoc(1) is now able to display correctly the vanilla version Modified: head/gnu/usr.bin/binutils/addr2line/addr2line.1 head/gnu/usr.bin/binutils/nm/nm.1 head/gnu/usr.bin/binutils/objcopy/objcopy.1 head/gnu/usr.bin/binutils/objdump/objdump.1 head/gnu/usr.bin/binutils/readelf/readelf.1 head/gnu/usr.bin/binutils/size/size.1 head/gnu/usr.bin/binutils/strings/strings.1 head/gnu/usr.bin/binutils/strip/strip.1 Modified: head/gnu/usr.bin/binutils/addr2line/addr2line.1 ============================================================================== --- head/gnu/usr.bin/binutils/addr2line/addr2line.1 Tue Dec 2 23:24:57 2014 (r275432) +++ head/gnu/usr.bin/binutils/addr2line/addr2line.1 Tue Dec 2 23:33:37 2014 (r275433) @@ -33,7 +33,7 @@ . ds R" "" . ds C` "" . ds C' "" -\} +'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p @@ -107,6 +107,7 @@ .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ Modified: head/gnu/usr.bin/binutils/nm/nm.1 ============================================================================== --- head/gnu/usr.bin/binutils/nm/nm.1 Tue Dec 2 23:24:57 2014 (r275432) +++ head/gnu/usr.bin/binutils/nm/nm.1 Tue Dec 2 23:33:37 2014 (r275433) @@ -33,7 +33,7 @@ . ds R" "" . ds C` "" . ds C' "" -\} +'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p @@ -107,6 +107,7 @@ .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ Modified: head/gnu/usr.bin/binutils/objcopy/objcopy.1 ============================================================================== --- head/gnu/usr.bin/binutils/objcopy/objcopy.1 Tue Dec 2 23:24:57 2014 (r275432) +++ head/gnu/usr.bin/binutils/objcopy/objcopy.1 Tue Dec 2 23:33:37 2014 (r275433) @@ -33,7 +33,7 @@ . ds R" "" . ds C` "" . ds C' "" -\} +'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p @@ -107,6 +107,7 @@ .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ Modified: head/gnu/usr.bin/binutils/objdump/objdump.1 ============================================================================== --- head/gnu/usr.bin/binutils/objdump/objdump.1 Tue Dec 2 23:24:57 2014 (r275432) +++ head/gnu/usr.bin/binutils/objdump/objdump.1 Tue Dec 2 23:33:37 2014 (r275433) @@ -33,7 +33,7 @@ . ds R" "" . ds C` "" . ds C' "" -\} +'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p @@ -107,6 +107,7 @@ .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ Modified: head/gnu/usr.bin/binutils/readelf/readelf.1 ============================================================================== --- head/gnu/usr.bin/binutils/readelf/readelf.1 Tue Dec 2 23:24:57 2014 (r275432) +++ head/gnu/usr.bin/binutils/readelf/readelf.1 Tue Dec 2 23:33:37 2014 (r275433) @@ -33,7 +33,7 @@ . ds R" "" . ds C` "" . ds C' "" -\} +'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p @@ -107,6 +107,7 @@ .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ Modified: head/gnu/usr.bin/binutils/size/size.1 ============================================================================== --- head/gnu/usr.bin/binutils/size/size.1 Tue Dec 2 23:24:57 2014 (r275432) +++ head/gnu/usr.bin/binutils/size/size.1 Tue Dec 2 23:33:37 2014 (r275433) @@ -33,7 +33,7 @@ . ds R" "" . ds C` "" . ds C' "" -\} +'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p @@ -107,6 +107,7 @@ .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ Modified: head/gnu/usr.bin/binutils/strings/strings.1 ============================================================================== --- head/gnu/usr.bin/binutils/strings/strings.1 Tue Dec 2 23:24:57 2014 (r275432) +++ head/gnu/usr.bin/binutils/strings/strings.1 Tue Dec 2 23:33:37 2014 (r275433) @@ -33,7 +33,7 @@ . ds R" "" . ds C` "" . ds C' "" -\} +'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p @@ -107,6 +107,7 @@ .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ Modified: head/gnu/usr.bin/binutils/strip/strip.1 ============================================================================== --- head/gnu/usr.bin/binutils/strip/strip.1 Tue Dec 2 23:24:57 2014 (r275432) +++ head/gnu/usr.bin/binutils/strip/strip.1 Tue Dec 2 23:33:37 2014 (r275433) @@ -33,7 +33,7 @@ . ds R" "" . ds C` "" . ds C' "" -\} +'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p @@ -107,6 +107,7 @@ .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 00:10:04 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19036F03; Wed, 3 Dec 2014 00:10:04 +0000 (UTC) Received: from mail-wi0-x22c.google.com (mail-wi0-x22c.google.com [IPv6:2a00:1450:400c:c05::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 89692A51; Wed, 3 Dec 2014 00:10:03 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id n3so29690002wiv.11 for ; Tue, 02 Dec 2014 16:10:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=EOCaDfZ6EsdOqHKFZsIYN3cCCIk81aaFxYvgFtrDZ18=; b=MBOmN3zcPe6yhNcpJ0mw+UwoIREaaD588pUze4PhjBXpk2XQBbv7UmJw4yRefSLv4I CSgKX0u4lFyYDvM3AxBKDcTBo0YCpPLjZbR5+f/sFZOp0h4qdBfdUOpWw0UvPebRSlhL 3I+fhHwAoK1bQEQoZY4iKPo/+LDHYe11N9uKVGMp5iAMkMZsw202PqnWKtpHanmbucaT pctRWxfxBYMK7x1I/gPv6eJZBETKnr9AlFYaqrWtOeSENEx7cTwPE9w3qyveNItyrnku HLjro7F+I7fVnbYkvtppocmb8BriZsfiLG2L2NgP1NnpJ9/2Nmi/oMT1m+zVqE1y4no7 olpw== MIME-Version: 1.0 X-Received: by 10.180.92.234 with SMTP id cp10mr9216330wib.16.1417565401194; Tue, 02 Dec 2014 16:10:01 -0800 (PST) Received: by 10.194.81.233 with HTTP; Tue, 2 Dec 2014 16:10:01 -0800 (PST) In-Reply-To: <201412022302.sB2N2w9V002617@svn.freebsd.org> References: <201412022302.sB2N2w9V002617@svn.freebsd.org> Date: Tue, 2 Dec 2014 16:10:01 -0800 Message-ID: Subject: Re: svn commit: r275431 - in head/sys/dev: e1000 ixgbe From: Jack Vogel To: Jack F Vogel Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 00:10:04 -0000 Just to make it clear, I am not opposed to what this code was trying to do, in fact I think its a pretty cool idea, but I think it can be implemented more cleanly. Eric and myself will be discussing the details. Jack On Tue, Dec 2, 2014 at 3:02 PM, Jack F Vogel wrote: > Author: jfv > Date: Tue Dec 2 23:02:57 2014 > New Revision: 275431 > URL: https://svnweb.freebsd.org/changeset/base/275431 > > Log: > Revert r275136, it was not approved, it was sloppy, if a feature > like this is needed please resubmit for Intel's approval. > > Modified: > head/sys/dev/e1000/if_igb.c > head/sys/dev/ixgbe/ixgbe.c > > Modified: head/sys/dev/e1000/if_igb.c > > ============================================================================== > --- head/sys/dev/e1000/if_igb.c Tue Dec 2 22:35:43 2014 (r275430) > +++ head/sys/dev/e1000/if_igb.c Tue Dec 2 23:02:57 2014 (r275431) > @@ -188,7 +188,6 @@ static char *igb_strings[] = { > /********************************************************************* > * Function prototypes > *********************************************************************/ > -static int igb_per_unit_num_queues(SYSCTL_HANDLER_ARGS); > static int igb_probe(device_t); > static int igb_attach(device_t); > static int igb_detach(device_t); > @@ -494,11 +493,6 @@ igb_attach(device_t dev) > OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, > igb_sysctl_nvm_info, "I", "NVM Information"); > > - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), > - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), > - OID_AUTO, "num_queues", CTLTYPE_INT | CTLFLAG_RD, > - adapter, 0, igb_per_unit_num_queues, "I", "Number > of Queues"); > - > igb_set_sysctl_value(adapter, "enable_aim", > "Interrupt Moderation", &adapter->enable_aim, > igb_enable_aim); > @@ -2837,7 +2831,6 @@ igb_setup_msix(struct adapter *adapter) > { > device_t dev = adapter->dev; > int bar, want, queues, msgs, maxqueues; > - int n_queues; > > /* tuneable override */ > if (igb_enable_msix == 0) > @@ -2865,18 +2858,11 @@ igb_setup_msix(struct adapter *adapter) > goto msi; > } > > - n_queues = 0; > - /* try more specific tunable, then global, then finally default to > boot time tunable if set. */ > - if (device_getenv_int(dev, "num_queues", &n_queues) != 0) { > - device_printf(dev, "using specific tunable num_queues=%d", > n_queues); > - } else if (TUNABLE_INT_FETCH("hw.igb.num_queues", &n_queues) != 0) > { > - if (igb_num_queues != n_queues) { > - device_printf(dev, "using global tunable > hw.igb.num_queues=%d", n_queues); > - igb_num_queues = n_queues; > - } > - } else { > - n_queues = igb_num_queues; > - } > + queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; > + > + /* Override via tuneable */ > + if (igb_num_queues != 0) > + queues = igb_num_queues; > > #ifdef RSS > /* If we're doing RSS, clamp at the number of RSS buckets */ > @@ -2884,12 +2870,6 @@ igb_setup_msix(struct adapter *adapter) > queues = rss_getnumbuckets(); > #endif > > - if (n_queues != 0) { > - queues = n_queues; > - } else { > - /* Figure out a reasonable auto config value */ > - queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; > - } > > /* Sanity check based on HW */ > switch (adapter->hw.mac.type) { > @@ -2912,17 +2892,10 @@ igb_setup_msix(struct adapter *adapter) > maxqueues = 1; > break; > } > - if (queues > maxqueues) { > - device_printf(adapter->dev, "requested %d queues, but max > for this adapter is %d\n", > - queues, maxqueues); > + > + /* Final clamp on the actual hardware capability */ > + if (queues > maxqueues) > queues = maxqueues; > - } else if (queues == 0) { > - queues = 1; > - } else if (queues < 0) { > - device_printf(adapter->dev, "requested %d queues, but min > for this adapter is %d\n", > - queues, 1); > - queues = 1; > - } > > /* > ** One vector (RX/TX pair) per queue > @@ -6407,14 +6380,3 @@ igb_sysctl_eee(SYSCTL_HANDLER_ARGS) > IGB_CORE_UNLOCK(adapter); > return (0); > } > - > -static int > -igb_per_unit_num_queues(SYSCTL_HANDLER_ARGS) > -{ > - struct adapter *adapter; > - > - adapter = (struct adapter *) arg1; > - > - return sysctl_handle_int(oidp, &adapter->num_queues, 0, req); > -} > - > > Modified: head/sys/dev/ixgbe/ixgbe.c > > ============================================================================== > --- head/sys/dev/ixgbe/ixgbe.c Tue Dec 2 22:35:43 2014 (r275430) > +++ head/sys/dev/ixgbe/ixgbe.c Tue Dec 2 23:02:57 2014 (r275431) > @@ -103,7 +103,6 @@ static char *ixgbe_strings[] = { > /********************************************************************* > * Function prototypes > *********************************************************************/ > -static int ixgbe_per_unit_num_queues(SYSCTL_HANDLER_ARGS); > static int ixgbe_probe(device_t); > static int ixgbe_attach(device_t); > static int ixgbe_detach(device_t); > @@ -476,11 +475,6 @@ ixgbe_attach(device_t dev) > > SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), > SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), > - OID_AUTO, "num_queues", CTLTYPE_INT | CTLFLAG_RD, > - adapter, 0, ixgbe_per_unit_num_queues, "I", > "Number of Queues"); > - > - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), > - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), > OID_AUTO, "ts", CTLTYPE_INT | CTLFLAG_RW, adapter, > 0, ixgbe_set_thermal_test, "I", "Thermal Test"); > > @@ -2522,7 +2516,6 @@ ixgbe_setup_msix(struct adapter *adapter > { > device_t dev = adapter->dev; > int rid, want, queues, msgs; > - int n_queues; > > /* Override by tuneable */ > if (ixgbe_enable_msix == 0) > @@ -2549,34 +2542,19 @@ ixgbe_setup_msix(struct adapter *adapter > > /* Figure out a reasonable auto config value */ > queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; > + > + /* Override based on tuneable */ > + if (ixgbe_num_queues != 0) > + queues = ixgbe_num_queues; > + > #ifdef RSS > /* If we're doing RSS, clamp at the number of RSS buckets */ > if (queues > rss_getnumbuckets()) > queues = rss_getnumbuckets(); > #endif > > - /* try more specific tunable, then global, then finally default to > boot time tunable if set. */ > - if (device_getenv_int(dev, "num_queues", &n_queues) != 0) { > - device_printf(dev, "using specific tunable numqueues=%d", > n_queues); > - } else if (TUNABLE_INT_FETCH("hw.ix.num_queues", &n_queues) != 0) { > - if (ixgbe_num_queues != n_queues) { > - device_printf(dev, "using global tunable > num_queues=%d", n_queues); > - ixgbe_num_queues = n_queues; > - } > - } else { > - n_queues = ixgbe_num_queues; > - } > - > - if (n_queues < 0) { > - device_printf(dev, "tunable < 0, resetting to default"); > - n_queues = 0; > - } > - > - if (n_queues != 0) > - queues = n_queues; > - /* Set max queues to 8 when autoconfiguring */ > - else if ((ixgbe_num_queues == 0) && (queues > 8)) > - queues = 8; > + /* reflect correct sysctl value */ > + ixgbe_num_queues = queues; > > /* > ** Want one vector (RX/TX pair) per queue > @@ -5964,15 +5942,6 @@ ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) > return error; > } > > -static int > -ixgbe_per_unit_num_queues(SYSCTL_HANDLER_ARGS) > -{ > - struct adapter *adapter; > - > - adapter = (struct adapter *) arg1; > - > - return sysctl_handle_int(oidp, &adapter->num_queues, 0, req); > -} > > /* > ** Control link advertise speed: > > From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 00:47:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EF526EF; Wed, 3 Dec 2014 00:47:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2BDBADCF; Wed, 3 Dec 2014 00:47:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB30l6Rh052953; Wed, 3 Dec 2014 00:47:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB30l6Bh052952; Wed, 3 Dec 2014 00:47:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201412030047.sB30l6Bh052952@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 3 Dec 2014 00:47:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275434 - head/sys/dev/pccard X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 00:47:06 -0000 Author: imp Date: Wed Dec 3 00:47:05 2014 New Revision: 275434 URL: https://svnweb.freebsd.org/changeset/base/275434 Log: Remove unused PCMCIA_CARD* macros. Always include the card human readable name. We support ~270 cards and at ~20 bytes each, this bloats things by only ~5k. Retain the PCMCIA_CARD vs PCMCIA_CARD_D distinction, though, in case this is intolerable. Modified: head/sys/dev/pccard/pccardvar.h Modified: head/sys/dev/pccard/pccardvar.h ============================================================================== --- head/sys/dev/pccard/pccardvar.h Tue Dec 2 23:33:37 2014 (r275433) +++ head/sys/dev/pccard/pccardvar.h Wed Dec 3 00:47:05 2014 (r275434) @@ -219,14 +219,8 @@ enum { #define PCCARD_C(a, b) PCMCIA_CIS_ ## a ## _ ## b #define PCMCIA_CARD_D(v, p) { PCCARD_S(v, p), PCMCIA_VENDOR_ ## v, \ PCCARD_P(v, p), PCCARD_C(v, p) } -#define PCMCIA_CARD2_D(v1, p1, p2) \ - { PCMCIA_STR_ ## p2, PCMCIA_VENDOR_ ## v1, PCCARD_P(v1, p1), \ - PCMCIA_CIS_ ## p2} -#define PCMCIA_CARD(v, p) { NULL, PCMCIA_VENDOR_ ## v, \ +#define PCMCIA_CARD(v, p) { PCCARD_S(v, p), PCMCIA_VENDOR_ ## v, \ PCCARD_P(v, p), PCCARD_C(v, p) } -#define PCMCIA_CARD2(v1, p1, p2) \ - { NULL, PCMCIA_VENDOR_ ## v1, PCCARD_P(v1, p1), \ - PCMCIA_CIS_ ## p2} /* * Defines to decode the get_funce_disk return value. See the PCMCIA standard From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 01:34:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C1A5E59; Wed, 3 Dec 2014 01:34:25 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48F19295; Wed, 3 Dec 2014 01:34:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB31YPK6074916; Wed, 3 Dec 2014 01:34:25 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB31YP7R074915; Wed, 3 Dec 2014 01:34:25 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412030134.sB31YP7R074915@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 3 Dec 2014 01:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275435 - head/rescue/rescue X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 01:34:25 -0000 Author: delphij Date: Wed Dec 3 01:34:24 2014 New Revision: 275435 URL: https://svnweb.freebsd.org/changeset/base/275435 Log: Add sleep(1) to /rescue. This adds 664 bytes to the binary on amd64 but it's pretty useful for shell scripts. MFC after: 1 month Sponsored by: iXsystems, Inc. Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile ============================================================================== --- head/rescue/rescue/Makefile Wed Dec 3 00:47:05 2014 (r275434) +++ head/rescue/rescue/Makefile Wed Dec 3 01:34:24 2014 (r275435) @@ -51,7 +51,8 @@ CRUNCH_LIBS+= ${.OBJDIR}/../librescue/*. CRUNCH_SRCDIRS+= bin CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \ ed expr getfacl hostname kenv kill ln ls mkdir mv \ - pkill ps pwd realpath rm rmdir setfacl sh stty sync test + pkill ps pwd realpath rm rmdir setfacl sh sleep stty \ + sync test CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcapw -lutil -lxo CRUNCH_BUILDTOOLS+= bin/sh From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 03:05:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 88278291; Wed, 3 Dec 2014 03:05:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74770E91; Wed, 3 Dec 2014 03:05:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB335GUT015921; Wed, 3 Dec 2014 03:05:16 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB335GFE015919; Wed, 3 Dec 2014 03:05:16 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201412030305.sB335GFE015919@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Wed, 3 Dec 2014 03:05:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275436 - in head: share/mk usr.sbin/gpioctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 03:05:16 -0000 Author: rpaulo Date: Wed Dec 3 03:05:15 2014 New Revision: 275436 URL: https://svnweb.freebsd.org/changeset/base/275436 Log: Switch gpioctl(8) to LIBADD. Modified: head/share/mk/src.libnames.mk head/usr.sbin/gpioctl/Makefile Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Wed Dec 3 01:34:24 2014 (r275435) +++ head/share/mk/src.libnames.mk Wed Dec 3 03:05:15 2014 (r275436) @@ -84,6 +84,7 @@ _LIBRARIES= \ figpar \ geom \ gnuregex \ + gpio \ gssapi \ gssapi_krb5 \ hdb \ Modified: head/usr.sbin/gpioctl/Makefile ============================================================================== --- head/usr.sbin/gpioctl/Makefile Wed Dec 3 01:34:24 2014 (r275435) +++ head/usr.sbin/gpioctl/Makefile Wed Dec 3 03:05:15 2014 (r275436) @@ -5,7 +5,6 @@ MAN= gpioctl.8 CFLAGS+= -I${.CURDIR}/../../lib/libgpio -DPADD+= ${LIBGPIO} -LDADD+= -lgpio +LIBADD= gpio .include From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 03:17:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69A02532; Wed, 3 Dec 2014 03:17:07 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 4303EF8A; Wed, 3 Dec 2014 03:17:06 +0000 (UTC) Received: from u10-2-32-011.office.norse-data.com (unknown [50.204.88.51]) by elvis.mu.org (Postfix) with ESMTPSA id 1E9B3341F84F; Tue, 2 Dec 2014 19:17:06 -0800 (PST) Message-ID: <547E80B0.8020407@freebsd.org> Date: Tue, 02 Dec 2014 19:17:04 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Jack Vogel , Jack F Vogel Subject: Re: svn commit: r275431 - in head/sys/dev: e1000 ixgbe References: <201412022302.sB2N2w9V002617@svn.freebsd.org> In-Reply-To: Content-Type: multipart/mixed; boundary="------------070409090102030909030801" X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 03:17:07 -0000 This is a multi-part message in MIME format. --------------070409090102030909030801 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Thanks Jack. I do appreciate you reviewing the change and reconsidering the implementation. A few things to note please: 1) The work was submitted for approval, please check your inbox from ~3 weeks ago. I've attached the message for reference. 2) Regarding #2, in FreeBSD past silence, especially for a minor change with good intentions, was considered acceptance. I may have missed an entry somewhere saying where the timeout for acceptance was, and if so, my apologies, however that doesn't seem to be the case. I will in the future give much more space than ~2 weeks for issues in the driver here. 3) In future would appreciate not calling my work sloppy in the commit logs. Commit logs serve as a very public record. Thanks again for considering implementing this another way. It would do a service to us if we could sort out how to tune the drivers only when they become active as it allows us to tune them later by using arbitrary means. I hope we can get something in that works for both of us. -Alfred On 12/2/14 4:10 PM, Jack Vogel wrote: > Just to make it clear, I am not opposed to what this code was trying > to do, in > fact I think its a pretty cool idea, but I think it can be implemented > more cleanly. > > Eric and myself will be discussing the details. > > Jack > > > On Tue, Dec 2, 2014 at 3:02 PM, Jack F Vogel > wrote: > > Author: jfv > Date: Tue Dec 2 23:02:57 2014 > New Revision: 275431 > URL: https://svnweb.freebsd.org/changeset/base/275431 > > Log: > Revert r275136, it was not approved, it was sloppy, if a feature > like this is needed please resubmit for Intel's approval. > > Modified: > head/sys/dev/e1000/if_igb.c > head/sys/dev/ixgbe/ixgbe.c > > Modified: head/sys/dev/e1000/if_igb.c > ============================================================================== > --- head/sys/dev/e1000/if_igb.c Tue Dec 2 22:35:43 2014 (r275430) > +++ head/sys/dev/e1000/if_igb.c Tue Dec 2 23:02:57 2014 (r275431) > @@ -188,7 +188,6 @@ static char *igb_strings[] = { > /********************************************************************* > * Function prototypes > *********************************************************************/ > -static int igb_per_unit_num_queues(SYSCTL_HANDLER_ARGS); > static int igb_probe(device_t); > static int igb_attach(device_t); > static int igb_detach(device_t); > @@ -494,11 +493,6 @@ igb_attach(device_t dev) > OID_AUTO, "nvm", CTLTYPE_INT|CTLFLAG_RW, adapter, 0, > igb_sysctl_nvm_info, "I", "NVM Information"); > > - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), > - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), > - OID_AUTO, "num_queues", CTLTYPE_INT | > CTLFLAG_RD, > - adapter, 0, igb_per_unit_num_queues, "I", > "Number of Queues"); > - > igb_set_sysctl_value(adapter, "enable_aim", > "Interrupt Moderation", &adapter->enable_aim, > igb_enable_aim); > @@ -2837,7 +2831,6 @@ igb_setup_msix(struct adapter *adapter) > { > device_t dev = adapter->dev; > int bar, want, queues, msgs, maxqueues; > - int n_queues; > > /* tuneable override */ > if (igb_enable_msix == 0) > @@ -2865,18 +2858,11 @@ igb_setup_msix(struct adapter *adapter) > goto msi; > } > > - n_queues = 0; > - /* try more specific tunable, then global, then finally > default to boot time tunable if set. */ > - if (device_getenv_int(dev, "num_queues", &n_queues) != 0) { > - device_printf(dev, "using specific tunable > num_queues=%d", n_queues); > - } else if (TUNABLE_INT_FETCH("hw.igb.num_queues", > &n_queues) != 0) { > - if (igb_num_queues != n_queues) { > - device_printf(dev, "using global tunable > hw.igb.num_queues=%d", n_queues); > - igb_num_queues = n_queues; > - } > - } else { > - n_queues = igb_num_queues; > - } > + queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; > + > + /* Override via tuneable */ > + if (igb_num_queues != 0) > + queues = igb_num_queues; > > #ifdef RSS > /* If we're doing RSS, clamp at the number of RSS buckets */ > @@ -2884,12 +2870,6 @@ igb_setup_msix(struct adapter *adapter) > queues = rss_getnumbuckets(); > #endif > > - if (n_queues != 0) { > - queues = n_queues; > - } else { > - /* Figure out a reasonable auto config value */ > - queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; > - } > > /* Sanity check based on HW */ > switch (adapter->hw.mac.type) { > @@ -2912,17 +2892,10 @@ igb_setup_msix(struct adapter *adapter) > maxqueues = 1; > break; > } > - if (queues > maxqueues) { > - device_printf(adapter->dev, "requested %d queues, > but max for this adapter is %d\n", > - queues, maxqueues); > + > + /* Final clamp on the actual hardware capability */ > + if (queues > maxqueues) > queues = maxqueues; > - } else if (queues == 0) { > - queues = 1; > - } else if (queues < 0) { > - device_printf(adapter->dev, "requested %d queues, > but min for this adapter is %d\n", > - queues, 1); > - queues = 1; > - } > > /* > ** One vector (RX/TX pair) per queue > @@ -6407,14 +6380,3 @@ igb_sysctl_eee(SYSCTL_HANDLER_ARGS) > IGB_CORE_UNLOCK(adapter); > return (0); > } > - > -static int > -igb_per_unit_num_queues(SYSCTL_HANDLER_ARGS) > -{ > - struct adapter *adapter; > - > - adapter = (struct adapter *) arg1; > - > - return sysctl_handle_int(oidp, &adapter->num_queues, 0, req); > -} > - > > Modified: head/sys/dev/ixgbe/ixgbe.c > ============================================================================== > --- head/sys/dev/ixgbe/ixgbe.c Tue Dec 2 22:35:43 2014 (r275430) > +++ head/sys/dev/ixgbe/ixgbe.c Tue Dec 2 23:02:57 2014 (r275431) > @@ -103,7 +103,6 @@ static char *ixgbe_strings[] = { > /********************************************************************* > * Function prototypes > *********************************************************************/ > -static int ixgbe_per_unit_num_queues(SYSCTL_HANDLER_ARGS); > static int ixgbe_probe(device_t); > static int ixgbe_attach(device_t); > static int ixgbe_detach(device_t); > @@ -476,11 +475,6 @@ ixgbe_attach(device_t dev) > > SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), > SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), > - OID_AUTO, "num_queues", CTLTYPE_INT | > CTLFLAG_RD, > - adapter, 0, ixgbe_per_unit_num_queues, > "I", "Number of Queues"); > - > - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), > - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), > OID_AUTO, "ts", CTLTYPE_INT | CTLFLAG_RW, > adapter, > 0, ixgbe_set_thermal_test, "I", "Thermal > Test"); > > @@ -2522,7 +2516,6 @@ ixgbe_setup_msix(struct adapter *adapter > { > device_t dev = adapter->dev; > int rid, want, queues, msgs; > - int n_queues; > > /* Override by tuneable */ > if (ixgbe_enable_msix == 0) > @@ -2549,34 +2542,19 @@ ixgbe_setup_msix(struct adapter *adapter > > /* Figure out a reasonable auto config value */ > queues = (mp_ncpus > (msgs-1)) ? (msgs-1) : mp_ncpus; > + > + /* Override based on tuneable */ > + if (ixgbe_num_queues != 0) > + queues = ixgbe_num_queues; > + > #ifdef RSS > /* If we're doing RSS, clamp at the number of RSS buckets */ > if (queues > rss_getnumbuckets()) > queues = rss_getnumbuckets(); > #endif > > - /* try more specific tunable, then global, then finally > default to boot time tunable if set. */ > - if (device_getenv_int(dev, "num_queues", &n_queues) != 0) { > - device_printf(dev, "using specific tunable > numqueues=%d", n_queues); > - } else if (TUNABLE_INT_FETCH("hw.ix.num_queues", > &n_queues) != 0) { > - if (ixgbe_num_queues != n_queues) { > - device_printf(dev, "using global tunable > num_queues=%d", n_queues); > - ixgbe_num_queues = n_queues; > - } > - } else { > - n_queues = ixgbe_num_queues; > - } > - > - if (n_queues < 0) { > - device_printf(dev, "tunable < 0, resetting to > default"); > - n_queues = 0; > - } > - > - if (n_queues != 0) > - queues = n_queues; > - /* Set max queues to 8 when autoconfiguring */ > - else if ((ixgbe_num_queues == 0) && (queues > 8)) > - queues = 8; > + /* reflect correct sysctl value */ > + ixgbe_num_queues = queues; > > /* > ** Want one vector (RX/TX pair) per queue > @@ -5964,15 +5942,6 @@ ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) > return error; > } > > -static int > -ixgbe_per_unit_num_queues(SYSCTL_HANDLER_ARGS) > -{ > - struct adapter *adapter; > - > - adapter = (struct adapter *) arg1; > - > - return sysctl_handle_int(oidp, &adapter->num_queues, 0, req); > -} > > /* > ** Control link advertise speed: > > --------------070409090102030909030801 Content-Type: message/rfc822; name="Attached Message" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="Attached Message" Message-ID: <5467B4AA.7060009@freebsd.org> Date: Sat, 15 Nov 2014 12:16:42 -0800 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: jfv Subject: Fwd: [Differential] [Commented On] D1149: ixgbe and igb should check tunables at load time. Also support per-device queue count. References: In-Reply-To: X-Forwarded-Message-Id: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit JFYI, We are discussing some very minor driver changes here: https://reviews.freebsd.org/D1149 The gist of this change is just to allow later tuning of the num_queues parameter for Intel NICS. Can you please sign up for a phabricator account? https://wiki.freebsd.org/CodeReview -Alfred -------- Original Message -------- Subject: [Differential] [Commented On] D1149: ixgbe and igb should check tunables at load time. Also support per-device queue count. Date: Sat, 15 Nov 2014 20:13:51 +0000 From: alfredperlstein (Alfred Perlstein) To: alfred@freebsd.org alfredperlstein added a comment. I don't know how to do that. Please make 'jfv' an account. REVISION DETAIL https://reviews.freebsd.org/D1149 To: alfredperlstein, glebius, adrian, melifaro, hrs, wollman, bryanv, rpaulo, bz, gnn, hiren, rwatson, smh Cc: ngie, bryanv --------------070409090102030909030801-- From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 03:50:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 463FEDAF; Wed, 3 Dec 2014 03:50:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 328CD2FB; Wed, 3 Dec 2014 03:50:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB33ouPm034875; Wed, 3 Dec 2014 03:50:56 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB33ot5Q034872; Wed, 3 Dec 2014 03:50:55 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412030350.sB33ot5Q034872@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 3 Dec 2014 03:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275437 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 03:50:56 -0000 Author: ae Date: Wed Dec 3 03:50:54 2014 New Revision: 275437 URL: https://svnweb.freebsd.org/changeset/base/275437 Log: ANSIfy function declarations. Sponsored by: Yandex LLC Modified: head/sys/netipsec/key.c head/sys/netipsec/key_debug.c head/sys/netipsec/keysock.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Wed Dec 3 03:05:15 2014 (r275436) +++ head/sys/netipsec/key.c Wed Dec 3 03:50:54 2014 (r275437) @@ -615,7 +615,8 @@ key_havesp(u_int dir) * others: found and return the pointer. */ struct secpolicy * -key_allocsp(struct secpolicyindex *spidx, u_int dir, const char* where, int tag) +key_allocsp(struct secpolicyindex *spidx, u_int dir, const char* where, + int tag) { struct secpolicy *sp; @@ -667,11 +668,8 @@ found: * others: found and return the pointer. */ struct secpolicy * -key_allocsp2(u_int32_t spi, - union sockaddr_union *dst, - u_int8_t proto, - u_int dir, - const char* where, int tag) +key_allocsp2(u_int32_t spi, union sockaddr_union *dst, u_int8_t proto, + u_int dir, const char* where, int tag) { struct secpolicy *sp; @@ -1079,11 +1077,8 @@ key_do_allocsa_policy(struct secashead * * keep source address in IPsec SA. We see a tricky situation here. */ struct secasvar * -key_allocsa( - union sockaddr_union *dst, - u_int proto, - u_int32_t spi, - const char* where, int tag) +key_allocsa(union sockaddr_union *dst, u_int proto, u_int32_t spi, + const char* where, int tag) { struct secashead *sah; struct secasvar *sav; @@ -1404,10 +1399,7 @@ _key_delsp(struct secpolicy *sp) * so must be set properly later. */ struct secpolicy * -key_msg2sp(xpl0, len, error) - struct sadb_x_policy *xpl0; - size_t len; - int *error; +key_msg2sp(struct sadb_x_policy *xpl0, size_t len, int *error) { struct secpolicy *newsp; @@ -1639,8 +1631,7 @@ key_newreqid() * copy secpolicy struct to sadb_x_policy structure indicated. */ struct mbuf * -key_sp2msg(sp) - struct secpolicy *sp; +key_sp2msg(struct secpolicy *sp) { struct sadb_x_policy *xpl; int tlen; @@ -1698,17 +1689,8 @@ key_sp2msg(sp) /* m will not be freed nor modified */ static struct mbuf * -#ifdef __STDC__ key_gather_mbuf(struct mbuf *m, const struct sadb_msghdr *mhp, - int ndeep, int nitem, ...) -#else -key_gather_mbuf(m, mhp, ndeep, nitem, va_alist) - struct mbuf *m; - const struct sadb_msghdr *mhp; - int ndeep; - int nitem; - va_dcl -#endif + int ndeep, int nitem, ...) { va_list ap; int idx; @@ -1797,10 +1779,7 @@ fail: * m will always be freed. */ static int -key_spdadd(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_spdadd(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { struct sadb_address *src0, *dst0; struct sadb_x_policy *xpl0, *xpl; @@ -2062,10 +2041,8 @@ key_getnewspid() * m will always be freed. */ static int -key_spddelete(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_spddelete(struct socket *so, struct mbuf *m, + const struct sadb_msghdr *mhp) { struct sadb_address *src0, *dst0; struct sadb_x_policy *xpl0; @@ -2172,10 +2149,8 @@ key_spddelete(so, m, mhp) * m will always be freed. */ static int -key_spddelete2(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_spddelete2(struct socket *so, struct mbuf *m, + const struct sadb_msghdr *mhp) { u_int32_t id; struct secpolicy *sp; @@ -2266,10 +2241,7 @@ key_spddelete2(so, m, mhp) * m will always be freed. */ static int -key_spdget(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_spdget(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { u_int32_t id; struct secpolicy *sp; @@ -2320,8 +2292,7 @@ key_spdget(so, m, mhp) * others: error number */ int -key_spdacquire(sp) - struct secpolicy *sp; +key_spdacquire(struct secpolicy *sp) { struct mbuf *result = NULL, *m; struct secspacq *newspacq; @@ -2380,10 +2351,7 @@ key_spdacquire(sp) * m will always be freed. */ static int -key_spdflush(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_spdflush(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { struct sadb_msg *newmsg; struct secpolicy *sp; @@ -2432,10 +2400,7 @@ key_spdflush(so, m, mhp) * m will always be freed. */ static int -key_spddump(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_spddump(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { struct secpolicy *sp; int cnt; @@ -2478,7 +2443,8 @@ key_spddump(so, m, mhp) } static struct mbuf * -key_setdumpsp(struct secpolicy *sp, u_int8_t type, u_int32_t seq, u_int32_t pid) +key_setdumpsp(struct secpolicy *sp, u_int8_t type, u_int32_t seq, + u_int32_t pid) { struct mbuf *result = NULL, *m; struct seclifetime lt; @@ -2554,8 +2520,7 @@ fail: * get PFKEY message length for security policy and request. */ static u_int -key_getspreqmsglen(sp) - struct secpolicy *sp; +key_getspreqmsglen(struct secpolicy *sp) { u_int tlen; @@ -2592,8 +2557,7 @@ key_getspreqmsglen(sp) * others : error number */ static int -key_spdexpire(sp) - struct secpolicy *sp; +key_spdexpire(struct secpolicy *sp) { struct mbuf *result = NULL, *m; int len; @@ -2706,8 +2670,7 @@ key_spdexpire(sp) * others : pointer to new SA head. */ static struct secashead * -key_newsah(saidx) - struct secasindex *saidx; +key_newsah(struct secasindex *saidx) { struct secashead *newsah; @@ -2734,8 +2697,7 @@ key_newsah(saidx) * delete SA index and all SA registerd. */ static void -key_delsah(sah) - struct secashead *sah; +key_delsah(struct secashead *sah) { struct secasvar *sav, *nextsav; u_int stateidx; @@ -2786,13 +2748,8 @@ key_delsah(sah) * does not modify mbuf. does not free mbuf on error. */ static struct secasvar * -key_newsav(m, mhp, sah, errp, where, tag) - struct mbuf *m; - const struct sadb_msghdr *mhp; - struct secashead *sah; - int *errp; - const char* where; - int tag; +key_newsav(struct mbuf *m, const struct sadb_msghdr *mhp, + struct secashead *sah, int *errp, const char *where, int tag) { struct secasvar *newsav; const struct sadb_sa *xsa; @@ -2937,8 +2894,7 @@ key_cleansav(struct secasvar *sav) * free() SA variable entry. */ static void -key_delsav(sav) - struct secasvar *sav; +key_delsav(struct secasvar *sav) { IPSEC_ASSERT(sav != NULL, ("null sav")); IPSEC_ASSERT(sav->refcnt == 0, ("reference count %u > 0", sav->refcnt)); @@ -2958,8 +2914,7 @@ key_delsav(sav) * others : found, pointer to a SA. */ static struct secashead * -key_getsah(saidx) - struct secasindex *saidx; +key_getsah(struct secasindex *saidx) { struct secashead *sah; @@ -2983,9 +2938,7 @@ key_getsah(saidx) * others : found, pointer to a SA. */ static struct secasvar * -key_checkspidup(saidx, spi) - struct secasindex *saidx; - u_int32_t spi; +key_checkspidup(struct secasindex *saidx, u_int32_t spi) { struct secashead *sah; struct secasvar *sav; @@ -3019,9 +2972,7 @@ key_checkspidup(saidx, spi) * others : found, pointer to a SA. */ static struct secasvar * -key_getsavbyspi(sah, spi) - struct secashead *sah; - u_int32_t spi; +key_getsavbyspi(struct secashead *sah, u_int32_t spi) { struct secasvar *sav; u_int stateidx, state; @@ -3061,10 +3012,8 @@ key_getsavbyspi(sah, spi) * does not modify mbuf. does not free mbuf on error. */ static int -key_setsaval(sav, m, mhp) - struct secasvar *sav; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_setsaval(struct secasvar *sav, struct mbuf *m, + const struct sadb_msghdr *mhp) { int error = 0; @@ -3602,8 +3551,7 @@ key_setsadbmsg(u_int8_t type, u_int16_t * copy secasvar data into sadb_address. */ static struct mbuf * -key_setsadbsa(sav) - struct secasvar *sav; +key_setsadbsa(struct secasvar *sav) { struct mbuf *m; struct sadb_sa *p; @@ -3633,7 +3581,8 @@ key_setsadbsa(sav) * set data into sadb_address. */ static struct mbuf * -key_setsadbaddr(u_int16_t exttype, const struct sockaddr *saddr, u_int8_t prefixlen, u_int16_t ul_proto) +key_setsadbaddr(u_int16_t exttype, const struct sockaddr *saddr, + u_int8_t prefixlen, u_int16_t ul_proto) { struct mbuf *m; struct sadb_address *p; @@ -3762,7 +3711,7 @@ key_setsadbxport(u_int16_t port, u_int16 /* * Get port from sockaddr. Port is in network byte order. */ -u_int16_t +u_int16_t key_portfromsaddr(struct sockaddr *sa) { @@ -3845,7 +3794,7 @@ key_setsadbxpolicy(u_int16_t type, u_int */ struct seckey * key_dup_keymsg(const struct sadb_key *src, u_int len, - struct malloc_type *type) + struct malloc_type *type) { struct seckey *dst; dst = (struct seckey *)malloc(sizeof(struct seckey), type, M_NOWAIT); @@ -3877,8 +3826,7 @@ key_dup_keymsg(const struct sadb_key *sr */ static struct seclifetime * -key_dup_lifemsg(const struct sadb_lifetime *src, - struct malloc_type *type) +key_dup_lifemsg(const struct sadb_lifetime *src, struct malloc_type *type) { struct seclifetime *dst = NULL; @@ -3929,8 +3877,7 @@ key_ismyaddr(struct sockaddr *sa) #include static int -key_ismyaddr6(sin6) - struct sockaddr_in6 *sin6; +key_ismyaddr6(struct sockaddr_in6 *sin6) { struct in6_ifaddr *ia; #if 0 @@ -3983,10 +3930,8 @@ key_ismyaddr6(sin6) * 0 : not equal */ static int -key_cmpsaidx( - const struct secasindex *saidx0, - const struct secasindex *saidx1, - int flag) +key_cmpsaidx(const struct secasindex *saidx0, const struct secasindex *saidx1, + int flag) { int chkport = 0; @@ -4065,9 +4010,8 @@ key_cmpsaidx( * 0 : not equal */ static int -key_cmpspidx_exactly( - struct secpolicyindex *spidx0, - struct secpolicyindex *spidx1) +key_cmpspidx_exactly(struct secpolicyindex *spidx0, + struct secpolicyindex *spidx1) { /* sanity */ if (spidx0 == NULL && spidx1 == NULL) @@ -4095,9 +4039,8 @@ key_cmpspidx_exactly( * 0 : not equal */ static int -key_cmpspidx_withmask( - struct secpolicyindex *spidx0, - struct secpolicyindex *spidx1) +key_cmpspidx_withmask(struct secpolicyindex *spidx0, + struct secpolicyindex *spidx1) { /* sanity */ if (spidx0 == NULL && spidx1 == NULL) @@ -4188,10 +4131,8 @@ key_cmpspidx_withmask( /* returns 0 on match */ static int -key_sockaddrcmp( - const struct sockaddr *sa1, - const struct sockaddr *sa2, - int port) +key_sockaddrcmp(const struct sockaddr *sa1, const struct sockaddr *sa2, + int port) { #ifdef satosin #undef satosin @@ -4538,9 +4479,7 @@ key_random() } void -key_randomfill(p, l) - void *p; - size_t l; +key_randomfill(void *p, size_t l) { size_t n; u_long v; @@ -4626,10 +4565,7 @@ key_proto2satype(u_int16_t proto) * other if success, return pointer to the message to send. */ static int -key_getspi(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_getspi(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { struct sadb_address *src0, *dst0; struct secasindex saidx; @@ -4861,9 +4797,7 @@ key_getspi(so, m, mhp) * others: success. */ static u_int32_t -key_do_getnewspi(spirange, saidx) - struct sadb_spirange *spirange; - struct secasindex *saidx; +key_do_getnewspi(struct sadb_spirange *spirange, struct secasindex *saidx) { u_int32_t newspi; u_int32_t min, max; @@ -4941,10 +4875,7 @@ key_do_getnewspi(spirange, saidx) * m will always be freed. */ static int -key_update(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_update(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { struct sadb_sa *sa0; struct sadb_address *src0, *dst0; @@ -5188,9 +5119,7 @@ key_update(so, m, mhp) */ #ifdef IPSEC_DOSEQCHECK static struct secasvar * -key_getsavbyseq(sah, seq) - struct secashead *sah; - u_int32_t seq; +key_getsavbyseq(struct secashead *sah, u_int32_t seq) { struct secasvar *sav; u_int state; @@ -5231,10 +5160,7 @@ key_getsavbyseq(sah, seq) * m will always be freed. */ static int -key_add(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_add(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { struct sadb_sa *sa0; struct sadb_address *src0, *dst0; @@ -5445,10 +5371,8 @@ key_add(so, m, mhp) /* m is retained */ static int -key_setident(sah, m, mhp) - struct secashead *sah; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_setident(struct secashead *sah, struct mbuf *m, + const struct sadb_msghdr *mhp) { const struct sadb_ident *idsrc, *iddst; int idsrclen, iddstlen; @@ -5521,9 +5445,7 @@ key_setident(sah, m, mhp) * it is caller's responsibility to free the result. */ static struct mbuf * -key_getmsgbuf_x1(m, mhp) - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_getmsgbuf_x1(struct mbuf *m, const struct sadb_msghdr *mhp) { struct mbuf *n; @@ -5567,10 +5489,7 @@ static int key_delete_all __P((struct so * m will always be freed. */ static int -key_delete(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_delete(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { struct sadb_sa *sa0; struct sadb_address *src0, *dst0; @@ -5714,8 +5633,8 @@ key_delete(so, m, mhp) * delete all SAs for src/dst. Called from key_delete(). */ static int -key_delete_all(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp, - u_int16_t proto) +key_delete_all(struct socket *so, struct mbuf *m, + const struct sadb_msghdr *mhp, u_int16_t proto) { struct sadb_address *src0, *dst0; struct secasindex saidx; @@ -5835,10 +5754,7 @@ key_delete_all(struct socket *so, struct * m will always be freed. */ static int -key_get(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_get(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { struct sadb_sa *sa0; struct sadb_address *src0, *dst0; @@ -5961,8 +5877,7 @@ key_get(so, m, mhp) /* XXX make it sysctl-configurable? */ static void -key_getcomb_setlifetime(comb) - struct sadb_comb *comb; +key_getcomb_setlifetime(struct sadb_comb *comb) { comb->sadb_comb_soft_allocations = 1; @@ -6054,11 +5969,8 @@ key_getcomb_esp() } static void -key_getsizes_ah( - const struct auth_hash *ah, - int alg, - u_int16_t* min, - u_int16_t* max) +key_getsizes_ah(const struct auth_hash *ah, int alg, u_int16_t* min, + u_int16_t* max) { *min = *max = ah->keysize; @@ -6188,8 +6100,7 @@ key_getcomb_ipcomp() * XXX sysctl interface to ipsec_{ah,esp}_keymin */ static struct mbuf * -key_getprop(saidx) - const struct secasindex *saidx; +key_getprop(const struct secasindex *saidx) { struct sadb_prop *prop; struct mbuf *m, *n; @@ -6461,8 +6372,7 @@ key_getacq(const struct secasindex *said } static struct secacq * -key_getacqbyseq(seq) - u_int32_t seq; +key_getacqbyseq(u_int32_t seq) { struct secacq *acq; @@ -6477,8 +6387,7 @@ key_getacqbyseq(seq) } static struct secspacq * -key_newspacq(spidx) - struct secpolicyindex *spidx; +key_newspacq(struct secpolicyindex *spidx) { struct secspacq *acq; @@ -6503,8 +6412,7 @@ key_newspacq(spidx) } static struct secspacq * -key_getspacq(spidx) - struct secpolicyindex *spidx; +key_getspacq(struct secpolicyindex *spidx) { struct secspacq *acq; @@ -6535,10 +6443,7 @@ key_getspacq(spidx) * m will always be freed. */ static int -key_acquire2(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_acquire2(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { const struct sadb_address *src0, *dst0; struct secasindex saidx; @@ -6693,10 +6598,7 @@ key_acquire2(so, m, mhp) * m will always be freed. */ static int -key_register(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_register(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { struct secreg *reg, *newreg = 0; @@ -7016,10 +6918,7 @@ key_expire(struct secasvar *sav) * m will always be freed. */ static int -key_flush(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_flush(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { struct sadb_msg *newmsg; struct secashead *sah, *nextsah; @@ -7099,10 +6998,7 @@ key_flush(so, m, mhp) * m will always be freed. */ static int -key_dump(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_dump(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { struct secashead *sah; struct secasvar *sav; @@ -7191,10 +7087,7 @@ key_dump(so, m, mhp) * m will always be freed. */ static int -key_promisc(so, m, mhp) - struct socket *so; - struct mbuf *m; - const struct sadb_msghdr *mhp; +key_promisc(struct socket *so, struct mbuf *m, const struct sadb_msghdr *mhp) { int olen; @@ -7280,9 +7173,7 @@ static int (*key_typesw[]) __P((struct s * length for buffer to send to user process. */ int -key_parse(m, so) - struct mbuf *m; - struct socket *so; +key_parse(struct mbuf *m, struct socket *so) { struct sadb_msg *msg; struct sadb_msghdr mh; @@ -7530,10 +7421,7 @@ senderror: } static int -key_senderror(so, m, code) - struct socket *so; - struct mbuf *m; - int code; +key_senderror(struct socket *so, struct mbuf *m, int code) { struct sadb_msg *msg; @@ -7551,9 +7439,7 @@ key_senderror(so, m, code) * XXX larger-than-MCLBYTES extension? */ static int -key_align(m, mhp) - struct mbuf *m; - struct sadb_msghdr *mhp; +key_align(struct mbuf *m, struct sadb_msghdr *mhp) { struct mbuf *n; struct sadb_ext *ext; @@ -7661,9 +7547,7 @@ key_align(m, mhp) } static int -key_validate_ext(ext, len) - const struct sadb_ext *ext; - int len; +key_validate_ext(const struct sadb_ext *ext, int len) { const struct sockaddr *sa; enum { NONE, ADDR } checktype = NONE; @@ -7837,11 +7721,8 @@ key_destroy(void) * xxx more checks to be provided */ int -key_checktunnelsanity(sav, family, src, dst) - struct secasvar *sav; - u_int family; - caddr_t src; - caddr_t dst; +key_checktunnelsanity(struct secasvar *sav, u_int family, caddr_t src, + caddr_t dst) { IPSEC_ASSERT(sav->sah != NULL, ("null SA header")); @@ -7852,9 +7733,7 @@ key_checktunnelsanity(sav, family, src, /* record data transfer on SA, and update timestamps */ void -key_sa_recordxfer(sav, m) - struct secasvar *sav; - struct mbuf *m; +key_sa_recordxfer(struct secasvar *sav, struct mbuf *m) { IPSEC_ASSERT(sav != NULL, ("Null secasvar")); IPSEC_ASSERT(m != NULL, ("Null mbuf")); @@ -7908,8 +7787,7 @@ key_sa_chgstate(struct secasvar *sav, u_ } void -key_sa_stir_iv(sav) - struct secasvar *sav; +key_sa_stir_iv(struct secasvar *sav) { IPSEC_ASSERT(sav->iv != NULL, ("null IV")); Modified: head/sys/netipsec/key_debug.c ============================================================================== --- head/sys/netipsec/key_debug.c Wed Dec 3 03:05:15 2014 (r275436) +++ head/sys/netipsec/key_debug.c Wed Dec 3 03:50:54 2014 (r275437) @@ -83,8 +83,7 @@ static void kdebug_secreplay __P((struct /* %%%: about struct sadb_msg */ void -kdebug_sadb(base) - struct sadb_msg *base; +kdebug_sadb(struct sadb_msg *base) { struct sadb_ext *ext; int tlen, extlen; @@ -172,8 +171,7 @@ kdebug_sadb(base) } static void -kdebug_sadb_prop(ext) - struct sadb_ext *ext; +kdebug_sadb_prop(struct sadb_ext *ext) { struct sadb_prop *prop = (struct sadb_prop *)ext; struct sadb_comb *comb; @@ -222,8 +220,7 @@ kdebug_sadb_prop(ext) } static void -kdebug_sadb_identity(ext) - struct sadb_ext *ext; +kdebug_sadb_identity(struct sadb_ext *ext) { struct sadb_ident *id = (struct sadb_ident *)ext; int len; @@ -265,8 +262,7 @@ kdebug_sadb_identity(ext) } static void -kdebug_sadb_supported(ext) - struct sadb_ext *ext; +kdebug_sadb_supported(struct sadb_ext *ext) { struct sadb_supported *sup = (struct sadb_supported *)ext; struct sadb_alg *alg; @@ -292,8 +288,7 @@ kdebug_sadb_supported(ext) } static void -kdebug_sadb_lifetime(ext) - struct sadb_ext *ext; +kdebug_sadb_lifetime(struct sadb_ext *ext) { struct sadb_lifetime *lft = (struct sadb_lifetime *)ext; @@ -312,8 +307,7 @@ kdebug_sadb_lifetime(ext) } static void -kdebug_sadb_sa(ext) - struct sadb_ext *ext; +kdebug_sadb_sa(struct sadb_ext *ext) { struct sadb_sa *sa = (struct sadb_sa *)ext; @@ -331,8 +325,7 @@ kdebug_sadb_sa(ext) } static void -kdebug_sadb_address(ext) - struct sadb_ext *ext; +kdebug_sadb_address(struct sadb_ext *ext) { struct sadb_address *addr = (struct sadb_address *)ext; @@ -351,8 +344,7 @@ kdebug_sadb_address(ext) } static void -kdebug_sadb_key(ext) - struct sadb_ext *ext; +kdebug_sadb_key(struct sadb_ext *ext) { struct sadb_key *key = (struct sadb_key *)ext; @@ -380,8 +372,7 @@ kdebug_sadb_key(ext) } static void -kdebug_sadb_x_sa2(ext) - struct sadb_ext *ext; +kdebug_sadb_x_sa2(struct sadb_ext *ext) { struct sadb_x_sa2 *sa2 = (struct sadb_x_sa2 *)ext; @@ -399,8 +390,7 @@ kdebug_sadb_x_sa2(ext) } void -kdebug_sadb_x_policy(ext) - struct sadb_ext *ext; +kdebug_sadb_x_policy(struct sadb_ext *ext) { struct sadb_x_policy *xpl = (struct sadb_x_policy *)ext; struct sockaddr *addr; @@ -467,8 +457,7 @@ kdebug_sadb_x_policy(ext) #ifdef _KERNEL /* %%%: about SPD and SAD */ void -kdebug_secpolicy(sp) - struct secpolicy *sp; +kdebug_secpolicy(struct secpolicy *sp) { /* sanity check */ if (sp == NULL) @@ -515,8 +504,7 @@ kdebug_secpolicy(sp) } void -kdebug_secpolicyindex(spidx) - struct secpolicyindex *spidx; +kdebug_secpolicyindex(struct secpolicyindex *spidx) { /* sanity check */ if (spidx == NULL) @@ -536,8 +524,7 @@ kdebug_secpolicyindex(spidx) } void -kdebug_secasindex(saidx) - struct secasindex *saidx; +kdebug_secasindex(struct secasindex *saidx) { /* sanity check */ if (saidx == NULL) @@ -572,8 +559,7 @@ kdebug_sec_lifetime(struct seclifetime * } void -kdebug_secasv(sav) - struct secasvar *sav; +kdebug_secasv(struct secasvar *sav) { /* sanity check */ if (sav == NULL) @@ -614,8 +600,7 @@ kdebug_secasv(sav) } static void -kdebug_secreplay(rpl) - struct secreplay *rpl; +kdebug_secreplay(struct secreplay *rpl) { int len, l; @@ -643,8 +628,7 @@ kdebug_secreplay(rpl) } void -kdebug_mbufhdr(m) - struct mbuf *m; +kdebug_mbufhdr(struct mbuf *m) { /* sanity check */ if (m == NULL) @@ -671,8 +655,7 @@ kdebug_mbufhdr(m) } void -kdebug_mbuf(m0) - struct mbuf *m0; +kdebug_mbuf(struct mbuf *m0) { struct mbuf *m = m0; int i, j; @@ -696,8 +679,7 @@ kdebug_mbuf(m0) #endif /* _KERNEL */ void -kdebug_sockaddr(addr) - struct sockaddr *addr; +kdebug_sockaddr(struct sockaddr *addr) { struct sockaddr_in *sin4; #ifdef INET6 @@ -735,9 +717,7 @@ kdebug_sockaddr(addr) } void -ipsec_bindump(buf, len) - caddr_t buf; - int len; +ipsec_bindump(caddr_t buf, int len) { int i; @@ -749,9 +729,7 @@ ipsec_bindump(buf, len) void -ipsec_hexdump(buf, len) - caddr_t buf; - int len; +ipsec_hexdump(caddr_t buf, int len) { int i; Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Wed Dec 3 03:05:15 2014 (r275436) +++ head/sys/netipsec/keysock.c Wed Dec 3 03:50:54 2014 (r275437) @@ -137,10 +137,7 @@ end: * send message to the socket. */ static int -key_sendup0(rp, m, promisc) - struct rawcb *rp; - struct mbuf *m; - int promisc; +key_sendup0(struct rawcb *rp, struct mbuf *m, int promisc) { int error; @@ -178,11 +175,7 @@ key_sendup0(rp, m, promisc) /* XXX this interface should be obsoleted. */ int -key_sendup(so, msg, len, target) - struct socket *so; - struct sadb_msg *msg; - u_int len; - int target; /*target of the resulting message*/ +key_sendup(struct socket *so, struct sadb_msg *msg, u_int len, int target) { struct mbuf *m, *n, *mprev; int tlen; @@ -267,10 +260,7 @@ key_sendup(so, msg, len, target) /* so can be NULL if target != KEY_SENDUP_ONE */ int -key_sendup_mbuf(so, m, target) - struct socket *so; - struct mbuf *m; - int target; +key_sendup_mbuf(struct socket *so, struct mbuf *m, int target) { struct mbuf *n; struct keycb *kp; From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 04:08:44 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B436D2AD; Wed, 3 Dec 2014 04:08:44 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9DB3B688; Wed, 3 Dec 2014 04:08:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB348ijP042859; Wed, 3 Dec 2014 04:08:44 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB348g9A042843; Wed, 3 Dec 2014 04:08:42 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412030408.sB348g9A042843@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 3 Dec 2014 04:08:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275438 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 04:08:44 -0000 Author: ae Date: Wed Dec 3 04:08:41 2014 New Revision: 275438 URL: https://svnweb.freebsd.org/changeset/base/275438 Log: Remove __P() macro. Suggested by: kevlo Sponsored by: Yandex LLC Modified: head/sys/netipsec/ipsec.c head/sys/netipsec/ipsec.h head/sys/netipsec/ipsec6.h head/sys/netipsec/key.c head/sys/netipsec/key.h head/sys/netipsec/key_debug.c head/sys/netipsec/key_debug.h head/sys/netipsec/keydb.h head/sys/netipsec/keysock.c head/sys/netipsec/keysock.h Modified: head/sys/netipsec/ipsec.c ============================================================================== --- head/sys/netipsec/ipsec.c Wed Dec 3 03:50:54 2014 (r275437) +++ head/sys/netipsec/ipsec.c Wed Dec 3 04:08:41 2014 (r275438) @@ -237,17 +237,17 @@ SYSCTL_VNET_PCPUSTAT(_net_inet6_ipsec6, struct ipsecstat, ipsec6stat, "IPsec IPv6 statistics."); #endif /* INET6 */ -static int ipsec_setspidx_inpcb __P((struct mbuf *, struct inpcb *)); -static int ipsec_setspidx __P((struct mbuf *, struct secpolicyindex *, int)); -static void ipsec4_get_ulp __P((struct mbuf *m, struct secpolicyindex *, int)); -static int ipsec4_setspidx_ipaddr __P((struct mbuf *, struct secpolicyindex *)); +static int ipsec_setspidx_inpcb(struct mbuf *, struct inpcb *); +static int ipsec_setspidx(struct mbuf *, struct secpolicyindex *, int); +static void ipsec4_get_ulp(struct mbuf *m, struct secpolicyindex *, int); +static int ipsec4_setspidx_ipaddr(struct mbuf *, struct secpolicyindex *); #ifdef INET6 -static void ipsec6_get_ulp __P((struct mbuf *m, struct secpolicyindex *, int)); -static int ipsec6_setspidx_ipaddr __P((struct mbuf *, struct secpolicyindex *)); +static void ipsec6_get_ulp(struct mbuf *m, struct secpolicyindex *, int); +static int ipsec6_setspidx_ipaddr(struct mbuf *, struct secpolicyindex *); #endif -static void ipsec_delpcbpolicy __P((struct inpcbpolicy *)); -static struct secpolicy *ipsec_deepcopy_policy __P((struct secpolicy *src)); -static void vshiftl __P((unsigned char *, int, int)); +static void ipsec_delpcbpolicy(struct inpcbpolicy *); +static struct secpolicy *ipsec_deepcopy_policy(struct secpolicy *src); +static void vshiftl(unsigned char *, int, int); MALLOC_DEFINE(M_IPSEC_INPCB, "inpcbpolicy", "inpcb-resident ipsec policy"); Modified: head/sys/netipsec/ipsec.h ============================================================================== --- head/sys/netipsec/ipsec.h Wed Dec 3 03:50:54 2014 (r275437) +++ head/sys/netipsec/ipsec.h Wed Dec 3 04:08:41 2014 (r275438) @@ -311,40 +311,39 @@ extern struct ipsecrequest *ipsec_newisr extern void ipsec_delisr(struct ipsecrequest *); struct tdb_ident; -extern struct secpolicy *ipsec_getpolicy __P((struct tdb_ident*, u_int)); +extern struct secpolicy *ipsec_getpolicy(struct tdb_ident*, u_int); struct inpcb; -extern struct secpolicy *ipsec4_checkpolicy __P((struct mbuf *, u_int, u_int, - int *, struct inpcb *)); +extern struct secpolicy *ipsec4_checkpolicy(struct mbuf *, u_int, u_int, + int *, struct inpcb *); extern struct secpolicy * ipsec_getpolicybyaddr(struct mbuf *, u_int, int, int *); struct inpcb; -extern int ipsec_init_policy __P((struct socket *so, struct inpcbpolicy **)); -extern int ipsec_copy_policy - __P((struct inpcbpolicy *, struct inpcbpolicy *)); -extern u_int ipsec_get_reqlevel __P((struct ipsecrequest *)); -extern int ipsec_in_reject __P((struct secpolicy *, struct mbuf *)); - -extern int ipsec_set_policy __P((struct inpcb *inp, int optname, - caddr_t request, size_t len, struct ucred *cred)); -extern int ipsec_get_policy __P((struct inpcb *inpcb, caddr_t request, - size_t len, struct mbuf **mp)); -extern int ipsec_delete_pcbpolicy __P((struct inpcb *)); -extern int ipsec4_in_reject __P((struct mbuf *, struct inpcb *)); +extern int ipsec_init_policy(struct socket *so, struct inpcbpolicy **); +extern int ipsec_copy_policy(struct inpcbpolicy *, struct inpcbpolicy *); +extern u_int ipsec_get_reqlevel(struct ipsecrequest *); +extern int ipsec_in_reject(struct secpolicy *, struct mbuf *); + +extern int ipsec_set_policy(struct inpcb *inp, int optname, + caddr_t request, size_t len, struct ucred *cred); +extern int ipsec_get_policy(struct inpcb *inpcb, caddr_t request, + size_t len, struct mbuf **mp); +extern int ipsec_delete_pcbpolicy(struct inpcb *); +extern int ipsec4_in_reject(struct mbuf *, struct inpcb *); struct secas; struct tcpcb; -extern int ipsec_chkreplay __P((u_int32_t, struct secasvar *)); -extern int ipsec_updatereplay __P((u_int32_t, struct secasvar *)); +extern int ipsec_chkreplay(u_int32_t, struct secasvar *); +extern int ipsec_updatereplay(u_int32_t, struct secasvar *); -extern size_t ipsec_hdrsiz __P((struct mbuf *, u_int, struct inpcb *)); -extern size_t ipsec_hdrsiz_tcp __P((struct tcpcb *)); +extern size_t ipsec_hdrsiz(struct mbuf *, u_int, struct inpcb *); +extern size_t ipsec_hdrsiz_tcp(struct tcpcb *); union sockaddr_union; extern char * ipsec_address(union sockaddr_union* sa); -extern const char *ipsec_logsastr __P((struct secasvar *)); +extern const char *ipsec_logsastr(struct secasvar *); -extern void ipsec_dumpmbuf __P((struct mbuf *)); +extern void ipsec_dumpmbuf(struct mbuf *); struct m_tag; extern int ah4_input(struct mbuf **mp, int *offp, int proto); @@ -355,11 +354,11 @@ extern int ipcomp4_input(struct mbuf **m extern int ipsec4_common_input(struct mbuf *m, ...); extern int ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip, int protoff, struct m_tag *mt); -extern int ipsec4_process_packet __P((struct mbuf *, struct ipsecrequest *, - int, int)); -extern int ipsec_process_done __P((struct mbuf *, struct ipsecrequest *)); +extern int ipsec4_process_packet(struct mbuf *, struct ipsecrequest *, + int, int); +extern int ipsec_process_done(struct mbuf *, struct ipsecrequest *); -extern struct mbuf *ipsec_copypkt __P((struct mbuf *)); +extern struct mbuf *ipsec_copypkt(struct mbuf *); extern void m_checkalignment(const char* where, struct mbuf *m0, int off, int len); @@ -378,11 +377,10 @@ extern void ipsec_bpf(struct mbuf *, str #endif /* _KERNEL */ #ifndef _KERNEL -extern caddr_t ipsec_set_policy __P((char *, int)); -extern int ipsec_get_policylen __P((caddr_t)); -extern char *ipsec_dump_policy __P((caddr_t, char *)); - -extern const char *ipsec_strerror __P((void)); +extern caddr_t ipsec_set_policy(char *, int); +extern int ipsec_get_policylen(caddr_t); +extern char *ipsec_dump_policy(caddr_t, char *); +extern const char *ipsec_strerror(void); #endif /* ! KERNEL */ Modified: head/sys/netipsec/ipsec6.h ============================================================================== --- head/sys/netipsec/ipsec6.h Wed Dec 3 03:50:54 2014 (r275437) +++ head/sys/netipsec/ipsec6.h Wed Dec 3 04:08:41 2014 (r275438) @@ -59,7 +59,7 @@ VNET_DECLARE(int, ip6_ipsec_ecn); #define V_ip6_ipsec_ecn VNET(ip6_ipsec_ecn) struct inpcb; -extern int ipsec6_in_reject __P((struct mbuf *, struct inpcb *)); +extern int ipsec6_in_reject(struct mbuf *, struct inpcb *); struct m_tag; extern int ipsec6_common_input(struct mbuf **mp, int *offp, int proto); Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Wed Dec 3 03:50:54 2014 (r275437) +++ head/sys/netipsec/key.c Wed Dec 3 04:08:41 2014 (r275438) @@ -413,54 +413,54 @@ struct sadb_msghdr { static struct callout key_timer; #endif -static struct secasvar *key_allocsa_policy __P((const struct secasindex *)); -static void key_freesp_so __P((struct secpolicy **)); -static struct secasvar *key_do_allocsa_policy __P((struct secashead *, u_int)); -static void key_delsp __P((struct secpolicy *)); -static struct secpolicy *key_getsp __P((struct secpolicyindex *)); +static struct secasvar *key_allocsa_policy(const struct secasindex *); +static void key_freesp_so(struct secpolicy **); +static struct secasvar *key_do_allocsa_policy(struct secashead *, u_int); +static void key_delsp(struct secpolicy *); +static struct secpolicy *key_getsp(struct secpolicyindex *); static void _key_delsp(struct secpolicy *sp); -static struct secpolicy *key_getspbyid __P((u_int32_t)); -static u_int32_t key_newreqid __P((void)); -static struct mbuf *key_gather_mbuf __P((struct mbuf *, - const struct sadb_msghdr *, int, int, ...)); -static int key_spdadd __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); -static u_int32_t key_getnewspid __P((void)); -static int key_spddelete __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); -static int key_spddelete2 __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); -static int key_spdget __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); -static int key_spdflush __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); -static int key_spddump __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); -static struct mbuf *key_setdumpsp __P((struct secpolicy *, - u_int8_t, u_int32_t, u_int32_t)); -static u_int key_getspreqmsglen __P((struct secpolicy *)); -static int key_spdexpire __P((struct secpolicy *)); -static struct secashead *key_newsah __P((struct secasindex *)); -static void key_delsah __P((struct secashead *)); -static struct secasvar *key_newsav __P((struct mbuf *, +static struct secpolicy *key_getspbyid(u_int32_t); +static u_int32_t key_newreqid(void); +static struct mbuf *key_gather_mbuf(struct mbuf *, + const struct sadb_msghdr *, int, int, ...); +static int key_spdadd(struct socket *, struct mbuf *, + const struct sadb_msghdr *); +static u_int32_t key_getnewspid(void); +static int key_spddelete(struct socket *, struct mbuf *, + const struct sadb_msghdr *); +static int key_spddelete2(struct socket *, struct mbuf *, + const struct sadb_msghdr *); +static int key_spdget(struct socket *, struct mbuf *, + const struct sadb_msghdr *); +static int key_spdflush(struct socket *, struct mbuf *, + const struct sadb_msghdr *); +static int key_spddump(struct socket *, struct mbuf *, + const struct sadb_msghdr *); +static struct mbuf *key_setdumpsp(struct secpolicy *, + u_int8_t, u_int32_t, u_int32_t); +static u_int key_getspreqmsglen(struct secpolicy *); +static int key_spdexpire(struct secpolicy *); +static struct secashead *key_newsah(struct secasindex *); +static void key_delsah(struct secashead *); +static struct secasvar *key_newsav(struct mbuf *, const struct sadb_msghdr *, struct secashead *, int *, - const char*, int)); + const char*, int); #define KEY_NEWSAV(m, sadb, sah, e) \ key_newsav(m, sadb, sah, e, __FILE__, __LINE__) -static void key_delsav __P((struct secasvar *)); -static struct secashead *key_getsah __P((struct secasindex *)); -static struct secasvar *key_checkspidup __P((struct secasindex *, u_int32_t)); -static struct secasvar *key_getsavbyspi __P((struct secashead *, u_int32_t)); -static int key_setsaval __P((struct secasvar *, struct mbuf *, - const struct sadb_msghdr *)); -static int key_mature __P((struct secasvar *)); -static struct mbuf *key_setdumpsa __P((struct secasvar *, u_int8_t, - u_int8_t, u_int32_t, u_int32_t)); -static struct mbuf *key_setsadbmsg __P((u_int8_t, u_int16_t, u_int8_t, - u_int32_t, pid_t, u_int16_t)); -static struct mbuf *key_setsadbsa __P((struct secasvar *)); -static struct mbuf *key_setsadbaddr __P((u_int16_t, - const struct sockaddr *, u_int8_t, u_int16_t)); +static void key_delsav(struct secasvar *); +static struct secashead *key_getsah(struct secasindex *); +static struct secasvar *key_checkspidup(struct secasindex *, u_int32_t); +static struct secasvar *key_getsavbyspi(struct secashead *, u_int32_t); +static int key_setsaval(struct secasvar *, struct mbuf *, + const struct sadb_msghdr *); +static int key_mature(struct secasvar *); +static struct mbuf *key_setdumpsa(struct secasvar *, u_int8_t, + u_int8_t, u_int32_t, u_int32_t); +static struct mbuf *key_setsadbmsg(u_int8_t, u_int16_t, u_int8_t, + u_int32_t, pid_t, u_int16_t); +static struct mbuf *key_setsadbsa(struct secasvar *); +static struct mbuf *key_setsadbaddr(u_int16_t, + const struct sockaddr *, u_int8_t, u_int16_t); #ifdef IPSEC_NAT_T static struct mbuf *key_setsadbxport(u_int16_t, u_int16_t); static struct mbuf *key_setsadbxtype(u_int16_t); @@ -468,15 +468,15 @@ static struct mbuf *key_setsadbxtype(u_i static void key_porttosaddr(struct sockaddr *, u_int16_t); #define KEY_PORTTOSADDR(saddr, port) \ key_porttosaddr((struct sockaddr *)(saddr), (port)) -static struct mbuf *key_setsadbxsa2 __P((u_int8_t, u_int32_t, u_int32_t)); -static struct mbuf *key_setsadbxpolicy __P((u_int16_t, u_int8_t, - u_int32_t)); +static struct mbuf *key_setsadbxsa2(u_int8_t, u_int32_t, u_int32_t); +static struct mbuf *key_setsadbxpolicy(u_int16_t, u_int8_t, + u_int32_t); static struct seckey *key_dup_keymsg(const struct sadb_key *, u_int, struct malloc_type *); static struct seclifetime *key_dup_lifemsg(const struct sadb_lifetime *src, struct malloc_type *type); #ifdef INET6 -static int key_ismyaddr6 __P((struct sockaddr_in6 *)); +static int key_ismyaddr6(struct sockaddr_in6 *); #endif /* flags for key_cmpsaidx() */ @@ -484,73 +484,75 @@ static int key_ismyaddr6 __P((struct soc #define CMP_MODE_REQID 2 /* additionally HEAD, reqid, mode. */ #define CMP_REQID 3 /* additionally HEAD, reaid. */ #define CMP_EXACTLY 4 /* all elements. */ -static int key_cmpsaidx - __P((const struct secasindex *, const struct secasindex *, int)); - -static int key_cmpspidx_exactly - __P((struct secpolicyindex *, struct secpolicyindex *)); -static int key_cmpspidx_withmask - __P((struct secpolicyindex *, struct secpolicyindex *)); -static int key_sockaddrcmp __P((const struct sockaddr *, const struct sockaddr *, int)); -static int key_bbcmp __P((const void *, const void *, u_int)); -static u_int16_t key_satype2proto __P((u_int8_t)); -static u_int8_t key_proto2satype __P((u_int16_t)); - -static int key_getspi __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); -static u_int32_t key_do_getnewspi __P((struct sadb_spirange *, - struct secasindex *)); -static int key_update __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); +static int key_cmpsaidx(const struct secasindex *, + const struct secasindex *, int); +static int key_cmpspidx_exactly(struct secpolicyindex *, + struct secpolicyindex *); +static int key_cmpspidx_withmask(struct secpolicyindex *, + struct secpolicyindex *); +static int key_sockaddrcmp(const struct sockaddr *, + const struct sockaddr *, int); +static int key_bbcmp(const void *, const void *, u_int); +static u_int16_t key_satype2proto(u_int8_t); +static u_int8_t key_proto2satype(u_int16_t); + +static int key_getspi(struct socket *, struct mbuf *, + const struct sadb_msghdr *); +static u_int32_t key_do_getnewspi(struct sadb_spirange *, + struct secasindex *); +static int key_update(struct socket *, struct mbuf *, + const struct sadb_msghdr *); #ifdef IPSEC_DOSEQCHECK -static struct secasvar *key_getsavbyseq __P((struct secashead *, u_int32_t)); +static struct secasvar *key_getsavbyseq(struct secashead *, u_int32_t); #endif -static int key_add __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); -static int key_setident __P((struct secashead *, struct mbuf *, - const struct sadb_msghdr *)); -static struct mbuf *key_getmsgbuf_x1 __P((struct mbuf *, - const struct sadb_msghdr *)); -static int key_delete __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); -static int key_get __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); - -static void key_getcomb_setlifetime __P((struct sadb_comb *)); -static struct mbuf *key_getcomb_esp __P((void)); -static struct mbuf *key_getcomb_ah __P((void)); -static struct mbuf *key_getcomb_ipcomp __P((void)); -static struct mbuf *key_getprop __P((const struct secasindex *)); - -static int key_acquire __P((const struct secasindex *, struct secpolicy *)); -static struct secacq *key_newacq __P((const struct secasindex *)); -static struct secacq *key_getacq __P((const struct secasindex *)); -static struct secacq *key_getacqbyseq __P((u_int32_t)); -static struct secspacq *key_newspacq __P((struct secpolicyindex *)); -static struct secspacq *key_getspacq __P((struct secpolicyindex *)); -static int key_acquire2 __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); -static int key_register __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); -static int key_expire __P((struct secasvar *)); -static int key_flush __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); -static int key_dump __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); -static int key_promisc __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)); -static int key_senderror __P((struct socket *, struct mbuf *, int)); -static int key_validate_ext __P((const struct sadb_ext *, int)); -static int key_align __P((struct mbuf *, struct sadb_msghdr *)); +static int key_add(struct socket *, struct mbuf *, + const struct sadb_msghdr *); +static int key_setident(struct secashead *, struct mbuf *, + const struct sadb_msghdr *); +static struct mbuf *key_getmsgbuf_x1(struct mbuf *, + const struct sadb_msghdr *); +static int key_delete(struct socket *, struct mbuf *, + const struct sadb_msghdr *); +static int key_delete_all(struct socket *, struct mbuf *, + const struct sadb_msghdr *, u_int16_t); +static int key_get(struct socket *, struct mbuf *, + const struct sadb_msghdr *); + +static void key_getcomb_setlifetime(struct sadb_comb *); +static struct mbuf *key_getcomb_esp(void); +static struct mbuf *key_getcomb_ah(void); +static struct mbuf *key_getcomb_ipcomp(void); +static struct mbuf *key_getprop(const struct secasindex *); + +static int key_acquire(const struct secasindex *, struct secpolicy *); +static struct secacq *key_newacq(const struct secasindex *); +static struct secacq *key_getacq(const struct secasindex *); +static struct secacq *key_getacqbyseq(u_int32_t); +static struct secspacq *key_newspacq(struct secpolicyindex *); +static struct secspacq *key_getspacq(struct secpolicyindex *); +static int key_acquire2(struct socket *, struct mbuf *, + const struct sadb_msghdr *); +static int key_register(struct socket *, struct mbuf *, + const struct sadb_msghdr *); +static int key_expire(struct secasvar *); +static int key_flush(struct socket *, struct mbuf *, + const struct sadb_msghdr *); +static int key_dump(struct socket *, struct mbuf *, + const struct sadb_msghdr *); +static int key_promisc(struct socket *, struct mbuf *, + const struct sadb_msghdr *); +static int key_senderror(struct socket *, struct mbuf *, int); +static int key_validate_ext(const struct sadb_ext *, int); +static int key_align(struct mbuf *, struct sadb_msghdr *); static struct mbuf *key_setlifetime(struct seclifetime *src, u_int16_t exttype); static struct mbuf *key_setkey(struct seckey *src, u_int16_t exttype); #if 0 -static const char *key_getfqdn __P((void)); -static const char *key_getuserfqdn __P((void)); +static const char *key_getfqdn(void); +static const char *key_getuserfqdn(void); #endif -static void key_sa_chgstate __P((struct secasvar *, u_int8_t)); +static void key_sa_chgstate(struct secasvar *, u_int8_t); static __inline void sa_initref(struct secasvar *sav) @@ -5474,9 +5476,6 @@ key_getmsgbuf_x1(struct mbuf *m, const s return n; } -static int key_delete_all __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *, u_int16_t)); - /* * SADB_DELETE processing * receive @@ -7134,8 +7133,8 @@ key_promisc(struct socket *so, struct mb } } -static int (*key_typesw[]) __P((struct socket *, struct mbuf *, - const struct sadb_msghdr *)) = { +static int (*key_typesw[])(struct socket *, struct mbuf *, + const struct sadb_msghdr *) = { NULL, /* SADB_RESERVED */ key_getspi, /* SADB_GETSPI */ key_update, /* SADB_UPDATE */ Modified: head/sys/netipsec/key.h ============================================================================== --- head/sys/netipsec/key.h Wed Dec 3 03:50:54 2014 (r275437) +++ head/sys/netipsec/key.h Wed Dec 3 04:08:41 2014 (r275438) @@ -86,27 +86,26 @@ extern void key_freesav(struct secasvar #define KEY_FREESAV(psav) \ key_freesav(psav, __FILE__, __LINE__) -extern void key_freeso __P((struct socket *)); -extern int key_checktunnelsanity __P((struct secasvar *, u_int, - caddr_t, caddr_t)); -extern int key_checkrequest - __P((struct ipsecrequest *isr, const struct secasindex *)); - -extern struct secpolicy *key_msg2sp __P((struct sadb_x_policy *, - size_t, int *)); -extern struct mbuf *key_sp2msg __P((struct secpolicy *)); -extern int key_ismyaddr __P((struct sockaddr *)); -extern int key_spdacquire __P((struct secpolicy *)); -extern u_long key_random __P((void)); -extern void key_randomfill __P((void *, size_t)); -extern void key_freereg __P((struct socket *)); -extern int key_parse __P((struct mbuf *, struct socket *)); -extern void key_init __P((void)); +extern void key_freeso(struct socket *); +extern int key_checktunnelsanity(struct secasvar *, u_int, + caddr_t, caddr_t); +extern int key_checkrequest(struct ipsecrequest *isr, + const struct secasindex *); +extern struct secpolicy *key_msg2sp(struct sadb_x_policy *, + size_t, int *); +extern struct mbuf *key_sp2msg(struct secpolicy *); +extern int key_ismyaddr(struct sockaddr *); +extern int key_spdacquire(struct secpolicy *); +extern u_long key_random(void); +extern void key_randomfill(void *, size_t); +extern void key_freereg(struct socket *); +extern int key_parse(struct mbuf *, struct socket *); +extern void key_init(void); #ifdef VIMAGE extern void key_destroy(void); #endif -extern void key_sa_recordxfer __P((struct secasvar *, struct mbuf *)); -extern void key_sa_stir_iv __P((struct secasvar *)); +extern void key_sa_recordxfer(struct secasvar *, struct mbuf *); +extern void key_sa_stir_iv(struct secasvar *); #ifdef IPSEC_NAT_T u_int16_t key_portfromsaddr(struct sockaddr *); #define KEY_PORTFROMSADDR(saddr) \ Modified: head/sys/netipsec/key_debug.c ============================================================================== --- head/sys/netipsec/key_debug.c Wed Dec 3 03:50:54 2014 (r275437) +++ head/sys/netipsec/key_debug.c Wed Dec 3 04:08:41 2014 (r275438) @@ -62,17 +62,17 @@ #include #endif /* !_KERNEL */ -static void kdebug_sadb_prop __P((struct sadb_ext *)); -static void kdebug_sadb_identity __P((struct sadb_ext *)); -static void kdebug_sadb_supported __P((struct sadb_ext *)); -static void kdebug_sadb_lifetime __P((struct sadb_ext *)); -static void kdebug_sadb_sa __P((struct sadb_ext *)); -static void kdebug_sadb_address __P((struct sadb_ext *)); -static void kdebug_sadb_key __P((struct sadb_ext *)); -static void kdebug_sadb_x_sa2 __P((struct sadb_ext *)); +static void kdebug_sadb_prop(struct sadb_ext *); +static void kdebug_sadb_identity(struct sadb_ext *); +static void kdebug_sadb_supported(struct sadb_ext *); +static void kdebug_sadb_lifetime(struct sadb_ext *); +static void kdebug_sadb_sa(struct sadb_ext *); +static void kdebug_sadb_address(struct sadb_ext *); +static void kdebug_sadb_key(struct sadb_ext *); +static void kdebug_sadb_x_sa2(struct sadb_ext *); #ifdef _KERNEL -static void kdebug_secreplay __P((struct secreplay *)); +static void kdebug_secreplay(struct secreplay *); #endif #ifndef _KERNEL Modified: head/sys/netipsec/key_debug.h ============================================================================== --- head/sys/netipsec/key_debug.h Wed Dec 3 03:50:54 2014 (r275437) +++ head/sys/netipsec/key_debug.h Wed Dec 3 04:08:41 2014 (r275438) @@ -62,8 +62,8 @@ VNET_DECLARE(u_int32_t, key_debug_level) struct sadb_msg; struct sadb_ext; -extern void kdebug_sadb __P((struct sadb_msg *)); -extern void kdebug_sadb_x_policy __P((struct sadb_ext *)); +extern void kdebug_sadb(struct sadb_msg *); +extern void kdebug_sadb_x_policy(struct sadb_ext *); #ifdef _KERNEL struct secpolicy; @@ -72,18 +72,18 @@ struct secasindex; struct secasvar; struct secreplay; struct mbuf; -extern void kdebug_secpolicy __P((struct secpolicy *)); -extern void kdebug_secpolicyindex __P((struct secpolicyindex *)); -extern void kdebug_secasindex __P((struct secasindex *)); -extern void kdebug_secasv __P((struct secasvar *)); -extern void kdebug_mbufhdr __P((struct mbuf *)); -extern void kdebug_mbuf __P((struct mbuf *)); +extern void kdebug_secpolicy(struct secpolicy *); +extern void kdebug_secpolicyindex(struct secpolicyindex *); +extern void kdebug_secasindex(struct secasindex *); +extern void kdebug_secasv(struct secasvar *); +extern void kdebug_mbufhdr(struct mbuf *); +extern void kdebug_mbuf(struct mbuf *); #endif /*_KERNEL*/ struct sockaddr; -extern void kdebug_sockaddr __P((struct sockaddr *)); +extern void kdebug_sockaddr(struct sockaddr *); -extern void ipsec_hexdump __P((caddr_t, int)); -extern void ipsec_bindump __P((caddr_t, int)); +extern void ipsec_hexdump(caddr_t, int); +extern void ipsec_bindump(caddr_t, int); #endif /* _NETIPSEC_KEY_DEBUG_H_ */ Modified: head/sys/netipsec/keydb.h ============================================================================== --- head/sys/netipsec/keydb.h Wed Dec 3 03:50:54 2014 (r275437) +++ head/sys/netipsec/keydb.h Wed Dec 3 04:08:41 2014 (r275438) @@ -198,21 +198,21 @@ struct secacq { #define SADB_KILL_INTERVAL 600 /* six seconds */ /* secpolicy */ -extern struct secpolicy *keydb_newsecpolicy __P((void)); -extern void keydb_delsecpolicy __P((struct secpolicy *)); +extern struct secpolicy *keydb_newsecpolicy(void); +extern void keydb_delsecpolicy(struct secpolicy *); /* secashead */ -extern struct secashead *keydb_newsecashead __P((void)); -extern void keydb_delsecashead __P((struct secashead *)); +extern struct secashead *keydb_newsecashead(void); +extern void keydb_delsecashead(struct secashead *); /* secasvar */ -extern struct secasvar *keydb_newsecasvar __P((void)); -extern void keydb_refsecasvar __P((struct secasvar *)); -extern void keydb_freesecasvar __P((struct secasvar *)); +extern struct secasvar *keydb_newsecasvar(void); +extern void keydb_refsecasvar(struct secasvar *); +extern void keydb_freesecasvar(struct secasvar *); /* secreplay */ -extern struct secreplay *keydb_newsecreplay __P((size_t)); -extern void keydb_delsecreplay __P((struct secreplay *)); +extern struct secreplay *keydb_newsecreplay(size_t); +extern void keydb_delsecreplay(struct secreplay *); /* secreg */ -extern struct secreg *keydb_newsecreg __P((void)); -extern void keydb_delsecreg __P((struct secreg *)); +extern struct secreg *keydb_newsecreg(void); +extern void keydb_delsecreg(struct secreg *); #endif /* _KERNEL */ Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Wed Dec 3 03:50:54 2014 (r275437) +++ head/sys/netipsec/keysock.c Wed Dec 3 04:08:41 2014 (r275438) @@ -74,7 +74,7 @@ static VNET_DEFINE(struct key_cb, key_cb static struct sockaddr key_src = { 2, PF_KEY, }; -static int key_sendup0 __P((struct rawcb *, struct mbuf *, int)); +static int key_sendup0(struct rawcb *, struct mbuf *, int); VNET_PCPUSTAT_DEFINE(struct pfkeystat, pfkeystat); VNET_PCPUSTAT_SYSINIT(pfkeystat); Modified: head/sys/netipsec/keysock.h ============================================================================== --- head/sys/netipsec/keysock.h Wed Dec 3 03:50:54 2014 (r275437) +++ head/sys/netipsec/keysock.h Wed Dec 3 04:08:41 2014 (r275438) @@ -77,11 +77,11 @@ VNET_PCPUSTAT_DECLARE(struct pfkeystat, #define PFKEYSTAT_INC(name) PFKEYSTAT_ADD(name, 1) extern int key_output(struct mbuf *m, struct socket *so, ...); -extern int key_usrreq __P((struct socket *, - int, struct mbuf *, struct mbuf *, struct mbuf *)); +extern int key_usrreq(struct socket *, int, struct mbuf *, + struct mbuf *, struct mbuf *); -extern int key_sendup __P((struct socket *, struct sadb_msg *, u_int, int)); -extern int key_sendup_mbuf __P((struct socket *, struct mbuf *, int)); +extern int key_sendup(struct socket *, struct sadb_msg *, u_int, int); +extern int key_sendup_mbuf(struct socket *, struct mbuf *, int); #endif /* _KERNEL */ #endif /*_NETIPSEC_KEYSOCK_H_*/ From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 08:25:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF4E9402; Wed, 3 Dec 2014 08:25:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0662F9F; Wed, 3 Dec 2014 08:25:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB38Pg3F056243; Wed, 3 Dec 2014 08:25:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB38Pg0t056241; Wed, 3 Dec 2014 08:25:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412030825.sB38Pg0t056241@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 3 Dec 2014 08:25:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275446 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 08:25:43 -0000 Author: mav Date: Wed Dec 3 08:25:41 2014 New Revision: 275446 URL: https://svnweb.freebsd.org/changeset/base/275446 Log: Plug memory leaks on UNMAP and XCOPY with invalid parameters. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_tpc.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Dec 3 08:22:13 2014 (r275445) +++ head/sys/cam/ctl/ctl.c Wed Dec 3 08:25:41 2014 (r275446) @@ -5904,8 +5904,7 @@ ctl_unmap(struct ctl_scsiio *ctsio) /*field*/ 0, /*bit_valid*/ 0, /*bit*/ 0); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); + goto done; } len = scsi_2btoul(hdr->desc_length); buf = (struct scsi_unmap_desc *)(hdr + 1); @@ -5932,8 +5931,7 @@ ctl_unmap(struct ctl_scsiio *ctsio) len = (uint8_t *)endnz - (uint8_t *)buf; if (len == 0) { ctl_set_success(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); + goto done; } mtx_lock(&lun->lun_lock); @@ -5947,6 +5945,14 @@ ctl_unmap(struct ctl_scsiio *ctsio) retval = lun->backend->config_write((union ctl_io *)ctsio); return (retval); + +done: + if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) { + free(ctsio->kern_data_ptr, M_CTL); + ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED; + } + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); } /* Modified: head/sys/cam/ctl/ctl_tpc.c ============================================================================== --- head/sys/cam/ctl/ctl_tpc.c Wed Dec 3 08:22:13 2014 (r275445) +++ head/sys/cam/ctl/ctl_tpc.c Wed Dec 3 08:25:41 2014 (r275446) @@ -1644,6 +1644,10 @@ ctl_extended_copy_lid1(struct ctl_scsiio return (CTL_RETVAL_COMPLETE); done: + if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) { + free(ctsio->kern_data_ptr, M_CTL); + ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED; + } ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } @@ -1767,6 +1771,10 @@ ctl_extended_copy_lid4(struct ctl_scsiio return (CTL_RETVAL_COMPLETE); done: + if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) { + free(ctsio->kern_data_ptr, M_CTL); + ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED; + } ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } @@ -1944,8 +1952,10 @@ ctl_populate_token(struct ctl_scsiio *ct return (CTL_RETVAL_COMPLETE); done: - if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) + if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) { free(ctsio->kern_data_ptr, M_CTL); + ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED; + } ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } @@ -2069,8 +2079,10 @@ ctl_write_using_token(struct ctl_scsiio return (CTL_RETVAL_COMPLETE); done: - if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) + if (ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) { free(ctsio->kern_data_ptr, M_CTL); + ctsio->io_hdr.flags &= ~CTL_FLAG_ALLOCATED; + } ctl_done((union ctl_io *)ctsio); return (CTL_RETVAL_COMPLETE); } From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 09:05:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6BF93EE7; Wed, 3 Dec 2014 09:05:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 57B17609; Wed, 3 Dec 2014 09:05:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB395s6i074228; Wed, 3 Dec 2014 09:05:54 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB395rYZ074226; Wed, 3 Dec 2014 09:05:53 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412030905.sB395rYZ074226@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 3 Dec 2014 09:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275447 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 09:05:54 -0000 Author: mav Date: Wed Dec 3 09:05:53 2014 New Revision: 275447 URL: https://svnweb.freebsd.org/changeset/base/275447 Log: Do not pre-allocate reservation keys memory for every possible initiator. In configurations with many ports, like iSCSI, each LUN is typically accessed only by limited subset of ports. Allocating that memory on demand allows to reduce CTL memory usage from 5.3MB/LUN to 1.3MB/LUN. MFC after: 1 month Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_private.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Dec 3 08:25:41 2014 (r275446) +++ head/sys/cam/ctl/ctl.c Wed Dec 3 09:05:53 2014 (r275447) @@ -3036,7 +3036,7 @@ ctl_ioctl(struct cdev *dev, u_long cmd, break; } case CTL_DUMP_STRUCTS: { - int i, j, k, idx; + int i, j, k; struct ctl_port *port; struct ctl_frontend *fe; @@ -3052,13 +3052,14 @@ ctl_ioctl(struct cdev *dev, u_long cmd, continue; for (j = 0; j < (CTL_MAX_PORTS * 2); j++) { + if (lun->pr_keys[j] == NULL) + continue; for (k = 0; k < CTL_MAX_INIT_PER_PORT; k++){ - idx = j * CTL_MAX_INIT_PER_PORT + k; - if (lun->pr_keys[idx] == 0) + if (lun->pr_keys[j][k] == 0) continue; printf(" LUN %d port %d iid %d key " "%#jx\n", i, j, k, - (uintmax_t)lun->pr_keys[idx]); + (uintmax_t)lun->pr_keys[j][k]); } } } @@ -3647,6 +3648,57 @@ ctl_is_set(uint32_t *mask, uint32_t bit) return (1); } +static uint64_t +ctl_get_prkey(struct ctl_lun *lun, uint32_t residx) +{ + uint64_t *t; + + t = lun->pr_keys[residx/CTL_MAX_INIT_PER_PORT]; + if (t == NULL) + return (0); + return (t[residx % CTL_MAX_INIT_PER_PORT]); +} + +static void +ctl_clr_prkey(struct ctl_lun *lun, uint32_t residx) +{ + uint64_t *t; + + t = lun->pr_keys[residx/CTL_MAX_INIT_PER_PORT]; + if (t == NULL) + return; + t[residx % CTL_MAX_INIT_PER_PORT] = 0; +} + +static void +ctl_alloc_prkey(struct ctl_lun *lun, uint32_t residx) +{ + uint64_t *p; + u_int i; + + i = residx/CTL_MAX_INIT_PER_PORT; + if (lun->pr_keys[i] != NULL) + return; + mtx_unlock(&lun->lun_lock); + p = malloc(sizeof(uint64_t) * CTL_MAX_INIT_PER_PORT, M_CTL, + M_WAITOK | M_ZERO); + mtx_lock(&lun->lun_lock); + if (lun->pr_keys[i] == NULL) + lun->pr_keys[i] = p; + else + free(p, M_CTL); +} + +static void +ctl_set_prkey(struct ctl_lun *lun, uint32_t residx, uint64_t key) +{ + uint64_t *t; + + t = lun->pr_keys[residx/CTL_MAX_INIT_PER_PORT]; + KASSERT(t != NULL, ("prkey %d is not allocated", residx)); + t[residx % CTL_MAX_INIT_PER_PORT] = key; +} + #ifdef unused /* * The bus, target and lun are optional, they can be filled in later. @@ -4685,6 +4737,10 @@ ctl_free_lun(struct ctl_lun *lun) ctl_tpc_lun_shutdown(lun); mtx_destroy(&lun->lun_lock); free(lun->lun_devid, M_CTL); + for (i = 0; i < 2 * CTL_MAX_PORTS; i++) { + if (lun->pr_keys[i] != NULL) + free(lun->pr_keys[i], M_CTL); + } free(lun->write_buffer, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) free(lun, M_CTL); @@ -5345,7 +5401,7 @@ ctl_start_stop(struct ctl_scsiio *ctsio) uint32_t residx; residx = ctl_get_resindex(&ctsio->io_hdr.nexus); - if (lun->pr_keys[residx] == 0 + if (ctl_get_prkey(lun, residx) == 0 || (lun->pr_res_idx!=residx && lun->res_type < 4)) { ctl_set_reservation_conflict(ctsio); @@ -7613,6 +7669,7 @@ ctl_persistent_reserve_in(struct ctl_scs /* struct scsi_per_res_in_rsrv in_data; */ struct ctl_lun *lun; struct ctl_softc *softc; + uint64_t key; CTL_DEBUG_PRINT(("ctl_persistent_reserve_in\n")); @@ -7698,7 +7755,7 @@ retry: lun->pr_key_count, res_keys->header.length); for (i = 0, key_count = 0; i < 2*CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i] == 0) + if ((key = ctl_get_prkey(lun, i)) == 0) continue; /* @@ -7724,8 +7781,7 @@ retry: key_count++; continue; } - scsi_u64to8b(lun->pr_keys[i], - res_keys->keys[key_count].key); + scsi_u64to8b(key, res_keys->keys[key_count].key); key_count++; } break; @@ -7776,7 +7832,7 @@ retry: * is 0, since it doesn't really matter. */ if (lun->pr_res_idx != CTL_PR_ALL_REGISTRANTS) { - scsi_u64to8b(lun->pr_keys[lun->pr_res_idx], + scsi_u64to8b(ctl_get_prkey(lun, lun->pr_res_idx), res->data.reservation); } res->data.scopetype = lun->res_type; @@ -7828,10 +7884,10 @@ retry: res_desc = &res_status->desc[0]; for (i = 0; i < 2*CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i] == 0) + if ((key = ctl_get_prkey(lun, i)) == 0) continue; - scsi_u64to8b(lun->pr_keys[i], res_desc->res_key.key); + scsi_u64to8b(key, res_desc->res_key.key); if ((lun->flags & CTL_LUN_PR_RESERVED) && (lun->pr_res_idx == i || lun->pr_res_idx == CTL_PR_ALL_REGISTRANTS)) { @@ -7931,10 +7987,10 @@ ctl_pro_preempt(struct ctl_softc *softc, * them */ for(i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (i == residx || lun->pr_keys[i] == 0) + if (i == residx || ctl_get_prkey(lun, i) == 0) continue; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; @@ -8000,11 +8056,11 @@ ctl_pro_preempt(struct ctl_softc *softc, } for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i] != sa_res_key) + if (ctl_get_prkey(lun, i) != sa_res_key) continue; found = 1; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } @@ -8033,7 +8089,7 @@ ctl_pro_preempt(struct ctl_softc *softc, } else { /* Reserved but not all registrants */ /* sa_res_key is res holder */ - if (sa_res_key == lun->pr_keys[lun->pr_res_idx]) { + if (sa_res_key == ctl_get_prkey(lun, lun->pr_res_idx)) { /* validate scope and type */ if ((cdb->scope_type & SPR_SCOPE_MASK) != SPR_LU_SCOPE) { @@ -8075,11 +8131,11 @@ ctl_pro_preempt(struct ctl_softc *softc, */ for(i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (i == residx || lun->pr_keys[i] == 0) + if (i == residx || ctl_get_prkey(lun, i) == 0) continue; - if (sa_res_key == lun->pr_keys[i]) { - lun->pr_keys[i] = 0; + if (sa_res_key == ctl_get_prkey(lun, i)) { + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (type != lun->res_type @@ -8118,11 +8174,11 @@ ctl_pro_preempt(struct ctl_softc *softc, int found=0; for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (sa_res_key != lun->pr_keys[i]) + if (sa_res_key != ctl_get_prkey(lun, i)) continue; found = 1; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } @@ -8168,7 +8224,7 @@ ctl_pro_preempt_other(struct ctl_lun *lu if (lun->pr_res_idx == CTL_PR_ALL_REGISTRANTS || lun->pr_res_idx == CTL_PR_NO_RESERVATION - || sa_res_key != lun->pr_keys[lun->pr_res_idx]) { + || sa_res_key != ctl_get_prkey(lun, lun->pr_res_idx)) { if (sa_res_key == 0) { /* * Unregister everybody else and build UA for @@ -8176,10 +8232,10 @@ ctl_pro_preempt_other(struct ctl_lun *lu */ for(i=0; i < 2*CTL_MAX_INITIATORS; i++) { if (i == msg->pr.pr_info.residx || - lun->pr_keys[i] == 0) + ctl_get_prkey(lun, i) == 0) continue; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } @@ -8190,10 +8246,10 @@ ctl_pro_preempt_other(struct ctl_lun *lu lun->pr_res_idx = msg->pr.pr_info.residx; } else { for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (sa_res_key == lun->pr_keys[i]) + if (sa_res_key == ctl_get_prkey(lun, i)) continue; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } @@ -8201,11 +8257,11 @@ ctl_pro_preempt_other(struct ctl_lun *lu } else { for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { if (i == msg->pr.pr_info.residx || - lun->pr_keys[i] == 0) + ctl_get_prkey(lun, i) == 0) continue; - if (sa_res_key == lun->pr_keys[i]) { - lun->pr_keys[i] = 0; + if (sa_res_key == ctl_get_prkey(lun, i)) { + ctl_clr_prkey(lun, i); lun->pr_key_count--; ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (msg->pr.pr_info.res_type != lun->res_type @@ -8237,7 +8293,7 @@ ctl_persistent_reserve_out(struct ctl_sc struct scsi_per_res_out_parms* param; struct ctl_softc *softc; uint32_t residx; - uint64_t res_key, sa_res_key; + uint64_t res_key, sa_res_key, key; uint8_t type; union ctl_ha_msg persis_io; int i; @@ -8311,8 +8367,8 @@ ctl_persistent_reserve_out(struct ctl_sc */ if ((cdb->action & SPRO_ACTION_MASK) != SPRO_REG_IGNO) { mtx_lock(&lun->lun_lock); - if (lun->pr_keys[residx] != 0) { - if (res_key != lun->pr_keys[residx]) { + if ((key = ctl_get_prkey(lun, residx)) != 0) { + if (res_key != key) { /* * The current key passed in doesn't match * the one the initiator previously @@ -8393,12 +8449,12 @@ ctl_persistent_reserve_out(struct ctl_sc if ((res_key == 0 && (cdb->action & SPRO_ACTION_MASK) == SPRO_REGISTER) || ((cdb->action & SPRO_ACTION_MASK) == SPRO_REG_IGNO - && lun->pr_keys[residx] == 0)) { + && ctl_get_prkey(lun, residx) == 0)) { mtx_unlock(&lun->lun_lock); goto done; } - lun->pr_keys[residx] = 0; + ctl_clr_prkey(lun, residx); lun->pr_key_count--; if (residx == lun->pr_res_idx) { @@ -8417,8 +8473,8 @@ ctl_persistent_reserve_out(struct ctl_sc */ for (i = 0; i < CTL_MAX_INITIATORS;i++){ - if (lun->pr_keys[i + - softc->persis_offset] == 0) + if (ctl_get_prkey(lun, i + + softc->persis_offset) == 0) continue; lun->pending_ua[i] |= CTL_UA_RES_RELEASE; @@ -8448,9 +8504,10 @@ ctl_persistent_reserve_out(struct ctl_sc * If we aren't registered currently then increment * the key count and set the registered flag. */ - if (lun->pr_keys[residx] == 0) + ctl_alloc_prkey(lun, residx); + if (ctl_get_prkey(lun, residx) == 0) lun->pr_key_count++; - lun->pr_keys[residx] = sa_res_key; + ctl_set_prkey(lun, residx, sa_res_key); persis_io.hdr.nexus = ctsio->io_hdr.nexus; persis_io.hdr.msg_type = CTL_MSG_PERS_ACTION; @@ -8565,7 +8622,8 @@ ctl_persistent_reserve_out(struct ctl_sc && type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) { if (i == residx || - lun->pr_keys[i + softc->persis_offset] == 0) + ctl_get_prkey(lun, + i + softc->persis_offset) == 0) continue; lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } @@ -8591,11 +8649,10 @@ ctl_persistent_reserve_out(struct ctl_sc lun->pr_key_count = 0; lun->pr_res_idx = CTL_PR_NO_RESERVATION; - lun->pr_keys[residx] = 0; - + ctl_clr_prkey(lun, residx); for (i=0; i < 2*CTL_MAX_INITIATORS; i++) - if (lun->pr_keys[i] != 0) { - lun->pr_keys[i] = 0; + if (ctl_get_prkey(lun, i) != 0) { + ctl_clr_prkey(lun, i); ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; @@ -8653,15 +8710,16 @@ ctl_hndl_per_res_out_on_other_sc(union c mtx_lock(&lun->lun_lock); switch(msg->pr.pr_info.action) { case CTL_PR_REG_KEY: - if (lun->pr_keys[msg->pr.pr_info.residx] == 0) + ctl_alloc_prkey(lun, msg->pr.pr_info.residx); + if (ctl_get_prkey(lun, msg->pr.pr_info.residx) == 0) lun->pr_key_count++; - lun->pr_keys[msg->pr.pr_info.residx] = - scsi_8btou64(msg->pr.pr_info.sa_res_key); + ctl_set_prkey(lun, msg->pr.pr_info.residx, + scsi_8btou64(msg->pr.pr_info.sa_res_key)); lun->PRGeneration++; break; case CTL_PR_UNREG_KEY: - lun->pr_keys[msg->pr.pr_info.residx] = 0; + ctl_clr_prkey(lun, msg->pr.pr_info.residx); lun->pr_key_count--; /* XXX Need to see if the reservation has been released */ @@ -8682,8 +8740,8 @@ ctl_hndl_per_res_out_on_other_sc(union c */ for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i + - softc->persis_offset] == 0) + if (ctl_get_prkey(lun, i + + softc->persis_offset) == 0) continue; lun->pending_ua[i] |= @@ -8716,7 +8774,7 @@ ctl_hndl_per_res_out_on_other_sc(union c if (lun->res_type != SPR_TYPE_EX_AC && lun->res_type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) - if (lun->pr_keys[i + softc->persis_offset] != 0) + if (ctl_get_prkey(lun, i + softc->persis_offset) != 0) lun->pending_ua[i] |= CTL_UA_RES_RELEASE; } @@ -8736,9 +8794,9 @@ ctl_hndl_per_res_out_on_other_sc(union c lun->pr_res_idx = CTL_PR_NO_RESERVATION; for (i=0; i < 2*CTL_MAX_INITIATORS; i++) { - if (lun->pr_keys[i] == 0) + if (ctl_get_prkey(lun, i) == 0) continue; - lun->pr_keys[i] = 0; + ctl_clr_prkey(lun, i); ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; @@ -11049,7 +11107,7 @@ ctl_scsiio_lun_check(struct ctl_softc *c * reservation and this isn't the res holder then set a * conflict. */ - if (lun->pr_keys[residx] == 0 + if (ctl_get_prkey(lun, residx) == 0 || (residx != lun->pr_res_idx && lun->res_type < 4)) { ctl_set_reservation_conflict(ctsio); retval = 1; Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Wed Dec 3 08:25:41 2014 (r275446) +++ head/sys/cam/ctl/ctl_private.h Wed Dec 3 09:05:53 2014 (r275447) @@ -410,7 +410,7 @@ struct ctl_lun { struct ctl_lun_io_stats stats; uint32_t res_idx; unsigned int PRGeneration; - uint64_t pr_keys[2*CTL_MAX_INITIATORS]; + uint64_t *pr_keys[2 * CTL_MAX_PORTS]; int pr_key_count; uint32_t pr_res_idx; uint8_t res_type; From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 09:32:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9124DAEF; Wed, 3 Dec 2014 09:32:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7E4AE977; Wed, 3 Dec 2014 09:32:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB39WqXZ090565; Wed, 3 Dec 2014 09:32:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB39WqZi090564; Wed, 3 Dec 2014 09:32:52 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412030932.sB39WqZi090564@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 3 Dec 2014 09:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275452 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 09:32:52 -0000 Author: mav Date: Wed Dec 3 09:32:51 2014 New Revision: 275452 URL: https://svnweb.freebsd.org/changeset/base/275452 Log: Do not corrupt the listen string when parsing it. This fixes problem with ctld reload when it is configured to listen on two portals with same IP, but different ports. MFC after: 1 week Modified: head/usr.sbin/ctld/ctld.c Modified: head/usr.sbin/ctld/ctld.c ============================================================================== --- head/usr.sbin/ctld/ctld.c Wed Dec 3 09:16:02 2014 (r275451) +++ head/usr.sbin/ctld/ctld.c Wed Dec 3 09:32:51 2014 (r275452) @@ -643,10 +643,11 @@ static int parse_addr_port(char *arg, const char *def_port, struct addrinfo **ai) { struct addrinfo hints; - char *addr, *ch; + char *str, *addr, *ch; const char *port; int error, colons = 0; + str = arg = strdup(arg); if (arg[0] == '[') { /* * IPv6 address in square brackets, perhaps with port. @@ -659,8 +660,10 @@ parse_addr_port(char *arg, const char *d port = def_port; } else if (arg[0] == ':') { port = arg + 1; - } else + } else { + free(str); return (1); + } } else { /* * Either IPv6 address without brackets - and without @@ -687,9 +690,8 @@ parse_addr_port(char *arg, const char *d hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; error = getaddrinfo(addr, port, &hints, ai); - if (error != 0) - return (1); - return (0); + free(str); + return ((error != 0) ? 1 : 0); } int From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 10:39:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F468EF9; Wed, 3 Dec 2014 10:39:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E62DCC; Wed, 3 Dec 2014 10:39:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3Adllj018647; Wed, 3 Dec 2014 10:39:47 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3Adlxm018646; Wed, 3 Dec 2014 10:39:47 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412031039.sB3Adlxm018646@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 3 Dec 2014 10:39:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275455 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 10:39:48 -0000 Author: mav Date: Wed Dec 3 10:39:47 2014 New Revision: 275455 URL: https://svnweb.freebsd.org/changeset/base/275455 Log: Remove some unused code. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Dec 3 10:03:34 2014 (r275454) +++ head/sys/cam/ctl/ctl.c Wed Dec 3 10:39:47 2014 (r275455) @@ -400,12 +400,6 @@ static int ctl_ioctl(struct cdev *dev, u struct thread *td); static uint32_t ctl_map_lun(int port_num, uint32_t lun); static uint32_t ctl_map_lun_back(int port_num, uint32_t lun); -#ifdef unused -static union ctl_io *ctl_malloc_io(ctl_io_type io_type, uint32_t targ_port, - uint32_t targ_target, uint32_t targ_lun, - int can_wait); -static void ctl_kfree_io(union ctl_io *io); -#endif /* unused */ static int ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *lun, struct ctl_be_lun *be_lun, struct ctl_id target_id); static int ctl_free_lun(struct ctl_lun *lun); @@ -3699,43 +3693,6 @@ ctl_set_prkey(struct ctl_lun *lun, uint3 t[residx % CTL_MAX_INIT_PER_PORT] = key; } -#ifdef unused -/* - * The bus, target and lun are optional, they can be filled in later. - * can_wait is used to determine whether we can wait on the malloc or not. - */ -union ctl_io* -ctl_malloc_io(ctl_io_type io_type, uint32_t targ_port, uint32_t targ_target, - uint32_t targ_lun, int can_wait) -{ - union ctl_io *io; - - if (can_wait) - io = (union ctl_io *)malloc(sizeof(*io), M_CTL, M_WAITOK); - else - io = (union ctl_io *)malloc(sizeof(*io), M_CTL, M_NOWAIT); - - if (io != NULL) { - io->io_hdr.io_type = io_type; - io->io_hdr.targ_port = targ_port; - /* - * XXX KDM this needs to change/go away. We need to move - * to a preallocated pool of ctl_scsiio structures. - */ - io->io_hdr.nexus.targ_target.id = targ_target; - io->io_hdr.nexus.targ_lun = targ_lun; - } - - return (io); -} - -void -ctl_kfree_io(union ctl_io *io) -{ - free(io, M_CTL); -} -#endif /* unused */ - /* * ctl_softc, pool_name, total_ctl_io are passed in. * npool is passed out. From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 14:04:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83B25824; Wed, 3 Dec 2014 14:04:58 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6FD1DCFD; Wed, 3 Dec 2014 14:04:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3E4wKN013484; Wed, 3 Dec 2014 14:04:58 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3E4wtj013483; Wed, 3 Dec 2014 14:04:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412031404.sB3E4wtj013483@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 3 Dec 2014 14:04:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275457 - head/sys/boot/mips/beri/loader X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 14:04:58 -0000 Author: emaste Date: Wed Dec 3 14:04:57 2014 New Revision: 275457 URL: https://svnweb.freebsd.org/changeset/base/275457 Log: Increase BERI loader section alignment to 16 The .text, .bss, and .data sections claimed 16-byte alignment, but were only aligned to 8 by the linker script. Discovered with strip(1) from elftoolchain, which performs validation absent from the binutils strip(1). Sponsored by: DARPA, AFRL Modified: head/sys/boot/mips/beri/loader/loader.ldscript Modified: head/sys/boot/mips/beri/loader/loader.ldscript ============================================================================== --- head/sys/boot/mips/beri/loader/loader.ldscript Wed Dec 3 10:42:10 2014 (r275456) +++ head/sys/boot/mips/beri/loader/loader.ldscript Wed Dec 3 14:04:57 2014 (r275457) @@ -57,7 +57,7 @@ SECTIONS . = __loader_base_vaddr__; . += SIZEOF_HEADERS; - .text ALIGN(0x8): { + .text ALIGN(0x10): { start.o(.text*) *(EXCLUDE_FILE (start.o) .text*) *(.rodata*) @@ -66,8 +66,8 @@ SECTIONS KEEP(*(set_Xcommand_set)) __stop_set_Xcommand_set = .; } - .data ALIGN(0x8): { *(.data*)} - .bss ALIGN(0x8): { *(.bss*) } + .data ALIGN(0x10): { *(.data*)} + .bss ALIGN(0x10): { *(.bss*) } __heap = ALIGN(0x8); /* 64-bit aligned heap pointer */ __data_end = .; From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 15:16:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4738C38; Wed, 3 Dec 2014 15:16:19 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0C607FC; Wed, 3 Dec 2014 15:16:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3FGJa9045726; Wed, 3 Dec 2014 15:16:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3FGIUm045719; Wed, 3 Dec 2014 15:16:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412031516.sB3FGIUm045719@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 3 Dec 2014 15:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275458 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 15:16:19 -0000 Author: mav Date: Wed Dec 3 15:16:18 2014 New Revision: 275458 URL: https://svnweb.freebsd.org/changeset/base/275458 Log: Do not pre-allocate UNIT ATTENTIONs storage for every possible initiator. Abusing ability of major UAs cover minor ones we may not account UAs for inactive ports. Allocate UAs storage for port and start accounting only after some initiator from that port fetched its first POWER ON OCCURRED. This reduces per-LUN CTL memory usage from >1MB to less then 100K. MFC after: 1 month Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_error.c head/sys/cam/ctl/ctl_error.h head/sys/cam/ctl/ctl_private.h Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Dec 3 14:04:57 2014 (r275457) +++ head/sys/cam/ctl/ctl.c Wed Dec 3 15:16:18 2014 (r275458) @@ -962,12 +962,70 @@ ctl_copy_sense_data(union ctl_ha_msg *sr dest->io_hdr.status = src->hdr.status; } +static void +ctl_est_ua(struct ctl_lun *lun, uint32_t initidx, ctl_ua_type ua) +{ + ctl_ua_type *pu; + + mtx_assert(&lun->lun_lock, MA_OWNED); + pu = lun->pending_ua[initidx / CTL_MAX_INIT_PER_PORT]; + if (pu == NULL) + return; + pu[initidx % CTL_MAX_INIT_PER_PORT] |= ua; +} + +static void +ctl_est_ua_all(struct ctl_lun *lun, uint32_t except, ctl_ua_type ua) +{ + int i, j; + + mtx_assert(&lun->lun_lock, MA_OWNED); + for (i = 0; i < CTL_MAX_PORTS; i++) { + if (lun->pending_ua[i] == NULL) + continue; + for (j = 0; j < CTL_MAX_INIT_PER_PORT; j++) { + if (i * CTL_MAX_INIT_PER_PORT + j == except) + continue; + lun->pending_ua[i][j] |= ua; + } + } +} + +static void +ctl_clr_ua(struct ctl_lun *lun, uint32_t initidx, ctl_ua_type ua) +{ + ctl_ua_type *pu; + + mtx_assert(&lun->lun_lock, MA_OWNED); + pu = lun->pending_ua[initidx / CTL_MAX_INIT_PER_PORT]; + if (pu == NULL) + return; + pu[initidx % CTL_MAX_INIT_PER_PORT] &= ~ua; +} + +static void +ctl_clr_ua_all(struct ctl_lun *lun, uint32_t except, ctl_ua_type ua) +{ + int i, j; + + mtx_assert(&lun->lun_lock, MA_OWNED); + for (i = 0; i < CTL_MAX_PORTS; i++) { + if (lun->pending_ua[i] == NULL) + continue; + for (j = 0; j < CTL_MAX_INIT_PER_PORT; j++) { + if (i * CTL_MAX_INIT_PER_PORT + j == except) + continue; + lun->pending_ua[i][j] &= ~ua; + } + } +} + static int ctl_ha_state_sysctl(SYSCTL_HANDLER_ARGS) { struct ctl_softc *softc = (struct ctl_softc *)arg1; struct ctl_lun *lun; - int error, value, i; + int error, value; if (softc->flags & CTL_FLAG_ACTIVE_SHELF) value = 0; @@ -985,8 +1043,7 @@ ctl_ha_state_sysctl(SYSCTL_HANDLER_ARGS) softc->flags &= ~CTL_FLAG_ACTIVE_SHELF; STAILQ_FOREACH(lun, &softc->lun_list, links) { mtx_lock(&lun->lun_lock); - for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_ua[i] |= CTL_UA_ASYM_ACC_CHANGE; + ctl_est_ua_all(lun, -1, CTL_UA_ASYM_ACC_CHANGE); mtx_unlock(&lun->lun_lock); } mtx_unlock(&softc->ctl_lock); @@ -4547,19 +4604,13 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft ctl_init_log_page_index(lun); /* - * Set the poweron UA for all initiators on this LUN only. - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_ua[i] = CTL_UA_POWERON; - - /* * Now, before we insert this lun on the lun list, set the lun * inventory changed UA for all other luns. */ STAILQ_FOREACH(nlun, &ctl_softc->lun_list, links) { - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - nlun->pending_ua[i] |= CTL_UA_LUN_CHANGE; - } + mtx_lock(&nlun->lun_lock); + ctl_est_ua_all(nlun, -1, CTL_UA_LUN_CHANGE); + mtx_unlock(&nlun->lun_lock); } STAILQ_INSERT_TAIL(&ctl_softc->lun_list, lun, links); @@ -4694,18 +4745,18 @@ ctl_free_lun(struct ctl_lun *lun) ctl_tpc_lun_shutdown(lun); mtx_destroy(&lun->lun_lock); free(lun->lun_devid, M_CTL); - for (i = 0; i < 2 * CTL_MAX_PORTS; i++) { - if (lun->pr_keys[i] != NULL) - free(lun->pr_keys[i], M_CTL); - } + for (i = 0; i < CTL_MAX_PORTS; i++) + free(lun->pending_ua[i], M_CTL); + for (i = 0; i < 2 * CTL_MAX_PORTS; i++) + free(lun->pr_keys[i], M_CTL); free(lun->write_buffer, M_CTL); if (lun->flags & CTL_LUN_MALLOCED) free(lun, M_CTL); STAILQ_FOREACH(nlun, &softc->lun_list, links) { - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - nlun->pending_ua[i] |= CTL_UA_LUN_CHANGE; - } + mtx_lock(&nlun->lun_lock); + ctl_est_ua_all(nlun, -1, CTL_UA_LUN_CHANGE); + mtx_unlock(&nlun->lun_lock); } return (0); @@ -4983,19 +5034,10 @@ ctl_lun_operable(struct ctl_be_lun *be_l void ctl_lun_capacity_changed(struct ctl_be_lun *be_lun) { - struct ctl_lun *lun; - struct ctl_softc *softc; - int i; - - softc = control_softc; - - lun = (struct ctl_lun *)be_lun->ctl_lun; + struct ctl_lun *lun = (struct ctl_lun *)be_lun->ctl_lun; mtx_lock(&lun->lun_lock); - - for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_ua[i] |= CTL_UA_CAPACITY_CHANGED; - + ctl_est_ua_all(lun, -1, CTL_UA_CAPACITY_CHANGED); mtx_unlock(&lun->lun_lock); } @@ -6043,19 +6085,8 @@ ctl_control_page_handler(struct ctl_scsi saved_cp->eca_and_aen |= user_cp->eca_and_aen & SCP_SWP; set_ua = 1; } - if (set_ua != 0) { - int i; - /* - * Let other initiators know that the mode - * parameters for this LUN have changed. - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (i == initidx) - continue; - - lun->pending_ua[i] |= CTL_UA_MODE_CHANGE; - } - } + if (set_ua != 0) + ctl_est_ua_all(lun, initidx, CTL_UA_MODE_CHANGE); mtx_unlock(&lun->lun_lock); return (0); @@ -6091,19 +6122,8 @@ ctl_caching_sp_handler(struct ctl_scsiio saved_cp->flags1 |= user_cp->flags1 & (SCP_WCE | SCP_RCD); set_ua = 1; } - if (set_ua != 0) { - int i; - /* - * Let other initiators know that the mode - * parameters for this LUN have changed. - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (i == initidx) - continue; - - lun->pending_ua[i] |= CTL_UA_MODE_CHANGE; - } - } + if (set_ua != 0) + ctl_est_ua_all(lun, initidx, CTL_UA_MODE_CHANGE); mtx_unlock(&lun->lun_lock); return (0); @@ -7891,7 +7911,7 @@ ctl_set_res_ua(struct ctl_lun *lun, uint int off = lun->ctl_softc->persis_offset; if (residx >= off && residx < off + CTL_MAX_INITIATORS) - lun->pending_ua[residx - off] |= ua; + ctl_est_ua(lun, residx - off, ua); } /* @@ -8433,8 +8453,8 @@ ctl_persistent_reserve_out(struct ctl_sc if (ctl_get_prkey(lun, i + softc->persis_offset) == 0) continue; - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; + ctl_est_ua(lun, i, + CTL_UA_RES_RELEASE); } } lun->res_type = 0; @@ -8582,7 +8602,7 @@ ctl_persistent_reserve_out(struct ctl_sc ctl_get_prkey(lun, i + softc->persis_offset) == 0) continue; - lun->pending_ua[i] |= CTL_UA_RES_RELEASE; + ctl_est_ua(lun, i, CTL_UA_RES_RELEASE); } } mtx_unlock(&lun->lun_lock); @@ -8701,8 +8721,7 @@ ctl_hndl_per_res_out_on_other_sc(union c softc->persis_offset) == 0) continue; - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; + ctl_est_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = 0; @@ -8732,8 +8751,7 @@ ctl_hndl_per_res_out_on_other_sc(union c && lun->res_type != SPR_TYPE_WR_EX) { for (i = 0; i < CTL_MAX_INITIATORS; i++) if (ctl_get_prkey(lun, i + softc->persis_offset) != 0) - lun->pending_ua[i] |= - CTL_UA_RES_RELEASE; + ctl_est_ua(lun, i, CTL_UA_RES_RELEASE); } lun->flags &= ~CTL_LUN_PR_RESERVED; @@ -9306,7 +9324,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio */ if (request_lun != NULL) { mtx_lock(&lun->lun_lock); - lun->pending_ua[initidx] &= ~CTL_UA_LUN_CHANGE; + ctl_clr_ua(lun, initidx, CTL_UA_RES_RELEASE); mtx_unlock(&lun->lun_lock); } } @@ -9361,6 +9379,7 @@ ctl_request_sense(struct ctl_scsiio *cts uint32_t initidx; int have_error; scsi_sense_data_type sense_format; + ctl_ua_type ua_type; cdb = (struct scsi_request_sense *)ctsio->cdb; @@ -9445,11 +9464,8 @@ ctl_request_sense(struct ctl_scsiio *cts have_error = 1; } else #endif - if (lun->pending_ua[initidx] != CTL_UA_NONE) { - ctl_ua_type ua_type; - - ua_type = ctl_build_ua(&lun->pending_ua[initidx], - sense_ptr, sense_format); + { + ua_type = ctl_build_ua(lun, initidx, sense_ptr, sense_format); if (ua_type != CTL_UA_NONE) have_error = 1; } @@ -11120,7 +11136,6 @@ ctl_failover(void) union ctl_io *next_io, *pending_io; union ctl_io *io; int lun_idx; - int i; ctl_softc = control_softc; @@ -11255,13 +11270,7 @@ ctl_failover(void) } } - /* - * Build Unit Attention - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - lun->pending_ua[i] |= - CTL_UA_ASYM_ACC_CHANGE; - } + ctl_est_ua_all(lun, -1, CTL_UA_ASYM_ACC_CHANGE); } else if (((lun->flags & CTL_LUN_PRIMARY_SC) == 0) && (ctl_softc->ha_mode == CTL_HA_MODE_SER_ONLY)) { printf("FAILOVER: secondary lun %d\n", lun_idx); @@ -11350,13 +11359,7 @@ ctl_failover(void) } } - /* - * Build Unit Attention - */ - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - lun->pending_ua[i] |= - CTL_UA_ASYM_ACC_CHANGE; - } + ctl_est_ua_all(lun, -1, CTL_UA_ASYM_ACC_CHANGE); } else { panic("Unhandled HA mode failover, LUN flags = %#x, " "ha_mode = #%x", lun->flags, ctl_softc->ha_mode); @@ -11492,28 +11495,22 @@ ctl_scsiio_precheck(struct ctl_softc *ct */ if ((entry->flags & CTL_CMD_FLAG_NO_SENSE) == 0) { ctl_ua_type ua_type; + scsi_sense_data_type sense_format; - if (lun->pending_ua[initidx] != CTL_UA_NONE) { - scsi_sense_data_type sense_format; - - if (lun != NULL) - sense_format = (lun->flags & - CTL_LUN_SENSE_DESC) ? SSD_TYPE_DESC : - SSD_TYPE_FIXED; - else - sense_format = SSD_TYPE_FIXED; + if (lun->flags & CTL_LUN_SENSE_DESC) + sense_format = SSD_TYPE_DESC; + else + sense_format = SSD_TYPE_FIXED; - ua_type = ctl_build_ua(&lun->pending_ua[initidx], - &ctsio->sense_data, sense_format); - if (ua_type != CTL_UA_NONE) { - ctsio->scsi_status = SCSI_STATUS_CHECK_COND; - ctsio->io_hdr.status = CTL_SCSI_ERROR | - CTL_AUTOSENSE; - ctsio->sense_len = SSD_FULL_SIZE; - mtx_unlock(&lun->lun_lock); - ctl_done((union ctl_io *)ctsio); - return (retval); - } + ua_type = ctl_build_ua(lun, initidx, &ctsio->sense_data, + sense_format); + if (ua_type != CTL_UA_NONE) { + mtx_unlock(&lun->lun_lock); + ctsio->scsi_status = SCSI_STATUS_CHECK_COND; + ctsio->io_hdr.status = CTL_SCSI_ERROR | CTL_AUTOSENSE; + ctsio->sense_len = SSD_FULL_SIZE; + ctl_done((union ctl_io *)ctsio); + return (retval); } } @@ -11792,7 +11789,9 @@ ctl_lun_reset(struct ctl_lun *lun, union #if 0 uint32_t initidx; #endif +#ifdef CTL_WITH_CA int i; +#endif mtx_lock(&lun->lun_lock); /* @@ -11811,11 +11810,9 @@ ctl_lun_reset(struct ctl_lun *lun, union */ #if 0 initidx = ctl_get_initindex(&io->io_hdr.nexus); - for (i = 0; i < CTL_MAX_INITIATORS; i++) { - if (initidx == i) - continue; - lun->pending_ua[i] |= ua_type; - } + ctl_est_ua_all(lun, initidx, ua_type); +#else + ctl_est_ua_all(lun, -1, ua_type); #endif /* @@ -11828,12 +11825,10 @@ ctl_lun_reset(struct ctl_lun *lun, union */ lun->flags &= ~CTL_LUN_RESERVED; - for (i = 0; i < CTL_MAX_INITIATORS; i++) { #ifdef CTL_WITH_CA + for (i = 0; i < CTL_MAX_INITIATORS; i++) ctl_clear_mask(lun->have_ca, i); #endif - lun->pending_ua[i] |= ua_type; - } mtx_unlock(&lun->lun_lock); return (0); @@ -11935,7 +11930,7 @@ ctl_i_t_nexus_reset(union ctl_io *io) #endif if ((lun->flags & CTL_LUN_RESERVED) && (lun->res_idx == residx)) lun->flags &= ~CTL_LUN_RESERVED; - lun->pending_ua[initidx] |= CTL_UA_I_T_NEXUS_LOSS; + ctl_est_ua(lun, initidx, CTL_UA_I_T_NEXUS_LOSS); mtx_unlock(&lun->lun_lock); } mtx_unlock(&softc->ctl_lock); @@ -13951,14 +13946,11 @@ ctl_thresh_thread(void *arg) if (lun->lasttpt == 0 || time_uptime - lun->lasttpt >= CTL_LBP_UA_PERIOD) { lun->lasttpt = time_uptime; - for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_ua[i] |= - CTL_UA_THIN_PROV_THRES; + ctl_est_ua_all(lun, -1, CTL_UA_THIN_PROV_THRES); } } else { lun->lasttpt = 0; - for (i = 0; i < CTL_MAX_INITIATORS; i++) - lun->pending_ua[i] &= ~CTL_UA_THIN_PROV_THRES; + ctl_clr_ua_all(lun, -1, CTL_UA_THIN_PROV_THRES); } mtx_unlock(&lun->lun_lock); } Modified: head/sys/cam/ctl/ctl_error.c ============================================================================== --- head/sys/cam/ctl/ctl_error.c Wed Dec 3 14:04:57 2014 (r275457) +++ head/sys/cam/ctl/ctl_error.c Wed Dec 3 15:16:18 2014 (r275458) @@ -367,16 +367,35 @@ ctl_set_ua(struct ctl_scsiio *ctsio, int } ctl_ua_type -ctl_build_ua(ctl_ua_type *ua_type, struct scsi_sense_data *sense, - scsi_sense_data_type sense_format) +ctl_build_ua(struct ctl_lun *lun, uint32_t initidx, + struct scsi_sense_data *sense, scsi_sense_data_type sense_format) { + ctl_ua_type *ua; ctl_ua_type ua_to_build, ua_to_clear; int asc, ascq; + uint32_t p, i; - if (*ua_type == CTL_UA_NONE) + mtx_assert(&lun->lun_lock, MA_OWNED); + p = initidx / CTL_MAX_INIT_PER_PORT; + if ((ua = lun->pending_ua[p]) == NULL) { + mtx_unlock(&lun->lun_lock); + ua = malloc(sizeof(ctl_ua_type) * CTL_MAX_INIT_PER_PORT, + M_CTL, M_WAITOK); + mtx_lock(&lun->lun_lock); + if (lun->pending_ua[p] == NULL) { + lun->pending_ua[p] = ua; + for (i = 0; i < CTL_MAX_INIT_PER_PORT; i++) + ua[i] = CTL_UA_POWERON; + } else { + free(ua, M_CTL); + ua = lun->pending_ua[p]; + } + } + i = initidx % CTL_MAX_INIT_PER_PORT; + if (ua[i] == CTL_UA_NONE) return (CTL_UA_NONE); - ua_to_build = (1 << (ffs(*ua_type) - 1)); + ua_to_build = (1 << (ffs(ua[i]) - 1)); ua_to_clear = ua_to_build; switch (ua_to_build) { @@ -482,7 +501,7 @@ ctl_build_ua(ctl_ua_type *ua_type, struc SSD_ELEM_NONE); /* We're reporting this UA, so clear it */ - *ua_type &= ~ua_to_clear; + ua[i] &= ~ua_to_clear; return (ua_to_build); } Modified: head/sys/cam/ctl/ctl_error.h ============================================================================== --- head/sys/cam/ctl/ctl_error.h Wed Dec 3 14:04:57 2014 (r275457) +++ head/sys/cam/ctl/ctl_error.h Wed Dec 3 15:16:18 2014 (r275458) @@ -42,6 +42,8 @@ #ifndef _CTL_ERROR_H_ #define _CTL_ERROR_H_ +struct ctl_lun; + void ctl_set_sense_data_va(struct scsi_sense_data *sense_data, void *lun, scsi_sense_data_type sense_format, int current_error, int sense_key, int asc, int ascq, va_list ap); @@ -55,8 +57,8 @@ void ctl_sense_to_desc(struct scsi_sense void ctl_sense_to_fixed(struct scsi_sense_data_desc *sense_src, struct scsi_sense_data_fixed *sense_dest); void ctl_set_ua(struct ctl_scsiio *ctsio, int asc, int ascq); -ctl_ua_type ctl_build_ua(ctl_ua_type *ua_type, struct scsi_sense_data *sense, - scsi_sense_data_type sense_format); +ctl_ua_type ctl_build_ua(struct ctl_lun *lun, uint32_t initidx, + struct scsi_sense_data *sense, scsi_sense_data_type sense_format); void ctl_set_overlapped_cmd(struct ctl_scsiio *ctsio); void ctl_set_overlapped_tag(struct ctl_scsiio *ctsio, uint8_t tag); void ctl_set_invalid_field(struct ctl_scsiio *ctsio, int sks_valid, int command, Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Wed Dec 3 14:04:57 2014 (r275457) +++ head/sys/cam/ctl/ctl_private.h Wed Dec 3 15:16:18 2014 (r275458) @@ -403,7 +403,7 @@ struct ctl_lun { uint32_t have_ca[CTL_MAX_INITIATORS >> 5]; struct scsi_sense_data pending_sense[CTL_MAX_INITIATORS]; #endif - ctl_ua_type pending_ua[CTL_MAX_INITIATORS]; + ctl_ua_type *pending_ua[CTL_MAX_PORTS]; time_t lasttpt; struct ctl_mode_pages mode_pages; struct ctl_log_pages log_pages; From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 15:19:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED198A5; Wed, 3 Dec 2014 15:19:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D997E847; Wed, 3 Dec 2014 15:19:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3FJcWg046154; Wed, 3 Dec 2014 15:19:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3FJcoN046153; Wed, 3 Dec 2014 15:19:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412031519.sB3FJcoN046153@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 3 Dec 2014 15:19:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275459 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 15:19:39 -0000 Author: mav Date: Wed Dec 3 15:19:38 2014 New Revision: 275459 URL: https://svnweb.freebsd.org/changeset/base/275459 Log: Unify function names after r275458. MFC after: 1 month Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Wed Dec 3 15:16:18 2014 (r275458) +++ head/sys/cam/ctl/ctl.c Wed Dec 3 15:19:38 2014 (r275459) @@ -7906,7 +7906,7 @@ retry: } static void -ctl_set_res_ua(struct ctl_lun *lun, uint32_t residx, ctl_ua_type ua) +ctl_est_res_ua(struct ctl_lun *lun, uint32_t residx, ctl_ua_type ua) { int off = lun->ctl_softc->persis_offset; @@ -7968,7 +7968,7 @@ ctl_pro_preempt(struct ctl_softc *softc, continue; ctl_clr_prkey(lun, i); - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; lun->res_type = type; @@ -8039,7 +8039,7 @@ ctl_pro_preempt(struct ctl_softc *softc, found = 1; ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } if (!found) { mtx_unlock(&lun->lun_lock); @@ -8114,11 +8114,11 @@ ctl_pro_preempt(struct ctl_softc *softc, if (sa_res_key == ctl_get_prkey(lun, i)) { ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type ==SPR_TYPE_EX_AC_RO)){ - ctl_set_res_ua(lun, i, CTL_UA_RES_RELEASE); + ctl_est_res_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = type; @@ -8157,7 +8157,7 @@ ctl_pro_preempt(struct ctl_softc *softc, found = 1; ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } if (!found) { @@ -8213,7 +8213,7 @@ ctl_pro_preempt_other(struct ctl_lun *lu continue; ctl_clr_prkey(lun, i); - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->pr_key_count = 1; @@ -8228,7 +8228,7 @@ ctl_pro_preempt_other(struct ctl_lun *lu ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } } } else { @@ -8240,11 +8240,11 @@ ctl_pro_preempt_other(struct ctl_lun *lu if (sa_res_key == ctl_get_prkey(lun, i)) { ctl_clr_prkey(lun, i); lun->pr_key_count--; - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } else if (msg->pr.pr_info.res_type != lun->res_type && (lun->res_type == SPR_TYPE_WR_EX_RO || lun->res_type == SPR_TYPE_EX_AC_RO)) { - ctl_set_res_ua(lun, i, CTL_UA_RES_RELEASE); + ctl_est_res_ua(lun, i, CTL_UA_RES_RELEASE); } } lun->res_type = msg->pr.pr_info.res_type; @@ -8630,7 +8630,7 @@ ctl_persistent_reserve_out(struct ctl_sc for (i=0; i < 2*CTL_MAX_INITIATORS; i++) if (ctl_get_prkey(lun, i) != 0) { ctl_clr_prkey(lun, i); - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; mtx_unlock(&lun->lun_lock); @@ -8772,7 +8772,7 @@ ctl_hndl_per_res_out_on_other_sc(union c if (ctl_get_prkey(lun, i) == 0) continue; ctl_clr_prkey(lun, i); - ctl_set_res_ua(lun, i, CTL_UA_REG_PREEMPT); + ctl_est_res_ua(lun, i, CTL_UA_REG_PREEMPT); } lun->PRGeneration++; break; From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 15:29:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F1E0A08; Wed, 3 Dec 2014 15:29:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 61A9A9AF; Wed, 3 Dec 2014 15:29:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3FTsHc051238; Wed, 3 Dec 2014 15:29:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3FTrwv051236; Wed, 3 Dec 2014 15:29:53 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412031529.sB3FTrwv051236@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 3 Dec 2014 15:29:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275460 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 15:29:54 -0000 Author: jhb Date: Wed Dec 3 15:29:53 2014 New Revision: 275460 URL: https://svnweb.freebsd.org/changeset/base/275460 Log: Revert device_getenv_int() for now as it duplicates resource_int_value(). We should perhaps implement a device_getenv_*() and device_setenv_*() API as a convenience wrapper on top of resource_*_value() and resource_set_*(). Modified: head/sys/kern/subr_bus.c head/sys/sys/bus.h Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Wed Dec 3 15:19:38 2014 (r275459) +++ head/sys/kern/subr_bus.c Wed Dec 3 15:29:53 2014 (r275460) @@ -56,8 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include @@ -5033,18 +5031,3 @@ bus_free_resource(device_t dev, int type return (0); return (bus_release_resource(dev, type, rman_get_rid(r), r)); } - -int -device_getenv_int(device_t dev, const char *knob, int *iptr) -{ - char env[128]; - int sz; - - sz = snprintf(env, sizeof(env), "hw.%s.%d.%s", device_get_name(dev), device_get_unit(dev), knob); - if (sz >= sizeof(env)) { - /* XXX: log? return error? bump sysctl error? */ - log(LOG_ERR, "device_getenv_int: knob too long: '%s'", knob); - return 0; - } - return (getenv_int(env, iptr)); -} Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Wed Dec 3 15:19:38 2014 (r275459) +++ head/sys/sys/bus.h Wed Dec 3 15:29:53 2014 (r275460) @@ -449,7 +449,6 @@ const char *device_get_nameunit(device_t void *device_get_softc(device_t dev); device_state_t device_get_state(device_t dev); int device_get_unit(device_t dev); -int device_getenv_int(device_t dev, const char *knob, int *iptr); struct sysctl_ctx_list *device_get_sysctl_ctx(device_t dev); struct sysctl_oid *device_get_sysctl_tree(device_t dev); int device_is_alive(device_t dev); /* did probe succeed? */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 16:04:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 32979BD8; Wed, 3 Dec 2014 16:04:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F88CE77; Wed, 3 Dec 2014 16:04:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3G416m069033; Wed, 3 Dec 2014 16:04:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3G41t6069032; Wed, 3 Dec 2014 16:04:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412031604.sB3G41t6069032@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 3 Dec 2014 16:04:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275461 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 16:04:02 -0000 Author: mav Date: Wed Dec 3 16:04:01 2014 New Revision: 275461 URL: https://svnweb.freebsd.org/changeset/base/275461 Log: Increase CTL ports limit from 128 to 256 and LUNs limit from 256 to 1024. After recent optimizations this change is no longer blocked by CTL memory consumption. Those limits are still not free, but much cheaper now. MFC after: 1 week Relnotes: yes Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl_ioctl.h Modified: head/sys/cam/ctl/ctl_ioctl.h ============================================================================== --- head/sys/cam/ctl/ctl_ioctl.h Wed Dec 3 15:29:53 2014 (r275460) +++ head/sys/cam/ctl/ctl_ioctl.h Wed Dec 3 16:04:01 2014 (r275461) @@ -60,17 +60,17 @@ /* * Maximum number of LUNs we support at the moment. MUST be a power of 2. */ -#define CTL_MAX_LUNS 256 +#define CTL_MAX_LUNS 1024 /* * Maximum number of initiators per port. */ -#define CTL_MAX_INIT_PER_PORT 2048 // Was 16 +#define CTL_MAX_INIT_PER_PORT 2048 /* * Maximum number of ports registered at one time. */ -#define CTL_MAX_PORTS 128 +#define CTL_MAX_PORTS 256 /* * Maximum number of initiators we support. From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 16:47:41 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03CD686B; Wed, 3 Dec 2014 16:47:41 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2186A5A; Wed, 3 Dec 2014 16:47:40 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 69692B98A; Wed, 3 Dec 2014 11:47:39 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r275412 - head/libexec/rtld-elf Date: Wed, 03 Dec 2014 10:06:41 -0500 Message-ID: <4619679.qqfhhZFLG8@ralph.baldwin.cx> User-Agent: KMail/4.14.2 (FreeBSD/10.1-STABLE; KDE/4.14.2; amd64; ; ) In-Reply-To: <201412021622.sB2GM9j4008534@svn.freebsd.org> References: <201412021622.sB2GM9j4008534@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 03 Dec 2014 11:47:39 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 16:47:41 -0000 On Tuesday, December 02, 2014 04:22:09 PM John Baldwin wrote: > Author: jhb > Date: Tue Dec 2 16:22:08 2014 > New Revision: 275412 > URL: https://svnweb.freebsd.org/changeset/base/275412 > > Log: > The runtime linker needs to include a path to itself in the link map > it exports to the debugger. It currently has two choices: it can use > a compiled-in path (/libexec/ld-elf.so.1) or it can use the path stored > in the interpreter path in the binary being executed. The runtime linker > currently prefers the second. However, this is usually wrong for compat32 > binaries since the binary specifies the path of rtld on a 32-bit system > (/libexec/ld-elf.so.1) instead of the actual path (/libexec/ld-elf32.so.1). > For now, always assume the compiled in path (/libexec/ld-elf32.so.1) as the > rtld path and ignore the path in the binary for the 32-bit runtime linker. > > Differential Revision: https://reviews.freebsd.org/D1236 > Reviewed by: kib This allows gdb (both in-tree and in-ports) to better debug an i386 binary on amd64. In particular, you can now start an i386 binary under gdb, and for devel/gdb from ports you can now debug an i386 core dump. (The in-tree gdb is confused by an i386 core dump.) -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 18:08:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D3B30658; Wed, 3 Dec 2014 18:08:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0BF8646; Wed, 3 Dec 2014 18:08:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3I8eCm024696; Wed, 3 Dec 2014 18:08:40 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3I8e61024695; Wed, 3 Dec 2014 18:08:40 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201412031808.sB3I8e61024695@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 3 Dec 2014 18:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275462 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 18:08:40 -0000 Author: sbruno Date: Wed Dec 3 18:08:39 2014 New Revision: 275462 URL: https://svnweb.freebsd.org/changeset/base/275462 Log: Assign argemdio0 to the correct base address and assign argemdio1 to its proper place *after* argemdio0 Correctly place arge0 and arge1 on their respective bus positions. Sponsored by: Nicholas Esborn Modified: head/sys/mips/conf/WZR-HPAG300H.hints Modified: head/sys/mips/conf/WZR-HPAG300H.hints ============================================================================== --- head/sys/mips/conf/WZR-HPAG300H.hints Wed Dec 3 16:04:01 2014 (r275461) +++ head/sys/mips/conf/WZR-HPAG300H.hints Wed Dec 3 18:08:39 2014 (r275462) @@ -5,10 +5,15 @@ # arge1 MDIO bus hint.argemdio.0.at="nexus0" -hint.argemdio.0.maddr=0x1a000000 +hint.argemdio.0.maddr=0x19000000 hint.argemdio.0.msize=0x1000 hint.argemdio.0.order=0 +hint.argemdio.1.at="nexus0" +hint.argemdio.1.maddr=0x1a000000 +hint.argemdio.1.msize=0x1000 +hint.argemdio.1.order=0 + hint.arge.0.phymask=0x0 hint.arge.0.media=1000 hint.arge.0.fduplex=1 @@ -20,15 +25,16 @@ hint.arge.1.phymask=0x10 hint.arge.1.media=1000 hint.arge.1.fduplex=1 hint.arge.1.eeprommac=0x1f05520c -hint.arge.1.mdio=mdioproxy0 # .. off of the switch mdiobus +hint.arge.1.mdio=mdioproxy1 # .. off of the switch mdiobus hint.arge.1.miimode=3 + # -# AR7240 switch config +# AR8317 switch config # hint.arswitch.0.at="mdio0" hint.arswitch.0.is_7240=0 # We need to be explicitly told this hint.arswitch.0.numphys=4 # 5 active switch PHYs (PHY 0 -> 4) -hint.arswitch.0.phy4cpu=0 # No, PHY 4 == dedicated PHY +hint.arswitch.0.phy4cpu=1 # No, PHY 4 == dedicated PHY hint.arswitch.0.is_rgmii=1 # Yes, is RGMII hint.arswitch.0.is_gmii=0 # No, not GMII From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 18:14:22 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A90194A; Wed, 3 Dec 2014 18:14:22 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 878FA78F; Wed, 3 Dec 2014 18:14:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3IEMXH028706; Wed, 3 Dec 2014 18:14:22 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3IEM1B028705; Wed, 3 Dec 2014 18:14:22 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201412031814.sB3IEM1B028705@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Wed, 3 Dec 2014 18:14:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275463 - head/contrib/mdocml X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 18:14:22 -0000 Author: brueffer Date: Wed Dec 3 18:14:21 2014 New Revision: 275463 URL: https://svnweb.freebsd.org/changeset/base/275463 Log: Add libcuse and libxo. Modified: head/contrib/mdocml/lib.in Modified: head/contrib/mdocml/lib.in ============================================================================== --- head/contrib/mdocml/lib.in Wed Dec 3 18:08:39 2014 (r275462) +++ head/contrib/mdocml/lib.in Wed Dec 3 18:14:21 2014 (r275463) @@ -39,6 +39,7 @@ LINE("libcipher", "FreeSec Crypt Library LINE("libcompat", "Compatibility Library (libcompat, \\-lcompat)") LINE("libcrypt", "Crypt Library (libcrypt, \\-lcrypt)") LINE("libcurses", "Curses Library (libcurses, \\-lcurses)") +LINE("libcuse", "Userland Character Device Library (libcuse, \\-lcuse)") LINE("libdevattr", "Device attribute and event library (libdevattr, \\-ldevattr)") LINE("libdevinfo", "Device and Resource Information Utility Library (libdevinfo, \\-ldevinfo)") LINE("libdevstat", "Device Statistics Library (libdevstat, \\-ldevstat)") @@ -121,4 +122,5 @@ LINE("libusbhid", "USB Human Interface D LINE("libutil", "System Utilities Library (libutil, \\-lutil)") LINE("libvgl", "Video Graphics Library (libvgl, \\-lvgl)") LINE("libx86_64", "x86_64 Architecture Library (libx86_64, \\-lx86_64)") +LINE("libxo", "Text, XML, JSON, and HTML Output Emission Library (libxo, \\-lxo)") LINE("libz", "Compression Library (libz, \\-lz)") From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 19:41:50 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5824C4AB; Wed, 3 Dec 2014 19:41:50 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45C7E19A; Wed, 3 Dec 2014 19:41:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3JfoYn070134; Wed, 3 Dec 2014 19:41:50 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3JfofT070133; Wed, 3 Dec 2014 19:41:50 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201412031941.sB3JfofT070133@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 3 Dec 2014 19:41:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275464 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 19:41:50 -0000 Author: sbruno Date: Wed Dec 3 19:41:49 2014 New Revision: 275464 URL: https://svnweb.freebsd.org/changeset/base/275464 Log: There is only one argemdio device on this board. Sponsored by: Nicholas Esborn Modified: head/sys/mips/conf/WZR-HPAG300H.hints Modified: head/sys/mips/conf/WZR-HPAG300H.hints ============================================================================== --- head/sys/mips/conf/WZR-HPAG300H.hints Wed Dec 3 18:14:21 2014 (r275463) +++ head/sys/mips/conf/WZR-HPAG300H.hints Wed Dec 3 19:41:49 2014 (r275464) @@ -9,11 +9,6 @@ hint.argemdio.0.maddr=0x19000000 hint.argemdio.0.msize=0x1000 hint.argemdio.0.order=0 -hint.argemdio.1.at="nexus0" -hint.argemdio.1.maddr=0x1a000000 -hint.argemdio.1.msize=0x1000 -hint.argemdio.1.order=0 - hint.arge.0.phymask=0x0 hint.arge.0.media=1000 hint.arge.0.fduplex=1 From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 21:48:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 87972199; Wed, 3 Dec 2014 21:48:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 68205117; Wed, 3 Dec 2014 21:48:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3LmVxJ038220; Wed, 3 Dec 2014 21:48:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3LmVNt038217; Wed, 3 Dec 2014 21:48:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412032148.sB3LmVNt038217@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 3 Dec 2014 21:48:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275467 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 21:48:31 -0000 Author: hselasky Date: Wed Dec 3 21:48:30 2014 New Revision: 275467 URL: https://svnweb.freebsd.org/changeset/base/275467 Log: Workaround for possible bug in the SAF1761 chip. Wait 125us before re-using a hardware propritary transfer descriptor, PTD, in USB host mode. If the PTD's are recycled too quickly, it has been observed that the hardware simply fails to schedule the requested job or resets completely disconnecting all devices. Modified: head/sys/dev/usb/controller/saf1761_otg.c head/sys/dev/usb/controller/saf1761_otg.h Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Wed Dec 3 19:44:24 2014 (r275466) +++ head/sys/dev/usb/controller/saf1761_otg.c Wed Dec 3 21:48:30 2014 (r275467) @@ -130,6 +130,7 @@ static void saf1761_otg_do_poll(struct u static void saf1761_otg_standard_done(struct usb_xfer *); static void saf1761_otg_intr_set(struct usb_xfer *, uint8_t); static void saf1761_otg_root_intr(struct saf1761_otg_softc *); +static void saf1761_otg_enable_psof(struct saf1761_otg_softc *, uint8_t); /* * Here is a list of what the SAF1761 chip can support. The main @@ -214,6 +215,7 @@ saf1761_otg_wakeup_peer(struct saf1761_o static uint8_t saf1761_host_channel_alloc(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { + uint32_t map; uint32_t x; if (td->channel < SOTG_HOST_CHANNEL_MAX) @@ -225,8 +227,11 @@ saf1761_host_channel_alloc(struct saf176 switch (td->ep_type) { case UE_INTERRUPT: + map = sc->sc_host_intr_map | + sc->sc_host_intr_busy_map[0] | + sc->sc_host_intr_busy_map[1]; for (x = 0; x != 32; x++) { - if (sc->sc_host_intr_map & (1 << x)) + if (map & (1 << x)) continue; sc->sc_host_intr_map |= (1 << x); td->channel = 32 + x; @@ -234,8 +239,11 @@ saf1761_host_channel_alloc(struct saf176 } break; case UE_ISOCHRONOUS: + map = sc->sc_host_isoc_map | + sc->sc_host_isoc_busy_map[0] | + sc->sc_host_isoc_busy_map[1]; for (x = 0; x != 32; x++) { - if (sc->sc_host_isoc_map & (1 << x)) + if (map & (1 << x)) continue; sc->sc_host_isoc_map |= (1 << x); td->channel = x; @@ -243,8 +251,11 @@ saf1761_host_channel_alloc(struct saf176 } break; default: + map = sc->sc_host_async_map | + sc->sc_host_async_busy_map[0] | + sc->sc_host_async_busy_map[1]; for (x = 0; x != 32; x++) { - if (sc->sc_host_async_map & (1 << x)) + if (map & (1 << x)) continue; sc->sc_host_async_map |= (1 << x); td->channel = 64 + x; @@ -269,6 +280,7 @@ saf1761_host_channel_free(struct saf1761 td->channel = SOTG_HOST_CHANNEL_MAX; sc->sc_host_intr_map &= ~(1 << x); sc->sc_host_intr_suspend_map &= ~(1 << x); + sc->sc_host_intr_busy_map[0] |= (1 << x); SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, (~sc->sc_host_intr_map) | sc->sc_host_intr_suspend_map); break; @@ -277,6 +289,7 @@ saf1761_host_channel_free(struct saf1761 td->channel = SOTG_HOST_CHANNEL_MAX; sc->sc_host_isoc_map &= ~(1 << x); sc->sc_host_isoc_suspend_map &= ~(1 << x); + sc->sc_host_isoc_busy_map[0] |= (1 << x); SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, (~sc->sc_host_isoc_map) | sc->sc_host_isoc_suspend_map); break; @@ -285,10 +298,12 @@ saf1761_host_channel_free(struct saf1761 td->channel = SOTG_HOST_CHANNEL_MAX; sc->sc_host_async_map &= ~(1 << x); sc->sc_host_async_suspend_map &= ~(1 << x); + sc->sc_host_async_busy_map[0] |= (1 << x); SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, (~sc->sc_host_async_map) | sc->sc_host_async_suspend_map); break; } + saf1761_otg_enable_psof(sc, 1); } static uint32_t @@ -1484,6 +1499,17 @@ saf1761_otg_interrupt_poll_locked(struct } static void +saf1761_otg_enable_psof(struct saf1761_otg_softc *sc, uint8_t on) +{ + if (on) { + sc->sc_intr_enable |= SOTG_DCINTERRUPT_IEPSOF; + } else { + sc->sc_intr_enable &= ~SOTG_DCINTERRUPT_IEPSOF; + } + SAF1761_WRITE_LE_4(sc, SOTG_DCINTERRUPT_EN, sc->sc_intr_enable); +} + +static void saf1761_otg_wait_suspend(struct saf1761_otg_softc *sc, uint8_t on) { if (on) { @@ -1565,6 +1591,27 @@ saf1761_otg_filter_interrupt(void *arg) (void) SAF1761_READ_LE_4(sc, SOTG_INT_PTD_DONE_PTD); (void) SAF1761_READ_LE_4(sc, SOTG_ISO_PTD_DONE_PTD); + if (status & SOTG_DCINTERRUPT_IEPSOF) { + if ((sc->sc_host_async_busy_map[1] | sc->sc_host_async_busy_map[0] | + sc->sc_host_intr_busy_map[1] | sc->sc_host_intr_busy_map[0] | + sc->sc_host_isoc_busy_map[1] | sc->sc_host_isoc_busy_map[0]) != 0) { + /* busy waiting is active */ + retval = FILTER_SCHEDULE_THREAD; + + sc->sc_host_async_busy_map[1] = sc->sc_host_async_busy_map[0]; + sc->sc_host_async_busy_map[0] = 0; + + sc->sc_host_intr_busy_map[1] = sc->sc_host_intr_busy_map[0]; + sc->sc_host_intr_busy_map[0] = 0; + + sc->sc_host_isoc_busy_map[1] = sc->sc_host_isoc_busy_map[0]; + sc->sc_host_isoc_busy_map[0] = 0; + } else { + /* busy waiting is not active */ + saf1761_otg_enable_psof(sc, 0); + } + } + if (status & SAF1761_DCINTERRUPT_THREAD_IRQ) retval = FILTER_SCHEDULE_THREAD; Modified: head/sys/dev/usb/controller/saf1761_otg.h ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.h Wed Dec 3 19:44:24 2014 (r275466) +++ head/sys/dev/usb/controller/saf1761_otg.h Wed Dec 3 21:48:30 2014 (r275467) @@ -139,10 +139,13 @@ struct saf1761_otg_softc { bus_space_tag_t sc_io_tag; bus_space_handle_t sc_io_hdl; + uint32_t sc_host_async_busy_map[2]; uint32_t sc_host_async_map; uint32_t sc_host_async_suspend_map; + uint32_t sc_host_intr_busy_map[2]; uint32_t sc_host_intr_map; uint32_t sc_host_intr_suspend_map; + uint32_t sc_host_isoc_busy_map[2]; uint32_t sc_host_isoc_map; uint32_t sc_host_isoc_suspend_map; uint32_t sc_intr_enable; /* enabled interrupts */ From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 21:55:45 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5643B3E8; Wed, 3 Dec 2014 21:55:45 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4279C1FC; Wed, 3 Dec 2014 21:55:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3Ltjfu043365; Wed, 3 Dec 2014 21:55:45 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3LtjJN043364; Wed, 3 Dec 2014 21:55:45 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412032155.sB3LtjJN043364@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 3 Dec 2014 21:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275468 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 21:55:45 -0000 Author: hselasky Date: Wed Dec 3 21:55:44 2014 New Revision: 275468 URL: https://svnweb.freebsd.org/changeset/base/275468 Log: Optimise the bit searching loops, by quickly skipping the 16 first set bits if all the 16 first bits are set. This way the worst case searching time is reduced from 32 to 16 cycles. Modified: head/sys/dev/usb/controller/saf1761_otg.c Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Wed Dec 3 21:48:30 2014 (r275467) +++ head/sys/dev/usb/controller/saf1761_otg.c Wed Dec 3 21:55:44 2014 (r275468) @@ -230,7 +230,7 @@ saf1761_host_channel_alloc(struct saf176 map = sc->sc_host_intr_map | sc->sc_host_intr_busy_map[0] | sc->sc_host_intr_busy_map[1]; - for (x = 0; x != 32; x++) { + for (x = ((map & 0xFFFF) == 0xFFFF) ? 16 : 0; x != 32; x++) { if (map & (1 << x)) continue; sc->sc_host_intr_map |= (1 << x); @@ -242,7 +242,7 @@ saf1761_host_channel_alloc(struct saf176 map = sc->sc_host_isoc_map | sc->sc_host_isoc_busy_map[0] | sc->sc_host_isoc_busy_map[1]; - for (x = 0; x != 32; x++) { + for (x = ((map & 0xFFFF) == 0xFFFF) ? 16 : 0; x != 32; x++) { if (map & (1 << x)) continue; sc->sc_host_isoc_map |= (1 << x); @@ -254,7 +254,7 @@ saf1761_host_channel_alloc(struct saf176 map = sc->sc_host_async_map | sc->sc_host_async_busy_map[0] | sc->sc_host_async_busy_map[1]; - for (x = 0; x != 32; x++) { + for (x = ((map & 0xFFFF) == 0xFFFF) ? 16 : 0; x != 32; x++) { if (map & (1 << x)) continue; sc->sc_host_async_map |= (1 << x); From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 22:03:25 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47B546D6; Wed, 3 Dec 2014 22:03:25 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BC2D7328; Wed, 3 Dec 2014 22:03:24 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id sB3M3MBp052453 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 4 Dec 2014 01:03:22 +0300 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id sB3M3Mxv052452; Thu, 4 Dec 2014 01:03:22 +0300 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 4 Dec 2014 01:03:22 +0300 From: Gleb Smirnoff To: "Andrey V. Elsukov" Subject: Re: svn commit: r275393 - head/sys/netipsec Message-ID: <20141203220322.GS47144@FreeBSD.org> References: <201412020528.sB25SfxW096682@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201412020528.sB25SfxW096682@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 22:03:25 -0000 On Tue, Dec 02, 2014 at 05:28:41AM +0000, Andrey V. Elsukov wrote: A> Author: ae A> Date: Tue Dec 2 05:28:40 2014 A> New Revision: 275393 A> URL: https://svnweb.freebsd.org/changeset/base/275393 A> A> Log: A> Remove unneded check. No need to do m_pullup to the size that we prepended. A> A> Sponsored by: Yandex LLC A> A> Modified: A> head/sys/netipsec/keysock.c A> A> Modified: head/sys/netipsec/keysock.c A> ============================================================================== A> --- head/sys/netipsec/keysock.c Tue Dec 2 04:20:50 2014 (r275392) A> +++ head/sys/netipsec/keysock.c Tue Dec 2 05:28:40 2014 (r275393) A> @@ -148,8 +148,6 @@ key_sendup0(rp, m, promisc) A> struct sadb_msg *pmsg; A> A> M_PREPEND(m, sizeof(struct sadb_msg), M_NOWAIT); A> - if (m && m->m_len < sizeof(struct sadb_msg)) A> - m = m_pullup(m, sizeof(struct sadb_msg)); A> if (!m) { A> PFKEYSTAT_INC(in_nomem); A> m_freem(m); A> - Substitute M_PREPEND with m_prepend() - style: if (m == NULL) - Don't call m_freem(NULL) :) -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 22:14:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81C0BB3D; Wed, 3 Dec 2014 22:14:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 543CD640; Wed, 3 Dec 2014 22:14:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3MEEbt054573; Wed, 3 Dec 2014 22:14:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3MEEWh054572; Wed, 3 Dec 2014 22:14:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201412032214.sB3MEEWh054572@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 3 Dec 2014 22:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275469 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 22:14:14 -0000 Author: imp Date: Wed Dec 3 22:14:13 2014 New Revision: 275469 URL: https://svnweb.freebsd.org/changeset/base/275469 Log: Const poison in a few places to ensure we don't modify things through the module data pointer. Modified: head/sys/kern/kern_linker.c Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Wed Dec 3 21:55:44 2014 (r275468) +++ head/sys/kern/kern_linker.c Wed Dec 3 22:14:13 2014 (r275469) @@ -139,8 +139,8 @@ static caddr_t linker_file_lookup_symbol const char* name, int deps); static int linker_load_module(const char *kldname, const char *modname, struct linker_file *parent, - struct mod_depend *verinfo, struct linker_file **lfpp); -static modlist_t modlist_lookup2(const char *name, struct mod_depend *verinfo); + const struct mod_depend *verinfo, struct linker_file **lfpp); +static modlist_t modlist_lookup2(const char *name, const struct mod_depend *verinfo); static void linker_init(void *arg) @@ -1353,7 +1353,7 @@ modlist_lookup(const char *name, int ver } static modlist_t -modlist_lookup2(const char *name, struct mod_depend *verinfo) +modlist_lookup2(const char *name, const struct mod_depend *verinfo) { modlist_t mod, bestmod; int ver; @@ -1426,7 +1426,7 @@ linker_preload(void *arg) linker_file_list_t depended_files; struct mod_metadata *mp, *nmp; struct mod_metadata **start, **stop, **mdp, **nmdp; - struct mod_depend *verinfo; + const struct mod_depend *verinfo; int nver; int resolves; modlist_t mod; @@ -1716,7 +1716,7 @@ linker_lookup_file(const char *path, int */ static char * linker_hints_lookup(const char *path, int pathlen, const char *modname, - int modnamelen, struct mod_depend *verinfo) + int modnamelen, const struct mod_depend *verinfo) { struct thread *td = curthread; /* XXX */ struct ucred *cred = td ? td->td_ucred : NULL; @@ -1849,7 +1849,7 @@ bad: */ static char * linker_search_module(const char *modname, int modnamelen, - struct mod_depend *verinfo) + const struct mod_depend *verinfo) { char *cp, *ep, *result; @@ -1953,7 +1953,7 @@ linker_hwpmc_list_objects(void) */ static int linker_load_module(const char *kldname, const char *modname, - struct linker_file *parent, struct mod_depend *verinfo, + struct linker_file *parent, const struct mod_depend *verinfo, struct linker_file **lfpp) { linker_file_t lfdep; @@ -2027,7 +2027,7 @@ linker_load_dependencies(linker_file_t l linker_file_t lfdep; struct mod_metadata **start, **stop, **mdp, **nmdp; struct mod_metadata *mp, *nmp; - struct mod_depend *verinfo; + const struct mod_depend *verinfo; modlist_t mod; const char *modname, *nmodname; int ver, error = 0, count; From owner-svn-src-head@FreeBSD.ORG Wed Dec 3 23:37:24 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B43FA0; Wed, 3 Dec 2014 23:37:24 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 276DAF0C; Wed, 3 Dec 2014 23:37:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3NbOwT001185; Wed, 3 Dec 2014 23:37:24 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3NbOTF001184; Wed, 3 Dec 2014 23:37:24 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201412032337.sB3NbOTF001184@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Wed, 3 Dec 2014 23:37:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275470 - head/sys/mips/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 23:37:24 -0000 Author: sbruno Date: Wed Dec 3 23:37:23 2014 New Revision: 275470 URL: https://svnweb.freebsd.org/changeset/base/275470 Log: Switch is an 8316, so make the comments say that. Delete extraneous comment line that manifested itself from cut-n-pasting. Sponsored by: Nicholas Esborn Modified: head/sys/mips/conf/WZR-HPAG300H.hints Modified: head/sys/mips/conf/WZR-HPAG300H.hints ============================================================================== --- head/sys/mips/conf/WZR-HPAG300H.hints Wed Dec 3 22:14:13 2014 (r275469) +++ head/sys/mips/conf/WZR-HPAG300H.hints Wed Dec 3 23:37:23 2014 (r275470) @@ -3,7 +3,6 @@ # arge0 is connected to the LAN side of the switch PHY. # arge1 is connected to the single port WAN side of the switch PHY. -# arge1 MDIO bus hint.argemdio.0.at="nexus0" hint.argemdio.0.maddr=0x19000000 hint.argemdio.0.msize=0x1000 @@ -24,7 +23,7 @@ hint.arge.1.mdio=mdioproxy1 # .. off hint.arge.1.miimode=3 # -# AR8317 switch config +# AR8316 switch config # hint.arswitch.0.at="mdio0" hint.arswitch.0.is_7240=0 # We need to be explicitly told this From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 00:54:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E5BE3B3; Thu, 4 Dec 2014 00:54:53 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B8619B5; Thu, 4 Dec 2014 00:54:52 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id sB40spIH013525 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 3 Dec 2014 16:54:52 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id sB40spNW013524; Wed, 3 Dec 2014 16:54:51 -0800 (PST) (envelope-from jmg) Date: Wed, 3 Dec 2014 16:54:51 -0800 From: John-Mark Gurney To: Hans Petter Selasky Subject: Re: svn commit: r275468 - head/sys/dev/usb/controller Message-ID: <20141204005451.GM99957@funkthat.com> References: <201412032155.sB3LtjJN043364@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201412032155.sB3LtjJN043364@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Wed, 03 Dec 2014 16:54:52 -0800 (PST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 00:54:53 -0000 Hans Petter Selasky wrote this message on Wed, Dec 03, 2014 at 21:55 +0000: > Author: hselasky > Date: Wed Dec 3 21:55:44 2014 > New Revision: 275468 > URL: https://svnweb.freebsd.org/changeset/base/275468 > > Log: > Optimise the bit searching loops, by quickly skipping the 16 first set > bits if all the 16 first bits are set. This way the worst case > searching time is reduced from 32 to 16 cycles. You could use ffs instead: x = ffs(~map); if (x) { x--; /* normal code */ } This has the benefit of using a single instruction on platforms that support it (bsfl on i386), though apparently, we haven't optimized this for all platforms... arm has a version for int, but their ffsl does the same linear search instead of just calling ffs, or at least detecting if sizeof(long) == sizeof(int) and calling ffs... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 02:28:23 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A42A64D; Thu, 4 Dec 2014 02:28:23 +0000 (UTC) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F1E52F2; Thu, 4 Dec 2014 02:28:23 +0000 (UTC) Received: by mail-ig0-f171.google.com with SMTP id z20so13906676igj.16 for ; Wed, 03 Dec 2014 18:28:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/wIxq63YgSJ/7wzt/8lw27fCEElkH1Gc9QEiGnJEamA=; b=vAqB1mn2NVXzC2bWTsO1gkfSjAWIiwiY3umwM3ME91WoKQeYxhya4AVqHG0JW0uzQB 1xEmEzLAr12eYdGV2YpYOs6QKTxOtpfO00l6x1T0dSS0/xasEKRPmz0MyP5HMDquGtqH PBjpgZtU6MRTGRjO/VdQvpJ+RZ5Zs91nJK06OlHwsENQMqiF+cutWq5SqY9zaDNHORea uoLEm5qaicw8rTjjw68SK/4JJcgUzPyWCKCzZ7rxCvkr3dtVHGiW2jryD0WMonKEVB5F o9SAdU7n7oYyUd7+ILeC6GYSUTttA46Bw+S9hcbaXi/8ihk3pdTZn7KxqrqVlnnPKOWm vIrg== MIME-Version: 1.0 X-Received: by 10.43.181.69 with SMTP id ph5mr9601270icc.83.1417660102321; Wed, 03 Dec 2014 18:28:22 -0800 (PST) Received: by 10.107.10.31 with HTTP; Wed, 3 Dec 2014 18:28:22 -0800 (PST) In-Reply-To: <201412021955.sB2JtiXL009756@svn.freebsd.org> References: <201412021955.sB2JtiXL009756@svn.freebsd.org> Date: Wed, 3 Dec 2014 21:28:22 -0500 Message-ID: Subject: Re: svn commit: r275422 - in head/sys: amd64/conf i386/conf pc98/conf powerpc/conf sparc64/conf From: Ryan Stone To: "George V. Neville-Neil" Content-Type: text/plain; charset=UTF-8 Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 02:28:23 -0000 Why is DEADLKRES also excluded? It was designed to be safe to run in production without a noticeable perf hit. On Tue, Dec 2, 2014 at 2:55 PM, George V. Neville-Neil wrote: > Author: gnn > Date: Tue Dec 2 19:55:43 2014 > New Revision: 275422 > URL: https://svnweb.freebsd.org/changeset/base/275422 > > Log: > This configuration file removes several debugging options, including > WITNESS and INVARIANTS checking, which are known to have significant > performance impact on running systems. When benchmarking new features > this kernel should be used instead of the standard GENERIC. > This kernel configuration should never appear outside of the HEAD > of the FreeBSD tree. > > Added: > head/sys/amd64/conf/GENERIC-NODEBUG (contents, props changed) > head/sys/i386/conf/GENERIC-NODEBUG (contents, props changed) > head/sys/pc98/conf/GENERIC-NODEBUG (contents, props changed) > head/sys/powerpc/conf/GENERIC-NODEBUG (contents, props changed) > head/sys/sparc64/conf/GENERIC-NODEBUG (contents, props changed) > > Added: head/sys/amd64/conf/GENERIC-NODEBUG > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/amd64/conf/GENERIC-NODEBUG Tue Dec 2 19:55:43 2014 (r275422) > @@ -0,0 +1,38 @@ > +# > +# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file > +# for FreeBSD/amd64 > +# > +# This configuration file removes several debugging options, including > +# WITNESS and INVARIANTS checking, which are known to have significant > +# performance impact on running systems. When benchmarking new features > +# this kernel should be used instead of the standard GENERIC. > +# This kernel configuration should never appear outside of the HEAD > +# of the FreeBSD tree. > +# > +# For more information on this file, please read the config(5) manual page, > +# and/or the handbook section on Kernel Configuration Files: > +# > +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html > +# > +# The handbook is also available locally in /usr/share/doc/handbook > +# if you've installed the doc distribution, otherwise always see the > +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the > +# latest information. > +# > +# An exhaustive list of options and more detailed explanations of the > +# device lines is also present in the ../../conf/NOTES and NOTES files. > +# If you are in doubt as to the purpose or necessity of a line, check first > +# in NOTES. > +# > +# $FreeBSD$ > + > +include GENERIC > + > +ident GENERIC-NODEBUG > + > +nooptions INVARIANTS > +nooptions INVARIANT_SUPPORT > +nooptions WITNESS > +nooptions WITNESS_SKIPSPIN > +nooptions DEADLKRES > + > > Added: head/sys/i386/conf/GENERIC-NODEBUG > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/i386/conf/GENERIC-NODEBUG Tue Dec 2 19:55:43 2014 (r275422) > @@ -0,0 +1,38 @@ > +# > +# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file > +# for FreeBSD/i386 > +# > +# This configuration file removes several debugging options, including > +# WITNESS and INVARIANTS checking, which are known to have significant > +# performance impact on running systems. When benchmarking new features > +# this kernel should be used instead of the standard GENERIC. > +# This kernel configuration should never appear outside of the HEAD > +# of the FreeBSD tree. > +# > +# For more information on this file, please read the config(5) manual page, > +# and/or the handbook section on Kernel Configuration Files: > +# > +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html > +# > +# The handbook is also available locally in /usr/share/doc/handbook > +# if you've installed the doc distribution, otherwise always see the > +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the > +# latest information. > +# > +# An exhaustive list of options and more detailed explanations of the > +# device lines is also present in the ../../conf/NOTES and NOTES files. > +# If you are in doubt as to the purpose or necessity of a line, check first > +# in NOTES. > +# > +# $FreeBSD$ > + > +include GENERIC > + > +ident GENERIC-NODEBUG > + > +nooptions INVARIANTS > +nooptions INVARIANT_SUPPORT > +nooptions WITNESS > +nooptions WITNESS_SKIPSPIN > +nooptions DEADLKRES > + > > Added: head/sys/pc98/conf/GENERIC-NODEBUG > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/pc98/conf/GENERIC-NODEBUG Tue Dec 2 19:55:43 2014 (r275422) > @@ -0,0 +1,38 @@ > +# > +# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file > +# for FreeBSD/pc98 > +# > +# This configuration file removes several debugging options, including > +# WITNESS and INVARIANTS checking, which are known to have significant > +# performance impact on running systems. When benchmarking new features > +# this kernel should be used instead of the standard GENERIC. > +# This kernel configuration should never appear outside of the HEAD > +# of the FreeBSD tree. > +# > +# For more information on this file, please read the config(5) manual page, > +# and/or the handbook section on Kernel Configuration Files: > +# > +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html > +# > +# The handbook is also available locally in /usr/share/doc/handbook > +# if you've installed the doc distribution, otherwise always see the > +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the > +# latest information. > +# > +# An exhaustive list of options and more detailed explanations of the > +# device lines is also present in the ../../conf/NOTES and NOTES files. > +# If you are in doubt as to the purpose or necessity of a line, check first > +# in NOTES. > +# > +# $FreeBSD$ > + > +include GENERIC > + > +ident GENERIC-NODEBUG > + > +nooptions INVARIANTS > +nooptions INVARIANT_SUPPORT > +nooptions WITNESS > +nooptions WITNESS_SKIPSPIN > +nooptions DEADLKRES > + > > Added: head/sys/powerpc/conf/GENERIC-NODEBUG > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/powerpc/conf/GENERIC-NODEBUG Tue Dec 2 19:55:43 2014 (r275422) > @@ -0,0 +1,38 @@ > +# > +# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file > +# for FreeBSD/powerpc > +# > +# This configuration file removes several debugging options, including > +# WITNESS and INVARIANTS checking, which are known to have significant > +# performance impact on running systems. When benchmarking new features > +# this kernel should be used instead of the standard GENERIC. > +# This kernel configuration should never appear outside of the HEAD > +# of the FreeBSD tree. > +# > +# For more information on this file, please read the config(5) manual page, > +# and/or the handbook section on Kernel Configuration Files: > +# > +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html > +# > +# The handbook is also available locally in /usr/share/doc/handbook > +# if you've installed the doc distribution, otherwise always see the > +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the > +# latest information. > +# > +# An exhaustive list of options and more detailed explanations of the > +# device lines is also present in the ../../conf/NOTES and NOTES files. > +# If you are in doubt as to the purpose or necessity of a line, check first > +# in NOTES. > +# > +# $FreeBSD$ > + > +include GENERIC > + > +ident GENERIC-NODEBUG > + > +nooptions INVARIANTS > +nooptions INVARIANT_SUPPORT > +nooptions WITNESS > +nooptions WITNESS_SKIPSPIN > +nooptions DEADLKRES > + > > Added: head/sys/sparc64/conf/GENERIC-NODEBUG > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/sparc64/conf/GENERIC-NODEBUG Tue Dec 2 19:55:43 2014 (r275422) > @@ -0,0 +1,38 @@ > +# > +# GENERIC-NODEBUG -- WITNESS and INVARIANTS free kernel configuration file > +# for FreeBSD/sparc64 > +# > +# This configuration file removes several debugging options, including > +# WITNESS and INVARIANTS checking, which are known to have significant > +# performance impact on running systems. When benchmarking new features > +# this kernel should be used instead of the standard GENERIC. > +# This kernel configuration should never appear outside of the HEAD > +# of the FreeBSD tree. > +# > +# For more information on this file, please read the config(5) manual page, > +# and/or the handbook section on Kernel Configuration Files: > +# > +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html > +# > +# The handbook is also available locally in /usr/share/doc/handbook > +# if you've installed the doc distribution, otherwise always see the > +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the > +# latest information. > +# > +# An exhaustive list of options and more detailed explanations of the > +# device lines is also present in the ../../conf/NOTES and NOTES files. > +# If you are in doubt as to the purpose or necessity of a line, check first > +# in NOTES. > +# > +# $FreeBSD$ > + > +include GENERIC > + > +ident GENERIC-NODEBUG > + > +nooptions INVARIANTS > +nooptions INVARIANT_SUPPORT > +nooptions WITNESS > +nooptions WITNESS_SKIPSPIN > +nooptions DEADLKRES > + > From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 04:46:07 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3CBD0116; Thu, 4 Dec 2014 04:46:07 +0000 (UTC) Received: from butcher-nb.yandex.net (hub.freebsd.org [IPv6:2001:1900:2254:206c::16:88]) by mx2.freebsd.org (Postfix) with ESMTP id 1318F1E39; Thu, 4 Dec 2014 04:46:05 +0000 (UTC) Message-ID: <547FE708.1000300@FreeBSD.org> Date: Thu, 04 Dec 2014 07:46:00 +0300 From: "Andrey V. Elsukov" User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r275393 - head/sys/netipsec References: <201412020528.sB25SfxW096682@svn.freebsd.org> <20141203220322.GS47144@FreeBSD.org> In-Reply-To: <20141203220322.GS47144@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 04:46:07 -0000 On 04.12.2014 01:03, Gleb Smirnoff wrote: > On Tue, Dec 02, 2014 at 05:28:41AM +0000, Andrey V. Elsukov wrote: > A> Author: ae > A> Date: Tue Dec 2 05:28:40 2014 > A> New Revision: 275393 > A> URL: https://svnweb.freebsd.org/changeset/base/275393 > A> > A> Log: > A> Remove unneded check. No need to do m_pullup to the size that we prepended. > A> > A> Sponsored by: Yandex LLC > A> > A> Modified: > A> head/sys/netipsec/keysock.c > A> > A> Modified: head/sys/netipsec/keysock.c > A> ============================================================================== > A> --- head/sys/netipsec/keysock.c Tue Dec 2 04:20:50 2014 (r275392) > A> +++ head/sys/netipsec/keysock.c Tue Dec 2 05:28:40 2014 (r275393) > A> @@ -148,8 +148,6 @@ key_sendup0(rp, m, promisc) > A> struct sadb_msg *pmsg; > A> > A> M_PREPEND(m, sizeof(struct sadb_msg), M_NOWAIT); > A> - if (m && m->m_len < sizeof(struct sadb_msg)) > A> - m = m_pullup(m, sizeof(struct sadb_msg)); > A> if (!m) { > A> PFKEYSTAT_INC(in_nomem); > A> m_freem(m); > A> > > - Substitute M_PREPEND with m_prepend() m_prepend() will always allocate new mbuf, but M_PREPEND can use unused space without allocation. I didn't checked how it behaves here, but very often first mbuf in the chain that contains packet header is aligned to the end of mbuf's data (it has unused space from start of the mbuf's data), so M_PREPEND is preferable. > - style: if (m == NULL) > - Don't call m_freem(NULL) -- WBR, Andrey V. Elsukov From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 05:02:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 808C655B; Thu, 4 Dec 2014 05:02:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6E2647B0; Thu, 4 Dec 2014 05:02:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB452DGN081184; Thu, 4 Dec 2014 05:02:13 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB452Dc2081183; Thu, 4 Dec 2014 05:02:13 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201412040502.sB452Dc2081183@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 4 Dec 2014 05:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275473 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 05:02:13 -0000 Author: ae Date: Thu Dec 4 05:02:12 2014 New Revision: 275473 URL: https://svnweb.freebsd.org/changeset/base/275473 Log: Fix style(9) and remove m_freem(NULL). Add XXX comment, it looks incorrect, because m_pkthdr.len is already incremented by M_PREPEND(). Sponsored by: Yandex LLC Modified: head/sys/netipsec/keysock.c Modified: head/sys/netipsec/keysock.c ============================================================================== --- head/sys/netipsec/keysock.c Thu Dec 4 01:21:56 2014 (r275472) +++ head/sys/netipsec/keysock.c Thu Dec 4 05:02:12 2014 (r275473) @@ -145,12 +145,11 @@ key_sendup0(struct rawcb *rp, struct mbu struct sadb_msg *pmsg; M_PREPEND(m, sizeof(struct sadb_msg), M_NOWAIT); - if (!m) { + if (m == NULL) { PFKEYSTAT_INC(in_nomem); - m_freem(m); - return ENOBUFS; + return (ENOBUFS); } - m->m_pkthdr.len += sizeof(*pmsg); + m->m_pkthdr.len += sizeof(*pmsg); /* XXX: is this correct? */ pmsg = mtod(m, struct sadb_msg *); bzero(pmsg, sizeof(*pmsg)); From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 07:20:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C0856B5; Thu, 4 Dec 2014 07:20:40 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5ECDF3FD; Thu, 4 Dec 2014 07:20:40 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 684881FE022; Thu, 4 Dec 2014 08:20:37 +0100 (CET) Message-ID: <54800B60.9020208@selasky.org> Date: Thu, 04 Dec 2014 08:21:04 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: John-Mark Gurney Subject: Re: svn commit: r275468 - head/sys/dev/usb/controller References: <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> In-Reply-To: <20141204005451.GM99957@funkthat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 07:20:40 -0000 On 12/04/14 01:54, John-Mark Gurney wrote: > Hans Petter Selasky wrote this message on Wed, Dec 03, 2014 at 21:55 +0000: >> Author: hselasky >> Date: Wed Dec 3 21:55:44 2014 >> New Revision: 275468 >> URL: https://svnweb.freebsd.org/changeset/base/275468 >> >> Log: >> Optimise the bit searching loops, by quickly skipping the 16 first set >> bits if all the 16 first bits are set. This way the worst case >> searching time is reduced from 32 to 16 cycles. > > You could use ffs instead: > x = ffs(~map); > if (x) { > x--; > /* normal code */ > } > > This has the benefit of using a single instruction on platforms that > support it (bsfl on i386), though apparently, we haven't optimized this > for all platforms... arm has a version for int, but their ffsl does > the same linear search instead of just calling ffs, or at least > detecting if sizeof(long) == sizeof(int) and calling ffs... > Yes, I'm aware about that, but like you say it is not optimised for all platforms yet. So I'm not sure if it will give any benefit for the platform the driver is running on .... I'll see if I can change the logic inside the C-version of ffs() and the do the swap like you suggest. --HPS From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 11:34:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E83937AB; Thu, 4 Dec 2014 11:34:21 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D370B381; Thu, 4 Dec 2014 11:34:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4BYLlD062231; Thu, 4 Dec 2014 11:34:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4BYJrn062220; Thu, 4 Dec 2014 11:34:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412041134.sB4BYJrn062220@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 4 Dec 2014 11:34:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275474 - in head/sys: cam/ctl cam/scsi cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 11:34:22 -0000 Author: mav Date: Thu Dec 4 11:34:19 2014 New Revision: 275474 URL: https://svnweb.freebsd.org/changeset/base/275474 Log: Add GET LBA STATUS command support to CTL. It is implemented for LUNs backed by ZVOLs in "dev" mode and files. GEOM has no such API, so for LUNs backed by raw devices all LBAs will be reported as mapped/unknown. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl.h head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_backend_ramdisk.c head/sys/cam/ctl/ctl_cmd_table.c head/sys/cam/ctl/ctl_private.h head/sys/cam/scsi/scsi_all.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Dec 4 05:02:12 2014 (r275473) +++ head/sys/cam/ctl/ctl.c Thu Dec 4 11:34:19 2014 (r275474) @@ -5172,6 +5172,40 @@ ctl_config_write_done(union ctl_io *io) free(buf, M_CTL); } +void +ctl_config_read_done(union ctl_io *io) +{ + uint8_t *buf; + + /* + * If there is some error -- we are done, skip data transfer. + */ + if ((io->io_hdr.flags & CTL_FLAG_ABORT) != 0 || + ((io->io_hdr.status & CTL_STATUS_MASK) != CTL_STATUS_NONE && + (io->io_hdr.status & CTL_STATUS_MASK) != CTL_SUCCESS)) { + if (io->io_hdr.flags & CTL_FLAG_ALLOCATED) + buf = io->scsiio.kern_data_ptr; + else + buf = NULL; + ctl_done(io); + if (buf) + free(buf, M_CTL); + return; + } + + /* + * If the IO_CONT flag is set, we need to call the supplied + * function to continue processing the I/O, instead of completing + * the I/O just yet. + */ + if (io->io_hdr.flags & CTL_FLAG_IO_CONT) { + io->scsiio.io_cont(io); + return; + } + + ctl_datamove(io); +} + /* * SCSI release command. */ @@ -7173,6 +7207,66 @@ ctl_read_capacity_16(struct ctl_scsiio * } int +ctl_get_lba_status(struct ctl_scsiio *ctsio) +{ + struct scsi_get_lba_status *cdb; + struct scsi_get_lba_status_data *data; + struct ctl_lun *lun; + struct ctl_lba_len_flags *lbalen; + uint64_t lba; + uint32_t alloc_len, total_len; + int retval; + + CTL_DEBUG_PRINT(("ctl_get_lba_status\n")); + + lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; + cdb = (struct scsi_get_lba_status *)ctsio->cdb; + lba = scsi_8btou64(cdb->addr); + alloc_len = scsi_4btoul(cdb->alloc_len); + + if (lba > lun->be_lun->maxlba) { + ctl_set_lba_out_of_range(ctsio); + ctl_done((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); + } + + total_len = sizeof(*data) + sizeof(data->descr[0]); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); + data = (struct scsi_get_lba_status_data *)ctsio->kern_data_ptr; + + if (total_len < alloc_len) { + ctsio->residual = alloc_len - total_len; + ctsio->kern_data_len = total_len; + ctsio->kern_total_len = total_len; + } else { + ctsio->residual = 0; + ctsio->kern_data_len = alloc_len; + ctsio->kern_total_len = alloc_len; + } + ctsio->kern_data_resid = 0; + ctsio->kern_rel_offset = 0; + ctsio->kern_sg_entries = 0; + + /* Fill dummy data in case backend can't tell anything. */ + scsi_ulto4b(4 + sizeof(data->descr[0]), data->length); + scsi_u64to8b(lba, data->descr[0].addr); + scsi_ulto4b(MIN(UINT32_MAX, lun->be_lun->maxlba + 1 - lba), + data->descr[0].length); + data->descr[0].status = 0; /* Mapped or unknown. */ + + ctl_set_success(ctsio); + ctsio->io_hdr.flags |= CTL_FLAG_ALLOCATED; + ctsio->be_move_done = ctl_config_move_done; + + lbalen = (struct ctl_lba_len_flags *)&ctsio->io_hdr.ctl_private[CTL_PRIV_LBA_LEN]; + lbalen->lba = lba; + lbalen->len = total_len; + lbalen->flags = 0; + retval = lun->backend->config_read((union ctl_io *)ctsio); + return (CTL_RETVAL_COMPLETE); +} + +int ctl_read_defect(struct ctl_scsiio *ctsio) { struct scsi_read_defect_data_10 *ccb10; @@ -10642,6 +10736,14 @@ ctl_get_lba_len(union ctl_io *io, uint64 *len = UINT64_MAX; break; } + case SERVICE_ACTION_IN: { /* GET LBA STATUS */ + struct scsi_get_lba_status *cdb; + + cdb = (struct scsi_get_lba_status *)io->scsiio.cdb; + *lba = scsi_8btou64(cdb->addr); + *len = UINT32_MAX; + break; + } default: return (1); break; /* NOTREACHED */ Modified: head/sys/cam/ctl/ctl.h ============================================================================== --- head/sys/cam/ctl/ctl.h Thu Dec 4 05:02:12 2014 (r275473) +++ head/sys/cam/ctl/ctl.h Thu Dec 4 11:34:19 2014 (r275474) @@ -186,6 +186,7 @@ int ctl_config_move_done(union ctl_io *i void ctl_datamove(union ctl_io *io); void ctl_done(union ctl_io *io); void ctl_data_submit_done(union ctl_io *io); +void ctl_config_read_done(union ctl_io *io); void ctl_config_write_done(union ctl_io *io); void ctl_portDB_changed(int portnum); void ctl_init_isc_msg(void); Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Thu Dec 4 05:02:12 2014 (r275473) +++ head/sys/cam/ctl/ctl_backend_block.c Thu Dec 4 11:34:19 2014 (r275474) @@ -68,6 +68,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -163,6 +164,7 @@ struct ctl_be_block_lun { cbb_dispatch_t dispatch; cbb_dispatch_t lun_flush; cbb_dispatch_t unmap; + cbb_dispatch_t get_lba_status; cbb_getattr_t getattr; uma_zone_t lun_zone; uint64_t size_blocks; @@ -180,6 +182,7 @@ struct ctl_be_block_lun { struct task io_task; int num_threads; STAILQ_HEAD(, ctl_io_hdr) input_queue; + STAILQ_HEAD(, ctl_io_hdr) config_read_queue; STAILQ_HEAD(, ctl_io_hdr) config_write_queue; STAILQ_HEAD(, ctl_io_hdr) datamove_queue; struct mtx_padalign io_lock; @@ -237,6 +240,8 @@ static void ctl_be_block_flush_file(stru struct ctl_be_block_io *beio); static void ctl_be_block_dispatch_file(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); +static void ctl_be_block_gls_file(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio); static void ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); static void ctl_be_block_unmap_dev(struct ctl_be_block_lun *be_lun, @@ -245,6 +250,8 @@ static void ctl_be_block_dispatch_dev(st struct ctl_be_block_io *beio); static uint64_t ctl_be_block_getattr_dev(struct ctl_be_block_lun *be_lun, const char *attrname); +static void ctl_be_block_cr_dispatch(struct ctl_be_block_lun *be_lun, + union ctl_io *io); static void ctl_be_block_cw_dispatch(struct ctl_be_block_lun *be_lun, union ctl_io *io); static void ctl_be_block_dispatch(struct ctl_be_block_lun *be_lun, @@ -753,6 +760,46 @@ ctl_be_block_dispatch_file(struct ctl_be } static void +ctl_be_block_gls_file(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio) +{ + union ctl_io *io = beio->io; + struct ctl_lba_len_flags *lbalen = ARGS(io); + struct scsi_get_lba_status_data *data; + off_t roff, off; + int error, status; + + DPRINTF("entered\n"); + + off = roff = ((off_t)lbalen->lba) << be_lun->blocksize_shift; + vn_lock(be_lun->vn, LK_SHARED | LK_RETRY); + error = VOP_IOCTL(be_lun->vn, FIOSEEKHOLE, &off, + 0, curthread->td_ucred, curthread); + if (error == 0 && off > roff) + status = 0; /* mapped up to off */ + else { + error = VOP_IOCTL(be_lun->vn, FIOSEEKDATA, &off, + 0, curthread->td_ucred, curthread); + if (error == 0 && off > roff) + status = 1; /* deallocated up to off */ + else { + status = 0; /* unknown up to the end */ + off = be_lun->size_bytes; + } + } + VOP_UNLOCK(be_lun->vn, 0); + + off >>= be_lun->blocksize_shift; + data = (struct scsi_get_lba_status_data *)io->scsiio.kern_data_ptr; + scsi_u64to8b(lbalen->lba, data->descr[0].addr); + scsi_ulto4b(MIN(UINT32_MAX, off - lbalen->lba), + data->descr[0].length); + data->descr[0].status = status; + + ctl_complete_beio(beio); +} + +static void ctl_be_block_dispatch_zvol(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) { @@ -845,6 +892,45 @@ ctl_be_block_dispatch_zvol(struct ctl_be } static void +ctl_be_block_gls_zvol(struct ctl_be_block_lun *be_lun, + struct ctl_be_block_io *beio) +{ + struct ctl_be_block_devdata *dev_data = &be_lun->backend.dev; + union ctl_io *io = beio->io; + struct ctl_lba_len_flags *lbalen = ARGS(io); + struct scsi_get_lba_status_data *data; + off_t roff, off; + int error, status; + + DPRINTF("entered\n"); + + off = roff = ((off_t)lbalen->lba) << be_lun->blocksize_shift; + error = (*dev_data->csw->d_ioctl)(dev_data->cdev, FIOSEEKHOLE, + (caddr_t)&off, FREAD, curthread); + if (error == 0 && off > roff) + status = 0; /* mapped up to off */ + else { + error = (*dev_data->csw->d_ioctl)(dev_data->cdev, FIOSEEKDATA, + (caddr_t)&off, FREAD, curthread); + if (error == 0 && off > roff) + status = 1; /* deallocated up to off */ + else { + status = 0; /* unknown up to the end */ + off = be_lun->size_bytes; + } + } + + off >>= be_lun->blocksize_shift; + data = (struct scsi_get_lba_status_data *)io->scsiio.kern_data_ptr; + scsi_u64to8b(lbalen->lba, data->descr[0].addr); + scsi_ulto4b(MIN(UINT32_MAX, off - lbalen->lba), + data->descr[0].length); + data->descr[0].status = status; + + ctl_complete_beio(beio); +} + +static void ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) { @@ -1217,6 +1303,49 @@ ctl_be_block_cw_dispatch_unmap(struct ct } static void +ctl_be_block_cr_done(struct ctl_be_block_io *beio) +{ + union ctl_io *io; + + io = beio->io; + ctl_free_beio(beio); + ctl_config_read_done(io); +} + +static void +ctl_be_block_cr_dispatch(struct ctl_be_block_lun *be_lun, + union ctl_io *io) +{ + struct ctl_be_block_io *beio; + struct ctl_be_block_softc *softc; + + DPRINTF("entered\n"); + + softc = be_lun->softc; + beio = ctl_alloc_beio(softc); + beio->io = io; + beio->lun = be_lun; + beio->beio_cont = ctl_be_block_cr_done; + PRIV(io)->ptr = (void *)beio; + + switch (io->scsiio.cdb[0]) { + case SERVICE_ACTION_IN: /* GET LBA STATUS */ + beio->bio_cmd = -1; + beio->ds_trans_type = DEVSTAT_NO_DATA; + beio->ds_tag_type = DEVSTAT_TAG_ORDERED; + beio->io_len = 0; + if (be_lun->get_lba_status) + be_lun->get_lba_status(be_lun, beio); + else + ctl_be_block_cr_done(beio); + break; + default: + panic("Unhandled CDB type %#x", io->scsiio.cdb[0]); + break; + } +} + +static void ctl_be_block_cw_done(struct ctl_be_block_io *beio) { union ctl_io *io; @@ -1451,16 +1580,21 @@ ctl_be_block_worker(void *context, int p } io = (union ctl_io *)STAILQ_FIRST(&be_lun->config_write_queue); if (io != NULL) { - DPRINTF("config write queue\n"); - STAILQ_REMOVE(&be_lun->config_write_queue, &io->io_hdr, ctl_io_hdr, links); - mtx_unlock(&be_lun->queue_lock); - ctl_be_block_cw_dispatch(be_lun, io); - + mtx_lock(&be_lun->queue_lock); + continue; + } + io = (union ctl_io *)STAILQ_FIRST(&be_lun->config_read_queue); + if (io != NULL) { + DPRINTF("config read queue\n"); + STAILQ_REMOVE(&be_lun->config_read_queue, &io->io_hdr, + ctl_io_hdr, links); + mtx_unlock(&be_lun->queue_lock); + ctl_be_block_cr_dispatch(be_lun, io); mtx_lock(&be_lun->queue_lock); continue; } @@ -1589,6 +1723,7 @@ ctl_be_block_open_file(struct ctl_be_blo be_lun->dev_type = CTL_BE_BLOCK_FILE; be_lun->dispatch = ctl_be_block_dispatch_file; be_lun->lun_flush = ctl_be_block_flush_file; + be_lun->get_lba_status = ctl_be_block_gls_file; error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); if (error != 0) { @@ -1675,9 +1810,10 @@ ctl_be_block_open_dev(struct ctl_be_bloc &be_lun->backend.dev.dev_ref); if (be_lun->backend.dev.csw == NULL) panic("Unable to retrieve device switch"); - if (strcmp(be_lun->backend.dev.csw->d_name, "zvol") == 0) + if (strcmp(be_lun->backend.dev.csw->d_name, "zvol") == 0) { be_lun->dispatch = ctl_be_block_dispatch_zvol; - else + be_lun->get_lba_status = ctl_be_block_gls_zvol; + } else be_lun->dispatch = ctl_be_block_dispatch_dev; be_lun->lun_flush = ctl_be_block_flush_dev; be_lun->unmap = ctl_be_block_unmap_dev; @@ -1952,6 +2088,7 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->params = req->reqdata.create; be_lun->softc = softc; STAILQ_INIT(&be_lun->input_queue); + STAILQ_INIT(&be_lun->config_read_queue); STAILQ_INIT(&be_lun->config_write_queue); STAILQ_INIT(&be_lun->datamove_queue); sprintf(be_lun->lunname, "cblk%d", softc->num_luns); @@ -2582,13 +2719,50 @@ ctl_be_block_config_write(union ctl_io * } return (retval); - } static int ctl_be_block_config_read(union ctl_io *io) { - return (0); + struct ctl_be_block_lun *be_lun; + struct ctl_be_lun *ctl_be_lun; + int retval = 0; + + DPRINTF("entered\n"); + + ctl_be_lun = (struct ctl_be_lun *)io->io_hdr.ctl_private[ + CTL_PRIV_BACKEND_LUN].ptr; + be_lun = (struct ctl_be_block_lun *)ctl_be_lun->be_lun; + + switch (io->scsiio.cdb[0]) { + case SERVICE_ACTION_IN: + if (io->scsiio.cdb[1] == SGLS_SERVICE_ACTION) { + mtx_lock(&be_lun->queue_lock); + STAILQ_INSERT_TAIL(&be_lun->config_read_queue, + &io->io_hdr, links); + mtx_unlock(&be_lun->queue_lock); + taskqueue_enqueue(be_lun->io_taskqueue, + &be_lun->io_task); + retval = CTL_RETVAL_QUEUED; + break; + } + ctl_set_invalid_field(&io->scsiio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 1, + /*bit_valid*/ 1, + /*bit*/ 4); + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + default: + ctl_set_invalid_opcode(&io->scsiio); + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + } + + return (retval); } static int Modified: head/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 4 05:02:12 2014 (r275473) +++ head/sys/cam/ctl/ctl_backend_ramdisk.c Thu Dec 4 11:34:19 2014 (r275474) @@ -967,8 +967,31 @@ ctl_backend_ramdisk_config_write(union c static int ctl_backend_ramdisk_config_read(union ctl_io *io) { - /* - * XXX KDM need to implement!! - */ - return (0); + int retval = 0; + + switch (io->scsiio.cdb[0]) { + case SERVICE_ACTION_IN: + if (io->scsiio.cdb[1] == SGLS_SERVICE_ACTION) { + /* We have nothing to tell, leave default data. */ + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + } + ctl_set_invalid_field(&io->scsiio, + /*sks_valid*/ 1, + /*command*/ 1, + /*field*/ 1, + /*bit_valid*/ 1, + /*bit*/ 4); + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + default: + ctl_set_invalid_opcode(&io->scsiio); + ctl_config_read_done(io); + retval = CTL_RETVAL_COMPLETE; + break; + } + + return (retval); } Modified: head/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- head/sys/cam/ctl/ctl_cmd_table.c Thu Dec 4 05:02:12 2014 (r275473) +++ head/sys/cam/ctl/ctl_cmd_table.c Thu Dec 4 11:34:19 2014 (r275474) @@ -433,7 +433,7 @@ const struct ctl_cmd_entry ctl_cmd_table /* 0F */ {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, -/* 10 */ +/* 10 READ CAPACITY(16) */ {ctl_read_capacity_16, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_SLUN | CTL_CMD_FLAG_OK_ON_STOPPED | CTL_CMD_FLAG_OK_ON_INOPERABLE | @@ -443,7 +443,18 @@ const struct ctl_cmd_entry ctl_cmd_table CTL_LUN_PAT_READCAP, 16, {0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, -/* 11-1f */ +/* 11 */ +{NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}, + +/* 12 GET LBA STATUS */ +{ctl_get_lba_status, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | + CTL_FLAG_DATA_IN | + CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, + CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, + 16, {0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0, 0x07}}, + +/* 13-1f */ }; /* A3 MAINTENANCE IN */ Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Thu Dec 4 05:02:12 2014 (r275473) +++ head/sys/cam/ctl/ctl_private.h Thu Dec 4 11:34:19 2014 (r275474) @@ -516,6 +516,7 @@ int ctl_report_supported_opcodes(struct int ctl_report_supported_tmf(struct ctl_scsiio *ctsio); int ctl_report_timestamp(struct ctl_scsiio *ctsio); int ctl_isc(struct ctl_scsiio *ctsio); +int ctl_get_lba_status(struct ctl_scsiio *ctsio); void ctl_tpc_init(struct ctl_softc *softc); void ctl_tpc_shutdown(struct ctl_softc *softc); Modified: head/sys/cam/scsi/scsi_all.h ============================================================================== --- head/sys/cam/scsi/scsi_all.h Thu Dec 4 05:02:12 2014 (r275473) +++ head/sys/cam/scsi/scsi_all.h Thu Dec 4 11:34:19 2014 (r275474) @@ -2518,6 +2518,32 @@ struct scsi_read_capacity_data_long uint8_t reserved[16]; }; +struct scsi_get_lba_status +{ + uint8_t opcode; +#define SGLS_SERVICE_ACTION 0x12 + uint8_t service_action; + uint8_t addr[8]; + uint8_t alloc_len[4]; + uint8_t reserved; + uint8_t control; +}; + +struct scsi_get_lba_status_data_descr +{ + uint8_t addr[8]; + uint8_t length[4]; + uint8_t status; + uint8_t reserved[3]; +}; + +struct scsi_get_lba_status_data +{ + uint8_t length[4]; + uint8_t reserved[4]; + struct scsi_get_lba_status_data_descr descr[]; +}; + struct scsi_report_luns { uint8_t opcode; Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Dec 4 05:02:12 2014 (r275473) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Thu Dec 4 11:34:19 2014 (r275474) @@ -91,6 +91,7 @@ #include #include #include +#include #include @@ -2914,6 +2915,18 @@ zvol_d_ioctl(struct cdev *dev, u_long cm error = ENOIOCTL; break; } + case FIOSEEKHOLE: + case FIOSEEKDATA: { + off_t *off = (off_t *)data; + uint64_t noff; + boolean_t hole; + + hole = (cmd == FIOSEEKHOLE); + noff = *off; + error = dmu_offset_next(zv->zv_objset, ZVOL_OBJ, hole, &noff); + *off = noff; + break; + } default: error = ENOIOCTL; } From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 15:54:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2ED00B66; Thu, 4 Dec 2014 15:54:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AC3A9C8; Thu, 4 Dec 2014 15:54:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4Fsjgn093035; Thu, 4 Dec 2014 15:54:45 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4FsjQp093034; Thu, 4 Dec 2014 15:54:45 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412041554.sB4FsjQp093034@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 4 Dec 2014 15:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275475 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 15:54:46 -0000 Author: mav Date: Thu Dec 4 15:54:45 2014 New Revision: 275475 URL: https://svnweb.freebsd.org/changeset/base/275475 Log: Decode some binary fields of Intel metadata. Submitted by: Dmitry Luhtionov MFC after: 2 weeks Modified: head/sys/geom/raid/md_intel.c Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Thu Dec 4 11:34:19 2014 (r275474) +++ head/sys/geom/raid/md_intel.c Thu Dec 4 15:54:45 2014 (r275475) @@ -366,6 +366,78 @@ intel_set_vol_curr_migr_unit(struct inte vol->curr_migr_unit_hi = curr_migr_unit >> 32; } +static char * +intel_status2str(int status) +{ + + switch (status) { + case INTEL_S_READY: + return ("READY"); + case INTEL_S_UNINITIALIZED: + return ("UNINITIALIZED"); + case INTEL_S_DEGRADED: + return ("DEGRADED"); + case INTEL_S_FAILURE: + return ("FAILURE"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_type2str(int type) +{ + + switch (type) { + case INTEL_T_RAID0: + return ("RAID0"); + case INTEL_T_RAID1: + return ("RAID1"); + case INTEL_T_RAID5: + return ("RAID5"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_cngst2str(int cng_state) +{ + + switch (cng_state) { + case INTEL_CNGST_UPDATED: + return ("UPDATED"); + case INTEL_CNGST_NEEDS_UPDATE: + return ("NEEDS_UPDATE"); + case INTEL_CNGST_MASTER_MISSING: + return ("MASTER_MISSING"); + default: + return ("UNKNOWN"); + } +} + +static char * +intel_mt2str(int type) +{ + + switch (type) { + case INTEL_MT_INIT: + return ("INIT"); + case INTEL_MT_REBUILD: + return ("REBUILD"); + case INTEL_MT_VERIFY: + return ("VERIFY"); + case INTEL_MT_GEN_MIGR: + return ("GEN_MIGR"); + case INTEL_MT_STATE_CHANGE: + return ("STATE_CHANGE"); + case INTEL_MT_REPAIR: + return ("REPAIR"); + default: + return ("UNKNOWN"); + } +} + static void g_raid_md_intel_print(struct intel_raid_conf *meta) { @@ -384,7 +456,22 @@ g_raid_md_intel_print(struct intel_raid_ printf("config_id 0x%08x\n", meta->config_id); printf("generation 0x%08x\n", meta->generation); printf("error_log_size %d\n", meta->error_log_size); - printf("attributes 0x%08x\n", meta->attributes); + printf("attributes 0x%b\n", meta->attributes, + "\020" + "\001RAID0" + "\002RAID1" + "\003RAID10" + "\004RAID1E" + "\005RAID15" + "\006RAIDCNG" + "\007EXT_STRIP" + "\032NVM_CACHE" + "\0332TB_DISK" + "\034BBM" + "\035NVM_CACHE" + "\0362TB" + "\037PM" + "\040CHECKSUM"); printf("total_disks %u\n", meta->total_disks); printf("total_volumes %u\n", meta->total_volumes); printf("error_log_pos %u\n", meta->error_log_pos); @@ -392,32 +479,50 @@ g_raid_md_intel_print(struct intel_raid_ printf("orig_config_id 0x%08x\n", meta->orig_config_id); printf("pwr_cycle_count %u\n", meta->pwr_cycle_count); printf("bbm_log_size %u\n", meta->bbm_log_size); + printf("Flags: S - Spare, A - Assigned, F - Failed, O - Online, D - Disabled\n"); printf("DISK# serial disk_sectors disk_sectors_hi disk_id flags owner\n"); for (i = 0; i < meta->total_disks; i++ ) { - printf(" %d <%.16s> %u %u 0x%08x 0x%08x %08x\n", i, + printf(" %d <%.16s> %u %u 0x%08x 0x%b %08x\n", i, meta->disk[i].serial, meta->disk[i].sectors, meta->disk[i].sectors_hi, meta->disk[i].id, - meta->disk[i].flags, meta->disk[i].owner_cfg_num); + meta->disk[i].flags, "\20\01S\02A\03F\04O\05D", + meta->disk[i].owner_cfg_num); } for (i = 0; i < meta->total_volumes; i++) { mvol = intel_get_volume(meta, i); printf(" ****** Volume %d ******\n", i); printf(" name %.16s\n", mvol->name); printf(" total_sectors %ju\n", mvol->total_sectors); - printf(" state 0x%08x\n", mvol->state); + printf(" state 0x%b\n", mvol->state, + "\020" + "\001BOOTABLE" + "\002BOOT_DEVICE" + "\003READ_COALESCING" + "\004WRITE_COALESCING" + "\005LAST_SHUTDOWN_DIRTY" + "\006HIDDEN_AT_BOOT" + "\007CURRENTLY_HIDDEN" + "\010VERIFY_AND_FIX" + "\011MAP_STATE_UNINIT" + "\012NO_AUTO_RECOVERY" + "\013CLONE_N_GO" + "\014CLONE_MAN_SYNC" + "\015CNG_MASTER_DISK_NUM"); printf(" reserved %u\n", mvol->reserved); printf(" migr_priority %u\n", mvol->migr_priority); printf(" num_sub_vols %u\n", mvol->num_sub_vols); printf(" tid %u\n", mvol->tid); printf(" cng_master_disk %u\n", mvol->cng_master_disk); printf(" cache_policy %u\n", mvol->cache_policy); - printf(" cng_state %u\n", mvol->cng_state); + printf(" cng_state %u (%s)\n", mvol->cng_state, + intel_cngst2str(mvol->cng_state)); printf(" cng_sub_state %u\n", mvol->cng_sub_state); printf(" curr_migr_unit %u\n", mvol->curr_migr_unit); printf(" curr_migr_unit_hi %u\n", mvol->curr_migr_unit_hi); printf(" checkpoint_id %u\n", mvol->checkpoint_id); printf(" migr_state %u\n", mvol->migr_state); - printf(" migr_type %u\n", mvol->migr_type); + printf(" migr_type %u (%s)\n", mvol->migr_type, + intel_mt2str(mvol->migr_type)); printf(" dirty %u\n", mvol->dirty); printf(" fs_state %u\n", mvol->fs_state); printf(" verify_errors %u\n", mvol->verify_errors); @@ -433,8 +538,10 @@ g_raid_md_intel_print(struct intel_raid_ printf(" stripe_count %u\n", mmap->stripe_count); printf(" stripe_count_hi %u\n", mmap->stripe_count_hi); printf(" strip_sectors %u\n", mmap->strip_sectors); - printf(" status %u\n", mmap->status); - printf(" type %u\n", mmap->type); + printf(" status %u (%s)\n", mmap->status, + intel_status2str(mmap->status)); + printf(" type %u (%s)\n", mmap->type, + intel_type2str(mmap->type)); printf(" total_disks %u\n", mmap->total_disks); printf(" total_domains %u\n", mmap->total_domains); printf(" failed_disk_num %u\n", mmap->failed_disk_num); From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 15:57:59 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58280F4C; Thu, 4 Dec 2014 15:57:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4215FA3E; Thu, 4 Dec 2014 15:57:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4FvxCL093591; Thu, 4 Dec 2014 15:57:59 GMT (envelope-from kargl@FreeBSD.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4FvxH8093590; Thu, 4 Dec 2014 15:57:59 GMT (envelope-from kargl@FreeBSD.org) Message-Id: <201412041557.sB4FvxH8093590@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kargl set sender to kargl@FreeBSD.org using -f From: Steve Kargl Date: Thu, 4 Dec 2014 15:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275476 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 15:57:59 -0000 Author: kargl Date: Thu Dec 4 15:57:58 2014 New Revision: 275476 URL: https://svnweb.freebsd.org/changeset/base/275476 Log: Fix a 20+ year bug by using an appropriate constant for the transition from one asymptotic approximation to another for the zeroth order Bessel and Neumann functions. Reviewed by: bde Modified: head/lib/msun/src/e_j0f.c Modified: head/lib/msun/src/e_j0f.c ============================================================================== --- head/lib/msun/src/e_j0f.c Thu Dec 4 15:54:45 2014 (r275475) +++ head/lib/msun/src/e_j0f.c Thu Dec 4 15:57:58 2014 (r275476) @@ -62,7 +62,7 @@ __ieee754_j0f(float x) * j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x) * y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x) */ - if(ix>0x80000000) z = (invsqrtpi*cc)/sqrtf(x); + if(ix>0x54000000) z = (invsqrtpi*cc)/sqrtf(x); else { u = pzerof(x); v = qzerof(x); z = invsqrtpi*(u*cc-v*ss)/sqrtf(x); @@ -136,7 +136,7 @@ __ieee754_y0f(float x) if ((s*c)0x80000000) z = (invsqrtpi*ss)/sqrtf(x); + if(ix>0x54800000) z = (invsqrtpi*ss)/sqrtf(x); else { u = pzerof(x); v = qzerof(x); z = invsqrtpi*(u*ss+v*cc)/sqrtf(x); From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 16:55:42 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7FF1845; Thu, 4 Dec 2014 16:55:42 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55F13228; Thu, 4 Dec 2014 16:55:42 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::a188:410a:c650:9766] (unknown [IPv6:2001:7b8:3a7:0:a188:410a:c650:9766]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 65667B80A; Thu, 4 Dec 2014 17:55:38 +0100 (CET) Subject: Re: svn commit: r275468 - head/sys/dev/usb/controller Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_C7AAA13C-9D6E-456B-A16A-501CF565AB43"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b3 From: Dimitry Andric In-Reply-To: <20141204005451.GM99957@funkthat.com> Date: Thu, 4 Dec 2014 17:55:40 +0100 Message-Id: <1373EB55-4238-40D0-B481-53C8B46D6E6C@FreeBSD.org> References: <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> To: John-Mark Gurney X-Mailer: Apple Mail (2.1993) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 16:55:42 -0000 --Apple-Mail=_C7AAA13C-9D6E-456B-A16A-501CF565AB43 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii On 04 Dec 2014, at 01:54, John-Mark Gurney wrote: > > Hans Petter Selasky wrote this message on Wed, Dec 03, 2014 at 21:55 +0000: >> Author: hselasky >> Date: Wed Dec 3 21:55:44 2014 >> New Revision: 275468 >> URL: https://svnweb.freebsd.org/changeset/base/275468 >> >> Log: >> Optimise the bit searching loops, by quickly skipping the 16 first set >> bits if all the 16 first bits are set. This way the worst case >> searching time is reduced from 32 to 16 cycles. > > You could use ffs instead: > x = ffs(~map); > if (x) { > x--; > /* normal code */ > } > > This has the benefit of using a single instruction on platforms that > support it (bsfl on i386), though apparently, we haven't optimized this > for all platforms... arm has a version for int, but their ffsl does > the same linear search instead of just calling ffs, or at least > detecting if sizeof(long) == sizeof(int) and calling ffs... Maybe it is easier to alias ffs() and friends to __builtin_ffs(), since the compilers we support have these builtins already. -Dimitry --Apple-Mail=_C7AAA13C-9D6E-456B-A16A-501CF565AB43 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.26 iEYEARECAAYFAlSAkgwACgkQsF6jCi4glqOGZACfVMhO4rmt//CSiX0+VASE70+K 9FkAoPn5PRfsUsn7QPATxijWI58US3BE =SYnJ -----END PGP SIGNATURE----- --Apple-Mail=_C7AAA13C-9D6E-456B-A16A-501CF565AB43-- From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 17:05:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD82FC58; Thu, 4 Dec 2014 17:05:08 +0000 (UTC) Received: from mail.myota.org (mail.myota.org [85.10.206.105]) by mx1.freebsd.org (Postfix) with ESMTP id 60931373; Thu, 4 Dec 2014 17:05:07 +0000 (UTC) Received: from mobile.client (58.7.167.190.d.dyn.codetel.net.do [190.167.7.58] (may be forged)) (authenticated bits=128) by mail.myota.org (8.14.9/8.14.9) with ESMTP id sB4H12LY007499; Thu, 4 Dec 2014 18:01:09 +0100 (CET) (envelope-from mail@ma20.ata.myota.org) Received: from submit.client ([127.0.0.1]) by schlappy.local (8.14.9/8.14.9) with ESMTP id sB4H0n5W001864; Thu, 4 Dec 2014 18:00:50 +0100 (CET) (envelope-from mail@ma20.ata.myota.org) Received: (from user@localhost) by schlappy.local (8.14.9/8.14.9/Submit) id sB4H0nCp001863; Thu, 4 Dec 2014 18:00:49 +0100 (CET) (envelope-from mail@ma20.ata.myota.org) Date: Thu, 4 Dec 2014 18:00:49 +0100 From: Andre Albsmeier To: Jean-Sebastien Pedron Subject: Re: svn commit: r273973 - head/sys/dev/vt Message-ID: <20141204170049.GA1832@schlappy> References: <201411021604.sA2G4n1R088429@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201411021604.sA2G4n1R088429@svn.freebsd.org> X-Echelon: IRA, Secure, unix, 15kg, president X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses! User-Agent: Mutt/1.5.21 (2010-09-15) X-Greylist: Not delayed on 85.10.206.105, ACL: AUTH(59), Origin: DO, OS: FreeBSD 9.x X-Virus-Scanned: clamav-milter 0.98.5 at colo X-Virus-Status: Clean Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 17:05:08 -0000 On Sun, 02-Nov-2014 at 16:04:49 +0000, Jean-Sebastien Pedron wrote: > Author: dumbbell > Date: Sun Nov 2 16:04:48 2014 > New Revision: 273973 > URL: https://svnweb.freebsd.org/changeset/base/273973 > > Log: > vt(4): Fix keyboard allocation when kbdmux(4) isn't used > > The problem was that only the kbdmux keyboard index was saved in > vd->vd_keyboard. This index is -1 when kbdmux isn't used. In this > case, the keyboard was correctly allocated, but the returned index was > discarded. > > PR: 194718 > MFC after: 1 week Could someone please MFC this to 9? The patch is slightly different here but works: --- sys/dev/vt/vt_core.c.ORI 2014-07-22 17:29:27.000000000 +0200 +++ sys/dev/vt/vt_core.c 2014-12-04 17:04:12.000000000 +0100 @@ -559,7 +559,6 @@ idx0 = kbd_allocate("kbdmux", -1, (void *)&vd->vd_keyboard, vt_kbdevent, vd); /* XXX: kb_token lost */ - vd->vd_keyboard = idx0; if (idx0 != -1) { DPRINTF(20, "%s: kbdmux allocated, idx = %d\n", __func__, idx0); k0 = kbd_get_keyboard(idx0); @@ -583,6 +582,7 @@ idx0 = kbd_allocate("*", -1, (void *)&vd->vd_keyboard, vt_kbdevent, vd); } + vd->vd_keyboard = idx0; DPRINTF(20, "%s: vd_keyboard = %d\n", __func__, vd->vd_keyboard); return (idx0); Thanks, -Andre From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 17:05:17 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DA908D98; Thu, 4 Dec 2014 17:05:17 +0000 (UTC) Received: from troutmask.apl.washington.edu (troutmask.apl.washington.edu [128.95.76.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "troutmask", Issuer "troutmask" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B7850377; Thu, 4 Dec 2014 17:05:17 +0000 (UTC) Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.14.9/8.14.9) with ESMTP id sB4H5HrN018569 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 4 Dec 2014 09:05:17 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.9/8.14.9/Submit) id sB4H5HKH018568; Thu, 4 Dec 2014 09:05:17 -0800 (PST) (envelope-from sgk) Date: Thu, 4 Dec 2014 09:05:17 -0800 From: Steve Kargl To: Steve Kargl Subject: Re: svn commit: r275476 - head/lib/msun/src Message-ID: <20141204170517.GA18534@troutmask.apl.washington.edu> References: <201412041557.sB4FvxH8093590@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201412041557.sB4FvxH8093590@svn.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 17:05:18 -0000 On Thu, Dec 04, 2014 at 03:57:59PM +0000, Steve Kargl wrote: > Author: kargl > Date: Thu Dec 4 15:57:58 2014 > New Revision: 275476 > URL: https://svnweb.freebsd.org/changeset/base/275476 > > Log: > Fix a 20+ year bug by using an appropriate constant for > the transition from one asymptotic approximation to another > for the zeroth order Bessel and Neumann functions. > A similar bug exists in e_j1f.c. I haven't determined the correct constant, yet. Someday, I'll get to it. -- Steve From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 17:10:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B41ECED; Thu, 4 Dec 2014 17:10:26 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 7317E3E2; Thu, 4 Dec 2014 17:10:26 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 73FE4AF5E; Thu, 4 Dec 2014 17:10:25 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 2897919F9; Thu, 4 Dec 2014 18:10:23 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Dimitry Andric Subject: Re: svn commit: r275468 - head/sys/dev/usb/controller References: <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> <1373EB55-4238-40D0-B481-53C8B46D6E6C@FreeBSD.org> Date: Thu, 04 Dec 2014 18:10:23 +0100 In-Reply-To: <1373EB55-4238-40D0-B481-53C8B46D6E6C@FreeBSD.org> (Dimitry Andric's message of "Thu, 4 Dec 2014 17:55:40 +0100") Message-ID: <86wq67e3y8.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, Hans Petter Selasky X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 17:10:26 -0000 Dimitry Andric writes: > Maybe it is easier to alias ffs() and friends to __builtin_ffs(), > since the compilers we support have these builtins already. That should already be the case on platforms that support it. There is absolutely no reason to hand-roll an ffs() equivalent. (unfortunately, only i386 and amd64 do this; someone[tm] should fix the others) DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 17:26:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0FDBD5E0; Thu, 4 Dec 2014 17:26:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E49FB817; Thu, 4 Dec 2014 17:26:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4HQ5w1036197; Thu, 4 Dec 2014 17:26:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4HQ5dM036195; Thu, 4 Dec 2014 17:26:05 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412041726.sB4HQ5dM036195@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 4 Dec 2014 17:26:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275477 - head/contrib/gcc/cp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 17:26:06 -0000 Author: dim Date: Thu Dec 4 17:26:04 2014 New Revision: 275477 URL: https://svnweb.freebsd.org/changeset/base/275477 Log: Pull in r174303 from upstream gcc trunk (by Jason Merrill): PR c++/48211 * name-lookup.h (cp_class_binding): Make base a pointer. * name-lookup.c (new_class_binding): Adjust. (poplevel_class): Adjust. This fixes a potential segfault when compiling gold, a part of the devel/binutils port, with gcc. See also the upstream bug report: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48211 Thanks to Jason Merrill, Tom Callaway and Red Hat legal for approving the use of this patch under the GNU GPL, version 2 or later. MFC after: 1 week Modified: head/contrib/gcc/cp/name-lookup.c head/contrib/gcc/cp/name-lookup.h Modified: head/contrib/gcc/cp/name-lookup.c ============================================================================== --- head/contrib/gcc/cp/name-lookup.c Thu Dec 4 15:57:58 2014 (r275476) +++ head/contrib/gcc/cp/name-lookup.c Thu Dec 4 17:26:04 2014 (r275477) @@ -319,35 +319,11 @@ new_class_binding (tree name, tree value cp_class_binding *cb; cxx_binding *binding; - if (VEC_length (cp_class_binding, scope->class_shadowed)) - { - cp_class_binding *old_base; - old_base = VEC_index (cp_class_binding, scope->class_shadowed, 0); - if (VEC_reserve (cp_class_binding, gc, scope->class_shadowed, 1)) - { - /* Fixup the current bindings, as they might have moved. */ - size_t i; - - for (i = 0; - VEC_iterate (cp_class_binding, scope->class_shadowed, i, cb); - i++) - { - cxx_binding **b; - b = &IDENTIFIER_BINDING (cb->identifier); - while (*b != &old_base[i].base) - b = &((*b)->previous); - *b = &cb->base; - } - } - cb = VEC_quick_push (cp_class_binding, scope->class_shadowed, NULL); - } - else cb = VEC_safe_push (cp_class_binding, gc, scope->class_shadowed, NULL); cb->identifier = name; - binding = &cb->base; + cb->base = binding = cxx_binding_make (value, type); binding->scope = scope; - cxx_binding_init (binding, value, type); return binding; } @@ -2501,7 +2477,10 @@ poplevel_class (void) for (i = 0; VEC_iterate (cp_class_binding, level->class_shadowed, i, cb); ++i) - IDENTIFIER_BINDING (cb->identifier) = cb->base.previous; + { + IDENTIFIER_BINDING (cb->identifier) = cb->base->previous; + cxx_binding_free (cb->base); + } ggc_free (level->class_shadowed); level->class_shadowed = NULL; } Modified: head/contrib/gcc/cp/name-lookup.h ============================================================================== --- head/contrib/gcc/cp/name-lookup.h Thu Dec 4 15:57:58 2014 (r275476) +++ head/contrib/gcc/cp/name-lookup.h Thu Dec 4 17:26:04 2014 (r275477) @@ -144,7 +144,7 @@ typedef enum tag_scope { typedef struct cp_class_binding GTY(()) { - cxx_binding base; + cxx_binding *base; /* The bound name. */ tree identifier; } cp_class_binding; From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 17:36:30 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7B8CA78; Thu, 4 Dec 2014 17:36:30 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B42CB945; Thu, 4 Dec 2014 17:36:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4HaU0r041099; Thu, 4 Dec 2014 17:36:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4HaUiv041098; Thu, 4 Dec 2014 17:36:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412041736.sB4HaUiv041098@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 4 Dec 2014 17:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275478 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 17:36:30 -0000 Author: mav Date: Thu Dec 4 17:36:29 2014 New Revision: 275478 URL: https://svnweb.freebsd.org/changeset/base/275478 Log: Swap resource count scopes for used/available space. Used count should be reported as per-LUN, while available should not. MFC after: 1 week Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Thu Dec 4 17:26:04 2014 (r275477) +++ head/sys/cam/ctl/ctl.c Thu Dec 4 17:36:29 2014 (r275478) @@ -6956,7 +6956,7 @@ ctl_lbp_log_sense_handler(struct ctl_scs phdr->param_len = 8; data = (uint8_t *)(phdr + 1); scsi_ulto4b(val >> CTL_LBP_EXPONENT, data); - data[4] = 0x01; /* per-LUN */ + data[4] = 0x02; /* per-pool */ data += phdr->param_len; } @@ -6969,7 +6969,7 @@ ctl_lbp_log_sense_handler(struct ctl_scs phdr->param_len = 8; data = (uint8_t *)(phdr + 1); scsi_ulto4b(val >> CTL_LBP_EXPONENT, data); - data[4] = 0x02; /* per-pool */ + data[4] = 0x01; /* per-LUN */ data += phdr->param_len; } From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 17:50:34 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E147CF9E; Thu, 4 Dec 2014 17:50:34 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F386B2D; Thu, 4 Dec 2014 17:50:34 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id sB4HoXfa025009 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Dec 2014 09:50:33 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id sB4HoW9Z025008; Thu, 4 Dec 2014 09:50:32 -0800 (PST) (envelope-from jmg) Date: Thu, 4 Dec 2014 09:50:32 -0800 From: John-Mark Gurney To: Hans Petter Selasky Subject: Re: svn commit: r275468 - head/sys/dev/usb/controller Message-ID: <20141204175032.GQ99957@funkthat.com> References: <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> <54800B60.9020208@selasky.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54800B60.9020208@selasky.org> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 04 Dec 2014 09:50:33 -0800 (PST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 17:50:35 -0000 Hans Petter Selasky wrote this message on Thu, Dec 04, 2014 at 08:21 +0100: > On 12/04/14 01:54, John-Mark Gurney wrote: > >Hans Petter Selasky wrote this message on Wed, Dec 03, 2014 at 21:55 +0000: > >>Author: hselasky > >>Date: Wed Dec 3 21:55:44 2014 > >>New Revision: 275468 > >>URL: https://svnweb.freebsd.org/changeset/base/275468 > >> > >>Log: > >> Optimise the bit searching loops, by quickly skipping the 16 first set > >> bits if all the 16 first bits are set. This way the worst case > >> searching time is reduced from 32 to 16 cycles. > > > >You could use ffs instead: > > x = ffs(~map); > > if (x) { > > x--; > > /* normal code */ > > } > > > >This has the benefit of using a single instruction on platforms that > >support it (bsfl on i386), though apparently, we haven't optimized this > >for all platforms... arm has a version for int, but their ffsl does > >the same linear search instead of just calling ffs, or at least > >detecting if sizeof(long) == sizeof(int) and calling ffs... > > > > Yes, I'm aware about that, but like you say it is not optimised for all > platforms yet. So I'm not sure if it will give any benefit for the > platform the driver is running on .... > > I'll see if I can change the logic inside the C-version of ffs() and the > do the swap like you suggest. Did you see the comment about usig __builtin_ffs{,l,ll} instead? this seems to be a better route... I was going to say we should leave the code for compatibility w/ other compilers, now that we are getting close to having an external tool chain, but I don't see us supporting non-gcc and non-clang compilers anytime soon, and it isn't hard to bring back the code... So, how about changing libkern.h to define the various ones to the built in, and dropping all the special versions? This should be an even better improvement as it'll eliminate some function call overhead.. Probably the same should be done in strings.h in userland too... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 18:23:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1EBBBC7C; Thu, 4 Dec 2014 18:23:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E583CEE5; Thu, 4 Dec 2014 18:23:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4IND0Y064401; Thu, 4 Dec 2014 18:23:13 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4INDbH064400; Thu, 4 Dec 2014 18:23:13 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201412041823.sB4INDbH064400@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Thu, 4 Dec 2014 18:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275480 - head/lib/libxo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 18:23:14 -0000 Author: brueffer Date: Thu Dec 4 18:23:13 2014 New Revision: 275480 URL: https://svnweb.freebsd.org/changeset/base/275480 Log: Add MLINKs for all functions described in the libxo manpages. Modified: head/lib/libxo/Makefile Modified: head/lib/libxo/Makefile ============================================================================== --- head/lib/libxo/Makefile Thu Dec 4 17:38:32 2014 (r275479) +++ head/lib/libxo/Makefile Thu Dec 4 18:23:13 2014 (r275480) @@ -33,4 +33,47 @@ MAN+= xo_attr.3 \ xo_set_writer.3 MAN+= xo_format.5 +MLINKS= xo_attr.3 xo_attr_h.3 \ + xo_attr.3 xo_attr_hv.3 \ + xo_create.3 xo_create_to_file.3 \ + xo_create.3 xo_destroy.3 \ + xo_emit.3 xo_emit_h.3 \ + xo_emit.3 xo_emit_hv.3 \ + xo_err.3 xo_warn.3 \ + xo_err.3 xo_warnx.3 \ + xo_err.3 xo_warn_c.3 \ + xo_err.3 xo_warn_hc.3 \ + xo_err.3 xo_errc.3 \ + xo_err.3 xo_errx.3 \ + xo_err.3 xo_message.3 \ + xo_err.3 xo_message_c.3 \ + xo_err.3 xo_message_hc.3 \ + xo_err.3 xo_message_hcv.3 \ + xo_finish.3 xo_finish_h.3 \ + xo_flush.3 xo_flush_h.3 \ + xo_open_container.3 xo_open_container_h.3 \ + xo_open_container.3 xo_open_container_hd.3 \ + xo_open_container.3 xo_open_container_d.3 \ + xo_open_container.3 xo_close_container.3 \ + xo_open_container.3 xo_close_container_h.3 \ + xo_open_container.3 xo_close_container_hd.3 \ + xo_open_container.3 xo_close_container_d.3 \ + xo_open_list.3 xo_open_list_h.3 \ + xo_open_list.3 xo_open_list_hd.3 \ + xo_open_list.3 xo_open_list_d.3 \ + xo_open_list.3 xo_open_instance.3 \ + xo_open_list.3 xo_open_instance_h.3 \ + xo_open_list.3 xo_open_instance_hd.3 \ + xo_open_list.3 xo_open_instance_d.3 \ + xo_open_list.3 xo_close_instance.3 \ + xo_open_list.3 xo_close_instance_h.3 \ + xo_open_list.3 xo_close_instance_hd.3 \ + xo_open_list.3 xo_close_instance_d.3 \ + xo_open_list.3 xo_close_list.3 \ + xo_open_list.3 xo_close_list_h.3 \ + xo_open_list.3 xo_close_list_hd.3 \ + xo_open_list.3 xo_close_list_d.3 \ + xo_set_flags.3 xo_clear_flags.3 \ + xo_set_style.3 xo_set_style_name.3 + .include From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 18:28:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1DA2EF57; Thu, 4 Dec 2014 18:28:38 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id CEA56F31; Thu, 4 Dec 2014 18:28:37 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 7751FA10F; Thu, 4 Dec 2014 18:28:36 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 03F4E1A03; Thu, 4 Dec 2014 19:28:31 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John-Mark Gurney Subject: Re: svn commit: r275468 - head/sys/dev/usb/controller References: <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> <54800B60.9020208@selasky.org> <20141204175032.GQ99957@funkthat.com> Date: Thu, 04 Dec 2014 19:28:31 +0100 In-Reply-To: <20141204175032.GQ99957@funkthat.com> (John-Mark Gurney's message of "Thu, 4 Dec 2014 09:50:32 -0800") Message-ID: <86sigve0c0.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Hans Petter Selasky , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 18:28:38 -0000 John-Mark Gurney writes: > Did you see the comment about usig __builtin_ffs{,l,ll} instead? this > seems to be a better route... No. It's needlessly compiler-dependent. > So, how about changing libkern.h to define the various ones to the > built in, and dropping all the special versions? This is (or should) be taken care of in cpufunc.h for platforms that support ffs / fls in hardware. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 18:37:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F4042DE; Thu, 4 Dec 2014 18:37:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 038189D; Thu, 4 Dec 2014 18:37:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4IbgJo069930; Thu, 4 Dec 2014 18:37:42 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4Ibgmr069929; Thu, 4 Dec 2014 18:37:42 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412041837.sB4Ibgmr069929@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 4 Dec 2014 18:37:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275481 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 18:37:43 -0000 Author: mav Date: Thu Dec 4 18:37:42 2014 New Revision: 275481 URL: https://svnweb.freebsd.org/changeset/base/275481 Log: Add to CTL support for threshold notifications for file-backed LUNs. Previously it was supported only for ZVOL-backed LUNs, but now should work for file-backed LUNs too. Used value in this case is a space occupied by the backing file, while available value is an available space on file system. Pool thresholds are still not implemented in this case. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Thu Dec 4 18:23:13 2014 (r275480) +++ head/sys/cam/ctl/ctl_backend_block.c Thu Dec 4 18:37:42 2014 (r275481) @@ -242,6 +242,8 @@ static void ctl_be_block_dispatch_file(s struct ctl_be_block_io *beio); static void ctl_be_block_gls_file(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); +static uint64_t ctl_be_block_getattr_file(struct ctl_be_block_lun *be_lun, + const char *attrname); static void ctl_be_block_flush_dev(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio); static void ctl_be_block_unmap_dev(struct ctl_be_block_lun *be_lun, @@ -799,6 +801,31 @@ ctl_be_block_gls_file(struct ctl_be_bloc ctl_complete_beio(beio); } +static uint64_t +ctl_be_block_getattr_file(struct ctl_be_block_lun *be_lun, const char *attrname) +{ + struct vattr vattr; + struct statfs statfs; + int error; + + if (be_lun->vn == NULL) + return (UINT64_MAX); + if (strcmp(attrname, "blocksused") == 0) { + error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); + if (error != 0) + return (UINT64_MAX); + return (vattr.va_bytes >> be_lun->blocksize_shift); + } + if (strcmp(attrname, "blocksavail") == 0) { + error = VFS_STATFS(be_lun->vn->v_mount, &statfs); + if (error != 0) + return (UINT64_MAX); + return ((statfs.f_bavail * statfs.f_bsize) >> + be_lun->blocksize_shift); + } + return (UINT64_MAX); +} + static void ctl_be_block_dispatch_zvol(struct ctl_be_block_lun *be_lun, struct ctl_be_block_io *beio) @@ -1724,6 +1751,7 @@ ctl_be_block_open_file(struct ctl_be_blo be_lun->dispatch = ctl_be_block_dispatch_file; be_lun->lun_flush = ctl_be_block_flush_file; be_lun->get_lba_status = ctl_be_block_gls_file; + be_lun->getattr = ctl_be_block_getattr_file; error = VOP_GETATTR(be_lun->vn, &vattr, curthread->td_ucred); if (error != 0) { From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 19:08:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 224519CB; Thu, 4 Dec 2014 19:08:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EAEF626; Thu, 4 Dec 2014 19:08:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4J85ML084195; Thu, 4 Dec 2014 19:08:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4J85v6084194; Thu, 4 Dec 2014 19:08:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412041908.sB4J85v6084194@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 4 Dec 2014 19:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275482 - head/usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 19:08:06 -0000 Author: mav Date: Thu Dec 4 19:08:05 2014 New Revision: 275482 URL: https://svnweb.freebsd.org/changeset/base/275482 Log: Document r275481 changes. MFC after: 2 weeks Modified: head/usr.sbin/ctladm/ctladm.8 Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Thu Dec 4 18:37:42 2014 (r275481) +++ head/usr.sbin/ctladm/ctladm.8 Thu Dec 4 19:08:05 2014 (r275482) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd November 5, 2014 +.Dd December 4, 2014 .Dt CTLADM 8 .Os .Sh NAME @@ -1007,10 +1007,11 @@ Set to "on", enables UNMAP support for t .It Va used-threshold .It Va pool-avail-threshold .It Va pool-used-threshold -Set per-LUN/-pool thin provisioning soft thresholds for ZVOL-backed LUNs. +Set per-LUN/-pool thin provisioning soft thresholds. LUN will establish UNIT ATTENTION condition if its or pool available space get below configured avail values, or its or pool used space get above configured used values. +Pool thresholds are working only for ZVOL-backed LUNs. .It Va writecache Set to "off", disables write caching for the LUN, if supported by the backend. .El From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 19:19:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 062FDBF6; Thu, 4 Dec 2014 19:19:06 +0000 (UTC) Received: from h2.funkthat.com (gate2.funkthat.com [208.87.223.18]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "funkthat.com", Issuer "funkthat.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id D34547A0; Thu, 4 Dec 2014 19:19:05 +0000 (UTC) Received: from h2.funkthat.com (localhost [127.0.0.1]) by h2.funkthat.com (8.14.3/8.14.3) with ESMTP id sB4JJ47t026062 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 4 Dec 2014 11:19:04 -0800 (PST) (envelope-from jmg@h2.funkthat.com) Received: (from jmg@localhost) by h2.funkthat.com (8.14.3/8.14.3/Submit) id sB4JJ4T7026061; Thu, 4 Dec 2014 11:19:04 -0800 (PST) (envelope-from jmg) Date: Thu, 4 Dec 2014 11:19:04 -0800 From: John-Mark Gurney To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: svn commit: r275468 - head/sys/dev/usb/controller Message-ID: <20141204191904.GB25139@funkthat.com> References: <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> <54800B60.9020208@selasky.org> <20141204175032.GQ99957@funkthat.com> <86sigve0c0.fsf@nine.des.no> <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> <1373EB55-4238-40D0-B481-53C8B46D6E6C@FreeBSD.org> <86wq67e3y8.fsf@nine.des.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86sigve0c0.fsf@nine.des.no> <86wq67e3y8.fsf@nine.des.no> User-Agent: Mutt/1.4.2.3i X-Operating-System: FreeBSD 7.2-RELEASE i386 X-PGP-Fingerprint: 54BA 873B 6515 3F10 9E88 9322 9CB1 8F74 6D3F A396 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html X-TipJar: bitcoin:13Qmb6AeTgQecazTWph4XasEsP7nGRbAPE X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? can i haz chizburger? X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.2 (h2.funkthat.com [127.0.0.1]); Thu, 04 Dec 2014 11:19:04 -0800 (PST) Cc: Hans Petter Selasky , src-committers@freebsd.org, Hans Petter Selasky , svn-src-all@freebsd.org, Dimitry Andric , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 19:19:06 -0000 Dag-Erling Smrgrav wrote this message on Thu, Dec 04, 2014 at 19:28 +0100: > John-Mark Gurney writes: > > Did you see the comment about usig __builtin_ffs{,l,ll} instead? this > > seems to be a better route... > > No. It's needlessly compiler-dependent. I'm confused, in an earlier email you said: Dag-Erling Smrgrav wrote this message on Thu, Dec 04, 2014 at 18:10 +0100: > Dimitry Andric writes: > > Maybe it is easier to alias ffs() and friends to __builtin_ffs(), > > since the compilers we support have these builtins already. > > That should already be the case on platforms that support it. There is > absolutely no reason to hand-roll an ffs() equivalent. So this says that you think it should be using the builtin, yet when I suggested it, you say no? Which is it? Yes, it is compiler dependant, and yes, we are getting closer to supporting external tool chains, but I doubt that the external tool chain is going to be anything other than gcc or clang, which both support all three... If someone does want to add a compiler that doesn't support it, it's easy enough for them to add an ifdef or two and add the proper code... Considering that we have hacks like: #ifdef HAVE_INLINE_FFSL cpu = CPU_FFS(&cpumask) - 1; #else while (cpu >= 0 && !CPU_ISSET(cpu, &cpumask)) cpu--; #endif in sched_ule.c, switching to always using builtin ffs and getting ride of these hacks seems like the best choice... If people feel that they need to implement ffs themselves, then we clearly aren't doing our job of providing fast blocks to build upon... > > So, how about changing libkern.h to define the various ones to the > > built in, and dropping all the special versions? > > This is (or should) be taken care of in cpufunc.h for platforms that > support ffs / fls in hardware. Considering that I'd trust the compiler writers to optimize their code more than the people who port to a new platform, I disagree... Rarely do ports to a new platform back fill in support functions like these, yet clearly, they are important, since mav thought it important enough to hack sched_ule.c... -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not." From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 20:36:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E7AD7E0E; Thu, 4 Dec 2014 20:36:57 +0000 (UTC) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A670A72; Thu, 4 Dec 2014 20:36:57 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id AFACC1FE023; Thu, 4 Dec 2014 21:36:47 +0100 (CET) Message-ID: <5480C5FA.4030402@selasky.org> Date: Thu, 04 Dec 2014 21:37:14 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: John-Mark Gurney Subject: Re: svn commit: r275468 - head/sys/dev/usb/controller References: <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> <54800B60.9020208@selasky.org> <20141204175032.GQ99957@funkthat.com> In-Reply-To: <20141204175032.GQ99957@funkthat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 20:36:58 -0000 On 12/04/14 18:50, John-Mark Gurney wrote: > Hans Petter Selasky wrote this message on Thu, Dec 04, 2014 at 08:21 +0100: >> On 12/04/14 01:54, John-Mark Gurney wrote: >>> Hans Petter Selasky wrote this message on Wed, Dec 03, 2014 at 21:55 +0000: >>>> Author: hselasky >>>> Date: Wed Dec 3 21:55:44 2014 >>>> New Revision: 275468 >>>> URL: https://svnweb.freebsd.org/changeset/base/275468 >>>> >>>> Log: >>>> Optimise the bit searching loops, by quickly skipping the 16 first set >>>> bits if all the 16 first bits are set. This way the worst case >>>> searching time is reduced from 32 to 16 cycles. >>> >>> You could use ffs instead: >>> x = ffs(~map); >>> if (x) { >>> x--; >>> /* normal code */ >>> } >>> >>> This has the benefit of using a single instruction on platforms that >>> support it (bsfl on i386), though apparently, we haven't optimized this >>> for all platforms... arm has a version for int, but their ffsl does >>> the same linear search instead of just calling ffs, or at least >>> detecting if sizeof(long) == sizeof(int) and calling ffs... >>> >> >> Yes, I'm aware about that, but like you say it is not optimised for all >> platforms yet. So I'm not sure if it will give any benefit for the >> platform the driver is running on .... >> >> I'll see if I can change the logic inside the C-version of ffs() and the >> do the swap like you suggest. > > Did you see the comment about usig __builtin_ffs{,l,ll} instead? this > seems to be a better route... > Hi, I see. Who can update the cpufunc.h header file to use the builtins? Are these also available with GCC? --HPS From owner-svn-src-head@FreeBSD.ORG Thu Dec 4 21:17:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1CE8920; Thu, 4 Dec 2014 21:17:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ACFE1785; Thu, 4 Dec 2014 21:17:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB4LHq94044502; Thu, 4 Dec 2014 21:17:52 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4LHoSE044495; Thu, 4 Dec 2014 21:17:50 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201412042117.sB4LHoSE044495@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 4 Dec 2014 21:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275483 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 21:17:53 -0000 Author: tuexen Date: Thu Dec 4 21:17:50 2014 New Revision: 275483 URL: https://svnweb.freebsd.org/changeset/base/275483 Log: This is the SCTP specific companion of https://svnweb.freebsd.org/changeset/base/275358 which was provided by Hans Petter Selasky. Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctputil.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Thu Dec 4 19:08:05 2014 (r275482) +++ head/sys/netinet/sctp_indata.c Thu Dec 4 21:17:50 2014 (r275483) @@ -2296,7 +2296,7 @@ sctp_process_data(struct mbuf **mm, int struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t * high_tsn, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { struct sctp_data_chunk *ch, chunk_buf; @@ -2391,7 +2391,7 @@ sctp_process_data(struct mbuf **mm, int stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); return (2); } @@ -2406,7 +2406,7 @@ sctp_process_data(struct mbuf **mm, int stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); return (2); } @@ -2475,7 +2475,7 @@ sctp_process_data(struct mbuf **mm, int m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); return (2); } Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Dec 4 19:08:05 2014 (r275482) +++ head/sys/netinet/sctp_input.c Thu Dec 4 21:17:50 2014 (r275483) @@ -86,7 +86,7 @@ sctp_handle_init(struct mbuf *m, int iph struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_chunk *cp, struct sctp_inpcb *inp, struct sctp_tcb *stcb, int *abort_no_unlock, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { struct sctp_init *init; @@ -101,7 +101,7 @@ sctp_handle_init(struct mbuf *m, int iph if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -113,7 +113,7 @@ sctp_handle_init(struct mbuf *m, int iph /* protocol error... send abort */ op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -123,7 +123,7 @@ sctp_handle_init(struct mbuf *m, int iph /* invalid parameter... send abort */ op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -133,7 +133,7 @@ sctp_handle_init(struct mbuf *m, int iph /* protocol error... send abort */ op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -143,7 +143,7 @@ sctp_handle_init(struct mbuf *m, int iph /* protocol error... send abort */ op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -155,7 +155,7 @@ sctp_handle_init(struct mbuf *m, int iph op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Problem with AUTH parameters"); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); if (stcb) *abort_no_unlock = 1; @@ -186,7 +186,7 @@ sctp_handle_init(struct mbuf *m, int iph op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "No listener"); sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); } goto outnow; @@ -200,7 +200,7 @@ sctp_handle_init(struct mbuf *m, int iph SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, src, dst, sh, cp, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port, ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); } @@ -434,7 +434,7 @@ sctp_process_init_ack(struct mbuf *m, in struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_no_unlock, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id) { struct sctp_association *asoc; @@ -474,7 +474,7 @@ sctp_process_init_ack(struct mbuf *m, in retval); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, net->port); *abort_no_unlock = 1; return (-1); @@ -549,7 +549,7 @@ sctp_process_init_ack(struct mbuf *m, in } sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, net->port); *abort_no_unlock = 1; } @@ -1284,7 +1284,7 @@ sctp_handle_init_ack(struct mbuf *m, int struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_no_unlock, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id) { struct sctp_init_ack *init_ack; @@ -1303,7 +1303,7 @@ sctp_handle_init_ack(struct mbuf *m, int op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, net->port); *abort_no_unlock = 1; return (-1); @@ -1315,7 +1315,7 @@ sctp_handle_init_ack(struct mbuf *m, int op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, net->port); *abort_no_unlock = 1; return (-1); @@ -1325,7 +1325,7 @@ sctp_handle_init_ack(struct mbuf *m, int op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, net->port); *abort_no_unlock = 1; return (-1); @@ -1335,7 +1335,7 @@ sctp_handle_init_ack(struct mbuf *m, int op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, net->port); *abort_no_unlock = 1; return (-1); @@ -1345,7 +1345,7 @@ sctp_handle_init_ack(struct mbuf *m, int op_err = sctp_generate_cause(SCTP_CAUSE_INVALID_PARAM, ""); sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, net->port); *abort_no_unlock = 1; return (-1); @@ -1370,7 +1370,7 @@ sctp_handle_init_ack(struct mbuf *m, int } if (sctp_process_init_ack(m, iphlen, offset, src, dst, sh, cp, stcb, net, abort_no_unlock, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id) < 0) { /* error in parsing parameters */ return (-1); @@ -1427,7 +1427,7 @@ sctp_process_cookie_new(struct mbuf *m, struct sctp_inpcb *inp, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port); @@ -1444,7 +1444,7 @@ sctp_process_cookie_existing(struct mbuf struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { struct sctp_association *asoc; @@ -1477,7 +1477,7 @@ sctp_process_cookie_existing(struct mbuf sctp_send_shutdown_ack(stcb, stcb->asoc.primary_destination); op_err = sctp_generate_cause(SCTP_CAUSE_COOKIE_IN_SHUTDOWN, ""); sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, net->port); if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 2; @@ -1684,7 +1684,7 @@ sctp_process_cookie_existing(struct mbuf */ op_err = sctp_generate_cause(SCTP_CAUSE_NAT_COLLIDING_STATE, ""); sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); return (NULL); } @@ -1856,7 +1856,7 @@ sctp_process_cookie_existing(struct mbuf sh, cookie, cookie_len, inp, netp, init_src, notification, auth_skipped, auth_offset, auth_len, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port)); } /* @@ -2012,7 +2012,7 @@ sctp_process_cookie_new(struct mbuf *m, struct sctp_inpcb *inp, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { struct sctp_tcb *stcb; @@ -2098,7 +2098,7 @@ sctp_process_cookie_new(struct mbuf *m, op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); return (NULL); } @@ -2126,7 +2126,7 @@ sctp_process_cookie_new(struct mbuf *m, op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); @@ -2373,7 +2373,7 @@ sctp_handle_cookie_echo(struct mbuf *m, struct sctp_inpcb **inp_p, struct sctp_tcb **stcb, struct sctp_nets **netp, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, struct sctp_tcb **locked_tcb, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { struct sctp_state_cookie *cookie; @@ -2560,7 +2560,7 @@ sctp_handle_cookie_echo(struct mbuf *m, tim = now.tv_usec - cookie->time_entered.tv_usec; scm->time_usec = htonl(tim); sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); return (NULL); } @@ -2650,7 +2650,7 @@ sctp_handle_cookie_echo(struct mbuf *m, cookie, cookie_len, *inp_p, netp, to, ¬ification, auth_skipped, auth_offset, auth_len, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); } else { /* this is abnormal... cookie-echo on existing TCB */ @@ -2659,7 +2659,7 @@ sctp_handle_cookie_echo(struct mbuf *m, src, dst, sh, cookie, cookie_len, *inp_p, *stcb, netp, to, ¬ification, auth_skipped, auth_offset, auth_len, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); } @@ -2667,11 +2667,8 @@ sctp_handle_cookie_echo(struct mbuf *m, /* still no TCB... must be bad cookie-echo */ return (NULL); } - if ((*netp != NULL) && (use_mflowid != 0)) { - (*netp)->flowid = mflowid; -#ifdef INVARIANTS - (*netp)->flowidset = 1; -#endif + if ((*netp != NULL) && (mflowtype != M_HASHTYPE_NONE)) { + (*netp)->flowtype = mflowtype; } /* * Ok, we built an association so confirm the address we sent the @@ -2742,7 +2739,7 @@ sctp_handle_cookie_echo(struct mbuf *m, op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); sctp_abort_association(*inp_p, NULL, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) pcb_so = SCTP_INP_SO(*inp_p); @@ -4368,7 +4365,7 @@ __attribute__((noinline)) struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, int *fwd_tsn_seen, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { struct sctp_association *asoc; @@ -4532,7 +4529,7 @@ __attribute__((noinline)) msg); /* no association, so it's out of the blue... */ sctp_handle_ootb(m, iphlen, *offset, src, dst, sh, inp, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); *offset = length; if (locked_tcb) { @@ -4576,7 +4573,7 @@ __attribute__((noinline)) msg); sctp_handle_ootb(m, iphlen, *offset, src, dst, sh, inp, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); return (NULL); } @@ -4721,7 +4718,7 @@ process_control_chunks: "INIT not the only chunk"); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); *offset = length; return (NULL); @@ -4731,7 +4728,7 @@ process_control_chunks: op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); *offset = length; return (NULL); @@ -4739,7 +4736,7 @@ process_control_chunks: sctp_handle_init(m, iphlen, *offset, src, dst, sh, (struct sctp_init_chunk *)ch, inp, stcb, &abort_no_unlock, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); *offset = length; if ((!abort_no_unlock) && (locked_tcb)) { @@ -4793,7 +4790,7 @@ process_control_chunks: (struct sctp_init_ack_chunk *)ch, stcb, *netp, &abort_no_unlock, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id); } else { ret = -1; @@ -5098,7 +5095,7 @@ process_control_chunks: op_err = sctp_generate_cause(SCTP_CAUSE_OUT_OF_RESC, ""); sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); } *offset = length; @@ -5133,7 +5130,7 @@ process_control_chunks: auth_offset, auth_len, &locked_tcb, - use_mflowid, + mflowtype, mflowid, vrf_id, port); @@ -5587,7 +5584,7 @@ sctp_common_input_processing(struct mbuf uint8_t compute_crc, #endif uint8_t ecn_bits, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { uint32_t high_tsn; @@ -5626,11 +5623,8 @@ sctp_common_input_processing(struct mbuf net->port = port; } #endif - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif + if ((net != NULL) && (mflowtype != M_HASHTYPE_NONE)) { + net->flowtype = mflowtype; } if ((inp != NULL) && (stcb != NULL)) { sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); @@ -5659,11 +5653,8 @@ sctp_common_input_processing(struct mbuf net->port = port; } #endif - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif + if ((net != NULL) && (mflowtype != M_HASHTYPE_NONE)) { + net->flowtype = mflowtype; } if (inp == NULL) { SCTP_STAT_INCR(sctps_noport); @@ -5672,7 +5663,7 @@ sctp_common_input_processing(struct mbuf } if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { sctp_send_shutdown_complete2(src, dst, sh, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); goto out; } @@ -5687,7 +5678,7 @@ sctp_common_input_processing(struct mbuf "Out of the blue"); sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); } } @@ -5748,7 +5739,7 @@ sctp_common_input_processing(struct mbuf op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); goto out; } @@ -5759,7 +5750,7 @@ sctp_common_input_processing(struct mbuf stcb = sctp_process_control(m, iphlen, &offset, length, src, dst, sh, ch, inp, stcb, &net, &fwd_tsn_seen, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); if (stcb) { /* @@ -5800,7 +5791,7 @@ sctp_common_input_processing(struct mbuf op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); goto out; } @@ -5872,7 +5863,7 @@ sctp_common_input_processing(struct mbuf op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), msg); sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); goto out; /* sa_ignore NOTREACHED */ @@ -5893,7 +5884,7 @@ sctp_common_input_processing(struct mbuf retval = sctp_process_data(mm, iphlen, &offset, length, src, dst, sh, inp, stcb, net, &high_tsn, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); if (retval == 2) { /* @@ -6008,7 +5999,7 @@ sctp_input_with_port(struct mbuf *i_pak, #endif uint32_t mflowid; - uint8_t use_mflowid; + uint8_t mflowtype; iphlen = off; if (SCTP_GET_PKT_VRFID(i_pak, vrf_id)) { @@ -6038,13 +6029,8 @@ sctp_input_with_port(struct mbuf *i_pak, m->m_pkthdr.len, if_name(m->m_pkthdr.rcvif), (int)m->m_pkthdr.csum_flags, CSUM_BITS); - if (m->m_flags & M_FLOWID) { - mflowid = m->m_pkthdr.flowid; - use_mflowid = 1; - } else { - mflowid = 0; - use_mflowid = 0; - } + mflowid = m->m_pkthdr.flowid; + mflowtype = M_HASHTYPE_GET(m); SCTP_STAT_INCR(sctps_recvpackets); SCTP_STAT_INCR_COUNTER64(sctps_inpackets); /* Get IP, SCTP, and first chunk header together in the first mbuf. */ @@ -6104,7 +6090,7 @@ sctp_input_with_port(struct mbuf *i_pak, compute_crc, #endif ecn_bits, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); out: if (m) { @@ -6134,7 +6120,7 @@ sctp_input(struct mbuf **mp, int *offp, int cpu_to_use; uint32_t flowid, tag; - if (m->m_flags & M_FLOWID) { + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { flowid = m->m_pkthdr.flowid; } else { /* @@ -6153,7 +6139,7 @@ sctp_input(struct mbuf **mp, int *offp, tag = htonl(sh->v_tag); flowid = tag ^ ntohs(sh->dest_port) ^ ntohs(sh->src_port); m->m_pkthdr.flowid = flowid; - m->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m, M_HASHTYPE_OPAQUE); } cpu_to_use = sctp_cpuarry[flowid % mp_ncpus]; sctp_queue_to_mcore(m, off, cpu_to_use); Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Dec 4 19:08:05 2014 (r275482) +++ head/sys/netinet/sctp_output.c Thu Dec 4 21:17:50 2014 (r275483) @@ -3999,7 +3999,7 @@ sctp_lowlevel_chunk_output(struct sctp_i uint32_t v_tag, uint16_t port, union sctp_sockstore *over_addr, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) int so_locked SCTP_UNUSED #else @@ -4090,18 +4090,11 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_BUF_NEXT(newm) = m; m = newm; if (net != NULL) { -#ifdef INVARIANTS - if (net->flowidset == 0) { - panic("Flow ID not set"); - } -#endif m->m_pkthdr.flowid = net->flowid; - m->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m, net->flowtype); } else { - if (use_mflowid != 0) { - m->m_pkthdr.flowid = mflowid; - m->m_flags |= M_FLOWID; - } + m->m_pkthdr.flowid = mflowid; + M_HASHTYPE_SET(m, mflowtype); } packet_length = sctp_calculate_len(m); ip = mtod(m, struct ip *); @@ -4379,18 +4372,11 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_BUF_NEXT(newm) = m; m = newm; if (net != NULL) { -#ifdef INVARIANTS - if (net->flowidset == 0) { - panic("Flow ID not set"); - } -#endif m->m_pkthdr.flowid = net->flowid; - m->m_flags |= M_FLOWID; + M_HASHTYPE_SET(m, net->flowtype); } else { - if (use_mflowid != 0) { - m->m_pkthdr.flowid = mflowid; - m->m_flags |= M_FLOWID; - } + m->m_pkthdr.flowid = mflowid; + M_HASHTYPE_SET(m, mflowtype); } packet_length = sctp_calculate_len(m); @@ -5484,7 +5470,7 @@ sctp_send_initiate_ack(struct sctp_inpcb struct mbuf *init_pkt, int iphlen, int offset, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_chunk *init_chk, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port, int hold_inp_lock) { struct sctp_association *asoc; @@ -5536,7 +5522,7 @@ sctp_send_initiate_ack(struct sctp_inpcb op_err = sctp_generate_cause(SCTP_BASE_SYSCTL(sctp_diag_info_code), "Address added"); sctp_send_abort(init_pkt, iphlen, src, dst, sh, 0, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); return; } @@ -5555,7 +5541,7 @@ do_a_abort: } sctp_send_abort(init_pkt, iphlen, src, dst, sh, init_chk->init.initiate_tag, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); return; } @@ -6112,7 +6098,7 @@ do_a_abort: 0, 0, inp->sctp_lport, sh->src_port, init_chk->init.initiate_tag, port, over_addr, - use_mflowid, mflowid, + mflowtype, mflowid, SCTP_SO_NOT_LOCKED); SCTP_STAT_INCR_COUNTER64(sctps_outcontrolchunks); } @@ -10953,7 +10939,7 @@ static void sctp_send_resp_msg(struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, uint32_t vtag, uint8_t type, struct mbuf *cause, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { struct mbuf *o_pak; @@ -11033,10 +11019,8 @@ sctp_send_resp_msg(struct sockaddr *src, SCTP_BUF_RESV_UF(mout, max_linkhdr); SCTP_BUF_LEN(mout) = len; SCTP_BUF_NEXT(mout) = cause; - if (use_mflowid != 0) { - mout->m_pkthdr.flowid = mflowid; - mout->m_flags |= M_FLOWID; - } + mout->m_pkthdr.flowid = mflowid; + M_HASHTYPE_SET(mout, mflowtype); #ifdef INET ip = NULL; #endif @@ -11222,11 +11206,11 @@ sctp_send_resp_msg(struct sockaddr *src, void sctp_send_shutdown_complete2(struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { sctp_send_resp_msg(src, dst, sh, 0, SCTP_SHUTDOWN_COMPLETE, NULL, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); } @@ -12045,7 +12029,7 @@ skip_stuff: void sctp_send_abort(struct mbuf *m, int iphlen, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, uint32_t vtag, struct mbuf *cause, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { /* Don't respond to an ABORT with an ABORT. */ @@ -12055,7 +12039,7 @@ sctp_send_abort(struct mbuf *m, int iphl return; } sctp_send_resp_msg(src, dst, sh, vtag, SCTP_ABORT_ASSOCIATION, cause, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); return; } @@ -12063,11 +12047,11 @@ sctp_send_abort(struct mbuf *m, int iphl void sctp_send_operr_to(struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, uint32_t vtag, struct mbuf *cause, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { sctp_send_resp_msg(src, dst, sh, vtag, SCTP_OPERATION_ERROR, cause, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); return; } Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Thu Dec 4 19:08:05 2014 (r275482) +++ head/sys/netinet/sctp_pcb.c Thu Dec 4 21:17:50 2014 (r275483) @@ -4049,9 +4049,7 @@ sctp_add_remote_addr(struct sctp_tcb *st net->flowid = stcb->asoc.my_vtag ^ ntohs(stcb->rport) ^ ntohs(stcb->sctp_ep->sctp_lport); -#ifdef INVARIANTS - net->flowidset = 1; -#endif + net->flowtype = M_HASHTYPE_OPAQUE; if (netp) { *netp = net; } Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Thu Dec 4 19:08:05 2014 (r275482) +++ head/sys/netinet/sctp_structs.h Thu Dec 4 21:17:50 2014 (r275483) @@ -380,9 +380,7 @@ struct sctp_nets { uint8_t lan_type; uint8_t rto_needed; uint32_t flowid; -#ifdef INVARIANTS - uint8_t flowidset; -#endif + uint8_t flowtype; }; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Thu Dec 4 19:08:05 2014 (r275482) +++ head/sys/netinet/sctputil.c Thu Dec 4 21:17:50 2014 (r275483) @@ -3852,7 +3852,7 @@ sctp_abort_association(struct sctp_inpcb struct mbuf *m, int iphlen, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct mbuf *op_err, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { uint32_t vtag; @@ -3872,7 +3872,7 @@ sctp_abort_association(struct sctp_inpcb stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; } sctp_send_abort(m, iphlen, src, dst, sh, vtag, op_err, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); if (stcb != NULL) { /* Ok, now lets free it */ @@ -4026,7 +4026,7 @@ sctp_handle_ootb(struct mbuf *m, int iph struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_inpcb *inp, struct mbuf *cause, - uint8_t use_mflowid, uint32_t mflowid, + uint8_t mflowtype, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { struct sctp_chunkhdr *ch, chunk_buf; @@ -4068,7 +4068,7 @@ sctp_handle_ootb(struct mbuf *m, int iph return; case SCTP_SHUTDOWN_ACK: sctp_send_shutdown_complete2(src, dst, sh, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); return; default: @@ -4082,7 +4082,7 @@ sctp_handle_ootb(struct mbuf *m, int iph ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && (contains_init_chunk == 0))) { sctp_send_abort(m, iphlen, src, dst, sh, 0, cause, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); } } Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Thu Dec 4 19:08:05 2014 (r275482) +++ head/sys/netinet6/sctp6_usrreq.c Thu Dec 4 21:17:50 2014 (r275483) @@ -83,7 +83,7 @@ sctp6_input_with_port(struct mbuf **i_pa #endif uint32_t mflowid; - uint8_t use_mflowid; + uint8_t mflowtype; iphlen = *offp; if (SCTP_GET_PKT_VRFID(*i_pak, vrf_id)) { @@ -113,13 +113,8 @@ sctp6_input_with_port(struct mbuf **i_pa m->m_pkthdr.len, if_name(m->m_pkthdr.rcvif), (int)m->m_pkthdr.csum_flags, CSUM_BITS); - if (m->m_flags & M_FLOWID) { - mflowid = m->m_pkthdr.flowid; - use_mflowid = 1; - } else { - mflowid = 0; - use_mflowid = 0; - } + mflowid = m->m_pkthdr.flowid; + mflowtype = M_HASHTYPE_GET(m); SCTP_STAT_INCR(sctps_recvpackets); SCTP_STAT_INCR_COUNTER64(sctps_inpackets); /* Get IP, SCTP, and first chunk header together in the first mbuf. */ @@ -180,7 +175,7 @@ sctp6_input_with_port(struct mbuf **i_pa compute_crc, #endif ecn_bits, - use_mflowid, mflowid, + mflowtype, mflowid, vrf_id, port); out: if (m) { From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 09:33:16 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4F887C30; Fri, 5 Dec 2014 09:33:16 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 0D135DE4; Fri, 5 Dec 2014 09:33:15 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 18F69AEA6; Fri, 5 Dec 2014 09:33:14 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 8A8D380A4; Fri, 5 Dec 2014 10:33:12 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: John-Mark Gurney Subject: Re: svn commit: r275468 - head/sys/dev/usb/controller References: <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> <54800B60.9020208@selasky.org> <20141204175032.GQ99957@funkthat.com> <86sigve0c0.fsf@nine.des.no> <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> <1373EB55-4238-40D0-B481-53C8B46D6E6C@FreeBSD.org> <86wq67e3y8.fsf@nine.des.no> <20141204191904.GB25139@funkthat.com> Date: Fri, 05 Dec 2014 10:33:12 +0100 In-Reply-To: <20141204191904.GB25139@funkthat.com> (John-Mark Gurney's message of "Thu, 4 Dec 2014 11:19:04 -0800") Message-ID: <86oarie90n.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: Hans Petter Selasky , src-committers@freebsd.org, Hans Petter Selasky , svn-src-all@freebsd.org, Dimitry Andric , svn-src-head@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 09:33:16 -0000 John-Mark Gurney writes: > So this says that you think it should be using the builtin, yet when I > suggested it, you say no? Which is it? Use ffs(), let libkern worry about how it's implemented. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 09:42:21 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9E31F4B; Fri, 5 Dec 2014 09:42:21 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7679BEF7; Fri, 5 Dec 2014 09:42:21 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id D251B1FE023; Fri, 5 Dec 2014 10:42:18 +0100 (CET) Message-ID: <54817E16.3030206@selasky.org> Date: Fri, 05 Dec 2014 10:42:46 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= , John-Mark Gurney Subject: Re: svn commit: r275468 - head/sys/dev/usb/controller References: <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> <54800B60.9020208@selasky.org> <20141204175032.GQ99957@funkthat.com> <86sigve0c0.fsf@nine.des.no> <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> <1373EB55-4238-40D0-B481-53C8B46D6E6C@FreeBSD.org> <86wq67e3y8.fsf@nine.des.no> <20141204191904.GB25139@funkthat.com> <86oarie90n.fsf@nine.des.no> In-Reply-To: <86oarie90n.fsf@nine.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, Hans Petter Selasky , svn-src-all@freebsd.org, src-committers@freebsd.org, Dimitry Andric X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 09:42:21 -0000 On 12/05/14 10:33, Dag-Erling Smørgrav wrote: > John-Mark Gurney writes: >> So this says that you think it should be using the builtin, yet when I >> suggested it, you say no? Which is it? > > Use ffs(), let libkern worry about how it's implemented. > > DES > Hi, One more question. Is ffs() available in the loader too? Because this code is also built for the loader? I guess I could figure this out myself though ... --HPS From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 10:03:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DA6653A; Fri, 5 Dec 2014 10:03:05 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 19B4A178; Fri, 5 Dec 2014 10:03:04 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 2BB8AAF20; Fri, 5 Dec 2014 10:03:04 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 13A6D80AA; Fri, 5 Dec 2014 11:03:00 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Hans Petter Selasky Subject: Re: svn commit: r275468 - head/sys/dev/usb/controller References: <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> <54800B60.9020208@selasky.org> <20141204175032.GQ99957@funkthat.com> <86sigve0c0.fsf@nine.des.no> <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> <1373EB55-4238-40D0-B481-53C8B46D6E6C@FreeBSD.org> <86wq67e3y8.fsf@nine.des.no> <20141204191904.GB25139@funkthat.com> <86oarie90n.fsf@nine.des.no> <54817E16.3030206@selasky.org> Date: Fri, 05 Dec 2014 11:02:59 +0100 In-Reply-To: <54817E16.3030206@selasky.org> (Hans Petter Selasky's message of "Fri, 05 Dec 2014 10:42:46 +0100") Message-ID: <86k326e7n0.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, Dimitry Andric , svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 10:03:05 -0000 Hans Petter Selasky writes: > Is ffs() available in the loader too? Because this code is also built > for the loader? I guess I could figure this out myself though ... The loader usues libkern, so yes. But it's easy enough to check - just modify the code to use ffs() and see if it builds. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 10:23:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B776BD5; Fri, 5 Dec 2014 10:23:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D25633EB; Fri, 5 Dec 2014 10:23:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5ANJcD030406; Fri, 5 Dec 2014 10:23:19 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5ANJj1030404; Fri, 5 Dec 2014 10:23:19 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412051023.sB5ANJj1030404@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 5 Dec 2014 10:23:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275503 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 10:23:20 -0000 Author: mav Date: Fri Dec 5 10:23:18 2014 New Revision: 275503 URL: https://svnweb.freebsd.org/changeset/base/275503 Log: Avoid unneeded malloc/memcpy/free if there is no metadata on disk. Submitted by: Dmitry Luhtionov MFC after: 2 weeks Modified: head/sys/geom/raid/md_nvidia.c head/sys/geom/raid/md_sii.c Modified: head/sys/geom/raid/md_nvidia.c ============================================================================== --- head/sys/geom/raid/md_nvidia.c Fri Dec 5 09:30:07 2014 (r275502) +++ head/sys/geom/raid/md_nvidia.c Fri Dec 5 10:23:18 2014 (r275503) @@ -256,23 +256,24 @@ nvidia_meta_read(struct g_consumer *cp) pp->name, error); return (NULL); } - meta = malloc(sizeof(*meta), M_MD_NVIDIA, M_WAITOK); - memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); - g_free(buf); + meta = (struct nvidia_raid_conf *)buf; /* Check if this is an NVIDIA RAID struct */ if (strncmp(meta->nvidia_id, NVIDIA_MAGIC, strlen(NVIDIA_MAGIC))) { G_RAID_DEBUG(1, "NVIDIA signature check failed on %s", pp->name); - free(meta, M_MD_NVIDIA); + g_free(buf); return (NULL); } if (meta->config_size > 128 || meta->config_size < 30) { G_RAID_DEBUG(1, "NVIDIA metadata size looks wrong: %d", meta->config_size); - free(meta, M_MD_NVIDIA); + g_free(buf); return (NULL); } + meta = malloc(sizeof(*meta), M_MD_NVIDIA, M_WAITOK); + memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); + g_free(buf); /* Check metadata checksum. */ for (checksum = 0, ptr = (uint32_t *)meta, Modified: head/sys/geom/raid/md_sii.c ============================================================================== --- head/sys/geom/raid/md_sii.c Fri Dec 5 09:30:07 2014 (r275502) +++ head/sys/geom/raid/md_sii.c Fri Dec 5 10:23:18 2014 (r275503) @@ -277,15 +277,13 @@ sii_meta_read(struct g_consumer *cp) pp->name, error); return (NULL); } - meta = malloc(sizeof(*meta), M_MD_SII, M_WAITOK); - memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); - g_free(buf); + meta = (struct sii_raid_conf *)buf; /* Check vendor ID. */ if (meta->vendor_id != 0x1095) { G_RAID_DEBUG(1, "SiI vendor ID check failed on %s (0x%04x)", pp->name, meta->vendor_id); - free(meta, M_MD_SII); + g_free(buf); return (NULL); } @@ -293,9 +291,12 @@ sii_meta_read(struct g_consumer *cp) if (meta->version_major != 2) { G_RAID_DEBUG(1, "SiI version check failed on %s (%d.%d)", pp->name, meta->version_major, meta->version_minor); - free(meta, M_MD_SII); + g_free(buf); return (NULL); } + meta = malloc(sizeof(*meta), M_MD_SII, M_WAITOK); + memcpy(meta, buf, min(sizeof(*meta), pp->sectorsize)); + g_free(buf); /* Check metadata checksum. */ for (checksum = 0, ptr = (uint16_t *)meta, i = 0; i <= 159; i++) From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 11:52:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2110CDCD; Fri, 5 Dec 2014 11:52:05 +0000 (UTC) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id D64FCF25; Fri, 5 Dec 2014 11:52:04 +0000 (UTC) Received: from nine.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id 38030A22A; Fri, 5 Dec 2014 11:51:58 +0000 (UTC) Received: by nine.des.no (Postfix, from userid 1001) id 8ADAA80B7; Fri, 5 Dec 2014 12:51:54 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Hans Petter Selasky Subject: Re: svn commit: r275468 - head/sys/dev/usb/controller References: <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> <54800B60.9020208@selasky.org> <20141204175032.GQ99957@funkthat.com> <5480C5FA.4030402@selasky.org> Date: Fri, 05 Dec 2014 12:51:54 +0100 In-Reply-To: <5480C5FA.4030402@selasky.org> (Hans Petter Selasky's message of "Thu, 04 Dec 2014 21:37:14 +0100") Message-ID: <86fvcue2lh.fsf@nine.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 11:52:05 -0000 Hans Petter Selasky writes: > I see. Who can update the cpufunc.h header file to use the builtins? Ask someone involved with porting FreeBSD to that platform. > Are these also available with GCC? They are enabled unconditionally for amd64 and i386. They may or may not be compiler-dependent on other platforms. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 12:04:48 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D1FF142A; Fri, 5 Dec 2014 12:04:48 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BE87CC0; Fri, 5 Dec 2014 12:04:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5C4mmu079835; Fri, 5 Dec 2014 12:04:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5C4mNQ079834; Fri, 5 Dec 2014 12:04:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412051204.sB5C4mNQ079834@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Dec 2014 12:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275506 - head/sys/boot/kshim X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 12:04:48 -0000 Author: hselasky Date: Fri Dec 5 12:04:47 2014 New Revision: 275506 URL: https://svnweb.freebsd.org/changeset/base/275506 Log: Define the ffs() function in the USB bootloader's global and independent header file. Modified: head/sys/boot/kshim/bsd_kernel.h Modified: head/sys/boot/kshim/bsd_kernel.h ============================================================================== --- head/sys/boot/kshim/bsd_kernel.h Fri Dec 5 11:58:32 2014 (r275505) +++ head/sys/boot/kshim/bsd_kernel.h Fri Dec 5 12:04:47 2014 (r275506) @@ -109,6 +109,8 @@ SYSINIT_ENTRY(uniq##_entry, "sysuninit", #define cold 0 #define BUS_PROBE_GENERIC 0 #define CALLOUT_RETURNUNLOCKED 0x1 +#undef ffs +#define ffs(x) __builtin_ffs(x) #undef va_list #define va_list __builtin_va_list #undef va_size From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 12:07:54 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 878485C8; Fri, 5 Dec 2014 12:07:54 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 697DBF7; Fri, 5 Dec 2014 12:07:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5C7svj080278; Fri, 5 Dec 2014 12:07:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5C7s3E080277; Fri, 5 Dec 2014 12:07:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412051207.sB5C7s3E080277@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 5 Dec 2014 12:07:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275507 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 12:07:54 -0000 Author: hselasky Date: Fri Dec 5 12:07:53 2014 New Revision: 275507 URL: https://svnweb.freebsd.org/changeset/base/275507 Log: Optimise bit searching loop by using the ffs() function. Make some related bit shifts unsigned while at it. Modified: head/sys/dev/usb/controller/saf1761_otg.c Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Fri Dec 5 12:04:47 2014 (r275506) +++ head/sys/dev/usb/controller/saf1761_otg.c Fri Dec 5 12:07:53 2014 (r275507) @@ -58,6 +58,7 @@ #include #include #include +#include #include #include @@ -216,7 +217,7 @@ static uint8_t saf1761_host_channel_alloc(struct saf1761_otg_softc *sc, struct saf1761_otg_td *td) { uint32_t map; - uint32_t x; + int x; if (td->channel < SOTG_HOST_CHANNEL_MAX) return (0); @@ -227,41 +228,38 @@ saf1761_host_channel_alloc(struct saf176 switch (td->ep_type) { case UE_INTERRUPT: - map = sc->sc_host_intr_map | + map = ~(sc->sc_host_intr_map | sc->sc_host_intr_busy_map[0] | - sc->sc_host_intr_busy_map[1]; - for (x = ((map & 0xFFFF) == 0xFFFF) ? 16 : 0; x != 32; x++) { - if (map & (1 << x)) - continue; - sc->sc_host_intr_map |= (1 << x); - td->channel = 32 + x; - return (0); - } - break; + sc->sc_host_intr_busy_map[1]); + /* find first set bit */ + x = ffs(map) - 1; + if (x < 0 || x > 31) + break; + sc->sc_host_intr_map |= (1U << x); + td->channel = 32 + x; + return (0); case UE_ISOCHRONOUS: - map = sc->sc_host_isoc_map | + map = ~(sc->sc_host_isoc_map | sc->sc_host_isoc_busy_map[0] | - sc->sc_host_isoc_busy_map[1]; - for (x = ((map & 0xFFFF) == 0xFFFF) ? 16 : 0; x != 32; x++) { - if (map & (1 << x)) - continue; - sc->sc_host_isoc_map |= (1 << x); - td->channel = x; - return (0); - } - break; + sc->sc_host_isoc_busy_map[1]); + /* find first set bit */ + x = ffs(map) - 1; + if (x < 0 || x > 31) + break; + sc->sc_host_isoc_map |= (1U << x); + td->channel = x; + return (0); default: - map = sc->sc_host_async_map | + map = ~(sc->sc_host_async_map | sc->sc_host_async_busy_map[0] | - sc->sc_host_async_busy_map[1]; - for (x = ((map & 0xFFFF) == 0xFFFF) ? 16 : 0; x != 32; x++) { - if (map & (1 << x)) - continue; - sc->sc_host_async_map |= (1 << x); - td->channel = 64 + x; - return (0); - } - break; + sc->sc_host_async_busy_map[1]); + /* find first set bit */ + x = ffs(map) - 1; + if (x < 0 || x > 31) + break; + sc->sc_host_async_map |= (1U << x); + td->channel = 64 + x; + return (0); } return (1); } @@ -278,27 +276,27 @@ saf1761_host_channel_free(struct saf1761 case UE_INTERRUPT: x = td->channel - 32; td->channel = SOTG_HOST_CHANNEL_MAX; - sc->sc_host_intr_map &= ~(1 << x); - sc->sc_host_intr_suspend_map &= ~(1 << x); - sc->sc_host_intr_busy_map[0] |= (1 << x); + sc->sc_host_intr_map &= ~(1U << x); + sc->sc_host_intr_suspend_map &= ~(1U << x); + sc->sc_host_intr_busy_map[0] |= (1U << x); SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, (~sc->sc_host_intr_map) | sc->sc_host_intr_suspend_map); break; case UE_ISOCHRONOUS: x = td->channel; td->channel = SOTG_HOST_CHANNEL_MAX; - sc->sc_host_isoc_map &= ~(1 << x); - sc->sc_host_isoc_suspend_map &= ~(1 << x); - sc->sc_host_isoc_busy_map[0] |= (1 << x); + sc->sc_host_isoc_map &= ~(1U << x); + sc->sc_host_isoc_suspend_map &= ~(1U << x); + sc->sc_host_isoc_busy_map[0] |= (1U << x); SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, (~sc->sc_host_isoc_map) | sc->sc_host_isoc_suspend_map); break; default: x = td->channel - 64; td->channel = SOTG_HOST_CHANNEL_MAX; - sc->sc_host_async_map &= ~(1 << x); - sc->sc_host_async_suspend_map &= ~(1 << x); - sc->sc_host_async_busy_map[0] |= (1 << x); + sc->sc_host_async_map &= ~(1U << x); + sc->sc_host_async_suspend_map &= ~(1U << x); + sc->sc_host_async_busy_map[0] |= (1U << x); SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, (~sc->sc_host_async_map) | sc->sc_host_async_suspend_map); break; @@ -3619,19 +3617,19 @@ saf1761_otg_device_resume(struct usb_dev switch (td->ep_type) { case UE_INTERRUPT: x = td->channel - 32; - sc->sc_host_intr_suspend_map &= ~(1 << x); + sc->sc_host_intr_suspend_map &= ~(1U << x); SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, (~sc->sc_host_intr_map) | sc->sc_host_intr_suspend_map); break; case UE_ISOCHRONOUS: x = td->channel; - sc->sc_host_isoc_suspend_map &= ~(1 << x); + sc->sc_host_isoc_suspend_map &= ~(1U << x); SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, (~sc->sc_host_isoc_map) | sc->sc_host_isoc_suspend_map); break; default: x = td->channel - 64; - sc->sc_host_async_suspend_map &= ~(1 << x); + sc->sc_host_async_suspend_map &= ~(1U << x); SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, (~sc->sc_host_async_map) | sc->sc_host_async_suspend_map); break; @@ -3675,19 +3673,19 @@ saf1761_otg_device_suspend(struct usb_de switch (td->ep_type) { case UE_INTERRUPT: x = td->channel - 32; - sc->sc_host_intr_suspend_map |= (1 << x); + sc->sc_host_intr_suspend_map |= (1U << x); SAF1761_WRITE_LE_4(sc, SOTG_INT_PTD_SKIP_PTD, (~sc->sc_host_intr_map) | sc->sc_host_intr_suspend_map); break; case UE_ISOCHRONOUS: x = td->channel; - sc->sc_host_isoc_suspend_map |= (1 << x); + sc->sc_host_isoc_suspend_map |= (1U << x); SAF1761_WRITE_LE_4(sc, SOTG_ISO_PTD_SKIP_PTD, (~sc->sc_host_isoc_map) | sc->sc_host_isoc_suspend_map); break; default: x = td->channel - 64; - sc->sc_host_async_suspend_map |= (1 << x); + sc->sc_host_async_suspend_map |= (1U << x); SAF1761_WRITE_LE_4(sc, SOTG_ATL_PTD_SKIP_PTD, (~sc->sc_host_async_map) | sc->sc_host_async_suspend_map); break; From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 12:11:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D918474F; Fri, 5 Dec 2014 12:11:14 +0000 (UTC) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9948211C; Fri, 5 Dec 2014 12:11:14 +0000 (UTC) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0E8791FE023; Fri, 5 Dec 2014 13:11:11 +0100 (CET) Message-ID: <5481A0FC.3050809@selasky.org> Date: Fri, 05 Dec 2014 13:11:40 +0100 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= Subject: Re: svn commit: r275468 - head/sys/dev/usb/controller References: <201412032155.sB3LtjJN043364@svn.freebsd.org> <20141204005451.GM99957@funkthat.com> <54800B60.9020208@selasky.org> <20141204175032.GQ99957@funkthat.com> <5480C5FA.4030402@selasky.org> <86fvcue2lh.fsf@nine.des.no> In-Reply-To: <86fvcue2lh.fsf@nine.des.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, John-Mark Gurney , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 12:11:15 -0000 Done. See r275507 . --HPS From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 12:38:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7545C359; Fri, 5 Dec 2014 12:38:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 606B8635; Fri, 5 Dec 2014 12:38:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5Cc2Gh094997; Fri, 5 Dec 2014 12:38:02 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5Cc1gQ094991; Fri, 5 Dec 2014 12:38:01 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201412051238.sB5Cc1gQ094991@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 5 Dec 2014 12:38:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275510 - in head: sbin/iscontrol usr.bin/iscsictl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 12:38:02 -0000 Author: trasz Date: Fri Dec 5 12:38:01 2014 New Revision: 275510 URL: https://svnweb.freebsd.org/changeset/base/275510 Log: Move iscsi.conf.5 from sbin/iscontrol/ to usr.bin/iscsictl/, as the former is obsolete. MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Added: head/usr.bin/iscsictl/iscsi.conf.5 - copied unchanged from r275500, head/sbin/iscontrol/iscsi.conf.5 Deleted: head/sbin/iscontrol/iscsi.conf.5 Modified: head/sbin/iscontrol/Makefile head/usr.bin/iscsictl/Makefile Modified: head/sbin/iscontrol/Makefile ============================================================================== --- head/sbin/iscontrol/Makefile Fri Dec 5 12:25:36 2014 (r275509) +++ head/sbin/iscontrol/Makefile Fri Dec 5 12:38:01 2014 (r275510) @@ -8,6 +8,6 @@ S= ${.CURDIR}/../../sys WARNS?= 3 CFLAGS+= -I$S -MAN= iscsi.conf.5 iscontrol.8 +MAN= iscontrol.8 .include Modified: head/usr.bin/iscsictl/Makefile ============================================================================== --- head/usr.bin/iscsictl/Makefile Fri Dec 5 12:25:36 2014 (r275509) +++ head/usr.bin/iscsictl/Makefile Fri Dec 5 12:38:01 2014 (r275510) @@ -4,7 +4,7 @@ PROG= iscsictl SRCS= iscsictl.c periphs.c parse.y token.l y.tab.h CFLAGS+= -I${.CURDIR} CFLAGS+= -I${.CURDIR}/../../sys/dev/iscsi -MAN= iscsictl.8 +MAN= iscsi.conf.5 iscsictl.8 LIBADD= cam util Copied: head/usr.bin/iscsictl/iscsi.conf.5 (from r275500, head/sbin/iscontrol/iscsi.conf.5) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/iscsictl/iscsi.conf.5 Fri Dec 5 12:38:01 2014 (r275510, copy of r275500, head/sbin/iscontrol/iscsi.conf.5) @@ -0,0 +1,188 @@ +.\" Copyright (c) 2007-2010 Daniel Braniss +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 17, 2013 +.Dt ISCSI.CONF 5 +.Os +.Sh NAME +.Nm iscsi.conf +.Nd iSCSI initiator configuration file +.Sh DESCRIPTION +The file +.Nm , +is used by the +.Xr iscsictl 8 +and +.Xr iscontrol 8 +utilities. +It contains declarations and parameter/key-options. +The syntax is very simple, +.D1 Li variable = value; +and they can be grouped via a +.Em block +declaration: +.Bf Li +.Bd -literal + # this is a comment + target_1 { # nickname + variable = value; + ... + } # this must be on a line by itself. +.Ed +.Ef +.Pp +The following are specified in the iSCSI RFC 3720, +for a full description see sections 11/12 of the RFC. +.Bl -tag -width MaxConnections +.It Cm AuthMethod +currently only supported authentication method is CHAP, with +digest either MD5 or SHA. +Default is none. +.It Cm HeaderDigest +a +.Em digest +is calculated on the header of all iSCSI PDUs, and +checked. +Only CRC32C is implemented. +Default is none. +.It Cm DataDigest +same as for HeaderDigest, but on the data part of the iSCSI PDU. +(not yet tested) +.It Cm TargetName +is the name by which the target is known, not to be confused with +target address, either obtained via the target administrator, or +from a +.Em discovery session . +.It Cm InitiatorName +if not specified, defaults to +.Sy iqn.2005-01.il.ac.huji.cs: +.Aq hostname . +.It Cm TargetAddress +is of the form +.Sy domainname[:port][,portal-group-tag] +to quote the RFC: +.Bd -ragged -compact +The domainname can be specified as either a DNS host name, a +dotted-decimal IPv4 address, or a bracketed IPv6 address as specified +in [RFC2732]. +.Ed +Note: portal-group-tag is unused at the moment. +.Em not implemented yet. +.It Cm MaxRecvDataSegmentLength +the maximum data segment length in +bytes it can receive in an iSCSI PDU, default is 8192. +.It Cm MaxOutstandingR2T +is used to calculate/negotiate the +.Em tag opening , +can be overridden by the +.Sy tag +option. +.It Cm SessionType +either Discovery or Normal, default is Normal, see the +.Fl d +flag of +.Cm iscontrol . +.El +.sp +The following are not specified in the +.Sy RFC 3720 +.Bl -tag -width sockbufsize +.It Cm port +The iSCSI port used by the iSCSI protocol, defaults to 3260. +.It Cm tags +Sets the +.Em tag opening +to the value specified. +.It Cm maxluns +overrides the compiled value of +.Sy luns , +see +.Xr iscsi_initiator 4 . +This value can only be reduced. +.It Cm sockbufsize +sets the receiver and transmitter socket buffer size to +.Em size , +in kilobytes. +The default is 128. +.El +.sp +If +.Em AuthMethod +is set to +.Cm CHAP , +then the following must also be set: +.Bl -tag -width chapSecret +.It Cm chapSecret +this +.Em shared-secret . +Can be either an ASCII string (e.g. hello world), a hex string (e.g +0xababcd0987654321...), or base64 string (eg 0b...) +.It Cm chapIName +the chap-name, defaults to +.Em hostname . +.It Cm chapDigest +can be MD5 or SHA1. +.It Cm tgtChapName/tgtChapSecret +name and secret used for mutual CHAP; by default, mutual CHAP +is not used. +.El +.Sh FILES +.Bl -tag -width indent +.It Pa /etc/iscsi.conf +.El +.Sh EXAMPLES +.Bd -literal +# +# Globals +# +port = 3260 +# +myiscsi { # nickname + targetaddress = iscsi1 + targetname = iqn.1900.com.com:sn.123456 +} +chaptest { + targetaddress= 10.0.0.1; + targetname = iqn.1900.com.com:sn.123456 + initiatorname= iqn.2005-01.il.ac.huji.cs:nobody + authmethod = CHAP; chapDigest = SHA1; + chapsecret = 0x3713c3336d9a224c2791c873d3d2b174 + tags = 256 +} +.Ed +.Sh SEE ALSO +.Xr iscsi_initiator 4 , +.Xr iscsictl 8 , +.Xr iscontrol 8 +.Sh STANDARDS +ISCSI RFC 3720 +.\"Sh HISTORY +.\"Sh AUTHORS +.Sh BUGS +Some options have not been implemented, either they were found +to be unnecessary, or not understood, this can change in the future. +.br +The tags opening value is difficult to calculate, use wisely. From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 13:30:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5A81C71; Fri, 5 Dec 2014 13:30:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92162C07; Fri, 5 Dec 2014 13:30:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5DUkHU023094; Fri, 5 Dec 2014 13:30:46 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5DUkHs023093; Fri, 5 Dec 2014 13:30:46 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412051330.sB5DUkHs023093@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 5 Dec 2014 13:30:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275512 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 13:30:46 -0000 Author: mav Date: Fri Dec 5 13:30:45 2014 New Revision: 275512 URL: https://svnweb.freebsd.org/changeset/base/275512 Log: In addition to r275481 allow threshold notifications work without UNMAP. While without UNMAP support there is not much initiator can do about it, the administrator still better be notified about the storage overflow. MFC after: 2 weeks Sponsored by: iXsystems, Inc. Modified: head/sys/cam/ctl/ctl.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Fri Dec 5 12:51:27 2014 (r275511) +++ head/sys/cam/ctl/ctl.c Fri Dec 5 13:30:45 2014 (r275512) @@ -4347,8 +4347,7 @@ ctl_init_log_page_index(struct ctl_lun * continue; if (page_index->page_code == SLS_LOGICAL_BLOCK_PROVISIONING && - ((lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) == 0 || - lun->backend->lun_attr == NULL)) + lun->backend->lun_attr == NULL) continue; if (page_index->page_code != prev) { @@ -10253,8 +10252,8 @@ ctl_inquiry_evpd_lbp(struct ctl_scsiio * lbp_ptr->page_code = SVPD_LBP; scsi_ulto2b(sizeof(*lbp_ptr) - 4, lbp_ptr->page_length); + lbp_ptr->threshold_exponent = CTL_LBP_EXPONENT; if (lun != NULL && lun->be_lun->flags & CTL_LUN_FLAG_UNMAP) { - lbp_ptr->threshold_exponent = CTL_LBP_EXPONENT; lbp_ptr->flags = SVPD_LBP_UNMAP | SVPD_LBP_WS16 | SVPD_LBP_WS10 | SVPD_LBP_RZ | SVPD_LBP_ANC_SUP; lbp_ptr->prov_type = SVPD_LBP_THIN; @@ -14002,7 +14001,6 @@ ctl_thresh_thread(void *arg) be_lun = lun->be_lun; if ((lun->flags & CTL_LUN_DISABLED) || (lun->flags & CTL_LUN_OFFLINE) || - (be_lun->flags & CTL_LUN_FLAG_UNMAP) == 0 || lun->backend->lun_attr == NULL) continue; rwpage = &lun->mode_pages.rw_er_page[CTL_PAGE_CURRENT]; From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 15:02:31 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B00F454; Fri, 5 Dec 2014 15:02:31 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 375CA8A4; Fri, 5 Dec 2014 15:02:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5F2VIi066263; Fri, 5 Dec 2014 15:02:31 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5F2V7g066261; Fri, 5 Dec 2014 15:02:31 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412051502.sB5F2V7g066261@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 5 Dec 2014 15:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275513 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 15:02:31 -0000 Author: kib Date: Fri Dec 5 15:02:30 2014 New Revision: 275513 URL: https://svnweb.freebsd.org/changeset/base/275513 Log: When the last reference on the vnode' vm object is dropped, read the vp->v_vflag without taking vnode lock and without bypass. We do know that vp is the lowest level in the stack, since the pointer is obtained from the object' handle. Stale VV_TEXT flag read can only happen if parallel execve() is performed and not yet activated the image, since process takes reference for text mapping. In this case, the execve() code manages the VV_TEXT flag on its own already. It was observed that otherwise read-only sendfile(2) requires exclusive vnode lock and contending on it on some loads for VV_TEXT handling. Reported by: glebius, scottl Tested by: glebius, pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/vm/vm_object.c Modified: head/sys/vm/vm_object.c ============================================================================== --- head/sys/vm/vm_object.c Fri Dec 5 13:30:45 2014 (r275512) +++ head/sys/vm/vm_object.c Fri Dec 5 15:02:30 2014 (r275513) @@ -468,7 +468,12 @@ vm_object_vndeallocate(vm_object_t objec } #endif - if (object->ref_count > 1) { + /* + * The test for text of vp vnode does not need a bypass to + * reach right VV_TEXT there, since it is obtained from + * object->handle. + */ + if (object->ref_count > 1 || (vp->v_vflag & VV_TEXT) == 0) { object->ref_count--; VM_OBJECT_WUNLOCK(object); /* vrele may need the vnode lock. */ From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 15:24:43 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 71C29997; Fri, 5 Dec 2014 15:24:43 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5E057AE9; Fri, 5 Dec 2014 15:24:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5FOhhW075755; Fri, 5 Dec 2014 15:24:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5FOg2G075751; Fri, 5 Dec 2014 15:24:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201412051524.sB5FOg2G075751@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 5 Dec 2014 15:24:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275514 - in head/sys: sys vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 15:24:43 -0000 Author: jhb Date: Fri Dec 5 15:24:42 2014 New Revision: 275514 URL: https://svnweb.freebsd.org/changeset/base/275514 Log: Always ignore the deprecated MAP_RENAME and MAP_NORESERVE flags to mmap(). Some old libraries may be used even with newer binaries (specifically the Nvidia driver libraries). Differential Revision: https://reviews.freebsd.org/D1262 Reviewed by: kib Modified: head/sys/sys/param.h head/sys/vm/vm_mmap.c Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Dec 5 15:02:30 2014 (r275513) +++ head/sys/sys/param.h Fri Dec 5 15:24:42 2014 (r275514) @@ -81,7 +81,6 @@ #define P_OSREL_SIGSEGV 700004 #define P_OSREL_MAP_ANON 800104 #define P_OSREL_MAP_FSTRICT 1100036 -#define P_OSREL_MAP_RENAME 1100039 #define P_OSREL_MAJOR(x) ((x) / 100000) #endif Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Fri Dec 5 15:02:30 2014 (r275513) +++ head/sys/vm/vm_mmap.c Fri Dec 5 15:24:42 2014 (r275514) @@ -222,8 +222,7 @@ sys_mmap(td, uap) /* * Ignore old flags that used to be defined but did not do anything. */ - if (td->td_proc->p_osrel < P_OSREL_MAP_RENAME) - flags &= ~(MAP_RESERVED0020 | MAP_RESERVED0040); + flags &= ~(MAP_RESERVED0020 | MAP_RESERVED0040); /* * Enforce the constraints. From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 18:29:02 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 40060599; Fri, 5 Dec 2014 18:29:02 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C16520F; Fri, 5 Dec 2014 18:29:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5IT2qK065118; Fri, 5 Dec 2014 18:29:02 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5IT2rA065117; Fri, 5 Dec 2014 18:29:02 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412051829.sB5IT2rA065117@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 5 Dec 2014 18:29:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275515 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 18:29:02 -0000 Author: delphij Date: Fri Dec 5 18:29:01 2014 New Revision: 275515 URL: https://svnweb.freebsd.org/changeset/base/275515 Log: Fix a regression introduced in r274337 (large block support) In dsl_dataset_hold_obj() we used zap_contains(.., DS_FIELD_LARGE_BLOCKS) to determine whether the extensible (zapifyed) dataset have large blocks. The code expects the result be either 0 (found) or ENOENT (not found), however reused the variable 'err' which later code expects to be 0. Fix this by adopting similar code construct that is used later for DS_FIELD_BOOKMARK_NAMES, which uses a temporary variable zaperr to catch errors from zap_* rountines. Reported by: Peter J. Creath (on FreeNAS; FreeNAS bug #6848) Illumos issue: 5393 spurious failures from dsl_dataset_hold_obj() Reviewed by: mahrens Sponsored by: iXsystems, Inc. X-MFC with: r274337 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Dec 5 15:24:42 2014 (r275514) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Dec 5 18:29:01 2014 (r275515) @@ -409,11 +409,11 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin offsetof(dmu_sendarg_t, dsa_link)); if (doi.doi_type == DMU_OTN_ZAP_METADATA) { - err = zap_contains(mos, dsobj, DS_FIELD_LARGE_BLOCKS); - if (err == 0) + int zaperr = zap_contains(mos, dsobj, DS_FIELD_LARGE_BLOCKS); + if (zaperr != ENOENT) { + VERIFY0(zaperr); ds->ds_large_blocks = B_TRUE; - else - ASSERT3U(err, ==, ENOENT); + } } if (err == 0) { From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 19:00:56 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A734EF57; Fri, 5 Dec 2014 19:00:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93CA2872; Fri, 5 Dec 2014 19:00:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5J0uJ3080872; Fri, 5 Dec 2014 19:00:56 GMT (envelope-from kargl@FreeBSD.org) Received: (from kargl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5J0u0U080870; Fri, 5 Dec 2014 19:00:56 GMT (envelope-from kargl@FreeBSD.org) Message-Id: <201412051900.sB5J0u0U080870@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kargl set sender to kargl@FreeBSD.org using -f From: Steve Kargl Date: Fri, 5 Dec 2014 19:00:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275518 - head/lib/msun/src X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 19:00:56 -0000 Author: kargl Date: Fri Dec 5 19:00:55 2014 New Revision: 275518 URL: https://svnweb.freebsd.org/changeset/base/275518 Log: Update the constants associated with the evaluation of j0f(x) for |x| small. While here, remove the explicit cast of 0.25 to float. Replace a multiplication involving 0.25 by a division using an integer constant 4. Make a similar change in j0() to minimize the diff. Suggested by: bde Modified: head/lib/msun/src/e_j0.c head/lib/msun/src/e_j0f.c Modified: head/lib/msun/src/e_j0.c ============================================================================== --- head/lib/msun/src/e_j0.c Fri Dec 5 18:55:32 2014 (r275517) +++ head/lib/msun/src/e_j0.c Fri Dec 5 19:00:55 2014 (r275518) @@ -115,7 +115,7 @@ __ieee754_j0(double x) if(ix<0x3f200000) { /* |x| < 2**-13 */ if(huge+x>one) { /* raise inexact if x != 0 */ if(ix<0x3e400000) return one; /* |x|<2**-27 */ - else return one - 0.25*x*x; + else return one - x*x/4; } } z = x*x; Modified: head/lib/msun/src/e_j0f.c ============================================================================== --- head/lib/msun/src/e_j0f.c Fri Dec 5 18:55:32 2014 (r275517) +++ head/lib/msun/src/e_j0f.c Fri Dec 5 19:00:55 2014 (r275518) @@ -69,10 +69,10 @@ __ieee754_j0f(float x) } return z; } - if(ix<0x39000000) { /* |x| < 2**-13 */ + if(ix<0x3c000000) { /* |x| < 2**-7 */ if(huge+x>one) { /* raise inexact if x != 0 */ - if(ix<0x32000000) return one; /* |x|<2**-27 */ - else return one - (float)0.25*x*x; + if(ix<0x39800000) return one; /* |x|<2**-12 */ + else return one - x*x/4; } } z = x*x; From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 19:04:09 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3ACD618E; Fri, 5 Dec 2014 19:04:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BDAC89F; Fri, 5 Dec 2014 19:04:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5J48fI083749; Fri, 5 Dec 2014 19:04:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5J48hT083747; Fri, 5 Dec 2014 19:04:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412051904.sB5J48hT083747@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 5 Dec 2014 19:04:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275519 - head/sys/arm/xscale/ixp425 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 19:04:09 -0000 Author: andrew Date: Fri Dec 5 19:04:08 2014 New Revision: 275519 URL: https://svnweb.freebsd.org/changeset/base/275519 Log: Add missing END macros to some of the xscale functions. MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm/xscale/ixp425/ixp425_a4x_io.S head/sys/arm/xscale/ixp425/ixp425_pci_asm.S Modified: head/sys/arm/xscale/ixp425/ixp425_a4x_io.S ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_a4x_io.S Fri Dec 5 19:00:55 2014 (r275518) +++ head/sys/arm/xscale/ixp425/ixp425_a4x_io.S Fri Dec 5 19:04:08 2014 (r275519) @@ -56,6 +56,7 @@ ENTRY(a4x_bs_r_1) ldr r0, [r1, r2, LSL #2] and r0, r0, #0xff mov pc, lr +END(a4x_bs_r_1) ENTRY(a4x_bs_r_2) ldr r0, [r1, r2, LSL #2] @@ -63,10 +64,12 @@ ENTRY(a4x_bs_r_2) orr r1, r1, r1, lsl #8 and r0, r0, r1 mov pc, lr +END(a4x_bs_r_2) ENTRY(a4x_bs_r_4) ldr r0, [r1, r2, LSL #2] mov pc, lr +END(a4x_bs_r_4) /* * Write single @@ -75,6 +78,7 @@ ENTRY(a4x_bs_w_1) and r3, r3, #0xff str r3, [r1, r2, LSL #2] mov pc, lr +END(a4x_bs_w_1) ENTRY(a4x_bs_w_2) mov r0, #0xff @@ -82,10 +86,12 @@ ENTRY(a4x_bs_w_2) and r3, r3, r0 str r3, [r1, r2, LSL #2] mov pc, lr +END(a4x_bs_w_2) ENTRY(a4x_bs_w_4) str r3, [r1, r2, LSL #2] mov pc, lr +END(a4x_bs_w_4) /* * Read multiple @@ -101,6 +107,7 @@ ENTRY(a4x_bs_rm_1) strb r3, [r1], #1 bne 1b mov pc, lr +END(a4x_bs_rm_1) ENTRY(a4x_bs_rm_2) add r0, r1, r2, lsl #2 @@ -113,6 +120,7 @@ ENTRY(a4x_bs_rm_2) strh r3, [r1], #2 bne 1b mov pc, lr +END(a4x_bs_rm_2) /* * Write multiple @@ -128,6 +136,7 @@ ENTRY(a4x_bs_wm_1) str r3, [r0] bne 1b mov pc, lr +END(a4x_bs_wm_1) ENTRY(a4x_bs_wm_2) add r0, r1, r2, lsl #2 @@ -140,3 +149,4 @@ ENTRY(a4x_bs_wm_2) str r3, [r0] bne 1b mov pc, lr +END(a4x_bs_wm_2) Modified: head/sys/arm/xscale/ixp425/ixp425_pci_asm.S ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425_pci_asm.S Fri Dec 5 19:00:55 2014 (r275518) +++ head/sys/arm/xscale/ixp425/ixp425_pci_asm.S Fri Dec 5 19:04:08 2014 (r275519) @@ -58,6 +58,7 @@ ENTRY(ixp425_pci_mem_bs_r_1) ldrb r0, [r1, r2] #endif /* __ARMEB__ */ mov pc, lr +END(ixp425_pci_mem_bs_r_1) ENTRY(ixp425_pci_mem_bs_r_2) #ifdef __ARMEB__ @@ -68,10 +69,12 @@ ENTRY(ixp425_pci_mem_bs_r_2) ldrh r0, [r1, r2] #endif /* __ARMEB__ */ mov pc, lr +END(ixp425_pci_mem_bs_r_2) ENTRY(ixp425_pci_mem_bs_r_4) ldr r0, [r1, r2] mov pc, lr +END(ixp425_pci_mem_bs_r_4) /* * write single @@ -86,6 +89,7 @@ ENTRY(ixp425_pci_mem_bs_w_1) strb r3, [r1, r2] #endif /* __ARMEB__ */ mov pc, lr +END(ixp425_pci_mem_bs_w_1) ENTRY(ixp425_pci_mem_bs_w_2) #ifdef __ARMEB__ @@ -96,7 +100,9 @@ ENTRY(ixp425_pci_mem_bs_w_2) strh r3, [r1, r2] #endif /* __ARMEB__ */ mov pc, lr +END(ixp425_pci_mem_bs_w_2) ENTRY(ixp425_pci_mem_bs_w_4) str r3, [r1, r2] mov pc, lr +END(ixp425_pci_mem_bs_w_4) From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 19:08:37 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C59F353; Fri, 5 Dec 2014 19:08:37 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FA868F0; Fri, 5 Dec 2014 19:08:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5J8aPV084329; Fri, 5 Dec 2014 19:08:36 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5J8aWF084327; Fri, 5 Dec 2014 19:08:36 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412051908.sB5J8aWF084327@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 5 Dec 2014 19:08:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275520 - in head/sys: arm/arm libkern/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 19:08:37 -0000 Author: andrew Date: Fri Dec 5 19:08:36 2014 New Revision: 275520 URL: https://svnweb.freebsd.org/changeset/base/275520 Log: Use the unified syntax in a few more assembly files MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/fusu.S head/sys/libkern/arm/ffs.S Modified: head/sys/arm/arm/fusu.S ============================================================================== --- head/sys/arm/arm/fusu.S Fri Dec 5 19:04:08 2014 (r275519) +++ head/sys/arm/arm/fusu.S Fri Dec 5 19:08:36 2014 (r275520) @@ -38,6 +38,8 @@ #include "assym.s" __FBSDID("$FreeBSD$"); + .syntax unified + #ifdef _ARM_ARCH_6 #define GET_PCB(tmp) \ mrc p15, 0, tmp, c13, c0, 4; \ @@ -83,7 +85,7 @@ EENTRY_NP(casuword32) ldrt r5, [r0] cmp r5, r1 movne r0, r5 - streqt r2, [r0] + strteq r2, [r0] #endif moveq r0, r1 2: Modified: head/sys/libkern/arm/ffs.S ============================================================================== --- head/sys/libkern/arm/ffs.S Fri Dec 5 19:04:08 2014 (r275519) +++ head/sys/libkern/arm/ffs.S Fri Dec 5 19:08:36 2014 (r275520) @@ -31,6 +31,7 @@ #include __FBSDID("$FreeBSD$"); + .syntax unified /* * ffs - find first set bit, this algorithm isolates the first set @@ -62,7 +63,7 @@ ENTRY(ffs) rsbne r0, r0, r0, lsl #16 /* r0 = X * 0x0450fbaf */ /* now lookup in table indexed on top 6 bits of r0 */ - ldrneb r0, [ r2, r0, lsr #26 ] + ldrbne r0, [ r2, r0, lsr #26 ] RET .text; From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 19:11:26 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72E25505; Fri, 5 Dec 2014 19:11:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FF0C9A4; Fri, 5 Dec 2014 19:11:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5JBQGm088150; Fri, 5 Dec 2014 19:11:26 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5JBQCT088149; Fri, 5 Dec 2014 19:11:26 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412051911.sB5JBQCT088149@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 5 Dec 2014 19:11:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275521 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 19:11:26 -0000 Author: andrew Date: Fri Dec 5 19:11:25 2014 New Revision: 275521 URL: https://svnweb.freebsd.org/changeset/base/275521 Log: Set the alignment to 4-bytes after a string as clang 3.5 can switch to thumb mode if this is incorrect. MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/fusu.S Modified: head/sys/arm/arm/fusu.S ============================================================================== --- head/sys/arm/arm/fusu.S Fri Dec 5 19:08:36 2014 (r275520) +++ head/sys/arm/arm/fusu.S Fri Dec 5 19:11:25 2014 (r275521) @@ -271,7 +271,7 @@ _C_LABEL(fusubailout): fusupcbfaulttext: .asciz "Yikes - no valid PCB during fusuxxx() addr=%08x\n" - .align 0 + .align 2 #endif /* From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 19:14:06 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF00B778; Fri, 5 Dec 2014 19:14:06 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBAD29CB; Fri, 5 Dec 2014 19:14:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5JE6Db088695; Fri, 5 Dec 2014 19:14:06 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5JE6Vo088694; Fri, 5 Dec 2014 19:14:06 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412051914.sB5JE6Vo088694@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 5 Dec 2014 19:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275522 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 19:14:06 -0000 Author: andrew Date: Fri Dec 5 19:14:05 2014 New Revision: 275522 URL: https://svnweb.freebsd.org/changeset/base/275522 Log: Place the literal pool after a RET otherwise clang 3.5 tries to put it too far away from a ldr psuedo instruction. With this clang will place the literal value here where it's close enough to be loaded. MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/support.S Modified: head/sys/arm/arm/support.S ============================================================================== --- head/sys/arm/arm/support.S Fri Dec 5 19:11:25 2014 (r275521) +++ head/sys/arm/arm/support.S Fri Dec 5 19:14:05 2014 (r275522) @@ -1364,6 +1364,8 @@ ENTRY(memcpy) strbge r2, [r3], #0x01 strbgt ip, [r3] RET +/* Place a literal pool here for the above ldr instructions to use */ +.ltorg /* From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 19:19:18 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B89CBAE2; Fri, 5 Dec 2014 19:19:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5662A2D; Fri, 5 Dec 2014 19:19:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5JJIAt089363; Fri, 5 Dec 2014 19:19:18 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5JJIK8089362; Fri, 5 Dec 2014 19:19:18 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412051919.sB5JJIK8089362@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 5 Dec 2014 19:19:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275523 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 19:19:18 -0000 Author: andrew Date: Fri Dec 5 19:19:17 2014 New Revision: 275523 URL: https://svnweb.freebsd.org/changeset/base/275523 Log: Switch to an armv6k cpu, without this clang 3.5 complains "bx lr" is unsupported as it needs a newer cpu. MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/cpufunc_asm_arm11x6.S Modified: head/sys/arm/arm/cpufunc_asm_arm11x6.S ============================================================================== --- head/sys/arm/arm/cpufunc_asm_arm11x6.S Fri Dec 5 19:14:05 2014 (r275522) +++ head/sys/arm/arm/cpufunc_asm_arm11x6.S Fri Dec 5 19:19:17 2014 (r275523) @@ -62,7 +62,7 @@ #include __FBSDID("$FreeBSD$"); - .cpu arm1136js + .cpu arm1176jz-s #if 0 #define Invalidate_I_cache(Rtmp1, Rtmp2) \ From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 19:23:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8CE36CEA; Fri, 5 Dec 2014 19:23:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79A68B01; Fri, 5 Dec 2014 19:23:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5JNq9H093358; Fri, 5 Dec 2014 19:23:52 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5JNqFn093357; Fri, 5 Dec 2014 19:23:52 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412051923.sB5JNqFn093357@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 5 Dec 2014 19:23:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275524 - head/sys/arm/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 19:23:52 -0000 Author: andrew Date: Fri Dec 5 19:23:51 2014 New Revision: 275524 URL: https://svnweb.freebsd.org/changeset/base/275524 Log: Switch to a .cpu directive. These will work when clang 3.5 is imported where the .arch directive is a nop. MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm/ti/ti_smc.S Modified: head/sys/arm/ti/ti_smc.S ============================================================================== --- head/sys/arm/ti/ti_smc.S Fri Dec 5 19:19:17 2014 (r275523) +++ head/sys/arm/ti/ti_smc.S Fri Dec 5 19:23:51 2014 (r275524) @@ -26,7 +26,7 @@ #include __FBSDID("$FreeBSD$"); - .arch armv7a + .cpu cortex-a8 .arch_extension sec /* Issue a smc #0 call */ From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 22:56:11 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7990DA5; Fri, 5 Dec 2014 22:56:11 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65A612F1; Fri, 5 Dec 2014 22:56:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5MuBIv090840; Fri, 5 Dec 2014 22:56:11 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5MuBJI090839; Fri, 5 Dec 2014 22:56:11 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412052256.sB5MuBJI090839@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 5 Dec 2014 22:56:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275530 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 22:56:11 -0000 Author: delphij Date: Fri Dec 5 22:56:10 2014 New Revision: 275530 URL: https://svnweb.freebsd.org/changeset/base/275530 Log: Use %d instead of %u for error number. This way we see ERESTART as -1 not 4294967295 when doing DTrace. MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Fri Dec 5 22:38:21 2014 (r275529) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Fri Dec 5 22:56:10 2014 (r275530) @@ -1483,7 +1483,7 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * } if (scn->scn_visited_this_txg) { zfs_dbgmsg("freed %llu blocks in %llums from " - "free_bpobj/bptree txg %llu; err=%u", + "free_bpobj/bptree txg %llu; err=%d", (longlong_t)scn->scn_visited_this_txg, (longlong_t) NSEC2MSEC(gethrtime() - scn->scn_sync_start_time), From owner-svn-src-head@FreeBSD.ORG Fri Dec 5 23:08:40 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 84690370; Fri, 5 Dec 2014 23:08:40 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 711FD611; Fri, 5 Dec 2014 23:08:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5N8eSp095834; Fri, 5 Dec 2014 23:08:40 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5N8eXe095833; Fri, 5 Dec 2014 23:08:40 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412052308.sB5N8eXe095833@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 5 Dec 2014 23:08:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275531 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 23:08:40 -0000 Author: pfg Date: Fri Dec 5 23:08:39 2014 New Revision: 275531 URL: https://svnweb.freebsd.org/changeset/base/275531 Log: Update OpenBSD CVS revision for our r255232. This is a no-op to make it easier to track changes from OpenBSD MFC after: 3 days Modified: head/usr.bin/patch/pch.c Modified: head/usr.bin/patch/pch.c ============================================================================== --- head/usr.bin/patch/pch.c Fri Dec 5 22:56:10 2014 (r275530) +++ head/usr.bin/patch/pch.c Fri Dec 5 23:08:39 2014 (r275531) @@ -24,7 +24,7 @@ * -C option added in 1998, original code by Marc Espie, based on FreeBSD * behaviour * - * $OpenBSD: pch.c,v 1.39 2012/04/11 08:07:13 ajacoutot Exp $ + * $OpenBSD: pch.c,v 1.40 2013/07/11 12:39:31 otto Exp $ * $FreeBSD$ */ From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 00:13:57 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E5E97C3; Sat, 6 Dec 2014 00:13:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE1A1DA8; Sat, 6 Dec 2014 00:13:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB60DuKY029086; Sat, 6 Dec 2014 00:13:56 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60Dujd029084; Sat, 6 Dec 2014 00:13:56 GMT (envelope-from np@FreeBSD.org) Message-Id: <201412060013.sB60Dujd029084@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 6 Dec 2014 00:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275539 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:13:57 -0000 Author: np Date: Sat Dec 6 00:13:56 2014 New Revision: 275539 URL: https://svnweb.freebsd.org/changeset/base/275539 Log: cxgbe(4): Allow for different pad and pack boundaries for different adapters. Set the pack boundary for T5 cards to be the same as the PCIe max payload size. The chip likes it this way. In this revision the driver allocate rx buffers that align on both boundaries. This is not a strict requirement and a followup commit will switch the driver to a more relaxed allocation strategy. MFC after: 2 weeks Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sat Dec 6 00:12:58 2014 (r275538) +++ head/sys/dev/cxgbe/adapter.h Sat Dec 6 00:13:56 2014 (r275539) @@ -148,7 +148,7 @@ enum { #else SW_ZONE_SIZES = 3, /* cluster, jumbo9k, jumbo16k */ #endif - CL_METADATA_SIZE = CACHE_LINE_SIZE, + CL_METADATA_SIZE = 256, /* same as MSIZE for now */ SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR size in desc */ TX_SGL_SEGS = 36, @@ -695,6 +695,7 @@ struct sge { struct sge_iq **iqmap; /* iq->cntxt_id to iq mapping */ struct sge_eq **eqmap; /* eq->cntxt_id to eq mapping */ + int pad_boundary; int pack_boundary; int8_t safe_hwidx1; /* may not have room for metadata */ int8_t safe_hwidx2; /* with room for metadata and maybe more */ Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sat Dec 6 00:12:58 2014 (r275538) +++ head/sys/dev/cxgbe/t4_sge.c Sat Dec 6 00:13:56 2014 (r275539) @@ -120,19 +120,10 @@ TUNABLE_INT("hw.cxgbe.buffer_packing", & /* * Start next frame in a packed buffer at this boundary. * -1: driver should figure out a good value. - * T4: - * --- - * if fl_pad != 0 - * value specified here will be overridden by fl_pad. - * else - * power of 2 from 32 to 4096 (both inclusive) is a valid value here. - * T5: - * --- - * 16, or a power of 2 from 64 to 4096 (both inclusive) is a valid value. + * T4: driver will ignore this and use the same value as fl_pad above. + * T5: 16, or a power of 2 from 64 to 4096 (both inclusive) is a valid value. */ static int fl_pack = -1; -static int t4_fl_pack; -static int t5_fl_pack; TUNABLE_INT("hw.cxgbe.fl_pack", &fl_pack); /* @@ -175,8 +166,7 @@ static int service_iq(struct sge_iq *, i static struct mbuf *get_fl_payload(struct adapter *, struct sge_fl *, uint32_t); static int t4_eth_rx(struct sge_iq *, const struct rss_header *, struct mbuf *); static inline void init_iq(struct sge_iq *, struct adapter *, int, int, int); -static inline void init_fl(struct adapter *, struct sge_fl *, int, int, int, - char *); +static inline void init_fl(struct adapter *, struct sge_fl *, int, int, char *); static inline void init_eq(struct sge_eq *, int, int, uint8_t, uint16_t, char *); static int alloc_ring(struct adapter *, size_t, bus_dma_tag_t *, bus_dmamap_t *, @@ -264,15 +254,6 @@ static counter_u64_t extfree_rels; void t4_sge_modload(void) { - int pad; - - /* set pad to a reasonable powerof2 between 16 and 4096 (inclusive) */ -#if defined(__i386__) || defined(__amd64__) - pad = max(cpu_clflush_line_size, 16); -#else - pad = max(CACHE_LINE_SIZE, 16); -#endif - pad = min(pad, 4096); if (fl_pktshift < 0 || fl_pktshift > 7) { printf("Invalid hw.cxgbe.fl_pktshift value (%d)," @@ -280,35 +261,6 @@ t4_sge_modload(void) fl_pktshift = 2; } - if (fl_pad != 0 && - (fl_pad < 32 || fl_pad > 4096 || !powerof2(fl_pad))) { - - if (fl_pad != -1) { - printf("Invalid hw.cxgbe.fl_pad value (%d)," - " using %d instead.\n", fl_pad, max(pad, 32)); - } - fl_pad = max(pad, 32); - } - - /* - * T4 has the same pad and pack boundary. If a pad boundary is set, - * pack boundary must be set to the same value. Otherwise take the - * specified value or auto-calculate something reasonable. - */ - if (fl_pad) - t4_fl_pack = fl_pad; - else if (fl_pack < 32 || fl_pack > 4096 || !powerof2(fl_pack)) - t4_fl_pack = max(pad, 32); - else - t4_fl_pack = fl_pack; - - /* T5's pack boundary is independent of the pad boundary. */ - if (fl_pack < 16 || fl_pack == 32 || fl_pack > 4096 || - !powerof2(fl_pack)) - t5_fl_pack = max(pad, CACHE_LINE_SIZE); - else - t5_fl_pack = fl_pack; - if (spg_len != 64 && spg_len != 128) { int len; @@ -366,6 +318,71 @@ t4_init_sge_cpl_handlers(struct adapter t4_register_fw_msg_handler(sc, FW6_TYPE_CMD_RPL, t4_handle_fw_rpl); } +static inline void +setup_pad_and_pack_boundaries(struct adapter *sc) +{ + uint32_t v, m; + int pad, pack; + + pad = fl_pad; + if (fl_pad < 32 || fl_pad > 4096 || !powerof2(fl_pad)) { + /* + * If there is any chance that we might use buffer packing and + * the chip is a T4, then pick 64 as the pad/pack boundary. Set + * it to 32 in all other cases. + */ + pad = is_t4(sc) && buffer_packing ? 64 : 32; + + /* + * For fl_pad = 0 we'll still write a reasonable value to the + * register but all the freelists will opt out of padding. + * We'll complain here only if the user tried to set it to a + * value greater than 0 that was invalid. + */ + if (fl_pad > 0) { + device_printf(sc->dev, "Invalid hw.cxgbe.fl_pad value" + " (%d), using %d instead.\n", fl_pad, pad); + } + } + m = V_INGPADBOUNDARY(M_INGPADBOUNDARY); + v = V_INGPADBOUNDARY(ilog2(pad) - 5); + t4_set_reg_field(sc, A_SGE_CONTROL, m, v); + + if (is_t4(sc)) { + if (fl_pack != -1 && fl_pack != pad) { + /* Complain but carry on. */ + device_printf(sc->dev, "hw.cxgbe.fl_pack (%d) ignored," + " using %d instead.\n", fl_pack, pad); + } + return; + } + + pack = fl_pack; + if (fl_pack < 16 || fl_pack == 32 || fl_pack > 4096 || + !powerof2(fl_pack)) { + pack = max(sc->params.pci.mps, CACHE_LINE_SIZE); + MPASS(powerof2(pack)); + if (pack < 16) + pack = 16; + if (pack == 32) + pack = 64; + if (pack > 4096) + pack = 4096; + if (fl_pack != -1) { + device_printf(sc->dev, "Invalid hw.cxgbe.fl_pack value" + " (%d), using %d instead.\n", fl_pack, pack); + } + } + m = V_INGPACKBOUNDARY(M_INGPACKBOUNDARY); + if (pack == 16) + v = V_INGPACKBOUNDARY(0); + else + v = V_INGPACKBOUNDARY(ilog2(pack) - 5); + + MPASS(!is_t4(sc)); /* T4 doesn't have SGE_CONTROL2 */ + t4_set_reg_field(sc, A_SGE_CONTROL2, m, v); +} + /* * adap->params.vpd.cclk must be set up before this is called. */ @@ -398,24 +415,9 @@ t4_tweak_chip_settings(struct adapter *s m = V_PKTSHIFT(M_PKTSHIFT) | F_RXPKTCPLMODE | F_EGRSTATUSPAGESIZE; v = V_PKTSHIFT(fl_pktshift) | F_RXPKTCPLMODE | V_EGRSTATUSPAGESIZE(spg_len == 128); - if (is_t4(sc) && (fl_pad || buffer_packing)) { - /* t4_fl_pack has the correct value even when fl_pad = 0 */ - m |= V_INGPADBOUNDARY(M_INGPADBOUNDARY); - v |= V_INGPADBOUNDARY(ilog2(t4_fl_pack) - 5); - } else if (is_t5(sc) && fl_pad) { - m |= V_INGPADBOUNDARY(M_INGPADBOUNDARY); - v |= V_INGPADBOUNDARY(ilog2(fl_pad) - 5); - } t4_set_reg_field(sc, A_SGE_CONTROL, m, v); - if (is_t5(sc) && buffer_packing) { - m = V_INGPACKBOUNDARY(M_INGPACKBOUNDARY); - if (t5_fl_pack == 16) - v = V_INGPACKBOUNDARY(0); - else - v = V_INGPACKBOUNDARY(ilog2(t5_fl_pack) - 5); - t4_set_reg_field(sc, A_SGE_CONTROL2, m, v); - } + setup_pad_and_pack_boundaries(sc); v = V_HOSTPAGESIZEPF0(PAGE_SHIFT - 10) | V_HOSTPAGESIZEPF1(PAGE_SHIFT - 10) | @@ -486,15 +488,25 @@ t4_tweak_chip_settings(struct adapter *s } /* - * SGE wants the buffer to be at least 64B and then a multiple of the pad - * boundary or 16, whichever is greater. + * SGE wants the buffer to be at least 64B and then a multiple of 16. If + * padding and packing are enabled, the buffer's start and end need to be + * correctly aligned as well. We'll just make sure that the size is a multiple + * of the alignment, it is up to other parts . */ static inline int -hwsz_ok(int hwsz) +hwsz_ok(struct adapter *sc, int hwsz) { - int mask = max(fl_pad, 16) - 1; + int align = 16; + + if (fl_pad) { + MPASS(sc->sge.pad_boundary > align); + align = sc->sge.pad_boundary; + } + if (buffer_packing && sc->sge.pack_boundary > align) + align = sc->sge.pack_boundary; + align--; /* now a mask */ + return (hwsz >= 64 && (hwsz & align) == 0); - return (hwsz >= 64 && (hwsz & mask) == 0); } /* @@ -521,33 +533,22 @@ t4_read_chip_settings(struct adapter *sc m = V_PKTSHIFT(M_PKTSHIFT) | F_RXPKTCPLMODE | F_EGRSTATUSPAGESIZE; v = V_PKTSHIFT(fl_pktshift) | F_RXPKTCPLMODE | V_EGRSTATUSPAGESIZE(spg_len == 128); - if (is_t4(sc) && (fl_pad || buffer_packing)) { - m |= V_INGPADBOUNDARY(M_INGPADBOUNDARY); - v |= V_INGPADBOUNDARY(ilog2(t4_fl_pack) - 5); - } else if (is_t5(sc) && fl_pad) { - m |= V_INGPADBOUNDARY(M_INGPADBOUNDARY); - v |= V_INGPADBOUNDARY(ilog2(fl_pad) - 5); - } r = t4_read_reg(sc, A_SGE_CONTROL); if ((r & m) != v) { device_printf(sc->dev, "invalid SGE_CONTROL(0x%x)\n", r); rc = EINVAL; } + s->pad_boundary = 1 << (G_INGPADBOUNDARY(r) + 5); - if (is_t5(sc) && buffer_packing) { - m = V_INGPACKBOUNDARY(M_INGPACKBOUNDARY); - if (t5_fl_pack == 16) - v = V_INGPACKBOUNDARY(0); - else - v = V_INGPACKBOUNDARY(ilog2(t5_fl_pack) - 5); + if (is_t4(sc)) + s->pack_boundary = s->pad_boundary; + else { r = t4_read_reg(sc, A_SGE_CONTROL2); - if ((r & m) != v) { - device_printf(sc->dev, - "invalid SGE_CONTROL2(0x%x)\n", r); - rc = EINVAL; - } + if (G_INGPACKBOUNDARY(r) == 0) + s->pack_boundary = 16; + else + s->pack_boundary = 1 << (G_INGPACKBOUNDARY(r) + 5); } - s->pack_boundary = is_t4(sc) ? t4_fl_pack : t5_fl_pack; v = V_HOSTPAGESIZEPF0(PAGE_SHIFT - 10) | V_HOSTPAGESIZEPF1(PAGE_SHIFT - 10) | @@ -568,13 +569,22 @@ t4_read_chip_settings(struct adapter *sc for (i = 0; i < nitems(s->hw_buf_info); i++, hwb++) { r = t4_read_reg(sc, A_SGE_FL_BUFFER_SIZE0 + (4 * i)); hwb->size = r; - hwb->zidx = hwsz_ok(r) ? -1 : -2; + hwb->zidx = hwsz_ok(sc, r) ? -1 : -2; hwb->next = -1; } /* * Create a sorted list in decreasing order of hw buffer sizes (and so * increasing order of spare area) for each software zone. + * + * If padding is enabled then the start and end of the buffer must align + * to the pad boundary; if packing is enabled then they must align with + * the pack boundary as well. Allocations from the cluster zones are + * aligned to min(size, 4K), so the buffer starts at that alignment and + * ends at hwb->size alignment. If mbuf inlining is allowed the + * starting alignment will be reduced to MSIZE and the driver will + * exercise appropriate caution when deciding on the best buffer layout + * to use. */ n = 0; /* no usable buffer size to begin with */ swz = &s->sw_zone_info[0]; @@ -586,6 +596,15 @@ t4_read_chip_settings(struct adapter *sc swz->zone = m_getzone(swz->size); swz->type = m_gettype(swz->size); + if (swz->size < PAGE_SIZE) { + MPASS(powerof2(swz->size)); + if (fl_pad && (swz->size % sc->sge.pad_boundary != 0)) + continue; + if (buffer_packing && + (swz->size % sc->sge.pack_boundary != 0)) + continue; + } + if (swz->size == safest_rx_cluster) safe_swz = swz; @@ -593,6 +612,12 @@ t4_read_chip_settings(struct adapter *sc for (j = 0; j < SGE_FLBUF_SIZES; j++, hwb++) { if (hwb->zidx != -1 || hwb->size > swz->size) continue; +#ifdef INVARIANTS + if (fl_pad) + MPASS(hwb->size % sc->sge.pad_boundary == 0); + if (buffer_packing) + MPASS(hwb->size % sc->sge.pack_boundary == 0); +#endif hwb->zidx = i; if (head == -1) head = tail = j; @@ -640,14 +665,17 @@ t4_read_chip_settings(struct adapter *sc int spare; hwb = &s->hw_buf_info[i]; +#ifdef INVARIANTS + if (fl_pad) + MPASS(hwb->size % sc->sge.pad_boundary == 0); + if (buffer_packing) + MPASS(hwb->size % sc->sge.pack_boundary == 0); +#endif spare = safe_swz->size - hwb->size; - if (spare < CL_METADATA_SIZE) - continue; - if (s->safe_hwidx2 == -1 || - spare == CL_METADATA_SIZE + MSIZE) + if (spare >= CL_METADATA_SIZE) { s->safe_hwidx2 = i; - if (spare >= CL_METADATA_SIZE + MSIZE) break; + } } } @@ -745,17 +773,6 @@ t4_create_dma_tag(struct adapter *sc) return (rc); } -static inline int -enable_buffer_packing(struct adapter *sc) -{ - - if (sc->flags & BUF_PACKING_OK && - ((is_t5(sc) && buffer_packing) || /* 1 or -1 both ok for T5 */ - (is_t4(sc) && buffer_packing == 1))) - return (1); - return (0); -} - void t4_sge_sysctls(struct adapter *sc, struct sysctl_ctx_list *ctx, struct sysctl_oid_list *children) @@ -769,7 +786,7 @@ t4_sge_sysctls(struct adapter *sc, struc NULL, fl_pktshift, "payload DMA offset in rx buffer (bytes)"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "fl_pad", CTLFLAG_RD, - NULL, fl_pad, "payload pad boundary (bytes)"); + NULL, sc->sge.pad_boundary, "payload pad boundary (bytes)"); SYSCTL_ADD_INT(ctx, children, OID_AUTO, "spg_len", CTLFLAG_RD, NULL, spg_len, "status page size (bytes)"); @@ -777,10 +794,6 @@ t4_sge_sysctls(struct adapter *sc, struc SYSCTL_ADD_INT(ctx, children, OID_AUTO, "cong_drop", CTLFLAG_RD, NULL, cong_drop, "congestion drop setting"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "buffer_packing", CTLFLAG_RD, - NULL, enable_buffer_packing(sc), - "pack multiple frames in one fl buffer"); - SYSCTL_ADD_INT(ctx, children, OID_AUTO, "fl_pack", CTLFLAG_RD, NULL, sc->sge.pack_boundary, "payload pack boundary (bytes)"); } @@ -958,7 +971,6 @@ mtu_to_max_payload(struct adapter *sc, i #ifdef TCP_OFFLOAD } #endif - payload = roundup2(payload, fl_pad); return (payload); } @@ -983,7 +995,7 @@ t4_setup_port_queues(struct port_info *p struct ifnet *ifp = pi->ifp; struct sysctl_oid *oid = device_get_sysctl_tree(pi->dev); struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid); - int maxp, pack, mtu = ifp->if_mtu; + int maxp, mtu = ifp->if_mtu; /* Interrupt vector to start from (when using multiple vectors) */ intr_idx = first_vector(pi); @@ -994,7 +1006,6 @@ t4_setup_port_queues(struct port_info *p * b) allocate queue iff it will take direct interrupts. */ maxp = mtu_to_max_payload(sc, mtu, 0); - pack = enable_buffer_packing(sc); if (pi->flags & INTR_RXQ) { oid = SYSCTL_ADD_NODE(&pi->ctx, children, OID_AUTO, "rxq", CTLFLAG_RD, NULL, "rx queues"); @@ -1005,7 +1016,7 @@ t4_setup_port_queues(struct port_info *p snprintf(name, sizeof(name), "%s rxq%d-fl", device_get_nameunit(pi->dev), i); - init_fl(sc, &rxq->fl, pi->qsize_rxq / 8, maxp, pack, name); + init_fl(sc, &rxq->fl, pi->qsize_rxq / 8, maxp, name); if (pi->flags & INTR_RXQ) { rxq->iq.flags |= IQ_INTR; @@ -1029,7 +1040,7 @@ t4_setup_port_queues(struct port_info *p snprintf(name, sizeof(name), "%s ofld_rxq%d-fl", device_get_nameunit(pi->dev), i); - init_fl(sc, &ofld_rxq->fl, pi->qsize_rxq / 8, maxp, pack, name); + init_fl(sc, &ofld_rxq->fl, pi->qsize_rxq / 8, maxp, name); if (pi->flags & INTR_OFLD_RXQ) { ofld_rxq->iq.flags |= IQ_INTR; @@ -1572,8 +1583,14 @@ get_scatter_segment(struct adapter *sc, caddr_t payload; len = min(total, hwb->size - fl->rx_offset); - padded_len = roundup2(len, fl->buf_boundary); payload = sd->cl + cll->region1 + fl->rx_offset; + if (fl->flags & FL_BUF_PACKING) { + padded_len = roundup2(len, fl->buf_boundary); + MPASS(fl->rx_offset + padded_len <= hwb->size); + } else { + padded_len = hwb->size; + MPASS(fl->rx_offset == 0); /* not packing */ + } if (sc->sc_do_rxcopy && len < RX_COPY_THRESHOLD) { @@ -2121,14 +2138,15 @@ init_iq(struct sge_iq *iq, struct adapte } static inline void -init_fl(struct adapter *sc, struct sge_fl *fl, int qsize, int maxp, int pack, - char *name) +init_fl(struct adapter *sc, struct sge_fl *fl, int qsize, int maxp, char *name) { fl->qsize = qsize; fl->sidx = qsize - spg_len / EQ_ESIZE; strlcpy(fl->lockname, name, sizeof(fl->lockname)); - if (pack) + if (sc->flags & BUF_PACKING_OK && + ((!is_t4(sc) && buffer_packing) || /* T5+: enabled unless 0 */ + (is_t4(sc) && buffer_packing == 1)))/* T4: disabled unless 1 */ fl->flags |= FL_BUF_PACKING; find_best_refill_source(sc, fl, maxp); find_safe_refill_source(sc, fl); @@ -2277,11 +2295,13 @@ alloc_iq_fl(struct port_info *pi, struct if (fl->flags & FL_BUF_PACKING) { fl->lowat = roundup2(sc->sge.fl_starve_threshold2, 8); - fl->buf_boundary = max(fl_pad, sc->sge.pack_boundary); + fl->buf_boundary = sc->sge.pack_boundary; } else { fl->lowat = roundup2(sc->sge.fl_starve_threshold, 8); - fl->buf_boundary = fl_pad; + fl->buf_boundary = 16; } + if (fl_pad && fl->buf_boundary < sc->sge.pad_boundary) + fl->buf_boundary = sc->sge.pad_boundary; c.iqns_to_fl0congen |= htobe32(V_FW_IQ_CMD_FL0HOSTFCMODE(X_HOSTFCMODE_NONE) | @@ -2452,6 +2472,10 @@ add_fl_sysctls(struct sysctl_ctx_list *c SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "cntxt_id", CTLTYPE_INT | CTLFLAG_RD, &fl->cntxt_id, 0, sysctl_uint16, "I", "SGE context id of the freelist"); + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "padding", CTLFLAG_RD, NULL, + fl_pad ? 1 : 0, "padding enabled"); + SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "packing", CTLFLAG_RD, NULL, + fl->flags & FL_BUF_PACKING ? 1 : 0, "packing enabled"); SYSCTL_ADD_UINT(ctx, children, OID_AUTO, "cidx", CTLFLAG_RD, &fl->cidx, 0, "consumer index"); if (fl->flags & FL_BUF_PACKING) { @@ -4367,6 +4391,17 @@ done: if (allow_mbufs_in_cluster == 0 || hwb->size < maxp) break; + + /* + * Do not inline mbufs if doing so would violate the pad/pack + * boundary alignment requirement. + */ + if (fl_pad && (MSIZE % sc->sge.pad_boundary) != 0) + continue; + if (fl->flags & FL_BUF_PACKING && + (MSIZE % sc->sge.pack_boundary) != 0) + continue; + if (spare < CL_METADATA_SIZE + MSIZE) continue; n = (spare - CL_METADATA_SIZE) / MSIZE; @@ -4449,7 +4484,9 @@ find_safe_refill_source(struct adapter * spare = swz->size - hwb->size; fl->cll_alt.hwidx = hwidx; fl->cll_alt.zidx = hwb->zidx; - if (allow_mbufs_in_cluster) + if (allow_mbufs_in_cluster && + (fl_pad == 0 || (MSIZE % sc->sge.pad_boundary) == 0) && + (!(fl->flags & FL_BUF_PACKING) || (MSIZE % sc->sge.pack_boundary) == 0)) fl->cll_alt.region1 = ((spare - CL_METADATA_SIZE) / MSIZE) * MSIZE; else fl->cll_alt.region1 = 0; From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 01:01:53 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 001BDB8; Sat, 6 Dec 2014 01:01:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D5AD12EC; Sat, 6 Dec 2014 01:01:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB611qX5052639; Sat, 6 Dec 2014 01:01:52 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB611qFF052571; Sat, 6 Dec 2014 01:01:52 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060101.sB611qFF052571@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 6 Dec 2014 01:01:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275552 - in head/cddl: contrib/opensolaris/lib/libnvpair lib/libnvpair X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 01:01:53 -0000 Author: delphij Date: Sat Dec 6 01:01:51 2014 New Revision: 275552 URL: https://svnweb.freebsd.org/changeset/base/275552 Log: MFV r260710 + 275532: Add a new method, nvlist_print_json to allow libnvpair to emit JSON. MFC after: 1 month Added: head/cddl/contrib/opensolaris/lib/libnvpair/nvpair_json.c - copied, changed from r260710, vendor/illumos/dist/lib/libnvpair/nvpair_json.c Modified: head/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.h head/cddl/lib/libnvpair/Makefile Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.h ============================================================================== --- head/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.h Sat Dec 6 00:50:57 2014 (r275551) +++ head/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.h Sat Dec 6 01:01:51 2014 (r275552) @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #ifndef _LIBNVPAIR_H @@ -46,6 +47,7 @@ extern int nvpair_value_match_regex(nvpa char **); extern void nvlist_print(FILE *, nvlist_t *); +extern int nvlist_print_json(FILE *, nvlist_t *); extern void dump_nvlist(nvlist_t *, int); /* Copied and modified: head/cddl/contrib/opensolaris/lib/libnvpair/nvpair_json.c (from r260710, vendor/illumos/dist/lib/libnvpair/nvpair_json.c) ============================================================================== --- vendor/illumos/dist/lib/libnvpair/nvpair_json.c Thu Jan 16 13:12:06 2014 (r260710, copy source) +++ head/cddl/contrib/opensolaris/lib/libnvpair/nvpair_json.c Sat Dec 6 01:01:51 2014 (r275552) @@ -9,7 +9,7 @@ * http://www.illumos.org/license/CDDL. */ /* - * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2014, Joyent, Inc. */ #include @@ -20,9 +20,11 @@ #include "libnvpair.h" -#define FPRINTF(fp, ...) \ - if (fprintf(fp, __VA_ARGS__) < 0) \ - return (-1) \ +#define FPRINTF(fp, ...) \ + do { \ + if (fprintf(fp, __VA_ARGS__) < 0) \ + return (-1); \ + } while (0) /* * When formatting a string for JSON output we must escape certain characters, @@ -300,7 +302,7 @@ nvlist_print_json(FILE *fp, nvlist_t *nv for (i = 0; i < valsz; i++) { if (i > 0) FPRINTF(fp, ","); - FPRINTF(fp, "%hd", val[i]); + FPRINTF(fp, "%hhd", val[i]); } FPRINTF(fp, "]"); break; @@ -328,7 +330,7 @@ nvlist_print_json(FILE *fp, nvlist_t *nv for (i = 0; i < valsz; i++) { if (i > 0) FPRINTF(fp, ","); - FPRINTF(fp, "%hhd", val[i]); + FPRINTF(fp, "%hd", val[i]); } FPRINTF(fp, "]"); break; Modified: head/cddl/lib/libnvpair/Makefile ============================================================================== --- head/cddl/lib/libnvpair/Makefile Sat Dec 6 00:50:57 2014 (r275551) +++ head/cddl/lib/libnvpair/Makefile Sat Dec 6 01:01:51 2014 (r275552) @@ -9,6 +9,7 @@ SRCS= libnvpair.c \ nvpair_alloc_system.c \ nvpair_alloc_fixed.c \ nvpair.c \ + nvpair_json.c \ fnvpair.c WARNS?= 0 From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 01:21:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0486B48D; Sat, 6 Dec 2014 01:21:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E440A6DC; Sat, 6 Dec 2014 01:21:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB61LCvL061685; Sat, 6 Dec 2014 01:21:12 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB61LC9C061684; Sat, 6 Dec 2014 01:21:12 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201412060121.sB61LC9C061684@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 6 Dec 2014 01:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275553 - head/usr.bin/patch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 01:21:13 -0000 Author: pfg Date: Sat Dec 6 01:21:12 2014 New Revision: 275553 URL: https://svnweb.freebsd.org/changeset/base/275553 Log: Merge fixes from OpenBSD. Check fstat return value. Also, use off_t for file size and offsets. Avoid iterating over end of string. Obtained from: OpenBSD (CVS rev. 1.41, 1.43) MFC after: 1 week Modified: head/usr.bin/patch/pch.c Modified: head/usr.bin/patch/pch.c ============================================================================== --- head/usr.bin/patch/pch.c Sat Dec 6 01:01:51 2014 (r275552) +++ head/usr.bin/patch/pch.c Sat Dec 6 01:21:12 2014 (r275553) @@ -46,7 +46,7 @@ /* Patch (diff listing) abstract type. */ -static long p_filesize; /* size of the patch file */ +static off_t p_filesize; /* size of the patch file */ static LINENUM p_first; /* 1st line number */ static LINENUM p_newfirst; /* 1st line number of replacement */ static LINENUM p_ptrn_lines; /* # lines in pattern */ @@ -60,9 +60,9 @@ static unsigned short *p_len = NULL; /* static char *p_char = NULL; /* +, -, and ! */ static int hunkmax = INITHUNKMAX; /* size of above arrays to begin with */ static int p_indent; /* indent to patch */ -static LINENUM p_base; /* where to intuit this time */ +static off_t p_base; /* where to intuit this time */ static LINENUM p_bline; /* line # of p_base */ -static LINENUM p_start; /* where intuit found a patch */ +static off_t p_start; /* where intuit found a patch */ static LINENUM p_sline; /* and the line number for it */ static LINENUM p_hunk_beg; /* line number of current hunk */ static LINENUM p_efake = -1; /* end of faked up lines--don't free */ @@ -72,8 +72,8 @@ static char *bestguess = NULL; /* guess static void grow_hunkmax(void); static int intuit_diff_type(void); -static void next_intuit_at(LINENUM, LINENUM); -static void skip_to(LINENUM, LINENUM); +static void next_intuit_at(off_t, LINENUM); +static void skip_to(off_t, LINENUM); static size_t pgets(bool _do_indent); static char *best_name(const struct file_name *, bool); static char *posix_name(const struct file_name *, bool); @@ -119,9 +119,10 @@ open_patch_file(const char *filename) pfp = fopen(filename, "r"); if (pfp == NULL) pfatal("patch file %s not found", filename); - fstat(fileno(pfp), &filestat); + if (fstat(fileno(pfp), &filestat)) + pfatal("can't stat %s", filename); p_filesize = filestat.st_size; - next_intuit_at(0L, 1L); /* start at the beginning */ + next_intuit_at(0, 1L); /* start at the beginning */ set_hunkmax(); } @@ -172,7 +173,7 @@ there_is_another_patch(void) { bool exists = false; - if (p_base != 0L && p_base >= p_filesize) { + if (p_base != 0 && p_base >= p_filesize) { if (verbose) say("done\n"); return false; @@ -181,7 +182,7 @@ there_is_another_patch(void) say("Hmm..."); diff_type = intuit_diff_type(); if (!diff_type) { - if (p_base != 0L) { + if (p_base != 0) { if (verbose) say(" Ignoring the trailing garbage.\ndone\n"); } else @@ -190,7 +191,7 @@ there_is_another_patch(void) } if (verbose) say(" %sooks like %s to me...\n", - (p_base == 0L ? "L" : "The next patch l"), + (p_base == 0 ? "L" : "The next patch l"), diff_type == UNI_DIFF ? "a unified diff" : diff_type == CONTEXT_DIFF ? "a context diff" : diff_type == NEW_CONTEXT_DIFF ? "a new-style context diff" : @@ -252,8 +253,8 @@ p4_fetchname(struct file_name *name, cha static int intuit_diff_type(void) { - long this_line = 0, previous_line; - long first_command_line = -1; + off_t this_line = 0, previous_line; + off_t first_command_line = -1; LINENUM fcl_line = -1; bool last_line_was_command = false, this_is_a_command = false; bool stars_last_line = false, stars_this_line = false; @@ -263,17 +264,17 @@ intuit_diff_type(void) memset(names, 0, sizeof(names)); ok_to_create_file = false; - fseek(pfp, p_base, SEEK_SET); + fseeko(pfp, p_base, SEEK_SET); p_input_line = p_bline - 1; for (;;) { previous_line = this_line; last_line_was_command = this_is_a_command; stars_last_line = stars_this_line; - this_line = ftell(pfp); + this_line = ftello(pfp); indent = 0; p_input_line++; if (pgets(false) == 0) { - if (first_command_line >= 0L) { + if (first_command_line >= 0) { /* nothing but deletes!? */ p_start = first_command_line; p_sline = fcl_line; @@ -296,7 +297,7 @@ intuit_diff_type(void) ; this_is_a_command = (isdigit((unsigned char)*s) && (*t == 'd' || *t == 'c' || *t == 'a')); - if (first_command_line < 0L && this_is_a_command) { + if (first_command_line < 0 && this_is_a_command) { first_command_line = this_line; fcl_line = p_input_line; p_indent = indent; /* assume this for now */ @@ -332,7 +333,7 @@ intuit_diff_type(void) p4_fetchname(&names[OLD_FILE], s + 5); } if ((!diff_type || diff_type == ED_DIFF) && - first_command_line >= 0L && + first_command_line >= 0 && strEQ(s, ".\n")) { p_indent = indent; p_start = first_command_line; @@ -356,9 +357,9 @@ intuit_diff_type(void) ok_to_create_file = true; /* * If this is a new context diff the character just - * before the newline is a '*'. + * at the end of the line is a '*'. */ - while (*s != '\n') + while (*s && *s != '\n') s++; p_indent = indent; p_start = previous_line; @@ -422,26 +423,27 @@ scan_exit: * Remember where this patch ends so we know where to start up again. */ static void -next_intuit_at(LINENUM file_pos, LINENUM file_line) +next_intuit_at(off_t file_pos, LINENUM file_line) { p_base = file_pos; p_bline = file_line; } /* - * Basically a verbose fseek() to the actual diff listing. + * Basically a verbose fseeko() to the actual diff listing. */ static void -skip_to(LINENUM file_pos, LINENUM file_line) +skip_to(off_t file_pos, LINENUM file_line) { size_t len; if (p_base > file_pos) - fatal("Internal error: seek %ld>%ld\n", p_base, file_pos); + fatal("Internal error: seek %lld>%lld\n", + (long long)p_base, (long long)file_pos); if (verbose && p_base < file_pos) { - fseek(pfp, p_base, SEEK_SET); + fseeko(pfp, p_base, SEEK_SET); say("The text leading up to this was:\n--------------------------\n"); - while (ftell(pfp) < file_pos) { + while (ftello(pfp) < file_pos) { len = pgets(false); if (len == 0) fatal("Unexpected end of file\n"); @@ -449,7 +451,7 @@ skip_to(LINENUM file_pos, LINENUM file_l } say("--------------------------\n"); } else - fseek(pfp, file_pos, SEEK_SET); + fseeko(pfp, file_pos, SEEK_SET); p_input_line = file_line - 1; } @@ -479,7 +481,7 @@ remove_special_line(void) return true; } if (c != EOF) - fseek(pfp, -1L, SEEK_CUR); + fseeko(pfp, -1, SEEK_CUR); return false; } @@ -490,7 +492,7 @@ remove_special_line(void) bool another_hunk(void) { - long line_beginning; /* file pos of the current line */ + off_t line_beginning; /* file pos of the current line */ LINENUM repl_beginning; /* index of --- line */ LINENUM fillcnt; /* #lines of missing ptrn or repl */ LINENUM fillsrc; /* index of first line to copy */ @@ -498,7 +500,7 @@ another_hunk(void) bool ptrn_spaces_eaten; /* ptrn was slightly misformed */ bool repl_could_be_missing; /* no + or ! lines in this hunk */ bool repl_missing; /* we are now backtracking */ - long repl_backtrack_position; /* file pos of first repl line */ + off_t repl_backtrack_position; /* file pos of first repl line */ LINENUM repl_patch_line; /* input line number for same */ LINENUM ptrn_copiable; /* # of copiable lines in ptrn */ char *s; @@ -516,7 +518,7 @@ another_hunk(void) p_max = hunkmax; /* gets reduced when --- found */ if (diff_type == CONTEXT_DIFF || diff_type == NEW_CONTEXT_DIFF) { - line_beginning = ftell(pfp); + line_beginning = ftello(pfp); repl_beginning = 0; fillcnt = 0; fillsrc = 0; @@ -537,7 +539,7 @@ another_hunk(void) p_context = 100; p_hunk_beg = p_input_line + 1; while (p_end < p_max) { - line_beginning = ftell(pfp); + line_beginning = ftello(pfp); len = pgets(true); p_input_line++; if (len == 0) { @@ -644,7 +646,7 @@ another_hunk(void) } } repl_beginning = p_end; - repl_backtrack_position = ftell(pfp); + repl_backtrack_position = ftello(pfp); repl_patch_line = p_input_line; p_line[p_end] = savestr(buf); if (out_of_mem) { @@ -776,7 +778,7 @@ hunk_done: p_input_line = repl_patch_line; for (p_end--; p_end > repl_beginning; p_end--) free(p_line[p_end]); - fseek(pfp, repl_backtrack_position, SEEK_SET); + fseeko(pfp, repl_backtrack_position, SEEK_SET); /* redundant 'new' context lines were omitted - set */ /* up to fill them in from the old file context */ @@ -854,7 +856,7 @@ hunk_done: LINENUM fillnew; /* index of new lines */ char ch; - line_beginning = ftell(pfp); /* file pos of the current line */ + line_beginning = ftello(pfp); /* file pos of the current line */ len = pgets(true); p_input_line++; if (len == 0 || strnNE(buf, "@@ -", 4)) { @@ -918,7 +920,7 @@ hunk_done: context = 0; p_hunk_beg = p_input_line + 1; while (fillold <= p_ptrn_lines || fillnew <= p_end) { - line_beginning = ftell(pfp); + line_beginning = ftello(pfp); len = pgets(true); p_input_line++; if (len == 0) { @@ -1021,7 +1023,7 @@ hunk_done: int i; LINENUM min, max; - line_beginning = ftell(pfp); + line_beginning = ftello(pfp); p_context = 0; len = pgets(true); p_input_line++; @@ -1398,7 +1400,7 @@ void do_ed_script(void) { char *t; - long beginning_of_this_line; + off_t beginning_of_this_line; FILE *pipefp = NULL; if (!skip_rest_of_patch) { @@ -1411,7 +1413,7 @@ do_ed_script(void) pipefp = popen(buf, "w"); } for (;;) { - beginning_of_this_line = ftell(pfp); + beginning_of_this_line = ftello(pfp); if (pgets(true) == 0) { next_intuit_at(beginning_of_this_line, p_input_line); break; From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 01:47:39 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 566D67F9; Sat, 6 Dec 2014 01:47:39 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3567692C; Sat, 6 Dec 2014 01:47:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB61ldEa072163; Sat, 6 Dec 2014 01:47:39 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB61lc8w072161; Sat, 6 Dec 2014 01:47:38 GMT (envelope-from np@FreeBSD.org) Message-Id: <201412060147.sB61lc8w072161@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 6 Dec 2014 01:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275554 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 01:47:39 -0000 Author: np Date: Sat Dec 6 01:47:38 2014 New Revision: 275554 URL: https://svnweb.freebsd.org/changeset/base/275554 Log: cxgbe(4): allow the driver to use rx buffers that do not end on a pack boundary. MFC after: 2 weeks Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Sat Dec 6 01:21:12 2014 (r275553) +++ head/sys/dev/cxgbe/adapter.h Sat Dec 6 01:47:38 2014 (r275554) @@ -148,7 +148,7 @@ enum { #else SW_ZONE_SIZES = 3, /* cluster, jumbo9k, jumbo16k */ #endif - CL_METADATA_SIZE = 256, /* same as MSIZE for now */ + CL_METADATA_SIZE = CACHE_LINE_SIZE, SGE_MAX_WR_NDESC = SGE_MAX_WR_LEN / EQ_ESIZE, /* max WR size in desc */ TX_SGL_SEGS = 36, Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Sat Dec 6 01:21:12 2014 (r275553) +++ head/sys/dev/cxgbe/t4_sge.c Sat Dec 6 01:47:38 2014 (r275554) @@ -489,24 +489,17 @@ t4_tweak_chip_settings(struct adapter *s /* * SGE wants the buffer to be at least 64B and then a multiple of 16. If - * padding and packing are enabled, the buffer's start and end need to be - * correctly aligned as well. We'll just make sure that the size is a multiple - * of the alignment, it is up to other parts . + * padding is is use the buffer's start and end need to be aligned to the pad + * boundary as well. We'll just make sure that the size is a multiple of the + * boundary here, it is up to the buffer allocation code to make sure the start + * of the buffer is aligned as well. */ static inline int hwsz_ok(struct adapter *sc, int hwsz) { - int align = 16; - - if (fl_pad) { - MPASS(sc->sge.pad_boundary > align); - align = sc->sge.pad_boundary; - } - if (buffer_packing && sc->sge.pack_boundary > align) - align = sc->sge.pack_boundary; - align--; /* now a mask */ - return (hwsz >= 64 && (hwsz & align) == 0); + int mask = fl_pad ? sc->sge.pad_boundary - 1 : 16 - 1; + return (hwsz >= 64 && (hwsz & mask) == 0); } /* @@ -600,9 +593,6 @@ t4_read_chip_settings(struct adapter *sc MPASS(powerof2(swz->size)); if (fl_pad && (swz->size % sc->sge.pad_boundary != 0)) continue; - if (buffer_packing && - (swz->size % sc->sge.pack_boundary != 0)) - continue; } if (swz->size == safest_rx_cluster) @@ -615,8 +605,6 @@ t4_read_chip_settings(struct adapter *sc #ifdef INVARIANTS if (fl_pad) MPASS(hwb->size % sc->sge.pad_boundary == 0); - if (buffer_packing) - MPASS(hwb->size % sc->sge.pack_boundary == 0); #endif hwb->zidx = i; if (head == -1) @@ -668,8 +656,6 @@ t4_read_chip_settings(struct adapter *sc #ifdef INVARIANTS if (fl_pad) MPASS(hwb->size % sc->sge.pad_boundary == 0); - if (buffer_packing) - MPASS(hwb->size % sc->sge.pack_boundary == 0); #endif spare = safe_swz->size - hwb->size; if (spare >= CL_METADATA_SIZE) { @@ -1571,7 +1557,8 @@ rxb_free(struct mbuf *m, void *arg1, voi * d) m_extaddref (cluster with metadata) zone_mbuf */ static struct mbuf * -get_scatter_segment(struct adapter *sc, struct sge_fl *fl, int total, int flags) +get_scatter_segment(struct adapter *sc, struct sge_fl *fl, int fr_offset, + int remaining) { struct mbuf *m; struct fl_sdesc *sd = &fl->sdesc[fl->cidx]; @@ -1579,26 +1566,31 @@ get_scatter_segment(struct adapter *sc, struct sw_zone_info *swz = &sc->sge.sw_zone_info[cll->zidx]; struct hw_buf_info *hwb = &sc->sge.hw_buf_info[cll->hwidx]; struct cluster_metadata *clm = cl_metadata(sc, fl, cll, sd->cl); - int len, padded_len; + int len, blen; caddr_t payload; - len = min(total, hwb->size - fl->rx_offset); + blen = hwb->size - fl->rx_offset; /* max possible in this buf */ + len = min(remaining, blen); payload = sd->cl + cll->region1 + fl->rx_offset; if (fl->flags & FL_BUF_PACKING) { - padded_len = roundup2(len, fl->buf_boundary); - MPASS(fl->rx_offset + padded_len <= hwb->size); + const u_int l = fr_offset + len; + const u_int pad = roundup2(l, fl->buf_boundary) - l; + + if (fl->rx_offset + len + pad < hwb->size) + blen = len + pad; + MPASS(fl->rx_offset + blen <= hwb->size); } else { - padded_len = hwb->size; MPASS(fl->rx_offset == 0); /* not packing */ } + if (sc->sc_do_rxcopy && len < RX_COPY_THRESHOLD) { /* * Copy payload into a freshly allocated mbuf. */ - m = flags & M_PKTHDR ? + m = fr_offset == 0 ? m_gethdr(M_NOWAIT, MT_DATA) : m_get(M_NOWAIT, MT_DATA); if (m == NULL) return (NULL); @@ -1620,10 +1612,11 @@ get_scatter_segment(struct adapter *sc, MPASS(clm != NULL); m = (struct mbuf *)(sd->cl + sd->nmbuf * MSIZE); /* No bzero required */ - if (m_init(m, NULL, 0, M_NOWAIT, MT_DATA, flags | M_NOFREE)) + if (m_init(m, NULL, 0, M_NOWAIT, MT_DATA, + fr_offset == 0 ? M_PKTHDR | M_NOFREE : M_NOFREE)) return (NULL); fl->mbuf_inlined++; - m_extaddref(m, payload, padded_len, &clm->refcount, rxb_free, + m_extaddref(m, payload, blen, &clm->refcount, rxb_free, swz->zone, sd->cl); if (sd->nmbuf++ == 0) counter_u64_add(extfree_refs, 1); @@ -1635,13 +1628,13 @@ get_scatter_segment(struct adapter *sc, * payload in the cluster. */ - m = flags & M_PKTHDR ? + m = fr_offset == 0 ? m_gethdr(M_NOWAIT, MT_DATA) : m_get(M_NOWAIT, MT_DATA); if (m == NULL) return (NULL); fl->mbuf_allocated++; if (clm != NULL) { - m_extaddref(m, payload, padded_len, &clm->refcount, + m_extaddref(m, payload, blen, &clm->refcount, rxb_free, swz->zone, sd->cl); if (sd->nmbuf++ == 0) counter_u64_add(extfree_refs, 1); @@ -1650,12 +1643,12 @@ get_scatter_segment(struct adapter *sc, sd->cl = NULL; /* consumed, not a recycle candidate */ } } - if (flags & M_PKTHDR) - m->m_pkthdr.len = total; + if (fr_offset == 0) + m->m_pkthdr.len = remaining; m->m_len = len; if (fl->flags & FL_BUF_PACKING) { - fl->rx_offset += padded_len; + fl->rx_offset += blen; MPASS(fl->rx_offset <= hwb->size); if (fl->rx_offset < hwb->size) return (m); /* without advancing the cidx */ @@ -1677,17 +1670,17 @@ static struct mbuf * get_fl_payload(struct adapter *sc, struct sge_fl *fl, uint32_t len_newbuf) { struct mbuf *m0, *m, **pnext; - u_int len; + u_int remaining; + const u_int total = G_RSPD_LEN(len_newbuf); - len = G_RSPD_LEN(len_newbuf); if (__predict_false(fl->flags & FL_BUF_RESUME)) { M_ASSERTPKTHDR(fl->m0); - MPASS(len == fl->m0->m_pkthdr.len); - MPASS(fl->remaining < len); + MPASS(fl->m0->m_pkthdr.len == total); + MPASS(fl->remaining < total); m0 = fl->m0; pnext = fl->pnext; - len = fl->remaining; + remaining = fl->remaining; fl->flags &= ~FL_BUF_RESUME; goto get_segment; } @@ -1708,25 +1701,25 @@ get_fl_payload(struct adapter *sc, struc * 'len' and it may span multiple hw buffers. */ - m0 = get_scatter_segment(sc, fl, len, M_PKTHDR); + m0 = get_scatter_segment(sc, fl, 0, total); if (m0 == NULL) return (NULL); - len -= m0->m_len; + remaining = total - m0->m_len; pnext = &m0->m_next; - while (len > 0) { + while (remaining > 0) { get_segment: MPASS(fl->rx_offset == 0); - m = get_scatter_segment(sc, fl, len, 0); + m = get_scatter_segment(sc, fl, total - remaining, remaining); if (__predict_false(m == NULL)) { fl->m0 = m0; fl->pnext = pnext; - fl->remaining = len; + fl->remaining = remaining; fl->flags |= FL_BUF_RESUME; return (NULL); } *pnext = m; pnext = &m->m_next; - len -= m->m_len; + remaining -= m->m_len; } *pnext = NULL; @@ -4485,8 +4478,7 @@ find_safe_refill_source(struct adapter * fl->cll_alt.hwidx = hwidx; fl->cll_alt.zidx = hwb->zidx; if (allow_mbufs_in_cluster && - (fl_pad == 0 || (MSIZE % sc->sge.pad_boundary) == 0) && - (!(fl->flags & FL_BUF_PACKING) || (MSIZE % sc->sge.pack_boundary) == 0)) + (fl_pad == 0 || (MSIZE % sc->sge.pad_boundary) == 0)) fl->cll_alt.region1 = ((spare - CL_METADATA_SIZE) / MSIZE) * MSIZE; else fl->cll_alt.region1 = 0; From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 03:00:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 79C8B1A5; Sat, 6 Dec 2014 03:00:00 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 66602F5F; Sat, 6 Dec 2014 03:00:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB6300IJ004531; Sat, 6 Dec 2014 03:00:00 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB630009004530; Sat, 6 Dec 2014 03:00:00 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201412060300.sB630009004530@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Sat, 6 Dec 2014 03:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275555 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 03:00:00 -0000 Author: rodrigc Date: Sat Dec 6 02:59:59 2014 New Revision: 275555 URL: https://svnweb.freebsd.org/changeset/base/275555 Log: MFp4: @181627 Allow UMA allocated memory to be freed when VNET jails are torn down. Differential Revision: D1201 Submitted by: bz Reviewed by: rwatson, gnn Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Sat Dec 6 01:47:38 2014 (r275554) +++ head/sys/netinet/udp_usrreq.c Sat Dec 6 02:59:59 2014 (r275555) @@ -216,10 +216,10 @@ udp_init(void) * a 4-tuple, flip this to 4-tuple. */ in_pcbinfo_init(&V_udbinfo, "udp", &V_udb, UDBHASHSIZE, UDBHASHSIZE, - "udp_inpcb", udp_inpcb_init, NULL, UMA_ZONE_NOFREE, + "udp_inpcb", udp_inpcb_init, NULL, 0, IPI_HASHFIELDS_2TUPLE); V_udpcb_zone = uma_zcreate("udpcb", sizeof(struct udpcb), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); uma_zone_set_max(V_udpcb_zone, maxsockets); uma_zone_set_warning(V_udpcb_zone, "kern.ipc.maxsockets limit reached"); EVENTHANDLER_REGISTER(maxsockets_change, udp_zone_change, NULL, @@ -232,7 +232,7 @@ udplite_init(void) in_pcbinfo_init(&V_ulitecbinfo, "udplite", &V_ulitecb, UDBHASHSIZE, UDBHASHSIZE, "udplite_inpcb", udplite_inpcb_init, NULL, - UMA_ZONE_NOFREE, IPI_HASHFIELDS_2TUPLE); + 0, IPI_HASHFIELDS_2TUPLE); } /* From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 03:15:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D593958; Sat, 6 Dec 2014 03:15:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B6052B9; Sat, 6 Dec 2014 03:15:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB63Fl23014545; Sat, 6 Dec 2014 03:15:47 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB63FlDi014544; Sat, 6 Dec 2014 03:15:47 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412060315.sB63FlDi014544@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sat, 6 Dec 2014 03:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275557 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 03:15:47 -0000 Author: ngie Date: Sat Dec 6 03:15:46 2014 New Revision: 275557 URL: https://svnweb.freebsd.org/changeset/base/275557 Log: Fix typos in comments and wrap to <80 columns MFC after: 3 days Modified: head/share/mk/bsd.compiler.mk Directory Properties: head/ (props changed) head/share/ (props changed) Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Sat Dec 6 03:12:57 2014 (r275556) +++ head/share/mk/bsd.compiler.mk Sat Dec 6 03:15:46 2014 (r275557) @@ -2,18 +2,22 @@ # Setup variables for the compiler # -# COMPILTER_TYPE is the major type of compiler. Currently gcc and clang support -# automatic detetion. Other compiler types can be shoe-horned in, but require explicit -# setting of the compiler type. The compiler type can also be set explicitly if, say, -# you install gcc as clang... -# -# COMPILER_VERSION is a numeric constant equal to major * 10000 + minor * 100 + tiny. It -# too can be overriden on the command line. When testing it, be sure to make sure that you -# are limiting the test to a specific compiler. Testing against 30300 for gcc likely isn't -# what you wanted (since versions of gcc prior to 4.2 likely have no prayer of working). +# COMPILER_TYPE is the major type of compiler. Currently gcc and clang support +# automatic detection. Other compiler types can be shoe-horned in, but require +# explicit setting of the compiler type. The compiler type can also be set +# explicitly if, say, you install gcc as clang... # -# COMPILER_FEATURES will contain one or more of the following, based on compiler support -# for that feature: c++11 (supports full (or nearly full) C++11 programming environment). +# COMPILER_VERSION is a numeric constant equal to: +# major * 10000 + minor * 100 + tiny +# It too can be overriden on the command line. When testing it, be sure to +# make sure that you are limiting the test to a specific compiler. Testing +# against 30300 for gcc likely isn't what you wanted (since versions of gcc +# prior to 4.2 likely have no prayer of working). +# +# COMPILER_FEATURES will contain one or more of the following, based on +# compiler support for that feature: +# +# - c++11 : supports full (or nearly full) C++11 programming environment. # # This file may be included multiple times, but only has effect the first time. # From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 09:11:14 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 564A29BF; Sat, 6 Dec 2014 09:11:14 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4234C8B2; Sat, 6 Dec 2014 09:11:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB69BENI079914; Sat, 6 Dec 2014 09:11:14 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB69BEU1079913; Sat, 6 Dec 2014 09:11:14 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060911.sB69BEU1079913@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 6 Dec 2014 09:11:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275560 - head/sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 09:11:14 -0000 Author: delphij Date: Sat Dec 6 09:11:13 2014 New Revision: 275560 URL: https://svnweb.freebsd.org/changeset/base/275560 Log: MFC r275533: Sync with Illumos. This have no effect to FreeBSD. Illumos issue: 5100 sparc build failed after 5004 MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h Sat Dec 6 07:30:08 2014 (r275559) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h Sat Dec 6 09:11:13 2014 (r275560) @@ -21,6 +21,7 @@ /* * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2014 Igor Kozhukhov . */ #ifndef _SYS_CPUVAR_H @@ -31,6 +32,7 @@ #include #include +#include #if (defined(_KERNEL) || defined(_KMEMUSER)) && defined(_MACHDEP) #include #endif @@ -52,15 +54,6 @@ extern "C" { struct squeue_set_s; #define CPU_CACHE_COHERENCE_SIZE 64 -#define S_LOADAVG_SZ 11 -#define S_MOVAVG_SZ 10 - -struct loadavg_s { - int lg_cur; /* current loadavg entry */ - unsigned int lg_len; /* number entries recorded */ - hrtime_t lg_total; /* used to temporarily hold load totals */ - hrtime_t lg_loads[S_LOADAVG_SZ]; /* table of recorded entries */ -}; /* * For fast event tracing. From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 09:14:46 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EDA47BAF; Sat, 6 Dec 2014 09:14:46 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA7FE8D3; Sat, 6 Dec 2014 09:14:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB69Ekwn080391; Sat, 6 Dec 2014 09:14:46 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB69EkkJ080390; Sat, 6 Dec 2014 09:14:46 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060914.sB69EkkJ080390@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 6 Dec 2014 09:14:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275561 - head/sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 09:14:47 -0000 Author: delphij Date: Sat Dec 6 09:14:46 2014 New Revision: 275561 URL: https://svnweb.freebsd.org/changeset/base/275561 Log: MFV r275534: Sync with Illumos. This have no effect to FreeBSD. Illumos issue: 5285 pass in cpu_pause_func via pause_cpus MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h Sat Dec 6 09:11:13 2014 (r275560) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h Sat Dec 6 09:14:46 2014 (r275561) @@ -648,7 +648,7 @@ void poke_cpu(int cpun); /* interrupt a void mach_cpu_pause(volatile char *); -void pause_cpus(cpu_t *off_cp); +void pause_cpus(cpu_t *off_cp, void *(*func)(void *)); void start_cpus(void); int cpus_paused(void); From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 09:38:29 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6AFDEEB8; Sat, 6 Dec 2014 09:38:29 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 56F3FAAA; Sat, 6 Dec 2014 09:38:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB69cT9E090053; Sat, 6 Dec 2014 09:38:29 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB69cSON090050; Sat, 6 Dec 2014 09:38:28 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060938.sB69cSON090050@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 6 Dec 2014 09:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275562 - in head/sys/cddl/contrib/opensolaris/uts/common: dtrace fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 09:38:29 -0000 Author: delphij Date: Sat Dec 6 09:38:28 2014 New Revision: 275562 URL: https://svnweb.freebsd.org/changeset/base/275562 Log: MFV r275535: Unexpand ISP2() and MSEC2NSEC(). Illumos issue: 5255 uts shouldn't open-code ISP2 MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: head/sys/cddl/contrib/opensolaris/ (props changed) Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Dec 6 09:14:46 2014 (r275561) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Sat Dec 6 09:38:28 2014 (r275562) @@ -176,7 +176,7 @@ dtrace_optval_t dtrace_ustackframes_defa dtrace_optval_t dtrace_jstackframes_default = 50; dtrace_optval_t dtrace_jstackstrsize_default = 512; int dtrace_msgdsize_max = 128; -hrtime_t dtrace_chill_max = 500 * (NANOSEC / MILLISEC); /* 500 ms */ +hrtime_t dtrace_chill_max = MSEC2NSEC(500); /* 500 ms */ hrtime_t dtrace_chill_interval = NANOSEC; /* 1000 ms */ int dtrace_devdepth_max = 32; int dtrace_err_verbose; @@ -13782,7 +13782,7 @@ dtrace_dof_slurp(dof_hdr_t *dof, dtrace_ if (!(sec->dofs_flags & DOF_SECF_LOAD)) continue; /* just ignore non-loadable sections */ - if (sec->dofs_align & (sec->dofs_align - 1)) { + if (!ISP2(sec->dofs_align)) { dtrace_dof_error(dof, "bad section alignment"); return (-1); } Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sat Dec 6 09:14:46 2014 (r275561) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Sat Dec 6 09:38:28 2014 (r275562) @@ -2483,7 +2483,7 @@ fasttrap_load(void) if (nent == 0 || nent > 0x1000000) nent = FASTTRAP_TPOINTS_DEFAULT_SIZE; - if ((nent & (nent - 1)) == 0) + if (ISP2(nent)) fasttrap_tpoints.fth_nent = nent; else fasttrap_tpoints.fth_nent = 1 << fasttrap_highbit(nent); @@ -2501,7 +2501,7 @@ fasttrap_load(void) * ... and the providers hash table... */ nent = FASTTRAP_PROVIDERS_DEFAULT_SIZE; - if ((nent & (nent - 1)) == 0) + if (ISP2(nent)) fasttrap_provs.fth_nent = nent; else fasttrap_provs.fth_nent = 1 << fasttrap_highbit(nent); @@ -2537,7 +2537,7 @@ fasttrap_load(void) * ... and the procs hash table. */ nent = FASTTRAP_PROCS_DEFAULT_SIZE; - if ((nent & (nent - 1)) == 0) + if (ISP2(nent)) fasttrap_procs.fth_nent = nent; else fasttrap_procs.fth_nent = 1 << fasttrap_highbit(nent); Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat Dec 6 09:14:46 2014 (r275561) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat Dec 6 09:38:28 2014 (r275562) @@ -24,6 +24,7 @@ * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved. */ +#include #include #include #include @@ -151,7 +152,7 @@ zio_init(void) size_t align = 0; size_t cflags = (size > zio_buf_debug_limit) ? KMC_NODEBUG : 0; - while (p2 & (p2 - 1)) + while (!ISP2(p2)) p2 &= p2 - 1; #ifdef illumos From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 10:05:08 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1F6FC327; Sat, 6 Dec 2014 10:05:08 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0BBDFD0C; Sat, 6 Dec 2014 10:05:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB6A572j003885; Sat, 6 Dec 2014 10:05:07 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB6A57hI003884; Sat, 6 Dec 2014 10:05:07 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412061005.sB6A57hI003884@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 6 Dec 2014 10:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275563 - head/cddl/contrib/opensolaris/tools/ctf/cvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 10:05:08 -0000 Author: delphij Date: Sat Dec 6 10:05:07 2014 New Revision: 275563 URL: https://svnweb.freebsd.org/changeset/base/275563 Log: MFV r275536: Illumos issue: 3363 Mark non-returning functions in ctftools MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) Modified: head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h ============================================================================== --- head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Sat Dec 6 09:38:28 2014 (r275562) +++ head/cddl/contrib/opensolaris/tools/ctf/cvt/ctftools.h Sat Dec 6 10:05:07 2014 (r275563) @@ -26,8 +26,6 @@ #ifndef _CTFTOOLS_H #define _CTFTOOLS_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Functions and data structures used in the manipulation of stabs and CTF data */ @@ -39,6 +37,8 @@ #include #include +#include + #ifdef __cplusplus extern "C" { #endif @@ -435,8 +435,8 @@ int streq(const char *, const char *); int findelfsecidx(Elf *, const char *, const char *); size_t elf_ptrsz(Elf *); char *mktmpname(const char *, const char *); -void terminate(const char *, ...); -void aborterr(const char *, ...); +void terminate(const char *, ...) __NORETURN; +void aborterr(const char *, ...) __NORETURN; void set_terminate_cleanup(void (*)(void)); void elfterminate(const char *, const char *, ...); void warning(const char *, ...); From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 11:59:35 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6BED276; Sat, 6 Dec 2014 11:59:35 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D33B68CA; Sat, 6 Dec 2014 11:59:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB6BxZXu054979; Sat, 6 Dec 2014 11:59:35 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB6BxZOV054978; Sat, 6 Dec 2014 11:59:35 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412061159.sB6BxZOV054978@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 6 Dec 2014 11:59:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275564 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 11:59:36 -0000 Author: andrew Date: Sat Dec 6 11:59:35 2014 New Revision: 275564 URL: https://svnweb.freebsd.org/changeset/base/275564 Log: Use the unified syntax when generating assembly for clang. The clang 3.5 integrated assembler only accepts it. MFC after: 1 week Sponsored by: ABT Systems Ltd Modified: head/sys/arm/arm/stdatomic.c Modified: head/sys/arm/arm/stdatomic.c ============================================================================== --- head/sys/arm/arm/stdatomic.c Sat Dec 6 10:05:07 2014 (r275563) +++ head/sys/arm/arm/stdatomic.c Sat Dec 6 11:59:35 2014 (r275564) @@ -850,8 +850,13 @@ EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str, fetch_and_sub, "sub") \ EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str, fetch_and_xor, "eor") +#ifdef __clang__ +EMIT_ALL_OPS_N(1, uint8_t, "ldrb", "strb", "strbeq") +EMIT_ALL_OPS_N(2, uint16_t, "ldrh", "strh", "strheq") +#else EMIT_ALL_OPS_N(1, uint8_t, "ldrb", "strb", "streqb") EMIT_ALL_OPS_N(2, uint16_t, "ldrh", "strh", "streqh") +#endif EMIT_ALL_OPS_N(4, uint32_t, "ldr", "str", "streq") #ifndef __clang__ From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 12:03:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77E3F69C; Sat, 6 Dec 2014 12:03:10 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 641CC991; Sat, 6 Dec 2014 12:03:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB6C3A6w059113; Sat, 6 Dec 2014 12:03:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB6C3An1059112; Sat, 6 Dec 2014 12:03:10 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201412061203.sB6C3An1059112@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 6 Dec 2014 12:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275565 - head/sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 12:03:10 -0000 Author: andrew Date: Sat Dec 6 12:03:09 2014 New Revision: 275565 URL: https://svnweb.freebsd.org/changeset/base/275565 Log: Apply the same fix in r274697 to the ARM case. Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Sat Dec 6 11:59:35 2014 (r275564) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h Sat Dec 6 12:03:09 2014 (r275565) @@ -377,7 +377,9 @@ extern "C" { /* * Define the appropriate "implementation choices". */ +#if !defined(_ILP32) #define _ILP32 +#endif #if !defined(_I32LPx) && defined(_KERNEL) #define _I32LPx #endif From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 15:16:00 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66611596; Sat, 6 Dec 2014 15:16:00 +0000 (UTC) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "tensor.andric.com", Issuer "COMODO RSA Domain Validation Secure Server CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FF32D1D; Sat, 6 Dec 2014 15:15:59 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::45a3:ddb8:2175:f9c7] (unknown [IPv6:2001:7b8:3a7:0:45a3:ddb8:2175:f9c7]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 734AEB80A; Sat, 6 Dec 2014 16:15:57 +0100 (CET) Subject: Re: svn commit: r275564 - head/sys/arm/arm Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\)) Content-Type: multipart/signed; boundary="Apple-Mail=_5BADA196-0D36-4A71-AC60-586F132A6051"; protocol="application/pgp-signature"; micalg=pgp-sha1 X-Pgp-Agent: GPGMail 2.5b3 From: Dimitry Andric In-Reply-To: <201412061159.sB6BxZOV054978@svn.freebsd.org> Date: Sat, 6 Dec 2014 16:15:55 +0100 Message-Id: <078F2487-9D4D-435C-92CC-C0E3EC7A34AE@FreeBSD.org> References: <201412061159.sB6BxZOV054978@svn.freebsd.org> To: Andrew Turner X-Mailer: Apple Mail (2.1993) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 15:16:00 -0000 --Apple-Mail=_5BADA196-0D36-4A71-AC60-586F132A6051 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 06 Dec 2014, at 12:59, Andrew Turner wrote: >=20 > Author: andrew > Date: Sat Dec 6 11:59:35 2014 > New Revision: 275564 > URL: https://svnweb.freebsd.org/changeset/base/275564 >=20 > Log: > Use the unified syntax when generating assembly for clang. The clang = 3.5 > integrated assembler only accepts it. >=20 > MFC after: 1 week > Sponsored by: ABT Systems Ltd >=20 > Modified: > head/sys/arm/arm/stdatomic.c >=20 > Modified: head/sys/arm/arm/stdatomic.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/arm/arm/stdatomic.c Sat Dec 6 10:05:07 2014 = (r275563) > +++ head/sys/arm/arm/stdatomic.c Sat Dec 6 11:59:35 2014 = (r275564) > @@ -850,8 +850,13 @@ EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str > EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str, fetch_and_sub, "sub") = \ > EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str, fetch_and_xor, "eor") >=20 > +#ifdef __clang__ > +EMIT_ALL_OPS_N(1, uint8_t, "ldrb", "strb", "strbeq") > +EMIT_ALL_OPS_N(2, uint16_t, "ldrh", "strh", "strheq") > +#else > EMIT_ALL_OPS_N(1, uint8_t, "ldrb", "strb", "streqb") > EMIT_ALL_OPS_N(2, uint16_t, "ldrh", "strh", "streqh") > +#endif > EMIT_ALL_OPS_N(4, uint32_t, "ldr", "str", "streq") I already had this change in the clang350-import project branch, but unconditional. Should we just not standardize on the unified syntax, so all these ifdefs can be avoided? -Dimitry --Apple-Mail=_5BADA196-0D36-4A71-AC60-586F132A6051 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.26 iEYEARECAAYFAlSDHa8ACgkQsF6jCi4glqOfygCg5RsHX2vQyYCBIi3dJH3QShaz wCEAoMETMYfBeb49cvx3QVhtqZFCNqcc =lq3b -----END PGP SIGNATURE----- --Apple-Mail=_5BADA196-0D36-4A71-AC60-586F132A6051-- From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 19:35:47 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC830E97; Sat, 6 Dec 2014 19:35:47 +0000 (UTC) Received: from nibbler.fubar.geek.nz (nibbler.fubar.geek.nz [199.48.134.198]) by mx1.freebsd.org (Postfix) with ESMTP id 8E5998D4; Sat, 6 Dec 2014 19:35:47 +0000 (UTC) Received: from bender.lan (97e078e7.skybroadband.com [151.224.120.231]) by nibbler.fubar.geek.nz (Postfix) with ESMTPSA id 0923D7328F; Sat, 6 Dec 2014 19:35:39 +0000 (UTC) Date: Sat, 6 Dec 2014 19:35:31 +0000 From: Andrew Turner To: Dimitry Andric Subject: Re: svn commit: r275564 - head/sys/arm/arm Message-ID: <20141206193531.73875d39@bender.lan> In-Reply-To: <078F2487-9D4D-435C-92CC-C0E3EC7A34AE@FreeBSD.org> References: <201412061159.sB6BxZOV054978@svn.freebsd.org> <078F2487-9D4D-435C-92CC-C0E3EC7A34AE@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 19:35:47 -0000 On Sat, 6 Dec 2014 16:15:55 +0100 Dimitry Andric wrote: > On 06 Dec 2014, at 12:59, Andrew Turner wrote: > > > > Author: andrew > > Date: Sat Dec 6 11:59:35 2014 > > New Revision: 275564 > > URL: https://svnweb.freebsd.org/changeset/base/275564 > > > > Log: > > Use the unified syntax when generating assembly for clang. The > > clang 3.5 integrated assembler only accepts it. > > > > MFC after: 1 week > > Sponsored by: ABT Systems Ltd > > > > Modified: > > head/sys/arm/arm/stdatomic.c > > > > Modified: head/sys/arm/arm/stdatomic.c > > ============================================================================== > > --- head/sys/arm/arm/stdatomic.c Sat Dec 6 10:05:07 > > 2014 (r275563) +++ head/sys/arm/arm/stdatomic.c Sat > > Dec 6 11:59:35 2014 (r275564) @@ -850,8 +850,13 @@ > > EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str EMIT_FETCH_AND_OP_N(N, > > uintN_t, ldr, str, fetch_and_sub, "sub") \ > > EMIT_FETCH_AND_OP_N(N, uintN_t, ldr, str, fetch_and_xor, "eor") > > > > +#ifdef __clang__ > > +EMIT_ALL_OPS_N(1, uint8_t, "ldrb", "strb", "strbeq") > > +EMIT_ALL_OPS_N(2, uint16_t, "ldrh", "strh", "strheq") > > +#else > > EMIT_ALL_OPS_N(1, uint8_t, "ldrb", "strb", "streqb") > > EMIT_ALL_OPS_N(2, uint16_t, "ldrh", "strh", "streqh") > > +#endif > > EMIT_ALL_OPS_N(4, uint32_t, "ldr", "str", "streq") > > I already had this change in the clang350-import project branch, but > unconditional. Should we just not standardize on the unified syntax, > so all these ifdefs can be avoided? Unfortunately gcc 4.2 doesn't produce unified syntax so we need to have both here. Without this the armeb build failed for me. Andrew From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 20:00:10 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC5EC5C0; Sat, 6 Dec 2014 20:00:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C811FB50; Sat, 6 Dec 2014 20:00:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB6K09NV099842; Sat, 6 Dec 2014 20:00:09 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB6K09vD099839; Sat, 6 Dec 2014 20:00:09 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201412062000.sB6K09vD099839@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 6 Dec 2014 20:00:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275567 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 20:00:10 -0000 Author: tuexen Date: Sat Dec 6 20:00:08 2014 New Revision: 275567 URL: https://svnweb.freebsd.org/changeset/base/275567 Log: Fix the support of mapped IPv4 addresses. Thanks to Mark Bonnekessel and Markus Boese for making me aware of the problems. MFC after: 1 week Modified: head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sat Dec 6 17:50:37 2014 (r275566) +++ head/sys/netinet/sctp_usrreq.c Sat Dec 6 20:00:08 2014 (r275567) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #ifdef INET6 +#include #endif #include #include @@ -1373,10 +1374,14 @@ sctp_count_max_addresses_vrf(struct sctp switch (sctp_ifa->address.sa.sa_family) { #ifdef INET case AF_INET: +#ifdef INET6 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) cnt += sizeof(struct sockaddr_in6); else cnt += sizeof(struct sockaddr_in); +#else + cnt += sizeof(struct sockaddr_in); +#endif break; #endif #ifdef INET6 @@ -1396,10 +1401,14 @@ sctp_count_max_addresses_vrf(struct sctp switch (laddr->ifa->address.sa.sa_family) { #ifdef INET case AF_INET: +#ifdef INET6 if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) cnt += sizeof(struct sockaddr_in6); else cnt += sizeof(struct sockaddr_in); +#else + cnt += sizeof(struct sockaddr_in); +#endif break; #endif #ifdef INET6 @@ -2216,23 +2225,27 @@ flags_out: size = 0; /* Count the sizes */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { - size += sizeof(struct sockaddr_in6); - } else { - switch (((struct sockaddr *)&net->ro._l_addr)->sa_family) { + switch (net->ro._l_addr.sa.sa_family) { #ifdef INET - case AF_INET: + case AF_INET: +#ifdef INET6 + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { + size += sizeof(struct sockaddr_in6); + } else { size += sizeof(struct sockaddr_in); - break; + } +#else + size += sizeof(struct sockaddr_in); +#endif + break; #endif #ifdef INET6 - case AF_INET6: - size += sizeof(struct sockaddr_in6); - break; + case AF_INET6: + size += sizeof(struct sockaddr_in6); + break; #endif - default: - break; - } + default: + break; } } SCTP_TCB_UNLOCK(stcb); @@ -2264,24 +2277,28 @@ flags_out: sas = (struct sockaddr_storage *)&saddr->addr[0]; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { - cpsz = sizeof(struct sockaddr_in6); - } else { - switch (((struct sockaddr *)&net->ro._l_addr)->sa_family) { + switch (net->ro._l_addr.sa.sa_family) { #ifdef INET - case AF_INET: + case AF_INET: +#ifdef INET6 + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { + cpsz = sizeof(struct sockaddr_in6); + } else { cpsz = sizeof(struct sockaddr_in); - break; + } +#else + cpsz = sizeof(struct sockaddr_in); +#endif + break; #endif #ifdef INET6 - case AF_INET6: - cpsz = sizeof(struct sockaddr_in6); - break; + case AF_INET6: + cpsz = sizeof(struct sockaddr_in6); + break; #endif - default: - cpsz = 0; - break; - } + default: + cpsz = 0; + break; } if (cpsz == 0) { break; @@ -2292,15 +2309,15 @@ flags_out: } #if defined(INET) && defined(INET6) if ((sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) && - (((struct sockaddr *)&net->ro._l_addr)->sa_family == AF_INET)) { + (net->ro._l_addr.sa.sa_family == AF_INET)) { /* Must map the address */ - in6_sin_2_v4mapsin6((struct sockaddr_in *)&net->ro._l_addr, + in6_sin_2_v4mapsin6(&net->ro._l_addr.sin, (struct sockaddr_in6 *)sas); } else { -#endif memcpy(sas, &net->ro._l_addr, cpsz); -#if defined(INET) && defined(INET6) } +#else + memcpy(sas, &net->ro._l_addr, cpsz); #endif ((struct sockaddr_in *)sas)->sin_port = stcb->rport; @@ -2337,13 +2354,35 @@ flags_out: { struct sctp_paddrparams *paddrp; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(paddrp, optval, struct sctp_paddrparams, *optsize); SCTP_FIND_STCB(inp, stcb, paddrp->spp_assoc_id); - net = NULL; - if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&paddrp->spp_address); +#if defined(INET) && defined(INET6) + if (paddrp->spp_address.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&paddrp->spp_address; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&paddrp->spp_address; + } + } else { + addr = (struct sockaddr *)&paddrp->spp_address; + } +#else + addr = (struct sockaddr *)&paddrp->spp_address; +#endif + if (stcb != NULL) { + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -2352,22 +2391,20 @@ flags_out: * the locked tcb (last argument) is NOT a * TCB.. aka NULL. */ + net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&paddrp->spp_address, &net, NULL, NULL); + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if (stcb && (net == NULL)) { - struct sockaddr *sa; - - sa = (struct sockaddr *)&paddrp->spp_address; + if ((stcb != NULL) && (net == NULL)) { #ifdef INET - if (sa->sa_family == AF_INET) { + if (addr->sa_family == AF_INET) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)sa; - if (sin->sin_addr.s_addr) { + sin = (struct sockaddr_in *)addr; + if (sin->sin_addr.s_addr != INADDR_ANY) { error = EINVAL; SCTP_TCB_UNLOCK(stcb); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); @@ -2376,10 +2413,10 @@ flags_out: } else #endif #ifdef INET6 - if (sa->sa_family == AF_INET6) { + if (addr->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)sa; + sin6 = (struct sockaddr_in6 *)addr; if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { error = EINVAL; SCTP_TCB_UNLOCK(stcb); @@ -2395,10 +2432,10 @@ flags_out: break; } } - if (stcb) { + if (stcb != NULL) { /* Applies to the specific association */ paddrp->spp_flags = 0; - if (net) { + if (net != NULL) { int ovh; if (inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) { @@ -2514,13 +2551,35 @@ flags_out: { struct sctp_paddrinfo *paddri; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(paddri, optval, struct sctp_paddrinfo, *optsize); SCTP_FIND_STCB(inp, stcb, paddri->spinfo_assoc_id); - net = NULL; - if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&paddri->spinfo_address); +#if defined(INET) && defined(INET6) + if (paddri->spinfo_address.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&paddri->spinfo_address; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&paddri->spinfo_address; + } + } else { + addr = (struct sockaddr *)&paddri->spinfo_address; + } +#else + addr = (struct sockaddr *)&paddri->spinfo_address; +#endif + if (stcb != NULL) { + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -2529,14 +2588,15 @@ flags_out: * the locked tcb (last argument) is NOT a * TCB.. aka NULL. */ + net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&paddri->spinfo_address, &net, NULL, NULL); + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if ((stcb) && (net)) { + if ((stcb != NULL) && (net != NULL)) { if (net->dest_state & SCTP_ADDR_UNCONFIRMED) { /* It's unconfirmed */ paddri->spinfo_state = SCTP_UNCONFIRMED; @@ -2555,7 +2615,7 @@ flags_out: SCTP_TCB_UNLOCK(stcb); *optsize = sizeof(struct sctp_paddrinfo); } else { - if (stcb) { + if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, ENOENT); @@ -2772,16 +2832,32 @@ flags_out: SCTP_FIND_STCB(inp, stcb, ssp->ssp_assoc_id); if (stcb) { - /* simply copy out the sockaddr_storage... */ - size_t len; + union sctp_sockstore *addr; - len = *optsize; - if (len > stcb->asoc.primary_destination->ro._l_addr.sa.sa_len) - len = stcb->asoc.primary_destination->ro._l_addr.sa.sa_len; - - memcpy(&ssp->ssp_addr, - &stcb->asoc.primary_destination->ro._l_addr, - len); + addr = &stcb->asoc.primary_destination->ro._l_addr; + switch (addr->sa.sa_family) { +#ifdef INET + case AF_INET: +#ifdef INET6 + if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { + in6_sin_2_v4mapsin6(&addr->sin, + (struct sockaddr_in6 *)&ssp->ssp_addr); + } else { + memcpy(&ssp->ssp_addr, &addr->sin, sizeof(struct sockaddr_in)); + } +#else + memcpy(&ssp->ssp_addr, &addr->sin, sizeof(struct sockaddr_in)); +#endif + break; +#endif +#ifdef INET6 + case AF_INET6: + memcpy(&ssp->ssp_addr, &addr->sin6, sizeof(struct sockaddr_in6)); + break; +#endif + default: + break; + } SCTP_TCB_UNLOCK(stcb); *optsize = sizeof(struct sctp_setprim); } else { @@ -3121,13 +3197,35 @@ flags_out: { struct sctp_paddrthlds *thlds; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(thlds, optval, struct sctp_paddrthlds, *optsize); SCTP_FIND_STCB(inp, stcb, thlds->spt_assoc_id); - net = NULL; - if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&thlds->spt_address); +#if defined(INET) && defined(INET6) + if (thlds->spt_address.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&thlds->spt_address; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&thlds->spt_address; + } + } else { + addr = (struct sockaddr *)&thlds->spt_address; + } +#else + addr = (struct sockaddr *)&thlds->spt_address; +#endif + if (stcb != NULL) { + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -3136,22 +3234,20 @@ flags_out: * the locked tcb (last argument) is NOT a * TCB.. aka NULL. */ + net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&thlds->spt_address, &net, NULL, NULL); + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if (stcb && (net == NULL)) { - struct sockaddr *sa; - - sa = (struct sockaddr *)&thlds->spt_address; + if ((stcb != NULL) && (net == NULL)) { #ifdef INET - if (sa->sa_family == AF_INET) { + if (addr->sa_family == AF_INET) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)sa; - if (sin->sin_addr.s_addr) { + sin = (struct sockaddr_in *)addr; + if (sin->sin_addr.s_addr != INADDR_ANY) { error = EINVAL; SCTP_TCB_UNLOCK(stcb); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); @@ -3160,10 +3256,10 @@ flags_out: } else #endif #ifdef INET6 - if (sa->sa_family == AF_INET6) { + if (addr->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)sa; + sin6 = (struct sockaddr_in6 *)addr; if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { error = EINVAL; SCTP_TCB_UNLOCK(stcb); @@ -3179,8 +3275,8 @@ flags_out: break; } } - if (stcb) { - if (net) { + if (stcb != NULL) { + if (net != NULL) { thlds->spt_pathmaxrxt = net->failure_threshold; thlds->spt_pathpfthld = net->pf_threshold; } else { @@ -3212,12 +3308,35 @@ flags_out: { struct sctp_udpencaps *encaps; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(encaps, optval, struct sctp_udpencaps, *optsize); SCTP_FIND_STCB(inp, stcb, encaps->sue_assoc_id); +#if defined(INET) && defined(INET6) + if (encaps->sue_address.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&encaps->sue_address; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&encaps->sue_address; + } + } else { + addr = (struct sockaddr *)&encaps->sue_address; + } +#else + addr = (struct sockaddr *)&encaps->sue_address; +#endif if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&encaps->sue_address); + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -3228,21 +3347,18 @@ flags_out: */ net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&encaps->sue_address, &net, NULL, NULL); + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if (stcb && (net == NULL)) { - struct sockaddr *sa; - - sa = (struct sockaddr *)&encaps->sue_address; + if ((stcb != NULL) && (net == NULL)) { #ifdef INET - if (sa->sa_family == AF_INET) { + if (addr->sa_family == AF_INET) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)sa; - if (sin->sin_addr.s_addr) { + sin = (struct sockaddr_in *)addr; + if (sin->sin_addr.s_addr != INADDR_ANY) { error = EINVAL; SCTP_TCB_UNLOCK(stcb); SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, error); @@ -3251,10 +3367,10 @@ flags_out: } else #endif #ifdef INET6 - if (sa->sa_family == AF_INET6) { + if (addr->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)sa; + sin6 = (struct sockaddr_in6 *)addr; if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { error = EINVAL; SCTP_TCB_UNLOCK(stcb); @@ -3270,7 +3386,7 @@ flags_out: break; } } - if (stcb) { + if (stcb != NULL) { if (net) { encaps->sue_port = net->port; } else { @@ -4946,12 +5062,35 @@ sctp_setopt(struct socket *so, int optna { struct sctp_paddrparams *paddrp; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(paddrp, optval, struct sctp_paddrparams, optsize); SCTP_FIND_STCB(inp, stcb, paddrp->spp_assoc_id); - net = NULL; - if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&paddrp->spp_address); + +#if defined(INET) && defined(INET6) + if (paddrp->spp_address.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&paddrp->spp_address; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&paddrp->spp_address; + } + } else { + addr = (struct sockaddr *)&paddrp->spp_address; + } +#else + addr = (struct sockaddr *)&paddrp->spp_address; +#endif + if (stcb != NULL) { + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -4960,25 +5099,22 @@ sctp_setopt(struct socket *so, int optna * the locked tcb (last argument) is NOT a * TCB.. aka NULL. */ + net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, - (struct sockaddr *)&paddrp->spp_address, + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if (stcb && (net == NULL)) { - struct sockaddr *sa; - - sa = (struct sockaddr *)&paddrp->spp_address; + if ((stcb != NULL) && (net == NULL)) { #ifdef INET - if (sa->sa_family == AF_INET) { + if (addr->sa_family == AF_INET) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)sa; - if (sin->sin_addr.s_addr) { + sin = (struct sockaddr_in *)addr; + if (sin->sin_addr.s_addr != INADDR_ANY) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); SCTP_TCB_UNLOCK(stcb); error = EINVAL; @@ -4987,10 +5123,10 @@ sctp_setopt(struct socket *so, int optna } else #endif #ifdef INET6 - if (sa->sa_family == AF_INET6) { + if (addr->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)sa; + sin6 = (struct sockaddr_in6 *)addr; if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); SCTP_TCB_UNLOCK(stcb); @@ -5019,7 +5155,7 @@ sctp_setopt(struct socket *so, int optna SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); return (EINVAL); } - if (stcb) { + if (stcb != NULL) { /************************TCB SPECIFIC SET ******************/ /* * do we change the timer for HB, we run @@ -5034,7 +5170,7 @@ sctp_setopt(struct socket *so, int optna } /* network sets ? */ - if (net) { + if (net != NULL) { /************************NET SPECIFIC SET ******************/ if (paddrp->spp_flags & SPP_HB_DISABLE) { if (!(net->dest_state & SCTP_ADDR_UNCONFIRMED) && @@ -5119,7 +5255,7 @@ sctp_setopt(struct socket *so, int optna #endif } else { /************************ASSOC ONLY -- NO NET SPECIFIC SET ******************/ - if (paddrp->spp_pathmaxrxt) { + if (paddrp->spp_pathmaxrxt != 0) { stcb->asoc.def_net_failure = paddrp->spp_pathmaxrxt; TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { if (net->dest_state & SCTP_ADDR_PF) { @@ -5150,14 +5286,14 @@ sctp_setopt(struct socket *so, int optna } } if (paddrp->spp_flags & SPP_HB_ENABLE) { - if (paddrp->spp_hbinterval) { + if (paddrp->spp_hbinterval != 0) { stcb->asoc.heart_beat_delay = paddrp->spp_hbinterval; } else if (paddrp->spp_flags & SPP_HB_TIME_IS_ZERO) { stcb->asoc.heart_beat_delay = 0; } /* Turn back on the timer */ TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { - if (paddrp->spp_hbinterval) { + if (paddrp->spp_hbinterval != 0) { net->heart_beat_delay = paddrp->spp_hbinterval; } else if (paddrp->spp_flags & SPP_HB_TIME_IS_ZERO) { net->heart_beat_delay = 0; @@ -5238,12 +5374,12 @@ sctp_setopt(struct socket *so, int optna * set it with the options on the * socket */ - if (paddrp->spp_pathmaxrxt) { + if (paddrp->spp_pathmaxrxt != 0) { inp->sctp_ep.def_net_failure = paddrp->spp_pathmaxrxt; } if (paddrp->spp_flags & SPP_HB_TIME_IS_ZERO) inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = 0; - else if (paddrp->spp_hbinterval) { + else if (paddrp->spp_hbinterval != 0) { if (paddrp->spp_hbinterval > SCTP_MAX_HB_INTERVAL) paddrp->spp_hbinterval = SCTP_MAX_HB_INTERVAL; inp->sctp_ep.sctp_timeoutticks[SCTP_TIMER_HEARTBEAT] = MSEC_TO_TICKS(paddrp->spp_hbinterval); @@ -5409,13 +5545,35 @@ sctp_setopt(struct socket *so, int optna { struct sctp_setprim *spa; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(spa, optval, struct sctp_setprim, optsize); SCTP_FIND_STCB(inp, stcb, spa->ssp_assoc_id); - net = NULL; - if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&spa->ssp_addr); +#if defined(INET) && defined(INET6) + if (spa->ssp_addr.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&spa->ssp_addr; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&spa->ssp_addr; + } + } else { + addr = (struct sockaddr *)&spa->ssp_addr; + } +#else + addr = (struct sockaddr *)&spa->ssp_addr; +#endif + if (stcb != NULL) { + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -5424,16 +5582,16 @@ sctp_setopt(struct socket *so, int optna * the locked tcb (last argument) is NOT a * TCB.. aka NULL. */ + net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, - (struct sockaddr *)&spa->ssp_addr, + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if ((stcb) && (net)) { + if ((stcb != NULL) && (net != NULL)) { if ((net != stcb->asoc.primary_destination) && (!(net->dest_state & SCTP_ADDR_UNCONFIRMED))) { /* Ok we need to set it */ @@ -5450,7 +5608,7 @@ sctp_setopt(struct socket *so, int optna SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } - if (stcb) { + if (stcb != NULL) { SCTP_TCB_UNLOCK(stcb); } break; @@ -5472,14 +5630,36 @@ sctp_setopt(struct socket *so, int optna case SCTP_SET_PEER_PRIMARY_ADDR: { struct sctp_setpeerprim *sspp; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(sspp, optval, struct sctp_setpeerprim, optsize); SCTP_FIND_STCB(inp, stcb, sspp->sspp_assoc_id); if (stcb != NULL) { struct sctp_ifa *ifa; - ifa = sctp_find_ifa_by_addr((struct sockaddr *)&sspp->sspp_addr, - stcb->asoc.vrf_id, SCTP_ADDR_NOT_LOCKED); +#if defined(INET) && defined(INET6) + if (sspp->sspp_addr.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&sspp->sspp_addr; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&sspp->sspp_addr; + } + } else { + addr = (struct sockaddr *)&sspp->sspp_addr; + } +#else + addr = (struct sockaddr *)&sspp->sspp_addr; +#endif + ifa = sctp_find_ifa_by_addr(addr, stcb->asoc.vrf_id, SCTP_ADDR_NOT_LOCKED); if (ifa == NULL) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; @@ -5510,13 +5690,13 @@ sctp_setopt(struct socket *so, int optna goto out_of_it; } } else { - switch (sspp->sspp_addr.ss_family) { + switch (addr->sa_family) { #ifdef INET case AF_INET: { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)&sspp->sspp_addr; + sin = (struct sockaddr_in *)addr; if (prison_check_ip4(inp->ip_inp.inp.inp_cred, &sin->sin_addr) != 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -5531,7 +5711,7 @@ sctp_setopt(struct socket *so, int optna { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)&sspp->sspp_addr; + sin6 = (struct sockaddr_in6 *)addr; if (prison_check_ip6(inp->ip_inp.inp.inp_cred, &sin6->sin6_addr) != 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); @@ -5547,8 +5727,7 @@ sctp_setopt(struct socket *so, int optna goto out_of_it; } } - if (sctp_set_primary_ip_address_sa(stcb, - (struct sockaddr *)&sspp->sspp_addr) != 0) { + if (sctp_set_primary_ip_address_sa(stcb, addr) != 0) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); error = EINVAL; } @@ -5899,12 +6078,35 @@ sctp_setopt(struct socket *so, int optna { struct sctp_paddrthlds *thlds; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(thlds, optval, struct sctp_paddrthlds, optsize); SCTP_FIND_STCB(inp, stcb, thlds->spt_assoc_id); - net = NULL; - if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&thlds->spt_address); + +#if defined(INET) && defined(INET6) + if (thlds->spt_address.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&thlds->spt_address; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&thlds->spt_address; + } + } else { + addr = (struct sockaddr *)&thlds->spt_address; + } +#else + addr = (struct sockaddr *)&thlds->spt_address; +#endif + if (stcb != NULL) { + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -5913,25 +6115,22 @@ sctp_setopt(struct socket *so, int optna * the locked tcb (last argument) is NOT a * TCB.. aka NULL. */ + net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, - (struct sockaddr *)&thlds->spt_address, + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if (stcb && (net == NULL)) { - struct sockaddr *sa; - - sa = (struct sockaddr *)&thlds->spt_address; + if ((stcb != NULL) && (net == NULL)) { #ifdef INET - if (sa->sa_family == AF_INET) { + if (addr->sa_family == AF_INET) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)sa; - if (sin->sin_addr.s_addr) { + sin = (struct sockaddr_in *)addr; + if (sin->sin_addr.s_addr != INADDR_ANY) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); SCTP_TCB_UNLOCK(stcb); error = EINVAL; @@ -5940,10 +6139,10 @@ sctp_setopt(struct socket *so, int optna } else #endif #ifdef INET6 - if (sa->sa_family == AF_INET6) { + if (addr->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)sa; + sin6 = (struct sockaddr_in6 *)addr; if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); SCTP_TCB_UNLOCK(stcb); @@ -5959,8 +6158,8 @@ sctp_setopt(struct socket *so, int optna break; } } - if (stcb) { - if (net) { + if (stcb != NULL) { + if (net != NULL) { if (net->dest_state & SCTP_ADDR_PF) { if ((net->failure_threshold > thlds->spt_pathmaxrxt) || (net->failure_threshold <= thlds->spt_pathpfthld)) { @@ -6040,11 +6239,35 @@ sctp_setopt(struct socket *so, int optna { struct sctp_udpencaps *encaps; struct sctp_nets *net; + struct sockaddr *addr; + +#if defined(INET) && defined(INET6) + struct sockaddr_in sin_store; + +#endif SCTP_CHECK_AND_CAST(encaps, optval, struct sctp_udpencaps, optsize); SCTP_FIND_STCB(inp, stcb, encaps->sue_assoc_id); - if (stcb) { - net = sctp_findnet(stcb, (struct sockaddr *)&encaps->sue_address); + +#if defined(INET) && defined(INET6) + if (encaps->sue_address.ss_family == AF_INET6) { + struct sockaddr_in6 *sin6; + + sin6 = (struct sockaddr_in6 *)&encaps->sue_address; + if (IN6_IS_ADDR_V4MAPPED(&sin6->sin6_addr)) { + in6_sin6_2_sin(&sin_store, sin6); + addr = (struct sockaddr *)&sin_store; + } else { + addr = (struct sockaddr *)&encaps->sue_address; + } + } else { + addr = (struct sockaddr *)&encaps->sue_address; + } +#else + addr = (struct sockaddr *)&encaps->sue_address; +#endif + if (stcb != NULL) { + net = sctp_findnet(stcb, addr); } else { /* * We increment here since @@ -6055,22 +6278,19 @@ sctp_setopt(struct socket *so, int optna */ net = NULL; SCTP_INP_INCR_REF(inp); - stcb = sctp_findassociation_ep_addr(&inp, (struct sockaddr *)&encaps->sue_address, &net, NULL, NULL); + stcb = sctp_findassociation_ep_addr(&inp, addr, &net, NULL, NULL); if (stcb == NULL) { SCTP_INP_DECR_REF(inp); } } - if (stcb && (net == NULL)) { - struct sockaddr *sa; - - sa = (struct sockaddr *)&encaps->sue_address; + if ((stcb != NULL) && (net == NULL)) { #ifdef INET - if (sa->sa_family == AF_INET) { + if (addr->sa_family == AF_INET) { struct sockaddr_in *sin; - sin = (struct sockaddr_in *)sa; - if (sin->sin_addr.s_addr) { + sin = (struct sockaddr_in *)addr; + if (sin->sin_addr.s_addr != INADDR_ANY) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); SCTP_TCB_UNLOCK(stcb); error = EINVAL; @@ -6079,10 +6299,10 @@ sctp_setopt(struct socket *so, int optna } else #endif #ifdef INET6 - if (sa->sa_family == AF_INET6) { + if (addr->sa_family == AF_INET6) { struct sockaddr_in6 *sin6; - sin6 = (struct sockaddr_in6 *)sa; + sin6 = (struct sockaddr_in6 *)addr; if (!IN6_IS_ADDR_UNSPECIFIED(&sin6->sin6_addr)) { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); SCTP_TCB_UNLOCK(stcb); @@ -6098,8 +6318,8 @@ sctp_setopt(struct socket *so, int optna break; } } - if (stcb) { - if (net) { + if (stcb != NULL) { + if (net != NULL) { net->port = encaps->sue_port; } else { stcb->asoc.port = encaps->sue_port; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Dec 6 17:50:37 2014 (r275566) +++ head/sys/netinet/sctputil.c Sat Dec 6 20:00:08 2014 (r275567) @@ -2760,7 +2760,16 @@ sctp_notify_peer_addr_change(struct sctp switch (sa->sa_family) { #ifdef INET case AF_INET: +#ifdef INET6 + if (sctp_is_feature_on(stcb->sctp_ep, SCTP_PCB_FLAGS_NEEDS_MAPPED_V4)) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 20:39:27 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5AE5DF95; Sat, 6 Dec 2014 20:39:27 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 465A0E2B; Sat, 6 Dec 2014 20:39:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB6KdRsg020678; Sat, 6 Dec 2014 20:39:27 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB6KdPtg020670; Sat, 6 Dec 2014 20:39:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412062039.sB6KdPtg020670@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 6 Dec 2014 20:39:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275568 - in head: sys/cam/ctl usr.sbin/ctladm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 20:39:27 -0000 Author: mav Date: Sat Dec 6 20:39:25 2014 New Revision: 275568 URL: https://svnweb.freebsd.org/changeset/base/275568 Log: Count consecutive read requests as blocking in CTL for files and ZVOLs. Technically read requests can be executed in any order or simultaneously since they are not changing any data. But ZFS prefetcher goes crasy when it receives consecutive requests from different threads. Since prefetcher works on level of separate blocks, instead of two consecutive 128K requests it may receive 32 8K requests in mixed order. This patch is more workaround then a real fix, and it does not fix all of prefetcher problems, but it improves sequential read speed by 3-4x times in some configurations. On the other side it may hurt performance if some backing store has no prefetch, that is why it is disabled by default for raw devices. MFC after: 2 weeks Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend.h head/sys/cam/ctl/ctl_backend_block.c head/sys/cam/ctl/ctl_private.h head/sys/cam/ctl/ctl_ser_table.c head/usr.sbin/ctladm/ctladm.8 Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Sat Dec 6 20:00:08 2014 (r275567) +++ head/sys/cam/ctl/ctl.c Sat Dec 6 20:39:25 2014 (r275568) @@ -433,7 +433,9 @@ static int ctl_inquiry_evpd_lbp(struct c static int ctl_inquiry_evpd(struct ctl_scsiio *ctsio); static int ctl_inquiry_std(struct ctl_scsiio *ctsio); static int ctl_get_lba_len(union ctl_io *io, uint64_t *lba, uint64_t *len); -static ctl_action ctl_extent_check(union ctl_io *io1, union ctl_io *io2); +static ctl_action ctl_extent_check(union ctl_io *io1, union ctl_io *io2, + bool seq); +static ctl_action ctl_extent_check_seq(union ctl_io *io1, union ctl_io *io2); static ctl_action ctl_check_for_blockage(struct ctl_lun *lun, union ctl_io *pending_io, union ctl_io *ooa_io); static ctl_action ctl_check_ooa(struct ctl_lun *lun, union ctl_io *pending_io, @@ -4590,6 +4592,17 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft if (value != NULL && strcmp(value, "on") == 0) lun->flags |= CTL_LUN_READONLY; + lun->serseq = CTL_LUN_SERSEQ_OFF; + if (be_lun->flags & CTL_LUN_FLAG_SERSEQ_READ) + lun->serseq = CTL_LUN_SERSEQ_READ; + value = ctl_get_opt(&be_lun->options, "serseq"); + if (value != NULL && strcmp(value, "on") == 0) + lun->serseq = CTL_LUN_SERSEQ_ON; + else if (value != NULL && strcmp(value, "read") == 0) + lun->serseq = CTL_LUN_SERSEQ_READ; + else if (value != NULL && strcmp(value, "off") == 0) + lun->serseq = CTL_LUN_SERSEQ_OFF; + lun->ctl_softc = ctl_softc; TAILQ_INIT(&lun->ooa_queue); TAILQ_INIT(&lun->blocked_queue); @@ -10752,15 +10765,15 @@ ctl_get_lba_len(union ctl_io *io, uint64 } static ctl_action -ctl_extent_check_lba(uint64_t lba1, uint64_t len1, uint64_t lba2, uint64_t len2) +ctl_extent_check_lba(uint64_t lba1, uint64_t len1, uint64_t lba2, uint64_t len2, + bool seq) { uint64_t endlba1, endlba2; - endlba1 = lba1 + len1 - 1; + endlba1 = lba1 + len1 - (seq ? 0 : 1); endlba2 = lba2 + len2 - 1; - if ((endlba1 < lba2) - || (endlba2 < lba1)) + if ((endlba1 < lba2) || (endlba2 < lba1)) return (CTL_ACTION_PASS); else return (CTL_ACTION_BLOCK); @@ -10799,23 +10812,39 @@ ctl_extent_check_unmap(union ctl_io *io, } static ctl_action -ctl_extent_check(union ctl_io *io1, union ctl_io *io2) +ctl_extent_check(union ctl_io *io1, union ctl_io *io2, bool seq) { uint64_t lba1, lba2; uint64_t len1, len2; int retval; - if (ctl_get_lba_len(io1, &lba1, &len1) != 0) + if (ctl_get_lba_len(io2, &lba2, &len2) != 0) return (CTL_ACTION_ERROR); - retval = ctl_extent_check_unmap(io2, lba1, len1); + retval = ctl_extent_check_unmap(io1, lba2, len2); if (retval != CTL_ACTION_ERROR) return (retval); + if (ctl_get_lba_len(io1, &lba1, &len1) != 0) + return (CTL_ACTION_ERROR); + + return (ctl_extent_check_lba(lba1, len1, lba2, len2, seq)); +} + +static ctl_action +ctl_extent_check_seq(union ctl_io *io1, union ctl_io *io2) +{ + uint64_t lba1, lba2; + uint64_t len1, len2; + + if (ctl_get_lba_len(io1, &lba1, &len1) != 0) + return (CTL_ACTION_ERROR); if (ctl_get_lba_len(io2, &lba2, &len2) != 0) return (CTL_ACTION_ERROR); - return (ctl_extent_check_lba(lba1, len1, lba2, len2)); + if (lba1 + len1 == lba2) + return (CTL_ACTION_BLOCK); + return (CTL_ACTION_PASS); } static ctl_action @@ -10904,12 +10933,18 @@ ctl_check_for_blockage(struct ctl_lun *l case CTL_SER_BLOCK: return (CTL_ACTION_BLOCK); case CTL_SER_EXTENT: - return (ctl_extent_check(pending_io, ooa_io)); + return (ctl_extent_check(ooa_io, pending_io, + (lun->serseq == CTL_LUN_SERSEQ_ON))); case CTL_SER_EXTENTOPT: if ((lun->mode_pages.control_page[CTL_PAGE_CURRENT].queue_flags & SCP_QUEUE_ALG_MASK) != SCP_QUEUE_ALG_UNRESTRICTED) - return (ctl_extent_check(pending_io, ooa_io)); - /* FALLTHROUGH */ + return (ctl_extent_check(ooa_io, pending_io, + (lun->serseq == CTL_LUN_SERSEQ_ON))); + return (CTL_ACTION_PASS); + case CTL_SER_EXTENTSEQ: + if (lun->serseq != CTL_LUN_SERSEQ_OFF) + return (ctl_extent_check_seq(ooa_io, pending_io)); + return (CTL_ACTION_PASS); case CTL_SER_PASS: return (CTL_ACTION_PASS); case CTL_SER_BLOCKOPT: @@ -12440,7 +12475,7 @@ ctl_cmd_pattern_match(struct ctl_scsiio return (CTL_LUN_PAT_NONE); action = ctl_extent_check_lba(lba1, len1, desc->lba_range.lba, - desc->lba_range.len); + desc->lba_range.len, FALSE); /* * A "pass" means that the LBA ranges don't overlap, so * this doesn't match the user's range criteria. Modified: head/sys/cam/ctl/ctl_backend.h ============================================================================== --- head/sys/cam/ctl/ctl_backend.h Sat Dec 6 20:00:08 2014 (r275567) +++ head/sys/cam/ctl/ctl_backend.h Sat Dec 6 20:39:25 2014 (r275568) @@ -85,7 +85,8 @@ typedef enum { CTL_LUN_FLAG_DEVID = 0x20, CTL_LUN_FLAG_DEV_TYPE = 0x40, CTL_LUN_FLAG_UNMAP = 0x80, - CTL_LUN_FLAG_OFFLINE = 0x100 + CTL_LUN_FLAG_OFFLINE = 0x100, + CTL_LUN_FLAG_SERSEQ_READ = 0x200 } ctl_backend_lun_flags; #ifdef _KERNEL Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Sat Dec 6 20:00:08 2014 (r275567) +++ head/sys/cam/ctl/ctl_backend_block.c Sat Dec 6 20:39:25 2014 (r275568) @@ -2204,6 +2204,8 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_OFFLINE; if (unmap) be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_UNMAP; + if (be_lun->dispatch != ctl_be_block_dispatch_dev) + be_lun->ctl_be_lun.flags |= CTL_LUN_FLAG_SERSEQ_READ; be_lun->ctl_be_lun.be_lun = be_lun; be_lun->ctl_be_lun.maxlba = (be_lun->size_blocks == 0) ? 0 : (be_lun->size_blocks - 1); Modified: head/sys/cam/ctl/ctl_private.h ============================================================================== --- head/sys/cam/ctl/ctl_private.h Sat Dec 6 20:00:08 2014 (r275567) +++ head/sys/cam/ctl/ctl_private.h Sat Dec 6 20:39:25 2014 (r275568) @@ -97,6 +97,7 @@ typedef enum { CTL_SER_BLOCKOPT, CTL_SER_EXTENT, CTL_SER_EXTENTOPT, + CTL_SER_EXTENTSEQ, CTL_SER_PASS, CTL_SER_SKIP } ctl_serialize_action; @@ -183,6 +184,12 @@ typedef enum { } ctl_lun_flags; typedef enum { + CTL_LUN_SERSEQ_OFF, + CTL_LUN_SERSEQ_READ, + CTL_LUN_SERSEQ_ON +} ctl_lun_serseq; + +typedef enum { CTLBLOCK_FLAG_NONE = 0x00, CTLBLOCK_FLAG_INVALID = 0x01 } ctlblock_flags; @@ -386,6 +393,7 @@ struct ctl_lun { struct ctl_id target; uint64_t lun; ctl_lun_flags flags; + ctl_lun_serseq serseq; STAILQ_HEAD(,ctl_error_desc) error_list; uint64_t error_serial; struct ctl_softc *ctl_softc; Modified: head/sys/cam/ctl/ctl_ser_table.c ============================================================================== --- head/sys/cam/ctl/ctl_ser_table.c Sat Dec 6 20:00:08 2014 (r275567) +++ head/sys/cam/ctl/ctl_ser_table.c Sat Dec 6 20:39:25 2014 (r275568) @@ -59,12 +59,13 @@ #define bO CTL_SER_BLOCKOPT /* Optional block */ #define xT CTL_SER_EXTENT /* Extent check */ #define xO CTL_SER_EXTENTOPT /* Optional extent check */ +#define xS CTL_SER_EXTENTSEQ /* Sequential extent check */ static ctl_serialize_action ctl_serialize_table[CTL_SERIDX_COUNT][CTL_SERIDX_COUNT] = { /**>IDX_ :: 2nd:TUR RD WRT UNM MDSN MDSL RQSN INQ RDCP RES LSNS FMT STR*/ /*TUR */{ pS, pS, pS, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, -/*READ */{ pS, pS, xT, bO, bK, bK, bK, pS, pS, bK, pS, bK, bK}, +/*READ */{ pS, xS, xT, bO, bK, bK, bK, pS, pS, bK, pS, bK, bK}, /*WRITE */{ pS, xT, xT, bO, bK, bK, bK, pS, pS, bK, pS, bK, bK}, /*UNMAP */{ pS, xO, xO, pS, bK, bK, bK, pS, pS, bK, pS, bK, bK}, /*MD_SNS */{ bK, bK, bK, bK, pS, bK, bK, pS, pS, bK, pS, bK, bK}, Modified: head/usr.sbin/ctladm/ctladm.8 ============================================================================== --- head/usr.sbin/ctladm/ctladm.8 Sat Dec 6 20:00:08 2014 (r275567) +++ head/usr.sbin/ctladm/ctladm.8 Sat Dec 6 20:39:25 2014 (r275568) @@ -34,7 +34,7 @@ .\" $Id: //depot/users/kenm/FreeBSD-test2/usr.sbin/ctladm/ctladm.8#3 $ .\" $FreeBSD$ .\" -.Dd December 4, 2014 +.Dd December 6, 2014 .Dt CTLADM 8 .Os .Sh NAME @@ -995,6 +995,13 @@ command sequence order shall be explicit client through the selection of appropriate commands and task attributes. The default value is "restricted". It improves data integrity, but may introduce some additional delays. +.It Va serseq +Set to "on" to serialize conseсutive reads/writes. +Set to "read" to serialize conseсutive reads. +Set to "off" to allow them be issued in parallel. +Parallel issue of consecutive operations may confuse logic of the +backing file system, hurting performance; but it may improve performance +of backing stores without prefetch/write-back. .It Va rpm Specifies medium rotation rate of the device: 0 -- not reported, 1 -- non-rotating (SSD), >1024 -- value in revolutions per minute. From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 21:00:37 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AF55D6B4; Sat, 6 Dec 2014 21:00:37 +0000 (UTC) Received: from smtp.digiware.nl (unknown [IPv6:2001:4cb8:90:ffff::3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DB75FF5; Sat, 6 Dec 2014 21:00:37 +0000 (UTC) Received: from rack1.digiware.nl (unknown [127.0.0.1]) by smtp.digiware.nl (Postfix) with ESMTP id 561E016A401; Sat, 6 Dec 2014 22:00:33 +0100 (CET) X-Virus-Scanned: amavisd-new at digiware.nl Received: from smtp.digiware.nl ([127.0.0.1]) by rack1.digiware.nl (rack1.digiware.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kojEh7_drAMl; Sat, 6 Dec 2014 22:00:23 +0100 (CET) Received: from [192.168.10.9] (vaio [192.168.10.9]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.digiware.nl (Postfix) with ESMTPSA id AF96D16A402; Sat, 6 Dec 2014 21:49:16 +0100 (CET) Message-ID: <54836BCC.2080707@digiware.nl> Date: Sat, 06 Dec 2014 21:49:16 +0100 From: Willem Jan Withagen User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Andriy Gapon , d@delphij.net, Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r273060 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201410132039.s9DKdpmh055573@svn.freebsd.org> <546F57B1.2020602@FreeBSD.org> <546F9FC3.10402@delphij.net> <5474540D.2000607@FreeBSD.org> In-Reply-To: <5474540D.2000607@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 21:00:37 -0000 On 25-11-2014 11:03, Andriy Gapon wrote: > On 21/11/2014 22:25, Xin Li wrote: >> On 11/21/14 07:18, Andriy Gapon wrote: >>> On 13/10/2014 23:39, Xin LI wrote: >>>> Author: delphij Date: Mon Oct 13 20:39:51 2014 New Revision: >>>> 273060 URL: https://svnweb.freebsd.org/changeset/base/273060 >>>> >>>> Log: Use write_psize instead of write_asize when doing >>>> vdev_space_update. Without this change the accounting of L2ARC >>>> usage would be wrong and give 16EB free space because the number >>>> became negative and overflows. >>>> >>>> Obtained from: FreeNAS (issue #6239) >> >>> First, a link to the issue would be more convenient for reviewers. >>> Here it is https://bugs.freenas.org/issues/6239 >> >>> Then, I would like to see a technical explanation for this change. >>> I could not find any explanation here or in the FreeNAS issue or in >>> the FreeNAS commit. >> >>> As far as I can see, all calls to vdev_space_update() in the ARC >>> code are passed l2hdr->b_asize or a sum of b_asize fields of >>> multiple buffers. Thus, I am really surprised with this change and >>> would like to see reasoning behind it. >> >> Hmm I think you are right that my change doesn't make sense but I >> can't remember the details either and suggests there is some other >> issues that was covered up by this. > > Maybe you have some other changes in FreeNAS and the change in question is > supposed to work along with them? > > Meanwhile, perhaps the discussed commit needs to be reverted? > >> It looks like that I was confused because the L2ARC clock hand >> advances by buf_p_sz (unrelated but it should really be called >> buf_a_size) and the way we calculate allocated L2ARC free. > > Agree about 'a' vs 'p'. And, BTW, we have some related changes in ClusterHQ > that I will upstream. > Not sure how this got resolved but I immediately recognise some of this since I run into this on one of my volumes. These are 2 ssd caches on a raidz2 pool, and they are certainly not 16EB. ........... cache - - - - - - diskid/DISK-S1ANNSADB75814Wp3 109G 187G 16.0E - 0% 172% diskid/DISK-S1ANNSADB75819Ep3 109G 166G 16.0E - 0% 152% --WjW From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 21:34:38 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0EC9ED86; Sat, 6 Dec 2014 21:34:38 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EF8783A6; Sat, 6 Dec 2014 21:34:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB6LYbeU049968; Sat, 6 Dec 2014 21:34:37 GMT (envelope-from kami@FreeBSD.org) Received: (from kami@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB6LYb2k049967; Sat, 6 Dec 2014 21:34:37 GMT (envelope-from kami@FreeBSD.org) Message-Id: <201412062134.sB6LYb2k049967@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kami set sender to kami@FreeBSD.org using -f From: Dominic Fandrey Date: Sat, 6 Dec 2014 21:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275569 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 21:34:38 -0000 Author: kami (ports committer) Date: Sat Dec 6 21:34:37 2014 New Revision: 275569 URL: https://svnweb.freebsd.org/changeset/base/275569 Log: Add mentor information for kami a.k.a. me. My mentors are cs and koobs. Differential Revision: https://reviews.freebsd.org/D975 Reviewed by: cs Approved by: cs Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sat Dec 6 20:39:25 2014 (r275568) +++ head/share/misc/committers-ports.dot Sat Dec 6 21:34:37 2014 (r275569) @@ -126,6 +126,7 @@ josef [label="Josef El-Rayes\njosef@Free jpaetzel [label="Josh Paetzel\njpaetzel@FreeBSD.org\n2008/09/05"] jsa [label="Joseph S. Atkinson\njsa@FreeBSD.org\n2010/07/15"] jylefort [label="Jean-Yves Lefort\njylefort@FreeBSD.org\n2005/04/12"] +kami [label="Dominic Fandrey\nkami@FreeBSD.org\n2014/09/09"] kevlo [label="Kevin Lo\nkevlo@FreeBSD.org\n2003/02/21"] kmoore [label="Kris Moore\nkmoore@FreeBSD.org\n2009/04/14"] knu [label="Akinori Musha\nknu@FreeBSD.org\n2000/03/22"] @@ -291,6 +292,8 @@ crees -> madpilot crees -> gblach crees -> tijl +cs -> kami + culot -> danilo culot -> jase culot -> marino @@ -389,6 +392,7 @@ knu -> maho knu -> nobutaka knu -> nork +koobs -> kami koobs -> xmj krion -> brooks From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 21:50:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91D762F7; Sat, 6 Dec 2014 21:50:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7ED2E6A2; Sat, 6 Dec 2014 21:50:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB6LoaER058104; Sat, 6 Dec 2014 21:50:36 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB6LoaYe058103; Sat, 6 Dec 2014 21:50:36 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201412062150.sB6LoaYe058103@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Dec 2014 21:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275570 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 21:50:36 -0000 Author: bapt Date: Sat Dec 6 21:50:35 2014 New Revision: 275570 URL: https://svnweb.freebsd.org/changeset/base/275570 Log: add some missing mentor->mentee relationship Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sat Dec 6 21:34:37 2014 (r275569) +++ head/share/misc/committers-ports.dot Sat Dec 6 21:50:35 2014 (r275570) @@ -265,6 +265,7 @@ bapt -> jlaffaye bapt -> marius bapt -> marino bapt -> rodrigo +bapt -> grembo beat -> decke beat -> marius @@ -342,6 +343,7 @@ fjoe -> osa flo -> bar flo -> jase +flo -> grembo flz -> garga flz -> johans From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 21:55:19 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EF195448; Sat, 6 Dec 2014 21:55:18 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC37979D; Sat, 6 Dec 2014 21:55:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB6LtI98060337; Sat, 6 Dec 2014 21:55:18 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB6LtIHi060336; Sat, 6 Dec 2014 21:55:18 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201412062155.sB6LtIHi060336@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Dec 2014 21:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275571 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 21:55:19 -0000 Author: bapt Date: Sat Dec 6 21:55:18 2014 New Revision: 275571 URL: https://svnweb.freebsd.org/changeset/base/275571 Log: Update to reflect the current members of portmgr Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Sat Dec 6 21:50:35 2014 (r275570) +++ head/share/misc/organization.dot Sat Dec 6 21:55:18 2014 (r275571) @@ -30,7 +30,7 @@ coresecretary [label="Core Team Secretar doccommitters [label="Doc/www Committers\ndoc-committers@FreeBSD.org"] doceng [label="Documentation Engineering Team\ndoceng@FreeBSD.org\ngjb, blackend,\ngabor, hrs"] portscommitters [label="Ports Committers\nports-committers@FreeBSD.org"] -portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nantoine, bapt, bdrewery,\ndecke, erwin, mat,\nmiwi, swills, tabthorpe"] +portmgr [label="Port Management Team\nportmgr@FreeBSD.org\nantoine, bapt, bdrewery,\ndecke, erwin, mat, swills"] portmgrsecretary [label="Port Management Team Secretary\nportmgr-secretary@FreeBSD.org\nculot"] re [label="Primary Release Engineering Team\nre@FreeBSD.org\nkib, blackend, jpaetzel, hrs, kensmith"] secteam [label="Security Team\nsecteam@FreeBSD.org\nsimon, qingli, delphij,\nremko, philip, stas, cperciva,\ncsjp, rwatson, miwi, bz"] From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 22:03:13 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 404DC62B; Sat, 6 Dec 2014 22:03:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CF52871; Sat, 6 Dec 2014 22:03:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB6M3DuJ065088; Sat, 6 Dec 2014 22:03:13 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB6M3DjD065086; Sat, 6 Dec 2014 22:03:13 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201412062203.sB6M3DjD065086@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sat, 6 Dec 2014 22:03:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275572 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 22:03:13 -0000 Author: sbruno Date: Sat Dec 6 22:03:12 2014 New Revision: 275572 URL: https://svnweb.freebsd.org/changeset/base/275572 Log: Add myself as a ports committer, mentored by bapt/bdrewery. Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sat Dec 6 21:55:18 2014 (r275571) +++ head/share/misc/committers-ports.dot Sat Dec 6 22:03:12 2014 (r275572) @@ -191,6 +191,7 @@ rodrigo [label="Rodrigo Osorio\nrodrigo@ romain [label="Romain Tartiere\nromain@FreeBSD.org\n2010/01/24"] sahil [label="Sahil Tandon\nsahil@FreeBSD.org\n2010/04/11"] sat [label="Andrew Pantyukhin\nsat@FreeBSD.org\n2006/05/06"] +sbruno [label="Sean Bruno\sbruno@FreeBSD.org\n2014/09/14"] sbz [label="Sofian Brabez\nsbz@FreeBSD.org\n2011/03/14"] scheidell [label="Michael Scheidell\nscheidell@FreeBSD.org\n2011/11/06"] sem [label="Sergey Matveychuk\nsem@FreeBSD.org\n2004/07/07"] @@ -257,15 +258,17 @@ avilla -> jhale avilla -> rakuco bdrewery -> dbn +bdrewery -> sbruno bdrewery -> trociny bapt -> bdrewery bapt -> eadler +bapt -> grembo bapt -> jlaffaye bapt -> marius bapt -> marino bapt -> rodrigo -bapt -> grembo +bapt -> sbruno beat -> decke beat -> marius From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 22:11:11 2014 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4E3E97A1; Sat, 6 Dec 2014 22:11:11 +0000 (UTC) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id F2C8D896; Sat, 6 Dec 2014 22:11:09 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id AAA08690; Sun, 07 Dec 2014 00:13:02 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1XxNZD-0004Ut-Ib; Sun, 07 Dec 2014 00:11:07 +0200 Message-ID: <54837EC3.3070609@FreeBSD.org> Date: Sun, 07 Dec 2014 00:10:11 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Willem Jan Withagen , d@delphij.net, Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r273060 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201410132039.s9DKdpmh055573@svn.freebsd.org> <546F57B1.2020602@FreeBSD.org> <546F9FC3.10402@delphij.net> <5474540D.2000607@FreeBSD.org> <54836BCC.2080707@digiware.nl> In-Reply-To: <54836BCC.2080707@digiware.nl> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 22:11:11 -0000 On 06/12/2014 22:49, Willem Jan Withagen wrote: > Not sure how this got resolved but I immediately recognise some of this > since I run into this on one of my volumes. > > These are 2 ssd caches on a raidz2 pool, and they are certainly not 16EB. > ........... > cache - - - - - - > diskid/DISK-S1ANNSADB75814Wp3 109G 187G 16.0E - 0% 172% > diskid/DISK-S1ANNSADB75819Ep3 109G 166G 16.0E - 0% 152% With what revision do you get see this? -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 22:28:52 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28E30CEE; Sat, 6 Dec 2014 22:28:52 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 161F1A18; Sat, 6 Dec 2014 22:28:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB6MSpjp076715; Sat, 6 Dec 2014 22:28:51 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB6MSpfZ076714; Sat, 6 Dec 2014 22:28:51 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201412062228.sB6MSpfZ076714@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 6 Dec 2014 22:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275573 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 22:28:52 -0000 Author: bapt Date: Sat Dec 6 22:28:51 2014 New Revision: 275573 URL: https://svnweb.freebsd.org/changeset/base/275573 Log: Fix rendering Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Sat Dec 6 22:03:12 2014 (r275572) +++ head/share/misc/committers-ports.dot Sat Dec 6 22:28:51 2014 (r275573) @@ -191,7 +191,7 @@ rodrigo [label="Rodrigo Osorio\nrodrigo@ romain [label="Romain Tartiere\nromain@FreeBSD.org\n2010/01/24"] sahil [label="Sahil Tandon\nsahil@FreeBSD.org\n2010/04/11"] sat [label="Andrew Pantyukhin\nsat@FreeBSD.org\n2006/05/06"] -sbruno [label="Sean Bruno\sbruno@FreeBSD.org\n2014/09/14"] +sbruno [label="Sean Bruno\nsbruno@FreeBSD.org\n2014/09/14"] sbz [label="Sofian Brabez\nsbz@FreeBSD.org\n2011/03/14"] scheidell [label="Michael Scheidell\nscheidell@FreeBSD.org\n2011/11/06"] sem [label="Sergey Matveychuk\nsem@FreeBSD.org\n2004/07/07"] From owner-svn-src-head@FreeBSD.ORG Sat Dec 6 22:57:20 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C296335; Sat, 6 Dec 2014 22:57:20 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49375CAB; Sat, 6 Dec 2014 22:57:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB6MvKas091419; Sat, 6 Dec 2014 22:57:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB6MvK6s091418; Sat, 6 Dec 2014 22:57:20 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201412062257.sB6MvK6s091418@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 6 Dec 2014 22:57:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275574 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 22:57:20 -0000 Author: tuexen Date: Sat Dec 6 22:57:19 2014 New Revision: 275574 URL: https://svnweb.freebsd.org/changeset/base/275574 Log: Include the received chunk padding when reporting an unknown chunk. MFC after: 1 week Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Dec 6 22:28:51 2014 (r275573) +++ head/sys/netinet/sctp_input.c Sat Dec 6 22:57:19 2014 (r275574) @@ -5477,10 +5477,12 @@ process_control_chunks: if ((ch->chunk_type & 0x40) && (stcb != NULL)) { struct mbuf *mm; struct sctp_paramhdr *phd; + int len; mm = sctp_get_mbuf_for_msg(sizeof(struct sctp_paramhdr), 0, M_NOWAIT, 1, MT_DATA); if (mm) { + len = min(SCTP_SIZE32(chk_length), (uint32_t) (length - *offset)); phd = mtod(mm, struct sctp_paramhdr *); /* * We cheat and use param type since @@ -5490,11 +5492,11 @@ process_control_chunks: * names. */ phd->param_type = htons(SCTP_CAUSE_UNRECOG_CHUNK); - phd->param_length = htons(chk_length + sizeof(*phd)); + phd->param_length = htons(len + sizeof(*phd)); SCTP_BUF_LEN(mm) = sizeof(*phd); - SCTP_BUF_NEXT(mm) = SCTP_M_COPYM(m, *offset, chk_length, M_NOWAIT); + SCTP_BUF_NEXT(mm) = SCTP_M_COPYM(m, *offset, len, M_NOWAIT); if (SCTP_BUF_NEXT(mm)) { - if (sctp_pad_lastmbuf(SCTP_BUF_NEXT(mm), SCTP_SIZE32(chk_length) - chk_length, NULL) == NULL) { + if (sctp_pad_lastmbuf(SCTP_BUF_NEXT(mm), SCTP_SIZE32(len) - len, NULL) == NULL) { sctp_m_freem(mm); } else { #ifdef SCTP_MBUF_LOGGING