From owner-svn-src-all@FreeBSD.ORG Sun Nov 30 04:50:15 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 06:04:01 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 08:43:56 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 10:36:30 2014 Return-Path: Delivered-To: svn-src-all@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 9ED18BB8; Sun, 30 Nov 2014 10: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 8A343240; Sun, 30 Nov 2014 10: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 sAUAaUHR089707; Sun, 30 Nov 2014 10:36:30 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAUAaUZ6089706; Sun, 30 Nov 2014 10:36:30 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201411301036.sAUAaUZ6089706@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 30 Nov 2014 10:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275310 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 30 Nov 2014 10:36:30 -0000 Author: trasz Date: Sun Nov 30 10:36:29 2014 New Revision: 275310 URL: https://svnweb.freebsd.org/changeset/base/275310 Log: MFC r273918: Change the default log level for iSCSI target from 3 to 1. It should have been 1 from the beginning; not sure how it ended up at 3. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Sun Nov 30 10:01:47 2014 (r275309) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Sun Nov 30 10:36:29 2014 (r275310) @@ -84,7 +84,7 @@ static uma_zone_t cfiscsi_data_wait_zone SYSCTL_NODE(_kern_cam_ctl, OID_AUTO, iscsi, CTLFLAG_RD, 0, "CAM Target Layer iSCSI Frontend"); -static int debug = 3; +static int debug = 1; TUNABLE_INT("kern.cam.ctl.iscsi.debug", &debug); SYSCTL_INT(_kern_cam_ctl_iscsi, OID_AUTO, debug, CTLFLAG_RWTUN, &debug, 1, "Enable debug messages"); From owner-svn-src-all@FreeBSD.ORG Sun Nov 30 11:02:09 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 11:22:40 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 12:11:02 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 12:20:25 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 12:25:05 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 12:32:17 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 12:34:49 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 12:52:39 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 13:13:47 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 13:24:26 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 13:28:00 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 13:40:59 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 13:43:53 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 16:36:27 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 17:27:25 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 17:29:50 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 17:55:07 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 18:11:05 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 18:38:06 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 18:59:22 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 19:03:16 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 19:03:49 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 19:32:01 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 20:12:49 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 20:20:56 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 21:33:51 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sun Nov 30 23:21:33 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 02:59:06 2014 Return-Path: Delivered-To: svn-src-all@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 01EB97F2; Mon, 1 Dec 2014 02:59: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 E26C28CE; Mon, 1 Dec 2014 02:59: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 sB12x5rr047560; Mon, 1 Dec 2014 02:59:05 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB12x5UA047559; Mon, 1 Dec 2014 02:59:05 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201412010259.sB12x5UA047559@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Mon, 1 Dec 2014 02:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275348 - stable/10/usr.bin/dc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 02:59:06 -0000 Author: kevlo Date: Mon Dec 1 02:59:05 2014 New Revision: 275348 URL: https://svnweb.freebsd.org/changeset/base/275348 Log: MFC r275162: Init array field in the proper place. Obtained from: OpenBSD Modified: stable/10/usr.bin/dc/stack.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/dc/stack.c ============================================================================== --- stable/10/usr.bin/dc/stack.c Sun Nov 30 20:20:55 2014 (r275347) +++ stable/10/usr.bin/dc/stack.c Mon Dec 1 02:59:05 2014 (r275348) @@ -137,14 +137,12 @@ stack_swap(struct stack *stack) static void stack_grow(struct stack *stack) { - size_t i, new_size; + size_t new_size; if (++stack->sp == stack->size) { new_size = stack->size * 2 + 1; stack->stack = brealloc(stack->stack, new_size * sizeof(*stack->stack)); - for (i = stack->size; i < new_size; i++) - stack->stack[i].array = NULL; stack->size = new_size; } } @@ -156,6 +154,7 @@ stack_pushnumber(struct stack *stack, st stack_grow(stack); stack->stack[stack->sp].type = BCODE_NUMBER; stack->stack[stack->sp].u.num = b; + stack->stack[stack->sp].array = NULL; } void @@ -165,6 +164,7 @@ stack_pushstring(struct stack *stack, ch stack_grow(stack); stack->stack[stack->sp].type = BCODE_STRING; stack->stack[stack->sp].u.string = string; + stack->stack[stack->sp].array = NULL; } void From owner-svn-src-all@FreeBSD.ORG Mon Dec 1 03:01:03 2014 Return-Path: Delivered-To: svn-src-all@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 23F969A4; Mon, 1 Dec 2014 03:01:03 +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 D86BD958; Mon, 1 Dec 2014 03:01: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 sB1311Z3049104; Mon, 1 Dec 2014 03:01:01 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1311On049103; Mon, 1 Dec 2014 03:01:01 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201412010301.sB1311On049103@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Mon, 1 Dec 2014 03:01:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275349 - stable/9/usr.bin/dc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 03:01:03 -0000 Author: kevlo Date: Mon Dec 1 03:01:01 2014 New Revision: 275349 URL: https://svnweb.freebsd.org/changeset/base/275349 Log: MFC r275162: Init array field in the proper place. Obtained from: OpenBSD Modified: stable/9/usr.bin/dc/stack.c (contents, props changed) Modified: stable/9/usr.bin/dc/stack.c ============================================================================== --- stable/9/usr.bin/dc/stack.c Mon Dec 1 02:59:05 2014 (r275348) +++ stable/9/usr.bin/dc/stack.c Mon Dec 1 03:01:01 2014 (r275349) @@ -137,14 +137,12 @@ stack_swap(struct stack *stack) static void stack_grow(struct stack *stack) { - size_t i, new_size; + size_t new_size; if (++stack->sp == stack->size) { new_size = stack->size * 2 + 1; stack->stack = brealloc(stack->stack, new_size * sizeof(*stack->stack)); - for (i = stack->size; i < new_size; i++) - stack->stack[i].array = NULL; stack->size = new_size; } } @@ -156,6 +154,7 @@ stack_pushnumber(struct stack *stack, st stack_grow(stack); stack->stack[stack->sp].type = BCODE_NUMBER; stack->stack[stack->sp].u.num = b; + stack->stack[stack->sp].array = NULL; } void @@ -165,6 +164,7 @@ stack_pushstring(struct stack *stack, ch stack_grow(stack); stack->stack[stack->sp].type = BCODE_STRING; stack->stack[stack->sp].u.string = string; + stack->stack[stack->sp].array = NULL; } void From owner-svn-src-all@FreeBSD.ORG Mon Dec 1 03:04:16 2014 Return-Path: Delivered-To: svn-src-all@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 B677EC59; Mon, 1 Dec 2014 03:04: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 8A3DEA90; Mon, 1 Dec 2014 03:04: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 sB134GAc053051; Mon, 1 Dec 2014 03:04:16 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB134GSE053049; Mon, 1 Dec 2014 03:04:16 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201412010304.sB134GSE053049@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Mon, 1 Dec 2014 03:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275350 - stable/10/sys/contrib/dev/ral X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 03:04:16 -0000 Author: kevlo Date: Mon Dec 1 03:04:15 2014 New Revision: 275350 URL: https://svnweb.freebsd.org/changeset/base/275350 Log: MFC r275003: Add missing headers needed by write(). Modified: stable/10/sys/contrib/dev/ral/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/dev/ral/Makefile ============================================================================== --- stable/10/sys/contrib/dev/ral/Makefile Mon Dec 1 03:01:01 2014 (r275349) +++ stable/10/sys/contrib/dev/ral/Makefile Mon Dec 1 03:04:15 2014 (r275350) @@ -3,7 +3,8 @@ FILES= rt2561s.fw.uu rt2561.fw.uu rt2661.fw.uu rt2860.fw.uu rt2561s.fw.uu: microcode.h LICENSE - (echo '#include '; \ + (echo '#include '; \ + echo '#include '; \ cat microcode.h; \ echo 'int main(void) { \ write(1, rt2561s, sizeof(rt2561s)); return 0; \ @@ -11,7 +12,8 @@ rt2561s.fw.uu: microcode.h LICENSE (sed 's/^/# /' LICENSE; ./build | uuencode rt2561s.fw) > ${.TARGET} rt2561.fw.uu: microcode.h LICENSE - (echo '#include '; \ + (echo '#include '; \ + echo '#include '; \ cat microcode.h; \ echo 'int main(void) { \ write(1, rt2561, sizeof(rt2561)); return 0; \ @@ -19,7 +21,8 @@ rt2561.fw.uu: microcode.h LICENSE (sed 's/^/# /' LICENSE; ./build | uuencode rt2561.fw) > ${.TARGET} rt2661.fw.uu: microcode.h LICENSE - (echo '#include '; \ + (echo '#include '; \ + echo '#include '; \ cat microcode.h; \ echo 'int main(void) { \ write(1, rt2661, sizeof(rt2661)); return 0; \ @@ -27,7 +30,8 @@ rt2661.fw.uu: microcode.h LICENSE (sed 's/^/# /' LICENSE; ./build | uuencode rt2661.fw) > ${.TARGET} rt2860.fw.uu: microcode.h LICENSE - (echo '#include '; \ + (echo '#include '; \ + echo '#include '; \ cat microcode.h; \ echo 'int main(void) { \ write(1, rt2860, sizeof(rt2860)); return 0; \ From owner-svn-src-all@FreeBSD.ORG Mon Dec 1 07:34:26 2014 Return-Path: Delivered-To: svn-src-all@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 C9845A02; Mon, 1 Dec 2014 07:34: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 9A939E84; Mon, 1 Dec 2014 07:34: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 sB17YQTG076236; Mon, 1 Dec 2014 07:34:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB17YQ0H076235; Mon, 1 Dec 2014 07:34:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412010734.sB17YQ0H076235@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 07:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275351 - stable/10/sys/dev/sound/usb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 07:34:26 -0000 Author: hselasky Date: Mon Dec 1 07:34:25 2014 New Revision: 275351 URL: https://svnweb.freebsd.org/changeset/base/275351 Log: MFC r274918: Don't use the synchronization endpoint unless referenced by the isochronous endpoint descriptor used for the data transfers, hence the synchronization feature might not be supposed to be supported [yet]. This makes seamless playback synced with the USB HOST clock work with the DN32-USB module for Midas audio systems and possibly other similar products from Klark Teknik. Modified: stable/10/sys/dev/sound/usb/uaudio.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/10/sys/dev/sound/usb/uaudio.c Mon Dec 1 03:04:15 2014 (r275350) +++ stable/10/sys/dev/sound/usb/uaudio.c Mon Dec 1 07:34:25 2014 (r275351) @@ -195,6 +195,7 @@ struct uaudio_chan_alt { uint8_t iface_index; uint8_t iface_alt_index; uint8_t channels; + uint8_t enable_sync; }; struct uaudio_chan { @@ -1804,6 +1805,14 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan_alt->iface_index = curidx; chan_alt->iface_alt_index = alt_index; + if (UEP_HAS_SYNCADDR(ed1) && ed1->bSynchAddress != 0) { + DPRINTF("Sync endpoint will be used, if present\n"); + chan_alt->enable_sync = 1; + } else { + DPRINTF("Sync endpoint will not be used\n"); + chan_alt->enable_sync = 0; + } + usbd_set_parent_iface(sc->sc_udev, curidx, sc->sc_mixer_iface_index); @@ -2080,8 +2089,10 @@ tr_transferred: chn_intr(ch->pcm_ch); /* start SYNC transfer, if any */ - if ((ch->last_sync_time++ & 7) == 0) - usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); + if (ch->usb_alt[ch->cur_alt].enable_sync != 0) { + if ((ch->last_sync_time++ & 7) == 0) + usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); + } case USB_ST_SETUP: mfl = usbd_xfer_max_framelen(xfer); From owner-svn-src-all@FreeBSD.ORG Mon Dec 1 07:36:01 2014 Return-Path: Delivered-To: svn-src-all@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 8F79DB4A; Mon, 1 Dec 2014 07:36: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 61326E98; Mon, 1 Dec 2014 07:36: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 sB17a1Tk076502; Mon, 1 Dec 2014 07:36:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB17a1cu076501; Mon, 1 Dec 2014 07:36:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412010736.sB17a1cu076501@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 07:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275352 - stable/9/sys/dev/sound/usb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 07:36:01 -0000 Author: hselasky Date: Mon Dec 1 07:36:00 2014 New Revision: 275352 URL: https://svnweb.freebsd.org/changeset/base/275352 Log: MFC r274918: Don't use the synchronization endpoint unless referenced by the isochronous endpoint descriptor used for the data transfers, hence the synchronization feature might not be supposed to be supported [yet]. This makes seamless playback synced with the USB HOST clock work with the DN32-USB module for Midas audio systems and possibly other similar products from Klark Teknik. Modified: stable/9/sys/dev/sound/usb/uaudio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/9/sys/dev/sound/usb/uaudio.c Mon Dec 1 07:34:25 2014 (r275351) +++ stable/9/sys/dev/sound/usb/uaudio.c Mon Dec 1 07:36:00 2014 (r275352) @@ -195,6 +195,7 @@ struct uaudio_chan_alt { uint8_t iface_index; uint8_t iface_alt_index; uint8_t channels; + uint8_t enable_sync; }; struct uaudio_chan { @@ -1804,6 +1805,14 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan_alt->iface_index = curidx; chan_alt->iface_alt_index = alt_index; + if (UEP_HAS_SYNCADDR(ed1) && ed1->bSynchAddress != 0) { + DPRINTF("Sync endpoint will be used, if present\n"); + chan_alt->enable_sync = 1; + } else { + DPRINTF("Sync endpoint will not be used\n"); + chan_alt->enable_sync = 0; + } + usbd_set_parent_iface(sc->sc_udev, curidx, sc->sc_mixer_iface_index); @@ -2080,8 +2089,10 @@ tr_transferred: chn_intr(ch->pcm_ch); /* start SYNC transfer, if any */ - if ((ch->last_sync_time++ & 7) == 0) - usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); + if (ch->usb_alt[ch->cur_alt].enable_sync != 0) { + if ((ch->last_sync_time++ & 7) == 0) + usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); + } case USB_ST_SETUP: mfl = usbd_xfer_max_framelen(xfer); From owner-svn-src-all@FreeBSD.ORG Mon Dec 1 07:37:30 2014 Return-Path: Delivered-To: svn-src-all@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 8B239C9D; Mon, 1 Dec 2014 07:37: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 5D095EAE; Mon, 1 Dec 2014 07:37: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 sB17bUUU076726; Mon, 1 Dec 2014 07:37:30 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB17bUeH076725; Mon, 1 Dec 2014 07:37:30 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412010737.sB17bUeH076725@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 07:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r275353 - stable/8/sys/dev/sound/usb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 07:37:30 -0000 Author: hselasky Date: Mon Dec 1 07:37:29 2014 New Revision: 275353 URL: https://svnweb.freebsd.org/changeset/base/275353 Log: MFC r274918: Don't use the synchronization endpoint unless referenced by the isochronous endpoint descriptor used for the data transfers, hence the synchronization feature might not be supposed to be supported [yet]. This makes seamless playback synced with the USB HOST clock work with the DN32-USB module for Midas audio systems and possibly other similar products from Klark Teknik. Modified: stable/8/sys/dev/sound/usb/uaudio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/usb/ (props changed) Modified: stable/8/sys/dev/sound/usb/uaudio.c ============================================================================== --- stable/8/sys/dev/sound/usb/uaudio.c Mon Dec 1 07:36:00 2014 (r275352) +++ stable/8/sys/dev/sound/usb/uaudio.c Mon Dec 1 07:37:29 2014 (r275353) @@ -195,6 +195,7 @@ struct uaudio_chan_alt { uint8_t iface_index; uint8_t iface_alt_index; uint8_t channels; + uint8_t enable_sync; }; struct uaudio_chan { @@ -1804,6 +1805,14 @@ uaudio_chan_fill_info_sub(struct uaudio_ chan_alt->iface_index = curidx; chan_alt->iface_alt_index = alt_index; + if (UEP_HAS_SYNCADDR(ed1) && ed1->bSynchAddress != 0) { + DPRINTF("Sync endpoint will be used, if present\n"); + chan_alt->enable_sync = 1; + } else { + DPRINTF("Sync endpoint will not be used\n"); + chan_alt->enable_sync = 0; + } + usbd_set_parent_iface(sc->sc_udev, curidx, sc->sc_mixer_iface_index); @@ -2080,8 +2089,10 @@ tr_transferred: chn_intr(ch->pcm_ch); /* start SYNC transfer, if any */ - if ((ch->last_sync_time++ & 7) == 0) - usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); + if (ch->usb_alt[ch->cur_alt].enable_sync != 0) { + if ((ch->last_sync_time++ & 7) == 0) + usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); + } case USB_ST_SETUP: mfl = usbd_xfer_max_framelen(xfer); From owner-svn-src-all@FreeBSD.ORG Mon Dec 1 08:14:27 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 10:17:24 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 11:45:36 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 12:17:43 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 12:30:00 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 12:57:11 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 12:59:17 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 13:07:51 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 13:55:46 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 14:48:39 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 14:48:39 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:02:50 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:09:52 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:15:25 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:21:55 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:26:09 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:29:29 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:34:28 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:39:06 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:43:06 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:45:05 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:48:39 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:49:21 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:49:24 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:55:59 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 15:56:51 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 16:05:46 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 16:07:33 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 16:09:00 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 16:10:04 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 16:10:45 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 16:13:09 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 16:28:35 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 16:31:09 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 16:37:22 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 16:39:22 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 16:46:33 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 17:36:11 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 17:49:47 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 17:51:17 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 19:02:48 2014 Return-Path: Delivered-To: svn-src-all@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 72CF4738 for ; Mon, 1 Dec 2014 19:02:48 +0000 (UTC) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) (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 D30A3967 for ; Mon, 1 Dec 2014 19:02:47 +0000 (UTC) Received: by mail-wi0-f178.google.com with SMTP id hi2so18434853wib.17 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=BF4gfkauskR1TEgx7eRNNsMsydCj/XPmvlRi4/HgkIIXEQr/ARQe0hx+RuBoHDlgNP CHPPrEUJFWluj6BaGdw0f5K4DwX+g8ihJ2QAoDeYboQKv7Vcyjdv4wb/FNEsW+Wztpc+ ePFg/BmOYUigF2WhKx8GIDFYbIHEmD/olqhcriuIEuYwb7gVlckDx249HA7QtX4Za2Bj JNwquHmhhhcDC1Khco8RZ2/OAS3JzWYBlze1hV9T5V3eW+zTWv99QxEGbeMz+jh1mtbX 13CsQPka/cAtrhzPEDWjtSVzWhaZpbD/kKkRz2WfUC/r4N+MMIZVtoT012a93YyS6v29 rShw== X-Gm-Message-State: ALoCoQmJodw6aKFlpNVizFoQXq7EBwpaM0HFnUznOwjSY4XbCEX6syB8r7pWX1i2T1X0kyr6s8ob 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 19:17:14 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 19:28:01 2014 Return-Path: Delivered-To: svn-src-all@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 03411100 for ; Mon, 1 Dec 2014 19:28:01 +0000 (UTC) Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) (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 84D56BC6 for ; Mon, 1 Dec 2014 19:28:00 +0000 (UTC) Received: by mail-wg0-f53.google.com with SMTP id l18so14848082wgh.26 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=AOYU7M7GyZLGqgG41IwPpdqWZA2wBHSTTGsEpK3pvoUtad8dt/r+hG8uMJvM9yPuGW guCan4+HWslLwirjmsbdA/QzMH+4L5CGbHVRJTe0JD0y/a4qgtzuZcZslBk2NGmZo8gJ M10HyPtiQtRsihASi2QjXhAzeYXe4XLC7ZBCaLHVPJm3fbGKWSQmS+7sMUZrALSolWSq ZuhJ6Eugep/zBPsXNVJKWYXYAKB/wG7nbk0PqDd2My3NW5WS2WLlxa4y0c7K7APa0UtU xfI08i1n6yAMol5RWs9VT2/j0HZdVKbyIOrKpgBhT8vYSLBtpmhgfX5js3d1g6JTuZUg gCAg== X-Gm-Message-State: ALoCoQkWE1bacudF9qZpCBz9PU3UuAy9Am5gb9msPjEqaQoPOpDJWz4viVfmPDqI9Ly+/2i/NUnk 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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 19:28:01 -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-all@FreeBSD.ORG Mon Dec 1 19:39:39 2014 Return-Path: Delivered-To: svn-src-all@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 4DDD0561; Mon, 1 Dec 2014 19:39: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 3A2E0CBA; Mon, 1 Dec 2014 19:39: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 sB1JddOI015346; Mon, 1 Dec 2014 19:39:39 GMT (envelope-from davidch@FreeBSD.org) Received: (from davidch@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB1JddA9015345; Mon, 1 Dec 2014 19:39:39 GMT (envelope-from davidch@FreeBSD.org) Message-Id: <201412011939.sB1JddA9015345@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: davidch set sender to davidch@FreeBSD.org using -f From: David Christensen Date: Mon, 1 Dec 2014 19:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r275375 - svnadmin/conf X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Dec 2014 19:39:39 -0000 Author: davidch Date: Mon Dec 1 19:39:38 2014 New Revision: 275375 URL: https://svnweb.freebsd.org/changeset/base/275375 Log: Release edavis from mentorship. Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Mon Dec 1 17:51:16 2014 (r275374) +++ svnadmin/conf/mentors Mon Dec 1 19:39:38 2014 (r275375) @@ -15,7 +15,6 @@ agc scottl Co-mentor: emax benl philip Co-mentor: simon carl jimharris cherry gibbs -edavis davidch eri gnn Co-mentor: thompsa ganbold stas jceel wkoszek Co-mentor: cognet From owner-svn-src-all@FreeBSD.ORG Mon Dec 1 19:48:23 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 20:51:02 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 21:04:27 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 21:07:36 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 21:13:48 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 21:36:26 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 22:09:33 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Mon Dec 1 22:39:36 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 00:23:27 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 01:30:54 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 02:11:10 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 02:16:31 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 02:32:29 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 02:41:44 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 04:20:56 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 05:28:41 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 05:41:05 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 06:11:33 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 06:24:46 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 07:34:08 2014 Return-Path: Delivered-To: svn-src-all@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 2F7578A0; Tue, 2 Dec 2014 07:34: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 19C53E77; Tue, 2 Dec 2014 07:34: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 sB27Y8lc057388; Tue, 2 Dec 2014 07:34:08 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB27Y6hC057381; Tue, 2 Dec 2014 07:34:06 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201412020734.sB27Y6hC057381@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 07:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275397 - vendor/mdocml/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 07:34:08 -0000 Author: bapt Date: Tue Dec 2 07:34:06 2014 New Revision: 275397 URL: https://svnweb.freebsd.org/changeset/base/275397 Log: Import CVS version of mandoc as of 20141201 Added: vendor/mdocml/dist/compat_fts.c (contents, props changed) vendor/mdocml/dist/compat_fts.h (contents, props changed) vendor/mdocml/dist/configure.local.example vendor/mdocml/dist/man.1 (contents, props changed) vendor/mdocml/dist/test-dirent-namlen.c (contents, props changed) vendor/mdocml/dist/test-fts.c (contents, props changed) vendor/mdocml/dist/test-sqlite3.c (contents, props changed) vendor/mdocml/dist/test-wchar.c (contents, props changed) Deleted: vendor/mdocml/dist/apropos.c vendor/mdocml/dist/arch.c vendor/mdocml/dist/arch.in vendor/mdocml/dist/att.in vendor/mdocml/dist/config.h.post vendor/mdocml/dist/config.h.pre vendor/mdocml/dist/preconv.1 vendor/mdocml/dist/vol.c vendor/mdocml/dist/vol.in Modified: vendor/mdocml/dist/INSTALL vendor/mdocml/dist/LICENSE vendor/mdocml/dist/Makefile vendor/mdocml/dist/Makefile.depend vendor/mdocml/dist/NEWS vendor/mdocml/dist/TODO vendor/mdocml/dist/apropos.1 vendor/mdocml/dist/att.c vendor/mdocml/dist/cgi.c vendor/mdocml/dist/chars.c vendor/mdocml/dist/chars.in vendor/mdocml/dist/compat_fgetln.c vendor/mdocml/dist/compat_getsubopt.c vendor/mdocml/dist/compat_ohash.c vendor/mdocml/dist/compat_reallocarray.c vendor/mdocml/dist/compat_sqlite3_errstr.c vendor/mdocml/dist/compat_strcasestr.c vendor/mdocml/dist/compat_strlcat.c vendor/mdocml/dist/compat_strlcpy.c vendor/mdocml/dist/compat_strsep.c vendor/mdocml/dist/configure vendor/mdocml/dist/demandoc.1 vendor/mdocml/dist/demandoc.c vendor/mdocml/dist/eqn.7 vendor/mdocml/dist/eqn.c vendor/mdocml/dist/eqn_html.c vendor/mdocml/dist/eqn_term.c vendor/mdocml/dist/example.style.css vendor/mdocml/dist/html.c vendor/mdocml/dist/html.h vendor/mdocml/dist/lib.c vendor/mdocml/dist/libman.h vendor/mdocml/dist/libmandoc.h vendor/mdocml/dist/libmdoc.h vendor/mdocml/dist/libroff.h vendor/mdocml/dist/main.c vendor/mdocml/dist/main.h vendor/mdocml/dist/makewhatis.8 vendor/mdocml/dist/man.c vendor/mdocml/dist/man.cgi.8 vendor/mdocml/dist/man.h vendor/mdocml/dist/man_hash.c vendor/mdocml/dist/man_html.c vendor/mdocml/dist/man_macro.c vendor/mdocml/dist/man_term.c vendor/mdocml/dist/man_validate.c vendor/mdocml/dist/mandoc.1 vendor/mdocml/dist/mandoc.3 vendor/mdocml/dist/mandoc.c vendor/mdocml/dist/mandoc.db.5 vendor/mdocml/dist/mandoc.h vendor/mdocml/dist/mandoc_aux.c vendor/mdocml/dist/mandoc_escape.3 vendor/mdocml/dist/mandocdb.c vendor/mdocml/dist/manpage.c vendor/mdocml/dist/manpath.c vendor/mdocml/dist/mansearch.c vendor/mdocml/dist/mansearch.h vendor/mdocml/dist/mansearch_const.c vendor/mdocml/dist/mchars_alloc.3 vendor/mdocml/dist/mdoc.7 vendor/mdocml/dist/mdoc.c vendor/mdocml/dist/mdoc_argv.c vendor/mdocml/dist/mdoc_hash.c vendor/mdocml/dist/mdoc_html.c vendor/mdocml/dist/mdoc_macro.c vendor/mdocml/dist/mdoc_man.c vendor/mdocml/dist/mdoc_term.c vendor/mdocml/dist/mdoc_validate.c vendor/mdocml/dist/msec.c vendor/mdocml/dist/msec.in vendor/mdocml/dist/out.c vendor/mdocml/dist/out.h vendor/mdocml/dist/preconv.c vendor/mdocml/dist/read.c vendor/mdocml/dist/roff.7 vendor/mdocml/dist/roff.c vendor/mdocml/dist/st.c vendor/mdocml/dist/st.in vendor/mdocml/dist/style.css vendor/mdocml/dist/tbl.7 vendor/mdocml/dist/tbl.c vendor/mdocml/dist/tbl_data.c vendor/mdocml/dist/tbl_html.c vendor/mdocml/dist/tbl_layout.c vendor/mdocml/dist/tbl_opts.c vendor/mdocml/dist/tbl_term.c vendor/mdocml/dist/term.c vendor/mdocml/dist/term.h vendor/mdocml/dist/term_ascii.c vendor/mdocml/dist/term_ps.c vendor/mdocml/dist/test-getsubopt.c vendor/mdocml/dist/tree.c Modified: vendor/mdocml/dist/INSTALL ============================================================================== --- vendor/mdocml/dist/INSTALL Tue Dec 2 06:24:45 2014 (r275396) +++ vendor/mdocml/dist/INSTALL Tue Dec 2 07:34:06 2014 (r275397) @@ -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: vendor/mdocml/dist/LICENSE ============================================================================== --- vendor/mdocml/dist/LICENSE Tue Dec 2 06:24:45 2014 (r275396) +++ vendor/mdocml/dist/LICENSE Tue Dec 2 07:34:06 2014 (r275397) @@ -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: vendor/mdocml/dist/Makefile ============================================================================== --- vendor/mdocml/dist/Makefile Tue Dec 2 06:24:45 2014 (r275396) +++ vendor/mdocml/dist/Makefile Tue Dec 2 07:34:06 2014 (r275397) @@ -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: vendor/mdocml/dist/Makefile.depend ============================================================================== --- vendor/mdocml/dist/Makefile.depend Tue Dec 2 06:24:45 2014 (r275396) +++ vendor/mdocml/dist/Makefile.depend Tue Dec 2 07:34:06 2014 (r275397) @@ -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: vendor/mdocml/dist/NEWS ============================================================================== --- vendor/mdocml/dist/NEWS Tue Dec 2 06:24:45 2014 (r275396) +++ vendor/mdocml/dist/NEWS Tue Dec 2 07:34:06 2014 (r275397) @@ -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: vendor/mdocml/dist/TODO ============================================================================== --- vendor/mdocml/dist/TODO Tue Dec 2 06:24:45 2014 (r275396) +++ vendor/mdocml/dist/TODO Tue Dec 2 07:34:06 2014 (r275397) @@ -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 *** + +- consider whether can be used for Ar Dv Er Ev Fa Va. + from bentley@ Wed, 13 Aug 2014 09:17:55 -0600 - check https://github.com/trentm/mdocml @@ -287,42 +397,57 @@ * formatting issues: gratuitous differences ************************************************************************ +- .Fn reopens a new scope after punctuation in mandoc, + but closes its scope for good in groff. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 2 07:36:04 2014 Return-Path: Delivered-To: svn-src-all@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 8EB989E7; Tue, 2 Dec 2014 07:36: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 78678E88; Tue, 2 Dec 2014 07:36: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 sB27a4r9057709; Tue, 2 Dec 2014 07:36:04 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB27a33S057702; Tue, 2 Dec 2014 07:36:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201412020736.sB27a33S057702@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 07:36:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275398 - vendor/mdocml/20141201 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 07:36:04 -0000 Author: bapt Date: Tue Dec 2 07:36:02 2014 New Revision: 275398 URL: https://svnweb.freebsd.org/changeset/base/275398 Log: Tag import for mandoc cvs 20141201 Added: vendor/mdocml/20141201/ - copied from r273756, vendor/mdocml/dist/ vendor/mdocml/20141201/INSTALL - copied unchanged from r275397, vendor/mdocml/dist/INSTALL vendor/mdocml/20141201/LICENSE - copied unchanged from r275397, vendor/mdocml/dist/LICENSE vendor/mdocml/20141201/Makefile.depend - copied unchanged from r275397, vendor/mdocml/dist/Makefile.depend vendor/mdocml/20141201/cgi.h.example - copied unchanged from r274876, vendor/mdocml/dist/cgi.h.example vendor/mdocml/20141201/compat_fts.c - copied unchanged from r275397, vendor/mdocml/dist/compat_fts.c vendor/mdocml/20141201/compat_fts.h - copied unchanged from r275397, vendor/mdocml/dist/compat_fts.h vendor/mdocml/20141201/compat_ohash.c - copied unchanged from r275397, vendor/mdocml/dist/compat_ohash.c vendor/mdocml/20141201/compat_ohash.h - copied unchanged from r274876, vendor/mdocml/dist/compat_ohash.h vendor/mdocml/20141201/compat_reallocarray.c - copied unchanged from r275397, vendor/mdocml/dist/compat_reallocarray.c vendor/mdocml/20141201/compat_sqlite3_errstr.c - copied unchanged from r275397, vendor/mdocml/dist/compat_sqlite3_errstr.c vendor/mdocml/20141201/compat_strcasestr.c - copied unchanged from r275397, vendor/mdocml/dist/compat_strcasestr.c vendor/mdocml/20141201/compat_strsep.c - copied unchanged from r275397, vendor/mdocml/dist/compat_strsep.c vendor/mdocml/20141201/configure - copied unchanged from r275397, vendor/mdocml/dist/configure vendor/mdocml/20141201/configure.local.example - copied unchanged from r275397, vendor/mdocml/dist/configure.local.example vendor/mdocml/20141201/makewhatis.8 - copied unchanged from r275397, vendor/mdocml/dist/makewhatis.8 vendor/mdocml/20141201/man.1 - copied unchanged from r275397, vendor/mdocml/dist/man.1 vendor/mdocml/20141201/man.cgi.8 - copied unchanged from r275397, vendor/mdocml/dist/man.cgi.8 vendor/mdocml/20141201/mandoc.db.5 - copied unchanged from r275397, vendor/mdocml/dist/mandoc.db.5 vendor/mdocml/20141201/mandoc_aux.c - copied unchanged from r275397, vendor/mdocml/dist/mandoc_aux.c vendor/mdocml/20141201/mandoc_aux.h - copied unchanged from r274876, vendor/mdocml/dist/mandoc_aux.h vendor/mdocml/20141201/mandoc_escape.3 - copied unchanged from r275397, vendor/mdocml/dist/mandoc_escape.3 vendor/mdocml/20141201/mandoc_html.3 - copied unchanged from r274876, vendor/mdocml/dist/mandoc_html.3 vendor/mdocml/20141201/mandoc_malloc.3 - copied unchanged from r274876, vendor/mdocml/dist/mandoc_malloc.3 vendor/mdocml/20141201/manpage.c - copied unchanged from r275397, vendor/mdocml/dist/manpage.c vendor/mdocml/20141201/mansearch.3 - copied unchanged from r274876, vendor/mdocml/dist/mansearch.3 vendor/mdocml/20141201/mansearch.c - copied unchanged from r275397, vendor/mdocml/dist/mansearch.c vendor/mdocml/20141201/mansearch.h - copied unchanged from r275397, vendor/mdocml/dist/mansearch.h vendor/mdocml/20141201/mansearch_const.c - copied unchanged from r275397, vendor/mdocml/dist/mansearch_const.c vendor/mdocml/20141201/mchars_alloc.3 - copied unchanged from r275397, vendor/mdocml/dist/mchars_alloc.3 vendor/mdocml/20141201/test-dirent-namlen.c - copied unchanged from r275397, vendor/mdocml/dist/test-dirent-namlen.c vendor/mdocml/20141201/test-fts.c - copied unchanged from r275397, vendor/mdocml/dist/test-fts.c vendor/mdocml/20141201/test-ohash.c - copied unchanged from r274876, vendor/mdocml/dist/test-ohash.c vendor/mdocml/20141201/test-reallocarray.c - copied unchanged from r274876, vendor/mdocml/dist/test-reallocarray.c vendor/mdocml/20141201/test-sqlite3.c - copied unchanged from r275397, vendor/mdocml/dist/test-sqlite3.c vendor/mdocml/20141201/test-sqlite3_errstr.c - copied unchanged from r274876, vendor/mdocml/dist/test-sqlite3_errstr.c vendor/mdocml/20141201/test-strcasestr.c - copied unchanged from r274876, vendor/mdocml/dist/test-strcasestr.c vendor/mdocml/20141201/test-strsep.c - copied unchanged from r274876, vendor/mdocml/dist/test-strsep.c vendor/mdocml/20141201/test-wchar.c - copied unchanged from r275397, vendor/mdocml/dist/test-wchar.c Replaced: vendor/mdocml/20141201/Makefile - copied unchanged from r275397, vendor/mdocml/dist/Makefile vendor/mdocml/20141201/NEWS - copied unchanged from r275397, vendor/mdocml/dist/NEWS vendor/mdocml/20141201/TODO - copied unchanged from r275397, vendor/mdocml/dist/TODO vendor/mdocml/20141201/apropos.1 - copied unchanged from r275397, vendor/mdocml/dist/apropos.1 vendor/mdocml/20141201/att.c - copied unchanged from r275397, vendor/mdocml/dist/att.c vendor/mdocml/20141201/cgi.c - copied unchanged from r275397, vendor/mdocml/dist/cgi.c vendor/mdocml/20141201/chars.c - copied unchanged from r275397, vendor/mdocml/dist/chars.c vendor/mdocml/20141201/chars.in - copied unchanged from r275397, vendor/mdocml/dist/chars.in vendor/mdocml/20141201/compat_fgetln.c - copied unchanged from r275397, vendor/mdocml/dist/compat_fgetln.c vendor/mdocml/20141201/compat_getsubopt.c - copied unchanged from r275397, vendor/mdocml/dist/compat_getsubopt.c vendor/mdocml/20141201/compat_strlcat.c - copied unchanged from r275397, vendor/mdocml/dist/compat_strlcat.c vendor/mdocml/20141201/compat_strlcpy.c - copied unchanged from r275397, vendor/mdocml/dist/compat_strlcpy.c vendor/mdocml/20141201/demandoc.1 - copied unchanged from r275397, vendor/mdocml/dist/demandoc.1 vendor/mdocml/20141201/demandoc.c - copied unchanged from r275397, vendor/mdocml/dist/demandoc.c vendor/mdocml/20141201/eqn.7 - copied unchanged from r275397, vendor/mdocml/dist/eqn.7 vendor/mdocml/20141201/eqn.c - copied unchanged from r275397, vendor/mdocml/dist/eqn.c vendor/mdocml/20141201/eqn_html.c - copied unchanged from r275397, vendor/mdocml/dist/eqn_html.c vendor/mdocml/20141201/eqn_term.c - copied unchanged from r275397, vendor/mdocml/dist/eqn_term.c vendor/mdocml/20141201/example.style.css - copied unchanged from r275397, vendor/mdocml/dist/example.style.css vendor/mdocml/20141201/gmdiff - copied unchanged from r274876, vendor/mdocml/dist/gmdiff vendor/mdocml/20141201/html.c - copied unchanged from r275397, vendor/mdocml/dist/html.c vendor/mdocml/20141201/html.h - copied unchanged from r275397, vendor/mdocml/dist/html.h vendor/mdocml/20141201/lib.c - copied unchanged from r275397, vendor/mdocml/dist/lib.c vendor/mdocml/20141201/lib.in - copied unchanged from r274876, vendor/mdocml/dist/lib.in vendor/mdocml/20141201/libman.h - copied unchanged from r275397, vendor/mdocml/dist/libman.h vendor/mdocml/20141201/libmandoc.h - copied unchanged from r275397, vendor/mdocml/dist/libmandoc.h vendor/mdocml/20141201/libmdoc.h - copied unchanged from r275397, vendor/mdocml/dist/libmdoc.h vendor/mdocml/20141201/libroff.h - copied unchanged from r275397, vendor/mdocml/dist/libroff.h vendor/mdocml/20141201/main.c - copied unchanged from r275397, vendor/mdocml/dist/main.c vendor/mdocml/20141201/main.h - copied unchanged from r275397, vendor/mdocml/dist/main.h vendor/mdocml/20141201/man.7 - copied unchanged from r274876, vendor/mdocml/dist/man.7 vendor/mdocml/20141201/man.c - copied unchanged from r275397, vendor/mdocml/dist/man.c vendor/mdocml/20141201/man.h - copied unchanged from r275397, vendor/mdocml/dist/man.h vendor/mdocml/20141201/man_hash.c - copied unchanged from r275397, vendor/mdocml/dist/man_hash.c vendor/mdocml/20141201/man_html.c - copied unchanged from r275397, vendor/mdocml/dist/man_html.c vendor/mdocml/20141201/man_macro.c - copied unchanged from r275397, vendor/mdocml/dist/man_macro.c vendor/mdocml/20141201/man_term.c - copied unchanged from r275397, vendor/mdocml/dist/man_term.c vendor/mdocml/20141201/man_validate.c - copied unchanged from r275397, vendor/mdocml/dist/man_validate.c vendor/mdocml/20141201/mandoc.1 - copied unchanged from r275397, vendor/mdocml/dist/mandoc.1 vendor/mdocml/20141201/mandoc.3 - copied unchanged from r275397, vendor/mdocml/dist/mandoc.3 vendor/mdocml/20141201/mandoc.c - copied unchanged from r275397, vendor/mdocml/dist/mandoc.c vendor/mdocml/20141201/mandoc.h - copied unchanged from r275397, vendor/mdocml/dist/mandoc.h vendor/mdocml/20141201/mandocdb.c - copied unchanged from r275397, vendor/mdocml/dist/mandocdb.c vendor/mdocml/20141201/manpath.c - copied unchanged from r275397, vendor/mdocml/dist/manpath.c vendor/mdocml/20141201/mdoc.7 - copied unchanged from r275397, vendor/mdocml/dist/mdoc.7 vendor/mdocml/20141201/mdoc.c - copied unchanged from r275397, vendor/mdocml/dist/mdoc.c vendor/mdocml/20141201/mdoc.h - copied unchanged from r274876, vendor/mdocml/dist/mdoc.h vendor/mdocml/20141201/mdoc_argv.c - copied unchanged from r275397, vendor/mdocml/dist/mdoc_argv.c vendor/mdocml/20141201/mdoc_hash.c - copied unchanged from r275397, vendor/mdocml/dist/mdoc_hash.c vendor/mdocml/20141201/mdoc_html.c - copied unchanged from r275397, vendor/mdocml/dist/mdoc_html.c vendor/mdocml/20141201/mdoc_macro.c - copied unchanged from r275397, vendor/mdocml/dist/mdoc_macro.c vendor/mdocml/20141201/mdoc_man.c - copied unchanged from r275397, vendor/mdocml/dist/mdoc_man.c vendor/mdocml/20141201/mdoc_term.c - copied unchanged from r275397, vendor/mdocml/dist/mdoc_term.c vendor/mdocml/20141201/mdoc_validate.c - copied unchanged from r275397, vendor/mdocml/dist/mdoc_validate.c vendor/mdocml/20141201/msec.c - copied unchanged from r275397, vendor/mdocml/dist/msec.c vendor/mdocml/20141201/msec.in - copied unchanged from r275397, vendor/mdocml/dist/msec.in vendor/mdocml/20141201/out.c - copied unchanged from r275397, vendor/mdocml/dist/out.c vendor/mdocml/20141201/out.h - copied unchanged from r275397, vendor/mdocml/dist/out.h vendor/mdocml/20141201/preconv.c - copied unchanged from r275397, vendor/mdocml/dist/preconv.c vendor/mdocml/20141201/read.c - copied unchanged from r275397, vendor/mdocml/dist/read.c vendor/mdocml/20141201/roff.7 - copied unchanged from r275397, vendor/mdocml/dist/roff.7 vendor/mdocml/20141201/roff.c - copied unchanged from r275397, vendor/mdocml/dist/roff.c vendor/mdocml/20141201/st.c - copied unchanged from r275397, vendor/mdocml/dist/st.c vendor/mdocml/20141201/st.in - copied unchanged from r275397, vendor/mdocml/dist/st.in vendor/mdocml/20141201/style.css - copied unchanged from r275397, vendor/mdocml/dist/style.css vendor/mdocml/20141201/tbl.7 - copied unchanged from r275397, vendor/mdocml/dist/tbl.7 vendor/mdocml/20141201/tbl.c - copied unchanged from r275397, vendor/mdocml/dist/tbl.c vendor/mdocml/20141201/tbl_data.c - copied unchanged from r275397, vendor/mdocml/dist/tbl_data.c vendor/mdocml/20141201/tbl_html.c - copied unchanged from r275397, vendor/mdocml/dist/tbl_html.c vendor/mdocml/20141201/tbl_layout.c - copied unchanged from r275397, vendor/mdocml/dist/tbl_layout.c vendor/mdocml/20141201/tbl_opts.c - copied unchanged from r275397, vendor/mdocml/dist/tbl_opts.c vendor/mdocml/20141201/tbl_term.c - copied unchanged from r275397, vendor/mdocml/dist/tbl_term.c vendor/mdocml/20141201/term.c - copied unchanged from r275397, vendor/mdocml/dist/term.c vendor/mdocml/20141201/term.h - copied unchanged from r275397, vendor/mdocml/dist/term.h vendor/mdocml/20141201/term_ascii.c - copied unchanged from r275397, vendor/mdocml/dist/term_ascii.c vendor/mdocml/20141201/term_ps.c - copied unchanged from r275397, vendor/mdocml/dist/term_ps.c vendor/mdocml/20141201/test-fgetln.c - copied unchanged from r274876, vendor/mdocml/dist/test-fgetln.c vendor/mdocml/20141201/test-getsubopt.c - copied unchanged from r275397, vendor/mdocml/dist/test-getsubopt.c vendor/mdocml/20141201/test-mmap.c - copied unchanged from r274876, vendor/mdocml/dist/test-mmap.c vendor/mdocml/20141201/test-strlcat.c - copied unchanged from r274876, vendor/mdocml/dist/test-strlcat.c vendor/mdocml/20141201/test-strlcpy.c - copied unchanged from r274876, vendor/mdocml/dist/test-strlcpy.c vendor/mdocml/20141201/test-strptime.c - copied unchanged from r274876, vendor/mdocml/dist/test-strptime.c vendor/mdocml/20141201/tree.c - copied unchanged from r275397, vendor/mdocml/dist/tree.c Deleted: vendor/mdocml/20141201/apropos.c vendor/mdocml/20141201/apropos_db.c vendor/mdocml/20141201/apropos_db.h vendor/mdocml/20141201/arch.c vendor/mdocml/20141201/arch.in vendor/mdocml/20141201/att.in vendor/mdocml/20141201/catman.8 vendor/mdocml/20141201/catman.c vendor/mdocml/20141201/config.h.post vendor/mdocml/20141201/config.h.pre vendor/mdocml/20141201/external.png vendor/mdocml/20141201/index.css vendor/mdocml/20141201/index.sgml vendor/mdocml/20141201/man.cgi.7 vendor/mdocml/20141201/mandocdb.8 vendor/mdocml/20141201/mandocdb.h vendor/mdocml/20141201/preconv.1 vendor/mdocml/20141201/test-betoh64.c vendor/mdocml/20141201/vol.c vendor/mdocml/20141201/vol.in vendor/mdocml/20141201/whatis.1 Copied: vendor/mdocml/20141201/INSTALL (from r275397, vendor/mdocml/dist/INSTALL) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20141201/INSTALL Tue Dec 2 07:36:02 2014 (r275398, copy of r275397, vendor/mdocml/dist/INSTALL) @@ -0,0 +1,188 @@ +$Id: INSTALL,v 1.5 2014/08/18 13:27:47 kristaps Exp $ + +About mdocml, the portable mandoc distribution +---------------------------------------------- +The mandoc manpage compiler toolset is a suite of tools compiling +mdoc(7), the roff(7) macro language of choice for BSD manual pages, +and man(7), the predominant historical language for UNIX manuals. +The toolset does not yet implement man(1); that is only scheduled +for the next release, 1.13.2. It can, however, already serve to +translate source manpages to the output displayed by man(1). +For general information, see . + +In this document, we describe the installation and deployment of +mandoc(1), first as a simple, standalone formatter, and then as part of +the man(1) system. + +In case you have questions or want to provide feedback, read +. Consider subscribing to the +discuss@ mailing list mentioned on that page. If you intend to +help with the development of mandoc, consider subscribing to the +tech@ mailing list, too. + +Enjoy using the mandoc toolset! + +Ingo Schwarze, Karlsruhe, August 2014 + + +Installation +------------ +Before manually installing mandoc on your system, please check +whether the newest version of mandoc is already installed by default +or available via a binary package or a ports system. A list of the +latest bundled and ported versions of mandoc for various operating +systems is maintained at . + +If mandoc is installed, you can check the version by running "mandoc -V". +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. 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. + +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 +missing SQLITE_DETERMINISTIC optimization flag. Versions older +than 3.8.0 may not show full error information if opening a database +fails due to the missing sqlite3_errstr() API. Both are very minor +problems, apropos(1) is fully usable with SQLite 3.7.5. Versions +older than 3.7.5 may or may not work, they have not been tested. + +1.2. The fts(3) directory traversion functions. +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. + + +Checking autoconfiguration quality +---------------------------------- +If you want to check whether automatic configuration works well +on your platform, consider the following: + +The mandoc package intentionally does not use GNU autoconf because +we consider that toolset a blatant example of overengineering that +is obsolete nowadays, since all modern operating systems are now +reasonably close to POSIX and do not need arcane shell magic any +longer. If your system does need such magic, consider upgrading +to reasonably modern POSIX-compliant tools rather than asking for +autoconf-style workarounds. + +As far as mandoc is using any features not mandated by ANSI X3.159-1989 +("ANSI C") or IEEE Std 1003.1-2008 ("POSIX") that some modern systems +do not have, we intend to provide autoconfiguration tests and +compat_*.c implementations. Please report any that turn out to be +missing. Note that while we do strive to produce portable code, +we do not slavishly restrict ourselves to POSIX-only interfaces. +For improved security and readability, we do use well-designed, +modern interfaces like reallocarray(3) even if they are still rather +uncommon, of course bundling compat_*.c implementations as needed. + +Where mandoc is using ANSI C or POSIX features that some systems +still lack and that compat_*.c implementations can be provided for +without too much hassle, we will consider adding them, too, so +please report whatever is missing on your platform. + +The following steps can be used to manually check the automatic +configuration on your platform: + +1. Run "make distclean". + +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 +output and standard error output these commands produce. Watch out +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 "#define HAVE_*" differ from your expectations. + + +Deployment +---------- +If you want to integrate the mandoc(1) tools with your existing +man(1) system as a formatter, then contact us first: on systems without +mandoc(1) as the default, you may have your work cut out for you! +Usually, you can have your default installation and mandoc(1) work right +alongside each other by using user-specific versions of the files +mentioned below. + +0. Back up each file you want to change! + +1. First see whether your system has "/etc/man.conf" or "/etc/manpath.conf" +(if it has neither, but man(1) is functional, then let us know) or, +if running as your own user, a per-user override file. In either +case, find where man(1) is executing nroff(1) or groff(1) to format +manuals. Replace these calls with mandoc(1). + +2. Then make sure that man(1) isn't running preprocessors, so you may +need to replace tbl(1), eqn(1), and similar references with cat(1). +Some man(1) implementations, like that on Mac OSX, let you run "man -d" +to see how the formatter is invoked. Use this to test your changes. On +Mac OS X, for instance, man(1) will prepend all files with ".ll" and +".nr" to set the terminal size, so you need to pass "tail -n+2 | +mandoc(1)" to disregard them. + +3. Finally, make sure that mandoc(1) is actually being invoked instead +of cached pages being pulled up. You can usually do this by commenting +out NOCACHE or similar. + +mandoc(1) still has a long way to go in understanding non-trivial +low-level roff(7) markup embedded in some man(7) pages. On the BSD +systems using mandoc(1), third-party software is generally vetted +on whether it may be formatted with mandoc(1). If not, groff(1) +is pulled in as a dependency and used to install a pre-formatted +"catpage" intead of directly as manual page source. + +For more background on switching operating systems to use mandoc(1) +instead of groff(1) to format manuals, see the two BSDCan presentations +by Ingo Schwarze: + + Copied: vendor/mdocml/20141201/LICENSE (from r275397, vendor/mdocml/dist/LICENSE) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20141201/LICENSE Tue Dec 2 07:36:02 2014 (r275398, copy of r275397, vendor/mdocml/dist/LICENSE) @@ -0,0 +1,46 @@ +$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 +of the following developers: + +Copyright (c) 2008, 2009, 2010, 2011, 2012 Kristaps Dzonsons +Copyright (c) 2010, 2011, 2012, 2013, 2014 Ingo Schwarze +Copyright (c) 2009, 2010, 2011, 2012 Joerg Sonnenberger +Copyright (c) 2013 Franco Fichtner +Copyright (c) 1999, 2004 Marc Espie +Copyright (c) 1998, 2010 Todd C. Miller +Copyright (c) 2008 Otto Moerbeek +Copyright (c) 2003 Jason McIntyre + +See the individual source files for information about who contributed +to which file during which years. + + +The mdocml distribution as a whole is distributed by its developers +under the following license: + +Permission to use, copy, modify, and distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +The following files included from outside sources are protected by +other people's Copyright and are distributed under a 3-clause BSD +license; see these individual files for details. + +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. Copied: vendor/mdocml/20141201/Makefile (from r275397, vendor/mdocml/dist/Makefile) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20141201/Makefile Tue Dec 2 07:36:02 2014 (r275398, copy of r275397, vendor/mdocml/dist/Makefile) @@ -0,0 +1,407 @@ +# $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 +# +# Permission to use, copy, modify, and distribute this software for any +# purpose with or without fee is hereby granted, provided that the above +# copyright notice and this permission notice appear in all copies. +# +# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +BASEBIN = mandoc demandoc +DBBIN = makewhatis +CGIBIN = man.cgi + +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-wchar.c + +SRCS = att.c \ + cgi.c \ + chars.c \ + compat_fgetln.c \ + compat_fts.c \ + compat_getsubopt.c \ + compat_ohash.c \ + compat_reallocarray.c \ + compat_sqlite3_errstr.c \ + compat_strcasestr.c \ + compat_strlcat.c \ + compat_strlcpy.c \ + compat_strsep.c \ + demandoc.c \ + eqn.c \ + eqn_html.c \ + eqn_term.c \ + html.c \ + lib.c \ + main.c \ + man.c \ + man_hash.c \ + man_html.c \ + man_macro.c \ + man_term.c \ + man_validate.c \ + mandoc.c \ + mandoc_aux.c \ + mandocdb.c \ + manpage.c \ + manpath.c \ + mansearch.c \ + mansearch_const.c \ + mdoc.c \ + mdoc_argv.c \ + mdoc_hash.c \ + mdoc_html.c \ + mdoc_macro.c \ + mdoc_man.c \ + mdoc_term.c \ + mdoc_validate.c \ + msec.c \ + out.c \ + preconv.c \ + read.c \ + roff.c \ + st.c \ + tbl.c \ + tbl_data.c \ + tbl_html.c \ + tbl_layout.c \ + tbl_opts.c \ + tbl_term.c \ + term.c \ + term_ascii.c \ + term_ps.c \ + tree.c \ + $(TESTSRCS) + +DISTFILES = INSTALL \ + LICENSE \ + Makefile \ + Makefile.depend \ + NEWS \ + TODO \ + apropos.1 \ + cgi.h.example \ + chars.in \ + compat_fts.h \ + compat_ohash.h \ + configure \ + configure.local.example \ + demandoc.1 \ + eqn.7 \ + example.style.css \ + gmdiff \ + html.h \ + lib.in \ + libman.h \ + libmandoc.h \ + libmdoc.h \ + libroff.h \ + main.h \ + makewhatis.8 \ + man-cgi.css \ + man.1 \ + man.7 \ + man.cgi.8 \ + man.h \ + mandoc.1 \ + mandoc.3 \ + mandoc.db.5 \ + mandoc.h \ + mandoc_aux.h \ + mandoc_char.7 \ + mandoc_escape.3 \ + mandoc_html.3 \ + mandoc_malloc.3 \ + manpath.h \ + mansearch.3 \ + mansearch.h \ + mchars_alloc.3 \ + mdoc.7 \ + mdoc.h \ + msec.in \ + out.h \ + predefs.in \ + roff.7 \ + st.in \ + style.css \ + tbl.3 \ + tbl.7 \ + term.h \ + $(SRCS) + +LIBMAN_OBJS = man.o \ + man_hash.o \ + man_macro.o \ + man_validate.o + +LIBMDOC_OBJS = att.o \ + lib.o \ + mdoc.o \ + mdoc_argv.o \ + mdoc_hash.o \ + mdoc_macro.o \ + mdoc_validate.o \ + st.o + +LIBROFF_OBJS = eqn.o \ + roff.o \ + tbl.o \ + tbl_data.o \ + tbl_layout.o \ + tbl_opts.o + +LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ + $(LIBMDOC_OBJS) \ + $(LIBROFF_OBJS) \ + chars.o \ + 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 \ + compat_sqlite3_errstr.o \ + compat_strcasestr.o \ + compat_strlcat.o \ + compat_strlcpy.o \ + compat_strsep.o + +MANDOC_HTML_OBJS = eqn_html.o \ + html.o \ + man_html.o \ + mdoc_html.o \ + tbl_html.o + +MANDOC_MAN_OBJS = mdoc_man.o + +MANDOC_TERM_OBJS = eqn_term.o \ + man_term.o \ + mdoc_term.o \ + term.o \ + term_ascii.o \ + term_ps.o \ + tbl_term.o + +MANDOC_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + main.o \ + out.o \ + tree.o + +MAN_OBJS = $(MANDOC_OBJS) + +MAKEWHATIS_OBJS = mandocdb.o mansearch_const.o manpath.o + +APROPOS_OBJS = mansearch.o mansearch_const.o manpath.o + +CGI_OBJS = $(MANDOC_HTML_OBJS) \ + cgi.o \ + mansearch.o \ + mansearch_const.o \ + out.o + +MANPAGE_OBJS = manpage.o mansearch.o mansearch_const.o manpath.o + +DEMANDOC_OBJS = demandoc.o + +WWW_MANS = apropos.1.html \ + demandoc.1.html \ + man.1.html \ + mandoc.1.html \ + mandoc.3.html \ + mandoc_escape.3.html \ + mandoc_html.3.html \ + mandoc_malloc.3.html \ + mansearch.3.html \ + mchars_alloc.3.html \ + tbl.3.html \ + mandoc.db.5.html \ + eqn.7.html \ + man.7.html \ + mandoc_char.7.html \ + mdoc.7.html \ + roff.7.html \ + tbl.7.html \ + makewhatis.8.html \ + man.cgi.8.html \ + man.h.html \ + mandoc.h.html \ + mandoc_aux.h.html \ + manpath.h.html \ + mansearch.h.html \ + mdoc.h.html + +WWW_OBJS = mdocml.tar.gz \ + mdocml.sha256 + +include Makefile.local + +INSTALL_TARGETS = $(BUILD_TARGETS:-build=-install) + +# === DEPENDENCY HANDLING ============================================== + +all: base-build $(BUILD_TARGETS) Makefile.local + +base-build: $(BASEBIN) + +db-build: $(DBBIN) + +cgi-build: $(CGIBIN) + +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) $(COMPAT_OBJS) + rm -f mandoc $(MANDOC_OBJS) $(APROPOS_OBJS) + rm -f makewhatis $(MAKEWHATIS_OBJS) + rm -f man.cgi $(CGI_OBJS) + rm -f manpage $(MANPAGE_OBJS) + rm -f demandoc $(DEMANDOC_OBJS) + rm -f $(WWW_MANS) $(WWW_OBJS) + rm -rf *.dSYM + +base-install: base-build + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(EXAMPLEDIR) + mkdir -p $(DESTDIR)$(LIBDIR) + mkdir -p $(DESTDIR)$(INCLUDEDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man3 + mkdir -p $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_PROGRAM) $(BASEBIN) $(DESTDIR)$(BINDIR) + $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) + $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h \ + $(DESTDIR)$(INCLUDEDIR) + $(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 \ + $(DESTDIR)$(MANDIR)/man7 + $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR) + +db-install: db-build + mkdir -p $(DESTDIR)$(BINDIR) + mkdir -p $(DESTDIR)$(SBINDIR) + mkdir -p $(DESTDIR)$(MANDIR)/man1 + mkdir -p $(DESTDIR)$(MANDIR)/man3 + mkdir -p $(DESTDIR)$(MANDIR)/man5 + mkdir -p $(DESTDIR)$(MANDIR)/man8 + 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 \ + $(DESTDIR)$(MANDIR)/man1/whatis.1 + $(INSTALL_MAN) mansearch.3 $(DESTDIR)$(MANDIR)/man3 + $(INSTALL_MAN) mandoc.db.5 $(DESTDIR)$(MANDIR)/man5 + $(INSTALL_MAN) makewhatis.8 $(DESTDIR)$(MANDIR)/man8 + +cgi-install: cgi-build + mkdir -p $(DESTDIR)$(CGIBINDIR) + mkdir -p $(DESTDIR)$(HTDOCDIR) + mkdir -p $(DESTDIR)$(WWWPREFIX)/man/mandoc/man1 + mkdir -p $(DESTDIR)$(WWWPREFIX)/man/mandoc/man8 + $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) + $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css + $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR) + $(INSTALL_MAN) apropos.1 $(DESTDIR)$(WWWPREFIX)/man/mandoc/man1/ + $(INSTALL_MAN) man.cgi.8 $(DESTDIR)$(WWWPREFIX)/man/mandoc/man8/ + +www-install: www + mkdir -p $(DESTDIR)$(HTDOCDIR)/snapshots + $(INSTALL_DATA) $(WWW_MANS) style.css $(DESTDIR)$(HTDOCDIR) + $(INSTALL_DATA) $(WWW_OBJS) $(DESTDIR)$(HTDOCDIR)/snapshots + $(INSTALL_DATA) mdocml.tar.gz \ + $(DESTDIR)$(HTDOCDIR)/snapshots/mdocml-$(VERSION).tar.gz + $(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; 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: $(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) + +manpage: $(MANPAGE_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MANPAGE_OBJS) libmandoc.a $(DBLIB) + +man.cgi: $(CGI_OBJS) libmandoc.a + $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) + +demandoc: $(DEMANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a + +mdocml.sha256: mdocml.tar.gz + sha256 mdocml.tar.gz > $@ + +mdocml.tar.gz: $(DISTFILES) + mkdir -p .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/ + +.PHONY: base-install cgi-install db-install install www-install +.PHONY: clean distclean depend +.SUFFIXES: .1 .3 .5 .7 .8 .h +.SUFFIXES: .1.html .3.html .5.html .7.html .8.html .h.html + +.h.h.html: + highlight -I $< > $@ + +.1.1.html .3.3.html .5.5.html .7.7.html .8.8.html: mandoc + ./mandoc -Thtml -Wall,stop \ + -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< > $@ Copied: vendor/mdocml/20141201/Makefile.depend (from r275397, vendor/mdocml/dist/Makefile.depend) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20141201/Makefile.depend Tue Dec 2 07:36:02 2014 (r275398, copy of r275397, vendor/mdocml/dist/Makefile.depend) @@ -0,0 +1,72 @@ +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_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 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 +man_macro.o: man_macro.c config.h man.h mandoc.h libmandoc.h libman.h +man_term.o: man_term.c config.h mandoc.h mandoc_aux.h out.h man.h term.h main.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 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 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 +mdoc_hash.o: mdoc_hash.c config.h mdoc.h libmdoc.h +mdoc_html.o: mdoc_html.c config.h mandoc.h mandoc_aux.h out.h html.h mdoc.h main.h +mdoc_macro.o: mdoc_macro.c config.h mdoc.h mandoc.h libmdoc.h libmandoc.h +mdoc_man.o: mdoc_man.c config.h mandoc.h mandoc_aux.h out.h man.h mdoc.h main.h +mdoc_term.o: mdoc_term.c config.h mandoc.h mandoc_aux.h out.h term.h mdoc.h main.h +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 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 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 +tbl_html.o: tbl_html.c config.h mandoc.h out.h html.h +tbl_layout.o: tbl_layout.c config.h mandoc.h mandoc_aux.h libmandoc.h libroff.h +tbl_opts.o: tbl_opts.c config.h mandoc.h libmandoc.h libroff.h +tbl_term.o: tbl_term.c config.h mandoc.h out.h term.h +term.o: term.c config.h mandoc.h mandoc_aux.h out.h term.h main.h +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 +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 Copied: vendor/mdocml/20141201/NEWS (from r275397, vendor/mdocml/dist/NEWS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/mdocml/20141201/NEWS Tue Dec 2 07:36:02 2014 (r275398, copy of r275397, vendor/mdocml/dist/NEWS) @@ -0,0 +1,447 @@ +$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. + +Changes in version 1.13.1, released on August 10, 2014 + + --- MAJOR NEW FEATURES --- + * A complete apropos(1)/makewhatis(8)/man.cgi(8) suite + based on SQLite3 is now included. + * The roff(7) parser now provides an almost complete implementation + of numerical expressions. + * Warning and error messages have been improved in many ways. + Almost all fatal errors were downgraded to normal errors and some + even to warnings. Almost all messages now mention the macro where + the issue is detected and many indicate the workaround employed. + The mandoc(1) manual now includes a list explaining all messages. + --- MINOR NEW FEATURES --- + * The roff(7) parser now supports the .ami (append to macro with + indirectly specified name), .as (append to user-defined + string), .dei (define macro with indirectly specified name), + .ll (line length), and .rr (remove register) requests. + * The roff(7) parser now supports string comparison and numerical + conditionals in the .if and .ie requests. + * The roff parser now fully supports the \B (validate numerical + expression) and partially supports the \w (measure text width) + escape sequences. + * The terminal formatter now supports the \: (optional line break) + escape sequence. + * The roff parser now supports expansion of user-defined strings + involving indirect references. + * The roff(7) parser now handles some pre-defined read-only + number registers that occur in the pod2man(1) preamble. + * For backward compatibility, the mdoc(7) parser and formatters + now support the obsolete macros .En, .Es, .Fr, and .Ot. + * The mdoc(7) formatter non partially supports .Bd -centered. + * tbl(7) now handles leading and trailing vertical lines. + * The build system now provides fallback versions of strcasestr(3) + and strsep(3) for systems lacking them. + * The mdoc(7) manual now explains how various standards + supported by the .St macro are related to each other. + --- BUGFIXES --- + * In the roff(7) parser, several bugs were fixed with respect + to closing conditional blocks on macro lines. + * Parsing of roff(7) identifiers and escape sequences was improved + in multiple respects. + * In the mdoc(7) parser, the handling of defective document + prologues was improved in multiple ways. + * The mdoc(7) parser no longer skips content before the first section + header, and it no longer deletes non-.% content from .Rs blocks. + * In the mdoc(7) parser, a crash was fixed related to weird .Sh headers. + * In the mdoc(7) parser, handling of .Sm with missing or invalid + arguments was corrected. + * In the mdoc(7) parser, trailing punctuation at the end of partial + implicit macros no longer triggers end-of-sentence spacing. + * In the terminal formatter, two crashes were fixed: one triggered by + excessive indentation and another by excessively long .Nm arguments. + * In the terminal formatter, a floating point rounding bug was + fixed that sometimes caused an off-by-one error in indentation. + * In the UTF-8 formatter, rendering of accents, breakable hyphens, + and non-breakable spaces was corrected. + * In the HTML formatter, encoding of special characters was + corrected in multiple respects. + * In the mdoc(7) formatter, rendering of .Ex and .Rv was + improved for various edge cases. + * In the mdoc(7) formatter, handling of empty .Bl -inset item + heads was improved. + * In the man(7) formatter, some bugs were fixed with respect + to same-line detection in the context of .TP and .nf macros, + and the indentation of .IP and .TP blocks was improved. + * The mandoc(3) library no longer prints to stderr. + --- THANKS TO --- + Abhinav Upadhyay (NetBSD), Andreas Voegele, Anthony Bentley (OpenBSD), + Christian Weisgerber (OpenBSD), Havard Eidnes (NetBSD), Jan Stary, + Jason McIntyre (OpenBSD), Jeremie Courreges-Anglas (OpenBSD), + Joerg Sonnenberger (NetBSD), Juan Francisco Cantero Hurtado (OpenBSD), + Marc Espie (OpenBSD), Matthias Scheler (NetBSD), Pascal Stumpf (OpenBSD), + Paul Onyschuk (Alpine Linux), Sebastien Marie, Steffen Nurpmeso, + Stuart Henderson (OpenBSD), Ted Unangst (OpenBSD), Theo de Raadt (OpenBSD), + Thomas Klausner (NetBSD), and Ulrich Spoerlein (FreeBSD) + for reporting bugs and missing features. + +Changes in version 1.12.3, released on December 31, 2013 + + * In the mdoc(7) SYNOPSIS, line breaks and hanging indentation + now work correctly for .Fo/.Fa/.Fc and .Fn blocks. + Thanks to Franco Fichtner for doing part of the work. + * The mdoc(7) .Bk macro got some addititonal bugfixes. + * In mdoc(7) macro arguments, double quotes can now be quoted + by doubling them, just like in man(7). + Thanks to Tsugutomo ENAMI for the patch. + * At the end of man(7) macro lines, end-of-sentence spacing + now works. Thanks to Franco Fichtner for the patch. + * For backward compatibility, the man(7) parser now supports the + man-ext .UR/.UE (uniform resource identifier) block macros. + * The man(7) parser now handles closing blocks that are not open + more gracefully. + * The man(7) parser now ignores blank lines right after .SH and .SS. + * In the man(7) formatter, reset indentation when leaving a block, + not just when entering the next one. + * The roff(7) .nr request now supports incrementing and decrementing + number registers and stops parsing the number right before the + first non-digit character. + * The roff(7) parser now supports the alternative escape sequence + syntax \C'uXXXX' for Unicode characters. + * The roff(7) parser now parses and ignores the .fam (font family) + and .hw (hyphenation points) requests and the \d and \u escape + sequences. + * The roff(7) manual got a new ESCAPE SEQUENCE REFERENCE. + +Changes in version 1.12.2, released on Oktober 5, 2013 + + * The mdoc(7) to man(7) converter, to be called as mandoc -Tman, + is now fully functional. + * The mandoc(1) utility now supports the -Ios (default operating system) + input option, and the -Tutf8 output mode now actually works. + * The mandocdb(8) utility no longer truncates existing databases when + starting to build new ones, but only replaces them when the build + actually succeeds. + * The man(7) parser now supports the PD macro (paragraph distance), + and (for GNU man-ext compatibility only) EX (example block) and EE + (example end). Plus several bugfixes regarding indentation, line + breaks, and vertical spacing, and regarding RS following TP. + * The roff(7) parser now supports the \f(BI (bold+italic) font escape, + the \z (zero cursor advance) escape and the cc (change control + character) and it (input line trap) requests. Plus bugfixes regarding + the \t (tab) escape, nested escape sequences, and conditional requests. + * In mdoc(7), several bugs were fixed related to UTF-8 output of quoting + enclosures, delimiter handling, list indentation and horizontal and + vertical spacing, formatting of the Lk, %U, and %C macros, plus some + bugfixes related to the handling of syntax errors like badly nested + font blocks, stray Ta macros outside column lists, unterminated It Xo + blocks, and non-text children of Nm blocks. + * In tbl(7), the width of horizontal spans and the vertical spacing + around tables was corrected, and in man(7) files, a crash was fixed + that was triggered by some particular unclosed T{ macros. + * For mandoc developers, we now provide a tbl(3) library manual and + gmdiff, a very small, very simplistic groff-versus-mandoc output + comparison tool. + * Provide this NEWS file. + +Changes in version 1.12.1, released on March 23, 2012 + + * Significant work on apropos(1) and mandocdb(8). These tools are now + much more robust. A whatis(1) implementation is now handled as an + apropos(1) mode. These tools are also able to minimally handle + pre-formatted pages, that is, those already formatted by another + utility such as GNU troff. + * The man.cgi(7) script is also now available for wider testing. + It interfaces with mandocdb(8) manuals cached by catman(8). + HTML output is generated on-the-fly by libmandoc or internal + methods to convert pre-formatted pages. + * The mailing list archive for the discuss and tech lists are being + hosted by Gmane at gmane.comp.tools.mdocml.user and + gmane.comp.tools.mdocml.devel, respectively. + +Changes in version 1.12.0, released on October 8, 2011 + + * This version features a new, work-in-progress mandoc(1) output mode: + -Tman. This mode allows a system maintainer to distribute man(7) + media for older systems that may not natively support mdoc(7), such + as old Solaris systems. + * The -Ofragment option was added to mandoc(1)'s -Thtml and -Txhtml modes. + * While adding features, an apropos(1) utility has been merged from the + mandoc-tools sandbox. This interfaces with mandocdb(8) for semantic + search of manual content. apropos(1) is different from the traditional + apropos primarily in allowing keyword search (such as for functions, + utilities, etc.) and regular expressions. Note that the calling + syntax for apropos is likely to change as it settles down. + * In documentation news, the mdoc(7) and man(7) manuals have been + made considerably more readable by adding MACRO OVERVIEW sections, by + moving the gory details of the LANGUAGE SYNTAX to the roff(7) manual, + and by moving the very technical MACRO SYNTAX sections down to the + bottom of the page. + * Furthermore, for tbl(7), the -Tascii mode horizontal spacing of tables + was rewritten completely. It is now compatible with groff(1), both + with and without frames and rulers. + * Nesting of indented blocks is now supported in man(7), and several + bugs were fixed regarding indentation and alignment. + * The page headers in mdoc(7) are now nicer for very long titles. + +Changes in version 1.11.7, released on September 2, 2011 + + * Added demandoc(1) utility for stripping away macros and escapes. + This replaces the historical deroff(1) utility. + * Also improved the mdoc(7) and man(7) manuals. + +Changes in version 1.11.6, released on August 16, 2011 + + * Handling of tr macro in roff(7) implemented. This makes Perl + documentation much more readable. Hyphenation is also now enabled in + man(7) format documents. Many other general improvements have been + implemented. + +Changes in version 1.11.5, released on July 24, 2011 + + * Significant eqn(7) improvements. mdocml can now parse arbitrary eqn + input (although few GNU extensions are accepted, nor is mixing + low-level roff with eqn). See the eqn(7) manual for details. + For the time being, equations are rendered as simple in-line text. + The equation parser satisfies the language specified in the + Second Edition User's Guide: + http://www.kohala.com/start/troff/v7man/eqn/eqn2e.ps + +Changes in version 1.11.4, released on July 12, 2011 + + * Bug-fixes and clean-ups across all systems, especially in mandocdb(8) + and the man(7) parser. This release was significantly assisted by + participants in OpenBSD's c2k11. Thanks! + +Changes in version 1.11.3, released on May 26, 2011 + + * Introduce locale-encoding of output with the -Tlocale output option and + Unicode escaped-character input. See mandoc(1) and mandoc_char(7), + respectively, for details. This allows for non-ASCII characters (e.g., + \[u5000]) to be rendered in the locale's encoding, if said environment + supports wide-character encoding (if it does not, -Tascii is used + instead). Locale support can be turned off at compile time by removing + -DUSE_WCHAR in the Makefile, in which case -Tlocale is always a synonym + for -Tascii. + * Furthermore, multibyte-encoded documents, such as those in UTF-8, may + be on-the-fly recoded into mandoc(1) input by using the newly-added + preconv(1) utility. Note: in the future, this feature may be + integrated into mandoc(1). + +Changes in version 1.11.2, released on May 12, 2011 + + * Corrected some installation issues in version 1.11.1. + * Further migration to libmandoc. + * Initial public release (this utility is very much under development) + of mandocdb(8). This utility produces keyword databases of manual + content, which features semantic querying of manual content. + +Changes in version 1.11.1, released on April 4, 2011 + + * The earlier libroff, libmdoc, and libman soup have been merged into + a single library, libmandoc, which manages all aspects of parsing + real manuals, from line-handling to tbl(7) parsing. + * As usual, many general fixes and improvements have also occurred. + In particular, a great deal of redundancy and superfluous code has + been removed with the merging of the backend libraries. + * see also the changes in 1.10.10 + +Changes in version 1.10.10, March 20, 2011, NOT released + + * Initial eqn(7) functionality is in place. For the time being, + this is limited to the recognition of equation blocks; + future version of mdocml will expand upon this framework. + +Changes in version 1.10.9, released on January 7, 2011 + + * Many back-end fixes have been implemented: argument handling (quoting), + man(7) improvements, error/warning classes, and many more. + * Initial tbl(7) functionality (see the "TS", "TE", and "T&" macros in + the roff(7) manual) has been merged from tbl.bsd.lv. Output is still + minimal, especially for -Thtml and -Txhtml, but manages to at least + display data. This means that mandoc(1) now has built-in support + for two troff preprocessors via libroff: soelim(1) and tbl(1). + +Changes in version 1.10.8, released on December 24, 2010 + + * Overhauled the -Thtml and -Txhtml output modes. They now display + readable output in arbitrary browsers, including text-based ones like + lynx(1). See HTML and XHTML manuals in the DOCUMENTATION section + for examples. Attention: available style-sheet classes have been + considerably changed! See the example.style.css file for details. + Lastly, libmdoc and libman have been cleaned up and reduced in size + and complexity. + * see also the changes in 1.10.7 + +Changes in version 1.10.7, December 6, 2010, NOT released + + Significant improvements merged from OpenBSD downstream, including: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Tue Dec 2 07:42:26 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 08:28:41 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 11:44:57 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 11:47:28 2014 Return-Path: Delivered-To: svn-src-all@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 AE72F9B4; Tue, 2 Dec 2014 11:47:28 +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 8FF7DCC4; Tue, 2 Dec 2014 11:47:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2BlSvg075661; Tue, 2 Dec 2014 11:47:28 GMT (envelope-from jch@FreeBSD.org) Received: (from jch@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2BlR8T075654; Tue, 2 Dec 2014 11:47:27 GMT (envelope-from jch@FreeBSD.org) Message-Id: <201412021147.sB2BlR8T075654@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jch set sender to jch@FreeBSD.org using -f From: Julien Charbon Date: Tue, 2 Dec 2014 11:47:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275402 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 11:47:28 -0000 Author: jch Date: Tue Dec 2 11:47:26 2014 New Revision: 275402 URL: https://svnweb.freebsd.org/changeset/base/275402 Log: MFC r264321, r264342, r264351, r264356, r273850, r274629: Currently, the TCP slow timer can starve TCP input processing while it walks the list of connections in TIME_WAIT closing expired connections due to contention on the global TCP pcbinfo lock. To remediate, introduce a new global lock to protect the list of connections in TIME_WAIT. Only acquire the TCP pcbinfo lock when closing an expired connection. This limits the window of time when TCP input processing is stopped to the amount of time needed to close a single connection. Approved by: jhb (mentor) Modified: stable/10/sys/netinet/tcp_timer.c stable/10/sys/netinet/tcp_timer.h stable/10/sys/netinet/tcp_timewait.c stable/10/sys/netinet/tcp_usrreq.c stable/10/sys/netinet/tcp_var.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/tcp_timer.c ============================================================================== --- stable/10/sys/netinet/tcp_timer.c Tue Dec 2 11:44:56 2014 (r275401) +++ stable/10/sys/netinet/tcp_timer.c Tue Dec 2 11:47:26 2014 (r275402) @@ -195,9 +195,7 @@ tcp_slowtimo(void) VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - INP_INFO_WLOCK(&V_tcbinfo); (void) tcp_tw_2msl_scan(0); - INP_INFO_WUNLOCK(&V_tcbinfo); CURVNET_RESTORE(); } VNET_LIST_RUNLOCK_NOSLEEP(); Modified: stable/10/sys/netinet/tcp_timer.h ============================================================================== --- stable/10/sys/netinet/tcp_timer.h Tue Dec 2 11:44:56 2014 (r275401) +++ stable/10/sys/netinet/tcp_timer.h Tue Dec 2 11:47:26 2014 (r275402) @@ -178,7 +178,7 @@ extern int tcp_fast_finwait2_recycle; void tcp_timer_init(void); void tcp_timer_2msl(void *xtp); struct tcptw * - tcp_tw_2msl_scan(int _reuse); /* XXX temporary */ + tcp_tw_2msl_scan(int reuse); /* XXX temporary? */ void tcp_timer_keep(void *xtp); void tcp_timer_persist(void *xtp); void tcp_timer_rexmt(void *xtp); Modified: stable/10/sys/netinet/tcp_timewait.c ============================================================================== --- stable/10/sys/netinet/tcp_timewait.c Tue Dec 2 11:44:56 2014 (r275401) +++ stable/10/sys/netinet/tcp_timewait.c Tue Dec 2 11:47:26 2014 (r275402) @@ -91,20 +91,40 @@ __FBSDID("$FreeBSD$"); #include static VNET_DEFINE(uma_zone_t, tcptw_zone); -#define V_tcptw_zone VNET(tcptw_zone) +#define V_tcptw_zone VNET(tcptw_zone) static int maxtcptw; /* * The timed wait queue contains references to each of the TCP sessions * currently in the TIME_WAIT state. The queue pointers, including the * queue pointers in each tcptw structure, are protected using the global - * tcbinfo lock, which must be held over queue iteration and modification. + * timewait lock, which must be held over queue iteration and modification. + * + * Rules on tcptw usage: + * - a inpcb is always freed _after_ its tcptw + * - a tcptw relies on its inpcb reference counting for memory stability + * - a tcptw is dereferenceable only while its inpcb is locked */ static VNET_DEFINE(TAILQ_HEAD(, tcptw), twq_2msl); -#define V_twq_2msl VNET(twq_2msl) +#define V_twq_2msl VNET(twq_2msl) + +/* Global timewait lock */ +static VNET_DEFINE(struct rwlock, tw_lock); +#define V_tw_lock VNET(tw_lock) + +#define TW_LOCK_INIT(tw, d) rw_init_flags(&(tw), (d), 0) +#define TW_LOCK_DESTROY(tw) rw_destroy(&(tw)) +#define TW_RLOCK(tw) rw_rlock(&(tw)) +#define TW_WLOCK(tw) rw_wlock(&(tw)) +#define TW_RUNLOCK(tw) rw_runlock(&(tw)) +#define TW_WUNLOCK(tw) rw_wunlock(&(tw)) +#define TW_LOCK_ASSERT(tw) rw_assert(&(tw), RA_LOCKED) +#define TW_RLOCK_ASSERT(tw) rw_assert(&(tw), RA_RLOCKED) +#define TW_WLOCK_ASSERT(tw) rw_assert(&(tw), RA_WLOCKED) +#define TW_UNLOCK_ASSERT(tw) rw_assert(&(tw), RA_UNLOCKED) static void tcp_tw_2msl_reset(struct tcptw *, int); -static void tcp_tw_2msl_stop(struct tcptw *); +static void tcp_tw_2msl_stop(struct tcptw *, int); static int tcp_twrespond(struct tcptw *, int); static int @@ -172,6 +192,7 @@ tcp_tw_init(void) else uma_zone_set_max(V_tcptw_zone, maxtcptw); TAILQ_INIT(&V_twq_2msl); + TW_LOCK_INIT(V_tw_lock, "tcptw"); } #ifdef VIMAGE @@ -181,10 +202,11 @@ tcp_tw_destroy(void) struct tcptw *tw; INP_INFO_WLOCK(&V_tcbinfo); - while((tw = TAILQ_FIRST(&V_twq_2msl)) != NULL) + while ((tw = TAILQ_FIRST(&V_twq_2msl)) != NULL) tcp_twclose(tw, 0); INP_INFO_WUNLOCK(&V_tcbinfo); + TW_LOCK_DESTROY(V_tw_lock); uma_zdestroy(V_tcptw_zone); } #endif @@ -205,7 +227,7 @@ tcp_twstart(struct tcpcb *tp) int isipv6 = inp->inp_inc.inc_flags & INC_ISIPV6; #endif - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); /* tcp_tw_2msl_reset(). */ + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); if (V_nolocaltimewait) { @@ -230,6 +252,14 @@ tcp_twstart(struct tcpcb *tp) tw = uma_zalloc(V_tcptw_zone, M_NOWAIT); if (tw == NULL) { + /* + * Reached limit on total number of TIMEWAIT connections + * allowed. Remove a connection from TIMEWAIT queue in LRU + * fashion to make room for this connection. + * + * pcbinfo lock is needed here to prevent deadlock as + * two inpcb locks can be acquired simultaneously. + */ tw = tcp_tw_2msl_scan(1); if (tw == NULL) { tp = tcp_close(tp); @@ -238,7 +268,12 @@ tcp_twstart(struct tcpcb *tp) return; } } + /* + * The tcptw will hold a reference on its inpcb until tcp_twclose + * is called + */ tw->tw_inpcb = inp; + in_pcbref(inp); /* Reference from tw */ /* * Recover last window size sent. @@ -321,7 +356,7 @@ tcp_twstart(struct tcpcb *tp) * Most other new OSes use semi-randomized ISN values, so we * do not need to worry about them. */ -#define MS_ISN_BYTES_PER_SECOND 250000 +#define MS_ISN_BYTES_PER_SECOND 250000 /* * Determine if the ISN we will generate has advanced beyond the last @@ -357,7 +392,6 @@ tcp_twcheck(struct inpcb *inp, struct tc int thflags; tcp_seq seq; - /* tcbinfo lock required for tcp_twclose(), tcp_tw_2msl_reset(). */ INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(inp); @@ -459,11 +493,10 @@ tcp_twclose(struct tcptw *tw, int reuse) inp = tw->tw_inpcb; KASSERT((inp->inp_flags & INP_TIMEWAIT), ("tcp_twclose: !timewait")); KASSERT(intotw(inp) == tw, ("tcp_twclose: inp_ppcb != tw")); - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); /* tcp_tw_2msl_stop(). */ + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); /* in_pcbfree() */ INP_WLOCK_ASSERT(inp); - tw->tw_inpcb = NULL; - tcp_tw_2msl_stop(tw); + tcp_tw_2msl_stop(tw, reuse); inp->inp_ppcb = NULL; in_pcbdrop(inp); @@ -492,14 +525,14 @@ tcp_twclose(struct tcptw *tw, int reuse) */ INP_WUNLOCK(inp); } - } else + } else { + /* + * The socket has been already cleaned-up for us, only free the + * inpcb. + */ in_pcbfree(inp); + } TCPSTAT_INC(tcps_closed); - crfree(tw->tw_cred); - tw->tw_cred = NULL; - if (reuse) - return; - uma_zfree(V_tcptw_zone, tw); } static int @@ -617,34 +650,106 @@ tcp_tw_2msl_reset(struct tcptw *tw, int INP_INFO_WLOCK_ASSERT(&V_tcbinfo); INP_WLOCK_ASSERT(tw->tw_inpcb); + + TW_WLOCK(V_tw_lock); if (rearm) TAILQ_REMOVE(&V_twq_2msl, tw, tw_2msl); tw->tw_time = ticks + 2 * tcp_msl; TAILQ_INSERT_TAIL(&V_twq_2msl, tw, tw_2msl); + TW_WUNLOCK(V_tw_lock); } static void -tcp_tw_2msl_stop(struct tcptw *tw) +tcp_tw_2msl_stop(struct tcptw *tw, int reuse) { + struct ucred *cred; + struct inpcb *inp; + int released; INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + + TW_WLOCK(V_tw_lock); + inp = tw->tw_inpcb; + tw->tw_inpcb = NULL; + TAILQ_REMOVE(&V_twq_2msl, tw, tw_2msl); + cred = tw->tw_cred; + tw->tw_cred = NULL; + TW_WUNLOCK(V_tw_lock); + + if (cred != NULL) + crfree(cred); + + released = in_pcbrele_wlocked(inp); + KASSERT(!released, ("%s: inp should not be released here", __func__)); + + if (!reuse) + uma_zfree(V_tcptw_zone, tw); } struct tcptw * tcp_tw_2msl_scan(int reuse) { struct tcptw *tw; + struct inpcb *inp; + +#ifdef INVARIANTS + if (reuse) { + /* + * pcbinfo lock is needed in reuse case to prevent deadlock + * as two inpcb locks can be acquired simultaneously: + * - the inpcb transitioning to TIME_WAIT state in + * tcp_tw_start(), + * - the inpcb closed by tcp_twclose(). + */ + INP_INFO_WLOCK_ASSERT(&V_tcbinfo); + } +#endif - INP_INFO_WLOCK_ASSERT(&V_tcbinfo); for (;;) { + TW_RLOCK(V_tw_lock); tw = TAILQ_FIRST(&V_twq_2msl); - if (tw == NULL || (!reuse && (tw->tw_time - ticks) > 0)) + if (tw == NULL || (!reuse && (tw->tw_time - ticks) > 0)) { + TW_RUNLOCK(V_tw_lock); + break; + } + KASSERT(tw->tw_inpcb != NULL, ("%s: tw->tw_inpcb == NULL", + __func__)); + + inp = tw->tw_inpcb; + in_pcbref(inp); + TW_RUNLOCK(V_tw_lock); + + if (INP_INFO_TRY_WLOCK(&V_tcbinfo)) { + + INP_WLOCK(inp); + tw = intotw(inp); + if (in_pcbrele_wlocked(inp)) { + KASSERT(tw == NULL, ("%s: held last inp " + "reference but tw not NULL", __func__)); + INP_INFO_WUNLOCK(&V_tcbinfo); + continue; + } + + if (tw == NULL) { + /* tcp_twclose() has already been called */ + INP_WUNLOCK(inp); + INP_INFO_WUNLOCK(&V_tcbinfo); + continue; + } + + tcp_twclose(tw, reuse); + INP_INFO_WUNLOCK(&V_tcbinfo); + if (reuse) + return tw; + } else { + /* INP_INFO lock is busy, continue later. */ + INP_WLOCK(inp); + if (!in_pcbrele_wlocked(inp)) + INP_WUNLOCK(inp); break; - INP_WLOCK(tw->tw_inpcb); - tcp_twclose(tw, reuse); - if (reuse) - return (tw); + } } - return (NULL); + + return NULL; } Modified: stable/10/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/10/sys/netinet/tcp_usrreq.c Tue Dec 2 11:44:56 2014 (r275401) +++ stable/10/sys/netinet/tcp_usrreq.c Tue Dec 2 11:47:26 2014 (r275402) @@ -182,6 +182,21 @@ tcp_detach(struct socket *so, struct inp * present until timewait ends. * * XXXRW: Would it be cleaner to free the tcptw here? + * + * Astute question indeed, from twtcp perspective there are + * three cases to consider: + * + * #1 tcp_detach is called at tcptw creation time by + * tcp_twstart, then do not discard the newly created tcptw + * and leave inpcb present until timewait ends + * #2 tcp_detach is called at timewait end (or reuse) by + * tcp_twclose, then the tcptw has already been discarded + * and inpcb is freed here + * #3 tcp_detach is called() after timewait ends (or reuse) + * (e.g. by soclose), then tcptw has already been discarded + * and inpcb is freed here + * + * In all three cases the tcptw should not be freed here. */ if (inp->inp_flags & INP_DROPPED) { KASSERT(tp == NULL, ("tcp_detach: INP_TIMEWAIT && " Modified: stable/10/sys/netinet/tcp_var.h ============================================================================== --- stable/10/sys/netinet/tcp_var.h Tue Dec 2 11:44:56 2014 (r275401) +++ stable/10/sys/netinet/tcp_var.h Tue Dec 2 11:47:26 2014 (r275402) @@ -663,7 +663,7 @@ void tcp_twstart(struct tcpcb *); #if 0 int tcp_twrecycleable(struct tcptw *tw); #endif -void tcp_twclose(struct tcptw *_tw, int _reuse); +void tcp_twclose(struct tcptw *, int); void tcp_ctlinput(int, struct sockaddr *, void *); int tcp_ctloutput(struct socket *, struct sockopt *); struct tcpcb * From owner-svn-src-all@FreeBSD.ORG Tue Dec 2 12:05:45 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 12:31:29 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 12:38:23 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 12:39:29 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 13:46:16 2014 Return-Path: Delivered-To: svn-src-all@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 708E848C; Tue, 2 Dec 2014 13:46: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 5B9B2B72; Tue, 2 Dec 2014 13:46: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 sB2DkG2E032681; Tue, 2 Dec 2014 13:46:16 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2DkEDX032671; Tue, 2 Dec 2014 13:46:14 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201412021346.sB2DkEDX032671@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Tue, 2 Dec 2014 13:46:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275406 - stable/10/sys/dev/agp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 13:46:16 -0000 Author: tijl Date: Tue Dec 2 13:46:13 2014 New Revision: 275406 URL: https://svnweb.freebsd.org/changeset/base/275406 Log: MFC r273856,273863,273963-273965 - Add two new functions to the AGP driver KPI to bind/unbind arbitrary sets of pages into the GTT. - Avoid possible overflow in agp_generic_alloc_memory. - In agp(4) avoid the need to flush all cpu caches with wbinvd between updating the GTT and flushing the AGP TLB by storing the GTT in write-combining memory. - In agp_amd_bind_page don't flush the AGP TLB. It's done by the calling function. - agp_generic_unbind_memory: flush AGP TLB before unwiring pages agp_bind_pages: assert that pages have been wired down Modified: stable/10/sys/dev/agp/agp.c stable/10/sys/dev/agp/agp_amd.c stable/10/sys/dev/agp/agp_amd64.c stable/10/sys/dev/agp/agp_apple.c stable/10/sys/dev/agp/agp_ati.c stable/10/sys/dev/agp/agp_i810.c stable/10/sys/dev/agp/agppriv.h stable/10/sys/dev/agp/agpvar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/agp/agp.c ============================================================================== --- stable/10/sys/dev/agp/agp.c Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agp.c Tue Dec 2 13:46:13 2014 (r275406) @@ -50,6 +50,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -84,14 +86,6 @@ static devclass_t agp_devclass; /* Helper functions for implementing chipset mini drivers. */ -void -agp_flush_cache() -{ -#if defined(__i386__) || defined(__amd64__) - wbinvd(); -#endif -} - u_int8_t agp_find_caps(device_t dev) { @@ -158,17 +152,16 @@ agp_alloc_gatt(device_t dev) return 0; gatt->ag_entries = entries; - gatt->ag_virtual = contigmalloc(entries * sizeof(u_int32_t), M_AGP, 0, - 0, ~0, PAGE_SIZE, 0); + gatt->ag_virtual = (void *)kmem_alloc_contig(kernel_arena, + entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, PAGE_SIZE, + 0, VM_MEMATTR_WRITE_COMBINING); if (!gatt->ag_virtual) { if (bootverbose) device_printf(dev, "contiguous allocation failed\n"); free(gatt, M_AGP); return 0; } - bzero(gatt->ag_virtual, entries * sizeof(u_int32_t)); gatt->ag_physical = vtophys((vm_offset_t) gatt->ag_virtual); - agp_flush_cache(); return gatt; } @@ -176,8 +169,8 @@ agp_alloc_gatt(device_t dev) void agp_free_gatt(struct agp_gatt *gatt) { - contigfree(gatt->ag_virtual, - gatt->ag_entries * sizeof(u_int32_t), M_AGP); + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_virtual, + gatt->ag_entries * sizeof(u_int32_t)); free(gatt, M_AGP); } @@ -280,7 +273,6 @@ agp_free_res(device_t dev) bus_release_resource(dev, SYS_RES_MEMORY, sc->as_aperture_rid, sc->as_aperture); mtx_destroy(&sc->as_lock); - agp_flush_cache(); } int @@ -485,7 +477,7 @@ agp_generic_alloc_memory(device_t dev, i if ((size & (AGP_PAGE_SIZE - 1)) != 0) return 0; - if (sc->as_allocated + size > sc->as_maxmem) + if (size > sc->as_maxmem - sc->as_allocated) return 0; if (type != 0) { @@ -605,12 +597,6 @@ agp_generic_bind_memory(device_t dev, st VM_OBJECT_WUNLOCK(mem->am_obj); /* - * Flush the cpu cache since we are providing a new mapping - * for these pages. - */ - agp_flush_cache(); - - /* * Make sure the chipset gets the new mappings. */ AGP_FLUSH_TLB(dev); @@ -659,6 +645,9 @@ agp_generic_unbind_memory(device_t dev, */ for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE) AGP_UNBIND_PAGE(dev, mem->am_offset + i); + + AGP_FLUSH_TLB(dev); + VM_OBJECT_WLOCK(mem->am_obj); for (i = 0; i < mem->am_size; i += PAGE_SIZE) { m = vm_page_lookup(mem->am_obj, atop(i)); @@ -667,9 +656,6 @@ agp_generic_unbind_memory(device_t dev, vm_page_unlock(m); } VM_OBJECT_WUNLOCK(mem->am_obj); - - agp_flush_cache(); - AGP_FLUSH_TLB(dev); mem->am_offset = 0; mem->am_is_bound = 0; @@ -996,3 +982,76 @@ void agp_memory_info(device_t dev, void mi->ami_offset = mem->am_offset; mi->ami_is_bound = mem->am_is_bound; } + +int +agp_bind_pages(device_t dev, vm_page_t *pages, vm_size_t size, + vm_offset_t offset) +{ + struct agp_softc *sc; + vm_offset_t i, j, k, pa; + vm_page_t m; + int error; + + if ((size & (AGP_PAGE_SIZE - 1)) != 0 || + (offset & (AGP_PAGE_SIZE - 1)) != 0) + return (EINVAL); + + sc = device_get_softc(dev); + + mtx_lock(&sc->as_lock); + for (i = 0; i < size; i += PAGE_SIZE) { + m = pages[OFF_TO_IDX(i)]; + KASSERT(m->wire_count > 0, + ("agp_bind_pages: page %p hasn't been wired", m)); + + /* + * Install entries in the GATT, making sure that if + * AGP_PAGE_SIZE < PAGE_SIZE and size is not + * aligned to PAGE_SIZE, we don't modify too many GATT + * entries. + */ + for (j = 0; j < PAGE_SIZE && i + j < size; j += AGP_PAGE_SIZE) { + pa = VM_PAGE_TO_PHYS(m) + j; + AGP_DPF("binding offset %#jx to pa %#jx\n", + (uintmax_t)offset + i + j, (uintmax_t)pa); + error = AGP_BIND_PAGE(dev, offset + i + j, pa); + if (error) { + /* + * Bail out. Reverse all the mappings. + */ + for (k = 0; k < i + j; k += AGP_PAGE_SIZE) + AGP_UNBIND_PAGE(dev, offset + k); + + mtx_unlock(&sc->as_lock); + return (error); + } + } + } + + AGP_FLUSH_TLB(dev); + + mtx_unlock(&sc->as_lock); + return (0); +} + +int +agp_unbind_pages(device_t dev, vm_size_t size, vm_offset_t offset) +{ + struct agp_softc *sc; + vm_offset_t i; + + if ((size & (AGP_PAGE_SIZE - 1)) != 0 || + (offset & (AGP_PAGE_SIZE - 1)) != 0) + return (EINVAL); + + sc = device_get_softc(dev); + + mtx_lock(&sc->as_lock); + for (i = 0; i < size; i += AGP_PAGE_SIZE) + AGP_UNBIND_PAGE(dev, offset + i); + + AGP_FLUSH_TLB(dev); + + mtx_unlock(&sc->as_lock); + return (0); +} Modified: stable/10/sys/dev/agp/agp_amd.c ============================================================================== --- stable/10/sys/dev/agp/agp_amd.c Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agp_amd.c Tue Dec 2 13:46:13 2014 (r275406) @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -92,34 +94,35 @@ agp_amd_alloc_gatt(device_t dev) /* * The AMD751 uses a page directory to map a non-contiguous - * gatt so we don't need to use contigmalloc. - * Malloc individual gatt pages and map them into the page + * gatt so we don't need to use kmem_alloc_contig. + * Allocate individual GATT pages and map them into the page * directory. */ gatt->ag_entries = entries; - gatt->ag_virtual = malloc(entries * sizeof(u_int32_t), - M_AGP, M_NOWAIT); + gatt->ag_virtual = (void *)kmem_alloc_attr(kernel_arena, + entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, + VM_MEMATTR_WRITE_COMBINING); if (!gatt->ag_virtual) { if (bootverbose) device_printf(dev, "allocation failed\n"); free(gatt, M_AGP); return 0; } - bzero(gatt->ag_virtual, entries * sizeof(u_int32_t)); /* * Allocate the page directory. */ - gatt->ag_vdir = malloc(AGP_PAGE_SIZE, M_AGP, M_NOWAIT); + gatt->ag_vdir = (void *)kmem_alloc_attr(kernel_arena, AGP_PAGE_SIZE, + M_NOWAIT | M_ZERO, 0, ~0, VM_MEMATTR_WRITE_COMBINING); if (!gatt->ag_vdir) { if (bootverbose) device_printf(dev, "failed to allocate page directory\n"); - free(gatt->ag_virtual, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_virtual, + entries * sizeof(u_int32_t)); free(gatt, M_AGP); return 0; } - bzero(gatt->ag_vdir, AGP_PAGE_SIZE); gatt->ag_pdir = vtophys((vm_offset_t) gatt->ag_vdir); if(bootverbose) @@ -158,19 +161,15 @@ agp_amd_alloc_gatt(device_t dev) gatt->ag_vdir[i + pdir_offset] = pa | 1; } - /* - * Make sure the chipset can see everything. - */ - agp_flush_cache(); - return gatt; } static void agp_amd_free_gatt(struct agp_amd_gatt *gatt) { - free(gatt->ag_virtual, M_AGP); - free(gatt->ag_vdir, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_vdir, AGP_PAGE_SIZE); + kmem_free(kernel_arena, (vm_offset_t)gatt->ag_virtual, + gatt->ag_entries * sizeof(u_int32_t)); free(gatt, M_AGP); } @@ -348,9 +347,6 @@ agp_amd_bind_page(device_t dev, vm_offse return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical | 1; - - /* invalidate the cache */ - AGP_FLUSH_TLB(dev); return 0; } Modified: stable/10/sys/dev/agp/agp_amd64.c ============================================================================== --- stable/10/sys/dev/agp/agp_amd64.c Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agp_amd64.c Tue Dec 2 13:46:13 2014 (r275406) @@ -241,8 +241,6 @@ agp_amd64_attach(device_t dev) 4); } - agp_flush_cache(); - return (0); } Modified: stable/10/sys/dev/agp/agp_apple.c ============================================================================== --- stable/10/sys/dev/agp/agp_apple.c Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agp_apple.c Tue Dec 2 13:46:13 2014 (r275406) @@ -224,8 +224,6 @@ agp_apple_bind_page(device_t dev, vm_off return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = physical; - __asm __volatile("dcbst 0,%0; sync" :: - "r"(&sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT]) : "memory"); return (0); } @@ -238,8 +236,6 @@ agp_apple_unbind_page(device_t dev, vm_o return EINVAL; sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT] = 0; - __asm __volatile("dcbst 0,%0; sync" :: - "r"(&sc->gatt->ag_virtual[offset >> AGP_PAGE_SHIFT]) : "memory"); return (0); } Modified: stable/10/sys/dev/agp/agp_ati.c ============================================================================== --- stable/10/sys/dev/agp/agp_ati.c Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agp_ati.c Tue Dec 2 13:46:13 2014 (r275406) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -129,20 +131,23 @@ agp_ati_alloc_gatt(device_t dev) /* Alloc the GATT -- pointers to pages of AGP memory */ sc->ag_entries = entries; - sc->ag_virtual = malloc(entries * sizeof(u_int32_t), M_AGP, - M_NOWAIT | M_ZERO); + sc->ag_virtual = (void *)kmem_alloc_attr(kernel_arena, + entries * sizeof(u_int32_t), M_NOWAIT | M_ZERO, 0, ~0, + VM_MEMATTR_WRITE_COMBINING); if (sc->ag_virtual == NULL) { if (bootverbose) - device_printf(dev, "aperture allocation failed\n"); + device_printf(dev, "GATT allocation failed\n"); return ENOMEM; } /* Alloc the page directory -- pointers to each page of the GATT */ - sc->ag_vdir = malloc(AGP_PAGE_SIZE, M_AGP, M_NOWAIT | M_ZERO); + sc->ag_vdir = (void *)kmem_alloc_attr(kernel_arena, AGP_PAGE_SIZE, + M_NOWAIT | M_ZERO, 0, ~0, VM_MEMATTR_WRITE_COMBINING); if (sc->ag_vdir == NULL) { if (bootverbose) device_printf(dev, "pagedir allocation failed\n"); - free(sc->ag_virtual, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)sc->ag_virtual, + entries * sizeof(u_int32_t)); return ENOMEM; } sc->ag_pdir = vtophys((vm_offset_t)sc->ag_vdir); @@ -158,11 +163,6 @@ agp_ati_alloc_gatt(device_t dev) sc->ag_vdir[apbase_offset + i] = pa | 1; } - /* - * Make sure the chipset can see everything. - */ - agp_flush_cache(); - return 0; } @@ -264,8 +264,9 @@ agp_ati_detach(device_t dev) temp = pci_read_config(dev, apsize_reg, 4); pci_write_config(dev, apsize_reg, temp & ~1, 4); - free(sc->ag_vdir, M_AGP); - free(sc->ag_virtual, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)sc->ag_vdir, AGP_PAGE_SIZE); + kmem_free(kernel_arena, (vm_offset_t)sc->ag_virtual, + sc->ag_entries * sizeof(u_int32_t)); bus_release_resource(dev, SYS_RES_MEMORY, ATI_GART_MMADDR, sc->regs); agp_free_res(dev); Modified: stable/10/sys/dev/agp/agp_i810.c ============================================================================== --- stable/10/sys/dev/agp/agp_i810.c Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agp_i810.c Tue Dec 2 13:46:13 2014 (r275406) @@ -66,6 +66,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -1449,17 +1451,16 @@ agp_i810_install_gatt(device_t dev) sc->dcache_size = 0; /* According to the specs the gatt on the i810 must be 64k. */ - sc->gatt->ag_virtual = contigmalloc(64 * 1024, M_AGP, 0, 0, ~0, - PAGE_SIZE, 0); + sc->gatt->ag_virtual = (void *)kmem_alloc_contig(kernel_arena, + 64 * 1024, M_NOWAIT | M_ZERO, 0, ~0, PAGE_SIZE, + 0, VM_MEMATTR_WRITE_COMBINING); if (sc->gatt->ag_virtual == NULL) { if (bootverbose) device_printf(dev, "contiguous allocation failed\n"); return (ENOMEM); } - bzero(sc->gatt->ag_virtual, sc->gatt->ag_entries * sizeof(u_int32_t)); sc->gatt->ag_physical = vtophys((vm_offset_t)sc->gatt->ag_virtual); - agp_flush_cache(); /* Install the GATT. */ bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, sc->gatt->ag_physical | 1); @@ -1591,7 +1592,7 @@ agp_i810_deinstall_gatt(device_t dev) sc = device_get_softc(dev); bus_write_4(sc->sc_res[0], AGP_I810_PGTBL_CTL, 0); - contigfree(sc->gatt->ag_virtual, 64 * 1024, M_AGP); + kmem_free(kernel_arena, (vm_offset_t)sc->gatt->ag_virtual, 64 * 1024); } static void @@ -2146,7 +2147,6 @@ agp_i810_bind_memory(device_t dev, struc sc->match->driver->install_gtt_pte(dev, (offset + i) >> AGP_PAGE_SHIFT, mem->am_physical + i, 0); } - agp_flush_cache(); mem->am_offset = offset; mem->am_is_bound = 1; mtx_unlock(&sc->agp.as_lock); @@ -2187,7 +2187,6 @@ agp_i810_unbind_memory(device_t dev, str sc->match->driver->install_gtt_pte(dev, (mem->am_offset + i) >> AGP_PAGE_SHIFT, 0, 0); } - agp_flush_cache(); mem->am_is_bound = 0; mtx_unlock(&sc->agp.as_lock); return (0); Modified: stable/10/sys/dev/agp/agppriv.h ============================================================================== --- stable/10/sys/dev/agp/agppriv.h Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agppriv.h Tue Dec 2 13:46:13 2014 (r275406) @@ -83,7 +83,6 @@ struct agp_gatt { vm_offset_t ag_physical; }; -void agp_flush_cache(void); u_int8_t agp_find_caps(device_t dev); struct agp_gatt *agp_alloc_gatt(device_t dev); void agp_set_aperture_resource(device_t dev, int rid); Modified: stable/10/sys/dev/agp/agpvar.h ============================================================================== --- stable/10/sys/dev/agp/agpvar.h Tue Dec 2 12:38:22 2014 (r275405) +++ stable/10/sys/dev/agp/agpvar.h Tue Dec 2 13:46:13 2014 (r275406) @@ -122,6 +122,19 @@ int agp_unbind_memory(device_t dev, void */ void agp_memory_info(device_t dev, void *handle, struct agp_memory_info *mi); +/* + * Bind a set of pages at a given offset within the AGP aperture. + * Returns EINVAL if the given size or offset is not at an AGP page boundary. + */ +int agp_bind_pages(device_t dev, vm_page_t *pages, vm_size_t size, + vm_offset_t offset); + +/* + * Unbind a set of pages from the AGP aperture. + * Returns EINVAL if the given size or offset is not at an AGP page boundary. + */ +int agp_unbind_pages(device_t dev, vm_size_t size, vm_offset_t offset); + #define AGP_NORMAL_MEMORY 0 #define AGP_USER_TYPES (1 << 16) From owner-svn-src-all@FreeBSD.ORG Tue Dec 2 13:58:58 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 14:09:57 2014 Return-Path: Delivered-To: svn-src-all@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 1C8CBACA; Tue, 2 Dec 2014 14:09: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 074B5D8E; Tue, 2 Dec 2014 14:09: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 sB2E9ump042779; Tue, 2 Dec 2014 14:09:56 GMT (envelope-from tijl@FreeBSD.org) Received: (from tijl@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2E9sZu042768; Tue, 2 Dec 2014 14:09:54 GMT (envelope-from tijl@FreeBSD.org) Message-Id: <201412021409.sB2E9sZu042768@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: tijl set sender to tijl@FreeBSD.org using -f From: Tijl Coosemans Date: Tue, 2 Dec 2014 14:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275408 - in stable/10/sys: dev/drm2 dev/drm2/radeon dev/drm2/ttm modules/drm2/drm2 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 14:09:57 -0000 Author: tijl Date: Tue Dec 2 14:09:54 2014 New Revision: 275408 URL: https://svnweb.freebsd.org/changeset/base/275408 Log: MFC r273862,273902: Port the TTM AGP backend to the FreeBSD agp driver and enable AGP support in the radeonkms driver. Note: In PCI mode virtual addresses on the graphics card that map to system RAM are translated to physical addresses by the graphics card itself. In AGP mode address translation is done by the AGP chipset so fictitious addresses appear on the system bus. For the CPU cache management to work correctly when the CPU accesses this memory it needs to use the same fictitious addresses (and let the chipset translate them) instead of using the physical addresses directly. Reviewed by: kib Modified: stable/10/sys/dev/drm2/drm_agpsupport.c stable/10/sys/dev/drm2/radeon/radeon.h stable/10/sys/dev/drm2/radeon/radeon_device.c stable/10/sys/dev/drm2/radeon/radeon_ttm.c stable/10/sys/dev/drm2/ttm/ttm_agp_backend.c stable/10/sys/dev/drm2/ttm/ttm_bo_driver.h stable/10/sys/dev/drm2/ttm/ttm_page_alloc.c stable/10/sys/modules/drm2/drm2/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/drm2/drm_agpsupport.c ============================================================================== --- stable/10/sys/dev/drm2/drm_agpsupport.c Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/dev/drm2/drm_agpsupport.c Tue Dec 2 14:09:54 2014 (r275408) @@ -396,7 +396,7 @@ void *drm_agp_allocate_memory(size_t pag if (!agpdev) return NULL; - return agp_alloc_memory(agpdev, type, pages << AGP_PAGE_SHIFT); + return agp_alloc_memory(agpdev, type, pages << PAGE_SHIFT); } int drm_agp_free_memory(void *handle) Modified: stable/10/sys/dev/drm2/radeon/radeon.h ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon.h Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/dev/drm2/radeon/radeon.h Tue Dec 2 14:09:54 2014 (r275408) @@ -1618,6 +1618,7 @@ struct radeon_device { bool need_dma32; bool accel_working; bool fictitious_range_registered; + bool fictitious_agp_range_registered; struct radeon_surface_reg surface_regs[RADEON_GEM_MAX_SURFACES]; const struct firmware *me_fw; /* all family ME firmware */ const struct firmware *pfp_fw; /* r6/700 PFP firmware */ Modified: stable/10/sys/dev/drm2/radeon/radeon_device.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_device.c Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/dev/drm2/radeon/radeon_device.c Tue Dec 2 14:09:54 2014 (r275408) @@ -1014,6 +1014,7 @@ int radeon_device_init(struct radeon_dev rdev->mc.gtt_size = radeon_gart_size * 1024 * 1024; rdev->accel_working = false; rdev->fictitious_range_registered = false; + rdev->fictitious_agp_range_registered = false; /* set up ring ids */ for (i = 0; i < RADEON_NUM_RINGS; i++) { rdev->ring[i].idx = i; @@ -1168,6 +1169,24 @@ int radeon_device_init(struct radeon_dev return (-r); } rdev->fictitious_range_registered = true; +#if __OS_HAS_AGP + if (rdev->flags & RADEON_IS_AGP) { + DRM_INFO("%s: Taking over the fictitious range 0x%jx-0x%jx\n", + __func__, (uintmax_t)rdev->mc.agp_base, + (uintmax_t)rdev->mc.agp_base + rdev->mc.gtt_size); + r = vm_phys_fictitious_reg_range( + rdev->mc.agp_base, + rdev->mc.agp_base + rdev->mc.gtt_size, + VM_MEMATTR_WRITE_COMBINING); + if (r != 0) { + DRM_ERROR("Failed to register fictitious range " + "0x%jx-0x%jx (%d).\n", (uintmax_t)rdev->mc.agp_base, + (uintmax_t)rdev->mc.agp_base + rdev->mc.gtt_size, r); + return (-r); + } + rdev->fictitious_agp_range_registered = true; + } +#endif if ((radeon_testing & 1)) { radeon_test_moves(rdev); @@ -1205,6 +1224,13 @@ void radeon_device_fini(struct radeon_de rdev->mc.aper_base, rdev->mc.aper_base + rdev->mc.visible_vram_size); } +#if __OS_HAS_AGP + if (rdev->fictitious_agp_range_registered) { + vm_phys_fictitious_unreg_range( + rdev->mc.agp_base, + rdev->mc.agp_base + rdev->mc.gtt_size); + } +#endif radeon_fini(rdev); #ifdef DUMBBELL_WIP Modified: stable/10/sys/dev/drm2/radeon/radeon_ttm.c ============================================================================== --- stable/10/sys/dev/drm2/radeon/radeon_ttm.c Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/dev/drm2/radeon/radeon_ttm.c Tue Dec 2 14:09:54 2014 (r275408) @@ -560,12 +560,10 @@ static struct ttm_tt *radeon_ttm_tt_crea rdev = radeon_get_rdev(bdev); #if __OS_HAS_AGP -#ifdef DUMBBELL_WIP if (rdev->flags & RADEON_IS_AGP) { return ttm_agp_tt_create(bdev, rdev->ddev->agp->agpdev, size, page_flags, dummy_read_page); } -#endif /* DUMBBELL_WIP */ #endif gtt = malloc(sizeof(struct radeon_ttm_tt), @@ -610,11 +608,9 @@ static int radeon_ttm_tt_populate(struct rdev = radeon_get_rdev(ttm->bdev); #if __OS_HAS_AGP -#ifdef DUMBBELL_WIP if (rdev->flags & RADEON_IS_AGP) { return ttm_agp_tt_populate(ttm); } -#endif /* DUMBBELL_WIP */ #endif #ifdef CONFIG_SWIOTLB @@ -660,12 +656,10 @@ static void radeon_ttm_tt_unpopulate(str rdev = radeon_get_rdev(ttm->bdev); #if __OS_HAS_AGP -#ifdef DUMBBELL_WIP if (rdev->flags & RADEON_IS_AGP) { ttm_agp_tt_unpopulate(ttm); return; } -#endif /* DUMBBELL_WIP */ #endif #ifdef CONFIG_SWIOTLB Modified: stable/10/sys/dev/drm2/ttm/ttm_agp_backend.c ============================================================================== --- stable/10/sys/dev/drm2/ttm/ttm_agp_backend.c Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/dev/drm2/ttm/ttm_agp_backend.c Tue Dec 2 14:09:54 2014 (r275408) @@ -41,7 +41,8 @@ __FBSDID("$FreeBSD$"); struct ttm_agp_backend { struct ttm_tt ttm; - struct agp_memory *mem; + vm_offset_t offset; + vm_page_t *pages; device_t bridge; }; @@ -51,31 +52,23 @@ static int ttm_agp_bind(struct ttm_tt *t { struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); struct drm_mm_node *node = bo_mem->mm_node; - struct agp_memory *mem; - int ret, cached = (bo_mem->placement & TTM_PL_FLAG_CACHED); + int ret; unsigned i; - mem = agp_alloc_memory(agp_be->bridge, AGP_USER_MEMORY, ttm->num_pages); - if (unlikely(mem == NULL)) - return -ENOMEM; - - mem->page_count = 0; for (i = 0; i < ttm->num_pages; i++) { vm_page_t page = ttm->pages[i]; if (!page) page = ttm->dummy_read_page; - mem->pages[mem->page_count++] = page; + agp_be->pages[i] = page; } - agp_be->mem = mem; - - mem->is_flushed = 1; - mem->type = (cached) ? AGP_USER_CACHED_MEMORY : AGP_USER_MEMORY; - ret = agp_bind_memory(mem, node->start); + agp_be->offset = node->start * PAGE_SIZE; + ret = -agp_bind_pages(agp_be->bridge, agp_be->pages, + ttm->num_pages << PAGE_SHIFT, agp_be->offset); if (ret) - pr_err("AGP Bind memory failed\n"); + printf("[TTM] AGP Bind memory failed\n"); return ret; } @@ -84,22 +77,16 @@ static int ttm_agp_unbind(struct ttm_tt { struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); - if (agp_be->mem) { - if (agp_be->mem->is_bound) - return agp_unbind_memory(agp_be->mem); - agp_free_memory(agp_be->mem); - agp_be->mem = NULL; - } - return 0; + return -agp_unbind_pages(agp_be->bridge, ttm->num_pages << PAGE_SHIFT, + agp_be->offset); } static void ttm_agp_destroy(struct ttm_tt *ttm) { struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); - if (agp_be->mem) - ttm_agp_unbind(ttm); ttm_tt_fini(ttm); + free(agp_be->pages, M_TTM_AGP); free(agp_be, M_TTM_AGP); } @@ -118,14 +105,18 @@ struct ttm_tt *ttm_agp_tt_create(struct agp_be = malloc(sizeof(*agp_be), M_TTM_AGP, M_WAITOK | M_ZERO); - agp_be->mem = NULL; agp_be->bridge = bridge; agp_be->ttm.func = &ttm_agp_func; if (ttm_tt_init(&agp_be->ttm, bdev, size, page_flags, dummy_read_page)) { + free(agp_be, M_TTM_AGP); return NULL; } + agp_be->offset = 0; + agp_be->pages = malloc(agp_be->ttm.num_pages * sizeof(*agp_be->pages), + M_TTM_AGP, M_WAITOK); + return &agp_be->ttm; } Modified: stable/10/sys/dev/drm2/ttm/ttm_bo_driver.h ============================================================================== --- stable/10/sys/dev/drm2/ttm/ttm_bo_driver.h Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/dev/drm2/ttm/ttm_bo_driver.h Tue Dec 2 14:09:54 2014 (r275408) @@ -990,9 +990,8 @@ extern vm_memattr_t ttm_io_prot(uint32_t extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; -#if (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) +#if __OS_HAS_AGP #define TTM_HAS_AGP -#include /** * ttm_agp_tt_create @@ -1009,7 +1008,7 @@ extern const struct ttm_mem_type_manager * bind and unbind memory backing a ttm_tt. */ extern struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, - struct agp_bridge_data *bridge, + device_t bridge, unsigned long size, uint32_t page_flags, struct vm_page *dummy_read_page); int ttm_agp_tt_populate(struct ttm_tt *ttm); Modified: stable/10/sys/dev/drm2/ttm/ttm_page_alloc.c ============================================================================== --- stable/10/sys/dev/drm2/ttm/ttm_page_alloc.c Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/dev/drm2/ttm/ttm_page_alloc.c Tue Dec 2 14:09:54 2014 (r275408) @@ -45,10 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef TTM_HAS_AGP -#include -#endif - #define NUM_PAGES_TO_ALLOC (PAGE_SIZE/sizeof(vm_page_t)) #define SMALL_ALLOCATION 16 #define FREE_ALL_PAGES (~0U) @@ -220,46 +216,34 @@ static struct ttm_pool_manager *_manager static int set_pages_array_wb(vm_page_t *pages, int addrinarray) { - vm_page_t m; +#ifdef TTM_HAS_AGP int i; - for (i = 0; i < addrinarray; i++) { - m = pages[i]; -#ifdef TTM_HAS_AGP - unmap_page_from_agp(m); + for (i = 0; i < addrinarray; i++) + pmap_page_set_memattr(pages[i], VM_MEMATTR_WRITE_BACK); #endif - pmap_page_set_memattr(m, VM_MEMATTR_WRITE_BACK); - } return 0; } static int set_pages_array_wc(vm_page_t *pages, int addrinarray) { - vm_page_t m; +#ifdef TTM_HAS_AGP int i; - for (i = 0; i < addrinarray; i++) { - m = pages[i]; -#ifdef TTM_HAS_AGP - map_page_into_agp(pages[i]); + for (i = 0; i < addrinarray; i++) + pmap_page_set_memattr(pages[i], VM_MEMATTR_WRITE_COMBINING); #endif - pmap_page_set_memattr(m, VM_MEMATTR_WRITE_COMBINING); - } return 0; } static int set_pages_array_uc(vm_page_t *pages, int addrinarray) { - vm_page_t m; +#ifdef TTM_HAS_AGP int i; - for (i = 0; i < addrinarray; i++) { - m = pages[i]; -#ifdef TTM_HAS_AGP - map_page_into_agp(pages[i]); + for (i = 0; i < addrinarray; i++) + pmap_page_set_memattr(pages[i], VM_MEMATTR_UNCACHEABLE); #endif - pmap_page_set_memattr(m, VM_MEMATTR_UNCACHEABLE); - } return 0; } Modified: stable/10/sys/modules/drm2/drm2/Makefile ============================================================================== --- stable/10/sys/modules/drm2/drm2/Makefile Tue Dec 2 13:58:57 2014 (r275407) +++ stable/10/sys/modules/drm2/drm2/Makefile Tue Dec 2 14:09:54 2014 (r275408) @@ -35,6 +35,7 @@ SRCS = \ drm_stub.c \ drm_sysctl.c \ drm_vm.c \ + ttm_agp_backend.c \ ttm_lock.c \ ttm_object.c \ ttm_tt.c \ @@ -46,7 +47,6 @@ SRCS = \ ttm_page_alloc.c \ ttm_bo_vm.c \ ati_pcigart.c -#ttm_agp_backend.c #ttm_page_alloc_dma.c .if ${MACHINE_CPUARCH} == "amd64" From owner-svn-src-all@FreeBSD.ORG Tue Dec 2 16:22:09 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 18:12:17 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 18:20:54 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 18:35:35 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 18:37:05 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 19:41:25 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 19:55:45 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 19:58:27 2014 Return-Path: Delivered-To: svn-src-all@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 5D439FBF; Tue, 2 Dec 2014 19:58: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 4947EB21; Tue, 2 Dec 2014 19:58: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 sB2JwRgJ010196; Tue, 2 Dec 2014 19:58:27 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2JwRSP010195; Tue, 2 Dec 2014 19:58:27 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201412021958.sB2JwRSP010195@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 2 Dec 2014 19:58:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275424 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 19:58:27 -0000 Author: brooks Date: Tue Dec 2 19:58:26 2014 New Revision: 275424 URL: https://svnweb.freebsd.org/changeset/base/275424 Log: MFC r274806: Add a guard against attempting to invoke the buildenv target with -j# as that silently exits rather than doing something useful. Sponsored by: DARPA, AFRL Modified: stable/10/Makefile.inc1 Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Tue Dec 2 19:55:46 2014 (r275423) +++ stable/10/Makefile.inc1 Tue Dec 2 19:58:26 2014 (r275424) @@ -689,6 +689,11 @@ buildworld_epilogue: buildenvvars: @echo ${WMAKEENV:Q} +.if ${.TARGETS:Mbuildenv} +.if ${.MAKEFLAGS:M-j} +.error The buildenv target is incompatible with -j +.endif +.endif buildenv: @echo Entering world for ${TARGET_ARCH}:${TARGET} @cd ${.CURDIR} && env ${WMAKEENV} ${BUILDENV_SHELL} || true From owner-svn-src-all@FreeBSD.ORG Tue Dec 2 20:23:11 2014 Return-Path: Delivered-To: svn-src-all@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 0F3183C6; Tue, 2 Dec 2014 20:23: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 EEDF7DBC; Tue, 2 Dec 2014 20:23: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 sB2KNAee023726; Tue, 2 Dec 2014 20:23:10 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2KNAps023725; Tue, 2 Dec 2014 20:23:10 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201412022023.sB2KNAps023725@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 2 Dec 2014 20:23:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275425 - stable/9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 20:23:11 -0000 Author: brooks Date: Tue Dec 2 20:23:10 2014 New Revision: 275425 URL: https://svnweb.freebsd.org/changeset/base/275425 Log: MFC r274806: Add a guard against attempting to invoke the buildenv target with -j# as that silently exits rather than doing something useful. Sponsored by: DARPA, AFRL Modified: stable/9/Makefile.inc1 (contents, props changed) Directory Properties: stable/9/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Tue Dec 2 19:58:26 2014 (r275424) +++ stable/9/Makefile.inc1 Tue Dec 2 20:23:10 2014 (r275425) @@ -621,6 +621,11 @@ buildworld_epilogue: buildenvvars: @echo ${WMAKEENV:Q} +.if ${.TARGETS:Mbuildenv} +.if ${.MAKEFLAGS:M-j} +.error The buildenv target is incompatible with -j +.endif +.endif buildenv: @echo Entering world for ${TARGET_ARCH}:${TARGET} @cd ${.CURDIR} && env ${WMAKEENV} ${BUILDENV_SHELL} || true From owner-svn-src-all@FreeBSD.ORG Tue Dec 2 20:28:07 2014 Return-Path: Delivered-To: svn-src-all@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 1CF3D572; Tue, 2 Dec 2014 20:28:07 +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 E43D5DE9; Tue, 2 Dec 2014 20:28: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 sB2KS6jf024694; Tue, 2 Dec 2014 20:28:06 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2KS6Sf024692; Tue, 2 Dec 2014 20:28:06 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201412022028.sB2KS6Sf024692@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 2 Dec 2014 20:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275426 - stable/10/sys/boot/fdt/dts/mips X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 20:28:07 -0000 Author: brooks Date: Tue Dec 2 20:28:05 2014 New Revision: 275426 URL: https://svnweb.freebsd.org/changeset/base/275426 Log: MFC r274818: Merge from CheriBSD (3422ebe71b6c06fe78b1be73623b240c219e08e3): Rename beripic to beripic0. Sponsored by: DARPA, AFRL Modified: stable/10/sys/boot/fdt/dts/mips/beri-sim.dts stable/10/sys/boot/fdt/dts/mips/beripad-de4.dts Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/boot/fdt/dts/mips/beri-sim.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/mips/beri-sim.dts Tue Dec 2 20:23:10 2014 (r275425) +++ stable/10/sys/boot/fdt/dts/mips/beri-sim.dts Tue Dec 2 20:28:05 2014 (r275426) @@ -97,7 +97,7 @@ reg = <0x0 0x4000000>; // 64M at 0x0 }; - beripic: beripic@7f804000 { + beripic0: beripic@7f804000 { compatible = "sri-cambridge,beri-pic"; interrupt-controller; #address-cells = <0>; @@ -115,7 +115,7 @@ compatible = "altera,jtag_uart-11_0"; reg = <0x7f000000 0x40>; interrupts = <0>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; serial@7f001000 { Modified: stable/10/sys/boot/fdt/dts/mips/beripad-de4.dts ============================================================================== --- stable/10/sys/boot/fdt/dts/mips/beripad-de4.dts Tue Dec 2 20:23:10 2014 (r275425) +++ stable/10/sys/boot/fdt/dts/mips/beripad-de4.dts Tue Dec 2 20:28:05 2014 (r275426) @@ -97,7 +97,7 @@ reg = <0x0 0x40000000>; // 1G at 0x0 }; - beripic: beripic@7f804000 { + beripic0: beripic@7f804000 { compatible = "sri-cambridge,beri-pic"; interrupt-controller; #address-cells = <0>; @@ -117,14 +117,14 @@ reg-shift = <2>; clock-frequency = <50000000>; interrupts = <6>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; serial@7f000000 { compatible = "altera,jtag_uart-11_0"; reg = <0x7f000000 0x40>; interrupts = <0>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; serial@7f001000 { @@ -198,7 +198,7 @@ 0x7f007420 0x20>; // RX, TX interrupts = <1 2>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; ethernet@7f005000 { @@ -211,7 +211,7 @@ 0x7f005420 0x20>; // RX, TX interrupts = <11 12>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; touchscreen@70400000 { @@ -227,7 +227,7 @@ 0x7f140000 0x4>; // IRQ 4 is DC, IRQ 5 is HC. interrupts = <4 5>; - interrupt-parent = <&beripic>; + interrupt-parent = <&beripic0>; }; avgen@0x7f009000 { From owner-svn-src-all@FreeBSD.ORG Tue Dec 2 20:29:33 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 21:23:14 2014 Return-Path: Delivered-To: svn-src-all@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 518DA15A; Tue, 2 Dec 2014 21: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 3DC715F3; Tue, 2 Dec 2014 21:23: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 sB2LNE0Y052237; Tue, 2 Dec 2014 21:23:14 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2LNEq7052236; Tue, 2 Dec 2014 21:23:14 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201412022123.sB2LNEq7052236@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 2 Dec 2014 21:23:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275428 - stable/10/sys/dev/altera/avgen X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 21:23:14 -0000 Author: brooks Date: Tue Dec 2 21:23:13 2014 New Revision: 275428 URL: https://svnweb.freebsd.org/changeset/base/275428 Log: MFC r274820: Merge from CheriBSD (2e28d2a3090239b30481f35dc452ad95a5c57389): Remove initalized, but unused devname variable Sponsored by: DARPA, AFRL Modified: stable/10/sys/dev/altera/avgen/altera_avgen.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/altera/avgen/altera_avgen.c ============================================================================== --- stable/10/sys/dev/altera/avgen/altera_avgen.c Tue Dec 2 20:29:29 2014 (r275427) +++ stable/10/sys/dev/altera/avgen/altera_avgen.c Tue Dec 2 21:23:13 2014 (r275428) @@ -321,7 +321,6 @@ altera_avgen_attach(struct altera_avgen_ const char *str_mmapio, const char *str_devname, int devunit) { device_t dev = sc->avg_dev; - char devname[SPECNAMELEN + 1]; int error; error = altera_avgen_process_options(sc, str_fileio, str_mmapio, @@ -329,18 +328,6 @@ altera_avgen_attach(struct altera_avgen_ if (error) return (error); - /* Select a device name. */ - if (str_devname != NULL) { - if (devunit != -1) - (void)snprintf(devname, sizeof(devname), "%s%d", - str_devname, devunit); - else - (void)snprintf(devname, sizeof(devname), "%s", - str_devname); - } else - snprintf(devname, sizeof(devname), "%s%d", "avgen", - sc->avg_unit); - if (rman_get_size(sc->avg_res) >= PAGE_SIZE || str_mmapio != NULL) { if (rman_get_size(sc->avg_res) % PAGE_SIZE != 0) { device_printf(dev, From owner-svn-src-all@FreeBSD.ORG Tue Dec 2 22:04:28 2014 Return-Path: Delivered-To: svn-src-all@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 5A999CA1; Tue, 2 Dec 2014 22:04:28 +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 4762EAA2; Tue, 2 Dec 2014 22:04:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB2M4SSx071866; Tue, 2 Dec 2014 22:04:28 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB2M4RFZ071864; Tue, 2 Dec 2014 22:04:27 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201412022204.sB2M4RFZ071864@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 2 Dec 2014 22:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275429 - stable/10/sys/dev/altera/jtag_uart X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Dec 2014 22:04:28 -0000 Author: brooks Date: Tue Dec 2 22:04:27 2014 New Revision: 275429 URL: https://svnweb.freebsd.org/changeset/base/275429 Log: MFC r274821: Merge from CheriBSD: commit d0c7d235c09fc65dbdb278e7016a96f79c6a49cc Make the Altera JTAG UART device driver slightly more forgiving of the foibles of a sub-par hrdware interface by increasing the timeout for spotting JTAG polling from one to two seconds. commit 19ed45a18832560dab967c179d83b71081c3a220 Update comment. commit 8edfe803f033cc8e33229f99894c2b7496a44d5f Add a comment about a device-driver race condition that could cause the BERI pipeline to wedge awaiting JTAG in the event that both the low-level console and the tty layer decide to write to the JTAG FIFO just before JTAG is disconnected. Resolving this race is a bit tricky as it looks like there isn't a way to 'give the character back' to the tty layer when we discover the race. The easy fix is to drop the character, which we don't yet do, but perhaps should as that is a better outcome than wedging the pipeline. commit 2ea26cf579c9defcf31e413e7c9b0fbc159237fc Add a comment about an inherent race with hardware in the Altera JTAG UART's low-level console code. Submitted by: rwatson Sponsored by: DARPA, AFRL Modified: stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c ============================================================================== --- stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c Tue Dec 2 21:23:13 2014 (r275428) +++ stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_cons.c Tue Dec 2 22:04:27 2014 (r275429) @@ -221,6 +221,9 @@ aju_cons_write(char ch) * disconnection. * * XXXRW: The polling delay may require tuning. + * + * XXXRW: Notice the inherent race with hardware: in clearing the + * bit, we may race with hardware setting the same bit. */ v = aju_cons_control_read(); if (v & ALTERA_JTAG_UART_CONTROL_AC) { Modified: stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c ============================================================================== --- stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c Tue Dec 2 21:23:13 2014 (r275428) +++ stable/10/sys/dev/altera/jtag_uart/altera_jtag_uart_tty.c Tue Dec 2 22:04:27 2014 (r275429) @@ -65,9 +65,9 @@ static struct ttydevsw aju_ttydevsw = { /* * When polling for the AC bit, the number of times we have to not see it - * before assuming JTAG has disappeared on us. By default, one second. + * before assuming JTAG has disappeared on us. By default, two seconds. */ -#define AJU_JTAG_MAXMISS 5 +#define AJU_JTAG_MAXMISS 10 /* * Polling intervals for input/output and JTAG connection events. @@ -255,6 +255,22 @@ aju_handle_output(struct altera_jtag_uar if (ttydisc_getc(tp, &ch, sizeof(ch)) != sizeof(ch)) panic("%s: ttydisc_getc", __func__); AJU_LOCK(sc); + + /* + * XXXRW: There is a slight race here in which we test + * for writability, drop the lock, get the character + * from the tty layer, re-acquire the lock, and then + * write. It's possible for other code -- + * specifically, the low-level console -- to have + * written in the mean time, which might mean that + * there is no longer space. The BERI memory bus will + * cause this write to block, wedging the processor + * until space is available -- which could be a while + * if JTAG is not attached! + * + * The 'easy' fix is to drop the character if WSPACE + * has become unset. Not sure what the 'hard' fix is. + */ aju_data_write(sc, ch); } else { /* From owner-svn-src-all@FreeBSD.ORG Tue Dec 2 22:35:44 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 22:52:38 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 23:02:58 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 23:25:00 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Tue Dec 2 23:33:40 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 00:10:04 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 00:47:06 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 01:34:25 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 03:05:16 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 03:17:07 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 03:50:56 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 04:08:44 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 06:53:52 2014 Return-Path: Delivered-To: svn-src-all@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 E4596C9C; Wed, 3 Dec 2014 06:53: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 CE6FD61E; Wed, 3 Dec 2014 06:53: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 sB36rqTU016263; Wed, 3 Dec 2014 06:53:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB36rnIe016248; Wed, 3 Dec 2014 06:53:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412030653.sB36rnIe016248@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 06:53:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275439 - in stable/10/sys/dev: ahci ata ata/chipsets ichsmb ichwd sound/pci/hda uart usb/controller X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 06:53:53 -0000 Author: mav Date: Wed Dec 3 06:53:49 2014 New Revision: 275439 URL: https://svnweb.freebsd.org/changeset/base/275439 Log: MFC r275101: Add bunch of PCI IDs of Intel Wildcat Point (9 Series) chipsets. Modified: stable/10/sys/dev/ahci/ahci.c stable/10/sys/dev/ata/ata-pci.h stable/10/sys/dev/ata/chipsets/ata-intel.c stable/10/sys/dev/ichsmb/ichsmb_pci.c stable/10/sys/dev/ichwd/ichwd.c stable/10/sys/dev/ichwd/ichwd.h stable/10/sys/dev/sound/pci/hda/hdac.c stable/10/sys/dev/sound/pci/hda/hdac.h stable/10/sys/dev/uart/uart_bus_pci.c stable/10/sys/dev/usb/controller/ehci_pci.c stable/10/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ahci/ahci.c ============================================================================== --- stable/10/sys/dev/ahci/ahci.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/ahci/ahci.c Wed Dec 3 06:53:49 2014 (r275439) @@ -226,6 +226,14 @@ static struct { {0x8c078086, 0x00, "Intel Lynx Point (RAID)", 0}, {0x8c0e8086, 0x00, "Intel Lynx Point (RAID)", 0}, {0x8c0f8086, 0x00, "Intel Lynx Point (RAID)", 0}, + {0x8c828086, 0x00, "Intel Wildcat Point", 0}, + {0x8c838086, 0x00, "Intel Wildcat Point", 0}, + {0x8c848086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c858086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c868086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c878086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c8e8086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c8f8086, 0x00, "Intel Wildcat Point (RAID)", 0}, {0x8d028086, 0x00, "Intel Wellsburg", 0}, {0x8d048086, 0x00, "Intel Wellsburg (RAID)", 0}, {0x8d068086, 0x00, "Intel Wellsburg (RAID)", 0}, Modified: stable/10/sys/dev/ata/ata-pci.h ============================================================================== --- stable/10/sys/dev/ata/ata-pci.h Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/ata/ata-pci.h Wed Dec 3 06:53:49 2014 (r275439) @@ -275,6 +275,19 @@ struct ata_pci_controller { #define ATA_LPT_R5 0x8c0e8086 #define ATA_LPT_R6 0x8c0f8086 +#define ATA_WCPT_S1 0x8c808086 +#define ATA_WCPT_S2 0x8c818086 +#define ATA_WCPT_AH1 0x8c828086 +#define ATA_WCPT_AH2 0x8c838086 +#define ATA_WCPT_R1 0x8c848086 +#define ATA_WCPT_R2 0x8c858086 +#define ATA_WCPT_R3 0x8c868086 +#define ATA_WCPT_R4 0x8c878086 +#define ATA_WCPT_S3 0x8c888086 +#define ATA_WCPT_S4 0x8c898086 +#define ATA_WCPT_R5 0x8c8e8086 +#define ATA_WCPT_R6 0x8c8f8086 + #define ATA_WELLS_S1 0x8d008086 #define ATA_WELLS_S2 0x8d088086 #define ATA_WELLS_S3 0x8d608086 Modified: stable/10/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/10/sys/dev/ata/chipsets/ata-intel.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/ata/chipsets/ata-intel.c Wed Dec 3 06:53:49 2014 (r275439) @@ -227,6 +227,18 @@ ata_intel_probe(device_t dev) { ATA_LPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point" }, { ATA_LPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, { ATA_LPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_WCPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_AH2, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R3, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R4, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, { ATA_WELLS_S1, 0, INTEL_6CH, 0, ATA_SA300, "Wellsburg" }, { ATA_WELLS_S2, 0, INTEL_6CH2, 0, ATA_SA300, "Wellsburg" }, { ATA_WELLS_S3, 0, INTEL_6CH, 0, ATA_SA300, "Wellsburg" }, Modified: stable/10/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/10/sys/dev/ichsmb/ichsmb_pci.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/ichsmb/ichsmb_pci.c Wed Dec 3 06:53:49 2014 (r275439) @@ -88,6 +88,7 @@ __FBSDID("$FreeBSD$"); #define ID_AVOTON 0x1f3c8086 #define ID_COLETOCRK 0x23B08086 #define ID_LPT 0x8c228086 +#define ID_WCPT 0x8ca28086 #define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 @@ -197,6 +198,9 @@ ichsmb_pci_probe(device_t dev) case ID_LPT: device_set_desc(dev, "Intel Lynx Point SMBus controller"); break; + case ID_WCPT: + device_set_desc(dev, "Intel Wildcat Point SMBus controller"); + break; case ID_COLETOCRK: device_set_desc(dev, "Intel Coleto Creek SMBus controller"); break; Modified: stable/10/sys/dev/ichwd/ichwd.c ============================================================================== --- stable/10/sys/dev/ichwd/ichwd.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/ichwd/ichwd.c Wed Dec 3 06:53:49 2014 (r275439) @@ -194,6 +194,9 @@ static struct ichwd_device ichwd_devices { DEVICEID_LPT0, "Intel Lynx Point watchdog timer", 10 }, { DEVICEID_LPT1, "Intel Lynx Point watchdog timer", 10 }, { DEVICEID_LPT2, "Intel Lynx Point watchdog timer", 10 }, + { DEVICEID_WCPT2, "Intel Wildcat Point watchdog timer", 10 }, + { DEVICEID_WCPT4, "Intel Wildcat Point watchdog timer", 10 }, + { DEVICEID_WCPT6, "Intel Wildcat Point watchdog timer", 10 }, { DEVICEID_DH89XXCC_LPC, "Intel DH89xxCC watchdog timer", 10 }, { DEVICEID_COLETOCRK_LPC, "Intel Coleto Creek watchdog timer", 10 }, { 0, NULL, 0 }, Modified: stable/10/sys/dev/ichwd/ichwd.h ============================================================================== --- stable/10/sys/dev/ichwd/ichwd.h Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/ichwd/ichwd.h Wed Dec 3 06:53:49 2014 (r275439) @@ -210,6 +210,9 @@ struct ichwd_softc { #define DEVICEID_LPT29 0x8c5d #define DEVICEID_LPT30 0x8c5e #define DEVICEID_LPT31 0x8c5f +#define DEVICEID_WCPT2 0x8cc2 +#define DEVICEID_WCPT4 0x8cc4 +#define DEVICEID_WCPT6 0x8cc6 /* ICH LPC Interface Bridge Registers (ICH5 and older) */ #define ICH_GEN_STA 0xd4 Modified: stable/10/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/sound/pci/hda/hdac.c Wed Dec 3 06:53:49 2014 (r275439) @@ -86,6 +86,7 @@ static const struct { { HDA_INTEL_PPT1, "Intel Panther Point", 0, 0 }, { HDA_INTEL_LPT1, "Intel Lynx Point", 0, 0 }, { HDA_INTEL_LPT2, "Intel Lynx Point", 0, 0 }, + { HDA_INTEL_WCPT, "Intel Wildcat Point", 0, 0 }, { HDA_INTEL_WELLS1, "Intel Wellsburg", 0, 0 }, { HDA_INTEL_WELLS2, "Intel Wellsburg", 0, 0 }, { HDA_INTEL_LPTLP1, "Intel Lynx Point-LP", 0, 0 }, Modified: stable/10/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/10/sys/dev/sound/pci/hda/hdac.h Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/sound/pci/hda/hdac.h Wed Dec 3 06:53:49 2014 (r275439) @@ -62,6 +62,7 @@ #define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b) #define HDA_INTEL_LPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x8c20) #define HDA_INTEL_LPT2 HDA_MODEL_CONSTRUCT(INTEL, 0x8c21) +#define HDA_INTEL_WCPT HDA_MODEL_CONSTRUCT(INTEL, 0x8ca0) #define HDA_INTEL_WELLS1 HDA_MODEL_CONSTRUCT(INTEL, 0x8d20) #define HDA_INTEL_WELLS2 HDA_MODEL_CONSTRUCT(INTEL, 0x8d21) #define HDA_INTEL_LPTLP1 HDA_MODEL_CONSTRUCT(INTEL, 0x9c20) Modified: stable/10/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/10/sys/dev/uart/uart_bus_pci.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/uart/uart_bus_pci.c Wed Dec 3 06:53:49 2014 (r275439) @@ -126,6 +126,7 @@ static const struct pci_id pci_ns8250_id { 0x8086, 0x8813, 0xffff, 0, "Intel EG20T Serial Port 2", 0x10 }, { 0x8086, 0x8814, 0xffff, 0, "Intel EG20T Serial Port 3", 0x10 }, { 0x8086, 0x8c3d, 0xffff, 0, "Intel Lynx Point KT Controller", 0x10 }, +{ 0x8086, 0x8cbd, 0xffff, 0, "Intel Wildcat Point KT Controller", 0x10 }, { 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, Modified: stable/10/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/ehci_pci.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/usb/controller/ehci_pci.c Wed Dec 3 06:53:49 2014 (r275439) @@ -158,6 +158,10 @@ ehci_pci_match(device_t self) return ("Intel Lynx Point USB 2.0 controller USB-A"); case 0x8c2d8086: return ("Intel Lynx Point USB 2.0 controller USB-B"); + case 0x8ca68086: + return ("Intel Wildcat Point USB 2.0 controller USB-A"); + case 0x8cad8086: + return ("Intel Wildcat Point USB 2.0 controller USB-B"); case 0x00e01033: return ("NEC uPD 720100 USB 2.0 controller"); Modified: stable/10/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/10/sys/dev/usb/controller/xhci_pci.c Wed Dec 3 04:08:41 2014 (r275438) +++ stable/10/sys/dev/usb/controller/xhci_pci.c Wed Dec 3 06:53:49 2014 (r275439) @@ -107,6 +107,8 @@ xhci_pci_match(device_t self) return ("Intel Panther Point USB 3.0 controller"); case 0x8c318086: return ("Intel Lynx Point USB 3.0 controller"); + case 0x8cb18086: + return ("Intel Wildcat Point USB 3.0 controller"); default: break; From owner-svn-src-all@FreeBSD.ORG Wed Dec 3 06:59:01 2014 Return-Path: Delivered-To: svn-src-all@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 E80B1EAF; Wed, 3 Dec 2014 06:59: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 D42C5658; Wed, 3 Dec 2014 06:59: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 sB36x1rp017045; Wed, 3 Dec 2014 06:59:01 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB36x1T0017032; Wed, 3 Dec 2014 06:59:01 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412030659.sB36x1T0017032@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 06:59:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275440 - stable/9/sys/dev/sound/pci/hda X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 06:59:02 -0000 Author: mav Date: Wed Dec 3 06:59:00 2014 New Revision: 275440 URL: https://svnweb.freebsd.org/changeset/base/275440 Log: MFC r258168: Add ID for Intel Lynx Point HDMI CODEC. Modified: stable/9/sys/dev/sound/pci/hda/hdac.h stable/9/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdac.h Wed Dec 3 06:53:49 2014 (r275439) +++ stable/9/sys/dev/sound/pci/hda/hdac.h Wed Dec 3 06:59:00 2014 (r275440) @@ -610,6 +610,7 @@ #define HDA_CODEC_INTELIP2 HDA_CODEC_CONSTRUCT(INTEL, 0x2804) #define HDA_CODEC_INTELCPT HDA_CODEC_CONSTRUCT(INTEL, 0x2805) #define HDA_CODEC_INTELPPT HDA_CODEC_CONSTRUCT(INTEL, 0x2806) +#define HDA_CODEC_INTELLP HDA_CODEC_CONSTRUCT(INTEL, 0x2807) #define HDA_CODEC_INTELCL HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) #define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff) Modified: stable/9/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdacc.c Wed Dec 3 06:53:49 2014 (r275439) +++ stable/9/sys/dev/sound/pci/hda/hdacc.c Wed Dec 3 06:59:00 2014 (r275440) @@ -318,6 +318,7 @@ static const struct { { HDA_CODEC_INTELIP2, 0, "Intel Ibex Peak" }, { HDA_CODEC_INTELCPT, 0, "Intel Cougar Point" }, { HDA_CODEC_INTELPPT, 0, "Intel Panther Point" }, + { HDA_CODEC_INTELLP, 0, "Intel Lynx Point" }, { HDA_CODEC_INTELCL, 0, "Intel Crestline" }, { HDA_CODEC_SII1390, 0, "Silicon Image SiI1390" }, { HDA_CODEC_SII1392, 0, "Silicon Image SiI1392" }, From owner-svn-src-all@FreeBSD.ORG Wed Dec 3 07:00:26 2014 Return-Path: Delivered-To: svn-src-all@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 A64F6FF7; Wed, 3 Dec 2014 07:00: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 924C2669; Wed, 3 Dec 2014 07:00: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 sB370QX3019607; Wed, 3 Dec 2014 07:00:26 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB370PCL019604; Wed, 3 Dec 2014 07:00:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412030700.sB370PCL019604@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 07:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275441 - stable/9/sys/dev/sound/pci/hda X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 07:00:26 -0000 Author: mav Date: Wed Dec 3 07:00:25 2014 New Revision: 275441 URL: https://svnweb.freebsd.org/changeset/base/275441 Log: MFC r258170: Add some more Intel HDA controller IDs and rename HDMI CODEC to Haswell. Modified: stable/9/sys/dev/sound/pci/hda/hdac.c stable/9/sys/dev/sound/pci/hda/hdac.h stable/9/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdac.c Wed Dec 3 06:59:00 2014 (r275440) +++ stable/9/sys/dev/sound/pci/hda/hdac.c Wed Dec 3 07:00:25 2014 (r275441) @@ -76,11 +76,20 @@ static const struct { char quirks_on; char quirks_off; } hdac_devices[] = { + { HDA_INTEL_OAK, "Intel Oaktrail", 0, 0 }, + { HDA_INTEL_BAY, "Intel BayTrail", 0, 0 }, + { HDA_INTEL_HSW1, "Intel Haswell", 0, 0 }, + { HDA_INTEL_HSW2, "Intel Haswell", 0, 0 }, + { HDA_INTEL_HSW3, "Intel Haswell", 0, 0 }, { HDA_INTEL_CPT, "Intel Cougar Point", 0, 0 }, { HDA_INTEL_PATSBURG,"Intel Patsburg", 0, 0 }, { HDA_INTEL_PPT1, "Intel Panther Point", 0, 0 }, { HDA_INTEL_LPT1, "Intel Lynx Point", 0, 0 }, { HDA_INTEL_LPT2, "Intel Lynx Point", 0, 0 }, + { HDA_INTEL_WELLS1, "Intel Wellsburg", 0, 0 }, + { HDA_INTEL_WELLS2, "Intel Wellsburg", 0, 0 }, + { HDA_INTEL_LPTLP1, "Intel Lynx Point-LP", 0, 0 }, + { HDA_INTEL_LPTLP2, "Intel Lynx Point-LP", 0, 0 }, { HDA_INTEL_82801F, "Intel 82801F", 0, 0 }, { HDA_INTEL_63XXESB, "Intel 631x/632xESB", 0, 0 }, { HDA_INTEL_82801G, "Intel 82801G", 0, 0 }, Modified: stable/9/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdac.h Wed Dec 3 06:59:00 2014 (r275440) +++ stable/9/sys/dev/sound/pci/hda/hdac.h Wed Dec 3 07:00:25 2014 (r275441) @@ -41,6 +41,11 @@ /* Intel */ #define INTEL_VENDORID 0x8086 +#define HDA_INTEL_OAK HDA_MODEL_CONSTRUCT(INTEL, 0x080a) +#define HDA_INTEL_BAY HDA_MODEL_CONSTRUCT(INTEL, 0x0f04) +#define HDA_INTEL_HSW1 HDA_MODEL_CONSTRUCT(INTEL, 0x0a0c) +#define HDA_INTEL_HSW2 HDA_MODEL_CONSTRUCT(INTEL, 0x0c0c) +#define HDA_INTEL_HSW3 HDA_MODEL_CONSTRUCT(INTEL, 0x0d0c) #define HDA_INTEL_CPT HDA_MODEL_CONSTRUCT(INTEL, 0x1c20) #define HDA_INTEL_PATSBURG HDA_MODEL_CONSTRUCT(INTEL, 0x1d20) #define HDA_INTEL_PPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x1e20) @@ -57,6 +62,10 @@ #define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b) #define HDA_INTEL_LPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x8c20) #define HDA_INTEL_LPT2 HDA_MODEL_CONSTRUCT(INTEL, 0x8c21) +#define HDA_INTEL_WELLS1 HDA_MODEL_CONSTRUCT(INTEL, 0x8d20) +#define HDA_INTEL_WELLS2 HDA_MODEL_CONSTRUCT(INTEL, 0x8d21) +#define HDA_INTEL_LPTLP1 HDA_MODEL_CONSTRUCT(INTEL, 0x9c20) +#define HDA_INTEL_LPTLP2 HDA_MODEL_CONSTRUCT(INTEL, 0x9c21) #define HDA_INTEL_ALL HDA_MODEL_CONSTRUCT(INTEL, 0xffff) /* Nvidia */ @@ -610,7 +619,7 @@ #define HDA_CODEC_INTELIP2 HDA_CODEC_CONSTRUCT(INTEL, 0x2804) #define HDA_CODEC_INTELCPT HDA_CODEC_CONSTRUCT(INTEL, 0x2805) #define HDA_CODEC_INTELPPT HDA_CODEC_CONSTRUCT(INTEL, 0x2806) -#define HDA_CODEC_INTELLP HDA_CODEC_CONSTRUCT(INTEL, 0x2807) +#define HDA_CODEC_INTELHSW HDA_CODEC_CONSTRUCT(INTEL, 0x2807) #define HDA_CODEC_INTELCL HDA_CODEC_CONSTRUCT(INTEL, 0x29fb) #define HDA_CODEC_INTELXXXX HDA_CODEC_CONSTRUCT(INTEL, 0xffff) Modified: stable/9/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdacc.c Wed Dec 3 06:59:00 2014 (r275440) +++ stable/9/sys/dev/sound/pci/hda/hdacc.c Wed Dec 3 07:00:25 2014 (r275441) @@ -318,7 +318,7 @@ static const struct { { HDA_CODEC_INTELIP2, 0, "Intel Ibex Peak" }, { HDA_CODEC_INTELCPT, 0, "Intel Cougar Point" }, { HDA_CODEC_INTELPPT, 0, "Intel Panther Point" }, - { HDA_CODEC_INTELLP, 0, "Intel Lynx Point" }, + { HDA_CODEC_INTELHSW, 0, "Intel Haswell" }, { HDA_CODEC_INTELCL, 0, "Intel Crestline" }, { HDA_CODEC_SII1390, 0, "Silicon Image SiI1390" }, { HDA_CODEC_SII1392, 0, "Silicon Image SiI1392" }, From owner-svn-src-all@FreeBSD.ORG Wed Dec 3 07:02:52 2014 Return-Path: Delivered-To: svn-src-all@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 AE4D21C7; Wed, 3 Dec 2014 07:02: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 9912E75F; Wed, 3 Dec 2014 07:02: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 sB372qWe020957; Wed, 3 Dec 2014 07:02:52 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB372nYj020943; Wed, 3 Dec 2014 07:02:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412030702.sB372nYj020943@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 07:02:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275442 - in stable/9/sys/dev: ahci ata ata/chipsets ichsmb ichwd sound/pci/hda uart usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 07:02:52 -0000 Author: mav Date: Wed Dec 3 07:02:48 2014 New Revision: 275442 URL: https://svnweb.freebsd.org/changeset/base/275442 Log: MFC r275101: Add bunch of PCI IDs of Intel Wildcat Point (9 Series) chipsets. Modified: stable/9/sys/dev/ahci/ahci.c stable/9/sys/dev/ata/ata-pci.h stable/9/sys/dev/ata/chipsets/ata-intel.c stable/9/sys/dev/ichsmb/ichsmb_pci.c stable/9/sys/dev/ichwd/ichwd.c stable/9/sys/dev/ichwd/ichwd.h stable/9/sys/dev/sound/pci/hda/hdac.c stable/9/sys/dev/sound/pci/hda/hdac.h stable/9/sys/dev/uart/uart_bus_pci.c stable/9/sys/dev/usb/controller/ehci_pci.c stable/9/sys/dev/usb/controller/xhci_pci.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ahci/ahci.c ============================================================================== --- stable/9/sys/dev/ahci/ahci.c Wed Dec 3 07:00:25 2014 (r275441) +++ stable/9/sys/dev/ahci/ahci.c Wed Dec 3 07:02:48 2014 (r275442) @@ -230,6 +230,14 @@ static struct { {0x8c078086, 0x00, "Intel Lynx Point (RAID)", 0}, {0x8c0e8086, 0x00, "Intel Lynx Point (RAID)", 0}, {0x8c0f8086, 0x00, "Intel Lynx Point (RAID)", 0}, + {0x8c828086, 0x00, "Intel Wildcat Point", 0}, + {0x8c838086, 0x00, "Intel Wildcat Point", 0}, + {0x8c848086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c858086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c868086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c878086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c8e8086, 0x00, "Intel Wildcat Point (RAID)", 0}, + {0x8c8f8086, 0x00, "Intel Wildcat Point (RAID)", 0}, {0x8d028086, 0x00, "Intel Wellsburg", 0}, {0x8d048086, 0x00, "Intel Wellsburg (RAID)", 0}, {0x8d068086, 0x00, "Intel Wellsburg (RAID)", 0}, Modified: stable/9/sys/dev/ata/ata-pci.h ============================================================================== --- stable/9/sys/dev/ata/ata-pci.h Wed Dec 3 07:00:25 2014 (r275441) +++ stable/9/sys/dev/ata/ata-pci.h Wed Dec 3 07:02:48 2014 (r275442) @@ -278,6 +278,19 @@ struct ata_pci_controller { #define ATA_LPT_R5 0x8c0e8086 #define ATA_LPT_R6 0x8c0f8086 +#define ATA_WCPT_S1 0x8c808086 +#define ATA_WCPT_S2 0x8c818086 +#define ATA_WCPT_AH1 0x8c828086 +#define ATA_WCPT_AH2 0x8c838086 +#define ATA_WCPT_R1 0x8c848086 +#define ATA_WCPT_R2 0x8c858086 +#define ATA_WCPT_R3 0x8c868086 +#define ATA_WCPT_R4 0x8c878086 +#define ATA_WCPT_S3 0x8c888086 +#define ATA_WCPT_S4 0x8c898086 +#define ATA_WCPT_R5 0x8c8e8086 +#define ATA_WCPT_R6 0x8c8f8086 + #define ATA_WELLS_S1 0x8d008086 #define ATA_WELLS_S2 0x8d088086 #define ATA_WELLS_S3 0x8d608086 Modified: stable/9/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- stable/9/sys/dev/ata/chipsets/ata-intel.c Wed Dec 3 07:00:25 2014 (r275441) +++ stable/9/sys/dev/ata/chipsets/ata-intel.c Wed Dec 3 07:02:48 2014 (r275442) @@ -228,6 +228,18 @@ ata_intel_probe(device_t dev) { ATA_LPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Lynx Point" }, { ATA_LPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, { ATA_LPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Lynx Point" }, + { ATA_WCPT_S1, 0, INTEL_6CH, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_S2, 0, INTEL_6CH, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_AH1, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_AH2, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R1, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R2, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R3, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R4, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_S3, 0, INTEL_6CH2, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_S4, 0, INTEL_6CH2, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R5, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, + { ATA_WCPT_R6, 0, INTEL_AHCI, 0, ATA_SA300, "Wildcat Point" }, { ATA_WELLS_S1, 0, INTEL_6CH, 0, ATA_SA300, "Wellsburg" }, { ATA_WELLS_S2, 0, INTEL_6CH2, 0, ATA_SA300, "Wellsburg" }, { ATA_WELLS_S3, 0, INTEL_6CH, 0, ATA_SA300, "Wellsburg" }, Modified: stable/9/sys/dev/ichsmb/ichsmb_pci.c ============================================================================== --- stable/9/sys/dev/ichsmb/ichsmb_pci.c Wed Dec 3 07:00:25 2014 (r275441) +++ stable/9/sys/dev/ichsmb/ichsmb_pci.c Wed Dec 3 07:02:48 2014 (r275442) @@ -87,6 +87,7 @@ __FBSDID("$FreeBSD$"); #define ID_PPT 0x1e228086 #define ID_COLETOCRK 0x23B08086 #define ID_LPT 0x8c228086 +#define ID_WCPT 0x8ca28086 #define PCIS_SERIALBUS_SMBUS_PROGIF 0x00 @@ -193,6 +194,9 @@ ichsmb_pci_probe(device_t dev) case ID_LPT: device_set_desc(dev, "Intel Lynx Point SMBus controller"); break; + case ID_WCPT: + device_set_desc(dev, "Intel Wildcat Point SMBus controller"); + break; case ID_COLETOCRK: device_set_desc(dev, "Intel Coleto Creek SMBus controller"); break; Modified: stable/9/sys/dev/ichwd/ichwd.c ============================================================================== --- stable/9/sys/dev/ichwd/ichwd.c Wed Dec 3 07:00:25 2014 (r275441) +++ stable/9/sys/dev/ichwd/ichwd.c Wed Dec 3 07:02:48 2014 (r275442) @@ -191,6 +191,9 @@ static struct ichwd_device ichwd_devices { DEVICEID_PPT29, "Intel Panther Point watchdog timer", 10 }, { DEVICEID_PPT30, "Intel Panther Point watchdog timer", 10 }, { DEVICEID_PPT31, "Intel Panther Point watchdog timer", 10 }, + { DEVICEID_WCPT2, "Intel Wildcat Point watchdog timer", 10 }, + { DEVICEID_WCPT4, "Intel Wildcat Point watchdog timer", 10 }, + { DEVICEID_WCPT6, "Intel Wildcat Point watchdog timer", 10 }, { DEVICEID_DH89XXCC_LPC, "Intel DH89xxCC watchdog timer", 10 }, { DEVICEID_COLETOCRK_LPC, "Intel Coleto Creek watchdog timer", 10 }, { 0, NULL, 0 }, Modified: stable/9/sys/dev/ichwd/ichwd.h ============================================================================== --- stable/9/sys/dev/ichwd/ichwd.h Wed Dec 3 07:00:25 2014 (r275441) +++ stable/9/sys/dev/ichwd/ichwd.h Wed Dec 3 07:02:48 2014 (r275442) @@ -178,6 +178,9 @@ struct ichwd_softc { #define DEVICEID_3400 0x3b12 #define DEVICEID_3420 0x3b14 #define DEVICEID_3450 0x3b16 +#define DEVICEID_WCPT2 0x8cc2 +#define DEVICEID_WCPT4 0x8cc4 +#define DEVICEID_WCPT6 0x8cc6 /* ICH LPC Interface Bridge Registers (ICH5 and older) */ #define ICH_GEN_STA 0xd4 Modified: stable/9/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdac.c Wed Dec 3 07:00:25 2014 (r275441) +++ stable/9/sys/dev/sound/pci/hda/hdac.c Wed Dec 3 07:02:48 2014 (r275442) @@ -86,6 +86,7 @@ static const struct { { HDA_INTEL_PPT1, "Intel Panther Point", 0, 0 }, { HDA_INTEL_LPT1, "Intel Lynx Point", 0, 0 }, { HDA_INTEL_LPT2, "Intel Lynx Point", 0, 0 }, + { HDA_INTEL_WCPT, "Intel Wildcat Point", 0, 0 }, { HDA_INTEL_WELLS1, "Intel Wellsburg", 0, 0 }, { HDA_INTEL_WELLS2, "Intel Wellsburg", 0, 0 }, { HDA_INTEL_LPTLP1, "Intel Lynx Point-LP", 0, 0 }, Modified: stable/9/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdac.h Wed Dec 3 07:00:25 2014 (r275441) +++ stable/9/sys/dev/sound/pci/hda/hdac.h Wed Dec 3 07:02:48 2014 (r275442) @@ -62,6 +62,7 @@ #define HDA_INTEL_SCH HDA_MODEL_CONSTRUCT(INTEL, 0x811b) #define HDA_INTEL_LPT1 HDA_MODEL_CONSTRUCT(INTEL, 0x8c20) #define HDA_INTEL_LPT2 HDA_MODEL_CONSTRUCT(INTEL, 0x8c21) +#define HDA_INTEL_WCPT HDA_MODEL_CONSTRUCT(INTEL, 0x8ca0) #define HDA_INTEL_WELLS1 HDA_MODEL_CONSTRUCT(INTEL, 0x8d20) #define HDA_INTEL_WELLS2 HDA_MODEL_CONSTRUCT(INTEL, 0x8d21) #define HDA_INTEL_LPTLP1 HDA_MODEL_CONSTRUCT(INTEL, 0x9c20) Modified: stable/9/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/9/sys/dev/uart/uart_bus_pci.c Wed Dec 3 07:00:25 2014 (r275441) +++ stable/9/sys/dev/uart/uart_bus_pci.c Wed Dec 3 07:02:48 2014 (r275442) @@ -126,6 +126,7 @@ static const struct pci_id pci_ns8250_id { 0x8086, 0x8813, 0xffff, 0, "Intel EG20T Serial Port 2", 0x10 }, { 0x8086, 0x8814, 0xffff, 0, "Intel EG20T Serial Port 3", 0x10 }, { 0x8086, 0x8c3d, 0xffff, 0, "Intel Lynx Point KT Controller", 0x10 }, +{ 0x8086, 0x8cbd, 0xffff, 0, "Intel Wildcat Point KT Controller", 0x10 }, { 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, Modified: stable/9/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/ehci_pci.c Wed Dec 3 07:00:25 2014 (r275441) +++ stable/9/sys/dev/usb/controller/ehci_pci.c Wed Dec 3 07:02:48 2014 (r275442) @@ -158,6 +158,10 @@ ehci_pci_match(device_t self) return ("Intel Lynx Point USB 2.0 controller USB-A"); case 0x8c2d8086: return ("Intel Lynx Point USB 2.0 controller USB-B"); + case 0x8ca68086: + return ("Intel Wildcat Point USB 2.0 controller USB-A"); + case 0x8cad8086: + return ("Intel Wildcat Point USB 2.0 controller USB-B"); case 0x00e01033: return ("NEC uPD 720100 USB 2.0 controller"); Modified: stable/9/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci_pci.c Wed Dec 3 07:00:25 2014 (r275441) +++ stable/9/sys/dev/usb/controller/xhci_pci.c Wed Dec 3 07:02:48 2014 (r275442) @@ -107,6 +107,8 @@ xhci_pci_match(device_t self) return ("Intel Panther Point USB 3.0 controller"); case 0x8c318086: return ("Intel Lynx Point USB 3.0 controller"); + case 0x8cb18086: + return ("Intel Wildcat Point USB 3.0 controller"); default: break; From owner-svn-src-all@FreeBSD.ORG Wed Dec 3 07:04:29 2014 Return-Path: Delivered-To: svn-src-all@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 59A99336; Wed, 3 Dec 2014 07:04: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 4667D785; Wed, 3 Dec 2014 07:04: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 sB374T8h021214; Wed, 3 Dec 2014 07:04:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB374TPI021213; Wed, 3 Dec 2014 07:04:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412030704.sB374TPI021213@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 07:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275443 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 07:04:29 -0000 Author: mav Date: Wed Dec 3 07:04:28 2014 New Revision: 275443 URL: https://svnweb.freebsd.org/changeset/base/275443 Log: MFC r275123: Fix incorrect check, blocking MULTIID functionality. Modified: stable/10/sys/dev/isp/isp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp.c ============================================================================== --- stable/10/sys/dev/isp/isp.c Wed Dec 3 07:02:48 2014 (r275442) +++ stable/10/sys/dev/isp/isp.c Wed Dec 3 07:04:28 2014 (r275443) @@ -1219,7 +1219,7 @@ isp_reset(ispsoftc_t *isp, int do_load_d * work for them). */ if (IS_FC(isp) && isp->isp_nchan > 1) { - if (!IS_24XX(isp) || (fwt & ISP2400_FW_ATTR_MULTIID) == 0) { + if (!ISP_CAP_MULTI_ID(isp)) { isp_prt(isp, ISP_LOGWARN, "non-MULTIID f/w loaded, only can enable 1 of %d channels", isp->isp_nchan); isp->isp_nchan = 1; } From owner-svn-src-all@FreeBSD.ORG Wed Dec 3 07:05:18 2014 Return-Path: Delivered-To: svn-src-all@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 12CE846A; Wed, 3 Dec 2014 07:05: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 F365378B; Wed, 3 Dec 2014 07:05: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 sB375HZs021399; Wed, 3 Dec 2014 07:05:17 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB375HHm021398; Wed, 3 Dec 2014 07:05:17 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412030705.sB375HHm021398@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 07:05:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275444 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 07:05:18 -0000 Author: mav Date: Wed Dec 3 07:05:17 2014 New Revision: 275444 URL: https://svnweb.freebsd.org/changeset/base/275444 Log: MFC r275124: Fix WWNN/WWPN generation for virtual channels. Modified: stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Wed Dec 3 07:04:28 2014 (r275443) +++ stable/10/sys/dev/isp/isp_freebsd.c Wed Dec 3 07:05:17 2014 (r275444) @@ -6109,10 +6109,9 @@ isp_default_wwn(ispsoftc_t * isp, int ch return (seed); } return (0x400000007F000009ull); - } else { - seed = iswwnn ? fc->def_wwnn : fc->def_wwpn; } + seed = iswwnn ? fc->def_wwnn : fc->def_wwpn; /* * For channel zero just return what we have. For either ACTIVE or @@ -6135,11 +6134,9 @@ isp_default_wwn(ispsoftc_t * isp, int ch if (seed) { return (seed); } - if (isactive) { + seed = iswwnn ? ISP_FC_PC(isp, 0)->def_wwnn : ISP_FC_PC(isp, 0)->def_wwpn; + if (seed == 0) seed = iswwnn ? FCPARAM(isp, 0)->isp_wwnn_nvram : FCPARAM(isp, 0)->isp_wwpn_nvram; - } else { - seed = iswwnn ? ISP_FC_PC(isp, 0)->def_wwnn : ISP_FC_PC(isp, 0)->def_wwpn; - } if (((seed >> 60) & 0xf) == 2) { /* From owner-svn-src-all@FreeBSD.ORG Wed Dec 3 08:22:13 2014 Return-Path: Delivered-To: svn-src-all@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 E41B429D; Wed, 3 Dec 2014 08:22: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 D06D4F7C; Wed, 3 Dec 2014 08:22: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 sB38MDn3055811; Wed, 3 Dec 2014 08:22:13 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB38MDuG055810; Wed, 3 Dec 2014 08:22:13 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201412030822.sB38MDuG055810@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 3 Dec 2014 08:22:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275445 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 08:22:14 -0000 Author: trasz Date: Wed Dec 3 08:22:13 2014 New Revision: 275445 URL: https://svnweb.freebsd.org/changeset/base/275445 Log: MFC r274703: Fix typo. Sponsored by: The FreeBSD Foundation Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Dec 3 07:05:17 2014 (r275444) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Wed Dec 3 08:22:13 2014 (r275445) @@ -1990,7 +1990,7 @@ cfiscsi_ioctl_port_create(struct ctl_req if (ct->ct_state == CFISCSI_TARGET_STATE_ACTIVE) { req->status = CTL_LUN_ERROR; snprintf(req->error_str, sizeof(req->error_str), - "target \"%s\" already exist", target); + "target \"%s\" already exists", target); cfiscsi_target_release(ct); ctl_free_opts(&opts); return; From owner-svn-src-all@FreeBSD.ORG Wed Dec 3 08:25:42 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 09:05:54 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 09:08:08 2014 Return-Path: Delivered-To: svn-src-all@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 11F69104; Wed, 3 Dec 2014 09:08: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 E7D69628; Wed, 3 Dec 2014 09:08:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB3987Ni074571; Wed, 3 Dec 2014 09:08:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB398572074554; Wed, 3 Dec 2014 09:08:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412030908.sB398572074554@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 09:08:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275448 - in stable/10/contrib/ofed: librdmacm/examples/build/cmatose librdmacm/examples/build/mckey librdmacm/examples/build/rping librdmacm/examples/build/udaddy management/infiniband... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 09:08:08 -0000 Author: hselasky Date: Wed Dec 3 09:08:04 2014 New Revision: 275448 URL: https://svnweb.freebsd.org/changeset/base/275448 Log: MFC r275328 and r275330: Add missing libraries when linking and fix building of some infiniband utilities by updating some header file locations and compiler include directives. Sponsored by: Mellanox Technologies Modified: stable/10/contrib/ofed/librdmacm/examples/build/cmatose/Makefile stable/10/contrib/ofed/librdmacm/examples/build/mckey/Makefile stable/10/contrib/ofed/librdmacm/examples/build/rping/Makefile stable/10/contrib/ofed/librdmacm/examples/build/udaddy/Makefile stable/10/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c stable/10/contrib/ofed/management/infiniband-diags/src/ibroute.c stable/10/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c stable/10/contrib/ofed/management/infiniband-diags/src/ibtracert.c stable/10/contrib/ofed/management/infiniband-diags/src/saquery.c stable/10/contrib/ofed/management/infiniband-diags/src/smpquery.c stable/10/contrib/ofed/usr.bin/Makefile.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/ofed/librdmacm/examples/build/cmatose/Makefile ============================================================================== --- stable/10/contrib/ofed/librdmacm/examples/build/cmatose/Makefile Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/librdmacm/examples/build/cmatose/Makefile Wed Dec 3 09:08:04 2014 (r275448) @@ -6,5 +6,6 @@ PROG= cmatose MAN= SRCS= cmatose.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: stable/10/contrib/ofed/librdmacm/examples/build/mckey/Makefile ============================================================================== --- stable/10/contrib/ofed/librdmacm/examples/build/mckey/Makefile Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/librdmacm/examples/build/mckey/Makefile Wed Dec 3 09:08:04 2014 (r275448) @@ -6,5 +6,6 @@ PROG= mckey MAN= SRCS= mckey.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: stable/10/contrib/ofed/librdmacm/examples/build/rping/Makefile ============================================================================== --- stable/10/contrib/ofed/librdmacm/examples/build/rping/Makefile Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/librdmacm/examples/build/rping/Makefile Wed Dec 3 09:08:04 2014 (r275448) @@ -6,5 +6,6 @@ PROG= rping MAN= SRCS= rping.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: stable/10/contrib/ofed/librdmacm/examples/build/udaddy/Makefile ============================================================================== --- stable/10/contrib/ofed/librdmacm/examples/build/udaddy/Makefile Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/librdmacm/examples/build/udaddy/Makefile Wed Dec 3 09:08:04 2014 (r275448) @@ -6,5 +6,6 @@ PROG= udaddy MAN= SRCS= udaddy.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: stable/10/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c ============================================================================== --- stable/10/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c Wed Dec 3 09:08:04 2014 (r275448) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include "ibnetdiscover.h" #include "grouping.h" Modified: stable/10/contrib/ofed/management/infiniband-diags/src/ibroute.c ============================================================================== --- stable/10/contrib/ofed/management/infiniband-diags/src/ibroute.c Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/management/infiniband-diags/src/ibroute.c Wed Dec 3 09:08:04 2014 (r275448) @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include "ibdiag_common.h" Modified: stable/10/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c ============================================================================== --- stable/10/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c Wed Dec 3 09:08:04 2014 (r275448) @@ -43,7 +43,7 @@ #include #include -#include +#include #include "ibdiag_common.h" Modified: stable/10/contrib/ofed/management/infiniband-diags/src/ibtracert.c ============================================================================== --- stable/10/contrib/ofed/management/infiniband-diags/src/ibtracert.c Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/management/infiniband-diags/src/ibtracert.c Wed Dec 3 09:08:04 2014 (r275448) @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include "ibdiag_common.h" Modified: stable/10/contrib/ofed/management/infiniband-diags/src/saquery.c ============================================================================== --- stable/10/contrib/ofed/management/infiniband-diags/src/saquery.c Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/management/infiniband-diags/src/saquery.c Wed Dec 3 09:08:04 2014 (r275448) @@ -50,12 +50,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include Modified: stable/10/contrib/ofed/management/infiniband-diags/src/smpquery.c ============================================================================== --- stable/10/contrib/ofed/management/infiniband-diags/src/smpquery.c Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/management/infiniband-diags/src/smpquery.c Wed Dec 3 09:08:04 2014 (r275448) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include "ibdiag_common.h" Modified: stable/10/contrib/ofed/usr.bin/Makefile.inc ============================================================================== --- stable/10/contrib/ofed/usr.bin/Makefile.inc Wed Dec 3 09:05:53 2014 (r275447) +++ stable/10/contrib/ofed/usr.bin/Makefile.inc Wed Dec 3 09:08:04 2014 (r275448) @@ -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-all@FreeBSD.ORG Wed Dec 3 09:10:45 2014 Return-Path: Delivered-To: svn-src-all@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 0CA2C2A2; Wed, 3 Dec 2014 09: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 E224E6DC; Wed, 3 Dec 2014 09:10: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 sB39AiP5078155; Wed, 3 Dec 2014 09:10:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB39AgM9078141; Wed, 3 Dec 2014 09:10:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412030910.sB39AgM9078141@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 09:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275449 - in stable/9/contrib/ofed: librdmacm/examples/build/cmatose librdmacm/examples/build/mckey librdmacm/examples/build/rping librdmacm/examples/build/udaddy management/infiniband-... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 09:10:45 -0000 Author: hselasky Date: Wed Dec 3 09:10:41 2014 New Revision: 275449 URL: https://svnweb.freebsd.org/changeset/base/275449 Log: MFC r275328 and r275330: Add missing libraries when linking and fix building of some infiniband utilities by updating some header file locations and compiler include directives. Sponsored by: Mellanox Technologies Modified: stable/9/contrib/ofed/librdmacm/examples/build/cmatose/Makefile stable/9/contrib/ofed/librdmacm/examples/build/mckey/Makefile stable/9/contrib/ofed/librdmacm/examples/build/rping/Makefile stable/9/contrib/ofed/librdmacm/examples/build/udaddy/Makefile stable/9/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c stable/9/contrib/ofed/management/infiniband-diags/src/ibroute.c stable/9/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c stable/9/contrib/ofed/management/infiniband-diags/src/ibtracert.c stable/9/contrib/ofed/management/infiniband-diags/src/saquery.c stable/9/contrib/ofed/management/infiniband-diags/src/smpquery.c stable/9/contrib/ofed/usr.bin/Makefile.inc Directory Properties: stable/9/contrib/ (props changed) Modified: stable/9/contrib/ofed/librdmacm/examples/build/cmatose/Makefile ============================================================================== --- stable/9/contrib/ofed/librdmacm/examples/build/cmatose/Makefile Wed Dec 3 09:08:04 2014 (r275448) +++ stable/9/contrib/ofed/librdmacm/examples/build/cmatose/Makefile Wed Dec 3 09:10:41 2014 (r275449) @@ -6,5 +6,6 @@ PROG= cmatose MAN= SRCS= cmatose.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: stable/9/contrib/ofed/librdmacm/examples/build/mckey/Makefile ============================================================================== --- stable/9/contrib/ofed/librdmacm/examples/build/mckey/Makefile Wed Dec 3 09:08:04 2014 (r275448) +++ stable/9/contrib/ofed/librdmacm/examples/build/mckey/Makefile Wed Dec 3 09:10:41 2014 (r275449) @@ -6,5 +6,6 @@ PROG= mckey MAN= SRCS= mckey.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: stable/9/contrib/ofed/librdmacm/examples/build/rping/Makefile ============================================================================== --- stable/9/contrib/ofed/librdmacm/examples/build/rping/Makefile Wed Dec 3 09:08:04 2014 (r275448) +++ stable/9/contrib/ofed/librdmacm/examples/build/rping/Makefile Wed Dec 3 09:10:41 2014 (r275449) @@ -6,5 +6,6 @@ PROG= rping MAN= SRCS= rping.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: stable/9/contrib/ofed/librdmacm/examples/build/udaddy/Makefile ============================================================================== --- stable/9/contrib/ofed/librdmacm/examples/build/udaddy/Makefile Wed Dec 3 09:08:04 2014 (r275448) +++ stable/9/contrib/ofed/librdmacm/examples/build/udaddy/Makefile Wed Dec 3 09:10:41 2014 (r275449) @@ -6,5 +6,6 @@ PROG= udaddy MAN= SRCS= udaddy.c LDADD+= -libverbs -lrdmacm -lpthread +LDADD+= -lmlx4 .include Modified: stable/9/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c ============================================================================== --- stable/9/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c Wed Dec 3 09:08:04 2014 (r275448) +++ stable/9/contrib/ofed/management/infiniband-diags/src/ibnetdiscover.c Wed Dec 3 09:10:41 2014 (r275449) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include "ibnetdiscover.h" #include "grouping.h" Modified: stable/9/contrib/ofed/management/infiniband-diags/src/ibroute.c ============================================================================== --- stable/9/contrib/ofed/management/infiniband-diags/src/ibroute.c Wed Dec 3 09:08:04 2014 (r275448) +++ stable/9/contrib/ofed/management/infiniband-diags/src/ibroute.c Wed Dec 3 09:10:41 2014 (r275449) @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include "ibdiag_common.h" Modified: stable/9/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c ============================================================================== --- stable/9/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c Wed Dec 3 09:08:04 2014 (r275448) +++ stable/9/contrib/ofed/management/infiniband-diags/src/ibsendtrap.c Wed Dec 3 09:10:41 2014 (r275449) @@ -43,7 +43,7 @@ #include #include -#include +#include #include "ibdiag_common.h" Modified: stable/9/contrib/ofed/management/infiniband-diags/src/ibtracert.c ============================================================================== --- stable/9/contrib/ofed/management/infiniband-diags/src/ibtracert.c Wed Dec 3 09:08:04 2014 (r275448) +++ stable/9/contrib/ofed/management/infiniband-diags/src/ibtracert.c Wed Dec 3 09:10:41 2014 (r275449) @@ -49,7 +49,7 @@ #include #include #include -#include +#include #include "ibdiag_common.h" Modified: stable/9/contrib/ofed/management/infiniband-diags/src/saquery.c ============================================================================== --- stable/9/contrib/ofed/management/infiniband-diags/src/saquery.c Wed Dec 3 09:08:04 2014 (r275448) +++ stable/9/contrib/ofed/management/infiniband-diags/src/saquery.c Wed Dec 3 09:10:41 2014 (r275449) @@ -50,12 +50,12 @@ #include #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include Modified: stable/9/contrib/ofed/management/infiniband-diags/src/smpquery.c ============================================================================== --- stable/9/contrib/ofed/management/infiniband-diags/src/smpquery.c Wed Dec 3 09:08:04 2014 (r275448) +++ stable/9/contrib/ofed/management/infiniband-diags/src/smpquery.c Wed Dec 3 09:10:41 2014 (r275449) @@ -50,7 +50,7 @@ #include #include #include -#include +#include #include "ibdiag_common.h" Modified: stable/9/contrib/ofed/usr.bin/Makefile.inc ============================================================================== --- stable/9/contrib/ofed/usr.bin/Makefile.inc Wed Dec 3 09:08:04 2014 (r275448) +++ stable/9/contrib/ofed/usr.bin/Makefile.inc Wed Dec 3 09:10:41 2014 (r275449) @@ -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-all@FreeBSD.ORG Wed Dec 3 09:14:15 2014 Return-Path: Delivered-To: svn-src-all@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 4526040E; Wed, 3 Dec 2014 09:14: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 310A4754; Wed, 3 Dec 2014 09:14:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB39EFSi078706; Wed, 3 Dec 2014 09:14:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB39EEm7078704; Wed, 3 Dec 2014 09:14:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412030914.sB39EEm7078704@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 09:14:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275450 - in stable/10/sys/dev/usb: . quirk X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 09:14:15 -0000 Author: hselasky Date: Wed Dec 3 09:14:14 2014 New Revision: 275450 URL: https://svnweb.freebsd.org/changeset/base/275450 Log: MFC r275110: Add new USB quirk. PR: 195372 Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c stable/10/sys/dev/usb/usbdevs Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/10/sys/dev/usb/quirk/usb_quirk.c Wed Dec 3 09:10:41 2014 (r275449) +++ stable/10/sys/dev/usb/quirk/usb_quirk.c Wed Dec 3 09:14:14 2014 (r275450) @@ -253,6 +253,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(LEXAR, CF_READER, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(LEXAR, JUMPSHOT, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(LEXAR, JUMPDRIVE, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), USB_QUIRK(LOGITEC, LDR_H443SU2, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(LOGITEC, LDR_H443U2, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI,), Modified: stable/10/sys/dev/usb/usbdevs ============================================================================== --- stable/10/sys/dev/usb/usbdevs Wed Dec 3 09:10:41 2014 (r275449) +++ stable/10/sys/dev/usb/usbdevs Wed Dec 3 09:14:14 2014 (r275450) @@ -2602,6 +2602,7 @@ product LENOVO ETHERNET 0x7203 USB 2.0 /* Lexar products */ product LEXAR JUMPSHOT 0x0001 jumpSHOT CompactFlash Reader product LEXAR CF_READER 0xb002 USB CF Reader +product LEXAR JUMPDRIVE 0xa833 USB Jumpdrive Flash Drive /* Lexmark products */ product LEXMARK S2450 0x0009 Optra S 2450 From owner-svn-src-all@FreeBSD.ORG Wed Dec 3 09:16:04 2014 Return-Path: Delivered-To: svn-src-all@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 104E7593; Wed, 3 Dec 2014 09:16: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 F034E77A; Wed, 3 Dec 2014 09:16:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB39G3Al079045; Wed, 3 Dec 2014 09:16:03 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB39G3gs079042; Wed, 3 Dec 2014 09:16:03 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201412030916.sB39G3gs079042@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 09:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275451 - in stable/9/sys/dev/usb: . quirk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 09:16:04 -0000 Author: hselasky Date: Wed Dec 3 09:16:02 2014 New Revision: 275451 URL: https://svnweb.freebsd.org/changeset/base/275451 Log: MFC r275110: Add new USB quirk. PR: 195372 Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/9/sys/dev/usb/quirk/usb_quirk.c Wed Dec 3 09:14:14 2014 (r275450) +++ stable/9/sys/dev/usb/quirk/usb_quirk.c Wed Dec 3 09:16:02 2014 (r275451) @@ -252,6 +252,7 @@ static struct usb_quirk_entry usb_quirks USB_QUIRK(LEXAR, CF_READER, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI, UQ_MSC_NO_INQUIRY), USB_QUIRK(LEXAR, JUMPSHOT, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), + USB_QUIRK(LEXAR, JUMPDRIVE, 0x0000, 0xffff, UQ_MSC_NO_INQUIRY), USB_QUIRK(LOGITEC, LDR_H443SU2, 0x0000, 0xffff, UQ_MSC_FORCE_PROTO_SCSI), USB_QUIRK(LOGITEC, LDR_H443U2, 0x0000, 0xffff, UQ_MSC_FORCE_WIRE_BBB, UQ_MSC_FORCE_PROTO_SCSI,), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Wed Dec 3 09:14:14 2014 (r275450) +++ stable/9/sys/dev/usb/usbdevs Wed Dec 3 09:16:02 2014 (r275451) @@ -2602,6 +2602,7 @@ product LENOVO ETHERNET 0x7203 USB 2.0 /* Lexar products */ product LEXAR JUMPSHOT 0x0001 jumpSHOT CompactFlash Reader product LEXAR CF_READER 0xb002 USB CF Reader +product LEXAR JUMPDRIVE 0xa833 USB Jumpdrive Flash Drive /* Lexmark products */ product LEXMARK S2450 0x0009 Optra S 2450 From owner-svn-src-all@FreeBSD.ORG Wed Dec 3 09:32:52 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 10:39:48 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 10:42:11 2014 Return-Path: Delivered-To: svn-src-all@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 9B988377; Wed, 3 Dec 2014 10:42: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 7CDDA117; Wed, 3 Dec 2014 10:42: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 sB3AgB6T022207; Wed, 3 Dec 2014 10:42:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3AgBVO022206; Wed, 3 Dec 2014 10:42:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412031042.sB3AgBVO022206@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 3 Dec 2014 10:42:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275456 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 10:42:11 -0000 Author: kib Date: Wed Dec 3 10:42:10 2014 New Revision: 275456 URL: https://svnweb.freebsd.org/changeset/base/275456 Log: MFC r275120: Fix SA_SIGINFO | SA_RESETHAND handling, reset disposition after sv_sendsig() is called. Modified: stable/10/sys/kern/kern_sig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_sig.c ============================================================================== --- stable/10/sys/kern/kern_sig.c Wed Dec 3 10:39:47 2014 (r275455) +++ stable/10/sys/kern/kern_sig.c Wed Dec 3 10:42:10 2014 (r275456) @@ -1891,6 +1891,30 @@ pgsignal(struct pgrp *pgrp, int sig, int } } + +/* + * Recalculate the signal mask and reset the signal disposition after + * usermode frame for delivery is formed. Should be called after + * mach-specific routine, because sysent->sv_sendsig() needs correct + * ps_siginfo and signal mask. + */ +static void +postsig_done(int sig, struct thread *td, struct sigacts *ps) +{ + sigset_t mask; + + mtx_assert(&ps->ps_mtx, MA_OWNED); + td->td_ru.ru_nsignals++; + mask = ps->ps_catchmask[_SIG_IDX(sig)]; + if (!SIGISMEMBER(ps->ps_signodefer, sig)) + SIGADDSET(mask, sig); + kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, + SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED); + if (SIGISMEMBER(ps->ps_sigreset, sig)) + sigdflt(ps, sig); +} + + /* * Send a signal caused by a trap to the current thread. If it will be * caught immediately, deliver it with correct code. Otherwise, post it @@ -1900,7 +1924,6 @@ void trapsignal(struct thread *td, ksiginfo_t *ksi) { struct sigacts *ps; - sigset_t mask; struct proc *p; int sig; int code; @@ -1915,7 +1938,6 @@ trapsignal(struct thread *td, ksiginfo_t mtx_lock(&ps->ps_mtx); if ((p->p_flag & P_TRACED) == 0 && SIGISMEMBER(ps->ps_sigcatch, sig) && !SIGISMEMBER(td->td_sigmask, sig)) { - td->td_ru.ru_nsignals++; #ifdef KTRACE if (KTRPOINT(curthread, KTR_PSIG)) ktrpsig(sig, ps->ps_sigact[_SIG_IDX(sig)], @@ -1923,13 +1945,7 @@ trapsignal(struct thread *td, ksiginfo_t #endif (*p->p_sysent->sv_sendsig)(ps->ps_sigact[_SIG_IDX(sig)], ksi, &td->td_sigmask); - mask = ps->ps_catchmask[_SIG_IDX(sig)]; - if (!SIGISMEMBER(ps->ps_signodefer, sig)) - SIGADDSET(mask, sig); - kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, - SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED); - if (SIGISMEMBER(ps->ps_sigreset, sig)) - sigdflt(ps, sig); + postsig_done(sig, td, ps); mtx_unlock(&ps->ps_mtx); } else { /* @@ -2811,7 +2827,7 @@ postsig(sig) struct sigacts *ps; sig_t action; ksiginfo_t ksi; - sigset_t returnmask, mask; + sigset_t returnmask; KASSERT(sig != 0, ("postsig")); @@ -2866,20 +2882,12 @@ postsig(sig) } else returnmask = td->td_sigmask; - mask = ps->ps_catchmask[_SIG_IDX(sig)]; - if (!SIGISMEMBER(ps->ps_signodefer, sig)) - SIGADDSET(mask, sig); - kern_sigprocmask(td, SIG_BLOCK, &mask, NULL, - SIGPROCMASK_PROC_LOCKED | SIGPROCMASK_PS_LOCKED); - - if (SIGISMEMBER(ps->ps_sigreset, sig)) - sigdflt(ps, sig); - td->td_ru.ru_nsignals++; if (p->p_sig == sig) { p->p_code = 0; p->p_sig = 0; } (*p->p_sysent->sv_sendsig)(action, &ksi, &returnmask); + postsig_done(sig, td, ps); } return (1); } From owner-svn-src-all@FreeBSD.ORG Wed Dec 3 14:04:58 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 15:16:19 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 15:19:39 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 15:29:54 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 16:04:02 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 16:47:41 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 18:08:40 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 18:14:22 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 19:41:50 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 19:44:23 2014 Return-Path: Delivered-To: svn-src-all@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 9112F623; Wed, 3 Dec 2014 19:44: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 7D9281BF; Wed, 3 Dec 2014 19:44: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 sB3JiNpp070504; Wed, 3 Dec 2014 19:44:23 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3JiNmt070503; Wed, 3 Dec 2014 19:44:23 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201412031944.sB3JiNmt070503@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Dec 2014 19:44:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275465 - stable/10/usr.sbin/pciconf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 19:44:23 -0000 Author: markj Date: Wed Dec 3 19:44:22 2014 New Revision: 275465 URL: https://svnweb.freebsd.org/changeset/base/275465 Log: MFC r273488: Fix some bugs in the error handling of getdevice(). PR: 194506 Modified: stable/10/usr.sbin/pciconf/pciconf.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/10/usr.sbin/pciconf/pciconf.c Wed Dec 3 19:41:49 2014 (r275464) +++ stable/10/usr.sbin/pciconf/pciconf.c Wed Dec 3 19:44:22 2014 (r275465) @@ -662,16 +662,16 @@ getdevice(const char *name) * find the start of the unit. */ if (name[0] == '\0') - err(1, "Empty device name"); + errx(1, "Empty device name"); cp = strchr(name, '\0'); assert(cp != NULL && cp != name); cp--; while (cp != name && isdigit(cp[-1])) cp--; - if (cp == name) + if (cp == name || !isdigit(*cp)) errx(1, "Invalid device name"); if ((size_t)(cp - name) + 1 > sizeof(patterns[0].pd_name)) - errx(1, "Device name i2s too long"); + errx(1, "Device name is too long"); memcpy(patterns[0].pd_name, name, cp - name); patterns[0].pd_unit = strtol(cp, &cp, 10); assert(*cp == '\0'); From owner-svn-src-all@FreeBSD.ORG Wed Dec 3 19:44:25 2014 Return-Path: Delivered-To: svn-src-all@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 2DC3C679; Wed, 3 Dec 2014 19:44: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 EC1E61C1; Wed, 3 Dec 2014 19:44: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 sB3JiOIn070568; Wed, 3 Dec 2014 19:44:24 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB3JiOPI070567; Wed, 3 Dec 2014 19:44:24 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201412031944.sB3JiOPI070567@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 3 Dec 2014 19:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275466 - stable/9/usr.sbin/pciconf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2014 19:44:25 -0000 Author: markj Date: Wed Dec 3 19:44:24 2014 New Revision: 275466 URL: https://svnweb.freebsd.org/changeset/base/275466 Log: MFC r273488: Fix some bugs in the error handling of getdevice(). PR: 194506 Modified: stable/9/usr.sbin/pciconf/pciconf.c Directory Properties: stable/9/usr.sbin/pciconf/ (props changed) Modified: stable/9/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/9/usr.sbin/pciconf/pciconf.c Wed Dec 3 19:44:22 2014 (r275465) +++ stable/9/usr.sbin/pciconf/pciconf.c Wed Dec 3 19:44:24 2014 (r275466) @@ -661,16 +661,16 @@ getdevice(const char *name) * find the start of the unit. */ if (name[0] == '\0') - err(1, "Empty device name"); + errx(1, "Empty device name"); cp = strchr(name, '\0'); assert(cp != NULL && cp != name); cp--; while (cp != name && isdigit(cp[-1])) cp--; - if (cp == name) + if (cp == name || !isdigit(*cp)) errx(1, "Invalid device name"); if ((size_t)(cp - name) + 1 > sizeof(patterns[0].pd_name)) - errx(1, "Device name i2s too long"); + errx(1, "Device name is too long"); memcpy(patterns[0].pd_name, name, cp - name); patterns[0].pd_unit = strtol(cp, &cp, 10); assert(*cp == '\0'); From owner-svn-src-all@FreeBSD.ORG Wed Dec 3 21:48:31 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 21:55:45 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 22:03:25 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 22:14:14 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Wed Dec 3 23:37:24 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 00:54:53 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 01:10:51 2014 Return-Path: Delivered-To: svn-src-all@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 A7AB0850; Thu, 4 Dec 2014 01:10:51 +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 78315ADB; Thu, 4 Dec 2014 01:10:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB41ApV0054383; Thu, 4 Dec 2014 01:10:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB41Apvm054382; Thu, 4 Dec 2014 01:10:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412040110.sB41Apvm054382@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 01:10:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275471 - in stable: 10/sys/dev/ath/ath_hal/ar5212 9/sys/dev/ath/ath_hal/ar5212 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 01:10:51 -0000 Author: dim Date: Thu Dec 4 01:10:50 2014 New Revision: 275471 URL: https://svnweb.freebsd.org/changeset/base/275471 Log: MFC r274922: Fix the following -Werror warning from clang 3.5.0, while building the ath kernel module: sys/dev/ath/ath_hal/ar5212/ar5212_reset.c:2642:7: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value] if (abs(lp[0] * EEP_SCALE - target) < EEP_DELTA) { ^ sys/dev/ath/ah_osdep.h:74:18: note: expanded from macro 'abs' #define abs(_a) __builtin_abs(_a) ^ sys/dev/ath/ath_hal/ar5212/ar5212_reset.c:2642:7: note: remove the call to '__builtin_abs' since unsigned values cannot be negative sys/dev/ath/ah_osdep.h:74:18: note: expanded from macro 'abs' #define abs(_a) __builtin_abs(_a) ^ 1 error generated. This warning occurs because both lp[0] and target are unsigned, so the subtraction expression is also unsigned, and calling abs() is a no-op. However, the intention was to look at the absolute difference between the two unsigned quantities. Introduce a small static function to clarify what we're doing, and call that instead. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D1212 Modified: stable/9/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c ============================================================================== --- stable/9/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Wed Dec 3 23:37:23 2014 (r275470) +++ stable/9/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Thu Dec 4 01:10:50 2014 (r275471) @@ -2459,6 +2459,12 @@ ar5212GetTargetPowers(struct ath_hal *ah powInfo[ixlo].twicePwr54, powInfo[ixhi].twicePwr54); } +static uint32_t +udiff(uint32_t u, uint32_t v) +{ + return (u >= v ? u - v : v - u); +} + /* * Search a list for a specified value v that is within * EEP_DELTA of the search values. Return the closest @@ -2493,7 +2499,7 @@ ar5212GetLowerUpperValues(uint16_t v, ui * If value is close to the current value of the list * then target is not between values, it is one of the values */ - if (abs(lp[0] * EEP_SCALE - target) < EEP_DELTA) { + if (udiff(lp[0] * EEP_SCALE, target) < EEP_DELTA) { *vlo = *vhi = lp[0]; return; } From owner-svn-src-all@FreeBSD.ORG Thu Dec 4 01:10:52 2014 Return-Path: Delivered-To: svn-src-all@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 53980851; Thu, 4 Dec 2014 01:10: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 1954EADC; Thu, 4 Dec 2014 01:10: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 sB41ApMi054392; Thu, 4 Dec 2014 01:10:51 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB41Apaj054391; Thu, 4 Dec 2014 01:10:51 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412040110.sB41Apaj054391@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 01:10:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275471 - in stable: 10/sys/dev/ath/ath_hal/ar5212 9/sys/dev/ath/ath_hal/ar5212 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 01:10:52 -0000 Author: dim Date: Thu Dec 4 01:10:50 2014 New Revision: 275471 URL: https://svnweb.freebsd.org/changeset/base/275471 Log: MFC r274922: Fix the following -Werror warning from clang 3.5.0, while building the ath kernel module: sys/dev/ath/ath_hal/ar5212/ar5212_reset.c:2642:7: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value] if (abs(lp[0] * EEP_SCALE - target) < EEP_DELTA) { ^ sys/dev/ath/ah_osdep.h:74:18: note: expanded from macro 'abs' #define abs(_a) __builtin_abs(_a) ^ sys/dev/ath/ath_hal/ar5212/ar5212_reset.c:2642:7: note: remove the call to '__builtin_abs' since unsigned values cannot be negative sys/dev/ath/ah_osdep.h:74:18: note: expanded from macro 'abs' #define abs(_a) __builtin_abs(_a) ^ 1 error generated. This warning occurs because both lp[0] and target are unsigned, so the subtraction expression is also unsigned, and calling abs() is a no-op. However, the intention was to look at the absolute difference between the two unsigned quantities. Introduce a small static function to clarify what we're doing, and call that instead. Reviewed by: adrian Differential Revision: https://reviews.freebsd.org/D1212 Modified: stable/10/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c ============================================================================== --- stable/10/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Wed Dec 3 23:37:23 2014 (r275470) +++ stable/10/sys/dev/ath/ath_hal/ar5212/ar5212_reset.c Thu Dec 4 01:10:50 2014 (r275471) @@ -2605,6 +2605,12 @@ ar5212GetTargetPowers(struct ath_hal *ah powInfo[ixlo].twicePwr54, powInfo[ixhi].twicePwr54); } +static uint32_t +udiff(uint32_t u, uint32_t v) +{ + return (u >= v ? u - v : v - u); +} + /* * Search a list for a specified value v that is within * EEP_DELTA of the search values. Return the closest @@ -2639,7 +2645,7 @@ ar5212GetLowerUpperValues(uint16_t v, ui * If value is close to the current value of the list * then target is not between values, it is one of the values */ - if (abs(lp[0] * EEP_SCALE - target) < EEP_DELTA) { + if (udiff(lp[0] * EEP_SCALE, target) < EEP_DELTA) { *vlo = *vhi = lp[0]; return; } From owner-svn-src-all@FreeBSD.ORG Thu Dec 4 01:21:57 2014 Return-Path: Delivered-To: svn-src-all@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 86420BB9; Thu, 4 Dec 2014 01:21: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 714DCC69; Thu, 4 Dec 2014 01:21: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 sB41LvvZ062924; Thu, 4 Dec 2014 01:21:57 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB41Lv5T062923; Thu, 4 Dec 2014 01:21:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412040121.sB41Lv5T062923@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 01:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275472 - in stable: 10/contrib/libc++/include 9/contrib/libc++/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 01:21:57 -0000 Author: dim Date: Thu Dec 4 01:21:56 2014 New Revision: 275472 URL: https://svnweb.freebsd.org/changeset/base/275472 Log: MFC r275366: 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 Modified: stable/9/contrib/libc++/include/type_traits Directory Properties: stable/9/contrib/libc++/ (props changed) Changes in other areas also in this revision: Modified: stable/10/contrib/libc++/include/type_traits Directory Properties: stable/10/ (props changed) Modified: stable/9/contrib/libc++/include/type_traits ============================================================================== --- stable/9/contrib/libc++/include/type_traits Thu Dec 4 01:10:50 2014 (r275471) +++ stable/9/contrib/libc++/include/type_traits Thu Dec 4 01:21:56 2014 (r275472) @@ -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-all@FreeBSD.ORG Thu Dec 4 01:21:58 2014 Return-Path: Delivered-To: svn-src-all@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 2370CBBA; Thu, 4 Dec 2014 01:21: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 0E89AC6A; Thu, 4 Dec 2014 01:21: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 sB41LvOf063196; Thu, 4 Dec 2014 01:21:57 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB41LvQv063188; Thu, 4 Dec 2014 01:21:57 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201412040121.sB41LvQv063188@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 01:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275472 - in stable: 10/contrib/libc++/include 9/contrib/libc++/include X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 01:21:58 -0000 Author: dim Date: Thu Dec 4 01:21:56 2014 New Revision: 275472 URL: https://svnweb.freebsd.org/changeset/base/275472 Log: MFC r275366: 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 Modified: stable/10/contrib/libc++/include/type_traits Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/contrib/libc++/include/type_traits Directory Properties: stable/9/contrib/libc++/ (props changed) Modified: stable/10/contrib/libc++/include/type_traits ============================================================================== --- stable/10/contrib/libc++/include/type_traits Thu Dec 4 01:10:50 2014 (r275471) +++ stable/10/contrib/libc++/include/type_traits Thu Dec 4 01:21:56 2014 (r275472) @@ -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-all@FreeBSD.ORG Thu Dec 4 02:28:23 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 04:46:07 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 05:02:13 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 07:20:40 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 11:34:21 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 15:54:46 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 15:57:59 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 16:55:42 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 17:05:08 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 17:05:17 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 17:10:26 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 17:26:06 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 17:36:30 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 17:50:34 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 18:23:14 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 18:28:38 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 18:37:43 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 19:08:06 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 19:19:06 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 20:36:57 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 21:17:52 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Thu Dec 4 22:15:23 2014 Return-Path: Delivered-To: svn-src-all@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 54B577B7; Thu, 4 Dec 2014 22:15: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 414FEDAE; Thu, 4 Dec 2014 22:15: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 sB4MFN1c072884; Thu, 4 Dec 2014 22:15:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4MFNL0072883; Thu, 4 Dec 2014 22:15:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201412042215.sB4MFNL0072883@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 4 Dec 2014 22:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275484 - stable/9/sys/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 22:15:23 -0000 Author: emaste Date: Thu Dec 4 22:15:22 2014 New Revision: 275484 URL: https://svnweb.freebsd.org/changeset/base/275484 Log: Add missing VT_ kernel config knobs MFC of r268059 Modified: stable/9/sys/conf/options Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Thu Dec 4 21:17:50 2014 (r275483) +++ stable/9/sys/conf/options Thu Dec 4 22:15:22 2014 (r275484) @@ -734,8 +734,6 @@ SAFE_RNDTEST opt_safe.h # syscons/vt options MAXCONS opt_syscons.h -VT_FB_DEFAULT_WIDTH opt_syscons.h -VT_FB_DEFAULT_HEIGHT opt_syscons.h SC_ALT_MOUSE_IMAGE opt_syscons.h SC_CUT_SPACES2TABS opt_syscons.h SC_CUT_SEPCHARS opt_syscons.h @@ -758,6 +756,11 @@ SC_NORM_REV_ATTR opt_syscons.h SC_PIXEL_MODE opt_syscons.h SC_RENDER_DEBUG opt_syscons.h SC_TWOBUTTON_MOUSE opt_syscons.h +VT_ALT_TO_ESC_HACK opt_syscons.h +VT_FB_DEFAULT_WIDTH opt_syscons.h +VT_FB_DEFAULT_HEIGHT opt_syscons.h +VT_MAXWINDOWS opt_syscons.h +VT_TWOBUTTON_MOUSE opt_syscons.h DEV_SC opt_syscons.h DEV_VT opt_syscons.h From owner-svn-src-all@FreeBSD.ORG Thu Dec 4 23:15:45 2014 Return-Path: Delivered-To: svn-src-all@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 C957E795; Thu, 4 Dec 2014 23:15: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 B5B276B8; Thu, 4 Dec 2014 23:15: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 sB4NFjlP001364; Thu, 4 Dec 2014 23:15:45 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4NFjCb001363; Thu, 4 Dec 2014 23:15:45 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412042315.sB4NFjCb001363@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Dec 2014 23:15:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275485 - stable/10/sbin/sysctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 23:15:45 -0000 Author: delphij Date: Thu Dec 4 23:15:44 2014 New Revision: 275485 URL: https://svnweb.freebsd.org/changeset/base/275485 Log: MFC r272044: Constify a parameter of name2oid. No functional change. Modified: stable/10/sbin/sysctl/sysctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/sysctl/sysctl.c ============================================================================== --- stable/10/sbin/sysctl/sysctl.c Thu Dec 4 22:15:22 2014 (r275484) +++ stable/10/sbin/sysctl/sysctl.c Thu Dec 4 23:15:44 2014 (r275485) @@ -78,7 +78,7 @@ static int parsefile(const char *); static int parse(const char *, int); static int show_var(int *, int); static int sysctl_all(int *oid, int len); -static int name2oid(char *, int *); +static int name2oid(const char *, int *); static int set_IK(const char *, int *); @@ -693,7 +693,7 @@ set_IK(const char *str, int *val) */ static int -name2oid(char *name, int *oidp) +name2oid(const char *name, int *oidp) { int oid[2]; int i; From owner-svn-src-all@FreeBSD.ORG Thu Dec 4 23:17:36 2014 Return-Path: Delivered-To: svn-src-all@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 A7A1C972; Thu, 4 Dec 2014 23:17: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 934C46E3; Thu, 4 Dec 2014 23:17: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 sB4NHagO001684; Thu, 4 Dec 2014 23:17:36 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4NHaH9001683; Thu, 4 Dec 2014 23:17:36 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412042317.sB4NHaH9001683@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Dec 2014 23:17:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275486 - stable/10/cddl/contrib/opensolaris/lib/libzpool/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 23:17:36 -0000 Author: delphij Date: Thu Dec 4 23:17:35 2014 New Revision: 275486 URL: https://svnweb.freebsd.org/changeset/base/275486 Log: MFC r274303: Apply upstream 13597:3eac1e8e0f4c (git: illumos-gate@aa846ad9): Initialize tqent_flags in the userland taskq implementation. Without this the assertion of tq->tq_freelist != NULL may fail in taskq_destroy. The problem is that tqent_flags is never initialized in the userland implementation while the kernel one does initialize it. Without proper initialization, the flag may have its lowest bit set, making it treated as TQENT_FLAG_PREALLOC and never removing taskq_ent_t from tq_freelist. Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Thu Dec 4 23:15:44 2014 (r275485) +++ stable/10/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c Thu Dec 4 23:17:35 2014 (r275486) @@ -24,6 +24,7 @@ */ /* * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright 2012 Garrett D'Amore . All rights reserved. */ #include @@ -136,6 +137,7 @@ taskq_dispatch(taskq_t *tq, task_func_t t->tqent_prev->tqent_next = t; t->tqent_func = func; t->tqent_arg = arg; + t->tqent_flags = 0; cv_signal(&tq->tq_dispatch_cv); mutex_exit(&tq->tq_lock); return (1); From owner-svn-src-all@FreeBSD.ORG Thu Dec 4 23:19:05 2014 Return-Path: Delivered-To: svn-src-all@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 CB2B5B17; Thu, 4 Dec 2014 23:19: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 B7AB6754; Thu, 4 Dec 2014 23:19: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 sB4NJ5Lk001927; Thu, 4 Dec 2014 23:19:05 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4NJ5wY001926; Thu, 4 Dec 2014 23:19:05 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412042319.sB4NJ5wY001926@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Dec 2014 23:19:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275487 - stable/10/sys/conf X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 23:19:05 -0000 Author: delphij Date: Thu Dec 4 23:19:04 2014 New Revision: 275487 URL: https://svnweb.freebsd.org/changeset/base/275487 Log: MFC r274458,274523: Derive copyright year from src/COPYRIGHT. Modified: stable/10/sys/conf/newvers.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/newvers.sh ============================================================================== --- stable/10/sys/conf/newvers.sh Thu Dec 4 23:17:35 2014 (r275486) +++ stable/10/sys/conf/newvers.sh Thu Dec 4 23:19:04 2014 (r275487) @@ -52,7 +52,7 @@ else fi b=share/examples/etc/bsd-style-copyright -year=`date '+%Y'` +year=$(sed -Ee '/^Copyright .* The FreeBSD Project/!d;s/^.*1992-([0-9]*) .*$/\1/g' ${SYSDIR}/../COPYRIGHT) # look for copyright template for bsd_copyright in ../$b ../../$b ../../../$b /usr/src/$b /usr/$b do From owner-svn-src-all@FreeBSD.ORG Thu Dec 4 23:20:45 2014 Return-Path: Delivered-To: svn-src-all@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 AF963D32; Thu, 4 Dec 2014 23:20: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 90D787F1; Thu, 4 Dec 2014 23:20: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 sB4NKjT9002469; Thu, 4 Dec 2014 23:20:45 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4NKjZ4002467; Thu, 4 Dec 2014 23:20:45 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412042320.sB4NKjZ4002467@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Dec 2014 23:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275488 - in stable/10: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 23:20:45 -0000 Author: delphij Date: Thu Dec 4 23:20:44 2014 New Revision: 275488 URL: https://svnweb.freebsd.org/changeset/base/275488 Log: MFC r274276: MFV r274271: Improve zdb -b performance: - Reduce gethrtime() call to 1/100th of blkptr's; - Skip manipulating the size-ordered tree; - Issue more (10, previously 3) async reads; - Use lighter weight testing in traverse_visitbp(); Illumos issue: 5243 zdb -b could be much faster Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Dec 4 23:19:04 2014 (r275487) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Thu Dec 4 23:20:44 2014 (r275488) @@ -77,9 +77,11 @@ #ifndef lint extern boolean_t zfs_recover; extern uint64_t zfs_arc_max, zfs_arc_meta_limit; +extern int zfs_vdev_async_read_max_active; #else boolean_t zfs_recover; uint64_t zfs_arc_max, zfs_arc_meta_limit; +int zfs_vdev_async_read_max_active; #endif const char cmdname[] = "zdb"; @@ -2384,8 +2386,14 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog zcb->zcb_readfails = 0; - if (dump_opt['b'] < 5 && - gethrtime() > zcb->zcb_lastprint + NANOSEC) { + /* only call gethrtime() every 100 blocks */ + static int iters; + if (++iters > 100) + iters = 0; + else + return (0); + + if (dump_opt['b'] < 5 && gethrtime() > zcb->zcb_lastprint + NANOSEC) { uint64_t now = gethrtime(); char buf[10]; uint64_t bytes = zcb->zcb_type[ZB_TOTAL][ZDB_OT_TOTAL].zb_asize; @@ -2494,6 +2502,14 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) (longlong_t)vd->vdev_ms_count); msp->ms_ops = &zdb_metaslab_ops; + + /* + * We don't want to spend the CPU + * manipulating the size-ordered + * tree, so clear the range_tree + * ops. + */ + msp->ms_tree->rt_ops = NULL; VERIFY0(space_map_load(msp->ms_sm, msp->ms_tree, SM_ALLOC)); msp->ms_loaded = B_TRUE; @@ -3508,6 +3524,13 @@ main(int argc, char **argv) */ zfs_arc_max = zfs_arc_meta_limit = 256 * 1024 * 1024; + /* + * "zdb -c" uses checksum-verifying scrub i/os which are async reads. + * "zdb -b" uses traversal prefetch which uses async reads. + * For good performance, let several of them be active at once. + */ + zfs_vdev_async_read_max_active = 10; + kernel_init(FREAD); g_zfs = libzfs_init(); ASSERT(g_zfs != NULL); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Thu Dec 4 23:19:04 2014 (r275487) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Thu Dec 4 23:20:44 2014 (r275488) @@ -59,6 +59,7 @@ typedef struct traverse_data { int td_flags; prefetch_data_t *td_pfd; boolean_t td_paused; + uint64_t td_hole_birth_enabled_txg; blkptr_cb_t *td_func; void *td_arg; } traverse_data_t; @@ -229,25 +230,20 @@ traverse_visitbp(traverse_data_t *td, co } if (bp->blk_birth == 0) { - if (spa_feature_is_active(td->td_spa, SPA_FEATURE_HOLE_BIRTH)) { - /* - * Since this block has a birth time of 0 it must be a - * hole created before the SPA_FEATURE_HOLE_BIRTH - * feature was enabled. If SPA_FEATURE_HOLE_BIRTH - * was enabled before the min_txg for this traveral we - * know the hole must have been created before the - * min_txg for this traveral, so we can skip it. If - * SPA_FEATURE_HOLE_BIRTH was enabled after the min_txg - * for this traveral we cannot tell if the hole was - * created before or after the min_txg for this - * traversal, so we cannot skip it. - */ - uint64_t hole_birth_enabled_txg; - VERIFY(spa_feature_enabled_txg(td->td_spa, - SPA_FEATURE_HOLE_BIRTH, &hole_birth_enabled_txg)); - if (hole_birth_enabled_txg < td->td_min_txg) - return (0); - } + /* + * Since this block has a birth time of 0 it must be a + * hole created before the SPA_FEATURE_HOLE_BIRTH + * feature was enabled. If SPA_FEATURE_HOLE_BIRTH + * was enabled before the min_txg for this traveral we + * know the hole must have been created before the + * min_txg for this traveral, so we can skip it. If + * SPA_FEATURE_HOLE_BIRTH was enabled after the min_txg + * for this traveral we cannot tell if the hole was + * created before or after the min_txg for this + * traversal, so we cannot skip it. + */ + if (td->td_hole_birth_enabled_txg < td->td_min_txg) + return (0); } else if (bp->blk_birth <= td->td_min_txg) { return (0); } @@ -523,6 +519,13 @@ traverse_impl(spa_t *spa, dsl_dataset_t td.td_flags = flags; td.td_paused = B_FALSE; + if (spa_feature_is_active(spa, SPA_FEATURE_HOLE_BIRTH)) { + VERIFY(spa_feature_enabled_txg(spa, + SPA_FEATURE_HOLE_BIRTH, &td.td_hole_birth_enabled_txg)); + } else { + td.td_hole_birth_enabled_txg = 0; + } + pd.pd_blks_max = zfs_pd_blks_max; pd.pd_flags = flags; mutex_init(&pd.pd_mtx, NULL, MUTEX_DEFAULT, NULL); From owner-svn-src-all@FreeBSD.ORG Thu Dec 4 23:21:43 2014 Return-Path: Delivered-To: svn-src-all@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 1F943EF2; Thu, 4 Dec 2014 23:21: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 0BD8A809; Thu, 4 Dec 2014 23:21: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 sB4NLgOo005400; Thu, 4 Dec 2014 23:21:42 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4NLgpG005399; Thu, 4 Dec 2014 23:21:42 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412042321.sB4NLgpG005399@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Dec 2014 23:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275489 - stable/10/sys/libkern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 23:21:43 -0000 Author: delphij Date: Thu Dec 4 23:21:42 2014 New Revision: 275489 URL: https://svnweb.freebsd.org/changeset/base/275489 Log: MFC r274636: Sync with userland variant. Modified: stable/10/sys/libkern/strncmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/libkern/strncmp.c ============================================================================== --- stable/10/sys/libkern/strncmp.c Thu Dec 4 23:20:44 2014 (r275488) +++ stable/10/sys/libkern/strncmp.c Thu Dec 4 23:21:42 2014 (r275489) @@ -10,7 +10,7 @@ * 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. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -33,9 +33,7 @@ __FBSDID("$FreeBSD$"); #include int -strncmp(s1, s2, n) - register const char *s1, *s2; - register size_t n; +strncmp(const char *s1, const char *s2, size_t n) { if (n == 0) @@ -44,7 +42,7 @@ strncmp(s1, s2, n) if (*s1 != *s2++) return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1)); - if (*s1++ == 0) + if (*s1++ == '\0') break; } while (--n != 0); return (0); From owner-svn-src-all@FreeBSD.ORG Thu Dec 4 23:26:16 2014 Return-Path: Delivered-To: svn-src-all@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 369B320F; Thu, 4 Dec 2014 23:26: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 20BFA84C; Thu, 4 Dec 2014 23:26: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 sB4NQFci006678; Thu, 4 Dec 2014 23:26:15 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4NQFNt006677; Thu, 4 Dec 2014 23:26:15 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412042326.sB4NQFNt006677@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Dec 2014 23:26:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275490 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 23:26:16 -0000 Author: delphij Date: Thu Dec 4 23:26:15 2014 New Revision: 275490 URL: https://svnweb.freebsd.org/changeset/base/275490 Log: MFC r274674: Add a tunable for spa_slop_shift which controls how much space we would reserve by default. Tuning is not recommended. Relnotes: yes Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Dec 4 23:21:42 2014 (r275489) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Thu Dec 4 23:26:15 2014 (r275490) @@ -384,6 +384,9 @@ zfs_deadman_init() * See also the comments in zfs_space_check_t. */ int spa_slop_shift = 5; +SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_slop_shift, CTLFLAG_RWTUN, + &spa_slop_shift, 0, + "Shift value of reserved space (1/(2^spa_slop_shift))."); /* * ========================================================================== From owner-svn-src-all@FreeBSD.ORG Thu Dec 4 23:27:30 2014 Return-Path: Delivered-To: svn-src-all@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 9D26F43C; Thu, 4 Dec 2014 23:27: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 896AE869; Thu, 4 Dec 2014 23:27: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 sB4NRUIC006884; Thu, 4 Dec 2014 23:27:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB4NRUbZ006883; Thu, 4 Dec 2014 23:27:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412042327.sB4NRUbZ006883@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 4 Dec 2014 23:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275491 - stable/10/contrib/hyperv/tools X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Dec 2014 23:27:30 -0000 Author: delphij Date: Thu Dec 4 23:27:29 2014 New Revision: 275491 URL: https://svnweb.freebsd.org/changeset/base/275491 Log: MFC r274370: Rename variable name from 'index' to 'idx' to avoid shadowing index(3). Noticed by: dim Modified: stable/10/contrib/hyperv/tools/hv_kvp_daemon.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/hyperv/tools/hv_kvp_daemon.c ============================================================================== --- stable/10/contrib/hyperv/tools/hv_kvp_daemon.c Thu Dec 4 23:26:15 2014 (r275490) +++ stable/10/contrib/hyperv/tools/hv_kvp_daemon.c Thu Dec 4 23:27:29 2014 (r275491) @@ -511,25 +511,25 @@ kvp_get_value(int pool, __u8 *key, int k static int -kvp_pool_enumerate(int pool, int index, __u8 *key, int key_size, +kvp_pool_enumerate(int pool, int idx, __u8 *key, int key_size, __u8 *value, int value_size) { struct kvp_record *record; KVP_LOG(LOG_DEBUG, "kvp_pool_enumerate: pool = %d, index = %d\n,", - pool, index); + pool, idx); /* First update our in-memory state first. */ kvp_update_mem_state(pool); record = kvp_pools[pool].records; /* Index starts with 0 */ - if (index >= kvp_pools[pool].num_records) { + if (idx >= kvp_pools[pool].num_records) { return (1); } - memcpy(key, record[index].key, key_size); - memcpy(value, record[index].value, value_size); + memcpy(key, record[idx].key, key_size); + memcpy(value, record[idx].value, value_size); return (0); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 00:32:34 2014 Return-Path: Delivered-To: svn-src-all@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 02DF2392; Fri, 5 Dec 2014 00:32:34 +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 E27F4F61; Fri, 5 Dec 2014 00:32: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 sB50WXfd040351; Fri, 5 Dec 2014 00:32:33 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB50WXki040350; Fri, 5 Dec 2014 00:32:33 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412050032.sB50WXki040350@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 00:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275492 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 00:32:34 -0000 Author: delphij Date: Fri Dec 5 00:32:33 2014 New Revision: 275492 URL: https://svnweb.freebsd.org/changeset/base/275492 Log: MFC r274172 (avg) fix l2arc compression buffers leak We have observed that arc_release() can be called concurrently with a l2arc in-flight write. Also, we have observed that arc_hdr_destroy() can be called from arc_write_done() for a zio with ZIO_FLAG_IO_REWRITE flag in similar circumstances. Previously the l2arc headers would be freed while leaking their associated compression buffers. Now the buffers are placed on l2arc_free_on_write list for delayed freeing. This is similar to what was already done to arc buffers that were supposed to be freed concurrently with in-flight writes of those buffers. In addition to fixing the discovered leaks this change also adds some protective code to assert that a compression buffer associated with a l2arc header is never leaked. A new kstat l2_cdata_free_on_write is added. It keeps a count of delayed compression buffer frees which previously would have been leaks. Tested by: Vitalij Satanivskij et al Requested by: many Sponsored by: HybridCluster / ClusterHQ This is a 10.1-RELEASE errata candidate. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu Dec 4 23:27:29 2014 (r275491) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Dec 5 00:32:33 2014 (r275492) @@ -390,6 +390,7 @@ typedef struct arc_stats { kstat_named_t arcstat_l2_evict_lock_retry; kstat_named_t arcstat_l2_evict_reading; kstat_named_t arcstat_l2_free_on_write; + kstat_named_t arcstat_l2_cdata_free_on_write; kstat_named_t arcstat_l2_abort_lowmem; kstat_named_t arcstat_l2_cksum_bad; kstat_named_t arcstat_l2_io_error; @@ -467,6 +468,7 @@ static arc_stats_t arc_stats = { { "l2_evict_lock_retry", KSTAT_DATA_UINT64 }, { "l2_evict_reading", KSTAT_DATA_UINT64 }, { "l2_free_on_write", KSTAT_DATA_UINT64 }, + { "l2_cdata_free_on_write", KSTAT_DATA_UINT64 }, { "l2_abort_lowmem", KSTAT_DATA_UINT64 }, { "l2_cksum_bad", KSTAT_DATA_UINT64 }, { "l2_io_error", KSTAT_DATA_UINT64 }, @@ -1658,6 +1660,21 @@ arc_buf_add_ref(arc_buf_t *buf, void* ta data, metadata, hits); } +static void +arc_buf_free_on_write(void *data, size_t size, + void (*free_func)(void *, size_t)) +{ + l2arc_data_free_t *df; + + df = kmem_alloc(sizeof (l2arc_data_free_t), KM_SLEEP); + df->l2df_data = data; + df->l2df_size = size; + df->l2df_func = free_func; + mutex_enter(&l2arc_free_on_write_mtx); + list_insert_head(l2arc_free_on_write, df); + mutex_exit(&l2arc_free_on_write_mtx); +} + /* * Free the arc data buffer. If it is an l2arc write in progress, * the buffer is placed on l2arc_free_on_write to be freed later. @@ -1668,14 +1685,7 @@ arc_buf_data_free(arc_buf_t *buf, void ( arc_buf_hdr_t *hdr = buf->b_hdr; if (HDR_L2_WRITING(hdr)) { - l2arc_data_free_t *df; - df = kmem_alloc(sizeof (l2arc_data_free_t), KM_SLEEP); - df->l2df_data = buf->b_data; - df->l2df_size = hdr->b_size; - df->l2df_func = free_func; - mutex_enter(&l2arc_free_on_write_mtx); - list_insert_head(l2arc_free_on_write, df); - mutex_exit(&l2arc_free_on_write_mtx); + arc_buf_free_on_write(buf->b_data, hdr->b_size, free_func); ARCSTAT_BUMP(arcstat_l2_free_on_write); } else { free_func(buf->b_data, hdr->b_size); @@ -1687,6 +1697,23 @@ arc_buf_data_free(arc_buf_t *buf, void ( * arc_buf_t off of the the arc_buf_hdr_t's list and free it. */ static void +arc_buf_l2_cdata_free(arc_buf_hdr_t *hdr) +{ + l2arc_buf_hdr_t *l2hdr = hdr->b_l2hdr; + + ASSERT(MUTEX_HELD(&l2arc_buflist_mtx)); + + if (l2hdr->b_tmp_cdata == NULL) + return; + + ASSERT(HDR_L2_WRITING(hdr)); + arc_buf_free_on_write(l2hdr->b_tmp_cdata, hdr->b_size, + zio_data_buf_free); + ARCSTAT_BUMP(arcstat_l2_cdata_free_on_write); + l2hdr->b_tmp_cdata = NULL; +} + +static void arc_buf_destroy(arc_buf_t *buf, boolean_t recycle, boolean_t remove) { arc_buf_t **bufp; @@ -1785,6 +1812,7 @@ arc_hdr_destroy(arc_buf_hdr_t *hdr) trim_map_free(l2hdr->b_dev->l2ad_vdev, l2hdr->b_daddr, hdr->b_size, 0); list_remove(l2hdr->b_dev->l2ad_buflist, hdr); + arc_buf_l2_cdata_free(hdr); ARCSTAT_INCR(arcstat_l2_size, -hdr->b_size); ARCSTAT_INCR(arcstat_l2_asize, -l2hdr->b_asize); vdev_space_update(l2hdr->b_dev->l2ad_vdev, @@ -3678,6 +3706,7 @@ arc_release(arc_buf_t *buf, void *tag) l2hdr = hdr->b_l2hdr; if (l2hdr) { mutex_enter(&l2arc_buflist_mtx); + arc_buf_l2_cdata_free(hdr); hdr->b_l2hdr = NULL; list_remove(l2hdr->b_dev->l2ad_buflist, hdr); } @@ -4967,6 +4996,11 @@ top: ARCSTAT_INCR(arcstat_l2_asize, -abl2->b_asize); bytes_evicted += abl2->b_asize; ab->b_l2hdr = NULL; + /* + * We are destroying l2hdr, so ensure that + * its compressed buffer, if any, is not leaked. + */ + ASSERT(abl2->b_tmp_cdata == NULL); kmem_free(abl2, sizeof (l2arc_buf_hdr_t)); ARCSTAT_INCR(arcstat_l2_size, -ab->b_size); } @@ -5205,6 +5239,14 @@ l2arc_write_buffers(spa_t *spa, l2arc_de buf_data = l2hdr->b_tmp_cdata; buf_sz = l2hdr->b_asize; + /* + * If the data has not been compressed, then clear b_tmp_cdata + * to make sure that it points only to a temporary compression + * buffer. + */ + if (!L2ARC_IS_VALID_COMPRESS(l2hdr->b_compress)) + l2hdr->b_tmp_cdata = NULL; + /* Compression may have squashed the buffer to zero length. */ if (buf_sz != 0) { uint64_t buf_p_sz; @@ -5395,15 +5437,18 @@ l2arc_release_cdata_buf(arc_buf_hdr_t *a { l2arc_buf_hdr_t *l2hdr = ab->b_l2hdr; - if (l2hdr->b_compress == ZIO_COMPRESS_LZ4) { + ASSERT(L2ARC_IS_VALID_COMPRESS(l2hdr->b_compress)); + if (l2hdr->b_compress != ZIO_COMPRESS_EMPTY) { /* * If the data was compressed, then we've allocated a * temporary buffer for it, so now we need to release it. */ ASSERT(l2hdr->b_tmp_cdata != NULL); zio_data_buf_free(l2hdr->b_tmp_cdata, ab->b_size); + l2hdr->b_tmp_cdata = NULL; + } else { + ASSERT(l2hdr->b_tmp_cdata == NULL); } - l2hdr->b_tmp_cdata = NULL; } /* From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 07:23:28 2014 Return-Path: Delivered-To: svn-src-all@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 B20728F0; Fri, 5 Dec 2014 07:23:28 +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 9D926D97; Fri, 5 Dec 2014 07:23:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB57NSmY037504; Fri, 5 Dec 2014 07:23:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB57NP66037487; Fri, 5 Dec 2014 07:23:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412050723.sB57NP66037487@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 07:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275493 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 07:23:28 -0000 Author: mav Date: Fri Dec 5 07:23:25 2014 New Revision: 275493 URL: https://svnweb.freebsd.org/changeset/base/275493 Log: MFC r274785: Partially reconstruct Active/Standby clusting. In this mode one head is in Active state, supporting all commands, while another is in Standby state, supporting only minimal LUN discovery subset. It is still incomplete since Standby state requires reservation support, which is impossible to do right without having interlink between heads. But it allows to run some basic experiments. Modified: stable/10/sys/cam/ctl/ctl.c stable/10/sys/cam/ctl/ctl_cmd_table.c stable/10/sys/cam/ctl/ctl_frontend.c stable/10/sys/cam/ctl/ctl_frontend.h stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c stable/10/sys/cam/ctl/ctl_frontend_internal.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_ha.h stable/10/sys/cam/ctl/ctl_private.h stable/10/sys/cam/ctl/ctl_tpc_local.c stable/10/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl.c ============================================================================== --- stable/10/sys/cam/ctl/ctl.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl.c Fri Dec 5 07:23:25 2014 (r275493) @@ -357,7 +357,6 @@ static struct ctl_logical_block_provisio static int rcv_sync_msg; static int persis_offset; static uint8_t ctl_pause_rtr; -static int ctl_is_single = 1; SYSCTL_NODE(_kern_cam, OID_AUTO, ctl, CTLFLAG_RD, 0, "CAM Target Layer"); static int worker_threads = -1; @@ -972,12 +971,42 @@ ctl_copy_sense_data(union ctl_ha_msg *sr } 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; + + if (softc->flags & CTL_FLAG_ACTIVE_SHELF) + value = 0; + else + value = 1; + + error = sysctl_handle_int(oidp, &value, 0, req); + if ((error != 0) || (req->newptr == NULL)) + return (error); + + mtx_lock(&softc->ctl_lock); + if (value == 0) + softc->flags |= CTL_FLAG_ACTIVE_SHELF; + else + 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; + mtx_unlock(&lun->lun_lock); + } + mtx_unlock(&softc->ctl_lock); + return (0); +} + +static int ctl_init(void) { struct ctl_softc *softc; struct ctl_io_pool *internal_pool, *emergency_pool, *other_pool; struct ctl_port *port; - uint8_t sc_id =0; int i, error, retval; //int isc_retval; @@ -1035,16 +1064,17 @@ ctl_init(void) * In Copan's HA scheme, the "master" and "slave" roles are * figured out through the slot the controller is in. Although it * is an active/active system, someone has to be in charge. - */ -#ifdef NEEDTOPORT - scmicro_rw(SCMICRO_GET_SHELF_ID, &sc_id); -#endif - - if (sc_id == 0) { - softc->flags |= CTL_FLAG_MASTER_SHELF; - persis_offset = 0; + */ + SYSCTL_ADD_INT(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "ha_id", CTLFLAG_RDTUN, &softc->ha_id, 0, + "HA head ID (0 - no HA)"); + if (softc->ha_id == 0) { + softc->flags |= CTL_FLAG_ACTIVE_SHELF; + softc->is_single = 1; + softc->port_offset = 0; } else - persis_offset = CTL_MAX_INITIATORS; + softc->port_offset = (softc->ha_id - 1) * CTL_MAX_PORTS; + persis_offset = softc->port_offset * CTL_MAX_INIT_PER_PORT; /* * XXX KDM need to figure out where we want to get our target ID @@ -1157,12 +1187,15 @@ ctl_init(void) port->max_targets = 15; port->max_target_id = 15; - if (ctl_port_register(&softc->ioctl_info.port, - (softc->flags & CTL_FLAG_MASTER_SHELF)) != 0) { + if (ctl_port_register(&softc->ioctl_info.port) != 0) { printf("ctl: ioctl front end registration failed, will " "continue anyway\n"); } + SYSCTL_ADD_PROC(&softc->sysctl_ctx,SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "ha_state", CTLTYPE_INT | CTLFLAG_RWTUN, + softc, 0, ctl_ha_state_sysctl, "I", "HA state for this head"); + #ifdef CTL_IO_DELAY if (sizeof(struct callout) > CTL_TIMER_BYTES) { printf("sizeof(struct callout) %zd > CTL_TIMER_BYTES %zd\n", @@ -1264,10 +1297,10 @@ ctl_close(struct cdev *dev, int flags, i int ctl_port_enable(ctl_port_type port_type) { - struct ctl_softc *softc; + struct ctl_softc *softc = control_softc; struct ctl_port *port; - if (ctl_is_single == 0) { + if (softc->is_single == 0) { union ctl_ha_msg msg_info; int isc_retval; @@ -1292,8 +1325,6 @@ ctl_port_enable(ctl_port_type port_type) #endif } - softc = control_softc; - STAILQ_FOREACH(port, &softc->port_list, links) { if (port_type & port->port_type) { @@ -7439,8 +7470,8 @@ ctl_report_tagret_port_groups(struct ctl { struct scsi_maintenance_in *cdb; int retval; - int alloc_len, ext, total_len = 0, g, p, pc, pg; - int num_target_port_groups, num_target_ports, single; + int alloc_len, ext, total_len = 0, g, p, pc, pg, gs, os; + int num_target_port_groups, num_target_ports; struct ctl_lun *lun; struct ctl_softc *softc; struct ctl_port *port; @@ -7474,8 +7505,7 @@ ctl_report_tagret_port_groups(struct ctl return(retval); } - single = ctl_is_single; - if (single) + if (softc->is_single) num_target_port_groups = 1; else num_target_port_groups = NUM_TARGET_PORT_GROUPS; @@ -7531,18 +7561,26 @@ ctl_report_tagret_port_groups(struct ctl tpg_desc = &rtg_ptr->groups[0]; } - pg = ctsio->io_hdr.nexus.targ_port / CTL_MAX_PORTS; mtx_lock(&softc->ctl_lock); + pg = softc->port_offset / CTL_MAX_PORTS; + if (softc->flags & CTL_FLAG_ACTIVE_SHELF) { + if (softc->ha_mode == CTL_HA_MODE_ACT_STBY) { + gs = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + os = TPG_ASYMMETRIC_ACCESS_STANDBY; + } else if (lun->flags & CTL_LUN_PRIMARY_SC) { + gs = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + os = TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; + } else { + gs = TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; + os = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + } + } else { + gs = TPG_ASYMMETRIC_ACCESS_STANDBY; + os = TPG_ASYMMETRIC_ACCESS_OPTIMIZED; + } for (g = 0; g < num_target_port_groups; g++) { - if (g == pg) - tpg_desc->pref_state = TPG_PRIMARY | - TPG_ASYMMETRIC_ACCESS_OPTIMIZED; - else - tpg_desc->pref_state = - TPG_ASYMMETRIC_ACCESS_NONOPTIMIZED; - tpg_desc->support = TPG_AO_SUP; - if (!single) - tpg_desc->support |= TPG_AN_SUP; + tpg_desc->pref_state = (g == pg) ? gs : os; + tpg_desc->support = TPG_AO_SUP | TPG_AN_SUP | TPG_S_SUP; scsi_ulto2b(g + 1, tpg_desc->target_port_group); tpg_desc->status = TPG_IMPLICIT; pc = 0; @@ -10181,12 +10219,11 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s struct ctl_lun *lun; struct ctl_port *port; int data_len, num_target_ports, iid_len, id_len, g, pg, p; - int num_target_port_groups, single; + int num_target_port_groups; lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - single = ctl_is_single; - if (single) + if (softc->is_single) num_target_port_groups = 1; else num_target_port_groups = NUM_TARGET_PORT_GROUPS; @@ -10246,10 +10283,7 @@ ctl_inquiry_evpd_scsi_ports(struct ctl_s pd = &sp->design[0]; mtx_lock(&softc->ctl_lock); - if (softc->flags & CTL_FLAG_MASTER_SHELF) - pg = 0; - else - pg = 1; + pg = softc->port_offset / CTL_MAX_PORTS; for (g = 0; g < num_target_port_groups; g++) { STAILQ_FOREACH(port, &softc->port_list, links) { if ((port->status & CTL_PORT_STATUS_ONLINE) == 0) @@ -11329,15 +11363,12 @@ ctl_scsiio_lun_check(struct ctl_softc *c * If this shelf is a secondary shelf controller, we have to reject * any media access commands. */ -#if 0 - /* No longer needed for HA */ - if (((ctl_softc->flags & CTL_FLAG_MASTER_SHELF) == 0) - && ((entry->flags & CTL_CMD_FLAG_OK_ON_SECONDARY) == 0)) { + if ((ctl_softc->flags & CTL_FLAG_ACTIVE_SHELF) == 0 && + (entry->flags & CTL_CMD_FLAG_OK_ON_SECONDARY) == 0) { ctl_set_lun_standby(ctsio); retval = 1; goto bailout; } -#endif if (entry->pattern & CTL_LUN_PAT_WRITE) { if (lun->flags & CTL_LUN_READONLY) { @@ -14392,7 +14423,7 @@ ctl_isc_start(struct ctl_ha_component *c // UNKNOWN->HA or UNKNOWN->SINGLE (bootstrap) if (c->state == CTL_HA_STATE_UNKNOWN ) { - ctl_is_single = 0; + control_softc->is_single = 0; if (ctl_ha_msg_create(CTL_HA_CHAN_CTL, ctl_isc_event_handler) != CTL_HA_STATUS_SUCCESS) { printf("ctl_isc_start: ctl_ha_msg_create failed.\n"); @@ -14402,14 +14433,14 @@ ctl_isc_start(struct ctl_ha_component *c && CTL_HA_STATE_IS_SINGLE(state)){ // HA->SINGLE transition ctl_failover(); - ctl_is_single = 1; + control_softc->is_single = 1; } else { printf("ctl_isc_start:Invalid state transition %X->%X\n", c->state, state); ret = CTL_HA_COMP_STATUS_ERROR; } if (CTL_HA_STATE_IS_SINGLE(state)) - ctl_is_single = 1; + control_softc->is_single = 1; c->state = state; c->status = ret; Modified: stable/10/sys/cam/ctl/ctl_cmd_table.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_cmd_table.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_cmd_table.c Fri Dec 5 07:23:25 2014 (r275493) @@ -800,12 +800,18 @@ const struct ctl_cmd_entry ctl_cmd_table /* 3B WRITE BUFFER */ {ctl_write_buffer, CTL_SERIDX_MD_SEL, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_FLAG_DATA_OUT, CTL_LUN_PAT_NONE, 10, {0x1f, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07}}, /* 3C READ BUFFER */ {ctl_read_buffer, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_BOTH | + CTL_CMD_FLAG_OK_ON_STOPPED | + CTL_CMD_FLAG_OK_ON_INOPERABLE | + CTL_CMD_FLAG_OK_ON_OFFLINE | CTL_FLAG_DATA_IN | CTL_CMD_FLAG_ALLOW_ON_PR_WRESV, CTL_LUN_PAT_NONE, Modified: stable/10/sys/cam/ctl/ctl_frontend.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_frontend.c Fri Dec 5 07:23:25 2014 (r275493) @@ -136,7 +136,7 @@ ctl_frontend_find(char *frontend_name) } int -ctl_port_register(struct ctl_port *port, int master_shelf) +ctl_port_register(struct ctl_port *port) { struct ctl_io_pool *pool; int port_num; @@ -193,7 +193,7 @@ error: STAILQ_INIT(&port->options); mtx_lock(&control_softc->ctl_lock); - port->targ_port = port_num + (master_shelf != 0 ? 0 : CTL_MAX_PORTS); + port->targ_port = port_num + control_softc->port_offset; STAILQ_INSERT_TAIL(&port->frontend->port_list, port, fe_links); STAILQ_INSERT_TAIL(&control_softc->port_list, port, links); control_softc->ctl_ports[port_num] = port; Modified: stable/10/sys/cam/ctl/ctl_frontend.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend.h Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_frontend.h Fri Dec 5 07:23:25 2014 (r275493) @@ -278,7 +278,7 @@ struct ctl_frontend * ctl_frontend_find( * This may block until resources are allocated. Called at FETD module load * time. Returns 0 for success, non-zero for failure. */ -int ctl_port_register(struct ctl_port *port, int master_SC); +int ctl_port_register(struct ctl_port *port); /* * Called at FETD module unload time. Modified: stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_frontend_cam_sim.c Fri Dec 5 07:23:25 2014 (r275493) @@ -164,7 +164,7 @@ cfcs_init(void) port->max_targets = 1; port->max_target_id = 15; - retval = ctl_port_register(port, /*master_SC*/ 1); + retval = ctl_port_register(port); if (retval != 0) { printf("%s: ctl_port_register() failed with error %d!\n", __func__, retval); Modified: stable/10/sys/cam/ctl/ctl_frontend_internal.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_internal.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_frontend_internal.c Fri Dec 5 07:23:25 2014 (r275493) @@ -244,8 +244,6 @@ cfi_init(void) memset(softc, 0, sizeof(*softc)); mtx_init(&softc->lock, "CTL frontend mutex", NULL, MTX_DEF); - softc->flags |= CTL_FLAG_MASTER_SHELF; - STAILQ_INIT(&softc->lun_list); STAILQ_INIT(&softc->metatask_list); sprintf(softc->fe_name, "kernel"); @@ -264,7 +262,7 @@ cfi_init(void) port->max_targets = 15; port->max_target_id = 15; - if (ctl_port_register(port, (softc->flags & CTL_FLAG_MASTER_SHELF)) != 0) + if (ctl_port_register(port) != 0) { printf("%s: internal frontend registration failed\n", __func__); return (0); Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Dec 5 07:23:25 2014 (r275493) @@ -2054,7 +2054,7 @@ cfiscsi_ioctl_port_create(struct ctl_req desc->length = idlen; strlcpy(desc->identifier, target, idlen); - retval = ctl_port_register(port, /*master_SC*/ 1); + retval = ctl_port_register(port); if (retval != 0) { ctl_free_opts(&port->options); cfiscsi_target_release(ct); Modified: stable/10/sys/cam/ctl/ctl_ha.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_ha.h Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_ha.h Fri Dec 5 07:23:25 2014 (r275493) @@ -38,6 +38,8 @@ /* * CTL High Availability Modes: * + * CTL_HA_MODE_ACT_STBY: One side is in Active state and processing commands, + * the other side is in Standby state, returning errors. * CTL_HA_MODE_SER_ONLY: Commands are serialized to the other side. Write * mirroring and read re-direction are assumed to * happen in the back end. @@ -46,6 +48,7 @@ */ typedef enum { + CTL_HA_MODE_ACT_STBY, CTL_HA_MODE_SER_ONLY, CTL_HA_MODE_XFER } ctl_ha_mode; Modified: stable/10/sys/cam/ctl/ctl_private.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_private.h Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_private.h Fri Dec 5 07:23:25 2014 (r275493) @@ -442,7 +442,7 @@ struct ctl_lun { typedef enum { CTL_FLAG_REAL_SYNC = 0x02, - CTL_FLAG_MASTER_SHELF = 0x04 + CTL_FLAG_ACTIVE_SHELF = 0x04 } ctl_gen_flags; #define CTL_MAX_THREADS 16 @@ -467,6 +467,10 @@ struct ctl_softc { int num_luns; ctl_gen_flags flags; ctl_ha_mode ha_mode; + int ha_id; + int ha_state; + int is_single; + int port_offset; int inquiry_pq_no_lun; struct sysctl_ctx_list sysctl_ctx; struct sysctl_oid *sysctl_tree; Modified: stable/10/sys/cam/ctl/ctl_tpc_local.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_tpc_local.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/ctl_tpc_local.c Fri Dec 5 07:23:25 2014 (r275493) @@ -87,7 +87,6 @@ CTL_FRONTEND_DECLARE(ctltpc, tpcl_fronte static int tpcl_init(void) { - struct ctl_softc *softc = control_softc; struct tpcl_softc *tsoftc = &tpcl_softc; struct ctl_port *port; struct scsi_transportid_spi *tid; @@ -112,7 +111,7 @@ tpcl_init(void) port->max_target_id = 0; port->max_initiators = 1; - if (ctl_port_register(port, (softc->flags & CTL_FLAG_MASTER_SHELF)) != 0) + if (ctl_port_register(port) != 0) { printf("%s: tpc frontend registration failed\n", __func__); return (0); Modified: stable/10/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/10/sys/cam/ctl/scsi_ctl.c Fri Dec 5 00:32:33 2014 (r275492) +++ stable/10/sys/cam/ctl/scsi_ctl.c Fri Dec 5 07:23:25 2014 (r275493) @@ -425,7 +425,7 @@ ctlfeasync(void *callback_arg, uint32_t printf("%s: calling ctl_port_register() for %s%d\n", __func__, cpi->dev_name, cpi->unit_number); #endif - retval = ctl_port_register(port, /*master_SC*/ 1); + retval = ctl_port_register(port); if (retval != 0) { printf("%s: ctl_port_register() failed with " "error %d!\n", __func__, retval); From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 07:24:18 2014 Return-Path: Delivered-To: svn-src-all@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 6952BA31; Fri, 5 Dec 2014 07:24: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 4AE60DA7; Fri, 5 Dec 2014 07:24: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 sB57OI83037683; Fri, 5 Dec 2014 07:24:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB57OILB037682; Fri, 5 Dec 2014 07:24:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412050724.sB57OILB037682@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 07:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275494 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 07:24:18 -0000 Author: mav Date: Fri Dec 5 07:24:17 2014 New Revision: 275494 URL: https://svnweb.freebsd.org/changeset/base/275494 Log: MFC r274795: Close race between cfiscsi_offline() and new connection arrival. Incoming connection should be either rejected or accepted and terminated. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Dec 5 07:23:25 2014 (r275493) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Dec 5 07:24:17 2014 (r275494) @@ -1064,6 +1064,8 @@ cfiscsi_session_terminate_tasks(struct c union ctl_io *io; int error, last, wait; + if (cs->cs_target == NULL) + return; /* No target yet, so nothing to do. */ io = ctl_alloc_io(cs->cs_target->ct_port.ctl_pool_ref); if (io == NULL) { CFISCSI_SESSION_WARN(cs, "can't allocate ctl_io"); @@ -1247,11 +1249,7 @@ cfiscsi_session_new(struct cfiscsi_softc } mtx_lock(&softc->lock); - cs->cs_id = softc->last_session_id + 1; - softc->last_session_id++; - mtx_unlock(&softc->lock); - - mtx_lock(&softc->lock); + cs->cs_id = ++softc->last_session_id; TAILQ_INSERT_TAIL(&softc->sessions, cs, cs_next); mtx_unlock(&softc->lock); @@ -1429,14 +1427,6 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * return; } - if (ct->ct_online == 0) { - ci->status = CTL_ISCSI_ERROR; - snprintf(ci->error_str, sizeof(ci->error_str), - "%s: port offline", __func__); - cfiscsi_target_release(ct); - return; - } - #ifdef ICL_KERNEL_PROXY if (cihp->socket > 0 && cihp->connection_id > 0) { snprintf(ci->error_str, sizeof(ci->error_str), @@ -1448,7 +1438,7 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * if (cihp->socket == 0) { mtx_lock(&cfiscsi_softc.lock); TAILQ_FOREACH(cs, &cfiscsi_softc.sessions, cs_next) { - if (cs->cs_id == cihp->socket) + if (cs->cs_id == cihp->connection_id) break; } if (cs == NULL) { @@ -1473,7 +1463,6 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * #ifdef ICL_KERNEL_PROXY } #endif - cs->cs_target = ct; /* * First PDU of Full Feature phase has the same CmdSN as the last @@ -1505,6 +1494,19 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi * cihp->initiator_isid[2], cihp->initiator_isid[3], cihp->initiator_isid[4], cihp->initiator_isid[5]); + mtx_lock(&softc->lock); + if (ct->ct_online == 0) { + mtx_unlock(&softc->lock); + cfiscsi_session_terminate(cs); + cfiscsi_target_release(ct); + ci->status = CTL_ISCSI_ERROR; + snprintf(ci->error_str, sizeof(ci->error_str), + "%s: port offline", __func__); + return; + } + cs->cs_target = ct; + mtx_unlock(&softc->lock); + refcount_acquire(&cs->cs_outstanding_ctl_pdus); restart: if (!cs->cs_terminating) { From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 07:25:03 2014 Return-Path: Delivered-To: svn-src-all@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 D01FFB66; Fri, 5 Dec 2014 07:25:03 +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 A2E7FDB1; Fri, 5 Dec 2014 07:25:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB57P3ka037870; Fri, 5 Dec 2014 07:25:03 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB57P33k037867; Fri, 5 Dec 2014 07:25:03 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412050725.sB57P33k037867@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 07:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275495 - stable/10/sys/cam/ctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 07:25:03 -0000 Author: mav Date: Fri Dec 5 07:25:02 2014 New Revision: 275495 URL: https://svnweb.freebsd.org/changeset/base/275495 Log: MFC r274805: Make cfiscsi_offline() synchronous, waiting for connections termination before return. This should make ctld restart more clean and predictable. Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Dec 5 07:24:17 2014 (r275494) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.c Fri Dec 5 07:25:02 2014 (r275495) @@ -1282,6 +1282,7 @@ cfiscsi_session_delete(struct cfiscsi_se mtx_lock(&softc->lock); TAILQ_REMOVE(&softc->sessions, cs, cs_next); + cv_signal(&softc->sessions_cv); mtx_unlock(&softc->lock); free(cs, M_CFISCSI); @@ -1298,6 +1299,7 @@ cfiscsi_init(void) bzero(softc, sizeof(*softc)); mtx_init(&softc->lock, "cfiscsi", NULL, MTX_DEF); + cv_init(&softc->sessions_cv, "cfiscsi_sessions"); #ifdef ICL_KERNEL_PROXY cv_init(&softc->accept_cv, "cfiscsi_accept"); #endif @@ -1382,6 +1384,14 @@ cfiscsi_offline(void *arg) if (cs->cs_target == ct) cfiscsi_session_terminate(cs); } + do { + TAILQ_FOREACH(cs, &softc->sessions, cs_next) { + if (cs->cs_target == ct) + break; + } + if (cs != NULL) + cv_wait(&softc->sessions_cv, &softc->lock); + } while (cs != NULL && ct->ct_online == 0); mtx_unlock(&softc->lock); if (online > 0) return; Modified: stable/10/sys/cam/ctl/ctl_frontend_iscsi.h ============================================================================== --- stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Fri Dec 5 07:24:17 2014 (r275494) +++ stable/10/sys/cam/ctl/ctl_frontend_iscsi.h Fri Dec 5 07:25:02 2014 (r275495) @@ -115,6 +115,7 @@ struct cfiscsi_softc { unsigned int last_session_id; TAILQ_HEAD(, cfiscsi_target) targets; TAILQ_HEAD(, cfiscsi_session) sessions; + struct cv sessions_cv; #ifdef ICL_KERNEL_PROXY struct icl_listen *listener; struct cv accept_cv; From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 07:29:32 2014 Return-Path: Delivered-To: svn-src-all@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 9BD23CEE; Fri, 5 Dec 2014 07:29:32 +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 8809CDDB; Fri, 5 Dec 2014 07:29:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB57TW1q038669; Fri, 5 Dec 2014 07:29:32 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB57TWPP038668; Fri, 5 Dec 2014 07:29:32 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412050729.sB57TWPP038668@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 07:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275496 - stable/10/usr.sbin/ctld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 07:29:32 -0000 Author: mav Date: Fri Dec 5 07:29:31 2014 New Revision: 275496 URL: https://svnweb.freebsd.org/changeset/base/275496 Log: MFC r274248: Remove unused assignments, noticed by Clang analyzer. Modified: stable/10/usr.sbin/ctld/ctld.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ctld/ctld.c ============================================================================== --- stable/10/usr.sbin/ctld/ctld.c Fri Dec 5 07:25:02 2014 (r275495) +++ stable/10/usr.sbin/ctld/ctld.c Fri Dec 5 07:29:31 2014 (r275496) @@ -896,7 +896,7 @@ void isns_register(struct isns *isns, struct isns *oldisns) { struct conf *conf = isns->i_conf; - int s, res; + int s; char hostname[256]; if (TAILQ_EMPTY(&conf->conf_targets) || @@ -912,8 +912,8 @@ isns_register(struct isns *isns, struct if (oldisns == NULL || TAILQ_EMPTY(&oldisns->i_conf->conf_targets)) oldisns = isns; - res = isns_do_deregister(oldisns, s, hostname); - res = isns_do_register(isns, s, hostname); + isns_do_deregister(oldisns, s, hostname); + isns_do_register(isns, s, hostname); close(s); set_timeout(0, false); } @@ -938,8 +938,8 @@ isns_check(struct isns *isns) res = isns_do_check(isns, s, hostname); if (res < 0) { - res = isns_do_deregister(isns, s, hostname); - res = isns_do_register(isns, s, hostname); + isns_do_deregister(isns, s, hostname); + isns_do_register(isns, s, hostname); } close(s); set_timeout(0, false); @@ -949,7 +949,7 @@ void isns_deregister(struct isns *isns) { struct conf *conf = isns->i_conf; - int s, res; + int s; char hostname[256]; if (TAILQ_EMPTY(&conf->conf_targets) || @@ -961,7 +961,7 @@ isns_deregister(struct isns *isns) return; gethostname(hostname, sizeof(hostname)); - res = isns_do_deregister(isns, s, hostname); + isns_do_deregister(isns, s, hostname); close(s); set_timeout(0, false); } From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 07:46:29 2014 Return-Path: Delivered-To: svn-src-all@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 51229FA8; Fri, 5 Dec 2014 07:46: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 3D815F86; Fri, 5 Dec 2014 07:46: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 sB57kTKA048191; Fri, 5 Dec 2014 07:46:29 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB57kT87048190; Fri, 5 Dec 2014 07:46:29 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412050746.sB57kT87048190@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 07:46:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275497 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 07:46:29 -0000 Author: mav Date: Fri Dec 5 07:46:28 2014 New Revision: 275497 URL: https://svnweb.freebsd.org/changeset/base/275497 Log: MFC r268395: Pass correct command that should be aborted to ISPCTL_ABORT_CMD. This makes XPT_ABORT to work for me on initiator side of isp(4). Previous code was trying to abort the XPT_ABORT itself and failed. Modified: stable/10/sys/dev/isp/isp_freebsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_freebsd.c ============================================================================== --- stable/10/sys/dev/isp/isp_freebsd.c Fri Dec 5 07:29:31 2014 (r275496) +++ stable/10/sys/dev/isp/isp_freebsd.c Fri Dec 5 07:46:28 2014 (r275497) @@ -5107,7 +5107,7 @@ isp_action(struct cam_sim *sim, union cc break; #endif case XPT_SCSI_IO: - error = isp_control(isp, ISPCTL_ABORT_CMD, ccb); + error = isp_control(isp, ISPCTL_ABORT_CMD, accb); if (error) { ccb->ccb_h.status = CAM_UA_ABORT; } else { From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 07:48:23 2014 Return-Path: Delivered-To: svn-src-all@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 09F79178; Fri, 5 Dec 2014 07: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 EAC38F92; Fri, 5 Dec 2014 07: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 sB57mMWE048571; Fri, 5 Dec 2014 07:48:22 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB57mMKJ048570; Fri, 5 Dec 2014 07:48:22 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412050748.sB57mMKJ048570@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 07:48:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275498 - stable/10/sys/dev/isp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 07:48:23 -0000 Author: mav Date: Fri Dec 5 07:48:22 2014 New Revision: 275498 URL: https://svnweb.freebsd.org/changeset/base/275498 Log: MFC r272937: Fix r272936 build with old GCC. Modified: stable/10/sys/dev/isp/isp_library.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/isp/isp_library.c ============================================================================== --- stable/10/sys/dev/isp/isp_library.c Fri Dec 5 07:46:28 2014 (r275497) +++ stable/10/sys/dev/isp/isp_library.c Fri Dec 5 07:48:22 2014 (r275498) @@ -2472,7 +2472,8 @@ isp_add_wwn_entry(ispsoftc_t *isp, int c lp = NULL; if (fcp->isp_tgt_map[nphdl]) { - lp = &fcp->portdb[fcp->isp_tgt_map[nphdl] - 1]; + i = fcp->isp_tgt_map[nphdl] - 1; + lp = &fcp->portdb[i]; } else { /* * Make sure the addition of a new target mode entry doesn't duplicate entries From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 07:51:51 2014 Return-Path: Delivered-To: svn-src-all@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 AF9684AD; Fri, 5 Dec 2014 07:51:51 +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 9BF05A6; Fri, 5 Dec 2014 07:51:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB57ppF7052716; Fri, 5 Dec 2014 07:51:51 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB57ppkS052715; Fri, 5 Dec 2014 07:51:51 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201412050751.sB57ppkS052715@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Fri, 5 Dec 2014 07:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275500 - stable/10/usr.sbin/gpioctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 07:51:51 -0000 Author: rpaulo Date: Fri Dec 5 07:51:50 2014 New Revision: 275500 URL: https://svnweb.freebsd.org/changeset/base/275500 Log: MFC r275420: gpioctl: don't print the command line arguments. PR: 195330 Submitted by: Scott Ellis jumpnowtek at gmail.com Modified: stable/10/usr.sbin/gpioctl/gpioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/gpioctl/gpioctl.c ============================================================================== --- stable/10/usr.sbin/gpioctl/gpioctl.c Fri Dec 5 07:48:25 2014 (r275499) +++ stable/10/usr.sbin/gpioctl/gpioctl.c Fri Dec 5 07:51:50 2014 (r275500) @@ -224,9 +224,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) ctlfile = defctlfile; From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 08:46:16 2014 Return-Path: Delivered-To: svn-src-all@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 145A8141; Fri, 5 Dec 2014 08:46: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 00BEF8CB; Fri, 5 Dec 2014 08:46: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 sB58kF1C079124; Fri, 5 Dec 2014 08:46:15 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB58kFcL079123; Fri, 5 Dec 2014 08:46:15 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412050846.sB58kFcL079123@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 5 Dec 2014 08:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275501 - stable/10/tools/regression/pjdfstest X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 08:46:16 -0000 Author: ngie Date: Fri Dec 5 08:46:15 2014 New Revision: 275501 URL: https://svnweb.freebsd.org/changeset/base/275501 Log: MFC r271796 (by will): Use 'cc' for the C compiler instead of 'gcc'. Sponsored by: Spectra Logic MFSpectraBSD: 1079507 on 2014/07/24 Modified: stable/10/tools/regression/pjdfstest/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/tools/regression/pjdfstest/Makefile ============================================================================== --- stable/10/tools/regression/pjdfstest/Makefile Fri Dec 5 07:51:50 2014 (r275500) +++ stable/10/tools/regression/pjdfstest/Makefile Fri Dec 5 08:46:15 2014 (r275501) @@ -18,7 +18,7 @@ ${PROG}: ${PROG}.c echo "Unsupported operating system: ${OSTYPE}."; \ exit 1; \ fi; \ - cmd="gcc -Wall $$CFLAGS ${PROG}.c -o ${PROG}"; \ + cmd="cc -Wall $$CFLAGS ${PROG}.c -o ${PROG}"; \ echo $$cmd; \ $$cmd From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 09:30:08 2014 Return-Path: Delivered-To: svn-src-all@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 BE721ABC; Fri, 5 Dec 2014 09:30: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 AAFA1D34; Fri, 5 Dec 2014 09:30: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 sB59U8jE000559; Fri, 5 Dec 2014 09:30:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB59U8R6000558; Fri, 5 Dec 2014 09:30:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201412050930.sB59U8R6000558@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 09:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275502 - stable/10/sys/kern X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 09:30:08 -0000 Author: kib Date: Fri Dec 5 09:30:07 2014 New Revision: 275502 URL: https://svnweb.freebsd.org/changeset/base/275502 Log: MFC r275206: Assert the state of the process lock and sigact mutex in kern_sigprocmask() and reschedule_signals(). Modified: stable/10/sys/kern/kern_sig.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_sig.c ============================================================================== --- stable/10/sys/kern/kern_sig.c Fri Dec 5 08:46:15 2014 (r275501) +++ stable/10/sys/kern/kern_sig.c Fri Dec 5 09:30:07 2014 (r275502) @@ -1003,8 +1003,12 @@ kern_sigprocmask(struct thread *td, int int error; p = td->td_proc; - if (!(flags & SIGPROCMASK_PROC_LOCKED)) + if ((flags & SIGPROCMASK_PROC_LOCKED) != 0) + PROC_LOCK_ASSERT(p, MA_OWNED); + else PROC_LOCK(p); + mtx_assert(&p->p_sigacts->ps_mtx, (flags & SIGPROCMASK_PS_LOCKED) != 0 + ? MA_OWNED : MA_NOTOWNED); if (oset != NULL) *oset = td->td_sigmask; @@ -2519,9 +2523,11 @@ reschedule_signals(struct proc *p, sigse int sig; PROC_LOCK_ASSERT(p, MA_OWNED); + ps = p->p_sigacts; + mtx_assert(&ps->ps_mtx, (flags & SIGPROCMASK_PS_LOCKED) != 0 ? + MA_OWNED : MA_NOTOWNED); if (SIGISEMPTY(p->p_siglist)) return; - ps = p->p_sigacts; SIGSETAND(block, p->p_siglist); while ((sig = sig_ffs(&block)) != 0) { SIGDELSET(block, sig); From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 09:33:16 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 09:42:21 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 10:03:05 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 10:23:20 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 11:44:27 2014 Return-Path: Delivered-To: svn-src-all@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 80C78AB6; Fri, 5 Dec 2014 11:44: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 6A2AAE37; Fri, 5 Dec 2014 11:44: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 sB5BiRB9070279; Fri, 5 Dec 2014 11:44:27 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5BiJFN070239; Fri, 5 Dec 2014 11:44:19 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412051144.sB5BiJFN070239@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 5 Dec 2014 11:44:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275504 - in stable/10: . contrib/pjdfstest contrib/pjdfstest/tests/chflags contrib/pjdfstest/tests/chmod contrib/pjdfstest/tests/chown contrib/pjdfstest/tests/ftruncate contrib/pjdfste... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 11:44:27 -0000 Author: ngie Date: Fri Dec 5 11:44:18 2014 New Revision: 275504 URL: https://svnweb.freebsd.org/changeset/base/275504 Log: MFC r272057,r272083,r272084,r272087,r274016: r272057: Import pjdfstest from ^/vendor/pjdfstest/abf03c3a47745d4521b0e4aa141317553ca48f91 - Remove tools/regression/pjdfstest - Add upgrade directions for contrib/pjdfstest - Add a note to UPDATING for the move (the reachover Makefiles are coming soon) Functional differences: - ftruncate testcases are added from upstream (github) Non-functional differences: - The copyright for the project has been updated to 2012 - pjd's contact information has been updated Discussed with: -testing, jmmv, pjd Sponsored by: EMC / Isilon Storage Division r272083: Expect ELOOP on Darwin/Linux with "O_NOFOLLOW was specified and the target is a symbolic link" case. Assume EMLINK on the rest of the OSes (FreeBSD, Solaris, etc) Sponsored by: EMC / Isilon Storage Division r272084: Fix the executed testplan count Sponsored by: EMC / Isilon Storage Division r272087: Increase the memory disk size in the following testcases to avoid mount failures, which would cause cascade failures in the rest of the test run: link/15.t, open/19.t, mkdir/11.t, mkfifo/11.t, symlink/11.t Fail quickly in all of the testcases if mdconfig, mount, umount, etc fails to avoid issues similar to this in the future Submitted by: Casey Peel Sponsored by: EMC / Isilon Storage Division r274016: Integrate pjdfstest test suite execution into kyua pjdfstest execution is opt-in and must be done as root due to some of the assumptions made by the test suite and lack of error checking in the non-root case A description of how to execute pjdfstest with kyua is provided in share/pjdfstest/README Phabric: D824 (an earlier prototype patch) Relnotes: yes Sponsored by: EMC / Isilon Storage Division Added: stable/10/contrib/pjdfstest/ - copied from r272057, head/contrib/pjdfstest/ stable/10/share/doc/pjdfstest/ - copied from r274016, head/share/doc/pjdfstest/ stable/10/tests/sys/pjdfstest/ - copied from r274016, head/tests/sys/pjdfstest/ Modified: stable/10/UPDATING stable/10/contrib/pjdfstest/tests/chflags/12.t stable/10/contrib/pjdfstest/tests/chmod/09.t stable/10/contrib/pjdfstest/tests/chown/09.t stable/10/contrib/pjdfstest/tests/ftruncate/00.t stable/10/contrib/pjdfstest/tests/ftruncate/10.t stable/10/contrib/pjdfstest/tests/link/05.t stable/10/contrib/pjdfstest/tests/link/14.t stable/10/contrib/pjdfstest/tests/link/15.t stable/10/contrib/pjdfstest/tests/link/16.t stable/10/contrib/pjdfstest/tests/mkdir/09.t stable/10/contrib/pjdfstest/tests/mkdir/11.t stable/10/contrib/pjdfstest/tests/mkfifo/08.t stable/10/contrib/pjdfstest/tests/mkfifo/11.t stable/10/contrib/pjdfstest/tests/open/14.t stable/10/contrib/pjdfstest/tests/open/15.t stable/10/contrib/pjdfstest/tests/open/16.t stable/10/contrib/pjdfstest/tests/open/19.t stable/10/contrib/pjdfstest/tests/rename/15.t stable/10/contrib/pjdfstest/tests/rename/16.t stable/10/contrib/pjdfstest/tests/rmdir/13.t stable/10/contrib/pjdfstest/tests/rmdir/14.t stable/10/contrib/pjdfstest/tests/symlink/10.t stable/10/contrib/pjdfstest/tests/symlink/11.t stable/10/contrib/pjdfstest/tests/truncate/10.t stable/10/contrib/pjdfstest/tests/unlink/12.t stable/10/etc/mtree/BSD.tests.dist stable/10/share/doc/Makefile stable/10/tests/sys/Makefile stable/10/tools/build/mk/OptionalObsoleteFiles.inc Directory Properties: stable/10/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Fri Dec 5 10:23:18 2014 (r275503) +++ stable/10/UPDATING Fri Dec 5 11:44:18 2014 (r275504) @@ -16,6 +16,11 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20141205: + pjdfstest has been integrated into kyua as an opt-in test suite. + Please see share/doc/pjdfstest/README for a more details on how to + execute it. + 20141118: 10.1-RELEASE. Modified: stable/10/contrib/pjdfstest/tests/chflags/12.t ============================================================================== --- head/contrib/pjdfstest/tests/chflags/12.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/chflags/12.t Fri Dec 5 11:44:18 2014 (r275504) @@ -16,8 +16,8 @@ FreeBSD:UFS) n1=`namegen` expect 0 mkdir ${n0} 0755 - n=`mdconfig -a -n -t malloc -s 1m` - newfs /dev/md${n} >/dev/null + n=`mdconfig -a -n -t malloc -s 1m` || exit + newfs /dev/md${n} >/dev/null || exit mount /dev/md${n} ${n0} expect 0 create ${n0}/${n1} 0644 expect 0 chflags ${n0}/${n1} UF_IMMUTABLE @@ -34,7 +34,7 @@ FreeBSD:UFS) expect none stat ${n0}/${n1} flags expect 0 unlink ${n0}/${n1} umount /dev/md${n} - mdconfig -d -u ${n} + mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} ;; FreeBSD:ZFS) @@ -43,7 +43,7 @@ FreeBSD:ZFS) n0=`namegen` n1=`namegen` - n=`mdconfig -a -n -t malloc -s 128m` + n=`mdconfig -a -n -t malloc -s 128m` || exit zpool create ${n0} /dev/md${n} expect 0 create /${n0}/${n1} 0644 expect 0 chflags /${n0}/${n1} UF_NODUMP @@ -60,7 +60,7 @@ FreeBSD:ZFS) expect none stat /${n0}/${n1} flags expect 0 unlink /${n0}/${n1} zpool destroy ${n0} - mdconfig -d -u ${n} + mdconfig -d -u ${n} || exit ;; *) quick_exit Modified: stable/10/contrib/pjdfstest/tests/chmod/09.t ============================================================================== --- head/contrib/pjdfstest/tests/chmod/09.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/chmod/09.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 chmod ${n0}/${n1} 0640 expect 0640 stat ${n0}/${n1} mode @@ -33,5 +33,5 @@ expect 0 lchmod ${n0}/${n1} 0640 expect 0640 stat ${n0}/${n1} mode expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/chown/09.t ============================================================================== --- head/contrib/pjdfstest/tests/chown/09.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/chown/09.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 chown ${n0}/${n1} 65534 65534 expect 65534,65534 stat ${n0}/${n1} uid,gid @@ -28,5 +28,5 @@ expect 0 chown ${n0}/${n1} 65533 65533 expect 65533,65533 stat ${n0}/${n1} uid,gid expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/ftruncate/00.t ============================================================================== --- head/contrib/pjdfstest/tests/ftruncate/00.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/ftruncate/00.t Fri Dec 5 11:44:18 2014 (r275504) @@ -6,7 +6,7 @@ desc="ftruncate descrease/increase file dir=`dirname $0` . ${dir}/../misc.sh -echo "1..21" +echo "1..26" n0=`namegen` n1=`namegen` Modified: stable/10/contrib/pjdfstest/tests/ftruncate/10.t ============================================================================== --- head/contrib/pjdfstest/tests/ftruncate/10.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/ftruncate/10.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 truncate ${n0}/${n1} 123 expect 123 stat ${n0}/${n1} size @@ -28,5 +28,5 @@ expect 0 truncate ${n0}/${n1} 1234 expect 1234 stat ${n0}/${n1} size expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/link/05.t ============================================================================== --- head/contrib/pjdfstest/tests/link/05.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/link/05.t Fri Dec 5 11:44:18 2014 (r275504) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs -i 1 /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs -i 1 /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 i=1 while :; do @@ -32,5 +32,5 @@ test_check $i -eq 32767 expect EMLINK link ${n0}/${n1} ${n0}/${n2} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/link/14.t ============================================================================== --- head/contrib/pjdfstest/tests/link/14.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/link/14.t Fri Dec 5 11:44:18 2014 (r275504) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect EXDEV link ${n0}/${n1} ${n2} expect 0 unlink ${n0}/${n1} @@ -25,5 +25,5 @@ expect 0 create ${n1} 0644 expect EXDEV link ${n1} ${n0}/${n2} expect 0 unlink ${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/link/15.t ============================================================================== --- head/contrib/pjdfstest/tests/link/15.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/link/15.t Fri Dec 5 11:44:18 2014 (r275504) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 i=0 while :; do @@ -29,5 +29,5 @@ while :; do done expect ENOSPC link ${n0}/${n1} ${n0}/${n2} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/link/16.t ============================================================================== --- head/contrib/pjdfstest/tests/link/16.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/link/16.t Fri Dec 5 11:44:18 2014 (r275504) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 link ${n0}/${n1} ${n0}/${n2} @@ -30,5 +30,5 @@ expect 0 unlink ${n0}/${n2} expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/mkdir/09.t ============================================================================== --- head/contrib/pjdfstest/tests/mkdir/09.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/mkdir/09.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 mkdir ${n0}/${n1} 0755 expect 0 rmdir ${n0}/${n1} mount -ur /dev/md${n} @@ -25,5 +25,5 @@ mount -uw /dev/md${n} expect 0 mkdir ${n0}/${n1} 0755 expect 0 rmdir ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/mkdir/11.t ============================================================================== --- head/contrib/pjdfstest/tests/mkdir/11.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/mkdir/11.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit i=0 while :; do mkdir ${n0}/${i} >/dev/null 2>&1 @@ -27,5 +27,5 @@ while :; do done expect ENOSPC mkdir ${n0}/${n1} 0755 umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/mkfifo/08.t ============================================================================== --- head/contrib/pjdfstest/tests/mkfifo/08.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/mkfifo/08.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 mkfifo ${n0}/${n1} 0644 expect 0 unlink ${n0}/${n1} mount -ur /dev/md${n} @@ -25,5 +25,5 @@ mount -uw /dev/md${n} expect 0 mkfifo ${n0}/${n1} 0644 expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/mkfifo/11.t ============================================================================== --- head/contrib/pjdfstest/tests/mkfifo/11.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/mkfifo/11.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit i=0 while :; do mkfifo ${n0}/${i} >/dev/null 2>&1 @@ -27,5 +27,5 @@ while :; do done expect ENOSPC mkfifo ${n0}/${n1} 0644 umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/open/14.t ============================================================================== --- head/contrib/pjdfstest/tests/open/14.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/open/14.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 open ${n0}/${n1} O_WRONLY expect 0 open ${n0}/${n1} O_RDWR @@ -28,5 +28,5 @@ expect EROFS open ${n0}/${n1} O_RDONLY,O mount -uw /dev/md${n} expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/open/15.t ============================================================================== --- head/contrib/pjdfstest/tests/open/15.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/open/15.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,14 +14,14 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 open ${n0}/${n1} O_RDONLY,O_CREAT 0644 expect 0 unlink ${n0}/${n1} mount -ur /dev/md${n} expect EROFS open ${n0}/${n1} O_RDONLY,O_CREAT 0644 mount -uw /dev/md${n} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/open/16.t ============================================================================== --- head/contrib/pjdfstest/tests/open/16.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/open/16.t Fri Dec 5 11:44:18 2014 (r275504) @@ -1,19 +1,27 @@ #!/bin/sh # $FreeBSD: head/tools/regression/pjdfstest/tests/open/16.t 219621 2011-03-13 19:35:13Z pjd $ -desc="open returns ELOOP when O_NOFOLLOW was specified and the target is a symbolic link" - dir=`dirname $0` . ${dir}/../misc.sh +case "${os}" in +Darwin|Linux) + error=ELOOP + ;; +*) + error=EMLINK + ;; +esac +desc="open returns $error when O_NOFOLLOW was specified and the target is a symbolic link" + echo "1..6" n0=`namegen` n1=`namegen` expect 0 symlink ${n0} ${n1} -expect ELOOP open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644 -expect ELOOP open ${n1} O_RDONLY,O_NOFOLLOW -expect ELOOP open ${n1} O_WRONLY,O_NOFOLLOW -expect ELOOP open ${n1} O_RDWR,O_NOFOLLOW +expect $error open ${n1} O_RDONLY,O_CREAT,O_NOFOLLOW 0644 +expect $error open ${n1} O_RDONLY,O_NOFOLLOW +expect $error open ${n1} O_WRONLY,O_NOFOLLOW +expect $error open ${n1} O_RDWR,O_NOFOLLOW expect 0 unlink ${n1} Modified: stable/10/contrib/pjdfstest/tests/open/19.t ============================================================================== --- head/contrib/pjdfstest/tests/open/19.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/open/19.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit i=0 while :; do touch ${n0}/${i} >/dev/null 2>&1 @@ -27,5 +27,5 @@ while :; do done expect ENOSPC open ${n0}/${i} O_RDONLY,O_CREAT 0644 umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/rename/15.t ============================================================================== --- head/contrib/pjdfstest/tests/rename/15.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/rename/15.t Fri Dec 5 11:44:18 2014 (r275504) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit for type in regular dir fifo block char socket symlink; do create_file ${type} ${n0}/${n1} @@ -30,5 +30,5 @@ for type in regular dir fifo block char done umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/rename/16.t ============================================================================== --- head/contrib/pjdfstest/tests/rename/16.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/rename/16.t Fri Dec 5 11:44:18 2014 (r275504) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 mount -ur /dev/md${n} @@ -28,5 +28,5 @@ expect EROFS rename ${n2} ${n0}/${n2} expect 0 unlink ${n2} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/rmdir/13.t ============================================================================== --- head/contrib/pjdfstest/tests/rmdir/13.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/rmdir/13.t Fri Dec 5 11:44:18 2014 (r275504) @@ -13,10 +13,10 @@ echo "1..3" n0=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect EBUSY rmdir ${n0} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/rmdir/14.t ============================================================================== --- head/contrib/pjdfstest/tests/rmdir/14.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/rmdir/14.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,14 +14,14 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 mkdir ${n0}/${n1} 0755 mount -ur /dev/md${n} expect EROFS rmdir ${n0}/${n1} mount -uw /dev/md${n} expect 0 rmdir ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/symlink/10.t ============================================================================== --- head/contrib/pjdfstest/tests/symlink/10.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/symlink/10.t Fri Dec 5 11:44:18 2014 (r275504) @@ -15,9 +15,9 @@ n1=`namegen` n2=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 symlink test ${n0}/${n1} expect 0 unlink ${n0}/${n1} @@ -28,5 +28,5 @@ expect 0 symlink test ${n0}/${n1} expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/symlink/11.t ============================================================================== --- head/contrib/pjdfstest/tests/symlink/11.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/symlink/11.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 256k` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 512k` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit i=0 while :; do ln -s test ${n0}/${i} >/dev/null 2>&1 @@ -27,5 +27,5 @@ while :; do done expect ENOSPC symlink test ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/truncate/10.t ============================================================================== --- head/contrib/pjdfstest/tests/truncate/10.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/truncate/10.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,9 +14,9 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 expect 0 truncate ${n0}/${n1} 123 expect 123 stat ${n0}/${n1} size @@ -28,5 +28,5 @@ expect 0 truncate ${n0}/${n1} 1234 expect 1234 stat ${n0}/${n1} size expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/contrib/pjdfstest/tests/unlink/12.t ============================================================================== --- head/contrib/pjdfstest/tests/unlink/12.t Wed Sep 24 07:00:35 2014 (r272057) +++ stable/10/contrib/pjdfstest/tests/unlink/12.t Fri Dec 5 11:44:18 2014 (r275504) @@ -14,14 +14,14 @@ n0=`namegen` n1=`namegen` expect 0 mkdir ${n0} 0755 -n=`mdconfig -a -n -t malloc -s 1m` -newfs /dev/md${n} >/dev/null -mount /dev/md${n} ${n0} +n=`mdconfig -a -n -t malloc -s 1m` || exit +newfs /dev/md${n} >/dev/null || exit +mount /dev/md${n} ${n0} || exit expect 0 create ${n0}/${n1} 0644 mount -ur /dev/md${n} expect EROFS unlink ${n0}/${n1} mount -uw /dev/md${n} expect 0 unlink ${n0}/${n1} umount /dev/md${n} -mdconfig -d -u ${n} +mdconfig -d -u ${n} || exit expect 0 rmdir ${n0} Modified: stable/10/etc/mtree/BSD.tests.dist ============================================================================== --- stable/10/etc/mtree/BSD.tests.dist Fri Dec 5 10:23:18 2014 (r275503) +++ stable/10/etc/mtree/BSD.tests.dist Fri Dec 5 11:44:18 2014 (r275504) @@ -17,6 +17,8 @@ doc atf .. + pjdfstest + .. .. .. tests @@ -131,6 +133,38 @@ .. netinet .. + pjdfstest + chflags + .. + chmod + .. + chown + .. + ftruncate + .. + granular + .. + link + .. + mkdir + .. + mkfifo + .. + mknod + .. + open + .. + rename + .. + rmdir + .. + symlink + .. + truncate + .. + unlink + .. + .. .. usr.bin apply Modified: stable/10/share/doc/Makefile ============================================================================== --- stable/10/share/doc/Makefile Fri Dec 5 10:23:18 2014 (r275503) +++ stable/10/share/doc/Makefile Fri Dec 5 11:44:18 2014 (r275504) @@ -7,10 +7,12 @@ SUBDIR= ${_IPv6} \ ${_atf} \ legal \ ${_llvm} \ + ${_pjdfstest} \ ${_roffdocs} .if ${MK_TESTS} != "no" _atf= atf +_pjdfstest= pjdfstest .endif .if ${MK_CLANG} != "no" Modified: stable/10/tests/sys/Makefile ============================================================================== --- stable/10/tests/sys/Makefile Fri Dec 5 10:23:18 2014 (r275503) +++ stable/10/tests/sys/Makefile Fri Dec 5 11:44:18 2014 (r275504) @@ -2,8 +2,12 @@ .include +TESTSDIR= ${TESTSBASE}/sys + TESTS_SUBDIRS+= kern TESTS_SUBDIRS+= netinet -TESTSDIR= ${TESTSBASE}/sys + +# Items not integrated into kyua runs by default +SUBDIR+= pjdfstest .include Modified: stable/10/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri Dec 5 10:23:18 2014 (r275503) +++ stable/10/tools/build/mk/OptionalObsoleteFiles.inc Fri Dec 5 11:44:18 2014 (r275504) @@ -4016,9 +4016,10 @@ OLD_FILES+=usr/share/sendmail/cf/sitecon OLD_FILES+=usr/share/sendmail/cf/siteconfig/uucp.ucbvax.m4 .endif -#.if ${MK_SHAREDOCS} == no -# to be filled in -#.endif +.if ${MK_SHAREDOCS} == no +OLD_FILES+=usr/share/doc/pjdfstest/README +OLD_DIRS+=usr/share/doc/pjdfstest +.endif #.if ${MK_SYSCONS} == no # to be filled in From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 11:52:05 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 11:58:33 2014 Return-Path: Delivered-To: svn-src-all@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 396D3FCB; Fri, 5 Dec 2014 11:58: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 25D46F67; Fri, 5 Dec 2014 11:58: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 sB5BwXfN075509; Fri, 5 Dec 2014 11:58:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5BwXBj075508; Fri, 5 Dec 2014 11:58:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412051158.sB5BwXBj075508@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 5 Dec 2014 11:58:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275505 - stable/9/tools/regression/pjdfstest X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 11:58:33 -0000 Author: ngie Date: Fri Dec 5 11:58:32 2014 New Revision: 275505 URL: https://svnweb.freebsd.org/changeset/base/275505 Log: MFstable/10 r275501: MFC r271796 (by will): Use 'cc' for the C compiler instead of 'gcc'. Sponsored by: Spectra Logic MFSpectraBSD: 1079507 on 2014/07/24 Modified: stable/9/tools/regression/pjdfstest/Makefile Directory Properties: stable/9/ (props changed) stable/9/tools/ (props changed) stable/9/tools/regression/ (props changed) Modified: stable/9/tools/regression/pjdfstest/Makefile ============================================================================== --- stable/9/tools/regression/pjdfstest/Makefile Fri Dec 5 11:44:18 2014 (r275504) +++ stable/9/tools/regression/pjdfstest/Makefile Fri Dec 5 11:58:32 2014 (r275505) @@ -18,7 +18,7 @@ ${PROG}: ${PROG}.c echo "Unsupported operating system: ${OSTYPE}."; \ exit 1; \ fi; \ - cmd="gcc -Wall $$CFLAGS ${PROG}.c -o ${PROG}"; \ + cmd="cc -Wall $$CFLAGS ${PROG}.c -o ${PROG}"; \ echo $$cmd; \ $$cmd From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 12:04:48 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 12:07:54 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 12:11:14 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 12:23:32 2014 Return-Path: Delivered-To: svn-src-all@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 D98F29AE; Fri, 5 Dec 2014 12:23:32 +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 C32942E4; Fri, 5 Dec 2014 12:23:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5CNWhF089030; Fri, 5 Dec 2014 12:23:32 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5CNTfe089013; Fri, 5 Dec 2014 12:23:29 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412051223.sB5CNTfe089013@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 5 Dec 2014 12:23:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275508 - in stable/10: contrib/telnet/arpa contrib/telnet/telnet contrib/telnet/telnetd contrib/tzcode/stdtime libexec/telnetd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 12:23:33 -0000 Author: ngie Date: Fri Dec 5 12:23:29 2014 New Revision: 275508 URL: https://svnweb.freebsd.org/changeset/base/275508 Log: MFC r274364: Add baud rate support to telnet(1) This implements part of RFC-2217 It's based off a patch originally written by Sujal Patel at Isilon, and contributions from other Isilon employees. PR: 173728 Phabric: D995 Reviewed by: markj, markm Sponsored by: EMC / Isilon Storage Division Added: stable/10/contrib/telnet/telnet/baud.h - copied unchanged from r274364, head/contrib/telnet/telnet/baud.h Modified: stable/10/contrib/telnet/arpa/telnet.h stable/10/contrib/telnet/telnet/commands.c stable/10/contrib/telnet/telnet/externs.h stable/10/contrib/telnet/telnet/main.c stable/10/contrib/telnet/telnet/sys_bsd.c stable/10/contrib/telnet/telnet/telnet.1 stable/10/contrib/telnet/telnet/telnet.c stable/10/contrib/telnet/telnet/types.h stable/10/contrib/telnet/telnetd/sys_term.c stable/10/contrib/tzcode/stdtime/localtime.c stable/10/libexec/telnetd/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/telnet/arpa/telnet.h ============================================================================== --- stable/10/contrib/telnet/arpa/telnet.h Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/arpa/telnet.h Fri Dec 5 12:23:29 2014 (r275508) @@ -127,6 +127,7 @@ extern char *telcmds[]; #define TELOPT_KERMIT 47 /* RFC2840 - Kermit */ #define TELOPT_EXOPL 255 /* extended-options-list */ +#define COMPORT_SET_BAUDRATE 1 /* RFC2217 - Com Port Set Baud Rate */ #define NTELOPTS (1+TELOPT_KERMIT) #ifdef TELOPTS Copied: stable/10/contrib/telnet/telnet/baud.h (from r274364, head/contrib/telnet/telnet/baud.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/telnet/telnet/baud.h Fri Dec 5 12:23:29 2014 (r275508, copy of r274364, head/contrib/telnet/telnet/baud.h) @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2014 EMC Corporation + * 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 JOHN BIRRELL 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 REGENTS 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$ + */ + +/* + * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD). + */ +#if B4800 != 4800 +#define DECODE_BAUD +#endif + +#ifdef DECODE_BAUD +#ifndef B7200 +#define B7200 B4800 +#endif + +#ifndef B14400 +#define B14400 B9600 +#endif + +#ifndef B19200 +#define B19200 B14400 +#endif + +#ifndef B28800 +#define B28800 B19200 +#endif + +#ifndef B38400 +#define B38400 B28800 +#endif + +#ifndef B57600 +#define B57600 B38400 +#endif + +#ifndef B76800 +#define B76800 B57600 +#endif + +#ifndef B115200 +#define B115200 B76800 +#endif + +#ifndef B115200 +#define B115200 B76800 +#endif +#endif + +#ifndef B230400 +#define B230400 B115200 +#endif + +/* + * A table of available terminal speeds + */ +struct termspeeds termspeeds[] = { + { 0, B0 }, + { 50, B50 }, + { 75, B75 }, + { 110, B110 }, + { 134, B134 }, + { 150, B150 }, + { 200, B200 }, + { 300, B300 }, + { 600, B600 }, + { 1200, B1200 }, + { 1800, B1800 }, + { 2400, B2400 }, + { 4800, B4800 }, +#ifdef B7200 + { 7200, B7200 }, +#endif + { 9600, B9600 }, +#ifdef B14400 + { 14400, B14400 }, +#endif +#ifdef B19200 + { 19200, B19200 }, +#endif +#ifdef B28800 + { 28800, B28800 }, +#endif +#ifdef B38400 + { 38400, B38400 }, +#endif +#ifdef B57600 + { 57600, B57600 }, +#endif +#ifdef B115200 + { 115200, B115200 }, +#endif +#ifdef B230400 + { 230400, B230400 }, +#endif + { -1, 0 } +}; Modified: stable/10/contrib/telnet/telnet/commands.c ============================================================================== --- stable/10/contrib/telnet/telnet/commands.c Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnet/commands.c Fri Dec 5 12:23:29 2014 (r275508) @@ -896,6 +896,7 @@ static struct setlist Setlist[] = { { "forw1", "alternate end of line character", NULL, termForw1Charp }, { "forw2", "alternate end of line character", NULL, termForw2Charp }, { "ayt", "alternate AYT character", NULL, termAytCharp }, + { "baudrate", "set remote baud rate", DoBaudRate, ComPortBaudRate }, { NULL, NULL, NULL, NULL } }; Modified: stable/10/contrib/telnet/telnet/externs.h ============================================================================== --- stable/10/contrib/telnet/telnet/externs.h Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnet/externs.h Fri Dec 5 12:23:29 2014 (r275508) @@ -231,6 +231,10 @@ extern unsigned char NetTraceFile[]; /* Name of file where debugging output goes */ extern void SetNetTrace(char *); /* Function to change where debugging goes */ +extern unsigned char + ComPortBaudRate[]; /* Baud rate of the remote end */ +extern void + DoBaudRate(char *); /* Function to set the baud rate of the remote end */ extern jmp_buf toplevel; /* For error conditions. */ @@ -475,6 +479,16 @@ extern cc_t termAytChar; # endif #endif +typedef struct { + int + system, /* what the current time is */ + echotoggle, /* last time user entered echo character */ + modenegotiated, /* last time operating mode negotiated */ + didnetreceive, /* last time we read data from network */ + gotDM; /* when did we last see a data mark */ +} Clocks; + +extern Clocks clocks; /* Ring buffer structures which are shared */ Modified: stable/10/contrib/telnet/telnet/main.c ============================================================================== --- stable/10/contrib/telnet/telnet/main.c Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnet/main.c Fri Dec 5 12:23:29 2014 (r275508) @@ -91,10 +91,10 @@ usage(void) fprintf(stderr, "usage: %s %s%s%s%s\n", prompt, #ifdef AUTHENTICATION - "[-4] [-6] [-8] [-E] [-K] [-L] [-N] [-S tos] [-X atype] [-c] [-d]", - "\n\t[-e char] [-k realm] [-l user] [-f/-F] [-n tracefile] ", + "[-4] [-6] [-8] [-B baudrate] [-E] [-K] [-L] [-N] [-S tos] [-X atype]", + "\n\t[-c] [-d] [-e char] [-k realm] [-l user] [-f/-F] [-n tracefile] ", #else - "[-4] [-6] [-8] [-E] [-L] [-N] [-S tos] [-c] [-d]", + "[-4] [-6] [-8] [-B baudrate] [-E] [-L] [-N] [-S tos] [-c] [-d]", "\n\t[-e char] [-l user] [-n tracefile] ", #endif "[-r] [-s src_addr] [-u] ", @@ -154,7 +154,7 @@ main(int argc, char *argv[]) #define IPSECOPT #endif while ((ch = getopt(argc, argv, - "468EKLNS:X:acde:fFk:l:n:rs:uxy" IPSECOPT)) != -1) + "468B:EKLNS:X:acde:fFk:l:n:rs:uxy" IPSECOPT)) != -1) #undef IPSECOPT { switch(ch) { @@ -169,6 +169,9 @@ main(int argc, char *argv[]) case '8': eight = 3; /* binary output and input */ break; + case 'B': + DoBaudRate(optarg); + break; case 'E': rlogin = escape = _POSIX_VDISABLE; break; Modified: stable/10/contrib/telnet/telnet/sys_bsd.c ============================================================================== --- stable/10/contrib/telnet/telnet/sys_bsd.c Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnet/sys_bsd.c Fri Dec 5 12:23:29 2014 (r275508) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "defines.h" #include "externs.h" #include "types.h" +#include "baud.h" int tout, /* Output file descriptor */ @@ -682,71 +683,6 @@ TerminalNewMode(int f) } -/* - * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD). - */ -#if B4800 != 4800 -#define DECODE_BAUD -#endif - -#ifdef DECODE_BAUD -#ifndef B7200 -#define B7200 B4800 -#endif - -#ifndef B14400 -#define B14400 B9600 -#endif - -#ifndef B19200 -# define B19200 B14400 -#endif - -#ifndef B28800 -#define B28800 B19200 -#endif - -#ifndef B38400 -# define B38400 B28800 -#endif - -#ifndef B57600 -#define B57600 B38400 -#endif - -#ifndef B76800 -#define B76800 B57600 -#endif - -#ifndef B115200 -#define B115200 B76800 -#endif - -#ifndef B230400 -#define B230400 B115200 -#endif - - -/* - * This code assumes that the values B0, B50, B75... - * are in ascending order. They do not have to be - * contiguous. - */ -struct termspeeds { - long speed; - long value; -} termspeeds[] = { - { 0, B0 }, { 50, B50 }, { 75, B75 }, - { 110, B110 }, { 134, B134 }, { 150, B150 }, - { 200, B200 }, { 300, B300 }, { 600, B600 }, - { 1200, B1200 }, { 1800, B1800 }, { 2400, B2400 }, - { 4800, B4800 }, { 7200, B7200 }, { 9600, B9600 }, - { 14400, B14400 }, { 19200, B19200 }, { 28800, B28800 }, - { 38400, B38400 }, { 57600, B57600 }, { 115200, B115200 }, - { 230400, B230400 }, { -1, B230400 } -}; -#endif /* DECODE_BAUD */ - void TerminalSpeeds(long *ispeed, long *ospeed) { Modified: stable/10/contrib/telnet/telnet/telnet.1 ============================================================================== --- stable/10/contrib/telnet/telnet/telnet.1 Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnet/telnet.1 Fri Dec 5 12:23:29 2014 (r275508) @@ -43,6 +43,7 @@ protocol .Sh SYNOPSIS .Nm .Op Fl 468EFKLNacdfruxy +.Op Fl B Ar baudrate .Op Fl S Ar tos .Op Fl X Ar authtype .Op Fl e Ar escapechar @@ -89,6 +90,9 @@ This causes an attempt to negotiate the .Dv TELNET BINARY option on both input and output. +.It Fl B Ar baudrate +Sets the baud rate to +.Ar baudrate . .It Fl E Stops any character from being recognized as an escape character. .It Fl F Modified: stable/10/contrib/telnet/telnet/telnet.c ============================================================================== --- stable/10/contrib/telnet/telnet/telnet.c Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnet/telnet.c Fri Dec 5 12:23:29 2014 (r275508) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "ring.h" @@ -68,7 +69,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include - + #define strip(x) ((my_want_state_is_wont(TELOPT_BINARY)) ? ((x)&0x7f) : (x)) static unsigned char subbuffer[SUBBUFSIZE], @@ -162,7 +163,7 @@ static int is_unique(char *, char **, ch */ Clocks clocks; - + /* * Initialize telnet environment. */ @@ -196,7 +197,7 @@ init_telnet(void) flushline = 1; telrcv_state = TS_DATA; } - + /* * These routines are in charge of sending option negotiations @@ -206,6 +207,42 @@ init_telnet(void) * is in disagreement as to what the current state should be. */ +unsigned char ComPortBaudRate[256]; + +void +DoBaudRate(char *arg) +{ + char *temp, temp2[10]; + int i; + uint32_t baudrate; + + errno = 0; + baudrate = (uint32_t)strtol(arg, &temp, 10); + if (temp[0] != '\0' || (baudrate == 0 && errno != 0)) + ExitString("Invalid baud rate provided.\n", 1); + + for (i = 1; termspeeds[i].speed != -1; i++) + if (baudrate == termspeeds[i].speed) + break; + if (termspeeds[i].speed == -1) + ExitString("Invalid baud rate provided.\n", 1); + + strlcpy(ComPortBaudRate, arg, sizeof(ComPortBaudRate)); + + if (NETROOM() < sizeof(temp2)) { + ExitString("No room in buffer for baud rate.\n", 1); + /* NOTREACHED */ + } + + snprintf(temp2, sizeof(temp2), "%c%c%c%c....%c%c", IAC, SB, TELOPT_COMPORT, + COMPORT_SET_BAUDRATE, IAC, SE); + + baudrate = htonl(baudrate); + memcpy(&temp2[4], &baudrate, sizeof(baudrate)); + ring_supply_data(&netoring, temp2, sizeof(temp2)); + printsub('>', &temp[2], sizeof(temp2) - 2); +} + void send_do(int c, int init) { @@ -1084,7 +1121,7 @@ lm_mode(unsigned char *cmd, int len, int setconnmode(0); /* set changed mode */ } - + /* * slc() @@ -1628,7 +1665,7 @@ env_opt_end(int emptyok) } } - + int telrcv(void) @@ -2013,7 +2050,7 @@ telsnd(void) ring_consumed(&ttyiring, count); return returnValue||count; /* Non-zero if we did anything */ } - + /* * Scheduler() * Modified: stable/10/contrib/telnet/telnet/types.h ============================================================================== --- stable/10/contrib/telnet/telnet/types.h Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnet/types.h Fri Dec 5 12:23:29 2014 (r275508) @@ -40,13 +40,9 @@ typedef struct { extern Modelist modelist[]; -typedef struct { - int - system, /* what the current time is */ - echotoggle, /* last time user entered echo character */ - modenegotiated, /* last time operating mode negotiated */ - didnetreceive, /* last time we read data from network */ - gotDM; /* when did we last see a data mark */ -} Clocks; +struct termspeeds { + int speed; + int value; +}; -extern Clocks clocks; +extern struct termspeeds termspeeds[]; Modified: stable/10/contrib/telnet/telnetd/sys_term.c ============================================================================== --- stable/10/contrib/telnet/telnetd/sys_term.c Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/telnet/telnetd/sys_term.c Fri Dec 5 12:23:29 2014 (r275508) @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include "telnetd.h" #include "pathnames.h" +#include "types.h" +#include "baud.h" #ifdef AUTHENTICATION #include @@ -743,56 +745,6 @@ tty_iscrnl(void) #endif } -/* - * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD). - */ -#if B4800 != 4800 -#define DECODE_BAUD -#endif - -#ifdef DECODE_BAUD - -/* - * A table of available terminal speeds - */ -struct termspeeds { - int speed; - int value; -} termspeeds[] = { - { 0, B0 }, { 50, B50 }, { 75, B75 }, - { 110, B110 }, { 134, B134 }, { 150, B150 }, - { 200, B200 }, { 300, B300 }, { 600, B600 }, - { 1200, B1200 }, { 1800, B1800 }, { 2400, B2400 }, - { 4800, B4800 }, -#ifdef B7200 - { 7200, B7200 }, -#endif - { 9600, B9600 }, -#ifdef B14400 - { 14400, B14400 }, -#endif -#ifdef B19200 - { 19200, B19200 }, -#endif -#ifdef B28800 - { 28800, B28800 }, -#endif -#ifdef B38400 - { 38400, B38400 }, -#endif -#ifdef B57600 - { 57600, B57600 }, -#endif -#ifdef B115200 - { 115200, B115200 }, -#endif -#ifdef B230400 - { 230400, B230400 }, -#endif - { -1, 0 } -}; -#endif /* DECODE_BAUD */ - void tty_tspeed(int val) { Modified: stable/10/contrib/tzcode/stdtime/localtime.c ============================================================================== --- stable/10/contrib/tzcode/stdtime/localtime.c Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/contrib/tzcode/stdtime/localtime.c Fri Dec 5 12:23:29 2014 (r275508) @@ -1792,7 +1792,11 @@ int delta; number0 = *number; *number += delta; - return (*number < number0) != (delta < 0); + if ((*number < number0) != (delta < 0)) { + errno = EOVERFLOW; + return (1); + } + return (0); } static int @@ -1804,7 +1808,11 @@ int delta; number0 = *number; *number += delta; - return (*number < number0) != (delta < 0); + if ((*number < number0) != (delta < 0)) { + errno = EOVERFLOW; + return (1); + } + return (0); } static int Modified: stable/10/libexec/telnetd/Makefile ============================================================================== --- stable/10/libexec/telnetd/Makefile Fri Dec 5 12:07:53 2014 (r275507) +++ stable/10/libexec/telnetd/Makefile Fri Dec 5 12:23:29 2014 (r275508) @@ -25,6 +25,7 @@ CFLAGS+= -DINET6 .endif CFLAGS+= -I${TELNETDIR} +CFLAGS+= -I${TELNETDIR}/telnet LIBTELNET= ${.OBJDIR}/../../lib/libtelnet/libtelnet.a From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 12:25:37 2014 Return-Path: Delivered-To: svn-src-all@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 BD5FAB75; Fri, 5 Dec 2014 12:25: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 A983B30E; Fri, 5 Dec 2014 12:25: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 sB5CPbFp089442; Fri, 5 Dec 2014 12:25:37 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5CPbCN089441; Fri, 5 Dec 2014 12:25:37 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412051225.sB5CPbCN089441@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 5 Dec 2014 12:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275509 - stable/10/contrib/tzcode/stdtime X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 12:25:37 -0000 Author: ngie Date: Fri Dec 5 12:25:36 2014 New Revision: 275509 URL: https://svnweb.freebsd.org/changeset/base/275509 Log: MFC r274365: Revert WiP to contrib/tzcode accidentally committed with r274364 Modified: stable/10/contrib/tzcode/stdtime/localtime.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/tzcode/stdtime/localtime.c ============================================================================== --- stable/10/contrib/tzcode/stdtime/localtime.c Fri Dec 5 12:23:29 2014 (r275508) +++ stable/10/contrib/tzcode/stdtime/localtime.c Fri Dec 5 12:25:36 2014 (r275509) @@ -1792,11 +1792,7 @@ int delta; number0 = *number; *number += delta; - if ((*number < number0) != (delta < 0)) { - errno = EOVERFLOW; - return (1); - } - return (0); + return (*number < number0) != (delta < 0); } static int @@ -1808,11 +1804,7 @@ int delta; number0 = *number; *number += delta; - if ((*number < number0) != (delta < 0)) { - errno = EOVERFLOW; - return (1); - } - return (0); + return (*number < number0) != (delta < 0); } static int From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 12:38:02 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 12:51:29 2014 Return-Path: Delivered-To: svn-src-all@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 E3AAE78F; Fri, 5 Dec 2014 12:51:28 +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 C4BAD79A; Fri, 5 Dec 2014 12:51:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5CpSgL003109; Fri, 5 Dec 2014 12:51:28 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5CpSrV003106; Fri, 5 Dec 2014 12:51:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412051251.sB5CpSrV003106@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 5 Dec 2014 12:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275511 - in stable/10: . sbin/mdconfig/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 12:51:29 -0000 Author: ngie Date: Fri Dec 5 12:51:27 2014 New Revision: 275511 URL: https://svnweb.freebsd.org/changeset/base/275511 Log: MFC r275170: Convert sbin/mdconfig/tests from prove format tests to ATF format tests As a side effect... 1. The tests now checks for the root user before continuing with kyua, which is more visible than the test being skipped with the TAP protocol 2. The tests work with devices that aren't /dev/md0 by caching the device attached during the test to a file, and later use the cached information to detach the device in the cleanup routine 3. The tests no longer require perl to run PR: 191191 Sponsored by: EMC / Isilon Storage Division Added: stable/10/sbin/mdconfig/tests/mdconfig_test.sh - copied unchanged from r275170, head/sbin/mdconfig/tests/mdconfig_test.sh Deleted: stable/10/sbin/mdconfig/tests/legacy_test.sh stable/10/sbin/mdconfig/tests/mdconfig.test stable/10/sbin/mdconfig/tests/run.pl Modified: stable/10/ObsoleteFiles.inc stable/10/sbin/mdconfig/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/ObsoleteFiles.inc ============================================================================== --- stable/10/ObsoleteFiles.inc Fri Dec 5 12:38:01 2014 (r275510) +++ stable/10/ObsoleteFiles.inc Fri Dec 5 12:51:27 2014 (r275511) @@ -38,6 +38,10 @@ # xargs -n1 | sort | uniq -d; # done +# 20141205: convert sbin/mdconfig/tests to ATF format tests +OLD_FILES+=usr/tests/sbin/mdconfig/legacy_test +OLD_FILES+=usr/tests/sbin/mdconfig/mdconfig.test +OLD_FILES+=usr/tests/sbin/mdconfig/run.pl # 20141028: debug files accidentally installed as directory name OLD_FILES+=usr/lib/debug/usr/lib/i18n OLD_FILES+=usr/lib/debug/usr/lib/private Modified: stable/10/sbin/mdconfig/tests/Makefile ============================================================================== --- stable/10/sbin/mdconfig/tests/Makefile Fri Dec 5 12:38:01 2014 (r275510) +++ stable/10/sbin/mdconfig/tests/Makefile Fri Dec 5 12:51:27 2014 (r275511) @@ -2,12 +2,9 @@ TESTSDIR= ${TESTSBASE}/sbin/mdconfig -TAP_TESTS_SH= legacy_test -TAP_TESTS_SH_SED_legacy_test= 's,__PERL__,${TAP_PERL_INTERPRETER},g' -TEST_METADATA.legacy_test+= required_programs="${TAP_PERL_INTERPRETER}" +ATF_TESTS_SH= mdconfig_test -FILESDIR= ${TESTSDIR} -FILES= mdconfig.test -FILES+= run.pl + +TEST_METADATA.mdconfig_test+= required_user="root" .include Copied: stable/10/sbin/mdconfig/tests/mdconfig_test.sh (from r275170, head/sbin/mdconfig/tests/mdconfig_test.sh) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sbin/mdconfig/tests/mdconfig_test.sh Fri Dec 5 12:51:27 2014 (r275511, copy of r275170, head/sbin/mdconfig/tests/mdconfig_test.sh) @@ -0,0 +1,281 @@ +# Copyright (c) 2012 Edward Tomasz Napierała +# 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$ +# + +check_diskinfo() +{ + local md=$1 + local mediasize_in_bytes=$2 + local mediasize_in_sectors=$3 + local sectorsize=${4:-512} + local stripesize=${5:-0} + local stripeoffset=${6:-0} + + atf_check -s exit:0 \ + -o match:"/dev/$md *$sectorsize *$mediasize_in_bytes *$mediasize_in_sectors *$stripesize *$stripeoffset" \ + -x "diskinfo /dev/$md | expand" +} + +cleanup_common() +{ + if [ -f mdconfig.out ]; then + mdconfig -d -u $(sed -e 's/md//' mdconfig.out) + fi +} + +atf_test_case attach_vnode_non_explicit_type cleanup +attach_vnode_non_explicit_type_head() +{ + atf_set "descr" "Tests out -a / -f without -t" +} +attach_vnode_non_explicit_type_body() +{ + local md + local size_in_mb=1024 + + atf_check -s exit:0 -x "truncate -s ${size_in_mb}m xxx" + atf_check -s exit:0 -o save:mdconfig.out -x 'mdconfig -af xxx' + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "1073741824" "2097152" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md vnode ${size_in_mb}M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_vnode_non_explicit_type_cleanup() +{ + cleanup_common +} + +atf_test_case attach_vnode_implicit_a_f cleanup +attach_vnode_implicit_a_f_head() +{ + atf_set "descr" "Tests out implied -a / -f without -t" +} +attach_vnode_implicit_a_f_body() +{ + local md + local size_in_mb=1024 + + atf_check -s exit:0 -x "truncate -s ${size_in_mb}m xxx" + atf_check -s exit:0 -o save:mdconfig.out -x 'mdconfig xxx' + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "1073741824" "2097152" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md vnode ${size_in_mb}M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_vnode_implicit_a_f_cleanup() +{ + cleanup_common +} + +atf_test_case attach_vnode_explicit_type cleanup +attach_vnode_explicit_type_head() +{ + atf_set "descr" "Tests out implied -a / -f with -t vnode" +} +attach_vnode_explicit_type_body() +{ + local md + local size_in_mb=1024 + + atf_check -s exit:0 -x "truncate -s ${size_in_mb}m xxx" + atf_check -s exit:0 -o save:mdconfig.out -x 'mdconfig -af xxx -t vnode' + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "1073741824" "2097152" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md vnode ${size_in_mb}M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_vnode_explicit_type_cleanup() +{ + [ -f mdconfig.out ] && mdconfig -d -u $(sed -e 's/md//' mdconfig.out) + rm -f mdconfig.out xxx +} + +atf_test_case attach_vnode_smaller_than_file cleanup +attach_vnode_smaller_than_file_head() +{ + atf_set "descr" "Tests mdconfig -s with size less than the file size" +} +attach_vnode_smaller_than_file_body() +{ + local md + local size_in_mb=128 + + atf_check -s exit:0 -x "truncate -s 1024m xxx" + atf_check -s exit:0 -o save:mdconfig.out \ + -x "mdconfig -af xxx -s ${size_in_mb}m" + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "134217728" "262144" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md vnode ${size_in_mb}M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_vnode_smaller_than_file_cleanup() +{ + cleanup_common +} + +atf_test_case attach_vnode_larger_than_file cleanup +attach_vnode_larger_than_file_head() +{ + atf_set "descr" "Tests mdconfig -s with size greater than the file size" +} +attach_vnode_larger_than_file_body() +{ + local md + local size_in_gb=128 + + atf_check -s exit:0 -x "truncate -s 1024m xxx" + atf_check -s exit:0 -o save:mdconfig.out \ + -x "mdconfig -af xxx -s ${size_in_gb}g" + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "137438953472" "268435456" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md vnode ${size_in_gb}G$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_vnode_larger_than_file_cleanup() +{ + cleanup_common +} + +atf_test_case attach_vnode_sector_size cleanup +attach_vnode_sector_size_head() +{ + atf_set "descr" "Tests mdconfig -s with size greater than the file size" +} +attach_vnode_sector_size_body() +{ + local md + local size_in_mb=1024 + + atf_check -s exit:0 -x "truncate -s ${size_in_mb}m xxx" + atf_check -s exit:0 -o save:mdconfig.out \ + -x "mdconfig -af xxx -S 2048" + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "1073741824" "524288" "2048" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md vnode ${size_in_mb}M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_vnode_sector_size_cleanup() +{ + cleanup_common +} + +atf_test_case attach_malloc cleanup +attach_malloc_head() +{ + atf_set "descr" "Tests mdconfig with -t malloc" +} +attach_malloc_body() +{ + local md + local size_in_mb=1024 + + atf_check -s exit:0 -o save:mdconfig.out \ + -x 'mdconfig -a -t malloc -s 1g' + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "1073741824" "2097152" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md malloc ${size_in_mb}M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_malloc_cleanup() +{ + cleanup_common +} + +atf_test_case attach_swap cleanup +attach_swap_head() +{ + atf_set "descr" "Tests mdconfig with -t swap" +} +attach_swap_body() +{ + local md + local size_in_mb=1024 + + atf_check -s exit:0 -o save:mdconfig.out \ + -x 'mdconfig -a -t swap -s 1g' + md=$(cat mdconfig.out) + atf_check -s exit:0 -o match:'^md[0-9]+$' -x "echo $md" + check_diskinfo "$md" "1073741824" "2097152" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md swap ${size_in_mb}M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_swap_cleanup() +{ + cleanup_common +} + +atf_test_case attach_with_specific_unit_number cleanup +attach_with_specific_unit_number_head() +{ + atf_set "descr" "Tests mdconfig with a unit specified by -u" +} +attach_with_specific_unit_number_body() +{ + local md_unit=99 + local size_in_mb=10 + + local md="md${md_unit}" + + echo "$md" > mdconfig.out + + atf_check -s exit:0 -o empty \ + -x "mdconfig -a -t malloc -s ${size_in_mb}m -u $md_unit" + check_diskinfo "$md" "10485760" "20480" + # This awk strips the file path. + atf_check -s exit:0 -o match:"^$md malloc "$size_in_mb"M$" \ + -x "mdconfig -lv | awk '\$1 == \"$md\" { print \$1, \$2, \$3 }'" +} +attach_with_specific_unit_number_cleanup() +{ + cleanup_common +} + +atf_init_test_cases() +{ + atf_add_test_case attach_vnode_non_explicit_type + atf_add_test_case attach_vnode_explicit_type + atf_add_test_case attach_vnode_smaller_than_file + atf_add_test_case attach_vnode_larger_than_file + atf_add_test_case attach_vnode_sector_size + atf_add_test_case attach_malloc + atf_add_test_case attach_swap + atf_add_test_case attach_with_specific_unit_number +} From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 13:30:46 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 15:02:31 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 15:24:43 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 18:29:02 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 18:55:33 2014 Return-Path: Delivered-To: svn-src-all@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 5540FB2A; Fri, 5 Dec 2014 18:55: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 26A11784; Fri, 5 Dec 2014 18:55: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 sB5ItX74078965; Fri, 5 Dec 2014 18:55:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5ItW4u078962; Fri, 5 Dec 2014 18:55:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201412051855.sB5ItW4u078962@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 5 Dec 2014 18:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275517 - in stable/9/cddl/contrib/opensolaris/lib: libctf/common libdtrace/common X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 18:55:33 -0000 Author: markj Date: Fri Dec 5 18:55:32 2014 New Revision: 275517 URL: https://svnweb.freebsd.org/changeset/base/275517 Log: MFC r271695: Fix some incorrect endianness checks. Modified: stable/9/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Fri Dec 5 18:55:31 2014 (r275516) +++ stable/9/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Fri Dec 5 18:55:32 2014 (r275517) @@ -273,7 +273,7 @@ ctf_fdopen(int fd, int *errp) */ if (nbytes >= (ssize_t) sizeof (Elf32_Ehdr) && bcmp(&hdr.e32.e_ident[EI_MAG0], ELFMAG, SELFMAG) == 0) { -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN uchar_t order = ELFDATA2MSB; #else uchar_t order = ELFDATA2LSB; Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Fri Dec 5 18:55:31 2014 (r275516) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Fri Dec 5 18:55:32 2014 (r275517) @@ -167,7 +167,7 @@ print_bitfield(dt_printarg_t *pap, ulong * to the lowest 'size' bytes in 'value', and we need to shift based on * the offset from the end of the data, not the offset of the start. */ -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN buf += sizeof (value) - size; off += ep->cte_bits; #endif @@ -178,7 +178,7 @@ print_bitfield(dt_printarg_t *pap, ulong * Offsets are counted from opposite ends on little- and * big-endian machines. */ -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN shift = NBBY - shift; #endif From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 18:55:32 2014 Return-Path: Delivered-To: svn-src-all@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 DD1C1B29; Fri, 5 Dec 2014 18:55:32 +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 AE83B783; Fri, 5 Dec 2014 18:55:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5ItWdE078953; Fri, 5 Dec 2014 18:55:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5ItWlL078945; Fri, 5 Dec 2014 18:55:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201412051855.sB5ItWlL078945@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 5 Dec 2014 18:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275516 - in stable/10/cddl/contrib/opensolaris/lib: libctf/common libdtrace/common X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 18:55:33 -0000 Author: markj Date: Fri Dec 5 18:55:31 2014 New Revision: 275516 URL: https://svnweb.freebsd.org/changeset/base/275516 Log: MFC r271695: Fix some incorrect endianness checks. Modified: stable/10/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Fri Dec 5 18:29:01 2014 (r275515) +++ stable/10/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c Fri Dec 5 18:55:31 2014 (r275516) @@ -274,7 +274,7 @@ ctf_fdopen(int fd, int *errp) */ if (nbytes >= (ssize_t) sizeof (Elf32_Ehdr) && bcmp(&hdr.e32.e_ident[EI_MAG0], ELFMAG, SELFMAG) == 0) { -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN uchar_t order = ELFDATA2MSB; #else uchar_t order = ELFDATA2LSB; Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Fri Dec 5 18:29:01 2014 (r275515) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_print.c Fri Dec 5 18:55:31 2014 (r275516) @@ -167,7 +167,7 @@ print_bitfield(dt_printarg_t *pap, ulong * to the lowest 'size' bytes in 'value', and we need to shift based on * the offset from the end of the data, not the offset of the start. */ -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN buf += sizeof (value) - size; off += ep->cte_bits; #endif @@ -178,7 +178,7 @@ print_bitfield(dt_printarg_t *pap, ulong * Offsets are counted from opposite ends on little- and * big-endian machines. */ -#ifdef _BIG_ENDIAN +#if BYTE_ORDER == _BIG_ENDIAN shift = NBBY - shift; #endif From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 19:00:56 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 19:04:09 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 19:08:37 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 19:11:26 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 19:14:06 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 19:19:18 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 19:23:52 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 21:37:31 2014 Return-Path: Delivered-To: svn-src-all@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 51E5AED; Fri, 5 Dec 2014 21:37: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 3BEE1ADF; Fri, 5 Dec 2014 21:37: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 sB5LbVRK053970; Fri, 5 Dec 2014 21:37:31 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5LbSJF053952; Fri, 5 Dec 2014 21:37:28 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201412052137.sB5LbSJF053952@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Fri, 5 Dec 2014 21:37:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r275525 - in stable/9: contrib/telnet/arpa contrib/telnet/telnet contrib/telnet/telnetd libexec/telnetd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 21:37:31 -0000 Author: ngie Date: Fri Dec 5 21:37:27 2014 New Revision: 275525 URL: https://svnweb.freebsd.org/changeset/base/275525 Log: MFstable/10 r275508,r275509: r275508: MFC r274364: Add baud rate support to telnet(1) This implements part of RFC-2217 It's based off a patch originally written by Sujal Patel at Isilon, and contributions from other Isilon employees. PR: 173728 Phabric: D995 Reviewed by: markj, markm Sponsored by: EMC / Isilon Storage Division r275509: MFC r274365: Revert WiP to contrib/tzcode accidentally committed with r274364 Added: stable/9/contrib/telnet/telnet/baud.h - copied unchanged from r275508, stable/10/contrib/telnet/telnet/baud.h Modified: stable/9/contrib/telnet/arpa/telnet.h stable/9/contrib/telnet/telnet/commands.c stable/9/contrib/telnet/telnet/externs.h stable/9/contrib/telnet/telnet/main.c stable/9/contrib/telnet/telnet/sys_bsd.c stable/9/contrib/telnet/telnet/telnet.1 stable/9/contrib/telnet/telnet/telnet.c stable/9/contrib/telnet/telnet/types.h stable/9/contrib/telnet/telnetd/sys_term.c stable/9/libexec/telnetd/Makefile Directory Properties: stable/9/ (props changed) stable/9/contrib/ (props changed) stable/9/contrib/telnet/ (props changed) stable/9/contrib/tzcode/ (props changed) stable/9/contrib/tzcode/stdtime/ (props changed) Modified: stable/9/contrib/telnet/arpa/telnet.h ============================================================================== --- stable/9/contrib/telnet/arpa/telnet.h Fri Dec 5 19:23:51 2014 (r275524) +++ stable/9/contrib/telnet/arpa/telnet.h Fri Dec 5 21:37:27 2014 (r275525) @@ -127,6 +127,7 @@ extern char *telcmds[]; #define TELOPT_KERMIT 47 /* RFC2840 - Kermit */ #define TELOPT_EXOPL 255 /* extended-options-list */ +#define COMPORT_SET_BAUDRATE 1 /* RFC2217 - Com Port Set Baud Rate */ #define NTELOPTS (1+TELOPT_KERMIT) #ifdef TELOPTS Copied: stable/9/contrib/telnet/telnet/baud.h (from r275508, stable/10/contrib/telnet/telnet/baud.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/contrib/telnet/telnet/baud.h Fri Dec 5 21:37:27 2014 (r275525, copy of r275508, stable/10/contrib/telnet/telnet/baud.h) @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2014 EMC Corporation + * 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 JOHN BIRRELL 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 REGENTS 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$ + */ + +/* + * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD). + */ +#if B4800 != 4800 +#define DECODE_BAUD +#endif + +#ifdef DECODE_BAUD +#ifndef B7200 +#define B7200 B4800 +#endif + +#ifndef B14400 +#define B14400 B9600 +#endif + +#ifndef B19200 +#define B19200 B14400 +#endif + +#ifndef B28800 +#define B28800 B19200 +#endif + +#ifndef B38400 +#define B38400 B28800 +#endif + +#ifndef B57600 +#define B57600 B38400 +#endif + +#ifndef B76800 +#define B76800 B57600 +#endif + +#ifndef B115200 +#define B115200 B76800 +#endif + +#ifndef B115200 +#define B115200 B76800 +#endif +#endif + +#ifndef B230400 +#define B230400 B115200 +#endif + +/* + * A table of available terminal speeds + */ +struct termspeeds termspeeds[] = { + { 0, B0 }, + { 50, B50 }, + { 75, B75 }, + { 110, B110 }, + { 134, B134 }, + { 150, B150 }, + { 200, B200 }, + { 300, B300 }, + { 600, B600 }, + { 1200, B1200 }, + { 1800, B1800 }, + { 2400, B2400 }, + { 4800, B4800 }, +#ifdef B7200 + { 7200, B7200 }, +#endif + { 9600, B9600 }, +#ifdef B14400 + { 14400, B14400 }, +#endif +#ifdef B19200 + { 19200, B19200 }, +#endif +#ifdef B28800 + { 28800, B28800 }, +#endif +#ifdef B38400 + { 38400, B38400 }, +#endif +#ifdef B57600 + { 57600, B57600 }, +#endif +#ifdef B115200 + { 115200, B115200 }, +#endif +#ifdef B230400 + { 230400, B230400 }, +#endif + { -1, 0 } +}; Modified: stable/9/contrib/telnet/telnet/commands.c ============================================================================== --- stable/9/contrib/telnet/telnet/commands.c Fri Dec 5 19:23:51 2014 (r275524) +++ stable/9/contrib/telnet/telnet/commands.c Fri Dec 5 21:37:27 2014 (r275525) @@ -896,6 +896,7 @@ static struct setlist Setlist[] = { { "forw1", "alternate end of line character", NULL, termForw1Charp }, { "forw2", "alternate end of line character", NULL, termForw2Charp }, { "ayt", "alternate AYT character", NULL, termAytCharp }, + { "baudrate", "set remote baud rate", DoBaudRate, ComPortBaudRate }, { NULL, NULL, NULL, NULL } }; Modified: stable/9/contrib/telnet/telnet/externs.h ============================================================================== --- stable/9/contrib/telnet/telnet/externs.h Fri Dec 5 19:23:51 2014 (r275524) +++ stable/9/contrib/telnet/telnet/externs.h Fri Dec 5 21:37:27 2014 (r275525) @@ -231,6 +231,10 @@ extern unsigned char NetTraceFile[]; /* Name of file where debugging output goes */ extern void SetNetTrace(char *); /* Function to change where debugging goes */ +extern unsigned char + ComPortBaudRate[]; /* Baud rate of the remote end */ +extern void + DoBaudRate(char *); /* Function to set the baud rate of the remote end */ extern jmp_buf toplevel; /* For error conditions. */ @@ -475,6 +479,16 @@ extern cc_t termAytChar; # endif #endif +typedef struct { + int + system, /* what the current time is */ + echotoggle, /* last time user entered echo character */ + modenegotiated, /* last time operating mode negotiated */ + didnetreceive, /* last time we read data from network */ + gotDM; /* when did we last see a data mark */ +} Clocks; + +extern Clocks clocks; /* Ring buffer structures which are shared */ Modified: stable/9/contrib/telnet/telnet/main.c ============================================================================== --- stable/9/contrib/telnet/telnet/main.c Fri Dec 5 19:23:51 2014 (r275524) +++ stable/9/contrib/telnet/telnet/main.c Fri Dec 5 21:37:27 2014 (r275525) @@ -91,10 +91,10 @@ usage(void) fprintf(stderr, "usage: %s %s%s%s%s\n", prompt, #ifdef AUTHENTICATION - "[-4] [-6] [-8] [-E] [-K] [-L] [-N] [-S tos] [-X atype] [-c] [-d]", - "\n\t[-e char] [-k realm] [-l user] [-f/-F] [-n tracefile] ", + "[-4] [-6] [-8] [-B baudrate] [-E] [-K] [-L] [-N] [-S tos] [-X atype]", + "\n\t[-c] [-d] [-e char] [-k realm] [-l user] [-f/-F] [-n tracefile] ", #else - "[-4] [-6] [-8] [-E] [-L] [-N] [-S tos] [-c] [-d]", + "[-4] [-6] [-8] [-B baudrate] [-E] [-L] [-N] [-S tos] [-c] [-d]", "\n\t[-e char] [-l user] [-n tracefile] ", #endif "[-r] [-s src_addr] [-u] ", @@ -154,7 +154,7 @@ main(int argc, char *argv[]) #define IPSECOPT #endif while ((ch = getopt(argc, argv, - "468EKLNS:X:acde:fFk:l:n:rs:uxy" IPSECOPT)) != -1) + "468B:EKLNS:X:acde:fFk:l:n:rs:uxy" IPSECOPT)) != -1) #undef IPSECOPT { switch(ch) { @@ -169,6 +169,9 @@ main(int argc, char *argv[]) case '8': eight = 3; /* binary output and input */ break; + case 'B': + DoBaudRate(optarg); + break; case 'E': rlogin = escape = _POSIX_VDISABLE; break; Modified: stable/9/contrib/telnet/telnet/sys_bsd.c ============================================================================== --- stable/9/contrib/telnet/telnet/sys_bsd.c Fri Dec 5 19:23:51 2014 (r275524) +++ stable/9/contrib/telnet/telnet/sys_bsd.c Fri Dec 5 21:37:27 2014 (r275525) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include "defines.h" #include "externs.h" #include "types.h" +#include "baud.h" int tout, /* Output file descriptor */ @@ -682,71 +683,6 @@ TerminalNewMode(int f) } -/* - * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD). - */ -#if B4800 != 4800 -#define DECODE_BAUD -#endif - -#ifdef DECODE_BAUD -#ifndef B7200 -#define B7200 B4800 -#endif - -#ifndef B14400 -#define B14400 B9600 -#endif - -#ifndef B19200 -# define B19200 B14400 -#endif - -#ifndef B28800 -#define B28800 B19200 -#endif - -#ifndef B38400 -# define B38400 B28800 -#endif - -#ifndef B57600 -#define B57600 B38400 -#endif - -#ifndef B76800 -#define B76800 B57600 -#endif - -#ifndef B115200 -#define B115200 B76800 -#endif - -#ifndef B230400 -#define B230400 B115200 -#endif - - -/* - * This code assumes that the values B0, B50, B75... - * are in ascending order. They do not have to be - * contiguous. - */ -struct termspeeds { - long speed; - long value; -} termspeeds[] = { - { 0, B0 }, { 50, B50 }, { 75, B75 }, - { 110, B110 }, { 134, B134 }, { 150, B150 }, - { 200, B200 }, { 300, B300 }, { 600, B600 }, - { 1200, B1200 }, { 1800, B1800 }, { 2400, B2400 }, - { 4800, B4800 }, { 7200, B7200 }, { 9600, B9600 }, - { 14400, B14400 }, { 19200, B19200 }, { 28800, B28800 }, - { 38400, B38400 }, { 57600, B57600 }, { 115200, B115200 }, - { 230400, B230400 }, { -1, B230400 } -}; -#endif /* DECODE_BAUD */ - void TerminalSpeeds(long *ispeed, long *ospeed) { Modified: stable/9/contrib/telnet/telnet/telnet.1 ============================================================================== --- stable/9/contrib/telnet/telnet/telnet.1 Fri Dec 5 19:23:51 2014 (r275524) +++ stable/9/contrib/telnet/telnet/telnet.1 Fri Dec 5 21:37:27 2014 (r275525) @@ -43,6 +43,7 @@ protocol .Sh SYNOPSIS .Nm .Op Fl 468EFKLNacdfruxy +.Op Fl B Ar baudrate .Op Fl S Ar tos .Op Fl X Ar authtype .Op Fl e Ar escapechar @@ -89,6 +90,9 @@ This causes an attempt to negotiate the .Dv TELNET BINARY option on both input and output. +.It Fl B Ar baudrate +Sets the baud rate to +.Ar baudrate . .It Fl E Stops any character from being recognized as an escape character. .It Fl F Modified: stable/9/contrib/telnet/telnet/telnet.c ============================================================================== --- stable/9/contrib/telnet/telnet/telnet.c Fri Dec 5 19:23:51 2014 (r275524) +++ stable/9/contrib/telnet/telnet/telnet.c Fri Dec 5 21:37:27 2014 (r275525) @@ -52,6 +52,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "ring.h" @@ -68,7 +69,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include - + #define strip(x) ((my_want_state_is_wont(TELOPT_BINARY)) ? ((x)&0x7f) : (x)) static unsigned char subbuffer[SUBBUFSIZE], @@ -162,7 +163,7 @@ static int is_unique(char *, char **, ch */ Clocks clocks; - + /* * Initialize telnet environment. */ @@ -196,7 +197,7 @@ init_telnet(void) flushline = 1; telrcv_state = TS_DATA; } - + /* * These routines are in charge of sending option negotiations @@ -206,6 +207,42 @@ init_telnet(void) * is in disagreement as to what the current state should be. */ +unsigned char ComPortBaudRate[256]; + +void +DoBaudRate(char *arg) +{ + char *temp, temp2[10]; + int i; + uint32_t baudrate; + + errno = 0; + baudrate = (uint32_t)strtol(arg, &temp, 10); + if (temp[0] != '\0' || (baudrate == 0 && errno != 0)) + ExitString("Invalid baud rate provided.\n", 1); + + for (i = 1; termspeeds[i].speed != -1; i++) + if (baudrate == termspeeds[i].speed) + break; + if (termspeeds[i].speed == -1) + ExitString("Invalid baud rate provided.\n", 1); + + strlcpy(ComPortBaudRate, arg, sizeof(ComPortBaudRate)); + + if (NETROOM() < sizeof(temp2)) { + ExitString("No room in buffer for baud rate.\n", 1); + /* NOTREACHED */ + } + + snprintf(temp2, sizeof(temp2), "%c%c%c%c....%c%c", IAC, SB, TELOPT_COMPORT, + COMPORT_SET_BAUDRATE, IAC, SE); + + baudrate = htonl(baudrate); + memcpy(&temp2[4], &baudrate, sizeof(baudrate)); + ring_supply_data(&netoring, temp2, sizeof(temp2)); + printsub('>', &temp[2], sizeof(temp2) - 2); +} + void send_do(int c, int init) { @@ -1084,7 +1121,7 @@ lm_mode(unsigned char *cmd, int len, int setconnmode(0); /* set changed mode */ } - + /* * slc() @@ -1628,7 +1665,7 @@ env_opt_end(int emptyok) } } - + int telrcv(void) @@ -2013,7 +2050,7 @@ telsnd(void) ring_consumed(&ttyiring, count); return returnValue||count; /* Non-zero if we did anything */ } - + /* * Scheduler() * Modified: stable/9/contrib/telnet/telnet/types.h ============================================================================== --- stable/9/contrib/telnet/telnet/types.h Fri Dec 5 19:23:51 2014 (r275524) +++ stable/9/contrib/telnet/telnet/types.h Fri Dec 5 21:37:27 2014 (r275525) @@ -40,13 +40,9 @@ typedef struct { extern Modelist modelist[]; -typedef struct { - int - system, /* what the current time is */ - echotoggle, /* last time user entered echo character */ - modenegotiated, /* last time operating mode negotiated */ - didnetreceive, /* last time we read data from network */ - gotDM; /* when did we last see a data mark */ -} Clocks; +struct termspeeds { + int speed; + int value; +}; -extern Clocks clocks; +extern struct termspeeds termspeeds[]; Modified: stable/9/contrib/telnet/telnetd/sys_term.c ============================================================================== --- stable/9/contrib/telnet/telnetd/sys_term.c Fri Dec 5 19:23:51 2014 (r275524) +++ stable/9/contrib/telnet/telnetd/sys_term.c Fri Dec 5 21:37:27 2014 (r275525) @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include "telnetd.h" #include "pathnames.h" +#include "types.h" +#include "baud.h" #ifdef AUTHENTICATION #include @@ -743,56 +745,6 @@ tty_iscrnl(void) #endif } -/* - * Try to guess whether speeds are "encoded" (4.2BSD) or just numeric (4.4BSD). - */ -#if B4800 != 4800 -#define DECODE_BAUD -#endif - -#ifdef DECODE_BAUD - -/* - * A table of available terminal speeds - */ -struct termspeeds { - int speed; - int value; -} termspeeds[] = { - { 0, B0 }, { 50, B50 }, { 75, B75 }, - { 110, B110 }, { 134, B134 }, { 150, B150 }, - { 200, B200 }, { 300, B300 }, { 600, B600 }, - { 1200, B1200 }, { 1800, B1800 }, { 2400, B2400 }, - { 4800, B4800 }, -#ifdef B7200 - { 7200, B7200 }, -#endif - { 9600, B9600 }, -#ifdef B14400 - { 14400, B14400 }, -#endif -#ifdef B19200 - { 19200, B19200 }, -#endif -#ifdef B28800 - { 28800, B28800 }, -#endif -#ifdef B38400 - { 38400, B38400 }, -#endif -#ifdef B57600 - { 57600, B57600 }, -#endif -#ifdef B115200 - { 115200, B115200 }, -#endif -#ifdef B230400 - { 230400, B230400 }, -#endif - { -1, 0 } -}; -#endif /* DECODE_BAUD */ - void tty_tspeed(int val) { Modified: stable/9/libexec/telnetd/Makefile ============================================================================== --- stable/9/libexec/telnetd/Makefile Fri Dec 5 19:23:51 2014 (r275524) +++ stable/9/libexec/telnetd/Makefile Fri Dec 5 21:37:27 2014 (r275525) @@ -25,6 +25,7 @@ CFLAGS+= -DINET6 .endif CFLAGS+= -I${TELNETDIR} +CFLAGS+= -I${TELNETDIR}/telnet LIBTELNET= ${.OBJDIR}/../../lib/libtelnet/libtelnet.a From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 22:34:18 2014 Return-Path: Delivered-To: svn-src-all@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 79C718C7; Fri, 5 Dec 2014 22:34: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 64AB9A3; Fri, 5 Dec 2014 22:34: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 sB5MYIf6081308; Fri, 5 Dec 2014 22:34:18 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5MYGZM081293; Fri, 5 Dec 2014 22:34:16 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201412052234.sB5MYGZM081293@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Fri, 5 Dec 2014 22:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275526 - in vendor/tnftp/dist: . libnetbsd src X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 22:34:18 -0000 Author: gavin Date: Fri Dec 5 22:34:15 2014 New Revision: 275526 URL: https://svnweb.freebsd.org/changeset/base/275526 Log: Import tnftp-20141031. Modified: vendor/tnftp/dist/ChangeLog vendor/tnftp/dist/NEWS vendor/tnftp/dist/THANKS vendor/tnftp/dist/configure vendor/tnftp/dist/configure.ac vendor/tnftp/dist/libnetbsd/glob.c vendor/tnftp/dist/src/fetch.c vendor/tnftp/dist/src/ssl.h vendor/tnftp/dist/src/version.h Modified: vendor/tnftp/dist/ChangeLog ============================================================================== --- vendor/tnftp/dist/ChangeLog Fri Dec 5 21:37:27 2014 (r275525) +++ vendor/tnftp/dist/ChangeLog Fri Dec 5 22:34:15 2014 (r275526) @@ -1,4 +1,15 @@ -$NetBSD: ChangeLog,v 1.62 2013/05/05 13:53:38 lukem Exp $ +$NetBSD: ChangeLog,v 1.63 2014/10/31 04:13:56 lukem Exp $ + + +Fri Oct 31 04:07:38 UTC 2014 lukem + + * Release as "tnftp 20141031". + + * Merge NetBSD usr.bin/ftp from 20130220 to 20141026: + - Don't pay attention to special characters if they don't + come from the command line (from jmcneill). + Fixes CVE-2014-8517. + - PR/34796: Hauke Fath: ftp does not timeout on http fetches. Sun May 5 13:51:47 UTC 2013 lukem Modified: vendor/tnftp/dist/NEWS ============================================================================== --- vendor/tnftp/dist/NEWS Fri Dec 5 21:37:27 2014 (r275525) +++ vendor/tnftp/dist/NEWS Fri Dec 5 22:34:15 2014 (r275526) @@ -1,6 +1,14 @@ -$NetBSD: NEWS,v 1.9 2013/05/05 13:53:38 lukem Exp $ +$NetBSD: NEWS,v 1.10 2014/10/31 04:06:54 lukem Exp $ -This is tnftp version 20130505. +This is tnftp version 20141031. + +Changes in tnftp from 20130505 to 20141031: + + Ignore special character behaviour in filenames not provided + by the user. + Fixes CVE-2014-8517. + + Fix timeout on HTTP fetches. Changes in tnftp from 20100108 to 20130505: Modified: vendor/tnftp/dist/THANKS ============================================================================== --- vendor/tnftp/dist/THANKS Fri Dec 5 21:37:27 2014 (r275525) +++ vendor/tnftp/dist/THANKS Fri Dec 5 22:34:15 2014 (r275526) @@ -19,9 +19,11 @@ Douwe Kiela Eugene Kotlyarov Geoff Wing Giles Lean +Hauke Fath Havard Eidnes Hubert Feyrer ITOH Yasufumi +Jared McNeill Jason R. Thorpe John Hawkinson Joseph S. Myers Modified: vendor/tnftp/dist/configure ============================================================================== --- vendor/tnftp/dist/configure Fri Dec 5 21:37:27 2014 (r275525) +++ vendor/tnftp/dist/configure Fri Dec 5 22:34:15 2014 (r275526) @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.ac Revision: 1.25 . +# From configure.ac Revision: 1.26 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for tnftp 20130505. +# Generated by GNU Autoconf 2.69 for tnftp 20141031. # # Report bugs to . # @@ -13,7 +13,7 @@ # gives unlimited permission to copy, distribute and modify it. # # -# Copyright (c) 1999-2013 The NetBSD Foundation, Inc. +# Copyright (c) 1999-2014 The NetBSD Foundation, Inc. # All rights reserved. # ## -------------------- ## @@ -596,8 +596,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tnftp' PACKAGE_TARNAME='tnftp' -PACKAGE_VERSION='20130505' -PACKAGE_STRING='tnftp 20130505' +PACKAGE_VERSION='20141031' +PACKAGE_STRING='tnftp 20141031' PACKAGE_BUGREPORT='lukem@NetBSD.org' PACKAGE_URL='' @@ -1333,7 +1333,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tnftp 20130505 to adapt to many kinds of systems. +\`configure' configures tnftp 20141031 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1403,7 +1403,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tnftp 20130505:";; + short | recursive ) echo "Configuration of tnftp 20141031:";; esac cat <<\_ACEOF @@ -1518,7 +1518,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tnftp configure 20130505 +tnftp configure 20141031 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1526,7 +1526,7 @@ This configure script is free software; gives unlimited permission to copy, distribute and modify it. -Copyright (c) 1999-2013 The NetBSD Foundation, Inc. +Copyright (c) 1999-2014 The NetBSD Foundation, Inc. All rights reserved. _ACEOF @@ -2103,7 +2103,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tnftp $as_me 20130505, which was +It was created by tnftp $as_me 20141031, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3067,7 +3067,7 @@ fi # Define the identity of the package. PACKAGE='tnftp' - VERSION='20130505' + VERSION='20141031' cat >>confdefs.h <<_ACEOF @@ -15274,7 +15274,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tnftp $as_me 20130505, which was +This file was extended by tnftp $as_me 20141031, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15340,7 +15340,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -tnftp config.status 20130505 +tnftp config.status 20141031 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/tnftp/dist/configure.ac ============================================================================== --- vendor/tnftp/dist/configure.ac Fri Dec 5 21:37:27 2014 (r275525) +++ vendor/tnftp/dist/configure.ac Fri Dec 5 22:34:15 2014 (r275526) @@ -1,15 +1,15 @@ -# $NetBSD: configure.ac,v 1.25 2013/05/05 13:50:50 lukem Exp $ +# $NetBSD: configure.ac,v 1.26 2014/10/31 04:03:54 lukem Exp $ # # Process this file with autoconf to produce a configure script. -AC_INIT([tnftp], [20130505], [lukem@NetBSD.org]) +AC_INIT([tnftp], [20141031], [lukem@NetBSD.org]) AC_PREREQ([2.69]) AC_COPYRIGHT([ -Copyright (c) 1999-2013 The NetBSD Foundation, Inc. +Copyright (c) 1999-2014 The NetBSD Foundation, Inc. All rights reserved. ]) -AC_REVISION([$Revision: 1.25 $]) +AC_REVISION([$Revision: 1.26 $]) AS_SHELL_SANITIZE() Modified: vendor/tnftp/dist/libnetbsd/glob.c ============================================================================== --- vendor/tnftp/dist/libnetbsd/glob.c Fri Dec 5 21:37:27 2014 (r275525) +++ vendor/tnftp/dist/libnetbsd/glob.c Fri Dec 5 22:34:15 2014 (r275526) @@ -1,4 +1,4 @@ -/* $NetBSD: glob.c,v 1.11 2013/05/05 13:20:16 lukem Exp $ */ +/* $NetBSD: glob.c,v 1.12 2014/05/05 00:20:45 lukem Exp $ */ /* from: NetBSD: glob.c,v 1.34 2013/02/21 18:17:43 christos Exp */ /* @@ -176,8 +176,8 @@ static void qprintf(const char *, Char #endif int -glob(const char * __restrict pattern, int flags, int (*errfunc)(const char *, - int), glob_t * __restrict pglob) +glob(const char * pattern, int flags, int (*errfunc)(const char *, + int), glob_t * pglob) { const unsigned char *patnext; int c; Modified: vendor/tnftp/dist/src/fetch.c ============================================================================== --- vendor/tnftp/dist/src/fetch.c Fri Dec 5 21:37:27 2014 (r275525) +++ vendor/tnftp/dist/src/fetch.c Fri Dec 5 22:34:15 2014 (r275526) @@ -1,5 +1,5 @@ -/* $NetBSD: fetch.c,v 1.19 2013/05/05 11:17:30 lukem Exp $ */ -/* from NetBSD: fetch.c,v 1.202 2013/02/23 13:47:36 christos Exp */ +/* $NetBSD: fetch.c,v 1.20 2014/10/31 03:37:59 lukem Exp $ */ +/* from NetBSD: fetch.c,v 1.206 2014/10/26 16:21:59 christos Exp */ /*- * Copyright (c) 1997-2009 The NetBSD Foundation, Inc. @@ -39,7 +39,7 @@ #include #ifndef lint -__RCSID(" NetBSD: fetch.c,v 1.202 2013/02/23 13:47:36 christos Exp "); +__RCSID(" NetBSD: fetch.c,v 1.206 2014/10/26 16:21:59 christos Exp "); #endif /* not lint */ /* @@ -87,6 +87,7 @@ typedef enum { } url_t; __dead static void aborthttp(int); +__dead static void timeouthttp(int); #ifndef NO_AUTH static int auth_url(const char *, char **, const char *, const char *); static void base64_encode(const unsigned char *, size_t, unsigned char *); @@ -499,8 +500,10 @@ fetch_url(const char *url, const char *p { struct addrinfo hints, *res, *res0 = NULL; int error; - sigfunc volatile oldintr; - sigfunc volatile oldintp; + sigfunc volatile oldint; + sigfunc volatile oldpipe; + sigfunc volatile oldalrm; + sigfunc volatile oldquit; int volatile s; struct stat sb; int volatile ischunked; @@ -526,6 +529,7 @@ fetch_url(const char *url, const char *p int (*volatile closefunc)(FILE *); FETCH *volatile fin; FILE *volatile fout; + const char *volatile penv = proxyenv; time_t mtime; url_t urltype; in_port_t portnum; @@ -533,9 +537,9 @@ fetch_url(const char *url, const char *p void *ssl; #endif - DPRINTF("fetch_url: `%s' proxyenv `%s'\n", url, STRorNULL(proxyenv)); + DPRINTF("%s: `%s' proxyenv `%s'\n", __func__, url, STRorNULL(penv)); - oldintr = oldintp = NULL; + oldquit = oldalrm = oldint = oldpipe = NULL; closefunc = NULL; fin = NULL; fout = NULL; @@ -546,6 +550,9 @@ fetch_url(const char *url, const char *p rval = 1; uuser = pass = host = path = decodedpath = puser = ppass = NULL; + if (sigsetjmp(httpabort, 1)) + goto cleanup_fetch_url; + if (parse_url(url, "URL", &urltype, &uuser, &pass, &host, &port, &portnum, &path) == -1) goto cleanup_fetch_url; @@ -571,7 +578,7 @@ fetch_url(const char *url, const char *p url_decode(decodedpath); if (outfile) - savefile = ftp_strdup(outfile); + savefile = outfile; else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) @@ -579,7 +586,7 @@ fetch_url(const char *url, const char *p else savefile = ftp_strdup(decodedpath); } - DPRINTF("fetch_url: savefile `%s'\n", savefile); + DPRINTF("%s: savefile `%s'\n", __func__, savefile); if (EMPTYSTRING(savefile)) { if (urltype == FTP_URL_T) { rval = fetch_ftp(url); @@ -595,8 +602,7 @@ fetch_url(const char *url, const char *p rangestart = rangeend = entitylen = -1; mtime = -1; if (restartautofetch) { - if (strcmp(savefile, "-") != 0 && *savefile != '|' && - stat(savefile, &sb) == 0) + if (stat(savefile, &sb) == 0) restart_point = sb.st_size; } if (urltype == FILE_URL_T) { /* file:// URLs */ @@ -631,18 +637,18 @@ fetch_url(const char *url, const char *p const char *leading; int hasleading; - if (proxyenv == NULL) { + if (penv == NULL) { #ifdef WITH_SSL if (urltype == HTTPS_URL_T) - proxyenv = getoptionvalue("https_proxy"); + penv = getoptionvalue("https_proxy"); #endif - if (proxyenv == NULL && IS_HTTP_TYPE(urltype)) - proxyenv = getoptionvalue("http_proxy"); + if (penv == NULL && IS_HTTP_TYPE(urltype)) + penv = getoptionvalue("http_proxy"); else if (urltype == FTP_URL_T) - proxyenv = getoptionvalue("ftp_proxy"); + penv = getoptionvalue("ftp_proxy"); } direction = "retrieved"; - if (! EMPTYSTRING(proxyenv)) { /* use proxy */ + if (! EMPTYSTRING(penv)) { /* use proxy */ url_t purltype; char *phost, *ppath; char *pport, *no_proxy; @@ -689,10 +695,10 @@ fetch_url(const char *url, const char *p if (isproxy) { if (restart_point) { warnx("Can't restart via proxy URL `%s'", - proxyenv); + penv); goto cleanup_fetch_url; } - if (parse_url(proxyenv, "proxy URL", &purltype, + if (parse_url(penv, "proxy URL", &purltype, &puser, &ppass, &phost, &pport, &pportnum, &ppath) == -1) goto cleanup_fetch_url; @@ -702,8 +708,7 @@ fetch_url(const char *url, const char *p EMPTYSTRING(phost) || (! EMPTYSTRING(ppath) && strcmp(ppath, "/") != 0)) { - warnx("Malformed proxy URL `%s'", - proxyenv); + warnx("Malformed proxy URL `%s'", penv); FREEPTR(phost); FREEPTR(pport); FREEPTR(ppath); @@ -729,7 +734,7 @@ fetch_url(const char *url, const char *p FREEPTR(ppath); urltype = purltype; } - } /* ! EMPTYSTRING(proxyenv) */ + } /* ! EMPTYSTRING(penv) */ memset(&hints, 0, sizeof(hints)); hints.ai_flags = 0; @@ -801,9 +806,13 @@ fetch_url(const char *url, const char *p goto cleanup_fetch_url; } + oldalrm = xsignal(SIGALRM, timeouthttp); + alarmtimer(quit_time ? quit_time : 60); fin = fetch_fdopen(s, "r+"); fetch_set_ssl(fin, ssl); + alarmtimer(0); + alarmtimer(quit_time ? quit_time : 60); /* * Construct and send the request. */ @@ -890,11 +899,15 @@ fetch_url(const char *url, const char *p fetch_printf(fin, "\r\n"); if (fetch_flush(fin) == EOF) { warn("Writing HTTP request"); + alarmtimer(0); goto cleanup_fetch_url; } + alarmtimer(0); /* Read the response */ + alarmtimer(quit_time ? quit_time : 60); len = fetch_getline(fin, buf, sizeof(buf), &errormsg); + alarmtimer(0); if (len < 0) { if (*errormsg == '\n') errormsg++; @@ -903,7 +916,7 @@ fetch_url(const char *url, const char *p } while (len > 0 && (ISLWS(buf[len-1]))) buf[--len] = '\0'; - DPRINTF("fetch_url: received `%s'\n", buf); + DPRINTF("%s: received `%s'\n", __func__, buf); /* Determine HTTP response code */ cp = strchr(buf, ' '); @@ -918,7 +931,9 @@ fetch_url(const char *url, const char *p /* Read the rest of the header. */ while (1) { + alarmtimer(quit_time ? quit_time : 60); len = fetch_getline(fin, buf, sizeof(buf), &errormsg); + alarmtimer(0); if (len < 0) { if (*errormsg == '\n') errormsg++; @@ -929,7 +944,7 @@ fetch_url(const char *url, const char *p buf[--len] = '\0'; if (len == 0) break; - DPRINTF("fetch_url: received `%s'\n", buf); + DPRINTF("%s: received `%s'\n", __func__, buf); /* * Look for some headers @@ -941,8 +956,8 @@ fetch_url(const char *url, const char *p filesize = STRTOLL(cp, &ep, 10); if (filesize < 0 || *ep != '\0') goto improper; - DPRINTF("fetch_url: parsed len as: " LLF "\n", - (LLT)filesize); + DPRINTF("%s: parsed len as: " LLF "\n", + __func__, (LLT)filesize); } else if (match_token(&cp, "Content-Range:")) { if (! match_token(&cp, "bytes")) @@ -1013,8 +1028,8 @@ fetch_url(const char *url, const char *p } else if (match_token(&cp, "Location:")) { location = ftp_strdup(cp); - DPRINTF("fetch_url: parsed location as `%s'\n", - cp); + DPRINTF("%s: parsed location as `%s'\n", + __func__, cp); } else if (match_token(&cp, "Transfer-Encoding:")) { if (match_token(&cp, "binary")) { @@ -1029,19 +1044,20 @@ fetch_url(const char *url, const char *p goto cleanup_fetch_url; } ischunked++; - DPRINTF("fetch_url: using chunked encoding\n"); + DPRINTF("%s: using chunked encoding\n", + __func__); } else if (match_token(&cp, "Proxy-Authenticate:") || match_token(&cp, "WWW-Authenticate:")) { if (! (token = match_token(&cp, "Basic"))) { - DPRINTF( - "fetch_url: skipping unknown auth scheme `%s'\n", - token); + DPRINTF("%s: skipping unknown auth " + "scheme `%s'\n", __func__, token); continue; } FREEPTR(auth); auth = ftp_strdup(token); - DPRINTF("fetch_url: parsed auth as `%s'\n", cp); + DPRINTF("%s: parsed auth as `%s'\n", + __func__, cp); } } @@ -1123,7 +1139,7 @@ fetch_url(const char *url, const char *p apass = NULL; } if (auth_url(auth, authp, auser, apass) == 0) { - rval = fetch_url(url, proxyenv, + rval = fetch_url(url, penv, proxyauth, wwwauth); memset(*authp, 0, strlen(*authp)); FREEPTR(*authp); @@ -1140,18 +1156,26 @@ fetch_url(const char *url, const char *p } } /* end of ftp:// or http:// specific setup */ - /* Open the output file. */ - if (strcmp(savefile, "-") == 0) { - fout = stdout; - } else if (*savefile == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); - fout = popen(savefile + 1, "w"); - if (fout == NULL) { - warn("Can't execute `%s'", savefile + 1); - goto cleanup_fetch_url; + /* Open the output file. */ + + /* + * Only trust filenames with special meaning if they came from + * the command line + */ + if (outfile == savefile) { + if (strcmp(savefile, "-") == 0) { + fout = stdout; + } else if (*savefile == '|') { + oldpipe = xsignal(SIGPIPE, SIG_IGN); + fout = popen(savefile + 1, "w"); + if (fout == NULL) { + warn("Can't execute `%s'", savefile + 1); + goto cleanup_fetch_url; + } + closefunc = pclose; } - closefunc = pclose; - } else { + } + if (fout == NULL) { if ((rangeend != -1 && rangeend <= restart_point) || (rangestart == -1 && filesize != -1 && filesize <= restart_point)) { /* already done */ @@ -1180,10 +1204,8 @@ fetch_url(const char *url, const char *p } /* Trap signals */ - if (sigsetjmp(httpabort, 1)) - goto cleanup_fetch_url; - (void)xsignal(SIGQUIT, psummary); - oldintr = xsignal(SIGINT, aborthttp); + oldquit = xsignal(SIGQUIT, psummary); + oldint = xsignal(SIGINT, aborthttp); assert(rcvbuf_size > 0); if ((size_t)rcvbuf_size > bufsize) { @@ -1195,6 +1217,10 @@ fetch_url(const char *url, const char *p bytes = 0; hashbytes = mark; + if (oldalrm) { + (void)xsignal(SIGALRM, oldalrm); + oldalrm = NULL; + } progressmeter(-1); /* Finally, suck down the file. */ @@ -1241,7 +1267,7 @@ fetch_url(const char *url, const char *p warnx("Unexpected data following chunk-size"); goto cleanup_fetch_url; } - DPRINTF("fetch_url: got chunk-size of " LLF "\n", + DPRINTF("%s: got chunk-size of " LLF "\n", __func__, (LLT)chunksize); if (chunksize == 0) { lastchunk = 1; @@ -1251,7 +1277,7 @@ fetch_url(const char *url, const char *p /* transfer file or chunk */ while (1) { struct timeval then, now, td; - off_t bufrem; + volatile off_t bufrem; if (rate_get) (void)gettimeofday(&then, NULL); @@ -1299,6 +1325,7 @@ fetch_url(const char *url, const char *p chunkdone: if (ischunked) { if (fetch_getln(xferbuf, bufsize, fin) == NULL) { + alarmtimer(0); warnx("Unexpected EOF reading chunk CRLF"); goto cleanup_fetch_url; } @@ -1350,10 +1377,14 @@ fetch_url(const char *url, const char *p warnx("Improper response from `%s:%s'", host, port); cleanup_fetch_url: - if (oldintr) - (void)xsignal(SIGINT, oldintr); - if (oldintp) - (void)xsignal(SIGPIPE, oldintp); + if (oldint) + (void)xsignal(SIGINT, oldint); + if (oldpipe) + (void)xsignal(SIGPIPE, oldpipe); + if (oldalrm) + (void)xsignal(SIGALRM, oldalrm); + if (oldquit) + (void)xsignal(SIGQUIT, oldpipe); if (fin != NULL) fetch_close(fin); else if (s != -1) @@ -1362,7 +1393,8 @@ fetch_url(const char *url, const char *p (*closefunc)(fout); if (res0) freeaddrinfo(res0); - FREEPTR(savefile); + if (savefile != outfile) + FREEPTR(savefile); FREEPTR(uuser); if (pass != NULL) memset(pass, 0, strlen(pass)); @@ -1388,12 +1420,32 @@ static void aborthttp(int notused) { char msgbuf[100]; - size_t len; + int len; sigint_raised = 1; alarmtimer(0); - len = strlcpy(msgbuf, "\nHTTP fetch aborted.\n", sizeof(msgbuf)); - write(fileno(ttyout), msgbuf, len); + if (fromatty) { + len = snprintf(msgbuf, sizeof(msgbuf), + "\n%s: HTTP fetch aborted.\n", getprogname()); + if (len > 0) + write(fileno(ttyout), msgbuf, len); + } + siglongjmp(httpabort, 1); +} + +static void +timeouthttp(int notused) +{ + char msgbuf[100]; + int len; + + alarmtimer(0); + if (fromatty) { + len = snprintf(msgbuf, sizeof(msgbuf), + "\n%s: HTTP fetch timeout.\n", getprogname()); + if (len > 0) + write(fileno(ttyout), msgbuf, len); + } siglongjmp(httpabort, 1); } Modified: vendor/tnftp/dist/src/ssl.h ============================================================================== --- vendor/tnftp/dist/src/ssl.h Fri Dec 5 21:37:27 2014 (r275525) +++ vendor/tnftp/dist/src/ssl.h Fri Dec 5 22:34:15 2014 (r275526) @@ -1,5 +1,5 @@ -/* $NetBSD: ssl.h,v 1.1.1.1 2013/05/05 10:40:57 lukem Exp $ */ -/* from NetBSD: ssl.h,v 1.1 2012/12/21 18:07:36 christos Exp */ +/* $NetBSD: ssl.h,v 1.2 2014/10/31 03:57:14 lukem Exp $ */ +/* from NetBSD: ssl.h,v 1.2 2014/01/07 02:07:08 joerg Exp */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -31,7 +31,8 @@ #define FETCH struct fetch_connect struct fetch_connect; -int fetch_printf(struct fetch_connect *, const char *fmt, ...); +int fetch_printf(struct fetch_connect *, const char *fmt, ...) + ; int fetch_fileno(struct fetch_connect *); int fetch_error(struct fetch_connect *); int fetch_flush(struct fetch_connect *); Modified: vendor/tnftp/dist/src/version.h ============================================================================== --- vendor/tnftp/dist/src/version.h Fri Dec 5 21:37:27 2014 (r275525) +++ vendor/tnftp/dist/src/version.h Fri Dec 5 22:34:15 2014 (r275526) @@ -1,5 +1,5 @@ -/* $NetBSD: version.h,v 1.5 2013/05/05 11:17:31 lukem Exp $ */ -/* from NetBSD: version.h,v 1.84 2013/05/05 10:40:19 lukem Exp */ +/* $NetBSD: version.h,v 1.6 2014/10/31 03:37:59 lukem Exp $ */ +/* from NetBSD: version.h,v 1.85 2014/10/31 03:27:18 lukem Exp */ /*- * Copyright (c) 1999-2009 The NetBSD Foundation, Inc. @@ -35,5 +35,5 @@ #endif #ifndef FTP_VERSION -#define FTP_VERSION "20130220" +#define FTP_VERSION "20141026" #endif From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 22:35:29 2014 Return-Path: Delivered-To: svn-src-all@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 ABBBBA05; Fri, 5 Dec 2014 22:35: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 7E5D2B5; Fri, 5 Dec 2014 22:35: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 sB5MZTtd081514; Fri, 5 Dec 2014 22:35:29 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5MZT53081513; Fri, 5 Dec 2014 22:35:29 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201412052235.sB5MZT53081513@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Fri, 5 Dec 2014 22:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275527 - vendor/tnftp/20141031 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 22:35:29 -0000 Author: gavin Date: Fri Dec 5 22:35:28 2014 New Revision: 275527 URL: https://svnweb.freebsd.org/changeset/base/275527 Log: Tag tnftp-20141031. Added: vendor/tnftp/20141031/ - copied from r275526, vendor/tnftp/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 22:37:58 2014 Return-Path: Delivered-To: svn-src-all@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 87CB4B65; Fri, 5 Dec 2014 22:37: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 68904D4; Fri, 5 Dec 2014 22:37: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 sB5MbwNP081823; Fri, 5 Dec 2014 22:37:58 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5Mbuph081811; Fri, 5 Dec 2014 22:37:56 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201412052237.sB5Mbuph081811@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Fri, 5 Dec 2014 22:37:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275528 - vendor/tnftp/dist X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 22:37:58 -0000 Author: gavin Date: Fri Dec 5 22:37:56 2014 New Revision: 275528 URL: https://svnweb.freebsd.org/changeset/base/275528 Log: Import tnftp-20141104. Modified: vendor/tnftp/dist/ChangeLog vendor/tnftp/dist/NEWS vendor/tnftp/dist/configure vendor/tnftp/dist/configure.ac vendor/tnftp/dist/tnftp.h vendor/tnftp/dist/tnftp_config.h.in Modified: vendor/tnftp/dist/ChangeLog ============================================================================== --- vendor/tnftp/dist/ChangeLog Fri Dec 5 22:35:28 2014 (r275527) +++ vendor/tnftp/dist/ChangeLog Fri Dec 5 22:37:56 2014 (r275528) @@ -1,6 +1,16 @@ -$NetBSD: ChangeLog,v 1.63 2014/10/31 04:13:56 lukem Exp $ +$NetBSD: ChangeLog,v 1.66 2014/11/03 21:48:49 lukem Exp $ +Mon Nov 3 21:43:20 UTC 2014 lukem + + * Release as "tnftp 20141104". + +Fri Oct 31 08:32:28 UTC 2014 lukem + + * Use '=' not '==' with test in configure. + + * Check for for writev() declaration. + Fri Oct 31 04:07:38 UTC 2014 lukem * Release as "tnftp 20141031". Modified: vendor/tnftp/dist/NEWS ============================================================================== --- vendor/tnftp/dist/NEWS Fri Dec 5 22:35:28 2014 (r275527) +++ vendor/tnftp/dist/NEWS Fri Dec 5 22:37:56 2014 (r275528) @@ -1,6 +1,10 @@ -$NetBSD: NEWS,v 1.10 2014/10/31 04:06:54 lukem Exp $ +$NetBSD: NEWS,v 1.11 2014/11/03 21:48:49 lukem Exp $ -This is tnftp version 20141031. +This is tnftp version 20141104. + +Changes in tnftp from 20141031 to 20141104: + + Portability fixes. Changes in tnftp from 20130505 to 20141031: Modified: vendor/tnftp/dist/configure ============================================================================== --- vendor/tnftp/dist/configure Fri Dec 5 22:35:28 2014 (r275527) +++ vendor/tnftp/dist/configure Fri Dec 5 22:37:56 2014 (r275528) @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.ac Revision: 1.26 . +# From configure.ac Revision: 1.29 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for tnftp 20141031. +# Generated by GNU Autoconf 2.69 for tnftp 20141104. # # Report bugs to . # @@ -596,8 +596,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='tnftp' PACKAGE_TARNAME='tnftp' -PACKAGE_VERSION='20141031' -PACKAGE_STRING='tnftp 20141031' +PACKAGE_VERSION='20141104' +PACKAGE_STRING='tnftp 20141104' PACKAGE_BUGREPORT='lukem@NetBSD.org' PACKAGE_URL='' @@ -1333,7 +1333,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures tnftp 20141031 to adapt to many kinds of systems. +\`configure' configures tnftp 20141104 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1403,7 +1403,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of tnftp 20141031:";; + short | recursive ) echo "Configuration of tnftp 20141104:";; esac cat <<\_ACEOF @@ -1518,7 +1518,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -tnftp configure 20141031 +tnftp configure 20141104 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2103,7 +2103,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by tnftp $as_me 20141031, which was +It was created by tnftp $as_me 20141104, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3067,7 +3067,7 @@ fi # Define the identity of the package. PACKAGE='tnftp' - VERSION='20141031' + VERSION='20141104' cat >>confdefs.h <<_ACEOF @@ -12277,7 +12277,7 @@ rm -f core conftest.err conftest.$ac_obj if test "$with_ssl" != no; then : { $as_echo "$as_me:${as_lineno-$LINENO}: --with-ssl=$with_ssl; checking for required OpenSSL features" >&5 $as_echo "$as_me: --with-ssl=$with_ssl; checking for required OpenSSL features" >&6;} - if test "$have_ssl" == yes; then : + if test "$have_ssl" = yes; then : $as_echo "#define WITH_SSL 1" >>confdefs.h { $as_echo "$as_me:${as_lineno-$LINENO}: enabling SSL support" >&5 @@ -12383,7 +12383,8 @@ accheck_includes=' ' # accheck_includes for ac_header in sys/types.h sys/ioctl.h sys/param.h sys/stat.h \ - sys/socket.h sys/syslimits.h sys/time.h sys/wait.h + sys/socket.h sys/syslimits.h sys/time.h sys/uio.h \ + sys/wait.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$accheck_includes @@ -15274,7 +15275,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by tnftp $as_me 20141031, which was +This file was extended by tnftp $as_me 20141104, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -15340,7 +15341,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -tnftp config.status 20141031 +tnftp config.status 20141104 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/tnftp/dist/configure.ac ============================================================================== --- vendor/tnftp/dist/configure.ac Fri Dec 5 22:35:28 2014 (r275527) +++ vendor/tnftp/dist/configure.ac Fri Dec 5 22:37:56 2014 (r275528) @@ -1,15 +1,15 @@ -# $NetBSD: configure.ac,v 1.26 2014/10/31 04:03:54 lukem Exp $ +# $NetBSD: configure.ac,v 1.29 2014/11/03 21:48:49 lukem Exp $ # # Process this file with autoconf to produce a configure script. -AC_INIT([tnftp], [20141031], [lukem@NetBSD.org]) +AC_INIT([tnftp], [20141104], [lukem@NetBSD.org]) AC_PREREQ([2.69]) AC_COPYRIGHT([ Copyright (c) 1999-2014 The NetBSD Foundation, Inc. All rights reserved. ]) -AC_REVISION([$Revision: 1.26 $]) +AC_REVISION([$Revision: 1.29 $]) AS_SHELL_SANITIZE() @@ -140,7 +140,7 @@ AX_CHECK_OPENSSL([have_ssl=yes]) AS_IF([test "$with_ssl" != no], [AC_MSG_NOTICE([--with-ssl=$with_ssl; checking for required OpenSSL features]) - AS_IF([test "$have_ssl" == yes], + AS_IF([test "$have_ssl" = yes], [AC_DEFINE([WITH_SSL], [1]) AC_MSG_NOTICE([enabling SSL support]) with_ssl=yes], @@ -229,7 +229,8 @@ accheck_includes=' ' # accheck_includes AC_CHECK_HEADERS([sys/types.h sys/ioctl.h sys/param.h sys/stat.h \ - sys/socket.h sys/syslimits.h sys/time.h sys/wait.h], + sys/socket.h sys/syslimits.h sys/time.h sys/uio.h \ + sys/wait.h], [], [], [$accheck_includes]) AC_HEADER_DIRENT() AC_HEADER_RESOLV() Modified: vendor/tnftp/dist/tnftp.h ============================================================================== --- vendor/tnftp/dist/tnftp.h Fri Dec 5 22:35:28 2014 (r275527) +++ vendor/tnftp/dist/tnftp.h Fri Dec 5 22:37:56 2014 (r275528) @@ -1,4 +1,4 @@ -/* $NetBSD: tnftp.h,v 1.35 2013/05/05 13:17:05 lukem Exp $ */ +/* $NetBSD: tnftp.h,v 1.36 2014/10/31 07:22:03 lukem Exp $ */ #define FTP_PRODUCT PACKAGE_NAME #define FTP_VERSION PACKAGE_VERSION @@ -70,6 +70,9 @@ # include # endif #endif +#if defined(HAVE_SYS_UIO_H) +# include +#endif #if defined(HAVE_SYS_IOCTL_H) # include Modified: vendor/tnftp/dist/tnftp_config.h.in ============================================================================== --- vendor/tnftp/dist/tnftp_config.h.in Fri Dec 5 22:35:28 2014 (r275527) +++ vendor/tnftp/dist/tnftp_config.h.in Fri Dec 5 22:37:56 2014 (r275528) @@ -388,6 +388,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_UIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 22:38:22 2014 Return-Path: Delivered-To: svn-src-all@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 4D342C87; Fri, 5 Dec 2014 22:38: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 2001FD7; Fri, 5 Dec 2014 22:38: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 sB5McL3e081923; Fri, 5 Dec 2014 22:38:21 GMT (envelope-from gavin@FreeBSD.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5McLST081922; Fri, 5 Dec 2014 22:38:21 GMT (envelope-from gavin@FreeBSD.org) Message-Id: <201412052238.sB5McLST081922@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gavin set sender to gavin@FreeBSD.org using -f From: Gavin Atkinson Date: Fri, 5 Dec 2014 22:38:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275529 - vendor/tnftp/20141104 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 22:38:22 -0000 Author: gavin Date: Fri Dec 5 22:38:21 2014 New Revision: 275529 URL: https://svnweb.freebsd.org/changeset/base/275529 Log: Tag tnftp-20141104. Added: vendor/tnftp/20141104/ - copied from r275528, vendor/tnftp/dist/ From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 22:56:11 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 23:08:40 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Fri Dec 5 23:43:16 2014 Return-Path: Delivered-To: svn-src-all@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 139BCA07; Fri, 5 Dec 2014 23:43: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 F3F7CA80; Fri, 5 Dec 2014 23:43:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sB5NhF11013542; Fri, 5 Dec 2014 23:43:15 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5NhFmH013541; Fri, 5 Dec 2014 23:43:15 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412052343.sB5NhFmH013541@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 23:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275532 - vendor/illumos/dist/lib/libnvpair X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 23:43:16 -0000 Author: delphij Date: Fri Dec 5 23:43:15 2014 New Revision: 275532 URL: https://svnweb.freebsd.org/changeset/base/275532 Log: 5005 libnvpair JSON output broken by lint fixes 5006 libnvpair JSON cannot print int16 arrays Reviewed by: Robert Mustacchi Approved by: Gordon Ross Author: Joshua M. Clulow illumos/illumos-gate@37c79205ad46187f54b2edbf6a468160935f14d9 Modified: vendor/illumos/dist/lib/libnvpair/nvpair_json.c Modified: vendor/illumos/dist/lib/libnvpair/nvpair_json.c ============================================================================== --- vendor/illumos/dist/lib/libnvpair/nvpair_json.c Fri Dec 5 23:08:39 2014 (r275531) +++ vendor/illumos/dist/lib/libnvpair/nvpair_json.c Fri Dec 5 23:43:15 2014 (r275532) @@ -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, @@ -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; From owner-svn-src-all@FreeBSD.ORG Fri Dec 5 23:50:17 2014 Return-Path: Delivered-To: svn-src-all@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 0FF4CBC4; Fri, 5 Dec 2014 23:50: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 F01E6ACF; Fri, 5 Dec 2014 23:50: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 sB5NoGea014926; Fri, 5 Dec 2014 23:50:16 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5NoG3R014925; Fri, 5 Dec 2014 23:50:16 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412052350.sB5NoG3R014925@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 23:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275533 - vendor-sys/illumos/dist/uts/common/sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 23:50:17 -0000 Author: delphij Date: Fri Dec 5 23:50:16 2014 New Revision: 275533 URL: https://svnweb.freebsd.org/changeset/base/275533 Log: 5100 sparc build failed after 5004 Reviewed by: Garrett D'Amore Reviewed by: Gary Mills Approved by: Robert Mustacchi Author: Igor Kozhukhov illumos/illuoms-gate@6481fd49a4385db15285ddf89f9c80b45eaaa407 Modified: vendor-sys/illumos/dist/uts/common/sys/cpuvar.h Modified: vendor-sys/illumos/dist/uts/common/sys/cpuvar.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/cpuvar.h Fri Dec 5 23:43:15 2014 (r275532) +++ vendor-sys/illumos/dist/uts/common/sys/cpuvar.h Fri Dec 5 23:50:16 2014 (r275533) @@ -22,6 +22,7 @@ /* * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright 2014 Igor Kozhukhov . */ #ifndef _SYS_CPUVAR_H @@ -32,6 +33,7 @@ #include #include +#include #if (defined(_KERNEL) || defined(_KMEMUSER)) && defined(_MACHDEP) #include #endif @@ -53,15 +55,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-all@FreeBSD.ORG Fri Dec 5 23:51:21 2014 Return-Path: Delivered-To: svn-src-all@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 52BE4D7A; Fri, 5 Dec 2014 23:51: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 3F318AE3; Fri, 5 Dec 2014 23:51: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 sB5NpL6f017985; Fri, 5 Dec 2014 23:51:21 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5NpLsN017984; Fri, 5 Dec 2014 23:51:21 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412052351.sB5NpLsN017984@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 23:51:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275534 - vendor-sys/illumos/dist/uts/common/sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 23:51:21 -0000 Author: delphij Date: Fri Dec 5 23:51:20 2014 New Revision: 275534 URL: https://svnweb.freebsd.org/changeset/base/275534 Log: 5285 pass in cpu_pause_func via pause_cpus Reviewed by: Robert Mustacchi Reviewed by: Dan McDonald Approved by: Gordon Ross Author: Josef 'Jeff' Sipek illumos/illumos-gate@0ed5c46e82c989cfa9726d9dae452e3d24ef83be Modified: vendor-sys/illumos/dist/uts/common/sys/cpuvar.h Modified: vendor-sys/illumos/dist/uts/common/sys/cpuvar.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/sys/cpuvar.h Fri Dec 5 23:50:16 2014 (r275533) +++ vendor-sys/illumos/dist/uts/common/sys/cpuvar.h Fri Dec 5 23:51:20 2014 (r275534) @@ -652,7 +652,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-all@FreeBSD.ORG Fri Dec 5 23:55:46 2014 Return-Path: Delivered-To: svn-src-all@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 21D5FF0A; Fri, 5 Dec 2014 23: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 0D834BB4; Fri, 5 Dec 2014 23: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 sB5NtjYx018534; Fri, 5 Dec 2014 23:55:45 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB5NtjuD018528; Fri, 5 Dec 2014 23:55:45 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412052355.sB5NtjuD018528@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 23:55:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275535 - in vendor-sys/illumos/dist/uts/common: dtrace fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2014 23:55:46 -0000 Author: delphij Date: Fri Dec 5 23:55:44 2014 New Revision: 275535 URL: https://svnweb.freebsd.org/changeset/base/275535 Log: 5255 uts shouldn't open-code ISP2 Reviewed by: Marcel Telka Reviewed by: Dan McDonald Approved by: Robert Mustacchi Author: Josef 'Jeff' Sipek illumos/illumos-gate@de710d24d2fae4468e64da999e1d952a247f142c Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c vendor-sys/illumos/dist/uts/common/dtrace/fasttrap.c vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Fri Dec 5 23:51:20 2014 (r275534) +++ vendor-sys/illumos/dist/uts/common/dtrace/dtrace.c Fri Dec 5 23:55:44 2014 (r275535) @@ -139,7 +139,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; @@ -13039,7 +13039,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: vendor-sys/illumos/dist/uts/common/dtrace/fasttrap.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/dtrace/fasttrap.c Fri Dec 5 23:51:20 2014 (r275534) +++ vendor-sys/illumos/dist/uts/common/dtrace/fasttrap.c Fri Dec 5 23:55:44 2014 (r275535) @@ -2156,7 +2156,7 @@ fasttrap_attach(dev_info_t *devi, ddi_at 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); @@ -2169,7 +2169,7 @@ fasttrap_attach(dev_info_t *devi, ddi_at * ... 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); @@ -2182,7 +2182,7 @@ fasttrap_attach(dev_info_t *devi, ddi_at * ... 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: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Fri Dec 5 23:51:20 2014 (r275534) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Fri Dec 5 23:55:44 2014 (r275535) @@ -24,6 +24,7 @@ * Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved. */ +#include #include #include #include @@ -121,7 +122,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; #ifndef _KERNEL From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:01:20 2014 Return-Path: Delivered-To: svn-src-all@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 C56E826A; Sat, 6 Dec 2014 00:01: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 B1C5DC84; Sat, 6 Dec 2014 00:01: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 sB601Kir021401; Sat, 6 Dec 2014 00:01:20 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB601Kt9021400; Sat, 6 Dec 2014 00:01:20 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060001.sB601Kt9021400@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 00:01:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275536 - vendor/illumos/dist/tools/ctf/cvt X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:01:20 -0000 Author: delphij Date: Sat Dec 6 00:01:19 2014 New Revision: 275536 URL: https://svnweb.freebsd.org/changeset/base/275536 Log: 3363 Mark non-returning functions in ctftools Reviewed by: Richard Lowe Reviewed by: Josef 'Jeff' Sipek Approved by: Albert Lee Author: Erik Cederstrand illumos/illumos-gate@a6bde1a23b60f140c7ed78df979c2e22b1ed9b2c Modified: vendor/illumos/dist/tools/ctf/cvt/ctftools.h Modified: vendor/illumos/dist/tools/ctf/cvt/ctftools.h ============================================================================== --- vendor/illumos/dist/tools/ctf/cvt/ctftools.h Fri Dec 5 23:55:44 2014 (r275535) +++ vendor/illumos/dist/tools/ctf/cvt/ctftools.h Sat Dec 6 00:01:19 2014 (r275536) @@ -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 @@ -434,8 +434,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(char *, ...); -void aborterr(char *, ...); +void terminate(char *, ...) __NORETURN; +void aborterr(char *, ...) __NORETURN; void set_terminate_cleanup(void (*)()); void elfterminate(const char *, const char *, ...); void warning(char *, ...); From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:10:48 2014 Return-Path: Delivered-To: svn-src-all@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 6FE71539; Sat, 6 Dec 2014 00:10: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 5B8E3CF4; Sat, 6 Dec 2014 00:10: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 sB60AmoR027501; Sat, 6 Dec 2014 00:10:48 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60Al3B027499; Sat, 6 Dec 2014 00:10:47 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060010.sB60Al3B027499@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 00:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275537 - in vendor/illumos/dist: cmd/zfs lib/libzfs/common X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:10:48 -0000 Author: delphij Date: Sat Dec 6 00:10:47 2014 New Revision: 275537 URL: https://svnweb.freebsd.org/changeset/base/275537 Log: 5316 allow smbadm join to use RPC Reviewed by: Bayard Bell Reviewed by: Dan McDonald Reviewed by: Thomas Keiser Reviewed by: Matthew Ahrens Approved by: Robert Mustacchi Author: Gordon Ross illumos/illumos-gate@1ed6b69a5ca1ca3ee5e9a4931f74e2237c7e1c9f Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Modified: vendor/illumos/dist/cmd/zfs/zfs_main.c ============================================================================== --- vendor/illumos/dist/cmd/zfs/zfs_main.c Sat Dec 6 00:01:19 2014 (r275536) +++ vendor/illumos/dist/cmd/zfs/zfs_main.c Sat Dec 6 00:10:47 2014 (r275537) @@ -63,6 +63,7 @@ #include #include #include +#include #include "zfs_iter.h" #include "zfs_util.h" @@ -2372,9 +2373,8 @@ userspace_cb(void *arg, const char *doma /* SMB */ char sid[ZFS_MAXNAMELEN + 32]; uid_t id; - uint64_t classes; int err; - directory_error_t e; + int flag = IDMAP_REQ_FLG_USE_CACHE; smbentity = B_TRUE; @@ -2391,10 +2391,13 @@ userspace_cb(void *arg, const char *doma if (err == 0) { rid = id; if (!cb->cb_sid2posix) { - e = directory_name_from_sid(NULL, sid, &name, - &classes); - if (e != NULL) - directory_error_free(e); + if (type == USTYPE_SMB_USR) { + (void) idmap_getwinnamebyuid(rid, flag, + &name, NULL); + } else { + (void) idmap_getwinnamebygid(rid, flag, + &name, NULL); + } if (name == NULL) name = sid; } Modified: vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Sat Dec 6 00:01:19 2014 (r275536) +++ vendor/illumos/dist/lib/libzfs/common/libzfs_dataset.c Sat Dec 6 00:10:47 2014 (r275537) @@ -2557,7 +2557,7 @@ userquota_propname_decode(const char *pr boolean_t isuser; domain[0] = '\0'; - + *ridp = 0; /* Figure out the property type ({user|group}{quota|space}) */ for (type = 0; type < ZFS_NUM_USERQUOTA_PROPS; type++) { if (strncmp(propname, zfs_userquota_prop_prefixes[type], @@ -2578,35 +2578,61 @@ userquota_propname_decode(const char *pr * It's a SID name (eg "user@domain") that needs to be * turned into S-1-domainID-RID. */ - directory_error_t e; + int flag = 0; + idmap_stat stat, map_stat; + uid_t pid; + idmap_rid_t rid; + idmap_get_handle_t *gh = NULL; + + stat = idmap_get_create(&gh); + if (stat != IDMAP_SUCCESS) { + idmap_get_destroy(gh); + return (ENOMEM); + } if (zoned && getzoneid() == GLOBAL_ZONEID) return (ENOENT); if (isuser) { - e = directory_sid_from_user_name(NULL, - cp, &numericsid); + stat = idmap_getuidbywinname(cp, NULL, flag, &pid); + if (stat < 0) + return (ENOENT); + stat = idmap_get_sidbyuid(gh, pid, flag, &numericsid, + &rid, &map_stat); } else { - e = directory_sid_from_group_name(NULL, - cp, &numericsid); + stat = idmap_getgidbywinname(cp, NULL, flag, &pid); + if (stat < 0) + return (ENOENT); + stat = idmap_get_sidbygid(gh, pid, flag, &numericsid, + &rid, &map_stat); + } + if (stat < 0) { + idmap_get_destroy(gh); + return (ENOENT); } - if (e != NULL) { - directory_error_free(e); + stat = idmap_get_mappings(gh); + idmap_get_destroy(gh); + + if (stat < 0) { return (ENOENT); } if (numericsid == NULL) return (ENOENT); cp = numericsid; + *ridp = rid; /* will be further decoded below */ } if (strncmp(cp, "S-1-", 4) == 0) { /* It's a numeric SID (eg "S-1-234-567-89") */ (void) strlcpy(domain, cp, domainlen); - cp = strrchr(domain, '-'); - *cp = '\0'; - cp++; - errno = 0; - *ridp = strtoull(cp, &end, 10); + if (*ridp == 0) { + cp = strrchr(domain, '-'); + *cp = '\0'; + cp++; + *ridp = strtoull(cp, &end, 10); + } else { + end = ""; + } if (numericsid) { free(numericsid); numericsid = NULL; From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:12:59 2014 Return-Path: Delivered-To: svn-src-all@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 8293C680; Sat, 6 Dec 2014 00:12: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 54AB1D9B; Sat, 6 Dec 2014 00:12: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 sB60Cxh5028934; Sat, 6 Dec 2014 00:12:59 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60CwjI028928; Sat, 6 Dec 2014 00:12:58 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060012.sB60CwjI028928@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 00:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275538 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:12:59 -0000 Author: delphij Date: Sat Dec 6 00:12:58 2014 New Revision: 275538 URL: https://svnweb.freebsd.org/changeset/base/275538 Log: 5179 Remove unused ZFS ARC functions Reviewed by: Josef 'Jeff' Sipek Reviewed by: Steve Gonczi Reviewed by: Matthew Ahrens Reviewed by: Richard Elling Reviewed by: George Wilson Approved by: Richard Lowe Author: Serapheim Dimitropoulos illumos/illumos-gate@fbefb14f62976763eeaa74a0c1ac68accb38cf44 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Sat Dec 6 00:10:47 2014 (r275537) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Sat Dec 6 00:12:58 2014 (r275538) @@ -1310,23 +1310,6 @@ arc_space_return(uint64_t space, arc_spa atomic_add_64(&arc_size, -space); } -void * -arc_data_buf_alloc(uint64_t size) -{ - if (arc_evict_needed(ARC_BUFC_DATA)) - cv_signal(&arc_reclaim_thr_cv); - atomic_add_64(&arc_size, size); - return (zio_data_buf_alloc(size)); -} - -void -arc_data_buf_free(void *buf, uint64_t size) -{ - zio_data_buf_free(buf, size); - ASSERT(arc_size >= size); - atomic_add_64(&arc_size, -size); -} - arc_buf_t * arc_buf_alloc(spa_t *spa, int size, void *tag, arc_buf_contents_t type) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h Sat Dec 6 00:10:47 2014 (r275537) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/arc.h Sat Dec 6 00:12:58 2014 (r275538) @@ -83,8 +83,6 @@ typedef enum arc_space_type { void arc_space_consume(uint64_t space, arc_space_type_t type); void arc_space_return(uint64_t space, arc_space_type_t type); -void *arc_data_buf_alloc(uint64_t space); -void arc_data_buf_free(void *buf, uint64_t space); arc_buf_t *arc_buf_alloc(spa_t *spa, int size, void *tag, arc_buf_contents_t type); arc_buf_t *arc_loan_buf(spa_t *spa, int size); From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:13:57 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 00:14:39 2014 Return-Path: Delivered-To: svn-src-all@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 DDAC990A; Sat, 6 Dec 2014 00:14: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 BFD37DAF; Sat, 6 Dec 2014 00:14: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 sB60EdTg029265; Sat, 6 Dec 2014 00:14:39 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60Ed5P029262; Sat, 6 Dec 2014 00:14:39 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060014.sB60Ed5P029262@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 00:14:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275540 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:14:40 -0000 Author: delphij Date: Sat Dec 6 00:14:38 2014 New Revision: 275540 URL: https://svnweb.freebsd.org/changeset/base/275540 Log: 5213 panic in metaslab_init due to space_map_open returning ENXIO Reviewed by: Matthew Ahrens Reviewed by: George Wilson Reviewed by: Bayard Bell Reviewed by: Brian Behlendorf Reviewed by: Steven Hartland Approved by: Dan McDonald Author: Prakash Surya illumos/illumos-gate@1e9bd7ec42f2d3bf854c2da35310901194833267 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab.h vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Sat Dec 6 00:13:56 2014 (r275539) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/metaslab.c Sat Dec 6 00:14:38 2014 (r275540) @@ -1208,28 +1208,36 @@ metaslab_unload(metaslab_t *msp) msp->ms_weight &= ~METASLAB_ACTIVE_MASK; } -metaslab_t * -metaslab_init(metaslab_group_t *mg, uint64_t id, uint64_t object, uint64_t txg) +int +metaslab_init(metaslab_group_t *mg, uint64_t id, uint64_t object, uint64_t txg, + metaslab_t **msp) { vdev_t *vd = mg->mg_vd; objset_t *mos = vd->vdev_spa->spa_meta_objset; - metaslab_t *msp; + metaslab_t *ms; + int error; - msp = kmem_zalloc(sizeof (metaslab_t), KM_SLEEP); - mutex_init(&msp->ms_lock, NULL, MUTEX_DEFAULT, NULL); - cv_init(&msp->ms_load_cv, NULL, CV_DEFAULT, NULL); - msp->ms_id = id; - msp->ms_start = id << vd->vdev_ms_shift; - msp->ms_size = 1ULL << vd->vdev_ms_shift; + ms = kmem_zalloc(sizeof (metaslab_t), KM_SLEEP); + mutex_init(&ms->ms_lock, NULL, MUTEX_DEFAULT, NULL); + cv_init(&ms->ms_load_cv, NULL, CV_DEFAULT, NULL); + ms->ms_id = id; + ms->ms_start = id << vd->vdev_ms_shift; + ms->ms_size = 1ULL << vd->vdev_ms_shift; /* * We only open space map objects that already exist. All others * will be opened when we finally allocate an object for it. */ if (object != 0) { - VERIFY0(space_map_open(&msp->ms_sm, mos, object, msp->ms_start, - msp->ms_size, vd->vdev_ashift, &msp->ms_lock)); - ASSERT(msp->ms_sm != NULL); + error = space_map_open(&ms->ms_sm, mos, object, ms->ms_start, + ms->ms_size, vd->vdev_ashift, &ms->ms_lock); + + if (error != 0) { + kmem_free(ms, sizeof (metaslab_t)); + return (error); + } + + ASSERT(ms->ms_sm != NULL); } /* @@ -1239,11 +1247,11 @@ metaslab_init(metaslab_group_t *mg, uint * addition of new space; and for debugging, it ensures that we'd * data fault on any attempt to use this metaslab before it's ready. */ - msp->ms_tree = range_tree_create(&metaslab_rt_ops, msp, &msp->ms_lock); - metaslab_group_add(mg, msp); + ms->ms_tree = range_tree_create(&metaslab_rt_ops, ms, &ms->ms_lock); + metaslab_group_add(mg, ms); - msp->ms_fragmentation = metaslab_fragmentation(msp); - msp->ms_ops = mg->mg_class->mc_ops; + ms->ms_fragmentation = metaslab_fragmentation(ms); + ms->ms_ops = mg->mg_class->mc_ops; /* * If we're opening an existing pool (txg == 0) or creating @@ -1252,25 +1260,27 @@ metaslab_init(metaslab_group_t *mg, uint * does not become available until after this txg has synced. */ if (txg <= TXG_INITIAL) - metaslab_sync_done(msp, 0); + metaslab_sync_done(ms, 0); /* * If metaslab_debug_load is set and we're initializing a metaslab * that has an allocated space_map object then load the its space * map so that can verify frees. */ - if (metaslab_debug_load && msp->ms_sm != NULL) { - mutex_enter(&msp->ms_lock); - VERIFY0(metaslab_load(msp)); - mutex_exit(&msp->ms_lock); + if (metaslab_debug_load && ms->ms_sm != NULL) { + mutex_enter(&ms->ms_lock); + VERIFY0(metaslab_load(ms)); + mutex_exit(&ms->ms_lock); } if (txg != 0) { vdev_dirty(vd, 0, NULL, txg); - vdev_dirty(vd, VDD_METASLAB, msp, txg); + vdev_dirty(vd, VDD_METASLAB, ms, txg); } - return (msp); + *msp = ms; + + return (0); } void Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab.h Sat Dec 6 00:13:56 2014 (r275539) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/metaslab.h Sat Dec 6 00:14:38 2014 (r275540) @@ -42,8 +42,8 @@ typedef struct metaslab_ops { extern metaslab_ops_t *zfs_metaslab_ops; -metaslab_t *metaslab_init(metaslab_group_t *, uint64_t, - uint64_t, uint64_t); +int metaslab_init(metaslab_group_t *, uint64_t, uint64_t, uint64_t, + metaslab_t **); void metaslab_fini(metaslab_t *); void metaslab_load_wait(metaslab_t *); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Sat Dec 6 00:13:56 2014 (r275539) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/vdev.c Sat Dec 6 00:14:38 2014 (r275540) @@ -857,7 +857,11 @@ vdev_metaslab_init(vdev_t *vd, uint64_t if (error) return (error); } - vd->vdev_ms[m] = metaslab_init(vd->vdev_mg, m, object, txg); + + error = metaslab_init(vd->vdev_mg, m, object, txg, + &(vd->vdev_ms[m])); + if (error) + return (error); } if (txg == 0) From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:17:26 2014 Return-Path: Delivered-To: svn-src-all@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 4EBACA75; Sat, 6 Dec 2014 00:17: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 3B0A2DC8; Sat, 6 Dec 2014 00:17: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 sB60HQa1029675; Sat, 6 Dec 2014 00:17:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60HQEb029674; Sat, 6 Dec 2014 00:17:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060017.sB60HQEb029674@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 00:17:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275541 - vendor/illumos/dist/lib/libzfs/common/sys X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:17:26 -0000 Author: delphij Date: Sat Dec 6 00:17:25 2014 New Revision: 275541 URL: https://svnweb.freebsd.org/changeset/base/275541 Log: 5312 libzfs should be decoupled from kernel's zfs_context.h Reviewed by: Matthew Ahrens Reviewed by: Will Andrews Reviewed by: Andriy Gapon Approved by: Dan McDonald Author: Justin T. Gibbs illumos/illumos-gate@587644a8567e6a9533f88401daa59cbd78c4632f Added: vendor/illumos/dist/lib/libzfs/common/sys/ vendor/illumos/dist/lib/libzfs/common/sys/zfs_context.h (contents, props changed) Added: vendor/illumos/dist/lib/libzfs/common/sys/zfs_context.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/illumos/dist/lib/libzfs/common/sys/zfs_context.h Sat Dec 6 00:17:25 2014 (r275541) @@ -0,0 +1,37 @@ +/* + * CDDL HEADER START + * + * This file and its contents are supplied under the terms of the + * Common Development and Distribution License ("CDDL"), version 1.0. + * You may only use this file in accordance with the terms of version + * 1.0 of the CDDL. + * + * A full copy of the text of the CDDL should have accompanied this + * source. A copy of the CDDL is also available via the Internet at + * http://www.illumos.org/license/CDDL. + * + * CDDL HEADER END + */ +/* + * Copyright 2014 Spectra Logic Corporation. All rights reserved. + */ + +#ifndef _SYS_ZFS_CONTEXT_H +#define _SYS_ZFS_CONTEXT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include +#include +#include + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_ZFS_CONTEXT_H */ From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:18:54 2014 Return-Path: Delivered-To: svn-src-all@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 A3B78D09; Sat, 6 Dec 2014 00:18: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 8F8B8DDE; Sat, 6 Dec 2014 00:18: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 sB60IsSX030021; Sat, 6 Dec 2014 00:18:54 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60IsV6030020; Sat, 6 Dec 2014 00:18:54 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060018.sB60IsV6030020@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 00:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275542 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:18:54 -0000 Author: delphij Date: Sat Dec 6 00:18:53 2014 New Revision: 275542 URL: https://svnweb.freebsd.org/changeset/base/275542 Log: 5311 traverse_dnode may report success when it should not Reviewed by: Matthew Ahrens Reviewed by: Andriy Gapon Reviewed by: Will Andrews Approved by: Dan McDonald Author: Justin T. Gibbs illumos/illumos-gate@2a89c2c59b7c2beb2373c14368cbe7e32af6ffc1 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Sat Dec 6 00:17:25 2014 (r275541) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Sat Dec 6 00:18:53 2014 (r275542) @@ -429,7 +429,7 @@ traverse_dnode(traverse_data_t *td, cons break; } - if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) { + if (err == 0 && dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) { SET_BOOKMARK(&czb, objset, object, 0, DMU_SPILL_BLKID); err = traverse_visitbp(td, dnp, &dnp->dn_spill, &czb); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:31:59 2014 Return-Path: Delivered-To: svn-src-all@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 50CD9FC1; Sat, 6 Dec 2014 00:31: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 334F2F6D; Sat, 6 Dec 2014 00:31: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 sB60Vxeu038469; Sat, 6 Dec 2014 00:31:59 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60VwKi038467; Sat, 6 Dec 2014 00:31:58 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060031.sB60VwKi038467@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 00:31:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275543 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:31:59 -0000 Author: delphij Date: Sat Dec 6 00:31:58 2014 New Revision: 275543 URL: https://svnweb.freebsd.org/changeset/base/275543 Log: 5310 Remove always true tests for non-NULL ds->ds_phys Reviewed by: Matthew Ahrens Reviewed by: Will Andrews Reviewed by: Andriy Gapon Approved by: Dan McDonald Author: Justin T. Gibbs illumos/illumos-gate@d808a4fc6ac40e878a28e96f1ad7dd2ec439bfbf Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Sat Dec 6 00:18:53 2014 (r275542) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Sat Dec 6 00:31:58 2014 (r275543) @@ -634,16 +634,14 @@ dsl_dataset_rele(dsl_dataset_t *ds, void void dsl_dataset_disown(dsl_dataset_t *ds, void *tag) { - ASSERT(ds->ds_owner == tag && ds->ds_dbuf != NULL); + ASSERT3P(ds->ds_owner, ==, tag); + ASSERT(ds->ds_dbuf != NULL); mutex_enter(&ds->ds_lock); ds->ds_owner = NULL; mutex_exit(&ds->ds_lock); dsl_dataset_long_rele(ds, tag); - if (ds->ds_dbuf != NULL) - dsl_dataset_rele(ds, tag); - else - dsl_dataset_evict(NULL, ds); + dsl_dataset_rele(ds, tag); } boolean_t Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c Sat Dec 6 00:18:53 2014 (r275542) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c Sat Dec 6 00:31:58 2014 (r275543) @@ -168,8 +168,8 @@ dsl_prop_get_ds(dsl_dataset_t *ds, const ASSERT(dsl_pool_config_held(ds->ds_dir->dd_pool)); inheritable = (prop == ZPROP_INVAL || zfs_prop_inheritable(prop)); - snapshot = (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds)); - zapobj = (ds->ds_phys == NULL ? 0 : ds->ds_phys->ds_props_obj); + snapshot = dsl_dataset_is_snapshot(ds); + zapobj = ds->ds_phys->ds_props_obj; if (zapobj != 0) { objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; @@ -544,7 +544,7 @@ dsl_prop_set_sync_impl(dsl_dataset_t *ds isint = (dodefault(propname, 8, 1, &intval) == 0); - if (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds)) { + if (dsl_dataset_is_snapshot(ds)) { ASSERT(version >= SPA_VERSION_SNAP_PROPS); if (ds->ds_phys->ds_props_obj == 0) { dmu_buf_will_dirty(ds->ds_dbuf, tx); @@ -641,7 +641,7 @@ dsl_prop_set_sync_impl(dsl_dataset_t *ds if (isint) { VERIFY0(dsl_prop_get_int_ds(ds, propname, &intval)); - if (ds->ds_phys != NULL && dsl_dataset_is_snapshot(ds)) { + if (dsl_dataset_is_snapshot(ds)) { dsl_prop_cb_record_t *cbr; /* * It's a snapshot; nothing can inherit this From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:33:10 2014 Return-Path: Delivered-To: svn-src-all@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 97CE7171; Sat, 6 Dec 2014 00:33: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 83C81F73; Sat, 6 Dec 2014 00:33: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 sB60XAmZ038680; Sat, 6 Dec 2014 00:33:10 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60XAua038679; Sat, 6 Dec 2014 00:33:10 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060033.sB60XAua038679@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 00:33:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275544 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:33:10 -0000 Author: delphij Date: Sat Dec 6 00:33:09 2014 New Revision: 275544 URL: https://svnweb.freebsd.org/changeset/base/275544 Log: 5350 clean up code in dnode_sync() Reviewed by: Alex Reece Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Richard Elling Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@e6518318428d2be1962bf2d47fd83ebfe8cb2736 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Sat Dec 6 00:31:58 2014 (r275543) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode_sync.c Sat Dec 6 00:33:09 2014 (r275544) @@ -633,12 +633,11 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx) dn->dn_free_txg <= tx->tx_txg; /* - * We will either remove a spill block when a file is being removed - * or we have been asked to remove it. + * Remove the spill block if we have been explicitly asked to + * remove it, or if the object is being removed. */ - if (dn->dn_rm_spillblk[txgoff] || - ((dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) && freeing_dnode)) { - if ((dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR)) + if (dn->dn_rm_spillblk[txgoff] || freeing_dnode) { + if (dnp->dn_flags & DNODE_FLAG_SPILL_BLKPTR) kill_spill = B_TRUE; dn->dn_rm_spillblk[txgoff] = 0; } From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:34:26 2014 Return-Path: Delivered-To: svn-src-all@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 959742AB; Sat, 6 Dec 2014 00:34: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 81B36F83; Sat, 6 Dec 2014 00:34: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 sB60YQs5038874; Sat, 6 Dec 2014 00:34:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60YQDA038873; Sat, 6 Dec 2014 00:34:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060034.sB60YQDA038873@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 00:34:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275545 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:34:26 -0000 Author: delphij Date: Sat Dec 6 00:34:25 2014 New Revision: 275545 URL: https://svnweb.freebsd.org/changeset/base/275545 Log: 5348 zio_checksum_error() only fills in info if ECKSUM Reviewed by: Alex Reece Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Steven Hartland Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@373dc1cf9a4e0791397a9b268cdac1f664af58a8 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Sat Dec 6 00:33:09 2014 (r275544) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Sat Dec 6 00:34:25 2014 (r275545) @@ -2817,7 +2817,8 @@ zio_checksum_verify(zio_t *zio) if ((error = zio_checksum_error(zio, &info)) != 0) { zio->io_error = error; - if (!(zio->io_flags & ZIO_FLAG_SPECULATIVE)) { + if (error == ECKSUM && + !(zio->io_flags & ZIO_FLAG_SPECULATIVE)) { zfs_ereport_start_checksum(zio->io_spa, zio->io_vd, zio, zio->io_offset, zio->io_size, NULL, &info); From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:37:01 2014 Return-Path: Delivered-To: svn-src-all@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 B6849419; Sat, 6 Dec 2014 00:37: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 9860FFA4; Sat, 6 Dec 2014 00:37: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 sB60b1vi039252; Sat, 6 Dec 2014 00:37:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60b14j039251; Sat, 6 Dec 2014 00:37:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060037.sB60b14j039251@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 00:37:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275546 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:37:01 -0000 Author: delphij Date: Sat Dec 6 00:37:00 2014 New Revision: 275546 URL: https://svnweb.freebsd.org/changeset/base/275546 Log: 5351 scrub goes for an extra second each txg 5352 scrub should pause when there is some dirty data Reviewed by: Alex Reece Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Richard Elling Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@6f6a76adacda33b10633476dc6c5d66d7f17dd94 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Sat Dec 6 00:34:25 2014 (r275545) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Sat Dec 6 00:37:00 2014 (r275546) @@ -389,12 +389,11 @@ dsl_scan_sync_state(dsl_scan_t *scn, dmu &scn->scn_phys, tx)); } +extern int zfs_vdev_async_write_active_min_dirty_percent; + static boolean_t dsl_scan_check_pause(dsl_scan_t *scn, const zbookmark_phys_t *zb) { - uint64_t elapsed_nanosecs; - int mintime; - /* we never skip user/group accounting objects */ if (zb && (int64_t)zb->zb_object < 0) return (B_FALSE); @@ -409,12 +408,28 @@ dsl_scan_check_pause(dsl_scan_t *scn, co if (zb && zb->zb_level != 0) return (B_FALSE); - mintime = (scn->scn_phys.scn_func == POOL_SCAN_RESILVER) ? + /* + * We pause if: + * - we have scanned for the maximum time: an entire txg + * timeout (default 5 sec) + * or + * - we have scanned for at least the minimum time (default 1 sec + * for scrub, 3 sec for resilver), and either we have sufficient + * dirty data that we are starting to write more quickly + * (default 30%), or someone is explicitly waiting for this txg + * to complete. + * or + * - the spa is shutting down because this pool is being exported + * or the machine is rebooting. + */ + int mintime = (scn->scn_phys.scn_func == POOL_SCAN_RESILVER) ? zfs_resilver_min_time_ms : zfs_scan_min_time_ms; - elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time; - if (elapsed_nanosecs / NANOSEC > zfs_txg_timeout || + uint64_t elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time; + int dirty_pct = scn->scn_dp->dp_dirty_total * 100 / zfs_dirty_data_max; + if (elapsed_nanosecs / NANOSEC >= zfs_txg_timeout || (NSEC2MSEC(elapsed_nanosecs) > mintime && - txg_sync_waiting(scn->scn_dp)) || + (txg_sync_waiting(scn->scn_dp) || + dirty_pct >= zfs_vdev_async_write_active_min_dirty_percent)) || spa_shutting_down(scn->scn_dp->dp_spa)) { if (zb) { dprintf("pausing at bookmark %llx/%llx/%llx/%llx\n", From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:38:56 2014 Return-Path: Delivered-To: svn-src-all@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 DD6BE580; Sat, 6 Dec 2014 00:38: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 BE5BCFBE; Sat, 6 Dec 2014 00:38: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 sB60cuAZ039495; Sat, 6 Dec 2014 00:38:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60cuq8039494; Sat, 6 Dec 2014 00:38:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060038.sB60cuq8039494@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 00:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275547 - vendor/illumos/dist/man/man1m X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:38:57 -0000 Author: delphij Date: Sat Dec 6 00:38:55 2014 New Revision: 275547 URL: https://svnweb.freebsd.org/changeset/base/275547 Log: 4181 zfs(1m): 'zfs allow' examples in the man page are outdated Reviewed by: Richard Lowe Reviewed by: Gordon Ross Reviewed by: Yuri Pankov Approved by: Dan McDonald Author: Marcel Telka illumos/illumos-gate@5619b3f84733e187bc34bca49abbec8bdfcd7d99 Modified: vendor/illumos/dist/man/man1m/zfs.1m Modified: vendor/illumos/dist/man/man1m/zfs.1m ============================================================================== --- vendor/illumos/dist/man/man1m/zfs.1m Sat Dec 6 00:37:00 2014 (r275546) +++ vendor/illumos/dist/man/man1m/zfs.1m Sat Dec 6 00:38:55 2014 (r275547) @@ -24,11 +24,11 @@ .\" Copyright 2011 Joshua M. Clulow .\" Copyright (c) 2014 by Delphix. All rights reserved. .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. -.\" Copyright 2013 Nexenta Systems, Inc. All Rights Reserved. .\" Copyright (c) 2014, Joyent, Inc. All rights reserved. .\" Copyright (c) 2014 by Adam Stevko. All rights reserved. +.\" Copyright 2014 Nexenta Systems, Inc. All Rights Reserved. .\" -.TH ZFS 1M "March 6, 2014" +.TH ZFS 1M "November 11, 2014" .SH NAME zfs \- configures ZFS file systems .SH SYNOPSIS @@ -4038,10 +4038,9 @@ permissions on \fBtank/cindys\fR are als .nf # \fBzfs allow cindys create,destroy,mount,snapshot tank/cindys\fR # \fBzfs allow tank/cindys\fR -------------------------------------------------------------- -Local+Descendent permissions on (tank/cindys) - user cindys create,destroy,mount,snapshot -------------------------------------------------------------- +---- Permissions on tank/cindys -------------------------------------- +Local+Descendent permissions: + user cindys create,destroy,mount,snapshot .fi .in -2 .sp @@ -4074,12 +4073,11 @@ The permissions on \fBtank/users\fR are # \fBzfs allow staff create,mount tank/users\fR # \fBzfs allow -c destroy tank/users\fR # \fBzfs allow tank/users\fR -------------------------------------------------------------- -Create time permissions on (tank/users) - create,destroy -Local+Descendent permissions on (tank/users) - group staff create,mount -------------------------------------------------------------- +---- Permissions on tank/users --------------------------------------- +Permission sets: + destroy +Local+Descendent permissions: + group staff create,mount .fi .in -2 .sp @@ -4098,14 +4096,11 @@ displayed. # \fBzfs allow -s @pset create,destroy,snapshot,mount tank/users\fR # \fBzfs allow staff @pset tank/users\fR # \fBzfs allow tank/users\fR -------------------------------------------------------------- -Permission sets on (tank/users) +---- Permissions on tank/users --------------------------------------- +Permission sets: @pset create,destroy,mount,snapshot -Create time permissions on (tank/users) - create,destroy -Local+Descendent permissions on (tank/users) - group staff @pset,create,mount -------------------------------------------------------------- +Local+Descendent permissions: + group staff @pset .fi .in -2 .sp @@ -4123,14 +4118,13 @@ also displayed. .nf # \fBzfs allow cindys quota,reservation users/home\fR # \fBzfs allow users/home\fR -------------------------------------------------------------- -Local+Descendent permissions on (users/home) +---- Permissions on users/home --------------------------------------- +Local+Descendent permissions: user cindys quota,reservation -------------------------------------------------------------- cindys% \fBzfs set quota=10G users/home/marks\fR cindys% \fBzfs get quota users/home/marks\fR -NAME PROPERTY VALUE SOURCE -users/home/marks quota 10G local +NAME PROPERTY VALUE SOURCE +users/home/marks quota 10G local .fi .in -2 .sp @@ -4148,14 +4142,11 @@ The following example shows how to remov .nf # \fBzfs unallow staff snapshot tank/users\fR # \fBzfs allow tank/users\fR -------------------------------------------------------------- -Permission sets on (tank/users) +---- Permissions on tank/users --------------------------------------- +Permission sets: @pset create,destroy,mount,snapshot -Create time permissions on (tank/users) - create,destroy -Local+Descendent permissions on (tank/users) - group staff @pset,create,mount -------------------------------------------------------------- +Local+Descendent permissions: + group staff @pset .fi .in -2 .sp From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:42:32 2014 Return-Path: Delivered-To: svn-src-all@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 E8DD3818; Sat, 6 Dec 2014 00:42: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 D4D80DC; Sat, 6 Dec 2014 00:42: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 sB60gVrY043366; Sat, 6 Dec 2014 00:42:31 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60gVhW043364; Sat, 6 Dec 2014 00:42:31 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060042.sB60gVhW043364@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 00:42:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275548 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:42:32 -0000 Author: delphij Date: Sat Dec 6 00:42:30 2014 New Revision: 275548 URL: https://svnweb.freebsd.org/changeset/base/275548 Log: 5349 verify that block pointer is plausible before reading Reviewed by: Alex Reece Reviewed by: Christopher Siden Reviewed by: Dan McDonald Reviewed by: George Wilson Reviewed by: Richard Lowe Reviewed by: Xin Li Reviewed by: Josef 'Jeff' Sipek Approved by: Gordon Ross Author: Matthew Ahrens illumos/illumos-gate@f63ab3d5a84a12b474655fc7e700db3efba6c4c9 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Sat Dec 6 00:38:55 2014 (r275547) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/spa.h Sat Dec 6 00:42:30 2014 (r275548) @@ -791,6 +791,7 @@ extern boolean_t spa_is_root(spa_t *spa) extern boolean_t spa_writeable(spa_t *spa); extern boolean_t spa_has_pending_synctask(spa_t *spa); extern int spa_maxblocksize(spa_t *spa); +extern void zfs_blkptr_verify(spa_t *spa, const blkptr_t *bp); extern int spa_mode(spa_t *spa); extern uint64_t strtonum(const char *str, char **nptr); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Sat Dec 6 00:38:55 2014 (r275547) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/zio.c Sat Dec 6 00:42:30 2014 (r275548) @@ -216,7 +216,7 @@ zio_buf_alloc(size_t size) { size_t c = (size - 1) >> SPA_MINBLOCKSHIFT; - ASSERT3U(c, <, SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT); + VERIFY3U(c, <, SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT); return (kmem_cache_alloc(zio_buf_cache[c], KM_PUSHPAGE)); } @@ -232,7 +232,7 @@ zio_data_buf_alloc(size_t size) { size_t c = (size - 1) >> SPA_MINBLOCKSHIFT; - ASSERT(c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT); + VERIFY3U(c, <, SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT); return (kmem_cache_alloc(zio_data_buf_cache[c], KM_PUSHPAGE)); } @@ -242,7 +242,7 @@ zio_buf_free(void *buf, size_t size) { size_t c = (size - 1) >> SPA_MINBLOCKSHIFT; - ASSERT(c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT); + VERIFY3U(c, <, SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT); kmem_cache_free(zio_buf_cache[c], buf); } @@ -252,7 +252,7 @@ zio_data_buf_free(void *buf, size_t size { size_t c = (size - 1) >> SPA_MINBLOCKSHIFT; - ASSERT(c < SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT); + VERIFY3U(c, <, SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT); kmem_cache_free(zio_data_buf_cache[c], buf); } @@ -596,6 +596,86 @@ zio_root(spa_t *spa, zio_done_func_t *do return (zio_null(NULL, spa, NULL, done, private, flags)); } +void +zfs_blkptr_verify(spa_t *spa, const blkptr_t *bp) +{ + if (!DMU_OT_IS_VALID(BP_GET_TYPE(bp))) { + zfs_panic_recover("blkptr at %p has invalid TYPE %llu", + bp, (longlong_t)BP_GET_TYPE(bp)); + } + if (BP_GET_CHECKSUM(bp) >= ZIO_CHECKSUM_FUNCTIONS || + BP_GET_CHECKSUM(bp) <= ZIO_CHECKSUM_ON) { + zfs_panic_recover("blkptr at %p has invalid CHECKSUM %llu", + bp, (longlong_t)BP_GET_CHECKSUM(bp)); + } + if (BP_GET_COMPRESS(bp) >= ZIO_COMPRESS_FUNCTIONS || + BP_GET_COMPRESS(bp) <= ZIO_COMPRESS_ON) { + zfs_panic_recover("blkptr at %p has invalid COMPRESS %llu", + bp, (longlong_t)BP_GET_COMPRESS(bp)); + } + if (BP_GET_LSIZE(bp) > SPA_MAXBLOCKSIZE) { + zfs_panic_recover("blkptr at %p has invalid LSIZE %llu", + bp, (longlong_t)BP_GET_LSIZE(bp)); + } + if (BP_GET_PSIZE(bp) > SPA_MAXBLOCKSIZE) { + zfs_panic_recover("blkptr at %p has invalid PSIZE %llu", + bp, (longlong_t)BP_GET_PSIZE(bp)); + } + + if (BP_IS_EMBEDDED(bp)) { + if (BPE_GET_ETYPE(bp) > NUM_BP_EMBEDDED_TYPES) { + zfs_panic_recover("blkptr at %p has invalid ETYPE %llu", + bp, (longlong_t)BPE_GET_ETYPE(bp)); + } + } + + /* + * Pool-specific checks. + * + * Note: it would be nice to verify that the blk_birth and + * BP_PHYSICAL_BIRTH() are not too large. However, spa_freeze() + * allows the birth time of log blocks (and dmu_sync()-ed blocks + * that are in the log) to be arbitrarily large. + */ + for (int i = 0; i < BP_GET_NDVAS(bp); i++) { + uint64_t vdevid = DVA_GET_VDEV(&bp->blk_dva[i]); + if (vdevid >= spa->spa_root_vdev->vdev_children) { + zfs_panic_recover("blkptr at %p DVA %u has invalid " + "VDEV %llu", + bp, i, (longlong_t)vdevid); + } + vdev_t *vd = spa->spa_root_vdev->vdev_child[vdevid]; + if (vd == NULL) { + zfs_panic_recover("blkptr at %p DVA %u has invalid " + "VDEV %llu", + bp, i, (longlong_t)vdevid); + } + if (vd->vdev_ops == &vdev_hole_ops) { + zfs_panic_recover("blkptr at %p DVA %u has hole " + "VDEV %llu", + bp, i, (longlong_t)vdevid); + + } + if (vd->vdev_ops == &vdev_missing_ops) { + /* + * "missing" vdevs are valid during import, but we + * don't have their detailed info (e.g. asize), so + * we can't perform any more checks on them. + */ + continue; + } + uint64_t offset = DVA_GET_OFFSET(&bp->blk_dva[i]); + uint64_t asize = DVA_GET_ASIZE(&bp->blk_dva[i]); + if (BP_IS_GANG(bp)) + asize = vdev_psize_to_asize(vd, SPA_GANGBLOCKSIZE); + if (offset + asize > vd->vdev_asize) { + zfs_panic_recover("blkptr at %p DVA %u has invalid " + "OFFSET %llu", + bp, i, (longlong_t)offset); + } + } +} + zio_t * zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, void *data, uint64_t size, zio_done_func_t *done, void *private, @@ -603,6 +683,8 @@ zio_read(zio_t *pio, spa_t *spa, const b { zio_t *zio; + zfs_blkptr_verify(spa, bp); + zio = zio_create(pio, spa, BP_PHYSICAL_BIRTH(bp), bp, data, size, done, private, ZIO_TYPE_READ, priority, flags, NULL, 0, zb, From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:45:27 2014 Return-Path: Delivered-To: svn-src-all@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 D9DAC970; Sat, 6 Dec 2014 00:45: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 C6124FD; Sat, 6 Dec 2014 00:45: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 sB60jRsV043822; Sat, 6 Dec 2014 00:45:27 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60jRql043821; Sat, 6 Dec 2014 00:45:27 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060045.sB60jRql043821@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 00:45:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275549 - vendor-sys/illumos/dist/uts/common/fs/zfs X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:45:28 -0000 Author: delphij Date: Sat Dec 6 00:45:27 2014 New Revision: 275549 URL: https://svnweb.freebsd.org/changeset/base/275549 Log: 5368 ARC should cache more metadata Reviewed by: Alex Reece Reviewed by: Christopher Siden Reviewed by: George Wilson Reviewed by: Richard Elling Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@3a5286a1cffceafcd8cf79c4156fad605129bf50 Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Sat Dec 6 00:42:30 2014 (r275548) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/arc.c Sat Dec 6 00:45:27 2014 (r275549) @@ -196,6 +196,7 @@ static boolean_t arc_warm; uint64_t zfs_arc_max; uint64_t zfs_arc_min; uint64_t zfs_arc_meta_limit = 0; +uint64_t zfs_arc_meta_min = 0; int zfs_arc_grow_retry = 0; int zfs_arc_shrink_shift = 0; int zfs_arc_p_min_shift = 0; @@ -324,6 +325,7 @@ typedef struct arc_stats { kstat_named_t arcstat_meta_used; kstat_named_t arcstat_meta_limit; kstat_named_t arcstat_meta_max; + kstat_named_t arcstat_meta_min; } arc_stats_t; static arc_stats_t arc_stats = { @@ -389,7 +391,8 @@ static arc_stats_t arc_stats = { { "duplicate_reads", KSTAT_DATA_UINT64 }, { "arc_meta_used", KSTAT_DATA_UINT64 }, { "arc_meta_limit", KSTAT_DATA_UINT64 }, - { "arc_meta_max", KSTAT_DATA_UINT64 } + { "arc_meta_max", KSTAT_DATA_UINT64 }, + { "arc_meta_min", KSTAT_DATA_UINT64 } }; #define ARCSTAT(stat) (arc_stats.stat.value.ui64) @@ -452,6 +455,7 @@ static arc_state_t *arc_l2c_only; #define arc_c_min ARCSTAT(arcstat_c_min) /* min target cache size */ #define arc_c_max ARCSTAT(arcstat_c_max) /* max target cache size */ #define arc_meta_limit ARCSTAT(arcstat_meta_limit) /* max size for metadata */ +#define arc_meta_min ARCSTAT(arcstat_meta_min) /* min size for metadata */ #define arc_meta_used ARCSTAT(arcstat_meta_used) /* size of metadata */ #define arc_meta_max ARCSTAT(arcstat_meta_max) /* max size of metadata */ @@ -1779,7 +1783,6 @@ arc_evict(arc_state_t *state, uint64_t s arc_state_t *evicted_state; uint64_t bytes_evicted = 0, skipped = 0, missed = 0; arc_buf_hdr_t *ab, *ab_prev = NULL; - list_t *list = &state->arcs_list[type]; kmutex_t *hash_lock; boolean_t have_lock; void *stolen = NULL; @@ -1793,6 +1796,50 @@ arc_evict(arc_state_t *state, uint64_t s mutex_enter(&state->arcs_mtx); mutex_enter(&evicted_state->arcs_mtx); + /* + * Decide which "type" (data vs metadata) to recycle from. + * + * If we are over the metadata limit, recycle from metadata. + * If we are under the metadata minimum, recycle from data. + * Otherwise, recycle from whichever type has the oldest (least + * recently accessed) header. + */ + if (recycle) { + arc_buf_hdr_t *data_hdr = + list_tail(&state->arcs_list[ARC_BUFC_DATA]); + arc_buf_hdr_t *metadata_hdr = + list_tail(&state->arcs_list[ARC_BUFC_METADATA]); + arc_buf_contents_t realtype; + if (data_hdr == NULL) { + realtype = ARC_BUFC_METADATA; + } else if (metadata_hdr == NULL) { + realtype = ARC_BUFC_DATA; + } else if (arc_meta_used >= arc_meta_limit) { + realtype = ARC_BUFC_METADATA; + } else if (arc_meta_used <= arc_meta_min) { + realtype = ARC_BUFC_DATA; + } else { + if (data_hdr->b_arc_access < + metadata_hdr->b_arc_access) { + realtype = ARC_BUFC_DATA; + } else { + realtype = ARC_BUFC_METADATA; + } + } + if (realtype != type) { + /* + * If we want to evict from a different list, + * we can not recycle, because DATA vs METADATA + * buffers are segregated into different kmem + * caches (and vmem arenas). + */ + type = realtype; + recycle = B_FALSE; + } + } + + list_t *list = &state->arcs_list[type]; + for (ab = list_tail(list); ab; ab = ab_prev) { ab_prev = list_prev(list, ab); /* prefetch buffers have a minimum lifespan */ @@ -3755,6 +3802,12 @@ arc_init(void) if (arc_c_min < arc_meta_limit / 2 && zfs_arc_min == 0) arc_c_min = arc_meta_limit / 2; + if (zfs_arc_meta_min > 0) { + arc_meta_min = zfs_arc_meta_min; + } else { + arc_meta_min = arc_c_min / 2; + } + if (zfs_arc_grow_retry > 0) arc_grow_retry = zfs_arc_grow_retry; From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:47:33 2014 Return-Path: Delivered-To: svn-src-all@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 91EC7AA4; Sat, 6 Dec 2014 00:47: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 7DB6810C; Sat, 6 Dec 2014 00:47: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 sB60lX5j044117; Sat, 6 Dec 2014 00:47:33 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60lWuH044113; Sat, 6 Dec 2014 00:47:32 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060047.sB60lWuH044113@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 00:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275550 - in vendor-sys/illumos/dist/uts/common/fs/zfs: . sys X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:47:33 -0000 Author: delphij Date: Sat Dec 6 00:47:31 2014 New Revision: 275550 URL: https://svnweb.freebsd.org/changeset/base/275550 Log: 5347 idle pool may run itself out of space Reviewed by: Alex Reece Reviewed by: George Wilson Reviewed by: Steven Hartland Reviewed by: Richard Elling Approved by: Dan McDonald Author: Matthew Ahrens illumos/illumos-gate@231aab857f14a3e7a0ed5f2879399c3cd6ae92ea Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/uberblock.h vendor-sys/illumos/dist/uts/common/fs/zfs/uberblock.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Sat Dec 6 00:45:27 2014 (r275549) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c Sat Dec 6 00:47:31 2014 (r275550) @@ -1449,13 +1449,6 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * "traverse_dataset_destroyed()", err); } - /* - * If we didn't make progress, mark the async destroy as - * stalled, so that we will not initiate a spa_sync() on - * its behalf. - */ - scn->scn_async_stalled = (scn->scn_visited_this_txg == 0); - if (bptree_is_empty(dp->dp_meta_objset, dp->dp_bptree_obj)) { /* finished; deactivate async destroy feature */ spa_feature_decr(spa, SPA_FEATURE_ASYNC_DESTROY, tx); @@ -1468,6 +1461,18 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * dp->dp_bptree_obj, tx)); dp->dp_bptree_obj = 0; scn->scn_async_destroying = B_FALSE; + scn->scn_async_stalled = B_FALSE; + } else { + /* + * If we didn't make progress, mark the async + * destroy as stalled, so that we will not initiate + * a spa_sync() on its behalf. Note that we only + * check this if we are not finished, because if the + * bptree had no blocks for us to visit, we can + * finish without "making progress". + */ + scn->scn_async_stalled = + (scn->scn_visited_this_txg == 0); } } if (scn->scn_visited_this_txg) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Sat Dec 6 00:45:27 2014 (r275549) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c Sat Dec 6 00:47:31 2014 (r275550) @@ -6262,21 +6262,6 @@ spa_sync(spa_t *spa, uint64_t txg) } /* - * If anything has changed in this txg, or if someone is waiting - * for this txg to sync (eg, spa_vdev_remove()), push the - * deferred frees from the previous txg. If not, leave them - * alone so that we don't generate work on an otherwise idle - * system. - */ - if (!txg_list_empty(&dp->dp_dirty_datasets, txg) || - !txg_list_empty(&dp->dp_dirty_dirs, txg) || - !txg_list_empty(&dp->dp_sync_tasks, txg) || - ((dsl_scan_active(dp->dp_scan) || - txg_sync_waiting(dp)) && !spa_shutting_down(spa))) { - spa_sync_deferred_frees(spa, tx); - } - - /* * Iterate to convergence. */ do { @@ -6293,6 +6278,11 @@ spa_sync(spa_t *spa, uint64_t txg) if (pass < zfs_sync_pass_deferred_free) { spa_sync_frees(spa, free_bpl, tx); } else { + /* + * We can not defer frees in pass 1, because + * we sync the deferred frees later in pass 1. + */ + ASSERT3U(pass, >, 1); bplist_iterate(free_bpl, bpobj_enqueue_cb, &spa->spa_deferred_bpobj, tx); } @@ -6303,8 +6293,37 @@ spa_sync(spa_t *spa, uint64_t txg) while (vd = txg_list_remove(&spa->spa_vdev_txg_list, txg)) vdev_sync(vd, txg); - if (pass == 1) + if (pass == 1) { spa_sync_upgrades(spa, tx); + ASSERT3U(txg, >=, + spa->spa_uberblock.ub_rootbp.blk_birth); + /* + * Note: We need to check if the MOS is dirty + * because we could have marked the MOS dirty + * without updating the uberblock (e.g. if we + * have sync tasks but no dirty user data). We + * need to check the uberblock's rootbp because + * it is updated if we have synced out dirty + * data (though in this case the MOS will most + * likely also be dirty due to second order + * effects, we don't want to rely on that here). + */ + if (spa->spa_uberblock.ub_rootbp.blk_birth < txg && + !dmu_objset_is_dirty(mos, txg)) { + /* + * Nothing changed on the first pass, + * therefore this TXG is a no-op. Avoid + * syncing deferred frees, so that we + * can keep this TXG as a no-op. + */ + ASSERT(txg_list_empty(&dp->dp_dirty_datasets, + txg)); + ASSERT(txg_list_empty(&dp->dp_dirty_dirs, txg)); + ASSERT(txg_list_empty(&dp->dp_sync_tasks, txg)); + break; + } + spa_sync_deferred_frees(spa, tx); + } } while (dmu_objset_is_dirty(mos, txg)); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/sys/uberblock.h ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/sys/uberblock.h Sat Dec 6 00:45:27 2014 (r275549) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/sys/uberblock.h Sat Dec 6 00:47:31 2014 (r275550) @@ -22,6 +22,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright (c) 2014 by Delphix. All rights reserved. + */ #ifndef _SYS_UBERBLOCK_H #define _SYS_UBERBLOCK_H @@ -36,8 +39,8 @@ extern "C" { typedef struct uberblock uberblock_t; -extern int uberblock_verify(uberblock_t *ub); -extern int uberblock_update(uberblock_t *ub, vdev_t *rvd, uint64_t txg); +extern int uberblock_verify(uberblock_t *); +extern boolean_t uberblock_update(uberblock_t *, vdev_t *, uint64_t); #ifdef __cplusplus } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/uberblock.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/uberblock.c Sat Dec 6 00:45:27 2014 (r275549) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/uberblock.c Sat Dec 6 00:47:31 2014 (r275550) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, 2014 by Delphix. All rights reserved. */ #include @@ -40,10 +40,10 @@ uberblock_verify(uberblock_t *ub) } /* - * Update the uberblock and return a boolean value indicating whether - * anything changed in this transaction group. + * Update the uberblock and return TRUE if anything changed in this + * transaction group. */ -int +boolean_t uberblock_update(uberblock_t *ub, vdev_t *rvd, uint64_t txg) { ASSERT(ub->ub_txg < txg); From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:50:58 2014 Return-Path: Delivered-To: svn-src-all@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 B1896C09; Sat, 6 Dec 2014 00:50: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 925381C1; Sat, 6 Dec 2014 00:50: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 sB60owMo045853; Sat, 6 Dec 2014 00:50:58 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60owYO045852; Sat, 6 Dec 2014 00:50:58 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060050.sB60owYO045852@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 00:50:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275551 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:50:58 -0000 Author: delphij Date: Sat Dec 6 00:50:57 2014 New Revision: 275551 URL: https://svnweb.freebsd.org/changeset/base/275551 Log: 5314 Remove "dbuf phys" db->db_data pointer aliases in ZFS Reviewed by: Andriy Gapon Reviewed by: Matthew Ahrens Reviewed by: Will Andrews Approved by: Dan McDonald Author: Justin T. Gibbs illumos/illumos-gate@c1379625401dfbe1c39b79136dd384a571d47fde Modified: vendor/illumos/dist/cmd/zdb/zdb.c Changes in other areas also in this revision: Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_bookmark.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deleg.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_synctask.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_userhold.c vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dir.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_leaf.h vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c vendor-sys/illumos/dist/uts/common/fs/zfs/zap_leaf.c vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Modified: vendor/illumos/dist/cmd/zdb/zdb.c ============================================================================== --- vendor/illumos/dist/cmd/zdb/zdb.c Sat Dec 6 00:47:31 2014 (r275550) +++ vendor/illumos/dist/cmd/zdb/zdb.c Sat Dec 6 00:50:57 2014 (r275551) @@ -1857,8 +1857,8 @@ dump_dir(objset_t *os) if (dds.dds_type == DMU_OST_META) { dds.dds_creation_txg = TXG_INITIAL; usedobjs = BP_GET_FILL(os->os_rootbp); - refdbytes = os->os_spa->spa_dsl_pool-> - dp_mos_dir->dd_phys->dd_used_bytes; + refdbytes = dsl_dir_phys(os->os_spa->spa_dsl_pool->dp_mos_dir)-> + dd_used_bytes; } else { dmu_objset_space(os, &refdbytes, &scratch, &usedobjs, &scratch); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 00:51:01 2014 Return-Path: Delivered-To: svn-src-all@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 68F37CDF; Sat, 6 Dec 2014 00:51: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 53E3F1C3; Sat, 6 Dec 2014 00:51: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 sB60p1UN046163; Sat, 6 Dec 2014 00:51:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB60oxYu045859; Sat, 6 Dec 2014 00:50:59 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201412060050.sB60oxYu045859@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 00:50:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r275551 - vendor-sys/illumos/dist/uts/common/fs/zfs vendor-sys/illumos/dist/uts/common/fs/zfs/sys vendor/illumos/dist/cmd/zdb X-SVN-Group: vendor-sys MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 00:51:01 -0000 Author: delphij Date: Sat Dec 6 00:50:57 2014 New Revision: 275551 URL: https://svnweb.freebsd.org/changeset/base/275551 Log: 5314 Remove "dbuf phys" db->db_data pointer aliases in ZFS Reviewed by: Andriy Gapon Reviewed by: Matthew Ahrens Reviewed by: Will Andrews Approved by: Dan McDonald Author: Justin T. Gibbs illumos/illumos-gate@c1379625401dfbe1c39b79136dd384a571d47fde Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_bookmark.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deadlist.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_deleg.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_destroy.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dir.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_pool.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_prop.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_scan.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_synctask.c vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_userhold.c vendor-sys/illumos/dist/uts/common/fs/zfs/sa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa.c vendor-sys/illumos/dist/uts/common/fs/zfs/spa_history.c vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dbuf.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dmu.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dataset.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/dsl_dir.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_impl.h vendor-sys/illumos/dist/uts/common/fs/zfs/sys/zap_leaf.h vendor-sys/illumos/dist/uts/common/fs/zfs/zap.c vendor-sys/illumos/dist/uts/common/fs/zfs/zap_leaf.c vendor-sys/illumos/dist/uts/common/fs/zfs/zap_micro.c vendor-sys/illumos/dist/uts/common/fs/zfs/zfs_ioctl.c Changes in other areas also in this revision: Modified: vendor/illumos/dist/cmd/zdb/zdb.c Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Sat Dec 6 00:47:31 2014 (r275550) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dbuf.c Sat Dec 6 00:50:57 2014 (r275551) @@ -223,11 +223,8 @@ dbuf_evict_user(dmu_buf_impl_t *db) if (db->db_level != 0 || db->db_evict_func == NULL) return; - if (db->db_user_data_ptr_ptr) - *db->db_user_data_ptr_ptr = db->db.db_data; db->db_evict_func(&db->db, db->db_user_ptr); db->db_user_ptr = NULL; - db->db_user_data_ptr_ptr = NULL; db->db_evict_func = NULL; } @@ -418,16 +415,6 @@ dbuf_verify(dmu_buf_impl_t *db) #endif static void -dbuf_update_data(dmu_buf_impl_t *db) -{ - ASSERT(MUTEX_HELD(&db->db_mtx)); - if (db->db_level == 0 && db->db_user_data_ptr_ptr) { - ASSERT(!refcount_is_zero(&db->db_holds)); - *db->db_user_data_ptr_ptr = db->db.db_data; - } -} - -static void dbuf_set_data(dmu_buf_impl_t *db, arc_buf_t *buf) { ASSERT(MUTEX_HELD(&db->db_mtx)); @@ -437,7 +424,6 @@ dbuf_set_data(dmu_buf_impl_t *db, arc_bu db->db.db_data = buf->b_data; if (!arc_released(buf)) arc_set_callback(buf, dbuf_do_evict, db); - dbuf_update_data(db); } else { dbuf_evict_user(db); db->db.db_data = NULL; @@ -543,7 +529,6 @@ dbuf_read_impl(dmu_buf_impl_t *db, zio_t if (bonuslen) bcopy(DN_BONUS(dn->dn_phys), db->db.db_data, bonuslen); DB_DNODE_EXIT(db); - dbuf_update_data(db); db->db_state = DB_CACHED; mutex_exit(&db->db_mtx); return; @@ -1726,7 +1711,6 @@ dbuf_create(dnode_t *dn, uint8_t level, db->db_blkptr = blkptr; db->db_user_ptr = NULL; - db->db_user_data_ptr_ptr = NULL; db->db_evict_func = NULL; db->db_immediate_evict = 0; db->db_freed_in_flight = 0; @@ -1971,7 +1955,6 @@ top: } (void) refcount_add(&db->db_holds, tag); - dbuf_update_data(db); DBUF_VERIFY(db); mutex_exit(&db->db_mtx); @@ -2182,27 +2165,25 @@ dbuf_refcount(dmu_buf_impl_t *db) } void * -dmu_buf_set_user(dmu_buf_t *db_fake, void *user_ptr, void *user_data_ptr_ptr, +dmu_buf_set_user(dmu_buf_t *db_fake, void *user_ptr, dmu_buf_evict_func_t *evict_func) { - return (dmu_buf_update_user(db_fake, NULL, user_ptr, - user_data_ptr_ptr, evict_func)); + return (dmu_buf_update_user(db_fake, NULL, user_ptr, evict_func)); } void * -dmu_buf_set_user_ie(dmu_buf_t *db_fake, void *user_ptr, void *user_data_ptr_ptr, +dmu_buf_set_user_ie(dmu_buf_t *db_fake, void *user_ptr, dmu_buf_evict_func_t *evict_func) { dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake; db->db_immediate_evict = TRUE; - return (dmu_buf_update_user(db_fake, NULL, user_ptr, - user_data_ptr_ptr, evict_func)); + return (dmu_buf_update_user(db_fake, NULL, user_ptr, evict_func)); } void * dmu_buf_update_user(dmu_buf_t *db_fake, void *old_user_ptr, void *user_ptr, - void *user_data_ptr_ptr, dmu_buf_evict_func_t *evict_func) + dmu_buf_evict_func_t *evict_func) { dmu_buf_impl_t *db = (dmu_buf_impl_t *)db_fake; ASSERT(db->db_level == 0); @@ -2213,10 +2194,7 @@ dmu_buf_update_user(dmu_buf_t *db_fake, if (db->db_user_ptr == old_user_ptr) { db->db_user_ptr = user_ptr; - db->db_user_data_ptr_ptr = user_data_ptr_ptr; db->db_evict_func = evict_func; - - dbuf_update_data(db); } else { old_user_ptr = db->db_user_ptr; } Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c Sat Dec 6 00:47:31 2014 (r275550) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_diff.c Sat Dec 6 00:50:57 2014 (r275551) @@ -194,7 +194,7 @@ dmu_diff(const char *tosnap_name, const return (SET_ERROR(EXDEV)); } - fromtxg = fromsnap->ds_phys->ds_creation_txg; + fromtxg = dsl_dataset_phys(fromsnap)->ds_creation_txg; dsl_dataset_rele(fromsnap, FTAG); dsl_dataset_long_hold(tosnap, FTAG); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Sat Dec 6 00:47:31 2014 (r275550) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_objset.c Sat Dec 6 00:50:57 2014 (r275551) @@ -1479,12 +1479,12 @@ dmu_snapshot_realname(objset_t *os, char dsl_dataset_t *ds = os->os_dsl_dataset; uint64_t ignored; - if (ds->ds_phys->ds_snapnames_zapobj == 0) + if (dsl_dataset_phys(ds)->ds_snapnames_zapobj == 0) return (SET_ERROR(ENOENT)); return (zap_lookup_norm(ds->ds_dir->dd_pool->dp_meta_objset, - ds->ds_phys->ds_snapnames_zapobj, name, 8, 1, &ignored, MT_FIRST, - real, maxlen, conflict)); + dsl_dataset_phys(ds)->ds_snapnames_zapobj, name, 8, 1, &ignored, + MT_FIRST, real, maxlen, conflict)); } int @@ -1497,12 +1497,12 @@ dmu_snapshot_list_next(objset_t *os, int ASSERT(dsl_pool_config_held(dmu_objset_pool(os))); - if (ds->ds_phys->ds_snapnames_zapobj == 0) + if (dsl_dataset_phys(ds)->ds_snapnames_zapobj == 0) return (SET_ERROR(ENOENT)); zap_cursor_init_serialized(&cursor, ds->ds_dir->dd_pool->dp_meta_objset, - ds->ds_phys->ds_snapnames_zapobj, *offp); + dsl_dataset_phys(ds)->ds_snapnames_zapobj, *offp); if (zap_cursor_retrieve(&cursor, &attr) != 0) { zap_cursor_fini(&cursor); @@ -1536,12 +1536,12 @@ dmu_dir_list_next(objset_t *os, int name /* there is no next dir on a snapshot! */ if (os->os_dsl_dataset->ds_object != - dd->dd_phys->dd_head_dataset_obj) + dsl_dir_phys(dd)->dd_head_dataset_obj) return (SET_ERROR(ENOENT)); zap_cursor_init_serialized(&cursor, dd->dd_pool->dp_meta_objset, - dd->dd_phys->dd_child_dir_zapobj, *offp); + dsl_dir_phys(dd)->dd_child_dir_zapobj, *offp); if (zap_cursor_retrieve(&cursor, &attr) != 0) { zap_cursor_fini(&cursor); @@ -1589,7 +1589,7 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint6 return (0); } - thisobj = dd->dd_phys->dd_head_dataset_obj; + thisobj = dsl_dir_phys(dd)->dd_head_dataset_obj; attr = kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP); /* @@ -1597,7 +1597,7 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint6 */ if (flags & DS_FIND_CHILDREN) { for (zap_cursor_init(&zc, dp->dp_meta_objset, - dd->dd_phys->dd_child_dir_zapobj); + dsl_dir_phys(dd)->dd_child_dir_zapobj); zap_cursor_retrieve(&zc, attr) == 0; (void) zap_cursor_advance(&zc)) { ASSERT3U(attr->za_integer_length, ==, @@ -1626,7 +1626,9 @@ dmu_objset_find_dp(dsl_pool_t *dp, uint6 err = dsl_dataset_hold_obj(dp, thisobj, FTAG, &ds); if (err == 0) { - uint64_t snapobj = ds->ds_phys->ds_snapnames_zapobj; + uint64_t snapobj; + + snapobj = dsl_dataset_phys(ds)->ds_snapnames_zapobj; dsl_dataset_rele(ds, FTAG); for (zap_cursor_init(&zc, dp->dp_meta_objset, snapobj); @@ -1701,7 +1703,7 @@ dmu_objset_find_impl(spa_t *spa, const c return (0); } - thisobj = dd->dd_phys->dd_head_dataset_obj; + thisobj = dsl_dir_phys(dd)->dd_head_dataset_obj; attr = kmem_alloc(sizeof (zap_attribute_t), KM_SLEEP); /* @@ -1709,7 +1711,7 @@ dmu_objset_find_impl(spa_t *spa, const c */ if (flags & DS_FIND_CHILDREN) { for (zap_cursor_init(&zc, dp->dp_meta_objset, - dd->dd_phys->dd_child_dir_zapobj); + dsl_dir_phys(dd)->dd_child_dir_zapobj); zap_cursor_retrieve(&zc, attr) == 0; (void) zap_cursor_advance(&zc)) { ASSERT3U(attr->za_integer_length, ==, @@ -1742,7 +1744,9 @@ dmu_objset_find_impl(spa_t *spa, const c err = dsl_dataset_hold_obj(dp, thisobj, FTAG, &ds); if (err == 0) { - uint64_t snapobj = ds->ds_phys->ds_snapnames_zapobj; + uint64_t snapobj; + + snapobj = dsl_dataset_phys(ds)->ds_snapnames_zapobj; dsl_dataset_rele(ds, FTAG); for (zap_cursor_init(&zc, dp->dp_meta_objset, snapobj); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Sat Dec 6 00:47:31 2014 (r275550) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_send.c Sat Dec 6 00:50:57 2014 (r275551) @@ -598,12 +598,12 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, featureflags); drr->drr_u.drr_begin.drr_creation_time = - ds->ds_phys->ds_creation_time; + dsl_dataset_phys(ds)->ds_creation_time; drr->drr_u.drr_begin.drr_type = dmu_objset_type(os); if (is_clone) drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_CLONE; - drr->drr_u.drr_begin.drr_toguid = ds->ds_phys->ds_guid; - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) + drr->drr_u.drr_begin.drr_toguid = dsl_dataset_phys(ds)->ds_guid; + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) drr->drr_u.drr_begin.drr_flags |= DRR_FLAG_CI_DATA; if (fromzb != NULL) { @@ -624,7 +624,7 @@ dmu_send_impl(void *tag, dsl_pool_t *dp, dsp->dsa_proc = curproc; dsp->dsa_os = os; dsp->dsa_off = off; - dsp->dsa_toguid = ds->ds_phys->ds_guid; + dsp->dsa_toguid = dsl_dataset_phys(ds)->ds_guid; ZIO_SET_CHECKSUM(&dsp->dsa_zc, 0, 0, 0, 0); dsp->dsa_pending_op = PENDING_NONE; dsp->dsa_incremental = (fromzb != NULL); @@ -710,9 +710,10 @@ dmu_send_obj(const char *pool, uint64_t } if (!dsl_dataset_is_before(ds, fromds, 0)) err = SET_ERROR(EXDEV); - zb.zbm_creation_time = fromds->ds_phys->ds_creation_time; - zb.zbm_creation_txg = fromds->ds_phys->ds_creation_txg; - zb.zbm_guid = fromds->ds_phys->ds_guid; + zb.zbm_creation_time = + dsl_dataset_phys(fromds)->ds_creation_time; + zb.zbm_creation_txg = dsl_dataset_phys(fromds)->ds_creation_txg; + zb.zbm_guid = dsl_dataset_phys(fromds)->ds_guid; is_clone = (fromds->ds_dir != ds->ds_dir); dsl_dataset_rele(fromds, FTAG); err = dmu_send_impl(FTAG, dp, ds, &zb, is_clone, @@ -779,10 +780,10 @@ dmu_send(const char *tosnap, const char if (!dsl_dataset_is_before(ds, fromds, 0)) err = SET_ERROR(EXDEV); zb.zbm_creation_time = - fromds->ds_phys->ds_creation_time; + dsl_dataset_phys(fromds)->ds_creation_time; zb.zbm_creation_txg = - fromds->ds_phys->ds_creation_txg; - zb.zbm_guid = fromds->ds_phys->ds_guid; + dsl_dataset_phys(fromds)->ds_creation_txg; + zb.zbm_guid = dsl_dataset_phys(fromds)->ds_guid; is_clone = (ds->ds_dir != fromds->ds_dir); dsl_dataset_rele(fromds, FTAG); } @@ -829,7 +830,7 @@ dmu_send_estimate(dsl_dataset_t *ds, dsl /* Get uncompressed size estimate of changed data. */ if (fromds == NULL) { - size = ds->ds_phys->ds_uncompressed_bytes; + size = dsl_dataset_phys(ds)->ds_uncompressed_bytes; } else { uint64_t used, comp; err = dsl_dataset_space_written(fromds, ds, @@ -884,15 +885,15 @@ recv_begin_check_existing_impl(dmu_recv_ /* temporary clone name must not exist */ error = zap_lookup(dp->dp_meta_objset, - ds->ds_dir->dd_phys->dd_child_dir_zapobj, recv_clone_name, + dsl_dir_phys(ds->ds_dir)->dd_child_dir_zapobj, recv_clone_name, 8, 1, &val); if (error != ENOENT) return (error == 0 ? EBUSY : error); /* new snapshot name must not exist */ error = zap_lookup(dp->dp_meta_objset, - ds->ds_phys->ds_snapnames_zapobj, drba->drba_cookie->drc_tosnap, - 8, 1, &val); + dsl_dataset_phys(ds)->ds_snapnames_zapobj, + drba->drba_cookie->drc_tosnap, 8, 1, &val); if (error != ENOENT) return (error == 0 ? EEXIST : error); @@ -912,7 +913,7 @@ recv_begin_check_existing_impl(dmu_recv_ if (fromguid != 0) { dsl_dataset_t *snap; - uint64_t obj = ds->ds_phys->ds_prev_snap_obj; + uint64_t obj = dsl_dataset_phys(ds)->ds_prev_snap_obj; /* Find snapshot in this dir that matches fromguid. */ while (obj != 0) { @@ -924,9 +925,9 @@ recv_begin_check_existing_impl(dmu_recv_ dsl_dataset_rele(snap, FTAG); return (SET_ERROR(ENODEV)); } - if (snap->ds_phys->ds_guid == fromguid) + if (dsl_dataset_phys(snap)->ds_guid == fromguid) break; - obj = snap->ds_phys->ds_prev_snap_obj; + obj = dsl_dataset_phys(snap)->ds_prev_snap_obj; dsl_dataset_rele(snap, FTAG); } if (obj == 0) @@ -949,9 +950,9 @@ recv_begin_check_existing_impl(dmu_recv_ dsl_dataset_rele(snap, FTAG); } else { /* if full, most recent snapshot must be $ORIGIN */ - if (ds->ds_phys->ds_prev_snap_txg >= TXG_INITIAL) + if (dsl_dataset_phys(ds)->ds_prev_snap_txg >= TXG_INITIAL) return (SET_ERROR(ENODEV)); - drba->drba_snapobj = ds->ds_phys->ds_prev_snap_obj; + drba->drba_snapobj = dsl_dataset_phys(ds)->ds_prev_snap_obj; } return (0); @@ -1069,7 +1070,7 @@ dmu_recv_begin_check(void *arg, dmu_tx_t dsl_dataset_rele(ds, FTAG); return (SET_ERROR(EINVAL)); } - if (origin->ds_phys->ds_guid != fromguid) { + if (dsl_dataset_phys(origin)->ds_guid != fromguid) { dsl_dataset_rele(origin, FTAG); dsl_dataset_rele(ds, FTAG); return (SET_ERROR(ENODEV)); @@ -1140,7 +1141,7 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t } dmu_buf_will_dirty(newds->ds_dbuf, tx); - newds->ds_phys->ds_flags |= DS_FLAG_INCONSISTENT; + dsl_dataset_phys(newds)->ds_flags |= DS_FLAG_INCONSISTENT; /* * If we actually created a non-clone, we need to create the @@ -1777,7 +1778,7 @@ dmu_recv_stream(dmu_recv_cookie_t *drc, */ VERIFY0(dmu_objset_from_ds(drc->drc_ds, &os)); - ASSERT(drc->drc_ds->ds_phys->ds_flags & DS_FLAG_INCONSISTENT); + ASSERT(dsl_dataset_phys(drc->drc_ds)->ds_flags & DS_FLAG_INCONSISTENT); featureflags = DMU_GET_FEATUREFLAGS(drc->drc_drrb->drr_versioninfo); @@ -1940,8 +1941,11 @@ dmu_recv_end_check(void *arg, dmu_tx_t * * the snap before drc_ds, because drc_ds can not * have any snaps of its own). */ - uint64_t obj = origin_head->ds_phys->ds_prev_snap_obj; - while (obj != drc->drc_ds->ds_phys->ds_prev_snap_obj) { + uint64_t obj; + + obj = dsl_dataset_phys(origin_head)->ds_prev_snap_obj; + while (obj != + dsl_dataset_phys(drc->drc_ds)->ds_prev_snap_obj) { dsl_dataset_t *snap; error = dsl_dataset_hold_obj(dp, obj, FTAG, &snap); @@ -1953,7 +1957,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_destroy_snapshot_check_impl( snap, B_FALSE); } - obj = snap->ds_phys->ds_prev_snap_obj; + obj = dsl_dataset_phys(snap)->ds_prev_snap_obj; dsl_dataset_rele(snap, FTAG); if (error != 0) return (error); @@ -1999,13 +2003,16 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t * Destroy any snapshots of drc_tofs (origin_head) * after the origin (the snap before drc_ds). */ - uint64_t obj = origin_head->ds_phys->ds_prev_snap_obj; - while (obj != drc->drc_ds->ds_phys->ds_prev_snap_obj) { + uint64_t obj; + + obj = dsl_dataset_phys(origin_head)->ds_prev_snap_obj; + while (obj != + dsl_dataset_phys(drc->drc_ds)->ds_prev_snap_obj) { dsl_dataset_t *snap; VERIFY0(dsl_dataset_hold_obj(dp, obj, FTAG, &snap)); ASSERT3P(snap->ds_dir, ==, origin_head->ds_dir); - obj = snap->ds_phys->ds_prev_snap_obj; + obj = dsl_dataset_phys(snap)->ds_prev_snap_obj; dsl_destroy_snapshot_sync_impl(snap, B_FALSE, tx); dsl_dataset_rele(snap, FTAG); @@ -2021,15 +2028,16 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t /* set snapshot's creation time and guid */ dmu_buf_will_dirty(origin_head->ds_prev->ds_dbuf, tx); - origin_head->ds_prev->ds_phys->ds_creation_time = + dsl_dataset_phys(origin_head->ds_prev)->ds_creation_time = drc->drc_drrb->drr_creation_time; - origin_head->ds_prev->ds_phys->ds_guid = + dsl_dataset_phys(origin_head->ds_prev)->ds_guid = drc->drc_drrb->drr_toguid; - origin_head->ds_prev->ds_phys->ds_flags &= + dsl_dataset_phys(origin_head->ds_prev)->ds_flags &= ~DS_FLAG_INCONSISTENT; dmu_buf_will_dirty(origin_head->ds_dbuf, tx); - origin_head->ds_phys->ds_flags &= ~DS_FLAG_INCONSISTENT; + dsl_dataset_phys(origin_head)->ds_flags &= + ~DS_FLAG_INCONSISTENT; dsl_dataset_rele(origin_head, FTAG); dsl_destroy_head_sync_impl(drc->drc_ds, tx); @@ -2043,15 +2051,17 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t /* set snapshot's creation time and guid */ dmu_buf_will_dirty(ds->ds_prev->ds_dbuf, tx); - ds->ds_prev->ds_phys->ds_creation_time = + dsl_dataset_phys(ds->ds_prev)->ds_creation_time = drc->drc_drrb->drr_creation_time; - ds->ds_prev->ds_phys->ds_guid = drc->drc_drrb->drr_toguid; - ds->ds_prev->ds_phys->ds_flags &= ~DS_FLAG_INCONSISTENT; + dsl_dataset_phys(ds->ds_prev)->ds_guid = + drc->drc_drrb->drr_toguid; + dsl_dataset_phys(ds->ds_prev)->ds_flags &= + ~DS_FLAG_INCONSISTENT; dmu_buf_will_dirty(ds->ds_dbuf, tx); - ds->ds_phys->ds_flags &= ~DS_FLAG_INCONSISTENT; + dsl_dataset_phys(ds)->ds_flags &= ~DS_FLAG_INCONSISTENT; } - drc->drc_newsnapobj = drc->drc_ds->ds_phys->ds_prev_snap_obj; + drc->drc_newsnapobj = dsl_dataset_phys(drc->drc_ds)->ds_prev_snap_obj; /* * Release the hold from dmu_recv_begin. This must be done before * we return to open context, so that when we free the dataset's dnode, @@ -2077,7 +2087,7 @@ add_ds_to_guidmap(const char *name, avl_ gmep = kmem_alloc(sizeof (*gmep), KM_SLEEP); err = dsl_dataset_hold_obj(dp, snapobj, gmep, &snapds); if (err == 0) { - gmep->guid = snapds->ds_phys->ds_guid; + gmep->guid = dsl_dataset_phys(snapds)->ds_guid; gmep->gme_ds = snapds; avl_add(guid_map, gmep); dsl_dataset_long_hold(snapds, gmep); Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Sat Dec 6 00:47:31 2014 (r275550) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_traverse.c Sat Dec 6 00:50:57 2014 (r275551) @@ -579,7 +579,7 @@ traverse_dataset(dsl_dataset_t *ds, uint blkptr_cb_t func, void *arg) { return (traverse_impl(ds->ds_dir->dd_pool->dp_spa, ds, ds->ds_object, - &ds->ds_phys->ds_bp, txg_start, NULL, flags, func, arg)); + &dsl_dataset_phys(ds)->ds_bp, txg_start, NULL, flags, func, arg)); } int @@ -634,8 +634,8 @@ traverse_pool(spa_t *spa, uint64_t txg_s continue; break; } - if (ds->ds_phys->ds_prev_snap_txg > txg) - txg = ds->ds_phys->ds_prev_snap_txg; + if (dsl_dataset_phys(ds)->ds_prev_snap_txg > txg) + txg = dsl_dataset_phys(ds)->ds_prev_snap_txg; err = traverse_dataset(ds, txg, flags, func, arg); dsl_dataset_rele(ds, FTAG); if (err != 0) Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Sat Dec 6 00:47:31 2014 (r275550) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dmu_tx.c Sat Dec 6 00:50:57 2014 (r275551) @@ -713,6 +713,7 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o { dmu_tx_hold_t *txh; dnode_t *dn; + dsl_dataset_phys_t *ds_phys; uint64_t nblocks; int epbs, err; @@ -787,8 +788,9 @@ dmu_tx_hold_zap(dmu_tx_t *tx, uint64_t o * we'll have to modify an indirect twig for each. */ epbs = dn->dn_indblkshift - SPA_BLKPTRSHIFT; + ds_phys = dsl_dataset_phys(dn->dn_objset->os_dsl_dataset); for (nblocks = dn->dn_maxblkid >> epbs; nblocks != 0; nblocks >>= epbs) - if (dn->dn_objset->os_dsl_dataset->ds_phys->ds_prev_snap_obj) + if (ds_phys->ds_prev_snap_obj) txh->txh_space_towrite += 3 << dn->dn_indblkshift; else txh->txh_space_tooverwrite += 3 << dn->dn_indblkshift; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Sat Dec 6 00:47:31 2014 (r275550) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dnode.c Sat Dec 6 00:50:57 2014 (r275551) @@ -1116,7 +1116,7 @@ dnode_hold_impl(objset_t *os, uint64_t o zrl_init(&dnh[i].dnh_zrlock); dnh[i].dnh_dnode = NULL; } - if (winner = dmu_buf_set_user(&db->db, children_dnodes, NULL, + if (winner = dmu_buf_set_user(&db->db, children_dnodes, dnode_buf_pageout)) { for (i = 0; i < epb; i++) { Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_bookmark.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_bookmark.c Sat Dec 6 00:47:31 2014 (r275550) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_bookmark.c Sat Dec 6 00:50:57 2014 (r275551) @@ -65,7 +65,7 @@ dsl_dataset_bmark_lookup(dsl_dataset_t * if (bmark_zapobj == 0) return (SET_ERROR(ESRCH)); - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) mt = MT_FIRST; else mt = MT_EXACT; @@ -208,10 +208,11 @@ dsl_bookmark_create_sync(void *arg, dmu_ &bmark_fs->ds_bookmarks, tx)); } - bmark_phys.zbm_guid = snapds->ds_phys->ds_guid; - bmark_phys.zbm_creation_txg = snapds->ds_phys->ds_creation_txg; + bmark_phys.zbm_guid = dsl_dataset_phys(snapds)->ds_guid; + bmark_phys.zbm_creation_txg = + dsl_dataset_phys(snapds)->ds_creation_txg; bmark_phys.zbm_creation_time = - snapds->ds_phys->ds_creation_time; + dsl_dataset_phys(snapds)->ds_creation_time; VERIFY0(zap_add(mos, bmark_fs->ds_bookmarks, shortname, sizeof (uint64_t), @@ -340,7 +341,7 @@ dsl_dataset_bookmark_remove(dsl_dataset_ uint64_t bmark_zapobj = ds->ds_bookmarks; matchtype_t mt; - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) mt = MT_FIRST; else mt = MT_EXACT; Modified: vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Sat Dec 6 00:47:31 2014 (r275550) +++ vendor-sys/illumos/dist/uts/common/fs/zfs/dsl_dataset.c Sat Dec 6 00:50:57 2014 (r275551) @@ -70,6 +70,9 @@ int zfs_max_recordsize = 1 * 1024 * 1024 #define DS_REF_MAX (1ULL << 62) +extern inline dsl_dataset_phys_t *dsl_dataset_phys(dsl_dataset_t *ds); +extern inline boolean_t dsl_dataset_is_snapshot(dsl_dataset_t *ds); + /* * Figure out how much of this delta should be propogated to the dsl_dir * layer. If there's a refreservation, that space has already been @@ -78,13 +81,15 @@ int zfs_max_recordsize = 1 * 1024 * 1024 static int64_t parent_delta(dsl_dataset_t *ds, int64_t delta) { + dsl_dataset_phys_t *ds_phys; uint64_t old_bytes, new_bytes; if (ds->ds_reserved == 0) return (delta); - old_bytes = MAX(ds->ds_phys->ds_unique_bytes, ds->ds_reserved); - new_bytes = MAX(ds->ds_phys->ds_unique_bytes + delta, ds->ds_reserved); + ds_phys = dsl_dataset_phys(ds); + old_bytes = MAX(ds_phys->ds_unique_bytes, ds->ds_reserved); + new_bytes = MAX(ds_phys->ds_unique_bytes + delta, ds->ds_reserved); ASSERT3U(ABS((int64_t)(new_bytes - old_bytes)), <=, ABS(delta)); return (new_bytes - old_bytes); @@ -115,10 +120,10 @@ dsl_dataset_block_born(dsl_dataset_t *ds dmu_buf_will_dirty(ds->ds_dbuf, tx); mutex_enter(&ds->ds_lock); delta = parent_delta(ds, used); - ds->ds_phys->ds_referenced_bytes += used; - ds->ds_phys->ds_compressed_bytes += compressed; - ds->ds_phys->ds_uncompressed_bytes += uncompressed; - ds->ds_phys->ds_unique_bytes += used; + dsl_dataset_phys(ds)->ds_referenced_bytes += used; + dsl_dataset_phys(ds)->ds_compressed_bytes += compressed; + dsl_dataset_phys(ds)->ds_uncompressed_bytes += uncompressed; + dsl_dataset_phys(ds)->ds_unique_bytes += used; if (BP_GET_LSIZE(bp) > SPA_OLD_MAXBLOCKSIZE) ds->ds_need_large_blocks = B_TRUE; mutex_exit(&ds->ds_lock); @@ -153,17 +158,17 @@ dsl_dataset_block_kill(dsl_dataset_t *ds ASSERT(!dsl_dataset_is_snapshot(ds)); dmu_buf_will_dirty(ds->ds_dbuf, tx); - if (bp->blk_birth > ds->ds_phys->ds_prev_snap_txg) { + if (bp->blk_birth > dsl_dataset_phys(ds)->ds_prev_snap_txg) { int64_t delta; dprintf_bp(bp, "freeing ds=%llu", ds->ds_object); dsl_free(tx->tx_pool, tx->tx_txg, bp); mutex_enter(&ds->ds_lock); - ASSERT(ds->ds_phys->ds_unique_bytes >= used || + ASSERT(dsl_dataset_phys(ds)->ds_unique_bytes >= used || !DS_UNIQUE_IS_ACCURATE(ds)); delta = parent_delta(ds, -used); - ds->ds_phys->ds_unique_bytes -= used; + dsl_dataset_phys(ds)->ds_unique_bytes -= used; mutex_exit(&ds->ds_lock); dsl_dir_diduse_space(ds->ds_dir, DD_USED_HEAD, delta, -compressed, -uncompressed, tx); @@ -184,15 +189,15 @@ dsl_dataset_block_kill(dsl_dataset_t *ds dsl_deadlist_insert(&ds->ds_deadlist, bp, tx); } ASSERT3U(ds->ds_prev->ds_object, ==, - ds->ds_phys->ds_prev_snap_obj); - ASSERT(ds->ds_prev->ds_phys->ds_num_children > 0); + dsl_dataset_phys(ds)->ds_prev_snap_obj); + ASSERT(dsl_dataset_phys(ds->ds_prev)->ds_num_children > 0); /* if (bp->blk_birth > prev prev snap txg) prev unique += bs */ - if (ds->ds_prev->ds_phys->ds_next_snap_obj == + if (dsl_dataset_phys(ds->ds_prev)->ds_next_snap_obj == ds->ds_object && bp->blk_birth > - ds->ds_prev->ds_phys->ds_prev_snap_txg) { + dsl_dataset_phys(ds->ds_prev)->ds_prev_snap_txg) { dmu_buf_will_dirty(ds->ds_prev->ds_dbuf, tx); mutex_enter(&ds->ds_prev->ds_lock); - ds->ds_prev->ds_phys->ds_unique_bytes += used; + dsl_dataset_phys(ds->ds_prev)->ds_unique_bytes += used; mutex_exit(&ds->ds_prev->ds_lock); } if (bp->blk_birth > ds->ds_dir->dd_origin_txg) { @@ -201,12 +206,12 @@ dsl_dataset_block_kill(dsl_dataset_t *ds } } mutex_enter(&ds->ds_lock); - ASSERT3U(ds->ds_phys->ds_referenced_bytes, >=, used); - ds->ds_phys->ds_referenced_bytes -= used; - ASSERT3U(ds->ds_phys->ds_compressed_bytes, >=, compressed); - ds->ds_phys->ds_compressed_bytes -= compressed; - ASSERT3U(ds->ds_phys->ds_uncompressed_bytes, >=, uncompressed); - ds->ds_phys->ds_uncompressed_bytes -= uncompressed; + ASSERT3U(dsl_dataset_phys(ds)->ds_referenced_bytes, >=, used); + dsl_dataset_phys(ds)->ds_referenced_bytes -= used; + ASSERT3U(dsl_dataset_phys(ds)->ds_compressed_bytes, >=, compressed); + dsl_dataset_phys(ds)->ds_compressed_bytes -= compressed; + ASSERT3U(dsl_dataset_phys(ds)->ds_uncompressed_bytes, >=, uncompressed); + dsl_dataset_phys(ds)->ds_uncompressed_bytes -= uncompressed; mutex_exit(&ds->ds_lock); return (used); @@ -232,7 +237,7 @@ dsl_dataset_prev_snap_txg(dsl_dataset_t if (ds->ds_trysnap_txg > spa_last_synced_txg(ds->ds_dir->dd_pool->dp_spa)) trysnap = ds->ds_trysnap_txg; - return (MAX(ds->ds_phys->ds_prev_snap_txg, trysnap)); + return (MAX(dsl_dataset_phys(ds)->ds_prev_snap_txg, trysnap)); } boolean_t @@ -267,7 +272,7 @@ dsl_dataset_evict(dmu_buf_t *db, void *d } bplist_destroy(&ds->ds_pending_deadlist); - if (ds->ds_phys->ds_deadlist_obj != 0) + if (dsl_dataset_phys(ds)->ds_deadlist_obj != 0) dsl_deadlist_close(&ds->ds_deadlist); if (ds->ds_dir) dsl_dir_rele(ds->ds_dir, ds); @@ -293,10 +298,10 @@ dsl_dataset_get_snapname(dsl_dataset_t * if (ds->ds_snapname[0]) return (0); - if (ds->ds_phys->ds_next_snap_obj == 0) + if (dsl_dataset_phys(ds)->ds_next_snap_obj == 0) return (0); - err = dmu_bonus_hold(mos, ds->ds_dir->dd_phys->dd_head_dataset_obj, + err = dmu_bonus_hold(mos, dsl_dir_phys(ds->ds_dir)->dd_head_dataset_obj, FTAG, &headdbuf); if (err != 0) return (err); @@ -311,11 +316,11 @@ int dsl_dataset_snap_lookup(dsl_dataset_t *ds, const char *name, uint64_t *value) { objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; - uint64_t snapobj = ds->ds_phys->ds_snapnames_zapobj; + uint64_t snapobj = dsl_dataset_phys(ds)->ds_snapnames_zapobj; matchtype_t mt; int err; - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) mt = MT_FIRST; else mt = MT_EXACT; @@ -332,13 +337,13 @@ dsl_dataset_snap_remove(dsl_dataset_t *d boolean_t adj_cnt) { objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; - uint64_t snapobj = ds->ds_phys->ds_snapnames_zapobj; + uint64_t snapobj = dsl_dataset_phys(ds)->ds_snapnames_zapobj; matchtype_t mt; int err; dsl_dir_snap_cmtime_update(ds->ds_dir); - if (ds->ds_phys->ds_flags & DS_FLAG_CI_DATASET) + if (dsl_dataset_phys(ds)->ds_flags & DS_FLAG_CI_DATASET) mt = MT_FIRST; else mt = MT_EXACT; @@ -384,7 +389,6 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin ds = kmem_zalloc(sizeof (dsl_dataset_t), KM_SLEEP); ds->ds_dbuf = dbuf; ds->ds_object = dsobj; - ds->ds_phys = dbuf->db_data; mutex_init(&ds->ds_lock, NULL, MUTEX_DEFAULT, NULL); mutex_init(&ds->ds_opening_lock, NULL, MUTEX_DEFAULT, NULL); @@ -393,7 +397,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin bplist_create(&ds->ds_pending_deadlist); dsl_deadlist_open(&ds->ds_deadlist, - mos, ds->ds_phys->ds_deadlist_obj); + mos, dsl_dataset_phys(ds)->ds_deadlist_obj); list_create(&ds->ds_sendstreams, sizeof (dmu_sendarg_t), offsetof(dmu_sendarg_t, dsa_link)); @@ -408,7 +412,8 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin if (err == 0) { err = dsl_dir_hold_obj(dp, - ds->ds_phys->ds_dir_obj, NULL, ds, &ds->ds_dir); + dsl_dataset_phys(ds)->ds_dir_obj, NULL, ds, + &ds->ds_dir); } if (err != 0) { mutex_destroy(&ds->ds_lock); @@ -424,9 +429,9 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin if (!dsl_dataset_is_snapshot(ds)) { ds->ds_snapname[0] = '\0'; - if (ds->ds_phys->ds_prev_snap_obj != 0) { + if (dsl_dataset_phys(ds)->ds_prev_snap_obj != 0) { err = dsl_dataset_hold_obj(dp, - ds->ds_phys->ds_prev_snap_obj, + dsl_dataset_phys(ds)->ds_prev_snap_obj, ds, &ds->ds_prev); } if (doi.doi_type == DMU_OTN_ZAP_METADATA) { @@ -440,10 +445,11 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin } else { if (zfs_flags & ZFS_DEBUG_SNAPNAMES) err = dsl_dataset_get_snapname(ds); - if (err == 0 && ds->ds_phys->ds_userrefs_obj != 0) { + if (err == 0 && + dsl_dataset_phys(ds)->ds_userrefs_obj != 0) { err = zap_count( ds->ds_dir->dd_pool->dp_meta_objset, - ds->ds_phys->ds_userrefs_obj, + dsl_dataset_phys(ds)->ds_userrefs_obj, &ds->ds_userrefs); } } @@ -462,7 +468,7 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin } if (err != 0 || (winner = dmu_buf_set_user_ie(dbuf, ds, - &ds->ds_phys, dsl_dataset_evict)) != NULL) { + dsl_dataset_evict)) != NULL) { bplist_destroy(&ds->ds_pending_deadlist); dsl_deadlist_close(&ds->ds_deadlist); if (ds->ds_prev) @@ -480,12 +486,12 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin ds = winner; } else { ds->ds_fsid_guid = - unique_insert(ds->ds_phys->ds_fsid_guid); + unique_insert(dsl_dataset_phys(ds)->ds_fsid_guid); } } ASSERT3P(ds->ds_dbuf, ==, dbuf); - ASSERT3P(ds->ds_phys, ==, dbuf->db_data); - ASSERT(ds->ds_phys->ds_prev_snap_obj != 0 || + ASSERT3P(dsl_dataset_phys(ds), ==, dbuf->db_data); + ASSERT(dsl_dataset_phys(ds)->ds_prev_snap_obj != 0 || spa_version(dp->dp_spa) < SPA_VERSION_ORIGIN || dp->dp_origin_snap == NULL || ds == dp->dp_origin_snap); *dsp = ds; @@ -506,7 +512,7 @@ dsl_dataset_hold(dsl_pool_t *dp, const c return (err); ASSERT(dsl_pool_config_held(dp)); - obj = dd->dd_phys->dd_head_dataset_obj; + obj = dsl_dir_phys(dd)->dd_head_dataset_obj; if (obj != 0) err = dsl_dataset_hold_obj(dp, obj, tag, dsp); else @@ -673,9 +679,9 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd origin = dp->dp_origin_snap; ASSERT(origin == NULL || origin->ds_dir->dd_pool == dp); - ASSERT(origin == NULL || origin->ds_phys->ds_num_children > 0); + ASSERT(origin == NULL || dsl_dataset_phys(origin)->ds_num_children > 0); ASSERT(dmu_tx_is_syncing(tx)); - ASSERT(dd->dd_phys->dd_head_dataset_obj == 0); + ASSERT(dsl_dir_phys(dd)->dd_head_dataset_obj == 0); dsobj = dmu_object_alloc(mos, DMU_OT_DSL_DATASET, 0, DMU_OT_DSL_DATASET, sizeof (dsl_dataset_phys_t), tx); @@ -701,55 +707,58 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd dsphys->ds_prev_snap_obj = origin->ds_object; dsphys->ds_prev_snap_txg = - origin->ds_phys->ds_creation_txg; + dsl_dataset_phys(origin)->ds_creation_txg; dsphys->ds_referenced_bytes = - origin->ds_phys->ds_referenced_bytes; + dsl_dataset_phys(origin)->ds_referenced_bytes; dsphys->ds_compressed_bytes = - origin->ds_phys->ds_compressed_bytes; + dsl_dataset_phys(origin)->ds_compressed_bytes; dsphys->ds_uncompressed_bytes = - origin->ds_phys->ds_uncompressed_bytes; - dsphys->ds_bp = origin->ds_phys->ds_bp; + dsl_dataset_phys(origin)->ds_uncompressed_bytes; + dsphys->ds_bp = dsl_dataset_phys(origin)->ds_bp; /* * Inherit flags that describe the dataset's contents * (INCONSISTENT) or properties (Case Insensitive). */ - dsphys->ds_flags |= origin->ds_phys->ds_flags & + dsphys->ds_flags |= dsl_dataset_phys(origin)->ds_flags & (DS_FLAG_INCONSISTENT | DS_FLAG_CI_DATASET); if (origin->ds_large_blocks) dsl_dataset_activate_large_blocks_sync_impl(dsobj, tx); dmu_buf_will_dirty(origin->ds_dbuf, tx); - origin->ds_phys->ds_num_children++; + dsl_dataset_phys(origin)->ds_num_children++; VERIFY0(dsl_dataset_hold_obj(dp, - origin->ds_dir->dd_phys->dd_head_dataset_obj, FTAG, &ohds)); + dsl_dir_phys(origin->ds_dir)->dd_head_dataset_obj, + FTAG, &ohds)); dsphys->ds_deadlist_obj = dsl_deadlist_clone(&ohds->ds_deadlist, dsphys->ds_prev_snap_txg, dsphys->ds_prev_snap_obj, tx); dsl_dataset_rele(ohds, FTAG); if (spa_version(dp->dp_spa) >= SPA_VERSION_NEXT_CLONES) { - if (origin->ds_phys->ds_next_clones_obj == 0) { - origin->ds_phys->ds_next_clones_obj = + if (dsl_dataset_phys(origin)->ds_next_clones_obj == 0) { + dsl_dataset_phys(origin)->ds_next_clones_obj = zap_create(mos, DMU_OT_NEXT_CLONES, DMU_OT_NONE, 0, tx); } VERIFY0(zap_add_int(mos, - origin->ds_phys->ds_next_clones_obj, dsobj, tx)); + dsl_dataset_phys(origin)->ds_next_clones_obj, + dsobj, tx)); } dmu_buf_will_dirty(dd->dd_dbuf, tx); - dd->dd_phys->dd_origin_obj = origin->ds_object; + dsl_dir_phys(dd)->dd_origin_obj = origin->ds_object; if (spa_version(dp->dp_spa) >= SPA_VERSION_DIR_CLONES) { - if (origin->ds_dir->dd_phys->dd_clones == 0) { + if (dsl_dir_phys(origin->ds_dir)->dd_clones == 0) { dmu_buf_will_dirty(origin->ds_dir->dd_dbuf, tx); - origin->ds_dir->dd_phys->dd_clones = + dsl_dir_phys(origin->ds_dir)->dd_clones = zap_create(mos, DMU_OT_DSL_CLONES, DMU_OT_NONE, 0, tx); } VERIFY0(zap_add_int(mos, - origin->ds_dir->dd_phys->dd_clones, dsobj, tx)); + dsl_dir_phys(origin->ds_dir)->dd_clones, + dsobj, tx)); } } @@ -759,7 +768,7 @@ dsl_dataset_create_sync_dd(dsl_dir_t *dd dmu_buf_rele(dbuf, FTAG); dmu_buf_will_dirty(dd->dd_dbuf, tx); - dd->dd_phys->dd_head_dataset_obj = dsobj; + dsl_dir_phys(dd)->dd_head_dataset_obj = dsobj; return (dsobj); } @@ -841,20 +850,20 @@ dsl_dataset_recalc_head_uniq(dsl_dataset ASSERT(!dsl_dataset_is_snapshot(ds)); - if (ds->ds_phys->ds_prev_snap_obj != 0) - mrs_used = ds->ds_prev->ds_phys->ds_referenced_bytes; + if (dsl_dataset_phys(ds)->ds_prev_snap_obj != 0) + mrs_used = dsl_dataset_phys(ds->ds_prev)->ds_referenced_bytes; else mrs_used = 0; dsl_deadlist_space(&ds->ds_deadlist, &dlused, &dlcomp, &dluncomp); ASSERT3U(dlused, <=, mrs_used); - ds->ds_phys->ds_unique_bytes = - ds->ds_phys->ds_referenced_bytes - (mrs_used - dlused); + dsl_dataset_phys(ds)->ds_unique_bytes = + dsl_dataset_phys(ds)->ds_referenced_bytes - (mrs_used - dlused); if (spa_version(ds->ds_dir->dd_pool->dp_spa) >= SPA_VERSION_UNIQUE_ACCURATE) - ds->ds_phys->ds_flags |= DS_FLAG_UNIQUE_ACCURATE; + dsl_dataset_phys(ds)->ds_flags |= DS_FLAG_UNIQUE_ACCURATE; } void @@ -865,8 +874,9 @@ dsl_dataset_remove_from_next_clones(dsl_ uint64_t count; int err; - ASSERT(ds->ds_phys->ds_num_children >= 2); - err = zap_remove_int(mos, ds->ds_phys->ds_next_clones_obj, obj, tx); + ASSERT(dsl_dataset_phys(ds)->ds_num_children >= 2); + err = zap_remove_int(mos, dsl_dataset_phys(ds)->ds_next_clones_obj, + obj, tx); /* * The err should not be ENOENT, but a bug in a previous version * of the code could cause upgrade_clones_cb() to not set @@ -879,16 +889,16 @@ dsl_dataset_remove_from_next_clones(dsl_ */ if (err != ENOENT) VERIFY0(err); - ASSERT0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, + ASSERT0(zap_count(mos, dsl_dataset_phys(ds)->ds_next_clones_obj, &count)); - ASSERT3U(count, <=, ds->ds_phys->ds_num_children - 2); + ASSERT3U(count, <=, dsl_dataset_phys(ds)->ds_num_children - 2); } blkptr_t * dsl_dataset_get_blkptr(dsl_dataset_t *ds) { - return (&ds->ds_phys->ds_bp); + return (&dsl_dataset_phys(ds)->ds_bp); } void @@ -900,7 +910,7 @@ dsl_dataset_set_blkptr(dsl_dataset_t *ds tx->tx_pool->dp_meta_rootbp = *bp; } else { dmu_buf_will_dirty(ds->ds_dbuf, tx); - ds->ds_phys->ds_bp = *bp; + dsl_dataset_phys(ds)->ds_bp = *bp; } } @@ -920,7 +930,7 @@ dsl_dataset_dirty(dsl_dataset_t *ds, dmu ASSERT(ds->ds_objset != NULL); - if (ds->ds_phys->ds_next_snap_obj != 0) + if (dsl_dataset_phys(ds)->ds_next_snap_obj != 0) panic("dirtying snapshot!"); dp = ds->ds_dir->dd_pool; @@ -956,7 +966,7 @@ dsl_dataset_snapshot_reserve_space(dsl_d * outside of the reservation. */ ASSERT(ds->ds_reserved == 0 || DS_UNIQUE_IS_ACCURATE(ds)); - asize = MIN(ds->ds_phys->ds_unique_bytes, ds->ds_reserved); + asize = MIN(dsl_dataset_phys(ds)->ds_unique_bytes, ds->ds_reserved); if (asize > dsl_dir_space_available(ds->ds_dir, NULL, 0, TRUE)) return (SET_ERROR(ENOSPC)); @@ -993,7 +1003,7 @@ dsl_dataset_snapshot_check_impl(dsl_data * We don't allow multiple snapshots of the same txg. If there * is already one, try again. */ - if (ds->ds_phys->ds_prev_snap_txg >= tx->tx_txg) + if (dsl_dataset_phys(ds)->ds_prev_snap_txg >= tx->tx_txg) return (SET_ERROR(EAGAIN)); /* @@ -1219,35 +1229,38 @@ dsl_dataset_snapshot_sync_impl(dsl_datas dsphys->ds_fsid_guid = unique_create(); (void) random_get_pseudo_bytes((void*)&dsphys->ds_guid, sizeof (dsphys->ds_guid)); - dsphys->ds_prev_snap_obj = ds->ds_phys->ds_prev_snap_obj; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 01:01:53 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 01:21:13 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 01:47:39 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 03:00:00 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 03:15:47 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 07:30:09 2014 Return-Path: Delivered-To: svn-src-all@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 ABD33790; Sat, 6 Dec 2014 07:30: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 8D46ED58; Sat, 6 Dec 2014 07:30: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 sB67U9FA029170; Sat, 6 Dec 2014 07:30:09 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB67U9ir029169; Sat, 6 Dec 2014 07:30:09 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201412060730.sB67U9ir029169@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 07:30:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275559 - stable/10/sys/dev/iscsi X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 07:30:09 -0000 Author: mav Date: Sat Dec 6 07:30:08 2014 New Revision: 275559 URL: https://svnweb.freebsd.org/changeset/base/275559 Log: MFC r274843, r274845: Move icl_pdu_get_data() and xpt_done() out of initiator's session lock. During heavy reads data copying in icl_pdu_get_data() may consume large percent of CPU time. Moving it out of the lock significantly reduces lock hold time and respectively lock congestion on read operations. Modified: stable/10/sys/dev/iscsi/iscsi.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/iscsi/iscsi.c ============================================================================== --- stable/10/sys/dev/iscsi/iscsi.c Sat Dec 6 04:02:56 2014 (r275558) +++ stable/10/sys/dev/iscsi/iscsi.c Sat Dec 6 07:30:08 2014 (r275559) @@ -144,6 +144,7 @@ static uma_zone_t iscsi_outstanding_zone #define ISCSI_SESSION_LOCK(X) mtx_lock(&X->is_lock) #define ISCSI_SESSION_UNLOCK(X) mtx_unlock(&X->is_lock) #define ISCSI_SESSION_LOCK_ASSERT(X) mtx_assert(&X->is_lock, MA_OWNED) +#define ISCSI_SESSION_LOCK_ASSERT_NOT(X) mtx_assert(&X->is_lock, MA_NOTOWNED) static int iscsi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int mode, struct thread *td); @@ -714,37 +715,46 @@ iscsi_receive_callback(struct icl_pdu *r switch (response->ip_bhs->bhs_opcode) { case ISCSI_BHS_OPCODE_NOP_IN: iscsi_pdu_handle_nop_in(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_SCSI_RESPONSE: iscsi_pdu_handle_scsi_response(response); + /* Session lock dropped inside. */ + ISCSI_SESSION_LOCK_ASSERT_NOT(is); break; case ISCSI_BHS_OPCODE_TASK_RESPONSE: iscsi_pdu_handle_task_response(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_SCSI_DATA_IN: iscsi_pdu_handle_data_in(response); + /* Session lock dropped inside. */ + ISCSI_SESSION_LOCK_ASSERT_NOT(is); break; case ISCSI_BHS_OPCODE_LOGOUT_RESPONSE: iscsi_pdu_handle_logout_response(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_R2T: iscsi_pdu_handle_r2t(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_ASYNC_MESSAGE: iscsi_pdu_handle_async_message(response); + ISCSI_SESSION_UNLOCK(is); break; case ISCSI_BHS_OPCODE_REJECT: iscsi_pdu_handle_reject(response); + ISCSI_SESSION_UNLOCK(is); break; default: ISCSI_SESSION_WARN(is, "received PDU with unsupported " "opcode 0x%x; reconnecting", response->ip_bhs->bhs_opcode); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); icl_pdu_free(response); } - - ISCSI_SESSION_UNLOCK(is); } static void @@ -833,8 +843,9 @@ iscsi_pdu_handle_scsi_response(struct ic struct iscsi_bhs_scsi_response *bhssr; struct iscsi_outstanding *io; struct iscsi_session *is; + union ccb *ccb; struct ccb_scsiio *csio; - size_t data_segment_len; + size_t data_segment_len, received; uint16_t sense_len; is = PDU_SESSION(response); @@ -845,46 +856,44 @@ iscsi_pdu_handle_scsi_response(struct ic ISCSI_SESSION_WARN(is, "bad itt 0x%x", bhssr->bhssr_initiator_task_tag); icl_pdu_free(response); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); return; } + ccb = io->io_ccb; + received = io->io_received; + iscsi_outstanding_remove(is, io); + ISCSI_SESSION_UNLOCK(is); + if (bhssr->bhssr_response != BHSSR_RESPONSE_COMMAND_COMPLETED) { ISCSI_SESSION_WARN(is, "service response 0x%x", bhssr->bhssr_response); - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; + ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; } else if (bhssr->bhssr_status == 0) { - io->io_ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_CMP; } else { - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_DEV_QFRZN; - io->io_ccb->csio.scsi_status = bhssr->bhssr_status; + ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_DEV_QFRZN; + ccb->csio.scsi_status = bhssr->bhssr_status; } - if (bhssr->bhssr_flags & BHSSR_FLAGS_RESIDUAL_OVERFLOW) { - ISCSI_SESSION_WARN(is, "target indicated residual overflow"); - icl_pdu_free(response); - iscsi_session_reconnect(is); - return; - } - - csio = &io->io_ccb->csio; - + csio = &ccb->csio; data_segment_len = icl_pdu_data_segment_length(response); if (data_segment_len > 0) { if (data_segment_len < sizeof(sense_len)) { ISCSI_SESSION_WARN(is, "truncated data segment (%zd bytes)", data_segment_len); - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; + ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; goto out; } icl_pdu_get_data(response, 0, &sense_len, sizeof(sense_len)); @@ -897,11 +906,11 @@ iscsi_pdu_handle_scsi_response(struct ic ISCSI_SESSION_WARN(is, "truncated data segment " "(%zd bytes, should be %zd)", data_segment_len, sizeof(sense_len) + sense_len); - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; + ccb->ccb_h.status = CAM_REQ_CMP_ERR | CAM_DEV_QFRZN; goto out; } else if (sizeof(sense_len) + sense_len < data_segment_len) ISCSI_SESSION_WARN(is, "oversize data segment " @@ -914,7 +923,7 @@ iscsi_pdu_handle_scsi_response(struct ic } icl_pdu_get_data(response, sizeof(sense_len), &csio->sense_data, sense_len); csio->sense_resid = csio->sense_len - sense_len; - io->io_ccb->ccb_h.status |= CAM_AUTOSNS_VALID; + ccb->ccb_h.status |= CAM_AUTOSNS_VALID; } out: @@ -922,21 +931,19 @@ out: csio->resid = ntohl(bhssr->bhssr_residual_count); if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { - KASSERT(io->io_received <= csio->dxfer_len, - ("io->io_received > csio->dxfer_len")); - if (io->io_received < csio->dxfer_len) { - if (csio->resid != csio->dxfer_len - io->io_received) { + KASSERT(received <= csio->dxfer_len, + ("received > csio->dxfer_len")); + if (received < csio->dxfer_len) { + if (csio->resid != csio->dxfer_len - received) { ISCSI_SESSION_WARN(is, "underflow mismatch: " "target indicates %d, we calculated %zd", - csio->resid, - csio->dxfer_len - io->io_received); + csio->resid, csio->dxfer_len - received); } - csio->resid = csio->dxfer_len - io->io_received; + csio->resid = csio->dxfer_len - received; } } - xpt_done(io->io_ccb); - iscsi_outstanding_remove(is, io); + xpt_done(ccb); icl_pdu_free(response); } @@ -978,8 +985,9 @@ iscsi_pdu_handle_data_in(struct icl_pdu struct iscsi_bhs_data_in *bhsdi; struct iscsi_outstanding *io; struct iscsi_session *is; + union ccb *ccb; struct ccb_scsiio *csio; - size_t data_segment_len; + size_t data_segment_len, received, oreceived; is = PDU_SESSION(response); bhsdi = (struct iscsi_bhs_data_in *)response->ip_bhs; @@ -988,6 +996,7 @@ iscsi_pdu_handle_data_in(struct icl_pdu ISCSI_SESSION_WARN(is, "bad itt 0x%x", bhsdi->bhsdi_initiator_task_tag); icl_pdu_free(response); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); return; } @@ -998,6 +1007,7 @@ iscsi_pdu_handle_data_in(struct icl_pdu * but initiators and targets MUST be able to properly receive * 0 length data segments." */ + ISCSI_SESSION_UNLOCK(is); icl_pdu_free(response); return; } @@ -1012,10 +1022,12 @@ iscsi_pdu_handle_data_in(struct icl_pdu io->io_received, (size_t)ntohl(bhsdi->bhsdi_buffer_offset)); icl_pdu_free(response); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); return; } - csio = &io->io_ccb->csio; + ccb = io->io_ccb; + csio = &ccb->csio; if (io->io_received + data_segment_len > csio->dxfer_len) { ISCSI_SESSION_WARN(is, "oversize data segment (%zd bytes " @@ -1023,11 +1035,18 @@ iscsi_pdu_handle_data_in(struct icl_pdu data_segment_len, io->io_received, csio->dxfer_len); icl_pdu_free(response); iscsi_session_reconnect(is); + ISCSI_SESSION_UNLOCK(is); return; } - icl_pdu_get_data(response, 0, csio->data_ptr + io->io_received, data_segment_len); + oreceived = io->io_received; io->io_received += data_segment_len; + received = io->io_received; + if ((bhsdi->bhsdi_flags & BHSDI_FLAGS_S) != 0) + iscsi_outstanding_remove(is, io); + ISCSI_SESSION_UNLOCK(is); + + icl_pdu_get_data(response, 0, csio->data_ptr + oreceived, data_segment_len); /* * XXX: Check DataSN. @@ -1043,33 +1062,31 @@ iscsi_pdu_handle_data_in(struct icl_pdu //ISCSI_SESSION_DEBUG(is, "got S flag; status 0x%x", bhsdi->bhsdi_status); if (bhsdi->bhsdi_status == 0) { - io->io_ccb->ccb_h.status = CAM_REQ_CMP; + ccb->ccb_h.status = CAM_REQ_CMP; } else { - if ((io->io_ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { - xpt_freeze_devq(io->io_ccb->ccb_h.path, 1); + if ((ccb->ccb_h.status & CAM_DEV_QFRZN) == 0) { + xpt_freeze_devq(ccb->ccb_h.path, 1); ISCSI_SESSION_DEBUG(is, "freezing devq"); } - io->io_ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_DEV_QFRZN; + ccb->ccb_h.status = CAM_SCSI_STATUS_ERROR | CAM_DEV_QFRZN; csio->scsi_status = bhsdi->bhsdi_status; } if ((csio->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN) { - KASSERT(io->io_received <= csio->dxfer_len, - ("io->io_received > csio->dxfer_len")); - if (io->io_received < csio->dxfer_len) { + KASSERT(received <= csio->dxfer_len, + ("received > csio->dxfer_len")); + if (received < csio->dxfer_len) { csio->resid = ntohl(bhsdi->bhsdi_residual_count); - if (csio->resid != csio->dxfer_len - io->io_received) { + if (csio->resid != csio->dxfer_len - received) { ISCSI_SESSION_WARN(is, "underflow mismatch: " "target indicates %d, we calculated %zd", - csio->resid, - csio->dxfer_len - io->io_received); + csio->resid, csio->dxfer_len - received); } - csio->resid = csio->dxfer_len - io->io_received; + csio->resid = csio->dxfer_len - received; } } - xpt_done(io->io_ccb); - iscsi_outstanding_remove(is, io); + xpt_done(ccb); icl_pdu_free(response); } From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 09:11:14 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 09:14:46 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 09:38:29 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 10:05:08 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 11:59:35 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 12:03:10 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 15:16:00 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 17:50:38 2014 Return-Path: Delivered-To: svn-src-all@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 462C7EC2; Sat, 6 Dec 2014 17:50: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 322A9C90; Sat, 6 Dec 2014 17:50: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 sB6Hob6K033070; Sat, 6 Dec 2014 17:50:37 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sB6HoblN033069; Sat, 6 Dec 2014 17:50:37 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201412061750.sB6HoblN033069@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Sat, 6 Dec 2014 17:50:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r275566 - stable/10/lib/libc/sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2014 17:50:38 -0000 Author: brooks Date: Sat Dec 6 17:50:37 2014 New Revision: 275566 URL: https://svnweb.freebsd.org/changeset/base/275566 Log: MFC r263928: Use the correct variable name in the example code. PR: 195749 Modified: stable/10/lib/libc/sys/cap_rights_limit.2 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libc/sys/cap_rights_limit.2 ============================================================================== --- stable/10/lib/libc/sys/cap_rights_limit.2 Sat Dec 6 12:03:09 2014 (r275565) +++ stable/10/lib/libc/sys/cap_rights_limit.2 Sat Dec 6 17:50:37 2014 (r275566) @@ -86,7 +86,7 @@ manual page. The following example demonstrates how to limit file descriptor capability rights to allow reading only. .Bd -literal -cap_rights_t rights; +cap_rights_t setrights; char buf[1]; int fd; From owner-svn-src-all@FreeBSD.ORG Sat Dec 6 19:35:47 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 20:00:10 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 20:39:27 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 21:00:37 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 21:34:38 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 21:50:36 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 21:55:18 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 22:03:13 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 22:11:11 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 22:28:52 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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-all@FreeBSD.ORG Sat Dec 6 22:57:20 2014 Return-Path: Delivered-To: svn-src-all@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-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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