From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 02:34:00 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1DC27DF1; Sun, 16 Feb 2014 02:34: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 09A911031; Sun, 16 Feb 2014 02:34:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1G2XxD4052035; Sun, 16 Feb 2014 02:33:59 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1G2Xxq2052034; Sun, 16 Feb 2014 02:33:59 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402160233.s1G2Xxq2052034@svn.freebsd.org> From: Eitan Adler Date: Sun, 16 Feb 2014 02:33:59 +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: r261954 - stable/10/lib/libutil X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 02:34:00 -0000 Author: eadler Date: Sun Feb 16 02:33:59 2014 New Revision: 261954 URL: http://svnweb.freebsd.org/changeset/base/261954 Log: MFC r261824: libutil/pw_util.3: Fix two prototypes. Modified: stable/10/lib/libutil/pw_util.3 Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libutil/pw_util.3 ============================================================================== --- stable/10/lib/libutil/pw_util.3 Sun Feb 16 02:09:42 2014 (r261953) +++ stable/10/lib/libutil/pw_util.3 Sun Feb 16 02:33:59 2014 (r261954) @@ -48,13 +48,13 @@ .In pwd.h .In libutil.h .Ft int -.Fn pw_copy "int ffd" "int tfd" "const struct passwd *pw" "const struct passwd *oldpw" +.Fn pw_copy "int ffd" "int tfd" "const struct passwd *pw" "struct passwd *oldpw" .Ft "struct passwd *" .Fn pw_dup "const struct passwd *pw" .Ft int .Fn pw_edit "int nosetuid" .Ft int -.Fn pw_equal "const struct passwd *pw1" "const struct passwd pw2" +.Fn pw_equal "const struct passwd *pw1" "const struct passwd *pw2" .Ft void .Fn pw_fini "void" .Ft int From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 08:35:34 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B10A4C2C; Sun, 16 Feb 2014 08:35: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8153919BC; Sun, 16 Feb 2014 08:35:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1G8ZYd8009165; Sun, 16 Feb 2014 08:35:34 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1G8ZYkh009164; Sun, 16 Feb 2014 08:35:34 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201402160835.s1G8ZYkh009164@svn.freebsd.org> From: Rui Paulo Date: Sun, 16 Feb 2014 08:35:34 +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: r261961 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 08:35:34 -0000 Author: rpaulo Date: Sun Feb 16 08:35:33 2014 New Revision: 261961 URL: http://svnweb.freebsd.org/changeset/base/261961 Log: MFC r261863 Add urtwn_start_locked() to avoid unlocking during TX. Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwn.c Sun Feb 16 06:56:44 2014 (r261960) +++ stable/10/sys/dev/usb/wlan/if_urtwn.c Sun Feb 16 08:35:33 2014 (r261961) @@ -209,6 +209,8 @@ static int urtwn_tx_start(struct urtwn_ struct ieee80211_node *, struct mbuf *, struct urtwn_data *); static void urtwn_start(struct ifnet *); +static void urtwn_start_locked(struct ifnet *, + struct urtwn_softc *); static int urtwn_ioctl(struct ifnet *, u_long, caddr_t); static int urtwn_power_on(struct urtwn_softc *); static int urtwn_llt_init(struct urtwn_softc *); @@ -866,13 +868,9 @@ tr_setup: } STAILQ_REMOVE_HEAD(&sc->sc_tx_pending, next); STAILQ_INSERT_TAIL(&sc->sc_tx_active, data, next); - usbd_xfer_set_frame_data(xfer, 0, data->buf, data->buflen); usbd_transfer_submit(xfer); - - URTWN_UNLOCK(sc); - urtwn_start(ifp); - URTWN_LOCK(sc); + urtwn_start_locked(ifp, sc); break; default: data = STAILQ_FIRST(&sc->sc_tx_active); @@ -1715,14 +1713,22 @@ static void urtwn_start(struct ifnet *ifp) { struct urtwn_softc *sc = ifp->if_softc; - struct ieee80211_node *ni; - struct mbuf *m; - struct urtwn_data *bf; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) return; - URTWN_LOCK(sc); + urtwn_start_locked(ifp, sc); + URTWN_UNLOCK(sc); +} + +static void +urtwn_start_locked(struct ifnet *ifp, struct urtwn_softc *sc) +{ + struct ieee80211_node *ni; + struct mbuf *m; + struct urtwn_data *bf; + + URTWN_ASSERT_LOCKED(sc); for (;;) { IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) @@ -1745,7 +1751,6 @@ urtwn_start(struct ifnet *ifp) sc->sc_txtimer = 5; callout_reset(&sc->sc_watchdog_ch, hz, urtwn_watchdog, sc); } - URTWN_UNLOCK(sc); } static int From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 10:16:08 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1FD7B369; Sun, 16 Feb 2014 10:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 08FDB10B5; Sun, 16 Feb 2014 10:16:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GAG7fj053182; Sun, 16 Feb 2014 10:16:07 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GAG7hA053179; Sun, 16 Feb 2014 10:16:07 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161016.s1GAG7hA053179@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 10:16:07 +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: r261963 - in stable/10/sbin: growfs newfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 10:16:08 -0000 Author: brueffer Date: Sun Feb 16 10:16:07 2014 New Revision: 261963 URL: http://svnweb.freebsd.org/changeset/base/261963 Log: Refer newfs and growfs users to fsck_ffs instead of fsck, the latter does not accept the referred to "-b" flag. PR: 82720 Submitted by: David D.W. Downey Modified: stable/10/sbin/growfs/growfs.c stable/10/sbin/newfs/mkfs.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/growfs/growfs.c ============================================================================== --- stable/10/sbin/growfs/growfs.c Sun Feb 16 08:42:52 2014 (r261962) +++ stable/10/sbin/growfs/growfs.c Sun Feb 16 10:16:07 2014 (r261963) @@ -201,7 +201,7 @@ growfs(int fsi, int fso, unsigned int Nf * Now build the cylinders group blocks and * then print out indices of cylinder groups. */ - printf("super-block backups (for fsck -b #) at:\n"); + printf("super-block backups (for fsck_ffs -b #) at:\n"); i = 0; width = charsperline(); Modified: stable/10/sbin/newfs/mkfs.c ============================================================================== --- stable/10/sbin/newfs/mkfs.c Sun Feb 16 08:42:52 2014 (r261962) +++ stable/10/sbin/newfs/mkfs.c Sun Feb 16 10:16:07 2014 (r261963) @@ -546,7 +546,7 @@ restart: * Now build the cylinders group blocks and * then print out indices of cylinder groups. */ - printf("super-block backups (for fsck -b #) at:\n"); + printf("super-block backups (for fsck_ffs -b #) at:\n"); i = 0; width = charsperline(); /* From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 10:28:19 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 01BEE65A; Sun, 16 Feb 2014 10:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF13E114C; Sun, 16 Feb 2014 10:28:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GASIMp057728; Sun, 16 Feb 2014 10:28:18 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GASI5v057727; Sun, 16 Feb 2014 10:28:18 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161028.s1GASI5v057727@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 10:28:18 +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: r261964 - stable/9/sbin/growfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 10:28:19 -0000 Author: brueffer Date: Sun Feb 16 10:28:18 2014 New Revision: 261964 URL: http://svnweb.freebsd.org/changeset/base/261964 Log: MFC: r261655 Refer newfs and growfs users to fsck_ffs instead of fsck, the latter does not accept the referred to "-b" flag. The part of the change pertaining newfs has already been merged to stable/9 in r237505, so only record that part of the merge. PR: 82720 Submitted by: David D.W. Downey Modified: stable/9/sbin/growfs/growfs.c Directory Properties: stable/9/sbin/growfs/ (props changed) stable/9/sbin/newfs/ (props changed) Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sun Feb 16 10:16:07 2014 (r261963) +++ stable/9/sbin/growfs/growfs.c Sun Feb 16 10:28:18 2014 (r261964) @@ -206,7 +206,7 @@ growfs(int fsi, int fso, unsigned int Nf * Now build the cylinders group blocks and * then print out indices of cylinder groups. */ - printf("super-block backups (for fsck -b #) at:\n"); + printf("super-block backups (for fsck_ffs -b #) at:\n"); i = 0; width = charsperline(); From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 10:39:30 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 72B8C59E; Sun, 16 Feb 2014 10:39: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 41E351218; Sun, 16 Feb 2014 10:39:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GAdUdf063391; Sun, 16 Feb 2014 10:39:30 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GAdUd2063390; Sun, 16 Feb 2014 10:39:30 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161039.s1GAdUd2063390@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 10:39: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: r261965 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 10:39:30 -0000 Author: brueffer Date: Sun Feb 16 10:39:29 2014 New Revision: 261965 URL: http://svnweb.freebsd.org/changeset/base/261965 Log: MFC: r261701 Allow iwn2000 and iwn2030 firmware to be linked into the kernel. PR: 184631 Submitted by: Oliver Pinter Modified: stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Sun Feb 16 10:28:18 2014 (r261964) +++ stable/10/sys/conf/files Sun Feb 16 10:39:29 2014 (r261965) @@ -1605,6 +1605,34 @@ iwn1000.fw optional iwn1000fw | iwnfw compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwn1000.fw" +iwn2000fw.c optional iwn2000fw | iwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwn2000.fw:iwn2000fw -miwn2000fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwn2000fw.c" +iwn2000fw.fwo optional iwn2000fw | iwnfw \ + dependency "iwn2000.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "iwn2000fw.fwo" +iwn2000.fw optional iwn2000fw | iwnfw \ + dependency "$S/contrib/dev/iwn/iwlwifi-2000-18.168.6.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "iwn2000.fw" +iwn2030fw.c optional iwn2030fw | iwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwn2030.fw:iwn2030fw -miwn2030fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwn2030fw.c" +iwn2030fw.fwo optional iwn2030fw | iwnfw \ + dependency "iwn2030.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "iwn2030fw.fwo" +iwn2030.fw optional iwn2030fw | iwnfw \ + dependency "$S/contrib/dev/iwn/iwnwifi-2030-18.168.6.1.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "iwn2030.fw" iwn4965fw.c optional iwn4965fw | iwnfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk iwn4965.fw:iwn4965fw -miwn4965fw -c${.TARGET}" \ no-implicit-rule before-depend local \ From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 11:11:42 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91890393; Sun, 16 Feb 2014 11:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F7D3148D; Sun, 16 Feb 2014 11:11:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GBBgeJ080414; Sun, 16 Feb 2014 11:11:42 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GBBgvR080411; Sun, 16 Feb 2014 11:11:42 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161111.s1GBBgvR080411@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 11:11: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: r261971 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 11:11:42 -0000 Author: brueffer Date: Sun Feb 16 11:11:41 2014 New Revision: 261971 URL: http://svnweb.freebsd.org/changeset/base/261971 Log: MFC: r261702 Update and sort the list of iwn(4) firmware. Modified: stable/10/share/man/man4/iwn.4 stable/10/share/man/man4/iwnfw.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/iwn.4 ============================================================================== --- stable/10/share/man/man4/iwn.4 Sun Feb 16 10:59:44 2014 (r261970) +++ stable/10/share/man/man4/iwn.4 Sun Feb 16 11:11:41 2014 (r261971) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 19, 2013 +.Dd February 9, 2014 .Dt IWN 4 .Os .Sh NAME @@ -45,8 +45,10 @@ kernel configuration file: You also need to select a firmware for your device. Choose one from: .Bd -ragged -offset indent -.Cd "device iwn4965fw" .Cd "device iwn1000fw" +.Cd "device iwn2000fw" +.Cd "device iwn2030fw" +.Cd "device iwn4965fw" .Cd "device iwn5000fw" .Cd "device iwn5150fw" .Cd "device iwn6000fw" @@ -67,8 +69,10 @@ module at boot time, place the following .Xr loader.conf 5 : .Bd -literal -offset indent if_iwn_load="YES" -iwn4965fw_load="YES" iwn1000fw_load="YES" +iwn2000fw_load="YES" +iwn2030fw_load="YES" +iwn4965fw_load="YES" iwn5000fw_load="YES" iwn5150fw_load="YES" iwn6000fw_load="YES" Modified: stable/10/share/man/man4/iwnfw.4 ============================================================================== --- stable/10/share/man/man4/iwnfw.4 Sun Feb 16 10:59:44 2014 (r261970) +++ stable/10/share/man/man4/iwnfw.4 Sun Feb 16 11:11:41 2014 (r261971) @@ -22,7 +22,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2011 +.Dd February 9, 2014 .Dt IWNFW 4 .Os .Sh NAME @@ -40,8 +40,10 @@ This will include three firmware images If you want to pick only the firmware image for your network adapter choose one of the following: .Bd -ragged -offset indent -.Cd "device iwn4965fw" .Cd "device iwn1000fw" +.Cd "device iwn2000fw" +.Cd "device iwn2030fw" +.Cd "device iwn4965fw" .Cd "device iwn5000fw" .Cd "device iwn5150fw" .Cd "device iwn6000fw" @@ -54,8 +56,10 @@ Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -iwn4965fw_load="YES" iwn1000fw_load="YES" +iwn2000fw_load="YES" +iwn2030fw_load="YES" +iwn4965fw_load="YES" iwn5000fw_load="YES" iwn5150fw_load="YES" iwn6000fw_load="YES" @@ -65,7 +69,7 @@ iwn6050fw_load="YES" .Ed .Sh DESCRIPTION This module provides access to firmware sets for the -Intel Wireless WiFi Link 4965, 1000, 5000 and 6000 series of +Intel Wireless WiFi Link 1000, 2000, 2030, 4965, 5000 and 6000 series of IEEE 802.11n adapters. It may be statically linked into the kernel, or loaded as a module. From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 11:13:14 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9D2560B; Sun, 16 Feb 2014 11:13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A5D9014A5; Sun, 16 Feb 2014 11:13:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GBDEwJ080755; Sun, 16 Feb 2014 11:13:14 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GBDEPJ080754; Sun, 16 Feb 2014 11:13:14 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161113.s1GBDEPJ080754@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 11:13: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: r261972 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 11:13:14 -0000 Author: brueffer Date: Sun Feb 16 11:13:14 2014 New Revision: 261972 URL: http://svnweb.freebsd.org/changeset/base/261972 Log: MFC: r261838 Add a deprecation notice to nve.4 and Xref nfe.4. Modified: stable/10/share/man/man4/nve.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/nve.4 ============================================================================== --- stable/10/share/man/man4/nve.4 Sun Feb 16 11:11:41 2014 (r261971) +++ stable/10/share/man/man4/nve.4 Sun Feb 16 11:13:14 2014 (r261972) @@ -26,13 +26,21 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2011 +.Dd February 13, 2014 .Dt NVE 4 .Os .Sh NAME .Nm nve .Nd "NVIDIA nForce MCP Networking Adapter device driver" .Sh SYNOPSIS +.Sy Warning: +This driver is deprecated and will not be available in +.Fx 11.0 +and later. +Please consider using the +.Xr nfe 4 +driver instead. +.Pp To compile this driver into the kernel, place the following lines in your kernel configuration file: @@ -119,6 +127,7 @@ the network connection (cable). .Xr arp 4 , .Xr miibus 4 , .Xr netintro 4 , +.Xr nfe 4 , .Xr ng_ether 4 , .Xr rgephy 4 , .Xr ifconfig 8 From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 11:14:39 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D6C18F3; Sun, 16 Feb 2014 11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA97114B7; Sun, 16 Feb 2014 11:14:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GBEbe4081232; Sun, 16 Feb 2014 11:14:37 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GBEbFf081231; Sun, 16 Feb 2014 11:14:37 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161114.s1GBEbFf081231@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 11:14:37 +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: r261973 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 11:14:39 -0000 Author: brueffer Date: Sun Feb 16 11:14:36 2014 New Revision: 261973 URL: http://svnweb.freebsd.org/changeset/base/261973 Log: MFC: r261838 Add a deprecation notice to nve.4 and Xref nfe.4. Modified: stable/9/share/man/man4/nve.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/nve.4 ============================================================================== --- stable/9/share/man/man4/nve.4 Sun Feb 16 11:13:14 2014 (r261972) +++ stable/9/share/man/man4/nve.4 Sun Feb 16 11:14:36 2014 (r261973) @@ -26,13 +26,21 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2011 +.Dd February 13, 2014 .Dt NVE 4 .Os .Sh NAME .Nm nve .Nd "NVIDIA nForce MCP Networking Adapter device driver" .Sh SYNOPSIS +.Sy Warning: +This driver is deprecated and will not be available in +.Fx 11.0 +and later. +Please consider using the +.Xr nfe 4 +driver instead. +.Pp To compile this driver into the kernel, place the following lines in your kernel configuration file: @@ -119,6 +127,7 @@ the network connection (cable). .Xr arp 4 , .Xr miibus 4 , .Xr netintro 4 , +.Xr nfe 4 , .Xr ng_ether 4 , .Xr rgephy 4 , .Xr ifconfig 8 From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 11:17:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AFA62A4A; Sun, 16 Feb 2014 11:17: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9886214CA; Sun, 16 Feb 2014 11:17:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GBHe83081803; Sun, 16 Feb 2014 11:17:40 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GBHeQY081802; Sun, 16 Feb 2014 11:17:40 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161117.s1GBHeQY081802@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 11:17:40 +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: r261974 - stable/8/share/man/man4 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 11:17:40 -0000 Author: brueffer Date: Sun Feb 16 11:17:40 2014 New Revision: 261974 URL: http://svnweb.freebsd.org/changeset/base/261974 Log: MFC: r261838 Add a deprecation notice to nve.4 and Xref nfe.4. Modified: stable/8/share/man/man4/nve.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/nve.4 ============================================================================== --- stable/8/share/man/man4/nve.4 Sun Feb 16 11:14:36 2014 (r261973) +++ stable/8/share/man/man4/nve.4 Sun Feb 16 11:17:40 2014 (r261974) @@ -26,13 +26,21 @@ .\" .\" $FreeBSD$ .\" -.Dd January 16, 2011 +.Dd February 13, 2014 .Dt NVE 4 .Os .Sh NAME .Nm nve .Nd "NVIDIA nForce MCP Networking Adapter device driver" .Sh SYNOPSIS +.Sy Warning: +This driver is deprecated and will not be available in +.Fx 11.0 +and later. +Please consider using the +.Xr nfe 4 +driver instead. +.Pp To compile this driver into the kernel, place the following lines in your kernel configuration file: @@ -123,6 +131,7 @@ bandwidth show that the card is actually .Xr arp 4 , .Xr miibus 4 , .Xr netintro 4 , +.Xr nfe 4 , .Xr ng_ether 4 , .Xr rgephy 4 , .Xr ifconfig 8 From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 19:12:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0358E36; Sun, 16 Feb 2014 19:12: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 80EE3169F; Sun, 16 Feb 2014 19:12:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJCpDB095686; Sun, 16 Feb 2014 19:12:51 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJCo3N095683; Sun, 16 Feb 2014 19:12:50 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402161912.s1GJCo3N095683@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 19:12:50 +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: r261985 - in stable/10/sys/ia64: ia64 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 19:12:51 -0000 Author: marcel Date: Sun Feb 16 19:12:50 2014 New Revision: 261985 URL: http://svnweb.freebsd.org/changeset/base/261985 Log: MFC r257487: Use LOG2_ID_PAGE_SIZE again for the identity mapping in regions 6 & 7. Modified: stable/10/sys/ia64/ia64/machdep.c stable/10/sys/ia64/ia64/mp_machdep.c stable/10/sys/ia64/include/param.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/machdep.c Sun Feb 16 19:08:10 2014 (r261984) +++ stable/10/sys/ia64/ia64/machdep.c Sun Feb 16 19:12:50 2014 (r261985) @@ -716,8 +716,8 @@ ia64_init(void) * handlers. Here we just make sure that they have the largest * possible page size to minimise TLB usage. */ - ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (PAGE_SHIFT << 2)); - ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (PAGE_SHIFT << 2)); + ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (LOG2_ID_PAGE_SIZE << 2)); + ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (LOG2_ID_PAGE_SIZE << 2)); ia64_srlz_d(); /* Initialize/setup physical memory datastructures */ Modified: stable/10/sys/ia64/ia64/mp_machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/mp_machdep.c Sun Feb 16 19:08:10 2014 (r261984) +++ stable/10/sys/ia64/ia64/mp_machdep.c Sun Feb 16 19:12:50 2014 (r261985) @@ -206,8 +206,8 @@ ia64_ap_startup(void) ia64_ap_state.as_trace = 0x100; ia64_set_rr(IA64_RR_BASE(5), (5 << 8) | (PAGE_SHIFT << 2) | 1); - ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (PAGE_SHIFT << 2)); - ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (PAGE_SHIFT << 2)); + ia64_set_rr(IA64_RR_BASE(6), (6 << 8) | (LOG2_ID_PAGE_SIZE << 2)); + ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (LOG2_ID_PAGE_SIZE << 2)); ia64_srlz_d(); pcpup = ia64_ap_state.as_pcpu; Modified: stable/10/sys/ia64/include/param.h ============================================================================== --- stable/10/sys/ia64/include/param.h Sun Feb 16 19:08:10 2014 (r261984) +++ stable/10/sys/ia64/include/param.h Sun Feb 16 19:12:50 2014 (r261985) @@ -105,6 +105,11 @@ #endif #define KSTACK_GUARD_PAGES 0 /* pages of kstack guard; 0 disables */ +/* The default size of identity mappings in region 6 & 7. */ +#ifndef LOG2_ID_PAGE_SIZE +#define LOG2_ID_PAGE_SIZE 16 +#endif + /* * Mach derived conversion macros */ From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 19:20:14 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8AD5E132; Sun, 16 Feb 2014 19:20: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 75DAD16D3; Sun, 16 Feb 2014 19:20:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJKEfJ097029; Sun, 16 Feb 2014 19:20:14 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJKEc1097028; Sun, 16 Feb 2014 19:20:14 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402161920.s1GJKEc1097028@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 19:20: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: r261986 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 19:20:14 -0000 Author: marcel Date: Sun Feb 16 19:20:13 2014 New Revision: 261986 URL: http://svnweb.freebsd.org/changeset/base/261986 Log: MFC r257910: Don't enable interrupts before we call sched_throw(). Modified: stable/10/sys/ia64/ia64/mp_machdep.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/mp_machdep.c ============================================================================== --- stable/10/sys/ia64/ia64/mp_machdep.c Sun Feb 16 19:12:50 2014 (r261985) +++ stable/10/sys/ia64/ia64/mp_machdep.c Sun Feb 16 19:20:13 2014 (r261986) @@ -249,8 +249,6 @@ ia64_ap_startup(void) ia64_set_tpr(0); ia64_srlz_d(); - ia64_enable_intr(); - sched_throw(NULL); /* NOTREACHED */ } From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 19:38:18 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58729950; Sun, 16 Feb 2014 19:38: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 443B81865; Sun, 16 Feb 2014 19:38:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJcIYh005495; Sun, 16 Feb 2014 19:38:18 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJcI4H005494; Sun, 16 Feb 2014 19:38:18 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161938.s1GJcI4H005494@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 19:38: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: r261989 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 19:38:18 -0000 Author: brueffer Date: Sun Feb 16 19:38:17 2014 New Revision: 261989 URL: http://svnweb.freebsd.org/changeset/base/261989 Log: Direct commit to stable/10 to note that the nve(4) driver has been deprecated. Modified: stable/10/UPDATING Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Sun Feb 16 19:33:34 2014 (r261988) +++ stable/10/UPDATING Sun Feb 16 19:38:17 2014 (r261989) @@ -16,6 +16,13 @@ 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. + +20140216: + The nve(4) driver for NVIDIA nForce MCP Ethernet adapters has + been deprecated and will not be part of FreeBSD 11.0 and later + releases. If you use this driver, please consider switching to + the nfe(4) driver instead. + 20140120: 10.0-RELEASE. From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 19:41:44 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E425B89; Sun, 16 Feb 2014 19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8938118D2; Sun, 16 Feb 2014 19:41:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJfiVu008664; Sun, 16 Feb 2014 19:41:44 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJfiwo008663; Sun, 16 Feb 2014 19:41:44 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161941.s1GJfiwo008663@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 19:41:44 +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: r261990 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 19:41:44 -0000 Author: brueffer Date: Sun Feb 16 19:41:44 2014 New Revision: 261990 URL: http://svnweb.freebsd.org/changeset/base/261990 Log: Direct commit to stable/9 to note that the nve(4) driver has been deprecated. Modified: stable/9/UPDATING Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Sun Feb 16 19:38:17 2014 (r261989) +++ stable/9/UPDATING Sun Feb 16 19:41:44 2014 (r261990) @@ -11,6 +11,12 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20140216: + The nve(4) driver for NVIDIA nForce MCP Ethernet adapters has + been deprecated and will not be part of FreeBSD 11.0 and later + releases. If you use this driver, please consider switching to + the nfe(4) driver instead. + 20131216: The behavior of gss_pseudo_random() for the krb5 mechanism has changed, for applications requesting a longer random string From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 19:44:30 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4380DCC; Sun, 16 Feb 2014 19:44: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BCFD918DB; Sun, 16 Feb 2014 19:44:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJiUi8009228; Sun, 16 Feb 2014 19:44:30 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJiUID009227; Sun, 16 Feb 2014 19:44:30 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402161944.s1GJiUID009227@svn.freebsd.org> From: Christian Brueffer Date: Sun, 16 Feb 2014 19:44: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: r261992 - stable/8 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 19:44:30 -0000 Author: brueffer Date: Sun Feb 16 19:44:30 2014 New Revision: 261992 URL: http://svnweb.freebsd.org/changeset/base/261992 Log: Direct commit to stable/8 to note that the nve(4) driver has been deprecated. Modified: stable/8/UPDATING Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Sun Feb 16 19:44:07 2014 (r261991) +++ stable/8/UPDATING Sun Feb 16 19:44:30 2014 (r261992) @@ -15,6 +15,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20140216: + The nve(4) driver for NVIDIA nForce MCP Ethernet adapters has + been deprecated and will not be part of FreeBSD 11.0 and later + releases. If you use this driver, please consider switching to + the nfe(4) driver instead. + 20131216: The behavior of gss_pseudo_random() for the krb5 mechanism has changed, for applications requesting a longer random string From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 19:46:21 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F3B0FC3; Sun, 16 Feb 2014 19:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F229B18EF; Sun, 16 Feb 2014 19:46:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GJkKtD009651; Sun, 16 Feb 2014 19:46:20 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GJkKqn009650; Sun, 16 Feb 2014 19:46:20 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402161946.s1GJkKqn009650@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 19:46:20 +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: r261993 - stable/10/sys/geom/part X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 19:46:21 -0000 Author: marcel Date: Sun Feb 16 19:46:20 2014 New Revision: 261993 URL: http://svnweb.freebsd.org/changeset/base/261993 Log: MFC r258448: Have the GPT probe return a lower priority when the MBR is not a PMBR. Modified: stable/10/sys/geom/part/g_part_gpt.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/part/g_part_gpt.c ============================================================================== --- stable/10/sys/geom/part/g_part_gpt.c Sun Feb 16 19:44:30 2014 (r261992) +++ stable/10/sys/geom/part/g_part_gpt.c Sun Feb 16 19:46:20 2014 (r261993) @@ -758,8 +758,8 @@ static int g_part_gpt_probe(struct g_part_table *table, struct g_consumer *cp) { struct g_provider *pp; - char *buf; - int error, res; + u_char *buf; + int error, index, pri, res; /* We don't nest, which means that our depth should be 0. */ if (table->gpt_depth != 0) @@ -784,11 +784,21 @@ g_part_gpt_probe(struct g_part_table *ta if (pp->sectorsize < MBRSIZE || pp->mediasize < 6 * pp->sectorsize) return (ENOSPC); - /* Check that there's a MBR. */ + /* + * Check that there's a MBR or a PMBR. If it's a PMBR, we return + * as the highest priority on a match, otherwise we assume some + * GPT-unaware tool has destroyed the GPT by recreating a MBR and + * we really want the MBR scheme to take precedence. + */ buf = g_read_data(cp, 0L, pp->sectorsize, &error); if (buf == NULL) return (error); res = le16dec(buf + DOSMAGICOFFSET); + pri = G_PART_PROBE_PRI_LOW; + for (index = 0; index < NDOSPART; index++) { + if (buf[DOSPARTOFF + DOSPARTSIZE * index + 4] == 0xee) + pri = G_PART_PROBE_PRI_HIGH; + } g_free(buf); if (res != DOSMAGIC) return (ENXIO); @@ -800,7 +810,7 @@ g_part_gpt_probe(struct g_part_table *ta res = memcmp(buf, GPT_HDR_SIG, 8); g_free(buf); if (res == 0) - return (G_PART_PROBE_PRI_HIGH); + return (pri); /* No primary? Check that there's a secondary. */ buf = g_read_data(cp, pp->mediasize - pp->sectorsize, pp->sectorsize, @@ -809,7 +819,7 @@ g_part_gpt_probe(struct g_part_table *ta return (error); res = memcmp(buf, GPT_HDR_SIG, 8); g_free(buf); - return ((res == 0) ? G_PART_PROBE_PRI_HIGH : ENXIO); + return ((res == 0) ? pri : ENXIO); } static int From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 20:02:30 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 809BC35F; Sun, 16 Feb 2014 20:02: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 69C6F1A05; Sun, 16 Feb 2014 20:02:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GK2UCV017791; Sun, 16 Feb 2014 20:02:30 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GK2Uum017790; Sun, 16 Feb 2014 20:02:30 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162002.s1GK2Uum017790@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 20:02: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: r261994 - stable/10/games/fortune/fortune X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 20:02:30 -0000 Author: marcel Date: Sun Feb 16 20:02:29 2014 New Revision: 261994 URL: http://svnweb.freebsd.org/changeset/base/261994 Log: MFC r259056: Fix r203922 for "fortune -o". Modified: stable/10/games/fortune/fortune/fortune.c Directory Properties: stable/10/ (props changed) Modified: stable/10/games/fortune/fortune/fortune.c ============================================================================== --- stable/10/games/fortune/fortune/fortune.c Sun Feb 16 19:46:20 2014 (r261993) +++ stable/10/games/fortune/fortune/fortune.c Sun Feb 16 20:02:29 2014 (r261994) @@ -486,7 +486,7 @@ add_file(int percent, const char *file, if (Offend) { if (was_malloc) free(tpath); - path = offensive; + path = tpath = offensive; offensive = NULL; was_malloc = TRUE; DPRINTF(1, (stderr, "\ttrying \"%s\"\n", path)); @@ -508,7 +508,7 @@ over: if (All_forts && offensive != NULL) { if (was_malloc) free(tpath); - path = offensive; + path = tpath = offensive; offensive = NULL; was_malloc = TRUE; DPRINTF(1, (stderr, "\ttrying \"%s\"\n", path)); From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 20:13:19 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 24C496EA; Sun, 16 Feb 2014 20:13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1013B1AA5; Sun, 16 Feb 2014 20:13:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GKDIU0022613; Sun, 16 Feb 2014 20:13:18 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GKDIiw022612; Sun, 16 Feb 2014 20:13:18 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162013.s1GKDIiw022612@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 20:13: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: r261995 - stable/10/games/fortune/fortune X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 20:13:19 -0000 Author: marcel Date: Sun Feb 16 20:13:18 2014 New Revision: 261995 URL: http://svnweb.freebsd.org/changeset/base/261995 Log: MFC r259057: Remove "Warning: file \"%s\" unreadable". It was introduced with revision 44599 and turned less than useful ever since fortunes-o.dat got removed. Modified: stable/10/games/fortune/fortune/fortune.c Directory Properties: stable/10/ (props changed) Modified: stable/10/games/fortune/fortune/fortune.c ============================================================================== --- stable/10/games/fortune/fortune/fortune.c Sun Feb 16 20:02:29 2014 (r261994) +++ stable/10/games/fortune/fortune/fortune.c Sun Feb 16 20:13:18 2014 (r261995) @@ -806,10 +806,6 @@ is_fortfile(const char *file, char **dat strcat(datfile, ".dat"); if (access(datfile, R_OK) < 0) { DPRINTF(2, (stderr, "FALSE (no readable \".dat\" file)\n")); -#ifdef DEBUG - if (Debug < 2) - DPRINTF(0, (stderr, "Warning: file \"%s\" unreadable\n", datfile)); -#endif free(datfile); return (FALSE); } From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 20:26:23 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27738CB2; Sun, 16 Feb 2014 20:26: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 118741BA7; Sun, 16 Feb 2014 20:26:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GKQMm0027672; Sun, 16 Feb 2014 20:26:22 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GKQMqO027671; Sun, 16 Feb 2014 20:26:22 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162026.s1GKQMqO027671@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 20:26: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: r261996 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 20:26:23 -0000 Author: marcel Date: Sun Feb 16 20:26:22 2014 New Revision: 261996 URL: http://svnweb.freebsd.org/changeset/base/261996 Log: MFC r259244: Allow pmap_remove_pages() to be called for physical maps not associated with the current thread. Modified: stable/10/sys/ia64/ia64/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/pmap.c ============================================================================== --- stable/10/sys/ia64/ia64/pmap.c Sun Feb 16 20:13:18 2014 (r261995) +++ stable/10/sys/ia64/ia64/pmap.c Sun Feb 16 20:26:22 2014 (r261996) @@ -2118,19 +2118,16 @@ pmap_remove_pages(pmap_t pmap) { struct pv_chunk *pc, *npc; struct ia64_lpte *pte; + pmap_t oldpmap; pv_entry_t pv; vm_offset_t va; vm_page_t m; u_long inuse, bitmask; int allfree, bit, field, idx; - if (pmap != vmspace_pmap(curthread->td_proc->p_vmspace)) { - printf("warning: %s called with non-current pmap\n", - __func__); - return; - } rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); + oldpmap = pmap_switch(pmap); TAILQ_FOREACH_SAFE(pc, &pmap->pm_pvchunk, pc_list, npc) { allfree = 1; for (field = 0; field < _NPCM; field++) { @@ -2170,8 +2167,9 @@ pmap_remove_pages(pmap_t pmap) free_pv_chunk(pc); } } - rw_wunlock(&pvh_global_lock); + pmap_switch(oldpmap); PMAP_UNLOCK(pmap); + rw_wunlock(&pvh_global_lock); } /* From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 20:37:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33BFAEC; Sun, 16 Feb 2014 20:37: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1EBA31C64; Sun, 16 Feb 2014 20:37:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GKbdvN032240; Sun, 16 Feb 2014 20:37:39 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GKbdnJ032239; Sun, 16 Feb 2014 20:37:39 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162037.s1GKbdnJ032239@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 20:37:39 +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: r261997 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 20:37:40 -0000 Author: marcel Date: Sun Feb 16 20:37:39 2014 New Revision: 261997 URL: http://svnweb.freebsd.org/changeset/base/261997 Log: MFC r259441: Properly drain the TTY when both revoke(2) and close(2) end up closing the TTY. Modified: stable/10/sys/kern/tty.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/tty.c ============================================================================== --- stable/10/sys/kern/tty.c Sun Feb 16 20:26:22 2014 (r261996) +++ stable/10/sys/kern/tty.c Sun Feb 16 20:37:39 2014 (r261997) @@ -191,8 +191,10 @@ ttydev_leave(struct tty *tp) /* Drain any output. */ MPASS((tp->t_flags & TF_STOPPED) == 0); - if (!tty_gone(tp)) - tty_drain(tp); + if (!tty_gone(tp)) { + while (tty_drain(tp) == ERESTART) + ; + } ttydisc_close(tp); From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 20:45:13 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 75A5F587; Sun, 16 Feb 2014 20:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 60C091D01; Sun, 16 Feb 2014 20:45:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GKjDve036209; Sun, 16 Feb 2014 20:45:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GKjDGB036208; Sun, 16 Feb 2014 20:45:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162045.s1GKjDGB036208@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 20:45: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: r261998 - stable/10/sys/dev/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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 20:45:13 -0000 Author: marcel Date: Sun Feb 16 20:45:12 2014 New Revision: 261998 URL: http://svnweb.freebsd.org/changeset/base/261998 Log: MFC r259838: Add another HP iLO serial (console) port, found on Itanium servers. Modified: stable/10/sys/dev/uart/uart_bus_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/10/sys/dev/uart/uart_bus_pci.c Sun Feb 16 20:37:39 2014 (r261997) +++ stable/10/sys/dev/uart/uart_bus_pci.c Sun Feb 16 20:45:12 2014 (r261998) @@ -82,6 +82,7 @@ static const struct pci_id pci_ns8250_id 0x10 }, { 0x103c, 0x1048, 0x103c, 0x1301, "HP Diva RMP3", 0x14 }, { 0x103c, 0x1290, 0xffff, 0, "HP Auxiliary Diva Serial Port", 0x18 }, +{ 0x103c, 0x3301, 0xffff, 0, "HP iLO serial port", 0x10 }, { 0x11c1, 0x0480, 0xffff, 0, "Agere Systems Venus Modem (V90, 56KFlex)", 0x14 }, { 0x115d, 0x0103, 0xffff, 0, "Xircom Cardbus Ethernet + 56k Modem", 0x10 }, { 0x1282, 0x6585, 0xffff, 0, "Davicom 56PDV PCI Modem", 0x10 }, From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 20:54:27 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3EA4F702; Sun, 16 Feb 2014 20:54: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 27FAF1D8B; Sun, 16 Feb 2014 20:54:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GKsRmW040260; Sun, 16 Feb 2014 20:54:27 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GKsRjI040259; Sun, 16 Feb 2014 20:54:27 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162054.s1GKsRjI040259@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 20:54: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: r261999 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 20:54:27 -0000 Author: marcel Date: Sun Feb 16 20:54:26 2014 New Revision: 261999 URL: http://svnweb.freebsd.org/changeset/base/261999 Log: MFC r259908: For ia64, use pmap_remove_pages() and not pmap_remove(). Modified: stable/10/sys/vm/vm_pageout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_pageout.c ============================================================================== --- stable/10/sys/vm/vm_pageout.c Sun Feb 16 20:45:12 2014 (r261998) +++ stable/10/sys/vm/vm_pageout.c Sun Feb 16 20:54:26 2014 (r261999) @@ -875,6 +875,14 @@ vm_pageout_map_deactivate_pages(map, des tmpe = tmpe->next; } +#ifdef __ia64__ + /* + * Remove all non-wired, managed mappings if a process is swapped out. + * This will free page table pages. + */ + if (desired == 0) + pmap_remove_pages(map->pmap); +#else /* * Remove all mappings if a process is swapped out, this will free page * table pages. @@ -883,6 +891,8 @@ vm_pageout_map_deactivate_pages(map, des pmap_remove(vm_map_pmap(map), vm_map_min(map), vm_map_max(map)); } +#endif + vm_map_unlock(map); } #endif /* !defined(NO_SWAPPING) */ From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 22:01:44 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B33C456B; Sun, 16 Feb 2014 22:01: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D6881352; Sun, 16 Feb 2014 22:01:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GM1ikN070454; Sun, 16 Feb 2014 22:01:44 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GM1iDC070453; Sun, 16 Feb 2014 22:01:44 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162201.s1GM1iDC070453@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 22:01:44 +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: r262001 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 22:01:44 -0000 Author: marcel Date: Sun Feb 16 22:01:44 2014 New Revision: 262001 URL: http://svnweb.freebsd.org/changeset/base/262001 Log: MFC r260666: In the nested TLB fault handler, for a direct-mapped address, make sure to clear the lower 12 bits. Modified: stable/10/sys/ia64/ia64/exception.S Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/exception.S ============================================================================== --- stable/10/sys/ia64/ia64/exception.S Sun Feb 16 21:53:33 2014 (r262000) +++ stable/10/sys/ia64/ia64/exception.S Sun Feb 16 22:01:44 2014 (r262001) @@ -1026,7 +1026,7 @@ IVT_ENTRY(Data_Nested_TLB, 0x1400) } { .mii mov cr.itir=r26 -(p12) dep r28=0,r30,61,3 +(p12) dep r28=0,r30,0,12 (p13) extr.u r28=r30,3*PAGE_SHIFT-8, PAGE_SHIFT-3 // dir L0 index ;; } From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 22:12:13 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D39947E1; Sun, 16 Feb 2014 22:12: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BF0AA1438; Sun, 16 Feb 2014 22:12:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GMCD2p075199; Sun, 16 Feb 2014 22:12:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GMCDBc075198; Sun, 16 Feb 2014 22:12:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162212.s1GMCDBc075198@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 22:12: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: r262002 - stable/10/sys/ia64/ia64 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 22:12:13 -0000 Author: marcel Date: Sun Feb 16 22:12:13 2014 New Revision: 262002 URL: http://svnweb.freebsd.org/changeset/base/262002 Log: MFC r260914: In pmap_set_pte(), make sure to enforce ordering by inserting a memory fence. Modified: stable/10/sys/ia64/ia64/pmap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/ia64/pmap.c ============================================================================== --- stable/10/sys/ia64/ia64/pmap.c Sun Feb 16 22:01:44 2014 (r262001) +++ stable/10/sys/ia64/ia64/pmap.c Sun Feb 16 22:12:13 2014 (r262002) @@ -1318,6 +1318,8 @@ pmap_set_pte(struct ia64_lpte *pte, vm_o pte->itir = PAGE_SHIFT << 2; + ia64_mf(); + pte->tag = ia64_ttag(va); } @@ -1336,8 +1338,8 @@ pmap_remove_pte(pmap_t pmap, struct ia64 * First remove from the VHPT. */ error = pmap_remove_vhpt(va); - if (error) - return (error); + KASSERT(error == 0, ("%s: pmap_remove_vhpt returned %d", + __func__, error)); pmap_invalidate_page(va); From owner-svn-src-stable@FreeBSD.ORG Sun Feb 16 23:08:21 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D6F8E208; Sun, 16 Feb 2014 23:08: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C04651765; Sun, 16 Feb 2014 23:08:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1GN8LMj098065; Sun, 16 Feb 2014 23:08:21 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1GN8LqU098064; Sun, 16 Feb 2014 23:08:21 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201402162308.s1GN8LqU098064@svn.freebsd.org> From: Marcel Moolenaar Date: Sun, 16 Feb 2014 23:08:21 +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: r262004 - stable/10/sys/ia64/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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Feb 2014 23:08:21 -0000 Author: marcel Date: Sun Feb 16 23:08:21 2014 New Revision: 262004 URL: http://svnweb.freebsd.org/changeset/base/262004 Log: MFC r260175: Implement atomic_swap_. Modified: stable/10/sys/ia64/include/atomic.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ia64/include/atomic.h ============================================================================== --- stable/10/sys/ia64/include/atomic.h Sun Feb 16 22:48:36 2014 (r262003) +++ stable/10/sys/ia64/include/atomic.h Sun Feb 16 23:08:21 2014 (r262004) @@ -386,4 +386,32 @@ atomic_fetchadd_long(volatile u_long *p, return (value); } +/* + * atomic_swap_(volatile *p, v); + */ + +static __inline uint32_t +atomic_swap_32(volatile uint32_t *p, uint32_t v) +{ + uint32_t r; + + __asm __volatile ("xchg4 %0 = %3, %2;;" : "=r"(r), "=m"(*p) : + "r"(v), "m"(*p) : "memory"); + return (r); +} + +static __inline uint64_t +atomic_swap_64(volatile uint64_t *p, uint64_t v) +{ + uint64_t r; + + __asm __volatile ("xchg8 %0 = %3, %2;;" : "=r"(r), "=m"(*p) : + "r"(v), "m"(*p) : "memory"); + return (r); +} + +#define atomic_swap_int atomic_swap_32 +#define atomic_swap_long atomic_swap_64 +#define atomic_swap_ptr atomic_swap_64 + #endif /* ! _MACHINE_ATOMIC_H_ */ From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 01:37:02 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6B501773; Mon, 17 Feb 2014 01:37: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5186211E4; Mon, 17 Feb 2014 01:37:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H1b2em063713; Mon, 17 Feb 2014 01:37:02 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H1aruu063646; Mon, 17 Feb 2014 01:36:53 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201402170136.s1H1aruu063646@svn.freebsd.org> From: Kevin Lo Date: Mon, 17 Feb 2014 01:36:53 +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: r262007 - in stable/10: contrib/libpcap share/man/man9 sys/dev/ath sys/dev/bwi sys/dev/bwn sys/dev/ipw sys/dev/iwi sys/dev/iwn sys/dev/malo sys/dev/mwl sys/dev/ral sys/dev/usb/wlan 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 01:37:02 -0000 Author: kevlo Date: Mon Feb 17 01:36:53 2014 New Revision: 262007 URL: http://svnweb.freebsd.org/changeset/base/262007 Log: MFC r260444: Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED. The origin of WEP comes from IEEE Std 802.11-1997 where it defines whether the frame body of MAC frame has been encrypted using WEP algorithm or not. IEEE Std. 802.11-2007 changes WEP to Protected Frame, indicates whether the frame is protected by a cryptographic encapsulation algorithm. Reviewed by: adrian, rpaulo Modified: stable/10/contrib/libpcap/ieee80211.h stable/10/share/man/man9/ieee80211_crypto.9 stable/10/sys/dev/ath/if_ath_tx.c stable/10/sys/dev/bwi/if_bwi.c stable/10/sys/dev/bwn/if_bwn.c stable/10/sys/dev/ipw/if_ipw.c stable/10/sys/dev/iwi/if_iwi.c stable/10/sys/dev/iwn/if_iwn.c stable/10/sys/dev/malo/if_malo.c stable/10/sys/dev/mwl/if_mwl.c stable/10/sys/dev/ral/rt2560.c stable/10/sys/dev/ral/rt2661.c stable/10/sys/dev/ral/rt2860.c stable/10/sys/dev/usb/wlan/if_rsu.c stable/10/sys/dev/usb/wlan/if_rum.c stable/10/sys/dev/usb/wlan/if_run.c stable/10/sys/dev/usb/wlan/if_uath.c stable/10/sys/dev/usb/wlan/if_upgt.c stable/10/sys/dev/usb/wlan/if_ural.c stable/10/sys/dev/usb/wlan/if_urtw.c stable/10/sys/dev/usb/wlan/if_urtwn.c stable/10/sys/dev/usb/wlan/if_zyd.c stable/10/sys/dev/wi/if_wi.c stable/10/sys/dev/wpi/if_wpi.c stable/10/sys/net80211/ieee80211.h stable/10/sys/net80211/ieee80211_adhoc.c stable/10/sys/net80211/ieee80211_hostap.c stable/10/sys/net80211/ieee80211_mesh.c stable/10/sys/net80211/ieee80211_output.c stable/10/sys/net80211/ieee80211_proto.c stable/10/sys/net80211/ieee80211_sta.c stable/10/sys/net80211/ieee80211_wds.c stable/10/tools/tools/net80211/stumbler/stumbler.c stable/10/tools/tools/net80211/w00t/ap/ap.c stable/10/tools/tools/net80211/w00t/assoc/assoc.c stable/10/tools/tools/net80211/w00t/expand/expand.c stable/10/tools/tools/net80211/w00t/prga/prga.c stable/10/tools/tools/net80211/w00t/redir/redir.c stable/10/tools/tools/net80211/wesside/wesside/wesside.c stable/10/tools/tools/net80211/wlaninject/wlaninject.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libpcap/ieee80211.h ============================================================================== --- stable/10/contrib/libpcap/ieee80211.h Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/contrib/libpcap/ieee80211.h Mon Feb 17 01:36:53 2014 (r262007) @@ -90,7 +90,7 @@ #define IEEE80211_FC1_RETRY 0x08 #define IEEE80211_FC1_PWR_MGT 0x10 #define IEEE80211_FC1_MORE_DATA 0x20 -#define IEEE80211_FC1_WEP 0x40 +#define IEEE80211_FC1_PROTECTED 0x40 #define IEEE80211_FC1_ORDER 0x80 #define IEEE80211_SEQ_FRAG_MASK 0x000f Modified: stable/10/share/man/man9/ieee80211_crypto.9 ============================================================================== --- stable/10/share/man/man9/ieee80211_crypto.9 Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/share/man/man9/ieee80211_crypto.9 Mon Feb 17 01:36:53 2014 (r262007) @@ -236,7 +236,7 @@ For receive, drivers mark frames with th .Dv M_WEP mbuf flag to indicate the hardware has decrypted the payload. If frames have the -.Dv IEEE80211_FC1_WEP +.Dv IEEE80211_FC1_PROTECTED bit marked in their 802.11 header and are not tagged with .Dv M_WEP then decryption is done in software. Modified: stable/10/sys/dev/ath/if_ath_tx.c ============================================================================== --- stable/10/sys/dev/ath/if_ath_tx.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/ath/if_ath_tx.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1584,7 +1584,7 @@ ath_tx_normal_setup(struct ath_softc *sc ATH_TX_LOCK_ASSERT(sc); wh = mtod(m0, struct ieee80211_frame *); - iswep = wh->i_fc[1] & IEEE80211_FC1_WEP; + iswep = wh->i_fc[1] & IEEE80211_FC1_PROTECTED; ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); isfrag = m0->m_flags & M_FRAG; hdrlen = ieee80211_anyhdrsize(wh); @@ -2214,7 +2214,7 @@ ath_tx_raw_start(struct ath_softc *sc, s sc->sc_tx_th.wt_tsf = htole64(tsf); sc->sc_tx_th.wt_flags = sc->sc_hwmap[rix].txflags; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; if (m0->m_flags & M_FRAG) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_FRAG; Modified: stable/10/sys/dev/bwi/if_bwi.c ============================================================================== --- stable/10/sys/dev/bwi/if_bwi.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/bwi/if_bwi.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1395,7 +1395,7 @@ bwi_start_locked(struct ifnet *ifp) ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; wh = mtod(m, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m); if (k == NULL) { ieee80211_free_node(ni); @@ -3000,7 +3000,7 @@ bwi_encap(struct bwi_softc *sc, int idx, */ if (ieee80211_radiotap_active_vap(vap)) { sc->sc_tx_th.wt_flags = 0; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; if (ieee80211_rate2phytype(sc->sc_rates, rate) == IEEE80211_T_DS && (ic->ic_flags & IEEE80211_F_SHPREAMBLE) && @@ -3183,7 +3183,7 @@ bwi_encap_raw(struct bwi_softc *sc, int if (ieee80211_radiotap_active_vap(vap)) { sc->sc_tx_th.wt_flags = 0; /* XXX IEEE80211_BPF_CRYPTO */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; if (params->ibp_flags & IEEE80211_BPF_SHORTPRE) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; @@ -3819,7 +3819,7 @@ bwi_rx_radiotap(struct bwi_softc *sc, st sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; wh = mtod(m, const struct ieee80211_frame_min *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_WEP; sc->sc_rx_th.wr_tsf = hdr->rxh_tsf; /* No endian convertion */ Modified: stable/10/sys/dev/bwn/if_bwn.c ============================================================================== --- stable/10/sys/dev/bwn/if_bwn.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/bwn/if_bwn.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1316,7 +1316,7 @@ bwn_start_locked(struct ifnet *ifp) } KASSERT(ni != NULL, ("%s:%d: fail", __func__, __LINE__)); wh = mtod(m, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m); if (k == NULL) { ieee80211_free_node(ni); @@ -9780,7 +9780,7 @@ bwn_set_txhdr(struct bwn_mac *mac, struc */ if (ieee80211_radiotap_active_vap(vap)) { sc->sc_tx_th.wt_flags = 0; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; if (isshort && (rate == BWN_CCK_RATE_2MB || rate == BWN_CCK_RATE_5MB || @@ -10319,7 +10319,7 @@ bwn_rx_radiotap(struct bwn_mac *mac, str sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_SHORTPRE; wh = mtod(m, const struct ieee80211_frame_min *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) sc->sc_rx_th.wr_flags |= IEEE80211_RADIOTAP_F_WEP; bwn_tsf_read(mac, &tsf); Modified: stable/10/sys/dev/ipw/if_ipw.c ============================================================================== --- stable/10/sys/dev/ipw/if_ipw.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/ipw/if_ipw.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1604,7 +1604,7 @@ ipw_tx_start(struct ifnet *ifp, struct m wh = mtod(m0, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); @@ -1628,7 +1628,7 @@ ipw_tx_start(struct ifnet *ifp, struct m shdr->hdr.type = htole32(IPW_HDR_TYPE_SEND); shdr->hdr.subtype = 0; - shdr->hdr.encrypted = (wh->i_fc[1] & IEEE80211_FC1_WEP) ? 1 : 0; + shdr->hdr.encrypted = (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) ? 1 : 0; shdr->hdr.encrypt = 0; shdr->hdr.keyidx = 0; shdr->hdr.keysz = 0; Modified: stable/10/sys/dev/iwi/if_iwi.c ============================================================================== --- stable/10/sys/dev/iwi/if_iwi.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/iwi/if_iwi.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1849,7 +1849,7 @@ iwi_tx_start(struct ifnet *ifp, struct m } else staid = 0; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); Modified: stable/10/sys/dev/iwn/if_iwn.c ============================================================================== --- stable/10/sys/dev/iwn/if_iwn.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/iwn/if_iwn.c Mon Feb 17 01:36:53 2014 (r262007) @@ -3623,7 +3623,7 @@ iwn_tx_data(struct iwn_softc *sc, struct rate & IEEE80211_RATE_VAL); /* Encrypt the frame if need be. */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { /* Retrieve key for TX. */ k = ieee80211_crypto_encap(ni, m); if (k == NULL) { Modified: stable/10/sys/dev/malo/if_malo.c ============================================================================== --- stable/10/sys/dev/malo/if_malo.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/malo/if_malo.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1101,7 +1101,7 @@ malo_tx_start(struct malo_softc *sc, str uint16_t qos; wh = mtod(m0, struct ieee80211_frame *); - iswep = wh->i_fc[1] & IEEE80211_FC1_WEP; + iswep = wh->i_fc[1] & IEEE80211_FC1_PROTECTED; ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); copyhdrlen = hdrlen = ieee80211_anyhdrsize(wh); pktlen = m0->m_pkthdr.len; Modified: stable/10/sys/dev/mwl/if_mwl.c ============================================================================== --- stable/10/sys/dev/mwl/if_mwl.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/mwl/if_mwl.c Mon Feb 17 01:36:53 2014 (r262007) @@ -2885,12 +2885,13 @@ mwl_rx_proc(void *arg, int npending) * upper layer to put a station in power save * (except when configured with MWL_HOST_PS_SUPPORT). */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) m->m_flags |= M_WEP; #ifdef MWL_HOST_PS_SUPPORT - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; #else - wh->i_fc[1] &= ~(IEEE80211_FC1_WEP | IEEE80211_FC1_PWR_MGT); + wh->i_fc[1] &= ~(IEEE80211_FC1_PROTECTED | + IEEE80211_FC1_PWR_MGT); #endif if (ieee80211_radiotap_active(ic)) { @@ -3204,7 +3205,7 @@ mwl_tx_start(struct mwl_softc *sc, struc #endif wh = mtod(m0, struct ieee80211_frame *); - iswep = wh->i_fc[1] & IEEE80211_FC1_WEP; + iswep = wh->i_fc[1] & IEEE80211_FC1_PROTECTED; ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); hdrlen = ieee80211_anyhdrsize(wh); copyhdrlen = hdrlen; Modified: stable/10/sys/dev/ral/rt2560.c ============================================================================== --- stable/10/sys/dev/ral/rt2560.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/ral/rt2560.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1557,7 +1557,7 @@ rt2560_tx_mgt(struct rt2560_softc *sc, s wh = mtod(m0, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); @@ -1803,7 +1803,7 @@ rt2560_tx_data(struct rt2560_softc *sc, rate = ni->ni_txrate; } - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); Modified: stable/10/sys/dev/ral/rt2661.c ============================================================================== --- stable/10/sys/dev/ral/rt2661.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/ral/rt2661.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1318,7 +1318,7 @@ rt2661_tx_mgt(struct rt2661_softc *sc, s wh = mtod(m0, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); @@ -1493,7 +1493,7 @@ rt2661_tx_data(struct rt2661_softc *sc, noack = cap->cap_wmeParams[ac].wmep_noackPolicy; } - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); Modified: stable/10/sys/dev/ral/rt2860.c ============================================================================== --- stable/10/sys/dev/ral/rt2860.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/ral/rt2860.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1284,9 +1284,9 @@ rt2860_rx_intr(struct rt2860_softc *sc) wh = mtod(m, struct ieee80211_frame *); #ifdef HW_CRYPTO - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { /* frame is decrypted by hardware */ - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; } #endif @@ -1492,7 +1492,7 @@ rt2860_tx(struct rt2860_softc *sc, struc wh = mtod(m, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m); if (k == NULL) { m_freem(m); Modified: stable/10/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rsu.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_rsu.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1669,7 +1669,7 @@ rsu_tx_start(struct rsu_softc *sc, struc wh = mtod(m0, struct ieee80211_frame *); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { device_printf(sc->sc_dev, Modified: stable/10/sys/dev/usb/wlan/if_rum.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rum.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_rum.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1120,7 +1120,7 @@ rum_tx_mgt(struct rum_softc *sc, struct sc->tx_nfree--; wh = mtod(m0, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); @@ -1238,7 +1238,7 @@ rum_tx_data(struct rum_softc *sc, struct else rate = ni->ni_txrate; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); Modified: stable/10/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_run.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_run.c Mon Feb 17 01:36:53 2014 (r262007) @@ -2793,8 +2793,8 @@ run_rx_frame(struct run_softc *sc, struc wh = mtod(m, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; m->m_flags |= M_WEP; } Modified: stable/10/sys/dev/usb/wlan/if_uath.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_uath.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_uath.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1625,7 +1625,7 @@ uath_tx_start(struct uath_softc *sc, str } wh = mtod(m0, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); Modified: stable/10/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_upgt.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_upgt.c Mon Feb 17 01:36:53 2014 (r262007) @@ -2222,7 +2222,7 @@ upgt_tx_start(struct upgt_softc *sc, str * Software crypto. */ wh = mtod(m, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m); if (k == NULL) { device_printf(sc->sc_dev, Modified: stable/10/sys/dev/usb/wlan/if_ural.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_ural.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_ural.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1119,7 +1119,7 @@ ural_tx_mgt(struct ural_softc *sc, struc tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; wh = mtod(m0, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); @@ -1288,7 +1288,7 @@ ural_tx_data(struct ural_softc *sc, stru else rate = ni->ni_txrate; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); Modified: stable/10/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtw.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_urtw.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1696,7 +1696,7 @@ urtw_tx_start(struct urtw_softc *sc, str /* * Software crypto. */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { device_printf(sc->sc_dev, Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwn.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_urtwn.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1596,7 +1596,7 @@ urtwn_tx_start(struct urtwn_softc *sc, s * Software crypto. */ wh = mtod(m0, struct ieee80211_frame *); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { device_printf(sc->sc_dev, Modified: stable/10/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_zyd.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/usb/wlan/if_zyd.c Mon Feb 17 01:36:53 2014 (r262007) @@ -2506,7 +2506,7 @@ zyd_tx_start(struct zyd_softc *sc, struc } } - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); Modified: stable/10/sys/dev/wi/if_wi.c ============================================================================== --- stable/10/sys/dev/wi/if_wi.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/wi/if_wi.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1003,7 +1003,7 @@ wi_start_locked(struct ifnet *ifp) mtod(m0, const uint8_t *) + ieee80211_hdrsize(wh)); frmhdr.wi_ehdr.ether_type = llc->llc_snap.ether_type; frmhdr.wi_tx_ctl = htole16(WI_ENC_TX_802_11|WI_TXCNTL_TX_EX); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { ieee80211_free_node(ni); @@ -1106,7 +1106,7 @@ wi_raw_xmit(struct ieee80211_node *ni, s frmhdr.wi_tx_ctl = htole16(WI_ENC_TX_802_11|WI_TXCNTL_TX_EX); if (params && (params->ibp_flags & IEEE80211_BPF_NOACK)) frmhdr.wi_tx_ctl |= htole16(WI_TXCNTL_ALTRTRY); - if ((wh->i_fc[1] & IEEE80211_FC1_WEP) && + if ((wh->i_fc[1] & IEEE80211_FC1_PROTECTED) && (!params || (params && (params->ibp_flags & IEEE80211_BPF_CRYPTO)))) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { Modified: stable/10/sys/dev/wpi/if_wpi.c ============================================================================== --- stable/10/sys/dev/wpi/if_wpi.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/dev/wpi/if_wpi.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1886,7 +1886,7 @@ wpi_tx_data(struct wpi_softc *sc, struct hdrlen = ieee80211_hdrsize(wh); ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m0); if (k == NULL) { m_freem(m0); @@ -1955,7 +1955,7 @@ wpi_tx_data(struct wpi_softc *sc, struct tap->wt_flags = 0; tap->wt_rate = rate; tap->wt_hwqueue = ac; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) tap->wt_flags |= IEEE80211_RADIOTAP_F_WEP; ieee80211_radiotap_tx(vap, m0); Modified: stable/10/sys/net80211/ieee80211.h ============================================================================== --- stable/10/sys/net80211/ieee80211.h Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211.h Mon Feb 17 01:36:53 2014 (r262007) @@ -166,7 +166,7 @@ struct ieee80211_qosframe_addr4 { #define IEEE80211_FC1_RETRY 0x08 #define IEEE80211_FC1_PWR_MGT 0x10 #define IEEE80211_FC1_MORE_DATA 0x20 -#define IEEE80211_FC1_WEP 0x40 +#define IEEE80211_FC1_PROTECTED 0x40 #define IEEE80211_FC1_ORDER 0x80 #define IEEE80211_SEQ_FRAG_MASK 0x000f Modified: stable/10/sys/net80211/ieee80211_adhoc.c ============================================================================== --- stable/10/sys/net80211/ieee80211_adhoc.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211_adhoc.c Mon Feb 17 01:36:53 2014 (r262007) @@ -474,7 +474,7 @@ adhoc_input(struct ieee80211_node *ni, s * crypto cipher modules used to do delayed update * of replay sequence numbers. */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0) { /* * Discard encrypted frames when privacy is off. @@ -492,7 +492,7 @@ adhoc_input(struct ieee80211_node *ni, s goto out; } wh = mtod(m, struct ieee80211_frame *); - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; } else { /* XXX M_WEP and IEEE80211_F_PRIVACY */ key = NULL; @@ -630,7 +630,7 @@ adhoc_input(struct ieee80211_node *ni, s ether_sprintf(wh->i_addr2), rssi); } #endif - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "%s", "WEP set but not permitted"); vap->iv_stats.is_rx_mgtdiscard++; /* XXX */ Modified: stable/10/sys/net80211/ieee80211_hostap.c ============================================================================== --- stable/10/sys/net80211/ieee80211_hostap.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211_hostap.c Mon Feb 17 01:36:53 2014 (r262007) @@ -693,7 +693,7 @@ hostap_input(struct ieee80211_node *ni, * crypto cipher modules used to do delayed update * of replay sequence numbers. */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0) { /* * Discard encrypted frames when privacy is off. @@ -711,7 +711,7 @@ hostap_input(struct ieee80211_node *ni, goto out; } wh = mtod(m, struct ieee80211_frame *); - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; } else { /* XXX M_WEP and IEEE80211_F_PRIVACY */ key = NULL; @@ -855,7 +855,7 @@ hostap_input(struct ieee80211_node *ni, ether_sprintf(wh->i_addr2), rssi); } #endif - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if (subtype != IEEE80211_FC0_SUBTYPE_AUTH) { /* * Only shared key auth frames with a challenge @@ -883,7 +883,7 @@ hostap_input(struct ieee80211_node *ni, goto out; } wh = mtod(m, struct ieee80211_frame *); - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; } /* * Pass the packet to radiotap before calling iv_recv_mgmt(). Modified: stable/10/sys/net80211/ieee80211_mesh.c ============================================================================== --- stable/10/sys/net80211/ieee80211_mesh.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211_mesh.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1824,7 +1824,7 @@ mesh_input(struct ieee80211_node *ni, st ether_sprintf(wh->i_addr2), rssi); } #endif - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "%s", "WEP set but not permitted"); vap->iv_stats.is_rx_mgtdiscard++; /* XXX */ Modified: stable/10/sys/net80211/ieee80211_output.c ============================================================================== --- stable/10/sys/net80211/ieee80211_output.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211_output.c Mon Feb 17 01:36:53 2014 (r262007) @@ -771,7 +771,7 @@ ieee80211_mgmt_output(struct ieee80211_n if (params->ibp_flags & IEEE80211_BPF_CRYPTO) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_AUTH, wh->i_addr1, "encrypting frame (%s)", __func__); - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; } m->m_flags |= M_ENCAP; /* mark encapsulated */ @@ -1496,7 +1496,7 @@ ieee80211_encap(struct ieee80211vap *vap (vap->iv_opmode == IEEE80211_M_STA ? !IEEE80211_KEY_UNDEFINED(key) : !IEEE80211_KEY_UNDEFINED(&ni->ni_ucastkey)))) { - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; if (!ieee80211_crypto_enmic(vap, key, m, txfrag)) { IEEE80211_NOTE_MAC(vap, IEEE80211_MSG_OUTPUT, eh.ether_dhost, Modified: stable/10/sys/net80211/ieee80211_proto.c ============================================================================== --- stable/10/sys/net80211/ieee80211_proto.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211_proto.c Mon Feb 17 01:36:53 2014 (r262007) @@ -447,7 +447,7 @@ ieee80211_dump_pkt(struct ieee80211com * printf(" QoS [TID %u%s]", qwh->i_qos[0] & IEEE80211_QOS_TID, qwh->i_qos[0] & IEEE80211_QOS_ACKPOLICY ? " ACM" : ""); } - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { int off; off = ieee80211_anyhdrspace(ic, wh); Modified: stable/10/sys/net80211/ieee80211_sta.c ============================================================================== --- stable/10/sys/net80211/ieee80211_sta.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211_sta.c Mon Feb 17 01:36:53 2014 (r262007) @@ -728,7 +728,7 @@ sta_input(struct ieee80211_node *ni, str * crypto cipher modules used to do delayed update * of replay sequence numbers. */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0) { /* * Discard encrypted frames when privacy is off. @@ -746,7 +746,7 @@ sta_input(struct ieee80211_node *ni, str goto out; } wh = mtod(m, struct ieee80211_frame *); - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; } else { /* XXX M_WEP and IEEE80211_F_PRIVACY */ key = NULL; @@ -881,7 +881,7 @@ sta_input(struct ieee80211_node *ni, str ether_sprintf(wh->i_addr2), rssi); } #endif - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if (subtype != IEEE80211_FC0_SUBTYPE_AUTH) { /* * Only shared key auth frames with a challenge @@ -910,7 +910,7 @@ sta_input(struct ieee80211_node *ni, str goto out; } wh = mtod(m, struct ieee80211_frame *); - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; } vap->iv_recv_mgmt(ni, m, subtype, rssi, nf); goto out; Modified: stable/10/sys/net80211/ieee80211_wds.c ============================================================================== --- stable/10/sys/net80211/ieee80211_wds.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/sys/net80211/ieee80211_wds.c Mon Feb 17 01:36:53 2014 (r262007) @@ -556,7 +556,7 @@ wds_input(struct ieee80211_node *ni, str * crypto cipher modules used to do delayed update * of replay sequence numbers. */ - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if ((vap->iv_flags & IEEE80211_F_PRIVACY) == 0) { /* * Discard encrypted frames when privacy is off. @@ -574,7 +574,7 @@ wds_input(struct ieee80211_node *ni, str goto out; } wh = mtod(m, struct ieee80211_frame *); - wh->i_fc[1] &= ~IEEE80211_FC1_WEP; + wh->i_fc[1] &= ~IEEE80211_FC1_PROTECTED; } else { /* XXX M_WEP and IEEE80211_F_PRIVACY */ key = NULL; @@ -708,7 +708,7 @@ wds_input(struct ieee80211_node *ni, str ether_sprintf(wh->i_addr2), rssi); } #endif - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { IEEE80211_DISCARD(vap, IEEE80211_MSG_INPUT, wh, NULL, "%s", "WEP set but not permitted"); vap->iv_stats.is_rx_mgtdiscard++; /* XXX */ Modified: stable/10/tools/tools/net80211/stumbler/stumbler.c ============================================================================== --- stable/10/tools/tools/net80211/stumbler/stumbler.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/stumbler/stumbler.c Mon Feb 17 01:36:53 2014 (r262007) @@ -711,7 +711,7 @@ int get_packet_info(struct ieee80211_fra else if (type == IEEE80211_FC0_TYPE_DATA && stype == IEEE80211_FC0_SUBTYPE_DATA) { - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { unsigned char* iv; node->wep = CRYPT_WEP; Modified: stable/10/tools/tools/net80211/w00t/ap/ap.c ============================================================================== --- stable/10/tools/tools/net80211/w00t/ap/ap.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/w00t/ap/ap.c Mon Feb 17 01:36:53 2014 (r262007) @@ -509,7 +509,7 @@ void read_real_data(struct params *p, st memcpy(dst, wh->i_addr3, 6); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if (!p->wep_len) { printf("Got wep but i aint wep\n"); return; @@ -737,7 +737,7 @@ void read_tap(struct params *p) wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; wh->i_fc[1] |= IEEE80211_FC1_DIR_FROMDS; if (p->wep_len) - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; /* LLC & SNAP */ ptr = (char*) (wh+1); Modified: stable/10/tools/tools/net80211/w00t/assoc/assoc.c ============================================================================== --- stable/10/tools/tools/net80211/w00t/assoc/assoc.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/w00t/assoc/assoc.c Mon Feb 17 01:36:53 2014 (r262007) @@ -368,7 +368,7 @@ void generic_process(struct ieee80211_fr ptr = (char*) (wh + 1); - if (wh->i_fc[1] & IEEE80211_FC1_WEP) { + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { if (!p->wep_len) { char srca[3*6]; char dsta[3*6]; @@ -676,7 +676,7 @@ void read_tap(struct params *p) wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; wh->i_fc[1] |= IEEE80211_FC1_DIR_TODS; if (p->wep_len) - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; /* LLC & SNAP */ ptr = (char*) (wh+1); Modified: stable/10/tools/tools/net80211/w00t/expand/expand.c ============================================================================== --- stable/10/tools/tools/net80211/w00t/expand/expand.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/w00t/expand/expand.c Mon Feb 17 01:36:53 2014 (r262007) @@ -99,7 +99,7 @@ int wanted(struct params *p, struct ieee if (memcmp(bssid, p->ap, 6) != 0) return 0; - if (!(wh->i_fc[1] & IEEE80211_FC1_WEP)) { + if (!(wh->i_fc[1] & IEEE80211_FC1_PROTECTED)) { printf("Got non WEP packet...\n"); return 0; } @@ -197,7 +197,7 @@ void send_mcast(struct params *p, unsign wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; wh->i_fc[0] |= IEEE80211_FC0_SUBTYPE_DATA; wh->i_fc[1] |= IEEE80211_FC1_DIR_TODS; - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; wh->i_dur[0] = 0x69; Modified: stable/10/tools/tools/net80211/w00t/prga/prga.c ============================================================================== --- stable/10/tools/tools/net80211/w00t/prga/prga.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/w00t/prga/prga.c Mon Feb 17 01:36:53 2014 (r262007) @@ -190,7 +190,7 @@ void get_prga(struct params *p) if (memcmp(p->ap, bssid, 6) != 0) return; - if (!(wh->i_fc[1] & IEEE80211_FC1_WEP)) { + if (!(wh->i_fc[1] & IEEE80211_FC1_PROTECTED)) { printf("Packet not WEP!\n"); return; } @@ -281,7 +281,7 @@ void send_frag(struct params *p) /* 802.11 */ wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; wh->i_fc[0] |= IEEE80211_FC0_SUBTYPE_DATA; - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; wh->i_fc[1] |= IEEE80211_FC1_DIR_TODS; if (!last) wh->i_fc[1] |= IEEE80211_FC1_MORE_FRAG; @@ -527,7 +527,7 @@ void read_tap(struct params *p) wh = (struct ieee80211_frame*) p->packet; wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; wh->i_fc[0] |= IEEE80211_FC0_SUBTYPE_DATA; - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; wh->i_fc[1] |= IEEE80211_FC1_DIR_TODS; wh->i_dur[0] = 0x69; Modified: stable/10/tools/tools/net80211/w00t/redir/redir.c ============================================================================== --- stable/10/tools/tools/net80211/w00t/redir/redir.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/w00t/redir/redir.c Mon Feb 17 01:36:53 2014 (r262007) @@ -140,7 +140,7 @@ int wanted(struct params *p, struct ieee if (memcmp(bssid, p->ap, 6) != 0) return 0; - if (!(wh->i_fc[1] & IEEE80211_FC1_WEP)) { + if (!(wh->i_fc[1] & IEEE80211_FC1_PROTECTED)) { printf("Got non WEP packet...\n"); return 0; } @@ -268,7 +268,7 @@ void send_header(struct params *p, struc wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; wh->i_fc[0] |= IEEE80211_FC0_SUBTYPE_DATA; wh->i_fc[1] |= IEEE80211_FC1_DIR_TODS; - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; wh->i_fc[1] |= IEEE80211_FC1_MORE_FRAG; wh->i_dur[0] = 0x69; @@ -345,7 +345,7 @@ void send_data(struct params *p) wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; wh->i_fc[0] |= IEEE80211_FC0_SUBTYPE_DATA; wh->i_fc[1] |= IEEE80211_FC1_DIR_TODS; - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; wh->i_dur[0] = 0x69; Modified: stable/10/tools/tools/net80211/wesside/wesside/wesside.c ============================================================================== --- stable/10/tools/tools/net80211/wesside/wesside/wesside.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/wesside/wesside/wesside.c Mon Feb 17 01:36:53 2014 (r262007) @@ -1093,13 +1093,13 @@ void stuff_for_us(struct ieee80211_frame int dlen; dlen = len - sizeof(*wh) - 4 -4; - if (!( wh->i_fc[1] & IEEE80211_FC1_WEP)) { + if (!( wh->i_fc[1] & IEEE80211_FC1_PROTECTED)) { time_print("WARNING: Got NON wep packet from %s dlen %d stype=%x\n", mac2str(wh->i_addr2), dlen, stype); return; } - assert (wh->i_fc[1] & IEEE80211_FC1_WEP); + assert (wh->i_fc[1] & IEEE80211_FC1_PROTECTED); if ((dlen == 36 || dlen == PADDED_ARPLEN) && rtrmac == (unsigned char*) 1) { rtrmac = (unsigned char *) malloc(6); @@ -1577,7 +1577,8 @@ void stuff_for_net(struct ieee80211_fram } // wep data! - if ( (wh->i_fc[1] & IEEE80211_FC1_WEP) && dlen > (4+8+4)) { + if ( (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) && + dlen > (4+8+4)) { got_wep(wh, rd); } } @@ -1768,7 +1769,7 @@ void prepare_fragstate(struct frag_state fs->wh.i_fc[0] |= IEEE80211_FC0_TYPE_DATA; fs->wh.i_fc[1] |= IEEE80211_FC1_DIR_TODS | IEEE80211_FC1_MORE_FRAG | - IEEE80211_FC1_WEP; + IEEE80211_FC1_PROTECTED; memset(&fs->data[8+8+20], 0, pad); } @@ -1858,7 +1859,7 @@ void flood_inet(tx) { fill_basic(wh); wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; - wh->i_fc[1] |= IEEE80211_FC1_WEP | IEEE80211_FC1_DIR_TODS; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED | IEEE80211_FC1_DIR_TODS; memset(wh->i_addr3, 0xff, 6); body = (unsigned char*) wh + sizeof(*wh); @@ -1880,7 +1881,7 @@ void flood_inet(tx) { fill_basic(wh); wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; - wh->i_fc[1] |= IEEE80211_FC1_WEP | IEEE80211_FC1_DIR_TODS; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED | IEEE80211_FC1_DIR_TODS; memcpy(wh->i_addr3, rtrmac, 6); body = (unsigned char*) wh + sizeof(*wh); @@ -1975,7 +1976,7 @@ void send_arp(int tx, unsigned short op, fill_basic(wh); wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; - wh->i_fc[1] |= IEEE80211_FC1_WEP | IEEE80211_FC1_DIR_TODS; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED | IEEE80211_FC1_DIR_TODS; memset(wh->i_addr3, 0xff, 6); body = (unsigned char*) wh + sizeof(*wh); @@ -2254,7 +2255,7 @@ void read_tap() { fill_basic(wh); wh->i_fc[0] |= IEEE80211_FC0_TYPE_DATA; - wh->i_fc[1] |= IEEE80211_FC1_WEP | IEEE80211_FC1_DIR_TODS; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED | IEEE80211_FC1_DIR_TODS; memcpy(wh->i_addr2, eh->ether_shost, 6); memcpy(wh->i_addr3, eh->ether_dhost, 6); Modified: stable/10/tools/tools/net80211/wlaninject/wlaninject.c ============================================================================== --- stable/10/tools/tools/net80211/wlaninject/wlaninject.c Mon Feb 17 00:00:39 2014 (r262006) +++ stable/10/tools/tools/net80211/wlaninject/wlaninject.c Mon Feb 17 01:36:53 2014 (r262007) @@ -600,7 +600,7 @@ int main(int argc, char *argv[]) break; case 'w': - wh->i_fc[1] |= IEEE80211_FC1_WEP; + wh->i_fc[1] |= IEEE80211_FC1_PROTECTED; break; case 'o': From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 01:39:04 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7A8F68B8; Mon, 17 Feb 2014 01:39: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4BB6911F3; Mon, 17 Feb 2014 01:39:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H1d4gX064063; Mon, 17 Feb 2014 01:39:04 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H1d3qB064060; Mon, 17 Feb 2014 01:39:03 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201402170139.s1H1d3qB064060@svn.freebsd.org> From: Kevin Lo Date: Mon, 17 Feb 2014 01:39: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: r262008 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 01:39:04 -0000 Author: kevlo Date: Mon Feb 17 01:39:03 2014 New Revision: 262008 URL: http://svnweb.freebsd.org/changeset/base/262008 Log: MFC r260463: Replace deprecated M_DONTWAIT with M_NOWAIT. Modified: stable/10/sys/dev/usb/wlan/if_rsu.c stable/10/sys/dev/usb/wlan/if_urtwn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_rsu.c Mon Feb 17 01:36:53 2014 (r262007) +++ stable/10/sys/dev/usb/wlan/if_rsu.c Mon Feb 17 01:39:03 2014 (r262008) @@ -1144,11 +1144,11 @@ rsu_event_survey(struct rsu_softc *sc, u pktlen = sizeof(*wh) + le32toh(bss->ieslen); if (__predict_false(pktlen > MCLBYTES)) return; - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (__predict_false(m == NULL)) return; if (pktlen > MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (!(m->m_flags & M_EXT)) { m_free(m); return; @@ -1357,13 +1357,13 @@ rsu_rx_frame(struct rsu_softc *sc, uint8 DPRINTFN(5, "Rx frame len=%d rate=%d infosz=%d rssi=%d\n", pktlen, rate, infosz, *rssi); - MGETHDR(m, M_DONTWAIT, MT_DATA); + MGETHDR(m, M_NOWAIT, MT_DATA); if (__predict_false(m == NULL)) { ifp->if_ierrors++; return NULL; } if (pktlen > MHLEN) { - MCLGET(m, M_DONTWAIT); + MCLGET(m, M_NOWAIT); if (__predict_false(!(m->m_flags & M_EXT))) { ifp->if_ierrors++; m_freem(m); Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwn.c Mon Feb 17 01:36:53 2014 (r262007) +++ stable/10/sys/dev/usb/wlan/if_urtwn.c Mon Feb 17 01:39:03 2014 (r262008) @@ -625,7 +625,7 @@ urtwn_rx_frame(struct urtwn_softc *sc, u rssi = URTWN_RSSI(rssi); } - m = m_getcl(M_DONTWAIT, MT_DATA, M_PKTHDR); + m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); if (m == NULL) { device_printf(sc->sc_dev, "could not create RX mbuf\n"); return (NULL); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 01:40:34 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 44A249ED; Mon, 17 Feb 2014 01:40: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2DC8311FB; Mon, 17 Feb 2014 01:40:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H1eYSw065073; Mon, 17 Feb 2014 01:40:34 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H1eYJe065071; Mon, 17 Feb 2014 01:40:34 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201402170140.s1H1eYJe065071@svn.freebsd.org> From: Kevin Lo Date: Mon, 17 Feb 2014 01:40:34 +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: r262009 - stable/10/sys/dev/usb/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 01:40:34 -0000 Author: kevlo Date: Mon Feb 17 01:40:33 2014 New Revision: 262009 URL: http://svnweb.freebsd.org/changeset/base/262009 Log: MFC r261506: Correct setting R92C_TXAGC_MCS11_MCS08 register. Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- stable/10/sys/dev/usb/wlan/if_urtwn.c Mon Feb 17 01:39:03 2014 (r262008) +++ stable/10/sys/dev/usb/wlan/if_urtwn.c Mon Feb 17 01:40:33 2014 (r262009) @@ -2492,7 +2492,7 @@ urtwn_write_txpower(struct urtwn_softc * SM(R92C_TXAGC_MCS07, power[19])); urtwn_bb_write(sc, R92C_TXAGC_MCS11_MCS08(chain), SM(R92C_TXAGC_MCS08, power[20]) | - SM(R92C_TXAGC_MCS08, power[21]) | + SM(R92C_TXAGC_MCS09, power[21]) | SM(R92C_TXAGC_MCS10, power[22]) | SM(R92C_TXAGC_MCS11, power[23])); urtwn_bb_write(sc, R92C_TXAGC_MCS15_MCS12(chain), From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 05:06:44 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 45683E9E; Mon, 17 Feb 2014 05:06: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 157DE14C9; Mon, 17 Feb 2014 05:06:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H56hui054619; Mon, 17 Feb 2014 05:06:43 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H56hoD054617; Mon, 17 Feb 2014 05:06:43 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402170506.s1H56hoD054617@svn.freebsd.org> From: Mark Johnston Date: Mon, 17 Feb 2014 05:06:43 +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: r262012 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 05:06:44 -0000 Author: markj Date: Mon Feb 17 05:06:43 2014 New Revision: 262012 URL: http://svnweb.freebsd.org/changeset/base/262012 Log: MFC r249514 (by gnn): Point args[0] not at the thread that is ending but at the one that is starting. This is in line with practice in OpenSolaris. Note that this change is only in ULE and not in the 4BSD scheduler. Once this change settles in (MFC timeout has expired) we'll try it out on 4BSD as well. MFC r260043: The arguments to sched:::off-cpu are the thread and associated process of the thread selected to run, not the currently running thread. Modified: stable/8/sys/kern/sched_4bsd.c stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/sched_4bsd.c ============================================================================== --- stable/8/sys/kern/sched_4bsd.c Mon Feb 17 03:24:00 2014 (r262011) +++ stable/8/sys/kern/sched_4bsd.c Mon Feb 17 05:06:43 2014 (r262012) @@ -1055,7 +1055,7 @@ sched_switch(struct thread *td, struct t PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif - SDT_PROBE2(sched, , , off_cpu, td, td->td_proc); + SDT_PROBE2(sched, , , off_cpu, newtd, newtd->td_proc); /* I feel sleepy */ lock_profile_release_lock(&sched_lock.lock_object); Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Mon Feb 17 03:24:00 2014 (r262011) +++ stable/8/sys/kern/sched_ule.c Mon Feb 17 05:06:43 2014 (r262012) @@ -1909,7 +1909,7 @@ sched_switch(struct thread *td, struct t if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif - SDT_PROBE2(sched, , , off_cpu, td, td->td_proc); + SDT_PROBE2(sched, , , off_cpu, newtd, newtd->td_proc); lock_profile_release_lock(&TDQ_LOCKPTR(tdq)->lock_object); TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 05:07:10 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28088FD0; Mon, 17 Feb 2014 05:07: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1372014D9; Mon, 17 Feb 2014 05:07:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H579pC054761; Mon, 17 Feb 2014 05:07:09 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H579XS054760; Mon, 17 Feb 2014 05:07:09 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402170507.s1H579XS054760@svn.freebsd.org> From: Mark Johnston Date: Mon, 17 Feb 2014 05:07:09 +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: r262013 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 05:07:10 -0000 Author: markj Date: Mon Feb 17 05:07:09 2014 New Revision: 262013 URL: http://svnweb.freebsd.org/changeset/base/262013 Log: MFC r260043: The arguments to sched:::off-cpu are the thread and associated process of the thread selected to run, not the currently running thread. Modified: stable/9/sys/kern/sched_4bsd.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/sched_4bsd.c ============================================================================== --- stable/9/sys/kern/sched_4bsd.c Mon Feb 17 05:06:43 2014 (r262012) +++ stable/9/sys/kern/sched_4bsd.c Mon Feb 17 05:07:09 2014 (r262013) @@ -1033,7 +1033,7 @@ sched_switch(struct thread *td, struct t PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif - SDT_PROBE2(sched, , , off_cpu, td, td->td_proc); + SDT_PROBE2(sched, , , off_cpu, newtd, newtd->td_proc); /* I feel sleepy */ lock_profile_release_lock(&sched_lock.lock_object); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 05:07:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C7470184; Mon, 17 Feb 2014 05:07: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9004214E3; Mon, 17 Feb 2014 05:07:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H57hrS054885; Mon, 17 Feb 2014 05:07:43 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H57hRX054884; Mon, 17 Feb 2014 05:07:43 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402170507.s1H57hRX054884@svn.freebsd.org> From: Mark Johnston Date: Mon, 17 Feb 2014 05:07:43 +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: r262014 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 05:07:43 -0000 Author: markj Date: Mon Feb 17 05:07:43 2014 New Revision: 262014 URL: http://svnweb.freebsd.org/changeset/base/262014 Log: MFC r260043: The arguments to sched:::off-cpu are the thread and associated process of the thread selected to run, not the currently running thread. Modified: stable/10/sys/kern/sched_4bsd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/sched_4bsd.c ============================================================================== --- stable/10/sys/kern/sched_4bsd.c Mon Feb 17 05:07:09 2014 (r262013) +++ stable/10/sys/kern/sched_4bsd.c Mon Feb 17 05:07:43 2014 (r262014) @@ -1033,7 +1033,7 @@ sched_switch(struct thread *td, struct t PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif - SDT_PROBE2(sched, , , off__cpu, td, td->td_proc); + SDT_PROBE2(sched, , , off__cpu, newtd, newtd->td_proc); /* I feel sleepy */ lock_profile_release_lock(&sched_lock.lock_object); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 09:35:31 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80AF4D04; Mon, 17 Feb 2014 09:35: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 68C6418AA; Mon, 17 Feb 2014 09:35:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H9ZVLT066384; Mon, 17 Feb 2014 09:35:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H9ZV4s066383; Mon, 17 Feb 2014 09:35:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402170935.s1H9ZV4s066383@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Feb 2014 09:35:31 +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: r262017 - stable/10/share/man/man4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 09:35:31 -0000 Author: mav Date: Mon Feb 17 09:35:30 2014 New Revision: 262017 URL: http://svnweb.freebsd.org/changeset/base/262017 Log: MFC r261719: Fix wrong device name in example. PR: docs/185602 Submitted by: koitsu Modified: stable/10/share/man/man4/scsi.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/scsi.4 ============================================================================== --- stable/10/share/man/man4/scsi.4 Mon Feb 17 05:54:24 2014 (r262016) +++ stable/10/share/man/man4/scsi.4 Mon Feb 17 09:35:30 2014 (r262017) @@ -195,7 +195,7 @@ hint.scbus.0.bus="1" This assigns .Nm bus 0 to the bus 1 instance on -.Em ahc0 . +.Em ahc1 . Peripheral drivers can be wired to a specific bus, target, and lun as so: .Bd -literal -offset indent hint.da.0.at="scbus0" From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 09:37:01 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F984E42; Mon, 17 Feb 2014 09: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8AD4D18B8; Mon, 17 Feb 2014 09:37:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1H9b1TS066597; Mon, 17 Feb 2014 09:37:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1H9b1G4066595; Mon, 17 Feb 2014 09:37:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402170937.s1H9b1G4066595@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Feb 2014 09:37: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: r262018 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 09:37:01 -0000 Author: mav Date: Mon Feb 17 09:37:01 2014 New Revision: 262018 URL: http://svnweb.freebsd.org/changeset/base/262018 Log: MFC r261719: Fix wrong device name in example. PR: docs/185602 Submitted by: koitsu Modified: stable/9/share/man/man4/scsi.4 Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/scsi.4 ============================================================================== --- stable/9/share/man/man4/scsi.4 Mon Feb 17 09:35:30 2014 (r262017) +++ stable/9/share/man/man4/scsi.4 Mon Feb 17 09:37:01 2014 (r262018) @@ -195,7 +195,7 @@ hint.scbus.0.bus="1" This assigns .Nm bus 0 to the bus 1 instance on -.Em ahc0 . +.Em ahc1 . Peripheral drivers can be wired to a specific bus, target, and lun as so: .Bd -literal -offset indent hint.da.0.at="scbus0" From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 11:23:00 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C8FE1A8E; Mon, 17 Feb 2014 11:23: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B2BDF14C0; Mon, 17 Feb 2014 11:23:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HBN0WF009692; Mon, 17 Feb 2014 11:23:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HBN09t009687; Mon, 17 Feb 2014 11:23:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171123.s1HBN09t009687@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 11:23:00 +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: r262021 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 11:23:00 -0000 Author: avg Date: Mon Feb 17 11:22:59 2014 New Revision: 262021 URL: http://svnweb.freebsd.org/changeset/base/262021 Log: MFC r252895: Add a man page for the SDT_* macros Added: stable/9/share/man/man9/SDT.9 - copied unchanged from r252895, head/share/man/man9/SDT.9 Modified: stable/9/share/man/man9/Makefile Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Mon Feb 17 11:05:57 2014 (r262020) +++ stable/9/share/man/man9/Makefile Mon Feb 17 11:22:59 2014 (r262021) @@ -233,6 +233,7 @@ MAN= accept_filter.9 \ rwlock.9 \ sbuf.9 \ scheduler.9 \ + SDT.9 \ securelevel_gt.9 \ selrecord.9 \ sema.9 \ @@ -1128,6 +1129,11 @@ MLINKS+=scheduler.9 curpriority_cmp.9 \ scheduler.9 sched_setup.9 \ scheduler.9 setrunnable.9 \ scheduler.9 updatepri.9 +MLINKS+=SDT.9 SDT_PROVIDER_DECLARE.9 \ + SDT.9 SDT_PROVIDER_DEFINE.9 \ + SDT.9 SDT_PROBE_DECLARE.9 \ + SDT.9 SDT_PROBE_DEFINE.9 \ + SDT.9 SDT_PROBE.9 MLINKS+=securelevel_gt.9 securelevel_ge.9 MLINKS+=selrecord.9 seldrain.9 \ selrecord.9 selwakeup.9 Copied: stable/9/share/man/man9/SDT.9 (from r252895, head/share/man/man9/SDT.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man9/SDT.9 Mon Feb 17 11:22:59 2014 (r262021, copy of r252895, head/share/man/man9/SDT.9) @@ -0,0 +1,243 @@ +.\" Copyright (c) 2013 Mark Johnston +.\" 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 July 3, 2013 +.Dt SDT 9 +.Os +.Sh NAME +.Nm SDT +.Nd a DTrace framework for adding statically-defined tracing probes +.Sh SYNOPSIS +.In sys/sdt.h +.Fn SDT_PROVIDER_DECLARE prov +.Fn SDT_PROVIDER_DEFINE prov +.Fn SDT_PROBE_DECLARE prov mod func name +.Fn SDT_PROBE_DEFINE prov mod func name sname +.Fn SDT_PROBE_DEFINE0 prov mod func name sname +.Fn SDT_PROBE_DEFINE1 prov mod func name sname arg0 +.Fn SDT_PROBE_DEFINE2 prov mod func name sname arg0 arg1 +.Fn SDT_PROBE_DEFINE3 prov mod func name sname arg0 arg1 arg2 +.Fn SDT_PROBE_DEFINE4 prov mod func name sname arg0 arg1 arg2 arg3 +.Fn SDT_PROBE_DEFINE5 prov mod func name sname arg0 arg1 arg2 arg3 arg4 +.Fn SDT_PROBE_DEFINE6 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5 +.Fn SDT_PROBE_DEFINE7 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5 \ + arg6 +.Fn SDT_PROBE0 prov mod func name +.Fn SDT_PROBE1 prov mod func name arg0 +.Fn SDT_PROBE2 prov mod func name arg0 arg1 +.Fn SDT_PROBE3 prov mod func name arg0 arg1 arg2 +.Fn SDT_PROBE4 prov mod func name arg0 arg1 arg2 arg3 +.Fn SDT_PROBE5 prov mod func name arg0 arg1 arg2 arg3 arg4 +.Fn SDT_PROBE6 prov mod func name arg0 arg1 arg2 arg3 arg4 arg5 +.Fn SDT_PROBE7 prov mod func name arg0 arg1 arg2 arg3 arg4 arg5 arg6 +.Sh DESCRIPTION +.Pp +The +.Nm +macros allow programmers to define static trace points in kernel code. +These trace points are used by the +.Nm +framework to create DTrace probes, allowing the code to be instrumented +using +.Xr dtrace 1 . +By default, +.Nm +trace points are disabled and have no effect on the surrounding code. +When a DTrace probe corresponding to a given trace point is enabled, threads +that execute the trace point will call a handler and cause the probe to fire. +Moreover, trace points can take arguments, making it possible to pass data +to the DTrace framework when an enabled probe fires. +.Pp +Multiple trace points may correspond to a single DTrace probe, allowing +programmers to create DTrace probes that correspond to logical system events +rather than tying probes to specific code execution paths. +For instance, a DTrace probe corresponding to the arrival of an IP packet into +the network stack may be defined using two +.Nm +trace points: one for IPv4 packets and one for IPv6 packets. +.Pp +In addition to defining DTrace probes, the +.Nm +macros allow programmers to define new DTrace providers, making it possible to +namespace logically-related probes. +An example is FreeBSD's sctp provider, which contains +.Nm +probes for FreeBSD's +.Xr sctp 4 +implementation. +.Pp +The +.Fn SDT_PROVIDER_DECLARE +and +.Fn SDT_PROVIDER_DEFINE +macros are used respectively to declare and define a DTrace provider named +.Ar prov +with the +.Nm +framework. +A provider need only be defined once; however, the provider must be declared +before defining any +.Nm +probes belonging to that provider. +.Pp +Similarly, the +.Fn SDT_PROBE_DECLARE +and +.Fn SDT_PROBE_DEFINE* +macros are used to declare and define DTrace probes using the +.Nm +framework. +Once a probe has been defined, trace points for that probe may be added to +kernel code. +DTrace probe identifiers consist of a provider, module, function and name, all +of which may be specified in the +.Nm +probe definition. +Note that probes should not specify a module name: the module name of a probe is +used to determine whether or not it should be destroyed when a kernel module is +unloaded. +See the +.Sx BUGS +section. +Note in particular that probes must not be defined across multiple kernel +modules. +The +.Fn SDT_PROBE_DEFINE* +macros also take an extra +.Ar sname +parameter. +This is used to allow the creation of probes with names containing the +.Ql - +character. +Specifically, the +.Ar name +argument should contain the probe name with all dashes converted to underscores, +and the +.Ar sname +argument should be the probe name as it will be referenced by D scripts. +.Pp +The +.Fn SDT_PROBE_DEFINE* +macros also allow programmers to declare the types of the arguments that are +passed to probes. +This is optional; if the argument types are omitted (through use of the +.Fn SDT_PROBE_DEFINE +macro), users wishing to make use of the arguments will have to manually cast +them to the correct types in their D scripts. +It is strongly recommended that probe definitions include a declaration of their +argument types. +.Pp +The +.Fn SDT_PROBE* +macros are used to create +.Nm +trace points. +They are meant to be added to executable code and can be used to instrument the +code in which they are called. +.Sh EXAMPLES +.Pp +The following probe definition will create a DTrace probe called +.Ql icmp::unreach:pkt-receive , +which would hypothetically be triggered when the kernel receives an ICMP packet +of type Destination Unreachable: +.Bd -literal -offset indent +SDT_PROVIDER_DECLARE(icmp); + +SDT_PROBE_DEFINE2(icmp, , unreach, pkt_receive, pkt-receive, + "struct mbuf *", "struct icmp *"); + +.Ed +This particular probe would take two arguments: a pointer to the +.Xr mbuf 9 +containing the incoming packet, and a pointer to the ICMP header for the packet. +Note that the module name of this probe is not specified. +.Pp +Consider a DTrace probe which fires when the network stack receives an IP +packet. +Such a probe would be defined by multiple tracepoints: +.Bd -literal -offset indent +SDT_PROBE_DEFINE2(ip, , , receive, receive, "struct mbuf *", + "struct ifnet *", "struct ip *", "struct ip6_hdr *"); + +int +ip_input(struct mbuf *m) +{ + struct ip *ip; + ... + ip = mtod(m, struct ip *); + SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, ip, NULL); + ... +} + +int +ip6_input(struct mbuf *m) +{ + struct ip6_hdr *ip6; + ... + ip6 = mtod(m, struct ip6_hdr *); + SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, NULL, ip6); + ... +} + +.Ed +In particular, the probe should fire when the kernel receives either an IPv4 +packet or an IPv6 packet. +.Sh SEE ALSO +.Xr dtrace 1 +.Sh AUTHORS +.An -nosplit +DTrace and the +.Nm +framework were originally ported to FreeBSD from Solaris by +.An John Birrell Aq jb@FreeBSD.org . +This manual page was written by +.An Mark Johnston Aq markj@FreeBSD.org . +.Sh BUGS +.Pp +The +.Nm +macros allow the module name of a probe to be specified as part of a probe +definition. +However, the DTrace framework uses the module name of probes to determine +which probes should be destroyed when a kernel module is unloaded, so the module +name of a probe should match the name of the module in which its defined. +.Nm +will set the module name properly if it is left unspecified in the probe +definition; see the +.Sx EXAMPLES +section. +.Pp +One of the goals of the original +.Nm +implementation (and by extension, of FreeBSD's port) is that inactive +.Nm +probes should have no performance impact. +This is unfortunately not the case; +.Nm +trace points will add a small but non-zero amount of latency to the code +in which they are defined. +A more sophisticated implementation of the probes will help alleviate this +problem. From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 11:23:22 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BE32EC4C; Mon, 17 Feb 2014 11:23: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A856C14CD; Mon, 17 Feb 2014 11:23:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HBNMx8009780; Mon, 17 Feb 2014 11:23:22 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HBNMUk009777; Mon, 17 Feb 2014 11:23:22 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171123.s1HBNMUk009777@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 11:23:22 +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: r262022 - stable/8/share/man/man9 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 11:23:22 -0000 Author: avg Date: Mon Feb 17 11:23:21 2014 New Revision: 262022 URL: http://svnweb.freebsd.org/changeset/base/262022 Log: MFC r252895: Add a man page for the SDT_* macros Added: stable/8/share/man/man9/SDT.9 - copied unchanged from r252895, head/share/man/man9/SDT.9 Modified: stable/8/share/man/man9/Makefile Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Mon Feb 17 11:22:59 2014 (r262021) +++ stable/8/share/man/man9/Makefile Mon Feb 17 11:23:21 2014 (r262022) @@ -232,6 +232,7 @@ MAN= accept_filter.9 \ rwlock.9 \ sbuf.9 \ scheduler.9 \ + SDT.9 \ securelevel_gt.9 \ selrecord.9 \ sema.9 \ @@ -1085,6 +1086,11 @@ MLINKS+=scheduler.9 curpriority_cmp.9 \ scheduler.9 sched_setup.9 \ scheduler.9 setrunnable.9 \ scheduler.9 updatepri.9 +MLINKS+=SDT.9 SDT_PROVIDER_DECLARE.9 \ + SDT.9 SDT_PROVIDER_DEFINE.9 \ + SDT.9 SDT_PROBE_DECLARE.9 \ + SDT.9 SDT_PROBE_DEFINE.9 \ + SDT.9 SDT_PROBE.9 MLINKS+=securelevel_gt.9 securelevel_ge.9 MLINKS+=selrecord.9 seldrain.9 \ selrecord.9 selwakeup.9 Copied: stable/8/share/man/man9/SDT.9 (from r252895, head/share/man/man9/SDT.9) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/share/man/man9/SDT.9 Mon Feb 17 11:23:21 2014 (r262022, copy of r252895, head/share/man/man9/SDT.9) @@ -0,0 +1,243 @@ +.\" Copyright (c) 2013 Mark Johnston +.\" 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 July 3, 2013 +.Dt SDT 9 +.Os +.Sh NAME +.Nm SDT +.Nd a DTrace framework for adding statically-defined tracing probes +.Sh SYNOPSIS +.In sys/sdt.h +.Fn SDT_PROVIDER_DECLARE prov +.Fn SDT_PROVIDER_DEFINE prov +.Fn SDT_PROBE_DECLARE prov mod func name +.Fn SDT_PROBE_DEFINE prov mod func name sname +.Fn SDT_PROBE_DEFINE0 prov mod func name sname +.Fn SDT_PROBE_DEFINE1 prov mod func name sname arg0 +.Fn SDT_PROBE_DEFINE2 prov mod func name sname arg0 arg1 +.Fn SDT_PROBE_DEFINE3 prov mod func name sname arg0 arg1 arg2 +.Fn SDT_PROBE_DEFINE4 prov mod func name sname arg0 arg1 arg2 arg3 +.Fn SDT_PROBE_DEFINE5 prov mod func name sname arg0 arg1 arg2 arg3 arg4 +.Fn SDT_PROBE_DEFINE6 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5 +.Fn SDT_PROBE_DEFINE7 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5 \ + arg6 +.Fn SDT_PROBE0 prov mod func name +.Fn SDT_PROBE1 prov mod func name arg0 +.Fn SDT_PROBE2 prov mod func name arg0 arg1 +.Fn SDT_PROBE3 prov mod func name arg0 arg1 arg2 +.Fn SDT_PROBE4 prov mod func name arg0 arg1 arg2 arg3 +.Fn SDT_PROBE5 prov mod func name arg0 arg1 arg2 arg3 arg4 +.Fn SDT_PROBE6 prov mod func name arg0 arg1 arg2 arg3 arg4 arg5 +.Fn SDT_PROBE7 prov mod func name arg0 arg1 arg2 arg3 arg4 arg5 arg6 +.Sh DESCRIPTION +.Pp +The +.Nm +macros allow programmers to define static trace points in kernel code. +These trace points are used by the +.Nm +framework to create DTrace probes, allowing the code to be instrumented +using +.Xr dtrace 1 . +By default, +.Nm +trace points are disabled and have no effect on the surrounding code. +When a DTrace probe corresponding to a given trace point is enabled, threads +that execute the trace point will call a handler and cause the probe to fire. +Moreover, trace points can take arguments, making it possible to pass data +to the DTrace framework when an enabled probe fires. +.Pp +Multiple trace points may correspond to a single DTrace probe, allowing +programmers to create DTrace probes that correspond to logical system events +rather than tying probes to specific code execution paths. +For instance, a DTrace probe corresponding to the arrival of an IP packet into +the network stack may be defined using two +.Nm +trace points: one for IPv4 packets and one for IPv6 packets. +.Pp +In addition to defining DTrace probes, the +.Nm +macros allow programmers to define new DTrace providers, making it possible to +namespace logically-related probes. +An example is FreeBSD's sctp provider, which contains +.Nm +probes for FreeBSD's +.Xr sctp 4 +implementation. +.Pp +The +.Fn SDT_PROVIDER_DECLARE +and +.Fn SDT_PROVIDER_DEFINE +macros are used respectively to declare and define a DTrace provider named +.Ar prov +with the +.Nm +framework. +A provider need only be defined once; however, the provider must be declared +before defining any +.Nm +probes belonging to that provider. +.Pp +Similarly, the +.Fn SDT_PROBE_DECLARE +and +.Fn SDT_PROBE_DEFINE* +macros are used to declare and define DTrace probes using the +.Nm +framework. +Once a probe has been defined, trace points for that probe may be added to +kernel code. +DTrace probe identifiers consist of a provider, module, function and name, all +of which may be specified in the +.Nm +probe definition. +Note that probes should not specify a module name: the module name of a probe is +used to determine whether or not it should be destroyed when a kernel module is +unloaded. +See the +.Sx BUGS +section. +Note in particular that probes must not be defined across multiple kernel +modules. +The +.Fn SDT_PROBE_DEFINE* +macros also take an extra +.Ar sname +parameter. +This is used to allow the creation of probes with names containing the +.Ql - +character. +Specifically, the +.Ar name +argument should contain the probe name with all dashes converted to underscores, +and the +.Ar sname +argument should be the probe name as it will be referenced by D scripts. +.Pp +The +.Fn SDT_PROBE_DEFINE* +macros also allow programmers to declare the types of the arguments that are +passed to probes. +This is optional; if the argument types are omitted (through use of the +.Fn SDT_PROBE_DEFINE +macro), users wishing to make use of the arguments will have to manually cast +them to the correct types in their D scripts. +It is strongly recommended that probe definitions include a declaration of their +argument types. +.Pp +The +.Fn SDT_PROBE* +macros are used to create +.Nm +trace points. +They are meant to be added to executable code and can be used to instrument the +code in which they are called. +.Sh EXAMPLES +.Pp +The following probe definition will create a DTrace probe called +.Ql icmp::unreach:pkt-receive , +which would hypothetically be triggered when the kernel receives an ICMP packet +of type Destination Unreachable: +.Bd -literal -offset indent +SDT_PROVIDER_DECLARE(icmp); + +SDT_PROBE_DEFINE2(icmp, , unreach, pkt_receive, pkt-receive, + "struct mbuf *", "struct icmp *"); + +.Ed +This particular probe would take two arguments: a pointer to the +.Xr mbuf 9 +containing the incoming packet, and a pointer to the ICMP header for the packet. +Note that the module name of this probe is not specified. +.Pp +Consider a DTrace probe which fires when the network stack receives an IP +packet. +Such a probe would be defined by multiple tracepoints: +.Bd -literal -offset indent +SDT_PROBE_DEFINE2(ip, , , receive, receive, "struct mbuf *", + "struct ifnet *", "struct ip *", "struct ip6_hdr *"); + +int +ip_input(struct mbuf *m) +{ + struct ip *ip; + ... + ip = mtod(m, struct ip *); + SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, ip, NULL); + ... +} + +int +ip6_input(struct mbuf *m) +{ + struct ip6_hdr *ip6; + ... + ip6 = mtod(m, struct ip6_hdr *); + SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, NULL, ip6); + ... +} + +.Ed +In particular, the probe should fire when the kernel receives either an IPv4 +packet or an IPv6 packet. +.Sh SEE ALSO +.Xr dtrace 1 +.Sh AUTHORS +.An -nosplit +DTrace and the +.Nm +framework were originally ported to FreeBSD from Solaris by +.An John Birrell Aq jb@FreeBSD.org . +This manual page was written by +.An Mark Johnston Aq markj@FreeBSD.org . +.Sh BUGS +.Pp +The +.Nm +macros allow the module name of a probe to be specified as part of a probe +definition. +However, the DTrace framework uses the module name of probes to determine +which probes should be destroyed when a kernel module is unloaded, so the module +name of a probe should match the name of the module in which its defined. +.Nm +will set the module name properly if it is left unspecified in the probe +definition; see the +.Sx EXAMPLES +section. +.Pp +One of the goals of the original +.Nm +implementation (and by extension, of FreeBSD's port) is that inactive +.Nm +probes should have no performance impact. +This is unfortunately not the case; +.Nm +trace points will add a small but non-zero amount of latency to the code +in which they are defined. +A more sophisticated implementation of the probes will help alleviate this +problem. From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 11:28:18 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2431F78; Mon, 17 Feb 2014 11:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 03403151A; Mon, 17 Feb 2014 11:28:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HBSH6L010500; Mon, 17 Feb 2014 11:28:17 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HBSGnB010491; Mon, 17 Feb 2014 11:28:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171128.s1HBSGnB010491@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 11:28:16 +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: r262023 - stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 11:28:18 -0000 Author: avg Date: Mon Feb 17 11:28:16 2014 New Revision: 262023 URL: http://svnweb.freebsd.org/changeset/base/262023 Log: MFC r253720: Use kern_ioctl() rather than ioctl() for testing the FBT provider Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d Mon Feb 17 11:23:21 2014 (r262022) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d Mon Feb 17 11:28:16 2014 (r262023) @@ -36,12 +36,12 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); exit(0); Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d Mon Feb 17 11:23:21 2014 (r262022) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d Mon Feb 17 11:28:16 2014 (r262023) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:return +fbt::kern_ioctl:return { printf("The function return value is stored in %u\n", arg1); exit(0); Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d Mon Feb 17 11:23:21 2014 (r262022) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d Mon Feb 17 11:28:16 2014 (r262023) @@ -36,13 +36,13 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d Mon Feb 17 11:23:21 2014 (r262022) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d Mon Feb 17 11:28:16 2014 (r262023) @@ -41,12 +41,12 @@ BEGIN self->traceme = 1; } -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the function\n"); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("The offset = %u\n", arg0); exit(0); Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d Mon Feb 17 11:23:21 2014 (r262022) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d Mon Feb 17 11:28:16 2014 (r262023) @@ -36,14 +36,14 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); exit(0); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d Mon Feb 17 11:23:21 2014 (r262022) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d Mon Feb 17 11:28:16 2014 (r262023) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:return +fbt::kern_ioctl:return /arg1 == 0/ { printf("%s %x returned 0", probefunc, arg0); Modified: stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Mon Feb 17 11:23:21 2014 (r262022) +++ stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Mon Feb 17 11:28:16 2014 (r262023) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { self->traceme = 1; } @@ -47,7 +47,7 @@ fbt:::entry printf("called %s\n", probefunc); } -fbt::ioctl:return +fbt::kern_ioctl:return /self->traceme/ { self->traceme = 0; From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 11:28:30 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D9C1717D; Mon, 17 Feb 2014 11:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BA42D151C; Mon, 17 Feb 2014 11:28:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HBSTEd010562; Mon, 17 Feb 2014 11:28:29 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HBSS6Q010553; Mon, 17 Feb 2014 11:28:28 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171128.s1HBSS6Q010553@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 11:28:28 +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: r262024 - stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 11:28:30 -0000 Author: avg Date: Mon Feb 17 11:28:27 2014 New Revision: 262024 URL: http://svnweb.freebsd.org/changeset/base/262024 Log: MFC r253720: Use kern_ioctl() rather than ioctl() for testing the FBT provider Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d Mon Feb 17 11:28:16 2014 (r262023) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionentry.d Mon Feb 17 11:28:27 2014 (r262024) @@ -36,12 +36,12 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); exit(0); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d Mon Feb 17 11:28:16 2014 (r262023) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.functionreturnvalue.d Mon Feb 17 11:28:27 2014 (r262024) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:return +fbt::kern_ioctl:return { printf("The function return value is stored in %u\n", arg1); exit(0); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d Mon Feb 17 11:28:16 2014 (r262023) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.ioctlargs.d Mon Feb 17 11:28:27 2014 (r262024) @@ -36,13 +36,13 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d Mon Feb 17 11:28:16 2014 (r262023) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offset.d Mon Feb 17 11:28:27 2014 (r262024) @@ -41,12 +41,12 @@ BEGIN self->traceme = 1; } -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the function\n"); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("The offset = %u\n", arg0); exit(0); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d Mon Feb 17 11:28:16 2014 (r262023) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.offsetzero.d Mon Feb 17 11:28:27 2014 (r262024) @@ -36,14 +36,14 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { printf("Entering the ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); exit(0); } -fbt::ioctl:return +fbt::kern_ioctl:return { printf("Returning from ioctl function\n"); printf("The few arguments are %u %u %u %u\n", arg0, arg1, arg2, arg3); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d Mon Feb 17 11:28:16 2014 (r262023) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.return0.d Mon Feb 17 11:28:27 2014 (r262024) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:return +fbt::kern_ioctl:return /arg1 == 0/ { printf("%s %x returned 0", probefunc, arg0); Modified: stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Mon Feb 17 11:28:16 2014 (r262023) +++ stable/8/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/fbtprovider/tst.tailcall.d Mon Feb 17 11:28:27 2014 (r262024) @@ -36,7 +36,7 @@ #pragma D option quiet #pragma D option statusrate=10ms -fbt::ioctl:entry +fbt::kern_ioctl:entry { self->traceme = 1; } @@ -47,7 +47,7 @@ fbt:::entry printf("called %s\n", probefunc); } -fbt::ioctl:return +fbt::kern_ioctl:return /self->traceme/ { self->traceme = 0; From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 11:36:31 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4197767; Mon, 17 Feb 2014 11:36: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ACB6F163C; Mon, 17 Feb 2014 11:36:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HBaVAq014187; Mon, 17 Feb 2014 11:36:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HBaVmh014183; Mon, 17 Feb 2014 11:36:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171136.s1HBaVmh014183@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 11:36:31 +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: r262025 - in stable/9: share/man/man9 sys/cddl/dev/sdt sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 11:36:31 -0000 Author: avg Date: Mon Feb 17 11:36:30 2014 New Revision: 262025 URL: http://svnweb.freebsd.org/changeset/base/262025 Log: MFC r254468,r254469: Add a "translated type" argument to SDT_PROBE_ARGTYPE() Note: this breaks ABI compatibility with older modules with SDT probes. My opinion is that benefits outweigh downsides, because I am not aware of any thirdparty binary-only modules with SDT probes. Modified: stable/9/share/man/man9/SDT.9 stable/9/sys/cddl/dev/sdt/sdt.c stable/9/sys/sys/sdt.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/share/man/man9/SDT.9 ============================================================================== --- stable/9/share/man/man9/SDT.9 Mon Feb 17 11:28:27 2014 (r262024) +++ stable/9/share/man/man9/SDT.9 Mon Feb 17 11:36:30 2014 (r262025) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2013 +.Dd August 17, 2013 .Dt SDT 9 .Os .Sh NAME @@ -45,6 +45,19 @@ .Fn SDT_PROBE_DEFINE6 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5 .Fn SDT_PROBE_DEFINE7 prov mod func name sname arg0 arg1 arg2 arg3 arg4 arg5 \ arg6 +.Fn SDT_PROBE_DEFINE0_XLATE prov mod func name sname +.Fn SDT_PROBE_DEFINE1_XLATE prov mod func name sname arg0 xarg0 +.Fn SDT_PROBE_DEFINE2_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 +.Fn SDT_PROBE_DEFINE3_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \ + arg2 xarg2 +.Fn SDT_PROBE_DEFINE4_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \ + arg2 xarg2 arg3 xarg3 +.Fn SDT_PROBE_DEFINE5_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \ + arg2 xarg2 arg3 xarg3 arg4 xarg4 +.Fn SDT_PROBE_DEFINE6_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \ + arg2 xarg2 arg3 xarg3 arg4 xarg4 arg5 xarg5 +.Fn SDT_PROBE_DEFINE7_XLATE prov mod func name sname arg0 xarg0 arg1 xarg1 \ + arg2 xarg2 arg3 xarg3 arg4 xarg4 arg5 xarg5 arg6 xarg6 .Fn SDT_PROBE0 prov mod func name .Fn SDT_PROBE1 prov mod func name arg0 .Fn SDT_PROBE2 prov mod func name arg0 arg1 @@ -151,6 +164,30 @@ It is strongly recommended that probe de argument types. .Pp The +.Fn SDT_PROBE_DEFINE*_XLATE +macros are used for probes whose argument types are to be dynamically translated +to the types specified by the corresponding +.Ar xarg +arguments. +This is mainly useful when porting probe definitions from other operating +systems. +As seen by +.Xr dtrace 1 , +the arguments of a probe defined using these macros will have types which match +the +.Ar xarg +types in the probe definition. +However, the arguments passed in at the trace point will have types matching the +native argument types in the probe definition, and thus the native type is +dynamically translated to the translated type. +So long as an appropriate translator is defined in +.Pa /usr/lib/dtrace , +scripts making use of the probe need not concern themselves with the underlying +type of a given +.Nm +probe argument. +.Pp +The .Fn SDT_PROBE* macros are used to create .Nm @@ -166,21 +203,20 @@ of type Destination Unreachable: .Bd -literal -offset indent SDT_PROVIDER_DECLARE(icmp); -SDT_PROBE_DEFINE2(icmp, , unreach, pkt_receive, pkt-receive, - "struct mbuf *", "struct icmp *"); +SDT_PROBE_DEFINE1(icmp, , unreach, pkt_receive, pkt-receive, + "struct icmp *"); .Ed -This particular probe would take two arguments: a pointer to the -.Xr mbuf 9 -containing the incoming packet, and a pointer to the ICMP header for the packet. +This particular probe would take a single argument: a pointer to the struct +containing the ICMP header for the packet. Note that the module name of this probe is not specified. .Pp Consider a DTrace probe which fires when the network stack receives an IP packet. Such a probe would be defined by multiple tracepoints: .Bd -literal -offset indent -SDT_PROBE_DEFINE2(ip, , , receive, receive, "struct mbuf *", - "struct ifnet *", "struct ip *", "struct ip6_hdr *"); +SDT_PROBE_DEFINE3(ip, , , receive, receive, "struct ifnet *", + "struct ip *", "struct ip6_hdr *"); int ip_input(struct mbuf *m) @@ -188,7 +224,7 @@ ip_input(struct mbuf *m) struct ip *ip; ... ip = mtod(m, struct ip *); - SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, ip, NULL); + SDT_PROBE3(ip, , , receive, m->m_pkthdr.rcvif, ip, NULL); ... } @@ -198,13 +234,46 @@ ip6_input(struct mbuf *m) struct ip6_hdr *ip6; ... ip6 = mtod(m, struct ip6_hdr *); - SDT_PROBE4(ip, , , receive, m, m->m_pkthdr.rcvif, NULL, ip6); + SDT_PROBE3(ip, , , receive, m->m_pkthdr.rcvif, NULL, ip6); ... } .Ed In particular, the probe should fire when the kernel receives either an IPv4 packet or an IPv6 packet. +.Pp +Consider the ICMP probe discussed above. +We note that its second argument is of type +.Ar struct icmp , +which is a type defined in the FreeBSD kernel to represent the ICMP header of +an ICMP packet, defined in RFC 792. +Linux has a corresponding type, +.Ar struct icmphdr , +for the same purpose, but its field names differ from FreeBSD's +.Ar struct icmp . +Similarly, illumos defines the +.Ar icmph_t +type, again with different field names. +Even with the +.Ql icmp:::pkt-receive +probes defined in all three operating systems, +one would still have to write OS-specific scripts to extract a given field out +of the ICMP header argument. +Dynamically-translated types solve this problem: one can define an +OS-independent +.Xr c 7 +struct to represent an ICMP header, say +.Ar struct icmp_hdr_dt , +and define translators from each of the three OS-specific types to +.Ar struct icmp_hdr_dt , +all in the +.Xr dtrace 1 +library path. +Then the FreeBSD probe above can be defined with: +.Bd -literal -offset indent +SDT_PROBE_DEFINE1_XLATE(ip, , , receive, receive, "struct icmp *", + "struct icmp_hdr_dt *"); +.Ed .Sh SEE ALSO .Xr dtrace 1 .Sh AUTHORS Modified: stable/9/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 11:28:27 2014 (r262024) +++ stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 11:36:30 2014 (r262025) @@ -201,11 +201,15 @@ sdt_getargdesc(void *arg, dtrace_id_t id if (desc->dtargd_ndx < probe->n_args) { TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) { if (desc->dtargd_ndx == argtype->ndx) { - /* XXX */ desc->dtargd_mapping = desc->dtargd_ndx; strlcpy(desc->dtargd_native, argtype->type, sizeof(desc->dtargd_native)); - desc->dtargd_xlate[0] = '\0'; /* XXX */ + if (argtype->xtype != NULL) + strlcpy(desc->dtargd_xlate, + argtype->xtype, + sizeof(desc->dtargd_xlate)); + else + desc->dtargd_xlate[0] = '\0'; } } } else Modified: stable/9/sys/sys/sdt.h ============================================================================== --- stable/9/sys/sys/sdt.h Mon Feb 17 11:28:27 2014 (r262024) +++ stable/9/sys/sys/sdt.h Mon Feb 17 11:36:30 2014 (r262025) @@ -87,7 +87,7 @@ #define SDT_PROBE_DEFINE(prov, mod, func, name, sname) #define SDT_PROBE_DECLARE(prov, mod, func, name) #define SDT_PROBE(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4) -#define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type) +#define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype) #define SDT_PROBE_DEFINE0(prov, mod, func, name, sname) #define SDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0) @@ -110,6 +110,22 @@ #define SDT_PROBE7(prov, mod, func, name, arg0, arg1, arg2, arg3, arg4, arg5, \ arg6) +#define SDT_PROBE_DEFINE0_XLATE(prov, mod, func, name, sname) +#define SDT_PROBE_DEFINE1_XLATE(prov, mod, func, name, sname, arg0, xarg0) +#define SDT_PROBE_DEFINE2_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1) +#define SDT_PROBE_DEFINE3_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2) +#define SDT_PROBE_DEFINE4_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3) +#define SDT_PROBE_DEFINE5_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4) +#define SDT_PROBE_DEFINE6_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5) +#define SDT_PROBE_DEFINE7_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5, arg6, \ + xarg6) + #else SET_DECLARE(sdt_providers_set, struct sdt_provider); @@ -143,9 +159,9 @@ SET_DECLARE(sdt_argtypes_set, struct sdt (uintptr_t) arg3, (uintptr_t) arg4); \ } while (0) -#define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type) \ +#define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype) \ static struct sdt_argtype sdt_##prov##_##mod##_##func##_##name##num[1] \ - = { { num, type, { NULL, NULL }, \ + = { { num, type, xtype, { NULL, NULL }, \ sdt_##prov##_##mod##_##func##_##name } \ }; \ DATA_SET(sdt_argtypes_set, sdt_##prov##_##mod##_##func##_##name##num); @@ -155,54 +171,113 @@ SET_DECLARE(sdt_argtypes_set, struct sdt #define SDT_PROBE_DEFINE1(prov, mod, func, name, sname, arg0) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0) + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL) #define SDT_PROBE_DEFINE2(prov, mod, func, name, sname, arg0, arg1) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1) + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL) #define SDT_PROBE_DEFINE3(prov, mod, func, name, sname, arg0, arg1, arg2)\ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2) + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL) #define SDT_PROBE_DEFINE4(prov, mod, func, name, sname, arg0, arg1, arg2, arg3) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3) + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, NULL) #define SDT_PROBE_DEFINE5(prov, mod, func, name, sname, arg0, arg1, arg2, arg3, arg4) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4) + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, NULL) #define SDT_PROBE_DEFINE6(prov, mod, func, name, sname, arg0, arg1, arg2, arg3,\ arg4, arg5) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5); + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5, NULL) #define SDT_PROBE_DEFINE7(prov, mod, func, name, sname, arg0, arg1, arg2, arg3,\ arg4, arg5, arg6) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5); \ - SDT_PROBE_ARGTYPE(prov, mod, func, name, 6, arg6); + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5, NULL); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 6, arg6, NULL) + +#define SDT_PROBE_DEFINE0_XLATE(prov, mod, func, name, sname) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname) + +#define SDT_PROBE_DEFINE1_XLATE(prov, mod, func, name, sname, arg0, xarg0) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0) + +#define SDT_PROBE_DEFINE2_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1) + +#define SDT_PROBE_DEFINE3_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2) + +#define SDT_PROBE_DEFINE4_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, xarg3) + +#define SDT_PROBE_DEFINE5_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, xarg3); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, xarg4) + +#define SDT_PROBE_DEFINE6_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, xarg3); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, xarg4); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5, xarg5) + +#define SDT_PROBE_DEFINE7_XLATE(prov, mod, func, name, sname, arg0, xarg0, \ + arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5, arg6, \ + xarg6) \ + SDT_PROBE_DEFINE(prov, mod, func, name, sname); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 0, arg0, xarg0); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 1, arg1, xarg1); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 2, arg2, xarg2); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 3, arg3, xarg3); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 4, arg4, xarg4); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 5, arg5, xarg5); \ + SDT_PROBE_ARGTYPE(prov, mod, func, name, 6, arg6, xarg6) #define SDT_PROBE0(prov, mod, func, name) \ SDT_PROBE(prov, mod, func, name, 0, 0, 0, 0, 0) @@ -257,12 +332,12 @@ struct sdt_provider; struct linker_file; struct sdt_argtype { - int ndx; /* Argument index. */ - const char *type; /* Argument type string. */ + int ndx; /* Argument index. */ + const char *type; /* Argument type string. */ + const char *xtype; /* Translated argument type. */ TAILQ_ENTRY(sdt_argtype) argtype_entry; /* Argument type list entry. */ - struct sdt_probe - *probe; /* Ptr to the probe structure. */ + struct sdt_probe *probe; /* Ptr to the probe structure. */ }; struct sdt_probe { From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 11:44:58 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B70B79AC; Mon, 17 Feb 2014 11:44: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9FD531700; Mon, 17 Feb 2014 11:44:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HBiwcm017732; Mon, 17 Feb 2014 11:44:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HBiwdp017731; Mon, 17 Feb 2014 11:44:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171144.s1HBiwdp017731@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 11:44:58 +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: r262026 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 11:44:58 -0000 Author: avg Date: Mon Feb 17 11:44:58 2014 New Revision: 262026 URL: http://svnweb.freebsd.org/changeset/base/262026 Log: MFC r254810: Remove the kld lock macros and just use the sx(9) API Modified: stable/9/sys/kern/kern_linker.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_linker.c ============================================================================== --- stable/9/sys/kern/kern_linker.c Mon Feb 17 11:36:30 2014 (r262025) +++ stable/9/sys/kern/kern_linker.c Mon Feb 17 11:44:58 2014 (r262026) @@ -69,17 +69,6 @@ SYSCTL_INT(_debug, OID_AUTO, kld_debug, &kld_debug, 0, "Set various levels of KLD debug"); #endif -#define KLD_LOCK() sx_xlock(&kld_sx) -#define KLD_UNLOCK() sx_xunlock(&kld_sx) -#define KLD_DOWNGRADE() sx_downgrade(&kld_sx) -#define KLD_LOCK_READ() sx_slock(&kld_sx) -#define KLD_UNLOCK_READ() sx_sunlock(&kld_sx) -#define KLD_LOCKED() sx_xlocked(&kld_sx) -#define KLD_LOCK_ASSERT() do { \ - if (!cold) \ - sx_assert(&kld_sx, SX_XLOCKED); \ -} while (0) - /* * static char *linker_search_path(const char *name, struct mod_depend * *verinfo); @@ -119,7 +108,8 @@ static int linker_no_more_classes = 0; #define LINKER_GET_NEXT_FILE_ID(a) do { \ linker_file_t lftmp; \ \ - KLD_LOCK_ASSERT(); \ + if (!cold) \ + sx_assert(&kld_sx, SA_XLOCKED); \ retry: \ TAILQ_FOREACH(lftmp, &linker_files, link) { \ if (next_file_id == lftmp->id) { \ @@ -368,7 +358,9 @@ static void linker_init_kernel_modules(void) { + sx_xlock(&kld_sx); linker_file_register_modules(linker_kernel_file); + sx_xunlock(&kld_sx); } SYSINIT(linker_kernel, SI_SUB_KLD, SI_ORDER_ANY, linker_init_kernel_modules, @@ -385,7 +377,7 @@ linker_load_file(const char *filename, l if (prison0.pr_securelevel > 0) return (EPERM); - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); lf = linker_find_file_by_name(filename); if (lf) { KLD_DPF(FILE, ("linker_load_file: file %s is already loaded," @@ -419,10 +411,10 @@ linker_load_file(const char *filename, l return (error); } modules = !TAILQ_EMPTY(&lf->modules); - KLD_UNLOCK(); + sx_xunlock(&kld_sx); linker_file_register_sysctls(lf); linker_file_sysinit(lf); - KLD_LOCK(); + sx_xlock(&kld_sx); lf->flags |= LINKER_FILE_LINKED; /* @@ -473,16 +465,16 @@ linker_reference_module(const char *modn modlist_t mod; int error; - KLD_LOCK(); + sx_xlock(&kld_sx); if ((mod = modlist_lookup2(modname, verinfo)) != NULL) { *result = mod->container; (*result)->refs++; - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (0); } error = linker_load_module(NULL, modname, NULL, verinfo, result); - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } @@ -493,13 +485,13 @@ linker_release_module(const char *modnam modlist_t mod; int error; - KLD_LOCK(); + sx_xlock(&kld_sx); if (lf == NULL) { KASSERT(modname != NULL, ("linker_release_module: no file or name")); mod = modlist_lookup2(modname, verinfo); if (mod == NULL) { - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (ESRCH); } lf = mod->container; @@ -507,7 +499,7 @@ linker_release_module(const char *modnam KASSERT(modname == NULL && verinfo == NULL, ("linker_release_module: both file and name")); error = linker_file_unload(lf, LINKER_UNLOAD_NORMAL); - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } @@ -520,7 +512,7 @@ linker_find_file_by_name(const char *fil koname = malloc(strlen(filename) + 4, M_LINKER, M_WAITOK); sprintf(koname, "%s.ko", filename); - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); TAILQ_FOREACH(lf, &linker_files, link) { if (strcmp(lf->filename, koname) == 0) break; @@ -536,7 +528,7 @@ linker_find_file_by_id(int fileid) { linker_file_t lf; - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); TAILQ_FOREACH(lf, &linker_files, link) if (lf->id == fileid && lf->flags & LINKER_FILE_LINKED) break; @@ -549,13 +541,13 @@ linker_file_foreach(linker_predicate_t * linker_file_t lf; int retval = 0; - KLD_LOCK(); + sx_xlock(&kld_sx); TAILQ_FOREACH(lf, &linker_files, link) { retval = predicate(lf, context); if (retval != 0) break; } - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (retval); } @@ -565,7 +557,8 @@ linker_make_file(const char *pathname, l linker_file_t lf; const char *filename; - KLD_LOCK_ASSERT(); + if (!cold) + sx_assert(&kld_sx, SA_XLOCKED); filename = linker_basename(pathname); KLD_DPF(FILE, ("linker_make_file: new file, filename='%s' for pathname='%s'\n", filename, pathname)); @@ -599,7 +592,7 @@ linker_file_unload(linker_file_t file, i if (prison0.pr_securelevel > 0) return (EPERM); - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); KLD_DPF(FILE, ("linker_file_unload: lf->refs=%d\n", file->refs)); /* Easy case of just dropping a reference. */ @@ -672,10 +665,10 @@ linker_file_unload(linker_file_t file, i */ if (file->flags & LINKER_FILE_LINKED) { file->flags &= ~LINKER_FILE_LINKED; - KLD_UNLOCK(); + sx_xunlock(&kld_sx); linker_file_sysuninit(file); linker_file_unregister_sysctls(file); - KLD_LOCK(); + sx_xlock(&kld_sx); } TAILQ_REMOVE(&linker_files, file, link); @@ -714,7 +707,7 @@ linker_file_add_dependency(linker_file_t { linker_file_t *newdeps; - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); newdeps = malloc((file->ndeps + 1) * sizeof(linker_file_t *), M_LINKER, M_WAITOK | M_ZERO); if (newdeps == NULL) @@ -746,12 +739,12 @@ linker_file_lookup_set(linker_file_t fil { int error, locked; - locked = KLD_LOCKED(); + locked = sx_xlocked(&kld_sx); if (!locked) - KLD_LOCK(); + sx_xlock(&kld_sx); error = LINKER_LOOKUP_SET(file, name, firstp, lastp, countp); if (!locked) - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } @@ -771,12 +764,12 @@ linker_file_lookup_symbol(linker_file_t caddr_t sym; int locked; - locked = KLD_LOCKED(); + locked = sx_xlocked(&kld_sx); if (!locked) - KLD_LOCK(); + sx_xlock(&kld_sx); sym = linker_file_lookup_symbol_internal(file, name, deps); if (!locked) - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (sym); } @@ -790,7 +783,7 @@ linker_file_lookup_symbol_internal(linke size_t common_size = 0; int i; - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); KLD_DPF(SYM, ("linker_file_lookup_symbol: file=%p, name=%s, deps=%d\n", file, name, deps)); @@ -990,9 +983,9 @@ linker_search_symbol_name(caddr_t value, { int error; - KLD_LOCK(); + sx_xlock(&kld_sx); error = linker_debug_search_symbol_name(value, buf, buflen, offset); - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } @@ -1034,10 +1027,10 @@ kern_kldload(struct thread *td, const ch modname = file; } - KLD_LOCK(); + sx_xlock(&kld_sx); error = linker_load_module(kldname, modname, NULL, NULL, &lf); if (error) { - KLD_UNLOCK(); + sx_xunlock(&kld_sx); goto done; } lf->userrefs++; @@ -1047,13 +1040,13 @@ kern_kldload(struct thread *td, const ch EVENTHANDLER_INVOKE(kld_load, lf); #ifdef HWPMC_HOOKS - KLD_DOWNGRADE(); + sx_downgrade(&kld_sx); pkm.pm_file = lf->filename; pkm.pm_address = (uintptr_t) lf->address; PMC_CALL_HOOK(td, PMC_FN_KLD_LOAD, (void *) &pkm); - KLD_UNLOCK_READ(); + sx_sunlock(&kld_sx); #else - KLD_UNLOCK(); + sx_xunlock(&kld_sx); #endif done: @@ -1096,7 +1089,7 @@ kern_kldunload(struct thread *td, int fi return (error); CURVNET_SET(TD_TO_VNET(td)); - KLD_LOCK(); + sx_xlock(&kld_sx); lf = linker_find_file_by_id(fileid); if (lf) { KLD_DPF(FILE, ("kldunload: lf->userrefs=%d\n", lf->userrefs)); @@ -1127,13 +1120,13 @@ kern_kldunload(struct thread *td, int fi #ifdef HWPMC_HOOKS if (error == 0) { - KLD_DOWNGRADE(); + sx_downgrade(&kld_sx); PMC_CALL_HOOK(td, PMC_FN_KLD_UNLOAD, (void *) &pkm); - KLD_UNLOCK_READ(); + sx_sunlock(&kld_sx); } else - KLD_UNLOCK(); + sx_xunlock(&kld_sx); #else - KLD_UNLOCK(); + sx_xunlock(&kld_sx); #endif CURVNET_RESTORE(); return (error); @@ -1177,13 +1170,13 @@ sys_kldfind(struct thread *td, struct kl goto out; filename = linker_basename(pathname); - KLD_LOCK(); + sx_xlock(&kld_sx); lf = linker_find_file_by_name(filename); if (lf) td->td_retval[0] = lf->id; else error = ENOENT; - KLD_UNLOCK(); + sx_xunlock(&kld_sx); out: free(pathname, M_TEMP); return (error); @@ -1201,7 +1194,7 @@ sys_kldnext(struct thread *td, struct kl return (error); #endif - KLD_LOCK(); + sx_xlock(&kld_sx); if (uap->fileid == 0) lf = TAILQ_FIRST(&linker_files); else { @@ -1222,7 +1215,7 @@ sys_kldnext(struct thread *td, struct kl else td->td_retval[0] = 0; out: - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } @@ -1261,10 +1254,10 @@ kern_kldstat(struct thread *td, int file return (error); #endif - KLD_LOCK(); + sx_xlock(&kld_sx); lf = linker_find_file_by_id(fileid); if (lf == NULL) { - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (ENOENT); } @@ -1282,7 +1275,7 @@ kern_kldstat(struct thread *td, int file if (namelen > MAXPATHLEN) namelen = MAXPATHLEN; bcopy(lf->pathname, &stat->pathname[0], namelen); - KLD_UNLOCK(); + sx_xunlock(&kld_sx); td->td_retval[0] = 0; return (0); @@ -1301,7 +1294,7 @@ sys_kldfirstmod(struct thread *td, struc return (error); #endif - KLD_LOCK(); + sx_xlock(&kld_sx); lf = linker_find_file_by_id(uap->fileid); if (lf) { MOD_SLOCK; @@ -1313,7 +1306,7 @@ sys_kldfirstmod(struct thread *td, struc MOD_SUNLOCK; } else error = ENOENT; - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } @@ -1341,7 +1334,7 @@ sys_kldsym(struct thread *td, struct kld symstr = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); if ((error = copyinstr(lookup.symname, symstr, MAXPATHLEN, NULL)) != 0) goto out; - KLD_LOCK(); + sx_xlock(&kld_sx); if (uap->fileid != 0) { lf = linker_find_file_by_id(uap->fileid); if (lf == NULL) @@ -1367,7 +1360,7 @@ sys_kldsym(struct thread *td, struct kld if (lf == NULL) error = ENOENT; } - KLD_UNLOCK(); + sx_xunlock(&kld_sx); out: free(symstr, M_TEMP); return (error); @@ -1476,6 +1469,7 @@ linker_preload(void *arg) error = 0; modptr = NULL; + sx_xlock(&kld_sx); while ((modptr = preload_search_next_name(modptr)) != NULL) { modname = (char *)preload_search_info(modptr, MODINFO_NAME); modtype = (char *)preload_search_info(modptr, MODINFO_TYPE); @@ -1657,6 +1651,7 @@ fail: TAILQ_REMOVE(&depended_files, lf, loaded); linker_file_unload(lf, LINKER_UNLOAD_FORCE); } + sx_xunlock(&kld_sx); /* woohoo! we made it! */ } @@ -1962,7 +1957,7 @@ linker_hwpmc_list_objects(void) int i, nmappings; nmappings = 0; - KLD_LOCK_READ(); + sx_slock(&kld_sx); TAILQ_FOREACH(lf, &linker_files, link) nmappings++; @@ -1977,7 +1972,7 @@ linker_hwpmc_list_objects(void) kobase[i].pm_address = (uintptr_t)lf->address; i++; } - KLD_UNLOCK_READ(); + sx_sunlock(&kld_sx); KASSERT(i > 0, ("linker_hpwmc_list_objects: no kernel objects?")); @@ -2003,7 +1998,7 @@ linker_load_module(const char *kldname, char *pathname; int error; - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); if (modname == NULL) { /* * We have to load KLD @@ -2077,7 +2072,7 @@ linker_load_dependencies(linker_file_t l /* * All files are dependant on /kernel. */ - KLD_LOCK_ASSERT(); + sx_assert(&kld_sx, SA_XLOCKED); if (linker_kernel_file) { linker_kernel_file->refs++; error = linker_file_add_dependency(lf, linker_kernel_file); @@ -2169,16 +2164,16 @@ sysctl_kern_function_list(SYSCTL_HANDLER error = sysctl_wire_old_buffer(req, 0); if (error != 0) return (error); - KLD_LOCK(); + sx_xlock(&kld_sx); TAILQ_FOREACH(lf, &linker_files, link) { error = LINKER_EACH_FUNCTION_NAME(lf, sysctl_kern_function_list_iterate, req); if (error) { - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (error); } } - KLD_UNLOCK(); + sx_xunlock(&kld_sx); return (SYSCTL_OUT(req, "", 1)); } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 12:12:32 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AB4B0834; Mon, 17 Feb 2014 12:12: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9699419E4; Mon, 17 Feb 2014 12:12:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCCWob029785; Mon, 17 Feb 2014 12:12:32 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCCWE6029784; Mon, 17 Feb 2014 12:12:32 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171212.s1HCCWE6029784@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:12: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: r262032 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 12:12:32 -0000 Author: avg Date: Mon Feb 17 12:12:32 2014 New Revision: 262032 URL: http://svnweb.freebsd.org/changeset/base/262032 Log: MFC r254811: call linker_file_lookup_set() with the shared lock held Modified: stable/9/sys/kern/kern_linker.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_linker.c ============================================================================== --- stable/9/sys/kern/kern_linker.c Mon Feb 17 12:10:08 2014 (r262031) +++ stable/9/sys/kern/kern_linker.c Mon Feb 17 12:12:32 2014 (r262032) @@ -196,6 +196,8 @@ linker_file_sysinit(linker_file_t lf) KLD_DPF(FILE, ("linker_file_sysinit: calling SYSINITs for %s\n", lf->filename)); + sx_assert(&kld_sx, SA_XLOCKED); + if (linker_file_lookup_set(lf, "sysinit_set", &start, &stop, NULL) != 0) return; /* @@ -221,6 +223,7 @@ linker_file_sysinit(linker_file_t lf) * Traverse the (now) ordered list of system initialization tasks. * Perform each task, and continue on to the next task. */ + sx_xunlock(&kld_sx); mtx_lock(&Giant); for (sipp = start; sipp < stop; sipp++) { if ((*sipp)->subsystem == SI_SUB_DUMMY) @@ -230,6 +233,7 @@ linker_file_sysinit(linker_file_t lf) (*((*sipp)->func)) ((*sipp)->udata); } mtx_unlock(&Giant); + sx_xlock(&kld_sx); } static void @@ -240,6 +244,8 @@ linker_file_sysuninit(linker_file_t lf) KLD_DPF(FILE, ("linker_file_sysuninit: calling SYSUNINITs for %s\n", lf->filename)); + sx_assert(&kld_sx, SA_XLOCKED); + if (linker_file_lookup_set(lf, "sysuninit_set", &start, &stop, NULL) != 0) return; @@ -267,6 +273,7 @@ linker_file_sysuninit(linker_file_t lf) * Traverse the (now) ordered list of system initialization tasks. * Perform each task, and continue on to the next task. */ + sx_xunlock(&kld_sx); mtx_lock(&Giant); for (sipp = start; sipp < stop; sipp++) { if ((*sipp)->subsystem == SI_SUB_DUMMY) @@ -276,6 +283,7 @@ linker_file_sysuninit(linker_file_t lf) (*((*sipp)->func)) ((*sipp)->udata); } mtx_unlock(&Giant); + sx_xlock(&kld_sx); } static void @@ -287,13 +295,17 @@ linker_file_register_sysctls(linker_file ("linker_file_register_sysctls: registering SYSCTLs for %s\n", lf->filename)); + sx_assert(&kld_sx, SA_XLOCKED); + if (linker_file_lookup_set(lf, "sysctl_set", &start, &stop, NULL) != 0) return; + sx_xunlock(&kld_sx); sysctl_lock(); for (oidp = start; oidp < stop; oidp++) sysctl_register_oid(*oidp); sysctl_unlock(); + sx_xlock(&kld_sx); } static void @@ -304,13 +316,17 @@ linker_file_unregister_sysctls(linker_fi KLD_DPF(FILE, ("linker_file_unregister_sysctls: registering SYSCTLs" " for %s\n", lf->filename)); + sx_assert(&kld_sx, SA_XLOCKED); + if (linker_file_lookup_set(lf, "sysctl_set", &start, &stop, NULL) != 0) return; + sx_xunlock(&kld_sx); sysctl_lock(); for (oidp = start; oidp < stop; oidp++) sysctl_unregister_oid(*oidp); sysctl_unlock(); + sx_xlock(&kld_sx); } static int @@ -323,6 +339,8 @@ linker_file_register_modules(linker_file KLD_DPF(FILE, ("linker_file_register_modules: registering modules" " in %s\n", lf->filename)); + sx_assert(&kld_sx, SA_XLOCKED); + if (linker_file_lookup_set(lf, "modmetadata_set", &start, &stop, NULL) != 0) { /* @@ -411,10 +429,8 @@ linker_load_file(const char *filename, l return (error); } modules = !TAILQ_EMPTY(&lf->modules); - sx_xunlock(&kld_sx); linker_file_register_sysctls(lf); linker_file_sysinit(lf); - sx_xlock(&kld_sx); lf->flags |= LINKER_FILE_LINKED; /* @@ -665,10 +681,8 @@ linker_file_unload(linker_file_t file, i */ if (file->flags & LINKER_FILE_LINKED) { file->flags &= ~LINKER_FILE_LINKED; - sx_xunlock(&kld_sx); linker_file_sysuninit(file); linker_file_unregister_sysctls(file); - sx_xlock(&kld_sx); } TAILQ_REMOVE(&linker_files, file, link); @@ -737,15 +751,9 @@ int linker_file_lookup_set(linker_file_t file, const char *name, void *firstp, void *lastp, int *countp) { - int error, locked; - locked = sx_xlocked(&kld_sx); - if (!locked) - sx_xlock(&kld_sx); - error = LINKER_LOOKUP_SET(file, name, firstp, lastp, countp); - if (!locked) - sx_xunlock(&kld_sx); - return (error); + sx_assert(&kld_sx, SA_LOCKED); + return (LINKER_LOOKUP_SET(file, name, firstp, lastp, countp)); } /* From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 12:14:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 26F82978; Mon, 17 Feb 2014 12:14: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1296E19F2; Mon, 17 Feb 2014 12:14:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCEoEl030165; Mon, 17 Feb 2014 12:14:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCEoG8030164; Mon, 17 Feb 2014 12:14:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171214.s1HCEoG8030164@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:14:50 +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: r262033 - stable/9/sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 12:14:51 -0000 Author: avg Date: Mon Feb 17 12:14:50 2014 New Revision: 262033 URL: http://svnweb.freebsd.org/changeset/base/262033 Log: MFC r255776: Give argtype struct names a different prefix than probe struct names Modified: stable/9/sys/sys/sdt.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/sys/sdt.h ============================================================================== --- stable/9/sys/sys/sdt.h Mon Feb 17 12:12:32 2014 (r262032) +++ stable/9/sys/sys/sdt.h Mon Feb 17 12:14:50 2014 (r262033) @@ -160,11 +160,11 @@ SET_DECLARE(sdt_argtypes_set, struct sdt } while (0) #define SDT_PROBE_ARGTYPE(prov, mod, func, name, num, type, xtype) \ - static struct sdt_argtype sdt_##prov##_##mod##_##func##_##name##num[1] \ + static struct sdt_argtype sdta_##prov##_##mod##_##func##_##name##num[1] \ = { { num, type, xtype, { NULL, NULL }, \ sdt_##prov##_##mod##_##func##_##name } \ }; \ - DATA_SET(sdt_argtypes_set, sdt_##prov##_##mod##_##func##_##name##num); + DATA_SET(sdt_argtypes_set, sdta_##prov##_##mod##_##func##_##name##num); #define SDT_PROBE_DEFINE0(prov, mod, func, name, sname) \ SDT_PROBE_DEFINE(prov, mod, func, name, sname) From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 12:24:06 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B4DFD02; Mon, 17 Feb 2014 12:24: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0B0CA1AB9; Mon, 17 Feb 2014 12:24:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCO510033937; Mon, 17 Feb 2014 12:24:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCO5lK033934; Mon, 17 Feb 2014 12:24:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171224.s1HCO5lK033934@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:24:05 +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: r262034 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 12:24:06 -0000 Author: avg Date: Mon Feb 17 12:24:05 2014 New Revision: 262034 URL: http://svnweb.freebsd.org/changeset/base/262034 Log: MFC r255777: Omit "__restrict" when generating syscall argument strings syscall argument strings are also regenerated as part of this commit Modified: stable/9/sys/kern/makesyscalls.sh stable/9/sys/kern/systrace_args.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/makesyscalls.sh ============================================================================== --- stable/9/sys/kern/makesyscalls.sh Mon Feb 17 12:14:50 2014 (r262033) +++ stable/9/sys/kern/makesyscalls.sh Mon Feb 17 12:24:05 2014 (r262034) @@ -392,19 +392,21 @@ s/\$//g printf("\t\tswitch(ndx) {\n") > systracetmp printf("\t\tstruct %s *p = params;\n", argalias) > systrace for (i = 1; i <= argc; i++) { - printf("\t\tcase %d:\n\t\t\tp = \"%s\";\n\t\t\tbreak;\n", i - 1, argtype[i]) > systracetmp - if (index(argtype[i], "*") > 0 || argtype[i] == "caddr_t") + arg = argtype[i] + sub("__restrict$", "", arg) + printf("\t\tcase %d:\n\t\t\tp = \"%s\";\n\t\t\tbreak;\n", i - 1, arg) > systracetmp + if (index(arg, "*") > 0 || arg == "caddr_t") printf("\t\tuarg[%d] = (intptr_t) p->%s; /* %s */\n", \ i - 1, \ - argname[i], argtype[i]) > systrace - else if (substr(argtype[i], 1, 1) == "u" || argtype[i] == "size_t") + argname[i], arg) > systrace + else if (substr(arg, 1, 1) == "u" || arg == "size_t") printf("\t\tuarg[%d] = p->%s; /* %s */\n", \ i - 1, \ - argname[i], argtype[i]) > systrace + argname[i], arg) > systrace else printf("\t\tiarg[%d] = p->%s; /* %s */\n", \ i - 1, \ - argname[i], argtype[i]) > systrace + argname[i], arg) > systrace } printf("\t\tdefault:\n\t\t\tbreak;\n\t\t};\n") > systracetmp } Modified: stable/9/sys/kern/systrace_args.c ============================================================================== --- stable/9/sys/kern/systrace_args.c Mon Feb 17 12:14:50 2014 (r262033) +++ stable/9/sys/kern/systrace_args.c Mon Feb 17 12:24:05 2014 (r262034) @@ -209,8 +209,8 @@ systrace_args(int sysnum, void *params, uarg[1] = (intptr_t) p->buf; /* caddr_t */ uarg[2] = p->len; /* size_t */ iarg[3] = p->flags; /* int */ - uarg[4] = (intptr_t) p->from; /* struct sockaddr *__restrict */ - uarg[5] = (intptr_t) p->fromlenaddr; /* __socklen_t *__restrict */ + uarg[4] = (intptr_t) p->from; /* struct sockaddr * */ + uarg[5] = (intptr_t) p->fromlenaddr; /* __socklen_t * */ *n_args = 6; break; } @@ -218,8 +218,8 @@ systrace_args(int sysnum, void *params, case 30: { struct accept_args *p = params; iarg[0] = p->s; /* int */ - uarg[1] = (intptr_t) p->name; /* struct sockaddr *__restrict */ - uarg[2] = (intptr_t) p->anamelen; /* __socklen_t *__restrict */ + uarg[1] = (intptr_t) p->name; /* struct sockaddr * */ + uarg[2] = (intptr_t) p->anamelen; /* __socklen_t * */ *n_args = 3; break; } @@ -227,8 +227,8 @@ systrace_args(int sysnum, void *params, case 31: { struct getpeername_args *p = params; iarg[0] = p->fdes; /* int */ - uarg[1] = (intptr_t) p->asa; /* struct sockaddr *__restrict */ - uarg[2] = (intptr_t) p->alen; /* __socklen_t *__restrict */ + uarg[1] = (intptr_t) p->asa; /* struct sockaddr * */ + uarg[2] = (intptr_t) p->alen; /* __socklen_t * */ *n_args = 3; break; } @@ -236,8 +236,8 @@ systrace_args(int sysnum, void *params, case 32: { struct getsockname_args *p = params; iarg[0] = p->fdes; /* int */ - uarg[1] = (intptr_t) p->asa; /* struct sockaddr *__restrict */ - uarg[2] = (intptr_t) p->alen; /* __socklen_t *__restrict */ + uarg[1] = (intptr_t) p->asa; /* struct sockaddr * */ + uarg[2] = (intptr_t) p->alen; /* __socklen_t * */ *n_args = 3; break; } @@ -3594,10 +3594,10 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 4: - p = "struct sockaddr *__restrict"; + p = "struct sockaddr *"; break; case 5: - p = "__socklen_t *__restrict"; + p = "__socklen_t *"; break; default: break; @@ -3610,10 +3610,10 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 1: - p = "struct sockaddr *__restrict"; + p = "struct sockaddr *"; break; case 2: - p = "__socklen_t *__restrict"; + p = "__socklen_t *"; break; default: break; @@ -3626,10 +3626,10 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 1: - p = "struct sockaddr *__restrict"; + p = "struct sockaddr *"; break; case 2: - p = "__socklen_t *__restrict"; + p = "__socklen_t *"; break; default: break; @@ -3642,10 +3642,10 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 1: - p = "struct sockaddr *__restrict"; + p = "struct sockaddr *"; break; case 2: - p = "__socklen_t *__restrict"; + p = "__socklen_t *"; break; default: break; From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 12:27:03 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D033E59; Mon, 17 Feb 2014 12:27: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 47D6C1AD1; Mon, 17 Feb 2014 12:27:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCR3C6034305; Mon, 17 Feb 2014 12:27:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCR3fP034304; Mon, 17 Feb 2014 12:27:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171227.s1HCR3fP034304@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:27: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: r262035 - stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 12:27:03 -0000 Author: avg Date: Mon Feb 17 12:27:02 2014 New Revision: 262035 URL: http://svnweb.freebsd.org/changeset/base/262035 Log: MFC r257143: Fix a couple of bugs in the fasttrap emulation of a "push %rbp" instruction Modified: stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 12:24:05 2014 (r262034) +++ stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 12:27:02 2014 (r262035) @@ -104,6 +104,7 @@ uwrite(proc_t *p, void *kaddr, size_t le #define r_rip r_eip #define r_rflags r_eflags #define r_rsp r_esp +#define r_rbp r_ebp #endif /* @@ -1381,29 +1382,27 @@ fasttrap_pid_probe(struct reg *rp) case FASTTRAP_T_PUSHL_EBP: { int ret = 0; - uintptr_t addr = 0; #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { - addr = rp->r_rsp - sizeof (uintptr_t); - ret = fasttrap_sulword((void *)addr, &rp->r_rsp); + rp->r_rsp -= sizeof (uintptr_t); + ret = fasttrap_sulword(&rp->r_rbp, (void *)rp->r_rsp); } else { #endif #ifdef __i386__ - addr = rp->r_rsp - sizeof (uint32_t); - ret = fasttrap_suword32((void *)addr, &rp->r_rsp); + rp->r_rsp -= sizeof (uint32_t); + ret = fasttrap_suword32(&rp->r_rbp, (void *)rp->r_rsp); #endif #ifdef __amd64 } #endif if (ret == -1) { - fasttrap_sigsegv(p, curthread, addr); + fasttrap_sigsegv(p, curthread, rp->r_rsp); new_pc = pc; break; } - rp->r_rsp = addr; new_pc = pc + tp->ftt_size; break; } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 12:37:27 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 83FA725C; Mon, 17 Feb 2014 12:37: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6F2B51BC1; Mon, 17 Feb 2014 12:37:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCbRu5038265; Mon, 17 Feb 2014 12:37:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCbRoB038264; Mon, 17 Feb 2014 12:37:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171237.s1HCbRoB038264@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:37:27 +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: r262037 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 12:37:27 -0000 Author: avg Date: Mon Feb 17 12:37:26 2014 New Revision: 262037 URL: http://svnweb.freebsd.org/changeset/base/262037 Log: MFC r254266,254309: Add event handlers for module load and unload events This is just a merge of EVENTHANDLER.9, the actual code chnage was merged earlier. Modified: stable/9/share/man/man9/EVENTHANDLER.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/EVENTHANDLER.9 ============================================================================== --- stable/9/share/man/man9/EVENTHANDLER.9 Mon Feb 17 12:29:17 2014 (r262036) +++ stable/9/share/man/man9/EVENTHANDLER.9 Mon Feb 17 12:37:26 2014 (r262037) @@ -23,7 +23,7 @@ .\" SUCH DAMAGE. .\" $FreeBSD$ .\" -.Dd January 7, 2005 +.Dd August 1, 2013 .Dt EVENTHANDLER 9 .Os .Sh NAME @@ -197,6 +197,12 @@ Callbacks invoked when an interface is c Callbacks invoked when a new network interface appears. .It Vt ifnet_departure_event Callbacks invoked when a network interface is taken down. +.It Vt kld_load +Callbacks invoked after a linker file has been loaded. +.It Vt kld_unload +Callbacks invoked before a linker file is about to be unloaded. +These callbacks may be used to return an error and prevent the unload from +proceeding. .It Vt power_profile_change Callbacks invoked when the power profile of the system changes. .It Vt process_exec From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 12:43:00 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0049B440; Mon, 17 Feb 2014 12:42: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C340C1C4C; Mon, 17 Feb 2014 12:42:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCgxcL041532; Mon, 17 Feb 2014 12:42:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCgvtm041518; Mon, 17 Feb 2014 12:42:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171242.s1HCgvtm041518@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:42: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: r262038 - in stable/9: share/man/man9 sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/dev/dtrace sys/cddl/dev/sdt sys/dev/hwpmc sys/kern sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 12:43:00 -0000 Author: avg Date: Mon Feb 17 12:42:57 2014 New Revision: 262038 URL: http://svnweb.freebsd.org/changeset/base/262038 Log: MFC r254813,259587: Rename the kld_unload event handler to kld_unload_try Modified: stable/9/share/man/man9/EVENTHANDLER.9 stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/9/sys/cddl/dev/dtrace/dtrace_load.c stable/9/sys/cddl/dev/dtrace/dtrace_unload.c stable/9/sys/cddl/dev/sdt/sdt.c stable/9/sys/dev/hwpmc/hwpmc_mod.c stable/9/sys/kern/kern_linker.c stable/9/sys/sys/eventhandler.h stable/9/sys/sys/pmckern.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/share/man/man9/EVENTHANDLER.9 ============================================================================== --- stable/9/share/man/man9/EVENTHANDLER.9 Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/share/man/man9/EVENTHANDLER.9 Mon Feb 17 12:42:57 2014 (r262038) @@ -200,6 +200,8 @@ Callbacks invoked when a network interfa .It Vt kld_load Callbacks invoked after a linker file has been loaded. .It Vt kld_unload +Callbacks invoked after a linker file has been successfully unloaded. +.It Vt kld_unload_try Callbacks invoked before a linker file is about to be unloaded. These callbacks may be used to return an error and prevent the unload from proceeding. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 12:42:57 2014 (r262038) @@ -242,7 +242,7 @@ int dtrace_in_probe; /* non-zero if exe uintptr_t dtrace_in_probe_addr; /* Address of invop when already in probe */ #endif static eventhandler_tag dtrace_kld_load_tag; -static eventhandler_tag dtrace_kld_unload_tag; +static eventhandler_tag dtrace_kld_unload_try_tag; #endif /* @@ -15333,7 +15333,7 @@ dtrace_kld_load(void *arg __unused, link } static void -dtrace_kld_unload(void *arg __unused, linker_file_t lf, int *error) +dtrace_kld_unload_try(void *arg __unused, linker_file_t lf, int *error) { if (*error != 0) Modified: stable/9/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 12:42:57 2014 (r262038) @@ -59,8 +59,8 @@ dtrace_load(void *dummy) /* Register callbacks for linker file load and unload events. */ dtrace_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, dtrace_kld_load, NULL, EVENTHANDLER_PRI_ANY); - dtrace_kld_unload_tag = EVENTHANDLER_REGISTER(kld_unload, - dtrace_kld_unload, NULL, EVENTHANDLER_PRI_ANY); + dtrace_kld_unload_try_tag = EVENTHANDLER_REGISTER(kld_unload_try, + dtrace_kld_unload_try, NULL, EVENTHANDLER_PRI_ANY); /* * XXX This is a short term hack to avoid having to comment Modified: stable/9/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 12:42:57 2014 (r262038) @@ -68,7 +68,7 @@ dtrace_unload() dtrace_provider = NULL; EVENTHANDLER_DEREGISTER(kld_load, dtrace_kld_load_tag); - EVENTHANDLER_DEREGISTER(kld_unload, dtrace_kld_unload_tag); + EVENTHANDLER_DEREGISTER(kld_unload_try, dtrace_kld_unload_try_tag); if ((state = dtrace_anon_grab()) != NULL) { /* Modified: stable/9/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 12:42:57 2014 (r262038) @@ -59,7 +59,7 @@ static int sdt_unload(void *); static void sdt_create_provider(struct sdt_provider *); static void sdt_create_probe(struct sdt_probe *); static void sdt_kld_load(void *, struct linker_file *); -static void sdt_kld_unload(void *, struct linker_file *, int *); +static void sdt_kld_unload_try(void *, struct linker_file *, int *); static MALLOC_DEFINE(M_SDT, "SDT", "DTrace SDT providers"); @@ -95,7 +95,7 @@ static struct cdev *sdt_cdev; static TAILQ_HEAD(, sdt_provider) sdt_prov_list; eventhandler_tag sdt_kld_load_tag; -eventhandler_tag sdt_kld_unload_tag; +eventhandler_tag sdt_kld_unload_try_tag; static void sdt_create_provider(struct sdt_provider *prov) @@ -264,7 +264,7 @@ sdt_kld_load(void *arg __unused, struct } static void -sdt_kld_unload(void *arg __unused, struct linker_file *lf, int *error __unused) +sdt_kld_unload_try(void *arg __unused, struct linker_file *lf, int *error __unused) { struct sdt_provider *prov, **curr, **begin, **end, *tmp; @@ -319,8 +319,8 @@ sdt_load(void *arg __unused) sdt_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, sdt_kld_load, NULL, EVENTHANDLER_PRI_ANY); - sdt_kld_unload_tag = EVENTHANDLER_REGISTER(kld_unload, sdt_kld_unload, - NULL, EVENTHANDLER_PRI_ANY); + sdt_kld_unload_try_tag = EVENTHANDLER_REGISTER(kld_unload_try, + sdt_kld_unload_try, NULL, EVENTHANDLER_PRI_ANY); /* Pick up probes from the kernel and already-loaded linker files. */ linker_file_foreach(sdt_linker_file_cb, NULL); @@ -332,7 +332,7 @@ sdt_unload(void *arg __unused) struct sdt_provider *prov, *tmp; EVENTHANDLER_DEREGISTER(kld_load, sdt_kld_load_tag); - EVENTHANDLER_DEREGISTER(kld_unload, sdt_kld_unload_tag); + EVENTHANDLER_DEREGISTER(kld_unload_try, sdt_kld_unload_try_tag); sdt_probe_func = sdt_probe_stub; Modified: stable/9/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- stable/9/sys/dev/hwpmc/hwpmc_mod.c Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/dev/hwpmc/hwpmc_mod.c Mon Feb 17 12:42:57 2014 (r262038) @@ -131,7 +131,8 @@ static int *pmc_pmcdisp; /* PMC row di /* various event handlers */ -static eventhandler_tag pmc_exit_tag, pmc_fork_tag; +static eventhandler_tag pmc_exit_tag, pmc_fork_tag, pmc_kld_load_tag, + pmc_kld_unload_tag; /* Module statistics */ struct pmc_op_getdriverstats pmc_stats; @@ -1475,50 +1476,6 @@ pmc_process_csw_out(struct thread *td) } /* - * Log a KLD operation. - */ - -static void -pmc_process_kld_load(struct pmckern_map_in *pkm) -{ - struct pmc_owner *po; - - sx_assert(&pmc_sx, SX_LOCKED); - - /* - * Notify owners of system sampling PMCs about KLD operations. - */ - - LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) - if (po->po_flags & PMC_PO_OWNS_LOGFILE) - pmclog_process_map_in(po, (pid_t) -1, pkm->pm_address, - (char *) pkm->pm_file); - - /* - * TODO: Notify owners of (all) process-sampling PMCs too. - */ - - return; -} - -static void -pmc_process_kld_unload(struct pmckern_map_out *pkm) -{ - struct pmc_owner *po; - - sx_assert(&pmc_sx, SX_LOCKED); - - LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) - if (po->po_flags & PMC_PO_OWNS_LOGFILE) - pmclog_process_map_out(po, (pid_t) -1, - pkm->pm_address, pkm->pm_address + pkm->pm_size); - - /* - * TODO: Notify owners of process-sampling PMCs. - */ -} - -/* * A mapping change for a process. */ @@ -1835,8 +1792,8 @@ const char *pmc_hooknames[] = { "CSW-IN", "CSW-OUT", "SAMPLE", - "KLDLOAD", - "KLDUNLOAD", + "UNUSED1", + "UNUSED2", "MMAP", "MUNMAP", "CALLCHAIN-NMI", @@ -2004,17 +1961,6 @@ pmc_hook_handler(struct thread *td, int pmc_process_samples(PCPU_GET(cpuid), PMC_SR); break; - - case PMC_FN_KLD_LOAD: - sx_assert(&pmc_sx, SX_LOCKED); - pmc_process_kld_load((struct pmckern_map_in *) arg); - break; - - case PMC_FN_KLD_UNLOAD: - sx_assert(&pmc_sx, SX_LOCKED); - pmc_process_kld_unload((struct pmckern_map_out *) arg); - break; - case PMC_FN_MMAP: sx_assert(&pmc_sx, SX_LOCKED); pmc_process_mmap(td, (struct pmckern_map_in *) arg); @@ -4649,6 +4595,47 @@ pmc_process_fork(void *arg __unused, str sx_xunlock(&pmc_sx); } +static void +pmc_kld_load(void *arg __unused, linker_file_t lf) +{ + struct pmc_owner *po; + + sx_slock(&pmc_sx); + + /* + * Notify owners of system sampling PMCs about KLD operations. + */ + LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) + if (po->po_flags & PMC_PO_OWNS_LOGFILE) + pmclog_process_map_in(po, (pid_t) -1, + (uintfptr_t) lf->address, lf->filename); + + /* + * TODO: Notify owners of (all) process-sampling PMCs too. + */ + + sx_sunlock(&pmc_sx); +} + +static void +pmc_kld_unload(void *arg __unused, const char *filename __unused, + caddr_t address, size_t size) +{ + struct pmc_owner *po; + + sx_slock(&pmc_sx); + + LIST_FOREACH(po, &pmc_ss_owners, po_ssnext) + if (po->po_flags & PMC_PO_OWNS_LOGFILE) + pmclog_process_map_out(po, (pid_t) -1, + (uintfptr_t) address, (uintfptr_t) address + size); + + /* + * TODO: Notify owners of process-sampling PMCs. + */ + + sx_sunlock(&pmc_sx); +} /* * initialization @@ -4924,6 +4911,12 @@ pmc_initialize(void) pmc_fork_tag = EVENTHANDLER_REGISTER(process_fork, pmc_process_fork, NULL, EVENTHANDLER_PRI_ANY); + /* register kld event handlers */ + pmc_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, pmc_kld_load, + NULL, EVENTHANDLER_PRI_ANY); + pmc_kld_unload_tag = EVENTHANDLER_REGISTER(kld_unload, pmc_kld_unload, + NULL, EVENTHANDLER_PRI_ANY); + /* initialize logging */ pmclog_initialize(); @@ -4981,6 +4974,8 @@ pmc_cleanup(void) /* deregister event handlers */ EVENTHANDLER_DEREGISTER(process_fork, pmc_fork_tag); EVENTHANDLER_DEREGISTER(process_exit, pmc_exit_tag); + EVENTHANDLER_DEREGISTER(kld_load, pmc_kld_load_tag); + EVENTHANDLER_DEREGISTER(kld_unload, pmc_kld_unload_tag); /* send SIGBUS to all owner threads, free up allocations */ if (pmc_ownerhash) Modified: stable/9/sys/kern/kern_linker.c ============================================================================== --- stable/9/sys/kern/kern_linker.c Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/kern/kern_linker.c Mon Feb 17 12:42:57 2014 (r262038) @@ -442,6 +442,7 @@ linker_load_file(const char *filename, l linker_file_unload(lf, LINKER_UNLOAD_FORCE); return (ENOEXEC); } + EVENTHANDLER_INVOKE(kld_load, lf); *result = lf; return (0); } @@ -617,6 +618,12 @@ linker_file_unload(linker_file_t file, i return (0); } + /* Give eventhandlers a chance to prevent the unload. */ + error = 0; + EVENTHANDLER_INVOKE(kld_unload_try, file, &error); + if (error != 0) + return (EBUSY); + KLD_DPF(FILE, ("linker_file_unload: file is unloading," " informing modules\n")); @@ -698,6 +705,10 @@ linker_file_unload(linker_file_t file, i } LINKER_UNLOAD(file); + + EVENTHANDLER_INVOKE(kld_unload, file->filename, file->address, + file->size); + if (file->filename) { free(file->filename, M_LINKER); file->filename = NULL; @@ -1003,9 +1014,6 @@ linker_search_symbol_name(caddr_t value, int kern_kldload(struct thread *td, const char *file, int *fileid) { -#ifdef HWPMC_HOOKS - struct pmckern_map_in pkm; -#endif const char *kldname, *modname; linker_file_t lf; int error; @@ -1044,18 +1052,7 @@ kern_kldload(struct thread *td, const ch lf->userrefs++; if (fileid != NULL) *fileid = lf->id; - - EVENTHANDLER_INVOKE(kld_load, lf); - -#ifdef HWPMC_HOOKS - sx_downgrade(&kld_sx); - pkm.pm_file = lf->filename; - pkm.pm_address = (uintptr_t) lf->address; - PMC_CALL_HOOK(td, PMC_FN_KLD_LOAD, (void *) &pkm); - sx_sunlock(&kld_sx); -#else sx_xunlock(&kld_sx); -#endif done: CURVNET_RESTORE(); @@ -1084,9 +1081,6 @@ sys_kldload(struct thread *td, struct kl int kern_kldunload(struct thread *td, int fileid, int flags) { -#ifdef HWPMC_HOOKS - struct pmckern_map_out pkm; -#endif linker_file_t lf; int error = 0; @@ -1102,10 +1096,7 @@ kern_kldunload(struct thread *td, int fi if (lf) { KLD_DPF(FILE, ("kldunload: lf->userrefs=%d\n", lf->userrefs)); - EVENTHANDLER_INVOKE(kld_unload, lf, &error); - if (error != 0) - error = EBUSY; - else if (lf->userrefs == 0) { + if (lf->userrefs == 0) { /* * XXX: maybe LINKER_UNLOAD_FORCE should override ? */ @@ -1113,11 +1104,6 @@ kern_kldunload(struct thread *td, int fi " loaded by the kernel\n"); error = EBUSY; } else { -#ifdef HWPMC_HOOKS - /* Save data needed by hwpmc(4) before unloading. */ - pkm.pm_address = (uintptr_t) lf->address; - pkm.pm_size = lf->size; -#endif lf->userrefs--; error = linker_file_unload(lf, flags); if (error) @@ -1125,17 +1111,8 @@ kern_kldunload(struct thread *td, int fi } } else error = ENOENT; - -#ifdef HWPMC_HOOKS - if (error == 0) { - sx_downgrade(&kld_sx); - PMC_CALL_HOOK(td, PMC_FN_KLD_UNLOAD, (void *) &pkm); - sx_sunlock(&kld_sx); - } else - sx_xunlock(&kld_sx); -#else sx_xunlock(&kld_sx); -#endif + CURVNET_RESTORE(); return (error); } Modified: stable/9/sys/sys/eventhandler.h ============================================================================== --- stable/9/sys/sys/eventhandler.h Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/sys/eventhandler.h Mon Feb 17 12:42:57 2014 (r262038) @@ -259,8 +259,10 @@ EVENTHANDLER_DECLARE(maxsockets_change, /* Kernel linker file load and unload events */ struct linker_file; typedef void (*kld_load_fn)(void *, struct linker_file *); -typedef void (*kld_unload_fn)(void *, struct linker_file *, int *); +typedef void (*kld_unload_fn)(void *, const char *, caddr_t, size_t); +typedef void (*kld_unload_try_fn)(void *, struct linker_file *, int *); EVENTHANDLER_DECLARE(kld_load, kld_load_fn); EVENTHANDLER_DECLARE(kld_unload, kld_unload_fn); +EVENTHANDLER_DECLARE(kld_unload_try, kld_unload_try_fn); #endif /* SYS_EVENTHANDLER_H */ Modified: stable/9/sys/sys/pmckern.h ============================================================================== --- stable/9/sys/sys/pmckern.h Mon Feb 17 12:37:26 2014 (r262037) +++ stable/9/sys/sys/pmckern.h Mon Feb 17 12:42:57 2014 (r262038) @@ -51,8 +51,8 @@ #define PMC_FN_CSW_IN 2 #define PMC_FN_CSW_OUT 3 #define PMC_FN_DO_SAMPLES 4 -#define PMC_FN_KLD_LOAD 5 -#define PMC_FN_KLD_UNLOAD 6 +#define PMC_FN_UNUSED1 5 +#define PMC_FN_UNUSED2 6 #define PMC_FN_MMAP 7 #define PMC_FN_MUNMAP 8 #define PMC_FN_USER_CALLCHAIN 9 From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 12:45:36 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E571769F; Mon, 17 Feb 2014 12:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C5C2C1C71; Mon, 17 Feb 2014 12:45:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCjZFX042024; Mon, 17 Feb 2014 12:45:35 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCjZej042023; Mon, 17 Feb 2014 12:45:35 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171245.s1HCjZej042023@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:45:35 +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: r262039 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 12:45:36 -0000 Author: avg Date: Mon Feb 17 12:45:35 2014 New Revision: 262039 URL: http://svnweb.freebsd.org/changeset/base/262039 Log: MFC r259587: Invoke the kld_* event handlers from linker_load_file() ... Modified: stable/10/sys/kern/kern_linker.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_linker.c ============================================================================== --- stable/10/sys/kern/kern_linker.c Mon Feb 17 12:42:57 2014 (r262038) +++ stable/10/sys/kern/kern_linker.c Mon Feb 17 12:45:35 2014 (r262039) @@ -434,6 +434,7 @@ linker_load_file(const char *filename, l linker_file_unload(lf, LINKER_UNLOAD_FORCE); return (ENOEXEC); } + EVENTHANDLER_INVOKE(kld_load, lf); *result = lf; return (0); } @@ -609,6 +610,12 @@ linker_file_unload(linker_file_t file, i return (0); } + /* Give eventhandlers a chance to prevent the unload. */ + error = 0; + EVENTHANDLER_INVOKE(kld_unload_try, file, &error); + if (error != 0) + return (EBUSY); + KLD_DPF(FILE, ("linker_file_unload: file is unloading," " informing modules\n")); @@ -690,6 +697,10 @@ linker_file_unload(linker_file_t file, i } LINKER_UNLOAD(file); + + EVENTHANDLER_INVOKE(kld_unload, file->filename, file->address, + file->size); + if (file->filename) { free(file->filename, M_LINKER); file->filename = NULL; @@ -1033,10 +1044,7 @@ kern_kldload(struct thread *td, const ch lf->userrefs++; if (fileid != NULL) *fileid = lf->id; - - sx_downgrade(&kld_sx); - EVENTHANDLER_INVOKE(kld_load, lf); - sx_sunlock(&kld_sx); + sx_xunlock(&kld_sx); done: CURVNET_RESTORE(); @@ -1066,9 +1074,6 @@ int kern_kldunload(struct thread *td, int fileid, int flags) { linker_file_t lf; - char *filename = NULL; - caddr_t address; - size_t size; int error = 0; if ((error = securelevel_gt(td->td_ucred, 0)) != 0) @@ -1083,10 +1088,7 @@ kern_kldunload(struct thread *td, int fi if (lf) { KLD_DPF(FILE, ("kldunload: lf->userrefs=%d\n", lf->userrefs)); - EVENTHANDLER_INVOKE(kld_unload_try, lf, &error); - if (error != 0) - error = EBUSY; - else if (lf->userrefs == 0) { + if (lf->userrefs == 0) { /* * XXX: maybe LINKER_UNLOAD_FORCE should override ? */ @@ -1094,11 +1096,6 @@ kern_kldunload(struct thread *td, int fi " loaded by the kernel\n"); error = EBUSY; } else { - /* Save data needed for the kld_unload callbacks. */ - filename = strdup(lf->filename, M_TEMP); - address = lf->address; - size = lf->size; - lf->userrefs--; error = linker_file_unload(lf, flags); if (error) @@ -1106,14 +1103,7 @@ kern_kldunload(struct thread *td, int fi } } else error = ENOENT; - - if (error == 0) { - sx_downgrade(&kld_sx); - EVENTHANDLER_INVOKE(kld_unload, filename, address, size); - sx_sunlock(&kld_sx); - } else - sx_xunlock(&kld_sx); - free(filename, M_TEMP); + sx_xunlock(&kld_sx); CURVNET_RESTORE(); return (error); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 12:48:06 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 554257FD; Mon, 17 Feb 2014 12:48: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3F6701C89; Mon, 17 Feb 2014 12:48:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCm6bT042371; Mon, 17 Feb 2014 12:48:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCm59u042368; Mon, 17 Feb 2014 12:48:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171248.s1HCm59u042368@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:48: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: r262040 - in stable/10/sys: cddl/dev/sdt 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 12:48:06 -0000 Author: avg Date: Mon Feb 17 12:48:05 2014 New Revision: 262040 URL: http://svnweb.freebsd.org/changeset/base/262040 Log: MFC r257152: Do some cleanup of the SDT code Modified: stable/10/sys/cddl/dev/sdt/sdt.c stable/10/sys/sys/sdt.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/10/sys/cddl/dev/sdt/sdt.c Mon Feb 17 12:45:35 2014 (r262039) +++ stable/10/sys/cddl/dev/sdt/sdt.c Mon Feb 17 12:48:05 2014 (r262040) @@ -24,6 +24,21 @@ * */ +/* + * This file contains a reimplementation of the statically-defined tracing (SDT) + * framework for DTrace. Probes and SDT providers are defined using the macros + * in sys/sdt.h, which append all the needed structures to linker sets. When + * this module is loaded, it iterates over all of the loaded modules and + * registers probes and providers with the DTrace framework based on the + * contents of these linker sets. + * + * A list of SDT providers is maintained here since a provider may span multiple + * modules. When a kernel module is unloaded, a provider defined in that module + * is unregistered only if no other modules refer to it. The DTrace framework is + * responsible for destroying individual probes when a kernel module is + * unloaded; in particular, probes may not span multiple kernel modules. + */ + #include "opt_kdtrace.h" #include @@ -53,9 +68,8 @@ static void sdt_destroy(void *, dtrace_i static void sdt_enable(void *, dtrace_id_t, void *); static void sdt_disable(void *, dtrace_id_t, void *); -static d_open_t sdt_open; -static void sdt_load(void *); -static int sdt_unload(void *); +static void sdt_load(void); +static int sdt_unload(void); static void sdt_create_provider(struct sdt_provider *); static void sdt_create_probe(struct sdt_probe *); static void sdt_kld_load(void *, struct linker_file *); @@ -63,12 +77,6 @@ static void sdt_kld_unload_try(void *, s static MALLOC_DEFINE(M_SDT, "SDT", "DTrace SDT providers"); -static struct cdevsw sdt_cdevsw = { - .d_version = D_VERSION, - .d_open = sdt_open, - .d_name = "sdt", -}; - static dtrace_pattr_t sdt_attr = { { DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, { DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, @@ -90,8 +98,6 @@ static dtrace_pops_t sdt_pops = { sdt_destroy, }; -static struct cdev *sdt_cdev; - static TAILQ_HEAD(, sdt_provider) sdt_prov_list; eventhandler_tag sdt_kld_load_tag; @@ -117,7 +123,6 @@ sdt_create_provider(struct sdt_provider newprov = malloc(sizeof(*newprov), M_SDT, M_WAITOK | M_ZERO); newprov->name = strdup(prov->name, M_SDT); prov->sdt_refs = newprov->sdt_refs = 1; - TAILQ_INIT(&newprov->probe_list); TAILQ_INSERT_TAIL(&sdt_prov_list, newprov, prov_entry); @@ -174,12 +179,14 @@ sdt_create_probe(struct sdt_probe *probe if (dtrace_probe_lookup(prov->id, mod, func, name) != DTRACE_IDNONE) return; - TAILQ_INSERT_TAIL(&prov->probe_list, probe, probe_entry); - (void)dtrace_probe_create(prov->id, mod, func, name, 1, probe); } -/* Probes are created through the SDT module load/unload hook. */ +/* + * Probes are created through the SDT module load/unload hook, so this function + * has nothing to do. It only exists because the DTrace provider framework + * requires one of provide_probes and provide_module to be defined. + */ static void sdt_provide_probes(void *arg, dtrace_probedesc_t *desc) { @@ -211,39 +218,39 @@ sdt_getargdesc(void *arg, dtrace_id_t id struct sdt_argtype *argtype; struct sdt_probe *probe = parg; - if (desc->dtargd_ndx < probe->n_args) { - TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) { - if (desc->dtargd_ndx == argtype->ndx) { - desc->dtargd_mapping = desc->dtargd_ndx; - strlcpy(desc->dtargd_native, argtype->type, - sizeof(desc->dtargd_native)); - if (argtype->xtype != NULL) - strlcpy(desc->dtargd_xlate, - argtype->xtype, - sizeof(desc->dtargd_xlate)); - else - desc->dtargd_xlate[0] = '\0'; + if (desc->dtargd_ndx >= probe->n_args) { + desc->dtargd_ndx = DTRACE_ARGNONE; + return; + } + + TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) { + if (desc->dtargd_ndx == argtype->ndx) { + desc->dtargd_mapping = desc->dtargd_ndx; + if (argtype->type == NULL) { + desc->dtargd_native[0] = '\0'; + desc->dtargd_xlate[0] = '\0'; + continue; } + strlcpy(desc->dtargd_native, argtype->type, + sizeof(desc->dtargd_native)); + if (argtype->xtype != NULL) + strlcpy(desc->dtargd_xlate, argtype->xtype, + sizeof(desc->dtargd_xlate)); } - } else - desc->dtargd_ndx = DTRACE_ARGNONE; + } } static void sdt_destroy(void *arg, dtrace_id_t id, void *parg) { - struct sdt_probe *probe; - - probe = parg; - TAILQ_REMOVE(&probe->prov->probe_list, probe, probe_entry); } /* * Called from the kernel linker when a module is loaded, before * dtrace_module_loaded() is called. This is done so that it's possible to - * register new providers when modules are loaded. We cannot do this in the - * provide_module method since it's called with the provider lock held - * and dtrace_register() will try to acquire it again. + * register new providers when modules are loaded. The DTrace framework + * explicitly disallows calling into the framework from the provide_module + * provider method, so we cannot do this there. */ static void sdt_kld_load(void *arg __unused, struct linker_file *lf) @@ -277,14 +284,15 @@ sdt_kld_load(void *arg __unused, struct } static void -sdt_kld_unload_try(void *arg __unused, struct linker_file *lf, int *error __unused) +sdt_kld_unload_try(void *arg __unused, struct linker_file *lf, int *error) { struct sdt_provider *prov, **curr, **begin, **end, *tmp; if (*error != 0) /* We already have an error, so don't do anything. */ return; - else if (linker_file_lookup_set(lf, "sdt_providers_set", &begin, &end, NULL)) + else if (linker_file_lookup_set(lf, "sdt_providers_set", &begin, &end, + NULL)) /* No DTrace providers are declared in this file. */ return; @@ -294,17 +302,20 @@ sdt_kld_unload_try(void *arg __unused, s */ for (curr = begin; curr < end; curr++) { TAILQ_FOREACH_SAFE(prov, &sdt_prov_list, prov_entry, tmp) { - if (strcmp(prov->name, (*curr)->name) == 0) { - if (prov->sdt_refs == 1) { - TAILQ_REMOVE(&sdt_prov_list, prov, - prov_entry); - dtrace_unregister(prov->id); - free(prov->name, M_SDT); - free(prov, M_SDT); - } else - prov->sdt_refs--; - break; - } + if (strcmp(prov->name, (*curr)->name) != 0) + continue; + + if (prov->sdt_refs == 1) { + if (dtrace_unregister(prov->id) != 0) { + *error = 1; + return; + } + TAILQ_REMOVE(&sdt_prov_list, prov, prov_entry); + free(prov->name, M_SDT); + free(prov, M_SDT); + } else + prov->sdt_refs--; + break; } } } @@ -319,15 +330,11 @@ sdt_linker_file_cb(linker_file_t lf, voi } static void -sdt_load(void *arg __unused) +sdt_load() { TAILQ_INIT(&sdt_prov_list); - /* Create the /dev/dtrace/sdt entry. */ - sdt_cdev = make_dev(&sdt_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, - "dtrace/sdt"); - sdt_probe_func = dtrace_probe; sdt_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, sdt_kld_load, NULL, @@ -340,9 +347,10 @@ sdt_load(void *arg __unused) } static int -sdt_unload(void *arg __unused) +sdt_unload() { struct sdt_provider *prov, *tmp; + int ret; EVENTHANDLER_DEREGISTER(kld_load, sdt_kld_load_tag); EVENTHANDLER_DEREGISTER(kld_unload_try, sdt_kld_unload_try_tag); @@ -350,18 +358,17 @@ sdt_unload(void *arg __unused) sdt_probe_func = sdt_probe_stub; TAILQ_FOREACH_SAFE(prov, &sdt_prov_list, prov_entry, tmp) { + ret = dtrace_unregister(prov->id); + if (ret != 0) + return (ret); TAILQ_REMOVE(&sdt_prov_list, prov, prov_entry); - dtrace_unregister(prov->id); free(prov->name, M_SDT); free(prov, M_SDT); } - destroy_dev(sdt_cdev); - return (0); } -/* ARGSUSED */ static int sdt_modevent(module_t mod __unused, int type, void *data __unused) { @@ -369,9 +376,11 @@ sdt_modevent(module_t mod __unused, int switch (type) { case MOD_LOAD: + sdt_load(); break; case MOD_UNLOAD: + error = sdt_unload(); break; case MOD_SHUTDOWN: @@ -385,18 +394,6 @@ sdt_modevent(module_t mod __unused, int return (error); } -/* ARGSUSED */ -static int -sdt_open(struct cdev *dev __unused, int oflags __unused, int devtype __unused, - struct thread *td __unused) -{ - - return (0); -} - -SYSINIT(sdt_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_load, NULL); -SYSUNINIT(sdt_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_unload, NULL); - DEV_MODULE(sdt, sdt_modevent, NULL); MODULE_VERSION(sdt, 1); MODULE_DEPEND(sdt, dtrace, 1, 1, 1); Modified: stable/10/sys/sys/sdt.h ============================================================================== --- stable/10/sys/sys/sdt.h Mon Feb 17 12:45:35 2014 (r262039) +++ stable/10/sys/sys/sdt.h Mon Feb 17 12:48:05 2014 (r262040) @@ -134,7 +134,7 @@ SET_DECLARE(sdt_argtypes_set, struct sdt #define SDT_PROVIDER_DEFINE(prov) \ struct sdt_provider sdt_provider_##prov[1] = { \ - { #prov, { NULL, NULL }, { NULL, NULL }, 0, 0 } \ + { #prov, { NULL, NULL }, 0, 0 } \ }; \ DATA_SET(sdt_providers_set, sdt_provider_##prov); @@ -358,7 +358,6 @@ struct sdt_provider { char *name; /* Provider name. */ TAILQ_ENTRY(sdt_provider) prov_entry; /* SDT provider list entry. */ - TAILQ_HEAD(probe_list_head, sdt_probe) probe_list; uintptr_t id; /* DTrace provider ID. */ int sdt_refs; /* Number of module references. */ }; From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 12:48:20 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E186929; Mon, 17 Feb 2014 12:48: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 27E081C8B; Mon, 17 Feb 2014 12:48:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCmK0U042436; Mon, 17 Feb 2014 12:48:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCmJ7i042434; Mon, 17 Feb 2014 12:48:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171248.s1HCmJ7i042434@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:48:19 +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: r262041 - in stable/9/sys: cddl/dev/sdt sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 12:48:20 -0000 Author: avg Date: Mon Feb 17 12:48:19 2014 New Revision: 262041 URL: http://svnweb.freebsd.org/changeset/base/262041 Log: MFC r257152: Do some cleanup of the SDT code Modified: stable/9/sys/cddl/dev/sdt/sdt.c stable/9/sys/sys/sdt.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 12:48:05 2014 (r262040) +++ stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 12:48:19 2014 (r262041) @@ -24,6 +24,21 @@ * */ +/* + * This file contains a reimplementation of the statically-defined tracing (SDT) + * framework for DTrace. Probes and SDT providers are defined using the macros + * in sys/sdt.h, which append all the needed structures to linker sets. When + * this module is loaded, it iterates over all of the loaded modules and + * registers probes and providers with the DTrace framework based on the + * contents of these linker sets. + * + * A list of SDT providers is maintained here since a provider may span multiple + * modules. When a kernel module is unloaded, a provider defined in that module + * is unregistered only if no other modules refer to it. The DTrace framework is + * responsible for destroying individual probes when a kernel module is + * unloaded; in particular, probes may not span multiple kernel modules. + */ + #include "opt_kdtrace.h" #include @@ -53,9 +68,8 @@ static void sdt_destroy(void *, dtrace_i static void sdt_enable(void *, dtrace_id_t, void *); static void sdt_disable(void *, dtrace_id_t, void *); -static d_open_t sdt_open; -static void sdt_load(void *); -static int sdt_unload(void *); +static void sdt_load(void); +static int sdt_unload(void); static void sdt_create_provider(struct sdt_provider *); static void sdt_create_probe(struct sdt_probe *); static void sdt_kld_load(void *, struct linker_file *); @@ -63,12 +77,6 @@ static void sdt_kld_unload_try(void *, s static MALLOC_DEFINE(M_SDT, "SDT", "DTrace SDT providers"); -static struct cdevsw sdt_cdevsw = { - .d_version = D_VERSION, - .d_open = sdt_open, - .d_name = "sdt", -}; - static dtrace_pattr_t sdt_attr = { { DTRACE_STABILITY_EVOLVING, DTRACE_STABILITY_EVOLVING, DTRACE_CLASS_COMMON }, { DTRACE_STABILITY_PRIVATE, DTRACE_STABILITY_PRIVATE, DTRACE_CLASS_UNKNOWN }, @@ -90,8 +98,6 @@ static dtrace_pops_t sdt_pops = { sdt_destroy, }; -static struct cdev *sdt_cdev; - static TAILQ_HEAD(, sdt_provider) sdt_prov_list; eventhandler_tag sdt_kld_load_tag; @@ -117,7 +123,6 @@ sdt_create_provider(struct sdt_provider newprov = malloc(sizeof(*newprov), M_SDT, M_WAITOK | M_ZERO); newprov->name = strdup(prov->name, M_SDT); prov->sdt_refs = newprov->sdt_refs = 1; - TAILQ_INIT(&newprov->probe_list); TAILQ_INSERT_TAIL(&sdt_prov_list, newprov, prov_entry); @@ -161,12 +166,14 @@ sdt_create_probe(struct sdt_probe *probe if (dtrace_probe_lookup(prov->id, mod, func, name) != DTRACE_IDNONE) return; - TAILQ_INSERT_TAIL(&prov->probe_list, probe, probe_entry); - (void)dtrace_probe_create(prov->id, mod, func, name, 1, probe); } -/* Probes are created through the SDT module load/unload hook. */ +/* + * Probes are created through the SDT module load/unload hook, so this function + * has nothing to do. It only exists because the DTrace provider framework + * requires one of provide_probes and provide_module to be defined. + */ static void sdt_provide_probes(void *arg, dtrace_probedesc_t *desc) { @@ -198,39 +205,39 @@ sdt_getargdesc(void *arg, dtrace_id_t id struct sdt_argtype *argtype; struct sdt_probe *probe = parg; - if (desc->dtargd_ndx < probe->n_args) { - TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) { - if (desc->dtargd_ndx == argtype->ndx) { - desc->dtargd_mapping = desc->dtargd_ndx; - strlcpy(desc->dtargd_native, argtype->type, - sizeof(desc->dtargd_native)); - if (argtype->xtype != NULL) - strlcpy(desc->dtargd_xlate, - argtype->xtype, - sizeof(desc->dtargd_xlate)); - else - desc->dtargd_xlate[0] = '\0'; + if (desc->dtargd_ndx >= probe->n_args) { + desc->dtargd_ndx = DTRACE_ARGNONE; + return; + } + + TAILQ_FOREACH(argtype, &probe->argtype_list, argtype_entry) { + if (desc->dtargd_ndx == argtype->ndx) { + desc->dtargd_mapping = desc->dtargd_ndx; + if (argtype->type == NULL) { + desc->dtargd_native[0] = '\0'; + desc->dtargd_xlate[0] = '\0'; + continue; } + strlcpy(desc->dtargd_native, argtype->type, + sizeof(desc->dtargd_native)); + if (argtype->xtype != NULL) + strlcpy(desc->dtargd_xlate, argtype->xtype, + sizeof(desc->dtargd_xlate)); } - } else - desc->dtargd_ndx = DTRACE_ARGNONE; + } } static void sdt_destroy(void *arg, dtrace_id_t id, void *parg) { - struct sdt_probe *probe; - - probe = parg; - TAILQ_REMOVE(&probe->prov->probe_list, probe, probe_entry); } /* * Called from the kernel linker when a module is loaded, before * dtrace_module_loaded() is called. This is done so that it's possible to - * register new providers when modules are loaded. We cannot do this in the - * provide_module method since it's called with the provider lock held - * and dtrace_register() will try to acquire it again. + * register new providers when modules are loaded. The DTrace framework + * explicitly disallows calling into the framework from the provide_module + * provider method, so we cannot do this there. */ static void sdt_kld_load(void *arg __unused, struct linker_file *lf) @@ -264,14 +271,15 @@ sdt_kld_load(void *arg __unused, struct } static void -sdt_kld_unload_try(void *arg __unused, struct linker_file *lf, int *error __unused) +sdt_kld_unload_try(void *arg __unused, struct linker_file *lf, int *error) { struct sdt_provider *prov, **curr, **begin, **end, *tmp; if (*error != 0) /* We already have an error, so don't do anything. */ return; - else if (linker_file_lookup_set(lf, "sdt_providers_set", &begin, &end, NULL)) + else if (linker_file_lookup_set(lf, "sdt_providers_set", &begin, &end, + NULL)) /* No DTrace providers are declared in this file. */ return; @@ -281,17 +289,20 @@ sdt_kld_unload_try(void *arg __unused, s */ for (curr = begin; curr < end; curr++) { TAILQ_FOREACH_SAFE(prov, &sdt_prov_list, prov_entry, tmp) { - if (strcmp(prov->name, (*curr)->name) == 0) { - if (prov->sdt_refs == 1) { - TAILQ_REMOVE(&sdt_prov_list, prov, - prov_entry); - dtrace_unregister(prov->id); - free(prov->name, M_SDT); - free(prov, M_SDT); - } else - prov->sdt_refs--; - break; - } + if (strcmp(prov->name, (*curr)->name) != 0) + continue; + + if (prov->sdt_refs == 1) { + if (dtrace_unregister(prov->id) != 0) { + *error = 1; + return; + } + TAILQ_REMOVE(&sdt_prov_list, prov, prov_entry); + free(prov->name, M_SDT); + free(prov, M_SDT); + } else + prov->sdt_refs--; + break; } } } @@ -306,15 +317,11 @@ sdt_linker_file_cb(linker_file_t lf, voi } static void -sdt_load(void *arg __unused) +sdt_load() { TAILQ_INIT(&sdt_prov_list); - /* Create the /dev/dtrace/sdt entry. */ - sdt_cdev = make_dev(&sdt_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, - "dtrace/sdt"); - sdt_probe_func = dtrace_probe; sdt_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, sdt_kld_load, NULL, @@ -327,9 +334,10 @@ sdt_load(void *arg __unused) } static int -sdt_unload(void *arg __unused) +sdt_unload() { struct sdt_provider *prov, *tmp; + int ret; EVENTHANDLER_DEREGISTER(kld_load, sdt_kld_load_tag); EVENTHANDLER_DEREGISTER(kld_unload_try, sdt_kld_unload_try_tag); @@ -337,18 +345,17 @@ sdt_unload(void *arg __unused) sdt_probe_func = sdt_probe_stub; TAILQ_FOREACH_SAFE(prov, &sdt_prov_list, prov_entry, tmp) { + ret = dtrace_unregister(prov->id); + if (ret != 0) + return (ret); TAILQ_REMOVE(&sdt_prov_list, prov, prov_entry); - dtrace_unregister(prov->id); free(prov->name, M_SDT); free(prov, M_SDT); } - destroy_dev(sdt_cdev); - return (0); } -/* ARGSUSED */ static int sdt_modevent(module_t mod __unused, int type, void *data __unused) { @@ -356,9 +363,11 @@ sdt_modevent(module_t mod __unused, int switch (type) { case MOD_LOAD: + sdt_load(); break; case MOD_UNLOAD: + error = sdt_unload(); break; case MOD_SHUTDOWN: @@ -372,18 +381,6 @@ sdt_modevent(module_t mod __unused, int return (error); } -/* ARGSUSED */ -static int -sdt_open(struct cdev *dev __unused, int oflags __unused, int devtype __unused, - struct thread *td __unused) -{ - - return (0); -} - -SYSINIT(sdt_load, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_load, NULL); -SYSUNINIT(sdt_unload, SI_SUB_DTRACE_PROVIDER, SI_ORDER_ANY, sdt_unload, NULL); - DEV_MODULE(sdt, sdt_modevent, NULL); MODULE_VERSION(sdt, 1); MODULE_DEPEND(sdt, dtrace, 1, 1, 1); Modified: stable/9/sys/sys/sdt.h ============================================================================== --- stable/9/sys/sys/sdt.h Mon Feb 17 12:48:05 2014 (r262040) +++ stable/9/sys/sys/sdt.h Mon Feb 17 12:48:19 2014 (r262041) @@ -134,7 +134,7 @@ SET_DECLARE(sdt_argtypes_set, struct sdt #define SDT_PROVIDER_DEFINE(prov) \ struct sdt_provider sdt_provider_##prov[1] = { \ - { #prov, { NULL, NULL }, { NULL, NULL }, 0, 0 } \ + { #prov, { NULL, NULL }, 0, 0 } \ }; \ DATA_SET(sdt_providers_set, sdt_provider_##prov); @@ -358,7 +358,6 @@ struct sdt_provider { char *name; /* Provider name. */ TAILQ_ENTRY(sdt_provider) prov_entry; /* SDT provider list entry. */ - TAILQ_HEAD(probe_list_head, sdt_probe) probe_list; uintptr_t id; /* DTrace provider ID. */ int sdt_refs; /* Number of module references. */ }; From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 12:57:15 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4EDAC2B; Mon, 17 Feb 2014 12:57: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B20C71D41; Mon, 17 Feb 2014 12:57:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCvFiF046171; Mon, 17 Feb 2014 12:57:15 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCvEg4046162; Mon, 17 Feb 2014 12:57:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171257.s1HCvEg4046162@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:57: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: r262042 - in stable/10/sys: amd64/amd64 cddl/dev/dtrace/amd64 i386/i386 mips/mips powerpc/aim sys x86/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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 12:57:16 -0000 Author: avg Date: Mon Feb 17 12:57:13 2014 New Revision: 262042 URL: http://svnweb.freebsd.org/changeset/base/262042 Log: MFC r257417: Remove references to an unused fasttrap probe hook Modified: stable/10/sys/amd64/amd64/trap.c stable/10/sys/cddl/dev/dtrace/amd64/dtrace_subr.c stable/10/sys/i386/i386/trap.c stable/10/sys/mips/mips/trap.c stable/10/sys/powerpc/aim/trap.c stable/10/sys/sys/dtrace_bsd.h stable/10/sys/x86/include/trap.h Modified: stable/10/sys/amd64/amd64/trap.c ============================================================================== --- stable/10/sys/amd64/amd64/trap.c Mon Feb 17 12:48:19 2014 (r262041) +++ stable/10/sys/amd64/amd64/trap.c Mon Feb 17 12:57:13 2014 (r262042) @@ -114,9 +114,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif @@ -128,7 +127,7 @@ void dblfault_handler(struct trapframe * static int trap_pfault(struct trapframe *, int); static void trap_fatal(struct trapframe *, vm_offset_t); -#define MAX_TRAP_MSG 33 +#define MAX_TRAP_MSG 32 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -163,7 +162,6 @@ static char *trap_msg[] = { "reserved (unknown) fault", /* 30 T_RESERVED */ "", /* 31 unused (reserved) */ "DTrace pid return trap", /* 32 T_DTRACE_RET */ - "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ }; #ifdef KDB @@ -255,16 +253,11 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || - type == T_BPTFLT) { + if (type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; fill_frame_regs(frame, ®s); - if (type == T_DTRACE_PROBE && - dtrace_fasttrap_probe_ptr != NULL && - dtrace_fasttrap_probe_ptr(®s) == 0) - goto out; - else if (type == T_BPTFLT && + if (type == T_BPTFLT && dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) goto out; Modified: stable/10/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Feb 17 12:48:19 2014 (r262041) +++ stable/10/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Feb 17 12:57:13 2014 (r262042) @@ -142,7 +142,6 @@ dtrace_sync(void) } #ifdef notyet -int (*dtrace_fasttrap_probe_ptr)(struct regs *); int (*dtrace_pid_probe_ptr)(struct regs *); int (*dtrace_return_probe_ptr)(struct regs *); @@ -213,13 +212,6 @@ dtrace_user_probe(struct regs *rp, caddr rw_exit(rwp); rp->r_pc = npc; - } else if (rp->r_trapno == T_DTRACE_PROBE) { - rwp = &CPU->cpu_ft_lock; - rw_enter(rwp, RW_READER); - if (dtrace_fasttrap_probe_ptr != NULL) - (void) (*dtrace_fasttrap_probe_ptr)(rp); - rw_exit(rwp); - } else if (rp->r_trapno == T_BPTFLT) { uint8_t instr; rwp = &CPU->cpu_ft_lock; Modified: stable/10/sys/i386/i386/trap.c ============================================================================== --- stable/10/sys/i386/i386/trap.c Mon Feb 17 12:48:19 2014 (r262041) +++ stable/10/sys/i386/i386/trap.c Mon Feb 17 12:57:13 2014 (r262042) @@ -123,9 +123,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif @@ -139,7 +138,7 @@ void dblfault_handler(void); extern inthand_t IDTVEC(lcall_syscall); -#define MAX_TRAP_MSG 33 +#define MAX_TRAP_MSG 32 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -174,8 +173,6 @@ static char *trap_msg[] = { "reserved (unknown) fault", /* 30 T_RESERVED */ "", /* 31 unused (reserved) */ "DTrace pid return trap", /* 32 T_DTRACE_RET */ - "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ - }; #if defined(I586_CPU) && !defined(NO_F00F_HACK) @@ -275,15 +272,10 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || - type == T_BPTFLT) { + if (type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; fill_frame_regs(frame, ®s); - if (type == T_DTRACE_PROBE && - dtrace_fasttrap_probe_ptr != NULL && - dtrace_fasttrap_probe_ptr(®s) == 0) - goto out; if (type == T_BPTFLT && dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) Modified: stable/10/sys/mips/mips/trap.c ============================================================================== --- stable/10/sys/mips/mips/trap.c Mon Feb 17 12:48:19 2014 (r262041) +++ stable/10/sys/mips/mips/trap.c Mon Feb 17 12:57:13 2014 (r262042) @@ -112,9 +112,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif @@ -639,7 +638,7 @@ trap(struct trapframe *trapframe) * function can return normally. */ /* - * XXXDTRACE: add fasttrap and pid probes handlers here (if ever) + * XXXDTRACE: add pid probe handler here (if ever) */ if (!usermode) { if (dtrace_trap_func != NULL && (*dtrace_trap_func)(trapframe, type)) Modified: stable/10/sys/powerpc/aim/trap.c ============================================================================== --- stable/10/sys/powerpc/aim/trap.c Mon Feb 17 12:48:19 2014 (r262041) +++ stable/10/sys/powerpc/aim/trap.c Mon Feb 17 12:57:13 2014 (r262042) @@ -121,9 +121,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; int (*dtrace_invop_jump_addr)(struct trapframe *); @@ -208,7 +207,7 @@ trap(struct trapframe *frame) * function can return normally. */ /* - * XXXDTRACE: add fasttrap and pid probes handlers here (if ever) + * XXXDTRACE: add pid probe handler here (if ever) */ if (dtrace_trap_func != NULL && (*dtrace_trap_func)(frame, type)) return; Modified: stable/10/sys/sys/dtrace_bsd.h ============================================================================== --- stable/10/sys/sys/dtrace_bsd.h Mon Feb 17 12:48:19 2014 (r262041) +++ stable/10/sys/sys/dtrace_bsd.h Mon Feb 17 12:57:13 2014 (r262042) @@ -70,8 +70,6 @@ extern dtrace_invop_func_t dtrace_invop_ extern dtrace_doubletrap_func_t dtrace_doubletrap_func; /* Pid provider hooks */ -typedef int (*dtrace_fasttrap_probe_ptr_t)(struct reg *); -extern dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; typedef int (*dtrace_pid_probe_ptr_t)(struct reg *); extern dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; typedef int (*dtrace_return_probe_ptr_t)(struct reg *); Modified: stable/10/sys/x86/include/trap.h ============================================================================== --- stable/10/sys/x86/include/trap.h Mon Feb 17 12:48:19 2014 (r262041) +++ stable/10/sys/x86/include/trap.h Mon Feb 17 12:57:13 2014 (r262042) @@ -63,7 +63,6 @@ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ #define T_DTRACE_RET 32 /* DTrace pid return */ -#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 12:57:55 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A250D6C; Mon, 17 Feb 2014 12:57: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 84A391D4C; Mon, 17 Feb 2014 12:57:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HCvton046273; Mon, 17 Feb 2014 12:57:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HCvst4046265; Mon, 17 Feb 2014 12:57:54 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171257.s1HCvst4046265@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 12:57:54 +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: r262043 - in stable/9/sys: amd64/amd64 amd64/include cddl/dev/dtrace/amd64 i386/i386 i386/include sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 12:57:55 -0000 Author: avg Date: Mon Feb 17 12:57:53 2014 New Revision: 262043 URL: http://svnweb.freebsd.org/changeset/base/262043 Log: MFC r257417: Remove references to an unused fasttrap probe hook Modified: stable/9/sys/amd64/amd64/trap.c stable/9/sys/amd64/include/trap.h stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c stable/9/sys/i386/i386/trap.c stable/9/sys/i386/include/trap.h stable/9/sys/sys/dtrace_bsd.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/trap.c ============================================================================== --- stable/9/sys/amd64/amd64/trap.c Mon Feb 17 12:57:13 2014 (r262042) +++ stable/9/sys/amd64/amd64/trap.c Mon Feb 17 12:57:53 2014 (r262043) @@ -114,9 +114,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif @@ -128,7 +127,7 @@ void dblfault_handler(struct trapframe * static int trap_pfault(struct trapframe *, int); static void trap_fatal(struct trapframe *, vm_offset_t); -#define MAX_TRAP_MSG 33 +#define MAX_TRAP_MSG 32 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -163,7 +162,6 @@ static char *trap_msg[] = { "reserved (unknown) fault", /* 30 T_RESERVED */ "", /* 31 unused (reserved) */ "DTrace pid return trap", /* 32 T_DTRACE_RET */ - "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ }; #ifdef KDB @@ -255,16 +253,11 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || - type == T_BPTFLT) { + if (type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; fill_frame_regs(frame, ®s); - if (type == T_DTRACE_PROBE && - dtrace_fasttrap_probe_ptr != NULL && - dtrace_fasttrap_probe_ptr(®s) == 0) - goto out; - else if (type == T_BPTFLT && + if (type == T_BPTFLT && dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) goto out; Modified: stable/9/sys/amd64/include/trap.h ============================================================================== --- stable/9/sys/amd64/include/trap.h Mon Feb 17 12:57:13 2014 (r262042) +++ stable/9/sys/amd64/include/trap.h Mon Feb 17 12:57:53 2014 (r262043) @@ -63,7 +63,6 @@ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ #define T_DTRACE_RET 32 /* DTrace pid return */ -#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ Modified: stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Feb 17 12:57:13 2014 (r262042) +++ stable/9/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Feb 17 12:57:53 2014 (r262043) @@ -142,7 +142,6 @@ dtrace_sync(void) } #ifdef notyet -int (*dtrace_fasttrap_probe_ptr)(struct regs *); int (*dtrace_pid_probe_ptr)(struct regs *); int (*dtrace_return_probe_ptr)(struct regs *); @@ -213,13 +212,6 @@ dtrace_user_probe(struct regs *rp, caddr rw_exit(rwp); rp->r_pc = npc; - } else if (rp->r_trapno == T_DTRACE_PROBE) { - rwp = &CPU->cpu_ft_lock; - rw_enter(rwp, RW_READER); - if (dtrace_fasttrap_probe_ptr != NULL) - (void) (*dtrace_fasttrap_probe_ptr)(rp); - rw_exit(rwp); - } else if (rp->r_trapno == T_BPTFLT) { uint8_t instr; rwp = &CPU->cpu_ft_lock; Modified: stable/9/sys/i386/i386/trap.c ============================================================================== --- stable/9/sys/i386/i386/trap.c Mon Feb 17 12:57:13 2014 (r262042) +++ stable/9/sys/i386/i386/trap.c Mon Feb 17 12:57:53 2014 (r262043) @@ -123,9 +123,8 @@ dtrace_doubletrap_func_t dtrace_doubletr systrace_probe_func_t systrace_probe_func; /* - * These hooks are necessary for the pid, usdt and fasttrap providers. + * These hooks are necessary for the pid and usdt providers. */ -dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; dtrace_return_probe_ptr_t dtrace_return_probe_ptr; #endif @@ -139,7 +138,7 @@ void dblfault_handler(void); extern inthand_t IDTVEC(lcall_syscall); -#define MAX_TRAP_MSG 33 +#define MAX_TRAP_MSG 32 static char *trap_msg[] = { "", /* 0 unused */ "privileged instruction fault", /* 1 T_PRIVINFLT */ @@ -174,8 +173,6 @@ static char *trap_msg[] = { "reserved (unknown) fault", /* 30 T_RESERVED */ "", /* 31 unused (reserved) */ "DTrace pid return trap", /* 32 T_DTRACE_RET */ - "DTrace fasttrap probe trap", /* 33 T_DTRACE_PROBE */ - }; #if defined(I586_CPU) && !defined(NO_F00F_HACK) @@ -275,15 +272,10 @@ trap(struct trapframe *frame) * handled the trap and modified the trap frame so that this * function can return normally. */ - if (type == T_DTRACE_PROBE || type == T_DTRACE_RET || - type == T_BPTFLT) { + if (type == T_DTRACE_RET || type == T_BPTFLT) { struct reg regs; fill_frame_regs(frame, ®s); - if (type == T_DTRACE_PROBE && - dtrace_fasttrap_probe_ptr != NULL && - dtrace_fasttrap_probe_ptr(®s) == 0) - goto out; if (type == T_BPTFLT && dtrace_pid_probe_ptr != NULL && dtrace_pid_probe_ptr(®s) == 0) Modified: stable/9/sys/i386/include/trap.h ============================================================================== --- stable/9/sys/i386/include/trap.h Mon Feb 17 12:57:13 2014 (r262042) +++ stable/9/sys/i386/include/trap.h Mon Feb 17 12:57:53 2014 (r262043) @@ -63,7 +63,6 @@ #define T_XMMFLT 29 /* SIMD floating-point exception */ #define T_RESERVED 30 /* reserved (unknown) */ #define T_DTRACE_RET 32 /* DTrace pid return */ -#define T_DTRACE_PROBE 33 /* DTrace fasttrap probe */ /* XXX most of the following codes aren't used, but could be. */ Modified: stable/9/sys/sys/dtrace_bsd.h ============================================================================== --- stable/9/sys/sys/dtrace_bsd.h Mon Feb 17 12:57:13 2014 (r262042) +++ stable/9/sys/sys/dtrace_bsd.h Mon Feb 17 12:57:53 2014 (r262043) @@ -70,8 +70,6 @@ extern dtrace_invop_func_t dtrace_invop_ extern dtrace_doubletrap_func_t dtrace_doubletrap_func; /* Pid provider hooks */ -typedef int (*dtrace_fasttrap_probe_ptr_t)(struct reg *); -extern dtrace_fasttrap_probe_ptr_t dtrace_fasttrap_probe_ptr; typedef int (*dtrace_pid_probe_ptr_t)(struct reg *); extern dtrace_pid_probe_ptr_t dtrace_pid_probe_ptr; typedef int (*dtrace_return_probe_ptr_t)(struct reg *); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 13:02:09 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 99C4DF83; Mon, 17 Feb 2014 13:02: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8549E1DDB; Mon, 17 Feb 2014 13:02:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HD29s8049692; Mon, 17 Feb 2014 13:02:09 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HD29UY049691; Mon, 17 Feb 2014 13:02:09 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171302.s1HD29UY049691@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:02: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: r262044 - stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:02:09 -0000 Author: avg Date: Mon Feb 17 13:02:09 2014 New Revision: 262044 URL: http://svnweb.freebsd.org/changeset/base/262044 Log: MFC r257143: Fix a couple of bugs in the fasttrap emulation of a "push %rbp" Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 12:57:53 2014 (r262043) +++ stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 13:02:09 2014 (r262044) @@ -104,6 +104,7 @@ uwrite(proc_t *p, void *kaddr, size_t le #define r_rip r_eip #define r_rflags r_eflags #define r_rsp r_esp +#define r_rbp r_ebp #endif /* @@ -1381,29 +1382,27 @@ fasttrap_pid_probe(struct reg *rp) case FASTTRAP_T_PUSHL_EBP: { int ret = 0; - uintptr_t addr = 0; #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { - addr = rp->r_rsp - sizeof (uintptr_t); - ret = fasttrap_sulword((void *)addr, &rp->r_rsp); + rp->r_rsp -= sizeof (uintptr_t); + ret = fasttrap_sulword(&rp->r_rbp, (void *)rp->r_rsp); } else { #endif #ifdef __i386__ - addr = rp->r_rsp - sizeof (uint32_t); - ret = fasttrap_suword32((void *)addr, &rp->r_rsp); + rp->r_rsp -= sizeof (uint32_t); + ret = fasttrap_suword32(&rp->r_rbp, (void *)rp->r_rsp); #endif #ifdef __amd64 } #endif if (ret == -1) { - fasttrap_sigsegv(p, curthread, addr); + fasttrap_sigsegv(p, curthread, rp->r_rsp); new_pc = pc; break; } - rp->r_rsp = addr; new_pc = pc + tp->ftt_size; break; } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 13:05:27 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EEB8230; Mon, 17 Feb 2014 13:05: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F3D601DFC; Mon, 17 Feb 2014 13:05:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HD5Qat050367; Mon, 17 Feb 2014 13:05:26 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HD5QSN050366; Mon, 17 Feb 2014 13:05:26 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171305.s1HD5QSN050366@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:05: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: r262045 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:05:27 -0000 Author: avg Date: Mon Feb 17 13:05:26 2014 New Revision: 262045 URL: http://svnweb.freebsd.org/changeset/base/262045 Log: MFC r257143: Fix a couple of bugs in the fasttrap emulation of a "push %rbp" Only mergeinfo for the previous commit. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 13:08:08 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E554A667; Mon, 17 Feb 2014 13:08: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C20861E2A; Mon, 17 Feb 2014 13:08:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HD87IG050904; Mon, 17 Feb 2014 13:08:07 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HD87fR050902; Mon, 17 Feb 2014 13:08:07 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171308.s1HD87fR050902@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:08:07 +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: r262046 - in stable/9/sys/cddl/contrib/opensolaris/uts: common/sys intel/dtrace X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:08:08 -0000 Author: avg Date: Mon Feb 17 13:08:07 2014 New Revision: 262046 URL: http://svnweb.freebsd.org/changeset/base/262046 Log: MFC r257679: Use suword32 and suword64 instead of copyout(9) in fasttrap Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Mon Feb 17 13:05:26 2014 (r262045) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Mon Feb 17 13:08:07 2014 (r262046) @@ -158,15 +158,15 @@ typedef struct fasttrap_hash { */ #define fasttrap_copyout copyout #define fasttrap_fuword32 fuword32 -#define fasttrap_suword32(_k, _u) copyout((_k), (_u), sizeof(uint32_t)) -#define fasttrap_suword64(_k, _u) copyout((_k), (_u), sizeof(uint64_t)) +#define fasttrap_suword32 suword32 +#define fasttrap_suword64 suword64 #ifdef __amd64__ #define fasttrap_fulword fuword64 -#define fasttrap_sulword fasttrap_suword64 +#define fasttrap_sulword suword64 #else #define fasttrap_fulword fuword32 -#define fasttrap_sulword fasttrap_suword32 +#define fasttrap_sulword suword32 #endif extern void fasttrap_sigtrap(proc_t *, kthread_t *, uintptr_t); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 13:05:26 2014 (r262045) +++ stable/9/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 13:08:07 2014 (r262046) @@ -1386,12 +1386,12 @@ fasttrap_pid_probe(struct reg *rp) #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { rp->r_rsp -= sizeof (uintptr_t); - ret = fasttrap_sulword(&rp->r_rbp, (void *)rp->r_rsp); + ret = fasttrap_sulword((void *)rp->r_rsp, rp->r_rbp); } else { #endif #ifdef __i386__ rp->r_rsp -= sizeof (uint32_t); - ret = fasttrap_suword32(&rp->r_rbp, (void *)rp->r_rsp); + ret = fasttrap_suword32((void *)rp->r_rsp, rp->r_rbp); #endif #ifdef __amd64 } @@ -1486,13 +1486,13 @@ fasttrap_pid_probe(struct reg *rp) if (p->p_model == DATAMODEL_NATIVE) { addr = rp->r_rsp - sizeof (uintptr_t); pcps = pc + tp->ftt_size; - ret = fasttrap_sulword((void *)addr, &pcps); + ret = fasttrap_sulword((void *)addr, pcps); } else { #endif #ifdef __i386__ addr = rp->r_rsp - sizeof (uint32_t); pcps = (uint32_t)(pc + tp->ftt_size); - ret = fasttrap_suword32((void *)addr, &pcps); + ret = fasttrap_suword32((void *)addr, pcps); #endif #ifdef __amd64 } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 13:08:21 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 331D779D; Mon, 17 Feb 2014 13:08: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 01D291E32; Mon, 17 Feb 2014 13:08:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HD8KLt050976; Mon, 17 Feb 2014 13:08:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HD8Kf9050974; Mon, 17 Feb 2014 13:08:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171308.s1HD8Kf9050974@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:08:20 +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: r262047 - in stable/10/sys/cddl/contrib/opensolaris/uts: common/sys intel/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:08:21 -0000 Author: avg Date: Mon Feb 17 13:08:20 2014 New Revision: 262047 URL: http://svnweb.freebsd.org/changeset/base/262047 Log: MFC r257679: Use suword32 and suword64 instead of copyout(9) in fasttrap Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Mon Feb 17 13:08:07 2014 (r262046) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap_impl.h Mon Feb 17 13:08:20 2014 (r262047) @@ -158,15 +158,15 @@ typedef struct fasttrap_hash { */ #define fasttrap_copyout copyout #define fasttrap_fuword32 fuword32 -#define fasttrap_suword32(_k, _u) copyout((_k), (_u), sizeof(uint32_t)) -#define fasttrap_suword64(_k, _u) copyout((_k), (_u), sizeof(uint64_t)) +#define fasttrap_suword32 suword32 +#define fasttrap_suword64 suword64 #ifdef __amd64__ #define fasttrap_fulword fuword64 -#define fasttrap_sulword fasttrap_suword64 +#define fasttrap_sulword suword64 #else #define fasttrap_fulword fuword32 -#define fasttrap_sulword fasttrap_suword32 +#define fasttrap_sulword suword32 #endif extern void fasttrap_sigtrap(proc_t *, kthread_t *, uintptr_t); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 13:08:07 2014 (r262046) +++ stable/10/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Feb 17 13:08:20 2014 (r262047) @@ -1386,12 +1386,12 @@ fasttrap_pid_probe(struct reg *rp) #ifdef __amd64 if (p->p_model == DATAMODEL_NATIVE) { rp->r_rsp -= sizeof (uintptr_t); - ret = fasttrap_sulword(&rp->r_rbp, (void *)rp->r_rsp); + ret = fasttrap_sulword((void *)rp->r_rsp, rp->r_rbp); } else { #endif #ifdef __i386__ rp->r_rsp -= sizeof (uint32_t); - ret = fasttrap_suword32(&rp->r_rbp, (void *)rp->r_rsp); + ret = fasttrap_suword32((void *)rp->r_rsp, rp->r_rbp); #endif #ifdef __amd64 } @@ -1486,13 +1486,13 @@ fasttrap_pid_probe(struct reg *rp) if (p->p_model == DATAMODEL_NATIVE) { addr = rp->r_rsp - sizeof (uintptr_t); pcps = pc + tp->ftt_size; - ret = fasttrap_sulword((void *)addr, &pcps); + ret = fasttrap_sulword((void *)addr, pcps); } else { #endif #ifdef __i386__ addr = rp->r_rsp - sizeof (uint32_t); pcps = (uint32_t)(pc + tp->ftt_size); - ret = fasttrap_suword32((void *)addr, &pcps); + ret = fasttrap_suword32((void *)addr, pcps); #endif #ifdef __amd64 } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 13:11:16 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C2D0B92F; Mon, 17 Feb 2014 13:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 93CE21FAD; Mon, 17 Feb 2014 13:11:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDBGnn052760; Mon, 17 Feb 2014 13:11:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDBGlW052565; Mon, 17 Feb 2014 13:11:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171311.s1HDBGlW052565@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:11: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: r262048 - in stable/10/sys/cddl/contrib/opensolaris/uts/common: dtrace 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:11:16 -0000 Author: avg Date: Mon Feb 17 13:11:15 2014 New Revision: 262048 URL: http://svnweb.freebsd.org/changeset/base/262048 Log: MFC r258291: change the ioctl definition so that the fasttrap ioctl handler is responsible for copying in userland data Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Feb 17 13:08:20 2014 (r262047) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Feb 17 13:11:15 2014 (r262048) @@ -2064,20 +2064,16 @@ fasttrap_ioctl(struct cdev *dev, u_long return (EAGAIN); if (cmd == FASTTRAPIOC_MAKEPROBE) { - fasttrap_probe_spec_t *uprobe = (void *)arg; + fasttrap_probe_spec_t *uprobe = *(fasttrap_probe_spec_t **)arg; fasttrap_probe_spec_t *probe; uint64_t noffs; size_t size; int ret; char *c; -#if defined(sun) if (copyin(&uprobe->ftps_noffs, &noffs, sizeof (uprobe->ftps_noffs))) return (EFAULT); -#else - noffs = uprobe->ftps_noffs; -#endif /* * Probes must have at least one tracepoint. @@ -2093,19 +2089,10 @@ fasttrap_ioctl(struct cdev *dev, u_long probe = kmem_alloc(size, KM_SLEEP); -#if defined(sun) if (copyin(uprobe, probe, size) != 0) { kmem_free(probe, size); return (EFAULT); } -#else - memcpy(probe, uprobe, sizeof(*probe)); - if (noffs > 1 && copyin(uprobe + 1, probe + 1, size) != 0) { - kmem_free(probe, size); - return (EFAULT); - } -#endif - /* * Verify that the function and module strings contain no Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Mon Feb 17 13:08:20 2014 (r262047) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Mon Feb 17 13:11:15 2014 (r262048) @@ -42,8 +42,8 @@ extern "C" { #define FASTTRAPIOC_MAKEPROBE (FASTTRAPIOC | 1) #define FASTTRAPIOC_GETINSTR (FASTTRAPIOC | 2) #else -#define FASTTRAPIOC_MAKEPROBE _IOW('f', 1, fasttrap_probe_spec_t) #define FASTTRAPIOC_GETINSTR _IOWR('f', 2, uint8_t) +#define FASTTRAPIOC_MAKEPROBE _IO('f', 3) #endif typedef enum fasttrap_probe_type { From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 13:11:28 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA9BEA5C; Mon, 17 Feb 2014 13:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9CD201FB0; Mon, 17 Feb 2014 13:11:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDBSMR054307; Mon, 17 Feb 2014 13:11:28 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDBSp8054305; Mon, 17 Feb 2014 13:11:28 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171311.s1HDBSp8054305@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:11: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: r262049 - in stable/9/sys/cddl/contrib/opensolaris/uts/common: dtrace sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:11:28 -0000 Author: avg Date: Mon Feb 17 13:11:27 2014 New Revision: 262049 URL: http://svnweb.freebsd.org/changeset/base/262049 Log: MFC r258291: change the ioctl definition so that the fasttrap ioctl handler is responsible for copying in userland data Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Feb 17 13:11:15 2014 (r262048) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Feb 17 13:11:27 2014 (r262049) @@ -2056,20 +2056,16 @@ fasttrap_ioctl(struct cdev *dev, u_long return (EAGAIN); if (cmd == FASTTRAPIOC_MAKEPROBE) { - fasttrap_probe_spec_t *uprobe = (void *)arg; + fasttrap_probe_spec_t *uprobe = *(fasttrap_probe_spec_t **)arg; fasttrap_probe_spec_t *probe; uint64_t noffs; size_t size; int ret; char *c; -#if defined(sun) if (copyin(&uprobe->ftps_noffs, &noffs, sizeof (uprobe->ftps_noffs))) return (EFAULT); -#else - noffs = uprobe->ftps_noffs; -#endif /* * Probes must have at least one tracepoint. @@ -2085,19 +2081,10 @@ fasttrap_ioctl(struct cdev *dev, u_long probe = kmem_alloc(size, KM_SLEEP); -#if defined(sun) if (copyin(uprobe, probe, size) != 0) { kmem_free(probe, size); return (EFAULT); } -#else - memcpy(probe, uprobe, sizeof(*probe)); - if (noffs > 1 && copyin(uprobe + 1, probe + 1, size) != 0) { - kmem_free(probe, size); - return (EFAULT); - } -#endif - /* * Verify that the function and module strings contain no Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Mon Feb 17 13:11:15 2014 (r262048) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fasttrap.h Mon Feb 17 13:11:27 2014 (r262049) @@ -42,8 +42,8 @@ extern "C" { #define FASTTRAPIOC_MAKEPROBE (FASTTRAPIOC | 1) #define FASTTRAPIOC_GETINSTR (FASTTRAPIOC | 2) #else -#define FASTTRAPIOC_MAKEPROBE _IOW('f', 1, fasttrap_probe_spec_t) #define FASTTRAPIOC_GETINSTR _IOWR('f', 2, uint8_t) +#define FASTTRAPIOC_MAKEPROBE _IO('f', 3) #endif typedef enum fasttrap_probe_type { From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 13:19:27 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DCCE9143; Mon, 17 Feb 2014 13:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF9C61034; Mon, 17 Feb 2014 13:19:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDJR6f055607; Mon, 17 Feb 2014 13:19:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDJRco055606; Mon, 17 Feb 2014 13:19:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171319.s1HDJRco055606@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:19: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: r262050 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:19:27 -0000 Author: avg Date: Mon Feb 17 13:19:27 2014 New Revision: 262050 URL: http://svnweb.freebsd.org/changeset/base/262050 Log: MFC r257417: Remove references to an unused fasttrap probe hook Only mergeinfo record for commit r262042 Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 13:29:49 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D502DBD; Mon, 17 Feb 2014 13:29: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 382F1114B; Mon, 17 Feb 2014 13:29:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDTnU3060034; Mon, 17 Feb 2014 13:29:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDTmCZ060027; Mon, 17 Feb 2014 13:29:48 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171329.s1HDTmCZ060027@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:29:48 +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: r262052 - in stable/9/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:29:49 -0000 Author: avg Date: Mon Feb 17 13:29:48 2014 New Revision: 262052 URL: http://svnweb.freebsd.org/changeset/base/262052 Log: MFC r252850: Hide references to mod_lock Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/9/sys/cddl/dev/dtrace/dtrace_ioctl.c stable/9/sys/cddl/dev/dtrace/dtrace_load.c stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 13:23:49 2014 (r262051) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 13:29:48 2014 (r262052) @@ -281,8 +281,6 @@ static kmutex_t dtrace_meta_lock; /* me #if !defined(sun) /* XXX FreeBSD hacks. */ -static kmutex_t mod_lock; - #define cr_suid cr_svuid #define cr_sgid cr_svgid #define ipaddr_t in_addr_t @@ -7681,7 +7679,9 @@ dtrace_unregister(dtrace_provider_id_t i } } else { mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif mutex_enter(&dtrace_lock); } @@ -7695,7 +7695,9 @@ dtrace_unregister(dtrace_provider_id_t i dtrace_anon.dta_state->dts_necbs > 0))) { if (!self) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } return (EBUSY); @@ -7729,7 +7731,9 @@ dtrace_unregister(dtrace_provider_id_t i if (!self) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } @@ -7811,7 +7815,9 @@ dtrace_unregister(dtrace_provider_id_t i if (!self) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } @@ -8131,6 +8137,7 @@ dtrace_probe_provide(dtrace_probedesc_t */ prv->dtpv_pops.dtps_provide(prv->dtpv_arg, desc); +#if defined(sun) /* * Now call the per-module provide operation. We will grab * mod_lock to prevent the list from being modified. Note @@ -8139,7 +8146,6 @@ dtrace_probe_provide(dtrace_probedesc_t */ mutex_enter(&mod_lock); -#if defined(sun) ctl = &modules; do { if (ctl->mod_busy || ctl->mod_mp == NULL) @@ -8148,9 +8154,9 @@ dtrace_probe_provide(dtrace_probedesc_t prv->dtpv_pops.dtps_provide_module(prv->dtpv_arg, ctl); } while ((ctl = ctl->mod_next) != &modules); -#endif mutex_exit(&mod_lock); +#endif } while (all && (prv = prv->dtpv_next) != NULL); } @@ -15143,7 +15149,9 @@ dtrace_module_loaded(modctl_t *ctl) dtrace_provider_t *prv; mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif #if defined(sun) ASSERT(ctl->mod_busy); @@ -15156,7 +15164,9 @@ dtrace_module_loaded(modctl_t *ctl) for (prv = dtrace_provider; prv != NULL; prv = prv->dtpv_next) prv->dtpv_pops.dtps_provide_module(prv->dtpv_arg, ctl); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); /* @@ -15218,7 +15228,9 @@ dtrace_module_unloaded(modctl_t *ctl, in #endif mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif mutex_enter(&dtrace_lock); #if !defined(sun) @@ -15239,7 +15251,9 @@ dtrace_module_unloaded(modctl_t *ctl, in * we don't have any work to do. */ mutex_exit(&dtrace_provider_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_lock); return; } @@ -15248,7 +15262,9 @@ dtrace_module_unloaded(modctl_t *ctl, in probe != NULL; probe = probe->dtpr_nextmod) { if (probe->dtpr_ecb != NULL) { mutex_exit(&dtrace_provider_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_lock); /* @@ -15320,7 +15336,9 @@ dtrace_module_unloaded(modctl_t *ctl, in } mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); } Modified: stable/9/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_ioctl.c Mon Feb 17 13:23:49 2014 (r262051) +++ stable/9/sys/cddl/dev/dtrace/dtrace_ioctl.c Mon Feb 17 13:29:48 2014 (r262052) @@ -584,19 +584,25 @@ dtrace_ioctl(struct cdev *dev, u_long cm return (EINVAL); mutex_enter(&dtrace_provider_lock); +#if defined(sun) mutex_enter(&mod_lock); +#endif mutex_enter(&dtrace_lock); if (desc->dtargd_id > dtrace_nprobes) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); return (EINVAL); } if ((probe = dtrace_probes[desc->dtargd_id - 1]) == NULL) { mutex_exit(&dtrace_lock); +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); return (EINVAL); } @@ -620,7 +626,9 @@ dtrace_ioctl(struct cdev *dev, u_long cm probe->dtpr_id, probe->dtpr_arg, desc); } +#if defined(sun) mutex_exit(&mod_lock); +#endif mutex_exit(&dtrace_provider_lock); return (0); Modified: stable/9/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:23:49 2014 (r262051) +++ stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:29:48 2014 (r262052) @@ -63,12 +63,6 @@ dtrace_load(void *dummy) dtrace_kld_unload_try, NULL, EVENTHANDLER_PRI_ANY); /* - * XXX This is a short term hack to avoid having to comment - * out lots and lots of lock/unlock calls. - */ - mutex_init(&mod_lock,"XXX mod_lock hack", MUTEX_DEFAULT, NULL); - - /* * Initialise the mutexes without 'witness' because the dtrace * code is mostly written to wait for memory. To have the * witness code change a malloc() from M_WAITOK to M_NOWAIT Modified: stable/9/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 13:23:49 2014 (r262051) +++ stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 13:29:48 2014 (r262052) @@ -127,9 +127,6 @@ dtrace_unload() mutex_destroy(&dtrace_errlock); #endif - /* XXX Hack */ - mutex_destroy(&mod_lock); - /* Reset our hook for exceptions. */ dtrace_invop_uninit(); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 13:33:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C91F24C; Mon, 17 Feb 2014 13:33: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2D89411E5; Mon, 17 Feb 2014 13:33:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDXhsH063394; Mon, 17 Feb 2014 13:33:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDXgIs063390; Mon, 17 Feb 2014 13:33:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171333.s1HDXgIs063390@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:33: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: r262053 - in stable/9/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:33:43 -0000 Author: avg Date: Mon Feb 17 13:33:42 2014 New Revision: 262053 URL: http://svnweb.freebsd.org/changeset/base/262053 Log: MFC r256148: Initialize and free the DTrace taskqueue in the dtrace module load/unload handlers Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/9/sys/cddl/dev/dtrace/dtrace_load.c stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 13:29:48 2014 (r262052) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Feb 17 13:33:42 2014 (r262053) @@ -15754,10 +15754,6 @@ dtrace_open(struct cdev *dev, int oflags #else devfs_set_cdevpriv(state, dtrace_dtr); #endif - /* This code actually belongs in dtrace_attach() */ - if (dtrace_opens == 1) - dtrace_taskq = taskq_create("dtrace_taskq", 1, maxclsyspri, - 1, INT_MAX, 0); #endif mutex_exit(&cpu_lock); @@ -15842,11 +15838,6 @@ dtrace_close(struct cdev *dev, int flags (void) kdi_dtrace_set(KDI_DTSET_DTRACE_DEACTIVATE); #else --dtrace_opens; - /* This code actually belongs in dtrace_detach() */ - if ((dtrace_opens == 0) && (dtrace_taskq != NULL)) { - taskq_destroy(dtrace_taskq); - dtrace_taskq = NULL; - } #endif mutex_exit(&dtrace_lock); Modified: stable/9/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:29:48 2014 (r262052) +++ stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:33:42 2014 (r262053) @@ -56,6 +56,8 @@ dtrace_load(void *dummy) /* Hang our hook for exceptions. */ dtrace_invop_init(); + dtrace_taskq = taskq_create("dtrace_taskq", 1, maxclsyspri, 0, 0, 0); + /* Register callbacks for linker file load and unload events. */ dtrace_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, dtrace_kld_load, NULL, EVENTHANDLER_PRI_ANY); Modified: stable/9/sys/cddl/dev/dtrace/dtrace_unload.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 13:29:48 2014 (r262052) +++ stable/9/sys/cddl/dev/dtrace/dtrace_unload.c Mon Feb 17 13:33:42 2014 (r262053) @@ -127,6 +127,8 @@ dtrace_unload() mutex_destroy(&dtrace_errlock); #endif + taskq_destroy(dtrace_taskq); + /* Reset our hook for exceptions. */ dtrace_invop_uninit(); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 13:36:36 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8A9A4631; Mon, 17 Feb 2014 13:36: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 77AD41221; Mon, 17 Feb 2014 13:36:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDaabO063878; Mon, 17 Feb 2014 13:36:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDaaj8063877; Mon, 17 Feb 2014 13:36:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171336.s1HDaaj8063877@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:36: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: r262054 - stable/10/sys/cddl/dev/dtrace X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:36:36 -0000 Author: avg Date: Mon Feb 17 13:36:35 2014 New Revision: 262054 URL: http://svnweb.freebsd.org/changeset/base/262054 Log: MFC r260132: Allocate the probe ID unrhdr before the DTrace kld_* event handlers are registered Modified: stable/10/sys/cddl/dev/dtrace/dtrace_load.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/10/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:33:42 2014 (r262053) +++ stable/10/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:36:35 2014 (r262054) @@ -58,6 +58,8 @@ dtrace_load(void *dummy) dtrace_taskq = taskq_create("dtrace_taskq", 1, maxclsyspri, 0, 0, 0); + dtrace_arena = new_unrhdr(1, INT_MAX, &dtrace_unr_mtx); + /* Register callbacks for linker file load and unload events. */ dtrace_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, dtrace_kld_load, NULL, EVENTHANDLER_PRI_ANY); @@ -85,8 +87,6 @@ dtrace_load(void *dummy) ASSERT(MUTEX_HELD(&cpu_lock)); - dtrace_arena = new_unrhdr(1, INT_MAX, &dtrace_unr_mtx); - dtrace_state_cache = kmem_cache_create("dtrace_state_cache", sizeof (dtrace_dstate_percpu_t) * NCPU, DTRACE_STATE_ALIGN, NULL, NULL, NULL, NULL, NULL, 0); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 13:36:58 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 62BF2760; Mon, 17 Feb 2014 13:36: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4EB111225; Mon, 17 Feb 2014 13:36:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDawVk063946; Mon, 17 Feb 2014 13:36:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDawJ5063945; Mon, 17 Feb 2014 13:36:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171336.s1HDawJ5063945@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:36:58 +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: r262055 - stable/9/sys/cddl/dev/dtrace X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:36:58 -0000 Author: avg Date: Mon Feb 17 13:36:57 2014 New Revision: 262055 URL: http://svnweb.freebsd.org/changeset/base/262055 Log: MFC r260132: Allocate the probe ID unrhdr before the DTrace kld_* event handlers are registered Modified: stable/9/sys/cddl/dev/dtrace/dtrace_load.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/dtrace/dtrace_load.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:36:35 2014 (r262054) +++ stable/9/sys/cddl/dev/dtrace/dtrace_load.c Mon Feb 17 13:36:57 2014 (r262055) @@ -58,6 +58,8 @@ dtrace_load(void *dummy) dtrace_taskq = taskq_create("dtrace_taskq", 1, maxclsyspri, 0, 0, 0); + dtrace_arena = new_unrhdr(1, INT_MAX, &dtrace_unr_mtx); + /* Register callbacks for linker file load and unload events. */ dtrace_kld_load_tag = EVENTHANDLER_REGISTER(kld_load, dtrace_kld_load, NULL, EVENTHANDLER_PRI_ANY); @@ -85,8 +87,6 @@ dtrace_load(void *dummy) ASSERT(MUTEX_HELD(&cpu_lock)); - dtrace_arena = new_unrhdr(1, INT_MAX, &dtrace_unr_mtx); - dtrace_state_cache = kmem_cache_create("dtrace_state_cache", sizeof (dtrace_dstate_percpu_t) * NCPU, DTRACE_STATE_ALIGN, NULL, NULL, NULL, NULL, NULL, 0); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 13:53:03 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 913FCFF3; Mon, 17 Feb 2014 13:53: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 71C0A13E0; Mon, 17 Feb 2014 13:53:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDr3Hi071295; Mon, 17 Feb 2014 13:53:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDr2NA071286; Mon, 17 Feb 2014 13:53:02 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171353.s1HDr2NA071286@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:53:02 +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: r262056 - in stable/9/sys: compat/linux security/mac X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:53:03 -0000 Author: avg Date: Mon Feb 17 13:53:01 2014 New Revision: 262056 URL: http://svnweb.freebsd.org/changeset/base/262056 Log: MFC r255971: Fix some typos that were causing probe argument types to show up as unknown MFC slacker: markj Modified: stable/9/sys/compat/linux/linux_futex.c stable/9/sys/compat/linux/linux_uid16.c stable/9/sys/security/mac/mac_framework.c stable/9/sys/security/mac/mac_internal.h stable/9/sys/security/mac/mac_posix_shm.c stable/9/sys/security/mac/mac_vfs.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/linux/linux_futex.c ============================================================================== --- stable/9/sys/compat/linux/linux_futex.c Mon Feb 17 13:36:57 2014 (r262055) +++ stable/9/sys/compat/linux/linux_futex.c Mon Feb 17 13:53:01 2014 (r262056) @@ -119,7 +119,7 @@ LIN_SDT_PROBE_DEFINE1(futex, futex_sleep LIN_SDT_PROBE_DEFINE3(futex, futex_wake, entry, "struct futex *", "int", "uint32_t"); LIN_SDT_PROBE_DEFINE3(futex, futex_wake, iterate, "uint32_t", - "struct waiting_proc *", "uin32_t"); + "struct waiting_proc *", "uint32_t"); LIN_SDT_PROBE_DEFINE1(futex, futex_wake, wakeup, "struct waiting_proc *"); LIN_SDT_PROBE_DEFINE1(futex, futex_wake, return, "int"); LIN_SDT_PROBE_DEFINE4(futex, futex_requeue, entry, "struct futex *", "int", Modified: stable/9/sys/compat/linux/linux_uid16.c ============================================================================== --- stable/9/sys/compat/linux/linux_uid16.c Mon Feb 17 13:36:57 2014 (r262055) +++ stable/9/sys/compat/linux/linux_uid16.c Mon Feb 17 13:53:01 2014 (r262056) @@ -87,7 +87,7 @@ LIN_SDT_PROBE_DEFINE1(uid16, linux_setgi LIN_SDT_PROBE_DEFINE1(uid16, linux_setgid16, return, "int"); LIN_SDT_PROBE_DEFINE1(uid16, linux_setuid16, entry, "l_uid16_t"); LIN_SDT_PROBE_DEFINE1(uid16, linux_setuid16, return, "int"); -LIN_SDT_PROBE_DEFINE2(uid16, linux_setregid16, entry, "l_git16_t", "l_git16_t"); +LIN_SDT_PROBE_DEFINE2(uid16, linux_setregid16, entry, "l_gid16_t", "l_gid16_t"); LIN_SDT_PROBE_DEFINE1(uid16, linux_setregid16, return, "int"); LIN_SDT_PROBE_DEFINE2(uid16, linux_setreuid16, entry, "l_uid16_t", "l_uid16_t"); LIN_SDT_PROBE_DEFINE1(uid16, linux_setreuid16, return, "int"); Modified: stable/9/sys/security/mac/mac_framework.c ============================================================================== --- stable/9/sys/security/mac/mac_framework.c Mon Feb 17 13:36:57 2014 (r262055) +++ stable/9/sys/security/mac/mac_framework.c Mon Feb 17 13:53:01 2014 (r262056) @@ -95,7 +95,7 @@ SDT_PROVIDER_DEFINE(mac); SDT_PROVIDER_DEFINE(mac_framework); SDT_PROBE_DEFINE2(mac, kernel, policy, modevent, modevent, "int", - "struct mac_policy_conf *mpc"); + "struct mac_policy_conf *"); SDT_PROBE_DEFINE1(mac, kernel, policy, register, register, "struct mac_policy_conf *"); SDT_PROBE_DEFINE1(mac, kernel, policy, unregister, unregister, Modified: stable/9/sys/security/mac/mac_internal.h ============================================================================== --- stable/9/sys/security/mac/mac_internal.h Mon Feb 17 13:36:57 2014 (r262055) +++ stable/9/sys/security/mac/mac_internal.h Mon Feb 17 13:53:01 2014 (r262056) @@ -119,7 +119,7 @@ SDT_PROVIDER_DECLARE(mac_framework); /* SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_grant_err, \ mac-grant-err, "int", arg0, arg1); \ SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_grant_ok, \ - mac-grant-ok, "INT", arg0, arg1); + mac-grant-ok, "int", arg0, arg1); #define MAC_GRANT_PROBE2(name, error, arg0, arg1) do { \ if (error) { \ Modified: stable/9/sys/security/mac/mac_posix_shm.c ============================================================================== --- stable/9/sys/security/mac/mac_posix_shm.c Mon Feb 17 13:36:57 2014 (r262055) +++ stable/9/sys/security/mac/mac_posix_shm.c Mon Feb 17 13:53:01 2014 (r262056) @@ -133,7 +133,7 @@ mac_posixshm_check_mmap(struct ucred *cr } MAC_CHECK_PROBE_DEFINE3(posixshm_check_open, "struct ucred *", - "struct shmfd *", "accmode_t accmode"); + "struct shmfd *", "accmode_t"); int mac_posixshm_check_open(struct ucred *cred, struct shmfd *shmfd, Modified: stable/9/sys/security/mac/mac_vfs.c ============================================================================== --- stable/9/sys/security/mac/mac_vfs.c Mon Feb 17 13:36:57 2014 (r262055) +++ stable/9/sys/security/mac/mac_vfs.c Mon Feb 17 13:53:01 2014 (r262056) @@ -783,7 +783,7 @@ mac_vnode_check_revoke(struct ucred *cre } MAC_CHECK_PROBE_DEFINE4(vnode_check_setacl, "struct ucred *", - "struct vnode *", "acl_tpe_t", "struct acl *"); + "struct vnode *", "acl_type_t", "struct acl *"); int mac_vnode_check_setacl(struct ucred *cred, struct vnode *vp, acl_type_t type, From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 13:58:57 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C1F92F5; Mon, 17 Feb 2014 13:58: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 437A91473; Mon, 17 Feb 2014 13:58:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HDwvjN072099; Mon, 17 Feb 2014 13:58:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HDwpZn072062; Mon, 17 Feb 2014 13:58:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171358.s1HDwpZn072062@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 13:58: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: r262057 - in stable/9/sys: cam/ctl cddl/dev/dtrace cddl/dev/sdt compat/linux dev/xen/blkback kern net netinet opencrypto security/mac sys tools X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 13:58:57 -0000 Author: avg Date: Mon Feb 17 13:58:50 2014 New Revision: 262057 URL: http://svnweb.freebsd.org/changeset/base/262057 Log: MFC r258622,258675: dtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE Modified: stable/9/sys/cam/ctl/ctl_backend_block.c stable/9/sys/cddl/dev/dtrace/dtrace_test.c stable/9/sys/cddl/dev/sdt/sdt.c stable/9/sys/compat/linux/linux_dtrace.h stable/9/sys/dev/xen/blkback/blkback.c stable/9/sys/kern/kern_clock.c stable/9/sys/kern/kern_exec.c stable/9/sys/kern/kern_exit.c stable/9/sys/kern/kern_fork.c stable/9/sys/kern/kern_priv.c stable/9/sys/kern/kern_proc.c stable/9/sys/kern/kern_racct.c stable/9/sys/kern/kern_sig.c stable/9/sys/kern/kern_synch.c stable/9/sys/kern/kern_thread.c stable/9/sys/kern/kern_timeout.c stable/9/sys/kern/sched_4bsd.c stable/9/sys/kern/sched_ule.c stable/9/sys/kern/subr_devstat.c stable/9/sys/kern/subr_turnstile.c stable/9/sys/kern/vfs_cache.c stable/9/sys/kern/vfs_lookup.c stable/9/sys/kern/vfs_syscalls.c stable/9/sys/net/vnet.c stable/9/sys/netinet/sctp_dtrace_define.h stable/9/sys/opencrypto/deflate.c stable/9/sys/security/mac/mac_framework.c stable/9/sys/security/mac/mac_internal.h stable/9/sys/sys/sdt.h stable/9/sys/tools/vnode_if.awk Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_block.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/cam/ctl/ctl_backend_block.c Mon Feb 17 13:58:50 2014 (r262057) @@ -634,10 +634,10 @@ ctl_be_block_flush_file(struct ctl_be_bl ctl_complete_beio(beio); } -SDT_PROBE_DEFINE1(cbb, kernel, read, file_start, file_start, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, write, file_start, file_start, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, read, file_done, file_done,"uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, write, file_done, file_done, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, read, file_start, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, write, file_start, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, read, file_done,"uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, write, file_done, "uint64_t"); static void ctl_be_block_dispatch_file(struct ctl_be_block_lun *be_lun, @@ -968,10 +968,10 @@ ctl_be_block_cw_dispatch(struct ctl_be_b } } -SDT_PROBE_DEFINE1(cbb, kernel, read, start, start, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, write, start, start, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, read, alloc_done, alloc_done, "uint64_t"); -SDT_PROBE_DEFINE1(cbb, kernel, write, alloc_done, alloc_done, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, read, start, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, write, start, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, read, alloc_done, "uint64_t"); +SDT_PROBE_DEFINE1(cbb, kernel, write, alloc_done, "uint64_t"); static void ctl_be_block_dispatch(struct ctl_be_block_lun *be_lun, Modified: stable/9/sys/cddl/dev/dtrace/dtrace_test.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/dtrace_test.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/cddl/dev/dtrace/dtrace_test.c Mon Feb 17 13:58:50 2014 (r262057) @@ -41,7 +41,7 @@ SDT_PROVIDER_DEFINE(test); -SDT_PROBE_DEFINE7(test, , , sdttest, sdttest, "int", "int", "int", "int", "int", +SDT_PROBE_DEFINE7(test, , , sdttest, "int", "int", "int", "int", "int", "int", "int"); /* Modified: stable/9/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/cddl/dev/sdt/sdt.c Mon Feb 17 13:58:50 2014 (r262057) @@ -138,6 +138,8 @@ sdt_create_probe(struct sdt_probe *probe char mod[DTRACE_MODNAMELEN]; char func[DTRACE_FUNCNAMELEN]; char name[DTRACE_NAMELEN]; + const char *from; + char *to; size_t len; TAILQ_FOREACH(prov, &sdt_prov_list, prov_entry) @@ -161,7 +163,18 @@ sdt_create_probe(struct sdt_probe *probe * in the C compiler, so we have to respect const vs non-const. */ strlcpy(func, probe->func, sizeof(func)); - strlcpy(name, probe->name, sizeof(name)); + + from = probe->name; + to = name; + for (len = 0; len < (sizeof(name) - 1) && *from != '\0'; + len++, from++, to++) { + if (from[0] == '_' && from[1] == '_') { + *to = '-'; + from++; + } else + *to = *from; + } + *to = '\0'; if (dtrace_probe_lookup(prov->id, mod, func, name) != DTRACE_IDNONE) return; Modified: stable/9/sys/compat/linux/linux_dtrace.h ============================================================================== --- stable/9/sys/compat/linux/linux_dtrace.h Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/compat/linux/linux_dtrace.h Mon Feb 17 13:58:50 2014 (r262057) @@ -48,27 +48,27 @@ LINUX_DTRACE, a, b, c) #define _LIN_SDT_PROBE_DEFINE0(a, b, c, d) SDT_PROBE_DEFINE(a, \ - b, c, d, d) + b, c, d) #define LIN_SDT_PROBE_DEFINE0(a, b, c) _LIN_SDT_PROBE_DEFINE0(\ LINUX_DTRACE, a, b, c) #define _LIN_SDT_PROBE_DEFINE1(a, b, c, d, e) SDT_PROBE_DEFINE1(a, \ - b, c, d, d, e) + b, c, d, e) #define LIN_SDT_PROBE_DEFINE1(a, b, c, d) _LIN_SDT_PROBE_DEFINE1(\ LINUX_DTRACE, a, b, c, d) #define _LIN_SDT_PROBE_DEFINE2(a, b, c, d, e, f) SDT_PROBE_DEFINE2(a, \ - b, c, d, d, e, f) + b, c, d, e, f) #define LIN_SDT_PROBE_DEFINE2(a, b, c, d, e) _LIN_SDT_PROBE_DEFINE2(\ LINUX_DTRACE, a, b, c, d, e) #define _LIN_SDT_PROBE_DEFINE3(a, b, c, d, e, f, g) SDT_PROBE_DEFINE3(a, \ - b, c, d, d, e, f, g) + b, c, d, e, f, g) #define LIN_SDT_PROBE_DEFINE3(a, b, c, d, e, f) _LIN_SDT_PROBE_DEFINE3(\ LINUX_DTRACE, a, b, c, d, e, f) #define _LIN_SDT_PROBE_DEFINE4(a, b, c, d, e, f, g, h) SDT_PROBE_DEFINE4(a, \ - b, c, d, d, e, f, g, h) + b, c, d, e, f, g, h) #define LIN_SDT_PROBE_DEFINE4(a, b, c, d, e, f, g) _LIN_SDT_PROBE_DEFINE4(\ LINUX_DTRACE, a, b, c, d, e, f, g) #define _LIN_SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h, i) \ - SDT_PROBE_DEFINE5(a, b, c, d, d, e, f, g, h, i) + SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h, i) #define LIN_SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h) _LIN_SDT_PROBE_DEFINE5(\ LINUX_DTRACE, a, b, c, d, e, f, g, h) Modified: stable/9/sys/dev/xen/blkback/blkback.c ============================================================================== --- stable/9/sys/dev/xen/blkback/blkback.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/dev/xen/blkback/blkback.c Mon Feb 17 13:58:50 2014 (r262057) @@ -2037,10 +2037,10 @@ xbb_intr(void *arg) } SDT_PROVIDER_DEFINE(xbb); -SDT_PROBE_DEFINE1(xbb, kernel, xbb_dispatch_dev, flush, flush, "int"); -SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_dev, read, read, "int", "uint64_t", +SDT_PROBE_DEFINE1(xbb, kernel, xbb_dispatch_dev, flush, "int"); +SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_dev, read, "int", "uint64_t", "uint64_t"); -SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_dev, write, write, "int", +SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_dev, write, "int", "uint64_t", "uint64_t"); /*----------------------------- Backend Handlers -----------------------------*/ @@ -2218,10 +2218,10 @@ fail_free_bios: return (error); } -SDT_PROBE_DEFINE1(xbb, kernel, xbb_dispatch_file, flush, flush, "int"); -SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_file, read, read, "int", "uint64_t", +SDT_PROBE_DEFINE1(xbb, kernel, xbb_dispatch_file, flush, "int"); +SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_file, read, "int", "uint64_t", "uint64_t"); -SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_file, write, write, "int", +SDT_PROBE_DEFINE3(xbb, kernel, xbb_dispatch_file, write, "int", "uint64_t", "uint64_t"); /** Modified: stable/9/sys/kern/kern_clock.c ============================================================================== --- stable/9/sys/kern/kern_clock.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_clock.c Mon Feb 17 13:58:50 2014 (r262057) @@ -93,7 +93,7 @@ SYSINIT(clocks, SI_SUB_CLOCKS, SI_ORDER_ static struct mtx time_lock; SDT_PROVIDER_DECLARE(sched); -SDT_PROBE_DEFINE2(sched, , , tick, tick, "struct thread *", "struct proc *"); +SDT_PROBE_DEFINE2(sched, , , tick, "struct thread *", "struct proc *"); static int sysctl_kern_cp_time(SYSCTL_HANDLER_ARGS) Modified: stable/9/sys/kern/kern_exec.c ============================================================================== --- stable/9/sys/kern/kern_exec.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_exec.c Mon Feb 17 13:58:50 2014 (r262057) @@ -95,9 +95,9 @@ dtrace_execexit_func_t dtrace_fasttrap_e #endif SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE1(proc, kernel, , exec, exec, "char *"); -SDT_PROBE_DEFINE1(proc, kernel, , exec_failure, exec-failure, "int"); -SDT_PROBE_DEFINE1(proc, kernel, , exec_success, exec-success, "char *"); +SDT_PROBE_DEFINE1(proc, kernel, , exec, "char *"); +SDT_PROBE_DEFINE1(proc, kernel, , exec__failure, "int"); +SDT_PROBE_DEFINE1(proc, kernel, , exec__success, "char *"); MALLOC_DEFINE(M_PARGS, "proc-args", "Process arguments"); @@ -839,7 +839,7 @@ interpret: vfs_mark_atime(imgp->vp, td->td_ucred); - SDT_PROBE(proc, kernel, , exec_success, args->fname, 0, 0, 0, 0); + SDT_PROBE(proc, kernel, , exec__success, args->fname, 0, 0, 0, 0); done1: /* @@ -921,7 +921,7 @@ exec_fail: p->p_flag &= ~P_INEXEC; PROC_UNLOCK(p); - SDT_PROBE(proc, kernel, , exec_failure, error, 0, 0, 0, 0); + SDT_PROBE(proc, kernel, , exec__failure, error, 0, 0, 0, 0); done2: #ifdef MAC Modified: stable/9/sys/kern/kern_exit.c ============================================================================== --- stable/9/sys/kern/kern_exit.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_exit.c Mon Feb 17 13:58:50 2014 (r262057) @@ -94,7 +94,7 @@ dtrace_execexit_func_t dtrace_fasttrap_e #endif SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE1(proc, kernel, , exit, exit, "int"); +SDT_PROBE_DEFINE1(proc, kernel, , exit, "int"); /* Hook for NFS teardown procedure. */ void (*nlminfo_release_p)(struct proc *p); Modified: stable/9/sys/kern/kern_fork.c ============================================================================== --- stable/9/sys/kern/kern_fork.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_fork.c Mon Feb 17 13:58:50 2014 (r262057) @@ -89,7 +89,7 @@ dtrace_fork_func_t dtrace_fasttrap_fork; #endif SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE3(proc, kernel, , create, create, "struct proc *", +SDT_PROBE_DEFINE3(proc, kernel, , create, "struct proc *", "struct proc *", "int"); #ifndef _SYS_SYSPROTO_H_ Modified: stable/9/sys/kern/kern_priv.c ============================================================================== --- stable/9/sys/kern/kern_priv.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_priv.c Mon Feb 17 13:58:50 2014 (r262057) @@ -65,8 +65,8 @@ SYSCTL_INT(_security_bsd, OID_AUTO, unpr TUNABLE_INT("security.bsd.unprivileged_mlock", &unprivileged_mlock); SDT_PROVIDER_DEFINE(priv); -SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_ok, priv-ok, "int"); -SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv_err, priv-err, "int"); +SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv__ok, "int"); +SDT_PROBE_DEFINE1(priv, kernel, priv_check, priv__err, "int"); /* * Check a credential for privilege. Lots of good reasons to deny privilege; @@ -160,9 +160,9 @@ priv_check_cred(struct ucred *cred, int error = EPERM; out: if (error) - SDT_PROBE1(priv, kernel, priv_check, priv_err, priv); + SDT_PROBE1(priv, kernel, priv_check, priv__err, priv); else - SDT_PROBE1(priv, kernel, priv_check, priv_ok, priv); + SDT_PROBE1(priv, kernel, priv_check, priv__ok, priv); return (error); } Modified: stable/9/sys/kern/kern_proc.c ============================================================================== --- stable/9/sys/kern/kern_proc.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_proc.c Mon Feb 17 13:58:50 2014 (r262057) @@ -91,17 +91,17 @@ __FBSDID("$FreeBSD$"); #endif SDT_PROVIDER_DEFINE(proc); -SDT_PROBE_DEFINE4(proc, kernel, ctor, entry, entry, "struct proc *", "int", +SDT_PROBE_DEFINE4(proc, kernel, ctor, entry, "struct proc *", "int", "void *", "int"); -SDT_PROBE_DEFINE4(proc, kernel, ctor, return, return, "struct proc *", "int", +SDT_PROBE_DEFINE4(proc, kernel, ctor, return, "struct proc *", "int", "void *", "int"); -SDT_PROBE_DEFINE4(proc, kernel, dtor, entry, entry, "struct proc *", "int", +SDT_PROBE_DEFINE4(proc, kernel, dtor, entry, "struct proc *", "int", "void *", "struct thread *"); -SDT_PROBE_DEFINE3(proc, kernel, dtor, return, return, "struct proc *", "int", +SDT_PROBE_DEFINE3(proc, kernel, dtor, return, "struct proc *", "int", "void *"); -SDT_PROBE_DEFINE3(proc, kernel, init, entry, entry, "struct proc *", "int", +SDT_PROBE_DEFINE3(proc, kernel, init, entry, "struct proc *", "int", "int"); -SDT_PROBE_DEFINE3(proc, kernel, init, return, return, "struct proc *", "int", +SDT_PROBE_DEFINE3(proc, kernel, init, return, "struct proc *", "int", "int"); MALLOC_DEFINE(M_PGRP, "pgrp", "process group header"); Modified: stable/9/sys/kern/kern_racct.c ============================================================================== --- stable/9/sys/kern/kern_racct.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_racct.c Mon Feb 17 13:58:50 2014 (r262057) @@ -96,29 +96,29 @@ static void racct_add_cred_locked(struct uint64_t amount); SDT_PROVIDER_DEFINE(racct); -SDT_PROBE_DEFINE3(racct, kernel, rusage, add, add, "struct proc *", "int", +SDT_PROBE_DEFINE3(racct, kernel, rusage, add, "struct proc *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, add_failure, add-failure, +SDT_PROBE_DEFINE3(racct, kernel, rusage, add__failure, "struct proc *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, add_cred, add-cred, "struct ucred *", +SDT_PROBE_DEFINE3(racct, kernel, rusage, add__cred, "struct ucred *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, add_force, add-force, "struct proc *", +SDT_PROBE_DEFINE3(racct, kernel, rusage, add__force, "struct proc *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, set, set, "struct proc *", "int", +SDT_PROBE_DEFINE3(racct, kernel, rusage, set, "struct proc *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, set_failure, set-failure, +SDT_PROBE_DEFINE3(racct, kernel, rusage, set__failure, "struct proc *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, sub, sub, "struct proc *", "int", +SDT_PROBE_DEFINE3(racct, kernel, rusage, sub, "struct proc *", "int", "uint64_t"); -SDT_PROBE_DEFINE3(racct, kernel, rusage, sub_cred, sub-cred, "struct ucred *", +SDT_PROBE_DEFINE3(racct, kernel, rusage, sub__cred, "struct ucred *", "int", "uint64_t"); -SDT_PROBE_DEFINE1(racct, kernel, racct, create, create, "struct racct *"); -SDT_PROBE_DEFINE1(racct, kernel, racct, destroy, destroy, "struct racct *"); -SDT_PROBE_DEFINE2(racct, kernel, racct, join, join, "struct racct *", +SDT_PROBE_DEFINE1(racct, kernel, racct, create, "struct racct *"); +SDT_PROBE_DEFINE1(racct, kernel, racct, destroy, "struct racct *"); +SDT_PROBE_DEFINE2(racct, kernel, racct, join, "struct racct *", "struct racct *"); -SDT_PROBE_DEFINE2(racct, kernel, racct, join_failure, join-failure, +SDT_PROBE_DEFINE2(racct, kernel, racct, join__failure, "struct racct *", "struct racct *"); -SDT_PROBE_DEFINE2(racct, kernel, racct, leave, leave, "struct racct *", +SDT_PROBE_DEFINE2(racct, kernel, racct, leave, "struct racct *", "struct racct *"); int racct_types[] = { @@ -527,7 +527,7 @@ racct_add_locked(struct proc *p, int res #ifdef RCTL error = rctl_enforce(p, resource, amount); if (error && RACCT_IS_DENIABLE(resource)) { - SDT_PROBE(racct, kernel, rusage, add_failure, p, resource, + SDT_PROBE(racct, kernel, rusage, add__failure, p, resource, amount, 0, 0); return (error); } @@ -558,7 +558,7 @@ racct_add_cred_locked(struct ucred *cred { struct prison *pr; - SDT_PROBE(racct, kernel, rusage, add_cred, cred, resource, amount, + SDT_PROBE(racct, kernel, rusage, add__cred, cred, resource, amount, 0, 0); racct_alloc_resource(cred->cr_ruidinfo->ui_racct, resource, amount); @@ -591,7 +591,7 @@ void racct_add_force(struct proc *p, int resource, uint64_t amount) { - SDT_PROBE(racct, kernel, rusage, add_force, p, resource, amount, 0, 0); + SDT_PROBE(racct, kernel, rusage, add__force, p, resource, amount, 0, 0); /* * We need proc lock to dereference p->p_ucred. @@ -645,7 +645,7 @@ racct_set_locked(struct proc *p, int res if (diff_proc > 0) { error = rctl_enforce(p, resource, diff_proc); if (error && RACCT_IS_DENIABLE(resource)) { - SDT_PROBE(racct, kernel, rusage, set_failure, p, + SDT_PROBE(racct, kernel, rusage, set__failure, p, resource, amount, 0, 0); return (error); } @@ -805,7 +805,7 @@ racct_sub_cred_locked(struct ucred *cred { struct prison *pr; - SDT_PROBE(racct, kernel, rusage, sub_cred, cred, resource, amount, + SDT_PROBE(racct, kernel, rusage, sub__cred, cred, resource, amount, 0, 0); #ifdef notyet Modified: stable/9/sys/kern/kern_sig.c ============================================================================== --- stable/9/sys/kern/kern_sig.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_sig.c Mon Feb 17 13:58:50 2014 (r262057) @@ -93,11 +93,11 @@ __FBSDID("$FreeBSD$"); #define ONSIG 32 /* NSIG for osig* syscalls. XXX. */ SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE3(proc, kernel, , signal_send, signal-send, "struct thread *", +SDT_PROBE_DEFINE3(proc, kernel, , signal__send, "struct thread *", "struct proc *", "int"); -SDT_PROBE_DEFINE2(proc, kernel, , signal_clear, signal-clear, "int", +SDT_PROBE_DEFINE2(proc, kernel, , signal__clear, "int", "ksiginfo_t *"); -SDT_PROBE_DEFINE3(proc, kernel, , signal_discard, signal-discard, +SDT_PROBE_DEFINE3(proc, kernel, , signal__discard, "struct thread *", "struct proc *", "int"); static int coredump(struct thread *); @@ -1252,7 +1252,7 @@ kern_sigtimedwait(struct thread *td, sig reschedule_signals(p, new_block, 0); if (error == 0) { - SDT_PROBE(proc, kernel, , signal_clear, sig, ksi, 0, 0, 0); + SDT_PROBE(proc, kernel, , signal__clear, sig, ksi, 0, 0, 0); if (ksi->ksi_code == SI_TIMER) itimer_accept(p, ksi->ksi_timerid, ksi); @@ -2053,7 +2053,7 @@ tdsendsignal(struct proc *p, struct thre sigqueue = &td->td_sigqueue; } - SDT_PROBE(proc, kernel, , signal_send, td, p, sig, 0, 0 ); + SDT_PROBE(proc, kernel, , signal__send, td, p, sig, 0, 0 ); /* * If the signal is being ignored, @@ -2064,7 +2064,7 @@ tdsendsignal(struct proc *p, struct thre */ mtx_lock(&ps->ps_mtx); if (SIGISMEMBER(ps->ps_sigignore, sig)) { - SDT_PROBE(proc, kernel, , signal_discard, td, p, sig, 0, 0 ); + SDT_PROBE(proc, kernel, , signal__discard, td, p, sig, 0, 0 ); mtx_unlock(&ps->ps_mtx); if (ksi && (ksi->ksi_flags & KSI_INS)) Modified: stable/9/sys/kern/kern_synch.c ============================================================================== --- stable/9/sys/kern/kern_synch.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_synch.c Mon Feb 17 13:58:50 2014 (r262057) @@ -108,18 +108,18 @@ SYSCTL_INT(_kern, OID_AUTO, fscale, CTLF static void loadav(void *arg); SDT_PROVIDER_DECLARE(sched); -SDT_PROBE_DEFINE(sched, , , preempt, preempt); +SDT_PROBE_DEFINE(sched, , , preempt); /* * These probes reference Solaris features that are not implemented in FreeBSD. * Create the probes anyway for compatibility with existing D scripts; they'll * just never fire. */ -SDT_PROBE_DEFINE(sched, , , cpucaps_sleep, cpucaps-sleep); -SDT_PROBE_DEFINE(sched, , , cpucaps_wakeup, cpucaps-wakeup); -SDT_PROBE_DEFINE(sched, , , schedctl_nopreempt, schedctl-nopreempt); -SDT_PROBE_DEFINE(sched, , , schedctl_preempt, schedctl-preempt); -SDT_PROBE_DEFINE(sched, , , schedctl_yield, schedctl-yield); +SDT_PROBE_DEFINE(sched, , , cpucaps__sleep); +SDT_PROBE_DEFINE(sched, , , cpucaps__wakeup); +SDT_PROBE_DEFINE(sched, , , schedctl__nopreempt); +SDT_PROBE_DEFINE(sched, , , schedctl__preempt); +SDT_PROBE_DEFINE(sched, , , schedctl__yield); void sleepinit(void) Modified: stable/9/sys/kern/kern_thread.c ============================================================================== --- stable/9/sys/kern/kern_thread.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_thread.c Mon Feb 17 13:58:50 2014 (r262057) @@ -63,7 +63,7 @@ __FBSDID("$FreeBSD$"); #include SDT_PROVIDER_DECLARE(proc); -SDT_PROBE_DEFINE(proc, , , lwp_exit, lwp-exit); +SDT_PROBE_DEFINE(proc, , , lwp__exit); /* Modified: stable/9/sys/kern/kern_timeout.c ============================================================================== --- stable/9/sys/kern/kern_timeout.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/kern_timeout.c Mon Feb 17 13:58:50 2014 (r262057) @@ -61,9 +61,9 @@ __FBSDID("$FreeBSD$"); #endif SDT_PROVIDER_DEFINE(callout_execute); -SDT_PROBE_DEFINE1(callout_execute, kernel, , callout_start, callout-start, +SDT_PROBE_DEFINE1(callout_execute, kernel, , callout__start, "struct callout *"); -SDT_PROBE_DEFINE1(callout_execute, kernel, , callout_end, callout-end, +SDT_PROBE_DEFINE1(callout_execute, kernel, , callout__end, "struct callout *"); static int avg_depth; @@ -514,9 +514,9 @@ softclock_call_cc(struct callout *c, str binuptime(&bt1); #endif THREAD_NO_SLEEPING(); - SDT_PROBE(callout_execute, kernel, , callout_start, c, 0, 0, 0, 0); + SDT_PROBE(callout_execute, kernel, , callout__start, c, 0, 0, 0, 0); c_func(c_arg); - SDT_PROBE(callout_execute, kernel, , callout_end, c, 0, 0, 0, 0); + SDT_PROBE(callout_execute, kernel, , callout__end, c, 0, 0, 0, 0); THREAD_SLEEPING_OK(); #ifdef DIAGNOSTIC binuptime(&bt2); Modified: stable/9/sys/kern/sched_4bsd.c ============================================================================== --- stable/9/sys/kern/sched_4bsd.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/sched_4bsd.c Mon Feb 17 13:58:50 2014 (r262057) @@ -255,20 +255,20 @@ SYSCTL_INT(_kern_sched, OID_AUTO, follow SDT_PROVIDER_DEFINE(sched); -SDT_PROBE_DEFINE3(sched, , , change_pri, change-pri, "struct thread *", +SDT_PROBE_DEFINE3(sched, , , change__pri, "struct thread *", "struct proc *", "uint8_t"); -SDT_PROBE_DEFINE3(sched, , , dequeue, dequeue, "struct thread *", +SDT_PROBE_DEFINE3(sched, , , dequeue, "struct thread *", "struct proc *", "void *"); -SDT_PROBE_DEFINE4(sched, , , enqueue, enqueue, "struct thread *", +SDT_PROBE_DEFINE4(sched, , , enqueue, "struct thread *", "struct proc *", "void *", "int"); -SDT_PROBE_DEFINE4(sched, , , lend_pri, lend-pri, "struct thread *", +SDT_PROBE_DEFINE4(sched, , , lend__pri, "struct thread *", "struct proc *", "uint8_t", "struct thread *"); -SDT_PROBE_DEFINE2(sched, , , load_change, load-change, "int", "int"); -SDT_PROBE_DEFINE2(sched, , , off_cpu, off-cpu, "struct thread *", +SDT_PROBE_DEFINE2(sched, , , load__change, "int", "int"); +SDT_PROBE_DEFINE2(sched, , , off__cpu, "struct thread *", "struct proc *"); -SDT_PROBE_DEFINE(sched, , , on_cpu, on-cpu); -SDT_PROBE_DEFINE(sched, , , remain_cpu, remain-cpu); -SDT_PROBE_DEFINE2(sched, , , surrender, surrender, "struct thread *", +SDT_PROBE_DEFINE(sched, , , on__cpu); +SDT_PROBE_DEFINE(sched, , , remain__cpu); +SDT_PROBE_DEFINE2(sched, , , surrender, "struct thread *", "struct proc *"); static __inline void @@ -277,7 +277,7 @@ sched_load_add(void) sched_tdcnt++; KTR_COUNTER0(KTR_SCHED, "load", "global load", sched_tdcnt); - SDT_PROBE2(sched, , , load_change, NOCPU, sched_tdcnt); + SDT_PROBE2(sched, , , load__change, NOCPU, sched_tdcnt); } static __inline void @@ -286,7 +286,7 @@ sched_load_rem(void) sched_tdcnt--; KTR_COUNTER0(KTR_SCHED, "load", "global load", sched_tdcnt); - SDT_PROBE2(sched, , , load_change, NOCPU, sched_tdcnt); + SDT_PROBE2(sched, , , load__change, NOCPU, sched_tdcnt); } /* * Arrange to reschedule if necessary, taking the priorities and @@ -836,12 +836,12 @@ sched_priority(struct thread *td, u_char KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "priority change", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(curthread)); - SDT_PROBE3(sched, , , change_pri, td, td->td_proc, prio); + SDT_PROBE3(sched, , , change__pri, td, td->td_proc, prio); if (td != curthread && prio > td->td_priority) { KTR_POINT3(KTR_SCHED, "thread", sched_tdname(curthread), "lend prio", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(td)); - SDT_PROBE4(sched, , , lend_pri, td, td->td_proc, prio, + SDT_PROBE4(sched, , , lend__pri, td, td->td_proc, prio, curthread); } THREAD_LOCK_ASSERT(td, MA_OWNED); @@ -1033,7 +1033,7 @@ sched_switch(struct thread *td, struct t PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif - SDT_PROBE2(sched, , , off_cpu, newtd, newtd->td_proc); + SDT_PROBE2(sched, , , off__cpu, newtd, newtd->td_proc); /* I feel sleepy */ lock_profile_release_lock(&sched_lock.lock_object); @@ -1067,13 +1067,13 @@ sched_switch(struct thread *td, struct t * need to reap it. */ - SDT_PROBE0(sched, , , on_cpu); + SDT_PROBE0(sched, , , on__cpu); #ifdef HWPMC_HOOKS if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_IN); #endif } else - SDT_PROBE0(sched, , , remain_cpu); + SDT_PROBE0(sched, , , remain__cpu); #ifdef SMP if (td->td_flags & TDF_IDLETD) Modified: stable/9/sys/kern/sched_ule.c ============================================================================== --- stable/9/sys/kern/sched_ule.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/sched_ule.c Mon Feb 17 13:58:50 2014 (r262057) @@ -333,20 +333,20 @@ SYSINIT(sched_initticks, SI_SUB_CLOCKS, SDT_PROVIDER_DEFINE(sched); -SDT_PROBE_DEFINE3(sched, , , change_pri, change-pri, "struct thread *", +SDT_PROBE_DEFINE3(sched, , , change__pri, "struct thread *", "struct proc *", "uint8_t"); -SDT_PROBE_DEFINE3(sched, , , dequeue, dequeue, "struct thread *", +SDT_PROBE_DEFINE3(sched, , , dequeue, "struct thread *", "struct proc *", "void *"); -SDT_PROBE_DEFINE4(sched, , , enqueue, enqueue, "struct thread *", +SDT_PROBE_DEFINE4(sched, , , enqueue, "struct thread *", "struct proc *", "void *", "int"); -SDT_PROBE_DEFINE4(sched, , , lend_pri, lend-pri, "struct thread *", +SDT_PROBE_DEFINE4(sched, , , lend__pri, "struct thread *", "struct proc *", "uint8_t", "struct thread *"); -SDT_PROBE_DEFINE2(sched, , , load_change, load-change, "int", "int"); -SDT_PROBE_DEFINE2(sched, , , off_cpu, off-cpu, "struct thread *", +SDT_PROBE_DEFINE2(sched, , , load__change, "int", "int"); +SDT_PROBE_DEFINE2(sched, , , off__cpu, "struct thread *", "struct proc *"); -SDT_PROBE_DEFINE(sched, , , on_cpu, on-cpu); -SDT_PROBE_DEFINE(sched, , , remain_cpu, remain-cpu); -SDT_PROBE_DEFINE2(sched, , , surrender, surrender, "struct thread *", +SDT_PROBE_DEFINE(sched, , , on__cpu); +SDT_PROBE_DEFINE(sched, , , remain__cpu); +SDT_PROBE_DEFINE2(sched, , , surrender, "struct thread *", "struct proc *"); /* @@ -531,7 +531,7 @@ tdq_load_add(struct tdq *tdq, struct thr if ((td->td_flags & TDF_NOLOAD) == 0) tdq->tdq_sysload++; KTR_COUNTER0(KTR_SCHED, "load", tdq->tdq_loadname, tdq->tdq_load); - SDT_PROBE2(sched, , , load_change, (int)TDQ_ID(tdq), tdq->tdq_load); + SDT_PROBE2(sched, , , load__change, (int)TDQ_ID(tdq), tdq->tdq_load); } /* @@ -551,7 +551,7 @@ tdq_load_rem(struct tdq *tdq, struct thr if ((td->td_flags & TDF_NOLOAD) == 0) tdq->tdq_sysload--; KTR_COUNTER0(KTR_SCHED, "load", tdq->tdq_loadname, tdq->tdq_load); - SDT_PROBE2(sched, , , load_change, (int)TDQ_ID(tdq), tdq->tdq_load); + SDT_PROBE2(sched, , , load__change, (int)TDQ_ID(tdq), tdq->tdq_load); } /* @@ -1622,12 +1622,12 @@ sched_thread_priority(struct thread *td, KTR_POINT3(KTR_SCHED, "thread", sched_tdname(td), "prio", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(curthread)); - SDT_PROBE3(sched, , , change_pri, td, td->td_proc, prio); + SDT_PROBE3(sched, , , change__pri, td, td->td_proc, prio); if (td != curthread && prio < td->td_priority) { KTR_POINT3(KTR_SCHED, "thread", sched_tdname(curthread), "lend prio", "prio:%d", td->td_priority, "new prio:%d", prio, KTR_ATTR_LINKED, sched_tdname(td)); - SDT_PROBE4(sched, , , lend_pri, td, td->td_proc, prio, + SDT_PROBE4(sched, , , lend__pri, td, td->td_proc, prio, curthread); } ts = td->td_sched; @@ -1880,7 +1880,7 @@ sched_switch(struct thread *td, struct t if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_OUT); #endif - SDT_PROBE2(sched, , , off_cpu, newtd, newtd->td_proc); + SDT_PROBE2(sched, , , off__cpu, newtd, newtd->td_proc); lock_profile_release_lock(&TDQ_LOCKPTR(tdq)->lock_object); TDQ_LOCKPTR(tdq)->mtx_lock = (uintptr_t)newtd; sched_pctcpu_update(newtd->td_sched, 0); @@ -1906,14 +1906,14 @@ sched_switch(struct thread *td, struct t lock_profile_obtain_lock_success( &TDQ_LOCKPTR(tdq)->lock_object, 0, 0, __FILE__, __LINE__); - SDT_PROBE0(sched, , , on_cpu); + SDT_PROBE0(sched, , , on__cpu); #ifdef HWPMC_HOOKS if (PMC_PROC_IS_USING_PMCS(td->td_proc)) PMC_SWITCH_CONTEXT(td, PMC_FN_CSW_IN); #endif } else { thread_unblock_switch(td, mtx); - SDT_PROBE0(sched, , , remain_cpu); + SDT_PROBE0(sched, , , remain__cpu); } /* * Assert that all went well and return. Modified: stable/9/sys/kern/subr_devstat.c ============================================================================== --- stable/9/sys/kern/subr_devstat.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/subr_devstat.c Mon Feb 17 13:58:50 2014 (r262057) @@ -49,19 +49,19 @@ __FBSDID("$FreeBSD$"); SDT_PROVIDER_DEFINE(io); -SDT_PROBE_DEFINE2(io, , , start, start, "struct bio *", "struct devstat *"); -SDT_PROBE_DEFINE2(io, , , done, done, "struct bio *", "struct devstat *"); -SDT_PROBE_DEFINE2(io, , , wait_start, wait-start, "struct bio *", +SDT_PROBE_DEFINE2(io, , , start, "struct bio *", "struct devstat *"); +SDT_PROBE_DEFINE2(io, , , done, "struct bio *", "struct devstat *"); +SDT_PROBE_DEFINE2(io, , , wait__start, "struct bio *", "struct devstat *"); -SDT_PROBE_DEFINE2(io, , , wait_done, wait-done, "struct bio *", +SDT_PROBE_DEFINE2(io, , , wait__done, "struct bio *", "struct devstat *"); #define DTRACE_DEVSTAT_START() SDT_PROBE2(io, , , start, NULL, ds) #define DTRACE_DEVSTAT_BIO_START() SDT_PROBE2(io, , , start, bp, ds) #define DTRACE_DEVSTAT_DONE() SDT_PROBE2(io, , , done, NULL, ds) #define DTRACE_DEVSTAT_BIO_DONE() SDT_PROBE2(io, , , done, bp, ds) -#define DTRACE_DEVSTAT_WAIT_START() SDT_PROBE2(io, , , wait_start, NULL, ds) -#define DTRACE_DEVSTAT_WAIT_DONE() SDT_PROBE2(io, , , wait_done, NULL, ds) +#define DTRACE_DEVSTAT_WAIT_START() SDT_PROBE2(io, , , wait__start, NULL, ds) +#define DTRACE_DEVSTAT_WAIT_DONE() SDT_PROBE2(io, , , wait__done, NULL, ds) static int devstat_num_devs; static long devstat_generation = 1; Modified: stable/9/sys/kern/subr_turnstile.c ============================================================================== --- stable/9/sys/kern/subr_turnstile.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/subr_turnstile.c Mon Feb 17 13:58:50 2014 (r262057) @@ -170,8 +170,8 @@ static int turnstile_init(void *mem, int static void turnstile_fini(void *mem, int size); SDT_PROVIDER_DECLARE(sched); -SDT_PROBE_DEFINE(sched, , , sleep, sleep); -SDT_PROBE_DEFINE2(sched, , , wakeup, wakeup, "struct thread *", +SDT_PROBE_DEFINE(sched, , , sleep); +SDT_PROBE_DEFINE2(sched, , , wakeup, "struct thread *", "struct proc *"); /* Modified: stable/9/sys/kern/vfs_cache.c ============================================================================== --- stable/9/sys/kern/vfs_cache.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/vfs_cache.c Mon Feb 17 13:58:50 2014 (r262057) @@ -62,28 +62,28 @@ __FBSDID("$FreeBSD$"); #include SDT_PROVIDER_DECLARE(vfs); -SDT_PROBE_DEFINE3(vfs, namecache, enter, done, done, "struct vnode *", "char *", +SDT_PROBE_DEFINE3(vfs, namecache, enter, done, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE2(vfs, namecache, enter_negative, done, done, "struct vnode *", +SDT_PROBE_DEFINE2(vfs, namecache, enter_negative, done, "struct vnode *", "char *"); -SDT_PROBE_DEFINE1(vfs, namecache, fullpath, entry, entry, "struct vnode *"); -SDT_PROBE_DEFINE3(vfs, namecache, fullpath, hit, hit, "struct vnode *", +SDT_PROBE_DEFINE1(vfs, namecache, fullpath, entry, "struct vnode *"); +SDT_PROBE_DEFINE3(vfs, namecache, fullpath, hit, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE1(vfs, namecache, fullpath, miss, miss, "struct vnode *"); -SDT_PROBE_DEFINE3(vfs, namecache, fullpath, return, return, "int", +SDT_PROBE_DEFINE1(vfs, namecache, fullpath, miss, "struct vnode *"); +SDT_PROBE_DEFINE3(vfs, namecache, fullpath, return, "int", "struct vnode *", "char *"); -SDT_PROBE_DEFINE3(vfs, namecache, lookup, hit, hit, "struct vnode *", "char *", +SDT_PROBE_DEFINE3(vfs, namecache, lookup, hit, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE2(vfs, namecache, lookup, hit_negative, hit-negative, +SDT_PROBE_DEFINE2(vfs, namecache, lookup, hit__negative, "struct vnode *", "char *"); -SDT_PROBE_DEFINE2(vfs, namecache, lookup, miss, miss, "struct vnode *", +SDT_PROBE_DEFINE2(vfs, namecache, lookup, miss, "struct vnode *", "char *"); -SDT_PROBE_DEFINE1(vfs, namecache, purge, done, done, "struct vnode *"); -SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, done, "struct vnode *"); -SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, done, "struct mount *"); -SDT_PROBE_DEFINE3(vfs, namecache, zap, done, done, "struct vnode *", "char *", +SDT_PROBE_DEFINE1(vfs, namecache, purge, done, "struct vnode *"); +SDT_PROBE_DEFINE1(vfs, namecache, purge_negative, done, "struct vnode *"); +SDT_PROBE_DEFINE1(vfs, namecache, purgevfs, done, "struct mount *"); +SDT_PROBE_DEFINE3(vfs, namecache, zap, done, "struct vnode *", "char *", "struct vnode *"); -SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, done, "struct vnode *", +SDT_PROBE_DEFINE2(vfs, namecache, zap_negative, done, "struct vnode *", "char *"); /* @@ -614,7 +614,7 @@ negative_success: nchstats.ncs_neghits++; if (ncp->nc_flag & NCF_WHITE) cnp->cn_flags |= ISWHITEOUT; - SDT_PROBE(vfs, namecache, lookup, hit_negative, dvp, nc_get_name(ncp), + SDT_PROBE(vfs, namecache, lookup, hit__negative, dvp, nc_get_name(ncp), 0, 0, 0); cache_out_ts(ncp, tsp, ticksp); CACHE_WUNLOCK(); Modified: stable/9/sys/kern/vfs_lookup.c ============================================================================== --- stable/9/sys/kern/vfs_lookup.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/vfs_lookup.c Mon Feb 17 13:58:50 2014 (r262057) @@ -70,9 +70,9 @@ __FBSDID("$FreeBSD$"); #undef NAMEI_DIAGNOSTIC SDT_PROVIDER_DECLARE(vfs); -SDT_PROBE_DEFINE3(vfs, namei, lookup, entry, entry, "struct vnode *", "char *", +SDT_PROBE_DEFINE3(vfs, namei, lookup, entry, "struct vnode *", "char *", "unsigned long"); -SDT_PROBE_DEFINE2(vfs, namei, lookup, return, return, "int", "struct vnode *"); +SDT_PROBE_DEFINE2(vfs, namei, lookup, return, "int", "struct vnode *"); /* * Allocation zone for namei Modified: stable/9/sys/kern/vfs_syscalls.c ============================================================================== --- stable/9/sys/kern/vfs_syscalls.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/kern/vfs_syscalls.c Mon Feb 17 13:58:50 2014 (r262057) @@ -91,8 +91,8 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_FADVISE, "fadvise", "posix_fadvise(2) information"); SDT_PROVIDER_DEFINE(vfs); -SDT_PROBE_DEFINE2(vfs, , stat, mode, mode, "char *", "int"); -SDT_PROBE_DEFINE2(vfs, , stat, reg, reg, "char *", "int"); +SDT_PROBE_DEFINE2(vfs, , stat, mode, "char *", "int"); +SDT_PROBE_DEFINE2(vfs, , stat, reg, "char *", "int"); static int chroot_refuse_vdir_fds(struct filedesc *fdp); static int getutimes(const struct timeval *, enum uio_seg, struct timespec *); Modified: stable/9/sys/net/vnet.c ============================================================================== --- stable/9/sys/net/vnet.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/net/vnet.c Mon Feb 17 13:58:50 2014 (r262057) @@ -210,14 +210,14 @@ static TAILQ_HEAD(, vnet_data_free) vnet static struct sx vnet_data_free_lock; SDT_PROVIDER_DEFINE(vnet); -SDT_PROBE_DEFINE1(vnet, functions, vnet_alloc, entry, entry, "int"); -SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, alloc, alloc, "int", +SDT_PROBE_DEFINE1(vnet, functions, vnet_alloc, entry, "int"); +SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, alloc, "int", "struct vnet *"); -SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, return, return, +SDT_PROBE_DEFINE2(vnet, functions, vnet_alloc, return, "int", "struct vnet *"); -SDT_PROBE_DEFINE2(vnet, functions, vnet_destroy, entry, entry, +SDT_PROBE_DEFINE2(vnet, functions, vnet_destroy, entry, "int", "struct vnet *"); -SDT_PROBE_DEFINE1(vnet, functions, vnet_destroy, return, entry, +SDT_PROBE_DEFINE1(vnet, functions, vnet_destroy, return, "int"); #ifdef DDB Modified: stable/9/sys/netinet/sctp_dtrace_define.h ============================================================================== --- stable/9/sys/netinet/sctp_dtrace_define.h Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/netinet/sctp_dtrace_define.h Mon Feb 17 13:58:50 2014 (r262057) @@ -45,7 +45,7 @@ SDT_PROVIDER_DEFINE(sctp); /* Cwnd probe - tracks changes in the congestion window on a netp */ /********************************************************/ /* Initial */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, init, init, +SDT_PROBE_DEFINE5(sctp, cwnd, net, init, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -56,7 +56,7 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, init, "int"); /* The new value of the cwnd */ /* ACK-INCREASE */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, ack, ack, +SDT_PROBE_DEFINE5(sctp, cwnd, net, ack, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -67,14 +67,14 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, ack, "int"); /* The new value of the cwnd */ /* ACK-INCREASE */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, rttvar, rttvar, +SDT_PROBE_DEFINE5(sctp, cwnd, net, rttvar, "uint64_t", /* The Vtag << 32 | localport << 16 | remoteport */ "uint64_t", /* obw | nbw */ "uint64_t", /* bwrtt | newrtt */ "uint64_t", /* flight */ "uint64_t"); /* (cwnd << 32) | point << 16 | retval(0/1) */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, rttstep, rttstep, +SDT_PROBE_DEFINE5(sctp, cwnd, net, rttstep, "uint64_t", /* The Vtag << 32 | localport << 16 | remoteport */ "uint64_t", /* obw | nbw */ "uint64_t", /* bwrtt | newrtt */ @@ -82,7 +82,7 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, rttst "uint64_t"); /* (cwnd << 32) | point << 16 | retval(0/1) */ /* FastRetransmit-DECREASE */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, fr, fr, +SDT_PROBE_DEFINE5(sctp, cwnd, net, fr, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -93,7 +93,7 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, fr, f "int"); /* The new value of the cwnd */ /* TimeOut-DECREASE */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, to, to, +SDT_PROBE_DEFINE5(sctp, cwnd, net, to, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -104,7 +104,7 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, to, t "int"); /* The new value of the cwnd */ /* BurstLimit-DECREASE */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, bl, bl, +SDT_PROBE_DEFINE5(sctp, cwnd, net, bl, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -115,7 +115,7 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, bl, b "int"); /* The new value of the cwnd */ /* ECN-DECREASE */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, ecn, ecn, +SDT_PROBE_DEFINE5(sctp, cwnd, net, ecn, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -126,7 +126,7 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, ecn, "int"); /* The new value of the cwnd */ /* PacketDrop-DECREASE */ -SDT_PROBE_DEFINE5(sctp, cwnd, net, pd, pd, +SDT_PROBE_DEFINE5(sctp, cwnd, net, pd, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -139,7 +139,7 @@ SDT_PROBE_DEFINE5(sctp, cwnd, net, pd, p /********************************************************/ /* Rwnd probe - tracks changes in the receiver window for an assoc */ /********************************************************/ -SDT_PROBE_DEFINE4(sctp, rwnd, assoc, val, val, +SDT_PROBE_DEFINE4(sctp, rwnd, assoc, val, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -151,7 +151,7 @@ SDT_PROBE_DEFINE4(sctp, rwnd, assoc, val /********************************************************/ /* flight probe - tracks changes in the flight size on a net or assoc */ /********************************************************/ -SDT_PROBE_DEFINE5(sctp, flightsize, net, val, val, +SDT_PROBE_DEFINE5(sctp, flightsize, net, val, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number @@ -164,7 +164,7 @@ SDT_PROBE_DEFINE5(sctp, flightsize, net, /********************************************************/ /* The total flight version */ /********************************************************/ -SDT_PROBE_DEFINE4(sctp, flightsize, assoc, val, val, +SDT_PROBE_DEFINE4(sctp, flightsize, assoc, val, "uint32_t", /* The Vtag for this end */ "uint32_t", /* * The port number of the local side << 16 | port number Modified: stable/9/sys/opencrypto/deflate.c ============================================================================== --- stable/9/sys/opencrypto/deflate.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/opencrypto/deflate.c Mon Feb 17 13:58:50 2014 (r262057) @@ -50,13 +50,13 @@ __FBSDID("$FreeBSD$"); #include SDT_PROVIDER_DECLARE(opencrypto); -SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, entry, entry, +SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, entry, "int", "u_int32_t"); -SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, bad, bad, +SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, bad, "int", "int", "int", "int", "int"); -SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, iter, iter, +SDT_PROBE_DEFINE5(opencrypto, deflate, deflate_global, iter, "int", "int", "int", "int", "int"); -SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, return, return, +SDT_PROBE_DEFINE2(opencrypto, deflate, deflate_global, return, "int", "u_int32_t"); int window_inflate = -1 * MAX_WBITS; Modified: stable/9/sys/security/mac/mac_framework.c ============================================================================== --- stable/9/sys/security/mac/mac_framework.c Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/security/mac/mac_framework.c Mon Feb 17 13:58:50 2014 (r262057) @@ -94,11 +94,11 @@ __FBSDID("$FreeBSD$"); SDT_PROVIDER_DEFINE(mac); SDT_PROVIDER_DEFINE(mac_framework); -SDT_PROBE_DEFINE2(mac, kernel, policy, modevent, modevent, "int", +SDT_PROBE_DEFINE2(mac, kernel, policy, modevent, "int", "struct mac_policy_conf *"); -SDT_PROBE_DEFINE1(mac, kernel, policy, register, register, +SDT_PROBE_DEFINE1(mac, kernel, policy, register, "struct mac_policy_conf *"); -SDT_PROBE_DEFINE1(mac, kernel, policy, unregister, unregister, +SDT_PROBE_DEFINE1(mac, kernel, policy, unregister, "struct mac_policy_conf *"); /* Modified: stable/9/sys/security/mac/mac_internal.h ============================================================================== --- stable/9/sys/security/mac/mac_internal.h Mon Feb 17 13:53:01 2014 (r262056) +++ stable/9/sys/security/mac/mac_internal.h Mon Feb 17 13:58:50 2014 (r262057) @@ -74,35 +74,35 @@ SDT_PROVIDER_DECLARE(mac); /* MAC Frame SDT_PROVIDER_DECLARE(mac_framework); /* Entry points to MAC. */ #define MAC_CHECK_PROBE_DEFINE4(name, arg0, arg1, arg2, arg3) \ - SDT_PROBE_DEFINE5(mac_framework, kernel, name, mac_check_err, \ - mac-check-ok, "int", arg0, arg1, arg2, arg3); \ - SDT_PROBE_DEFINE5(mac_framework, kernel, name, mac_check_ok, \ - mac-check-ok, "int", arg0, arg1, arg2, arg3); + SDT_PROBE_DEFINE5(mac_framework, kernel, name, mac__check__err, \ + "int", arg0, arg1, arg2, arg3); \ + SDT_PROBE_DEFINE5(mac_framework, kernel, name, mac__check__ok, \ + "int", arg0, arg1, arg2, arg3); #define MAC_CHECK_PROBE_DEFINE3(name, arg0, arg1, arg2) \ - SDT_PROBE_DEFINE4(mac_framework, kernel, name, mac_check_err, \ - mac-check-err, "int", arg0, arg1, arg2); \ - SDT_PROBE_DEFINE4(mac_framework, kernel, name, mac_check_ok, \ - mac-check-ok, "int", arg0, arg1, arg2); + SDT_PROBE_DEFINE4(mac_framework, kernel, name, mac__check__err, \ + "int", arg0, arg1, arg2); \ + SDT_PROBE_DEFINE4(mac_framework, kernel, name, mac__check__ok, \ + "int", arg0, arg1, arg2); #define MAC_CHECK_PROBE_DEFINE2(name, arg0, arg1) \ - SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_check_err, \ - mac-check-err, "int", arg0, arg1); \ - SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_check_ok, \ - mac-check-ok, "int", arg0, arg1); + SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac__check__err, \ + "int", arg0, arg1); \ + SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac__check__ok, \ + "int", arg0, arg1); #define MAC_CHECK_PROBE_DEFINE1(name, arg0) \ - SDT_PROBE_DEFINE2(mac_framework, kernel, name, mac_check_err, \ - mac-check-err, "int", arg0); \ - SDT_PROBE_DEFINE2(mac_framework, kernel, name, mac_check_ok, \ - mac-check-ok, "int", arg0); + SDT_PROBE_DEFINE2(mac_framework, kernel, name, mac__check__err, \ + "int", arg0); \ + SDT_PROBE_DEFINE2(mac_framework, kernel, name, mac__check__ok, \ + "int", arg0); #define MAC_CHECK_PROBE4(name, error, arg0, arg1, arg2, arg3) do { \ if (error) { \ - SDT_PROBE(mac_framework, kernel, name, mac_check_err, \ + SDT_PROBE(mac_framework, kernel, name, mac__check__err, \ error, arg0, arg1, arg2, arg3); \ } else { \ - SDT_PROBE(mac_framework, kernel, name, mac_check_ok, \ + SDT_PROBE(mac_framework, kernel, name, mac__check__ok, \ 0, arg0, arg1, arg2, arg3); \ } \ } while (0) @@ -116,17 +116,17 @@ SDT_PROVIDER_DECLARE(mac_framework); /* #endif #define MAC_GRANT_PROBE_DEFINE2(name, arg0, arg1) \ - SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_grant_err, \ - mac-grant-err, "int", arg0, arg1); \ - SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac_grant_ok, \ - mac-grant-ok, "int", arg0, arg1); + SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac__grant__err, \ + "int", arg0, arg1); \ + SDT_PROBE_DEFINE3(mac_framework, kernel, name, mac__grant__ok, \ + "int", arg0, arg1); #define MAC_GRANT_PROBE2(name, error, arg0, arg1) do { \ if (error) { \ - SDT_PROBE(mac_framework, kernel, name, mac_grant_err, \ + SDT_PROBE(mac_framework, kernel, name, mac__grant__err, \ error, arg0, arg1, 0, 0); \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 14:47:54 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 344C2D0F; Mon, 17 Feb 2014 14:47: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 149D91982; Mon, 17 Feb 2014 14:47:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HElrj3092787; Mon, 17 Feb 2014 14:47:53 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HElrjg092783; Mon, 17 Feb 2014 14:47:53 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171447.s1HElrjg092783@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 14:47:53 +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: r262058 - in stable/10/sys: cddl/compat/opensolaris/sys kern modules/zfs 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 14:47:54 -0000 Author: avg Date: Mon Feb 17 14:47:52 2014 New Revision: 262058 URL: http://svnweb.freebsd.org/changeset/base/262058 Log: MFC r258625: sdt: add support for solaris/illumos style DTRACE_PROBE macros Note: in head KDTRACE_HOOKS is defined in opt_global.h and thus there is no need to explicitly include any header to check that option. In this branch we have to include opt_kdtrace.h and, so, this commit carries additional changes to accomodate for that difference. Sponsored by: HybridCluster Modified: stable/10/sys/cddl/compat/opensolaris/sys/sdt.h stable/10/sys/kern/kern_sdt.c stable/10/sys/modules/zfs/Makefile stable/10/sys/sys/sdt.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/compat/opensolaris/sys/sdt.h ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/sys/sdt.h Mon Feb 17 13:58:50 2014 (r262057) +++ stable/10/sys/cddl/compat/opensolaris/sys/sdt.h Mon Feb 17 14:47:52 2014 (r262058) @@ -29,20 +29,11 @@ #ifndef _OPENSOLARIS_SYS_SDT_H_ #define _OPENSOLARIS_SYS_SDT_H_ +#ifdef _KERNEL +#include +#endif #include_next -#undef DTRACE_PROBE -#undef DTRACE_PROBE1 -#undef DTRACE_PROBE2 -#undef DTRACE_PROBE3 -#undef DTRACE_PROBE4 - -#define DTRACE_PROBE(name) -#define DTRACE_PROBE1(name, type1, arg1) -#define DTRACE_PROBE2(name, type1, arg1, type2, arg2) -#define DTRACE_PROBE3(name, type1, arg1, type2, arg2, type3, arg3) -#define DTRACE_PROBE4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) - #define SET_ERROR(err) (err) #endif /* _OPENSOLARIS_SYS_SDT_H_ */ Modified: stable/10/sys/kern/kern_sdt.c ============================================================================== --- stable/10/sys/kern/kern_sdt.c Mon Feb 17 13:58:50 2014 (r262057) +++ stable/10/sys/kern/kern_sdt.c Mon Feb 17 14:47:52 2014 (r262058) @@ -31,6 +31,8 @@ #include #include +SDT_PROVIDER_DEFINE(sdt); + /* * Hook for the DTrace probe function. The SDT provider will set this to * dtrace_probe() when it loads. Modified: stable/10/sys/modules/zfs/Makefile ============================================================================== --- stable/10/sys/modules/zfs/Makefile Mon Feb 17 13:58:50 2014 (r262057) +++ stable/10/sys/modules/zfs/Makefile Mon Feb 17 14:47:52 2014 (r262058) @@ -4,6 +4,12 @@ KMOD= zfs SRCS= bus_if.h device_if.h vnode_if.h +.if !defined(KERNBUILDDIR) +SRCS+= opt_kdtrace.h +opt_kdtrace.h: + echo "" > ${.TARGET} +.endif + SUNW= ${.CURDIR}/../../cddl/contrib/opensolaris .PATH: ${SUNW}/common/acl Modified: stable/10/sys/sys/sdt.h ============================================================================== --- stable/10/sys/sys/sdt.h Mon Feb 17 13:58:50 2014 (r262057) +++ stable/10/sys/sys/sdt.h Mon Feb 17 14:47:52 2014 (r262058) @@ -126,6 +126,14 @@ arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5, arg6, \ xarg6) +#define DTRACE_PROBE(name) +#define DTRACE_PROBE1(name, type0, arg0) +#define DTRACE_PROBE2(name, type0, arg0, type1, arg1) +#define DTRACE_PROBE3(name, type0, arg0, type1, arg1, type2, arg2) +#define DTRACE_PROBE4(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3) +#define DTRACE_PROBE5(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3,\ + type4, arg4) + #else SET_DECLARE(sdt_providers_set, struct sdt_provider); @@ -313,6 +321,51 @@ SET_DECLARE(sdt_argtypes_set, struct sdt (uintptr_t)arg6); \ } while (0) +#define DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, arg4) do { \ + static SDT_PROBE_DEFINE(sdt, , , name); \ + SDT_PROBE(sdt, , , name, arg0, arg1, arg2, arg3, arg4); +#define DTRACE_PROBE_IMPL_END } while (0) + +#define DTRACE_PROBE(name) \ + DTRACE_PROBE_IMPL_START(name, 0, 0, 0, 0, 0) \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE1(name, type0, arg0) \ + DTRACE_PROBE_IMPL_START(name, arg0, 0, 0, 0, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE2(name, type0, arg0, type1, arg1) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, 0, 0, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE3(name, type0, arg0, type1, arg1, type2, arg2) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, 0, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE4(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 3, #type3, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE5(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3, \ + type4, arg4) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, arg4) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 3, #type3, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 4, #type4, NULL); \ + DTRACE_PROBE_IMPL_END + #endif /* KDTRACE_HOOKS */ /* @@ -365,6 +418,8 @@ struct sdt_provider { void sdt_probe_stub(uint32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); +SDT_PROVIDER_DECLARE(sdt); + #endif /* _KERNEL */ #endif /* _SYS_SDT_H */ From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 14:48:24 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9A121E4C; Mon, 17 Feb 2014 14:48: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 76B7A198C; Mon, 17 Feb 2014 14:48:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HEmOba092898; Mon, 17 Feb 2014 14:48:24 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HEmNNo092894; Mon, 17 Feb 2014 14:48:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171448.s1HEmNNo092894@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 14:48: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: r262059 - in stable/9/sys: cddl/compat/opensolaris/sys kern modules/zfs sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 14:48:24 -0000 Author: avg Date: Mon Feb 17 14:48:23 2014 New Revision: 262059 URL: http://svnweb.freebsd.org/changeset/base/262059 Log: MFC r258625: sdt: add support for solaris/illumos style DTRACE_PROBE macros Note: in head KDTRACE_HOOKS is defined in opt_global.h and thus there is no need to explicitly include any header to check that option. In this branch we have to include opt_kdtrace.h and, so, this commit carries additional changes to accomodate for that difference. Sponsored by: HybridCluster Modified: stable/9/sys/cddl/compat/opensolaris/sys/sdt.h stable/9/sys/kern/kern_sdt.c stable/9/sys/modules/zfs/Makefile stable/9/sys/sys/sdt.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/sys/sdt.h ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/sys/sdt.h Mon Feb 17 14:47:52 2014 (r262058) +++ stable/9/sys/cddl/compat/opensolaris/sys/sdt.h Mon Feb 17 14:48:23 2014 (r262059) @@ -29,20 +29,11 @@ #ifndef _OPENSOLARIS_SYS_SDT_H_ #define _OPENSOLARIS_SYS_SDT_H_ +#ifdef _KERNEL +#include +#endif #include_next -#undef DTRACE_PROBE -#undef DTRACE_PROBE1 -#undef DTRACE_PROBE2 -#undef DTRACE_PROBE3 -#undef DTRACE_PROBE4 - -#define DTRACE_PROBE(name) -#define DTRACE_PROBE1(name, type1, arg1) -#define DTRACE_PROBE2(name, type1, arg1, type2, arg2) -#define DTRACE_PROBE3(name, type1, arg1, type2, arg2, type3, arg3) -#define DTRACE_PROBE4(name, type1, arg1, type2, arg2, type3, arg3, type4, arg4) - #define SET_ERROR(err) (err) #endif /* _OPENSOLARIS_SYS_SDT_H_ */ Modified: stable/9/sys/kern/kern_sdt.c ============================================================================== --- stable/9/sys/kern/kern_sdt.c Mon Feb 17 14:47:52 2014 (r262058) +++ stable/9/sys/kern/kern_sdt.c Mon Feb 17 14:48:23 2014 (r262059) @@ -31,6 +31,8 @@ #include #include +SDT_PROVIDER_DEFINE(sdt); + /* * Hook for the DTrace probe function. The SDT provider will set this to * dtrace_probe() when it loads. Modified: stable/9/sys/modules/zfs/Makefile ============================================================================== --- stable/9/sys/modules/zfs/Makefile Mon Feb 17 14:47:52 2014 (r262058) +++ stable/9/sys/modules/zfs/Makefile Mon Feb 17 14:48:23 2014 (r262059) @@ -4,6 +4,12 @@ KMOD= zfs SRCS= bus_if.h device_if.h vnode_if.h +.if !defined(KERNBUILDDIR) +SRCS+= opt_kdtrace.h +opt_kdtrace.h: + echo "" > ${.TARGET} +.endif + SUNW= ${.CURDIR}/../../cddl/contrib/opensolaris .PATH: ${SUNW}/common/acl Modified: stable/9/sys/sys/sdt.h ============================================================================== --- stable/9/sys/sys/sdt.h Mon Feb 17 14:47:52 2014 (r262058) +++ stable/9/sys/sys/sdt.h Mon Feb 17 14:48:23 2014 (r262059) @@ -126,6 +126,14 @@ arg1, xarg1, arg2, xarg2, arg3, xarg3, arg4, xarg4, arg5, xarg5, arg6, \ xarg6) +#define DTRACE_PROBE(name) +#define DTRACE_PROBE1(name, type0, arg0) +#define DTRACE_PROBE2(name, type0, arg0, type1, arg1) +#define DTRACE_PROBE3(name, type0, arg0, type1, arg1, type2, arg2) +#define DTRACE_PROBE4(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3) +#define DTRACE_PROBE5(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3,\ + type4, arg4) + #else SET_DECLARE(sdt_providers_set, struct sdt_provider); @@ -313,6 +321,51 @@ SET_DECLARE(sdt_argtypes_set, struct sdt (uintptr_t)arg6); \ } while (0) +#define DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, arg4) do { \ + static SDT_PROBE_DEFINE(sdt, , , name); \ + SDT_PROBE(sdt, , , name, arg0, arg1, arg2, arg3, arg4); +#define DTRACE_PROBE_IMPL_END } while (0) + +#define DTRACE_PROBE(name) \ + DTRACE_PROBE_IMPL_START(name, 0, 0, 0, 0, 0) \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE1(name, type0, arg0) \ + DTRACE_PROBE_IMPL_START(name, arg0, 0, 0, 0, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE2(name, type0, arg0, type1, arg1) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, 0, 0, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE3(name, type0, arg0, type1, arg1, type2, arg2) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, 0, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE4(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, 0) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 3, #type3, NULL); \ + DTRACE_PROBE_IMPL_END + +#define DTRACE_PROBE5(name, type0, arg0, type1, arg1, type2, arg2, type3, arg3, \ + type4, arg4) \ + DTRACE_PROBE_IMPL_START(name, arg0, arg1, arg2, arg3, arg4) \ + SDT_PROBE_ARGTYPE(sdt, , , name, 0, #type0, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 1, #type1, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 2, #type2, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 3, #type3, NULL); \ + SDT_PROBE_ARGTYPE(sdt, , , name, 4, #type4, NULL); \ + DTRACE_PROBE_IMPL_END + #endif /* KDTRACE_HOOKS */ /* @@ -365,6 +418,8 @@ struct sdt_provider { void sdt_probe_stub(uint32_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); +SDT_PROVIDER_DECLARE(sdt); + #endif /* _KERNEL */ #endif /* _SYS_SDT_H */ From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 14:51:02 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B1D3410C; Mon, 17 Feb 2014 14: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9DDCC1A15; Mon, 17 Feb 2014 14:51:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HEp26t095540; Mon, 17 Feb 2014 14:51:02 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HEp2RI095539; Mon, 17 Feb 2014 14:51:02 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402171451.s1HEp2RI095539@svn.freebsd.org> From: Mark Johnston Date: Mon, 17 Feb 2014 14:51:02 +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: r262060 - stable/10/cddl/contrib/opensolaris/lib/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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 14:51:02 -0000 Author: markj Date: Mon Feb 17 14:51:02 2014 New Revision: 262060 URL: http://svnweb.freebsd.org/changeset/base/262060 Log: MFC r260051: When clearing relocations to __dtrace* symbols, handle both SHT_REL and SHT_RELA sections properly instead of assuming that the relocation section is of type SHT_REL. Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Mon Feb 17 14:48:23 2014 (r262059) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Mon Feb 17 14:51:02 2014 (r262060) @@ -1620,10 +1620,17 @@ process_obj(dtrace_hdl_t *dtp, const cha * the executable file as the symbol is going to be * change from UND to ABS. */ - rela.r_offset = 0; - rela.r_info = 0; - rela.r_addend = 0; - (void) gelf_update_rela(data_rel, i, &rela); + if (shdr_rel.sh_type == SHT_RELA) { + rela.r_offset = 0; + rela.r_info = 0; + rela.r_addend = 0; + (void) gelf_update_rela(data_rel, i, &rela); + } else { + GElf_Rel rel; + rel.r_offset = 0; + rel.r_info = 0; + (void) gelf_update_rel(data_rel, i, &rel); + } #endif mod = 1; From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 14:52:07 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3D93A32D; Mon, 17 Feb 2014 14:52: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 282BC1A2F; Mon, 17 Feb 2014 14:52:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HEq7aN096211; Mon, 17 Feb 2014 14:52:07 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HEq7h4096210; Mon, 17 Feb 2014 14:52:07 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402171452.s1HEq7h4096210@svn.freebsd.org> From: Mark Johnston Date: Mon, 17 Feb 2014 14:52:07 +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: r262061 - stable/9/cddl/contrib/opensolaris/lib/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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 14:52:07 -0000 Author: markj Date: Mon Feb 17 14:52:06 2014 New Revision: 262061 URL: http://svnweb.freebsd.org/changeset/base/262061 Log: MFC r260051: When clearing relocations to __dtrace* symbols, handle both SHT_REL and SHT_RELA sections properly instead of assuming that the relocation section is of type SHT_REL. Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.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/libdtrace/common/dt_link.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Mon Feb 17 14:51:02 2014 (r262060) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Mon Feb 17 14:52:06 2014 (r262061) @@ -1539,10 +1539,17 @@ process_obj(dtrace_hdl_t *dtp, const cha * the executable file as the symbol is going to be * change from UND to ABS. */ - rela.r_offset = 0; - rela.r_info = 0; - rela.r_addend = 0; - (void) gelf_update_rela(data_rel, i, &rela); + if (shdr_rel.sh_type == SHT_RELA) { + rela.r_offset = 0; + rela.r_info = 0; + rela.r_addend = 0; + (void) gelf_update_rela(data_rel, i, &rela); + } else { + GElf_Rel rel; + rel.r_offset = 0; + rel.r_info = 0; + (void) gelf_update_rel(data_rel, i, &rel); + } #endif mod = 1; From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 15:20:04 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 167E765A; Mon, 17 Feb 2014 15:20: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 01B491C9E; Mon, 17 Feb 2014 15:20:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFK39j006591; Mon, 17 Feb 2014 15:20:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFK3KW006590; Mon, 17 Feb 2014 15:20:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171520.s1HFK3KW006590@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:20:03 +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: r262062 - stable/8/share/man/man9 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 15:20:04 -0000 Author: avg Date: Mon Feb 17 15:20:03 2014 New Revision: 262062 URL: http://svnweb.freebsd.org/changeset/base/262062 Log: MFC r214019: Update links for taskqueue(9) functions Modified: stable/8/share/man/man9/Makefile Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Mon Feb 17 14:52:06 2014 (r262061) +++ stable/8/share/man/man9/Makefile Mon Feb 17 15:20:03 2014 (r262062) @@ -1263,11 +1263,17 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASK_INITIALIZER.9 \ taskqueue.9 taskqueue_create.9 \ + taskqueue.9 taskqueue_create_fast.9 \ taskqueue.9 TASKQUEUE_DECLARE.9 \ taskqueue.9 TASKQUEUE_DEFINE.9 \ + taskqueue.9 TASKQUEUE_DEFINE_THREAD.9 \ + taskqueue.9 taskqueue_drain.9 \ taskqueue.9 taskqueue_enqueue.9 \ - taskqueue.9 taskqueue_find.9 \ + taskqueue.9 taskqueue_enqueue_fast.9 \ + taskqueue.9 TASKQUEUE_FAST_DEFINE.9 \ + taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ + taskqueue.9 taskqueue_member.9 \ taskqueue.9 taskqueue_run.9 MLINKS+=time.9 boottime.9 \ time.9 time_second.9 \ From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 15:24:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 337AC8D6; Mon, 17 Feb 2014 15:24: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E1E41D32; Mon, 17 Feb 2014 15:24:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFOoNu009806; Mon, 17 Feb 2014 15:24:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFOoDg009802; Mon, 17 Feb 2014 15:24:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171524.s1HFOoDg009802@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:24:50 +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: r262063 - in stable/8: share/man/man9 sys/kern sys/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 15:24:51 -0000 Author: avg Date: Mon Feb 17 15:24:49 2014 New Revision: 262063 URL: http://svnweb.freebsd.org/changeset/base/262063 Log: MFC r258713,262062: add taskqueue_drain_all Modified: stable/8/share/man/man9/Makefile stable/8/share/man/man9/taskqueue.9 stable/8/sys/kern/subr_taskqueue.c stable/8/sys/sys/taskqueue.h Directory Properties: stable/8/share/man/man9/ (props changed) stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Mon Feb 17 15:20:03 2014 (r262062) +++ stable/8/share/man/man9/Makefile Mon Feb 17 15:24:49 2014 (r262063) @@ -1262,19 +1262,22 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent sysctl_ctx_init.9 sysctl_ctx_free.9 MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASK_INITIALIZER.9 \ + taskqueue.9 taskqueue_block.9 \ taskqueue.9 taskqueue_create.9 \ taskqueue.9 taskqueue_create_fast.9 \ taskqueue.9 TASKQUEUE_DECLARE.9 \ taskqueue.9 TASKQUEUE_DEFINE.9 \ taskqueue.9 TASKQUEUE_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_drain.9 \ + taskqueue.9 taskqueue_drain_all.9 \ taskqueue.9 taskqueue_enqueue.9 \ taskqueue.9 taskqueue_enqueue_fast.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ taskqueue.9 taskqueue_member.9 \ - taskqueue.9 taskqueue_run.9 + taskqueue.9 taskqueue_run.9 \ + taskqueue.9 taskqueue_unblock.9 MLINKS+=time.9 boottime.9 \ time.9 time_second.9 \ time.9 time_uptime.9 Modified: stable/8/share/man/man9/taskqueue.9 ============================================================================== --- stable/8/share/man/man9/taskqueue.9 Mon Feb 17 15:20:03 2014 (r262062) +++ stable/8/share/man/man9/taskqueue.9 Mon Feb 17 15:24:49 2014 (r262063) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 18, 2009 +.Dd January 24, 2014 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -69,6 +69,12 @@ struct task { .Fn taskqueue_run_fast "struct taskqueue *queue" .Ft void .Fn taskqueue_drain "struct taskqueue *queue" "struct task *task" +.Ft void +.Fn taskqueue_drain_all "struct taskqueue *queue" +.Ft void +.Fn taskqueue_block "struct taskqueue *queue" +.Ft void +.Fn taskqueue_unblock "struct taskqueue *queue" .Ft int .Fn taskqueue_member "struct taskqueue *queue" "struct thread *td" .Fn TASK_INIT "struct task *task" "int priority" "task_fn_t *func" "void *context" @@ -176,6 +182,73 @@ function is used to wait for the task to There is no guarantee that the task will not be enqueued after call to .Fn taskqueue_drain . +If the caller wants to put the task into a known state, +then before calling +.Fn taskqueue_drain +the caller should use out-of-band means to ensure that the task +would not be enqueued. +For example, if the task is enqueued by an interrupt filter, then +the interrupt could be disabled. +.Pp +The +.Fn taskqueue_drain_all +function is used to wait for all pending and running tasks that +are enqueued on the taskqueue to finish. +The caller must arrange that the tasks are not re-enqueued. +Note that +.Fn taskqueue_drain_all +currently does not handle tasks with delayed enqueueing. +.Pp +The +.Fn taskqueue_block +function blocks the taskqueue. +It prevents any enqueued but not running tasks from being executed. +Future calls to +.Fn taskqueue_enqueue +will enqueue tasks, but the tasks will not be run until +.Fn taskqueue_unblock +is called. +Please note that +.Fn taskqueue_block +does not wait for any currently running tasks to finish. +Thus, the +.Fn taskqueue_block +does not provide a guarantee that +.Fn taskqueue_run +is not running after +.Fn taskqueue_block +returns, but it does provide a guarantee that +.Fn taskqueue_run +will not be called again +until +.Fn taskqueue_unblock +is called. +If the caller requires a guarantee that +.Fn taskqueue_run +is not running, then this must be arranged by the caller. +Note that if +.Fn taskqueue_drain +is called on a task that is enqueued on a taskqueue that is blocked by +.Fn taskqueue_block , +then +.Fn taskqueue_drain +can not return until the taskqueue is unblocked. +This can result in a deadlock if the thread blocked in +.Fn taskqueue_drain +is the thread that is supposed to call +.Fn taskqueue_unblock . +Thus, use of +.Fn taskqueue_drain +after +.Fn taskqueue_block +is discouraged, because the state of the task can not be known in advance. +The same caveat applies to +.Fn taskqueue_drain_all . +.Pp +The +.Fn taskqueue_unblock +function unblocks the previously blocked taskqueue. +All enqueued tasks can be run after this call. .Pp The .Fn taskqueue_member Modified: stable/8/sys/kern/subr_taskqueue.c ============================================================================== --- stable/8/sys/kern/subr_taskqueue.c Mon Feb 17 15:20:03 2014 (r262062) +++ stable/8/sys/kern/subr_taskqueue.c Mon Feb 17 15:24:49 2014 (r262063) @@ -202,6 +202,15 @@ taskqueue_enqueue(struct taskqueue *queu return 0; } +static void +taskqueue_drain_running(struct taskqueue *queue) +{ + + while (!TAILQ_EMPTY(&queue->tq_active)) + TQ_SLEEP(queue, &queue->tq_active, &queue->tq_mutex, + PWAIT, "-", 0); +} + void taskqueue_block(struct taskqueue *queue) { @@ -254,6 +263,8 @@ taskqueue_run_locked(struct taskqueue *q wakeup(task); } TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); + if (TAILQ_EMPTY(&queue->tq_active)) + wakeup(&queue->tq_active); } void @@ -296,6 +307,25 @@ taskqueue_drain(struct taskqueue *queue, } } +void +taskqueue_drain_all(struct taskqueue *queue) +{ + struct task *task; + + if (!queue->tq_spin) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); + + TQ_LOCK(queue); + task = STAILQ_LAST(&queue->tq_queue, task, ta_link); + if (task != NULL) + while (task->ta_pending != 0) + TQ_SLEEP(queue, task, &queue->tq_mutex, PWAIT, "-", 0); + taskqueue_drain_running(queue); + KASSERT(STAILQ_EMPTY(&queue->tq_queue), + ("taskqueue queue is not empty after draining")); + TQ_UNLOCK(queue); +} + static void taskqueue_swi_enqueue(void *context) { Modified: stable/8/sys/sys/taskqueue.h ============================================================================== --- stable/8/sys/sys/taskqueue.h Mon Feb 17 15:20:03 2014 (r262062) +++ stable/8/sys/sys/taskqueue.h Mon Feb 17 15:24:49 2014 (r262063) @@ -55,6 +55,7 @@ int taskqueue_start_threads(struct taskq const char *name, ...) __printflike(4, 5); int taskqueue_enqueue(struct taskqueue *queue, struct task *task); void taskqueue_drain(struct taskqueue *queue, struct task *task); +void taskqueue_drain_all(struct taskqueue *queue); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 15:29:48 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 33C5AB4B; Mon, 17 Feb 2014 15:29: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D5FF1D6E; Mon, 17 Feb 2014 15:29:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFTlc7010363; Mon, 17 Feb 2014 15:29:47 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFTlVG010359; Mon, 17 Feb 2014 15:29:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171529.s1HFTlVG010359@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:29:47 +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: r262064 - in stable/9: share/man/man9 sys/kern sys/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 15:29:48 -0000 Author: avg Date: Mon Feb 17 15:29:46 2014 New Revision: 262064 URL: http://svnweb.freebsd.org/changeset/base/262064 Log: MFC r258713,262062: add taskqueue_drain_all Modified: stable/9/share/man/man9/Makefile stable/9/share/man/man9/taskqueue.9 stable/9/sys/kern/subr_taskqueue.c stable/9/sys/sys/taskqueue.h Directory Properties: stable/9/share/man/man9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Mon Feb 17 15:24:49 2014 (r262063) +++ stable/9/share/man/man9/Makefile Mon Feb 17 15:29:46 2014 (r262064) @@ -1308,6 +1308,7 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent MLINKS+=SYSINIT.9 SYSUNINIT.9 MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASK_INITIALIZER.9 \ + taskqueue.9 taskqueue_block.9 \ taskqueue.9 taskqueue_cancel.9 \ taskqueue.9 taskqueue_create.9 \ taskqueue.9 taskqueue_create_fast.9 \ @@ -1315,13 +1316,15 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASKQUEUE_DEFINE.9 \ taskqueue.9 TASKQUEUE_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_drain.9 \ + taskqueue.9 taskqueue_drain_all.9 \ taskqueue.9 taskqueue_enqueue.9 \ taskqueue.9 taskqueue_enqueue_fast.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ taskqueue.9 taskqueue_member.9 \ - taskqueue.9 taskqueue_run.9 + taskqueue.9 taskqueue_run.9 \ + taskqueue.9 taskqueue_unblock.9 MLINKS+=time.9 boottime.9 \ time.9 time_second.9 \ time.9 time_uptime.9 Modified: stable/9/share/man/man9/taskqueue.9 ============================================================================== --- stable/9/share/man/man9/taskqueue.9 Mon Feb 17 15:24:49 2014 (r262063) +++ stable/9/share/man/man9/taskqueue.9 Mon Feb 17 15:29:46 2014 (r262064) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 4, 2012 +.Dd January 24, 2014 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -75,6 +75,12 @@ struct timeout_task; .Fn taskqueue_drain "struct taskqueue *queue" "struct task *task" .Ft void .Fn taskqueue_drain_timeout "struct taskqueue *queue" "struct timeout_task *timeout_task" +.Ft void +.Fn taskqueue_drain_all "struct taskqueue *queue" +.Ft void +.Fn taskqueue_block "struct taskqueue *queue" +.Ft void +.Fn taskqueue_unblock "struct taskqueue *queue" .Ft int .Fn taskqueue_member "struct taskqueue *queue" "struct thread *td" .Ft void @@ -227,6 +233,73 @@ function is used to wait for the schedul There is no guarantee that the task will not be enqueued after call to .Fn taskqueue_drain . +If the caller wants to put the task into a known state, +then before calling +.Fn taskqueue_drain +the caller should use out-of-band means to ensure that the task +would not be enqueued. +For example, if the task is enqueued by an interrupt filter, then +the interrupt could be disabled. +.Pp +The +.Fn taskqueue_drain_all +function is used to wait for all pending and running tasks that +are enqueued on the taskqueue to finish. +The caller must arrange that the tasks are not re-enqueued. +Note that +.Fn taskqueue_drain_all +currently does not handle tasks with delayed enqueueing. +.Pp +The +.Fn taskqueue_block +function blocks the taskqueue. +It prevents any enqueued but not running tasks from being executed. +Future calls to +.Fn taskqueue_enqueue +will enqueue tasks, but the tasks will not be run until +.Fn taskqueue_unblock +is called. +Please note that +.Fn taskqueue_block +does not wait for any currently running tasks to finish. +Thus, the +.Fn taskqueue_block +does not provide a guarantee that +.Fn taskqueue_run +is not running after +.Fn taskqueue_block +returns, but it does provide a guarantee that +.Fn taskqueue_run +will not be called again +until +.Fn taskqueue_unblock +is called. +If the caller requires a guarantee that +.Fn taskqueue_run +is not running, then this must be arranged by the caller. +Note that if +.Fn taskqueue_drain +is called on a task that is enqueued on a taskqueue that is blocked by +.Fn taskqueue_block , +then +.Fn taskqueue_drain +can not return until the taskqueue is unblocked. +This can result in a deadlock if the thread blocked in +.Fn taskqueue_drain +is the thread that is supposed to call +.Fn taskqueue_unblock . +Thus, use of +.Fn taskqueue_drain +after +.Fn taskqueue_block +is discouraged, because the state of the task can not be known in advance. +The same caveat applies to +.Fn taskqueue_drain_all . +.Pp +The +.Fn taskqueue_unblock +function unblocks the previously blocked taskqueue. +All enqueued tasks can be run after this call. .Pp The .Fn taskqueue_member Modified: stable/9/sys/kern/subr_taskqueue.c ============================================================================== --- stable/9/sys/kern/subr_taskqueue.c Mon Feb 17 15:24:49 2014 (r262063) +++ stable/9/sys/kern/subr_taskqueue.c Mon Feb 17 15:29:46 2014 (r262064) @@ -264,6 +264,15 @@ taskqueue_enqueue_timeout(struct taskque return (res); } +static void +taskqueue_drain_running(struct taskqueue *queue) +{ + + while (!TAILQ_EMPTY(&queue->tq_active)) + TQ_SLEEP(queue, &queue->tq_active, &queue->tq_mutex, + PWAIT, "-", 0); +} + void taskqueue_block(struct taskqueue *queue) { @@ -316,6 +325,8 @@ taskqueue_run_locked(struct taskqueue *q wakeup(task); } TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); + if (TAILQ_EMPTY(&queue->tq_active)) + wakeup(&queue->tq_active); } void @@ -400,6 +411,25 @@ taskqueue_drain(struct taskqueue *queue, } void +taskqueue_drain_all(struct taskqueue *queue) +{ + struct task *task; + + if (!queue->tq_spin) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); + + TQ_LOCK(queue); + task = STAILQ_LAST(&queue->tq_queue, task, ta_link); + if (task != NULL) + while (task->ta_pending != 0) + TQ_SLEEP(queue, task, &queue->tq_mutex, PWAIT, "-", 0); + taskqueue_drain_running(queue); + KASSERT(STAILQ_EMPTY(&queue->tq_queue), + ("taskqueue queue is not empty after draining")); + TQ_UNLOCK(queue); +} + +void taskqueue_drain_timeout(struct taskqueue *queue, struct timeout_task *timeout_task) { Modified: stable/9/sys/sys/taskqueue.h ============================================================================== --- stable/9/sys/sys/taskqueue.h Mon Feb 17 15:24:49 2014 (r262063) +++ stable/9/sys/sys/taskqueue.h Mon Feb 17 15:29:46 2014 (r262064) @@ -71,6 +71,7 @@ int taskqueue_cancel_timeout(struct task void taskqueue_drain(struct taskqueue *queue, struct task *task); void taskqueue_drain_timeout(struct taskqueue *queue, struct timeout_task *timeout_task); +void taskqueue_drain_all(struct taskqueue *queue); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 15:32:09 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BCC33E2A; Mon, 17 Feb 2014 15:32: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A70C61DFA; Mon, 17 Feb 2014 15:32:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFW9Xr013377; Mon, 17 Feb 2014 15:32:09 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFW8w7013373; Mon, 17 Feb 2014 15:32:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171532.s1HFW8w7013373@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:32: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: r262065 - in stable/10: share/man/man9 sys/kern sys/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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 15:32:09 -0000 Author: avg Date: Mon Feb 17 15:32:08 2014 New Revision: 262065 URL: http://svnweb.freebsd.org/changeset/base/262065 Log: MFC r258713,262062: add taskqueue_drain_all Modified: stable/10/share/man/man9/Makefile stable/10/share/man/man9/taskqueue.9 stable/10/sys/kern/subr_taskqueue.c stable/10/sys/sys/taskqueue.h Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/Makefile ============================================================================== --- stable/10/share/man/man9/Makefile Mon Feb 17 15:29:46 2014 (r262064) +++ stable/10/share/man/man9/Makefile Mon Feb 17 15:32:08 2014 (r262065) @@ -1336,6 +1336,7 @@ MLINKS+=sysctl_ctx_init.9 sysctl_ctx_ent MLINKS+=SYSINIT.9 SYSUNINIT.9 MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASK_INITIALIZER.9 \ + taskqueue.9 taskqueue_block.9 \ taskqueue.9 taskqueue_cancel.9 \ taskqueue.9 taskqueue_create.9 \ taskqueue.9 taskqueue_create_fast.9 \ @@ -1343,13 +1344,15 @@ MLINKS+=taskqueue.9 TASK_INIT.9 \ taskqueue.9 TASKQUEUE_DEFINE.9 \ taskqueue.9 TASKQUEUE_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_drain.9 \ + taskqueue.9 taskqueue_drain_all.9 \ taskqueue.9 taskqueue_enqueue.9 \ taskqueue.9 taskqueue_enqueue_fast.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE.9 \ taskqueue.9 TASKQUEUE_FAST_DEFINE_THREAD.9 \ taskqueue.9 taskqueue_free.9 \ taskqueue.9 taskqueue_member.9 \ - taskqueue.9 taskqueue_run.9 + taskqueue.9 taskqueue_run.9 \ + taskqueue.9 taskqueue_unblock.9 MLINKS+=time.9 boottime.9 \ time.9 time_second.9 \ time.9 time_uptime.9 Modified: stable/10/share/man/man9/taskqueue.9 ============================================================================== --- stable/10/share/man/man9/taskqueue.9 Mon Feb 17 15:29:46 2014 (r262064) +++ stable/10/share/man/man9/taskqueue.9 Mon Feb 17 15:32:08 2014 (r262065) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 4, 2012 +.Dd January 24, 2014 .Dt TASKQUEUE 9 .Os .Sh NAME @@ -86,6 +86,12 @@ struct timeout_task; .Fn taskqueue_drain "struct taskqueue *queue" "struct task *task" .Ft void .Fn taskqueue_drain_timeout "struct taskqueue *queue" "struct timeout_task *timeout_task" +.Ft void +.Fn taskqueue_drain_all "struct taskqueue *queue" +.Ft void +.Fn taskqueue_block "struct taskqueue *queue" +.Ft void +.Fn taskqueue_unblock "struct taskqueue *queue" .Ft int .Fn taskqueue_member "struct taskqueue *queue" "struct thread *td" .Ft void @@ -255,6 +261,73 @@ function is used to wait for the schedul There is no guarantee that the task will not be enqueued after call to .Fn taskqueue_drain . +If the caller wants to put the task into a known state, +then before calling +.Fn taskqueue_drain +the caller should use out-of-band means to ensure that the task +would not be enqueued. +For example, if the task is enqueued by an interrupt filter, then +the interrupt could be disabled. +.Pp +The +.Fn taskqueue_drain_all +function is used to wait for all pending and running tasks that +are enqueued on the taskqueue to finish. +The caller must arrange that the tasks are not re-enqueued. +Note that +.Fn taskqueue_drain_all +currently does not handle tasks with delayed enqueueing. +.Pp +The +.Fn taskqueue_block +function blocks the taskqueue. +It prevents any enqueued but not running tasks from being executed. +Future calls to +.Fn taskqueue_enqueue +will enqueue tasks, but the tasks will not be run until +.Fn taskqueue_unblock +is called. +Please note that +.Fn taskqueue_block +does not wait for any currently running tasks to finish. +Thus, the +.Fn taskqueue_block +does not provide a guarantee that +.Fn taskqueue_run +is not running after +.Fn taskqueue_block +returns, but it does provide a guarantee that +.Fn taskqueue_run +will not be called again +until +.Fn taskqueue_unblock +is called. +If the caller requires a guarantee that +.Fn taskqueue_run +is not running, then this must be arranged by the caller. +Note that if +.Fn taskqueue_drain +is called on a task that is enqueued on a taskqueue that is blocked by +.Fn taskqueue_block , +then +.Fn taskqueue_drain +can not return until the taskqueue is unblocked. +This can result in a deadlock if the thread blocked in +.Fn taskqueue_drain +is the thread that is supposed to call +.Fn taskqueue_unblock . +Thus, use of +.Fn taskqueue_drain +after +.Fn taskqueue_block +is discouraged, because the state of the task can not be known in advance. +The same caveat applies to +.Fn taskqueue_drain_all . +.Pp +The +.Fn taskqueue_unblock +function unblocks the previously blocked taskqueue. +All enqueued tasks can be run after this call. .Pp The .Fn taskqueue_member Modified: stable/10/sys/kern/subr_taskqueue.c ============================================================================== --- stable/10/sys/kern/subr_taskqueue.c Mon Feb 17 15:29:46 2014 (r262064) +++ stable/10/sys/kern/subr_taskqueue.c Mon Feb 17 15:32:08 2014 (r262065) @@ -285,6 +285,15 @@ taskqueue_enqueue_timeout(struct taskque return (res); } +static void +taskqueue_drain_running(struct taskqueue *queue) +{ + + while (!TAILQ_EMPTY(&queue->tq_active)) + TQ_SLEEP(queue, &queue->tq_active, &queue->tq_mutex, + PWAIT, "-", 0); +} + void taskqueue_block(struct taskqueue *queue) { @@ -337,6 +346,8 @@ taskqueue_run_locked(struct taskqueue *q wakeup(task); } TAILQ_REMOVE(&queue->tq_active, &tb, tb_link); + if (TAILQ_EMPTY(&queue->tq_active)) + wakeup(&queue->tq_active); } void @@ -421,6 +432,25 @@ taskqueue_drain(struct taskqueue *queue, } void +taskqueue_drain_all(struct taskqueue *queue) +{ + struct task *task; + + if (!queue->tq_spin) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); + + TQ_LOCK(queue); + task = STAILQ_LAST(&queue->tq_queue, task, ta_link); + if (task != NULL) + while (task->ta_pending != 0) + TQ_SLEEP(queue, task, &queue->tq_mutex, PWAIT, "-", 0); + taskqueue_drain_running(queue); + KASSERT(STAILQ_EMPTY(&queue->tq_queue), + ("taskqueue queue is not empty after draining")); + TQ_UNLOCK(queue); +} + +void taskqueue_drain_timeout(struct taskqueue *queue, struct timeout_task *timeout_task) { Modified: stable/10/sys/sys/taskqueue.h ============================================================================== --- stable/10/sys/sys/taskqueue.h Mon Feb 17 15:29:46 2014 (r262064) +++ stable/10/sys/sys/taskqueue.h Mon Feb 17 15:32:08 2014 (r262065) @@ -81,6 +81,7 @@ int taskqueue_cancel_timeout(struct task void taskqueue_drain(struct taskqueue *queue, struct task *task); void taskqueue_drain_timeout(struct taskqueue *queue, struct timeout_task *timeout_task); +void taskqueue_drain_all(struct taskqueue *queue); void taskqueue_free(struct taskqueue *queue); void taskqueue_run(struct taskqueue *queue); void taskqueue_block(struct taskqueue *queue); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 15:35:11 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D53A3145; Mon, 17 Feb 2014 15:35: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C01091E1E; Mon, 17 Feb 2014 15:35:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFZBit013888; Mon, 17 Feb 2014 15:35:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFZBhV013887; Mon, 17 Feb 2014 15:35:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171535.s1HFZBhV013887@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:35: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: r262067 - stable/10/cddl/contrib/opensolaris/lib/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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 15:35:11 -0000 Author: avg Date: Mon Feb 17 15:35:11 2014 New Revision: 262067 URL: http://svnweb.freebsd.org/changeset/base/262067 Log: MFC r261122: dtrace: remove unexplained 16MB limitation from dt_alloc/dt_zalloc Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Mon Feb 17 15:33:21 2014 (r262066) +++ stable/10/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Mon Feb 17 15:35:11 2014 (r262067) @@ -734,11 +734,6 @@ dt_zalloc(dtrace_hdl_t *dtp, size_t size { void *data; - if (size > 16 * 1024 * 1024) { - (void) dt_set_errno(dtp, EDT_NOMEM); - return (NULL); - } - if ((data = malloc(size)) == NULL) (void) dt_set_errno(dtp, EDT_NOMEM); else @@ -752,11 +747,6 @@ dt_alloc(dtrace_hdl_t *dtp, size_t size) { void *data; - if (size > 16 * 1024 * 1024) { - (void) dt_set_errno(dtp, EDT_NOMEM); - return (NULL); - } - if ((data = malloc(size)) == NULL) (void) dt_set_errno(dtp, EDT_NOMEM); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 15:35:25 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 395B022F; Mon, 17 Feb 2014 15:35: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 251331E21; Mon, 17 Feb 2014 15:35:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFZPEG013947; Mon, 17 Feb 2014 15:35:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFZP9T013946; Mon, 17 Feb 2014 15:35:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171535.s1HFZP9T013946@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:35: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: r262068 - stable/9/cddl/contrib/opensolaris/lib/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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 15:35:25 -0000 Author: avg Date: Mon Feb 17 15:35:24 2014 New Revision: 262068 URL: http://svnweb.freebsd.org/changeset/base/262068 Log: MFC r261122: dtrace: remove unexplained 16MB limitation from dt_alloc/dt_zalloc Modified: stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.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/libdtrace/common/dt_subr.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Mon Feb 17 15:35:11 2014 (r262067) +++ stable/9/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Mon Feb 17 15:35:24 2014 (r262068) @@ -733,11 +733,6 @@ dt_zalloc(dtrace_hdl_t *dtp, size_t size { void *data; - if (size > 16 * 1024 * 1024) { - (void) dt_set_errno(dtp, EDT_NOMEM); - return (NULL); - } - if ((data = malloc(size)) == NULL) (void) dt_set_errno(dtp, EDT_NOMEM); else @@ -751,11 +746,6 @@ dt_alloc(dtrace_hdl_t *dtp, size_t size) { void *data; - if (size > 16 * 1024 * 1024) { - (void) dt_set_errno(dtp, EDT_NOMEM); - return (NULL); - } - if ((data = malloc(size)) == NULL) (void) dt_set_errno(dtp, EDT_NOMEM); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 15:35:36 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CD5873A6; Mon, 17 Feb 2014 15:35: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B76D51E22; Mon, 17 Feb 2014 15:35:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFZaLd014007; Mon, 17 Feb 2014 15:35:36 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFZa2U014006; Mon, 17 Feb 2014 15:35:36 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171535.s1HFZa2U014006@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:35:36 +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: r262069 - stable/8/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 15:35:36 -0000 Author: avg Date: Mon Feb 17 15:35:36 2014 New Revision: 262069 URL: http://svnweb.freebsd.org/changeset/base/262069 Log: MFC r261122: dtrace: remove unexplained 16MB limitation from dt_alloc/dt_zalloc Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Mon Feb 17 15:35:24 2014 (r262068) +++ stable/8/cddl/contrib/opensolaris/lib/libdtrace/common/dt_subr.c Mon Feb 17 15:35:36 2014 (r262069) @@ -730,11 +730,6 @@ dt_zalloc(dtrace_hdl_t *dtp, size_t size { void *data; - if (size > 16 * 1024 * 1024) { - (void) dt_set_errno(dtp, EDT_NOMEM); - return (NULL); - } - if ((data = malloc(size)) == NULL) (void) dt_set_errno(dtp, EDT_NOMEM); else @@ -748,11 +743,6 @@ dt_alloc(dtrace_hdl_t *dtp, size_t size) { void *data; - if (size > 16 * 1024 * 1024) { - (void) dt_set_errno(dtp, EDT_NOMEM); - return (NULL); - } - if ((data = malloc(size)) == NULL) (void) dt_set_errno(dtp, EDT_NOMEM); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 15:38:10 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C5BA952B; Mon, 17 Feb 2014 15:38: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AF15B1E43; Mon, 17 Feb 2014 15:38:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFcAcf014350; Mon, 17 Feb 2014 15:38:10 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFcAaJ014349; Mon, 17 Feb 2014 15:38:10 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171538.s1HFcAaJ014349@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:38:10 +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: r262070 - stable/10/sys/cddl/compat/opensolaris/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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 15:38:10 -0000 Author: avg Date: Mon Feb 17 15:38:10 2014 New Revision: 262070 URL: http://svnweb.freebsd.org/changeset/base/262070 Log: MFC r258715: opensolaris compat: add taskq_wait emulation Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Feb 17 15:35:36 2014 (r262069) +++ stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Feb 17 15:38:10 2014 (r262070) @@ -166,3 +166,9 @@ taskq_dispatch_ent(taskq_t *tq, task_fun TASK_INIT(&task->tqent_task, prio, taskq_run_ent, task); taskqueue_enqueue(tq->tq_queue, &task->tqent_task); } + +void +taskq_wait(taskq_t *tq) +{ + taskqueue_drain_all(tq->tq_queue); +} From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 15:38:27 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BD0B465F; Mon, 17 Feb 2014 15:38: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8C5B1E48; Mon, 17 Feb 2014 15:38:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFcRXX014414; Mon, 17 Feb 2014 15:38:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFcRZq014413; Mon, 17 Feb 2014 15:38:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171538.s1HFcRZq014413@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:38:27 +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: r262071 - stable/9/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 15:38:27 -0000 Author: avg Date: Mon Feb 17 15:38:27 2014 New Revision: 262071 URL: http://svnweb.freebsd.org/changeset/base/262071 Log: MFC r258715: opensolaris compat: add taskq_wait emulation Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Feb 17 15:38:10 2014 (r262070) +++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Feb 17 15:38:27 2014 (r262071) @@ -166,3 +166,9 @@ taskq_dispatch_ent(taskq_t *tq, task_fun TASK_INIT(&task->tqent_task, prio, taskq_run_ent, task); taskqueue_enqueue(tq->tq_queue, &task->tqent_task); } + +void +taskq_wait(taskq_t *tq) +{ + taskqueue_drain_all(tq->tq_queue); +} From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 15:41:02 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 011067DF; Mon, 17 Feb 2014 15:41: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DB0421F67; Mon, 17 Feb 2014 15:41:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFf1TC015049; Mon, 17 Feb 2014 15:41:01 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFf1Mr015048; Mon, 17 Feb 2014 15:41:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171541.s1HFf1Mr015048@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:41:01 +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: r262072 - stable/8/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 15:41:02 -0000 Author: avg Date: Mon Feb 17 15:41:01 2014 New Revision: 262072 URL: http://svnweb.freebsd.org/changeset/base/262072 Log: MFC r258715: opensolaris compat: add taskq_wait emulation Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Feb 17 15:38:27 2014 (r262071) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Mon Feb 17 15:41:01 2014 (r262072) @@ -166,3 +166,9 @@ taskq_dispatch_ent(taskq_t *tq, task_fun TASK_INIT(&task->tqent_task, prio, taskq_run_ent, task); taskqueue_enqueue(tq->tq_queue, &task->tqent_task); } + +void +taskq_wait(taskq_t *tq) +{ + taskqueue_drain_all(tq->tq_queue); +} From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 15:50:41 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1D2AACF4; Mon, 17 Feb 2014 15:50: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED0801097; Mon, 17 Feb 2014 15:50:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFoeqe018743; Mon, 17 Feb 2014 15:50:40 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFoehW018742; Mon, 17 Feb 2014 15:50:40 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171550.s1HFoehW018742@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:50:40 +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: r262073 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 15:50:41 -0000 Author: avg Date: Mon Feb 17 15:50:40 2014 New Revision: 262073 URL: http://svnweb.freebsd.org/changeset/base/262073 Log: MFC r255226: Add sysctl/tunables for various metaslab variables MFC slacker: pjd Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 15:41:01 2014 (r262072) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 15:50:40 2014 (r262073) @@ -32,6 +32,9 @@ #include #include +SYSCTL_DECL(_vfs_zfs); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); + /* * Allow allocations to switch to gang blocks quickly. We do this to * avoid having to load lots of space_maps in a given txg. There are, @@ -46,6 +49,10 @@ uint64_t metaslab_aliquot = 512ULL << 10; uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */ +TUNABLE_QUAD("vfs.zfs.metaslab.gang_bang", &metaslab_gang_bang); +SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, gang_bang, CTLFLAG_RWTUN, + &metaslab_gang_bang, 0, + "Force gang block allocation for blocks larger than or equal to this value"); /* * The in-core space map representation is more compact than its on-disk form. @@ -62,12 +69,10 @@ int zfs_condense_pct = 200; * in zio_init() unless it has been overridden in /etc/system. */ int zfs_mg_alloc_failures = 0; - -SYSCTL_DECL(_vfs_zfs); -SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_failures, CTLFLAG_RDTUN, +TUNABLE_INT("vfs.zfs.mg_alloc_failures", &zfs_mg_alloc_failures); +SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_failures, CTLFLAG_RWTUN, &zfs_mg_alloc_failures, 0, "Number of allowed allocation failures per vdev"); -TUNABLE_INT("vfs.zfs.mg_alloc_failures", &zfs_mg_alloc_failures); /* * The zfs_mg_noalloc_threshold defines which metaslab groups should @@ -88,6 +93,10 @@ int zfs_mg_noalloc_threshold = 0; * Metaslab debugging: when set, keeps all space maps in core to verify frees. */ static int metaslab_debug = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug", &metaslab_debug); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug, CTLFLAG_RWTUN, &metaslab_debug, + 0, + "Metaslab debugging: when set, keeps all space maps in core to verify frees"); /* * Minimum size which forces the dynamic allocator to change @@ -96,6 +105,11 @@ static int metaslab_debug = 0; * aggressive strategy (i.e search by size rather than offset). */ uint64_t metaslab_df_alloc_threshold = SPA_MAXBLOCKSIZE; +TUNABLE_QUAD("vfs.zfs.metaslab.df_alloc_threshold", + &metaslab_df_alloc_threshold); +SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, df_alloc_threshold, CTLFLAG_RWTUN, + &metaslab_df_alloc_threshold, 0, + "Minimum size which forces the dynamic allocator to change it's allocation strategy"); /* * The minimum free space, in percent, which must be available @@ -104,22 +118,37 @@ uint64_t metaslab_df_alloc_threshold = S * switch to using best-fit allocations. */ int metaslab_df_free_pct = 4; +TUNABLE_INT("vfs.zfs.metaslab.df_free_pct", &metaslab_df_free_pct); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, df_free_pct, CTLFLAG_RWTUN, + &metaslab_df_free_pct, 0, + "The minimum free space, in percent, which must be available in a space map to continue allocations in a first-fit fashion"); /* * A metaslab is considered "free" if it contains a contiguous * segment which is greater than metaslab_min_alloc_size. */ uint64_t metaslab_min_alloc_size = DMU_MAX_ACCESS; +TUNABLE_QUAD("vfs.zfs.metaslab.min_alloc_size", + &metaslab_min_alloc_size); +SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, min_alloc_size, CTLFLAG_RWTUN, + &metaslab_min_alloc_size, 0, + "A metaslab is considered \"free\" if it contains a contiguous segment which is greater than vfs.zfs.metaslab.min_alloc_size"); /* * Max number of space_maps to prefetch. */ int metaslab_prefetch_limit = SPA_DVAS_PER_BP; +TUNABLE_INT("vfs.zfs.metaslab.prefetch_limit", &metaslab_prefetch_limit); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, prefetch_limit, CTLFLAG_RWTUN, + &metaslab_prefetch_limit, 0, "Maximum number of space_maps to prefetch"); /* * Percentage bonus multiplier for metaslabs that are in the bonus area. */ int metaslab_smo_bonus_pct = 150; +TUNABLE_INT("vfs.zfs.metaslab.smo_bonus_pct", &metaslab_smo_bonus_pct); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, smo_bonus_pct, CTLFLAG_RWTUN, + &metaslab_smo_bonus_pct, 0, "Maximum number of space_maps to prefetch"); /* * Should we be willing to write data to degraded vdevs? From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 15:51:20 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 472D3E36; Mon, 17 Feb 2014 15:51: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25D5510F9; Mon, 17 Feb 2014 15:51:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFpK56021445; Mon, 17 Feb 2014 15:51:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFpKmX021444; Mon, 17 Feb 2014 15:51:20 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171551.s1HFpKmX021444@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 15:51:19 +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: r262074 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 15:51:20 -0000 Author: avg Date: Mon Feb 17 15:51:19 2014 New Revision: 262074 URL: http://svnweb.freebsd.org/changeset/base/262074 Log: MFC r255226: Add sysctl/tunables for various metaslab variables MFC slacker: pjd Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 15:50:40 2014 (r262073) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 15:51:19 2014 (r262074) @@ -32,6 +32,9 @@ #include #include +SYSCTL_DECL(_vfs_zfs); +SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); + /* * Allow allocations to switch to gang blocks quickly. We do this to * avoid having to load lots of space_maps in a given txg. There are, @@ -46,6 +49,10 @@ uint64_t metaslab_aliquot = 512ULL << 10; uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */ +TUNABLE_QUAD("vfs.zfs.metaslab.gang_bang", &metaslab_gang_bang); +SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, gang_bang, CTLFLAG_RWTUN, + &metaslab_gang_bang, 0, + "Force gang block allocation for blocks larger than or equal to this value"); /* * The in-core space map representation is more compact than its on-disk form. @@ -62,12 +69,10 @@ int zfs_condense_pct = 200; * in zio_init() unless it has been overridden in /etc/system. */ int zfs_mg_alloc_failures = 0; - -SYSCTL_DECL(_vfs_zfs); -SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_failures, CTLFLAG_RDTUN, +TUNABLE_INT("vfs.zfs.mg_alloc_failures", &zfs_mg_alloc_failures); +SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_failures, CTLFLAG_RWTUN, &zfs_mg_alloc_failures, 0, "Number of allowed allocation failures per vdev"); -TUNABLE_INT("vfs.zfs.mg_alloc_failures", &zfs_mg_alloc_failures); /* * The zfs_mg_noalloc_threshold defines which metaslab groups should @@ -88,6 +93,10 @@ int zfs_mg_noalloc_threshold = 0; * Metaslab debugging: when set, keeps all space maps in core to verify frees. */ static int metaslab_debug = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug", &metaslab_debug); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug, CTLFLAG_RWTUN, &metaslab_debug, + 0, + "Metaslab debugging: when set, keeps all space maps in core to verify frees"); /* * Minimum size which forces the dynamic allocator to change @@ -96,6 +105,11 @@ static int metaslab_debug = 0; * aggressive strategy (i.e search by size rather than offset). */ uint64_t metaslab_df_alloc_threshold = SPA_MAXBLOCKSIZE; +TUNABLE_QUAD("vfs.zfs.metaslab.df_alloc_threshold", + &metaslab_df_alloc_threshold); +SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, df_alloc_threshold, CTLFLAG_RWTUN, + &metaslab_df_alloc_threshold, 0, + "Minimum size which forces the dynamic allocator to change it's allocation strategy"); /* * The minimum free space, in percent, which must be available @@ -104,22 +118,37 @@ uint64_t metaslab_df_alloc_threshold = S * switch to using best-fit allocations. */ int metaslab_df_free_pct = 4; +TUNABLE_INT("vfs.zfs.metaslab.df_free_pct", &metaslab_df_free_pct); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, df_free_pct, CTLFLAG_RWTUN, + &metaslab_df_free_pct, 0, + "The minimum free space, in percent, which must be available in a space map to continue allocations in a first-fit fashion"); /* * A metaslab is considered "free" if it contains a contiguous * segment which is greater than metaslab_min_alloc_size. */ uint64_t metaslab_min_alloc_size = DMU_MAX_ACCESS; +TUNABLE_QUAD("vfs.zfs.metaslab.min_alloc_size", + &metaslab_min_alloc_size); +SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, min_alloc_size, CTLFLAG_RWTUN, + &metaslab_min_alloc_size, 0, + "A metaslab is considered \"free\" if it contains a contiguous segment which is greater than vfs.zfs.metaslab.min_alloc_size"); /* * Max number of space_maps to prefetch. */ int metaslab_prefetch_limit = SPA_DVAS_PER_BP; +TUNABLE_INT("vfs.zfs.metaslab.prefetch_limit", &metaslab_prefetch_limit); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, prefetch_limit, CTLFLAG_RWTUN, + &metaslab_prefetch_limit, 0, "Maximum number of space_maps to prefetch"); /* * Percentage bonus multiplier for metaslabs that are in the bonus area. */ int metaslab_smo_bonus_pct = 150; +TUNABLE_INT("vfs.zfs.metaslab.smo_bonus_pct", &metaslab_smo_bonus_pct); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, smo_bonus_pct, CTLFLAG_RWTUN, + &metaslab_smo_bonus_pct, 0, "Maximum number of space_maps to prefetch"); /* * Should we be willing to write data to degraded vdevs? From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 15:57:17 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93598AB; Mon, 17 Feb 2014 15:57: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DBC31143; Mon, 17 Feb 2014 15:57:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HFvHBN022129; Mon, 17 Feb 2014 15:57:17 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HFvHDv022128; Mon, 17 Feb 2014 15:57:17 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201402171557.s1HFvHDv022128@svn.freebsd.org> From: Bryan Drewery Date: Mon, 17 Feb 2014 15:57: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: r262075 - stable/10/usr.sbin/newsyslog X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 15:57:17 -0000 Author: bdrewery Date: Mon Feb 17 15:57:16 2014 New Revision: 262075 URL: http://svnweb.freebsd.org/changeset/base/262075 Log: MFC r261401: Fix newsyslog(8) to use the size of the file instead of the blocks it takes on disk, as advertised in newsyslog.conf(5). Approved by: bapt (mentor, implicit) Modified: stable/10/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/10/usr.sbin/newsyslog/newsyslog.c Mon Feb 17 15:51:19 2014 (r262074) +++ stable/10/usr.sbin/newsyslog/newsyslog.c Mon Feb 17 15:57:16 2014 (r262075) @@ -2284,7 +2284,7 @@ sizefile(const char *file) if (stat(file, &sb) < 0) return (-1); - return (kbytes(dbtob(sb.st_blocks))); + return (kbytes(sb.st_size)); } /* From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 16:07:58 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CA638688; Mon, 17 Feb 2014 16:07: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B3A44123A; Mon, 17 Feb 2014 16:07:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HG7wRR026559; Mon, 17 Feb 2014 16:07:58 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HG7woK026558; Mon, 17 Feb 2014 16:07:58 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201402171607.s1HG7woK026558@svn.freebsd.org> From: Bryan Drewery Date: Mon, 17 Feb 2014 16:07:58 +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: r262076 - stable/9/usr.sbin/newsyslog X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 16:07:58 -0000 Author: bdrewery Date: Mon Feb 17 16:07:58 2014 New Revision: 262076 URL: http://svnweb.freebsd.org/changeset/base/262076 Log: MFC r261401: Fix newsyslog(8) to use the size of the file instead of the blocks it takes on disk, as advertised in newsyslog.conf(5). Approved by: bapt (mentor, implicit) Modified: stable/9/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/9/usr.sbin/newsyslog/ (props changed) Modified: stable/9/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/9/usr.sbin/newsyslog/newsyslog.c Mon Feb 17 15:57:16 2014 (r262075) +++ stable/9/usr.sbin/newsyslog/newsyslog.c Mon Feb 17 16:07:58 2014 (r262076) @@ -2282,7 +2282,7 @@ sizefile(const char *file) if (stat(file, &sb) < 0) return (-1); - return (kbytes(dbtob(sb.st_blocks))); + return (kbytes(sb.st_size)); } /* From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 16:17:57 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 78F9FDBC; Mon, 17 Feb 2014 16:17: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 63537132E; Mon, 17 Feb 2014 16:17:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGHv8B031180; Mon, 17 Feb 2014 16:17:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGHvQn031179; Mon, 17 Feb 2014 16:17:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171617.s1HGHvQn031179@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:17: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: r262077 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 16:17:57 -0000 Author: avg Date: Mon Feb 17 16:17:56 2014 New Revision: 262077 URL: http://svnweb.freebsd.org/changeset/base/262077 Log: MFC r253441: Manually merge part of vendor import r238583 from Illumos Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:07:58 2014 (r262076) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:17:56 2014 (r262077) @@ -1258,12 +1258,16 @@ vdev_open(vdev_t *vd) vd->vdev_ashift = MAX(ashift, vd->vdev_ashift); } else { /* - * Make sure the alignment requirement hasn't increased. + * Detect if the alignment requirement has increased. + * We don't want to make the pool unavailable, just + * issue a warning instead. */ - if (ashift > vd->vdev_top->vdev_ashift) { - vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, - VDEV_AUX_BAD_LABEL); - return (EINVAL); + if (ashift > vd->vdev_top->vdev_ashift && + vd->vdev_ops->vdev_op_leaf) { + cmn_err(CE_WARN, + "Disk, '%s', has a block alignment that is " + "larger than the pool's alignment\n", + vd->vdev_path); } vd->vdev_max_asize = max_asize; } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 16:18:05 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B173EE3; Mon, 17 Feb 2014 16:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 76FEE1332; Mon, 17 Feb 2014 16:18:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGI5wq031252; Mon, 17 Feb 2014 16:18:05 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGI5iT031251; Mon, 17 Feb 2014 16:18:05 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201402171618.s1HGI5iT031251@svn.freebsd.org> From: Bryan Drewery Date: Mon, 17 Feb 2014 16:18:05 +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: r262078 - stable/8/usr.sbin/newsyslog X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 16:18:05 -0000 Author: bdrewery Date: Mon Feb 17 16:18:04 2014 New Revision: 262078 URL: http://svnweb.freebsd.org/changeset/base/262078 Log: MFC r261401: Fix newsyslog(8) to use the size of the file instead of the blocks it takes on disk, as advertised in newsyslog.conf(5). Approved by: bapt (mentor, implicit) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Mon Feb 17 16:17:56 2014 (r262077) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Mon Feb 17 16:18:04 2014 (r262078) @@ -2248,7 +2248,7 @@ sizefile(const char *file) if (stat(file, &sb) < 0) return (-1); - return (kbytes(dbtob(sb.st_blocks))); + return (kbytes(sb.st_size)); } /* From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 16:18:14 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6E09AFC8; Mon, 17 Feb 2014 16:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 591601334; Mon, 17 Feb 2014 16:18:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGIEON031308; Mon, 17 Feb 2014 16:18:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGIEAA031307; Mon, 17 Feb 2014 16:18:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171618.s1HGIEAA031307@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:18:14 +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: r262079 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 16:18:14 -0000 Author: avg Date: Mon Feb 17 16:18:13 2014 New Revision: 262079 URL: http://svnweb.freebsd.org/changeset/base/262079 Log: MFC r253441: Manually merge part of vendor import r238583 from Illumos Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:18:04 2014 (r262078) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:18:13 2014 (r262079) @@ -1258,12 +1258,16 @@ vdev_open(vdev_t *vd) vd->vdev_ashift = MAX(ashift, vd->vdev_ashift); } else { /* - * Make sure the alignment requirement hasn't increased. + * Detect if the alignment requirement has increased. + * We don't want to make the pool unavailable, just + * issue a warning instead. */ - if (ashift > vd->vdev_top->vdev_ashift) { - vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, - VDEV_AUX_BAD_LABEL); - return (EINVAL); + if (ashift > vd->vdev_top->vdev_ashift && + vd->vdev_ops->vdev_op_leaf) { + cmn_err(CE_WARN, + "Disk, '%s', has a block alignment that is " + "larger than the pool's alignment\n", + vd->vdev_path); } vd->vdev_max_asize = max_asize; } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 16:30:06 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11D1B471; Mon, 17 Feb 2014 16:30: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EFDDC1451; Mon, 17 Feb 2014 16:30:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGU5Wi035607; Mon, 17 Feb 2014 16:30:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGU1nN035561; Mon, 17 Feb 2014 16:30:01 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171630.s1HGU1nN035561@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:30:01 +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: r262080 - in stable/8/sys/cddl/contrib/opensolaris/uts/common: fs/zfs fs/zfs/sys sys/fs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 16:30:06 -0000 Author: avg Date: Mon Feb 17 16:30:01 2014 New Revision: 262080 URL: http://svnweb.freebsd.org/changeset/base/262080 Log: MFC r254591,255753: Enhance the ZFS vdev layer to maintain both a logical and a physical minimum allocation size for devices Note: on this branch the commit is adjusted for absence of U64 type support in sysctl infrastructure. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 16:30:01 2014 (r262080) @@ -5167,7 +5167,7 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd len = l2hdr->b_asize; cdata = zio_data_buf_alloc(len); csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr->b_tmp_cdata, - cdata, l2hdr->b_asize); + cdata, l2hdr->b_asize, (size_t)SPA_MINBLOCKSIZE); if (csize == 0) { /* zero block, indicate that there's nothing to write */ @@ -5407,6 +5407,8 @@ l2arc_add_vdev(spa_t *spa, vdev_t *vd) ASSERT(!l2arc_vdev_present(vd)); + vdev_ashift_optimize(vd); + /* * Create a new l2arc device entry. */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 16:30:01 2014 (r262080) @@ -226,6 +226,27 @@ metaslab_class_space_update(metaslab_cla atomic_add_64(&mc->mc_dspace, dspace_delta); } +void +metaslab_class_minblocksize_update(metaslab_class_t *mc) +{ + metaslab_group_t *mg; + vdev_t *vd; + uint64_t minashift = UINT64_MAX; + + if ((mg = mc->mc_rotor) == NULL) { + mc->mc_minblocksize = SPA_MINBLOCKSIZE; + return; + } + + do { + vd = mg->mg_vd; + if (vd->vdev_ashift < minashift) + minashift = vd->vdev_ashift; + } while ((mg = mg->mg_next) != mc->mc_rotor); + + mc->mc_minblocksize = 1ULL << minashift; +} + uint64_t metaslab_class_get_alloc(metaslab_class_t *mc) { @@ -250,6 +271,12 @@ metaslab_class_get_dspace(metaslab_class return (spa_deflate(mc->mc_spa) ? mc->mc_dspace : mc->mc_space); } +uint64_t +metaslab_class_get_minblocksize(metaslab_class_t *mc) +{ + return (mc->mc_minblocksize); +} + /* * ========================================================================== * Metaslab groups @@ -389,6 +416,7 @@ metaslab_group_activate(metaslab_group_t mgnext->mg_prev = mg; } mc->mc_rotor = mg; + metaslab_class_minblocksize_update(mc); } void @@ -420,6 +448,7 @@ metaslab_group_passivate(metaslab_group_ mg->mg_prev = NULL; mg->mg_next = NULL; + metaslab_class_minblocksize_update(mc); } static void Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:30:01 2014 (r262080) @@ -3500,6 +3500,7 @@ spa_create(const char *pool, nvlist_t *n (error = spa_validate_aux(spa, nvroot, txg, VDEV_ALLOC_ADD)) == 0) { for (int c = 0; c < rvd->vdev_children; c++) { + vdev_ashift_optimize(rvd->vdev_child[c]); vdev_metaslab_set_size(rvd->vdev_child[c]); vdev_expand(rvd->vdev_child[c], txg); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:30:01 2014 (r262080) @@ -506,8 +506,10 @@ spa_config_update(spa_t *spa, int what) */ for (c = 0; c < rvd->vdev_children; c++) { vdev_t *tvd = rvd->vdev_child[c]; - if (tvd->vdev_ms_array == 0) + if (tvd->vdev_ms_array == 0) { + vdev_ashift_optimize(tvd); vdev_metaslab_set_size(tvd); + } vdev_expand(tvd, txg); } } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Mon Feb 17 16:30:01 2014 (r262080) @@ -70,6 +70,7 @@ extern uint64_t metaslab_class_get_alloc extern uint64_t metaslab_class_get_space(metaslab_class_t *mc); extern uint64_t metaslab_class_get_dspace(metaslab_class_t *mc); extern uint64_t metaslab_class_get_deferred(metaslab_class_t *mc); +extern uint64_t metaslab_class_get_minblocksize(metaslab_class_t *mc); extern metaslab_group_t *metaslab_group_create(metaslab_class_t *mc, vdev_t *vd); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Feb 17 16:30:01 2014 (r262080) @@ -50,6 +50,7 @@ struct metaslab_class { uint64_t mc_deferred; /* total deferred frees */ uint64_t mc_space; /* total space (alloc + free) */ uint64_t mc_dspace; /* total deflated space */ + uint64_t mc_minblocksize; }; struct metaslab_group { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Feb 17 16:30:01 2014 (r262080) @@ -93,6 +93,17 @@ struct dsl_dataset; #define SPA_BLOCKSIZES (SPA_MAXBLOCKSHIFT - SPA_MINBLOCKSHIFT + 1) /* + * Maximum supported logical ashift. + * + * The current 8k allocation block size limit is due to the 8k + * aligned/sized operations performed by vdev_probe() on + * vdev_label->vl_pad2. Using another "safe region" for these tests + * would allow the limit to be raised to 16k, at the expense of + * only having 8 available uberblocks in the label area. + */ +#define SPA_MAXASHIFT 13 + +/* * Size of block to hold the configuration data (a packed nvlist) */ #define SPA_CONFIG_BLOCKSIZE (1ULL << 14) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Mon Feb 17 16:30:01 2014 (r262080) @@ -78,6 +78,7 @@ extern void vdev_rele(vdev_t *); extern int vdev_metaslab_init(vdev_t *vd, uint64_t txg); extern void vdev_metaslab_fini(vdev_t *vd); extern void vdev_metaslab_set_size(vdev_t *); +extern void vdev_ashift_optimize(vdev_t *); extern void vdev_expand(vdev_t *vd, uint64_t txg); extern void vdev_split(vdev_t *vd); extern void vdev_deadman(vdev_t *vd); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:30:01 2014 (r262080) @@ -57,7 +57,7 @@ typedef struct vdev_cache_entry vdev_cac * Virtual device operations */ typedef int vdev_open_func_t(vdev_t *vd, uint64_t *size, uint64_t *max_size, - uint64_t *ashift); + uint64_t *logical_ashift, uint64_t *physical_ashift); typedef void vdev_close_func_t(vdev_t *vd); typedef uint64_t vdev_asize_func_t(vdev_t *vd, uint64_t psize); typedef int vdev_io_start_func_t(zio_t *zio); @@ -133,6 +133,24 @@ struct vdev { uint64_t vdev_min_asize; /* min acceptable asize */ uint64_t vdev_max_asize; /* max acceptable asize */ uint64_t vdev_ashift; /* block alignment shift */ + /* + * Logical block alignment shift + * + * The smallest sized/aligned I/O supported by the device. + */ + uint64_t vdev_logical_ashift; + /* + * Physical block alignment shift + * + * The device supports logical I/Os with vdev_logical_ashift + * size/alignment, but optimum performance will be achieved by + * aligning/sizing requests to vdev_physical_ashift. Smaller + * requests may be inflated or incur device level read-modify-write + * operations. + * + * May be 0 to indicate no preference (i.e. use vdev_logical_ashift). + */ + uint64_t vdev_physical_ashift; uint64_t vdev_state; /* see VDEV_STATE_* #defines */ uint64_t vdev_prevstate; /* used when reopening a vdev */ vdev_ops_t *vdev_ops; /* vdev operations */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Mon Feb 17 16:30:01 2014 (r262080) @@ -79,7 +79,7 @@ extern int lz4_decompress(void *src, voi * Compress and decompress data if necessary. */ extern size_t zio_compress_data(enum zio_compress c, void *src, void *dst, - size_t s_len); + size_t s_len, size_t minblocksize); extern int zio_decompress_data(enum zio_compress c, void *src, void *dst, size_t s_len, size_t d_len); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:30:01 2014 (r262080) @@ -52,6 +52,51 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, vdev, CT * Virtual device management. */ +/** + * The limit for ZFS to automatically increase a top-level vdev's ashift + * from logical ashift to physical ashift. + * + * Example: one or more 512B emulation child vdevs + * child->vdev_ashift = 9 (512 bytes) + * child->vdev_physical_ashift = 12 (4096 bytes) + * zfs_max_auto_ashift = 11 (2048 bytes) + * + * On pool creation or the addition of a new top-leve vdev, ZFS will + * bump the ashift of the top-level vdev to 2048. + * + * Example: one or more 512B emulation child vdevs + * child->vdev_ashift = 9 (512 bytes) + * child->vdev_physical_ashift = 12 (4096 bytes) + * zfs_max_auto_ashift = 13 (8192 bytes) + * + * On pool creation or the addition of a new top-leve vdev, ZFS will + * bump the ashift of the top-level vdev to 4096. + */ +static uint64_t zfs_max_auto_ashift = SPA_MAXASHIFT; + +static int +sysctl_vfs_zfs_max_auto_ashift(SYSCTL_HANDLER_ARGS) +{ + uint64_t val; + int err; + + val = zfs_max_auto_ashift; + err = sysctl_handle_quad(oidp, &val, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + if (val > SPA_MAXASHIFT) + val = SPA_MAXASHIFT; + + zfs_max_auto_ashift = val; + + return (0); +} +SYSCTL_PROC(_vfs_zfs, OID_AUTO, max_auto_ashift, + CTLTYPE_QUAD | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(uint64_t), + sysctl_vfs_zfs_max_auto_ashift, "Q", + "Cap on logical -> physical ashift adjustment on new top-level vdevs."); + static vdev_ops_t *vdev_ops_table[] = { &vdev_root_ops, &vdev_raidz_ops, @@ -746,6 +791,8 @@ vdev_add_parent(vdev_t *cvd, vdev_ops_t mvd->vdev_min_asize = cvd->vdev_min_asize; mvd->vdev_max_asize = cvd->vdev_max_asize; mvd->vdev_ashift = cvd->vdev_ashift; + mvd->vdev_logical_ashift = cvd->vdev_logical_ashift; + mvd->vdev_physical_ashift = cvd->vdev_physical_ashift; mvd->vdev_state = cvd->vdev_state; mvd->vdev_crtxg = cvd->vdev_crtxg; @@ -777,6 +824,8 @@ vdev_remove_parent(vdev_t *cvd) mvd->vdev_ops == &vdev_replacing_ops || mvd->vdev_ops == &vdev_spare_ops); cvd->vdev_ashift = mvd->vdev_ashift; + cvd->vdev_logical_ashift = mvd->vdev_logical_ashift; + cvd->vdev_physical_ashift = mvd->vdev_physical_ashift; vdev_remove_child(mvd, cvd); vdev_remove_child(pvd, mvd); @@ -1120,7 +1169,8 @@ vdev_open(vdev_t *vd) uint64_t osize = 0; uint64_t max_osize = 0; uint64_t asize, max_asize, psize; - uint64_t ashift = 0; + uint64_t logical_ashift = 0; + uint64_t physical_ashift = 0; ASSERT(vd->vdev_open_thread == curthread || spa_config_held(spa, SCL_STATE_ALL, RW_WRITER) == SCL_STATE_ALL); @@ -1150,7 +1200,8 @@ vdev_open(vdev_t *vd) return (SET_ERROR(ENXIO)); } - error = vd->vdev_ops->vdev_op_open(vd, &osize, &max_osize, &ashift); + error = vd->vdev_ops->vdev_op_open(vd, &osize, &max_osize, + &logical_ashift, &physical_ashift); /* * Reset the vdev_reopening flag so that we actually close @@ -1248,6 +1299,17 @@ vdev_open(vdev_t *vd) return (SET_ERROR(EINVAL)); } + vd->vdev_physical_ashift = + MAX(physical_ashift, vd->vdev_physical_ashift); + vd->vdev_logical_ashift = MAX(logical_ashift, vd->vdev_logical_ashift); + vd->vdev_ashift = MAX(vd->vdev_logical_ashift, vd->vdev_ashift); + + if (vd->vdev_logical_ashift > SPA_MAXASHIFT) { + vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, + VDEV_AUX_ASHIFT_TOO_BIG); + return (EINVAL); + } + if (vd->vdev_asize == 0) { /* * This is the first-ever open, so use the computed values. @@ -1255,19 +1317,15 @@ vdev_open(vdev_t *vd) */ vd->vdev_asize = asize; vd->vdev_max_asize = max_asize; - vd->vdev_ashift = MAX(ashift, vd->vdev_ashift); } else { /* - * Detect if the alignment requirement has increased. - * We don't want to make the pool unavailable, just - * issue a warning instead. + * Make sure the alignment requirement hasn't increased. */ - if (ashift > vd->vdev_top->vdev_ashift && + if (vd->vdev_ashift > vd->vdev_top->vdev_ashift && vd->vdev_ops->vdev_op_leaf) { - cmn_err(CE_WARN, - "Disk, '%s', has a block alignment that is " - "larger than the pool's alignment\n", - vd->vdev_path); + vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, + VDEV_AUX_BAD_LABEL); + return (EINVAL); } vd->vdev_max_asize = max_asize; } @@ -1577,6 +1635,23 @@ vdev_metaslab_set_size(vdev_t *vd) vd->vdev_ms_shift = MAX(vd->vdev_ms_shift, SPA_MAXBLOCKSHIFT); } +/* + * Maximize performance by inflating the configured ashift for + * top level vdevs to be as close to the physical ashift as + * possible without exceeding the administrator specified + * limit. + */ +void +vdev_ashift_optimize(vdev_t *vd) +{ + if (vd == vd->vdev_top && + (vd->vdev_ashift < vd->vdev_physical_ashift) && + (vd->vdev_ashift < zfs_max_auto_ashift)) { + vd->vdev_ashift = MIN(zfs_max_auto_ashift, + vd->vdev_physical_ashift); + } +} + void vdev_dirty(vdev_t *vd, int flags, void *arg, uint64_t txg) { @@ -2503,6 +2578,10 @@ vdev_get_stats(vdev_t *vd, vdev_stat_t * if (vd->vdev_ops->vdev_op_leaf) vs->vs_rsize += VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE; vs->vs_esize = vd->vdev_max_asize - vd->vdev_asize; + vs->vs_configured_ashift = vd->vdev_top != NULL + ? vd->vdev_top->vdev_ashift : vd->vdev_ashift; + vs->vs_logical_ashift = vd->vdev_logical_ashift; + vs->vs_physical_ashift = vd->vdev_physical_ashift; mutex_exit(&vd->vdev_stat_lock); /* Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Feb 17 16:30:01 2014 (r262080) @@ -49,7 +49,7 @@ vdev_file_rele(vdev_t *vd) static int vdev_file_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { vdev_file_t *vf; vnode_t *vp; @@ -132,7 +132,8 @@ skip_open: } *max_psize = *psize = vattr.va_size; - *ashift = SPA_MINBLOCKSHIFT; + *logical_ashift = SPA_MINBLOCKSHIFT; + *physical_ashift = SPA_MINBLOCKSHIFT; return (0); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Feb 17 16:30:01 2014 (r262080) @@ -576,7 +576,7 @@ vdev_geom_open_by_path(vdev_t *vd, int c static int vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { struct g_provider *pp; struct g_consumer *cp; @@ -662,9 +662,13 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi *max_psize = *psize = pp->mediasize; /* - * Determine the device's minimum transfer size. + * Determine the device's minimum transfer size and preferred + * transfer size. */ - *ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; + *logical_ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; + *physical_ashift = 0; + if (pp->stripesize) + *physical_ashift = highbit(pp->stripesize) - 1; /* * Clear the nowritecache settings, so that on a vdev_reopen() Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Mon Feb 17 16:30:01 2014 (r262080) @@ -132,7 +132,7 @@ vdev_mirror_map_alloc(zio_t *zio) static int vdev_mirror_open(vdev_t *vd, uint64_t *asize, uint64_t *max_asize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { int numerrors = 0; int lasterror = 0; @@ -155,7 +155,9 @@ vdev_mirror_open(vdev_t *vd, uint64_t *a *asize = MIN(*asize - 1, cvd->vdev_asize - 1) + 1; *max_asize = MIN(*max_asize - 1, cvd->vdev_max_asize - 1) + 1; - *ashift = MAX(*ashift, cvd->vdev_ashift); + *logical_ashift = MAX(*logical_ashift, cvd->vdev_ashift); + *physical_ashift = MAX(*physical_ashift, + cvd->vdev_physical_ashift); } if (numerrors == vd->vdev_children) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Mon Feb 17 16:30:01 2014 (r262080) @@ -45,7 +45,7 @@ /* ARGSUSED */ static int vdev_missing_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { /* * Really this should just fail. But then the root vdev will be in the @@ -55,7 +55,8 @@ vdev_missing_open(vdev_t *vd, uint64_t * */ *psize = 0; *max_psize = 0; - *ashift = 0; + *logical_ashift = 0; + *physical_ashift = 0; return (0); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 16:30:01 2014 (r262080) @@ -1478,7 +1478,7 @@ vdev_raidz_reconstruct(raidz_map_t *rm, static int vdev_raidz_open(vdev_t *vd, uint64_t *asize, uint64_t *max_asize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { vdev_t *cvd; uint64_t nparity = vd->vdev_nparity; @@ -1507,7 +1507,9 @@ vdev_raidz_open(vdev_t *vd, uint64_t *as *asize = MIN(*asize - 1, cvd->vdev_asize - 1) + 1; *max_asize = MIN(*max_asize - 1, cvd->vdev_max_asize - 1) + 1; - *ashift = MAX(*ashift, cvd->vdev_ashift); + *logical_ashift = MAX(*logical_ashift, cvd->vdev_ashift); + *physical_ashift = MAX(*physical_ashift, + cvd->vdev_physical_ashift); } *asize *= vd->vdev_children; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c Mon Feb 17 16:30:01 2014 (r262080) @@ -55,7 +55,7 @@ too_many_errors(vdev_t *vd, int numerror static int vdev_root_open(vdev_t *vd, uint64_t *asize, uint64_t *max_asize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { int lasterror = 0; int numerrors = 0; @@ -83,7 +83,8 @@ vdev_root_open(vdev_t *vd, uint64_t *asi *asize = 0; *max_asize = 0; - *ashift = 0; + *logical_ashift = 0; + *physical_ashift = 0; return (0); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:30:01 2014 (r262080) @@ -1091,8 +1091,10 @@ zio_write_bp_init(zio_t *zio) } if (compress != ZIO_COMPRESS_OFF) { + metaslab_class_t *mc = spa_normal_class(spa); void *cbuf = zio_buf_alloc(lsize); - psize = zio_compress_data(compress, zio->io_data, cbuf, lsize); + psize = zio_compress_data(compress, zio->io_data, cbuf, lsize, + (size_t)metaslab_class_get_minblocksize(mc)); if (psize == 0 || psize == lsize) { compress = ZIO_COMPRESS_OFF; zio_buf_free(cbuf, lsize); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Mon Feb 17 16:30:01 2014 (r262080) @@ -77,7 +77,8 @@ zio_compress_select(enum zio_compress ch } size_t -zio_compress_data(enum zio_compress c, void *src, void *dst, size_t s_len) +zio_compress_data(enum zio_compress c, void *src, void *dst, size_t s_len, + size_t minblocksize) { uint64_t *word, *word_end; size_t c_len, d_len, r_len; @@ -102,7 +103,7 @@ zio_compress_data(enum zio_compress c, v return (s_len); /* Compress at least 12.5% */ - d_len = P2ALIGN(s_len - (s_len >> 3), (size_t)SPA_MINBLOCKSIZE); + d_len = P2ALIGN(s_len - (s_len >> 3), minblocksize); if (d_len == 0) return (s_len); @@ -115,14 +116,14 @@ zio_compress_data(enum zio_compress c, v * Cool. We compressed at least as much as we were hoping to. * For both security and repeatability, pad out the last sector. */ - r_len = P2ROUNDUP(c_len, (size_t)SPA_MINBLOCKSIZE); + r_len = P2ROUNDUP(c_len, minblocksize); if (r_len > c_len) { bzero((char *)dst + c_len, r_len - c_len); c_len = r_len; } ASSERT3U(c_len, <=, d_len); - ASSERT(P2PHASE(c_len, (size_t)SPA_MINBLOCKSIZE) == 0); + ASSERT(P2PHASE(c_len, minblocksize) == 0); return (c_len); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:18:13 2014 (r262079) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:30:01 2014 (r262080) @@ -620,7 +620,8 @@ typedef enum vdev_aux { VDEV_AUX_IO_FAILURE, /* experienced I/O failure */ VDEV_AUX_BAD_LOG, /* cannot read log chain(s) */ VDEV_AUX_EXTERNAL, /* external diagnosis */ - VDEV_AUX_SPLIT_POOL /* vdev was split off into another pool */ + VDEV_AUX_SPLIT_POOL, /* vdev was split off into another pool */ + VDEV_AUX_ASHIFT_TOO_BIG /* vdev's min block size is too large */ } vdev_aux_t; /* @@ -714,7 +715,13 @@ typedef struct vdev_stat { uint64_t vs_self_healed; /* self-healed bytes */ uint64_t vs_scan_removing; /* removing? */ uint64_t vs_scan_processed; /* scan processed bytes */ + uint64_t vs_configured_ashift; /* TLV vdev_ashift */ + uint64_t vs_logical_ashift; /* vdev_logical_ashift */ + uint64_t vs_physical_ashift; /* vdev_physical_ashift */ } vdev_stat_t; +#define VDEV_STAT_VALID(field, uint64_t_field_count) \ + ((uint64_t_field_count * sizeof(uint64_t)) >= \ + (offsetof(vdev_stat_t, field) + sizeof(((vdev_stat_t *)NULL)->field))) /* * DDT statistics. Note: all fields should be 64-bit because this From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 16:30:23 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2E3895B6; Mon, 17 Feb 2014 16:30: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1549614C5; Mon, 17 Feb 2014 16:30:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGUN3f035981; Mon, 17 Feb 2014 16:30:23 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGUINE035956; Mon, 17 Feb 2014 16:30:18 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171630.s1HGUINE035956@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:30:18 +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: r262081 - in stable/9/sys/cddl/contrib/opensolaris/uts/common: fs/zfs fs/zfs/sys sys/fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 16:30:23 -0000 Author: avg Date: Mon Feb 17 16:30:18 2014 New Revision: 262081 URL: http://svnweb.freebsd.org/changeset/base/262081 Log: MFC r254591,255753: Enhance the ZFS vdev layer to maintain both a logical and a physical minimum allocation size for devices Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 16:30:18 2014 (r262081) @@ -5197,7 +5197,7 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd len = l2hdr->b_asize; cdata = zio_data_buf_alloc(len); csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr->b_tmp_cdata, - cdata, l2hdr->b_asize); + cdata, l2hdr->b_asize, (size_t)SPA_MINBLOCKSIZE); if (csize == 0) { /* zero block, indicate that there's nothing to write */ @@ -5437,6 +5437,8 @@ l2arc_add_vdev(spa_t *spa, vdev_t *vd) ASSERT(!l2arc_vdev_present(vd)); + vdev_ashift_optimize(vd); + /* * Create a new l2arc device entry. */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 16:30:18 2014 (r262081) @@ -226,6 +226,27 @@ metaslab_class_space_update(metaslab_cla atomic_add_64(&mc->mc_dspace, dspace_delta); } +void +metaslab_class_minblocksize_update(metaslab_class_t *mc) +{ + metaslab_group_t *mg; + vdev_t *vd; + uint64_t minashift = UINT64_MAX; + + if ((mg = mc->mc_rotor) == NULL) { + mc->mc_minblocksize = SPA_MINBLOCKSIZE; + return; + } + + do { + vd = mg->mg_vd; + if (vd->vdev_ashift < minashift) + minashift = vd->vdev_ashift; + } while ((mg = mg->mg_next) != mc->mc_rotor); + + mc->mc_minblocksize = 1ULL << minashift; +} + uint64_t metaslab_class_get_alloc(metaslab_class_t *mc) { @@ -250,6 +271,12 @@ metaslab_class_get_dspace(metaslab_class return (spa_deflate(mc->mc_spa) ? mc->mc_dspace : mc->mc_space); } +uint64_t +metaslab_class_get_minblocksize(metaslab_class_t *mc) +{ + return (mc->mc_minblocksize); +} + /* * ========================================================================== * Metaslab groups @@ -389,6 +416,7 @@ metaslab_group_activate(metaslab_group_t mgnext->mg_prev = mg; } mc->mc_rotor = mg; + metaslab_class_minblocksize_update(mc); } void @@ -420,6 +448,7 @@ metaslab_group_passivate(metaslab_group_ mg->mg_prev = NULL; mg->mg_next = NULL; + metaslab_class_minblocksize_update(mc); } static void Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:30:18 2014 (r262081) @@ -3505,6 +3505,7 @@ spa_create(const char *pool, nvlist_t *n (error = spa_validate_aux(spa, nvroot, txg, VDEV_ALLOC_ADD)) == 0) { for (int c = 0; c < rvd->vdev_children; c++) { + vdev_ashift_optimize(rvd->vdev_child[c]); vdev_metaslab_set_size(rvd->vdev_child[c]); vdev_expand(rvd->vdev_child[c], txg); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:30:18 2014 (r262081) @@ -514,8 +514,10 @@ spa_config_update(spa_t *spa, int what) */ for (c = 0; c < rvd->vdev_children; c++) { vdev_t *tvd = rvd->vdev_child[c]; - if (tvd->vdev_ms_array == 0) + if (tvd->vdev_ms_array == 0) { + vdev_ashift_optimize(tvd); vdev_metaslab_set_size(tvd); + } vdev_expand(tvd, txg); } } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h Mon Feb 17 16:30:18 2014 (r262081) @@ -70,6 +70,7 @@ extern uint64_t metaslab_class_get_alloc extern uint64_t metaslab_class_get_space(metaslab_class_t *mc); extern uint64_t metaslab_class_get_dspace(metaslab_class_t *mc); extern uint64_t metaslab_class_get_deferred(metaslab_class_t *mc); +extern uint64_t metaslab_class_get_minblocksize(metaslab_class_t *mc); extern metaslab_group_t *metaslab_group_create(metaslab_class_t *mc, vdev_t *vd); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h Mon Feb 17 16:30:18 2014 (r262081) @@ -50,6 +50,7 @@ struct metaslab_class { uint64_t mc_deferred; /* total deferred frees */ uint64_t mc_space; /* total space (alloc + free) */ uint64_t mc_dspace; /* total deflated space */ + uint64_t mc_minblocksize; }; struct metaslab_group { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Mon Feb 17 16:30:18 2014 (r262081) @@ -93,6 +93,17 @@ struct dsl_dataset; #define SPA_BLOCKSIZES (SPA_MAXBLOCKSHIFT - SPA_MINBLOCKSHIFT + 1) /* + * Maximum supported logical ashift. + * + * The current 8k allocation block size limit is due to the 8k + * aligned/sized operations performed by vdev_probe() on + * vdev_label->vl_pad2. Using another "safe region" for these tests + * would allow the limit to be raised to 16k, at the expense of + * only having 8 available uberblocks in the label area. + */ +#define SPA_MAXASHIFT 13 + +/* * Size of block to hold the configuration data (a packed nvlist) */ #define SPA_CONFIG_BLOCKSIZE (1ULL << 14) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h Mon Feb 17 16:30:18 2014 (r262081) @@ -78,6 +78,7 @@ extern void vdev_rele(vdev_t *); extern int vdev_metaslab_init(vdev_t *vd, uint64_t txg); extern void vdev_metaslab_fini(vdev_t *vd); extern void vdev_metaslab_set_size(vdev_t *); +extern void vdev_ashift_optimize(vdev_t *); extern void vdev_expand(vdev_t *vd, uint64_t txg); extern void vdev_split(vdev_t *vd); extern void vdev_deadman(vdev_t *vd); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:30:18 2014 (r262081) @@ -57,7 +57,7 @@ typedef struct vdev_cache_entry vdev_cac * Virtual device operations */ typedef int vdev_open_func_t(vdev_t *vd, uint64_t *size, uint64_t *max_size, - uint64_t *ashift); + uint64_t *logical_ashift, uint64_t *physical_ashift); typedef void vdev_close_func_t(vdev_t *vd); typedef uint64_t vdev_asize_func_t(vdev_t *vd, uint64_t psize); typedef int vdev_io_start_func_t(zio_t *zio); @@ -133,6 +133,24 @@ struct vdev { uint64_t vdev_min_asize; /* min acceptable asize */ uint64_t vdev_max_asize; /* max acceptable asize */ uint64_t vdev_ashift; /* block alignment shift */ + /* + * Logical block alignment shift + * + * The smallest sized/aligned I/O supported by the device. + */ + uint64_t vdev_logical_ashift; + /* + * Physical block alignment shift + * + * The device supports logical I/Os with vdev_logical_ashift + * size/alignment, but optimum performance will be achieved by + * aligning/sizing requests to vdev_physical_ashift. Smaller + * requests may be inflated or incur device level read-modify-write + * operations. + * + * May be 0 to indicate no preference (i.e. use vdev_logical_ashift). + */ + uint64_t vdev_physical_ashift; uint64_t vdev_state; /* see VDEV_STATE_* #defines */ uint64_t vdev_prevstate; /* used when reopening a vdev */ vdev_ops_t *vdev_ops; /* vdev operations */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Mon Feb 17 16:30:18 2014 (r262081) @@ -79,7 +79,7 @@ extern int lz4_decompress(void *src, voi * Compress and decompress data if necessary. */ extern size_t zio_compress_data(enum zio_compress c, void *src, void *dst, - size_t s_len); + size_t s_len, size_t minblocksize); extern int zio_decompress_data(enum zio_compress c, void *src, void *dst, size_t s_len, size_t d_len); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:30:18 2014 (r262081) @@ -52,6 +52,51 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, vdev, CT * Virtual device management. */ +/** + * The limit for ZFS to automatically increase a top-level vdev's ashift + * from logical ashift to physical ashift. + * + * Example: one or more 512B emulation child vdevs + * child->vdev_ashift = 9 (512 bytes) + * child->vdev_physical_ashift = 12 (4096 bytes) + * zfs_max_auto_ashift = 11 (2048 bytes) + * + * On pool creation or the addition of a new top-leve vdev, ZFS will + * bump the ashift of the top-level vdev to 2048. + * + * Example: one or more 512B emulation child vdevs + * child->vdev_ashift = 9 (512 bytes) + * child->vdev_physical_ashift = 12 (4096 bytes) + * zfs_max_auto_ashift = 13 (8192 bytes) + * + * On pool creation or the addition of a new top-leve vdev, ZFS will + * bump the ashift of the top-level vdev to 4096. + */ +static uint64_t zfs_max_auto_ashift = SPA_MAXASHIFT; + +static int +sysctl_vfs_zfs_max_auto_ashift(SYSCTL_HANDLER_ARGS) +{ + uint64_t val; + int err; + + val = zfs_max_auto_ashift; + err = sysctl_handle_64(oidp, &val, 0, req); + if (err != 0 || req->newptr == NULL) + return (err); + + if (val > SPA_MAXASHIFT) + val = SPA_MAXASHIFT; + + zfs_max_auto_ashift = val; + + return (0); +} +SYSCTL_PROC(_vfs_zfs, OID_AUTO, max_auto_ashift, + CTLTYPE_U64 | CTLFLAG_MPSAFE | CTLFLAG_RW, 0, sizeof(uint64_t), + sysctl_vfs_zfs_max_auto_ashift, "QU", + "Cap on logical -> physical ashift adjustment on new top-level vdevs."); + static vdev_ops_t *vdev_ops_table[] = { &vdev_root_ops, &vdev_raidz_ops, @@ -746,6 +791,8 @@ vdev_add_parent(vdev_t *cvd, vdev_ops_t mvd->vdev_min_asize = cvd->vdev_min_asize; mvd->vdev_max_asize = cvd->vdev_max_asize; mvd->vdev_ashift = cvd->vdev_ashift; + mvd->vdev_logical_ashift = cvd->vdev_logical_ashift; + mvd->vdev_physical_ashift = cvd->vdev_physical_ashift; mvd->vdev_state = cvd->vdev_state; mvd->vdev_crtxg = cvd->vdev_crtxg; @@ -777,6 +824,8 @@ vdev_remove_parent(vdev_t *cvd) mvd->vdev_ops == &vdev_replacing_ops || mvd->vdev_ops == &vdev_spare_ops); cvd->vdev_ashift = mvd->vdev_ashift; + cvd->vdev_logical_ashift = mvd->vdev_logical_ashift; + cvd->vdev_physical_ashift = mvd->vdev_physical_ashift; vdev_remove_child(mvd, cvd); vdev_remove_child(pvd, mvd); @@ -1120,7 +1169,8 @@ vdev_open(vdev_t *vd) uint64_t osize = 0; uint64_t max_osize = 0; uint64_t asize, max_asize, psize; - uint64_t ashift = 0; + uint64_t logical_ashift = 0; + uint64_t physical_ashift = 0; ASSERT(vd->vdev_open_thread == curthread || spa_config_held(spa, SCL_STATE_ALL, RW_WRITER) == SCL_STATE_ALL); @@ -1150,7 +1200,8 @@ vdev_open(vdev_t *vd) return (SET_ERROR(ENXIO)); } - error = vd->vdev_ops->vdev_op_open(vd, &osize, &max_osize, &ashift); + error = vd->vdev_ops->vdev_op_open(vd, &osize, &max_osize, + &logical_ashift, &physical_ashift); /* * Reset the vdev_reopening flag so that we actually close @@ -1248,6 +1299,17 @@ vdev_open(vdev_t *vd) return (SET_ERROR(EINVAL)); } + vd->vdev_physical_ashift = + MAX(physical_ashift, vd->vdev_physical_ashift); + vd->vdev_logical_ashift = MAX(logical_ashift, vd->vdev_logical_ashift); + vd->vdev_ashift = MAX(vd->vdev_logical_ashift, vd->vdev_ashift); + + if (vd->vdev_logical_ashift > SPA_MAXASHIFT) { + vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, + VDEV_AUX_ASHIFT_TOO_BIG); + return (EINVAL); + } + if (vd->vdev_asize == 0) { /* * This is the first-ever open, so use the computed values. @@ -1255,19 +1317,15 @@ vdev_open(vdev_t *vd) */ vd->vdev_asize = asize; vd->vdev_max_asize = max_asize; - vd->vdev_ashift = MAX(ashift, vd->vdev_ashift); } else { /* - * Detect if the alignment requirement has increased. - * We don't want to make the pool unavailable, just - * issue a warning instead. + * Make sure the alignment requirement hasn't increased. */ - if (ashift > vd->vdev_top->vdev_ashift && + if (vd->vdev_ashift > vd->vdev_top->vdev_ashift && vd->vdev_ops->vdev_op_leaf) { - cmn_err(CE_WARN, - "Disk, '%s', has a block alignment that is " - "larger than the pool's alignment\n", - vd->vdev_path); + vdev_set_state(vd, B_TRUE, VDEV_STATE_CANT_OPEN, + VDEV_AUX_BAD_LABEL); + return (EINVAL); } vd->vdev_max_asize = max_asize; } @@ -1577,6 +1635,23 @@ vdev_metaslab_set_size(vdev_t *vd) vd->vdev_ms_shift = MAX(vd->vdev_ms_shift, SPA_MAXBLOCKSHIFT); } +/* + * Maximize performance by inflating the configured ashift for + * top level vdevs to be as close to the physical ashift as + * possible without exceeding the administrator specified + * limit. + */ +void +vdev_ashift_optimize(vdev_t *vd) +{ + if (vd == vd->vdev_top && + (vd->vdev_ashift < vd->vdev_physical_ashift) && + (vd->vdev_ashift < zfs_max_auto_ashift)) { + vd->vdev_ashift = MIN(zfs_max_auto_ashift, + vd->vdev_physical_ashift); + } +} + void vdev_dirty(vdev_t *vd, int flags, void *arg, uint64_t txg) { @@ -2511,6 +2586,10 @@ vdev_get_stats(vdev_t *vd, vdev_stat_t * if (vd->vdev_ops->vdev_op_leaf) vs->vs_rsize += VDEV_LABEL_START_SIZE + VDEV_LABEL_END_SIZE; vs->vs_esize = vd->vdev_max_asize - vd->vdev_asize; + vs->vs_configured_ashift = vd->vdev_top != NULL + ? vd->vdev_top->vdev_ashift : vd->vdev_ashift; + vs->vs_logical_ashift = vd->vdev_logical_ashift; + vs->vs_physical_ashift = vd->vdev_physical_ashift; mutex_exit(&vd->vdev_stat_lock); /* Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c Mon Feb 17 16:30:18 2014 (r262081) @@ -49,7 +49,7 @@ vdev_file_rele(vdev_t *vd) static int vdev_file_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { vdev_file_t *vf; vnode_t *vp; @@ -132,7 +132,8 @@ skip_open: } *max_psize = *psize = vattr.va_size; - *ashift = SPA_MINBLOCKSHIFT; + *logical_ashift = SPA_MINBLOCKSHIFT; + *physical_ashift = SPA_MINBLOCKSHIFT; return (0); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Feb 17 16:30:18 2014 (r262081) @@ -576,7 +576,7 @@ vdev_geom_open_by_path(vdev_t *vd, int c static int vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { struct g_provider *pp; struct g_consumer *cp; @@ -662,9 +662,13 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi *max_psize = *psize = pp->mediasize; /* - * Determine the device's minimum transfer size. + * Determine the device's minimum transfer size and preferred + * transfer size. */ - *ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; + *logical_ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1; + *physical_ashift = 0; + if (pp->stripesize) + *physical_ashift = highbit(pp->stripesize) - 1; /* * Clear the nowritecache settings, so that on a vdev_reopen() Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c Mon Feb 17 16:30:18 2014 (r262081) @@ -132,7 +132,7 @@ vdev_mirror_map_alloc(zio_t *zio) static int vdev_mirror_open(vdev_t *vd, uint64_t *asize, uint64_t *max_asize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { int numerrors = 0; int lasterror = 0; @@ -155,7 +155,9 @@ vdev_mirror_open(vdev_t *vd, uint64_t *a *asize = MIN(*asize - 1, cvd->vdev_asize - 1) + 1; *max_asize = MIN(*max_asize - 1, cvd->vdev_max_asize - 1) + 1; - *ashift = MAX(*ashift, cvd->vdev_ashift); + *logical_ashift = MAX(*logical_ashift, cvd->vdev_ashift); + *physical_ashift = MAX(*physical_ashift, + cvd->vdev_physical_ashift); } if (numerrors == vd->vdev_children) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c Mon Feb 17 16:30:18 2014 (r262081) @@ -45,7 +45,7 @@ /* ARGSUSED */ static int vdev_missing_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { /* * Really this should just fail. But then the root vdev will be in the @@ -55,7 +55,8 @@ vdev_missing_open(vdev_t *vd, uint64_t * */ *psize = 0; *max_psize = 0; - *ashift = 0; + *logical_ashift = 0; + *physical_ashift = 0; return (0); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 16:30:18 2014 (r262081) @@ -1478,7 +1478,7 @@ vdev_raidz_reconstruct(raidz_map_t *rm, static int vdev_raidz_open(vdev_t *vd, uint64_t *asize, uint64_t *max_asize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { vdev_t *cvd; uint64_t nparity = vd->vdev_nparity; @@ -1507,7 +1507,9 @@ vdev_raidz_open(vdev_t *vd, uint64_t *as *asize = MIN(*asize - 1, cvd->vdev_asize - 1) + 1; *max_asize = MIN(*max_asize - 1, cvd->vdev_max_asize - 1) + 1; - *ashift = MAX(*ashift, cvd->vdev_ashift); + *logical_ashift = MAX(*logical_ashift, cvd->vdev_ashift); + *physical_ashift = MAX(*physical_ashift, + cvd->vdev_physical_ashift); } *asize *= vd->vdev_children; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c Mon Feb 17 16:30:18 2014 (r262081) @@ -55,7 +55,7 @@ too_many_errors(vdev_t *vd, int numerror static int vdev_root_open(vdev_t *vd, uint64_t *asize, uint64_t *max_asize, - uint64_t *ashift) + uint64_t *logical_ashift, uint64_t *physical_ashift) { int lasterror = 0; int numerrors = 0; @@ -83,7 +83,8 @@ vdev_root_open(vdev_t *vd, uint64_t *asi *asize = 0; *max_asize = 0; - *ashift = 0; + *logical_ashift = 0; + *physical_ashift = 0; return (0); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:30:18 2014 (r262081) @@ -1092,8 +1092,10 @@ zio_write_bp_init(zio_t *zio) } if (compress != ZIO_COMPRESS_OFF) { + metaslab_class_t *mc = spa_normal_class(spa); void *cbuf = zio_buf_alloc(lsize); - psize = zio_compress_data(compress, zio->io_data, cbuf, lsize); + psize = zio_compress_data(compress, zio->io_data, cbuf, lsize, + (size_t)metaslab_class_get_minblocksize(mc)); if (psize == 0 || psize == lsize) { compress = ZIO_COMPRESS_OFF; zio_buf_free(cbuf, lsize); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Mon Feb 17 16:30:18 2014 (r262081) @@ -77,7 +77,8 @@ zio_compress_select(enum zio_compress ch } size_t -zio_compress_data(enum zio_compress c, void *src, void *dst, size_t s_len) +zio_compress_data(enum zio_compress c, void *src, void *dst, size_t s_len, + size_t minblocksize) { uint64_t *word, *word_end; size_t c_len, d_len, r_len; @@ -102,7 +103,7 @@ zio_compress_data(enum zio_compress c, v return (s_len); /* Compress at least 12.5% */ - d_len = P2ALIGN(s_len - (s_len >> 3), (size_t)SPA_MINBLOCKSIZE); + d_len = P2ALIGN(s_len - (s_len >> 3), minblocksize); if (d_len == 0) return (s_len); @@ -115,14 +116,14 @@ zio_compress_data(enum zio_compress c, v * Cool. We compressed at least as much as we were hoping to. * For both security and repeatability, pad out the last sector. */ - r_len = P2ROUNDUP(c_len, (size_t)SPA_MINBLOCKSIZE); + r_len = P2ROUNDUP(c_len, minblocksize); if (r_len > c_len) { bzero((char *)dst + c_len, r_len - c_len); c_len = r_len; } ASSERT3U(c_len, <=, d_len); - ASSERT(P2PHASE(c_len, (size_t)SPA_MINBLOCKSIZE) == 0); + ASSERT(P2PHASE(c_len, minblocksize) == 0); return (c_len); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:30:01 2014 (r262080) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:30:18 2014 (r262081) @@ -620,7 +620,8 @@ typedef enum vdev_aux { VDEV_AUX_IO_FAILURE, /* experienced I/O failure */ VDEV_AUX_BAD_LOG, /* cannot read log chain(s) */ VDEV_AUX_EXTERNAL, /* external diagnosis */ - VDEV_AUX_SPLIT_POOL /* vdev was split off into another pool */ + VDEV_AUX_SPLIT_POOL, /* vdev was split off into another pool */ + VDEV_AUX_ASHIFT_TOO_BIG /* vdev's min block size is too large */ } vdev_aux_t; /* @@ -714,7 +715,13 @@ typedef struct vdev_stat { uint64_t vs_self_healed; /* self-healed bytes */ uint64_t vs_scan_removing; /* removing? */ uint64_t vs_scan_processed; /* scan processed bytes */ + uint64_t vs_configured_ashift; /* TLV vdev_ashift */ + uint64_t vs_logical_ashift; /* vdev_logical_ashift */ + uint64_t vs_physical_ashift; /* vdev_physical_ashift */ } vdev_stat_t; +#define VDEV_STAT_VALID(field, uint64_t_field_count) \ + ((uint64_t_field_count * sizeof(uint64_t)) >= \ + (offsetof(vdev_stat_t, field) + sizeof(((vdev_stat_t *)NULL)->field))) /* * DDT statistics. Note: all fields should be 64-bit because this From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 16:33:18 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C1E77752; Mon, 17 Feb 2014 16:33: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AA6EE1504; Mon, 17 Feb 2014 16:33:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGXIGr038709; Mon, 17 Feb 2014 16:33:18 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGXIo5038706; Mon, 17 Feb 2014 16:33:18 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171633.s1HGXIo5038706@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:33:18 +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: r262082 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 16:33:18 -0000 Author: avg Date: Mon Feb 17 16:33:17 2014 New Revision: 262082 URL: http://svnweb.freebsd.org/changeset/base/262082 Log: MFC r252840: 3836 zio_free() can be processed immediately in the common case MFC slacker: mm Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Mon Feb 17 16:30:18 2014 (r262081) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Mon Feb 17 16:33:17 2014 (r262082) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _ZIO_IMPL_H @@ -38,7 +38,7 @@ extern "C" { #endif /* - * XXX -- Describe ZFS I/O pipleine here. Fill in as needed. + * XXX -- Describe ZFS I/O pipeline here. Fill in as needed. * * The ZFS I/O pipeline is comprised of various stages which are defined * in the zio_stage enum below. The individual stages are used to construct @@ -213,7 +213,6 @@ enum zio_stage { #define ZIO_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ - ZIO_STAGE_ISSUE_ASYNC | \ ZIO_STAGE_DVA_FREE | \ ZIO_STAGE_VDEV_IO_START | \ ZIO_STAGE_VDEV_IO_ASSESS) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:30:18 2014 (r262081) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:33:17 2014 (r262082) @@ -740,7 +740,21 @@ void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp) { metaslab_check_free(spa, bp); - bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); + + /* + * Frees that are for the currently-syncing txg, are not going to be + * deferred, and which will not need to do a read (i.e. not GANG or + * DEDUP), can be processed immediately. Otherwise, put them on the + * in-memory list for later processing. + */ + if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp) || + txg != spa->spa_syncing_txg || + spa_sync_pass(spa) >= zfs_sync_pass_deferred_free) { + bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); + } else { + VERIFY0(zio_wait(zio_free_sync(NULL, spa, txg, bp, + BP_GET_PSIZE(bp), 0))); + } } zio_t * @@ -748,6 +762,7 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui uint64_t size, enum zio_flag flags) { zio_t *zio; + enum zio_stage stage = ZIO_FREE_PIPELINE; dprintf_bp(bp, "freeing in txg %llu, pass %u", (longlong_t)txg, spa->spa_sync_pass); @@ -759,9 +774,17 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui metaslab_check_free(spa, bp); arc_freed(spa, bp); + /* + * GANG and DEDUP blocks can induce a read (for the gang block header, + * or the DDT), so issue them asynchronously so that this thread is + * not tied up. + */ + if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp)) + stage |= ZIO_STAGE_ISSUE_ASYNC; + zio = zio_create(pio, spa, txg, bp, NULL, size, NULL, NULL, ZIO_TYPE_FREE, ZIO_PRIORITY_NOW, flags, - NULL, 0, NULL, ZIO_STAGE_OPEN, ZIO_FREE_PIPELINE); + NULL, 0, NULL, ZIO_STAGE_OPEN, stage); return (zio); } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 16:33:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B31B888C; Mon, 17 Feb 2014 16:33: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9DBAB150D; Mon, 17 Feb 2014 16:33:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGXhgW038789; Mon, 17 Feb 2014 16:33:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGXhBG038787; Mon, 17 Feb 2014 16:33:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171633.s1HGXhBG038787@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:33:43 +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: r262083 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 16:33:43 -0000 Author: avg Date: Mon Feb 17 16:33:42 2014 New Revision: 262083 URL: http://svnweb.freebsd.org/changeset/base/262083 Log: MFC r252840: 3836 zio_free() can be processed immediately in the common case MFC slacker: mm Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Mon Feb 17 16:33:17 2014 (r262082) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Mon Feb 17 16:33:42 2014 (r262083) @@ -24,7 +24,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _ZIO_IMPL_H @@ -38,7 +38,7 @@ extern "C" { #endif /* - * XXX -- Describe ZFS I/O pipleine here. Fill in as needed. + * XXX -- Describe ZFS I/O pipeline here. Fill in as needed. * * The ZFS I/O pipeline is comprised of various stages which are defined * in the zio_stage enum below. The individual stages are used to construct @@ -213,7 +213,6 @@ enum zio_stage { #define ZIO_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ - ZIO_STAGE_ISSUE_ASYNC | \ ZIO_STAGE_DVA_FREE | \ ZIO_STAGE_VDEV_IO_START | \ ZIO_STAGE_VDEV_IO_ASSESS) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:33:17 2014 (r262082) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Mon Feb 17 16:33:42 2014 (r262083) @@ -740,7 +740,21 @@ void zio_free(spa_t *spa, uint64_t txg, const blkptr_t *bp) { metaslab_check_free(spa, bp); - bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); + + /* + * Frees that are for the currently-syncing txg, are not going to be + * deferred, and which will not need to do a read (i.e. not GANG or + * DEDUP), can be processed immediately. Otherwise, put them on the + * in-memory list for later processing. + */ + if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp) || + txg != spa->spa_syncing_txg || + spa_sync_pass(spa) >= zfs_sync_pass_deferred_free) { + bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); + } else { + VERIFY0(zio_wait(zio_free_sync(NULL, spa, txg, bp, + BP_GET_PSIZE(bp), 0))); + } } zio_t * @@ -748,6 +762,7 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui uint64_t size, enum zio_flag flags) { zio_t *zio; + enum zio_stage stage = ZIO_FREE_PIPELINE; dprintf_bp(bp, "freeing in txg %llu, pass %u", (longlong_t)txg, spa->spa_sync_pass); @@ -758,9 +773,17 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui metaslab_check_free(spa, bp); + /* + * GANG and DEDUP blocks can induce a read (for the gang block header, + * or the DDT), so issue them asynchronously so that this thread is + * not tied up. + */ + if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp)) + stage |= ZIO_STAGE_ISSUE_ASYNC; + zio = zio_create(pio, spa, txg, bp, NULL, size, NULL, NULL, ZIO_TYPE_FREE, ZIO_PRIORITY_NOW, flags, - NULL, 0, NULL, ZIO_STAGE_OPEN, ZIO_FREE_PIPELINE); + NULL, 0, NULL, ZIO_STAGE_OPEN, stage); return (zio); } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 16:41:46 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DC27015E; Mon, 17 Feb 2014 16:41: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AD6D415FA; Mon, 17 Feb 2014 16:41:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGfkpG043037; Mon, 17 Feb 2014 16:41:46 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGfkkn043035; Mon, 17 Feb 2014 16:41:46 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171641.s1HGfkkn043035@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:41:46 +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: r262084 - in stable/9: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 16:41:46 -0000 Author: avg Date: Mon Feb 17 16:41:45 2014 New Revision: 262084 URL: http://svnweb.freebsd.org/changeset/base/262084 Log: MFC r254077: MFV r254071: Fix a regression introduced by fix for Illumos bug #3834 Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:33:42 2014 (r262083) +++ stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:41:45 2014 (r262084) @@ -3607,6 +3607,9 @@ ztest_dmu_read_write(ztest_ds_t *zd, uin else dmu_tx_hold_write(tx, bigobj, bigoff, bigsize); + /* This accounts for setting the checksum/compression. */ + dmu_tx_hold_bonus(tx, bigobj); + txg = ztest_tx_assign(tx, TXG_MIGHTWAIT, FTAG); if (txg == 0) { umem_free(packbuf, packsize); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Mon Feb 17 16:33:42 2014 (r262083) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Mon Feb 17 16:41:45 2014 (r262084) @@ -449,12 +449,12 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, ui blkid = off >> dn->dn_datablkshift; nblks = (len + dn->dn_datablksz - 1) >> dn->dn_datablkshift; - if (blkid >= dn->dn_maxblkid) { + if (blkid > dn->dn_maxblkid) { rw_exit(&dn->dn_struct_rwlock); return; } if (blkid + nblks > dn->dn_maxblkid) - nblks = dn->dn_maxblkid - blkid; + nblks = dn->dn_maxblkid - blkid + 1; } l0span = nblks; /* save for later use to calc level > 1 overhead */ From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 16:41:59 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 17A052CB; Mon, 17 Feb 2014 16:41: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DBC751606; Mon, 17 Feb 2014 16:41:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGfwOS043092; Mon, 17 Feb 2014 16:41:58 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGfwB7043090; Mon, 17 Feb 2014 16:41:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171641.s1HGfwB7043090@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:41:58 +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: r262085 - in stable/8: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 16:41:59 -0000 Author: avg Date: Mon Feb 17 16:41:58 2014 New Revision: 262085 URL: http://svnweb.freebsd.org/changeset/base/262085 Log: MFC r254077: MFV r254071: Fix a regression introduced by fix for Illumos bug #3834 Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:41:45 2014 (r262084) +++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:41:58 2014 (r262085) @@ -3607,6 +3607,9 @@ ztest_dmu_read_write(ztest_ds_t *zd, uin else dmu_tx_hold_write(tx, bigobj, bigoff, bigsize); + /* This accounts for setting the checksum/compression. */ + dmu_tx_hold_bonus(tx, bigobj); + txg = ztest_tx_assign(tx, TXG_MIGHTWAIT, FTAG); if (txg == 0) { umem_free(packbuf, packsize); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Mon Feb 17 16:41:45 2014 (r262084) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Mon Feb 17 16:41:58 2014 (r262085) @@ -449,12 +449,12 @@ dmu_tx_count_free(dmu_tx_hold_t *txh, ui blkid = off >> dn->dn_datablkshift; nblks = (len + dn->dn_datablksz - 1) >> dn->dn_datablkshift; - if (blkid >= dn->dn_maxblkid) { + if (blkid > dn->dn_maxblkid) { rw_exit(&dn->dn_struct_rwlock); return; } if (blkid + nblks > dn->dn_maxblkid) - nblks = dn->dn_maxblkid - blkid; + nblks = dn->dn_maxblkid - blkid + 1; } l0span = nblks; /* save for later use to calc level > 1 overhead */ From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 16:46:25 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7E4BD469; Mon, 17 Feb 2014 16:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 655231634; Mon, 17 Feb 2014 16:46:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGkPpK043740; Mon, 17 Feb 2014 16:46:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGkNO5043725; Mon, 17 Feb 2014 16:46:23 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171646.s1HGkNO5043725@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:46: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: r262086 - in stable/9/sys/cddl/contrib/opensolaris/uts/common: fs/zfs fs/zfs/sys sys/fs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 16:46:25 -0000 Author: avg Date: Mon Feb 17 16:46:23 2014 New Revision: 262086 URL: http://svnweb.freebsd.org/changeset/base/262086 Log: MFC r254112: MFV r254079: multiple ZFS issues Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 16:46:23 2014 (r262086) @@ -224,6 +224,7 @@ dsl_scan_setup_sync(void *arg, dmu_tx_t scn->scn_phys.scn_errors = 0; scn->scn_phys.scn_to_examine = spa->spa_root_vdev->vdev_stat.vs_alloc; scn->scn_restart_txg = 0; + scn->scn_done_txg = 0; spa_scan_stat_init(spa); if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) { @@ -800,7 +801,7 @@ dsl_scan_visitbp(blkptr_t *bp, const zbo * Don't scan it now unless we need to because something * under it was modified. */ - if (bp->blk_birth <= scn->scn_phys.scn_cur_max_txg) { + if (BP_PHYSICAL_BIRTH(bp) <= scn->scn_phys.scn_cur_max_txg) { scan_funcs[scn->scn_phys.scn_func](dp, bp, zb); } if (buf) @@ -1245,7 +1246,7 @@ dsl_scan_ddt_entry(dsl_scan_t *scn, enum for (int p = 0; p < DDT_PHYS_TYPES; p++, ddp++) { if (ddp->ddp_phys_birth == 0 || - ddp->ddp_phys_birth > scn->scn_phys.scn_cur_max_txg) + ddp->ddp_phys_birth > scn->scn_phys.scn_max_txg) continue; ddt_bp_create(checksum, ddk, ddp, &bp); @@ -1488,6 +1489,16 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * if (scn->scn_phys.scn_state != DSS_SCANNING) return; + if (scn->scn_done_txg == tx->tx_txg) { + ASSERT(!scn->scn_pausing); + /* finished with scan. */ + zfs_dbgmsg("txg %llu scan complete", tx->tx_txg); + dsl_scan_done(scn, B_TRUE, tx); + ASSERT3U(spa->spa_scrub_inflight, ==, 0); + dsl_scan_sync_state(scn, tx); + return; + } + if (scn->scn_phys.scn_ddt_bookmark.ddb_class <= scn->scn_phys.scn_ddt_class_max) { zfs_dbgmsg("doing scan sync txg %llu; " @@ -1523,9 +1534,9 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * (longlong_t)NSEC2MSEC(gethrtime() - scn->scn_sync_start_time)); if (!scn->scn_pausing) { - /* finished with scan. */ - zfs_dbgmsg("finished scan txg %llu", (longlong_t)tx->tx_txg); - dsl_scan_done(scn, B_TRUE, tx); + scn->scn_done_txg = tx->tx_txg + 1; + zfs_dbgmsg("txg %llu traversal complete, waiting till txg %llu", + tx->tx_txg, scn->scn_done_txg); } if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:46:23 2014 (r262086) @@ -4715,7 +4715,7 @@ spa_vdev_attach(spa_t *spa, uint64_t gui } /* mark the device being resilvered */ - newvd->vdev_resilvering = B_TRUE; + newvd->vdev_resilver_txg = txg; /* * If the parent is not a mirror, or if we're replacing, insert the new @@ -5579,13 +5579,6 @@ spa_vdev_resilver_done_hunt(vdev_t *vd) return (oldvd); } - if (vd->vdev_resilvering && vdev_dtl_empty(vd, DTL_MISSING) && - vdev_dtl_empty(vd, DTL_OUTAGE)) { - ASSERT(vd->vdev_ops->vdev_op_leaf); - vd->vdev_resilvering = B_FALSE; - vdev_config_dirty(vd->vdev_top); - } - /* * Check for a completed replacement. We always consider the first * vdev in the list to be the oldest vdev, and the last one to be @@ -5675,6 +5668,8 @@ spa_vdev_resilver_done(spa_t *spa) ASSERT(pvd->vdev_ops == &vdev_replacing_ops); sguid = ppvd->vdev_child[1]->vdev_guid; } + ASSERT(vd->vdev_resilver_txg == 0 || !vdev_dtl_required(vd)); + spa_config_exit(spa, SCL_ALL, FTAG); if (spa_vdev_detach(spa, guid, pguid, B_TRUE) != 0) return; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:46:23 2014 (r262086) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -196,7 +196,12 @@ spa_config_write(spa_config_dirent_t *dp /* * Synchronize pool configuration to disk. This must be called with the - * namespace lock held. + * namespace lock held. Synchronizing the pool cache is typically done after + * the configuration has been synced to the MOS. This exposes a window where + * the MOS config will have been updated but the cache file has not. If + * the system were to crash at that instant then the cached config may not + * contain the correct information to open the pool and an explicity import + * would be required. */ void spa_config_sync(spa_t *target, boolean_t removing, boolean_t postsysevent) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Mon Feb 17 16:46:23 2014 (r262086) @@ -72,11 +72,42 @@ typedef enum dsl_scan_flags { DSF_VISIT_DS_AGAIN = 1<<0, } dsl_scan_flags_t; +/* + * Every pool will have one dsl_scan_t and this structure will contain + * in-memory information about the scan and a pointer to the on-disk + * representation (i.e. dsl_scan_phys_t). Most of the state of the scan + * is contained on-disk to allow the scan to resume in the event of a reboot + * or panic. This structure maintains information about the behavior of a + * running scan, some caching information, and how it should traverse the pool. + * + * The following members of this structure direct the behavior of the scan: + * + * scn_pausing - a scan that cannot be completed in a single txg or + * has exceeded its allotted time will need to pause. + * When this flag is set the scanner will stop traversing + * the pool and write out the current state to disk. + * + * scn_restart_txg - directs the scanner to either restart or start a + * a scan at the specified txg value. + * + * scn_done_txg - when a scan completes its traversal it will set + * the completion txg to the next txg. This is necessary + * to ensure that any blocks that were freed during + * the scan but have not yet been processed (i.e deferred + * frees) are accounted for. + * + * This structure also maintains information about deferred frees which are + * a special kind of traversal. Deferred free can exist in either a bptree or + * a bpobj structure. The scn_is_bptree flag will indicate the type of + * deferred free that is in progress. If the deferred free is part of an + * asynchronous destroy then the scn_async_destroying flag will be set. + */ typedef struct dsl_scan { struct dsl_pool *scn_dp; boolean_t scn_pausing; uint64_t scn_restart_txg; + uint64_t scn_done_txg; uint64_t scn_sync_start_time; zio_t *scn_zio_root; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:46:23 2014 (r262086) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _SYS_VDEV_IMPL_H @@ -201,7 +201,7 @@ struct vdev { uint64_t vdev_faulted; /* persistent faulted state */ uint64_t vdev_degraded; /* persistent degraded state */ uint64_t vdev_removed; /* persistent removed state */ - uint64_t vdev_resilvering; /* persistent resilvering state */ + uint64_t vdev_resilver_txg; /* persistent resilvering state */ uint64_t vdev_nparity; /* number of parity devices for raidz */ char *vdev_path; /* vdev path (if any) */ char *vdev_devid; /* vdev devid (if any) */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 16:46:23 2014 (r262086) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _SYS_ZFS_DEBUG_H @@ -79,6 +79,7 @@ typedef struct zfs_dbgmsg { extern void zfs_dbgmsg_init(void); extern void zfs_dbgmsg_fini(void); extern void zfs_dbgmsg(const char *fmt, ...); +extern void zfs_dbgmsg_print(const char *tag); #ifdef illumos #ifndef _KERNEL Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:46:23 2014 (r262086) @@ -573,8 +573,8 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvl (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_OFFLINE, &vd->vdev_offline); - (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_RESILVERING, - &vd->vdev_resilvering); + (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_RESILVER_TXG, + &vd->vdev_resilver_txg); /* * When importing a pool, we want to ignore the persistent fault @@ -1753,6 +1753,75 @@ vdev_dtl_empty(vdev_t *vd, vdev_dtl_type } /* + * Returns the lowest txg in the DTL range. + */ +static uint64_t +vdev_dtl_min(vdev_t *vd) +{ + space_seg_t *ss; + + ASSERT(MUTEX_HELD(&vd->vdev_dtl_lock)); + ASSERT3U(vd->vdev_dtl[DTL_MISSING].sm_space, !=, 0); + ASSERT0(vd->vdev_children); + + ss = avl_first(&vd->vdev_dtl[DTL_MISSING].sm_root); + return (ss->ss_start - 1); +} + +/* + * Returns the highest txg in the DTL. + */ +static uint64_t +vdev_dtl_max(vdev_t *vd) +{ + space_seg_t *ss; + + ASSERT(MUTEX_HELD(&vd->vdev_dtl_lock)); + ASSERT3U(vd->vdev_dtl[DTL_MISSING].sm_space, !=, 0); + ASSERT0(vd->vdev_children); + + ss = avl_last(&vd->vdev_dtl[DTL_MISSING].sm_root); + return (ss->ss_end); +} + +/* + * Determine if a resilvering vdev should remove any DTL entries from + * its range. If the vdev was resilvering for the entire duration of the + * scan then it should excise that range from its DTLs. Otherwise, this + * vdev is considered partially resilvered and should leave its DTL + * entries intact. The comment in vdev_dtl_reassess() describes how we + * excise the DTLs. + */ +static boolean_t +vdev_dtl_should_excise(vdev_t *vd) +{ + spa_t *spa = vd->vdev_spa; + dsl_scan_t *scn = spa->spa_dsl_pool->dp_scan; + + ASSERT0(scn->scn_phys.scn_errors); + ASSERT0(vd->vdev_children); + + if (vd->vdev_resilver_txg == 0 || + vd->vdev_dtl[DTL_MISSING].sm_space == 0) + return (B_TRUE); + + /* + * When a resilver is initiated the scan will assign the scn_max_txg + * value to the highest txg value that exists in all DTLs. If this + * device's max DTL is not part of this scan (i.e. it is not in + * the range (scn_min_txg, scn_max_txg] then it is not eligible + * for excision. + */ + if (vdev_dtl_max(vd) <= scn->scn_phys.scn_max_txg) { + ASSERT3U(scn->scn_phys.scn_min_txg, <=, vdev_dtl_min(vd)); + ASSERT3U(scn->scn_phys.scn_min_txg, <, vd->vdev_resilver_txg); + ASSERT3U(vd->vdev_resilver_txg, <=, scn->scn_phys.scn_max_txg); + return (B_TRUE); + } + return (B_FALSE); +} + +/* * Reassess DTLs after a config change or scrub completion. */ void @@ -1775,9 +1844,17 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t t dsl_scan_t *scn = spa->spa_dsl_pool->dp_scan; mutex_enter(&vd->vdev_dtl_lock); + + /* + * If we've completed a scan cleanly then determine + * if this vdev should remove any DTLs. We only want to + * excise regions on vdevs that were available during + * the entire duration of this scan. + */ if (scrub_txg != 0 && (spa->spa_scrub_started || - (scn && scn->scn_phys.scn_errors == 0))) { + (scn != NULL && scn->scn_phys.scn_errors == 0)) && + vdev_dtl_should_excise(vd)) { /* * We completed a scrub up to scrub_txg. If we * did it without rebooting, then the scrub dtl @@ -1816,6 +1893,16 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t t else space_map_walk(&vd->vdev_dtl[DTL_MISSING], space_map_add, &vd->vdev_dtl[DTL_OUTAGE]); + + /* + * If the vdev was resilvering and no longer has any + * DTLs then reset its resilvering flag. + */ + if (vd->vdev_resilver_txg != 0 && + vd->vdev_dtl[DTL_MISSING].sm_space == 0 && + vd->vdev_dtl[DTL_OUTAGE].sm_space == 0) + vd->vdev_resilver_txg = 0; + mutex_exit(&vd->vdev_dtl_lock); if (txg != 0) @@ -1993,12 +2080,9 @@ vdev_resilver_needed(vdev_t *vd, uint64_ mutex_enter(&vd->vdev_dtl_lock); if (vd->vdev_dtl[DTL_MISSING].sm_space != 0 && vdev_writeable(vd)) { - space_seg_t *ss; - ss = avl_first(&vd->vdev_dtl[DTL_MISSING].sm_root); - thismin = ss->ss_start - 1; - ss = avl_last(&vd->vdev_dtl[DTL_MISSING].sm_root); - thismax = ss->ss_end; + thismin = vdev_dtl_min(vd); + thismax = vdev_dtl_max(vd); needed = B_TRUE; } mutex_exit(&vd->vdev_dtl_lock); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Mon Feb 17 16:46:23 2014 (r262086) @@ -222,30 +222,25 @@ vdev_config_generate(spa_t *spa, vdev_t { nvlist_t *nv = NULL; - VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) == 0); + nv = fnvlist_alloc(); - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_TYPE, - vd->vdev_ops->vdev_op_type) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_TYPE, vd->vdev_ops->vdev_op_type); if (!(flags & (VDEV_CONFIG_SPARE | VDEV_CONFIG_L2CACHE))) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ID, vd->vdev_id) - == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_GUID, vd->vdev_guid) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ID, vd->vdev_id); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_GUID, vd->vdev_guid); if (vd->vdev_path != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_PATH, - vd->vdev_path) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_PATH, vd->vdev_path); if (vd->vdev_devid != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_DEVID, - vd->vdev_devid) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_DEVID, vd->vdev_devid); if (vd->vdev_physpath != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_PHYS_PATH, - vd->vdev_physpath) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_PHYS_PATH, + vd->vdev_physpath); if (vd->vdev_fru != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_FRU, - vd->vdev_fru) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_FRU, vd->vdev_fru); if (vd->vdev_nparity != 0) { ASSERT(strcmp(vd->vdev_ops->vdev_op_type, @@ -266,59 +261,54 @@ vdev_config_generate(spa_t *spa, vdev_t * that only support a single parity device -- older software * will just ignore it. */ - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_NPARITY, - vd->vdev_nparity) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_NPARITY, vd->vdev_nparity); } if (vd->vdev_wholedisk != -1ULL) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK, - vd->vdev_wholedisk) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK, + vd->vdev_wholedisk); if (vd->vdev_not_present) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT, 1) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT, 1); if (vd->vdev_isspare) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_SPARE, 1) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_SPARE, 1); if (!(flags & (VDEV_CONFIG_SPARE | VDEV_CONFIG_L2CACHE)) && vd == vd->vdev_top) { - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_ARRAY, - vd->vdev_ms_array) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_SHIFT, - vd->vdev_ms_shift) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASHIFT, - vd->vdev_ashift) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASIZE, - vd->vdev_asize) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_LOG, - vd->vdev_islog) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_ARRAY, + vd->vdev_ms_array); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_SHIFT, + vd->vdev_ms_shift); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ASHIFT, vd->vdev_ashift); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ASIZE, + vd->vdev_asize); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_LOG, vd->vdev_islog); if (vd->vdev_removing) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVING, - vd->vdev_removing) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVING, + vd->vdev_removing); } if (vd->vdev_dtl_smo.smo_object != 0) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_DTL, - vd->vdev_dtl_smo.smo_object) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_DTL, + vd->vdev_dtl_smo.smo_object); if (vd->vdev_crtxg) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_CREATE_TXG, - vd->vdev_crtxg) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_CREATE_TXG, vd->vdev_crtxg); if (getstats) { vdev_stat_t vs; pool_scan_stat_t ps; vdev_get_stats(vd, &vs); - VERIFY(nvlist_add_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, - (uint64_t *)&vs, sizeof (vs) / sizeof (uint64_t)) == 0); + fnvlist_add_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, + (uint64_t *)&vs, sizeof (vs) / sizeof (uint64_t)); /* provide either current or previous scan information */ if (spa_scan_get_stats(spa, &ps) == 0) { - VERIFY(nvlist_add_uint64_array(nv, + fnvlist_add_uint64_array(nv, ZPOOL_CONFIG_SCAN_STATS, (uint64_t *)&ps, - sizeof (pool_scan_stat_t) / sizeof (uint64_t)) - == 0); + sizeof (pool_scan_stat_t) / sizeof (uint64_t)); } } @@ -348,8 +338,8 @@ vdev_config_generate(spa_t *spa, vdev_t } if (idx) { - VERIFY(nvlist_add_nvlist_array(nv, - ZPOOL_CONFIG_CHILDREN, child, idx) == 0); + fnvlist_add_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN, + child, idx); } for (c = 0; c < idx; c++) @@ -361,26 +351,20 @@ vdev_config_generate(spa_t *spa, vdev_t const char *aux = NULL; if (vd->vdev_offline && !vd->vdev_tmpoffline) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_OFFLINE, - B_TRUE) == 0); - if (vd->vdev_resilvering) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_RESILVERING, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_OFFLINE, B_TRUE); + if (vd->vdev_resilver_txg != 0) + fnvlist_add_uint64(nv, ZPOOL_CONFIG_RESILVER_TXG, + vd->vdev_resilver_txg); if (vd->vdev_faulted) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_FAULTED, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_FAULTED, B_TRUE); if (vd->vdev_degraded) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_DEGRADED, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_DEGRADED, B_TRUE); if (vd->vdev_removed) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVED, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVED, B_TRUE); if (vd->vdev_unspare) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_UNSPARE, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_UNSPARE, B_TRUE); if (vd->vdev_ishole) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_HOLE, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_HOLE, B_TRUE); switch (vd->vdev_stat.vs_aux) { case VDEV_AUX_ERR_EXCEEDED: @@ -393,12 +377,11 @@ vdev_config_generate(spa_t *spa, vdev_t } if (aux != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_AUX_STATE, - aux) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_AUX_STATE, aux); if (vd->vdev_splitting && vd->vdev_orig_guid != 0LL) { - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ORIG_GUID, - vd->vdev_orig_guid) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ORIG_GUID, + vd->vdev_orig_guid); } } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c Mon Feb 17 16:46:23 2014 (r262086) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -94,3 +94,16 @@ zfs_dbgmsg(const char *fmt, ...) } mutex_exit(&zfs_dbgmsgs_lock); } + +void +zfs_dbgmsg_print(const char *tag) +{ + zfs_dbgmsg_t *zdm; + + (void) printf("ZFS_DBGMSG(%s):\n", tag); + mutex_enter(&zfs_dbgmsgs_lock); + for (zdm = list_head(&zfs_dbgmsgs); zdm; + zdm = list_next(&zfs_dbgmsgs, zdm)) + (void) printf("%s\n", zdm->zdm_msg); + mutex_exit(&zfs_dbgmsgs_lock); +} Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:41:58 2014 (r262085) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:46:23 2014 (r262086) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012, Martin Matuska . All rights reserved. @@ -523,7 +523,7 @@ typedef struct zpool_rewind_policy { #define ZPOOL_CONFIG_SPLIT_GUID "split_guid" #define ZPOOL_CONFIG_SPLIT_LIST "guid_list" #define ZPOOL_CONFIG_REMOVING "removing" -#define ZPOOL_CONFIG_RESILVERING "resilvering" +#define ZPOOL_CONFIG_RESILVER_TXG "resilver_txg" #define ZPOOL_CONFIG_COMMENT "comment" #define ZPOOL_CONFIG_SUSPENDED "suspended" /* not stored on disk */ #define ZPOOL_CONFIG_TIMESTAMP "timestamp" /* not stored on disk */ From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 16:47:59 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 81B6B5E0; Mon, 17 Feb 2014 16:47: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E428164F; Mon, 17 Feb 2014 16:47:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGlxvD043946; Mon, 17 Feb 2014 16:47:59 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGlxj4043945; Mon, 17 Feb 2014 16:47:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171647.s1HGlxj4043945@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:47:59 +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: r262087 - stable/9/cddl/contrib/opensolaris/cmd/ztest X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 16:47:59 -0000 Author: avg Date: Mon Feb 17 16:47:58 2014 New Revision: 262087 URL: http://svnweb.freebsd.org/changeset/base/262087 Log: MFC r254112: MFV r254079: multiple ZFS issues Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:46:23 2014 (r262086) +++ stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:47:58 2014 (r262087) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -769,6 +769,16 @@ ztest_kill(ztest_shared_t *zs) { zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(ztest_spa)); zs->zs_space = metaslab_class_get_space(spa_normal_class(ztest_spa)); + + /* + * Before we kill off ztest, make sure that the config is updated. + * See comment above spa_config_sync(). + */ + mutex_enter(&spa_namespace_lock); + spa_config_sync(ztest_spa, B_FALSE, B_FALSE); + mutex_exit(&spa_namespace_lock); + + zfs_dbgmsg_print(FTAG); (void) kill(getpid(), SIGKILL); } @@ -2733,7 +2743,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t leaf, top; uint64_t ashift = ztest_get_ashift(); uint64_t oldguid, pguid; - size_t oldsize, newsize; + uint64_t oldsize, newsize; char oldpath[MAXPATHLEN], newpath[MAXPATHLEN]; int replacing; int oldvd_has_siblings = B_FALSE; @@ -2892,8 +2902,8 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, if (error != expected_error && expected_error != EBUSY) { fatal(0, "attach (%s %llu, %s %llu, %d) " "returned %d, expected %d", - oldpath, (longlong_t)oldsize, newpath, - (longlong_t)newsize, replacing, error, expected_error); + oldpath, oldsize, newpath, + newsize, replacing, error, expected_error); } VERIFY(mutex_unlock(&ztest_vdev_lock) == 0); @@ -4803,7 +4813,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint6 */ if (vd0 != NULL && maxfaults != 1 && (!vdev_resilver_needed(vd0->vdev_top, NULL, NULL) || - vd0->vdev_resilvering)) { + vd0->vdev_resilver_txg != 0)) { /* * Make vd0 explicitly claim to be unreadable, * or unwriteable, or reach behind its back @@ -5654,6 +5664,7 @@ ztest_run(ztest_shared_t *zs) zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(spa)); zs->zs_space = metaslab_class_get_space(spa_normal_class(spa)); + zfs_dbgmsg_print(FTAG); umem_free(tid, ztest_opts.zo_threads * sizeof (thread_t)); From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 16:48:13 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3B9770F; Mon, 17 Feb 2014 16:48: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C999E1651; Mon, 17 Feb 2014 16:48:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HGmDSu044049; Mon, 17 Feb 2014 16:48:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HGmB3b044033; Mon, 17 Feb 2014 16:48:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171648.s1HGmB3b044033@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 16:48:11 +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: r262088 - in stable/8: cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys sys/cddl/contrib/opensolaris/... X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 16:48:14 -0000 Author: avg Date: Mon Feb 17 16:48:11 2014 New Revision: 262088 URL: http://svnweb.freebsd.org/changeset/base/262088 Log: MFC r254112: MFV r254079: multiple ZFS issues Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 16:48:11 2014 (r262088) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. @@ -769,6 +769,16 @@ ztest_kill(ztest_shared_t *zs) { zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(ztest_spa)); zs->zs_space = metaslab_class_get_space(spa_normal_class(ztest_spa)); + + /* + * Before we kill off ztest, make sure that the config is updated. + * See comment above spa_config_sync(). + */ + mutex_enter(&spa_namespace_lock); + spa_config_sync(ztest_spa, B_FALSE, B_FALSE); + mutex_exit(&spa_namespace_lock); + + zfs_dbgmsg_print(FTAG); (void) kill(getpid(), SIGKILL); } @@ -2733,7 +2743,7 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t leaf, top; uint64_t ashift = ztest_get_ashift(); uint64_t oldguid, pguid; - size_t oldsize, newsize; + uint64_t oldsize, newsize; char oldpath[MAXPATHLEN], newpath[MAXPATHLEN]; int replacing; int oldvd_has_siblings = B_FALSE; @@ -2892,8 +2902,8 @@ ztest_vdev_attach_detach(ztest_ds_t *zd, if (error != expected_error && expected_error != EBUSY) { fatal(0, "attach (%s %llu, %s %llu, %d) " "returned %d, expected %d", - oldpath, (longlong_t)oldsize, newpath, - (longlong_t)newsize, replacing, error, expected_error); + oldpath, oldsize, newpath, + newsize, replacing, error, expected_error); } VERIFY(mutex_unlock(&ztest_vdev_lock) == 0); @@ -4803,7 +4813,7 @@ ztest_fault_inject(ztest_ds_t *zd, uint6 */ if (vd0 != NULL && maxfaults != 1 && (!vdev_resilver_needed(vd0->vdev_top, NULL, NULL) || - vd0->vdev_resilvering)) { + vd0->vdev_resilver_txg != 0)) { /* * Make vd0 explicitly claim to be unreadable, * or unwriteable, or reach behind its back @@ -5654,6 +5664,7 @@ ztest_run(ztest_shared_t *zs) zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(spa)); zs->zs_space = metaslab_class_get_space(spa_normal_class(spa)); + zfs_dbgmsg_print(FTAG); umem_free(tid, ztest_opts.zo_threads * sizeof (thread_t)); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 16:48:11 2014 (r262088) @@ -224,6 +224,7 @@ dsl_scan_setup_sync(void *arg, dmu_tx_t scn->scn_phys.scn_errors = 0; scn->scn_phys.scn_to_examine = spa->spa_root_vdev->vdev_stat.vs_alloc; scn->scn_restart_txg = 0; + scn->scn_done_txg = 0; spa_scan_stat_init(spa); if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) { @@ -800,7 +801,7 @@ dsl_scan_visitbp(blkptr_t *bp, const zbo * Don't scan it now unless we need to because something * under it was modified. */ - if (bp->blk_birth <= scn->scn_phys.scn_cur_max_txg) { + if (BP_PHYSICAL_BIRTH(bp) <= scn->scn_phys.scn_cur_max_txg) { scan_funcs[scn->scn_phys.scn_func](dp, bp, zb); } if (buf) @@ -1245,7 +1246,7 @@ dsl_scan_ddt_entry(dsl_scan_t *scn, enum for (int p = 0; p < DDT_PHYS_TYPES; p++, ddp++) { if (ddp->ddp_phys_birth == 0 || - ddp->ddp_phys_birth > scn->scn_phys.scn_cur_max_txg) + ddp->ddp_phys_birth > scn->scn_phys.scn_max_txg) continue; ddt_bp_create(checksum, ddk, ddp, &bp); @@ -1488,6 +1489,16 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * if (scn->scn_phys.scn_state != DSS_SCANNING) return; + if (scn->scn_done_txg == tx->tx_txg) { + ASSERT(!scn->scn_pausing); + /* finished with scan. */ + zfs_dbgmsg("txg %llu scan complete", tx->tx_txg); + dsl_scan_done(scn, B_TRUE, tx); + ASSERT3U(spa->spa_scrub_inflight, ==, 0); + dsl_scan_sync_state(scn, tx); + return; + } + if (scn->scn_phys.scn_ddt_bookmark.ddb_class <= scn->scn_phys.scn_ddt_class_max) { zfs_dbgmsg("doing scan sync txg %llu; " @@ -1523,9 +1534,9 @@ dsl_scan_sync(dsl_pool_t *dp, dmu_tx_t * (longlong_t)NSEC2MSEC(gethrtime() - scn->scn_sync_start_time)); if (!scn->scn_pausing) { - /* finished with scan. */ - zfs_dbgmsg("finished scan txg %llu", (longlong_t)tx->tx_txg); - dsl_scan_done(scn, B_TRUE, tx); + scn->scn_done_txg = tx->tx_txg + 1; + zfs_dbgmsg("txg %llu traversal complete, waiting till txg %llu", + tx->tx_txg, scn->scn_done_txg); } if (DSL_SCAN_IS_SCRUB_RESILVER(scn)) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Mon Feb 17 16:48:11 2014 (r262088) @@ -4710,7 +4710,7 @@ spa_vdev_attach(spa_t *spa, uint64_t gui } /* mark the device being resilvered */ - newvd->vdev_resilvering = B_TRUE; + newvd->vdev_resilver_txg = txg; /* * If the parent is not a mirror, or if we're replacing, insert the new @@ -5574,13 +5574,6 @@ spa_vdev_resilver_done_hunt(vdev_t *vd) return (oldvd); } - if (vd->vdev_resilvering && vdev_dtl_empty(vd, DTL_MISSING) && - vdev_dtl_empty(vd, DTL_OUTAGE)) { - ASSERT(vd->vdev_ops->vdev_op_leaf); - vd->vdev_resilvering = B_FALSE; - vdev_config_dirty(vd->vdev_top); - } - /* * Check for a completed replacement. We always consider the first * vdev in the list to be the oldest vdev, and the last one to be @@ -5670,6 +5663,8 @@ spa_vdev_resilver_done(spa_t *spa) ASSERT(pvd->vdev_ops == &vdev_replacing_ops); sguid = ppvd->vdev_child[1]->vdev_guid; } + ASSERT(vd->vdev_resilver_txg == 0 || !vdev_dtl_required(vd)); + spa_config_exit(spa, SCL_ALL, FTAG); if (spa_vdev_detach(spa, guid, pguid, B_TRUE) != 0) return; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Mon Feb 17 16:48:11 2014 (r262088) @@ -22,7 +22,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -196,7 +196,12 @@ spa_config_write(spa_config_dirent_t *dp /* * Synchronize pool configuration to disk. This must be called with the - * namespace lock held. + * namespace lock held. Synchronizing the pool cache is typically done after + * the configuration has been synced to the MOS. This exposes a window where + * the MOS config will have been updated but the cache file has not. If + * the system were to crash at that instant then the cached config may not + * contain the correct information to open the pool and an explicity import + * would be required. */ void spa_config_sync(spa_t *target, boolean_t removing, boolean_t postsysevent) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h Mon Feb 17 16:48:11 2014 (r262088) @@ -72,11 +72,42 @@ typedef enum dsl_scan_flags { DSF_VISIT_DS_AGAIN = 1<<0, } dsl_scan_flags_t; +/* + * Every pool will have one dsl_scan_t and this structure will contain + * in-memory information about the scan and a pointer to the on-disk + * representation (i.e. dsl_scan_phys_t). Most of the state of the scan + * is contained on-disk to allow the scan to resume in the event of a reboot + * or panic. This structure maintains information about the behavior of a + * running scan, some caching information, and how it should traverse the pool. + * + * The following members of this structure direct the behavior of the scan: + * + * scn_pausing - a scan that cannot be completed in a single txg or + * has exceeded its allotted time will need to pause. + * When this flag is set the scanner will stop traversing + * the pool and write out the current state to disk. + * + * scn_restart_txg - directs the scanner to either restart or start a + * a scan at the specified txg value. + * + * scn_done_txg - when a scan completes its traversal it will set + * the completion txg to the next txg. This is necessary + * to ensure that any blocks that were freed during + * the scan but have not yet been processed (i.e deferred + * frees) are accounted for. + * + * This structure also maintains information about deferred frees which are + * a special kind of traversal. Deferred free can exist in either a bptree or + * a bpobj structure. The scn_is_bptree flag will indicate the type of + * deferred free that is in progress. If the deferred free is part of an + * asynchronous destroy then the scn_async_destroying flag will be set. + */ typedef struct dsl_scan { struct dsl_pool *scn_dp; boolean_t scn_pausing; uint64_t scn_restart_txg; + uint64_t scn_done_txg; uint64_t scn_sync_start_time; zio_t *scn_zio_root; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Mon Feb 17 16:48:11 2014 (r262088) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _SYS_VDEV_IMPL_H @@ -201,7 +201,7 @@ struct vdev { uint64_t vdev_faulted; /* persistent faulted state */ uint64_t vdev_degraded; /* persistent degraded state */ uint64_t vdev_removed; /* persistent removed state */ - uint64_t vdev_resilvering; /* persistent resilvering state */ + uint64_t vdev_resilver_txg; /* persistent resilvering state */ uint64_t vdev_nparity; /* number of parity devices for raidz */ char *vdev_path; /* vdev path (if any) */ char *vdev_devid; /* vdev devid (if any) */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 16:48:11 2014 (r262088) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #ifndef _SYS_ZFS_DEBUG_H @@ -79,6 +79,7 @@ typedef struct zfs_dbgmsg { extern void zfs_dbgmsg_init(void); extern void zfs_dbgmsg_fini(void); extern void zfs_dbgmsg(const char *fmt, ...); +extern void zfs_dbgmsg_print(const char *tag); #ifdef illumos #ifndef _KERNEL Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Mon Feb 17 16:48:11 2014 (r262088) @@ -573,8 +573,8 @@ vdev_alloc(spa_t *spa, vdev_t **vdp, nvl (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_OFFLINE, &vd->vdev_offline); - (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_RESILVERING, - &vd->vdev_resilvering); + (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_RESILVER_TXG, + &vd->vdev_resilver_txg); /* * When importing a pool, we want to ignore the persistent fault @@ -1753,6 +1753,75 @@ vdev_dtl_empty(vdev_t *vd, vdev_dtl_type } /* + * Returns the lowest txg in the DTL range. + */ +static uint64_t +vdev_dtl_min(vdev_t *vd) +{ + space_seg_t *ss; + + ASSERT(MUTEX_HELD(&vd->vdev_dtl_lock)); + ASSERT3U(vd->vdev_dtl[DTL_MISSING].sm_space, !=, 0); + ASSERT0(vd->vdev_children); + + ss = avl_first(&vd->vdev_dtl[DTL_MISSING].sm_root); + return (ss->ss_start - 1); +} + +/* + * Returns the highest txg in the DTL. + */ +static uint64_t +vdev_dtl_max(vdev_t *vd) +{ + space_seg_t *ss; + + ASSERT(MUTEX_HELD(&vd->vdev_dtl_lock)); + ASSERT3U(vd->vdev_dtl[DTL_MISSING].sm_space, !=, 0); + ASSERT0(vd->vdev_children); + + ss = avl_last(&vd->vdev_dtl[DTL_MISSING].sm_root); + return (ss->ss_end); +} + +/* + * Determine if a resilvering vdev should remove any DTL entries from + * its range. If the vdev was resilvering for the entire duration of the + * scan then it should excise that range from its DTLs. Otherwise, this + * vdev is considered partially resilvered and should leave its DTL + * entries intact. The comment in vdev_dtl_reassess() describes how we + * excise the DTLs. + */ +static boolean_t +vdev_dtl_should_excise(vdev_t *vd) +{ + spa_t *spa = vd->vdev_spa; + dsl_scan_t *scn = spa->spa_dsl_pool->dp_scan; + + ASSERT0(scn->scn_phys.scn_errors); + ASSERT0(vd->vdev_children); + + if (vd->vdev_resilver_txg == 0 || + vd->vdev_dtl[DTL_MISSING].sm_space == 0) + return (B_TRUE); + + /* + * When a resilver is initiated the scan will assign the scn_max_txg + * value to the highest txg value that exists in all DTLs. If this + * device's max DTL is not part of this scan (i.e. it is not in + * the range (scn_min_txg, scn_max_txg] then it is not eligible + * for excision. + */ + if (vdev_dtl_max(vd) <= scn->scn_phys.scn_max_txg) { + ASSERT3U(scn->scn_phys.scn_min_txg, <=, vdev_dtl_min(vd)); + ASSERT3U(scn->scn_phys.scn_min_txg, <, vd->vdev_resilver_txg); + ASSERT3U(vd->vdev_resilver_txg, <=, scn->scn_phys.scn_max_txg); + return (B_TRUE); + } + return (B_FALSE); +} + +/* * Reassess DTLs after a config change or scrub completion. */ void @@ -1775,9 +1844,17 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t t dsl_scan_t *scn = spa->spa_dsl_pool->dp_scan; mutex_enter(&vd->vdev_dtl_lock); + + /* + * If we've completed a scan cleanly then determine + * if this vdev should remove any DTLs. We only want to + * excise regions on vdevs that were available during + * the entire duration of this scan. + */ if (scrub_txg != 0 && (spa->spa_scrub_started || - (scn && scn->scn_phys.scn_errors == 0))) { + (scn != NULL && scn->scn_phys.scn_errors == 0)) && + vdev_dtl_should_excise(vd)) { /* * We completed a scrub up to scrub_txg. If we * did it without rebooting, then the scrub dtl @@ -1816,6 +1893,16 @@ vdev_dtl_reassess(vdev_t *vd, uint64_t t else space_map_walk(&vd->vdev_dtl[DTL_MISSING], space_map_add, &vd->vdev_dtl[DTL_OUTAGE]); + + /* + * If the vdev was resilvering and no longer has any + * DTLs then reset its resilvering flag. + */ + if (vd->vdev_resilver_txg != 0 && + vd->vdev_dtl[DTL_MISSING].sm_space == 0 && + vd->vdev_dtl[DTL_OUTAGE].sm_space == 0) + vd->vdev_resilver_txg = 0; + mutex_exit(&vd->vdev_dtl_lock); if (txg != 0) @@ -1993,12 +2080,9 @@ vdev_resilver_needed(vdev_t *vd, uint64_ mutex_enter(&vd->vdev_dtl_lock); if (vd->vdev_dtl[DTL_MISSING].sm_space != 0 && vdev_writeable(vd)) { - space_seg_t *ss; - ss = avl_first(&vd->vdev_dtl[DTL_MISSING].sm_root); - thismin = ss->ss_start - 1; - ss = avl_last(&vd->vdev_dtl[DTL_MISSING].sm_root); - thismax = ss->ss_end; + thismin = vdev_dtl_min(vd); + thismax = vdev_dtl_max(vd); needed = B_TRUE; } mutex_exit(&vd->vdev_dtl_lock); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Mon Feb 17 16:48:11 2014 (r262088) @@ -222,30 +222,25 @@ vdev_config_generate(spa_t *spa, vdev_t { nvlist_t *nv = NULL; - VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) == 0); + nv = fnvlist_alloc(); - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_TYPE, - vd->vdev_ops->vdev_op_type) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_TYPE, vd->vdev_ops->vdev_op_type); if (!(flags & (VDEV_CONFIG_SPARE | VDEV_CONFIG_L2CACHE))) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ID, vd->vdev_id) - == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_GUID, vd->vdev_guid) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ID, vd->vdev_id); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_GUID, vd->vdev_guid); if (vd->vdev_path != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_PATH, - vd->vdev_path) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_PATH, vd->vdev_path); if (vd->vdev_devid != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_DEVID, - vd->vdev_devid) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_DEVID, vd->vdev_devid); if (vd->vdev_physpath != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_PHYS_PATH, - vd->vdev_physpath) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_PHYS_PATH, + vd->vdev_physpath); if (vd->vdev_fru != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_FRU, - vd->vdev_fru) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_FRU, vd->vdev_fru); if (vd->vdev_nparity != 0) { ASSERT(strcmp(vd->vdev_ops->vdev_op_type, @@ -266,59 +261,54 @@ vdev_config_generate(spa_t *spa, vdev_t * that only support a single parity device -- older software * will just ignore it. */ - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_NPARITY, - vd->vdev_nparity) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_NPARITY, vd->vdev_nparity); } if (vd->vdev_wholedisk != -1ULL) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK, - vd->vdev_wholedisk) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK, + vd->vdev_wholedisk); if (vd->vdev_not_present) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT, 1) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT, 1); if (vd->vdev_isspare) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_SPARE, 1) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_SPARE, 1); if (!(flags & (VDEV_CONFIG_SPARE | VDEV_CONFIG_L2CACHE)) && vd == vd->vdev_top) { - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_ARRAY, - vd->vdev_ms_array) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_SHIFT, - vd->vdev_ms_shift) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASHIFT, - vd->vdev_ashift) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ASIZE, - vd->vdev_asize) == 0); - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_LOG, - vd->vdev_islog) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_ARRAY, + vd->vdev_ms_array); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_METASLAB_SHIFT, + vd->vdev_ms_shift); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ASHIFT, vd->vdev_ashift); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ASIZE, + vd->vdev_asize); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_LOG, vd->vdev_islog); if (vd->vdev_removing) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVING, - vd->vdev_removing) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVING, + vd->vdev_removing); } if (vd->vdev_dtl_smo.smo_object != 0) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_DTL, - vd->vdev_dtl_smo.smo_object) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_DTL, + vd->vdev_dtl_smo.smo_object); if (vd->vdev_crtxg) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_CREATE_TXG, - vd->vdev_crtxg) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_CREATE_TXG, vd->vdev_crtxg); if (getstats) { vdev_stat_t vs; pool_scan_stat_t ps; vdev_get_stats(vd, &vs); - VERIFY(nvlist_add_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, - (uint64_t *)&vs, sizeof (vs) / sizeof (uint64_t)) == 0); + fnvlist_add_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, + (uint64_t *)&vs, sizeof (vs) / sizeof (uint64_t)); /* provide either current or previous scan information */ if (spa_scan_get_stats(spa, &ps) == 0) { - VERIFY(nvlist_add_uint64_array(nv, + fnvlist_add_uint64_array(nv, ZPOOL_CONFIG_SCAN_STATS, (uint64_t *)&ps, - sizeof (pool_scan_stat_t) / sizeof (uint64_t)) - == 0); + sizeof (pool_scan_stat_t) / sizeof (uint64_t)); } } @@ -348,8 +338,8 @@ vdev_config_generate(spa_t *spa, vdev_t } if (idx) { - VERIFY(nvlist_add_nvlist_array(nv, - ZPOOL_CONFIG_CHILDREN, child, idx) == 0); + fnvlist_add_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN, + child, idx); } for (c = 0; c < idx; c++) @@ -361,26 +351,20 @@ vdev_config_generate(spa_t *spa, vdev_t const char *aux = NULL; if (vd->vdev_offline && !vd->vdev_tmpoffline) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_OFFLINE, - B_TRUE) == 0); - if (vd->vdev_resilvering) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_RESILVERING, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_OFFLINE, B_TRUE); + if (vd->vdev_resilver_txg != 0) + fnvlist_add_uint64(nv, ZPOOL_CONFIG_RESILVER_TXG, + vd->vdev_resilver_txg); if (vd->vdev_faulted) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_FAULTED, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_FAULTED, B_TRUE); if (vd->vdev_degraded) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_DEGRADED, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_DEGRADED, B_TRUE); if (vd->vdev_removed) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVED, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVED, B_TRUE); if (vd->vdev_unspare) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_UNSPARE, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_UNSPARE, B_TRUE); if (vd->vdev_ishole) - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_IS_HOLE, - B_TRUE) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_IS_HOLE, B_TRUE); switch (vd->vdev_stat.vs_aux) { case VDEV_AUX_ERR_EXCEEDED: @@ -393,12 +377,11 @@ vdev_config_generate(spa_t *spa, vdev_t } if (aux != NULL) - VERIFY(nvlist_add_string(nv, ZPOOL_CONFIG_AUX_STATE, - aux) == 0); + fnvlist_add_string(nv, ZPOOL_CONFIG_AUX_STATE, aux); if (vd->vdev_splitting && vd->vdev_orig_guid != 0LL) { - VERIFY(nvlist_add_uint64(nv, ZPOOL_CONFIG_ORIG_GUID, - vd->vdev_orig_guid) == 0); + fnvlist_add_uint64(nv, ZPOOL_CONFIG_ORIG_GUID, + vd->vdev_orig_guid); } } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c Mon Feb 17 16:48:11 2014 (r262088) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. */ #include @@ -94,3 +94,16 @@ zfs_dbgmsg(const char *fmt, ...) } mutex_exit(&zfs_dbgmsgs_lock); } + +void +zfs_dbgmsg_print(const char *tag) +{ + zfs_dbgmsg_t *zdm; + + (void) printf("ZFS_DBGMSG(%s):\n", tag); + mutex_enter(&zfs_dbgmsgs_lock); + for (zdm = list_head(&zfs_dbgmsgs); zdm; + zdm = list_next(&zfs_dbgmsgs, zdm)) + (void) printf("%s\n", zdm->zdm_msg); + mutex_exit(&zfs_dbgmsgs_lock); +} Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:47:58 2014 (r262087) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Mon Feb 17 16:48:11 2014 (r262088) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012, Martin Matuska . All rights reserved. @@ -523,7 +523,7 @@ typedef struct zpool_rewind_policy { #define ZPOOL_CONFIG_SPLIT_GUID "split_guid" #define ZPOOL_CONFIG_SPLIT_LIST "guid_list" #define ZPOOL_CONFIG_REMOVING "removing" -#define ZPOOL_CONFIG_RESILVERING "resilvering" +#define ZPOOL_CONFIG_RESILVER_TXG "resilver_txg" #define ZPOOL_CONFIG_COMMENT "comment" #define ZPOOL_CONFIG_SUSPENDED "suspended" /* not stored on disk */ #define ZPOOL_CONFIG_TIMESTAMP "timestamp" /* not stored on disk */ From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:00:49 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CEAF69BA; Mon, 17 Feb 2014 17:00: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5327173A; Mon, 17 Feb 2014 17:00:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HH0nmC049981; Mon, 17 Feb 2014 17:00:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HH0k62049959; Mon, 17 Feb 2014 17:00:46 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171700.s1HH0k62049959@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:00:46 +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: r262089 - in stable/9: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/co... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:00:49 -0000 Author: avg Date: Mon Feb 17 17:00:46 2014 New Revision: 262089 URL: http://svnweb.freebsd.org/changeset/base/262089 Log: MFC r255750: MFV r254750: Add support of Illumos dumps on zvol over RAID-Z. Note that this only adds the features. FreeBSD would still need more work to support dumping on zvols. MFC slacker: delphij Added: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h - copied unchanged from r255750, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Feb 17 17:00:46 2014 (r262089) @@ -19,16 +19,16 @@ .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright (c) 2012 by Delphix. All rights reserved. -.\" Copyright (c) 2012, Joyent, Inc. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Bryan Drewery .\" Copyright (c) 2012, Glen Barber .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved. +.\" Copyright (c) 2013, Joyent, Inc. All rights reserved. .\" .\" $FreeBSD$ .\" -.Dd March 21, 2013 +.Dd September 20, 2013 .Dt ZFS 8 .Os .Sh NAME @@ -885,14 +885,21 @@ command or unmounted by the command. .Pp This property is not inherited. -.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 +.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 | noparity Controls the checksum used to verify data integrity. The default value is .Cm on , which automatically selects an appropriate algorithm (currently, .Cm fletcher4 , but this may change in future releases). The value .Cm off -disables integrity checking on user data. Disabling checksums is +disables integrity checking on user data. +The value +.Cm noparity +not only +disables integrity but also disables maintaining parity for user data. This +setting is used internally by a dump device residing on a RAID-Z pool and should +not be used by any other dataset. +Disabling checksums is .Em NOT a recommended practice. .It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | zle | Cm lz4 Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:00:46 2014 (r262089) @@ -19,10 +19,11 @@ .\" .\" Copyright (c) 2012 by Delphix. All rights reserved. .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. +.\" Copyright (c) 2013, Joyent, Inc. All rights reserved. .\" .\" $FreeBSD$ .\" -.Dd February 8, 2013 +.Dd September 20, 2013 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -229,6 +230,27 @@ feature. At the moment, this operation cannot be reversed. Booting off of .Sy lz4 -compressed root pools is supported. +.It Sy multi_vdev_crash_dump +.Bl -column "READ\-ONLY COMPATIBLE" "com.joyent:multi_vdev_crash_dump" +.It GUID Ta com.joyent:multi_vdev_crash_dump +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta none +.El +.Pp +This feature allows a dump device to be configured with a pool comprised +of multiple vdevs. +Those vdevs may be arranged in any mirrored or raidz +configuration. +.\" TODO: this is not yet supported on FreeBSD. +.\" .Pp +.\" When the +.\" .Sy multi_vdev_crash_dump +.\" feature is set to +.\" .Sy enabled , +.\" the administrator can use the +.\" .Xr dumpon 8 +.\" command to configure a +.\" dump device on a pool comprised of multiple vdevs. .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Feb 17 17:00:46 2014 (r262089) @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -4020,9 +4021,7 @@ supported_dump_vdev_type(libzfs_handle_t uint_t children, c; verify(nvlist_lookup_string(config, ZPOOL_CONFIG_TYPE, &type) == 0); - if (strcmp(type, VDEV_TYPE_RAIDZ) == 0 || - strcmp(type, VDEV_TYPE_FILE) == 0 || - strcmp(type, VDEV_TYPE_LOG) == 0 || + if (strcmp(type, VDEV_TYPE_FILE) == 0 || strcmp(type, VDEV_TYPE_HOLE) == 0 || strcmp(type, VDEV_TYPE_MISSING) == 0) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, @@ -4041,8 +4040,12 @@ supported_dump_vdev_type(libzfs_handle_t } /* - * check if this zvol is allowable for use as a dump device; zero if - * it is, > 0 if it isn't, < 0 if it isn't a zvol + * Check if this zvol is allowable for use as a dump device; zero if + * it is, > 0 if it isn't, < 0 if it isn't a zvol. + * + * Allowable storage configurations include mirrors, all raidz variants, and + * pools with log, cache, and spare devices. Pools which are backed by files or + * have missing/hole vdevs are not suitable. */ int zvol_check_dump_config(char *arg) @@ -4104,12 +4107,6 @@ zvol_check_dump_config(char *arg) verify(nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN, &top, &toplevels) == 0); - if (toplevels != 1) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "'%s' has multiple top level vdevs"), poolname); - (void) zfs_error(hdl, EZFS_DEVOVERFLOW, errbuf); - goto out; - } if (!supported_dump_vdev_type(hdl, top[0], errbuf)) { goto out; Modified: stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:00:46 2014 (r262089) @@ -22,6 +22,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #ifdef _KERNEL @@ -159,4 +160,7 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_LZ4_COMPRESS, "org.illumos:lz4_compress", "lz4_compress", "LZ4 compression algorithm support.", B_FALSE, B_FALSE, NULL); + zfeature_register(SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, + "com.joyent:multi_vdev_crash_dump", "multi_vdev_crash_dump", + "Crash dumps to multiple vdev pools.", B_FALSE, B_FALSE, NULL); } Modified: stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:00:46 2014 (r262089) @@ -22,6 +22,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #ifndef _ZFEATURE_COMMON_H @@ -53,6 +54,7 @@ static enum spa_feature { SPA_FEATURE_ASYNC_DESTROY, SPA_FEATURE_EMPTY_BPOBJ, SPA_FEATURE_LZ4_COMPRESS, + SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, SPA_FEATURES } spa_feature_t; Modified: stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Feb 17 17:00:46 2014 (r262089) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -69,6 +70,7 @@ zfs_prop_init(void) { "fletcher2", ZIO_CHECKSUM_FLETCHER_2 }, { "fletcher4", ZIO_CHECKSUM_FLETCHER_4 }, { "sha256", ZIO_CHECKSUM_SHA256 }, + { "noparity", ZIO_CHECKSUM_NOPARITY }, { NULL } }; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Feb 17 17:00:46 2014 (r262089) @@ -23,6 +23,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -2795,7 +2796,8 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ dr->dt.dl.dr_copies, dr->dt.dl.dr_nopwrite); mutex_exit(&db->db_mtx); } else if (db->db_state == DB_NOFILL) { - ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF); + ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF || + zp.zp_checksum == ZIO_CHECKSUM_NOPARITY); dr->dr_zio = zio_write(zio, os->os_spa, txg, db->db_blkptr, NULL, db->db.db_size, &zp, dbuf_write_nofill_ready, NULL, dbuf_write_nofill_done, db, Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Feb 17 17:00:46 2014 (r262089) @@ -22,8 +22,8 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. */ - /* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ +/* Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include #include @@ -1682,7 +1682,7 @@ dmu_write_policy(objset_t *os, dnode_t * * pipeline. */ compress = ZIO_COMPRESS_OFF; - checksum = ZIO_CHECKSUM_OFF; + checksum = ZIO_CHECKSUM_NOPARITY; } else { compress = zio_compress_select(dn->dn_compress, compress); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h Mon Feb 17 17:00:46 2014 (r262089) @@ -21,13 +21,12 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ #ifndef _SYS_VDEV_DISK_H #define _SYS_VDEV_DISK_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifdef _KERNEL #include @@ -40,14 +39,23 @@ extern "C" { #endif +#ifdef _KERNEL typedef struct vdev_disk { ddi_devid_t vd_devid; char *vd_minor; ldi_handle_t vd_lh; } vdev_disk_t; +#endif +extern int vdev_disk_physio(vdev_t *, + caddr_t, size_t, uint64_t, int, boolean_t); + +/* + * Since vdev_disk.c is not compiled into libzpool, this function should only be + * defined in the zfs kernel module. + */ #ifdef _KERNEL -extern int vdev_disk_physio(ldi_handle_t, caddr_t, size_t, uint64_t, int); +extern int vdev_disk_ldi_physio(ldi_handle_t, caddr_t, size_t, uint64_t, int); #endif #ifdef __cplusplus } Copied: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h (from r255750, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h Mon Feb 17 17:00:46 2014 (r262089, copy of r255750, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h) @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright (c) 2013, Joyent, Inc. All rights reserved. + */ + +#ifndef _SYS_VDEV_RAIDZ_H +#define _SYS_VDEV_RAIDZ_H + +#include +#ifdef illumos +#include +#ifdef _KERNEL +#include +#include +#include +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _KERNEL +extern int vdev_raidz_physio(vdev_t *, + caddr_t, size_t, uint64_t, uint64_t, boolean_t, boolean_t); +#endif +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_VDEV_RAIDZ_H */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Feb 17 17:00:46 2014 (r262089) @@ -25,6 +25,7 @@ * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #ifndef _ZIO_H @@ -81,6 +82,7 @@ enum zio_checksum { ZIO_CHECKSUM_FLETCHER_4, ZIO_CHECKSUM_SHA256, ZIO_CHECKSUM_ZILOG2, + ZIO_CHECKSUM_NOPARITY, ZIO_CHECKSUM_FUNCTIONS }; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Feb 17 17:00:46 2014 (r262089) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright 2013 Joyent, Inc. All rights reserved. */ #include @@ -391,8 +392,29 @@ vdev_disk_close(vdev_t *vd) } int -vdev_disk_physio(ldi_handle_t vd_lh, caddr_t data, size_t size, - uint64_t offset, int flags) +vdev_disk_physio(vdev_t *vd, caddr_t data, + size_t size, uint64_t offset, int flags, boolean_t isdump) +{ + vdev_disk_t *dvd = vd->vdev_tsd; + + ASSERT(vd->vdev_ops == &vdev_disk_ops); + + /* + * If in the context of an active crash dump, use the ldi_dump(9F) + * call instead of ldi_strategy(9F) as usual. + */ + if (isdump) { + ASSERT3P(dvd, !=, NULL); + return (ldi_dump(dvd->vd_lh, data, lbtodb(offset), + lbtodb(size))); + } + + return (vdev_disk_ldi_physio(dvd->vd_lh, data, size, offset, flags)); +} + +int +vdev_disk_ldi_physio(ldi_handle_t vd_lh, caddr_t data, + size_t size, uint64_t offset, int flags) { buf_t *bp; int error = 0; @@ -640,7 +662,7 @@ vdev_disk_read_rootlabel(char *devpath, /* read vdev label */ offset = vdev_label_offset(size, l, 0); - if (vdev_disk_physio(vd_lh, (caddr_t)label, + if (vdev_disk_ldi_physio(vd_lh, (caddr_t)label, VDEV_SKIP_SIZE + VDEV_PHYS_SIZE, offset, B_READ) != 0) continue; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 17:00:46 2014 (r262089) @@ -22,15 +22,22 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include #include #include +#ifdef illumos +#include +#endif +#include +#include #include #include #include #include +#include /* * Virtual device vector for RAID-Z. @@ -154,6 +161,8 @@ typedef struct raidz_map { VDEV_RAIDZ_64MUL_2((x), mask); \ } +#define VDEV_LABEL_OFFSET(x) (x + VDEV_LABEL_START_SIZE) + /* * Force reconstruction to use the general purpose method. */ @@ -437,14 +446,14 @@ static const zio_vsd_ops_t vdev_raidz_vs * the number of children in the target vdev. */ static raidz_map_t * -vdev_raidz_map_alloc(zio_t *zio, uint64_t unit_shift, uint64_t dcols, - uint64_t nparity) +vdev_raidz_map_alloc(caddr_t data, uint64_t size, uint64_t offset, boolean_t dofree, + uint64_t unit_shift, uint64_t dcols, uint64_t nparity) { raidz_map_t *rm; /* The starting RAIDZ (parent) vdev sector of the block. */ - uint64_t b = zio->io_offset >> unit_shift; + uint64_t b = offset >> unit_shift; /* The zio's size in units of the vdev's minimum sector size. */ - uint64_t s = zio->io_size >> unit_shift; + uint64_t s = size >> unit_shift; /* The first column for this stripe. */ uint64_t f = b % dcols; /* The starting byte offset on each child vdev. */ @@ -532,13 +541,13 @@ vdev_raidz_map_alloc(zio_t *zio, uint64_ ASSERT3U(rm->rm_asize - asize, ==, rm->rm_nskip << unit_shift); ASSERT3U(rm->rm_nskip, <=, nparity); - if (zio->io_type != ZIO_TYPE_FREE) { + if (!dofree) { for (c = 0; c < rm->rm_firstdatacol; c++) { rm->rm_col[c].rc_data = zio_buf_alloc(rm->rm_col[c].rc_size); } - rm->rm_col[c].rc_data = zio->io_data; + rm->rm_col[c].rc_data = data; for (c = c + 1; c < acols; c++) { rm->rm_col[c].rc_data = @@ -570,7 +579,7 @@ vdev_raidz_map_alloc(zio_t *zio, uint64_ ASSERT(rm->rm_cols >= 2); ASSERT(rm->rm_col[0].rc_size == rm->rm_col[1].rc_size); - if (rm->rm_firstdatacol == 1 && (zio->io_offset & (1ULL << 20))) { + if (rm->rm_firstdatacol == 1 && (offset & (1ULL << 20))) { devidx = rm->rm_col[0].rc_devidx; o = rm->rm_col[0].rc_offset; rm->rm_col[0].rc_devidx = rm->rm_col[1].rc_devidx; @@ -582,8 +591,6 @@ vdev_raidz_map_alloc(zio_t *zio, uint64_ rm->rm_skipstart = 1; } - zio->io_vsd = rm; - zio->io_vsd_ops = &vdev_raidz_vsd_ops; return (rm); } @@ -993,12 +1000,9 @@ vdev_raidz_reconstruct_pq(raidz_map_t *r * ~~ ~~ * __ __ * | 1 1 1 1 1 1 1 1 | - * | 128 64 32 16 8 4 2 1 | * | 19 205 116 29 64 16 4 1 | * | 1 0 0 0 0 0 0 0 | - * | 0 1 0 0 0 0 0 0 | - * (V|I)' = | 0 0 1 0 0 0 0 0 | - * | 0 0 0 1 0 0 0 0 | + * (V|I)' = | 0 0 0 1 0 0 0 0 | * | 0 0 0 0 1 0 0 0 | * | 0 0 0 0 0 1 0 0 | * | 0 0 0 0 0 0 1 0 | @@ -1532,6 +1536,154 @@ vdev_raidz_close(vdev_t *vd) vdev_close(vd->vdev_child[c]); } +#ifdef illumos +/* + * Handle a read or write I/O to a RAID-Z dump device. + * + * The dump device is in a unique situation compared to other ZFS datasets: + * writing to this device should be as simple and fast as possible. In + * addition, durability matters much less since the dump will be extracted + * once the machine reboots. For that reason, this function eschews parity for + * performance and simplicity. The dump device uses the checksum setting + * ZIO_CHECKSUM_NOPARITY to indicate that parity is not maintained for this + * dataset. + * + * Blocks of size 128 KB have been preallocated for this volume. I/Os less than + * 128 KB will not fill an entire block; in addition, they may not be properly + * aligned. In that case, this function uses the preallocated 128 KB block and + * omits reading or writing any "empty" portions of that block, as opposed to + * allocating a fresh appropriately-sized block. + * + * Looking at an example of a 32 KB I/O to a RAID-Z vdev with 5 child vdevs: + * + * vdev_raidz_io_start(data, size: 32 KB, offset: 64 KB) + * + * If this were a standard RAID-Z dataset, a block of at least 40 KB would be + * allocated which spans all five child vdevs. 8 KB of data would be written to + * each of four vdevs, with the fifth containing the parity bits. + * + * parity data data data data + * | PP | XX | XX | XX | XX | + * ^ ^ ^ ^ ^ + * | | | | | + * 8 KB parity ------8 KB data blocks------ + * + * However, when writing to the dump device, the behavior is different: + * + * vdev_raidz_physio(data, size: 32 KB, offset: 64 KB) + * + * Unlike the normal RAID-Z case in which the block is allocated based on the + * I/O size, reads and writes here always use a 128 KB logical I/O size. If the + * I/O size is less than 128 KB, only the actual portions of data are written. + * In this example the data is written to the third data vdev since that vdev + * contains the offset [64 KB, 96 KB). + * + * parity data data data data + * | | | | XX | | + * ^ + * | + * 32 KB data block + * + * As a result, an individual I/O may not span all child vdevs; moreover, a + * small I/O may only operate on a single child vdev. + * + * Note that since there are no parity bits calculated or written, this format + * remains the same no matter how many parity bits are used in a normal RAID-Z + * stripe. On a RAID-Z3 configuration with seven child vdevs, the example above + * would look like: + * + * parity parity parity data data data data + * | | | | | | XX | | + * ^ + * | + * 32 KB data block + */ +int +vdev_raidz_physio(vdev_t *vd, caddr_t data, size_t size, + uint64_t offset, uint64_t origoffset, boolean_t doread, boolean_t isdump) +{ + vdev_t *tvd = vd->vdev_top; + vdev_t *cvd; + raidz_map_t *rm; + raidz_col_t *rc; + int c, err = 0; + + uint64_t start, end, colstart, colend; + uint64_t coloffset, colsize, colskip; + + int flags = doread ? BIO_READ : BIO_WRITE; + +#ifdef _KERNEL + + /* + * Don't write past the end of the block + */ + VERIFY3U(offset + size, <=, origoffset + SPA_MAXBLOCKSIZE); + + start = offset; + end = start + size; + + /* + * Allocate a RAID-Z map for this block. Note that this block starts + * from the "original" offset, this is, the offset of the extent which + * contains the requisite offset of the data being read or written. + * + * Even if this I/O operation doesn't span the full block size, let's + * treat the on-disk format as if the only blocks are the complete 128 + * KB size. + */ + rm = vdev_raidz_map_alloc(data - (offset - origoffset), + SPA_MAXBLOCKSIZE, origoffset, B_FALSE, tvd->vdev_ashift, vd->vdev_children, + vd->vdev_nparity); + + coloffset = origoffset; + + for (c = rm->rm_firstdatacol; c < rm->rm_cols; + c++, coloffset += rc->rc_size) { + rc = &rm->rm_col[c]; + cvd = vd->vdev_child[rc->rc_devidx]; + + /* + * Find the start and end of this column in the RAID-Z map, + * keeping in mind that the stated size and offset of the + * operation may not fill the entire column for this vdev. + * + * If any portion of the data spans this column, issue the + * appropriate operation to the vdev. + */ + if (coloffset + rc->rc_size <= start) + continue; + if (coloffset >= end) + continue; + + colstart = MAX(coloffset, start); + colend = MIN(end, coloffset + rc->rc_size); + colsize = colend - colstart; + colskip = colstart - coloffset; + + VERIFY3U(colsize, <=, rc->rc_size); + VERIFY3U(colskip, <=, rc->rc_size); + + /* + * Note that the child vdev will have a vdev label at the start + * of its range of offsets, hence the need for + * VDEV_LABEL_OFFSET(). See zio_vdev_child_io() for another + * example of why this calculation is needed. + */ + if ((err = vdev_disk_physio(cvd, + ((char *)rc->rc_data) + colskip, colsize, + VDEV_LABEL_OFFSET(rc->rc_offset) + colskip, + flags, isdump)) != 0) + break; + } + + vdev_raidz_map_free(rm); +#endif /* KERNEL */ + + return (err); +} +#endif + static uint64_t vdev_raidz_asize(vdev_t *vd, uint64_t psize) { @@ -1584,9 +1736,14 @@ vdev_raidz_io_start(zio_t *zio) raidz_col_t *rc; int c, i; - rm = vdev_raidz_map_alloc(zio, tvd->vdev_ashift, vd->vdev_children, + rm = vdev_raidz_map_alloc(zio->io_data, zio->io_size, zio->io_offset, + zio->io_type == ZIO_TYPE_FREE, + tvd->vdev_ashift, vd->vdev_children, vd->vdev_nparity); + zio->io_vsd = rm; + zio->io_vsd_ops = &vdev_raidz_vsd_ops; + ASSERT3U(rm->rm_asize, ==, vdev_psize_to_asize(vd, zio->io_size)); if (zio->io_type == ZIO_TYPE_FREE) { @@ -1729,6 +1886,13 @@ raidz_parity_verify(zio_t *zio, raidz_ma int c, ret = 0; raidz_col_t *rc; + blkptr_t *bp = zio->io_bp; + enum zio_checksum checksum = (bp == NULL ? zio->io_prop.zp_checksum : + (BP_IS_GANG(bp) ? ZIO_CHECKSUM_GANG_HEADER : BP_GET_CHECKSUM(bp))); + + if (checksum == ZIO_CHECKSUM_NOPARITY) + return (ret); + for (c = 0; c < rm->rm_firstdatacol; c++) { rc = &rm->rm_col[c]; if (!rc->rc_tried || rc->rc_error != 0) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Mon Feb 17 17:00:46 2014 (r262089) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -78,6 +79,7 @@ zio_checksum_info_t zio_checksum_table[Z {{fletcher_4_native, fletcher_4_byteswap}, 1, 0, 0, "fletcher4"}, {{zio_checksum_SHA256, zio_checksum_SHA256}, 1, 0, 1, "sha256"}, {{fletcher_4_native, fletcher_4_byteswap}, 0, 1, 0, "zilog2"}, + {{zio_checksum_off, zio_checksum_off}, 0, 0, 0, "noparity"}, }; enum zio_checksum Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Feb 17 16:48:11 2014 (r262088) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Feb 17 17:00:46 2014 (r262089) @@ -24,6 +24,7 @@ * Copyright (c) 2006-2010 Pawel Jakub Dawidek * All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -60,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -77,9 +79,14 @@ #include #include #include +#include #include #include #include +#include +#include +#include + #include #include "zfs_namecheck.h" @@ -1164,27 +1171,28 @@ zvol_log_write(zvol_state_t *zv, dmu_tx_ #ifdef sun static int -zvol_dumpio_vdev(vdev_t *vd, void *addr, uint64_t offset, uint64_t size, - boolean_t doread, boolean_t isdump) +zvol_dumpio_vdev(vdev_t *vd, void *addr, uint64_t offset, uint64_t origoffset, + uint64_t size, boolean_t doread, boolean_t isdump) { vdev_disk_t *dvd; int c; int numerrors = 0; - for (c = 0; c < vd->vdev_children; c++) { - ASSERT(vd->vdev_ops == &vdev_mirror_ops || - vd->vdev_ops == &vdev_replacing_ops || - vd->vdev_ops == &vdev_spare_ops); - int err = zvol_dumpio_vdev(vd->vdev_child[c], - addr, offset, size, doread, isdump); - if (err != 0) { - numerrors++; - } else if (doread) { - break; + if (vd->vdev_ops == &vdev_mirror_ops || + vd->vdev_ops == &vdev_replacing_ops || + vd->vdev_ops == &vdev_spare_ops) { + for (c = 0; c < vd->vdev_children; c++) { + int err = zvol_dumpio_vdev(vd->vdev_child[c], + addr, offset, origoffset, size, doread, isdump); + if (err != 0) { + numerrors++; + } else if (doread) { + break; + } } } - if (!vd->vdev_ops->vdev_op_leaf) + if (!vd->vdev_ops->vdev_op_leaf && vd->vdev_ops != &vdev_raidz_ops) return (numerrors < vd->vdev_children ? 0 : EIO); if (doread && !vdev_readable(vd)) @@ -1192,19 +1200,26 @@ zvol_dumpio_vdev(vdev_t *vd, void *addr, else if (!doread && !vdev_writeable(vd)) return (SET_ERROR(EIO)); - dvd = vd->vdev_tsd; - ASSERT3P(dvd, !=, NULL); + if (vd->vdev_ops == &vdev_raidz_ops) { + return (vdev_raidz_physio(vd, + addr, size, offset, origoffset, doread, isdump)); + } + offset += VDEV_LABEL_START_SIZE; if (ddi_in_panic() || isdump) { ASSERT(!doread); if (doread) return (SET_ERROR(EIO)); + dvd = vd->vdev_tsd; + ASSERT3P(dvd, !=, NULL); return (ldi_dump(dvd->vd_lh, addr, lbtodb(offset), lbtodb(size))); } else { - return (vdev_disk_physio(dvd->vd_lh, addr, size, offset, - doread ? B_READ : B_WRITE)); + dvd = vd->vdev_tsd; + ASSERT3P(dvd, !=, NULL); + return (vdev_disk_ldi_physio(dvd->vd_lh, addr, size, + offset, doread ? B_READ : B_WRITE)); } } @@ -1239,7 +1254,8 @@ zvol_dumpio(zvol_state_t *zv, void *addr vd = vdev_lookup_top(spa, DVA_GET_VDEV(&ze->ze_dva)); offset += DVA_GET_OFFSET(&ze->ze_dva); - error = zvol_dumpio_vdev(vd, addr, offset, size, doread, isdump); + error = zvol_dumpio_vdev(vd, addr, offset, DVA_GET_OFFSET(&ze->ze_dva), + size, doread, isdump); if (!ddi_in_panic()) spa_config_exit(spa, SCL_STATE, FTAG); @@ -1259,6 +1275,7 @@ zvol_strategy(struct bio *bp) rl_t *rl; int error = 0; boolean_t doread = (bp->bio_cmd == BIO_READ); + boolean_t is_dumpified; boolean_t sync; if (zv == NULL) { @@ -1285,7 +1302,13 @@ zvol_strategy(struct bio *bp) return (0); } - sync = !doread && zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS; +#ifdef illumos + is_dumpified = zv->zv_flags & ZVOL_DUMPIFIED; +#else + is_dumpified = B_FALSE; +#endif + sync = !doread && !is_dumpified && + zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS; /* * There must be no buffer changes when doing a dmu_sync() because @@ -1296,7 +1319,15 @@ zvol_strategy(struct bio *bp) while (resid != 0 && off < volsize) { size_t size = MIN(resid, zvol_maxphys); +#ifdef illumos + if (is_dumpified) { + size = MIN(size, P2END(off, zv->zv_volblocksize) - off); + error = zvol_dumpio(zv, addr, off, size, + doread, B_FALSE); + } else if (doread) { +#else if (doread) { +#endif error = dmu_read(os, ZVOL_OBJ, off, size, addr, DMU_READ_PREFETCH); } else { @@ -1830,21 +1861,67 @@ zvol_fini(void) } #ifdef sun +/*ARGSUSED*/ +static int +zfs_mvdev_dump_feature_check(void *arg, dmu_tx_t *tx) +{ + spa_t *spa = dmu_tx_pool(tx)->dp_spa; + + if (spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_MULTI_VDEV_CRASH_DUMP])) + return (1); + return (0); +} + +/*ARGSUSED*/ +static void +zfs_mvdev_dump_activate_feature_sync(void *arg, dmu_tx_t *tx) +{ + spa_t *spa = dmu_tx_pool(tx)->dp_spa; + + spa_feature_incr(spa, + &spa_feature_table[SPA_FEATURE_MULTI_VDEV_CRASH_DUMP], tx); +} + static int zvol_dump_init(zvol_state_t *zv, boolean_t resize) { dmu_tx_t *tx; - int error = 0; + int error; objset_t *os = zv->zv_objset; + spa_t *spa = dmu_objset_spa(os); + vdev_t *vd = spa->spa_root_vdev; nvlist_t *nv = NULL; - uint64_t version = spa_version(dmu_objset_spa(zv->zv_objset)); + uint64_t version = spa_version(spa); + enum zio_checksum checksum; ASSERT(MUTEX_HELD(&spa_namespace_lock)); + ASSERT(vd->vdev_ops == &vdev_root_ops); + error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, 0, DMU_OBJECT_END); /* wait for dmu_free_long_range to actually free the blocks */ txg_wait_synced(dmu_objset_pool(zv->zv_objset), 0); + /* + * If the pool on which the dump device is being initialized has more + * than one child vdev, check that the MULTI_VDEV_CRASH_DUMP feature is + * enabled. If so, bump that feature's counter to indicate that the + * feature is active. We also check the vdev type to handle the + * following case: + * # zpool create test raidz disk1 disk2 disk3 + * Now have spa_root_vdev->vdev_children == 1 (the raidz vdev), + * the raidz vdev itself has 3 children. + */ + if (vd->vdev_children > 1 || vd->vdev_ops == &vdev_raidz_ops) { + if (!spa_feature_is_enabled(spa, + &spa_feature_table[SPA_FEATURE_MULTI_VDEV_CRASH_DUMP])) + return (SET_ERROR(ENOTSUP)); + (void) dsl_sync_task(spa_name(spa), + zfs_mvdev_dump_feature_check, + zfs_mvdev_dump_activate_feature_sync, NULL, 2); + } + tx = dmu_tx_create(os); dmu_tx_hold_zap(tx, ZVOL_ZAP_OBJ, TRUE, NULL); dmu_tx_hold_bonus(tx, ZVOL_OBJ); @@ -1855,6 +1932,14 @@ zvol_dump_init(zvol_state_t *zv, boolean } /* + * If MULTI_VDEV_CRASH_DUMP is active, use the NOPARITY checksum + * function. Otherwise, use the old default -- OFF. + */ + checksum = spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_MULTI_VDEV_CRASH_DUMP]) ? + ZIO_CHECKSUM_NOPARITY : ZIO_CHECKSUM_OFF; + + /* * If we are resizing the dump device then we only need to * update the refreservation to match the newly updated * zvolsize. Otherwise, we save off the original state of the @@ -1917,7 +2002,7 @@ zvol_dump_init(zvol_state_t *zv, boolean ZIO_COMPRESS_OFF) == 0); VERIFY(nvlist_add_uint64(nv, zfs_prop_to_name(ZFS_PROP_CHECKSUM), - ZIO_CHECKSUM_OFF) == 0); + checksum) == 0); if (version >= SPA_VERSION_DEDUP) { VERIFY(nvlist_add_uint64(nv, zfs_prop_to_name(ZFS_PROP_DEDUP), From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:01:45 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F1B8AB07; Mon, 17 Feb 2014 17:01: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5A1017A2; Mon, 17 Feb 2014 17:01:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HH1iQC051159; Mon, 17 Feb 2014 17:01:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HH1fFB051136; Mon, 17 Feb 2014 17:01:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171701.s1HH1fFB051136@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:01:41 +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: r262090 - in stable/8: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/co... X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:01:45 -0000 Author: avg Date: Mon Feb 17 17:01:41 2014 New Revision: 262090 URL: http://svnweb.freebsd.org/changeset/base/262090 Log: MFC r255750: MFV r254750: Add support of Illumos dumps on zvol over RAID-Z. Note that this only adds the features. FreeBSD would still need more work to support dumping on zvols. MFC slacker: delphij Added: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h - copied unchanged from r255750, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 Mon Feb 17 17:01:41 2014 (r262090) @@ -19,15 +19,15 @@ .\" .\" Copyright (c) 2010, Sun Microsystems, Inc. All Rights Reserved. .\" Copyright (c) 2012 by Delphix. All rights reserved. -.\" Copyright (c) 2012, Joyent, Inc. All rights reserved. .\" Copyright (c) 2011, Pawel Jakub Dawidek .\" Copyright (c) 2012, Glen Barber .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. .\" Copyright (c) 2013 Nexenta Systems, Inc. All Rights Reserved. +.\" Copyright (c) 2013, Joyent, Inc. All rights reserved. .\" .\" $FreeBSD$ .\" -.Dd March 21, 2013 +.Dd September 20, 2013 .Dt ZFS 8 .Os .Sh NAME @@ -884,14 +884,21 @@ command or unmounted by the command. .Pp This property is not inherited. -.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 +.It Sy checksum Ns = Ns Cm on | off | fletcher2 | fletcher4 | sha256 | noparity Controls the checksum used to verify data integrity. The default value is .Cm on , which automatically selects an appropriate algorithm (currently, .Cm fletcher4 , but this may change in future releases). The value .Cm off -disables integrity checking on user data. Disabling checksums is +disables integrity checking on user data. +The value +.Cm noparity +not only +disables integrity but also disables maintaining parity for user data. This +setting is used internally by a dump device residing on a RAID-Z pool and should +not be used by any other dataset. +Disabling checksums is .Em NOT a recommended practice. .It Sy compression Ns = Ns Cm on | off | lzjb | gzip | gzip- Ns Ar N | zle | Cm lz4 Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:01:41 2014 (r262090) @@ -19,10 +19,11 @@ .\" .\" Copyright (c) 2012 by Delphix. All rights reserved. .\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved. +.\" Copyright (c) 2013, Joyent, Inc. All rights reserved. .\" .\" $FreeBSD$ .\" -.Dd February 8, 2013 +.Dd September 20, 2013 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -229,6 +230,27 @@ feature. At the moment, this operation cannot be reversed. Booting off of .Sy lz4 -compressed root pools is supported. +.It Sy multi_vdev_crash_dump +.Bl -column "READ\-ONLY COMPATIBLE" "com.joyent:multi_vdev_crash_dump" +.It GUID Ta com.joyent:multi_vdev_crash_dump +.It READ\-ONLY COMPATIBLE Ta no +.It DEPENDENCIES Ta none +.El +.Pp +This feature allows a dump device to be configured with a pool comprised +of multiple vdevs. +Those vdevs may be arranged in any mirrored or raidz +configuration. +.\" TODO: this is not yet supported on FreeBSD. +.\" .Pp +.\" When the +.\" .Sy multi_vdev_crash_dump +.\" feature is set to +.\" .Sy enabled , +.\" the administrator can use the +.\" .Xr dumpon 8 +.\" command to configure a +.\" dump device on a pool comprised of multiple vdevs. .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Mon Feb 17 17:01:41 2014 (r262090) @@ -23,6 +23,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -4020,9 +4021,7 @@ supported_dump_vdev_type(libzfs_handle_t uint_t children, c; verify(nvlist_lookup_string(config, ZPOOL_CONFIG_TYPE, &type) == 0); - if (strcmp(type, VDEV_TYPE_RAIDZ) == 0 || - strcmp(type, VDEV_TYPE_FILE) == 0 || - strcmp(type, VDEV_TYPE_LOG) == 0 || + if (strcmp(type, VDEV_TYPE_FILE) == 0 || strcmp(type, VDEV_TYPE_HOLE) == 0 || strcmp(type, VDEV_TYPE_MISSING) == 0) { zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, @@ -4041,8 +4040,12 @@ supported_dump_vdev_type(libzfs_handle_t } /* - * check if this zvol is allowable for use as a dump device; zero if - * it is, > 0 if it isn't, < 0 if it isn't a zvol + * Check if this zvol is allowable for use as a dump device; zero if + * it is, > 0 if it isn't, < 0 if it isn't a zvol. + * + * Allowable storage configurations include mirrors, all raidz variants, and + * pools with log, cache, and spare devices. Pools which are backed by files or + * have missing/hole vdevs are not suitable. */ int zvol_check_dump_config(char *arg) @@ -4104,12 +4107,6 @@ zvol_check_dump_config(char *arg) verify(nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN, &top, &toplevels) == 0); - if (toplevels != 1) { - zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, - "'%s' has multiple top level vdevs"), poolname); - (void) zfs_error(hdl, EZFS_DEVOVERFLOW, errbuf); - goto out; - } if (!supported_dump_vdev_type(hdl, top[0], errbuf)) { goto out; Modified: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:01:41 2014 (r262090) @@ -22,6 +22,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #ifdef _KERNEL @@ -159,4 +160,7 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_LZ4_COMPRESS, "org.illumos:lz4_compress", "lz4_compress", "LZ4 compression algorithm support.", B_FALSE, B_FALSE, NULL); + zfeature_register(SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, + "com.joyent:multi_vdev_crash_dump", "multi_vdev_crash_dump", + "Crash dumps to multiple vdev pools.", B_FALSE, B_FALSE, NULL); } Modified: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:01:41 2014 (r262090) @@ -22,6 +22,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #ifndef _ZFEATURE_COMMON_H @@ -53,6 +54,7 @@ static enum spa_feature { SPA_FEATURE_ASYNC_DESTROY, SPA_FEATURE_EMPTY_BPOBJ, SPA_FEATURE_LZ4_COMPRESS, + SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, SPA_FEATURES } spa_feature_t; Modified: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Mon Feb 17 17:01:41 2014 (r262090) @@ -22,6 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -69,6 +70,7 @@ zfs_prop_init(void) { "fletcher2", ZIO_CHECKSUM_FLETCHER_2 }, { "fletcher4", ZIO_CHECKSUM_FLETCHER_4 }, { "sha256", ZIO_CHECKSUM_SHA256 }, + { "noparity", ZIO_CHECKSUM_NOPARITY }, { NULL } }; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Mon Feb 17 17:01:41 2014 (r262090) @@ -23,6 +23,7 @@ * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -2795,7 +2796,8 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ dr->dt.dl.dr_copies, dr->dt.dl.dr_nopwrite); mutex_exit(&db->db_mtx); } else if (db->db_state == DB_NOFILL) { - ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF); + ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF || + zp.zp_checksum == ZIO_CHECKSUM_NOPARITY); dr->dr_zio = zio_write(zio, os->os_spa, txg, db->db_blkptr, NULL, db->db.db_size, &zp, dbuf_write_nofill_ready, NULL, dbuf_write_nofill_done, db, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Mon Feb 17 17:01:41 2014 (r262090) @@ -22,8 +22,8 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. */ - /* Copyright (c) 2013 by Saso Kiselkov. All rights reserved. */ +/* Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include #include @@ -1623,7 +1623,7 @@ dmu_write_policy(objset_t *os, dnode_t * * pipeline. */ compress = ZIO_COMPRESS_OFF; - checksum = ZIO_CHECKSUM_OFF; + checksum = ZIO_CHECKSUM_NOPARITY; } else { compress = zio_compress_select(dn->dn_compress, compress); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_disk.h Mon Feb 17 17:01:41 2014 (r262090) @@ -21,13 +21,12 @@ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright (c) 2013 Joyent, Inc. All rights reserved. */ #ifndef _SYS_VDEV_DISK_H #define _SYS_VDEV_DISK_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifdef _KERNEL #include @@ -40,14 +39,23 @@ extern "C" { #endif +#ifdef _KERNEL typedef struct vdev_disk { ddi_devid_t vd_devid; char *vd_minor; ldi_handle_t vd_lh; } vdev_disk_t; +#endif +extern int vdev_disk_physio(vdev_t *, + caddr_t, size_t, uint64_t, int, boolean_t); + +/* + * Since vdev_disk.c is not compiled into libzpool, this function should only be + * defined in the zfs kernel module. + */ #ifdef _KERNEL -extern int vdev_disk_physio(ldi_handle_t, caddr_t, size_t, uint64_t, int); +extern int vdev_disk_ldi_physio(ldi_handle_t, caddr_t, size_t, uint64_t, int); #endif #ifdef __cplusplus } Copied: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h (from r255750, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h Mon Feb 17 17:01:41 2014 (r262090, copy of r255750, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_raidz.h) @@ -0,0 +1,50 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright (c) 2013, Joyent, Inc. All rights reserved. + */ + +#ifndef _SYS_VDEV_RAIDZ_H +#define _SYS_VDEV_RAIDZ_H + +#include +#ifdef illumos +#include +#ifdef _KERNEL +#include +#include +#include +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _KERNEL +extern int vdev_raidz_physio(vdev_t *, + caddr_t, size_t, uint64_t, uint64_t, boolean_t, boolean_t); +#endif +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_VDEV_RAIDZ_H */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Mon Feb 17 17:01:41 2014 (r262090) @@ -25,6 +25,7 @@ * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #ifndef _ZIO_H @@ -81,6 +82,7 @@ enum zio_checksum { ZIO_CHECKSUM_FLETCHER_4, ZIO_CHECKSUM_SHA256, ZIO_CHECKSUM_ZILOG2, + ZIO_CHECKSUM_NOPARITY, ZIO_CHECKSUM_FUNCTIONS }; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c Mon Feb 17 17:01:41 2014 (r262090) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright 2013 Joyent, Inc. All rights reserved. */ #include @@ -367,8 +368,29 @@ vdev_disk_close(vdev_t *vd) } int -vdev_disk_physio(ldi_handle_t vd_lh, caddr_t data, size_t size, - uint64_t offset, int flags) +vdev_disk_physio(vdev_t *vd, caddr_t data, + size_t size, uint64_t offset, int flags, boolean_t isdump) +{ + vdev_disk_t *dvd = vd->vdev_tsd; + + ASSERT(vd->vdev_ops == &vdev_disk_ops); + + /* + * If in the context of an active crash dump, use the ldi_dump(9F) + * call instead of ldi_strategy(9F) as usual. + */ + if (isdump) { + ASSERT3P(dvd, !=, NULL); + return (ldi_dump(dvd->vd_lh, data, lbtodb(offset), + lbtodb(size))); + } + + return (vdev_disk_ldi_physio(dvd->vd_lh, data, size, offset, flags)); +} + +int +vdev_disk_ldi_physio(ldi_handle_t vd_lh, caddr_t data, + size_t size, uint64_t offset, int flags) { buf_t *bp; int error = 0; @@ -616,7 +638,7 @@ vdev_disk_read_rootlabel(char *devpath, /* read vdev label */ offset = vdev_label_offset(size, l, 0); - if (vdev_disk_physio(vd_lh, (caddr_t)label, + if (vdev_disk_ldi_physio(vd_lh, (caddr_t)label, VDEV_SKIP_SIZE + VDEV_PHYS_SIZE, offset, B_READ) != 0) continue; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Mon Feb 17 17:01:41 2014 (r262090) @@ -22,15 +22,22 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include #include #include +#ifdef illumos +#include +#endif +#include +#include #include #include #include #include +#include /* * Virtual device vector for RAID-Z. @@ -154,6 +161,8 @@ typedef struct raidz_map { VDEV_RAIDZ_64MUL_2((x), mask); \ } +#define VDEV_LABEL_OFFSET(x) (x + VDEV_LABEL_START_SIZE) + /* * Force reconstruction to use the general purpose method. */ @@ -437,14 +446,14 @@ static const zio_vsd_ops_t vdev_raidz_vs * the number of children in the target vdev. */ static raidz_map_t * -vdev_raidz_map_alloc(zio_t *zio, uint64_t unit_shift, uint64_t dcols, - uint64_t nparity) +vdev_raidz_map_alloc(caddr_t data, uint64_t size, uint64_t offset, boolean_t dofree, + uint64_t unit_shift, uint64_t dcols, uint64_t nparity) { raidz_map_t *rm; /* The starting RAIDZ (parent) vdev sector of the block. */ - uint64_t b = zio->io_offset >> unit_shift; + uint64_t b = offset >> unit_shift; /* The zio's size in units of the vdev's minimum sector size. */ - uint64_t s = zio->io_size >> unit_shift; + uint64_t s = size >> unit_shift; /* The first column for this stripe. */ uint64_t f = b % dcols; /* The starting byte offset on each child vdev. */ @@ -532,13 +541,13 @@ vdev_raidz_map_alloc(zio_t *zio, uint64_ ASSERT3U(rm->rm_asize - asize, ==, rm->rm_nskip << unit_shift); ASSERT3U(rm->rm_nskip, <=, nparity); - if (zio->io_type != ZIO_TYPE_FREE) { + if (!dofree) { for (c = 0; c < rm->rm_firstdatacol; c++) { rm->rm_col[c].rc_data = zio_buf_alloc(rm->rm_col[c].rc_size); } - rm->rm_col[c].rc_data = zio->io_data; + rm->rm_col[c].rc_data = data; for (c = c + 1; c < acols; c++) { rm->rm_col[c].rc_data = @@ -570,7 +579,7 @@ vdev_raidz_map_alloc(zio_t *zio, uint64_ ASSERT(rm->rm_cols >= 2); ASSERT(rm->rm_col[0].rc_size == rm->rm_col[1].rc_size); - if (rm->rm_firstdatacol == 1 && (zio->io_offset & (1ULL << 20))) { + if (rm->rm_firstdatacol == 1 && (offset & (1ULL << 20))) { devidx = rm->rm_col[0].rc_devidx; o = rm->rm_col[0].rc_offset; rm->rm_col[0].rc_devidx = rm->rm_col[1].rc_devidx; @@ -582,8 +591,6 @@ vdev_raidz_map_alloc(zio_t *zio, uint64_ rm->rm_skipstart = 1; } - zio->io_vsd = rm; - zio->io_vsd_ops = &vdev_raidz_vsd_ops; return (rm); } @@ -993,12 +1000,9 @@ vdev_raidz_reconstruct_pq(raidz_map_t *r * ~~ ~~ * __ __ * | 1 1 1 1 1 1 1 1 | - * | 128 64 32 16 8 4 2 1 | * | 19 205 116 29 64 16 4 1 | * | 1 0 0 0 0 0 0 0 | - * | 0 1 0 0 0 0 0 0 | - * (V|I)' = | 0 0 1 0 0 0 0 0 | - * | 0 0 0 1 0 0 0 0 | + * (V|I)' = | 0 0 0 1 0 0 0 0 | * | 0 0 0 0 1 0 0 0 | * | 0 0 0 0 0 1 0 0 | * | 0 0 0 0 0 0 1 0 | @@ -1532,6 +1536,154 @@ vdev_raidz_close(vdev_t *vd) vdev_close(vd->vdev_child[c]); } +#ifdef illumos +/* + * Handle a read or write I/O to a RAID-Z dump device. + * + * The dump device is in a unique situation compared to other ZFS datasets: + * writing to this device should be as simple and fast as possible. In + * addition, durability matters much less since the dump will be extracted + * once the machine reboots. For that reason, this function eschews parity for + * performance and simplicity. The dump device uses the checksum setting + * ZIO_CHECKSUM_NOPARITY to indicate that parity is not maintained for this + * dataset. + * + * Blocks of size 128 KB have been preallocated for this volume. I/Os less than + * 128 KB will not fill an entire block; in addition, they may not be properly + * aligned. In that case, this function uses the preallocated 128 KB block and + * omits reading or writing any "empty" portions of that block, as opposed to + * allocating a fresh appropriately-sized block. + * + * Looking at an example of a 32 KB I/O to a RAID-Z vdev with 5 child vdevs: + * + * vdev_raidz_io_start(data, size: 32 KB, offset: 64 KB) + * + * If this were a standard RAID-Z dataset, a block of at least 40 KB would be + * allocated which spans all five child vdevs. 8 KB of data would be written to + * each of four vdevs, with the fifth containing the parity bits. + * + * parity data data data data + * | PP | XX | XX | XX | XX | + * ^ ^ ^ ^ ^ + * | | | | | + * 8 KB parity ------8 KB data blocks------ + * + * However, when writing to the dump device, the behavior is different: + * + * vdev_raidz_physio(data, size: 32 KB, offset: 64 KB) + * + * Unlike the normal RAID-Z case in which the block is allocated based on the + * I/O size, reads and writes here always use a 128 KB logical I/O size. If the + * I/O size is less than 128 KB, only the actual portions of data are written. + * In this example the data is written to the third data vdev since that vdev + * contains the offset [64 KB, 96 KB). + * + * parity data data data data + * | | | | XX | | + * ^ + * | + * 32 KB data block + * + * As a result, an individual I/O may not span all child vdevs; moreover, a + * small I/O may only operate on a single child vdev. + * + * Note that since there are no parity bits calculated or written, this format + * remains the same no matter how many parity bits are used in a normal RAID-Z + * stripe. On a RAID-Z3 configuration with seven child vdevs, the example above + * would look like: + * + * parity parity parity data data data data + * | | | | | | XX | | + * ^ + * | + * 32 KB data block + */ +int +vdev_raidz_physio(vdev_t *vd, caddr_t data, size_t size, + uint64_t offset, uint64_t origoffset, boolean_t doread, boolean_t isdump) +{ + vdev_t *tvd = vd->vdev_top; + vdev_t *cvd; + raidz_map_t *rm; + raidz_col_t *rc; + int c, err = 0; + + uint64_t start, end, colstart, colend; + uint64_t coloffset, colsize, colskip; + + int flags = doread ? BIO_READ : BIO_WRITE; + +#ifdef _KERNEL + + /* + * Don't write past the end of the block + */ + VERIFY3U(offset + size, <=, origoffset + SPA_MAXBLOCKSIZE); + + start = offset; + end = start + size; + + /* + * Allocate a RAID-Z map for this block. Note that this block starts + * from the "original" offset, this is, the offset of the extent which + * contains the requisite offset of the data being read or written. + * + * Even if this I/O operation doesn't span the full block size, let's + * treat the on-disk format as if the only blocks are the complete 128 + * KB size. + */ + rm = vdev_raidz_map_alloc(data - (offset - origoffset), + SPA_MAXBLOCKSIZE, origoffset, B_FALSE, tvd->vdev_ashift, vd->vdev_children, + vd->vdev_nparity); + + coloffset = origoffset; + + for (c = rm->rm_firstdatacol; c < rm->rm_cols; + c++, coloffset += rc->rc_size) { + rc = &rm->rm_col[c]; + cvd = vd->vdev_child[rc->rc_devidx]; + + /* + * Find the start and end of this column in the RAID-Z map, + * keeping in mind that the stated size and offset of the + * operation may not fill the entire column for this vdev. + * + * If any portion of the data spans this column, issue the + * appropriate operation to the vdev. + */ + if (coloffset + rc->rc_size <= start) + continue; + if (coloffset >= end) + continue; + + colstart = MAX(coloffset, start); + colend = MIN(end, coloffset + rc->rc_size); + colsize = colend - colstart; + colskip = colstart - coloffset; + + VERIFY3U(colsize, <=, rc->rc_size); + VERIFY3U(colskip, <=, rc->rc_size); + + /* + * Note that the child vdev will have a vdev label at the start + * of its range of offsets, hence the need for + * VDEV_LABEL_OFFSET(). See zio_vdev_child_io() for another + * example of why this calculation is needed. + */ + if ((err = vdev_disk_physio(cvd, + ((char *)rc->rc_data) + colskip, colsize, + VDEV_LABEL_OFFSET(rc->rc_offset) + colskip, + flags, isdump)) != 0) + break; + } + + vdev_raidz_map_free(rm); +#endif /* KERNEL */ + + return (err); +} +#endif + static uint64_t vdev_raidz_asize(vdev_t *vd, uint64_t psize) { @@ -1584,9 +1736,14 @@ vdev_raidz_io_start(zio_t *zio) raidz_col_t *rc; int c, i; - rm = vdev_raidz_map_alloc(zio, tvd->vdev_ashift, vd->vdev_children, + rm = vdev_raidz_map_alloc(zio->io_data, zio->io_size, zio->io_offset, + zio->io_type == ZIO_TYPE_FREE, + tvd->vdev_ashift, vd->vdev_children, vd->vdev_nparity); + zio->io_vsd = rm; + zio->io_vsd_ops = &vdev_raidz_vsd_ops; + ASSERT3U(rm->rm_asize, ==, vdev_psize_to_asize(vd, zio->io_size)); if (zio->io_type == ZIO_TYPE_FREE) { @@ -1729,6 +1886,13 @@ raidz_parity_verify(zio_t *zio, raidz_ma int c, ret = 0; raidz_col_t *rc; + blkptr_t *bp = zio->io_bp; + enum zio_checksum checksum = (bp == NULL ? zio->io_prop.zp_checksum : + (BP_IS_GANG(bp) ? ZIO_CHECKSUM_GANG_HEADER : BP_GET_CHECKSUM(bp))); + + if (checksum == ZIO_CHECKSUM_NOPARITY) + return (ret); + for (c = 0; c < rm->rm_firstdatacol; c++) { rc = &rm->rm_col[c]; if (!rc->rc_tried || rc->rc_error != 0) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c Mon Feb 17 17:01:41 2014 (r262090) @@ -21,6 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ #include @@ -78,6 +79,7 @@ zio_checksum_info_t zio_checksum_table[Z {{fletcher_4_native, fletcher_4_byteswap}, 1, 0, 0, "fletcher4"}, {{zio_checksum_SHA256, zio_checksum_SHA256}, 1, 0, 1, "sha256"}, {{fletcher_4_native, fletcher_4_byteswap}, 0, 1, 0, "zilog2"}, + {{zio_checksum_off, zio_checksum_off}, 0, 0, 0, "noparity"}, }; enum zio_checksum Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Feb 17 17:00:46 2014 (r262089) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c Mon Feb 17 17:01:41 2014 (r262090) @@ -24,6 +24,7 @@ * Copyright (c) 2006-2010 Pawel Jakub Dawidek * All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. + * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ /* Portions Copyright 2010 Robert Milkowski */ @@ -60,6 +61,7 @@ #include #include #include +#include #include #include #include @@ -77,9 +79,14 @@ #include #include #include +#include #include #include #include +#include +#include +#include + #include #include "zfs_namecheck.h" @@ -1164,27 +1171,28 @@ zvol_log_write(zvol_state_t *zv, dmu_tx_ #ifdef sun static int -zvol_dumpio_vdev(vdev_t *vd, void *addr, uint64_t offset, uint64_t size, - boolean_t doread, boolean_t isdump) +zvol_dumpio_vdev(vdev_t *vd, void *addr, uint64_t offset, uint64_t origoffset, + uint64_t size, boolean_t doread, boolean_t isdump) { vdev_disk_t *dvd; int c; int numerrors = 0; - for (c = 0; c < vd->vdev_children; c++) { - ASSERT(vd->vdev_ops == &vdev_mirror_ops || - vd->vdev_ops == &vdev_replacing_ops || - vd->vdev_ops == &vdev_spare_ops); - int err = zvol_dumpio_vdev(vd->vdev_child[c], - addr, offset, size, doread, isdump); - if (err != 0) { - numerrors++; - } else if (doread) { - break; + if (vd->vdev_ops == &vdev_mirror_ops || + vd->vdev_ops == &vdev_replacing_ops || + vd->vdev_ops == &vdev_spare_ops) { + for (c = 0; c < vd->vdev_children; c++) { + int err = zvol_dumpio_vdev(vd->vdev_child[c], + addr, offset, origoffset, size, doread, isdump); + if (err != 0) { + numerrors++; + } else if (doread) { + break; + } } } - if (!vd->vdev_ops->vdev_op_leaf) + if (!vd->vdev_ops->vdev_op_leaf && vd->vdev_ops != &vdev_raidz_ops) return (numerrors < vd->vdev_children ? 0 : EIO); if (doread && !vdev_readable(vd)) @@ -1192,19 +1200,26 @@ zvol_dumpio_vdev(vdev_t *vd, void *addr, else if (!doread && !vdev_writeable(vd)) return (SET_ERROR(EIO)); - dvd = vd->vdev_tsd; - ASSERT3P(dvd, !=, NULL); + if (vd->vdev_ops == &vdev_raidz_ops) { + return (vdev_raidz_physio(vd, + addr, size, offset, origoffset, doread, isdump)); + } + offset += VDEV_LABEL_START_SIZE; if (ddi_in_panic() || isdump) { ASSERT(!doread); if (doread) return (SET_ERROR(EIO)); + dvd = vd->vdev_tsd; + ASSERT3P(dvd, !=, NULL); return (ldi_dump(dvd->vd_lh, addr, lbtodb(offset), lbtodb(size))); } else { - return (vdev_disk_physio(dvd->vd_lh, addr, size, offset, - doread ? B_READ : B_WRITE)); + dvd = vd->vdev_tsd; + ASSERT3P(dvd, !=, NULL); + return (vdev_disk_ldi_physio(dvd->vd_lh, addr, size, + offset, doread ? B_READ : B_WRITE)); } } @@ -1239,7 +1254,8 @@ zvol_dumpio(zvol_state_t *zv, void *addr vd = vdev_lookup_top(spa, DVA_GET_VDEV(&ze->ze_dva)); offset += DVA_GET_OFFSET(&ze->ze_dva); - error = zvol_dumpio_vdev(vd, addr, offset, size, doread, isdump); + error = zvol_dumpio_vdev(vd, addr, offset, DVA_GET_OFFSET(&ze->ze_dva), + size, doread, isdump); if (!ddi_in_panic()) spa_config_exit(spa, SCL_STATE, FTAG); @@ -1259,6 +1275,7 @@ zvol_strategy(struct bio *bp) rl_t *rl; int error = 0; boolean_t doread = (bp->bio_cmd == BIO_READ); + boolean_t is_dumpified; boolean_t sync; if (zv == NULL) { @@ -1285,7 +1302,13 @@ zvol_strategy(struct bio *bp) return (0); } - sync = !doread && zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS; +#ifdef illumos + is_dumpified = zv->zv_flags & ZVOL_DUMPIFIED; +#else + is_dumpified = B_FALSE; +#endif + sync = !doread && !is_dumpified && + zv->zv_objset->os_sync == ZFS_SYNC_ALWAYS; /* * There must be no buffer changes when doing a dmu_sync() because @@ -1296,7 +1319,15 @@ zvol_strategy(struct bio *bp) while (resid != 0 && off < volsize) { size_t size = MIN(resid, zvol_maxphys); +#ifdef illumos + if (is_dumpified) { + size = MIN(size, P2END(off, zv->zv_volblocksize) - off); + error = zvol_dumpio(zv, addr, off, size, + doread, B_FALSE); + } else if (doread) { +#else if (doread) { +#endif error = dmu_read(os, ZVOL_OBJ, off, size, addr, DMU_READ_PREFETCH); } else { @@ -1830,21 +1861,67 @@ zvol_fini(void) } #ifdef sun +/*ARGSUSED*/ +static int +zfs_mvdev_dump_feature_check(void *arg, dmu_tx_t *tx) +{ + spa_t *spa = dmu_tx_pool(tx)->dp_spa; + + if (spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_MULTI_VDEV_CRASH_DUMP])) + return (1); + return (0); +} + +/*ARGSUSED*/ +static void +zfs_mvdev_dump_activate_feature_sync(void *arg, dmu_tx_t *tx) +{ + spa_t *spa = dmu_tx_pool(tx)->dp_spa; + + spa_feature_incr(spa, + &spa_feature_table[SPA_FEATURE_MULTI_VDEV_CRASH_DUMP], tx); +} + static int zvol_dump_init(zvol_state_t *zv, boolean_t resize) { dmu_tx_t *tx; - int error = 0; + int error; objset_t *os = zv->zv_objset; + spa_t *spa = dmu_objset_spa(os); + vdev_t *vd = spa->spa_root_vdev; nvlist_t *nv = NULL; - uint64_t version = spa_version(dmu_objset_spa(zv->zv_objset)); + uint64_t version = spa_version(spa); + enum zio_checksum checksum; ASSERT(MUTEX_HELD(&spa_namespace_lock)); + ASSERT(vd->vdev_ops == &vdev_root_ops); + error = dmu_free_long_range(zv->zv_objset, ZVOL_OBJ, 0, DMU_OBJECT_END); /* wait for dmu_free_long_range to actually free the blocks */ txg_wait_synced(dmu_objset_pool(zv->zv_objset), 0); + /* + * If the pool on which the dump device is being initialized has more + * than one child vdev, check that the MULTI_VDEV_CRASH_DUMP feature is + * enabled. If so, bump that feature's counter to indicate that the + * feature is active. We also check the vdev type to handle the + * following case: + * # zpool create test raidz disk1 disk2 disk3 + * Now have spa_root_vdev->vdev_children == 1 (the raidz vdev), + * the raidz vdev itself has 3 children. + */ + if (vd->vdev_children > 1 || vd->vdev_ops == &vdev_raidz_ops) { + if (!spa_feature_is_enabled(spa, + &spa_feature_table[SPA_FEATURE_MULTI_VDEV_CRASH_DUMP])) + return (SET_ERROR(ENOTSUP)); + (void) dsl_sync_task(spa_name(spa), + zfs_mvdev_dump_feature_check, + zfs_mvdev_dump_activate_feature_sync, NULL, 2); + } + tx = dmu_tx_create(os); dmu_tx_hold_zap(tx, ZVOL_ZAP_OBJ, TRUE, NULL); dmu_tx_hold_bonus(tx, ZVOL_OBJ); @@ -1855,6 +1932,14 @@ zvol_dump_init(zvol_state_t *zv, boolean } /* + * If MULTI_VDEV_CRASH_DUMP is active, use the NOPARITY checksum + * function. Otherwise, use the old default -- OFF. + */ + checksum = spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_MULTI_VDEV_CRASH_DUMP]) ? + ZIO_CHECKSUM_NOPARITY : ZIO_CHECKSUM_OFF; + + /* * If we are resizing the dump device then we only need to * update the refreservation to match the newly updated * zvolsize. Otherwise, we save off the original state of the @@ -1917,7 +2002,7 @@ zvol_dump_init(zvol_state_t *zv, boolean ZIO_COMPRESS_OFF) == 0); VERIFY(nvlist_add_uint64(nv, zfs_prop_to_name(ZFS_PROP_CHECKSUM), - ZIO_CHECKSUM_OFF) == 0); + checksum) == 0); if (version >= SPA_VERSION_DEDUP) { VERIFY(nvlist_add_uint64(nv, zfs_prop_to_name(ZFS_PROP_DEDUP), From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:11:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 53E06148; Mon, 17 Feb 2014 17:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D890189C; Mon, 17 Feb 2014 17:11:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHBeeD055589; Mon, 17 Feb 2014 17:11:40 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHBc5f055576; Mon, 17 Feb 2014 17:11:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171711.s1HHBc5f055576@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:11:38 +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: r262093 - in stable/10: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/o... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:11:40 -0000 Author: avg Date: Mon Feb 17 17:11:38 2014 New Revision: 262093 URL: http://svnweb.freebsd.org/changeset/base/262093 Log: MFC r258717: MFV r258371,r258372: 4101 metaslab_debug should allow for fine-grained control Added: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_reftree.h - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_reftree.h Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/10/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c stable/10/sys/conf/files 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 Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:11:38 2014 (r262093) @@ -242,7 +242,7 @@ const char histo_stars[] = "************ const int histo_width = sizeof (histo_stars) - 1; static void -dump_histogram(const uint64_t *histo, int size) +dump_histogram(const uint64_t *histo, int size, int offset) { int i; int minidx = size - 1; @@ -263,7 +263,7 @@ dump_histogram(const uint64_t *histo, in for (i = minidx; i <= maxidx; i++) { (void) printf("\t\t\t%3u: %6llu %s\n", - i, (u_longlong_t)histo[i], + i + offset, (u_longlong_t)histo[i], &histo_stars[(max - histo[i]) * histo_width / max]); } } @@ -316,19 +316,19 @@ dump_zap_stats(objset_t *os, uint64_t ob (u_longlong_t)zs.zs_salt); (void) printf("\t\tLeafs with 2^n pointers:\n"); - dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBlocks with n*5 entries:\n"); - dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBlocks n/10 full:\n"); - dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tEntries with n chunks:\n"); - dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBuckets with n entries:\n"); - dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE, 0); } /*ARGSUSED*/ @@ -517,26 +517,85 @@ dump_zpldir(objset_t *os, uint64_t objec zap_cursor_fini(&zc); } +int +get_dtl_refcount(vdev_t *vd) +{ + int refcount = 0; + + if (vd->vdev_ops->vdev_op_leaf) { + space_map_t *sm = vd->vdev_dtl_sm; + + if (sm != NULL && + sm->sm_dbuf->db_size == sizeof (space_map_phys_t)) + return (1); + return (0); + } + + for (int c = 0; c < vd->vdev_children; c++) + refcount += get_dtl_refcount(vd->vdev_child[c]); + return (refcount); +} + +int +get_metaslab_refcount(vdev_t *vd) +{ + int refcount = 0; + + if (vd->vdev_top == vd) { + for (int m = 0; m < vd->vdev_ms_count; m++) { + space_map_t *sm = vd->vdev_ms[m]->ms_sm; + + if (sm != NULL && + sm->sm_dbuf->db_size == sizeof (space_map_phys_t)) + refcount++; + } + } + for (int c = 0; c < vd->vdev_children; c++) + refcount += get_metaslab_refcount(vd->vdev_child[c]); + + return (refcount); +} + +static int +verify_spacemap_refcounts(spa_t *spa) +{ + int expected_refcount, actual_refcount; + + expected_refcount = spa_feature_get_refcount(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]); + actual_refcount = get_dtl_refcount(spa->spa_root_vdev); + actual_refcount += get_metaslab_refcount(spa->spa_root_vdev); + + if (expected_refcount != actual_refcount) { + (void) printf("space map refcount mismatch: expected %d != " + "actual %d\n", expected_refcount, actual_refcount); + return (2); + } + return (0); +} + static void -dump_spacemap(objset_t *os, space_map_obj_t *smo, space_map_t *sm) +dump_spacemap(objset_t *os, space_map_t *sm) { uint64_t alloc, offset, entry; - uint8_t mapshift = sm->sm_shift; - uint64_t mapstart = sm->sm_start; char *ddata[] = { "ALLOC", "FREE", "CONDENSE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" }; - if (smo->smo_object == 0) + if (sm == NULL) return; /* * Print out the freelist entries in both encoded and decoded form. */ alloc = 0; - for (offset = 0; offset < smo->smo_objsize; offset += sizeof (entry)) { - VERIFY3U(0, ==, dmu_read(os, smo->smo_object, offset, + for (offset = 0; offset < space_map_length(sm); + offset += sizeof (entry)) { + uint8_t mapshift = sm->sm_shift; + + VERIFY0(dmu_read(os, space_map_object(sm), offset, sizeof (entry), &entry, DMU_READ_PREFETCH)); if (SM_DEBUG_DECODE(entry)) { + (void) printf("\t [%6llu] %s: txg %llu, pass %llu\n", (u_longlong_t)(offset / sizeof (entry)), ddata[SM_DEBUG_ACTION_DECODE(entry)], @@ -548,10 +607,10 @@ dump_spacemap(objset_t *os, space_map_ob (u_longlong_t)(offset / sizeof (entry)), SM_TYPE_DECODE(entry) == SM_ALLOC ? 'A' : 'F', (u_longlong_t)((SM_OFFSET_DECODE(entry) << - mapshift) + mapstart), + mapshift) + sm->sm_start), (u_longlong_t)((SM_OFFSET_DECODE(entry) << - mapshift) + mapstart + (SM_RUN_DECODE(entry) << - mapshift)), + mapshift) + sm->sm_start + + (SM_RUN_DECODE(entry) << mapshift)), (u_longlong_t)(SM_RUN_DECODE(entry) << mapshift)); if (SM_TYPE_DECODE(entry) == SM_ALLOC) alloc += SM_RUN_DECODE(entry) << mapshift; @@ -559,10 +618,10 @@ dump_spacemap(objset_t *os, space_map_ob alloc -= SM_RUN_DECODE(entry) << mapshift; } } - if (alloc != smo->smo_alloc) { + if (alloc != space_map_allocated(sm)) { (void) printf("space_map_object alloc (%llu) INCONSISTENT " "with space map summary (%llu)\n", - (u_longlong_t)smo->smo_alloc, (u_longlong_t)alloc); + (u_longlong_t)space_map_allocated(sm), (u_longlong_t)alloc); } } @@ -570,15 +629,17 @@ static void dump_metaslab_stats(metaslab_t *msp) { char maxbuf[32]; - space_map_t *sm = msp->ms_map; - avl_tree_t *t = sm->sm_pp_root; - int free_pct = sm->sm_space * 100 / sm->sm_size; + range_tree_t *rt = msp->ms_tree; + avl_tree_t *t = &msp->ms_size_tree; + int free_pct = range_tree_space(rt) * 100 / msp->ms_size; - zdb_nicenum(space_map_maxsize(sm), maxbuf); + zdb_nicenum(metaslab_block_maxsize(msp), maxbuf); (void) printf("\t %25s %10lu %7s %6s %4s %4d%%\n", "segments", avl_numnodes(t), "maxsize", maxbuf, "freepct", free_pct); + (void) printf("\tIn-memory histogram:\n"); + dump_histogram(rt->rt_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0); } static void @@ -586,33 +647,45 @@ dump_metaslab(metaslab_t *msp) { vdev_t *vd = msp->ms_group->mg_vd; spa_t *spa = vd->vdev_spa; - space_map_t *sm = msp->ms_map; - space_map_obj_t *smo = &msp->ms_smo; + space_map_t *sm = msp->ms_sm; char freebuf[32]; - zdb_nicenum(sm->sm_size - smo->smo_alloc, freebuf); + zdb_nicenum(msp->ms_size - space_map_allocated(sm), freebuf); (void) printf( "\tmetaslab %6llu offset %12llx spacemap %6llu free %5s\n", - (u_longlong_t)(sm->sm_start / sm->sm_size), - (u_longlong_t)sm->sm_start, (u_longlong_t)smo->smo_object, freebuf); + (u_longlong_t)msp->ms_id, (u_longlong_t)msp->ms_start, + (u_longlong_t)space_map_object(sm), freebuf); - if (dump_opt['m'] > 1 && !dump_opt['L']) { + if (dump_opt['m'] > 2 && !dump_opt['L']) { mutex_enter(&msp->ms_lock); - space_map_load_wait(sm); - if (!sm->sm_loaded) - VERIFY(space_map_load(sm, zfs_metaslab_ops, - SM_FREE, smo, spa->spa_meta_objset) == 0); + metaslab_load_wait(msp); + if (!msp->ms_loaded) { + VERIFY0(metaslab_load(msp)); + range_tree_stat_verify(msp->ms_tree); + } dump_metaslab_stats(msp); - space_map_unload(sm); + metaslab_unload(msp); mutex_exit(&msp->ms_lock); } - if (dump_opt['d'] > 5 || dump_opt['m'] > 2) { - ASSERT(sm->sm_size == (1ULL << vd->vdev_ms_shift)); + if (dump_opt['m'] > 1 && sm != NULL && + spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM])) { + /* + * The space map histogram represents free space in chunks + * of sm_shift (i.e. bucket 0 refers to 2^sm_shift). + */ + (void) printf("\tOn-disk histogram:\n"); + dump_histogram(sm->sm_phys->smp_histogram, + SPACE_MAP_HISTOGRAM_SIZE(sm), sm->sm_shift); + } + + if (dump_opt['d'] > 5 || dump_opt['m'] > 3) { + ASSERT(msp->ms_size == (1ULL << vd->vdev_ms_shift)); mutex_enter(&msp->ms_lock); - dump_spacemap(spa->spa_meta_objset, smo, sm); + dump_spacemap(spa->spa_meta_objset, msp->ms_sm); mutex_exit(&msp->ms_lock); } } @@ -801,9 +874,9 @@ dump_all_ddts(spa_t *spa) } static void -dump_dtl_seg(space_map_t *sm, uint64_t start, uint64_t size) +dump_dtl_seg(void *arg, uint64_t start, uint64_t size) { - char *prefix = (void *)sm; + char *prefix = arg; (void) printf("%s [%llu,%llu) length %llu\n", prefix, @@ -833,17 +906,16 @@ dump_dtl(vdev_t *vd, int indent) required ? "DTL-required" : "DTL-expendable"); for (int t = 0; t < DTL_TYPES; t++) { - space_map_t *sm = &vd->vdev_dtl[t]; - if (sm->sm_space == 0) + range_tree_t *rt = vd->vdev_dtl[t]; + if (range_tree_space(rt) == 0) continue; (void) snprintf(prefix, sizeof (prefix), "\t%*s%s", indent + 2, "", name[t]); - mutex_enter(sm->sm_lock); - space_map_walk(sm, dump_dtl_seg, (void *)prefix); - mutex_exit(sm->sm_lock); + mutex_enter(rt->rt_lock); + range_tree_walk(rt, dump_dtl_seg, prefix); + mutex_exit(rt->rt_lock); if (dump_opt['d'] > 5 && vd->vdev_children == 0) - dump_spacemap(spa->spa_meta_objset, - &vd->vdev_dtl_smo, sm); + dump_spacemap(spa->spa_meta_objset, vd->vdev_dtl_sm); } for (int c = 0; c < vd->vdev_children; c++) @@ -2172,39 +2244,17 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog } static void -zdb_leak(space_map_t *sm, uint64_t start, uint64_t size) +zdb_leak(void *arg, uint64_t start, uint64_t size) { - vdev_t *vd = sm->sm_ppd; + vdev_t *vd = arg; (void) printf("leaked space: vdev %llu, offset 0x%llx, size %llu\n", (u_longlong_t)vd->vdev_id, (u_longlong_t)start, (u_longlong_t)size); } -/* ARGSUSED */ -static void -zdb_space_map_load(space_map_t *sm) -{ -} - -static void -zdb_space_map_unload(space_map_t *sm) -{ - space_map_vacate(sm, zdb_leak, sm); -} - -/* ARGSUSED */ -static void -zdb_space_map_claim(space_map_t *sm, uint64_t start, uint64_t size) -{ -} - -static space_map_ops_t zdb_space_map_ops = { - zdb_space_map_load, - zdb_space_map_unload, +static metaslab_ops_t zdb_metaslab_ops = { NULL, /* alloc */ - zdb_space_map_claim, - NULL, /* free */ - NULL /* maxsize */ + NULL /* fragmented */ }; static void @@ -2259,11 +2309,21 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); - VERIFY(space_map_load(msp->ms_map, - &zdb_space_map_ops, SM_ALLOC, &msp->ms_smo, - spa->spa_meta_objset) == 0); - msp->ms_map->sm_ppd = vd; + metaslab_unload(msp); + + /* + * For leak detection, we overload the metaslab + * ms_tree to contain allocated segments + * instead of free segments. As a result, + * we can't use the normal metaslab_load/unload + * interfaces. + */ + if (msp->ms_sm != NULL) { + msp->ms_ops = &zdb_metaslab_ops; + VERIFY0(space_map_load(msp->ms_sm, + msp->ms_tree, SM_ALLOC)); + msp->ms_loaded = B_TRUE; + } mutex_exit(&msp->ms_lock); } } @@ -2286,7 +2346,20 @@ zdb_leak_fini(spa_t *spa) for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); + + /* + * The ms_tree has been overloaded to + * contain allocated segments. Now that we + * finished traversing all blocks, any + * block that remains in the ms_tree + * represents an allocated block that we + * did not claim during the traversal. + * Claimed blocks would have been removed + * from the ms_tree. + */ + range_tree_vacate(msp->ms_tree, zdb_leak, vd); + msp->ms_loaded = B_FALSE; + mutex_exit(&msp->ms_lock); } } @@ -2489,7 +2562,7 @@ dump_block_stats(spa_t *spa) "(in 512-byte sectors): " "number of blocks\n"); dump_histogram(zb->zb_psize_histogram, - PSIZE_HISTO_SIZE); + PSIZE_HISTO_SIZE, 0); } } } @@ -2659,6 +2732,9 @@ dump_zpool(spa_t *spa) if (dump_opt['b'] || dump_opt['c']) rc = dump_block_stats(spa); + if (rc == 0) + rc = verify_spacemap_refcounts(spa); + if (dump_opt['s']) show_pool_stats(spa); Modified: stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:11:38 2014 (r262093) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2013 +.Dd October 08, 2013 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -251,6 +251,24 @@ configuration. .\" .Xr dumpon 8 .\" command to configure a .\" dump device on a pool comprised of multiple vdevs. +.It Sy spacemap_histogram +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:spacemap_histogram" +.It GUID Ta com.delphix:spacemap_histogram +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta none +.El +.Pp +This features allows ZFS to maintain more information about how free space +is organized within the pool. If this feature is +.Sy enabled , +ZFS will +set this feature to +.Sy active +when a new space map object is created or +an existing space map is upgraded to the new format. +Once the feature is +.Sy active , +it will remain in that state until the pool is destroyed. .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 17:11:38 2014 (r262093) @@ -5339,7 +5339,7 @@ ztest_deadman_thread(void *arg) * vdev_deadman() discovers that there hasn't been any recent * I/Os then it will end up aborting the tests. */ - if (spa_suspended(spa)) { + if (spa_suspended(spa) || spa->spa_root_vdev == NULL) { fatal(0, "aborting test after %llu seconds because " "pool has transitioned to a suspended state.", zfs_deadman_synctime_ms / 1000); Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:11:38 2014 (r262093) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -163,4 +163,7 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, "com.joyent:multi_vdev_crash_dump", "multi_vdev_crash_dump", "Crash dumps to multiple vdev pools.", B_FALSE, B_FALSE, NULL); + zfeature_register(SPA_FEATURE_SPACEMAP_HISTOGRAM, + "com.delphix:spacemap_histogram", "spacemap_histogram", + "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, NULL); } Modified: stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:11:38 2014 (r262093) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -55,6 +55,7 @@ static enum spa_feature { SPA_FEATURE_EMPTY_BPOBJ, SPA_FEATURE_LZ4_COMPRESS, SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, + SPA_FEATURE_SPACEMAP_HISTOGRAM, SPA_FEATURES } spa_feature_t; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/Makefile.files ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Mon Feb 17 17:11:38 2014 (r262093) @@ -21,7 +21,8 @@ # # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2012 by Delphix. All rights reserved. +# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. +# Copyright (c) 2013 by Delphix. All rights reserved. # Copyright (c) 2013 by Saso Kiselkov. All rights reserved. # # @@ -62,6 +63,7 @@ ZFS_COMMON_OBJS += \ lz4.o \ lzjb.o \ metaslab.o \ + range_tree.o \ refcount.o \ rrwlock.o \ sa.o \ @@ -72,6 +74,7 @@ ZFS_COMMON_OBJS += \ spa_history.o \ spa_misc.o \ space_map.o \ + space_reftree.o \ txg.o \ uberblock.o \ unique.o \ Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Feb 17 17:11:38 2014 (r262093) @@ -1339,7 +1339,7 @@ dnode_set_blksz(dnode_t *dn, uint64_t si rw_enter(&dn->dn_struct_rwlock, RW_WRITER); /* Check for any allocated blocks beyond the first */ - if (dn->dn_phys->dn_maxblkid != 0) + if (dn->dn_maxblkid != 0) goto fail; mutex_enter(&dn->dn_dbufs_mtx); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 17:11:32 2014 (r262092) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 17:11:38 2014 (r262093) @@ -31,6 +31,7 @@ #include #include #include +#include SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); @@ -47,6 +48,11 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab (!((flags) & (METASLAB_GANG_CHILD | METASLAB_GANG_HEADER | \ METASLAB_GANG_AVOID))) +#define METASLAB_WEIGHT_PRIMARY (1ULL << 63) +#define METASLAB_WEIGHT_SECONDARY (1ULL << 62) +#define METASLAB_ACTIVE_MASK \ + (METASLAB_WEIGHT_PRIMARY | METASLAB_WEIGHT_SECONDARY) + uint64_t metaslab_aliquot = 512ULL << 10; uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */ TUNABLE_QUAD("vfs.zfs.metaslab.gang_bang", &metaslab_gang_bang); @@ -61,6 +67,11 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, * Values should be greater than or equal to 100. */ int zfs_condense_pct = 200; +TUNABLE_INT("vfs.zfs.condense_pct", &zfs_condense_pct); +SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_pct, CTLFLAG_RWTUN, + &zfs_condense_pct, 0, + "Condense on-disk spacemap when it is more than this many percents" + " of in-memory counterpart"); /* * This value defines the number of allowed allocation failures per vdev. @@ -88,15 +99,29 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_ * no metaslab group will be excluded based on this criterion. */ int zfs_mg_noalloc_threshold = 0; +TUNABLE_INT("vfs.zfs.mg_noalloc_threshold", &zfs_mg_noalloc_threshold); +SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noalloc_threshold, CTLFLAG_RWTUN, + &zfs_mg_noalloc_threshold, 0, + "Percentage of metaslab group size that should be free" + " to make it eligible for allocation"); /* - * Metaslab debugging: when set, keeps all space maps in core to verify frees. + * When set will load all metaslabs when pool is first opened. */ -static int metaslab_debug = 0; -TUNABLE_INT("vfs.zfs.metaslab.debug", &metaslab_debug); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug, CTLFLAG_RWTUN, &metaslab_debug, - 0, - "Metaslab debugging: when set, keeps all space maps in core to verify frees"); +int metaslab_debug_load = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug_load", &metaslab_debug_load); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_load, CTLFLAG_RWTUN, + &metaslab_debug_load, 0, + "Load all metaslabs when pool is first opened"); + +/* + * When set will prevent metaslabs from being unloaded. + */ +int metaslab_debug_unload = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug_unload", &metaslab_debug_unload); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_unload, CTLFLAG_RWTUN, + &metaslab_debug_unload, 0, + "Prevent metaslabs from being unloaded"); /* * Minimum size which forces the dynamic allocator to change @@ -135,20 +160,24 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, "A metaslab is considered \"free\" if it contains a contiguous segment which is greater than vfs.zfs.metaslab.min_alloc_size"); /* - * Max number of space_maps to prefetch. - */ -int metaslab_prefetch_limit = SPA_DVAS_PER_BP; -TUNABLE_INT("vfs.zfs.metaslab.prefetch_limit", &metaslab_prefetch_limit); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, prefetch_limit, CTLFLAG_RWTUN, - &metaslab_prefetch_limit, 0, "Maximum number of space_maps to prefetch"); - -/* - * Percentage bonus multiplier for metaslabs that are in the bonus area. + * Percentage of all cpus that can be used by the metaslab taskq. */ -int metaslab_smo_bonus_pct = 150; -TUNABLE_INT("vfs.zfs.metaslab.smo_bonus_pct", &metaslab_smo_bonus_pct); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, smo_bonus_pct, CTLFLAG_RWTUN, - &metaslab_smo_bonus_pct, 0, "Maximum number of space_maps to prefetch"); +int metaslab_load_pct = 50; +TUNABLE_INT("vfs.zfs.metaslab.load_pct", &metaslab_load_pct); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, load_pct, CTLFLAG_RWTUN, + &metaslab_load_pct, 0, + "Percentage of cpus that can be used by the metaslab taskq"); + +/* + * Determines how many txgs a metaslab may remain loaded without having any + * allocations from it. As long as a metaslab continues to be used we will + * keep it loaded. + */ +int metaslab_unload_delay = TXG_SIZE * 2; +TUNABLE_INT("vfs.zfs.metaslab.unload_delay", &metaslab_unload_delay); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, unload_delay, CTLFLAG_RWTUN, + &metaslab_unload_delay, 0, + "Number of TXGs that an unused metaslab can be kept in memory"); /* * Should we be willing to write data to degraded vdevs? @@ -159,12 +188,41 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_ TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded); /* + * Max number of metaslabs per group to preload. + */ +int metaslab_preload_limit = SPA_DVAS_PER_BP; +TUNABLE_INT("vfs.zfs.metaslab.preload_limit", &metaslab_preload_limit); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_limit, CTLFLAG_RWTUN, + &metaslab_preload_limit, 0, + "Max number of metaslabs per group to preload"); + +/* + * Enable/disable preloading of metaslab. + */ +boolean_t metaslab_preload_enabled = B_TRUE; +TUNABLE_INT("vfs.zfs.metaslab.preload_enabled", &metaslab_preload_enabled); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_enabled, CTLFLAG_RWTUN, + &metaslab_preload_enabled, 0, + "Max number of metaslabs per group to preload"); + +/* + * Enable/disable additional weight factor for each metaslab. + */ +boolean_t metaslab_weight_factor_enable = B_FALSE; +TUNABLE_INT("vfs.zfs.metaslab.weight_factor_enable", + &metaslab_weight_factor_enable); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, weight_factor_enable, CTLFLAG_RWTUN, + &metaslab_weight_factor_enable, 0, + "Enable additional weight factor for each metaslab"); + + +/* * ========================================================================== * Metaslab classes * ========================================================================== */ metaslab_class_t * -metaslab_class_create(spa_t *spa, space_map_ops_t *ops) +metaslab_class_create(spa_t *spa, metaslab_ops_t *ops) { metaslab_class_t *mc; @@ -295,9 +353,9 @@ metaslab_compare(const void *x1, const v /* * If the weights are identical, use the offset to force uniqueness. */ - if (m1->ms_map->sm_start < m2->ms_map->sm_start) + if (m1->ms_start < m2->ms_start) return (-1); - if (m1->ms_map->sm_start > m2->ms_map->sm_start) + if (m1->ms_start > m2->ms_start) return (1); ASSERT3P(m1, ==, m2); @@ -365,6 +423,9 @@ metaslab_group_create(metaslab_class_t * mg->mg_class = mc; mg->mg_activation_count = 0; + mg->mg_taskq = taskq_create("metaslab_group_tasksq", metaslab_load_pct, + minclsyspri, 10, INT_MAX, TASKQ_THREADS_CPU_PCT); + return (mg); } @@ -434,6 +495,8 @@ metaslab_group_passivate(metaslab_group_ return; } + taskq_wait(mg->mg_taskq); + mgprev = mg->mg_prev; mgnext = mg->mg_next; @@ -514,130 +577,200 @@ metaslab_group_allocatable(metaslab_grou /* * ========================================================================== - * Common allocator routines + * Range tree callbacks * ========================================================================== */ + +/* + * Comparison function for the private size-ordered tree. Tree is sorted + * by size, larger sizes at the end of the tree. + */ static int -metaslab_segsize_compare(const void *x1, const void *x2) +metaslab_rangesize_compare(const void *x1, const void *x2) { - const space_seg_t *s1 = x1; - const space_seg_t *s2 = x2; - uint64_t ss_size1 = s1->ss_end - s1->ss_start; - uint64_t ss_size2 = s2->ss_end - s2->ss_start; + const range_seg_t *r1 = x1; + const range_seg_t *r2 = x2; + uint64_t rs_size1 = r1->rs_end - r1->rs_start; + uint64_t rs_size2 = r2->rs_end - r2->rs_start; - if (ss_size1 < ss_size2) + if (rs_size1 < rs_size2) return (-1); - if (ss_size1 > ss_size2) + if (rs_size1 > rs_size2) return (1); - if (s1->ss_start < s2->ss_start) + if (r1->rs_start < r2->rs_start) return (-1); - if (s1->ss_start > s2->ss_start) + + if (r1->rs_start > r2->rs_start) return (1); return (0); } /* - * This is a helper function that can be used by the allocator to find - * a suitable block to allocate. This will search the specified AVL - * tree looking for a block that matches the specified criteria. + * Create any block allocator specific components. The current allocators + * rely on using both a size-ordered range_tree_t and an array of uint64_t's. */ -static uint64_t -metaslab_block_picker(avl_tree_t *t, uint64_t *cursor, uint64_t size, - uint64_t align) +static void +metaslab_rt_create(range_tree_t *rt, void *arg) { - space_seg_t *ss, ssearch; - avl_index_t where; - - ssearch.ss_start = *cursor; - ssearch.ss_end = *cursor + size; + metaslab_t *msp = arg; - ss = avl_find(t, &ssearch, &where); - if (ss == NULL) - ss = avl_nearest(t, where, AVL_AFTER); + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT(msp->ms_tree == NULL); - while (ss != NULL) { - uint64_t offset = P2ROUNDUP(ss->ss_start, align); - - if (offset + size <= ss->ss_end) { - *cursor = offset + size; - return (offset); - } - ss = AVL_NEXT(t, ss); - } - - /* - * If we know we've searched the whole map (*cursor == 0), give up. - * Otherwise, reset the cursor to the beginning and try again. - */ - if (*cursor == 0) - return (-1ULL); - - *cursor = 0; - return (metaslab_block_picker(t, cursor, size, align)); + avl_create(&msp->ms_size_tree, metaslab_rangesize_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_pp_node)); } +/* + * Destroy the block allocator specific components. + */ static void -metaslab_pp_load(space_map_t *sm) +metaslab_rt_destroy(range_tree_t *rt, void *arg) { - space_seg_t *ss; - - ASSERT(sm->sm_ppd == NULL); - sm->sm_ppd = kmem_zalloc(64 * sizeof (uint64_t), KM_SLEEP); + metaslab_t *msp = arg; - sm->sm_pp_root = kmem_alloc(sizeof (avl_tree_t), KM_SLEEP); - avl_create(sm->sm_pp_root, metaslab_segsize_compare, - sizeof (space_seg_t), offsetof(struct space_seg, ss_pp_node)); + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + ASSERT0(avl_numnodes(&msp->ms_size_tree)); - for (ss = avl_first(&sm->sm_root); ss; ss = AVL_NEXT(&sm->sm_root, ss)) - avl_add(sm->sm_pp_root, ss); + avl_destroy(&msp->ms_size_tree); } static void -metaslab_pp_unload(space_map_t *sm) +metaslab_rt_add(range_tree_t *rt, range_seg_t *rs, void *arg) { - void *cookie = NULL; - - kmem_free(sm->sm_ppd, 64 * sizeof (uint64_t)); - sm->sm_ppd = NULL; - - while (avl_destroy_nodes(sm->sm_pp_root, &cookie) != NULL) { - /* tear down the tree */ - } + metaslab_t *msp = arg; - avl_destroy(sm->sm_pp_root); - kmem_free(sm->sm_pp_root, sizeof (avl_tree_t)); - sm->sm_pp_root = NULL; + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + VERIFY(!msp->ms_condensing); + avl_add(&msp->ms_size_tree, rs); } -/* ARGSUSED */ static void -metaslab_pp_claim(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_rt_remove(range_tree_t *rt, range_seg_t *rs, void *arg) { - /* No need to update cursor */ + metaslab_t *msp = arg; + + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + VERIFY(!msp->ms_condensing); + avl_remove(&msp->ms_size_tree, rs); } -/* ARGSUSED */ static void -metaslab_pp_free(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_rt_vacate(range_tree_t *rt, void *arg) { - /* No need to update cursor */ + metaslab_t *msp = arg; + + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + + /* + * Normally one would walk the tree freeing nodes along the way. + * Since the nodes are shared with the range trees we can avoid + * walking all nodes and just reinitialize the avl tree. The nodes + * will be freed by the range tree, so we don't want to free them here. + */ + avl_create(&msp->ms_size_tree, metaslab_rangesize_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_pp_node)); } +static range_tree_ops_t metaslab_rt_ops = { + metaslab_rt_create, + metaslab_rt_destroy, + metaslab_rt_add, + metaslab_rt_remove, + metaslab_rt_vacate +}; + +/* + * ========================================================================== + * Metaslab block operations + * ========================================================================== + */ + /* * Return the maximum contiguous segment within the metaslab. */ uint64_t -metaslab_pp_maxsize(space_map_t *sm) +metaslab_block_maxsize(metaslab_t *msp) { - avl_tree_t *t = sm->sm_pp_root; - space_seg_t *ss; + avl_tree_t *t = &msp->ms_size_tree; + range_seg_t *rs; - if (t == NULL || (ss = avl_last(t)) == NULL) + if (t == NULL || (rs = avl_last(t)) == NULL) return (0ULL); - return (ss->ss_end - ss->ss_start); + return (rs->rs_end - rs->rs_start); +} + +uint64_t +metaslab_block_alloc(metaslab_t *msp, uint64_t size) +{ + uint64_t start; + range_tree_t *rt = msp->ms_tree; + + VERIFY(!msp->ms_condensing); + + start = msp->ms_ops->msop_alloc(msp, size); + if (start != -1ULL) { + vdev_t *vd = msp->ms_group->mg_vd; + + VERIFY0(P2PHASE(start, 1ULL << vd->vdev_ashift)); + VERIFY0(P2PHASE(size, 1ULL << vd->vdev_ashift)); + VERIFY3U(range_tree_space(rt) - size, <=, msp->ms_size); + range_tree_remove(rt, start, size); + } + return (start); +} + +/* + * ========================================================================== + * Common allocator routines + * ========================================================================== + */ + +/* + * This is a helper function that can be used by the allocator to find + * a suitable block to allocate. This will search the specified AVL + * tree looking for a block that matches the specified criteria. + */ +static uint64_t +metaslab_block_picker(avl_tree_t *t, uint64_t *cursor, uint64_t size, + uint64_t align) +{ + range_seg_t *rs, rsearch; + avl_index_t where; + + rsearch.rs_start = *cursor; + rsearch.rs_end = *cursor + size; + + rs = avl_find(t, &rsearch, &where); + if (rs == NULL) + rs = avl_nearest(t, where, AVL_AFTER); + + while (rs != NULL) { + uint64_t offset = P2ROUNDUP(rs->rs_start, align); + + if (offset + size <= rs->rs_end) { + *cursor = offset + size; + return (offset); + } + rs = AVL_NEXT(t, rs); + } + + /* + * If we know we've searched the whole map (*cursor == 0), give up. + * Otherwise, reset the cursor to the beginning and try again. + */ + if (*cursor == 0) + return (-1ULL); + + *cursor = 0; + return (metaslab_block_picker(t, cursor, size, align)); } /* @@ -646,29 +779,31 @@ metaslab_pp_maxsize(space_map_t *sm) * ========================================================================== */ static uint64_t -metaslab_ff_alloc(space_map_t *sm, uint64_t size) +metaslab_ff_alloc(metaslab_t *msp, uint64_t size) { - avl_tree_t *t = &sm->sm_root; + /* + * Find the largest power of 2 block size that evenly divides the + * requested size. This is used to try to allocate blocks with similar + * alignment from the same area of the metaslab (i.e. same cursor + * bucket) but it does not guarantee that other allocations sizes + * may exist in the same region. + */ uint64_t align = size & -size; - uint64_t *cursor = (uint64_t *)sm->sm_ppd + highbit(align) - 1; + uint64_t *cursor = &msp->ms_lbas[highbit(align) - 1]; + avl_tree_t *t = &msp->ms_tree->rt_root; return (metaslab_block_picker(t, cursor, size, align)); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:12:00 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D47A2CA; Mon, 17 Feb 2014 17:12: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 350B918A4; Mon, 17 Feb 2014 17:12:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHC0BA055679; Mon, 17 Feb 2014 17:12:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHBwI6055658; Mon, 17 Feb 2014 17:11:58 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171711.s1HHBwI6055658@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:11:58 +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: r262094 - in stable/9: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/op... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:12:00 -0000 Author: avg Date: Mon Feb 17 17:11:58 2014 New Revision: 262094 URL: http://svnweb.freebsd.org/changeset/base/262094 Log: MFC r258717: MFV r258371,r258372: 4101 metaslab_debug should allow for fine-grained control Added: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_reftree.h - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_reftree.h Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/9/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:11:58 2014 (r262094) @@ -242,7 +242,7 @@ const char histo_stars[] = "************ const int histo_width = sizeof (histo_stars) - 1; static void -dump_histogram(const uint64_t *histo, int size) +dump_histogram(const uint64_t *histo, int size, int offset) { int i; int minidx = size - 1; @@ -263,7 +263,7 @@ dump_histogram(const uint64_t *histo, in for (i = minidx; i <= maxidx; i++) { (void) printf("\t\t\t%3u: %6llu %s\n", - i, (u_longlong_t)histo[i], + i + offset, (u_longlong_t)histo[i], &histo_stars[(max - histo[i]) * histo_width / max]); } } @@ -316,19 +316,19 @@ dump_zap_stats(objset_t *os, uint64_t ob (u_longlong_t)zs.zs_salt); (void) printf("\t\tLeafs with 2^n pointers:\n"); - dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBlocks with n*5 entries:\n"); - dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBlocks n/10 full:\n"); - dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tEntries with n chunks:\n"); - dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBuckets with n entries:\n"); - dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE, 0); } /*ARGSUSED*/ @@ -517,26 +517,85 @@ dump_zpldir(objset_t *os, uint64_t objec zap_cursor_fini(&zc); } +int +get_dtl_refcount(vdev_t *vd) +{ + int refcount = 0; + + if (vd->vdev_ops->vdev_op_leaf) { + space_map_t *sm = vd->vdev_dtl_sm; + + if (sm != NULL && + sm->sm_dbuf->db_size == sizeof (space_map_phys_t)) + return (1); + return (0); + } + + for (int c = 0; c < vd->vdev_children; c++) + refcount += get_dtl_refcount(vd->vdev_child[c]); + return (refcount); +} + +int +get_metaslab_refcount(vdev_t *vd) +{ + int refcount = 0; + + if (vd->vdev_top == vd) { + for (int m = 0; m < vd->vdev_ms_count; m++) { + space_map_t *sm = vd->vdev_ms[m]->ms_sm; + + if (sm != NULL && + sm->sm_dbuf->db_size == sizeof (space_map_phys_t)) + refcount++; + } + } + for (int c = 0; c < vd->vdev_children; c++) + refcount += get_metaslab_refcount(vd->vdev_child[c]); + + return (refcount); +} + +static int +verify_spacemap_refcounts(spa_t *spa) +{ + int expected_refcount, actual_refcount; + + expected_refcount = spa_feature_get_refcount(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]); + actual_refcount = get_dtl_refcount(spa->spa_root_vdev); + actual_refcount += get_metaslab_refcount(spa->spa_root_vdev); + + if (expected_refcount != actual_refcount) { + (void) printf("space map refcount mismatch: expected %d != " + "actual %d\n", expected_refcount, actual_refcount); + return (2); + } + return (0); +} + static void -dump_spacemap(objset_t *os, space_map_obj_t *smo, space_map_t *sm) +dump_spacemap(objset_t *os, space_map_t *sm) { uint64_t alloc, offset, entry; - uint8_t mapshift = sm->sm_shift; - uint64_t mapstart = sm->sm_start; char *ddata[] = { "ALLOC", "FREE", "CONDENSE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" }; - if (smo->smo_object == 0) + if (sm == NULL) return; /* * Print out the freelist entries in both encoded and decoded form. */ alloc = 0; - for (offset = 0; offset < smo->smo_objsize; offset += sizeof (entry)) { - VERIFY3U(0, ==, dmu_read(os, smo->smo_object, offset, + for (offset = 0; offset < space_map_length(sm); + offset += sizeof (entry)) { + uint8_t mapshift = sm->sm_shift; + + VERIFY0(dmu_read(os, space_map_object(sm), offset, sizeof (entry), &entry, DMU_READ_PREFETCH)); if (SM_DEBUG_DECODE(entry)) { + (void) printf("\t [%6llu] %s: txg %llu, pass %llu\n", (u_longlong_t)(offset / sizeof (entry)), ddata[SM_DEBUG_ACTION_DECODE(entry)], @@ -548,10 +607,10 @@ dump_spacemap(objset_t *os, space_map_ob (u_longlong_t)(offset / sizeof (entry)), SM_TYPE_DECODE(entry) == SM_ALLOC ? 'A' : 'F', (u_longlong_t)((SM_OFFSET_DECODE(entry) << - mapshift) + mapstart), + mapshift) + sm->sm_start), (u_longlong_t)((SM_OFFSET_DECODE(entry) << - mapshift) + mapstart + (SM_RUN_DECODE(entry) << - mapshift)), + mapshift) + sm->sm_start + + (SM_RUN_DECODE(entry) << mapshift)), (u_longlong_t)(SM_RUN_DECODE(entry) << mapshift)); if (SM_TYPE_DECODE(entry) == SM_ALLOC) alloc += SM_RUN_DECODE(entry) << mapshift; @@ -559,10 +618,10 @@ dump_spacemap(objset_t *os, space_map_ob alloc -= SM_RUN_DECODE(entry) << mapshift; } } - if (alloc != smo->smo_alloc) { + if (alloc != space_map_allocated(sm)) { (void) printf("space_map_object alloc (%llu) INCONSISTENT " "with space map summary (%llu)\n", - (u_longlong_t)smo->smo_alloc, (u_longlong_t)alloc); + (u_longlong_t)space_map_allocated(sm), (u_longlong_t)alloc); } } @@ -570,15 +629,17 @@ static void dump_metaslab_stats(metaslab_t *msp) { char maxbuf[32]; - space_map_t *sm = msp->ms_map; - avl_tree_t *t = sm->sm_pp_root; - int free_pct = sm->sm_space * 100 / sm->sm_size; + range_tree_t *rt = msp->ms_tree; + avl_tree_t *t = &msp->ms_size_tree; + int free_pct = range_tree_space(rt) * 100 / msp->ms_size; - zdb_nicenum(space_map_maxsize(sm), maxbuf); + zdb_nicenum(metaslab_block_maxsize(msp), maxbuf); (void) printf("\t %25s %10lu %7s %6s %4s %4d%%\n", "segments", avl_numnodes(t), "maxsize", maxbuf, "freepct", free_pct); + (void) printf("\tIn-memory histogram:\n"); + dump_histogram(rt->rt_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0); } static void @@ -586,33 +647,45 @@ dump_metaslab(metaslab_t *msp) { vdev_t *vd = msp->ms_group->mg_vd; spa_t *spa = vd->vdev_spa; - space_map_t *sm = msp->ms_map; - space_map_obj_t *smo = &msp->ms_smo; + space_map_t *sm = msp->ms_sm; char freebuf[32]; - zdb_nicenum(sm->sm_size - smo->smo_alloc, freebuf); + zdb_nicenum(msp->ms_size - space_map_allocated(sm), freebuf); (void) printf( "\tmetaslab %6llu offset %12llx spacemap %6llu free %5s\n", - (u_longlong_t)(sm->sm_start / sm->sm_size), - (u_longlong_t)sm->sm_start, (u_longlong_t)smo->smo_object, freebuf); + (u_longlong_t)msp->ms_id, (u_longlong_t)msp->ms_start, + (u_longlong_t)space_map_object(sm), freebuf); - if (dump_opt['m'] > 1 && !dump_opt['L']) { + if (dump_opt['m'] > 2 && !dump_opt['L']) { mutex_enter(&msp->ms_lock); - space_map_load_wait(sm); - if (!sm->sm_loaded) - VERIFY(space_map_load(sm, zfs_metaslab_ops, - SM_FREE, smo, spa->spa_meta_objset) == 0); + metaslab_load_wait(msp); + if (!msp->ms_loaded) { + VERIFY0(metaslab_load(msp)); + range_tree_stat_verify(msp->ms_tree); + } dump_metaslab_stats(msp); - space_map_unload(sm); + metaslab_unload(msp); mutex_exit(&msp->ms_lock); } - if (dump_opt['d'] > 5 || dump_opt['m'] > 2) { - ASSERT(sm->sm_size == (1ULL << vd->vdev_ms_shift)); + if (dump_opt['m'] > 1 && sm != NULL && + spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM])) { + /* + * The space map histogram represents free space in chunks + * of sm_shift (i.e. bucket 0 refers to 2^sm_shift). + */ + (void) printf("\tOn-disk histogram:\n"); + dump_histogram(sm->sm_phys->smp_histogram, + SPACE_MAP_HISTOGRAM_SIZE(sm), sm->sm_shift); + } + + if (dump_opt['d'] > 5 || dump_opt['m'] > 3) { + ASSERT(msp->ms_size == (1ULL << vd->vdev_ms_shift)); mutex_enter(&msp->ms_lock); - dump_spacemap(spa->spa_meta_objset, smo, sm); + dump_spacemap(spa->spa_meta_objset, msp->ms_sm); mutex_exit(&msp->ms_lock); } } @@ -801,9 +874,9 @@ dump_all_ddts(spa_t *spa) } static void -dump_dtl_seg(space_map_t *sm, uint64_t start, uint64_t size) +dump_dtl_seg(void *arg, uint64_t start, uint64_t size) { - char *prefix = (void *)sm; + char *prefix = arg; (void) printf("%s [%llu,%llu) length %llu\n", prefix, @@ -833,17 +906,16 @@ dump_dtl(vdev_t *vd, int indent) required ? "DTL-required" : "DTL-expendable"); for (int t = 0; t < DTL_TYPES; t++) { - space_map_t *sm = &vd->vdev_dtl[t]; - if (sm->sm_space == 0) + range_tree_t *rt = vd->vdev_dtl[t]; + if (range_tree_space(rt) == 0) continue; (void) snprintf(prefix, sizeof (prefix), "\t%*s%s", indent + 2, "", name[t]); - mutex_enter(sm->sm_lock); - space_map_walk(sm, dump_dtl_seg, (void *)prefix); - mutex_exit(sm->sm_lock); + mutex_enter(rt->rt_lock); + range_tree_walk(rt, dump_dtl_seg, prefix); + mutex_exit(rt->rt_lock); if (dump_opt['d'] > 5 && vd->vdev_children == 0) - dump_spacemap(spa->spa_meta_objset, - &vd->vdev_dtl_smo, sm); + dump_spacemap(spa->spa_meta_objset, vd->vdev_dtl_sm); } for (int c = 0; c < vd->vdev_children; c++) @@ -2172,39 +2244,17 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog } static void -zdb_leak(space_map_t *sm, uint64_t start, uint64_t size) +zdb_leak(void *arg, uint64_t start, uint64_t size) { - vdev_t *vd = sm->sm_ppd; + vdev_t *vd = arg; (void) printf("leaked space: vdev %llu, offset 0x%llx, size %llu\n", (u_longlong_t)vd->vdev_id, (u_longlong_t)start, (u_longlong_t)size); } -/* ARGSUSED */ -static void -zdb_space_map_load(space_map_t *sm) -{ -} - -static void -zdb_space_map_unload(space_map_t *sm) -{ - space_map_vacate(sm, zdb_leak, sm); -} - -/* ARGSUSED */ -static void -zdb_space_map_claim(space_map_t *sm, uint64_t start, uint64_t size) -{ -} - -static space_map_ops_t zdb_space_map_ops = { - zdb_space_map_load, - zdb_space_map_unload, +static metaslab_ops_t zdb_metaslab_ops = { NULL, /* alloc */ - zdb_space_map_claim, - NULL, /* free */ - NULL /* maxsize */ + NULL /* fragmented */ }; static void @@ -2259,11 +2309,21 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); - VERIFY(space_map_load(msp->ms_map, - &zdb_space_map_ops, SM_ALLOC, &msp->ms_smo, - spa->spa_meta_objset) == 0); - msp->ms_map->sm_ppd = vd; + metaslab_unload(msp); + + /* + * For leak detection, we overload the metaslab + * ms_tree to contain allocated segments + * instead of free segments. As a result, + * we can't use the normal metaslab_load/unload + * interfaces. + */ + if (msp->ms_sm != NULL) { + msp->ms_ops = &zdb_metaslab_ops; + VERIFY0(space_map_load(msp->ms_sm, + msp->ms_tree, SM_ALLOC)); + msp->ms_loaded = B_TRUE; + } mutex_exit(&msp->ms_lock); } } @@ -2286,7 +2346,20 @@ zdb_leak_fini(spa_t *spa) for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); + + /* + * The ms_tree has been overloaded to + * contain allocated segments. Now that we + * finished traversing all blocks, any + * block that remains in the ms_tree + * represents an allocated block that we + * did not claim during the traversal. + * Claimed blocks would have been removed + * from the ms_tree. + */ + range_tree_vacate(msp->ms_tree, zdb_leak, vd); + msp->ms_loaded = B_FALSE; + mutex_exit(&msp->ms_lock); } } @@ -2489,7 +2562,7 @@ dump_block_stats(spa_t *spa) "(in 512-byte sectors): " "number of blocks\n"); dump_histogram(zb->zb_psize_histogram, - PSIZE_HISTO_SIZE); + PSIZE_HISTO_SIZE, 0); } } } @@ -2659,6 +2732,9 @@ dump_zpool(spa_t *spa) if (dump_opt['b'] || dump_opt['c']) rc = dump_block_stats(spa); + if (rc == 0) + rc = verify_spacemap_refcounts(spa); + if (dump_opt['s']) show_pool_stats(spa); Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:11:58 2014 (r262094) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2013 +.Dd October 08, 2013 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -251,6 +251,24 @@ configuration. .\" .Xr dumpon 8 .\" command to configure a .\" dump device on a pool comprised of multiple vdevs. +.It Sy spacemap_histogram +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:spacemap_histogram" +.It GUID Ta com.delphix:spacemap_histogram +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta none +.El +.Pp +This features allows ZFS to maintain more information about how free space +is organized within the pool. If this feature is +.Sy enabled , +ZFS will +set this feature to +.Sy active +when a new space map object is created or +an existing space map is upgraded to the new format. +Once the feature is +.Sy active , +it will remain in that state until the pool is destroyed. .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 17:11:58 2014 (r262094) @@ -5339,7 +5339,7 @@ ztest_deadman_thread(void *arg) * vdev_deadman() discovers that there hasn't been any recent * I/Os then it will end up aborting the tests. */ - if (spa_suspended(spa)) { + if (spa_suspended(spa) || spa->spa_root_vdev == NULL) { fatal(0, "aborting test after %llu seconds because " "pool has transitioned to a suspended state.", zfs_deadman_synctime_ms / 1000); Modified: stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:11:58 2014 (r262094) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -163,4 +163,7 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, "com.joyent:multi_vdev_crash_dump", "multi_vdev_crash_dump", "Crash dumps to multiple vdev pools.", B_FALSE, B_FALSE, NULL); + zfeature_register(SPA_FEATURE_SPACEMAP_HISTOGRAM, + "com.delphix:spacemap_histogram", "spacemap_histogram", + "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, NULL); } Modified: stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:11:58 2014 (r262094) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -55,6 +55,7 @@ static enum spa_feature { SPA_FEATURE_EMPTY_BPOBJ, SPA_FEATURE_LZ4_COMPRESS, SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, + SPA_FEATURE_SPACEMAP_HISTOGRAM, SPA_FEATURES } spa_feature_t; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/Makefile.files ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Mon Feb 17 17:11:58 2014 (r262094) @@ -21,7 +21,8 @@ # # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2012 by Delphix. All rights reserved. +# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. +# Copyright (c) 2013 by Delphix. All rights reserved. # Copyright (c) 2013 by Saso Kiselkov. All rights reserved. # # @@ -62,6 +63,7 @@ ZFS_COMMON_OBJS += \ lz4.o \ lzjb.o \ metaslab.o \ + range_tree.o \ refcount.o \ rrwlock.o \ sa.o \ @@ -72,6 +74,7 @@ ZFS_COMMON_OBJS += \ spa_history.o \ spa_misc.o \ space_map.o \ + space_reftree.o \ txg.o \ uberblock.o \ unique.o \ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Feb 17 17:11:58 2014 (r262094) @@ -1339,7 +1339,7 @@ dnode_set_blksz(dnode_t *dn, uint64_t si rw_enter(&dn->dn_struct_rwlock, RW_WRITER); /* Check for any allocated blocks beyond the first */ - if (dn->dn_phys->dn_maxblkid != 0) + if (dn->dn_maxblkid != 0) goto fail; mutex_enter(&dn->dn_dbufs_mtx); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 17:11:38 2014 (r262093) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 17:11:58 2014 (r262094) @@ -31,6 +31,7 @@ #include #include #include +#include SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); @@ -47,6 +48,11 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab (!((flags) & (METASLAB_GANG_CHILD | METASLAB_GANG_HEADER | \ METASLAB_GANG_AVOID))) +#define METASLAB_WEIGHT_PRIMARY (1ULL << 63) +#define METASLAB_WEIGHT_SECONDARY (1ULL << 62) +#define METASLAB_ACTIVE_MASK \ + (METASLAB_WEIGHT_PRIMARY | METASLAB_WEIGHT_SECONDARY) + uint64_t metaslab_aliquot = 512ULL << 10; uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */ TUNABLE_QUAD("vfs.zfs.metaslab.gang_bang", &metaslab_gang_bang); @@ -61,6 +67,11 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, * Values should be greater than or equal to 100. */ int zfs_condense_pct = 200; +TUNABLE_INT("vfs.zfs.condense_pct", &zfs_condense_pct); +SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_pct, CTLFLAG_RWTUN, + &zfs_condense_pct, 0, + "Condense on-disk spacemap when it is more than this many percents" + " of in-memory counterpart"); /* * This value defines the number of allowed allocation failures per vdev. @@ -88,15 +99,29 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_ * no metaslab group will be excluded based on this criterion. */ int zfs_mg_noalloc_threshold = 0; +TUNABLE_INT("vfs.zfs.mg_noalloc_threshold", &zfs_mg_noalloc_threshold); +SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noalloc_threshold, CTLFLAG_RWTUN, + &zfs_mg_noalloc_threshold, 0, + "Percentage of metaslab group size that should be free" + " to make it eligible for allocation"); /* - * Metaslab debugging: when set, keeps all space maps in core to verify frees. + * When set will load all metaslabs when pool is first opened. */ -static int metaslab_debug = 0; -TUNABLE_INT("vfs.zfs.metaslab.debug", &metaslab_debug); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug, CTLFLAG_RWTUN, &metaslab_debug, - 0, - "Metaslab debugging: when set, keeps all space maps in core to verify frees"); +int metaslab_debug_load = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug_load", &metaslab_debug_load); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_load, CTLFLAG_RWTUN, + &metaslab_debug_load, 0, + "Load all metaslabs when pool is first opened"); + +/* + * When set will prevent metaslabs from being unloaded. + */ +int metaslab_debug_unload = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug_unload", &metaslab_debug_unload); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_unload, CTLFLAG_RWTUN, + &metaslab_debug_unload, 0, + "Prevent metaslabs from being unloaded"); /* * Minimum size which forces the dynamic allocator to change @@ -135,20 +160,24 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, "A metaslab is considered \"free\" if it contains a contiguous segment which is greater than vfs.zfs.metaslab.min_alloc_size"); /* - * Max number of space_maps to prefetch. - */ -int metaslab_prefetch_limit = SPA_DVAS_PER_BP; -TUNABLE_INT("vfs.zfs.metaslab.prefetch_limit", &metaslab_prefetch_limit); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, prefetch_limit, CTLFLAG_RWTUN, - &metaslab_prefetch_limit, 0, "Maximum number of space_maps to prefetch"); - -/* - * Percentage bonus multiplier for metaslabs that are in the bonus area. + * Percentage of all cpus that can be used by the metaslab taskq. */ -int metaslab_smo_bonus_pct = 150; -TUNABLE_INT("vfs.zfs.metaslab.smo_bonus_pct", &metaslab_smo_bonus_pct); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, smo_bonus_pct, CTLFLAG_RWTUN, - &metaslab_smo_bonus_pct, 0, "Maximum number of space_maps to prefetch"); +int metaslab_load_pct = 50; +TUNABLE_INT("vfs.zfs.metaslab.load_pct", &metaslab_load_pct); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, load_pct, CTLFLAG_RWTUN, + &metaslab_load_pct, 0, + "Percentage of cpus that can be used by the metaslab taskq"); + +/* + * Determines how many txgs a metaslab may remain loaded without having any + * allocations from it. As long as a metaslab continues to be used we will + * keep it loaded. + */ +int metaslab_unload_delay = TXG_SIZE * 2; +TUNABLE_INT("vfs.zfs.metaslab.unload_delay", &metaslab_unload_delay); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, unload_delay, CTLFLAG_RWTUN, + &metaslab_unload_delay, 0, + "Number of TXGs that an unused metaslab can be kept in memory"); /* * Should we be willing to write data to degraded vdevs? @@ -160,12 +189,41 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_ TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded); /* + * Max number of metaslabs per group to preload. + */ +int metaslab_preload_limit = SPA_DVAS_PER_BP; +TUNABLE_INT("vfs.zfs.metaslab.preload_limit", &metaslab_preload_limit); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_limit, CTLFLAG_RWTUN, + &metaslab_preload_limit, 0, + "Max number of metaslabs per group to preload"); + +/* + * Enable/disable preloading of metaslab. + */ +boolean_t metaslab_preload_enabled = B_TRUE; +TUNABLE_INT("vfs.zfs.metaslab.preload_enabled", &metaslab_preload_enabled); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_enabled, CTLFLAG_RWTUN, + &metaslab_preload_enabled, 0, + "Max number of metaslabs per group to preload"); + +/* + * Enable/disable additional weight factor for each metaslab. + */ +boolean_t metaslab_weight_factor_enable = B_FALSE; +TUNABLE_INT("vfs.zfs.metaslab.weight_factor_enable", + &metaslab_weight_factor_enable); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, weight_factor_enable, CTLFLAG_RWTUN, + &metaslab_weight_factor_enable, 0, + "Enable additional weight factor for each metaslab"); + + +/* * ========================================================================== * Metaslab classes * ========================================================================== */ metaslab_class_t * -metaslab_class_create(spa_t *spa, space_map_ops_t *ops) +metaslab_class_create(spa_t *spa, metaslab_ops_t *ops) { metaslab_class_t *mc; @@ -296,9 +354,9 @@ metaslab_compare(const void *x1, const v /* * If the weights are identical, use the offset to force uniqueness. */ - if (m1->ms_map->sm_start < m2->ms_map->sm_start) + if (m1->ms_start < m2->ms_start) return (-1); - if (m1->ms_map->sm_start > m2->ms_map->sm_start) + if (m1->ms_start > m2->ms_start) return (1); ASSERT3P(m1, ==, m2); @@ -366,6 +424,9 @@ metaslab_group_create(metaslab_class_t * mg->mg_class = mc; mg->mg_activation_count = 0; + mg->mg_taskq = taskq_create("metaslab_group_tasksq", metaslab_load_pct, + minclsyspri, 10, INT_MAX, TASKQ_THREADS_CPU_PCT); + return (mg); } @@ -435,6 +496,8 @@ metaslab_group_passivate(metaslab_group_ return; } + taskq_wait(mg->mg_taskq); + mgprev = mg->mg_prev; mgnext = mg->mg_next; @@ -515,130 +578,200 @@ metaslab_group_allocatable(metaslab_grou /* * ========================================================================== - * Common allocator routines + * Range tree callbacks * ========================================================================== */ + +/* + * Comparison function for the private size-ordered tree. Tree is sorted + * by size, larger sizes at the end of the tree. + */ static int -metaslab_segsize_compare(const void *x1, const void *x2) +metaslab_rangesize_compare(const void *x1, const void *x2) { - const space_seg_t *s1 = x1; - const space_seg_t *s2 = x2; - uint64_t ss_size1 = s1->ss_end - s1->ss_start; - uint64_t ss_size2 = s2->ss_end - s2->ss_start; + const range_seg_t *r1 = x1; + const range_seg_t *r2 = x2; + uint64_t rs_size1 = r1->rs_end - r1->rs_start; + uint64_t rs_size2 = r2->rs_end - r2->rs_start; - if (ss_size1 < ss_size2) + if (rs_size1 < rs_size2) return (-1); - if (ss_size1 > ss_size2) + if (rs_size1 > rs_size2) return (1); - if (s1->ss_start < s2->ss_start) + if (r1->rs_start < r2->rs_start) return (-1); - if (s1->ss_start > s2->ss_start) + + if (r1->rs_start > r2->rs_start) return (1); return (0); } /* - * This is a helper function that can be used by the allocator to find - * a suitable block to allocate. This will search the specified AVL - * tree looking for a block that matches the specified criteria. + * Create any block allocator specific components. The current allocators + * rely on using both a size-ordered range_tree_t and an array of uint64_t's. */ -static uint64_t -metaslab_block_picker(avl_tree_t *t, uint64_t *cursor, uint64_t size, - uint64_t align) +static void +metaslab_rt_create(range_tree_t *rt, void *arg) { - space_seg_t *ss, ssearch; - avl_index_t where; - - ssearch.ss_start = *cursor; - ssearch.ss_end = *cursor + size; + metaslab_t *msp = arg; - ss = avl_find(t, &ssearch, &where); - if (ss == NULL) - ss = avl_nearest(t, where, AVL_AFTER); + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT(msp->ms_tree == NULL); - while (ss != NULL) { - uint64_t offset = P2ROUNDUP(ss->ss_start, align); - - if (offset + size <= ss->ss_end) { - *cursor = offset + size; - return (offset); - } - ss = AVL_NEXT(t, ss); - } - - /* - * If we know we've searched the whole map (*cursor == 0), give up. - * Otherwise, reset the cursor to the beginning and try again. - */ - if (*cursor == 0) - return (-1ULL); - - *cursor = 0; - return (metaslab_block_picker(t, cursor, size, align)); + avl_create(&msp->ms_size_tree, metaslab_rangesize_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_pp_node)); } +/* + * Destroy the block allocator specific components. + */ static void -metaslab_pp_load(space_map_t *sm) +metaslab_rt_destroy(range_tree_t *rt, void *arg) { - space_seg_t *ss; - - ASSERT(sm->sm_ppd == NULL); - sm->sm_ppd = kmem_zalloc(64 * sizeof (uint64_t), KM_SLEEP); + metaslab_t *msp = arg; - sm->sm_pp_root = kmem_alloc(sizeof (avl_tree_t), KM_SLEEP); - avl_create(sm->sm_pp_root, metaslab_segsize_compare, - sizeof (space_seg_t), offsetof(struct space_seg, ss_pp_node)); + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + ASSERT0(avl_numnodes(&msp->ms_size_tree)); - for (ss = avl_first(&sm->sm_root); ss; ss = AVL_NEXT(&sm->sm_root, ss)) - avl_add(sm->sm_pp_root, ss); + avl_destroy(&msp->ms_size_tree); } static void -metaslab_pp_unload(space_map_t *sm) +metaslab_rt_add(range_tree_t *rt, range_seg_t *rs, void *arg) { - void *cookie = NULL; - - kmem_free(sm->sm_ppd, 64 * sizeof (uint64_t)); - sm->sm_ppd = NULL; - - while (avl_destroy_nodes(sm->sm_pp_root, &cookie) != NULL) { - /* tear down the tree */ - } + metaslab_t *msp = arg; - avl_destroy(sm->sm_pp_root); - kmem_free(sm->sm_pp_root, sizeof (avl_tree_t)); - sm->sm_pp_root = NULL; + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + VERIFY(!msp->ms_condensing); + avl_add(&msp->ms_size_tree, rs); } -/* ARGSUSED */ static void -metaslab_pp_claim(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_rt_remove(range_tree_t *rt, range_seg_t *rs, void *arg) { - /* No need to update cursor */ + metaslab_t *msp = arg; + + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + VERIFY(!msp->ms_condensing); + avl_remove(&msp->ms_size_tree, rs); } -/* ARGSUSED */ static void -metaslab_pp_free(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_rt_vacate(range_tree_t *rt, void *arg) { - /* No need to update cursor */ + metaslab_t *msp = arg; + + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + + /* + * Normally one would walk the tree freeing nodes along the way. + * Since the nodes are shared with the range trees we can avoid + * walking all nodes and just reinitialize the avl tree. The nodes + * will be freed by the range tree, so we don't want to free them here. + */ + avl_create(&msp->ms_size_tree, metaslab_rangesize_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_pp_node)); } +static range_tree_ops_t metaslab_rt_ops = { + metaslab_rt_create, + metaslab_rt_destroy, + metaslab_rt_add, + metaslab_rt_remove, + metaslab_rt_vacate +}; + +/* + * ========================================================================== + * Metaslab block operations + * ========================================================================== + */ + /* * Return the maximum contiguous segment within the metaslab. */ uint64_t -metaslab_pp_maxsize(space_map_t *sm) +metaslab_block_maxsize(metaslab_t *msp) { - avl_tree_t *t = sm->sm_pp_root; - space_seg_t *ss; + avl_tree_t *t = &msp->ms_size_tree; + range_seg_t *rs; - if (t == NULL || (ss = avl_last(t)) == NULL) + if (t == NULL || (rs = avl_last(t)) == NULL) return (0ULL); - return (ss->ss_end - ss->ss_start); + return (rs->rs_end - rs->rs_start); +} + +uint64_t +metaslab_block_alloc(metaslab_t *msp, uint64_t size) +{ + uint64_t start; + range_tree_t *rt = msp->ms_tree; + + VERIFY(!msp->ms_condensing); + + start = msp->ms_ops->msop_alloc(msp, size); + if (start != -1ULL) { + vdev_t *vd = msp->ms_group->mg_vd; + + VERIFY0(P2PHASE(start, 1ULL << vd->vdev_ashift)); + VERIFY0(P2PHASE(size, 1ULL << vd->vdev_ashift)); + VERIFY3U(range_tree_space(rt) - size, <=, msp->ms_size); + range_tree_remove(rt, start, size); + } + return (start); +} + +/* + * ========================================================================== + * Common allocator routines + * ========================================================================== + */ + +/* + * This is a helper function that can be used by the allocator to find + * a suitable block to allocate. This will search the specified AVL + * tree looking for a block that matches the specified criteria. + */ +static uint64_t +metaslab_block_picker(avl_tree_t *t, uint64_t *cursor, uint64_t size, + uint64_t align) +{ + range_seg_t *rs, rsearch; + avl_index_t where; + + rsearch.rs_start = *cursor; + rsearch.rs_end = *cursor + size; + + rs = avl_find(t, &rsearch, &where); + if (rs == NULL) + rs = avl_nearest(t, where, AVL_AFTER); + + while (rs != NULL) { + uint64_t offset = P2ROUNDUP(rs->rs_start, align); + + if (offset + size <= rs->rs_end) { + *cursor = offset + size; + return (offset); + } + rs = AVL_NEXT(t, rs); + } + + /* + * If we know we've searched the whole map (*cursor == 0), give up. + * Otherwise, reset the cursor to the beginning and try again. + */ + if (*cursor == 0) + return (-1ULL); + + *cursor = 0; + return (metaslab_block_picker(t, cursor, size, align)); } /* @@ -647,29 +780,31 @@ metaslab_pp_maxsize(space_map_t *sm) * ========================================================================== */ static uint64_t -metaslab_ff_alloc(space_map_t *sm, uint64_t size) +metaslab_ff_alloc(metaslab_t *msp, uint64_t size) { - avl_tree_t *t = &sm->sm_root; + /* + * Find the largest power of 2 block size that evenly divides the + * requested size. This is used to try to allocate blocks with similar + * alignment from the same area of the metaslab (i.e. same cursor + * bucket) but it does not guarantee that other allocations sizes + * may exist in the same region. + */ uint64_t align = size & -size; - uint64_t *cursor = (uint64_t *)sm->sm_ppd + highbit(align) - 1; + uint64_t *cursor = &msp->ms_lbas[highbit(align) - 1]; + avl_tree_t *t = &msp->ms_tree->rt_root; return (metaslab_block_picker(t, cursor, size, align)); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:12:13 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A0F2E411; Mon, 17 Feb 2014 17:12: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 886AE18AE; Mon, 17 Feb 2014 17:12:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHCDif055784; Mon, 17 Feb 2014 17:12:13 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHCCxb055774; Mon, 17 Feb 2014 17:12:12 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171712.s1HHCCxb055774@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:12:11 +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: r262095 - in stable/8: cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zpool cddl/contrib/opensolaris/cmd/ztest sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/op... X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:12:13 -0000 Author: avg Date: Mon Feb 17 17:12:11 2014 New Revision: 262095 URL: http://svnweb.freebsd.org/changeset/base/262095 Log: MFC r258717: MFV r258371,r258372: 4101 metaslab_debug should allow for fine-grained control Added: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/range_tree.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_reftree.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/range_tree.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_reftree.h - copied unchanged from r258717, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_reftree.h Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h stable/8/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfeature.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfeature.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:12:11 2014 (r262095) @@ -242,7 +242,7 @@ const char histo_stars[] = "************ const int histo_width = sizeof (histo_stars) - 1; static void -dump_histogram(const uint64_t *histo, int size) +dump_histogram(const uint64_t *histo, int size, int offset) { int i; int minidx = size - 1; @@ -263,7 +263,7 @@ dump_histogram(const uint64_t *histo, in for (i = minidx; i <= maxidx; i++) { (void) printf("\t\t\t%3u: %6llu %s\n", - i, (u_longlong_t)histo[i], + i + offset, (u_longlong_t)histo[i], &histo_stars[(max - histo[i]) * histo_width / max]); } } @@ -316,19 +316,19 @@ dump_zap_stats(objset_t *os, uint64_t ob (u_longlong_t)zs.zs_salt); (void) printf("\t\tLeafs with 2^n pointers:\n"); - dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBlocks with n*5 entries:\n"); - dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBlocks n/10 full:\n"); - dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tEntries with n chunks:\n"); - dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE, 0); (void) printf("\t\tBuckets with n entries:\n"); - dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE); + dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE, 0); } /*ARGSUSED*/ @@ -517,26 +517,85 @@ dump_zpldir(objset_t *os, uint64_t objec zap_cursor_fini(&zc); } +int +get_dtl_refcount(vdev_t *vd) +{ + int refcount = 0; + + if (vd->vdev_ops->vdev_op_leaf) { + space_map_t *sm = vd->vdev_dtl_sm; + + if (sm != NULL && + sm->sm_dbuf->db_size == sizeof (space_map_phys_t)) + return (1); + return (0); + } + + for (int c = 0; c < vd->vdev_children; c++) + refcount += get_dtl_refcount(vd->vdev_child[c]); + return (refcount); +} + +int +get_metaslab_refcount(vdev_t *vd) +{ + int refcount = 0; + + if (vd->vdev_top == vd) { + for (int m = 0; m < vd->vdev_ms_count; m++) { + space_map_t *sm = vd->vdev_ms[m]->ms_sm; + + if (sm != NULL && + sm->sm_dbuf->db_size == sizeof (space_map_phys_t)) + refcount++; + } + } + for (int c = 0; c < vd->vdev_children; c++) + refcount += get_metaslab_refcount(vd->vdev_child[c]); + + return (refcount); +} + +static int +verify_spacemap_refcounts(spa_t *spa) +{ + int expected_refcount, actual_refcount; + + expected_refcount = spa_feature_get_refcount(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM]); + actual_refcount = get_dtl_refcount(spa->spa_root_vdev); + actual_refcount += get_metaslab_refcount(spa->spa_root_vdev); + + if (expected_refcount != actual_refcount) { + (void) printf("space map refcount mismatch: expected %d != " + "actual %d\n", expected_refcount, actual_refcount); + return (2); + } + return (0); +} + static void -dump_spacemap(objset_t *os, space_map_obj_t *smo, space_map_t *sm) +dump_spacemap(objset_t *os, space_map_t *sm) { uint64_t alloc, offset, entry; - uint8_t mapshift = sm->sm_shift; - uint64_t mapstart = sm->sm_start; char *ddata[] = { "ALLOC", "FREE", "CONDENSE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID" }; - if (smo->smo_object == 0) + if (sm == NULL) return; /* * Print out the freelist entries in both encoded and decoded form. */ alloc = 0; - for (offset = 0; offset < smo->smo_objsize; offset += sizeof (entry)) { - VERIFY3U(0, ==, dmu_read(os, smo->smo_object, offset, + for (offset = 0; offset < space_map_length(sm); + offset += sizeof (entry)) { + uint8_t mapshift = sm->sm_shift; + + VERIFY0(dmu_read(os, space_map_object(sm), offset, sizeof (entry), &entry, DMU_READ_PREFETCH)); if (SM_DEBUG_DECODE(entry)) { + (void) printf("\t [%6llu] %s: txg %llu, pass %llu\n", (u_longlong_t)(offset / sizeof (entry)), ddata[SM_DEBUG_ACTION_DECODE(entry)], @@ -548,10 +607,10 @@ dump_spacemap(objset_t *os, space_map_ob (u_longlong_t)(offset / sizeof (entry)), SM_TYPE_DECODE(entry) == SM_ALLOC ? 'A' : 'F', (u_longlong_t)((SM_OFFSET_DECODE(entry) << - mapshift) + mapstart), + mapshift) + sm->sm_start), (u_longlong_t)((SM_OFFSET_DECODE(entry) << - mapshift) + mapstart + (SM_RUN_DECODE(entry) << - mapshift)), + mapshift) + sm->sm_start + + (SM_RUN_DECODE(entry) << mapshift)), (u_longlong_t)(SM_RUN_DECODE(entry) << mapshift)); if (SM_TYPE_DECODE(entry) == SM_ALLOC) alloc += SM_RUN_DECODE(entry) << mapshift; @@ -559,10 +618,10 @@ dump_spacemap(objset_t *os, space_map_ob alloc -= SM_RUN_DECODE(entry) << mapshift; } } - if (alloc != smo->smo_alloc) { + if (alloc != space_map_allocated(sm)) { (void) printf("space_map_object alloc (%llu) INCONSISTENT " "with space map summary (%llu)\n", - (u_longlong_t)smo->smo_alloc, (u_longlong_t)alloc); + (u_longlong_t)space_map_allocated(sm), (u_longlong_t)alloc); } } @@ -570,15 +629,17 @@ static void dump_metaslab_stats(metaslab_t *msp) { char maxbuf[32]; - space_map_t *sm = msp->ms_map; - avl_tree_t *t = sm->sm_pp_root; - int free_pct = sm->sm_space * 100 / sm->sm_size; + range_tree_t *rt = msp->ms_tree; + avl_tree_t *t = &msp->ms_size_tree; + int free_pct = range_tree_space(rt) * 100 / msp->ms_size; - zdb_nicenum(space_map_maxsize(sm), maxbuf); + zdb_nicenum(metaslab_block_maxsize(msp), maxbuf); (void) printf("\t %25s %10lu %7s %6s %4s %4d%%\n", "segments", avl_numnodes(t), "maxsize", maxbuf, "freepct", free_pct); + (void) printf("\tIn-memory histogram:\n"); + dump_histogram(rt->rt_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0); } static void @@ -586,33 +647,45 @@ dump_metaslab(metaslab_t *msp) { vdev_t *vd = msp->ms_group->mg_vd; spa_t *spa = vd->vdev_spa; - space_map_t *sm = msp->ms_map; - space_map_obj_t *smo = &msp->ms_smo; + space_map_t *sm = msp->ms_sm; char freebuf[32]; - zdb_nicenum(sm->sm_size - smo->smo_alloc, freebuf); + zdb_nicenum(msp->ms_size - space_map_allocated(sm), freebuf); (void) printf( "\tmetaslab %6llu offset %12llx spacemap %6llu free %5s\n", - (u_longlong_t)(sm->sm_start / sm->sm_size), - (u_longlong_t)sm->sm_start, (u_longlong_t)smo->smo_object, freebuf); + (u_longlong_t)msp->ms_id, (u_longlong_t)msp->ms_start, + (u_longlong_t)space_map_object(sm), freebuf); - if (dump_opt['m'] > 1 && !dump_opt['L']) { + if (dump_opt['m'] > 2 && !dump_opt['L']) { mutex_enter(&msp->ms_lock); - space_map_load_wait(sm); - if (!sm->sm_loaded) - VERIFY(space_map_load(sm, zfs_metaslab_ops, - SM_FREE, smo, spa->spa_meta_objset) == 0); + metaslab_load_wait(msp); + if (!msp->ms_loaded) { + VERIFY0(metaslab_load(msp)); + range_tree_stat_verify(msp->ms_tree); + } dump_metaslab_stats(msp); - space_map_unload(sm); + metaslab_unload(msp); mutex_exit(&msp->ms_lock); } - if (dump_opt['d'] > 5 || dump_opt['m'] > 2) { - ASSERT(sm->sm_size == (1ULL << vd->vdev_ms_shift)); + if (dump_opt['m'] > 1 && sm != NULL && + spa_feature_is_active(spa, + &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM])) { + /* + * The space map histogram represents free space in chunks + * of sm_shift (i.e. bucket 0 refers to 2^sm_shift). + */ + (void) printf("\tOn-disk histogram:\n"); + dump_histogram(sm->sm_phys->smp_histogram, + SPACE_MAP_HISTOGRAM_SIZE(sm), sm->sm_shift); + } + + if (dump_opt['d'] > 5 || dump_opt['m'] > 3) { + ASSERT(msp->ms_size == (1ULL << vd->vdev_ms_shift)); mutex_enter(&msp->ms_lock); - dump_spacemap(spa->spa_meta_objset, smo, sm); + dump_spacemap(spa->spa_meta_objset, msp->ms_sm); mutex_exit(&msp->ms_lock); } } @@ -801,9 +874,9 @@ dump_all_ddts(spa_t *spa) } static void -dump_dtl_seg(space_map_t *sm, uint64_t start, uint64_t size) +dump_dtl_seg(void *arg, uint64_t start, uint64_t size) { - char *prefix = (void *)sm; + char *prefix = arg; (void) printf("%s [%llu,%llu) length %llu\n", prefix, @@ -833,17 +906,16 @@ dump_dtl(vdev_t *vd, int indent) required ? "DTL-required" : "DTL-expendable"); for (int t = 0; t < DTL_TYPES; t++) { - space_map_t *sm = &vd->vdev_dtl[t]; - if (sm->sm_space == 0) + range_tree_t *rt = vd->vdev_dtl[t]; + if (range_tree_space(rt) == 0) continue; (void) snprintf(prefix, sizeof (prefix), "\t%*s%s", indent + 2, "", name[t]); - mutex_enter(sm->sm_lock); - space_map_walk(sm, dump_dtl_seg, (void *)prefix); - mutex_exit(sm->sm_lock); + mutex_enter(rt->rt_lock); + range_tree_walk(rt, dump_dtl_seg, prefix); + mutex_exit(rt->rt_lock); if (dump_opt['d'] > 5 && vd->vdev_children == 0) - dump_spacemap(spa->spa_meta_objset, - &vd->vdev_dtl_smo, sm); + dump_spacemap(spa->spa_meta_objset, vd->vdev_dtl_sm); } for (int c = 0; c < vd->vdev_children; c++) @@ -2172,39 +2244,17 @@ zdb_blkptr_cb(spa_t *spa, zilog_t *zilog } static void -zdb_leak(space_map_t *sm, uint64_t start, uint64_t size) +zdb_leak(void *arg, uint64_t start, uint64_t size) { - vdev_t *vd = sm->sm_ppd; + vdev_t *vd = arg; (void) printf("leaked space: vdev %llu, offset 0x%llx, size %llu\n", (u_longlong_t)vd->vdev_id, (u_longlong_t)start, (u_longlong_t)size); } -/* ARGSUSED */ -static void -zdb_space_map_load(space_map_t *sm) -{ -} - -static void -zdb_space_map_unload(space_map_t *sm) -{ - space_map_vacate(sm, zdb_leak, sm); -} - -/* ARGSUSED */ -static void -zdb_space_map_claim(space_map_t *sm, uint64_t start, uint64_t size) -{ -} - -static space_map_ops_t zdb_space_map_ops = { - zdb_space_map_load, - zdb_space_map_unload, +static metaslab_ops_t zdb_metaslab_ops = { NULL, /* alloc */ - zdb_space_map_claim, - NULL, /* free */ - NULL /* maxsize */ + NULL /* fragmented */ }; static void @@ -2259,11 +2309,21 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb) for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); - VERIFY(space_map_load(msp->ms_map, - &zdb_space_map_ops, SM_ALLOC, &msp->ms_smo, - spa->spa_meta_objset) == 0); - msp->ms_map->sm_ppd = vd; + metaslab_unload(msp); + + /* + * For leak detection, we overload the metaslab + * ms_tree to contain allocated segments + * instead of free segments. As a result, + * we can't use the normal metaslab_load/unload + * interfaces. + */ + if (msp->ms_sm != NULL) { + msp->ms_ops = &zdb_metaslab_ops; + VERIFY0(space_map_load(msp->ms_sm, + msp->ms_tree, SM_ALLOC)); + msp->ms_loaded = B_TRUE; + } mutex_exit(&msp->ms_lock); } } @@ -2286,7 +2346,20 @@ zdb_leak_fini(spa_t *spa) for (int m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); - space_map_unload(msp->ms_map); + + /* + * The ms_tree has been overloaded to + * contain allocated segments. Now that we + * finished traversing all blocks, any + * block that remains in the ms_tree + * represents an allocated block that we + * did not claim during the traversal. + * Claimed blocks would have been removed + * from the ms_tree. + */ + range_tree_vacate(msp->ms_tree, zdb_leak, vd); + msp->ms_loaded = B_FALSE; + mutex_exit(&msp->ms_lock); } } @@ -2489,7 +2562,7 @@ dump_block_stats(spa_t *spa) "(in 512-byte sectors): " "number of blocks\n"); dump_histogram(zb->zb_psize_histogram, - PSIZE_HISTO_SIZE); + PSIZE_HISTO_SIZE, 0); } } } @@ -2659,6 +2732,9 @@ dump_zpool(spa_t *spa) if (dump_opt['b'] || dump_opt['c']) rc = dump_block_stats(spa); + if (rc == 0) + rc = verify_spacemap_refcounts(spa); + if (dump_opt['s']) show_pool_stats(spa); Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool-features.7 Mon Feb 17 17:12:11 2014 (r262095) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 20, 2013 +.Dd October 08, 2013 .Dt ZPOOL-FEATURES 7 .Os .Sh NAME @@ -251,6 +251,24 @@ configuration. .\" .Xr dumpon 8 .\" command to configure a .\" dump device on a pool comprised of multiple vdevs. +.It Sy spacemap_histogram +.Bl -column "READ\-ONLY COMPATIBLE" "com.delphix:spacemap_histogram" +.It GUID Ta com.delphix:spacemap_histogram +.It READ\-ONLY COMPATIBLE Ta yes +.It DEPENDENCIES Ta none +.El +.Pp +This features allows ZFS to maintain more information about how free space +is organized within the pool. If this feature is +.Sy enabled , +ZFS will +set this feature to +.Sy active +when a new space map object is created or +an existing space map is upgraded to the new format. +Once the feature is +.Sy active , +it will remain in that state until the pool is destroyed. .El .Sh SEE ALSO .Xr zpool 8 Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Mon Feb 17 17:12:11 2014 (r262095) @@ -5339,7 +5339,7 @@ ztest_deadman_thread(void *arg) * vdev_deadman() discovers that there hasn't been any recent * I/Os then it will end up aborting the tests. */ - if (spa_suspended(spa)) { + if (spa_suspended(spa) || spa->spa_root_vdev == NULL) { fatal(0, "aborting test after %llu seconds because " "pool has transitioned to a suspended state.", zfs_deadman_synctime_ms / 1000); Modified: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.c Mon Feb 17 17:12:11 2014 (r262095) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -163,4 +163,7 @@ zpool_feature_init(void) zfeature_register(SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, "com.joyent:multi_vdev_crash_dump", "multi_vdev_crash_dump", "Crash dumps to multiple vdev pools.", B_FALSE, B_FALSE, NULL); + zfeature_register(SPA_FEATURE_SPACEMAP_HISTOGRAM, + "com.delphix:spacemap_histogram", "spacemap_histogram", + "Spacemaps maintain space histograms.", B_TRUE, B_FALSE, NULL); } Modified: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfeature_common.h Mon Feb 17 17:12:11 2014 (r262095) @@ -20,7 +20,7 @@ */ /* - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. * Copyright (c) 2013, Joyent, Inc. All rights reserved. */ @@ -55,6 +55,7 @@ static enum spa_feature { SPA_FEATURE_EMPTY_BPOBJ, SPA_FEATURE_LZ4_COMPRESS, SPA_FEATURE_MULTI_VDEV_CRASH_DUMP, + SPA_FEATURE_SPACEMAP_HISTOGRAM, SPA_FEATURES } spa_feature_t; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/Makefile.files ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/Makefile.files Mon Feb 17 17:12:11 2014 (r262095) @@ -21,7 +21,8 @@ # # Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved. -# Copyright (c) 2012 by Delphix. All rights reserved. +# Copyright (c) 2012 Nexenta Systems, Inc. All rights reserved. +# Copyright (c) 2013 by Delphix. All rights reserved. # Copyright (c) 2013 by Saso Kiselkov. All rights reserved. # # @@ -62,6 +63,7 @@ ZFS_COMMON_OBJS += \ lz4.o \ lzjb.o \ metaslab.o \ + range_tree.o \ refcount.o \ rrwlock.o \ sa.o \ @@ -72,6 +74,7 @@ ZFS_COMMON_OBJS += \ spa_history.o \ spa_misc.o \ space_map.o \ + space_reftree.o \ txg.o \ uberblock.o \ unique.o \ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Mon Feb 17 17:12:11 2014 (r262095) @@ -1339,7 +1339,7 @@ dnode_set_blksz(dnode_t *dn, uint64_t si rw_enter(&dn->dn_struct_rwlock, RW_WRITER); /* Check for any allocated blocks beyond the first */ - if (dn->dn_phys->dn_maxblkid != 0) + if (dn->dn_maxblkid != 0) goto fail; mutex_enter(&dn->dn_dbufs_mtx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 17:11:58 2014 (r262094) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c Mon Feb 17 17:12:11 2014 (r262095) @@ -31,6 +31,7 @@ #include #include #include +#include SYSCTL_DECL(_vfs_zfs); SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab"); @@ -47,6 +48,11 @@ SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab (!((flags) & (METASLAB_GANG_CHILD | METASLAB_GANG_HEADER | \ METASLAB_GANG_AVOID))) +#define METASLAB_WEIGHT_PRIMARY (1ULL << 63) +#define METASLAB_WEIGHT_SECONDARY (1ULL << 62) +#define METASLAB_ACTIVE_MASK \ + (METASLAB_WEIGHT_PRIMARY | METASLAB_WEIGHT_SECONDARY) + uint64_t metaslab_aliquot = 512ULL << 10; uint64_t metaslab_gang_bang = SPA_MAXBLOCKSIZE + 1; /* force gang blocks */ TUNABLE_QUAD("vfs.zfs.metaslab.gang_bang", &metaslab_gang_bang); @@ -61,6 +67,11 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, * Values should be greater than or equal to 100. */ int zfs_condense_pct = 200; +TUNABLE_INT("vfs.zfs.condense_pct", &zfs_condense_pct); +SYSCTL_INT(_vfs_zfs, OID_AUTO, condense_pct, CTLFLAG_RWTUN, + &zfs_condense_pct, 0, + "Condense on-disk spacemap when it is more than this many percents" + " of in-memory counterpart"); /* * This value defines the number of allowed allocation failures per vdev. @@ -88,15 +99,29 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_alloc_ * no metaslab group will be excluded based on this criterion. */ int zfs_mg_noalloc_threshold = 0; +TUNABLE_INT("vfs.zfs.mg_noalloc_threshold", &zfs_mg_noalloc_threshold); +SYSCTL_INT(_vfs_zfs, OID_AUTO, mg_noalloc_threshold, CTLFLAG_RWTUN, + &zfs_mg_noalloc_threshold, 0, + "Percentage of metaslab group size that should be free" + " to make it eligible for allocation"); /* - * Metaslab debugging: when set, keeps all space maps in core to verify frees. + * When set will load all metaslabs when pool is first opened. */ -static int metaslab_debug = 0; -TUNABLE_INT("vfs.zfs.metaslab.debug", &metaslab_debug); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug, CTLFLAG_RWTUN, &metaslab_debug, - 0, - "Metaslab debugging: when set, keeps all space maps in core to verify frees"); +int metaslab_debug_load = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug_load", &metaslab_debug_load); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_load, CTLFLAG_RWTUN, + &metaslab_debug_load, 0, + "Load all metaslabs when pool is first opened"); + +/* + * When set will prevent metaslabs from being unloaded. + */ +int metaslab_debug_unload = 0; +TUNABLE_INT("vfs.zfs.metaslab.debug_unload", &metaslab_debug_unload); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, debug_unload, CTLFLAG_RWTUN, + &metaslab_debug_unload, 0, + "Prevent metaslabs from being unloaded"); /* * Minimum size which forces the dynamic allocator to change @@ -135,20 +160,24 @@ SYSCTL_QUAD(_vfs_zfs_metaslab, OID_AUTO, "A metaslab is considered \"free\" if it contains a contiguous segment which is greater than vfs.zfs.metaslab.min_alloc_size"); /* - * Max number of space_maps to prefetch. - */ -int metaslab_prefetch_limit = SPA_DVAS_PER_BP; -TUNABLE_INT("vfs.zfs.metaslab.prefetch_limit", &metaslab_prefetch_limit); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, prefetch_limit, CTLFLAG_RWTUN, - &metaslab_prefetch_limit, 0, "Maximum number of space_maps to prefetch"); - -/* - * Percentage bonus multiplier for metaslabs that are in the bonus area. + * Percentage of all cpus that can be used by the metaslab taskq. */ -int metaslab_smo_bonus_pct = 150; -TUNABLE_INT("vfs.zfs.metaslab.smo_bonus_pct", &metaslab_smo_bonus_pct); -SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, smo_bonus_pct, CTLFLAG_RWTUN, - &metaslab_smo_bonus_pct, 0, "Maximum number of space_maps to prefetch"); +int metaslab_load_pct = 50; +TUNABLE_INT("vfs.zfs.metaslab.load_pct", &metaslab_load_pct); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, load_pct, CTLFLAG_RWTUN, + &metaslab_load_pct, 0, + "Percentage of cpus that can be used by the metaslab taskq"); + +/* + * Determines how many txgs a metaslab may remain loaded without having any + * allocations from it. As long as a metaslab continues to be used we will + * keep it loaded. + */ +int metaslab_unload_delay = TXG_SIZE * 2; +TUNABLE_INT("vfs.zfs.metaslab.unload_delay", &metaslab_unload_delay); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, unload_delay, CTLFLAG_RWTUN, + &metaslab_unload_delay, 0, + "Number of TXGs that an unused metaslab can be kept in memory"); /* * Should we be willing to write data to degraded vdevs? @@ -160,12 +189,41 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, write_to_ TUNABLE_INT("vfs.zfs.write_to_degraded", &zfs_write_to_degraded); /* + * Max number of metaslabs per group to preload. + */ +int metaslab_preload_limit = SPA_DVAS_PER_BP; +TUNABLE_INT("vfs.zfs.metaslab.preload_limit", &metaslab_preload_limit); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_limit, CTLFLAG_RWTUN, + &metaslab_preload_limit, 0, + "Max number of metaslabs per group to preload"); + +/* + * Enable/disable preloading of metaslab. + */ +boolean_t metaslab_preload_enabled = B_TRUE; +TUNABLE_INT("vfs.zfs.metaslab.preload_enabled", &metaslab_preload_enabled); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, preload_enabled, CTLFLAG_RWTUN, + &metaslab_preload_enabled, 0, + "Max number of metaslabs per group to preload"); + +/* + * Enable/disable additional weight factor for each metaslab. + */ +boolean_t metaslab_weight_factor_enable = B_FALSE; +TUNABLE_INT("vfs.zfs.metaslab.weight_factor_enable", + &metaslab_weight_factor_enable); +SYSCTL_INT(_vfs_zfs_metaslab, OID_AUTO, weight_factor_enable, CTLFLAG_RWTUN, + &metaslab_weight_factor_enable, 0, + "Enable additional weight factor for each metaslab"); + + +/* * ========================================================================== * Metaslab classes * ========================================================================== */ metaslab_class_t * -metaslab_class_create(spa_t *spa, space_map_ops_t *ops) +metaslab_class_create(spa_t *spa, metaslab_ops_t *ops) { metaslab_class_t *mc; @@ -296,9 +354,9 @@ metaslab_compare(const void *x1, const v /* * If the weights are identical, use the offset to force uniqueness. */ - if (m1->ms_map->sm_start < m2->ms_map->sm_start) + if (m1->ms_start < m2->ms_start) return (-1); - if (m1->ms_map->sm_start > m2->ms_map->sm_start) + if (m1->ms_start > m2->ms_start) return (1); ASSERT3P(m1, ==, m2); @@ -366,6 +424,9 @@ metaslab_group_create(metaslab_class_t * mg->mg_class = mc; mg->mg_activation_count = 0; + mg->mg_taskq = taskq_create("metaslab_group_tasksq", metaslab_load_pct, + minclsyspri, 10, INT_MAX, TASKQ_THREADS_CPU_PCT); + return (mg); } @@ -435,6 +496,8 @@ metaslab_group_passivate(metaslab_group_ return; } + taskq_wait(mg->mg_taskq); + mgprev = mg->mg_prev; mgnext = mg->mg_next; @@ -515,130 +578,200 @@ metaslab_group_allocatable(metaslab_grou /* * ========================================================================== - * Common allocator routines + * Range tree callbacks * ========================================================================== */ + +/* + * Comparison function for the private size-ordered tree. Tree is sorted + * by size, larger sizes at the end of the tree. + */ static int -metaslab_segsize_compare(const void *x1, const void *x2) +metaslab_rangesize_compare(const void *x1, const void *x2) { - const space_seg_t *s1 = x1; - const space_seg_t *s2 = x2; - uint64_t ss_size1 = s1->ss_end - s1->ss_start; - uint64_t ss_size2 = s2->ss_end - s2->ss_start; + const range_seg_t *r1 = x1; + const range_seg_t *r2 = x2; + uint64_t rs_size1 = r1->rs_end - r1->rs_start; + uint64_t rs_size2 = r2->rs_end - r2->rs_start; - if (ss_size1 < ss_size2) + if (rs_size1 < rs_size2) return (-1); - if (ss_size1 > ss_size2) + if (rs_size1 > rs_size2) return (1); - if (s1->ss_start < s2->ss_start) + if (r1->rs_start < r2->rs_start) return (-1); - if (s1->ss_start > s2->ss_start) + + if (r1->rs_start > r2->rs_start) return (1); return (0); } /* - * This is a helper function that can be used by the allocator to find - * a suitable block to allocate. This will search the specified AVL - * tree looking for a block that matches the specified criteria. + * Create any block allocator specific components. The current allocators + * rely on using both a size-ordered range_tree_t and an array of uint64_t's. */ -static uint64_t -metaslab_block_picker(avl_tree_t *t, uint64_t *cursor, uint64_t size, - uint64_t align) +static void +metaslab_rt_create(range_tree_t *rt, void *arg) { - space_seg_t *ss, ssearch; - avl_index_t where; - - ssearch.ss_start = *cursor; - ssearch.ss_end = *cursor + size; + metaslab_t *msp = arg; - ss = avl_find(t, &ssearch, &where); - if (ss == NULL) - ss = avl_nearest(t, where, AVL_AFTER); + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT(msp->ms_tree == NULL); - while (ss != NULL) { - uint64_t offset = P2ROUNDUP(ss->ss_start, align); - - if (offset + size <= ss->ss_end) { - *cursor = offset + size; - return (offset); - } - ss = AVL_NEXT(t, ss); - } - - /* - * If we know we've searched the whole map (*cursor == 0), give up. - * Otherwise, reset the cursor to the beginning and try again. - */ - if (*cursor == 0) - return (-1ULL); - - *cursor = 0; - return (metaslab_block_picker(t, cursor, size, align)); + avl_create(&msp->ms_size_tree, metaslab_rangesize_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_pp_node)); } +/* + * Destroy the block allocator specific components. + */ static void -metaslab_pp_load(space_map_t *sm) +metaslab_rt_destroy(range_tree_t *rt, void *arg) { - space_seg_t *ss; - - ASSERT(sm->sm_ppd == NULL); - sm->sm_ppd = kmem_zalloc(64 * sizeof (uint64_t), KM_SLEEP); + metaslab_t *msp = arg; - sm->sm_pp_root = kmem_alloc(sizeof (avl_tree_t), KM_SLEEP); - avl_create(sm->sm_pp_root, metaslab_segsize_compare, - sizeof (space_seg_t), offsetof(struct space_seg, ss_pp_node)); + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + ASSERT0(avl_numnodes(&msp->ms_size_tree)); - for (ss = avl_first(&sm->sm_root); ss; ss = AVL_NEXT(&sm->sm_root, ss)) - avl_add(sm->sm_pp_root, ss); + avl_destroy(&msp->ms_size_tree); } static void -metaslab_pp_unload(space_map_t *sm) +metaslab_rt_add(range_tree_t *rt, range_seg_t *rs, void *arg) { - void *cookie = NULL; - - kmem_free(sm->sm_ppd, 64 * sizeof (uint64_t)); - sm->sm_ppd = NULL; - - while (avl_destroy_nodes(sm->sm_pp_root, &cookie) != NULL) { - /* tear down the tree */ - } + metaslab_t *msp = arg; - avl_destroy(sm->sm_pp_root); - kmem_free(sm->sm_pp_root, sizeof (avl_tree_t)); - sm->sm_pp_root = NULL; + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + VERIFY(!msp->ms_condensing); + avl_add(&msp->ms_size_tree, rs); } -/* ARGSUSED */ static void -metaslab_pp_claim(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_rt_remove(range_tree_t *rt, range_seg_t *rs, void *arg) { - /* No need to update cursor */ + metaslab_t *msp = arg; + + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + VERIFY(!msp->ms_condensing); + avl_remove(&msp->ms_size_tree, rs); } -/* ARGSUSED */ static void -metaslab_pp_free(space_map_t *sm, uint64_t start, uint64_t size) +metaslab_rt_vacate(range_tree_t *rt, void *arg) { - /* No need to update cursor */ + metaslab_t *msp = arg; + + ASSERT3P(rt->rt_arg, ==, msp); + ASSERT3P(msp->ms_tree, ==, rt); + + /* + * Normally one would walk the tree freeing nodes along the way. + * Since the nodes are shared with the range trees we can avoid + * walking all nodes and just reinitialize the avl tree. The nodes + * will be freed by the range tree, so we don't want to free them here. + */ + avl_create(&msp->ms_size_tree, metaslab_rangesize_compare, + sizeof (range_seg_t), offsetof(range_seg_t, rs_pp_node)); } +static range_tree_ops_t metaslab_rt_ops = { + metaslab_rt_create, + metaslab_rt_destroy, + metaslab_rt_add, + metaslab_rt_remove, + metaslab_rt_vacate +}; + +/* + * ========================================================================== + * Metaslab block operations + * ========================================================================== + */ + /* * Return the maximum contiguous segment within the metaslab. */ uint64_t -metaslab_pp_maxsize(space_map_t *sm) +metaslab_block_maxsize(metaslab_t *msp) { - avl_tree_t *t = sm->sm_pp_root; - space_seg_t *ss; + avl_tree_t *t = &msp->ms_size_tree; + range_seg_t *rs; - if (t == NULL || (ss = avl_last(t)) == NULL) + if (t == NULL || (rs = avl_last(t)) == NULL) return (0ULL); - return (ss->ss_end - ss->ss_start); + return (rs->rs_end - rs->rs_start); +} + +uint64_t +metaslab_block_alloc(metaslab_t *msp, uint64_t size) +{ + uint64_t start; + range_tree_t *rt = msp->ms_tree; + + VERIFY(!msp->ms_condensing); + + start = msp->ms_ops->msop_alloc(msp, size); + if (start != -1ULL) { + vdev_t *vd = msp->ms_group->mg_vd; + + VERIFY0(P2PHASE(start, 1ULL << vd->vdev_ashift)); + VERIFY0(P2PHASE(size, 1ULL << vd->vdev_ashift)); + VERIFY3U(range_tree_space(rt) - size, <=, msp->ms_size); + range_tree_remove(rt, start, size); + } + return (start); +} + +/* + * ========================================================================== + * Common allocator routines + * ========================================================================== + */ + +/* + * This is a helper function that can be used by the allocator to find + * a suitable block to allocate. This will search the specified AVL + * tree looking for a block that matches the specified criteria. + */ +static uint64_t +metaslab_block_picker(avl_tree_t *t, uint64_t *cursor, uint64_t size, + uint64_t align) +{ + range_seg_t *rs, rsearch; + avl_index_t where; + + rsearch.rs_start = *cursor; + rsearch.rs_end = *cursor + size; + + rs = avl_find(t, &rsearch, &where); + if (rs == NULL) + rs = avl_nearest(t, where, AVL_AFTER); + + while (rs != NULL) { + uint64_t offset = P2ROUNDUP(rs->rs_start, align); + + if (offset + size <= rs->rs_end) { + *cursor = offset + size; + return (offset); + } + rs = AVL_NEXT(t, rs); + } + + /* + * If we know we've searched the whole map (*cursor == 0), give up. + * Otherwise, reset the cursor to the beginning and try again. + */ + if (*cursor == 0) + return (-1ULL); + + *cursor = 0; + return (metaslab_block_picker(t, cursor, size, align)); } /* @@ -647,29 +780,31 @@ metaslab_pp_maxsize(space_map_t *sm) * ========================================================================== */ static uint64_t -metaslab_ff_alloc(space_map_t *sm, uint64_t size) +metaslab_ff_alloc(metaslab_t *msp, uint64_t size) { - avl_tree_t *t = &sm->sm_root; + /* + * Find the largest power of 2 block size that evenly divides the + * requested size. This is used to try to allocate blocks with similar + * alignment from the same area of the metaslab (i.e. same cursor + * bucket) but it does not guarantee that other allocations sizes + * may exist in the same region. + */ uint64_t align = size & -size; - uint64_t *cursor = (uint64_t *)sm->sm_ppd + highbit(align) - 1; + uint64_t *cursor = &msp->ms_lbas[highbit(align) - 1]; + avl_tree_t *t = &msp->ms_tree->rt_root; return (metaslab_block_picker(t, cursor, size, align)); } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:27:52 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C36B3E96; Mon, 17 Feb 2014 17:27: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ADE661A27; Mon, 17 Feb 2014 17:27:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHRqcj060576; Mon, 17 Feb 2014 17:27:52 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHRq69060575; Mon, 17 Feb 2014 17:27:52 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171727.s1HHRq69060575@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:27:52 +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: r262096 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:27:52 -0000 Author: avg Date: Mon Feb 17 17:27:52 2014 New Revision: 262096 URL: http://svnweb.freebsd.org/changeset/base/262096 Log: MFC r260706: zfs_deleteextattr: name buffer from namei is needed by zfs_remove Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:12:11 2014 (r262095) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:27:52 2014 (r262096) @@ -6745,14 +6745,16 @@ vop_deleteextattr { UIO_SYSSPACE, attrname, xvp, td); error = namei(&nd); vp = nd.ni_vp; - NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) { ZFS_EXIT(zfsvfs); + NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ENOENT) error = ENOATTR; return (error); } + error = VOP_REMOVE(nd.ni_dvp, vp, &nd.ni_cnd); + NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); if (vp == nd.ni_dvp) From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:28:06 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 926F5FCC; Mon, 17 Feb 2014 17:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7DA761A2D; Mon, 17 Feb 2014 17:28:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHS68h060651; Mon, 17 Feb 2014 17:28:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHS6hJ060650; Mon, 17 Feb 2014 17:28:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171728.s1HHS6hJ060650@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:28:06 +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: r262097 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:28:06 -0000 Author: avg Date: Mon Feb 17 17:28:06 2014 New Revision: 262097 URL: http://svnweb.freebsd.org/changeset/base/262097 Log: MFC r260706: zfs_deleteextattr: name buffer from namei is needed by zfs_remove Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:27:52 2014 (r262096) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:28:06 2014 (r262097) @@ -6672,14 +6672,16 @@ vop_deleteextattr { UIO_SYSSPACE, attrname, xvp, td); error = namei(&nd); vp = nd.ni_vp; - NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) { ZFS_EXIT(zfsvfs); + NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ENOENT) error = ENOATTR; return (error); } + error = VOP_REMOVE(nd.ni_dvp, vp, &nd.ni_cnd); + NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); if (vp == nd.ni_dvp) From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:28:20 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19946178; Mon, 17 Feb 2014 17:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 02ABB1A31; Mon, 17 Feb 2014 17:28:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHSJYj060711; Mon, 17 Feb 2014 17:28:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHSJwK060710; Mon, 17 Feb 2014 17:28:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171728.s1HHSJwK060710@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:28:19 +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: r262098 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:28:20 -0000 Author: avg Date: Mon Feb 17 17:28:19 2014 New Revision: 262098 URL: http://svnweb.freebsd.org/changeset/base/262098 Log: MFC r260706: zfs_deleteextattr: name buffer from namei is needed by zfs_remove Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:28:06 2014 (r262097) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:28:19 2014 (r262098) @@ -6456,14 +6456,16 @@ vop_deleteextattr { UIO_SYSSPACE, attrname, xvp, td); error = namei(&nd); vp = nd.ni_vp; - NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) { ZFS_EXIT(zfsvfs); + NDFREE(&nd, NDF_ONLY_PNBUF); if (error == ENOENT) error = ENOATTR; return (error); } + error = VOP_REMOVE(nd.ni_dvp, vp, &nd.ni_cnd); + NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_dvp); if (vp == nd.ni_dvp) From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:42:35 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 21E9E75D; Mon, 17 Feb 2014 17:42: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0B0A81BED; Mon, 17 Feb 2014 17:42:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHgYFp067677; Mon, 17 Feb 2014 17:42:34 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHgYLI067669; Mon, 17 Feb 2014 17:42:34 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171742.s1HHgYLI067669@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:42:34 +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: r262099 - in stable/8/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common lib/libzpool/common lib/libzpool/common/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:42:35 -0000 Author: avg Date: Mon Feb 17 17:42:33 2014 New Revision: 262099 URL: http://svnweb.freebsd.org/changeset/base/262099 Log: MFC r254591,255753: Enhance the ZFS vdev layer to maintain both a logical and a physical minimum allocation size for devices Missed userland bits. Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c stable/8/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Feb 17 17:28:19 2014 (r262098) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Feb 17 17:42:33 2014 (r262099) @@ -1304,12 +1304,13 @@ print_status_config(zpool_handle_t *zhp, int namewidth, int depth, boolean_t isspare) { nvlist_t **child; - uint_t c, children; + uint_t c, vsc, children; pool_scan_stat_t *ps = NULL; vdev_stat_t *vs; char rbuf[6], wbuf[6], cbuf[6]; char *vname; uint64_t notpresent; + uint64_t ashift; spare_cbdata_t cb; const char *state; @@ -1318,7 +1319,7 @@ print_status_config(zpool_handle_t *zhp, children = 0; verify(nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, - (uint64_t **)&vs, &c) == 0); + (uint64_t **)&vs, &vsc) == 0); state = zpool_state_to_name(vs->vs_state, vs->vs_aux); if (isspare) { @@ -1372,6 +1373,10 @@ print_status_config(zpool_handle_t *zhp, (void) printf(gettext("unsupported feature(s)")); break; + case VDEV_AUX_ASHIFT_TOO_BIG: + (void) printf(gettext("unsupported minimum blocksize")); + break; + case VDEV_AUX_SPARED: verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID, &cb.cb_guid) == 0); @@ -1414,6 +1419,12 @@ print_status_config(zpool_handle_t *zhp, (void) printf(gettext("corrupted data")); break; } + } else if (children == 0 && !isspare && + VDEV_STAT_VALID(vs_physical_ashift, vsc) && + vs->vs_configured_ashift < vs->vs_physical_ashift) { + (void) printf( + gettext(" block size: %dB configured, %dB native"), + 1 << vs->vs_configured_ashift, 1 << vs->vs_physical_ashift); } (void) nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_SCAN_STATS, @@ -4277,6 +4288,15 @@ status_callback(zpool_handle_t *zhp, voi "'zpool clear'.\n")); break; + case ZPOOL_STATUS_NON_NATIVE_ASHIFT: + (void) printf(gettext("status: One or more devices are " + "configured to use a non-native block size.\n" + "\tExpect reduced performance.\n")); + (void) printf(gettext("action: Replace affected devices with " + "devices that support the\n\tconfigured block size, or " + "migrate data to a properly configured\n\tpool.\n")); + break; + default: /* * The remaining errors can't actually be generated, yet. Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Feb 17 17:28:19 2014 (r262098) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Feb 17 17:42:33 2014 (r262099) @@ -326,6 +326,7 @@ typedef enum { ZPOOL_STATUS_RESILVERING, /* device being resilvered */ ZPOOL_STATUS_OFFLINE_DEV, /* device online */ ZPOOL_STATUS_REMOVED_DEV, /* removed device */ + ZPOOL_STATUS_NON_NATIVE_ASHIFT, /* (e.g. 512e dev with ashift of 9) */ /* * Finally, the following indicates a healthy pool. Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Mon Feb 17 17:28:19 2014 (r262098) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Mon Feb 17 17:42:33 2014 (r262099) @@ -73,57 +73,66 @@ static char *zfs_msgid_table[] = { /* ARGSUSED */ static int -vdev_missing(uint64_t state, uint64_t aux, uint64_t errs) +vdev_missing(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_CANT_OPEN && - aux == VDEV_AUX_OPEN_FAILED); + return (vs->vs_state == VDEV_STATE_CANT_OPEN && + vs->vs_aux == VDEV_AUX_OPEN_FAILED); } /* ARGSUSED */ static int -vdev_faulted(uint64_t state, uint64_t aux, uint64_t errs) +vdev_faulted(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_FAULTED); + return (vs->vs_state == VDEV_STATE_FAULTED); } /* ARGSUSED */ static int -vdev_errors(uint64_t state, uint64_t aux, uint64_t errs) +vdev_errors(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_DEGRADED || errs != 0); + return (vs->vs_state == VDEV_STATE_DEGRADED || + vs->vs_read_errors != 0 || vs->vs_write_errors != 0 || + vs->vs_checksum_errors != 0); } /* ARGSUSED */ static int -vdev_broken(uint64_t state, uint64_t aux, uint64_t errs) +vdev_broken(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_CANT_OPEN); + return (vs->vs_state == VDEV_STATE_CANT_OPEN); } /* ARGSUSED */ static int -vdev_offlined(uint64_t state, uint64_t aux, uint64_t errs) +vdev_offlined(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_OFFLINE); + return (vs->vs_state == VDEV_STATE_OFFLINE); } /* ARGSUSED */ static int -vdev_removed(uint64_t state, uint64_t aux, uint64_t errs) +vdev_removed(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_REMOVED); + return (vs->vs_state == VDEV_STATE_REMOVED); +} + +static int +vdev_non_native_ashift(vdev_stat_t *vs, uint_t vsc) +{ + return (VDEV_STAT_VALID(vs_physical_ashift, vsc) && + vs->vs_configured_ashift < vs->vs_physical_ashift); } /* * Detect if any leaf devices that have seen errors or could not be opened. */ static boolean_t -find_vdev_problem(nvlist_t *vdev, int (*func)(uint64_t, uint64_t, uint64_t)) +find_vdev_problem(nvlist_t *vdev, int (*func)(vdev_stat_t *, uint_t), + boolean_t ignore_replacing) { nvlist_t **child; vdev_stat_t *vs; - uint_t c, children; - char *type; + uint_t c, vsc, children; /* * Ignore problems within a 'replacing' vdev, since we're presumably in @@ -131,23 +140,25 @@ find_vdev_problem(nvlist_t *vdev, int (* * out again. We'll pick up the fact that a resilver is happening * later. */ - verify(nvlist_lookup_string(vdev, ZPOOL_CONFIG_TYPE, &type) == 0); - if (strcmp(type, VDEV_TYPE_REPLACING) == 0) - return (B_FALSE); + if (ignore_replacing == B_TRUE) { + char *type; + + verify(nvlist_lookup_string(vdev, ZPOOL_CONFIG_TYPE, + &type) == 0); + if (strcmp(type, VDEV_TYPE_REPLACING) == 0) + return (B_FALSE); + } if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_CHILDREN, &child, &children) == 0) { for (c = 0; c < children; c++) - if (find_vdev_problem(child[c], func)) + if (find_vdev_problem(child[c], func, ignore_replacing)) return (B_TRUE); } else { verify(nvlist_lookup_uint64_array(vdev, ZPOOL_CONFIG_VDEV_STATS, - (uint64_t **)&vs, &c) == 0); + (uint64_t **)&vs, &vsc) == 0); - if (func(vs->vs_state, vs->vs_aux, - vs->vs_read_errors + - vs->vs_write_errors + - vs->vs_checksum_errors)) + if (func(vs, vsc) != 0) return (B_TRUE); } @@ -157,7 +168,7 @@ find_vdev_problem(nvlist_t *vdev, int (* if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_L2CACHE, &child, &children) == 0) { for (c = 0; c < children; c++) - if (find_vdev_problem(child[c], func)) + if (find_vdev_problem(child[c], func, ignore_replacing)) return (B_TRUE); } @@ -270,15 +281,15 @@ check_status(nvlist_t *config, boolean_t * Bad devices in non-replicated config. */ if (vs->vs_state == VDEV_STATE_CANT_OPEN && - find_vdev_problem(nvroot, vdev_faulted)) + find_vdev_problem(nvroot, vdev_faulted, B_TRUE)) return (ZPOOL_STATUS_FAULTED_DEV_NR); if (vs->vs_state == VDEV_STATE_CANT_OPEN && - find_vdev_problem(nvroot, vdev_missing)) + find_vdev_problem(nvroot, vdev_missing, B_TRUE)) return (ZPOOL_STATUS_MISSING_DEV_NR); if (vs->vs_state == VDEV_STATE_CANT_OPEN && - find_vdev_problem(nvroot, vdev_broken)) + find_vdev_problem(nvroot, vdev_broken, B_TRUE)) return (ZPOOL_STATUS_CORRUPT_LABEL_NR); /* @@ -300,32 +311,38 @@ check_status(nvlist_t *config, boolean_t /* * Missing devices in a replicated config. */ - if (find_vdev_problem(nvroot, vdev_faulted)) + if (find_vdev_problem(nvroot, vdev_faulted, B_TRUE)) return (ZPOOL_STATUS_FAULTED_DEV_R); - if (find_vdev_problem(nvroot, vdev_missing)) + if (find_vdev_problem(nvroot, vdev_missing, B_TRUE)) return (ZPOOL_STATUS_MISSING_DEV_R); - if (find_vdev_problem(nvroot, vdev_broken)) + if (find_vdev_problem(nvroot, vdev_broken, B_TRUE)) return (ZPOOL_STATUS_CORRUPT_LABEL_R); /* * Devices with errors */ - if (!isimport && find_vdev_problem(nvroot, vdev_errors)) + if (!isimport && find_vdev_problem(nvroot, vdev_errors, B_TRUE)) return (ZPOOL_STATUS_FAILING_DEV); /* * Offlined devices */ - if (find_vdev_problem(nvroot, vdev_offlined)) + if (find_vdev_problem(nvroot, vdev_offlined, B_TRUE)) return (ZPOOL_STATUS_OFFLINE_DEV); /* * Removed device */ - if (find_vdev_problem(nvroot, vdev_removed)) + if (find_vdev_problem(nvroot, vdev_removed, B_TRUE)) return (ZPOOL_STATUS_REMOVED_DEV); /* + * Suboptimal, but usable, ashift configuration. + */ + if (find_vdev_problem(nvroot, vdev_non_native_ashift, B_FALSE)) + return (ZPOOL_STATUS_NON_NATIVE_ASHIFT); + + /* * Outdated, but usable, version */ if (SPA_VERSION_IS_SUPPORTED(version) && version != SPA_VERSION) Modified: stable/8/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Mon Feb 17 17:28:19 2014 (r262098) +++ stable/8/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Mon Feb 17 17:42:33 2014 (r262099) @@ -623,6 +623,12 @@ dprintf_setup(int *argc, char **argv) dprintf_print_all = 1; } +int +sysctl_handle_64(SYSCTL_HANDLER_ARGS) +{ + return (0); +} + /* * ========================================================================= * debug printfs Modified: stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Mon Feb 17 17:28:19 2014 (r262098) +++ stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Mon Feb 17 17:42:33 2014 (r262099) @@ -684,11 +684,55 @@ typedef uint32_t idmap_rid_t; #define SX_SYSINIT(name, lock, desc) +#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, \ + intptr_t arg2, struct sysctl_req *req + +/* + * This describes the access space for a sysctl request. This is needed + * so that we can use the interface from the kernel or from user-space. + */ +struct sysctl_req { + struct thread *td; /* used for access checking */ + int lock; /* wiring state */ + void *oldptr; + size_t oldlen; + size_t oldidx; + int (*oldfunc)(struct sysctl_req *, const void *, size_t); + void *newptr; + size_t newlen; + size_t newidx; + int (*newfunc)(struct sysctl_req *, void *, size_t); + size_t validlen; + int flags; +}; + +SLIST_HEAD(sysctl_oid_list, sysctl_oid); + +/* + * This describes one "oid" in the MIB tree. Potentially more nodes can + * be hidden behind it, expanded by the handler. + */ +struct sysctl_oid { + struct sysctl_oid_list *oid_parent; + SLIST_ENTRY(sysctl_oid) oid_link; + int oid_number; + u_int oid_kind; + void *oid_arg1; + intptr_t oid_arg2; + const char *oid_name; + int (*oid_handler)(SYSCTL_HANDLER_ARGS); + const char *oid_fmt; + int oid_refcnt; + u_int oid_running; + const char *oid_descr; +}; + #define SYSCTL_DECL(...) #define SYSCTL_NODE(...) #define SYSCTL_INT(...) #define SYSCTL_UINT(...) #define SYSCTL_ULONG(...) +#define SYSCTL_PROC(...) #define SYSCTL_QUAD(...) #ifdef TUNABLE_INT #undef TUNABLE_INT @@ -699,6 +743,8 @@ typedef uint32_t idmap_rid_t; #define TUNABLE_ULONG(...) #define TUNABLE_QUAD(...) +int sysctl_handle_64(SYSCTL_HANDLER_ARGS); + /* Errors */ #ifndef ERESTART From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:43:15 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19A4889A; Mon, 17 Feb 2014 17:43: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 02CCE1BFA; Mon, 17 Feb 2014 17:43:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHhErM067883; Mon, 17 Feb 2014 17:43:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHhDtZ067878; Mon, 17 Feb 2014 17:43:13 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171743.s1HHhDtZ067878@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:43:13 +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: r262100 - in stable/9/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/common lib/libzpool/common lib/libzpool/common/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:43:15 -0000 Author: avg Date: Mon Feb 17 17:43:13 2014 New Revision: 262100 URL: http://svnweb.freebsd.org/changeset/base/262100 Log: MFC r254591,255753: Enhance the ZFS vdev layer to maintain both a logical and a physical minimum allocation size for devices Missed userland bits. Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c stable/9/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Feb 17 17:42:33 2014 (r262099) +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Mon Feb 17 17:43:13 2014 (r262100) @@ -1294,12 +1294,13 @@ print_status_config(zpool_handle_t *zhp, int namewidth, int depth, boolean_t isspare) { nvlist_t **child; - uint_t c, children; + uint_t c, vsc, children; pool_scan_stat_t *ps = NULL; vdev_stat_t *vs; char rbuf[6], wbuf[6], cbuf[6]; char *vname; uint64_t notpresent; + uint64_t ashift; spare_cbdata_t cb; const char *state; @@ -1308,7 +1309,7 @@ print_status_config(zpool_handle_t *zhp, children = 0; verify(nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS, - (uint64_t **)&vs, &c) == 0); + (uint64_t **)&vs, &vsc) == 0); state = zpool_state_to_name(vs->vs_state, vs->vs_aux); if (isspare) { @@ -1362,6 +1363,10 @@ print_status_config(zpool_handle_t *zhp, (void) printf(gettext("unsupported feature(s)")); break; + case VDEV_AUX_ASHIFT_TOO_BIG: + (void) printf(gettext("unsupported minimum blocksize")); + break; + case VDEV_AUX_SPARED: verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID, &cb.cb_guid) == 0); @@ -1404,6 +1409,12 @@ print_status_config(zpool_handle_t *zhp, (void) printf(gettext("corrupted data")); break; } + } else if (children == 0 && !isspare && + VDEV_STAT_VALID(vs_physical_ashift, vsc) && + vs->vs_configured_ashift < vs->vs_physical_ashift) { + (void) printf( + gettext(" block size: %dB configured, %dB native"), + 1 << vs->vs_configured_ashift, 1 << vs->vs_physical_ashift); } (void) nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_SCAN_STATS, @@ -4267,6 +4278,15 @@ status_callback(zpool_handle_t *zhp, voi "'zpool clear'.\n")); break; + case ZPOOL_STATUS_NON_NATIVE_ASHIFT: + (void) printf(gettext("status: One or more devices are " + "configured to use a non-native block size.\n" + "\tExpect reduced performance.\n")); + (void) printf(gettext("action: Replace affected devices with " + "devices that support the\n\tconfigured block size, or " + "migrate data to a properly configured\n\tpool.\n")); + break; + default: /* * The remaining errors can't actually be generated, yet. Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Feb 17 17:42:33 2014 (r262099) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Mon Feb 17 17:43:13 2014 (r262100) @@ -326,6 +326,7 @@ typedef enum { ZPOOL_STATUS_RESILVERING, /* device being resilvered */ ZPOOL_STATUS_OFFLINE_DEV, /* device online */ ZPOOL_STATUS_REMOVED_DEV, /* removed device */ + ZPOOL_STATUS_NON_NATIVE_ASHIFT, /* (e.g. 512e dev with ashift of 9) */ /* * Finally, the following indicates a healthy pool. Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Mon Feb 17 17:42:33 2014 (r262099) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Mon Feb 17 17:43:13 2014 (r262100) @@ -73,57 +73,66 @@ static char *zfs_msgid_table[] = { /* ARGSUSED */ static int -vdev_missing(uint64_t state, uint64_t aux, uint64_t errs) +vdev_missing(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_CANT_OPEN && - aux == VDEV_AUX_OPEN_FAILED); + return (vs->vs_state == VDEV_STATE_CANT_OPEN && + vs->vs_aux == VDEV_AUX_OPEN_FAILED); } /* ARGSUSED */ static int -vdev_faulted(uint64_t state, uint64_t aux, uint64_t errs) +vdev_faulted(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_FAULTED); + return (vs->vs_state == VDEV_STATE_FAULTED); } /* ARGSUSED */ static int -vdev_errors(uint64_t state, uint64_t aux, uint64_t errs) +vdev_errors(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_DEGRADED || errs != 0); + return (vs->vs_state == VDEV_STATE_DEGRADED || + vs->vs_read_errors != 0 || vs->vs_write_errors != 0 || + vs->vs_checksum_errors != 0); } /* ARGSUSED */ static int -vdev_broken(uint64_t state, uint64_t aux, uint64_t errs) +vdev_broken(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_CANT_OPEN); + return (vs->vs_state == VDEV_STATE_CANT_OPEN); } /* ARGSUSED */ static int -vdev_offlined(uint64_t state, uint64_t aux, uint64_t errs) +vdev_offlined(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_OFFLINE); + return (vs->vs_state == VDEV_STATE_OFFLINE); } /* ARGSUSED */ static int -vdev_removed(uint64_t state, uint64_t aux, uint64_t errs) +vdev_removed(vdev_stat_t *vs, uint_t vsc) { - return (state == VDEV_STATE_REMOVED); + return (vs->vs_state == VDEV_STATE_REMOVED); +} + +static int +vdev_non_native_ashift(vdev_stat_t *vs, uint_t vsc) +{ + return (VDEV_STAT_VALID(vs_physical_ashift, vsc) && + vs->vs_configured_ashift < vs->vs_physical_ashift); } /* * Detect if any leaf devices that have seen errors or could not be opened. */ static boolean_t -find_vdev_problem(nvlist_t *vdev, int (*func)(uint64_t, uint64_t, uint64_t)) +find_vdev_problem(nvlist_t *vdev, int (*func)(vdev_stat_t *, uint_t), + boolean_t ignore_replacing) { nvlist_t **child; vdev_stat_t *vs; - uint_t c, children; - char *type; + uint_t c, vsc, children; /* * Ignore problems within a 'replacing' vdev, since we're presumably in @@ -131,23 +140,25 @@ find_vdev_problem(nvlist_t *vdev, int (* * out again. We'll pick up the fact that a resilver is happening * later. */ - verify(nvlist_lookup_string(vdev, ZPOOL_CONFIG_TYPE, &type) == 0); - if (strcmp(type, VDEV_TYPE_REPLACING) == 0) - return (B_FALSE); + if (ignore_replacing == B_TRUE) { + char *type; + + verify(nvlist_lookup_string(vdev, ZPOOL_CONFIG_TYPE, + &type) == 0); + if (strcmp(type, VDEV_TYPE_REPLACING) == 0) + return (B_FALSE); + } if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_CHILDREN, &child, &children) == 0) { for (c = 0; c < children; c++) - if (find_vdev_problem(child[c], func)) + if (find_vdev_problem(child[c], func, ignore_replacing)) return (B_TRUE); } else { verify(nvlist_lookup_uint64_array(vdev, ZPOOL_CONFIG_VDEV_STATS, - (uint64_t **)&vs, &c) == 0); + (uint64_t **)&vs, &vsc) == 0); - if (func(vs->vs_state, vs->vs_aux, - vs->vs_read_errors + - vs->vs_write_errors + - vs->vs_checksum_errors)) + if (func(vs, vsc) != 0) return (B_TRUE); } @@ -157,7 +168,7 @@ find_vdev_problem(nvlist_t *vdev, int (* if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_L2CACHE, &child, &children) == 0) { for (c = 0; c < children; c++) - if (find_vdev_problem(child[c], func)) + if (find_vdev_problem(child[c], func, ignore_replacing)) return (B_TRUE); } @@ -270,15 +281,15 @@ check_status(nvlist_t *config, boolean_t * Bad devices in non-replicated config. */ if (vs->vs_state == VDEV_STATE_CANT_OPEN && - find_vdev_problem(nvroot, vdev_faulted)) + find_vdev_problem(nvroot, vdev_faulted, B_TRUE)) return (ZPOOL_STATUS_FAULTED_DEV_NR); if (vs->vs_state == VDEV_STATE_CANT_OPEN && - find_vdev_problem(nvroot, vdev_missing)) + find_vdev_problem(nvroot, vdev_missing, B_TRUE)) return (ZPOOL_STATUS_MISSING_DEV_NR); if (vs->vs_state == VDEV_STATE_CANT_OPEN && - find_vdev_problem(nvroot, vdev_broken)) + find_vdev_problem(nvroot, vdev_broken, B_TRUE)) return (ZPOOL_STATUS_CORRUPT_LABEL_NR); /* @@ -300,32 +311,38 @@ check_status(nvlist_t *config, boolean_t /* * Missing devices in a replicated config. */ - if (find_vdev_problem(nvroot, vdev_faulted)) + if (find_vdev_problem(nvroot, vdev_faulted, B_TRUE)) return (ZPOOL_STATUS_FAULTED_DEV_R); - if (find_vdev_problem(nvroot, vdev_missing)) + if (find_vdev_problem(nvroot, vdev_missing, B_TRUE)) return (ZPOOL_STATUS_MISSING_DEV_R); - if (find_vdev_problem(nvroot, vdev_broken)) + if (find_vdev_problem(nvroot, vdev_broken, B_TRUE)) return (ZPOOL_STATUS_CORRUPT_LABEL_R); /* * Devices with errors */ - if (!isimport && find_vdev_problem(nvroot, vdev_errors)) + if (!isimport && find_vdev_problem(nvroot, vdev_errors, B_TRUE)) return (ZPOOL_STATUS_FAILING_DEV); /* * Offlined devices */ - if (find_vdev_problem(nvroot, vdev_offlined)) + if (find_vdev_problem(nvroot, vdev_offlined, B_TRUE)) return (ZPOOL_STATUS_OFFLINE_DEV); /* * Removed device */ - if (find_vdev_problem(nvroot, vdev_removed)) + if (find_vdev_problem(nvroot, vdev_removed, B_TRUE)) return (ZPOOL_STATUS_REMOVED_DEV); /* + * Suboptimal, but usable, ashift configuration. + */ + if (find_vdev_problem(nvroot, vdev_non_native_ashift, B_FALSE)) + return (ZPOOL_STATUS_NON_NATIVE_ASHIFT); + + /* * Outdated, but usable, version */ if (SPA_VERSION_IS_SUPPORTED(version) && version != SPA_VERSION) Modified: stable/9/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Mon Feb 17 17:42:33 2014 (r262099) +++ stable/9/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c Mon Feb 17 17:43:13 2014 (r262100) @@ -626,6 +626,12 @@ dprintf_setup(int *argc, char **argv) dprintf_print_all = 1; } +int +sysctl_handle_64(SYSCTL_HANDLER_ARGS) +{ + return (0); +} + /* * ========================================================================= * debug printfs Modified: stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Mon Feb 17 17:42:33 2014 (r262099) +++ stable/9/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h Mon Feb 17 17:43:13 2014 (r262100) @@ -688,11 +688,55 @@ typedef uint32_t idmap_rid_t; #define SX_SYSINIT(name, lock, desc) +#define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, \ + intptr_t arg2, struct sysctl_req *req + +/* + * This describes the access space for a sysctl request. This is needed + * so that we can use the interface from the kernel or from user-space. + */ +struct sysctl_req { + struct thread *td; /* used for access checking */ + int lock; /* wiring state */ + void *oldptr; + size_t oldlen; + size_t oldidx; + int (*oldfunc)(struct sysctl_req *, const void *, size_t); + void *newptr; + size_t newlen; + size_t newidx; + int (*newfunc)(struct sysctl_req *, void *, size_t); + size_t validlen; + int flags; +}; + +SLIST_HEAD(sysctl_oid_list, sysctl_oid); + +/* + * This describes one "oid" in the MIB tree. Potentially more nodes can + * be hidden behind it, expanded by the handler. + */ +struct sysctl_oid { + struct sysctl_oid_list *oid_parent; + SLIST_ENTRY(sysctl_oid) oid_link; + int oid_number; + u_int oid_kind; + void *oid_arg1; + intptr_t oid_arg2; + const char *oid_name; + int (*oid_handler)(SYSCTL_HANDLER_ARGS); + const char *oid_fmt; + int oid_refcnt; + u_int oid_running; + const char *oid_descr; +}; + #define SYSCTL_DECL(...) #define SYSCTL_NODE(...) #define SYSCTL_INT(...) #define SYSCTL_UINT(...) #define SYSCTL_ULONG(...) +#define SYSCTL_PROC(...) #define SYSCTL_QUAD(...) #define SYSCTL_UQUAD(...) #ifdef TUNABLE_INT @@ -704,6 +748,8 @@ typedef uint32_t idmap_rid_t; #define TUNABLE_ULONG(...) #define TUNABLE_QUAD(...) +int sysctl_handle_64(SYSCTL_HANDLER_ARGS); + /* Errors */ #ifndef ERESTART From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:46:16 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8B0CFAEE; Mon, 17 Feb 2014 17: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 757911C24; Mon, 17 Feb 2014 17:46:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHkGIb068717; Mon, 17 Feb 2014 17:46:16 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHkGuJ068715; Mon, 17 Feb 2014 17:46:16 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171746.s1HHkGuJ068715@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:46: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: r262101 - in stable/10/cddl: contrib/opensolaris/cmd/zinject usr.bin/zinject X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:46:16 -0000 Author: avg Date: Mon Feb 17 17:46:15 2014 New Revision: 262101 URL: http://svnweb.freebsd.org/changeset/base/262101 Log: MFC r260703: zinject must use ioctl(2) compatibility wrapper Modified: stable/10/cddl/contrib/opensolaris/cmd/zinject/zinject.c stable/10/cddl/usr.bin/zinject/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/cddl/contrib/opensolaris/cmd/zinject/zinject.c ============================================================================== --- stable/10/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Feb 17 17:43:13 2014 (r262100) +++ stable/10/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Feb 17 17:46:15 2014 (r262101) @@ -148,6 +148,7 @@ #include #include +#include #undef verify /* both libzfs.h and zfs_context.h want to define this */ Modified: stable/10/cddl/usr.bin/zinject/Makefile ============================================================================== --- stable/10/cddl/usr.bin/zinject/Makefile Mon Feb 17 17:43:13 2014 (r262100) +++ stable/10/cddl/usr.bin/zinject/Makefile Mon Feb 17 17:46:15 2014 (r262101) @@ -16,6 +16,7 @@ CFLAGS+= -I${.CURDIR}/../../contrib/open CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs/ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:46:26 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 03600C15; Mon, 17 Feb 2014 17:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E3B141C28; Mon, 17 Feb 2014 17:46:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHkPLk068783; Mon, 17 Feb 2014 17:46:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHkP4J068782; Mon, 17 Feb 2014 17:46:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171746.s1HHkP4J068782@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:46: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: r262102 - stable/9/cddl/contrib/opensolaris/cmd/zinject X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:46:26 -0000 Author: avg Date: Mon Feb 17 17:46:25 2014 New Revision: 262102 URL: http://svnweb.freebsd.org/changeset/base/262102 Log: MFC r260703: zinject must use ioctl(2) compatibility wrapper Modified: stable/9/cddl/contrib/opensolaris/cmd/zinject/zinject.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zinject/zinject.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Feb 17 17:46:15 2014 (r262101) +++ stable/9/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Feb 17 17:46:25 2014 (r262102) @@ -148,6 +148,7 @@ #include #include +#include #undef verify /* both libzfs.h and zfs_context.h want to define this */ From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:46:33 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D4D82D49; Mon, 17 Feb 2014 17:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C0F931C2A; Mon, 17 Feb 2014 17:46:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHkX4r068847; Mon, 17 Feb 2014 17:46:33 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHkXdn068846; Mon, 17 Feb 2014 17:46:33 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171746.s1HHkXdn068846@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:46:33 +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: r262103 - stable/8/cddl/contrib/opensolaris/cmd/zinject X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:46:33 -0000 Author: avg Date: Mon Feb 17 17:46:33 2014 New Revision: 262103 URL: http://svnweb.freebsd.org/changeset/base/262103 Log: MFC r260703: zinject must use ioctl(2) compatibility wrapper Modified: stable/8/cddl/contrib/opensolaris/cmd/zinject/zinject.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zinject/zinject.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Feb 17 17:46:25 2014 (r262102) +++ stable/8/cddl/contrib/opensolaris/cmd/zinject/zinject.c Mon Feb 17 17:46:33 2014 (r262103) @@ -147,6 +147,7 @@ #include #include +#include #undef verify /* both libzfs.h and zfs_context.h want to define this */ From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:48:38 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA577EA2; Mon, 17 Feb 2014 17:48: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5E101C3E; Mon, 17 Feb 2014 17:48:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHmctG069312; Mon, 17 Feb 2014 17:48:38 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHmcQv069311; Mon, 17 Feb 2014 17:48:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171748.s1HHmcQv069311@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:48:38 +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: r262104 - stable/10/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:48:39 -0000 Author: avg Date: Mon Feb 17 17:48:38 2014 New Revision: 262104 URL: http://svnweb.freebsd.org/changeset/base/262104 Log: MFC r260811: zdb -R: do not treat numeric parameters to a flag as more flags Modified: stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.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 Mon Feb 17 17:46:33 2014 (r262103) +++ stable/10/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:48:38 2014 (r262104) @@ -2960,6 +2960,7 @@ zdb_read_block(char *thing, spa_t *spa) free(dup); return; } + i += p - &flagstr[i + 1]; /* skip over the number */ } } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:48:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 56BBBFD5; Mon, 17 Feb 2014 17:48: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 424191C43; Mon, 17 Feb 2014 17:48:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHmpMF069386; Mon, 17 Feb 2014 17:48:51 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHmp6a069385; Mon, 17 Feb 2014 17:48:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171748.s1HHmp6a069385@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:48: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: r262105 - stable/9/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:48:51 -0000 Author: avg Date: Mon Feb 17 17:48:50 2014 New Revision: 262105 URL: http://svnweb.freebsd.org/changeset/base/262105 Log: MFC r260811: zdb -R: do not treat numeric parameters to a flag as more flags Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:48:38 2014 (r262104) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:48:50 2014 (r262105) @@ -2960,6 +2960,7 @@ zdb_read_block(char *thing, spa_t *spa) free(dup); return; } + i += p - &flagstr[i + 1]; /* skip over the number */ } } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:49:04 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 657AA17E; Mon, 17 Feb 2014 17:49: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 514201C47; Mon, 17 Feb 2014 17:49:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHn43K069485; Mon, 17 Feb 2014 17:49:04 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHn4KQ069484; Mon, 17 Feb 2014 17:49:04 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171749.s1HHn4KQ069484@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:49:04 +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: r262106 - stable/8/cddl/contrib/opensolaris/cmd/zdb X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:49:04 -0000 Author: avg Date: Mon Feb 17 17:49:03 2014 New Revision: 262106 URL: http://svnweb.freebsd.org/changeset/base/262106 Log: MFC r260811: zdb -R: do not treat numeric parameters to a flag as more flags Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:48:50 2014 (r262105) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Feb 17 17:49:03 2014 (r262106) @@ -2960,6 +2960,7 @@ zdb_read_block(char *thing, spa_t *spa) free(dup); return; } + i += p - &flagstr[i + 1]; /* skip over the number */ } } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:51:50 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AC521533; Mon, 17 Feb 2014 17:51: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9682F1CE3; Mon, 17 Feb 2014 17:51:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHpoUF072791; Mon, 17 Feb 2014 17:51:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHpo2o072790; Mon, 17 Feb 2014 17:51:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171751.s1HHpo2o072790@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:51:50 +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: r262107 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:51:50 -0000 Author: avg Date: Mon Feb 17 17:51:50 2014 New Revision: 262107 URL: http://svnweb.freebsd.org/changeset/base/262107 Log: MFC r260812: traverse_visitbp: visit DMU_GROUPUSED_OBJECT before DMU_USERUSED_OBJECT Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Directory Properties: stable/10/ (props changed) 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 Mon Feb 17 17:49:03 2014 (r262106) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 17:51:50 2014 (r262107) @@ -329,9 +329,9 @@ traverse_visitbp(traverse_data_t *td, co prefetch_dnode_metadata(td, dnp, zb->zb_objset, DMU_META_DNODE_OBJECT); if (arc_buf_size(buf) >= sizeof (objset_phys_t)) { - prefetch_dnode_metadata(td, &osp->os_userused_dnode, - zb->zb_objset, DMU_USERUSED_OBJECT); prefetch_dnode_metadata(td, &osp->os_groupused_dnode, + zb->zb_objset, DMU_GROUPUSED_OBJECT); + prefetch_dnode_metadata(td, &osp->os_userused_dnode, zb->zb_objset, DMU_USERUSED_OBJECT); } @@ -342,18 +342,18 @@ traverse_visitbp(traverse_data_t *td, co err = 0; } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { - dnp = &osp->os_userused_dnode; + dnp = &osp->os_groupused_dnode; err = traverse_dnode(td, dnp, zb->zb_objset, - DMU_USERUSED_OBJECT); + DMU_GROUPUSED_OBJECT); } if (err && hard) { lasterr = err; err = 0; } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { - dnp = &osp->os_groupused_dnode; + dnp = &osp->os_userused_dnode; err = traverse_dnode(td, dnp, zb->zb_objset, - DMU_GROUPUSED_OBJECT); + DMU_USERUSED_OBJECT); } } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:52:00 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5C571661; Mon, 17 Feb 2014 17:52: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 47C0B1CE4; Mon, 17 Feb 2014 17:52:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHq0sb072866; Mon, 17 Feb 2014 17:52:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHq0xR072865; Mon, 17 Feb 2014 17:52:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171752.s1HHq0xR072865@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:52:00 +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: r262108 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:52:00 -0000 Author: avg Date: Mon Feb 17 17:51:59 2014 New Revision: 262108 URL: http://svnweb.freebsd.org/changeset/base/262108 Log: MFC r260812: traverse_visitbp: visit DMU_GROUPUSED_OBJECT before DMU_USERUSED_OBJECT Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 17:51:50 2014 (r262107) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 17:51:59 2014 (r262108) @@ -329,9 +329,9 @@ traverse_visitbp(traverse_data_t *td, co prefetch_dnode_metadata(td, dnp, zb->zb_objset, DMU_META_DNODE_OBJECT); if (arc_buf_size(buf) >= sizeof (objset_phys_t)) { - prefetch_dnode_metadata(td, &osp->os_userused_dnode, - zb->zb_objset, DMU_USERUSED_OBJECT); prefetch_dnode_metadata(td, &osp->os_groupused_dnode, + zb->zb_objset, DMU_GROUPUSED_OBJECT); + prefetch_dnode_metadata(td, &osp->os_userused_dnode, zb->zb_objset, DMU_USERUSED_OBJECT); } @@ -342,18 +342,18 @@ traverse_visitbp(traverse_data_t *td, co err = 0; } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { - dnp = &osp->os_userused_dnode; + dnp = &osp->os_groupused_dnode; err = traverse_dnode(td, dnp, zb->zb_objset, - DMU_USERUSED_OBJECT); + DMU_GROUPUSED_OBJECT); } if (err && hard) { lasterr = err; err = 0; } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { - dnp = &osp->os_groupused_dnode; + dnp = &osp->os_userused_dnode; err = traverse_dnode(td, dnp, zb->zb_objset, - DMU_GROUPUSED_OBJECT); + DMU_USERUSED_OBJECT); } } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:52:15 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4B6358AE; Mon, 17 Feb 2014 17:52: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E92A1CF6; Mon, 17 Feb 2014 17:52:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHqEuV072975; Mon, 17 Feb 2014 17:52:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHqE8S072974; Mon, 17 Feb 2014 17:52:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171752.s1HHqE8S072974@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:52:14 +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: r262109 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:52:15 -0000 Author: avg Date: Mon Feb 17 17:52:14 2014 New Revision: 262109 URL: http://svnweb.freebsd.org/changeset/base/262109 Log: MFC r260812: traverse_visitbp: visit DMU_GROUPUSED_OBJECT before DMU_USERUSED_OBJECT Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 17:51:59 2014 (r262108) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 17:52:14 2014 (r262109) @@ -329,9 +329,9 @@ traverse_visitbp(traverse_data_t *td, co prefetch_dnode_metadata(td, dnp, zb->zb_objset, DMU_META_DNODE_OBJECT); if (arc_buf_size(buf) >= sizeof (objset_phys_t)) { - prefetch_dnode_metadata(td, &osp->os_userused_dnode, - zb->zb_objset, DMU_USERUSED_OBJECT); prefetch_dnode_metadata(td, &osp->os_groupused_dnode, + zb->zb_objset, DMU_GROUPUSED_OBJECT); + prefetch_dnode_metadata(td, &osp->os_userused_dnode, zb->zb_objset, DMU_USERUSED_OBJECT); } @@ -342,18 +342,18 @@ traverse_visitbp(traverse_data_t *td, co err = 0; } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { - dnp = &osp->os_userused_dnode; + dnp = &osp->os_groupused_dnode; err = traverse_dnode(td, dnp, zb->zb_objset, - DMU_USERUSED_OBJECT); + DMU_GROUPUSED_OBJECT); } if (err && hard) { lasterr = err; err = 0; } if (err == 0 && arc_buf_size(buf) >= sizeof (objset_phys_t)) { - dnp = &osp->os_groupused_dnode; + dnp = &osp->os_userused_dnode; err = traverse_dnode(td, dnp, zb->zb_objset, - DMU_GROUPUSED_OBJECT); + DMU_USERUSED_OBJECT); } } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 17:59:52 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93789691; Mon, 17 Feb 2014 17:59: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 711391DFC; Mon, 17 Feb 2014 17:59:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HHxqBJ074285; Mon, 17 Feb 2014 17:59:52 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HHxp3U074282; Mon, 17 Feb 2014 17:59:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171759.s1HHxp3U074282@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 17:59:51 +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: r262110 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 17:59:52 -0000 Author: avg Date: Mon Feb 17 17:59:51 2014 New Revision: 262110 URL: http://svnweb.freebsd.org/changeset/base/262110 Log: MFC r260704,260717: zfs: getnewvnode_reserve must be called outside of a zfs transaction Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Feb 17 17:52:14 2014 (r262109) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Feb 17 17:59:51 2014 (r262110) @@ -951,6 +951,8 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * return (SET_ERROR(EDQUOT)); } + getnewvnode_reserve(1); + tx = dmu_tx_create(zfsvfs->z_os); dmu_tx_hold_sa_create(tx, acl_ids.z_aclp->z_acl_bytes + ZFS_SA_BASE_ATTR_SIZE); @@ -985,6 +987,8 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * zfs_acl_ids_free(&acl_ids); dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + *xvpp = ZTOV(xzp); return (0); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:52:14 2014 (r262109) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:59:51 2014 (r262110) @@ -1644,6 +1644,9 @@ zfs_create(vnode_t *dvp, char *name, vat return (error); } } + + getnewvnode_reserve(1); + top: *vpp = NULL; @@ -1672,6 +1675,7 @@ top: zfs_acl_ids_free(&acl_ids); if (strcmp(name, "..") == 0) error = SET_ERROR(EISDIR); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -1740,6 +1744,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -1806,6 +1811,7 @@ top: } } out: + getnewvnode_drop_reserve(); if (dl) zfs_dirent_unlock(dl); @@ -2149,6 +2155,9 @@ zfs_mkdir(vnode_t *dvp, char *dirname, v ZFS_EXIT(zfsvfs); return (error); } + + getnewvnode_reserve(1); + /* * First make sure the new directory doesn't exist. * @@ -2162,6 +2171,7 @@ top: if (error = zfs_dirent_lock(&dl, dzp, dirname, &zp, zf, NULL, NULL)) { zfs_acl_ids_free(&acl_ids); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2169,6 +2179,7 @@ top: if (error = zfs_zaccess(dzp, ACE_ADD_SUBDIRECTORY, 0, B_FALSE, cr)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2176,6 +2187,7 @@ top: if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (SET_ERROR(EDQUOT)); } @@ -2208,6 +2220,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2237,6 +2250,8 @@ top: dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + zfs_dirent_unlock(dl); if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) @@ -4120,6 +4135,9 @@ zfs_symlink(vnode_t *dvp, vnode_t **vpp, ZFS_EXIT(zfsvfs); return (error); } + + getnewvnode_reserve(1); + top: /* * Attempt to lock directory; fail if entry already exists. @@ -4127,6 +4145,7 @@ top: error = zfs_dirent_lock(&dl, dzp, name, &zp, zflg, NULL, NULL); if (error) { zfs_acl_ids_free(&acl_ids); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4134,6 +4153,7 @@ top: if (error = zfs_zaccess(dzp, ACE_ADD_FILE, 0, B_FALSE, cr)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4141,6 +4161,7 @@ top: if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (SET_ERROR(EDQUOT)); } @@ -4168,6 +4189,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4206,6 +4228,8 @@ top: dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + zfs_dirent_unlock(dl); if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Feb 17 17:52:14 2014 (r262109) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Feb 17 17:59:51 2014 (r262110) @@ -624,6 +624,8 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu zp = kmem_cache_alloc(znode_cache, KM_SLEEP); + KASSERT(curthread->td_vp_reserv > 0, + ("zfs_znode_alloc: getnewvnode without any vnodes reserved")); error = getnewvnode("zfs", zfsvfs->z_parent->z_vfs, &zfs_vnodeops, &vp); if (error != 0) { kmem_cache_free(znode_cache, zp); @@ -832,7 +834,6 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d } } - getnewvnode_reserve(1); ZFS_OBJ_HOLD_ENTER(zfsvfs, obj); VERIFY(0 == sa_buf_hold(zfsvfs->z_os, obj, NULL, &db)); @@ -1019,7 +1020,6 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d KASSERT(err == 0, ("insmntque() failed: error %d", err)); } ZFS_OBJ_HOLD_EXIT(zfsvfs, obj); - getnewvnode_drop_reserve(); } /* From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 18:00:04 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F2B587BA; Mon, 17 Feb 2014 18:00: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D1F341E03; Mon, 17 Feb 2014 18:00:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HI03pR074534; Mon, 17 Feb 2014 18:00:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HI03Qs074525; Mon, 17 Feb 2014 18:00:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171800.s1HI03Qs074525@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:00: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: r262111 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 18:00:04 -0000 Author: avg Date: Mon Feb 17 18:00:02 2014 New Revision: 262111 URL: http://svnweb.freebsd.org/changeset/base/262111 Log: MFC r260704,260717: zfs: getnewvnode_reserve must be called outside of a zfs transaction Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Feb 17 17:59:51 2014 (r262110) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Feb 17 18:00:02 2014 (r262111) @@ -951,6 +951,8 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * return (SET_ERROR(EDQUOT)); } + getnewvnode_reserve(1); + tx = dmu_tx_create(zfsvfs->z_os); dmu_tx_hold_sa_create(tx, acl_ids.z_aclp->z_acl_bytes + ZFS_SA_BASE_ATTR_SIZE); @@ -985,6 +987,8 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * zfs_acl_ids_free(&acl_ids); dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + *xvpp = ZTOV(xzp); return (0); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 17:59:51 2014 (r262110) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 18:00:02 2014 (r262111) @@ -1620,6 +1620,9 @@ zfs_create(vnode_t *dvp, char *name, vat return (error); } } + + getnewvnode_reserve(1); + top: *vpp = NULL; @@ -1648,6 +1651,7 @@ top: zfs_acl_ids_free(&acl_ids); if (strcmp(name, "..") == 0) error = SET_ERROR(EISDIR); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -1716,6 +1720,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -1782,6 +1787,7 @@ top: } } out: + getnewvnode_drop_reserve(); if (dl) zfs_dirent_unlock(dl); @@ -2125,6 +2131,9 @@ zfs_mkdir(vnode_t *dvp, char *dirname, v ZFS_EXIT(zfsvfs); return (error); } + + getnewvnode_reserve(1); + /* * First make sure the new directory doesn't exist. * @@ -2138,6 +2147,7 @@ top: if (error = zfs_dirent_lock(&dl, dzp, dirname, &zp, zf, NULL, NULL)) { zfs_acl_ids_free(&acl_ids); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2145,6 +2155,7 @@ top: if (error = zfs_zaccess(dzp, ACE_ADD_SUBDIRECTORY, 0, B_FALSE, cr)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2152,6 +2163,7 @@ top: if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (SET_ERROR(EDQUOT)); } @@ -2184,6 +2196,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2213,6 +2226,8 @@ top: dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + zfs_dirent_unlock(dl); if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) @@ -4096,6 +4111,9 @@ zfs_symlink(vnode_t *dvp, vnode_t **vpp, ZFS_EXIT(zfsvfs); return (error); } + + getnewvnode_reserve(1); + top: /* * Attempt to lock directory; fail if entry already exists. @@ -4103,6 +4121,7 @@ top: error = zfs_dirent_lock(&dl, dzp, name, &zp, zflg, NULL, NULL); if (error) { zfs_acl_ids_free(&acl_ids); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4110,6 +4129,7 @@ top: if (error = zfs_zaccess(dzp, ACE_ADD_FILE, 0, B_FALSE, cr)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4117,6 +4137,7 @@ top: if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (SET_ERROR(EDQUOT)); } @@ -4144,6 +4165,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4182,6 +4204,8 @@ top: dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + zfs_dirent_unlock(dl); if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Feb 17 17:59:51 2014 (r262110) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Feb 17 18:00:02 2014 (r262111) @@ -624,6 +624,8 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu zp = kmem_cache_alloc(znode_cache, KM_SLEEP); + KASSERT(curthread->td_vp_reserv > 0, + ("zfs_znode_alloc: getnewvnode without any vnodes reserved")); error = getnewvnode("zfs", zfsvfs->z_parent->z_vfs, &zfs_vnodeops, &vp); if (error != 0) { kmem_cache_free(znode_cache, zp); @@ -832,7 +834,6 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d } } - getnewvnode_reserve(1); ZFS_OBJ_HOLD_ENTER(zfsvfs, obj); VERIFY(0 == sa_buf_hold(zfsvfs->z_os, obj, NULL, &db)); @@ -1019,7 +1020,6 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d KASSERT(err == 0, ("insmntque() failed: error %d", err)); } ZFS_OBJ_HOLD_EXIT(zfsvfs, obj); - getnewvnode_drop_reserve(); } /* From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 18:00:25 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9C83890A; Mon, 17 Feb 2014 18:00: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7CDD91E10; Mon, 17 Feb 2014 18:00:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HI0PPs076277; Mon, 17 Feb 2014 18:00:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HI0OME076271; Mon, 17 Feb 2014 18:00:24 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171800.s1HI0OME076271@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:00:24 +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: r262112 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 18:00:25 -0000 Author: avg Date: Mon Feb 17 18:00:24 2014 New Revision: 262112 URL: http://svnweb.freebsd.org/changeset/base/262112 Log: MFC r260704,260717: zfs: getnewvnode_reserve must be called outside of a zfs transaction Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Feb 17 18:00:02 2014 (r262111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Mon Feb 17 18:00:24 2014 (r262112) @@ -951,6 +951,8 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * return (SET_ERROR(EDQUOT)); } + getnewvnode_reserve(1); + tx = dmu_tx_create(zfsvfs->z_os); dmu_tx_hold_sa_create(tx, acl_ids.z_aclp->z_acl_bytes + ZFS_SA_BASE_ATTR_SIZE); @@ -985,6 +987,8 @@ zfs_make_xattrdir(znode_t *zp, vattr_t * zfs_acl_ids_free(&acl_ids); dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + *xvpp = ZTOV(xzp); return (0); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 18:00:02 2014 (r262111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Mon Feb 17 18:00:24 2014 (r262112) @@ -1625,6 +1625,9 @@ zfs_create(vnode_t *dvp, char *name, vat return (error); } } + + getnewvnode_reserve(1); + top: *vpp = NULL; @@ -1653,6 +1656,7 @@ top: zfs_acl_ids_free(&acl_ids); if (strcmp(name, "..") == 0) error = SET_ERROR(EISDIR); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -1721,6 +1725,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -1787,6 +1792,7 @@ top: } } out: + getnewvnode_drop_reserve(); if (dl) zfs_dirent_unlock(dl); @@ -2130,6 +2136,9 @@ zfs_mkdir(vnode_t *dvp, char *dirname, v ZFS_EXIT(zfsvfs); return (error); } + + getnewvnode_reserve(1); + /* * First make sure the new directory doesn't exist. * @@ -2143,6 +2152,7 @@ top: if (error = zfs_dirent_lock(&dl, dzp, dirname, &zp, zf, NULL, NULL)) { zfs_acl_ids_free(&acl_ids); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2150,6 +2160,7 @@ top: if (error = zfs_zaccess(dzp, ACE_ADD_SUBDIRECTORY, 0, B_FALSE, cr)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2157,6 +2168,7 @@ top: if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (SET_ERROR(EDQUOT)); } @@ -2189,6 +2201,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -2218,6 +2231,8 @@ top: dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + zfs_dirent_unlock(dl); if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) @@ -4109,6 +4124,9 @@ zfs_symlink(vnode_t *dvp, vnode_t **vpp, ZFS_EXIT(zfsvfs); return (error); } + + getnewvnode_reserve(1); + top: /* * Attempt to lock directory; fail if entry already exists. @@ -4116,6 +4134,7 @@ top: error = zfs_dirent_lock(&dl, dzp, name, &zp, zflg, NULL, NULL); if (error) { zfs_acl_ids_free(&acl_ids); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4123,6 +4142,7 @@ top: if (error = zfs_zaccess(dzp, ACE_ADD_FILE, 0, B_FALSE, cr)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4130,6 +4150,7 @@ top: if (zfs_acl_ids_overquota(zfsvfs, &acl_ids)) { zfs_acl_ids_free(&acl_ids); zfs_dirent_unlock(dl); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (SET_ERROR(EDQUOT)); } @@ -4157,6 +4178,7 @@ top: } zfs_acl_ids_free(&acl_ids); dmu_tx_abort(tx); + getnewvnode_drop_reserve(); ZFS_EXIT(zfsvfs); return (error); } @@ -4195,6 +4217,8 @@ top: dmu_tx_commit(tx); + getnewvnode_drop_reserve(); + zfs_dirent_unlock(dl); if (zfsvfs->z_os->os_sync == ZFS_SYNC_ALWAYS) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Feb 17 18:00:02 2014 (r262111) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Mon Feb 17 18:00:24 2014 (r262112) @@ -624,6 +624,8 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu zp = kmem_cache_alloc(znode_cache, KM_SLEEP); + KASSERT(curthread->td_vp_reserv > 0, + ("zfs_znode_alloc: getnewvnode without any vnodes reserved")); error = getnewvnode("zfs", zfsvfs->z_parent->z_vfs, &zfs_vnodeops, &vp); if (error != 0) { kmem_cache_free(znode_cache, zp); @@ -832,7 +834,6 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d } } - getnewvnode_reserve(1); ZFS_OBJ_HOLD_ENTER(zfsvfs, obj); VERIFY(0 == sa_buf_hold(zfsvfs->z_os, obj, NULL, &db)); @@ -1019,7 +1020,6 @@ zfs_mknode(znode_t *dzp, vattr_t *vap, d KASSERT(err == 0, ("insmntque() failed: error %d", err)); } ZFS_OBJ_HOLD_EXIT(zfsvfs, obj); - getnewvnode_drop_reserve(); } /* From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 18:06:38 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 68E5CDD8; Mon, 17 Feb 2014 18:06: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 54A2F1FD3; Mon, 17 Feb 2014 18:06:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HI6cfS078432; Mon, 17 Feb 2014 18:06:38 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HI6cCN078431; Mon, 17 Feb 2014 18:06:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171806.s1HI6cCN078431@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:06:38 +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: r262113 - stable/9/cddl/usr.bin/zinject X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 18:06:38 -0000 Author: avg Date: Mon Feb 17 18:06:37 2014 New Revision: 262113 URL: http://svnweb.freebsd.org/changeset/base/262113 Log: MFC r260703: zinject must use ioctl(2) compatibility wrapper Modified: stable/9/cddl/usr.bin/zinject/Makefile Directory Properties: stable/9/cddl/usr.bin/zinject/ (props changed) Modified: stable/9/cddl/usr.bin/zinject/Makefile ============================================================================== --- stable/9/cddl/usr.bin/zinject/Makefile Mon Feb 17 18:00:24 2014 (r262112) +++ stable/9/cddl/usr.bin/zinject/Makefile Mon Feb 17 18:06:37 2014 (r262113) @@ -16,6 +16,7 @@ CFLAGS+= -I${.CURDIR}/../../contrib/open CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs/ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 18:07:08 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 73792188; Mon, 17 Feb 2014 18:07: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F3651FF7; Mon, 17 Feb 2014 18:07:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HI78H2078562; Mon, 17 Feb 2014 18:07:08 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HI78mC078561; Mon, 17 Feb 2014 18:07:08 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171807.s1HI78mC078561@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:07:08 +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: r262114 - stable/8/cddl/usr.bin/zinject X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 18:07:08 -0000 Author: avg Date: Mon Feb 17 18:07:07 2014 New Revision: 262114 URL: http://svnweb.freebsd.org/changeset/base/262114 Log: MFC r260703: zinject must use ioctl(2) compatibility wrapper Modified: stable/8/cddl/usr.bin/zinject/Makefile Directory Properties: stable/8/cddl/usr.bin/zinject/ (props changed) Modified: stable/8/cddl/usr.bin/zinject/Makefile ============================================================================== --- stable/8/cddl/usr.bin/zinject/Makefile Mon Feb 17 18:06:37 2014 (r262113) +++ stable/8/cddl/usr.bin/zinject/Makefile Mon Feb 17 18:07:07 2014 (r262114) @@ -15,6 +15,7 @@ CFLAGS+= -I${.CURDIR}/../../contrib/open CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/fs/zfs CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/sys CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common +CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/zfs/ CFLAGS+= -I${.CURDIR}/../../contrib/opensolaris/head CFLAGS+= -I${.CURDIR}/../../lib/libumem From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 18:16:26 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 002AE5E9; Mon, 17 Feb 2014 18:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DCC5E111D; Mon, 17 Feb 2014 18:16:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HIGPcU082722; Mon, 17 Feb 2014 18:16:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HIGP5E082721; Mon, 17 Feb 2014 18:16:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171816.s1HIGP5E082721@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:16: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: r262115 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 18:16:26 -0000 Author: avg Date: Mon Feb 17 18:16:25 2014 New Revision: 262115 URL: http://svnweb.freebsd.org/changeset/base/262115 Log: MFC r260835: MFV r260834: Fix memory leak of compressed buffers in l2arc_write_done 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 Mon Feb 17 18:07:07 2014 (r262114) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 18:16:25 2014 (r262115) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2014 by Saso Kiselkov. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ @@ -4593,6 +4593,13 @@ l2arc_write_done(zio_t *zio) */ for (ab = list_prev(buflist, head); ab; ab = ab_prev) { ab_prev = list_prev(buflist, ab); + abl2 = ab->b_l2hdr; + + /* + * Release the temporary compressed buffer as soon as possible. + */ + if (abl2->b_compress != ZIO_COMPRESS_OFF) + l2arc_release_cdata_buf(ab); hash_lock = HDR_LOCK(ab); if (!mutex_tryenter(hash_lock)) { @@ -4605,14 +4612,6 @@ l2arc_write_done(zio_t *zio) continue; } - abl2 = ab->b_l2hdr; - - /* - * Release the temporary compressed buffer as soon as possible. - */ - if (abl2->b_compress != ZIO_COMPRESS_OFF) - l2arc_release_cdata_buf(ab); - if (zio->io_error != 0) { /* * Error - drop L2ARC entry. From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 18:16:37 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80325714; Mon, 17 Feb 2014 18:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6969C1120; Mon, 17 Feb 2014 18:16:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HIGbla082779; Mon, 17 Feb 2014 18:16:37 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HIGbeX082778; Mon, 17 Feb 2014 18:16:37 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171816.s1HIGbeX082778@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:16:37 +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: r262116 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 18:16:37 -0000 Author: avg Date: Mon Feb 17 18:16:36 2014 New Revision: 262116 URL: http://svnweb.freebsd.org/changeset/base/262116 Log: MFC r260835: MFV r260834: Fix memory leak of compressed buffers in l2arc_write_done Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 18:16:25 2014 (r262115) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 18:16:36 2014 (r262116) @@ -21,7 +21,7 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2014 by Saso Kiselkov. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. */ @@ -4593,6 +4593,13 @@ l2arc_write_done(zio_t *zio) */ for (ab = list_prev(buflist, head); ab; ab = ab_prev) { ab_prev = list_prev(buflist, ab); + abl2 = ab->b_l2hdr; + + /* + * Release the temporary compressed buffer as soon as possible. + */ + if (abl2->b_compress != ZIO_COMPRESS_OFF) + l2arc_release_cdata_buf(ab); hash_lock = HDR_LOCK(ab); if (!mutex_tryenter(hash_lock)) { @@ -4605,14 +4612,6 @@ l2arc_write_done(zio_t *zio) continue; } - abl2 = ab->b_l2hdr; - - /* - * Release the temporary compressed buffer as soon as possible. - */ - if (abl2->b_compress != ZIO_COMPRESS_OFF) - l2arc_release_cdata_buf(ab); - if (zio->io_error != 0) { /* * Error - drop L2ARC entry. From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 18:16:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 27646841; Mon, 17 Feb 2014 18:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 11EA11126; Mon, 17 Feb 2014 18:16:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HIGo7e082838; Mon, 17 Feb 2014 18:16:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HIGo7H082836; Mon, 17 Feb 2014 18:16:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171816.s1HIGo7H082836@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:16:50 +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: r262117 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 18:16:51 -0000 Author: avg Date: Mon Feb 17 18:16:50 2014 New Revision: 262117 URL: http://svnweb.freebsd.org/changeset/base/262117 Log: MFC r260835: MFV r260834: Fix memory leak of compressed buffers in l2arc_write_done Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 18:16:36 2014 (r262116) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Mon Feb 17 18:16:50 2014 (r262117) @@ -22,7 +22,7 @@ * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright 2011 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2013 by Delphix. All rights reserved. - * Copyright (c) 2013 by Saso Kiselkov. All rights reserved. + * Copyright (c) 2014 by Saso Kiselkov. All rights reserved. */ /* @@ -4563,6 +4563,13 @@ l2arc_write_done(zio_t *zio) */ for (ab = list_prev(buflist, head); ab; ab = ab_prev) { ab_prev = list_prev(buflist, ab); + abl2 = ab->b_l2hdr; + + /* + * Release the temporary compressed buffer as soon as possible. + */ + if (abl2->b_compress != ZIO_COMPRESS_OFF) + l2arc_release_cdata_buf(ab); hash_lock = HDR_LOCK(ab); if (!mutex_tryenter(hash_lock)) { @@ -4575,14 +4582,6 @@ l2arc_write_done(zio_t *zio) continue; } - abl2 = ab->b_l2hdr; - - /* - * Release the temporary compressed buffer as soon as possible. - */ - if (abl2->b_compress != ZIO_COMPRESS_OFF) - l2arc_release_cdata_buf(ab); - if (zio->io_error != 0) { /* * Error - drop L2ARC entry. From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 18:24:26 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD19AF41; Mon, 17 Feb 2014 18:24: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BD44D11D5; Mon, 17 Feb 2014 18:24:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HIOQmh086913; Mon, 17 Feb 2014 18:24:26 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HIOP4N086907; Mon, 17 Feb 2014 18:24:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171824.s1HIOP4N086907@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:24: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: r262118 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 18:24:26 -0000 Author: avg Date: Mon Feb 17 18:24:25 2014 New Revision: 262118 URL: http://svnweb.freebsd.org/changeset/base/262118 Log: MFC r260185: MFV r260155: 4391 panic system rather than corrupting pool if we hit bug 4390 Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Feb 17 18:16:50 2014 (r262117) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Feb 17 18:24:25 2014 (r262118) @@ -180,6 +180,7 @@ bptree_iterate(objset_t *os, uint64_t ob err = 0; for (i = ba.ba_phys->bt_begin; i < ba.ba_phys->bt_end; i++) { bptree_entry_phys_t bte; + int flags = TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST; ASSERT(!free || i == ba.ba_phys->bt_begin); @@ -188,13 +189,13 @@ bptree_iterate(objset_t *os, uint64_t ob if (err != 0) break; + if (zfs_recover) + flags |= TRAVERSE_HARD; err = traverse_dataset_destroyed(os->os_spa, &bte.be_bp, - bte.be_birth_txg, &bte.be_zb, - TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST, + bte.be_birth_txg, &bte.be_zb, flags, bptree_visit_cb, &ba); if (free) { - ASSERT(err == 0 || err == ERESTART); - if (err != 0) { + if (err == ERESTART) { /* save bookmark for future resume */ ASSERT3U(bte.be_zb.zb_objset, ==, ZB_DESTROYED_OBJSET); @@ -202,11 +203,21 @@ bptree_iterate(objset_t *os, uint64_t ob dmu_write(os, obj, i * sizeof (bte), sizeof (bte), &bte, tx); break; - } else { - ba.ba_phys->bt_begin++; - (void) dmu_free_range(os, obj, - i * sizeof (bte), sizeof (bte), tx); } + if (err != 0) { + /* + * We can not properly handle an i/o + * error, because the traversal code + * does not know how to resume from an + * arbitrary bookmark. + */ + zfs_panic_recover("error %u from " + "traverse_dataset_destroyed()", err); + } + + ba.ba_phys->bt_begin++; + (void) dmu_free_range(os, obj, + i * sizeof (bte), sizeof (bte), tx); } } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 18:16:50 2014 (r262117) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 18:24:25 2014 (r262118) @@ -361,7 +361,7 @@ traverse_visitbp(traverse_data_t *td, co (void) arc_buf_remove_ref(buf, &buf); post: - if (err == 0 && lasterr == 0 && (td->td_flags & TRAVERSE_POST)) { + if (err == 0 && (td->td_flags & TRAVERSE_POST)) { err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); if (err == ERESTART) pause = B_TRUE; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 18:16:50 2014 (r262117) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 18:24:25 2014 (r262118) @@ -1347,6 +1347,9 @@ dsl_scan_free_should_pause(dsl_scan_t *s { uint64_t elapsed_nanosecs; + if (zfs_recover) + return (B_FALSE); + elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time; return (elapsed_nanosecs / NANOSEC > zfs_txg_timeout || (NSEC2MSEC(elapsed_nanosecs) > zfs_free_min_time_ms && Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Feb 17 18:16:50 2014 (r262117) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Feb 17 18:24:25 2014 (r262118) @@ -252,6 +252,8 @@ SYSCTL_INT(_debug, OID_AUTO, zfs_flags, * zfs_recover can be set to nonzero to attempt to recover from * otherwise-fatal errors, typically caused by on-disk corruption. When * set, calls to zfs_panic_recover() will turn into warning messages. + * This should only be used as a last resort, as it typically results + * in leaked space, or worse. */ int zfs_recover = 0; SYSCTL_DECL(_vfs_zfs); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 18:16:50 2014 (r262117) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 18:24:25 2014 (r262118) @@ -49,6 +49,7 @@ extern "C" { #endif extern int zfs_flags; +extern int zfs_recover; #define ZFS_DEBUG_DPRINTF (1<<0) #define ZFS_DEBUG_DBUF_VERIFY (1<<1) From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 18:24:39 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E7AEE9; Mon, 17 Feb 2014 18:24: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1EE5411D9; Mon, 17 Feb 2014 18:24:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HIOcMv086975; Mon, 17 Feb 2014 18:24:38 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HIOcXO086968; Mon, 17 Feb 2014 18:24:38 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171824.s1HIOcXO086968@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:24:38 +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: r262119 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 18:24:39 -0000 Author: avg Date: Mon Feb 17 18:24:37 2014 New Revision: 262119 URL: http://svnweb.freebsd.org/changeset/base/262119 Log: MFC r260185: MFV r260155: 4391 panic system rather than corrupting pool if we hit bug 4390 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Feb 17 18:24:25 2014 (r262118) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Feb 17 18:24:37 2014 (r262119) @@ -180,6 +180,7 @@ bptree_iterate(objset_t *os, uint64_t ob err = 0; for (i = ba.ba_phys->bt_begin; i < ba.ba_phys->bt_end; i++) { bptree_entry_phys_t bte; + int flags = TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST; ASSERT(!free || i == ba.ba_phys->bt_begin); @@ -188,13 +189,13 @@ bptree_iterate(objset_t *os, uint64_t ob if (err != 0) break; + if (zfs_recover) + flags |= TRAVERSE_HARD; err = traverse_dataset_destroyed(os->os_spa, &bte.be_bp, - bte.be_birth_txg, &bte.be_zb, - TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST, + bte.be_birth_txg, &bte.be_zb, flags, bptree_visit_cb, &ba); if (free) { - ASSERT(err == 0 || err == ERESTART); - if (err != 0) { + if (err == ERESTART) { /* save bookmark for future resume */ ASSERT3U(bte.be_zb.zb_objset, ==, ZB_DESTROYED_OBJSET); @@ -202,11 +203,21 @@ bptree_iterate(objset_t *os, uint64_t ob dmu_write(os, obj, i * sizeof (bte), sizeof (bte), &bte, tx); break; - } else { - ba.ba_phys->bt_begin++; - (void) dmu_free_range(os, obj, - i * sizeof (bte), sizeof (bte), tx); } + if (err != 0) { + /* + * We can not properly handle an i/o + * error, because the traversal code + * does not know how to resume from an + * arbitrary bookmark. + */ + zfs_panic_recover("error %u from " + "traverse_dataset_destroyed()", err); + } + + ba.ba_phys->bt_begin++; + (void) dmu_free_range(os, obj, + i * sizeof (bte), sizeof (bte), tx); } } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 18:24:25 2014 (r262118) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 18:24:37 2014 (r262119) @@ -361,7 +361,7 @@ traverse_visitbp(traverse_data_t *td, co (void) arc_buf_remove_ref(buf, &buf); post: - if (err == 0 && lasterr == 0 && (td->td_flags & TRAVERSE_POST)) { + if (err == 0 && (td->td_flags & TRAVERSE_POST)) { err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); if (err == ERESTART) pause = B_TRUE; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 18:24:25 2014 (r262118) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 18:24:37 2014 (r262119) @@ -1347,6 +1347,9 @@ dsl_scan_free_should_pause(dsl_scan_t *s { uint64_t elapsed_nanosecs; + if (zfs_recover) + return (B_FALSE); + elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time; return (elapsed_nanosecs / NANOSEC > zfs_txg_timeout || (NSEC2MSEC(elapsed_nanosecs) > zfs_free_min_time_ms && Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Feb 17 18:24:25 2014 (r262118) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Feb 17 18:24:37 2014 (r262119) @@ -252,6 +252,8 @@ SYSCTL_INT(_debug, OID_AUTO, zfs_flags, * zfs_recover can be set to nonzero to attempt to recover from * otherwise-fatal errors, typically caused by on-disk corruption. When * set, calls to zfs_panic_recover() will turn into warning messages. + * This should only be used as a last resort, as it typically results + * in leaked space, or worse. */ int zfs_recover = 0; SYSCTL_DECL(_vfs_zfs); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 18:24:25 2014 (r262118) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 18:24:37 2014 (r262119) @@ -49,6 +49,7 @@ extern "C" { #endif extern int zfs_flags; +extern int zfs_recover; #define ZFS_DEBUG_DPRINTF (1<<0) #define ZFS_DEBUG_DBUF_VERIFY (1<<1) From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 18:25:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69E3222C; Mon, 17 Feb 2014 18:25: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 48B8C11E4; Mon, 17 Feb 2014 18:25:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HIPhai087169; Mon, 17 Feb 2014 18:25:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HIPgES087164; Mon, 17 Feb 2014 18:25:42 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402171825.s1HIPgES087164@svn.freebsd.org> From: Andriy Gapon Date: Mon, 17 Feb 2014 18:25: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: r262120 - in stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 18:25:43 -0000 Author: avg Date: Mon Feb 17 18:25:41 2014 New Revision: 262120 URL: http://svnweb.freebsd.org/changeset/base/262120 Log: MFC r260185: MFV r260155: 4391 panic system rather than corrupting pool if we hit bug 4390 Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Feb 17 18:24:37 2014 (r262119) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Mon Feb 17 18:25:41 2014 (r262120) @@ -180,6 +180,7 @@ bptree_iterate(objset_t *os, uint64_t ob err = 0; for (i = ba.ba_phys->bt_begin; i < ba.ba_phys->bt_end; i++) { bptree_entry_phys_t bte; + int flags = TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST; ASSERT(!free || i == ba.ba_phys->bt_begin); @@ -188,13 +189,13 @@ bptree_iterate(objset_t *os, uint64_t ob if (err != 0) break; + if (zfs_recover) + flags |= TRAVERSE_HARD; err = traverse_dataset_destroyed(os->os_spa, &bte.be_bp, - bte.be_birth_txg, &bte.be_zb, - TRAVERSE_PREFETCH_METADATA | TRAVERSE_POST, + bte.be_birth_txg, &bte.be_zb, flags, bptree_visit_cb, &ba); if (free) { - ASSERT(err == 0 || err == ERESTART); - if (err != 0) { + if (err == ERESTART) { /* save bookmark for future resume */ ASSERT3U(bte.be_zb.zb_objset, ==, ZB_DESTROYED_OBJSET); @@ -202,11 +203,21 @@ bptree_iterate(objset_t *os, uint64_t ob dmu_write(os, obj, i * sizeof (bte), sizeof (bte), &bte, tx); break; - } else { - ba.ba_phys->bt_begin++; - (void) dmu_free_range(os, obj, - i * sizeof (bte), sizeof (bte), tx); } + if (err != 0) { + /* + * We can not properly handle an i/o + * error, because the traversal code + * does not know how to resume from an + * arbitrary bookmark. + */ + zfs_panic_recover("error %u from " + "traverse_dataset_destroyed()", err); + } + + ba.ba_phys->bt_begin++; + (void) dmu_free_range(os, obj, + i * sizeof (bte), sizeof (bte), tx); } } 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 Mon Feb 17 18:24:37 2014 (r262119) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c Mon Feb 17 18:25:41 2014 (r262120) @@ -361,7 +361,7 @@ traverse_visitbp(traverse_data_t *td, co (void) arc_buf_remove_ref(buf, &buf); post: - if (err == 0 && lasterr == 0 && (td->td_flags & TRAVERSE_POST)) { + if (err == 0 && (td->td_flags & TRAVERSE_POST)) { err = td->td_func(td->td_spa, NULL, bp, zb, dnp, td->td_arg); if (err == ERESTART) pause = B_TRUE; Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 18:24:37 2014 (r262119) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c Mon Feb 17 18:25:41 2014 (r262120) @@ -1347,6 +1347,9 @@ dsl_scan_free_should_pause(dsl_scan_t *s { uint64_t elapsed_nanosecs; + if (zfs_recover) + return (B_FALSE); + elapsed_nanosecs = gethrtime() - scn->scn_sync_start_time; return (elapsed_nanosecs / NANOSEC > zfs_txg_timeout || (NSEC2MSEC(elapsed_nanosecs) > zfs_free_min_time_ms && 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 Mon Feb 17 18:24:37 2014 (r262119) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Mon Feb 17 18:25:41 2014 (r262120) @@ -252,6 +252,8 @@ SYSCTL_INT(_debug, OID_AUTO, zfs_flags, * zfs_recover can be set to nonzero to attempt to recover from * otherwise-fatal errors, typically caused by on-disk corruption. When * set, calls to zfs_panic_recover() will turn into warning messages. + * This should only be used as a last resort, as it typically results + * in leaked space, or worse. */ int zfs_recover = 0; SYSCTL_DECL(_vfs_zfs); Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 18:24:37 2014 (r262119) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h Mon Feb 17 18:25:41 2014 (r262120) @@ -49,6 +49,7 @@ extern "C" { #endif extern int zfs_flags; +extern int zfs_recover; #define ZFS_DEBUG_DPRINTF (1<<0) #define ZFS_DEBUG_DBUF_VERIFY (1<<1) From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 20:04:17 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 020C7E89; Mon, 17 Feb 2014 20:04: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DFFF11AC6; Mon, 17 Feb 2014 20:04:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HK4GvV026079; Mon, 17 Feb 2014 20:04:16 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HK4GPZ026078; Mon, 17 Feb 2014 20:04:16 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402172004.s1HK4GPZ026078@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Feb 2014 20: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: r262122 - stable/10/etc/defaults X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 20:04:17 -0000 Author: mav Date: Mon Feb 17 20:04:16 2014 New Revision: 262122 URL: http://svnweb.freebsd.org/changeset/base/262122 Log: MFC r260486: Remove very low default limit of 4 nfsd threads. nfsd's own default is 8 * hw.ncpu, that sounds more appropriate for these SMP/NCQ/... days. Modified: stable/10/etc/defaults/rc.conf Directory Properties: stable/10/ (props changed) Modified: stable/10/etc/defaults/rc.conf ============================================================================== --- stable/10/etc/defaults/rc.conf Mon Feb 17 18:50:03 2014 (r262121) +++ stable/10/etc/defaults/rc.conf Mon Feb 17 20:04:16 2014 (r262122) @@ -315,7 +315,7 @@ nfs_client_enable="NO" # This host is a nfs_access_cache="60" # Client cache timeout in seconds nfs_server_enable="NO" # This host is an NFS server (or NO). oldnfs_server_enable="NO" # Run the old NFS server (YES/NO). -nfs_server_flags="-u -t -n 4" # Flags to nfsd (if enabled). +nfs_server_flags="-u -t" # Flags to nfsd (if enabled). mountd_enable="NO" # Run mountd (or NO). mountd_flags="-r" # Flags to mountd (if NFS server enabled). weak_mountd_authentication="NO" # Allow non-root mount requests to be served. From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 20:06:09 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BB8C51A4; Mon, 17 Feb 2014 20:06: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A4E201AE3; Mon, 17 Feb 2014 20:06:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HK69uJ026463; Mon, 17 Feb 2014 20:06:09 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HK69Lk026462; Mon, 17 Feb 2014 20:06:09 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402172006.s1HK69Lk026462@svn.freebsd.org> From: Alexander Motin Date: Mon, 17 Feb 2014 20:06:09 +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: r262124 - stable/9/etc/defaults X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 20:06:09 -0000 Author: mav Date: Mon Feb 17 20:06:09 2014 New Revision: 262124 URL: http://svnweb.freebsd.org/changeset/base/262124 Log: MFC r260486: Remove very low default limit of 4 nfsd threads. nfsd's own default is 8 * hw.ncpu, that sounds more appropriate for these SMP/NCQ/... days. Modified: stable/9/etc/defaults/rc.conf Directory Properties: stable/9/ (props changed) stable/9/etc/ (props changed) Modified: stable/9/etc/defaults/rc.conf ============================================================================== --- stable/9/etc/defaults/rc.conf Mon Feb 17 20:04:57 2014 (r262123) +++ stable/9/etc/defaults/rc.conf Mon Feb 17 20:06:09 2014 (r262124) @@ -327,7 +327,7 @@ nfs_client_enable="NO" # This host is a nfs_access_cache="60" # Client cache timeout in seconds nfs_server_enable="NO" # This host is an NFS server (or NO). oldnfs_server_enable="NO" # Run the old NFS server (YES/NO). -nfs_server_flags="-u -t -n 4" # Flags to nfsd (if enabled). +nfs_server_flags="-u -t" # Flags to nfsd (if enabled). mountd_enable="NO" # Run mountd (or NO). mountd_flags="-r" # Flags to mountd (if NFS server enabled). weak_mountd_authentication="NO" # Allow non-root mount requests to be served. From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 20:19:35 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9F092851; Mon, 17 Feb 2014 20:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F0F51BF0; Mon, 17 Feb 2014 20:19:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKJZvk031041; Mon, 17 Feb 2014 20:19:35 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKJZ0o031039; Mon, 17 Feb 2014 20:19:35 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172019.s1HKJZ0o031039@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:19:35 +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: r262126 - in stable: 10/sys/conf 10/sys/modules/wlan 9/sys/conf 9/sys/modules/wlan X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 20:19:35 -0000 Author: dim Date: Mon Feb 17 20:19:34 2014 New Revision: 262126 URL: http://svnweb.freebsd.org/changeset/base/262126 Log: MFC r261899: Similar to r260026, disable warning about unused functions for ieee80211_adhoc.c, ieee80211_hostap.c and ieee80211_sta.c. Modified: stable/9/sys/conf/files stable/9/sys/modules/wlan/Makefile Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/conf/files stable/10/sys/modules/wlan/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Mon Feb 17 20:08:11 2014 (r262125) +++ stable/9/sys/conf/files Mon Feb 17 20:19:34 2014 (r262126) @@ -2747,7 +2747,8 @@ net80211/ieee80211.c optional wlan net80211/ieee80211_acl.c optional wlan wlan_acl net80211/ieee80211_action.c optional wlan net80211/ieee80211_ageq.c optional wlan -net80211/ieee80211_adhoc.c optional wlan +net80211/ieee80211_adhoc.c optional wlan \ + compile-with "${NORMAL_C} -Wno-unused-function" net80211/ieee80211_ageq.c optional wlan net80211/ieee80211_amrr.c optional wlan | wlan_amrr net80211/ieee80211_crypto.c optional wlan \ @@ -2759,7 +2760,8 @@ net80211/ieee80211_crypto_wep.c optional net80211/ieee80211_ddb.c optional wlan ddb net80211/ieee80211_dfs.c optional wlan net80211/ieee80211_freebsd.c optional wlan -net80211/ieee80211_hostap.c optional wlan +net80211/ieee80211_hostap.c optional wlan \ + compile-with "${NORMAL_C} -Wno-unused-function" net80211/ieee80211_ht.c optional wlan net80211/ieee80211_hwmp.c optional wlan ieee80211_support_mesh net80211/ieee80211_input.c optional wlan @@ -2779,7 +2781,8 @@ net80211/ieee80211_regdomain.c optional net80211/ieee80211_rssadapt.c optional wlan wlan_rssadapt net80211/ieee80211_scan.c optional wlan net80211/ieee80211_scan_sta.c optional wlan -net80211/ieee80211_sta.c optional wlan +net80211/ieee80211_sta.c optional wlan \ + compile-with "${NORMAL_C} -Wno-unused-function" net80211/ieee80211_superg.c optional wlan ieee80211_support_superg net80211/ieee80211_tdma.c optional wlan ieee80211_support_tdma net80211/ieee80211_wds.c optional wlan Modified: stable/9/sys/modules/wlan/Makefile ============================================================================== --- stable/9/sys/modules/wlan/Makefile Mon Feb 17 20:08:11 2014 (r262125) +++ stable/9/sys/modules/wlan/Makefile Mon Feb 17 20:19:34 2014 (r262126) @@ -31,6 +31,9 @@ opt_ddb.h: .include +CWARNFLAGS.ieee80211_adhoc.c= -Wno-unused-function CWARNFLAGS.ieee80211_crypto.c= -Wno-unused-function +CWARNFLAGS.ieee80211_hostap.c= -Wno-unused-function CWARNFLAGS.ieee80211_mesh.c= -Wno-unused-function +CWARNFLAGS.ieee80211_sta.c= -Wno-unused-function CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 20:19:36 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 30319852; Mon, 17 Feb 2014 20:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1056A1BF1; Mon, 17 Feb 2014 20:19:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKJZlk031048; Mon, 17 Feb 2014 20:19:35 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKJZsa031046; Mon, 17 Feb 2014 20:19:35 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172019.s1HKJZsa031046@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:19:35 +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: r262126 - in stable: 10/sys/conf 10/sys/modules/wlan 9/sys/conf 9/sys/modules/wlan X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 20:19:36 -0000 Author: dim Date: Mon Feb 17 20:19:34 2014 New Revision: 262126 URL: http://svnweb.freebsd.org/changeset/base/262126 Log: MFC r261899: Similar to r260026, disable warning about unused functions for ieee80211_adhoc.c, ieee80211_hostap.c and ieee80211_sta.c. Modified: stable/10/sys/conf/files stable/10/sys/modules/wlan/Makefile Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/conf/files stable/9/sys/modules/wlan/Makefile Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Mon Feb 17 20:08:11 2014 (r262125) +++ stable/10/sys/conf/files Mon Feb 17 20:19:34 2014 (r262126) @@ -3140,7 +3140,8 @@ net80211/ieee80211.c optional wlan net80211/ieee80211_acl.c optional wlan wlan_acl net80211/ieee80211_action.c optional wlan net80211/ieee80211_ageq.c optional wlan -net80211/ieee80211_adhoc.c optional wlan +net80211/ieee80211_adhoc.c optional wlan \ + compile-with "${NORMAL_C} -Wno-unused-function" net80211/ieee80211_ageq.c optional wlan net80211/ieee80211_amrr.c optional wlan | wlan_amrr net80211/ieee80211_crypto.c optional wlan \ @@ -3152,7 +3153,8 @@ net80211/ieee80211_crypto_wep.c optional net80211/ieee80211_ddb.c optional wlan ddb net80211/ieee80211_dfs.c optional wlan net80211/ieee80211_freebsd.c optional wlan -net80211/ieee80211_hostap.c optional wlan +net80211/ieee80211_hostap.c optional wlan \ + compile-with "${NORMAL_C} -Wno-unused-function" net80211/ieee80211_ht.c optional wlan net80211/ieee80211_hwmp.c optional wlan ieee80211_support_mesh net80211/ieee80211_input.c optional wlan @@ -3172,7 +3174,8 @@ net80211/ieee80211_regdomain.c optional net80211/ieee80211_rssadapt.c optional wlan wlan_rssadapt net80211/ieee80211_scan.c optional wlan net80211/ieee80211_scan_sta.c optional wlan -net80211/ieee80211_sta.c optional wlan +net80211/ieee80211_sta.c optional wlan \ + compile-with "${NORMAL_C} -Wno-unused-function" net80211/ieee80211_superg.c optional wlan ieee80211_support_superg net80211/ieee80211_tdma.c optional wlan ieee80211_support_tdma net80211/ieee80211_wds.c optional wlan Modified: stable/10/sys/modules/wlan/Makefile ============================================================================== --- stable/10/sys/modules/wlan/Makefile Mon Feb 17 20:08:11 2014 (r262125) +++ stable/10/sys/modules/wlan/Makefile Mon Feb 17 20:19:34 2014 (r262126) @@ -32,6 +32,9 @@ opt_ddb.h: .include +CWARNFLAGS.ieee80211_adhoc.c= -Wno-unused-function CWARNFLAGS.ieee80211_crypto.c= -Wno-unused-function +CWARNFLAGS.ieee80211_hostap.c= -Wno-unused-function CWARNFLAGS.ieee80211_mesh.c= -Wno-unused-function +CWARNFLAGS.ieee80211_sta.c= -Wno-unused-function CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 20:25:17 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DDEB7C1F; Mon, 17 Feb 2014 20:25: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C89931C97; Mon, 17 Feb 2014 20:25:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKPHWq034484; Mon, 17 Feb 2014 20:25:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKPH9d034483; Mon, 17 Feb 2014 20:25:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172025.s1HKPH9d034483@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:25: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: r262127 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 20:25:18 -0000 Author: dim Date: Mon Feb 17 20:25:17 2014 New Revision: 262127 URL: http://svnweb.freebsd.org/changeset/base/262127 Log: MFC r261896: After r251709, avoid a clang 3.4 warning about an unused static const variable (uma_max_ipers), when asserts are disabled. Reviewed by: glebius Modified: stable/10/sys/vm/uma_core.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/uma_core.c ============================================================================== --- stable/10/sys/vm/uma_core.c Mon Feb 17 20:19:34 2014 (r262126) +++ stable/10/sys/vm/uma_core.c Mon Feb 17 20:25:17 2014 (r262127) @@ -150,9 +150,6 @@ static int booted = 0; #define UMA_STARTUP 1 #define UMA_STARTUP2 2 -/* Maximum number of allowed items-per-slab if the slab header is OFFPAGE */ -static const u_int uma_max_ipers = SLAB_SETSIZE; - /* * Only mbuf clusters use ref zones. Just provide enough references * to support the one user. New code should not use the ref facility. @@ -1388,7 +1385,7 @@ keg_cachespread_init(uma_keg_t keg) keg->uk_slabsize = UMA_SLAB_SIZE; keg->uk_ipers = ((pages * PAGE_SIZE) + trailer) / rsize; keg->uk_flags |= UMA_ZONE_OFFPAGE | UMA_ZONE_VTOSLAB; - KASSERT(keg->uk_ipers <= uma_max_ipers, + KASSERT(keg->uk_ipers <= SLAB_SETSIZE, ("%s: keg->uk_ipers too high(%d) increase max_ipers", __func__, keg->uk_ipers)); } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 20:31:55 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B6E220F; Mon, 17 Feb 2014 20:31: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 64E681D46; Mon, 17 Feb 2014 20:31:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKVtEK037991; Mon, 17 Feb 2014 20:31:55 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKVtgB037990; Mon, 17 Feb 2014 20:31:55 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172031.s1HKVtgB037990@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:31:55 +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: r262130 - in stable: 10/sys/conf 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 20:31:55 -0000 Author: dim Date: Mon Feb 17 20:31:54 2014 New Revision: 262130 URL: http://svnweb.freebsd.org/changeset/base/262130 Log: MFC r261902: In r260111, in sys/conf/files, I disabled warning about unused functions for the wrong mcg.c, the one in ofed/drivers/infiniband/hw/mlx4. Disable the warning for ofed/drivers/net/mlx4/mcg.c instead. Modified: stable/9/sys/conf/files Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Mon Feb 17 20:30:29 2014 (r262129) +++ stable/9/sys/conf/files Mon Feb 17 20:31:54 2014 (r262130) @@ -3242,7 +3242,7 @@ ofed/drivers/net/mlx4/main.c optional compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" ofed/drivers/net/mlx4/mcg.c optional mlx4ib | mlxen \ no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/ -Wno-unused" ofed/drivers/net/mlx4/mr.c optional mlx4ib | mlxen \ no-depend obj-prefix "mlx4_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 20:31:55 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E8331210; Mon, 17 Feb 2014 20:31: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B90551D47; Mon, 17 Feb 2014 20:31:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKVtO4037997; Mon, 17 Feb 2014 20:31:55 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKVtma037996; Mon, 17 Feb 2014 20:31:55 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172031.s1HKVtma037996@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:31:55 +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: r262130 - in stable: 10/sys/conf 9/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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 20:31:56 -0000 Author: dim Date: Mon Feb 17 20:31:54 2014 New Revision: 262130 URL: http://svnweb.freebsd.org/changeset/base/262130 Log: MFC r261902: In r260111, in sys/conf/files, I disabled warning about unused functions for the wrong mcg.c, the one in ofed/drivers/infiniband/hw/mlx4. Disable the warning for ofed/drivers/net/mlx4/mcg.c instead. Modified: stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/conf/files Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Mon Feb 17 20:30:29 2014 (r262129) +++ stable/10/sys/conf/files Mon Feb 17 20:31:54 2014 (r262130) @@ -3584,7 +3584,7 @@ ofed/drivers/infiniband/hw/mlx4/alias_GU compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" ofed/drivers/infiniband/hw/mlx4/mcg.c optional mlx4ib \ no-depend obj-prefix "mlx4ib_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/ -Wno-unused" + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" ofed/drivers/infiniband/hw/mlx4/sysfs.c optional mlx4ib \ no-depend obj-prefix "mlx4ib_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/infiniband/hw/mlx4/" @@ -3648,7 +3648,7 @@ ofed/drivers/net/mlx4/main.c optional compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" ofed/drivers/net/mlx4/mcg.c optional mlx4ib | mlxen \ no-depend obj-prefix "mlx4_" \ - compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" + compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/ -Wno-unused" ofed/drivers/net/mlx4/mr.c optional mlx4ib | mlxen \ no-depend obj-prefix "mlx4_" \ compile-with "${OFED_C_NOIMP} -I$S/ofed/drivers/net/mlx4/" From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 20:37:16 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85417697; Mon, 17 Feb 2014 20:37: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6E6E01D8F; Mon, 17 Feb 2014 20:37:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKbGBe038772; Mon, 17 Feb 2014 20:37:16 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKbGFq038771; Mon, 17 Feb 2014 20:37:16 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172037.s1HKbGFq038771@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:37: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: r262131 - in stable: 10/sys/conf 9/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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 20:37:16 -0000 Author: dim Date: Mon Feb 17 20:37:15 2014 New Revision: 262131 URL: http://svnweb.freebsd.org/changeset/base/262131 Log: MFC r261903: Disable warning about unused static const variables for sys/pci/ncr.c. Modified: stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/conf/files Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Mon Feb 17 20:31:54 2014 (r262130) +++ stable/10/sys/conf/files Mon Feb 17 20:37:15 2014 (r262131) @@ -3758,7 +3758,8 @@ pci/amdpm.c optional amdpm pci | nfpm pci/amdsmb.c optional amdsmb pci pci/if_rl.c optional rl pci pci/intpm.c optional intpm pci -pci/ncr.c optional ncr pci +pci/ncr.c optional ncr pci \ + compile-with "${NORMAL_C} -Wno-unused" pci/nfsmb.c optional nfsmb pci pci/viapm.c optional viapm pci rpc/auth_none.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 20:37:16 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2EB72696; Mon, 17 Feb 2014 20:37: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 195401D8E; Mon, 17 Feb 2014 20:37:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKbFqo038765; Mon, 17 Feb 2014 20:37:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKbFG1038764; Mon, 17 Feb 2014 20:37:15 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172037.s1HKbFG1038764@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:37:15 +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: r262131 - in stable: 10/sys/conf 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 20:37:16 -0000 Author: dim Date: Mon Feb 17 20:37:15 2014 New Revision: 262131 URL: http://svnweb.freebsd.org/changeset/base/262131 Log: MFC r261903: Disable warning about unused static const variables for sys/pci/ncr.c. Modified: stable/9/sys/conf/files Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/conf/files Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Mon Feb 17 20:31:54 2014 (r262130) +++ stable/9/sys/conf/files Mon Feb 17 20:37:15 2014 (r262131) @@ -3349,7 +3349,8 @@ pci/amdpm.c optional amdpm pci | nfpm pci/amdsmb.c optional amdsmb pci pci/if_rl.c optional rl pci pci/intpm.c optional intpm pci -pci/ncr.c optional ncr pci +pci/ncr.c optional ncr pci \ + compile-with "${NORMAL_C} -Wno-unused" pci/nfsmb.c optional nfsmb pci pci/viapm.c optional viapm pci rpc/auth_none.c optional krpc | nfslockd | nfsclient | nfsserver | nfscl | nfsd From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 20:45:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69199BA2; Mon, 17 Feb 2014 20:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 51E401F58; Mon, 17 Feb 2014 20:45:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HKjeRY042482; Mon, 17 Feb 2014 20:45:40 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HKjeNp042481; Mon, 17 Feb 2014 20:45:40 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402172045.s1HKjeNp042481@svn.freebsd.org> From: Dimitry Andric Date: Mon, 17 Feb 2014 20:45:40 +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: r262132 - stable/10/sys/dev/cxgbe/iw_cxgbe X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 20:45:40 -0000 Author: dim Date: Mon Feb 17 20:45:39 2014 New Revision: 262132 URL: http://svnweb.freebsd.org/changeset/base/262132 Log: MFC r261907: In cxgbe, conditionalize the t4_pgprot_wc() function, since it is only used when DOT5 is defined. Reviewed by: np Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/provider.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/cxgbe/iw_cxgbe/provider.c ============================================================================== --- stable/10/sys/dev/cxgbe/iw_cxgbe/provider.c Mon Feb 17 20:37:15 2014 (r262131) +++ stable/10/sys/dev/cxgbe/iw_cxgbe/provider.c Mon Feb 17 20:45:39 2014 (r262132) @@ -113,10 +113,12 @@ static struct ib_ucontext *c4iw_alloc_uc return &context->ibucontext; } +#ifdef DOT5 static inline pgprot_t t4_pgprot_wc(pgprot_t prot) { return pgprot_writecombine(prot); } +#endif static int c4iw_mmap(struct ib_ucontext *context, struct vm_area_struct *vma) { From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 22:19:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EFF7B3D1; Mon, 17 Feb 2014 22:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D8E6A1755; Mon, 17 Feb 2014 22:19:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HMJorp078278; Mon, 17 Feb 2014 22:19:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HMJnKl078272; Mon, 17 Feb 2014 22:19:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402172219.s1HMJnKl078272@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Feb 2014 22:19: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: r262134 - in stable: 10/sys/dev/pci 10/sys/sys 10/usr.sbin/pciconf 8/sys/dev/pci 8/sys/sys 8/usr.sbin/pciconf 9/sys/dev/pci 9/sys/sys 9/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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 22:19:51 -0000 Author: jhb Date: Mon Feb 17 22:19:49 2014 New Revision: 262134 URL: http://svnweb.freebsd.org/changeset/base/262134 Log: MFC 260926: Add support for displaying VPD for PCI devices via pciconf. - Store the length of each read-only VPD value since not all values are guaranteed to be ASCII values (though most are). - Add a new pciio ioctl to fetch VPD for a single PCI device. The values are returned as a list of variable length records, one for the device name and each keyword. - Add a new -V flag to pciconf's list mode which displays VPD data for each device. Modified: stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pci_user.c stable/10/sys/dev/pci/pcivar.h stable/10/sys/sys/pciio.h stable/10/usr.sbin/pciconf/pciconf.8 stable/10/usr.sbin/pciconf/pciconf.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/dev/pci/pci.c stable/8/sys/dev/pci/pci_user.c stable/8/sys/dev/pci/pcivar.h stable/8/sys/sys/pciio.h stable/8/usr.sbin/pciconf/pciconf.8 stable/8/usr.sbin/pciconf/pciconf.c stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pci_user.c stable/9/sys/dev/pci/pcivar.h stable/9/sys/sys/pciio.h stable/9/usr.sbin/pciconf/pciconf.8 stable/9/usr.sbin/pciconf/pciconf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/pci/ (props changed) stable/8/sys/sys/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) stable/9/usr.sbin/pciconf/ (props changed) Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/10/sys/dev/pci/pci.c Mon Feb 17 22:19:49 2014 (r262134) @@ -985,7 +985,7 @@ pci_read_vpd(device_t pcib, pcicfgregs * state = -2; break; } - dflen = byte2; + cfg->vpd.vpd_ros[off].len = dflen = byte2; if (dflen == 0 && strncmp(cfg->vpd.vpd_ros[off].keyword, "RV", 2) == 0) { @@ -1179,6 +1179,17 @@ pci_get_vpd_readonly_method(device_t dev return (ENXIO); } +struct pcicfg_vpd * +pci_fetch_vpd_list(device_t dev) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + pcicfgregs *cfg = &dinfo->cfg; + + if (!cfg->vpd.vpd_cached && cfg->vpd.vpd_reg != 0) + pci_read_vpd(device_get_parent(device_get_parent(dev)), cfg); + return (&cfg->vpd); +} + /* * Find the requested HyperTransport capability and return the offset * in configuration space via the pointer provided. The function Modified: stable/10/sys/dev/pci/pci_user.c ============================================================================== --- stable/10/sys/dev/pci/pci_user.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/10/sys/dev/pci/pci_user.c Mon Feb 17 22:19:49 2014 (r262134) @@ -407,6 +407,89 @@ pci_conf_match_old32(struct pci_match_co #endif /* PRE7_COMPAT */ static int +pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvio) +{ + struct pci_vpd_element vpd_element, *vpd_user; + struct pcicfg_vpd *vpd; + size_t len; + int error, i; + + vpd = pci_fetch_vpd_list(dev); + if (vpd->vpd_reg == 0 || vpd->vpd_ident == NULL) + return (ENXIO); + + /* + * Calculate the amount of space needed in the data buffer. An + * identifier element is always present followed by the read-only + * and read-write keywords. + */ + len = sizeof(struct pci_vpd_element) + strlen(vpd->vpd_ident); + for (i = 0; i < vpd->vpd_rocnt; i++) + len += sizeof(struct pci_vpd_element) + vpd->vpd_ros[i].len; + for (i = 0; i < vpd->vpd_wcnt; i++) + len += sizeof(struct pci_vpd_element) + vpd->vpd_w[i].len; + + if (lvio->plvi_len == 0) { + lvio->plvi_len = len; + return (0); + } + if (lvio->plvi_len < len) { + lvio->plvi_len = len; + return (ENOMEM); + } + + /* + * Copyout the identifier string followed by each keyword and + * value. + */ + vpd_user = lvio->plvi_data; + vpd_element.pve_keyword[0] = '\0'; + vpd_element.pve_keyword[1] = '\0'; + vpd_element.pve_flags = PVE_FLAG_IDENT; + vpd_element.pve_datalen = strlen(vpd->vpd_ident); + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_ident, vpd_user->pve_data, + strlen(vpd->vpd_ident)); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + vpd_element.pve_flags = 0; + for (i = 0; i < vpd->vpd_rocnt; i++) { + vpd_element.pve_keyword[0] = vpd->vpd_ros[i].keyword[0]; + vpd_element.pve_keyword[1] = vpd->vpd_ros[i].keyword[1]; + vpd_element.pve_datalen = vpd->vpd_ros[i].len; + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_ros[i].value, vpd_user->pve_data, + vpd->vpd_ros[i].len); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + } + vpd_element.pve_flags = PVE_FLAG_RW; + for (i = 0; i < vpd->vpd_wcnt; i++) { + vpd_element.pve_keyword[0] = vpd->vpd_w[i].keyword[0]; + vpd_element.pve_keyword[1] = vpd->vpd_w[i].keyword[1]; + vpd_element.pve_datalen = vpd->vpd_w[i].len; + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_w[i].value, vpd_user->pve_data, + vpd->vpd_w[i].len); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + } + KASSERT((char *)vpd_user - (char *)lvio->plvi_data == len, + ("length mismatch")); + lvio->plvi_len = len; + return (0); +} + +static int pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { device_t pcidev, brdev; @@ -417,6 +500,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, struct pci_devinfo *dinfo; struct pci_io *io; struct pci_bar_io *bio; + struct pci_list_vpd_io *lvio; struct pci_match_conf *pattern_buf; struct pci_map *pm; size_t confsz, iolen, pbufsz; @@ -433,19 +517,29 @@ pci_ioctl(struct cdev *dev, u_long cmd, struct pci_match_conf_old *pattern_buf_old = NULL; io_old = NULL; +#endif - if (!(flag & FWRITE) && cmd != PCIOCGETBAR && - cmd != PCIOCGETCONF && cmd != PCIOCGETCONF_OLD) - return EPERM; -#else - if (!(flag & FWRITE) && cmd != PCIOCGETBAR && cmd != PCIOCGETCONF) - return EPERM; + if (!(flag & FWRITE)) { + switch (cmd) { +#ifdef PRE7_COMPAT +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF_OLD32: +#endif + case PCIOCGETCONF_OLD: #endif + case PCIOCGETCONF: + case PCIOCGETBAR: + case PCIOCLISTVPD: + break; + default: + return (EPERM); + } + } - switch(cmd) { + switch (cmd) { #ifdef PRE7_COMPAT #ifdef COMPAT_FREEBSD32 - case PCIOCGETCONF_OLD32: + case PCIOCGETCONF_OLD32: cio32 = (struct pci_conf_io32 *)data; cio = malloc(sizeof(struct pci_conf_io), M_TEMP, M_WAITOK); cio->pat_buf_len = cio32->pat_buf_len; @@ -466,7 +560,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, cio = (struct pci_conf_io *)data; } - switch(cmd) { + switch (cmd) { #ifdef PRE7_COMPAT #ifdef COMPAT_FREEBSD32 case PCIOCGETCONF_OLD32: @@ -912,6 +1006,22 @@ getconfexit: else error = ENODEV; break; + case PCIOCLISTVPD: + lvio = (struct pci_list_vpd_io *)data; + + /* + * Assume that the user-level bus number is + * in fact the physical PCI bus number. + */ + pcidev = pci_find_dbsf(lvio->plvi_sel.pc_domain, + lvio->plvi_sel.pc_bus, lvio->plvi_sel.pc_dev, + lvio->plvi_sel.pc_func); + if (pcidev == NULL) { + error = ENODEV; + break; + } + error = pci_list_vpd(pcidev, lvio); + break; default: error = ENOTTY; break; Modified: stable/10/sys/dev/pci/pcivar.h ============================================================================== --- stable/10/sys/dev/pci/pcivar.h Mon Feb 17 22:06:52 2014 (r262133) +++ stable/10/sys/dev/pci/pcivar.h Mon Feb 17 22:19:49 2014 (r262134) @@ -57,6 +57,7 @@ struct pci_map { struct vpd_readonly { char keyword[2]; char *value; + int len; }; struct vpd_write { @@ -525,6 +526,7 @@ extern uint32_t pci_generation; struct pci_map *pci_find_bar(device_t dev, int reg); int pci_bar_enabled(device_t dev, struct pci_map *pm); +struct pcicfg_vpd *pci_fetch_vpd_list(device_t dev); #define VGA_PCI_BIOS_SHADOW_ADDR 0xC0000 #define VGA_PCI_BIOS_SHADOW_SIZE 131072 Modified: stable/10/sys/sys/pciio.h ============================================================================== --- stable/10/sys/sys/pciio.h Mon Feb 17 22:06:52 2014 (r262133) +++ stable/10/sys/sys/pciio.h Mon Feb 17 22:19:49 2014 (r262134) @@ -116,10 +116,31 @@ struct pci_bar_io { uint64_t pbi_length; /* length of BAR */ }; +struct pci_vpd_element { + char pve_keyword[2]; + uint8_t pve_flags; + uint8_t pve_datalen; + uint8_t pve_data[0]; +}; + +#define PVE_FLAG_IDENT 0x01 /* Element is the string identifier */ +#define PVE_FLAG_RW 0x02 /* Element is read/write */ + +#define PVE_NEXT(pve) \ + ((struct pci_vpd_element *)((char *)(pve) + \ + sizeof(struct pci_vpd_element) + (pve)->pve_datalen)) + +struct pci_list_vpd_io { + struct pcisel plvi_sel; /* device to operate on */ + size_t plvi_len; /* size of the data area */ + struct pci_vpd_element *plvi_data; +}; + #define PCIOCGETCONF _IOWR('p', 5, struct pci_conf_io) #define PCIOCREAD _IOWR('p', 2, struct pci_io) #define PCIOCWRITE _IOWR('p', 3, struct pci_io) #define PCIOCATTACHED _IOWR('p', 4, struct pci_io) #define PCIOCGETBAR _IOWR('p', 6, struct pci_bar_io) +#define PCIOCLISTVPD _IOWR('p', 7, struct pci_list_vpd_io) #endif /* !_SYS_PCIIO_H_ */ Modified: stable/10/usr.sbin/pciconf/pciconf.8 ============================================================================== --- stable/10/usr.sbin/pciconf/pciconf.8 Mon Feb 17 22:06:52 2014 (r262133) +++ stable/10/usr.sbin/pciconf/pciconf.8 Mon Feb 17 22:19:49 2014 (r262134) @@ -33,7 +33,7 @@ .Nd diagnostic utility for the PCI bus .Sh SYNOPSIS .Nm -.Fl l Oo Fl bcev Oc Op Ar device +.Fl l Oo Fl bcevV Oc Op Ar device .Nm .Fl a Ar device .Nm @@ -182,6 +182,28 @@ option is supplied, will attempt to load the vendor/device information database, and print vendor, device, class and subclass identification strings for each device. .Pp +If the +.Fl V +option is supplied, +.Nm +will list any vital product data +.Pq VPD +provided by each device. +Each VPD keyword is enumerated via a line in the following format: +.Bd -literal + VPD ro PN = '110114640C0 ' +.Ed +.Pp +The first string after the +.Dq Li VPD +prefix indicates if the keyword is read-only +.Dq ro +or read-write +.Dq rw . +The second string provides the keyword name. +The text after the the equals sign lists the value of the keyword which is +usually an ASCII string. +.Pp If the optional .Ar device argument is given with the Modified: stable/10/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/10/usr.sbin/pciconf/pciconf.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/10/usr.sbin/pciconf/pciconf.c Mon Feb 17 22:19:49 2014 (r262134) @@ -71,8 +71,9 @@ TAILQ_HEAD(,pci_vendor_info) pci_vendors static struct pcisel getsel(const char *str); static void list_bars(int fd, struct pci_conf *p); static void list_devs(const char *name, int verbose, int bars, int caps, - int errors); + int errors, int vpd); static void list_verbose(struct pci_conf *p); +static void list_vpd(int fd, struct pci_conf *p); static const char *guess_class(struct pci_conf *p); static const char *guess_subclass(struct pci_conf *p); static int load_vendors(void); @@ -86,7 +87,7 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: pciconf -l [-bcev] [device]", + "usage: pciconf -l [-bcevV] [device]", " pciconf -a device", " pciconf -r [-b | -h] device addr[:addr2]", " pciconf -w [-b | -h] device addr value"); @@ -98,13 +99,13 @@ main(int argc, char **argv) { int c; int listmode, readmode, writemode, attachedmode; - int bars, caps, errors, verbose; + int bars, caps, errors, verbose, vpd; int byte, isshort; listmode = readmode = writemode = attachedmode = 0; - bars = caps = errors = verbose = byte = isshort = 0; + bars = caps = errors = verbose = vpd = byte = isshort = 0; - while ((c = getopt(argc, argv, "abcehlrwv")) != -1) { + while ((c = getopt(argc, argv, "abcehlrwvV")) != -1) { switch(c) { case 'a': attachedmode = 1; @@ -143,6 +144,10 @@ main(int argc, char **argv) verbose = 1; break; + case 'V': + vpd = 1; + break; + default: usage(); } @@ -156,7 +161,7 @@ main(int argc, char **argv) if (listmode) { list_devs(optind + 1 == argc ? argv[optind] : NULL, verbose, - bars, caps, errors); + bars, caps, errors, vpd); } else if (attachedmode) { chkattached(argv[optind]); } else if (readmode) { @@ -173,7 +178,8 @@ main(int argc, char **argv) } static void -list_devs(const char *name, int verbose, int bars, int caps, int errors) +list_devs(const char *name, int verbose, int bars, int caps, int errors, + int vpd) { int fd; struct pci_conf_io pc; @@ -246,6 +252,8 @@ list_devs(const char *name, int verbose, list_caps(fd, p); if (errors) list_errors(fd, p); + if (vpd) + list_vpd(fd, p); } } while (pc.status == PCI_GETCONF_MORE_DEVS); @@ -339,6 +347,63 @@ list_verbose(struct pci_conf *p) printf(" subclass = %s\n", dp); } +static void +list_vpd(int fd, struct pci_conf *p) +{ + struct pci_list_vpd_io list; + struct pci_vpd_element *vpd, *end; + + list.plvi_sel = p->pc_sel; + list.plvi_len = 0; + list.plvi_data = NULL; + if (ioctl(fd, PCIOCLISTVPD, &list) < 0 || list.plvi_len == 0) + return; + + list.plvi_data = malloc(list.plvi_len); + if (ioctl(fd, PCIOCLISTVPD, &list) < 0) { + free(list.plvi_data); + return; + } + + vpd = list.plvi_data; + end = (struct pci_vpd_element *)((char *)vpd + list.plvi_len); + for (; vpd < end; vpd = PVE_NEXT(vpd)) { + if (vpd->pve_flags == PVE_FLAG_IDENT) { + printf(" VPD ident = '%.*s'\n", + (int)vpd->pve_datalen, vpd->pve_data); + continue; + } + + /* Ignore the checksum keyword. */ + if (!(vpd->pve_flags & PVE_FLAG_RW) && + memcmp(vpd->pve_keyword, "RV", 2) == 0) + continue; + + /* Ignore remaining read-write space. */ + if (vpd->pve_flags & PVE_FLAG_RW && + memcmp(vpd->pve_keyword, "RW", 2) == 0) + continue; + + /* Handle extended capability keyword. */ + if (!(vpd->pve_flags & PVE_FLAG_RW) && + memcmp(vpd->pve_keyword, "CP", 2) == 0) { + printf(" VPD ro CP = ID %02x in map 0x%x[0x%x]\n", + (unsigned int)vpd->pve_data[0], + PCIR_BAR((unsigned int)vpd->pve_data[1]), + (unsigned int)vpd->pve_data[3] << 8 | + (unsigned int)vpd->pve_data[2]); + continue; + } + + /* Remaining keywords should all have ASCII values. */ + printf(" VPD %s %c%c = '%.*s'\n", + vpd->pve_flags & PVE_FLAG_RW ? "rw" : "ro", + vpd->pve_keyword[0], vpd->pve_keyword[1], + (int)vpd->pve_datalen, vpd->pve_data); + } + free(list.plvi_data); +} + /* * This is a direct cut-and-paste from the table in sys/dev/pci/pci.c. */ From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 22:19:52 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7B2F63D2; Mon, 17 Feb 2014 22:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 485561756; Mon, 17 Feb 2014 22:19:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HMJqM9078289; Mon, 17 Feb 2014 22:19:52 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HMJpQc078283; Mon, 17 Feb 2014 22:19:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402172219.s1HMJpQc078283@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Feb 2014 22:19:51 +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: r262134 - in stable: 10/sys/dev/pci 10/sys/sys 10/usr.sbin/pciconf 8/sys/dev/pci 8/sys/sys 8/usr.sbin/pciconf 9/sys/dev/pci 9/sys/sys 9/usr.sbin/pciconf X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 22:19:52 -0000 Author: jhb Date: Mon Feb 17 22:19:49 2014 New Revision: 262134 URL: http://svnweb.freebsd.org/changeset/base/262134 Log: MFC 260926: Add support for displaying VPD for PCI devices via pciconf. - Store the length of each read-only VPD value since not all values are guaranteed to be ASCII values (though most are). - Add a new pciio ioctl to fetch VPD for a single PCI device. The values are returned as a list of variable length records, one for the device name and each keyword. - Add a new -V flag to pciconf's list mode which displays VPD data for each device. Modified: stable/8/sys/dev/pci/pci.c stable/8/sys/dev/pci/pci_user.c stable/8/sys/dev/pci/pcivar.h stable/8/sys/sys/pciio.h stable/8/usr.sbin/pciconf/pciconf.8 stable/8/usr.sbin/pciconf/pciconf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/pci/ (props changed) stable/8/sys/sys/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pci_user.c stable/10/sys/dev/pci/pcivar.h stable/10/sys/sys/pciio.h stable/10/usr.sbin/pciconf/pciconf.8 stable/10/usr.sbin/pciconf/pciconf.c stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pci_user.c stable/9/sys/dev/pci/pcivar.h stable/9/sys/sys/pciio.h stable/9/usr.sbin/pciconf/pciconf.8 stable/9/usr.sbin/pciconf/pciconf.c Directory Properties: stable/10/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) stable/9/usr.sbin/pciconf/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/8/sys/dev/pci/pci.c Mon Feb 17 22:19:49 2014 (r262134) @@ -978,7 +978,7 @@ pci_read_vpd(device_t pcib, pcicfgregs * state = -2; break; } - dflen = byte2; + cfg->vpd.vpd_ros[off].len = dflen = byte2; if (dflen == 0 && strncmp(cfg->vpd.vpd_ros[off].keyword, "RV", 2) == 0) { @@ -1179,6 +1179,17 @@ pci_get_vpd_readonly_method(device_t dev return (ENXIO); } +struct pcicfg_vpd * +pci_fetch_vpd_list(device_t dev) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + pcicfgregs *cfg = &dinfo->cfg; + + if (!cfg->vpd.vpd_cached && cfg->vpd.vpd_reg != 0) + pci_read_vpd(device_get_parent(device_get_parent(dev)), cfg); + return (&cfg->vpd); +} + /* * Find the requested extended capability and return the offset in * configuration space via the pointer provided. The function returns Modified: stable/8/sys/dev/pci/pci_user.c ============================================================================== --- stable/8/sys/dev/pci/pci_user.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/8/sys/dev/pci/pci_user.c Mon Feb 17 22:19:49 2014 (r262134) @@ -298,6 +298,89 @@ pci_conf_match_old(struct pci_match_conf #endif static int +pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvio) +{ + struct pci_vpd_element vpd_element, *vpd_user; + struct pcicfg_vpd *vpd; + size_t len; + int error, i; + + vpd = pci_fetch_vpd_list(dev); + if (vpd->vpd_reg == 0 || vpd->vpd_ident == NULL) + return (ENXIO); + + /* + * Calculate the amount of space needed in the data buffer. An + * identifier element is always present followed by the read-only + * and read-write keywords. + */ + len = sizeof(struct pci_vpd_element) + strlen(vpd->vpd_ident); + for (i = 0; i < vpd->vpd_rocnt; i++) + len += sizeof(struct pci_vpd_element) + vpd->vpd_ros[i].len; + for (i = 0; i < vpd->vpd_wcnt; i++) + len += sizeof(struct pci_vpd_element) + vpd->vpd_w[i].len; + + if (lvio->plvi_len == 0) { + lvio->plvi_len = len; + return (0); + } + if (lvio->plvi_len < len) { + lvio->plvi_len = len; + return (ENOMEM); + } + + /* + * Copyout the identifier string followed by each keyword and + * value. + */ + vpd_user = lvio->plvi_data; + vpd_element.pve_keyword[0] = '\0'; + vpd_element.pve_keyword[1] = '\0'; + vpd_element.pve_flags = PVE_FLAG_IDENT; + vpd_element.pve_datalen = strlen(vpd->vpd_ident); + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_ident, vpd_user->pve_data, + strlen(vpd->vpd_ident)); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + vpd_element.pve_flags = 0; + for (i = 0; i < vpd->vpd_rocnt; i++) { + vpd_element.pve_keyword[0] = vpd->vpd_ros[i].keyword[0]; + vpd_element.pve_keyword[1] = vpd->vpd_ros[i].keyword[1]; + vpd_element.pve_datalen = vpd->vpd_ros[i].len; + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_ros[i].value, vpd_user->pve_data, + vpd->vpd_ros[i].len); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + } + vpd_element.pve_flags = PVE_FLAG_RW; + for (i = 0; i < vpd->vpd_wcnt; i++) { + vpd_element.pve_keyword[0] = vpd->vpd_w[i].keyword[0]; + vpd_element.pve_keyword[1] = vpd->vpd_w[i].keyword[1]; + vpd_element.pve_datalen = vpd->vpd_w[i].len; + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_w[i].value, vpd_user->pve_data, + vpd->vpd_w[i].len); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + } + KASSERT((char *)vpd_user - (char *)lvio->plvi_data == len, + ("length mismatch")); + lvio->plvi_len = len; + return (0); +} + +static int pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { device_t pcidev, brdev; @@ -308,6 +391,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, struct pci_devinfo *dinfo; struct pci_io *io; struct pci_bar_io *bio; + struct pci_list_vpd_io *lvio; struct pci_match_conf *pattern_buf; struct pci_map *pm; size_t confsz, iolen, pbufsz; @@ -320,16 +404,23 @@ pci_ioctl(struct cdev *dev, u_long cmd, io_old = NULL; pattern_buf_old = NULL; +#endif - if (!(flag & FWRITE) && cmd != PCIOCGETBAR && - cmd != PCIOCGETCONF && cmd != PCIOCGETCONF_OLD) - return EPERM; -#else - if (!(flag & FWRITE) && cmd != PCIOCGETBAR && cmd != PCIOCGETCONF) - return EPERM; + if (!(flag & FWRITE)) { + switch (cmd) { +#ifdef PRE7_COMPAT + case PCIOCGETCONF_OLD: #endif + case PCIOCGETCONF: + case PCIOCGETBAR: + case PCIOCLISTVPD: + break; + default: + return (EPERM); + } + } - switch(cmd) { + switch (cmd) { #ifdef PRE7_COMPAT case PCIOCGETCONF_OLD: /* FALLTHROUGH */ @@ -694,6 +785,22 @@ getconfexit: bio->pbi_enabled = pci_bar_enabled(pcidev, pm); error = 0; break; + case PCIOCLISTVPD: + lvio = (struct pci_list_vpd_io *)data; + + /* + * Assume that the user-level bus number is + * in fact the physical PCI bus number. + */ + pcidev = pci_find_dbsf(lvio->plvi_sel.pc_domain, + lvio->plvi_sel.pc_bus, lvio->plvi_sel.pc_dev, + lvio->plvi_sel.pc_func); + if (pcidev == NULL) { + error = ENODEV; + break; + } + error = pci_list_vpd(pcidev, lvio); + break; default: error = ENOTTY; break; Modified: stable/8/sys/dev/pci/pcivar.h ============================================================================== --- stable/8/sys/dev/pci/pcivar.h Mon Feb 17 22:06:52 2014 (r262133) +++ stable/8/sys/dev/pci/pcivar.h Mon Feb 17 22:19:49 2014 (r262134) @@ -57,6 +57,7 @@ struct pci_map { struct vpd_readonly { char keyword[2]; char *value; + int len; }; struct vpd_write { @@ -488,5 +489,6 @@ extern uint32_t pci_generation; struct pci_map *pci_find_bar(device_t dev, int reg); int pci_bar_enabled(device_t dev, struct pci_map *pm); +struct pcicfg_vpd *pci_fetch_vpd_list(device_t dev); #endif /* _PCIVAR_H_ */ Modified: stable/8/sys/sys/pciio.h ============================================================================== --- stable/8/sys/sys/pciio.h Mon Feb 17 22:06:52 2014 (r262133) +++ stable/8/sys/sys/pciio.h Mon Feb 17 22:19:49 2014 (r262134) @@ -116,10 +116,31 @@ struct pci_bar_io { uint64_t pbi_length; /* length of BAR */ }; +struct pci_vpd_element { + char pve_keyword[2]; + uint8_t pve_flags; + uint8_t pve_datalen; + uint8_t pve_data[0]; +}; + +#define PVE_FLAG_IDENT 0x01 /* Element is the string identifier */ +#define PVE_FLAG_RW 0x02 /* Element is read/write */ + +#define PVE_NEXT(pve) \ + ((struct pci_vpd_element *)((char *)(pve) + \ + sizeof(struct pci_vpd_element) + (pve)->pve_datalen)) + +struct pci_list_vpd_io { + struct pcisel plvi_sel; /* device to operate on */ + size_t plvi_len; /* size of the data area */ + struct pci_vpd_element *plvi_data; +}; + #define PCIOCGETCONF _IOWR('p', 5, struct pci_conf_io) #define PCIOCREAD _IOWR('p', 2, struct pci_io) #define PCIOCWRITE _IOWR('p', 3, struct pci_io) #define PCIOCATTACHED _IOWR('p', 4, struct pci_io) #define PCIOCGETBAR _IOWR('p', 6, struct pci_bar_io) +#define PCIOCLISTVPD _IOWR('p', 7, struct pci_list_vpd_io) #endif /* !_SYS_PCIIO_H_ */ Modified: stable/8/usr.sbin/pciconf/pciconf.8 ============================================================================== --- stable/8/usr.sbin/pciconf/pciconf.8 Mon Feb 17 22:06:52 2014 (r262133) +++ stable/8/usr.sbin/pciconf/pciconf.8 Mon Feb 17 22:19:49 2014 (r262134) @@ -33,7 +33,7 @@ .Nd diagnostic utility for the PCI bus .Sh SYNOPSIS .Nm -.Fl l Oo Fl bcev Oc Op Ar device +.Fl l Oo Fl bcevV Oc Op Ar device .Nm .Fl a Ar device .Nm @@ -170,6 +170,28 @@ option is supplied, will attempt to load the vendor/device information database, and print vendor, device, class and subclass identification strings for each device. .Pp +If the +.Fl V +option is supplied, +.Nm +will list any vital product data +.Pq VPD +provided by each device. +Each VPD keyword is enumerated via a line in the following format: +.Bd -literal + VPD ro PN = '110114640C0 ' +.Ed +.Pp +The first string after the +.Dq Li VPD +prefix indicates if the keyword is read-only +.Dq ro +or read-write +.Dq rw . +The second string provides the keyword name. +The text after the the equals sign lists the value of the keyword which is +usually an ASCII string. +.Pp If the optional .Ar device argument is given with the Modified: stable/8/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/8/usr.sbin/pciconf/pciconf.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/8/usr.sbin/pciconf/pciconf.c Mon Feb 17 22:19:49 2014 (r262134) @@ -71,8 +71,9 @@ TAILQ_HEAD(,pci_vendor_info) pci_vendors static struct pcisel getsel(const char *str); static void list_bars(int fd, struct pci_conf *p); static void list_devs(const char *name, int verbose, int bars, int caps, - int errors); + int errors, int vpd); static void list_verbose(struct pci_conf *p); +static void list_vpd(int fd, struct pci_conf *p); static const char *guess_class(struct pci_conf *p); static const char *guess_subclass(struct pci_conf *p); static int load_vendors(void); @@ -86,7 +87,7 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: pciconf -l [-bcev] [device]", + "usage: pciconf -l [-bcevV] [device]", " pciconf -a device", " pciconf -r [-b | -h] device addr[:addr2]", " pciconf -w [-b | -h] device addr value"); @@ -98,13 +99,13 @@ main(int argc, char **argv) { int c; int listmode, readmode, writemode, attachedmode; - int bars, caps, errors, verbose; + int bars, caps, errors, verbose, vpd; int byte, isshort; listmode = readmode = writemode = attachedmode = 0; - bars = caps = errors = verbose = byte = isshort = 0; + bars = caps = errors = verbose = vpd = byte = isshort = 0; - while ((c = getopt(argc, argv, "abcehlrwv")) != -1) { + while ((c = getopt(argc, argv, "abcehlrwvV")) != -1) { switch(c) { case 'a': attachedmode = 1; @@ -143,6 +144,10 @@ main(int argc, char **argv) verbose = 1; break; + case 'V': + vpd = 1; + break; + default: usage(); } @@ -156,7 +161,7 @@ main(int argc, char **argv) if (listmode) { list_devs(optind + 1 == argc ? argv[optind] : NULL, verbose, - bars, caps, errors); + bars, caps, errors, vpd); } else if (attachedmode) { chkattached(argv[optind]); } else if (readmode) { @@ -173,7 +178,8 @@ main(int argc, char **argv) } static void -list_devs(const char *name, int verbose, int bars, int caps, int errors) +list_devs(const char *name, int verbose, int bars, int caps, int errors, + int vpd) { int fd; struct pci_conf_io pc; @@ -246,6 +252,8 @@ list_devs(const char *name, int verbose, list_caps(fd, p); if (errors) list_errors(fd, p); + if (vpd) + list_vpd(fd, p); } } while (pc.status == PCI_GETCONF_MORE_DEVS); @@ -339,6 +347,63 @@ list_verbose(struct pci_conf *p) printf(" subclass = %s\n", dp); } +static void +list_vpd(int fd, struct pci_conf *p) +{ + struct pci_list_vpd_io list; + struct pci_vpd_element *vpd, *end; + + list.plvi_sel = p->pc_sel; + list.plvi_len = 0; + list.plvi_data = NULL; + if (ioctl(fd, PCIOCLISTVPD, &list) < 0 || list.plvi_len == 0) + return; + + list.plvi_data = malloc(list.plvi_len); + if (ioctl(fd, PCIOCLISTVPD, &list) < 0) { + free(list.plvi_data); + return; + } + + vpd = list.plvi_data; + end = (struct pci_vpd_element *)((char *)vpd + list.plvi_len); + for (; vpd < end; vpd = PVE_NEXT(vpd)) { + if (vpd->pve_flags == PVE_FLAG_IDENT) { + printf(" VPD ident = '%.*s'\n", + (int)vpd->pve_datalen, vpd->pve_data); + continue; + } + + /* Ignore the checksum keyword. */ + if (!(vpd->pve_flags & PVE_FLAG_RW) && + memcmp(vpd->pve_keyword, "RV", 2) == 0) + continue; + + /* Ignore remaining read-write space. */ + if (vpd->pve_flags & PVE_FLAG_RW && + memcmp(vpd->pve_keyword, "RW", 2) == 0) + continue; + + /* Handle extended capability keyword. */ + if (!(vpd->pve_flags & PVE_FLAG_RW) && + memcmp(vpd->pve_keyword, "CP", 2) == 0) { + printf(" VPD ro CP = ID %02x in map 0x%x[0x%x]\n", + (unsigned int)vpd->pve_data[0], + PCIR_BAR((unsigned int)vpd->pve_data[1]), + (unsigned int)vpd->pve_data[3] << 8 | + (unsigned int)vpd->pve_data[2]); + continue; + } + + /* Remaining keywords should all have ASCII values. */ + printf(" VPD %s %c%c = '%.*s'\n", + vpd->pve_flags & PVE_FLAG_RW ? "rw" : "ro", + vpd->pve_keyword[0], vpd->pve_keyword[1], + (int)vpd->pve_datalen, vpd->pve_data); + } + free(list.plvi_data); +} + /* * This is a direct cut-and-paste from the table in sys/dev/pci/pci.c. */ From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 22:19:53 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD0443D3; Mon, 17 Feb 2014 22:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 945CC1757; Mon, 17 Feb 2014 22:19:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HMJr3q078301; Mon, 17 Feb 2014 22:19:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HMJq7U078294; Mon, 17 Feb 2014 22:19:52 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402172219.s1HMJq7U078294@svn.freebsd.org> From: John Baldwin Date: Mon, 17 Feb 2014 22:19:52 +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: r262134 - in stable: 10/sys/dev/pci 10/sys/sys 10/usr.sbin/pciconf 8/sys/dev/pci 8/sys/sys 8/usr.sbin/pciconf 9/sys/dev/pci 9/sys/sys 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 22:19:53 -0000 Author: jhb Date: Mon Feb 17 22:19:49 2014 New Revision: 262134 URL: http://svnweb.freebsd.org/changeset/base/262134 Log: MFC 260926: Add support for displaying VPD for PCI devices via pciconf. - Store the length of each read-only VPD value since not all values are guaranteed to be ASCII values (though most are). - Add a new pciio ioctl to fetch VPD for a single PCI device. The values are returned as a list of variable length records, one for the device name and each keyword. - Add a new -V flag to pciconf's list mode which displays VPD data for each device. Modified: stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pci_user.c stable/9/sys/dev/pci/pcivar.h stable/9/sys/sys/pciio.h stable/9/usr.sbin/pciconf/pciconf.8 stable/9/usr.sbin/pciconf/pciconf.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) stable/9/usr.sbin/pciconf/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pci_user.c stable/10/sys/dev/pci/pcivar.h stable/10/sys/sys/pciio.h stable/10/usr.sbin/pciconf/pciconf.8 stable/10/usr.sbin/pciconf/pciconf.c stable/8/sys/dev/pci/pci.c stable/8/sys/dev/pci/pci_user.c stable/8/sys/dev/pci/pcivar.h stable/8/sys/sys/pciio.h stable/8/usr.sbin/pciconf/pciconf.8 stable/8/usr.sbin/pciconf/pciconf.c Directory Properties: stable/10/ (props changed) stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/pci/ (props changed) stable/8/sys/sys/ (props changed) stable/8/usr.sbin/pciconf/ (props changed) Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/9/sys/dev/pci/pci.c Mon Feb 17 22:19:49 2014 (r262134) @@ -995,7 +995,7 @@ pci_read_vpd(device_t pcib, pcicfgregs * state = -2; break; } - dflen = byte2; + cfg->vpd.vpd_ros[off].len = dflen = byte2; if (dflen == 0 && strncmp(cfg->vpd.vpd_ros[off].keyword, "RV", 2) == 0) { @@ -1196,6 +1196,17 @@ pci_get_vpd_readonly_method(device_t dev return (ENXIO); } +struct pcicfg_vpd * +pci_fetch_vpd_list(device_t dev) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + pcicfgregs *cfg = &dinfo->cfg; + + if (!cfg->vpd.vpd_cached && cfg->vpd.vpd_reg != 0) + pci_read_vpd(device_get_parent(device_get_parent(dev)), cfg); + return (&cfg->vpd); +} + /* * Find the requested extended capability and return the offset in * configuration space via the pointer provided. The function returns Modified: stable/9/sys/dev/pci/pci_user.c ============================================================================== --- stable/9/sys/dev/pci/pci_user.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/9/sys/dev/pci/pci_user.c Mon Feb 17 22:19:49 2014 (r262134) @@ -407,6 +407,89 @@ pci_conf_match_old32(struct pci_match_co #endif /* PRE7_COMPAT */ static int +pci_list_vpd(device_t dev, struct pci_list_vpd_io *lvio) +{ + struct pci_vpd_element vpd_element, *vpd_user; + struct pcicfg_vpd *vpd; + size_t len; + int error, i; + + vpd = pci_fetch_vpd_list(dev); + if (vpd->vpd_reg == 0 || vpd->vpd_ident == NULL) + return (ENXIO); + + /* + * Calculate the amount of space needed in the data buffer. An + * identifier element is always present followed by the read-only + * and read-write keywords. + */ + len = sizeof(struct pci_vpd_element) + strlen(vpd->vpd_ident); + for (i = 0; i < vpd->vpd_rocnt; i++) + len += sizeof(struct pci_vpd_element) + vpd->vpd_ros[i].len; + for (i = 0; i < vpd->vpd_wcnt; i++) + len += sizeof(struct pci_vpd_element) + vpd->vpd_w[i].len; + + if (lvio->plvi_len == 0) { + lvio->plvi_len = len; + return (0); + } + if (lvio->plvi_len < len) { + lvio->plvi_len = len; + return (ENOMEM); + } + + /* + * Copyout the identifier string followed by each keyword and + * value. + */ + vpd_user = lvio->plvi_data; + vpd_element.pve_keyword[0] = '\0'; + vpd_element.pve_keyword[1] = '\0'; + vpd_element.pve_flags = PVE_FLAG_IDENT; + vpd_element.pve_datalen = strlen(vpd->vpd_ident); + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_ident, vpd_user->pve_data, + strlen(vpd->vpd_ident)); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + vpd_element.pve_flags = 0; + for (i = 0; i < vpd->vpd_rocnt; i++) { + vpd_element.pve_keyword[0] = vpd->vpd_ros[i].keyword[0]; + vpd_element.pve_keyword[1] = vpd->vpd_ros[i].keyword[1]; + vpd_element.pve_datalen = vpd->vpd_ros[i].len; + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_ros[i].value, vpd_user->pve_data, + vpd->vpd_ros[i].len); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + } + vpd_element.pve_flags = PVE_FLAG_RW; + for (i = 0; i < vpd->vpd_wcnt; i++) { + vpd_element.pve_keyword[0] = vpd->vpd_w[i].keyword[0]; + vpd_element.pve_keyword[1] = vpd->vpd_w[i].keyword[1]; + vpd_element.pve_datalen = vpd->vpd_w[i].len; + error = copyout(&vpd_element, vpd_user, sizeof(vpd_element)); + if (error) + return (error); + error = copyout(vpd->vpd_w[i].value, vpd_user->pve_data, + vpd->vpd_w[i].len); + if (error) + return (error); + vpd_user = PVE_NEXT(vpd_user); + } + KASSERT((char *)vpd_user - (char *)lvio->plvi_data == len, + ("length mismatch")); + lvio->plvi_len = len; + return (0); +} + +static int pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *td) { device_t pcidev, brdev; @@ -417,6 +500,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, struct pci_devinfo *dinfo; struct pci_io *io; struct pci_bar_io *bio; + struct pci_list_vpd_io *lvio; struct pci_match_conf *pattern_buf; struct pci_map *pm; size_t confsz, iolen, pbufsz; @@ -433,19 +517,29 @@ pci_ioctl(struct cdev *dev, u_long cmd, struct pci_match_conf_old *pattern_buf_old = NULL; io_old = NULL; +#endif - if (!(flag & FWRITE) && cmd != PCIOCGETBAR && - cmd != PCIOCGETCONF && cmd != PCIOCGETCONF_OLD) - return EPERM; -#else - if (!(flag & FWRITE) && cmd != PCIOCGETBAR && cmd != PCIOCGETCONF) - return EPERM; + if (!(flag & FWRITE)) { + switch (cmd) { +#ifdef PRE7_COMPAT +#ifdef COMPAT_FREEBSD32 + case PCIOCGETCONF_OLD32: +#endif + case PCIOCGETCONF_OLD: #endif + case PCIOCGETCONF: + case PCIOCGETBAR: + case PCIOCLISTVPD: + break; + default: + return (EPERM); + } + } - switch(cmd) { + switch (cmd) { #ifdef PRE7_COMPAT #ifdef COMPAT_FREEBSD32 - case PCIOCGETCONF_OLD32: + case PCIOCGETCONF_OLD32: cio32 = (struct pci_conf_io32 *)data; cio = malloc(sizeof(struct pci_conf_io), M_TEMP, M_WAITOK); cio->pat_buf_len = cio32->pat_buf_len; @@ -466,7 +560,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, cio = (struct pci_conf_io *)data; } - switch(cmd) { + switch (cmd) { #ifdef PRE7_COMPAT #ifdef COMPAT_FREEBSD32 case PCIOCGETCONF_OLD32: @@ -912,6 +1006,22 @@ getconfexit: else error = ENODEV; break; + case PCIOCLISTVPD: + lvio = (struct pci_list_vpd_io *)data; + + /* + * Assume that the user-level bus number is + * in fact the physical PCI bus number. + */ + pcidev = pci_find_dbsf(lvio->plvi_sel.pc_domain, + lvio->plvi_sel.pc_bus, lvio->plvi_sel.pc_dev, + lvio->plvi_sel.pc_func); + if (pcidev == NULL) { + error = ENODEV; + break; + } + error = pci_list_vpd(pcidev, lvio); + break; default: error = ENOTTY; break; Modified: stable/9/sys/dev/pci/pcivar.h ============================================================================== --- stable/9/sys/dev/pci/pcivar.h Mon Feb 17 22:06:52 2014 (r262133) +++ stable/9/sys/dev/pci/pcivar.h Mon Feb 17 22:19:49 2014 (r262134) @@ -57,6 +57,7 @@ struct pci_map { struct vpd_readonly { char keyword[2]; char *value; + int len; }; struct vpd_write { @@ -489,6 +490,7 @@ extern uint32_t pci_generation; struct pci_map *pci_find_bar(device_t dev, int reg); int pci_bar_enabled(device_t dev, struct pci_map *pm); +struct pcicfg_vpd *pci_fetch_vpd_list(device_t dev); #define VGA_PCI_BIOS_SHADOW_ADDR 0xC0000 #define VGA_PCI_BIOS_SHADOW_SIZE 131072 Modified: stable/9/sys/sys/pciio.h ============================================================================== --- stable/9/sys/sys/pciio.h Mon Feb 17 22:06:52 2014 (r262133) +++ stable/9/sys/sys/pciio.h Mon Feb 17 22:19:49 2014 (r262134) @@ -116,10 +116,31 @@ struct pci_bar_io { uint64_t pbi_length; /* length of BAR */ }; +struct pci_vpd_element { + char pve_keyword[2]; + uint8_t pve_flags; + uint8_t pve_datalen; + uint8_t pve_data[0]; +}; + +#define PVE_FLAG_IDENT 0x01 /* Element is the string identifier */ +#define PVE_FLAG_RW 0x02 /* Element is read/write */ + +#define PVE_NEXT(pve) \ + ((struct pci_vpd_element *)((char *)(pve) + \ + sizeof(struct pci_vpd_element) + (pve)->pve_datalen)) + +struct pci_list_vpd_io { + struct pcisel plvi_sel; /* device to operate on */ + size_t plvi_len; /* size of the data area */ + struct pci_vpd_element *plvi_data; +}; + #define PCIOCGETCONF _IOWR('p', 5, struct pci_conf_io) #define PCIOCREAD _IOWR('p', 2, struct pci_io) #define PCIOCWRITE _IOWR('p', 3, struct pci_io) #define PCIOCATTACHED _IOWR('p', 4, struct pci_io) #define PCIOCGETBAR _IOWR('p', 6, struct pci_bar_io) +#define PCIOCLISTVPD _IOWR('p', 7, struct pci_list_vpd_io) #endif /* !_SYS_PCIIO_H_ */ Modified: stable/9/usr.sbin/pciconf/pciconf.8 ============================================================================== --- stable/9/usr.sbin/pciconf/pciconf.8 Mon Feb 17 22:06:52 2014 (r262133) +++ stable/9/usr.sbin/pciconf/pciconf.8 Mon Feb 17 22:19:49 2014 (r262134) @@ -33,7 +33,7 @@ .Nd diagnostic utility for the PCI bus .Sh SYNOPSIS .Nm -.Fl l Oo Fl bcev Oc Op Ar device +.Fl l Oo Fl bcevV Oc Op Ar device .Nm .Fl a Ar device .Nm @@ -182,6 +182,28 @@ option is supplied, will attempt to load the vendor/device information database, and print vendor, device, class and subclass identification strings for each device. .Pp +If the +.Fl V +option is supplied, +.Nm +will list any vital product data +.Pq VPD +provided by each device. +Each VPD keyword is enumerated via a line in the following format: +.Bd -literal + VPD ro PN = '110114640C0 ' +.Ed +.Pp +The first string after the +.Dq Li VPD +prefix indicates if the keyword is read-only +.Dq ro +or read-write +.Dq rw . +The second string provides the keyword name. +The text after the the equals sign lists the value of the keyword which is +usually an ASCII string. +.Pp If the optional .Ar device argument is given with the Modified: stable/9/usr.sbin/pciconf/pciconf.c ============================================================================== --- stable/9/usr.sbin/pciconf/pciconf.c Mon Feb 17 22:06:52 2014 (r262133) +++ stable/9/usr.sbin/pciconf/pciconf.c Mon Feb 17 22:19:49 2014 (r262134) @@ -71,8 +71,9 @@ TAILQ_HEAD(,pci_vendor_info) pci_vendors static struct pcisel getsel(const char *str); static void list_bars(int fd, struct pci_conf *p); static void list_devs(const char *name, int verbose, int bars, int caps, - int errors); + int errors, int vpd); static void list_verbose(struct pci_conf *p); +static void list_vpd(int fd, struct pci_conf *p); static const char *guess_class(struct pci_conf *p); static const char *guess_subclass(struct pci_conf *p); static int load_vendors(void); @@ -86,7 +87,7 @@ static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n", - "usage: pciconf -l [-bcev] [device]", + "usage: pciconf -l [-bcevV] [device]", " pciconf -a device", " pciconf -r [-b | -h] device addr[:addr2]", " pciconf -w [-b | -h] device addr value"); @@ -98,13 +99,13 @@ main(int argc, char **argv) { int c; int listmode, readmode, writemode, attachedmode; - int bars, caps, errors, verbose; + int bars, caps, errors, verbose, vpd; int byte, isshort; listmode = readmode = writemode = attachedmode = 0; - bars = caps = errors = verbose = byte = isshort = 0; + bars = caps = errors = verbose = vpd = byte = isshort = 0; - while ((c = getopt(argc, argv, "abcehlrwv")) != -1) { + while ((c = getopt(argc, argv, "abcehlrwvV")) != -1) { switch(c) { case 'a': attachedmode = 1; @@ -143,6 +144,10 @@ main(int argc, char **argv) verbose = 1; break; + case 'V': + vpd = 1; + break; + default: usage(); } @@ -156,7 +161,7 @@ main(int argc, char **argv) if (listmode) { list_devs(optind + 1 == argc ? argv[optind] : NULL, verbose, - bars, caps, errors); + bars, caps, errors, vpd); } else if (attachedmode) { chkattached(argv[optind]); } else if (readmode) { @@ -173,7 +178,8 @@ main(int argc, char **argv) } static void -list_devs(const char *name, int verbose, int bars, int caps, int errors) +list_devs(const char *name, int verbose, int bars, int caps, int errors, + int vpd) { int fd; struct pci_conf_io pc; @@ -246,6 +252,8 @@ list_devs(const char *name, int verbose, list_caps(fd, p); if (errors) list_errors(fd, p); + if (vpd) + list_vpd(fd, p); } } while (pc.status == PCI_GETCONF_MORE_DEVS); @@ -339,6 +347,63 @@ list_verbose(struct pci_conf *p) printf(" subclass = %s\n", dp); } +static void +list_vpd(int fd, struct pci_conf *p) +{ + struct pci_list_vpd_io list; + struct pci_vpd_element *vpd, *end; + + list.plvi_sel = p->pc_sel; + list.plvi_len = 0; + list.plvi_data = NULL; + if (ioctl(fd, PCIOCLISTVPD, &list) < 0 || list.plvi_len == 0) + return; + + list.plvi_data = malloc(list.plvi_len); + if (ioctl(fd, PCIOCLISTVPD, &list) < 0) { + free(list.plvi_data); + return; + } + + vpd = list.plvi_data; + end = (struct pci_vpd_element *)((char *)vpd + list.plvi_len); + for (; vpd < end; vpd = PVE_NEXT(vpd)) { + if (vpd->pve_flags == PVE_FLAG_IDENT) { + printf(" VPD ident = '%.*s'\n", + (int)vpd->pve_datalen, vpd->pve_data); + continue; + } + + /* Ignore the checksum keyword. */ + if (!(vpd->pve_flags & PVE_FLAG_RW) && + memcmp(vpd->pve_keyword, "RV", 2) == 0) + continue; + + /* Ignore remaining read-write space. */ + if (vpd->pve_flags & PVE_FLAG_RW && + memcmp(vpd->pve_keyword, "RW", 2) == 0) + continue; + + /* Handle extended capability keyword. */ + if (!(vpd->pve_flags & PVE_FLAG_RW) && + memcmp(vpd->pve_keyword, "CP", 2) == 0) { + printf(" VPD ro CP = ID %02x in map 0x%x[0x%x]\n", + (unsigned int)vpd->pve_data[0], + PCIR_BAR((unsigned int)vpd->pve_data[1]), + (unsigned int)vpd->pve_data[3] << 8 | + (unsigned int)vpd->pve_data[2]); + continue; + } + + /* Remaining keywords should all have ASCII values. */ + printf(" VPD %s %c%c = '%.*s'\n", + vpd->pve_flags & PVE_FLAG_RW ? "rw" : "ro", + vpd->pve_keyword[0], vpd->pve_keyword[1], + (int)vpd->pve_datalen, vpd->pve_data); + } + free(list.plvi_data); +} + /* * This is a direct cut-and-paste from the table in sys/dev/pci/pci.c. */ From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 22:40:06 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 76DE01AE; Mon, 17 Feb 2014 22:40: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5E52E1960; Mon, 17 Feb 2014 22:40:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HMe64I086820; Mon, 17 Feb 2014 22:40:06 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HMe5aG086811; Mon, 17 Feb 2014 22:40:05 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402172240.s1HMe5aG086811@svn.freebsd.org> From: Mark Johnston Date: Mon, 17 Feb 2014 22:40: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: r262137 - in stable/10: share/man/man4 sys/conf sys/dev/usb sys/dev/usb/net sys/modules/usb sys/modules/usb/axge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 22:40:06 -0000 Author: markj Date: Mon Feb 17 22:40:05 2014 New Revision: 262137 URL: http://svnweb.freebsd.org/changeset/base/262137 Log: MFC r258036: Add IDs for the ASIX 88179 and 88178A USB to GigE adapters. MFC r258331: Import the axge(4) driver for the ASIX AX88178A and AX88179 USB Ethernet adapters. Both devices support Gigabit Ethernet and USB 2.0, and the AX88179 supports USB 3.0. MFC r258617 (by lwhsu): Also note to add xhci(4) to kernel configuration to utilize USB 3.0 MFC r258618 (by lwhsu): Mention axge(4) Added: stable/10/share/man/man4/axge.4 - copied, changed from r258331, head/share/man/man4/axge.4 stable/10/sys/dev/usb/net/if_axge.c - copied unchanged from r258331, head/sys/dev/usb/net/if_axge.c stable/10/sys/dev/usb/net/if_axgereg.h - copied unchanged from r258331, head/sys/dev/usb/net/if_axgereg.h stable/10/sys/modules/usb/axge/ - copied from r258331, head/sys/modules/usb/axge/ Modified: stable/10/share/man/man4/Makefile stable/10/share/man/man4/usb.4 stable/10/sys/conf/files stable/10/sys/dev/usb/usbdevs stable/10/sys/modules/usb/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/Makefile ============================================================================== --- stable/10/share/man/man4/Makefile Mon Feb 17 22:27:32 2014 (r262136) +++ stable/10/share/man/man4/Makefile Mon Feb 17 22:40:05 2014 (r262137) @@ -67,6 +67,7 @@ MAN= aac.4 \ auditpipe.4 \ aue.4 \ axe.4 \ + axge.4 \ bce.4 \ bfe.4 \ bge.4 \ Copied and modified: stable/10/share/man/man4/axge.4 (from r258331, head/share/man/man4/axge.4) ============================================================================== --- head/share/man/man4/axge.4 Tue Nov 19 00:37:53 2013 (r258331, copy source) +++ stable/10/share/man/man4/axge.4 Mon Feb 17 22:40:05 2014 (r262137) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2013 +.Dd November 22, 2013 .Dt AXGE 4 .Os .Sh NAME @@ -41,6 +41,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device xhci" .Cd "device ehci" .Cd "device uhci" .Cd "device ohci" Modified: stable/10/share/man/man4/usb.4 ============================================================================== --- stable/10/share/man/man4/usb.4 Mon Feb 17 22:27:32 2014 (r262136) +++ stable/10/share/man/man4/usb.4 Mon Feb 17 22:40:05 2014 (r262137) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2009 +.Dd November 26, 2013 .Dt USB 4 .Os .Sh NAME @@ -147,6 +147,7 @@ specifications can be found at: .Xr usbdi 4 , .Xr aue 4 , .Xr axe 4 , +.Xr axge 4 , .Xr cue 4 , .Xr ehci 4 , .Xr kue 4 , Modified: stable/10/sys/conf/files ============================================================================== --- stable/10/sys/conf/files Mon Feb 17 22:27:32 2014 (r262136) +++ stable/10/sys/conf/files Mon Feb 17 22:40:05 2014 (r262137) @@ -2342,6 +2342,7 @@ dev/usb/usb_util.c optional usb # dev/usb/net/if_aue.c optional aue dev/usb/net/if_axe.c optional axe +dev/usb/net/if_axge.c optional axge dev/usb/net/if_cdce.c optional cdce dev/usb/net/if_cue.c optional cue dev/usb/net/if_ipheth.c optional ipheth @@ -2352,8 +2353,8 @@ dev/usb/net/if_smsc.c optional smsc dev/usb/net/if_udav.c optional udav dev/usb/net/if_usie.c optional usie dev/usb/net/ruephy.c optional rue -dev/usb/net/usb_ethernet.c optional aue | axe | cdce | cue | kue | mos | \ - rue | smsc | udav | ipheth +dev/usb/net/usb_ethernet.c optional aue | axe | axge | cdce | cue | kue | \ + mos | rue | smsc | udav | ipheth dev/usb/net/uhso.c optional uhso # # USB WLAN drivers Copied: stable/10/sys/dev/usb/net/if_axge.c (from r258331, head/sys/dev/usb/net/if_axge.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/usb/net/if_axge.c Mon Feb 17 22:40:05 2014 (r262137, copy of r258331, head/sys/dev/usb/net/if_axge.c) @@ -0,0 +1,1023 @@ +/*- + * Copyright (c) 2013 Kevin Lo + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * ASIX Electronics AX88178A/AX88179 USB 2.0/3.0 gigabit ethernet driver. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include "usbdevs.h" + +#define USB_DEBUG_VAR axge_debug +#include +#include + +#include +#include + +/* + * Various supported device vendors/products. + */ + +static const STRUCT_USB_HOST_ID axge_devs[] = { +#define AXGE_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } + AXGE_DEV(ASIX, AX88178A), + AXGE_DEV(ASIX, AX88179), + /* AXGE_DEV(SITECOMEU, LN032), */ +#undef AXGE_DEV +}; + +static const struct { + unsigned char ctrl, timer_l, timer_h, size, ifg; +} AX88179_BULKIN_SIZE[] = { + {7, 0x4f, 0, 0x12, 0xff}, + {7, 0x20, 3, 0x16, 0xff}, + {7, 0xae, 7, 0x18, 0xff}, + {7, 0xcc, 0x4c, 0x18, 8}, +}; + +/* prototypes */ + +static device_probe_t axge_probe; +static device_attach_t axge_attach; +static device_detach_t axge_detach; + +static usb_callback_t axge_bulk_read_callback; +static usb_callback_t axge_bulk_write_callback; + +static miibus_readreg_t axge_miibus_readreg; +static miibus_writereg_t axge_miibus_writereg; +static miibus_statchg_t axge_miibus_statchg; + +static uether_fn_t axge_attach_post; +static uether_fn_t axge_init; +static uether_fn_t axge_stop; +static uether_fn_t axge_start; +static uether_fn_t axge_tick; +static uether_fn_t axge_setmulti; +static uether_fn_t axge_setpromisc; + +static int axge_read_mem(struct axge_softc *, uint8_t, uint16_t, + uint16_t, void *, int); +static void axge_write_mem(struct axge_softc *, uint8_t, uint16_t, + uint16_t, void *, int); +static uint16_t axge_read_cmd_2(struct axge_softc *, uint8_t, uint16_t, + uint16_t); +static void axge_write_cmd_1(struct axge_softc *, uint8_t, uint16_t, + uint16_t, uint8_t); +static void axge_write_cmd_2(struct axge_softc *, uint8_t, uint16_t, + uint16_t, uint16_t); +static void axge_chip_init(struct axge_softc *); +static void axge_reset(struct axge_softc *); + +static int axge_attach_post_sub(struct usb_ether *); +static int axge_ifmedia_upd(struct ifnet *); +static void axge_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int axge_ioctl(struct ifnet *, u_long, caddr_t); +static int axge_rx_frame(struct usb_ether *, struct usb_page_cache *, int); +static int axge_rxeof(struct usb_ether *, struct usb_page_cache *, + unsigned int, unsigned int, struct axge_csum_hdr *); +static void axge_csum_cfg(struct usb_ether *); + +#define AXGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) + +#ifdef USB_DEBUG +static int axge_debug = 0; + +static SYSCTL_NODE(_hw_usb, OID_AUTO, axge, CTLFLAG_RW, 0, "USB axge"); +SYSCTL_INT(_hw_usb_axge, OID_AUTO, debug, CTLFLAG_RW, &axge_debug, 0, + "Debug level"); +#endif + +static const struct usb_config axge_config[AXGE_N_TRANSFER] = { + [AXGE_BULK_DT_WR] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .frames = 16, + .bufsize = 16 * (MCLBYTES + 16), + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = axge_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ + }, + [AXGE_BULK_DT_RD] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 20480, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = axge_bulk_read_callback, + .timeout = 0, /* no timeout */ + }, +}; + +static device_method_t axge_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, axge_probe), + DEVMETHOD(device_attach, axge_attach), + DEVMETHOD(device_detach, axge_detach), + + /* MII interface. */ + DEVMETHOD(miibus_readreg, axge_miibus_readreg), + DEVMETHOD(miibus_writereg, axge_miibus_writereg), + DEVMETHOD(miibus_statchg, axge_miibus_statchg), + + DEVMETHOD_END +}; + +static driver_t axge_driver = { + .name = "axge", + .methods = axge_methods, + .size = sizeof(struct axge_softc), +}; + +static devclass_t axge_devclass; + +DRIVER_MODULE(axge, uhub, axge_driver, axge_devclass, NULL, NULL); +DRIVER_MODULE(miibus, axge, miibus_driver, miibus_devclass, NULL, NULL); +MODULE_DEPEND(axge, uether, 1, 1, 1); +MODULE_DEPEND(axge, usb, 1, 1, 1); +MODULE_DEPEND(axge, ether, 1, 1, 1); +MODULE_DEPEND(axge, miibus, 1, 1, 1); +MODULE_VERSION(axge, 1); + +static const struct usb_ether_methods axge_ue_methods = { + .ue_attach_post = axge_attach_post, + .ue_attach_post_sub = axge_attach_post_sub, + .ue_start = axge_start, + .ue_init = axge_init, + .ue_stop = axge_stop, + .ue_tick = axge_tick, + .ue_setmulti = axge_setmulti, + .ue_setpromisc = axge_setpromisc, + .ue_mii_upd = axge_ifmedia_upd, + .ue_mii_sts = axge_ifmedia_sts, +}; + +static int +axge_read_mem(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t val, void *buf, int len) +{ + struct usb_device_request req; + + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = cmd; + USETW(req.wValue, val); + USETW(req.wIndex, index); + USETW(req.wLength, len); + + return (uether_do_request(&sc->sc_ue, &req, buf, 1000)); +} + +static void +axge_write_mem(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t val, void *buf, int len) +{ + struct usb_device_request req; + + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = cmd; + USETW(req.wValue, val); + USETW(req.wIndex, index); + USETW(req.wLength, len); + + if (uether_do_request(&sc->sc_ue, &req, buf, 1000)) { + /* Error ignored. */ + } +} + +static uint16_t +axge_read_cmd_2(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg) +{ + uint8_t val[2]; + + axge_read_mem(sc, cmd, index, reg, &val, 2); + return (UGETW(val)); +} + +static void +axge_write_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg, uint8_t val) +{ + axge_write_mem(sc, cmd, index, reg, &val, 1); +} + +static void +axge_write_cmd_2(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg, uint16_t val) +{ + uint8_t temp[2]; + + USETW(temp, val); + axge_write_mem(sc, cmd, index, reg, &temp, 2); +} + +static int +axge_miibus_readreg(device_t dev, int phy, int reg) +{ + struct axge_softc *sc; + uint16_t val; + int locked; + + sc = device_get_softc(dev); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + val = axge_read_cmd_2(sc, AXGE_ACCESS_PHY, reg, phy); + + if (!locked) + AXGE_UNLOCK(sc); + + return (val); +} + +static int +axge_miibus_writereg(device_t dev, int phy, int reg, int val) +{ + struct axge_softc *sc; + int locked; + + sc = device_get_softc(dev); + if (sc->sc_phyno != phy) + return (0); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + axge_write_cmd_2(sc, AXGE_ACCESS_PHY, reg, phy, val); + + if (!locked) + AXGE_UNLOCK(sc); + + return (0); +} + +static void +axge_miibus_statchg(device_t dev) +{ + struct axge_softc *sc; + struct mii_data *mii; + struct ifnet *ifp; + uint16_t val; + int locked; + + sc = device_get_softc(dev); + mii = GET_MII(sc); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + ifp = uether_getifp(&sc->sc_ue); + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + goto done; + + sc->sc_flags &= ~AXGE_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + case IFM_1000_T: + sc->sc_flags |= AXGE_FLAG_LINK; + break; + default: + break; + } + } + + /* Lost link, do nothing. */ + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) + goto done; + + val = 0; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + val |= AXGE_MEDIUM_FULL_DUPLEX; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) + val |= AXGE_MEDIUM_TXFLOW_CTRLEN; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) + val |= AXGE_MEDIUM_RXFLOW_CTRLEN; + } + val |= AXGE_MEDIUM_RECEIVE_EN | AXGE_MEDIUM_ALWAYS_ONE; + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_1000_T: + val |= AXGE_MEDIUM_GIGAMODE; + case IFM_100_TX: + val |= AXGE_MEDIUM_PS; + case IFM_10_T: + /* Doesn't need to be handled. */ + break; + } + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MEDIUM_STATUS_MODE, val); + +done: + if (!locked) + AXGE_UNLOCK(sc); +} + +static void +axge_chip_init(struct axge_softc *sc) +{ + /* Power up ethernet PHY. */ + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, 0); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, + AXGE_PHYPWR_RSTCTL_IPRL); + uether_pause(&sc->sc_ue, hz / 4); + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_CLK_SELECT, + AXGE_CLK_SELECT_ACS | AXGE_CLK_SELECT_BCS); + uether_pause(&sc->sc_ue, hz / 10); +} + +static void +axge_reset(struct axge_softc *sc) +{ + struct usb_config_descriptor *cd; + usb_error_t err; + + cd = usbd_get_config_descriptor(sc->sc_ue.ue_udev); + + err = usbd_req_set_config(sc->sc_ue.ue_udev, &sc->sc_mtx, + cd->bConfigurationValue); + if (err) + DPRINTF("reset failed (ignored)\n"); + + /* Wait a little while for the chip to get its brains in order. */ + uether_pause(&sc->sc_ue, hz / 100); + + /* Reinitialize controller to achieve full reset. */ + axge_chip_init(sc); +} + +static void +axge_attach_post(struct usb_ether *ue) +{ + struct axge_softc *sc; + uint8_t tmp[5]; + + sc = uether_getsc(ue); + sc->sc_phyno = 3; + + /* Initialize controller and get station address. */ + axge_chip_init(sc); + + memcpy(tmp, &AX88179_BULKIN_SIZE[0], 5); + axge_read_mem(sc, AXGE_ACCESS_MAC, 5, AXGE_RX_BULKIN_QCTRL, tmp, 5); + axge_read_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, + ue->ue_eaddr, ETHER_ADDR_LEN); +} + +static int +axge_attach_post_sub(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + int error; + + sc = uether_getsc(ue); + ifp = ue->ue_ifp; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_start = uether_start; + ifp->if_ioctl = axge_ioctl; + ifp->if_init = uether_init; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; + IFQ_SET_READY(&ifp->if_snd); + + ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_TXCSUM | IFCAP_RXCSUM; + ifp->if_hwassist = AXGE_CSUM_FEATURES; + ifp->if_capenable = ifp->if_capabilities; + + mtx_lock(&Giant); + error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp, + uether_ifmedia_upd, ue->ue_methods->ue_mii_sts, + BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, 0); + mtx_unlock(&Giant); + + return (error); +} + +/* + * Set media options. + */ +static int +axge_ifmedia_upd(struct ifnet *ifp) +{ + struct axge_softc *sc; + struct mii_data *mii; + struct mii_softc *miisc; + int error; + + sc = ifp->if_softc; + mii = GET_MII(sc); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + PHY_RESET(miisc); + error = mii_mediachg(mii); + + return (error); +} + +/* + * Report current media status. + */ +static void +axge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + struct axge_softc *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + mii = GET_MII(sc); + AXGE_LOCK(sc); + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; + AXGE_UNLOCK(sc); +} + +/* + * Probe for a AX88179 chip. + */ +static int +axge_probe(device_t dev) +{ + struct usb_attach_arg *uaa; + + uaa = device_get_ivars(dev); + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + if (uaa->info.bConfigIndex != AXGE_CONFIG_IDX) + return (ENXIO); + if (uaa->info.bIfaceIndex != AXGE_IFACE_IDX) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(axge_devs, sizeof(axge_devs), uaa)); +} + +/* + * Attach the interface. Allocate softc structures, do ifmedia + * setup and ethernet/BPF attach. + */ +static int +axge_attach(device_t dev) +{ + struct usb_attach_arg *uaa; + struct axge_softc *sc; + struct usb_ether *ue; + uint8_t iface_index; + int error; + + uaa = device_get_ivars(dev); + sc = device_get_softc(dev); + ue = &sc->sc_ue; + + device_set_usb_desc(dev); + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + iface_index = AXGE_IFACE_IDX; + error = usbd_transfer_setup(uaa->device, &iface_index, + sc->sc_xfer, axge_config, AXGE_N_TRANSFER, sc, &sc->sc_mtx); + if (error) { + device_printf(dev, "allocating USB transfers failed\n"); + goto detach; + } + + ue->ue_sc = sc; + ue->ue_dev = dev; + ue->ue_udev = uaa->device; + ue->ue_mtx = &sc->sc_mtx; + ue->ue_methods = &axge_ue_methods; + + error = uether_ifattach(ue); + if (error) { + device_printf(dev, "could not attach interface\n"); + goto detach; + } + return (0); /* success */ + +detach: + axge_detach(dev); + return (ENXIO); /* failure */ +} + +static int +axge_detach(device_t dev) +{ + struct axge_softc *sc; + struct usb_ether *ue; + + sc = device_get_softc(dev); + ue = &sc->sc_ue; + usbd_transfer_unsetup(sc->sc_xfer, AXGE_N_TRANSFER); + uether_ifdetach(ue); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static void +axge_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct axge_softc *sc; + struct usb_ether *ue; + struct usb_page_cache *pc; + int actlen; + + sc = usbd_xfer_softc(xfer); + ue = &sc->sc_ue; + usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + pc = usbd_xfer_get_frame(xfer, 0); + axge_rx_frame(ue, pc, actlen); + + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + uether_rxflush(ue); + return; + + default: + if (error != USB_ERR_CANCELLED) { + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + + } +} + +static void +axge_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct axge_softc *sc; + struct ifnet *ifp; + struct usb_page_cache *pc; + struct mbuf *m; + uint32_t txhdr; + uint32_t txhdr2; + int nframes; + int frm_len; + + sc = usbd_xfer_softc(xfer); + ifp = uether_getifp(&sc->sc_ue); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0 || + (ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) { + /* + * Don't send anything if there is no link or + * controller is busy. + */ + return; + } + + for (nframes = 0; nframes < 16 && + !IFQ_DRV_IS_EMPTY(&ifp->if_snd); nframes++) { + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + break; + usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES, + nframes); + frm_len = 0; + pc = usbd_xfer_get_frame(xfer, nframes); + + txhdr = m->m_pkthdr.len; + txhdr = htole32(txhdr); + usbd_copy_in(pc, 0, &txhdr, sizeof(txhdr)); + frm_len += sizeof(txhdr); + + txhdr2 = 0; + if ((m->m_pkthdr.len + sizeof(txhdr) + sizeof(txhdr2)) % + usbd_xfer_max_framelen(xfer) == 0) { + txhdr2 |= 0x80008000; + } + txhdr2 = htole32(txhdr2); + usbd_copy_in(pc, frm_len, &txhdr2, sizeof(txhdr2)); + frm_len += sizeof(txhdr2); + + /* Next copy in the actual packet. */ + usbd_m_copy_in(pc, frm_len, m, 0, m->m_pkthdr.len); + frm_len += m->m_pkthdr.len; + + /* + * XXX + * Update TX packet counter here. This is not + * correct way but it seems that there is no way + * to know how many packets are sent at the end + * of transfer because controller combines + * multiple writes into single one if there is + * room in TX buffer of controller. + */ + ifp->if_opackets++; + + /* + * if there's a BPF listener, bounce a copy + * of this frame to him: + */ + BPF_MTAP(ifp, m); + + m_freem(m); + + /* Set frame length. */ + usbd_xfer_set_frame_len(xfer, nframes, frm_len); + } + if (nframes != 0) { + usbd_xfer_set_frames(xfer, nframes); + usbd_transfer_submit(xfer); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + } + return; + /* NOTREACHED */ + default: + ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + + if (error != USB_ERR_CANCELLED) { + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + + } +} + +static void +axge_tick(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct mii_data *mii; + + sc = uether_getsc(ue); + mii = GET_MII(sc); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + mii_tick(mii); + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) { + axge_miibus_statchg(ue->ue_dev); + if ((sc->sc_flags & AXGE_FLAG_LINK) != 0) + axge_start(ue); + } +} + +static void +axge_setmulti(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + struct ifmultiaddr *ifma; + uint32_t h; + uint16_t rxmode; + uint8_t hashtbl[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + h = 0; + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL); + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + rxmode |= AXGE_RX_CTL_AMALL; + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + return; + } + rxmode &= ~AXGE_RX_CTL_AMALL; + + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; + hashtbl[h / 8] |= 1 << (h % 8); + } + if_maddr_runlock(ifp); + + axge_write_mem(sc, AXGE_ACCESS_MAC, 8, AXGE_MULTI_FILTER_ARRY, + (void *)&hashtbl, 8); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); +} + +static void +axge_setpromisc(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + uint16_t rxmode; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL); + + if (ifp->if_flags & IFF_PROMISC) + rxmode |= AXGE_RX_CTL_PRO; + else + rxmode &= ~AXGE_RX_CTL_PRO; + + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + axge_setmulti(ue); +} + +static void +axge_start(struct usb_ether *ue) +{ + struct axge_softc *sc; + + sc = uether_getsc(ue); + /* + * Start the USB transfers, if not already started. + */ + usbd_transfer_start(sc->sc_xfer[AXGE_BULK_DT_RD]); + usbd_transfer_start(sc->sc_xfer[AXGE_BULK_DT_WR]); +} + +static void +axge_init(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + uint16_t rxmode; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + + /* + * Cancel pending I/O and free all RX/TX buffers. + */ + axge_stop(ue); + + axge_reset(sc); + + /* Set MAC address. */ + axge_write_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, + IF_LLADDR(ifp), ETHER_ADDR_LEN); + + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_PAUSE_WATERLVL_LOW, 0x34); + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_PAUSE_WATERLVL_HIGH, + 0x52); + + /* Configure TX/RX checksum offloading. */ + axge_csum_cfg(ue); + + /* Configure RX settings. */ + rxmode = (AXGE_RX_CTL_IPE | AXGE_RX_CTL_AM | AXGE_RX_CTL_START); + + /* If we want promiscuous mode, set the allframes bit. */ + if (ifp->if_flags & IFF_PROMISC) + rxmode |= AXGE_RX_CTL_PRO; + + if (ifp->if_flags & IFF_BROADCAST) + rxmode |= AXGE_RX_CTL_AB; + + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + + /* Load the multicast filter. */ + axge_setmulti(ue); + + usbd_xfer_set_stall(sc->sc_xfer[AXGE_BULK_DT_WR]); + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + /* Switch to selected media. */ + axge_ifmedia_upd(ifp); +} + +static void +axge_stop(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->sc_flags &= ~AXGE_FLAG_LINK; + + /* + * Stop all the transfers, if not already stopped: + */ + usbd_transfer_stop(sc->sc_xfer[AXGE_BULK_DT_WR]); + usbd_transfer_stop(sc->sc_xfer[AXGE_BULK_DT_RD]); +} + +static int +axge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ + struct usb_ether *ue; + struct axge_softc *sc; + struct ifreq *ifr; + int error, mask, reinit; + + ue = ifp->if_softc; + sc = uether_getsc(ue); + ifr = (struct ifreq *)data; + error = 0; + reinit = 0; + if (cmd == SIOCSIFCAP) { + AXGE_LOCK(sc); + mask = ifr->ifr_reqcap ^ ifp->if_capenable; + if ((mask & IFCAP_TXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) + ifp->if_hwassist |= AXGE_CSUM_FEATURES; + else + ifp->if_hwassist &= ~AXGE_CSUM_FEATURES; + reinit++; + } + if ((mask & IFCAP_RXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_RXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_RXCSUM; + reinit++; + } + if (reinit > 0 && ifp->if_drv_flags & IFF_DRV_RUNNING) + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + else + reinit = 0; + AXGE_UNLOCK(sc); + if (reinit > 0) + uether_init(ue); + } else + error = uether_ioctl(ifp, cmd, data); + + return (error); +} + +static int +axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen) +{ + struct axge_softc *sc; + struct axge_csum_hdr csum_hdr; + int error, len, pos; + int pkt_cnt; + uint32_t rxhdr; + uint16_t hdr_off; + uint16_t pktlen; + + sc = uether_getsc(ue); + pos = 0; + len = 0; + error = 0; + + usbd_copy_out(pc, actlen - sizeof(rxhdr), &rxhdr, sizeof(rxhdr)); + actlen -= sizeof(rxhdr); + rxhdr = le32toh(rxhdr); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Mon Feb 17 22:43:08 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A4ABD30E; Mon, 17 Feb 2014 22:43: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8C78A19D4; Mon, 17 Feb 2014 22:43:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1HMh8GM089484; Mon, 17 Feb 2014 22:43:08 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1HMh7qm089476; Mon, 17 Feb 2014 22:43:07 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201402172243.s1HMh7qm089476@svn.freebsd.org> From: Mark Johnston Date: Mon, 17 Feb 2014 22:43:07 +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: r262138 - in stable/9: share/man/man4 sys/conf sys/dev/usb sys/dev/usb/net sys/modules/usb sys/modules/usb/axge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Feb 2014 22:43:08 -0000 Author: markj Date: Mon Feb 17 22:43:07 2014 New Revision: 262138 URL: http://svnweb.freebsd.org/changeset/base/262138 Log: MFC r258036: Add IDs for the ASIX 88179 and 88178A USB to GigE adapters. MFC r258331: Import the axge(4) driver for the ASIX AX88178A and AX88179 USB Ethernet adapters. Both devices support Gigabit Ethernet and USB 2.0, and the AX88179 supports USB 3.0. MFC r258617 (by lwhsu): Also note to add xhci(4) to kernel configuration to utilize USB 3.0 MFC r258618 (by lwhsu): Mention axge(4) Added: stable/9/share/man/man4/axge.4 - copied, changed from r258331, head/share/man/man4/axge.4 stable/9/sys/dev/usb/net/if_axge.c - copied unchanged from r258331, head/sys/dev/usb/net/if_axge.c stable/9/sys/dev/usb/net/if_axgereg.h - copied unchanged from r258331, head/sys/dev/usb/net/if_axgereg.h stable/9/sys/modules/usb/axge/ - copied from r258331, head/sys/modules/usb/axge/ Modified: stable/9/share/man/man4/Makefile stable/9/share/man/man4/usb.4 stable/9/sys/conf/files stable/9/sys/dev/usb/usbdevs stable/9/sys/modules/usb/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Mon Feb 17 22:40:05 2014 (r262137) +++ stable/9/share/man/man4/Makefile Mon Feb 17 22:43:07 2014 (r262138) @@ -62,6 +62,7 @@ MAN= aac.4 \ auditpipe.4 \ aue.4 \ axe.4 \ + axge.4 \ bce.4 \ bfe.4 \ bge.4 \ Copied and modified: stable/9/share/man/man4/axge.4 (from r258331, head/share/man/man4/axge.4) ============================================================================== --- head/share/man/man4/axge.4 Tue Nov 19 00:37:53 2013 (r258331, copy source) +++ stable/9/share/man/man4/axge.4 Mon Feb 17 22:43:07 2014 (r262138) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 12, 2013 +.Dd November 22, 2013 .Dt AXGE 4 .Os .Sh NAME @@ -41,6 +41,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device xhci" .Cd "device ehci" .Cd "device uhci" .Cd "device ohci" Modified: stable/9/share/man/man4/usb.4 ============================================================================== --- stable/9/share/man/man4/usb.4 Mon Feb 17 22:40:05 2014 (r262137) +++ stable/9/share/man/man4/usb.4 Mon Feb 17 22:43:07 2014 (r262138) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2009 +.Dd November 26, 2013 .Dt USB 4 .Os .Sh NAME @@ -147,6 +147,7 @@ specifications can be found at: .Xr usbdi 4 , .Xr aue 4 , .Xr axe 4 , +.Xr axge 4 , .Xr cue 4 , .Xr ehci 4 , .Xr kue 4 , Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Mon Feb 17 22:40:05 2014 (r262137) +++ stable/9/sys/conf/files Mon Feb 17 22:43:07 2014 (r262138) @@ -2013,6 +2013,7 @@ dev/usb/usb_util.c optional usb # dev/usb/net/if_aue.c optional aue dev/usb/net/if_axe.c optional axe +dev/usb/net/if_axge.c optional axge dev/usb/net/if_cdce.c optional cdce dev/usb/net/if_cue.c optional cue dev/usb/net/if_ipheth.c optional ipheth @@ -2022,8 +2023,8 @@ dev/usb/net/if_rue.c optional rue dev/usb/net/if_udav.c optional udav dev/usb/net/if_usie.c optional usie dev/usb/net/ruephy.c optional rue -dev/usb/net/usb_ethernet.c optional aue | axe | cdce | cue | kue | mos | \ - rue | udav | ipheth +dev/usb/net/usb_ethernet.c optional aue | axe | axge | cdce | cue | kue | \ + mos | rue | udav | ipheth dev/usb/net/uhso.c optional uhso # # USB WLAN drivers Copied: stable/9/sys/dev/usb/net/if_axge.c (from r258331, head/sys/dev/usb/net/if_axge.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/usb/net/if_axge.c Mon Feb 17 22:43:07 2014 (r262138, copy of r258331, head/sys/dev/usb/net/if_axge.c) @@ -0,0 +1,1023 @@ +/*- + * Copyright (c) 2013 Kevin Lo + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * ASIX Electronics AX88178A/AX88179 USB 2.0/3.0 gigabit ethernet driver. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include "usbdevs.h" + +#define USB_DEBUG_VAR axge_debug +#include +#include + +#include +#include + +/* + * Various supported device vendors/products. + */ + +static const STRUCT_USB_HOST_ID axge_devs[] = { +#define AXGE_DEV(v,p) { USB_VP(USB_VENDOR_##v, USB_PRODUCT_##v##_##p) } + AXGE_DEV(ASIX, AX88178A), + AXGE_DEV(ASIX, AX88179), + /* AXGE_DEV(SITECOMEU, LN032), */ +#undef AXGE_DEV +}; + +static const struct { + unsigned char ctrl, timer_l, timer_h, size, ifg; +} AX88179_BULKIN_SIZE[] = { + {7, 0x4f, 0, 0x12, 0xff}, + {7, 0x20, 3, 0x16, 0xff}, + {7, 0xae, 7, 0x18, 0xff}, + {7, 0xcc, 0x4c, 0x18, 8}, +}; + +/* prototypes */ + +static device_probe_t axge_probe; +static device_attach_t axge_attach; +static device_detach_t axge_detach; + +static usb_callback_t axge_bulk_read_callback; +static usb_callback_t axge_bulk_write_callback; + +static miibus_readreg_t axge_miibus_readreg; +static miibus_writereg_t axge_miibus_writereg; +static miibus_statchg_t axge_miibus_statchg; + +static uether_fn_t axge_attach_post; +static uether_fn_t axge_init; +static uether_fn_t axge_stop; +static uether_fn_t axge_start; +static uether_fn_t axge_tick; +static uether_fn_t axge_setmulti; +static uether_fn_t axge_setpromisc; + +static int axge_read_mem(struct axge_softc *, uint8_t, uint16_t, + uint16_t, void *, int); +static void axge_write_mem(struct axge_softc *, uint8_t, uint16_t, + uint16_t, void *, int); +static uint16_t axge_read_cmd_2(struct axge_softc *, uint8_t, uint16_t, + uint16_t); +static void axge_write_cmd_1(struct axge_softc *, uint8_t, uint16_t, + uint16_t, uint8_t); +static void axge_write_cmd_2(struct axge_softc *, uint8_t, uint16_t, + uint16_t, uint16_t); +static void axge_chip_init(struct axge_softc *); +static void axge_reset(struct axge_softc *); + +static int axge_attach_post_sub(struct usb_ether *); +static int axge_ifmedia_upd(struct ifnet *); +static void axge_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int axge_ioctl(struct ifnet *, u_long, caddr_t); +static int axge_rx_frame(struct usb_ether *, struct usb_page_cache *, int); +static int axge_rxeof(struct usb_ether *, struct usb_page_cache *, + unsigned int, unsigned int, struct axge_csum_hdr *); +static void axge_csum_cfg(struct usb_ether *); + +#define AXGE_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) + +#ifdef USB_DEBUG +static int axge_debug = 0; + +static SYSCTL_NODE(_hw_usb, OID_AUTO, axge, CTLFLAG_RW, 0, "USB axge"); +SYSCTL_INT(_hw_usb_axge, OID_AUTO, debug, CTLFLAG_RW, &axge_debug, 0, + "Debug level"); +#endif + +static const struct usb_config axge_config[AXGE_N_TRANSFER] = { + [AXGE_BULK_DT_WR] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .frames = 16, + .bufsize = 16 * (MCLBYTES + 16), + .flags = {.pipe_bof = 1,.force_short_xfer = 1,}, + .callback = axge_bulk_write_callback, + .timeout = 10000, /* 10 seconds */ + }, + [AXGE_BULK_DT_RD] = { + .type = UE_BULK, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 20480, + .flags = {.pipe_bof = 1,.short_xfer_ok = 1,}, + .callback = axge_bulk_read_callback, + .timeout = 0, /* no timeout */ + }, +}; + +static device_method_t axge_methods[] = { + /* Device interface. */ + DEVMETHOD(device_probe, axge_probe), + DEVMETHOD(device_attach, axge_attach), + DEVMETHOD(device_detach, axge_detach), + + /* MII interface. */ + DEVMETHOD(miibus_readreg, axge_miibus_readreg), + DEVMETHOD(miibus_writereg, axge_miibus_writereg), + DEVMETHOD(miibus_statchg, axge_miibus_statchg), + + DEVMETHOD_END +}; + +static driver_t axge_driver = { + .name = "axge", + .methods = axge_methods, + .size = sizeof(struct axge_softc), +}; + +static devclass_t axge_devclass; + +DRIVER_MODULE(axge, uhub, axge_driver, axge_devclass, NULL, NULL); +DRIVER_MODULE(miibus, axge, miibus_driver, miibus_devclass, NULL, NULL); +MODULE_DEPEND(axge, uether, 1, 1, 1); +MODULE_DEPEND(axge, usb, 1, 1, 1); +MODULE_DEPEND(axge, ether, 1, 1, 1); +MODULE_DEPEND(axge, miibus, 1, 1, 1); +MODULE_VERSION(axge, 1); + +static const struct usb_ether_methods axge_ue_methods = { + .ue_attach_post = axge_attach_post, + .ue_attach_post_sub = axge_attach_post_sub, + .ue_start = axge_start, + .ue_init = axge_init, + .ue_stop = axge_stop, + .ue_tick = axge_tick, + .ue_setmulti = axge_setmulti, + .ue_setpromisc = axge_setpromisc, + .ue_mii_upd = axge_ifmedia_upd, + .ue_mii_sts = axge_ifmedia_sts, +}; + +static int +axge_read_mem(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t val, void *buf, int len) +{ + struct usb_device_request req; + + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + req.bmRequestType = UT_READ_VENDOR_DEVICE; + req.bRequest = cmd; + USETW(req.wValue, val); + USETW(req.wIndex, index); + USETW(req.wLength, len); + + return (uether_do_request(&sc->sc_ue, &req, buf, 1000)); +} + +static void +axge_write_mem(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t val, void *buf, int len) +{ + struct usb_device_request req; + + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + req.bmRequestType = UT_WRITE_VENDOR_DEVICE; + req.bRequest = cmd; + USETW(req.wValue, val); + USETW(req.wIndex, index); + USETW(req.wLength, len); + + if (uether_do_request(&sc->sc_ue, &req, buf, 1000)) { + /* Error ignored. */ + } +} + +static uint16_t +axge_read_cmd_2(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg) +{ + uint8_t val[2]; + + axge_read_mem(sc, cmd, index, reg, &val, 2); + return (UGETW(val)); +} + +static void +axge_write_cmd_1(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg, uint8_t val) +{ + axge_write_mem(sc, cmd, index, reg, &val, 1); +} + +static void +axge_write_cmd_2(struct axge_softc *sc, uint8_t cmd, uint16_t index, + uint16_t reg, uint16_t val) +{ + uint8_t temp[2]; + + USETW(temp, val); + axge_write_mem(sc, cmd, index, reg, &temp, 2); +} + +static int +axge_miibus_readreg(device_t dev, int phy, int reg) +{ + struct axge_softc *sc; + uint16_t val; + int locked; + + sc = device_get_softc(dev); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + val = axge_read_cmd_2(sc, AXGE_ACCESS_PHY, reg, phy); + + if (!locked) + AXGE_UNLOCK(sc); + + return (val); +} + +static int +axge_miibus_writereg(device_t dev, int phy, int reg, int val) +{ + struct axge_softc *sc; + int locked; + + sc = device_get_softc(dev); + if (sc->sc_phyno != phy) + return (0); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + axge_write_cmd_2(sc, AXGE_ACCESS_PHY, reg, phy, val); + + if (!locked) + AXGE_UNLOCK(sc); + + return (0); +} + +static void +axge_miibus_statchg(device_t dev) +{ + struct axge_softc *sc; + struct mii_data *mii; + struct ifnet *ifp; + uint16_t val; + int locked; + + sc = device_get_softc(dev); + mii = GET_MII(sc); + locked = mtx_owned(&sc->sc_mtx); + if (!locked) + AXGE_LOCK(sc); + + ifp = uether_getifp(&sc->sc_ue); + if (mii == NULL || ifp == NULL || + (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + goto done; + + sc->sc_flags &= ~AXGE_FLAG_LINK; + if ((mii->mii_media_status & (IFM_ACTIVE | IFM_AVALID)) == + (IFM_ACTIVE | IFM_AVALID)) { + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_10_T: + case IFM_100_TX: + case IFM_1000_T: + sc->sc_flags |= AXGE_FLAG_LINK; + break; + default: + break; + } + } + + /* Lost link, do nothing. */ + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) + goto done; + + val = 0; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { + val |= AXGE_MEDIUM_FULL_DUPLEX; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) + val |= AXGE_MEDIUM_TXFLOW_CTRLEN; + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) + val |= AXGE_MEDIUM_RXFLOW_CTRLEN; + } + val |= AXGE_MEDIUM_RECEIVE_EN | AXGE_MEDIUM_ALWAYS_ONE; + switch (IFM_SUBTYPE(mii->mii_media_active)) { + case IFM_1000_T: + val |= AXGE_MEDIUM_GIGAMODE; + case IFM_100_TX: + val |= AXGE_MEDIUM_PS; + case IFM_10_T: + /* Doesn't need to be handled. */ + break; + } + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_MEDIUM_STATUS_MODE, val); + +done: + if (!locked) + AXGE_UNLOCK(sc); +} + +static void +axge_chip_init(struct axge_softc *sc) +{ + /* Power up ethernet PHY. */ + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, 0); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_PHYPWR_RSTCTL, + AXGE_PHYPWR_RSTCTL_IPRL); + uether_pause(&sc->sc_ue, hz / 4); + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_CLK_SELECT, + AXGE_CLK_SELECT_ACS | AXGE_CLK_SELECT_BCS); + uether_pause(&sc->sc_ue, hz / 10); +} + +static void +axge_reset(struct axge_softc *sc) +{ + struct usb_config_descriptor *cd; + usb_error_t err; + + cd = usbd_get_config_descriptor(sc->sc_ue.ue_udev); + + err = usbd_req_set_config(sc->sc_ue.ue_udev, &sc->sc_mtx, + cd->bConfigurationValue); + if (err) + DPRINTF("reset failed (ignored)\n"); + + /* Wait a little while for the chip to get its brains in order. */ + uether_pause(&sc->sc_ue, hz / 100); + + /* Reinitialize controller to achieve full reset. */ + axge_chip_init(sc); +} + +static void +axge_attach_post(struct usb_ether *ue) +{ + struct axge_softc *sc; + uint8_t tmp[5]; + + sc = uether_getsc(ue); + sc->sc_phyno = 3; + + /* Initialize controller and get station address. */ + axge_chip_init(sc); + + memcpy(tmp, &AX88179_BULKIN_SIZE[0], 5); + axge_read_mem(sc, AXGE_ACCESS_MAC, 5, AXGE_RX_BULKIN_QCTRL, tmp, 5); + axge_read_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, + ue->ue_eaddr, ETHER_ADDR_LEN); +} + +static int +axge_attach_post_sub(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + int error; + + sc = uether_getsc(ue); + ifp = ue->ue_ifp; + ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; + ifp->if_start = uether_start; + ifp->if_ioctl = axge_ioctl; + ifp->if_init = uether_init; + IFQ_SET_MAXLEN(&ifp->if_snd, ifqmaxlen); + ifp->if_snd.ifq_drv_maxlen = ifqmaxlen; + IFQ_SET_READY(&ifp->if_snd); + + ifp->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_TXCSUM | IFCAP_RXCSUM; + ifp->if_hwassist = AXGE_CSUM_FEATURES; + ifp->if_capenable = ifp->if_capabilities; + + mtx_lock(&Giant); + error = mii_attach(ue->ue_dev, &ue->ue_miibus, ifp, + uether_ifmedia_upd, ue->ue_methods->ue_mii_sts, + BMSR_DEFCAPMASK, sc->sc_phyno, MII_OFFSET_ANY, 0); + mtx_unlock(&Giant); + + return (error); +} + +/* + * Set media options. + */ +static int +axge_ifmedia_upd(struct ifnet *ifp) +{ + struct axge_softc *sc; + struct mii_data *mii; + struct mii_softc *miisc; + int error; + + sc = ifp->if_softc; + mii = GET_MII(sc); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + LIST_FOREACH(miisc, &mii->mii_phys, mii_list) + PHY_RESET(miisc); + error = mii_mediachg(mii); + + return (error); +} + +/* + * Report current media status. + */ +static void +axge_ifmedia_sts(struct ifnet *ifp, struct ifmediareq *ifmr) +{ + struct axge_softc *sc; + struct mii_data *mii; + + sc = ifp->if_softc; + mii = GET_MII(sc); + AXGE_LOCK(sc); + mii_pollstat(mii); + ifmr->ifm_active = mii->mii_media_active; + ifmr->ifm_status = mii->mii_media_status; + AXGE_UNLOCK(sc); +} + +/* + * Probe for a AX88179 chip. + */ +static int +axge_probe(device_t dev) +{ + struct usb_attach_arg *uaa; + + uaa = device_get_ivars(dev); + if (uaa->usb_mode != USB_MODE_HOST) + return (ENXIO); + if (uaa->info.bConfigIndex != AXGE_CONFIG_IDX) + return (ENXIO); + if (uaa->info.bIfaceIndex != AXGE_IFACE_IDX) + return (ENXIO); + + return (usbd_lookup_id_by_uaa(axge_devs, sizeof(axge_devs), uaa)); +} + +/* + * Attach the interface. Allocate softc structures, do ifmedia + * setup and ethernet/BPF attach. + */ +static int +axge_attach(device_t dev) +{ + struct usb_attach_arg *uaa; + struct axge_softc *sc; + struct usb_ether *ue; + uint8_t iface_index; + int error; + + uaa = device_get_ivars(dev); + sc = device_get_softc(dev); + ue = &sc->sc_ue; + + device_set_usb_desc(dev); + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + iface_index = AXGE_IFACE_IDX; + error = usbd_transfer_setup(uaa->device, &iface_index, + sc->sc_xfer, axge_config, AXGE_N_TRANSFER, sc, &sc->sc_mtx); + if (error) { + device_printf(dev, "allocating USB transfers failed\n"); + goto detach; + } + + ue->ue_sc = sc; + ue->ue_dev = dev; + ue->ue_udev = uaa->device; + ue->ue_mtx = &sc->sc_mtx; + ue->ue_methods = &axge_ue_methods; + + error = uether_ifattach(ue); + if (error) { + device_printf(dev, "could not attach interface\n"); + goto detach; + } + return (0); /* success */ + +detach: + axge_detach(dev); + return (ENXIO); /* failure */ +} + +static int +axge_detach(device_t dev) +{ + struct axge_softc *sc; + struct usb_ether *ue; + + sc = device_get_softc(dev); + ue = &sc->sc_ue; + usbd_transfer_unsetup(sc->sc_xfer, AXGE_N_TRANSFER); + uether_ifdetach(ue); + mtx_destroy(&sc->sc_mtx); + + return (0); +} + +static void +axge_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct axge_softc *sc; + struct usb_ether *ue; + struct usb_page_cache *pc; + int actlen; + + sc = usbd_xfer_softc(xfer); + ue = &sc->sc_ue; + usbd_xfer_status(xfer, &actlen, NULL, NULL, NULL); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + pc = usbd_xfer_get_frame(xfer, 0); + axge_rx_frame(ue, pc, actlen); + + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_len(xfer)); + usbd_transfer_submit(xfer); + uether_rxflush(ue); + return; + + default: + if (error != USB_ERR_CANCELLED) { + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + + } +} + +static void +axge_bulk_write_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct axge_softc *sc; + struct ifnet *ifp; + struct usb_page_cache *pc; + struct mbuf *m; + uint32_t txhdr; + uint32_t txhdr2; + int nframes; + int frm_len; + + sc = usbd_xfer_softc(xfer); + ifp = uether_getifp(&sc->sc_ue); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + /* FALLTHROUGH */ + case USB_ST_SETUP: +tr_setup: + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0 || + (ifp->if_drv_flags & IFF_DRV_OACTIVE) != 0) { + /* + * Don't send anything if there is no link or + * controller is busy. + */ + return; + } + + for (nframes = 0; nframes < 16 && + !IFQ_DRV_IS_EMPTY(&ifp->if_snd); nframes++) { + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); + if (m == NULL) + break; + usbd_xfer_set_frame_offset(xfer, nframes * MCLBYTES, + nframes); + frm_len = 0; + pc = usbd_xfer_get_frame(xfer, nframes); + + txhdr = m->m_pkthdr.len; + txhdr = htole32(txhdr); + usbd_copy_in(pc, 0, &txhdr, sizeof(txhdr)); + frm_len += sizeof(txhdr); + + txhdr2 = 0; + if ((m->m_pkthdr.len + sizeof(txhdr) + sizeof(txhdr2)) % + usbd_xfer_max_framelen(xfer) == 0) { + txhdr2 |= 0x80008000; + } + txhdr2 = htole32(txhdr2); + usbd_copy_in(pc, frm_len, &txhdr2, sizeof(txhdr2)); + frm_len += sizeof(txhdr2); + + /* Next copy in the actual packet. */ + usbd_m_copy_in(pc, frm_len, m, 0, m->m_pkthdr.len); + frm_len += m->m_pkthdr.len; + + /* + * XXX + * Update TX packet counter here. This is not + * correct way but it seems that there is no way + * to know how many packets are sent at the end + * of transfer because controller combines + * multiple writes into single one if there is + * room in TX buffer of controller. + */ + ifp->if_opackets++; + + /* + * if there's a BPF listener, bounce a copy + * of this frame to him: + */ + BPF_MTAP(ifp, m); + + m_freem(m); + + /* Set frame length. */ + usbd_xfer_set_frame_len(xfer, nframes, frm_len); + } + if (nframes != 0) { + usbd_xfer_set_frames(xfer, nframes); + usbd_transfer_submit(xfer); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + } + return; + /* NOTREACHED */ + default: + ifp->if_oerrors++; + ifp->if_drv_flags &= ~IFF_DRV_OACTIVE; + + if (error != USB_ERR_CANCELLED) { + usbd_xfer_set_stall(xfer); + goto tr_setup; + } + return; + + } +} + +static void +axge_tick(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct mii_data *mii; + + sc = uether_getsc(ue); + mii = GET_MII(sc); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + mii_tick(mii); + if ((sc->sc_flags & AXGE_FLAG_LINK) == 0) { + axge_miibus_statchg(ue->ue_dev); + if ((sc->sc_flags & AXGE_FLAG_LINK) != 0) + axge_start(ue); + } +} + +static void +axge_setmulti(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + struct ifmultiaddr *ifma; + uint32_t h; + uint16_t rxmode; + uint8_t hashtbl[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + h = 0; + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL); + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + rxmode |= AXGE_RX_CTL_AMALL; + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + return; + } + rxmode &= ~AXGE_RX_CTL_AMALL; + + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = ether_crc32_be(LLADDR((struct sockaddr_dl *) + ifma->ifma_addr), ETHER_ADDR_LEN) >> 26; + hashtbl[h / 8] |= 1 << (h % 8); + } + if_maddr_runlock(ifp); + + axge_write_mem(sc, AXGE_ACCESS_MAC, 8, AXGE_MULTI_FILTER_ARRY, + (void *)&hashtbl, 8); + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); +} + +static void +axge_setpromisc(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + uint16_t rxmode; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + rxmode = axge_read_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL); + + if (ifp->if_flags & IFF_PROMISC) + rxmode |= AXGE_RX_CTL_PRO; + else + rxmode &= ~AXGE_RX_CTL_PRO; + + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + axge_setmulti(ue); +} + +static void +axge_start(struct usb_ether *ue) +{ + struct axge_softc *sc; + + sc = uether_getsc(ue); + /* + * Start the USB transfers, if not already started. + */ + usbd_transfer_start(sc->sc_xfer[AXGE_BULK_DT_RD]); + usbd_transfer_start(sc->sc_xfer[AXGE_BULK_DT_WR]); +} + +static void +axge_init(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + uint16_t rxmode; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + return; + + /* + * Cancel pending I/O and free all RX/TX buffers. + */ + axge_stop(ue); + + axge_reset(sc); + + /* Set MAC address. */ + axge_write_mem(sc, AXGE_ACCESS_MAC, ETHER_ADDR_LEN, AXGE_NODE_ID, + IF_LLADDR(ifp), ETHER_ADDR_LEN); + + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_PAUSE_WATERLVL_LOW, 0x34); + axge_write_cmd_1(sc, AXGE_ACCESS_MAC, 1, AXGE_PAUSE_WATERLVL_HIGH, + 0x52); + + /* Configure TX/RX checksum offloading. */ + axge_csum_cfg(ue); + + /* Configure RX settings. */ + rxmode = (AXGE_RX_CTL_IPE | AXGE_RX_CTL_AM | AXGE_RX_CTL_START); + + /* If we want promiscuous mode, set the allframes bit. */ + if (ifp->if_flags & IFF_PROMISC) + rxmode |= AXGE_RX_CTL_PRO; + + if (ifp->if_flags & IFF_BROADCAST) + rxmode |= AXGE_RX_CTL_AB; + + axge_write_cmd_2(sc, AXGE_ACCESS_MAC, 2, AXGE_RX_CTL, rxmode); + + /* Load the multicast filter. */ + axge_setmulti(ue); + + usbd_xfer_set_stall(sc->sc_xfer[AXGE_BULK_DT_WR]); + + ifp->if_drv_flags |= IFF_DRV_RUNNING; + /* Switch to selected media. */ + axge_ifmedia_upd(ifp); +} + +static void +axge_stop(struct usb_ether *ue) +{ + struct axge_softc *sc; + struct ifnet *ifp; + + sc = uether_getsc(ue); + ifp = uether_getifp(ue); + + AXGE_LOCK_ASSERT(sc, MA_OWNED); + + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->sc_flags &= ~AXGE_FLAG_LINK; + + /* + * Stop all the transfers, if not already stopped: + */ + usbd_transfer_stop(sc->sc_xfer[AXGE_BULK_DT_WR]); + usbd_transfer_stop(sc->sc_xfer[AXGE_BULK_DT_RD]); +} + +static int +axge_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) +{ + struct usb_ether *ue; + struct axge_softc *sc; + struct ifreq *ifr; + int error, mask, reinit; + + ue = ifp->if_softc; + sc = uether_getsc(ue); + ifr = (struct ifreq *)data; + error = 0; + reinit = 0; + if (cmd == SIOCSIFCAP) { + AXGE_LOCK(sc); + mask = ifr->ifr_reqcap ^ ifp->if_capenable; + if ((mask & IFCAP_TXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_TXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_TXCSUM; + if ((ifp->if_capenable & IFCAP_TXCSUM) != 0) + ifp->if_hwassist |= AXGE_CSUM_FEATURES; + else + ifp->if_hwassist &= ~AXGE_CSUM_FEATURES; + reinit++; + } + if ((mask & IFCAP_RXCSUM) != 0 && + (ifp->if_capabilities & IFCAP_RXCSUM) != 0) { + ifp->if_capenable ^= IFCAP_RXCSUM; + reinit++; + } + if (reinit > 0 && ifp->if_drv_flags & IFF_DRV_RUNNING) + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + else + reinit = 0; + AXGE_UNLOCK(sc); + if (reinit > 0) + uether_init(ue); + } else + error = uether_ioctl(ifp, cmd, data); + + return (error); +} + +static int +axge_rx_frame(struct usb_ether *ue, struct usb_page_cache *pc, int actlen) +{ + struct axge_softc *sc; + struct axge_csum_hdr csum_hdr; + int error, len, pos; + int pkt_cnt; + uint32_t rxhdr; + uint16_t hdr_off; + uint16_t pktlen; + + sc = uether_getsc(ue); + pos = 0; + len = 0; + error = 0; + + usbd_copy_out(pc, actlen - sizeof(rxhdr), &rxhdr, sizeof(rxhdr)); + actlen -= sizeof(rxhdr); + rxhdr = le32toh(rxhdr); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 01:15:34 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A3C8BA89; Tue, 18 Feb 2014 01:15: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8B7D815B8; Tue, 18 Feb 2014 01:15:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I1FY4v049336; Tue, 18 Feb 2014 01:15:34 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I1FWh1049330; Tue, 18 Feb 2014 01:15:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402180115.s1I1FWh1049330@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 01:15: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: r262141 - in stable/10/sys: amd64/include i386/include x86/acpica x86/include x86/x86 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 01:15:34 -0000 Author: jhb Date: Tue Feb 18 01:15:32 2014 New Revision: 262141 URL: http://svnweb.freebsd.org/changeset/base/262141 Log: MFC 259140: Move constants for indices in the local APIC's local vector table from apicvar.h to apicreg.h. Modified: stable/10/sys/amd64/include/apicvar.h stable/10/sys/i386/include/apicvar.h stable/10/sys/x86/acpica/madt.c stable/10/sys/x86/include/apicreg.h stable/10/sys/x86/x86/local_apic.c stable/10/sys/x86/x86/mptable.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/include/apicvar.h ============================================================================== --- stable/10/sys/amd64/include/apicvar.h Mon Feb 17 23:07:16 2014 (r262140) +++ stable/10/sys/amd64/include/apicvar.h Tue Feb 18 01:15:32 2014 (r262141) @@ -136,15 +136,6 @@ */ #define APIC_SPURIOUS_INT 255 -#define LVT_LINT0 0 -#define LVT_LINT1 1 -#define LVT_TIMER 2 -#define LVT_ERROR 3 -#define LVT_PMC 4 -#define LVT_THERMAL 5 -#define LVT_CMCI 6 -#define LVT_MAX LVT_CMCI - #ifndef LOCORE #define APIC_IPI_DEST_SELF -1 Modified: stable/10/sys/i386/include/apicvar.h ============================================================================== --- stable/10/sys/i386/include/apicvar.h Mon Feb 17 23:07:16 2014 (r262140) +++ stable/10/sys/i386/include/apicvar.h Tue Feb 18 01:15:32 2014 (r262141) @@ -135,15 +135,6 @@ */ #define APIC_SPURIOUS_INT 255 -#define LVT_LINT0 0 -#define LVT_LINT1 1 -#define LVT_TIMER 2 -#define LVT_ERROR 3 -#define LVT_PMC 4 -#define LVT_THERMAL 5 -#define LVT_CMCI 6 -#define LVT_MAX LVT_CMCI - #ifndef LOCORE #define APIC_IPI_DEST_SELF -1 Modified: stable/10/sys/x86/acpica/madt.c ============================================================================== --- stable/10/sys/x86/acpica/madt.c Mon Feb 17 23:07:16 2014 (r262140) +++ stable/10/sys/x86/acpica/madt.c Tue Feb 18 01:15:32 2014 (r262141) @@ -517,9 +517,9 @@ madt_parse_local_nmi(ACPI_MADT_LOCAL_API return; } if (nmi->Lint == 0) - pin = LVT_LINT0; + pin = APIC_LVT_LINT0; else - pin = LVT_LINT1; + pin = APIC_LVT_LINT1; lapic_set_lvt_mode(apic_id, pin, APIC_LVT_DM_NMI); if (!(nmi->IntiFlags & ACPI_MADT_TRIGGER_CONFORMS)) lapic_set_lvt_triggermode(apic_id, pin, Modified: stable/10/sys/x86/include/apicreg.h ============================================================================== --- stable/10/sys/x86/include/apicreg.h Mon Feb 17 23:07:16 2014 (r262140) +++ stable/10/sys/x86/include/apicreg.h Tue Feb 18 01:15:32 2014 (r262141) @@ -357,6 +357,16 @@ typedef struct IOAPIC ioapic_t; #define APIC_TDCR_128 0x0a #define APIC_TDCR_1 0x0b +/* LVT table indices */ +#define APIC_LVT_LINT0 0 +#define APIC_LVT_LINT1 1 +#define APIC_LVT_TIMER 2 +#define APIC_LVT_ERROR 3 +#define APIC_LVT_PMC 4 +#define APIC_LVT_THERMAL 5 +#define APIC_LVT_CMCI 6 +#define APIC_LVT_MAX APIC_LVT_CMCI + /****************************************************************************** * I/O APIC defines */ Modified: stable/10/sys/x86/x86/local_apic.c ============================================================================== --- stable/10/sys/x86/x86/local_apic.c Mon Feb 17 23:07:16 2014 (r262140) +++ stable/10/sys/x86/x86/local_apic.c Tue Feb 18 01:15:32 2014 (r262141) @@ -112,7 +112,7 @@ struct lvt { }; struct lapic { - struct lvt la_lvts[LVT_MAX + 1]; + struct lvt la_lvts[APIC_LVT_MAX + 1]; u_int la_id:8; u_int la_cluster:4; u_int la_cluster_id:2; @@ -126,7 +126,7 @@ struct lapic { } static lapics[MAX_APIC_ID + 1]; /* Global defaults for local APIC LVT entries. */ -static struct lvt lvts[LVT_MAX + 1] = { +static struct lvt lvts[APIC_LVT_MAX + 1] = { { 1, 1, 1, 1, APIC_LVT_DM_EXTINT, 0 }, /* LINT0: masked ExtINT */ { 1, 1, 0, 1, APIC_LVT_DM_NMI, 0 }, /* LINT1: NMI */ { 1, 1, 1, 1, APIC_LVT_DM_FIXED, APIC_TIMER_INT }, /* Timer */ @@ -180,7 +180,7 @@ lvt_mode(struct lapic *la, u_int pin, ui { struct lvt *lvt; - KASSERT(pin <= LVT_MAX, ("%s: pin %u out of range", __func__, pin)); + KASSERT(pin <= APIC_LVT_MAX, ("%s: pin %u out of range", __func__, pin)); if (la->la_lvts[pin].lvt_active) lvt = &la->la_lvts[pin]; else @@ -301,7 +301,7 @@ lapic_create(u_int apic_id, int boot_cpu */ lapics[apic_id].la_present = 1; lapics[apic_id].la_id = apic_id; - for (i = 0; i <= LVT_MAX; i++) { + for (i = 0; i <= APIC_LVT_MAX; i++) { lapics[apic_id].la_lvts[i] = lvts[i]; lapics[apic_id].la_lvts[i].lvt_active = 0; } @@ -340,10 +340,10 @@ lapic_dump(const char* str) lapic->lvt_lint0, lapic->lvt_lint1, lapic->tpr, lapic->svr); printf(" timer: 0x%08x therm: 0x%08x err: 0x%08x", lapic->lvt_timer, lapic->lvt_thermal, lapic->lvt_error); - if (maxlvt >= LVT_PMC) + if (maxlvt >= APIC_LVT_PMC) printf(" pmc: 0x%08x", lapic->lvt_pcint); printf("\n"); - if (maxlvt >= LVT_CMCI) + if (maxlvt >= APIC_LVT_CMCI) printf(" cmci: 0x%08x\n", lapic->lvt_cmci); } @@ -367,16 +367,16 @@ lapic_setup(int boot) lapic_enable(); /* Program LINT[01] LVT entries. */ - lapic->lvt_lint0 = lvt_mode(la, LVT_LINT0, lapic->lvt_lint0); - lapic->lvt_lint1 = lvt_mode(la, LVT_LINT1, lapic->lvt_lint1); + lapic->lvt_lint0 = lvt_mode(la, APIC_LVT_LINT0, lapic->lvt_lint0); + lapic->lvt_lint1 = lvt_mode(la, APIC_LVT_LINT1, lapic->lvt_lint1); /* Program the PMC LVT entry if present. */ - if (maxlvt >= LVT_PMC) - lapic->lvt_pcint = lvt_mode(la, LVT_PMC, lapic->lvt_pcint); + if (maxlvt >= APIC_LVT_PMC) + lapic->lvt_pcint = lvt_mode(la, APIC_LVT_PMC, lapic->lvt_pcint); /* Program timer LVT and setup handler. */ la->lvt_timer_cache = lapic->lvt_timer = - lvt_mode(la, LVT_TIMER, lapic->lvt_timer); + lvt_mode(la, APIC_LVT_TIMER, lapic->lvt_timer); if (boot) { snprintf(buf, sizeof(buf), "cpu%d:timer", PCPU_GET(cpuid)); intrcnt_add(buf, &la->la_timer_count); @@ -394,14 +394,14 @@ lapic_setup(int boot) } /* Program error LVT and clear any existing errors. */ - lapic->lvt_error = lvt_mode(la, LVT_ERROR, lapic->lvt_error); + lapic->lvt_error = lvt_mode(la, APIC_LVT_ERROR, lapic->lvt_error); lapic->esr = 0; /* XXX: Thermal LVT */ /* Program the CMCI LVT entry if present. */ - if (maxlvt >= LVT_CMCI) - lapic->lvt_cmci = lvt_mode(la, LVT_CMCI, lapic->lvt_cmci); + if (maxlvt >= APIC_LVT_CMCI) + lapic->lvt_cmci = lvt_mode(la, APIC_LVT_CMCI, lapic->lvt_cmci); intr_restore(saveintr); } @@ -425,7 +425,7 @@ lapic_update_pmc(void *dummy) struct lapic *la; la = &lapics[lapic_id()]; - lapic->lvt_pcint = lvt_mode(la, LVT_PMC, lapic->lvt_pcint); + lapic->lvt_pcint = lvt_mode(la, APIC_LVT_PMC, lapic->lvt_pcint); } #endif @@ -441,10 +441,10 @@ lapic_enable_pmc(void) /* Fail if the PMC LVT is not present. */ maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; - if (maxlvt < LVT_PMC) + if (maxlvt < APIC_LVT_PMC) return (0); - lvts[LVT_PMC].lvt_masked = 0; + lvts[APIC_LVT_PMC].lvt_masked = 0; #ifdef SMP /* @@ -475,10 +475,10 @@ lapic_disable_pmc(void) /* Fail if the PMC LVT is not present. */ maxlvt = (lapic->version & APIC_VER_MAXLVT) >> MAXLVTSHIFT; - if (maxlvt < LVT_PMC) + if (maxlvt < APIC_LVT_PMC) return; - lvts[LVT_PMC].lvt_masked = 1; + lvts[APIC_LVT_PMC].lvt_masked = 1; #ifdef SMP /* The APs should always be started when hwpmc is unloaded. */ @@ -618,7 +618,7 @@ int lapic_set_lvt_mask(u_int apic_id, u_int pin, u_char masked) { - if (pin > LVT_MAX) + if (pin > APIC_LVT_MAX) return (EINVAL); if (apic_id == APIC_ID_ALL) { lvts[pin].lvt_masked = masked; @@ -642,7 +642,7 @@ lapic_set_lvt_mode(u_int apic_id, u_int { struct lvt *lvt; - if (pin > LVT_MAX) + if (pin > APIC_LVT_MAX) return (EINVAL); if (apic_id == APIC_ID_ALL) { lvt = &lvts[pin]; @@ -697,7 +697,7 @@ int lapic_set_lvt_polarity(u_int apic_id, u_int pin, enum intr_polarity pol) { - if (pin > LVT_MAX || pol == INTR_POLARITY_CONFORM) + if (pin > APIC_LVT_MAX || pol == INTR_POLARITY_CONFORM) return (EINVAL); if (apic_id == APIC_ID_ALL) { lvts[pin].lvt_activehi = (pol == INTR_POLARITY_HIGH); @@ -722,7 +722,7 @@ int lapic_set_lvt_triggermode(u_int apic_id, u_int pin, enum intr_trigger trigger) { - if (pin > LVT_MAX || trigger == INTR_TRIGGER_CONFORM) + if (pin > APIC_LVT_MAX || trigger == INTR_TRIGGER_CONFORM) return (EINVAL); if (apic_id == APIC_ID_ALL) { lvts[pin].lvt_edgetrigger = (trigger == INTR_TRIGGER_EDGE); @@ -895,8 +895,8 @@ lapic_enable_cmc(void) apic_id = PCPU_GET(apic_id); KASSERT(lapics[apic_id].la_present, ("%s: missing APIC %u", __func__, apic_id)); - lapics[apic_id].la_lvts[LVT_CMCI].lvt_masked = 0; - lapics[apic_id].la_lvts[LVT_CMCI].lvt_active = 1; + lapics[apic_id].la_lvts[APIC_LVT_CMCI].lvt_masked = 0; + lapics[apic_id].la_lvts[APIC_LVT_CMCI].lvt_active = 1; if (bootverbose) printf("lapic%u: CMCI unmasked\n", apic_id); } Modified: stable/10/sys/x86/x86/mptable.c ============================================================================== --- stable/10/sys/x86/x86/mptable.c Mon Feb 17 23:07:16 2014 (r262140) +++ stable/10/sys/x86/x86/mptable.c Tue Feb 18 01:15:32 2014 (r262141) @@ -786,9 +786,9 @@ mptable_parse_local_int(int_entry_ptr in else apic_id = intr->dst_apic_id; if (intr->dst_apic_int == 0) - pin = LVT_LINT0; + pin = APIC_LVT_LINT0; else - pin = LVT_LINT1; + pin = APIC_LVT_LINT1; switch (intr->int_type) { case INTENTRY_TYPE_INT: #if 1 @@ -902,8 +902,9 @@ mptable_parse_ints(void) /* Is this a pre-defined config? */ if (mpfps->config_type != 0) { /* Configure LINT pins. */ - lapic_set_lvt_mode(APIC_ID_ALL, LVT_LINT0, APIC_LVT_DM_EXTINT); - lapic_set_lvt_mode(APIC_ID_ALL, LVT_LINT1, APIC_LVT_DM_NMI); + lapic_set_lvt_mode(APIC_ID_ALL, APIC_LVT_LINT0, + APIC_LVT_DM_EXTINT); + lapic_set_lvt_mode(APIC_ID_ALL, APIC_LVT_LINT1, APIC_LVT_DM_NMI); /* Configure I/O APIC pins. */ mptable_parse_default_config_ints(); From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 03:33:52 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 639E78E2; Tue, 18 Feb 2014 03:33: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4F7BD149D; Tue, 18 Feb 2014 03:33:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I3XqqU004599; Tue, 18 Feb 2014 03:33:52 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I3Xq5S004598; Tue, 18 Feb 2014 03:33:52 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201402180333.s1I3Xq5S004598@svn.freebsd.org> From: Warren Block Date: Tue, 18 Feb 2014 03:33:52 +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: r262145 - stable/10/share/man/man9 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 03:33:52 -0000 Author: wblock (doc committer) Date: Tue Feb 18 03:33:51 2014 New Revision: 262145 URL: http://svnweb.freebsd.org/changeset/base/262145 Log: MFC r261800: Remove obsolete vnode(9) man page references. Modified: stable/10/share/man/man9/vnode.9 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man9/vnode.9 ============================================================================== --- stable/10/share/man/man9/vnode.9 Tue Feb 18 03:07:36 2014 (r262144) +++ stable/10/share/man/man9/vnode.9 Tue Feb 18 03:33:51 2014 (r262145) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2010 +.Dd February 12, 2014 .Dt VNODE 9 .Os .Sh NAME @@ -69,11 +69,8 @@ and the .Va v_holdcnt of a vnode reaches zero then the vnode will be put on the freelist and may be reused for another file, possibly in another file system. -The transition to and from the freelist is handled by -.Xr getnewvnode 9 , -.Xr vfree 9 -and -.Xr vbusy 9 . +The transition from the freelist is handled by +.Xr getnewvnode 9 . The third is a count of the number of clients which are writing into the file. It is maintained by the @@ -82,9 +79,9 @@ and .Xr close 2 system calls. .Pp -Any call which returns a vnode (e.g.\& +Any call which returns a vnode (e.g.,\& .Xr vget 9 , -.Xr VOP_LOOKUP 9 +.Xr VOP_LOOKUP 9 , etc.) will increase the .Va v_usecount From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 03:37:21 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 02F8AAE0; Tue, 18 Feb 2014 03:37: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E178914ED; Tue, 18 Feb 2014 03:37:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I3bKW7005041; Tue, 18 Feb 2014 03:37:20 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I3bKHx005040; Tue, 18 Feb 2014 03:37:20 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201402180337.s1I3bKHx005040@svn.freebsd.org> From: Warren Block Date: Tue, 18 Feb 2014 03:37:20 +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: r262146 - stable/9/share/man/man9 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 03:37:21 -0000 Author: wblock (doc committer) Date: Tue Feb 18 03:37:20 2014 New Revision: 262146 URL: http://svnweb.freebsd.org/changeset/base/262146 Log: MFC r261800: Remove obsolete vnode(9) man page references. Modified: stable/9/share/man/man9/vnode.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/vnode.9 ============================================================================== --- stable/9/share/man/man9/vnode.9 Tue Feb 18 03:33:51 2014 (r262145) +++ stable/9/share/man/man9/vnode.9 Tue Feb 18 03:37:20 2014 (r262146) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2010 +.Dd February 12, 2014 .Dt VNODE 9 .Os .Sh NAME @@ -69,11 +69,8 @@ and the .Va v_holdcnt of a vnode reaches zero then the vnode will be put on the freelist and may be reused for another file, possibly in another file system. -The transition to and from the freelist is handled by -.Xr getnewvnode 9 , -.Xr vfree 9 -and -.Xr vbusy 9 . +The transition from the freelist is handled by +.Xr getnewvnode 9 . The third is a count of the number of clients which are writing into the file. It is maintained by the @@ -82,9 +79,9 @@ and .Xr close 2 system calls. .Pp -Any call which returns a vnode (e.g.\& +Any call which returns a vnode (e.g.,\& .Xr vget 9 , -.Xr VOP_LOOKUP 9 +.Xr VOP_LOOKUP 9 , etc.) will increase the .Va v_usecount From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 03:39:21 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 58C74C8B; Tue, 18 Feb 2014 03:39: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2AC1C151A; Tue, 18 Feb 2014 03:39:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I3dLDY005311; Tue, 18 Feb 2014 03:39:21 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I3dLtW005310; Tue, 18 Feb 2014 03:39:21 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201402180339.s1I3dLtW005310@svn.freebsd.org> From: Warren Block Date: Tue, 18 Feb 2014 03:39:21 +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: r262147 - stable/10/usr.bin/passwd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 03:39:21 -0000 Author: wblock (doc committer) Date: Tue Feb 18 03:39:20 2014 New Revision: 262147 URL: http://svnweb.freebsd.org/changeset/base/262147 Log: MFC r261895: Remove mention of minimum password length and upper/lower case checking, patch supplied by Allan Jude . Add xref to pam_passwdqc(8), where that testing is now done. Modified: stable/10/usr.bin/passwd/passwd.1 Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.bin/passwd/passwd.1 ============================================================================== --- stable/10/usr.bin/passwd/passwd.1 Tue Feb 18 03:37:20 2014 (r262146) +++ stable/10/usr.bin/passwd/passwd.1 Tue Feb 18 03:39:20 2014 (r262147) @@ -28,7 +28,7 @@ .\" @(#)passwd.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd February 14, 2014 .Dt PASSWD 1 .Os .Sh NAME @@ -59,27 +59,10 @@ The .Nm utility prompts for the new password twice in order to detect typing errors. .Pp -The new password should be at least six characters long (which -may be overridden using the -.Xr login.conf 5 -.Dq minpasswordlen -setting for a user's login class) and not purely alphabetic. -Its total length must be less than +The total length of the password must be less than .Dv _PASSWORD_LEN (currently 128 characters). .Pp -The new password should contain a mixture of upper and lower case -characters (which may be overridden using the -.Xr login.conf 5 -.Dq mixpasswordcase -setting for a user's login class). -Allowing lower case passwords may -be useful where the password file will be used in situations where only -lower case passwords are permissible, such as when using Samba to -authenticate Windows clients. -In all other situations, numbers, upper -case letters and meta characters are encouraged. -.Pp Once the password has been verified, .Nm communicates the new password information to @@ -230,6 +213,7 @@ login class capabilities database .Xr passwd 5 , .Xr kerberos 8 , .Xr kpasswdd 8 , +.Xr pam_passwdqc 8 , .Xr pw 8 , .Xr pwd_mkdb 8 , .Xr vipw 8 From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 03:42:50 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9AA57F5D; Tue, 18 Feb 2014 03:42: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6A94D15E5; Tue, 18 Feb 2014 03:42:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I3goXq008356; Tue, 18 Feb 2014 03:42:50 GMT (envelope-from wblock@svn.freebsd.org) Received: (from wblock@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I3goi9008355; Tue, 18 Feb 2014 03:42:50 GMT (envelope-from wblock@svn.freebsd.org) Message-Id: <201402180342.s1I3goi9008355@svn.freebsd.org> From: Warren Block Date: Tue, 18 Feb 2014 03:42:50 +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: r262148 - stable/9/usr.bin/passwd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 03:42:50 -0000 Author: wblock (doc committer) Date: Tue Feb 18 03:42:49 2014 New Revision: 262148 URL: http://svnweb.freebsd.org/changeset/base/262148 Log: MFC r261895: Remove mention of minimum password length and upper/lower case checking, patch supplied by Allan Jude . Add xref to pam_passwdqc(8), where that testing is now done. Modified: stable/9/usr.bin/passwd/passwd.1 Directory Properties: stable/9/usr.bin/passwd/ (props changed) Modified: stable/9/usr.bin/passwd/passwd.1 ============================================================================== --- stable/9/usr.bin/passwd/passwd.1 Tue Feb 18 03:39:20 2014 (r262147) +++ stable/9/usr.bin/passwd/passwd.1 Tue Feb 18 03:42:49 2014 (r262148) @@ -28,7 +28,7 @@ .\" @(#)passwd.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd February 14, 2014 .Dt PASSWD 1 .Os .Sh NAME @@ -59,27 +59,10 @@ The .Nm utility prompts for the new password twice in order to detect typing errors. .Pp -The new password should be at least six characters long (which -may be overridden using the -.Xr login.conf 5 -.Dq minpasswordlen -setting for a user's login class) and not purely alphabetic. -Its total length must be less than +The total length of the password must be less than .Dv _PASSWORD_LEN (currently 128 characters). .Pp -The new password should contain a mixture of upper and lower case -characters (which may be overridden using the -.Xr login.conf 5 -.Dq mixpasswordcase -setting for a user's login class). -Allowing lower case passwords may -be useful where the password file will be used in situations where only -lower case passwords are permissible, such as when using Samba to -authenticate Windows clients. -In all other situations, numbers, upper -case letters and meta characters are encouraged. -.Pp Once the password has been verified, .Nm communicates the new password information to @@ -230,6 +213,7 @@ login class capabilities database .Xr passwd 5 , .Xr kerberos 8 , .Xr kpasswdd 8 , +.Xr pam_passwdqc 8 , .Xr pw 8 , .Xr pwd_mkdb 8 , .Xr vipw 8 From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 05:01:06 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14B461FF; Tue, 18 Feb 2014 05:01: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 25FAC1B99; Tue, 18 Feb 2014 05:01:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I515lN038762; Tue, 18 Feb 2014 05:01:05 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I515E3038759; Tue, 18 Feb 2014 05:01:05 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201402180501.s1I515E3038759@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 18 Feb 2014 05:01: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: r262151 - in stable/10: share/man/man4 sys/conf sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/dev/re sys/modules/netmap sys/net tools/tools/netmap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 05:01:06 -0000 Author: luigi Date: Tue Feb 18 05:01:04 2014 New Revision: 262151 URL: http://svnweb.freebsd.org/changeset/base/262151 Log: MFH: sync the netmap code with the one in HEAD (enhanced VALE switch, netmap pipes, emulated netmap mode). See details in the log for svn 261909. Deleted: stable/10/tools/tools/netmap/click-test.cfg stable/10/tools/tools/netmap/nm_util.c stable/10/tools/tools/netmap/nm_util.h stable/10/tools/tools/netmap/pcap.c Modified: stable/10/share/man/man4/netmap.4 stable/10/sys/conf/files stable/10/sys/dev/e1000/if_em.c stable/10/sys/dev/e1000/if_igb.c stable/10/sys/dev/e1000/if_lem.c stable/10/sys/dev/ixgbe/ixgbe.c stable/10/sys/dev/netmap/if_em_netmap.h stable/10/sys/dev/netmap/if_igb_netmap.h stable/10/sys/dev/netmap/if_lem_netmap.h stable/10/sys/dev/netmap/if_re_netmap.h stable/10/sys/dev/netmap/ixgbe_netmap.h stable/10/sys/dev/netmap/netmap.c stable/10/sys/dev/netmap/netmap_kern.h stable/10/sys/dev/netmap/netmap_mem2.c stable/10/sys/dev/re/if_re.c stable/10/sys/modules/netmap/Makefile stable/10/sys/net/netmap.h stable/10/sys/net/netmap_user.h stable/10/tools/tools/netmap/Makefile stable/10/tools/tools/netmap/README stable/10/tools/tools/netmap/bridge.c stable/10/tools/tools/netmap/pkt-gen.c stable/10/tools/tools/netmap/vale-ctl.c Modified: stable/10/share/man/man4/netmap.4 ============================================================================== --- stable/10/share/man/man4/netmap.4 Tue Feb 18 04:38:26 2014 (r262150) +++ stable/10/share/man/man4/netmap.4 Tue Feb 18 05:01:04 2014 (r262151) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Matteo Landi, Luigi Rizzo, Universita` di Pisa +.\" Copyright (c) 2011-2014 Matteo Landi, Luigi Rizzo, Universita` di Pisa .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -21,230 +21,636 @@ .\" 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. -.\" +.\" .\" This document is derived in part from the enet man page (enet.4) .\" distributed with 4.3BSD Unix. .\" .\" $FreeBSD$ -.\" $Id: netmap.4 11563 2012-08-02 08:59:12Z luigi $: stable/8/share/man/man4/bpf.4 181694 2008-08-13 17:45:06Z ed $ .\" -.Dd September 23, 2013 +.Dd February 13, 2014 .Dt NETMAP 4 .Os .Sh NAME .Nm netmap .Nd a framework for fast packet I/O +.br +.Nm VALE +.Nd a fast VirtuAl Local Ethernet using the netmap API +.br +.Nm netmap pipes +.Nd a shared memory packet transport channel .Sh SYNOPSIS .Cd device netmap .Sh DESCRIPTION .Nm -is a framework for fast and safe access to network devices -(reaching 14.88 Mpps at less than 1 GHz). -.Nm -uses memory mapped buffers and metadata -(buffer indexes and lengths) to communicate with the kernel, -which is in charge of validating information through -.Pa ioctl() +is a framework for extremely fast and efficient packet I/O +for both userspace and kernel clients. +It runs on FreeBSD and Linux, +and includes +.Nm VALE , +a very fast and modular in-kernel software switch/dataplane, +and +.Nm netmap pipes , +a shared memory packet transport channel. +All these are accessed interchangeably with the same API. +.Pp +.Nm , VALE and -.Pa select()/poll(). +.Nm netmap pipes +are at least one order of magnitude faster than +standard OS mechanisms +(sockets, bpf, tun/tap interfaces, native switches, pipes), +reaching 14.88 million packets per second (Mpps) +with much less than one core on a 10 Gbit NIC, +about 20 Mpps per core for VALE ports, +and over 100 Mpps for netmap pipes. +.Pp +Userspace clients can dynamically switch NICs into .Nm -can exploit the parallelism in multiqueue devices and -multicore systems. +mode and send and receive raw packets through +memory mapped buffers. +Similarly, +.Nm VALE +switch instances and ports, and +.Nm netmap pipes +can be created dynamically, +providing high speed packet I/O between processes, +virtual machines, NICs and the host stack. .Pp .Nm +suports both non-blocking I/O through +.Xr ioctls() , +synchronization and blocking I/O through a file descriptor +and standard OS mechanisms such as +.Xr select 2 , +.Xr poll 2 , +.Xr epoll 2 , +.Xr kqueue 2 . +.Nm VALE +and +.Nm netmap pipes +are implemented by a single kernel module, which also emulates the +.Nm +API over standard drivers for devices without native +.Nm +support. +For best performance, +.Nm requires explicit support in device drivers. -For a list of supported devices, see the end of this manual page. -.Sh OPERATION +.Pp +In the rest of this (long) manual page we document +various aspects of the .Nm -clients must first open the -.Pa open("/dev/netmap") , -and then issue an -.Pa ioctl(...,NIOCREGIF,...) -to bind the file descriptor to a network device. -.Pp -When a device is put in -.Nm -mode, its data path is disconnected from the host stack. -The processes owning the file descriptor -can exchange packets with the device, or with the host stack, -through an mmapped memory region that contains pre-allocated -buffers and metadata. +and +.Nm VALE +architecture, features and usage. +.Pp +.Sh ARCHITECTURE +.Nm +supports raw packet I/O through a +.Em port , +which can be connected to a physical interface +.Em ( NIC ) , +to the host stack, +or to a +.Nm VALE +switch). +Ports use preallocated circular queues of buffers +.Em ( rings ) +residing in an mmapped region. +There is one ring for each transmit/receive queue of a +NIC or virtual port. +An additional ring pair connects to the host stack. +.Pp +After binding a file descriptor to a port, a +.Nm +client can send or receive packets in batches through +the rings, and possibly implement zero-copy forwarding +between ports. +.Pp +All NICs operating in +.Nm +mode use the same memory region, +accessible to all processes who own +.Nm /dev/netmap +file descriptors bound to NICs. +Independent +.Nm VALE +and +.Nm netmap pipe +ports +by default use separate memory regions, +but can be independently configured to share memory. +.Pp +.Sh ENTERING AND EXITING NETMAP MODE +The following section describes the system calls to create +and control +.Nm netmap +ports (including +.Nm VALE +and +.Nm netmap pipe +ports). +Simpler, higher level functions are described in section +.Xr LIBRARIES . +.Pp +Ports and rings are created and controlled through a file descriptor, +created by opening a special device +.Dl fd = open("/dev/netmap"); +and then bound to a specific port with an +.Dl ioctl(fd, NIOCREGIF, (struct nmreq *)arg); +.Pp +.Nm +has multiple modes of operation controlled by the +.Vt struct nmreq +argument. +.Va arg.nr_name +specifies the port name, as follows: +.Bl -tag -width XXXX +.It Dv OS network interface name (e.g. 'em0', 'eth1', ... ) +the data path of the NIC is disconnected from the host stack, +and the file descriptor is bound to the NIC (one or all queues), +or to the host stack; +.It Dv valeXXX:YYY (arbitrary XXX and YYY) +the file descriptor is bound to port YYY of a VALE switch called XXX, +both dynamically created if necessary. +The string cannot exceed IFNAMSIZ characters, and YYY cannot +be the name of any existing OS network interface. +.El +.Pp +On return, +.Va arg +indicates the size of the shared memory region, +and the number, size and location of all the +.Nm +data structures, which can be accessed by mmapping the memory +.Dl char *mem = mmap(0, arg.nr_memsize, fd); .Pp Non blocking I/O is done with special -.Pa ioctl()'s , -whereas the file descriptor can be passed to -.Pa select()/poll() -to be notified about incoming packet or available transmit buffers. -.Ss Data structures -All data structures for all devices in -.Nm -mode are in a memory -region shared by the kernel and all processes -who open -.Pa /dev/netmap -(NOTE: visibility may be restricted in future implementations). -All references between the shared data structure -are relative (offsets or indexes). Some macros help converting -them into actual pointers. +.Xr ioctl 2 +.Xr select 2 +and +.Xr poll 2 +on the file descriptor permit blocking I/O. +.Xr epoll 2 +and +.Xr kqueue 2 +are not supported on +.Nm +file descriptors. .Pp -The data structures in shared memory are the following: +While a NIC is in +.Nm +mode, the OS will still believe the interface is up and running. +OS-generated packets for that NIC end up into a +.Nm +ring, and another ring is used to send packets into the OS network stack. +A +.Xr close 2 +on the file descriptor removes the binding, +and returns the NIC to normal mode (reconnecting the data path +to the host stack), or destroys the virtual port. +.Pp +.Sh DATA STRUCTURES +The data structures in the mmapped memory region are detailed in +.Xr sys/net/netmap.h , +which is the ultimate reference for the +.Nm +API. The main structures and fields are indicated below: .Bl -tag -width XXX .It Dv struct netmap_if (one per interface) -indicates the number of rings supported by an interface, their -sizes, and the offsets of the -.Pa netmap_rings -associated to the interface. -The offset of a -.Pa struct netmap_if -in the shared memory region is indicated by the -.Pa nr_offset -field in the structure returned by the -.Pa NIOCREGIF -(see below). .Bd -literal struct netmap_if { - char ni_name[IFNAMSIZ]; /* name of the interface. */ - const u_int ni_num_queues; /* number of hw ring pairs */ - const ssize_t ring_ofs[]; /* offset of tx and rx rings */ + ... + const uint32_t ni_flags; /* properties */ + ... + const uint32_t ni_tx_rings; /* NIC tx rings */ + const uint32_t ni_rx_rings; /* NIC rx rings */ + uint32_t ni_bufs_head; /* head of extra bufs list */ + ... }; .Ed +.Pp +Indicates the number of available rings +.Pa ( struct netmap_rings ) +and their position in the mmapped region. +The number of tx and rx rings +.Pa ( ni_tx_rings , ni_rx_rings ) +normally depends on the hardware. +NICs also have an extra tx/rx ring pair connected to the host stack. +.Em NIOCREGIF +can also request additional unbound buffers in the same memory space, +to be used as temporary storage for packets. +.Pa ni_bufs_head +contains the index of the first of these free rings, +which are connected in a list (the first uint32_t of each +buffer being the index of the next buffer in the list). +A 0 indicates the end of the list. +.Pp .It Dv struct netmap_ring (one per ring) -contains the index of the current read or write slot (cur), -the number of slots available for reception or transmission (avail), -and an array of -.Pa slots -describing the buffers. -There is one ring pair for each of the N hardware ring pairs -supported by the card (numbered 0..N-1), plus -one ring pair (numbered N) for packets from/to the host stack. .Bd -literal struct netmap_ring { - const ssize_t buf_ofs; - const uint32_t num_slots; /* number of slots in the ring. */ - uint32_t avail; /* number of usable slots */ - uint32_t cur; /* 'current' index for the user side */ - uint32_t reserved; /* not refilled before current */ - - const uint16_t nr_buf_size; - uint16_t flags; - struct netmap_slot slot[0]; /* array of slots. */ + ... + const uint32_t num_slots; /* slots in each ring */ + const uint32_t nr_buf_size; /* size of each buffer */ + ... + uint32_t head; /* (u) first buf owned by user */ + uint32_t cur; /* (u) wakeup position */ + const uint32_t tail; /* (k) first buf owned by kernel */ + ... + uint32_t flags; + struct timeval ts; /* (k) time of last rxsync() */ + ... + struct netmap_slot slot[0]; /* array of slots */ } .Ed -.It Dv struct netmap_slot (one per packet) -contains the metadata for a packet: a buffer index (buf_idx), -a buffer length (len), and some flags. +.Pp +Implements transmit and receive rings, with read/write +pointers, metadata and and an array of +.Pa slots +describing the buffers. +.Pp +.It Dv struct netmap_slot (one per buffer) .Bd -literal struct netmap_slot { - uint32_t buf_idx; /* buffer index */ - uint16_t len; /* packet length */ - uint16_t flags; /* buf changed, etc. */ -#define NS_BUF_CHANGED 0x0001 /* must resync, buffer changed */ -#define NS_REPORT 0x0002 /* tell hw to report results - * e.g. by generating an interrupt - */ + uint32_t buf_idx; /* buffer index */ + uint16_t len; /* packet length */ + uint16_t flags; /* buf changed, etc. */ + uint64_t ptr; /* address for indirect buffers */ }; .Ed +.Pp +Describes a packet buffer, which normally is identified by +an index and resides in the mmapped region. .It Dv packet buffers -are fixed size (approximately 2k) buffers allocated by the kernel -that contain packet data. Buffers addresses are computed through -macros. +Fixed size (normally 2 KB) packet buffers allocated by the kernel. .El .Pp -Some macros support the access to objects in the shared memory -region. In particular: +The offset of the +.Pa struct netmap_if +in the mmapped region is indicated by the +.Pa nr_offset +field in the structure returned by +.Pa NIOCREGIF . +From there, all other objects are reachable through +relative references (offsets or indexes). +Macros and functions in +help converting them into actual pointers: +.Pp +.Dl struct netmap_if *nifp = NETMAP_IF(mem, arg.nr_offset); +.Dl struct netmap_ring *txr = NETMAP_TXRING(nifp, ring_index); +.Dl struct netmap_ring *rxr = NETMAP_RXRING(nifp, ring_index); +.Pp +.Dl char *buf = NETMAP_BUF(ring, buffer_index); +.Sh RINGS, BUFFERS AND DATA I/O +.Va Rings +are circular queues of packets with three indexes/pointers +.Va ( head , cur , tail ) ; +one slot is always kept empty. +The ring size +.Va ( num_slots ) +should not be assumed to be a power of two. +.br +(NOTE: older versions of netmap used head/count format to indicate +the content of a ring). +.Pp +.Va head +is the first slot available to userspace; +.br +.Va cur +is the wakeup point: +select/poll will unblock when +.Va tail +passes +.Va cur ; +.br +.Va tail +is the first slot reserved to the kernel. +.Pp +Slot indexes MUST only move forward; +for convenience, the function +.Dl nm_ring_next(ring, index) +returns the next index modulo the ring size. +.Pp +.Va head +and +.Va cur +are only modified by the user program; +.Va tail +is only modified by the kernel. +The kernel only reads/writes the +.Vt struct netmap_ring +slots and buffers +during the execution of a netmap-related system call. +The only exception are slots (and buffers) in the range +.Va tail\ . . . head-1 , +that are explicitly assigned to the kernel. +.Pp +.Ss TRANSMIT RINGS +On transmit rings, after a +.Nm +system call, slots in the range +.Va head\ . . . tail-1 +are available for transmission. +User code should fill the slots sequentially +and advance +.Va head +and +.Va cur +past slots ready to transmit. +.Va cur +may be moved further ahead if the user code needs +more slots before further transmissions (see +.Sx SCATTER GATHER I/O ) . +.Pp +At the next NIOCTXSYNC/select()/poll(), +slots up to +.Va head-1 +are pushed to the port, and +.Va tail +may advance if further slots have become available. +Below is an example of the evolution of a TX ring: +.Pp .Bd -literal -struct netmap_if *nifp; -struct netmap_ring *txring = NETMAP_TXRING(nifp, i); -struct netmap_ring *rxring = NETMAP_RXRING(nifp, i); -int i = txring->slot[txring->cur].buf_idx; -char *buf = NETMAP_BUF(txring, i); + after the syscall, slots between cur and tail are (a)vailable + head=cur tail + | | + v v + TX [.....aaaaaaaaaaa.............] + + user creates new packets to (T)ransmit + head=cur tail + | | + v v + TX [.....TTTTTaaaaaa.............] + + NIOCTXSYNC/poll()/select() sends packets and reports new slots + head=cur tail + | | + v v + TX [..........aaaaaaaaaaa........] +.Ed +.Pp +select() and poll() wlll block if there is no space in the ring, i.e. +.Dl ring->cur == ring->tail +and return when new slots have become available. +.Pp +High speed applications may want to amortize the cost of system calls +by preparing as many packets as possible before issuing them. +.Pp +A transmit ring with pending transmissions has +.Dl ring->head != ring->tail + 1 (modulo the ring size). +The function +.Va int nm_tx_pending(ring) +implements this test. +.Pp +.Ss RECEIVE RINGS +On receive rings, after a +.Nm +system call, the slots in the range +.Va head\& . . . tail-1 +contain received packets. +User code should process them and advance +.Va head +and +.Va cur +past slots it wants to return to the kernel. +.Va cur +may be moved further ahead if the user code wants to +wait for more packets +without returning all the previous slots to the kernel. +.Pp +At the next NIOCRXSYNC/select()/poll(), +slots up to +.Va head-1 +are returned to the kernel for further receives, and +.Va tail +may advance to report new incoming packets. +.br +Below is an example of the evolution of an RX ring: +.Bd -literal + after the syscall, there are some (h)eld and some (R)eceived slots + head cur tail + | | | + v v v + RX [..hhhhhhRRRRRRRR..........] + + user advances head and cur, releasing some slots and holding others + head cur tail + | | | + v v v + RX [..*****hhhRRRRRR...........] + + NICRXSYNC/poll()/select() recovers slots and reports new packets + head cur tail + | | | + v v v + RX [.......hhhRRRRRRRRRRRR....] .Ed +.Pp +.Sh SLOTS AND PACKET BUFFERS +Normally, packets should be stored in the netmap-allocated buffers +assigned to slots when ports are bound to a file descriptor. +One packet is fully contained in a single buffer. +.Pp +The following flags affect slot and buffer processing: +.Bl -tag -width XXX +.It NS_BUF_CHANGED +it MUST be used when the buf_idx in the slot is changed. +This can be used to implement +zero-copy forwarding, see +.Sx ZERO-COPY FORWARDING . +.Pp +.It NS_REPORT +reports when this buffer has been transmitted. +Normally, +.Nm +notifies transmit completions in batches, hence signals +can be delayed indefinitely. This flag helps detecting +when packets have been send and a file descriptor can be closed. +.It NS_FORWARD +When a ring is in 'transparent' mode (see +.Sx TRANSPARENT MODE ) , +packets marked with this flags are forwarded to the other endpoint +at the next system call, thus restoring (in a selective way) +the connection between a NIC and the host stack. +.It NS_NO_LEARN +tells the forwarding code that the SRC MAC address for this +packet must not be used in the learning bridge code. +.It NS_INDIRECT +indicates that the packet's payload is in a user-supplied buffer, +whose user virtual address is in the 'ptr' field of the slot. +The size can reach 65535 bytes. +.br +This is only supported on the transmit ring of +.Nm VALE +ports, and it helps reducing data copies in the interconnection +of virtual machines. +.It NS_MOREFRAG +indicates that the packet continues with subsequent buffers; +the last buffer in a packet must have the flag clear. +.El +.Sh SCATTER GATHER I/O +Packets can span multiple slots if the +.Va NS_MOREFRAG +flag is set in all but the last slot. +The maximum length of a chain is 64 buffers. +This is normally used with +.Nm VALE +ports when connecting virtual machines, as they generate large +TSO segments that are not split unless they reach a physical device. +.Pp +NOTE: The length field always refers to the individual +fragment; there is no place with the total length of a packet. +.Pp +On receive rings the macro +.Va NS_RFRAGS(slot) +indicates the remaining number of slots for this packet, +including the current one. +Slots with a value greater than 1 also have NS_MOREFRAG set. .Sh IOCTLS .Nm -supports some ioctl() to synchronize the state of the rings -between the kernel and the user processes, plus some -to query and configure the interface. -The former do not require any argument, whereas the latter -use a -.Pa struct netmap_req -defined as follows: +uses two ioctls (NIOCTXSYNC, NIOCRXSYNC) +for non-blocking I/O. They take no argument. +Two more ioctls (NIOCGINFO, NIOCREGIF) are used +to query and configure ports, with the following argument: .Bd -literal struct nmreq { - char nr_name[IFNAMSIZ]; - uint32_t nr_version; /* API version */ -#define NETMAP_API 3 /* current version */ - uint32_t nr_offset; /* nifp offset in the shared region */ - uint32_t nr_memsize; /* size of the shared region */ - uint32_t nr_tx_slots; /* slots in tx rings */ - uint32_t nr_rx_slots; /* slots in rx rings */ - uint16_t nr_tx_rings; /* number of tx rings */ - uint16_t nr_rx_rings; /* number of tx rings */ - uint16_t nr_ringid; /* ring(s) we care about */ -#define NETMAP_HW_RING 0x4000 /* low bits indicate one hw ring */ -#define NETMAP_SW_RING 0x2000 /* we process the sw ring */ -#define NETMAP_NO_TX_POLL 0x1000 /* no gratuitous txsync on poll */ -#define NETMAP_RING_MASK 0xfff /* the actual ring number */ - uint16_t spare1; - uint32_t spare2[4]; + char nr_name[IFNAMSIZ]; /* (i) port name */ + uint32_t nr_version; /* (i) API version */ + uint32_t nr_offset; /* (o) nifp offset in mmap region */ + uint32_t nr_memsize; /* (o) size of the mmap region */ + uint32_t nr_tx_slots; /* (i/o) slots in tx rings */ + uint32_t nr_rx_slots; /* (i/o) slots in rx rings */ + uint16_t nr_tx_rings; /* (i/o) number of tx rings */ + uint16_t nr_rx_rings; /* (i/o) number of tx rings */ + uint16_t nr_ringid; /* (i/o) ring(s) we care about */ + uint16_t nr_cmd; /* (i) special command */ + uint16_t nr_arg1; /* (i/o) extra arguments */ + uint16_t nr_arg2; /* (i/o) extra arguments */ + uint32_t nr_arg3; /* (i/o) extra arguments */ + uint32_t nr_flags /* (i/o) open mode */ + ... }; - .Ed -A device descriptor obtained through +.Pp +A file descriptor obtained through .Pa /dev/netmap -also supports the ioctl supported by network devices. +also supports the ioctl supported by network devices, see +.Xr netintro 4 . .Pp -The netmap-specific -.Xr ioctl 2 -command codes below are defined in -.In net/netmap.h -and are: .Bl -tag -width XXXX .It Dv NIOCGINFO -returns information about the interface named in nr_name. -On return, nr_memsize indicates the size of the shared netmap -memory region (this is device-independent), -nr_tx_slots and nr_rx_slots indicates how many buffers are in a -transmit and receive ring, -nr_tx_rings and nr_rx_rings indicates the number of transmit -and receive rings supported by the hardware. +returns EINVAL if the named port does not support netmap. +Otherwise, it returns 0 and (advisory) information +about the port. +Note that all the information below can change before the +interface is actually put in netmap mode. .Pp -If the device does not support netmap, the ioctl returns EINVAL. +.Bl -tag -width XX +.It Pa nr_memsize +indicates the size of the +.Nm +memory region. NICs in +.Nm +mode all share the same memory region, +whereas +.Nm VALE +ports have independent regions for each port. +.It Pa nr_tx_slots , nr_rx_slots +indicate the size of transmit and receive rings. +.It Pa nr_tx_rings , nr_rx_rings +indicate the number of transmit +and receive rings. +Both ring number and sizes may be configured at runtime +using interface-specific functions (e.g. +.Xr ethtool +). +.El .It Dv NIOCREGIF -puts the interface named in nr_name into netmap mode, disconnecting -it from the host stack, and/or defines which rings are controlled -through this file descriptor. -On return, it gives the same info as NIOCGINFO, and nr_ringid -indicates the identity of the rings controlled through the file +binds the port named in +.Va nr_name +to the file descriptor. For a physical device this also switches it into +.Nm +mode, disconnecting +it from the host stack. +Multiple file descriptors can be bound to the same port, +with proper synchronization left to the user. +.Pp +.Dv NIOCREGIF can also bind a file descriptor to one endpoint of a +.Em netmap pipe , +consisting of two netmap ports with a crossover connection. +A netmap pipe share the same memory space of the parent port, +and is meant to enable configuration where a master process acts +as a dispatcher towards slave processes. +.Pp +To enable this function, the +.Pa nr_arg1 +field of the structure can be used as a hint to the kernel to +indicate how many pipes we expect to use, and reserve extra space +in the memory region. +.Pp +On return, it gives the same info as NIOCGINFO, +with +.Pa nr_ringid +and +.Pa nr_flags +indicating the identity of the rings controlled through the file descriptor. .Pp -Possible values for nr_ringid are +.Va nr_flags +.Va nr_ringid +selects which rings are controlled through this file descriptor. +Possible values of +.Pa nr_flags +are indicated below, together with the naming schemes +that application libraries (such as the +.Nm nm_open +indicated below) can use to indicate the specific set of rings. +In the example below, "netmap:foo" is any valid netmap port name. +.Pp .Bl -tag -width XXXXX -.It 0 -default, all hardware rings -.It NETMAP_SW_RING -the ``host rings'' connecting to the host stack -.It NETMAP_HW_RING + i -the i-th hardware ring +.It NR_REG_ALL_NIC "netmap:foo" +(default) all hardware ring pairs +.It NR_REG_SW_NIC "netmap:foo^" +the ``host rings'', connecting to the host stack. +.It NR_RING_NIC_SW "netmap:foo+ +all hardware rings and the host rings +.It NR_REG_ONE_NIC "netmap:foo-i" +only the i-th hardware ring pair, where the number is in +.Pa nr_ringid ; +.It NR_REG_PIPE_MASTER "netmap:foo{i" +the master side of the netmap pipe whose identifier (i) is in +.Pa nr_ringid ; +.It NR_REG_PIPE_SLAVE "netmap:foo}i" +the slave side of the netmap pipe whose identifier (i) is in +.Pa nr_ringid . +.Pp +The identifier of a pipe must be thought as part of the pipe name, +and does not need to be sequential. On return the pipe +will only have a single ring pair with index 0, +irrespective of the value of i. .El +.Pp By default, a -.Nm poll +.Xr poll 2 or -.Nm select +.Xr select 2 call pushes out any pending packets on the transmit ring, even if no write events are specified. The feature can be disabled by or-ing -.Nm NETMAP_NO_TX_SYNC -to nr_ringid. -But normally you should keep this feature unless you are using -separate file descriptors for the send and receive rings, because -otherwise packets are pushed out only if NETMAP_TXSYNC is called, -or the send queue is full. -.Pp -.Pa NIOCREGIF -can be used multiple times to change the association of a -file descriptor to a ring pair, always within the same device. -.It Dv NIOCUNREGIF -brings an interface back to normal mode. +.Va NETMAP_NO_TX_SYNC +to the value written to +.Va nr_ringid. +When this feature is used, +packets are transmitted only on +.Va ioctl(NIOCTXSYNC) +or select()/poll() are called with a write event (POLLOUT/wfdset) or a full ring. +.Pp +When registering a virtual interface that is dynamically created to a +.Xr vale 4 +switch, we can specify the desired number of rings (1 by default, +and currently up to 16) on it using nr_tx_rings and nr_rx_rings fields. .It Dv NIOCTXSYNC tells the hardware of new packets to transmit, and updates the number of slots available for transmission. @@ -252,54 +658,387 @@ number of slots available for transmissi tells the hardware of consumed packets, and asks for newly available packets. .El +.Sh SELECT, POLL, EPOLL, KQUEUE. +.Xr select 2 +and +.Xr poll 2 +on a +.Nm +file descriptor process rings as indicated in +.Sx TRANSMIT RINGS +and +.Sx RECEIVE RINGS , +respectively when write (POLLOUT) and read (POLLIN) events are requested. +Both block if no slots are available in the ring +.Va ( ring->cur == ring->tail ) . +Depending on the platform, +.Xr epoll 2 +and +.Xr kqueue 2 +are supported too. +.Pp +Packets in transmit rings are normally pushed out +(and buffers reclaimed) even without +requesting write events. Passing the NETMAP_NO_TX_SYNC flag to +.Em NIOCREGIF +disables this feature. +By default, receive rings are processed only if read +events are requested. Passing the NETMAP_DO_RX_SYNC flag to +.Em NIOCREGIF updates receive rings even without read events. +Note that on epoll and kqueue, NETMAP_NO_TX_SYNC and NETMAP_DO_RX_SYNC +only have an effect when some event is posted for the file descriptor. +.Sh LIBRARIES +The +.Nm +API is supposed to be used directly, both because of its simplicity and +for efficient integration with applications. +.Pp +For conveniency, the +.Va +header provides a few macros and functions to ease creating +a file descriptor and doing I/O with a +.Nm +port. These are loosely modeled after the +.Xr pcap 3 +API, to ease porting of libpcap-based applications to +.Nm . +To use these extra functions, programs should +.Dl #define NETMAP_WITH_LIBS +before +.Dl #include +.Pp +The following functions are available: +.Bl -tag -width XXXXX +.It Va struct nm_desc * nm_open(const char *ifname, const struct nmreq *req, uint64_t flags, const struct nm_desc *arg) +similar to +.Xr pcap_open , +binds a file descriptor to a port. +.Bl -tag -width XX +.It Va ifname +is a port name, in the form "netmap:XXX" for a NIC and "valeXXX:YYY" for a +.Nm VALE +port. +.It Va req +provides the initial values for the argument to the NIOCREGIF ioctl. +The nm_flags and nm_ringid values are overwritten by parsing +ifname and flags, and other fields can be overridden through +the other two arguments. +.It Va arg +points to a struct nm_desc containing arguments (e.g. from a previously +open file descriptor) that should override the defaults. +The fields are used as described below +.It Va flags +can be set to a combination of the following flags: +.Va NETMAP_NO_TX_POLL , +.Va NETMAP_DO_RX_POLL +(copied into nr_ringid); +.Va NM_OPEN_NO_MMAP (if arg points to the same memory region, +avoids the mmap and uses the values from it); +.Va NM_OPEN_IFNAME (ignores ifname and uses the values in arg); +.Va NM_OPEN_ARG1 , +.Va NM_OPEN_ARG2 , +.Va NM_OPEN_ARG3 (uses the fields from arg); +.Va NM_OPEN_RING_CFG (uses the ring number and sizes from arg). +.El +.It Va int nm_close(struct nm_desc *d) +closes the file descriptor, unmaps memory, frees resources. +.It Va int nm_inject(struct nm_desc *d, const void *buf, size_t size) +similar to pcap_inject(), pushes a packet to a ring, returns the size +of the packet is successful, or 0 on error; +.It Va int nm_dispatch(struct nm_desc *d, int cnt, nm_cb_t cb, u_char *arg) +similar to pcap_dispatch(), applies a callback to incoming packets +.It Va u_char * nm_nextpkt(struct nm_desc *d, struct nm_pkthdr *hdr) +similar to pcap_next(), fetches the next packet +.Pp +.El +.Sh SUPPORTED DEVICES +.Nm +natively supports the following devices: +.Pp +On FreeBSD: +.Xr em 4 , +.Xr igb 4 , +.Xr ixgbe 4 , +.Xr lem 4 , +.Xr re 4 . +.Pp +On Linux +.Xr e1000 4 , +.Xr e1000e 4 , +.Xr igb 4 , +.Xr ixgbe 4 , +.Xr mlx4 4 , +.Xr forcedeth 4 , +.Xr r8169 4 . +.Pp +NICs without native support can still be used in +.Nm +mode through emulation. Performance is inferior to native netmap +mode but still significantly higher than sockets, and approaching +that of in-kernel solutions such as Linux's +.Xr pktgen . +.Pp +Emulation is also available for devices with native netmap support, +which can be used for testing or performance comparison. +The sysctl variable +.Va dev.netmap.admode +globally controls how netmap mode is implemented. +.Sh SYSCTL VARIABLES AND MODULE PARAMETERS +Some aspect of the operation of +.Nm +are controlled through sysctl variables on FreeBSD +.Em ( dev.netmap.* ) +and module parameters on Linux +.Em ( /sys/module/netmap_lin/parameters/* ) : +.Pp +.Bl -tag -width indent +.It Va dev.netmap.admode: 0 +Controls the use of native or emulated adapter mode. +0 uses the best available option, 1 forces native and +fails if not available, 2 forces emulated hence never fails. +.It Va dev.netmap.generic_ringsize: 1024 +Ring size used for emulated netmap mode +.It Va dev.netmap.generic_mit: 100000 +Controls interrupt moderation for emulated mode +.It Va dev.netmap.mmap_unreg: 0 +.It Va dev.netmap.fwd: 0 +Forces NS_FORWARD mode +.It Va dev.netmap.flags: 0 +.It Va dev.netmap.txsync_retry: 2 +.It Va dev.netmap.no_pendintr: 1 +Forces recovery of transmit buffers on system calls +.It Va dev.netmap.mitigate: 1 +Propagates interrupt mitigation to user processes +.It Va dev.netmap.no_timestamp: 0 +Disables the update of the timestamp in the netmap ring +.It Va dev.netmap.verbose: 0 +Verbose kernel messages +.It Va dev.netmap.buf_num: 163840 +.It Va dev.netmap.buf_size: 2048 +.It Va dev.netmap.ring_num: 200 +.It Va dev.netmap.ring_size: 36864 +.It Va dev.netmap.if_num: 100 +.It Va dev.netmap.if_size: 1024 +Sizes and number of objects (netmap_if, netmap_ring, buffers) +for the global memory region. The only parameter worth modifying is +.Va dev.netmap.buf_num +as it impacts the total amount of memory used by netmap. +.It Va dev.netmap.buf_curr_num: 0 +.It Va dev.netmap.buf_curr_size: 0 +.It Va dev.netmap.ring_curr_num: 0 +.It Va dev.netmap.ring_curr_size: 0 +.It Va dev.netmap.if_curr_num: 0 +.It Va dev.netmap.if_curr_size: 0 +Actual values in use. +.It Va dev.netmap.bridge_batch: 1024 +Batch size used when moving packets across a +.Nm VALE +switch. Values above 64 generally guarantee good +performance. +.El .Sh SYSTEM CALLS .Nm uses -.Nm select +.Xr select 2 , +.Xr poll 2 , +.Xr epoll and -.Nm poll -to wake up processes when significant events occur. +.Xr kqueue +to wake up processes when significant events occur, and +.Xr mmap 2 *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 05:46:19 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EA4D0878; Tue, 18 Feb 2014 05:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D24561DEE; Tue, 18 Feb 2014 05:46:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I5kJDl055516; Tue, 18 Feb 2014 05:46:19 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I5kJXv055512; Tue, 18 Feb 2014 05:46:19 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201402180546.s1I5kJXv055512@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 18 Feb 2014 05:46: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: r262152 - stable/10/sys/dev/netmap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 05:46:20 -0000 Author: luigi Date: Tue Feb 18 05:46:19 2014 New Revision: 262152 URL: http://svnweb.freebsd.org/changeset/base/262152 Log: missing files from previous commit... Added: stable/10/sys/dev/netmap/netmap_freebsd.c (contents, props changed) stable/10/sys/dev/netmap/netmap_generic.c (contents, props changed) stable/10/sys/dev/netmap/netmap_mbq.c (contents, props changed) stable/10/sys/dev/netmap/netmap_mbq.h (contents, props changed) stable/10/sys/dev/netmap/netmap_mem2.h (contents, props changed) stable/10/sys/dev/netmap/netmap_offloadings.c (contents, props changed) stable/10/sys/dev/netmap/netmap_pipe.c (contents, props changed) stable/10/sys/dev/netmap/netmap_vale.c (contents, props changed) Added: stable/10/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/netmap/netmap_freebsd.c Tue Feb 18 05:46:19 2014 (r262152) @@ -0,0 +1,655 @@ +/* + * Copyright (C) 2013-2014 Universita` di Pisa. 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$ */ + +#include +#include +#include +#include /* defines used in kernel.h */ +#include /* POLLIN, POLLOUT */ +#include /* types used in module initialization */ +#include /* DEV_MODULE */ +#include + +#include + +#include /* vtophys */ +#include /* vtophys */ +#include +#include +#include +#include +#include + + +#include +#include /* sockaddrs */ +#include +#include +#include +#include /* bus_dmamap_* */ +#include /* in6_cksum_pseudo() */ +#include /* in_pseudo(), in_cksum_hdr() */ + +#include +#include +#include + + +/* ======================== FREEBSD-SPECIFIC ROUTINES ================== */ + +rawsum_t nm_csum_raw(uint8_t *data, size_t len, rawsum_t cur_sum) +{ + /* TODO XXX please use the FreeBSD implementation for this. */ + uint16_t *words = (uint16_t *)data; + int nw = len / 2; + int i; + + for (i = 0; i < nw; i++) + cur_sum += be16toh(words[i]); + + if (len & 1) + cur_sum += (data[len-1] << 8); + + return cur_sum; +} + +/* Fold a raw checksum: 'cur_sum' is in host byte order, while the + * return value is in network byte order. + */ +uint16_t nm_csum_fold(rawsum_t cur_sum) +{ + /* TODO XXX please use the FreeBSD implementation for this. */ + while (cur_sum >> 16) + cur_sum = (cur_sum & 0xFFFF) + (cur_sum >> 16); + + return htobe16((~cur_sum) & 0xFFFF); +} + +uint16_t nm_csum_ipv4(struct nm_iphdr *iph) +{ +#if 0 + return in_cksum_hdr((void *)iph); +#else + return nm_csum_fold(nm_csum_raw((uint8_t*)iph, sizeof(struct nm_iphdr), 0)); +#endif +} + +void nm_csum_tcpudp_ipv4(struct nm_iphdr *iph, void *data, + size_t datalen, uint16_t *check) +{ + uint16_t pseudolen = datalen + iph->protocol; + + /* Compute and insert the pseudo-header cheksum. */ + *check = in_pseudo(iph->saddr, iph->daddr, + htobe16(pseudolen)); + /* Compute the checksum on TCP/UDP header + payload + * (includes the pseudo-header). + */ + *check = nm_csum_fold(nm_csum_raw(data, datalen, 0)); +} + +void nm_csum_tcpudp_ipv6(struct nm_ipv6hdr *ip6h, void *data, + size_t datalen, uint16_t *check) +{ +#ifdef INET6 + *check = in6_cksum_pseudo((void*)ip6h, datalen, ip6h->nexthdr, 0); + *check = nm_csum_fold(nm_csum_raw(data, datalen, 0)); +#else + static int notsupported = 0; + if (!notsupported) { + notsupported = 1; + D("inet6 segmentation not supported"); + } +#endif +} + + +/* + * Intercept the rx routine in the standard device driver. + * Second argument is non-zero to intercept, 0 to restore + */ +int +netmap_catch_rx(struct netmap_adapter *na, int intercept) +{ + struct netmap_generic_adapter *gna = (struct netmap_generic_adapter *)na; + struct ifnet *ifp = na->ifp; + + if (intercept) { + if (gna->save_if_input) { + D("cannot intercept again"); + return EINVAL; /* already set */ + } + gna->save_if_input = ifp->if_input; + ifp->if_input = generic_rx_handler; + } else { + if (!gna->save_if_input){ + D("cannot restore"); + return EINVAL; /* not saved */ + } + ifp->if_input = gna->save_if_input; + gna->save_if_input = NULL; + } + + return 0; +} + + +/* + * Intercept the packet steering routine in the tx path, + * so that we can decide which queue is used for an mbuf. + * Second argument is non-zero to intercept, 0 to restore. + * On freebsd we just intercept if_transmit. + */ +void +netmap_catch_tx(struct netmap_generic_adapter *gna, int enable) +{ + struct netmap_adapter *na = &gna->up.up; + struct ifnet *ifp = na->ifp; + + if (enable) { + na->if_transmit = ifp->if_transmit; + ifp->if_transmit = netmap_transmit; + } else { + ifp->if_transmit = na->if_transmit; + } +} + + +/* + * Transmit routine used by generic_netmap_txsync(). Returns 0 on success + * and non-zero on error (which may be packet drops or other errors). + * addr and len identify the netmap buffer, m is the (preallocated) + * mbuf to use for transmissions. + * + * We should add a reference to the mbuf so the m_freem() at the end + * 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) + * i = m->m_pkthdr.flowid % adapter->num_queues; + * else + * i = curcpu % adapter->num_queues; + * + */ +int +generic_xmit_frame(struct ifnet *ifp, struct mbuf *m, + void *addr, u_int len, u_int ring_nr) +{ + int ret; + + m->m_len = m->m_pkthdr.len = 0; + + // copy data to the mbuf + m_copyback(m, 0, len, addr); + // inc refcount. We are alone, so we can skip the atomic + atomic_fetchadd_int(m->m_ext.ref_cnt, 1); + m->m_flags |= M_FLOWID; + m->m_pkthdr.flowid = ring_nr; + m->m_pkthdr.rcvif = ifp; /* used for tx notification */ + ret = NA(ifp)->if_transmit(ifp, m); + return ret; +} + + +/* + * The following two functions are empty until we have a generic + * way to extract the info from the ifp + */ +int +generic_find_num_desc(struct ifnet *ifp, unsigned int *tx, unsigned int *rx) +{ + D("called"); + return 0; +} + + +void +generic_find_num_queues(struct ifnet *ifp, u_int *txq, u_int *rxq) +{ + D("called"); + *txq = netmap_generic_rings; + *rxq = netmap_generic_rings; +} + + +void netmap_mitigation_init(struct nm_generic_mit *mit, struct netmap_adapter *na) +{ + ND("called"); + mit->mit_pending = 0; + mit->mit_na = na; +} + + +void netmap_mitigation_start(struct nm_generic_mit *mit) +{ + ND("called"); +} + + +void netmap_mitigation_restart(struct nm_generic_mit *mit) +{ + ND("called"); +} + + +int netmap_mitigation_active(struct nm_generic_mit *mit) +{ + ND("called"); + return 0; +} + + +void netmap_mitigation_cleanup(struct nm_generic_mit *mit) +{ + ND("called"); +} + + +/* + * In order to track whether pages are still mapped, we hook into + * the standard cdev_pager and intercept the constructor and + * destructor. + */ + +struct netmap_vm_handle_t { + struct cdev *dev; + struct netmap_priv_d *priv; +}; + + +static int +netmap_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred, u_short *color) +{ + struct netmap_vm_handle_t *vmh = handle; + + if (netmap_verbose) + D("handle %p size %jd prot %d foff %jd", + handle, (intmax_t)size, prot, (intmax_t)foff); + dev_ref(vmh->dev); + return 0; +} + + +static void +netmap_dev_pager_dtor(void *handle) +{ + struct netmap_vm_handle_t *vmh = handle; + struct cdev *dev = vmh->dev; + struct netmap_priv_d *priv = vmh->priv; + + if (netmap_verbose) + D("handle %p", handle); + netmap_dtor(priv); + free(vmh, M_DEVBUF); + dev_rel(dev); +} + + +static int +netmap_dev_pager_fault(vm_object_t object, vm_ooffset_t offset, + int prot, vm_page_t *mres) +{ + struct netmap_vm_handle_t *vmh = object->handle; + struct netmap_priv_d *priv = vmh->priv; + vm_paddr_t paddr; + vm_page_t page; + vm_memattr_t memattr; + vm_pindex_t pidx; + + ND("object %p offset %jd prot %d mres %p", + object, (intmax_t)offset, prot, mres); + memattr = object->memattr; + pidx = OFF_TO_IDX(offset); + paddr = netmap_mem_ofstophys(priv->np_mref, offset); + if (paddr == 0) + return VM_PAGER_FAIL; + + if (((*mres)->flags & PG_FICTITIOUS) != 0) { + /* + * If the passed in result page is a fake page, update it with + * the new physical address. + */ + page = *mres; + vm_page_updatefake(page, paddr, memattr); + } else { + /* + * Replace the passed in reqpage page with our own fake page and + * free up the all of the original pages. + */ +#ifndef VM_OBJECT_WUNLOCK /* FreeBSD < 10.x */ +#define VM_OBJECT_WUNLOCK VM_OBJECT_UNLOCK +#define VM_OBJECT_WLOCK VM_OBJECT_LOCK +#endif /* VM_OBJECT_WUNLOCK */ + + VM_OBJECT_WUNLOCK(object); + page = vm_page_getfake(paddr, memattr); + VM_OBJECT_WLOCK(object); + vm_page_lock(*mres); + vm_page_free(*mres); + vm_page_unlock(*mres); + *mres = page; + vm_page_insert(page, object, pidx); + } + page->valid = VM_PAGE_BITS_ALL; + return (VM_PAGER_OK); +} + + +static struct cdev_pager_ops netmap_cdev_pager_ops = { + .cdev_pg_ctor = netmap_dev_pager_ctor, + .cdev_pg_dtor = netmap_dev_pager_dtor, + .cdev_pg_fault = netmap_dev_pager_fault, +}; + + +static int +netmap_mmap_single(struct cdev *cdev, vm_ooffset_t *foff, + vm_size_t objsize, vm_object_t *objp, int prot) +{ + int error; + struct netmap_vm_handle_t *vmh; + struct netmap_priv_d *priv; + vm_object_t obj; + + if (netmap_verbose) + D("cdev %p foff %jd size %jd objp %p prot %d", cdev, + (intmax_t )*foff, (intmax_t )objsize, objp, prot); + + vmh = malloc(sizeof(struct netmap_vm_handle_t), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (vmh == NULL) + return ENOMEM; + vmh->dev = cdev; + + NMG_LOCK(); + error = devfs_get_cdevpriv((void**)&priv); + if (error) + goto err_unlock; + vmh->priv = priv; + priv->np_refcount++; + NMG_UNLOCK(); + + error = netmap_get_memory(priv); + if (error) + goto err_deref; + + obj = cdev_pager_allocate(vmh, OBJT_DEVICE, + &netmap_cdev_pager_ops, objsize, prot, + *foff, NULL); + if (obj == NULL) { + D("cdev_pager_allocate failed"); + error = EINVAL; + goto err_deref; + } + + *objp = obj; + return 0; + +err_deref: + NMG_LOCK(); + priv->np_refcount--; +err_unlock: + NMG_UNLOCK(); +// err: + free(vmh, M_DEVBUF); + return error; +} + + +// XXX can we remove this ? +static int +netmap_close(struct cdev *dev, int fflag, int devtype, struct thread *td) +{ + if (netmap_verbose) + D("dev %p fflag 0x%x devtype %d td %p", + dev, fflag, devtype, td); + return 0; +} + + +static int +netmap_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +{ + struct netmap_priv_d *priv; + int error; + + (void)dev; + (void)oflags; + (void)devtype; + (void)td; + + // XXX wait or nowait ? + priv = malloc(sizeof(struct netmap_priv_d), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (priv == NULL) + return ENOMEM; + + error = devfs_set_cdevpriv(priv, netmap_dtor); + if (error) + return error; + + priv->np_refcount = 1; + + return 0; +} + +/******************** kqueue support ****************/ + +/* + * The OS_selwakeup also needs to issue a KNOTE_UNLOCKED. + * We use a non-zero argument to distinguish the call from the one + * in kevent_scan() which instead also needs to run netmap_poll(). + * The knote uses a global mutex for the time being. We might + * try to reuse the one in the si, but it is not allocated + * permanently so it might be a bit tricky. + * + * The *kqfilter function registers one or another f_event + * depending on read or write mode. + * In the call to f_event() td_fpop is NULL so any child function + * calling devfs_get_cdevpriv() would fail - and we need it in + * netmap_poll(). As a workaround we store priv into kn->kn_hook + * and pass it as first argument to netmap_poll(), which then + * uses the failure to tell that we are called from f_event() + * and do not need the selrecord(). + */ + +void freebsd_selwakeup(struct selinfo *si, int pri); + +void +freebsd_selwakeup(struct selinfo *si, int pri) +{ + if (netmap_verbose) + D("on knote %p", &si->si_note); + selwakeuppri(si, pri); + /* use a non-zero hint to tell the notification from the + * call done in kqueue_scan() which uses 0 + */ + KNOTE_UNLOCKED(&si->si_note, 0x100 /* notification */); +} + +static void +netmap_knrdetach(struct knote *kn) +{ + struct netmap_priv_d *priv = (struct netmap_priv_d *)kn->kn_hook; + struct selinfo *si = priv->np_rxsi; + + D("remove selinfo %p", si); + knlist_remove(&si->si_note, kn, 0); +} + +static void +netmap_knwdetach(struct knote *kn) +{ + struct netmap_priv_d *priv = (struct netmap_priv_d *)kn->kn_hook; + struct selinfo *si = priv->np_txsi; + + D("remove selinfo %p", si); + knlist_remove(&si->si_note, kn, 0); +} + +/* + * callback from notifies (generated externally) and our + * calls to kevent(). The former we just return 1 (ready) + * since we do not know better. + * In the latter we call netmap_poll and return 0/1 accordingly. + */ +static int +netmap_knrw(struct knote *kn, long hint, int events) +{ + struct netmap_priv_d *priv; + int revents; + + if (hint != 0) { + ND(5, "call from notify"); + return 1; /* assume we are ready */ + } + priv = kn->kn_hook; + /* the notification may come from an external thread, + * in which case we do not want to run the netmap_poll + * This should be filtered above, but check just in case. + */ + if (curthread != priv->np_td) { /* should not happen */ + RD(5, "curthread changed %p %p", curthread, priv->np_td); + return 1; + } else { + revents = netmap_poll((void *)priv, events, curthread); + return (events & revents) ? 1 : 0; + } +} + +static int +netmap_knread(struct knote *kn, long hint) +{ + return netmap_knrw(kn, hint, POLLIN); +} + +static int +netmap_knwrite(struct knote *kn, long hint) +{ + return netmap_knrw(kn, hint, POLLOUT); +} + +static struct filterops netmap_rfiltops = { + .f_isfd = 1, + .f_detach = netmap_knrdetach, + .f_event = netmap_knread, +}; + +static struct filterops netmap_wfiltops = { + .f_isfd = 1, + .f_detach = netmap_knwdetach, + .f_event = netmap_knwrite, +}; + + +/* + * This is called when a thread invokes kevent() to record + * a change in the configuration of the kqueue(). + * The 'priv' should be the same as in the netmap device. + */ +static int +netmap_kqfilter(struct cdev *dev, struct knote *kn) +{ + struct netmap_priv_d *priv; + int error; + struct netmap_adapter *na; + struct selinfo *si; + int ev = kn->kn_filter; + + if (ev != EVFILT_READ && ev != EVFILT_WRITE) { + D("bad filter request %d", ev); + return 1; + } + error = devfs_get_cdevpriv((void**)&priv); + if (error) { + D("device not yet setup"); + return 1; + } + na = priv->np_na; + if (na == NULL) { + D("no netmap adapter for this file descriptor"); + return 1; + } + /* the si is indicated in the priv */ + si = (ev == EVFILT_WRITE) ? priv->np_txsi : priv->np_rxsi; + // XXX lock(priv) ? + kn->kn_fop = (ev == EVFILT_WRITE) ? + &netmap_wfiltops : &netmap_rfiltops; + kn->kn_hook = priv; + knlist_add(&si->si_note, kn, 1); + // XXX unlock(priv) + ND("register %p %s td %p priv %p kn %p np_nifp %p kn_fp/fpop %s", + na, na->ifp->if_xname, curthread, priv, kn, + priv->np_nifp, + kn->kn_fp == curthread->td_fpop ? "match" : "MISMATCH"); + return 0; +} + +struct cdevsw netmap_cdevsw = { + .d_version = D_VERSION, + .d_name = "netmap", + .d_open = netmap_open, + .d_mmap_single = netmap_mmap_single, + .d_ioctl = netmap_ioctl, + .d_poll = netmap_poll, + .d_kqfilter = netmap_kqfilter, + .d_close = netmap_close, +}; +/*--- end of kqueue support ----*/ + +/* + * Kernel entry point. + * + * Initialize/finalize the module and return. + * + * Return 0 on success, errno on failure. + */ +static int +netmap_loader(__unused struct module *module, int event, __unused void *arg) +{ + int error = 0; + + switch (event) { + case MOD_LOAD: + error = netmap_init(); + break; + + case MOD_UNLOAD: + netmap_fini(); + break; + + default: + error = EOPNOTSUPP; + break; + } + + return (error); +} + + +DEV_MODULE(netmap, netmap_loader, NULL); Added: stable/10/sys/dev/netmap/netmap_generic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/netmap/netmap_generic.c Tue Feb 18 05:46:19 2014 (r262152) @@ -0,0 +1,806 @@ +/* + * Copyright (C) 2013-2014 Universita` di Pisa. 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. + */ + +/* + * This module implements netmap support on top of standard, + * unmodified device drivers. + * + * A NIOCREGIF request is handled here if the device does not + * have native support. TX and RX rings are emulated as follows: + * + * NIOCREGIF + * We preallocate a block of TX mbufs (roughly as many as + * tx descriptors; the number is not critical) to speed up + * operation during transmissions. The refcount on most of + * these buffers is artificially bumped up so we can recycle + * them more easily. Also, the destructor is intercepted + * so we use it as an interrupt notification to wake up + * processes blocked on a poll(). + * + * For each receive ring we allocate one "struct mbq" + * (an mbuf tailq plus a spinlock). We intercept packets + * (through if_input) + * on the receive path and put them in the mbq from which + * netmap receive routines can grab them. + * + * TX: + * in the generic_txsync() routine, netmap buffers are copied + * (or linked, in a future) to the preallocated mbufs + * and pushed to the transmit queue. Some of these mbufs + * (those with NS_REPORT, or otherwise every half ring) + * have the refcount=1, others have refcount=2. + * When the destructor is invoked, we take that as + * a notification that all mbufs up to that one in + * the specific ring have been completed, and generate + * the equivalent of a transmit interrupt. + * + * RX: + * + */ + +#ifdef __FreeBSD__ + +#include /* prerequisite */ +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include /* PROT_EXEC */ +#include +#include /* sockaddrs */ +#include +#include +#include +#include /* bus_dmamap_* in netmap_kern.h */ + +// XXX temporary - D() defined here +#include +#include +#include + +#define rtnl_lock() D("rtnl_lock called"); +#define rtnl_unlock() D("rtnl_unlock called"); +#define MBUF_TXQ(m) ((m)->m_pkthdr.flowid) +#define MBUF_RXQ(m) ((m)->m_pkthdr.flowid) +#define smp_mb() + +/* + * mbuf wrappers + */ + +/* + * we allocate an EXT_PACKET + */ +#define netmap_get_mbuf(len) m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR|M_NOFREE) + +/* mbuf destructor, also need to change the type to EXT_EXTREF, + * add an M_NOFREE flag, and then clear the flag and + * chain into uma_zfree(zone_pack, mf) + * (or reinstall the buffer ?) + */ +#define SET_MBUF_DESTRUCTOR(m, fn) do { \ + (m)->m_ext.ext_free = (void *)fn; \ + (m)->m_ext.ext_type = EXT_EXTREF; \ +} while (0) + + +#define GET_MBUF_REFCNT(m) ((m)->m_ext.ref_cnt ? *(m)->m_ext.ref_cnt : -1) + + + +#else /* linux */ + +#include "bsd_glue.h" + +#include /* rtnl_[un]lock() */ +#include /* struct ethtool_ops, get_ringparam */ +#include + +//#define RATE /* Enables communication statistics. */ + +//#define REG_RESET + +#endif /* linux */ + + +/* Common headers. */ +#include +#include +#include + + + +/* ======================== usage stats =========================== */ + +#ifdef RATE +#define IFRATE(x) x +struct rate_stats { + unsigned long txpkt; + unsigned long txsync; + unsigned long txirq; + unsigned long rxpkt; + unsigned long rxirq; + unsigned long rxsync; +}; + +struct rate_context { + unsigned refcount; + struct timer_list timer; + struct rate_stats new; + struct rate_stats old; +}; + +#define RATE_PRINTK(_NAME_) \ + printk( #_NAME_ " = %lu Hz\n", (cur._NAME_ - ctx->old._NAME_)/RATE_PERIOD); +#define RATE_PERIOD 2 +static void rate_callback(unsigned long arg) +{ + struct rate_context * ctx = (struct rate_context *)arg; + struct rate_stats cur = ctx->new; + int r; + + RATE_PRINTK(txpkt); + RATE_PRINTK(txsync); + RATE_PRINTK(txirq); + RATE_PRINTK(rxpkt); + RATE_PRINTK(rxsync); + RATE_PRINTK(rxirq); + printk("\n"); + + ctx->old = cur; + r = mod_timer(&ctx->timer, jiffies + + msecs_to_jiffies(RATE_PERIOD * 1000)); + if (unlikely(r)) + D("[v1000] Error: mod_timer()"); +} + +static struct rate_context rate_ctx; + +#else /* !RATE */ +#define IFRATE(x) +#endif /* !RATE */ + + +/* =============== GENERIC NETMAP ADAPTER SUPPORT ================= */ +#define GENERIC_BUF_SIZE netmap_buf_size /* Size of the mbufs in the Tx pool. */ + +/* + * Wrapper used by the generic adapter layer to notify + * the poller threads. Differently from netmap_rx_irq(), we check + * only IFCAP_NETMAP instead of NAF_NATIVE_ON to enable the irq. + */ +static void +netmap_generic_irq(struct ifnet *ifp, u_int q, u_int *work_done) +{ + if (unlikely(!(ifp->if_capenable & IFCAP_NETMAP))) + return; + + netmap_common_irq(ifp, q, work_done); +} + + +/* Enable/disable netmap mode for a generic network interface. */ +static int +generic_netmap_register(struct netmap_adapter *na, int enable) +{ + struct ifnet *ifp = na->ifp; + struct netmap_generic_adapter *gna = (struct netmap_generic_adapter *)na; + struct mbuf *m; + int error; + int i, r; + + if (!na) + return EINVAL; + +#ifdef REG_RESET + error = ifp->netdev_ops->ndo_stop(ifp); + if (error) { + return error; + } +#endif /* REG_RESET */ + + if (enable) { /* Enable netmap mode. */ + /* Init the mitigation support. */ + gna->mit = malloc(na->num_rx_rings * sizeof(struct nm_generic_mit), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (!gna->mit) { + D("mitigation allocation failed"); + error = ENOMEM; + goto out; + } + for (r=0; rnum_rx_rings; r++) + netmap_mitigation_init(&gna->mit[r], na); + + /* Initialize the rx queue, as generic_rx_handler() can + * be called as soon as netmap_catch_rx() returns. + */ + for (r=0; rnum_rx_rings; r++) { + mbq_safe_init(&na->rx_rings[r].rx_queue); + } + + /* + * Preallocate packet buffers for the tx rings. + */ + for (r=0; rnum_tx_rings; r++) + na->tx_rings[r].tx_pool = NULL; + for (r=0; rnum_tx_rings; r++) { + na->tx_rings[r].tx_pool = malloc(na->num_tx_desc * sizeof(struct mbuf *), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (!na->tx_rings[r].tx_pool) { + D("tx_pool allocation failed"); + error = ENOMEM; + goto free_tx_pools; + } + for (i=0; inum_tx_desc; i++) + na->tx_rings[r].tx_pool[i] = NULL; + for (i=0; inum_tx_desc; i++) { + m = netmap_get_mbuf(GENERIC_BUF_SIZE); + if (!m) { + D("tx_pool[%d] allocation failed", i); + error = ENOMEM; + goto free_tx_pools; + } + na->tx_rings[r].tx_pool[i] = m; + } + } + rtnl_lock(); + /* Prepare to intercept incoming traffic. */ + error = netmap_catch_rx(na, 1); + if (error) { + D("netdev_rx_handler_register() failed (%d)", error); + goto register_handler; + } + ifp->if_capenable |= IFCAP_NETMAP; + + /* Make netmap control the packet steering. */ + netmap_catch_tx(gna, 1); + + rtnl_unlock(); + +#ifdef RATE + if (rate_ctx.refcount == 0) { + D("setup_timer()"); + memset(&rate_ctx, 0, sizeof(rate_ctx)); + setup_timer(&rate_ctx.timer, &rate_callback, (unsigned long)&rate_ctx); + if (mod_timer(&rate_ctx.timer, jiffies + msecs_to_jiffies(1500))) { + D("Error: mod_timer()"); + } + } + rate_ctx.refcount++; +#endif /* RATE */ + + } else if (na->tx_rings[0].tx_pool) { + /* Disable netmap mode. We enter here only if the previous + generic_netmap_register(na, 1) was successfull. + If it was not, na->tx_rings[0].tx_pool was set to NULL by the + error handling code below. */ + rtnl_lock(); + + ifp->if_capenable &= ~IFCAP_NETMAP; + + /* Release packet steering control. */ + netmap_catch_tx(gna, 0); + + /* Do not intercept packets on the rx path. */ + netmap_catch_rx(na, 0); + + rtnl_unlock(); + + /* Free the mbufs going to the netmap rings */ + for (r=0; rnum_rx_rings; r++) { + mbq_safe_purge(&na->rx_rings[r].rx_queue); + mbq_safe_destroy(&na->rx_rings[r].rx_queue); + } + + for (r=0; rnum_rx_rings; r++) + netmap_mitigation_cleanup(&gna->mit[r]); + free(gna->mit, M_DEVBUF); + + for (r=0; rnum_tx_rings; r++) { + for (i=0; inum_tx_desc; i++) { + m_freem(na->tx_rings[r].tx_pool[i]); + } + free(na->tx_rings[r].tx_pool, M_DEVBUF); + } + +#ifdef RATE + if (--rate_ctx.refcount == 0) { + D("del_timer()"); + del_timer(&rate_ctx.timer); + } +#endif + } + +#ifdef REG_RESET + error = ifp->netdev_ops->ndo_open(ifp); + if (error) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 05:58:36 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DEF1DB06; Tue, 18 Feb 2014 05:58: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C54DC1FA6; Tue, 18 Feb 2014 05:58:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1I5waso060273; Tue, 18 Feb 2014 05:58:36 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1I5wa0f060271; Tue, 18 Feb 2014 05:58:36 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201402180558.s1I5wa0f060271@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 18 Feb 2014 05:58:36 +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: r262153 - in stable/9: share/man/man4 sys/conf sys/dev/e1000 sys/dev/ixgbe sys/dev/netmap sys/modules/netmap sys/net tools/tools/netmap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 05:58:37 -0000 Author: luigi Date: Tue Feb 18 05:58:36 2014 New Revision: 262153 URL: http://svnweb.freebsd.org/changeset/base/262153 Log: MFH: sync the netmap code with the one in HEAD (enhanced VALE switch, netmap pipes, emulated netmap mode). See details in the log for svn 261909. Added: stable/9/sys/dev/netmap/netmap_freebsd.c (contents, props changed) stable/9/sys/dev/netmap/netmap_generic.c (contents, props changed) stable/9/sys/dev/netmap/netmap_mbq.c (contents, props changed) stable/9/sys/dev/netmap/netmap_mbq.h (contents, props changed) stable/9/sys/dev/netmap/netmap_offloadings.c (contents, props changed) stable/9/sys/dev/netmap/netmap_pipe.c (contents, props changed) stable/9/sys/dev/netmap/netmap_vale.c (contents, props changed) stable/9/sys/modules/netmap/Makefile (contents, props changed) Replaced: stable/9/sys/dev/netmap/netmap_mem2.h (contents, props changed) stable/9/sys/modules/netmap/ Deleted: stable/9/tools/tools/netmap/click-test.cfg stable/9/tools/tools/netmap/nm_util.c stable/9/tools/tools/netmap/nm_util.h stable/9/tools/tools/netmap/pcap.c Modified: stable/9/share/man/man4/netmap.4 stable/9/sys/conf/files stable/9/sys/dev/e1000/if_em.c stable/9/sys/dev/e1000/if_igb.c stable/9/sys/dev/e1000/if_lem.c stable/9/sys/dev/ixgbe/ixgbe.c stable/9/sys/dev/netmap/if_em_netmap.h stable/9/sys/dev/netmap/if_igb_netmap.h stable/9/sys/dev/netmap/if_lem_netmap.h stable/9/sys/dev/netmap/if_re_netmap.h stable/9/sys/dev/netmap/ixgbe_netmap.h stable/9/sys/dev/netmap/netmap.c stable/9/sys/dev/netmap/netmap_kern.h stable/9/sys/dev/netmap/netmap_mem2.c stable/9/sys/net/netmap.h stable/9/sys/net/netmap_user.h stable/9/tools/tools/netmap/Makefile stable/9/tools/tools/netmap/README stable/9/tools/tools/netmap/bridge.c stable/9/tools/tools/netmap/pkt-gen.c stable/9/tools/tools/netmap/vale-ctl.c Modified: stable/9/share/man/man4/netmap.4 ============================================================================== --- stable/9/share/man/man4/netmap.4 Tue Feb 18 05:46:19 2014 (r262152) +++ stable/9/share/man/man4/netmap.4 Tue Feb 18 05:58:36 2014 (r262153) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Matteo Landi, Luigi Rizzo, Universita` di Pisa +.\" Copyright (c) 2011-2014 Matteo Landi, Luigi Rizzo, Universita` di Pisa .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -26,219 +26,631 @@ .\" distributed with 4.3BSD Unix. .\" .\" $FreeBSD$ -.\" $Id: netmap.4 9662 2011-11-16 13:18:06Z luigi $: stable/8/share/man/man4/bpf.4 181694 2008-08-13 17:45:06Z ed $ .\" -.Dd November 16, 2011 +.Dd February 13, 2014 .Dt NETMAP 4 .Os .Sh NAME .Nm netmap .Nd a framework for fast packet I/O +.br +.Nm VALE +.Nd a fast VirtuAl Local Ethernet using the netmap API +.br +.Nm netmap pipes +.Nd a shared memory packet transport channel .Sh SYNOPSIS .Cd device netmap .Sh DESCRIPTION .Nm -is a framework for fast and safe access to network devices -(reaching 14.88 Mpps at less than 1 GHz). +is a framework for extremely fast and efficient packet I/O +for both userspace and kernel clients. +It runs on FreeBSD and Linux, +and includes +.Nm VALE , +a very fast and modular in-kernel software switch/dataplane, +and +.Nm netmap pipes , +a shared memory packet transport channel. +All these are accessed interchangeably with the same API. +.Pp +.Nm , VALE +and +.Nm netmap pipes +are at least one order of magnitude faster than +standard OS mechanisms +(sockets, bpf, tun/tap interfaces, native switches, pipes), +reaching 14.88 million packets per second (Mpps) +with much less than one core on a 10 Gbit NIC, +about 20 Mpps per core for VALE ports, +and over 100 Mpps for netmap pipes. +.Pp +Userspace clients can dynamically switch NICs into +.Nm +mode and send and receive raw packets through +memory mapped buffers. +Similarly, +.Nm VALE +switch instances and ports, and +.Nm netmap pipes +can be created dynamically, +providing high speed packet I/O between processes, +virtual machines, NICs and the host stack. +.Pp .Nm -uses memory mapped buffers and metadata -(buffer indexes and lengths) to communicate with the kernel, -which is in charge of validating information through -.Pa ioctl() +suports both non-blocking I/O through +.Xr ioctls() , +synchronization and blocking I/O through a file descriptor +and standard OS mechanisms such as +.Xr select 2 , +.Xr poll 2 , +.Xr epoll 2 , +.Xr kqueue 2 . +.Nm VALE and -.Pa select()/poll() . +.Nm netmap pipes +are implemented by a single kernel module, which also emulates the +.Nm +API over standard drivers for devices without native +.Nm +support. +For best performance, +.Nm +requires explicit support in device drivers. +.Pp +In the rest of this (long) manual page we document +various aspects of the .Nm -can exploit the parallelism in multiqueue devices and -multicore systems. +and +.Nm VALE +architecture, features and usage. .Pp +.Sh ARCHITECTURE +.Nm +supports raw packet I/O through a +.Em port , +which can be connected to a physical interface +.Em ( NIC ) , +to the host stack, +or to a +.Nm VALE +switch). +Ports use preallocated circular queues of buffers +.Em ( rings ) +residing in an mmapped region. +There is one ring for each transmit/receive queue of a +NIC or virtual port. +An additional ring pair connects to the host stack. .Pp +After binding a file descriptor to a port, a .Nm -requires explicit support in device drivers. -For a list of supported devices, see the end of this manual page. -.Sh OPERATION +client can send or receive packets in batches through +the rings, and possibly implement zero-copy forwarding +between ports. +.Pp +All NICs operating in .Nm -clients must first open the -.Pa open("/dev/netmap") , -and then issue an -.Pa ioctl(...,NIOCREGIF,...) -to bind the file descriptor to a network device. -.Pp -When a device is put in -.Nm -mode, its data path is disconnected from the host stack. -The processes owning the file descriptor -can exchange packets with the device, or with the host stack, -through an mmapped memory region that contains pre-allocated -buffers and metadata. +mode use the same memory region, +accessible to all processes who own +.Nm /dev/netmap +file descriptors bound to NICs. +Independent +.Nm VALE +and +.Nm netmap pipe +ports +by default use separate memory regions, +but can be independently configured to share memory. +.Pp +.Sh ENTERING AND EXITING NETMAP MODE +The following section describes the system calls to create +and control +.Nm netmap +ports (including +.Nm VALE +and +.Nm netmap pipe +ports). +Simpler, higher level functions are described in section +.Xr LIBRARIES . +.Pp +Ports and rings are created and controlled through a file descriptor, +created by opening a special device +.Dl fd = open("/dev/netmap"); +and then bound to a specific port with an +.Dl ioctl(fd, NIOCREGIF, (struct nmreq *)arg); +.Pp +.Nm +has multiple modes of operation controlled by the +.Vt struct nmreq +argument. +.Va arg.nr_name +specifies the port name, as follows: +.Bl -tag -width XXXX +.It Dv OS network interface name (e.g. 'em0', 'eth1', ... ) +the data path of the NIC is disconnected from the host stack, +and the file descriptor is bound to the NIC (one or all queues), +or to the host stack; +.It Dv valeXXX:YYY (arbitrary XXX and YYY) +the file descriptor is bound to port YYY of a VALE switch called XXX, +both dynamically created if necessary. +The string cannot exceed IFNAMSIZ characters, and YYY cannot +be the name of any existing OS network interface. +.El +.Pp +On return, +.Va arg +indicates the size of the shared memory region, +and the number, size and location of all the +.Nm +data structures, which can be accessed by mmapping the memory +.Dl char *mem = mmap(0, arg.nr_memsize, fd); .Pp Non blocking I/O is done with special -.Pa ioctl()'s , -whereas the file descriptor can be passed to -.Pa select()/poll() -to be notified about incoming packet or available transmit buffers. -.Ss Data structures -All data structures for all devices in -.Nm -mode are in a memory -region shared by the kernel and all processes -who open -.Pa /dev/netmap -(NOTE: visibility may be restricted in future implementations). -All references between the shared data structure -are relative (offsets or indexes). Some macros help converting -them into actual pointers. +.Xr ioctl 2 +.Xr select 2 +and +.Xr poll 2 +on the file descriptor permit blocking I/O. +.Xr epoll 2 +and +.Xr kqueue 2 +are not supported on +.Nm +file descriptors. .Pp -The data structures in shared memory are the following: +While a NIC is in +.Nm +mode, the OS will still believe the interface is up and running. +OS-generated packets for that NIC end up into a +.Nm +ring, and another ring is used to send packets into the OS network stack. +A +.Xr close 2 +on the file descriptor removes the binding, +and returns the NIC to normal mode (reconnecting the data path +to the host stack), or destroys the virtual port. .Pp +.Sh DATA STRUCTURES +The data structures in the mmapped memory region are detailed in +.Xr sys/net/netmap.h , +which is the ultimate reference for the +.Nm +API. The main structures and fields are indicated below: .Bl -tag -width XXX .It Dv struct netmap_if (one per interface) -indicates the number of rings supported by an interface, their -sizes, and the offsets of the -.Pa netmap_rings -associated to the interface. -The offset of a -.Pa struct netmap_if -in the shared memory region is indicated by the -.Pa nr_offset -field in the structure returned by the -.Pa NIOCREGIF -(see below). .Bd -literal struct netmap_if { - char ni_name[IFNAMSIZ]; /* name of the interface. */ - const u_int ni_num_queues; /* number of hw ring pairs */ - const ssize_t ring_ofs[]; /* offset of tx and rx rings */ + ... + const uint32_t ni_flags; /* properties */ + ... + const uint32_t ni_tx_rings; /* NIC tx rings */ + const uint32_t ni_rx_rings; /* NIC rx rings */ + uint32_t ni_bufs_head; /* head of extra bufs list */ + ... }; .Ed +.Pp +Indicates the number of available rings +.Pa ( struct netmap_rings ) +and their position in the mmapped region. +The number of tx and rx rings +.Pa ( ni_tx_rings , ni_rx_rings ) +normally depends on the hardware. +NICs also have an extra tx/rx ring pair connected to the host stack. +.Em NIOCREGIF +can also request additional unbound buffers in the same memory space, +to be used as temporary storage for packets. +.Pa ni_bufs_head +contains the index of the first of these free rings, +which are connected in a list (the first uint32_t of each +buffer being the index of the next buffer in the list). +A 0 indicates the end of the list. +.Pp .It Dv struct netmap_ring (one per ring) -contains the index of the current read or write slot (cur), -the number of slots available for reception or transmission (avail), -and an array of -.Pa slots -describing the buffers. -There is one ring pair for each of the N hardware ring pairs -supported by the card (numbered 0..N-1), plus -one ring pair (numbered N) for packets from/to the host stack. .Bd -literal struct netmap_ring { - const ssize_t buf_ofs; - const uint32_t num_slots; /* number of slots in the ring. */ - uint32_t avail; /* number of usable slots */ - uint32_t cur; /* 'current' index for the user side */ - - const uint16_t nr_buf_size; - uint16_t flags; - struct netmap_slot slot[0]; /* array of slots. */ + ... + const uint32_t num_slots; /* slots in each ring */ + const uint32_t nr_buf_size; /* size of each buffer */ + ... + uint32_t head; /* (u) first buf owned by user */ + uint32_t cur; /* (u) wakeup position */ + const uint32_t tail; /* (k) first buf owned by kernel */ + ... + uint32_t flags; + struct timeval ts; /* (k) time of last rxsync() */ + ... + struct netmap_slot slot[0]; /* array of slots */ } .Ed -.It Dv struct netmap_slot (one per packet) -contains the metadata for a packet: a buffer index (buf_idx), -a buffer length (len), and some flags. +.Pp +Implements transmit and receive rings, with read/write +pointers, metadata and and an array of +.Pa slots +describing the buffers. +.Pp +.It Dv struct netmap_slot (one per buffer) .Bd -literal struct netmap_slot { - uint32_t buf_idx; /* buffer index */ - uint16_t len; /* packet length */ - uint16_t flags; /* buf changed, etc. */ -#define NS_BUF_CHANGED 0x0001 /* must resync, buffer changed */ -#define NS_REPORT 0x0002 /* tell hw to report results - * e.g. by generating an interrupt - */ + uint32_t buf_idx; /* buffer index */ + uint16_t len; /* packet length */ + uint16_t flags; /* buf changed, etc. */ + uint64_t ptr; /* address for indirect buffers */ }; .Ed +.Pp +Describes a packet buffer, which normally is identified by +an index and resides in the mmapped region. .It Dv packet buffers -are fixed size (approximately 2k) buffers allocated by the kernel -that contain packet data. Buffers addresses are computed through -macros. +Fixed size (normally 2 KB) packet buffers allocated by the kernel. .El .Pp -Some macros support the access to objects in the shared memory -region. In particular: +The offset of the +.Pa struct netmap_if +in the mmapped region is indicated by the +.Pa nr_offset +field in the structure returned by +.Pa NIOCREGIF . +From there, all other objects are reachable through +relative references (offsets or indexes). +Macros and functions in +help converting them into actual pointers: +.Pp +.Dl struct netmap_if *nifp = NETMAP_IF(mem, arg.nr_offset); +.Dl struct netmap_ring *txr = NETMAP_TXRING(nifp, ring_index); +.Dl struct netmap_ring *rxr = NETMAP_RXRING(nifp, ring_index); +.Pp +.Dl char *buf = NETMAP_BUF(ring, buffer_index); +.Sh RINGS, BUFFERS AND DATA I/O +.Va Rings +are circular queues of packets with three indexes/pointers +.Va ( head , cur , tail ) ; +one slot is always kept empty. +The ring size +.Va ( num_slots ) +should not be assumed to be a power of two. +.br +(NOTE: older versions of netmap used head/count format to indicate +the content of a ring). +.Pp +.Va head +is the first slot available to userspace; +.br +.Va cur +is the wakeup point: +select/poll will unblock when +.Va tail +passes +.Va cur ; +.br +.Va tail +is the first slot reserved to the kernel. +.Pp +Slot indexes MUST only move forward; +for convenience, the function +.Dl nm_ring_next(ring, index) +returns the next index modulo the ring size. +.Pp +.Va head +and +.Va cur +are only modified by the user program; +.Va tail +is only modified by the kernel. +The kernel only reads/writes the +.Vt struct netmap_ring +slots and buffers +during the execution of a netmap-related system call. +The only exception are slots (and buffers) in the range +.Va tail\ . . . head-1 , +that are explicitly assigned to the kernel. +.Pp +.Ss TRANSMIT RINGS +On transmit rings, after a +.Nm +system call, slots in the range +.Va head\ . . . tail-1 +are available for transmission. +User code should fill the slots sequentially +and advance +.Va head +and +.Va cur +past slots ready to transmit. +.Va cur +may be moved further ahead if the user code needs +more slots before further transmissions (see +.Sx SCATTER GATHER I/O ) . +.Pp +At the next NIOCTXSYNC/select()/poll(), +slots up to +.Va head-1 +are pushed to the port, and +.Va tail +may advance if further slots have become available. +Below is an example of the evolution of a TX ring: +.Pp .Bd -literal -struct netmap_if *nifp; -struct netmap_ring *txring = NETMAP_TXRING(nifp, i); -struct netmap_ring *rxring = NETMAP_RXRING(nifp, i); -int i = txring->slot[txring->cur].buf_idx; -char *buf = NETMAP_BUF(txring, i); + after the syscall, slots between cur and tail are (a)vailable + head=cur tail + | | + v v + TX [.....aaaaaaaaaaa.............] + + user creates new packets to (T)ransmit + head=cur tail + | | + v v + TX [.....TTTTTaaaaaa.............] + + NIOCTXSYNC/poll()/select() sends packets and reports new slots + head=cur tail + | | + v v + TX [..........aaaaaaaaaaa........] .Ed -.Ss IOCTLS .Pp +select() and poll() wlll block if there is no space in the ring, i.e. +.Dl ring->cur == ring->tail +and return when new slots have become available. +.Pp +High speed applications may want to amortize the cost of system calls +by preparing as many packets as possible before issuing them. +.Pp +A transmit ring with pending transmissions has +.Dl ring->head != ring->tail + 1 (modulo the ring size). +The function +.Va int nm_tx_pending(ring) +implements this test. +.Pp +.Ss RECEIVE RINGS +On receive rings, after a +.Nm +system call, the slots in the range +.Va head\& . . . tail-1 +contain received packets. +User code should process them and advance +.Va head +and +.Va cur +past slots it wants to return to the kernel. +.Va cur +may be moved further ahead if the user code wants to +wait for more packets +without returning all the previous slots to the kernel. +.Pp +At the next NIOCRXSYNC/select()/poll(), +slots up to +.Va head-1 +are returned to the kernel for further receives, and +.Va tail +may advance to report new incoming packets. +.br +Below is an example of the evolution of an RX ring: +.Bd -literal + after the syscall, there are some (h)eld and some (R)eceived slots + head cur tail + | | | + v v v + RX [..hhhhhhRRRRRRRR..........] + + user advances head and cur, releasing some slots and holding others + head cur tail + | | | + v v v + RX [..*****hhhRRRRRR...........] + + NICRXSYNC/poll()/select() recovers slots and reports new packets + head cur tail + | | | + v v v + RX [.......hhhRRRRRRRRRRRR....] +.Ed +.Pp +.Sh SLOTS AND PACKET BUFFERS +Normally, packets should be stored in the netmap-allocated buffers +assigned to slots when ports are bound to a file descriptor. +One packet is fully contained in a single buffer. +.Pp +The following flags affect slot and buffer processing: +.Bl -tag -width XXX +.It NS_BUF_CHANGED +it MUST be used when the buf_idx in the slot is changed. +This can be used to implement +zero-copy forwarding, see +.Sx ZERO-COPY FORWARDING . +.Pp +.It NS_REPORT +reports when this buffer has been transmitted. +Normally, +.Nm +notifies transmit completions in batches, hence signals +can be delayed indefinitely. This flag helps detecting +when packets have been send and a file descriptor can be closed. +.It NS_FORWARD +When a ring is in 'transparent' mode (see +.Sx TRANSPARENT MODE ) , +packets marked with this flags are forwarded to the other endpoint +at the next system call, thus restoring (in a selective way) +the connection between a NIC and the host stack. +.It NS_NO_LEARN +tells the forwarding code that the SRC MAC address for this +packet must not be used in the learning bridge code. +.It NS_INDIRECT +indicates that the packet's payload is in a user-supplied buffer, +whose user virtual address is in the 'ptr' field of the slot. +The size can reach 65535 bytes. +.br +This is only supported on the transmit ring of +.Nm VALE +ports, and it helps reducing data copies in the interconnection +of virtual machines. +.It NS_MOREFRAG +indicates that the packet continues with subsequent buffers; +the last buffer in a packet must have the flag clear. +.El +.Sh SCATTER GATHER I/O +Packets can span multiple slots if the +.Va NS_MOREFRAG +flag is set in all but the last slot. +The maximum length of a chain is 64 buffers. +This is normally used with +.Nm VALE +ports when connecting virtual machines, as they generate large +TSO segments that are not split unless they reach a physical device. +.Pp +NOTE: The length field always refers to the individual +fragment; there is no place with the total length of a packet. +.Pp +On receive rings the macro +.Va NS_RFRAGS(slot) +indicates the remaining number of slots for this packet, +including the current one. +Slots with a value greater than 1 also have NS_MOREFRAG set. +.Sh IOCTLS .Nm -supports some ioctl() to synchronize the state of the rings -between the kernel and the user processes, plus some -to query and configure the interface. -The former do not require any argument, whereas the latter -use a -.Pa struct netmap_req -defined as follows: +uses two ioctls (NIOCTXSYNC, NIOCRXSYNC) +for non-blocking I/O. They take no argument. +Two more ioctls (NIOCGINFO, NIOCREGIF) are used +to query and configure ports, with the following argument: .Bd -literal struct nmreq { - char nr_name[IFNAMSIZ]; - uint32_t nr_offset; /* nifp offset in the shared region */ - uint32_t nr_memsize; /* size of the shared region */ - uint32_t nr_numdescs; /* descriptors per queue */ - uint16_t nr_numqueues; - uint16_t nr_ringid; /* ring(s) we care about */ -#define NETMAP_HW_RING 0x4000 /* low bits indicate one hw ring */ -#define NETMAP_SW_RING 0x2000 /* we process the sw ring */ -#define NETMAP_NO_TX_POLL 0x1000 /* no gratuitous txsync on poll */ -#define NETMAP_RING_MASK 0xfff /* the actual ring number */ + char nr_name[IFNAMSIZ]; /* (i) port name */ + uint32_t nr_version; /* (i) API version */ + uint32_t nr_offset; /* (o) nifp offset in mmap region */ + uint32_t nr_memsize; /* (o) size of the mmap region */ + uint32_t nr_tx_slots; /* (i/o) slots in tx rings */ + uint32_t nr_rx_slots; /* (i/o) slots in rx rings */ + uint16_t nr_tx_rings; /* (i/o) number of tx rings */ + uint16_t nr_rx_rings; /* (i/o) number of tx rings */ + uint16_t nr_ringid; /* (i/o) ring(s) we care about */ + uint16_t nr_cmd; /* (i) special command */ + uint16_t nr_arg1; /* (i/o) extra arguments */ + uint16_t nr_arg2; /* (i/o) extra arguments */ + uint32_t nr_arg3; /* (i/o) extra arguments */ + uint32_t nr_flags /* (i/o) open mode */ + ... }; - .Ed -A device descriptor obtained through +.Pp +A file descriptor obtained through .Pa /dev/netmap -also supports the ioctl supported by network devices. +also supports the ioctl supported by network devices, see +.Xr netintro 4 . .Pp -The netmap-specific -.Xr ioctl 2 -command codes below are defined in -.In net/netmap.h -and are: .Bl -tag -width XXXX .It Dv NIOCGINFO -returns information about the interface named in nr_name. -On return, nr_memsize indicates the size of the shared netmap -memory region (this is device-independent), -nr_numslots indicates how many buffers are in a ring, -nr_numrings indicates the number of rings supported by the hardware. +returns EINVAL if the named port does not support netmap. +Otherwise, it returns 0 and (advisory) information +about the port. +Note that all the information below can change before the +interface is actually put in netmap mode. .Pp -If the device does not support netmap, the ioctl returns EINVAL. +.Bl -tag -width XX +.It Pa nr_memsize +indicates the size of the +.Nm +memory region. NICs in +.Nm +mode all share the same memory region, +whereas +.Nm VALE +ports have independent regions for each port. +.It Pa nr_tx_slots , nr_rx_slots +indicate the size of transmit and receive rings. +.It Pa nr_tx_rings , nr_rx_rings +indicate the number of transmit +and receive rings. +Both ring number and sizes may be configured at runtime +using interface-specific functions (e.g. +.Xr ethtool +). +.El .It Dv NIOCREGIF -puts the interface named in nr_name into netmap mode, disconnecting -it from the host stack, and/or defines which rings are controlled -through this file descriptor. -On return, it gives the same info as NIOCGINFO, and nr_ringid -indicates the identity of the rings controlled through the file +binds the port named in +.Va nr_name +to the file descriptor. For a physical device this also switches it into +.Nm +mode, disconnecting +it from the host stack. +Multiple file descriptors can be bound to the same port, +with proper synchronization left to the user. +.Pp +.Dv NIOCREGIF can also bind a file descriptor to one endpoint of a +.Em netmap pipe , +consisting of two netmap ports with a crossover connection. +A netmap pipe share the same memory space of the parent port, +and is meant to enable configuration where a master process acts +as a dispatcher towards slave processes. +.Pp +To enable this function, the +.Pa nr_arg1 +field of the structure can be used as a hint to the kernel to +indicate how many pipes we expect to use, and reserve extra space +in the memory region. +.Pp +On return, it gives the same info as NIOCGINFO, +with +.Pa nr_ringid +and +.Pa nr_flags +indicating the identity of the rings controlled through the file descriptor. .Pp -Possible values for nr_ringid are +.Va nr_flags +.Va nr_ringid +selects which rings are controlled through this file descriptor. +Possible values of +.Pa nr_flags +are indicated below, together with the naming schemes +that application libraries (such as the +.Nm nm_open +indicated below) can use to indicate the specific set of rings. +In the example below, "netmap:foo" is any valid netmap port name. +.Pp .Bl -tag -width XXXXX -.It 0 -default, all hardware rings -.It NETMAP_SW_RING -the ``host rings'' connecting to the host stack -.It NETMAP_HW_RING + i -the i-th hardware ring +.It NR_REG_ALL_NIC "netmap:foo" +(default) all hardware ring pairs +.It NR_REG_SW_NIC "netmap:foo^" +the ``host rings'', connecting to the host stack. +.It NR_RING_NIC_SW "netmap:foo+ +all hardware rings and the host rings +.It NR_REG_ONE_NIC "netmap:foo-i" +only the i-th hardware ring pair, where the number is in +.Pa nr_ringid ; +.It NR_REG_PIPE_MASTER "netmap:foo{i" +the master side of the netmap pipe whose identifier (i) is in +.Pa nr_ringid ; +.It NR_REG_PIPE_SLAVE "netmap:foo}i" +the slave side of the netmap pipe whose identifier (i) is in +.Pa nr_ringid . +.Pp +The identifier of a pipe must be thought as part of the pipe name, +and does not need to be sequential. On return the pipe +will only have a single ring pair with index 0, +irrespective of the value of i. .El +.Pp By default, a -.Nm poll +.Xr poll 2 or -.Nm select +.Xr select 2 call pushes out any pending packets on the transmit ring, even if no write events are specified. The feature can be disabled by or-ing -.Nm NETMAP_NO_TX_SYNC -to nr_ringid. -But normally you should keep this feature unless you are using -separate file descriptors for the send and receive rings, because -otherwise packets are pushed out only if NETMAP_TXSYNC is called, -or the send queue is full. -.Pp -.Pa NIOCREGIF -can be used multiple times to change the association of a -file descriptor to a ring pair, always within the same device. -.It Dv NIOCUNREGIF -brings an interface back to normal mode. +.Va NETMAP_NO_TX_SYNC +to the value written to +.Va nr_ringid. +When this feature is used, +packets are transmitted only on +.Va ioctl(NIOCTXSYNC) +or select()/poll() are called with a write event (POLLOUT/wfdset) or a full ring. +.Pp +When registering a virtual interface that is dynamically created to a +.Xr vale 4 +switch, we can specify the desired number of rings (1 by default, +and currently up to 16) on it using nr_tx_rings and nr_rx_rings fields. .It Dv NIOCTXSYNC tells the hardware of new packets to transmit, and updates the number of slots available for transmission. @@ -246,54 +658,418 @@ number of slots available for transmissi tells the hardware of consumed packets, and asks for newly available packets. .El -.Ss SYSTEM CALLS +.Sh SELECT, POLL, EPOLL, KQUEUE. +.Xr select 2 +and +.Xr poll 2 +on a +.Nm +file descriptor process rings as indicated in +.Sx TRANSMIT RINGS +and +.Sx RECEIVE RINGS , +respectively when write (POLLOUT) and read (POLLIN) events are requested. +Both block if no slots are available in the ring +.Va ( ring->cur == ring->tail ) . +Depending on the platform, +.Xr epoll 2 +and +.Xr kqueue 2 +are supported too. +.Pp +Packets in transmit rings are normally pushed out +(and buffers reclaimed) even without +requesting write events. Passing the NETMAP_NO_TX_SYNC flag to +.Em NIOCREGIF +disables this feature. +By default, receive rings are processed only if read +events are requested. Passing the NETMAP_DO_RX_SYNC flag to +.Em NIOCREGIF updates receive rings even without read events. +Note that on epoll and kqueue, NETMAP_NO_TX_SYNC and NETMAP_DO_RX_SYNC +only have an effect when some event is posted for the file descriptor. +.Sh LIBRARIES +The +.Nm +API is supposed to be used directly, both because of its simplicity and +for efficient integration with applications. +.Pp +For conveniency, the +.Va +header provides a few macros and functions to ease creating +a file descriptor and doing I/O with a +.Nm +port. These are loosely modeled after the +.Xr pcap 3 +API, to ease porting of libpcap-based applications to +.Nm . +To use these extra functions, programs should +.Dl #define NETMAP_WITH_LIBS +before +.Dl #include +.Pp +The following functions are available: +.Bl -tag -width XXXXX +.It Va struct nm_desc * nm_open(const char *ifname, const struct nmreq *req, uint64_t flags, const struct nm_desc *arg) +similar to +.Xr pcap_open , +binds a file descriptor to a port. +.Bl -tag -width XX +.It Va ifname +is a port name, in the form "netmap:XXX" for a NIC and "valeXXX:YYY" for a +.Nm VALE +port. +.It Va req +provides the initial values for the argument to the NIOCREGIF ioctl. +The nm_flags and nm_ringid values are overwritten by parsing +ifname and flags, and other fields can be overridden through +the other two arguments. +.It Va arg +points to a struct nm_desc containing arguments (e.g. from a previously +open file descriptor) that should override the defaults. +The fields are used as described below +.It Va flags +can be set to a combination of the following flags: +.Va NETMAP_NO_TX_POLL , +.Va NETMAP_DO_RX_POLL +(copied into nr_ringid); +.Va NM_OPEN_NO_MMAP (if arg points to the same memory region, +avoids the mmap and uses the values from it); +.Va NM_OPEN_IFNAME (ignores ifname and uses the values in arg); +.Va NM_OPEN_ARG1 , +.Va NM_OPEN_ARG2 , +.Va NM_OPEN_ARG3 (uses the fields from arg); +.Va NM_OPEN_RING_CFG (uses the ring number and sizes from arg). +.El +.It Va int nm_close(struct nm_desc *d) +closes the file descriptor, unmaps memory, frees resources. +.It Va int nm_inject(struct nm_desc *d, const void *buf, size_t size) +similar to pcap_inject(), pushes a packet to a ring, returns the size +of the packet is successful, or 0 on error; +.It Va int nm_dispatch(struct nm_desc *d, int cnt, nm_cb_t cb, u_char *arg) +similar to pcap_dispatch(), applies a callback to incoming packets +.It Va u_char * nm_nextpkt(struct nm_desc *d, struct nm_pkthdr *hdr) +similar to pcap_next(), fetches the next packet +.Pp +.El +.Sh SUPPORTED DEVICES +.Nm +natively supports the following devices: +.Pp +On FreeBSD: +.Xr em 4 , +.Xr igb 4 , +.Xr ixgbe 4 , +.Xr lem 4 , +.Xr re 4 . +.Pp +On Linux +.Xr e1000 4 , +.Xr e1000e 4 , +.Xr igb 4 , +.Xr ixgbe 4 , +.Xr mlx4 4 , +.Xr forcedeth 4 , +.Xr r8169 4 . +.Pp +NICs without native support can still be used in +.Nm +mode through emulation. Performance is inferior to native netmap +mode but still significantly higher than sockets, and approaching +that of in-kernel solutions such as Linux's +.Xr pktgen . +.Pp +Emulation is also available for devices with native netmap support, +which can be used for testing or performance comparison. +The sysctl variable +.Va dev.netmap.admode +globally controls how netmap mode is implemented. +.Sh SYSCTL VARIABLES AND MODULE PARAMETERS +Some aspect of the operation of +.Nm +are controlled through sysctl variables on FreeBSD +.Em ( dev.netmap.* ) +and module parameters on Linux +.Em ( /sys/module/netmap_lin/parameters/* ) : +.Pp +.Bl -tag -width indent +.It Va dev.netmap.admode: 0 +Controls the use of native or emulated adapter mode. +0 uses the best available option, 1 forces native and +fails if not available, 2 forces emulated hence never fails. +.It Va dev.netmap.generic_ringsize: 1024 +Ring size used for emulated netmap mode +.It Va dev.netmap.generic_mit: 100000 +Controls interrupt moderation for emulated mode +.It Va dev.netmap.mmap_unreg: 0 +.It Va dev.netmap.fwd: 0 +Forces NS_FORWARD mode +.It Va dev.netmap.flags: 0 +.It Va dev.netmap.txsync_retry: 2 +.It Va dev.netmap.no_pendintr: 1 +Forces recovery of transmit buffers on system calls +.It Va dev.netmap.mitigate: 1 +Propagates interrupt mitigation to user processes +.It Va dev.netmap.no_timestamp: 0 +Disables the update of the timestamp in the netmap ring +.It Va dev.netmap.verbose: 0 +Verbose kernel messages +.It Va dev.netmap.buf_num: 163840 +.It Va dev.netmap.buf_size: 2048 +.It Va dev.netmap.ring_num: 200 +.It Va dev.netmap.ring_size: 36864 +.It Va dev.netmap.if_num: 100 +.It Va dev.netmap.if_size: 1024 +Sizes and number of objects (netmap_if, netmap_ring, buffers) +for the global memory region. The only parameter worth modifying is +.Va dev.netmap.buf_num +as it impacts the total amount of memory used by netmap. +.It Va dev.netmap.buf_curr_num: 0 +.It Va dev.netmap.buf_curr_size: 0 +.It Va dev.netmap.ring_curr_num: 0 +.It Va dev.netmap.ring_curr_size: 0 +.It Va dev.netmap.if_curr_num: 0 +.It Va dev.netmap.if_curr_size: 0 +Actual values in use. +.It Va dev.netmap.bridge_batch: 1024 +Batch size used when moving packets across a +.Nm VALE +switch. Values above 64 generally guarantee good +performance. +.El +.Sh SYSTEM CALLS .Nm uses -.Nm select +.Xr select 2 , +.Xr poll 2 , +.Xr epoll and -.Nm poll -to wake up processes when significant events occur. +.Xr kqueue +to wake up processes when significant events occur, and +.Xr mmap 2 +to map memory. +.Xr ioctl 2 +is used to configure ports and +.Nm VALE switches . +.Pp +Applications may need to create threads and bind them to +specific cores to improve performance, using standard +OS primitives, see +.Xr pthread 3 . +In particular, +.Xr pthread_setaffinity_np 3 +may be of use. +.Sh CAVEATS *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 13:48:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DC328A0; Tue, 18 Feb 2014 13:48: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46B3116C2; Tue, 18 Feb 2014 13:48:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IDmpA2047442; Tue, 18 Feb 2014 13:48:51 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IDmpA8047441; Tue, 18 Feb 2014 13:48:51 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181348.s1IDmpA8047441@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 13:48: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: r262154 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 13:48:51 -0000 Author: avg Date: Tue Feb 18 13:48:50 2014 New Revision: 262154 URL: http://svnweb.freebsd.org/changeset/base/262154 Log: MFC r240829: remove cache entries associated with the source and the target of rename() MFC slacker: pjd Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 18 05:58:36 2014 (r262153) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 18 13:48:50 2014 (r262154) @@ -4025,6 +4025,9 @@ top: if (error == 0) { cache_purge(sdvp); cache_purge(tdvp); + cache_purge(ZTOV(szp)); + if (tzp) + cache_purge(ZTOV(tzp)); } #endif } From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 13:49:04 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D89E9D0; Tue, 18 Feb 2014 13:49: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 33D4316C4; Tue, 18 Feb 2014 13:49:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IDn3v1047516; Tue, 18 Feb 2014 13:49:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IDn3ps047515; Tue, 18 Feb 2014 13:49:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181349.s1IDn3ps047515@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 13:49:03 +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: r262155 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 13:49:04 -0000 Author: avg Date: Tue Feb 18 13:49:03 2014 New Revision: 262155 URL: http://svnweb.freebsd.org/changeset/base/262155 Log: MFC r240829: remove cache entries associated with the source and the target of rename() Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 18 13:48:50 2014 (r262154) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 18 13:49:03 2014 (r262155) @@ -4049,6 +4049,9 @@ top: if (error == 0) { cache_purge(sdvp); cache_purge(tdvp); + cache_purge(ZTOV(szp)); + if (tzp) + cache_purge(ZTOV(tzp)); } #endif } From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 13:58:55 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A918ECD0; Tue, 18 Feb 2014 13:58: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 93D8B179C; Tue, 18 Feb 2014 13:58:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IDwtDQ051485; Tue, 18 Feb 2014 13:58:55 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IDwtJM051484; Tue, 18 Feb 2014 13:58:55 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181358.s1IDwtJM051484@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 13:58:55 +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: r262156 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 13:58:55 -0000 Author: avg Date: Tue Feb 18 13:58:55 2014 New Revision: 262156 URL: http://svnweb.freebsd.org/changeset/base/262156 Log: MFC r250149: In case ZFS doesn't use UMA for buffers there's no need to waste memory Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 18 13:49:03 2014 (r262155) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 18 13:58:55 2014 (r262156) @@ -130,6 +130,8 @@ zio_init(void) sizeof (zio_t), 0, NULL, NULL, NULL, NULL, NULL, 0); zio_link_cache = kmem_cache_create("zio_link_cache", sizeof (zio_link_t), 0, NULL, NULL, NULL, NULL, NULL, 0); + if (!zio_use_uma) + goto out; /* * For small buffers, we want a cache for each multiple of @@ -193,6 +195,7 @@ zio_init(void) if (zio_data_buf_cache[c - 1] == NULL) zio_data_buf_cache[c - 1] = zio_data_buf_cache[c]; } +out: /* * The zio write taskqs have 1 thread per cpu, allow 1/2 of the taskqs From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 13:59:06 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5EB8DFE; Tue, 18 Feb 2014 13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C1C66179D; Tue, 18 Feb 2014 13:59:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IDx6j3051559; Tue, 18 Feb 2014 13:59:06 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IDx6Hh051558; Tue, 18 Feb 2014 13:59:06 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181359.s1IDx6Hh051558@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 13:59:06 +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: r262157 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 13:59:06 -0000 Author: avg Date: Tue Feb 18 13:59:06 2014 New Revision: 262157 URL: http://svnweb.freebsd.org/changeset/base/262157 Log: MFC r250149: In case ZFS doesn't use UMA for buffers there's no need to waste memory Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 18 13:58:55 2014 (r262156) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 18 13:59:06 2014 (r262157) @@ -130,6 +130,8 @@ zio_init(void) sizeof (zio_t), 0, NULL, NULL, NULL, NULL, NULL, 0); zio_link_cache = kmem_cache_create("zio_link_cache", sizeof (zio_link_t), 0, NULL, NULL, NULL, NULL, NULL, 0); + if (!zio_use_uma) + goto out; /* * For small buffers, we want a cache for each multiple of @@ -193,6 +195,7 @@ zio_init(void) if (zio_data_buf_cache[c - 1] == NULL) zio_data_buf_cache[c - 1] = zio_data_buf_cache[c]; } +out: /* * The zio write taskqs have 1 thread per cpu, allow 1/2 of the taskqs From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 14:06:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3B9B72A4; Tue, 18 Feb 2014 14:06: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1D513188B; Tue, 18 Feb 2014 14:06:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IE6gvV063920; Tue, 18 Feb 2014 14:06:42 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IE6fpd063912; Tue, 18 Feb 2014 14:06:41 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181406.s1IE6fpd063912@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 14:06:41 +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: r262158 - in stable/9: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 14:06:43 -0000 Author: avg Date: Tue Feb 18 14:06:41 2014 New Revision: 262158 URL: http://svnweb.freebsd.org/changeset/base/262158 Log: MFC r253819: MFV r253781 + r253871: 3894 zfs should not allow snapshot of inconsistent dataset MFC slacker: delphij Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 18 13:59:06 2014 (r262157) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 18 14:06:41 2014 (r262158) @@ -3519,6 +3519,12 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void int rv = 0; int error; + if (sd->sd_recursive && + zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) != 0) { + zfs_close(zhp); + return (0); + } + error = asprintf(&name, "%s@%s", zfs_get_name(zhp), sd->sd_snapname); if (error == -1) nomem(); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 18 13:59:06 2014 (r262157) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 18 14:06:41 2014 (r262158) @@ -1885,6 +1885,10 @@ get_numeric_property(zfs_handle_t *zhp, zcmd_free_nvlists(&zc); break; + case ZFS_PROP_INCONSISTENT: + *val = zhp->zfs_dmustats.dds_inconsistent; + break; + default: switch (zfs_prop_get_type(prop)) { case PROP_TYPE_NUMBER: @@ -3379,13 +3383,16 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void char name[ZFS_MAXNAMELEN]; int rv = 0; - (void) snprintf(name, sizeof (name), - "%s@%s", zfs_get_name(zhp), sd->sd_snapname); + if (zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) == 0) { + (void) snprintf(name, sizeof (name), + "%s@%s", zfs_get_name(zhp), sd->sd_snapname); - fnvlist_add_boolean(sd->sd_nvl, name); + fnvlist_add_boolean(sd->sd_nvl, name); - rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd); + rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd); + } zfs_close(zhp); + return (rv); } Modified: stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Feb 18 13:59:06 2014 (r262157) +++ stable/9/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Feb 18 14:06:41 2014 (r262158) @@ -397,6 +397,8 @@ zfs_prop_init(void) PROP_READONLY, ZFS_TYPE_DATASET, "UNIQUE"); zprop_register_hidden(ZFS_PROP_OBJSETID, "objsetid", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID"); + zprop_register_hidden(ZFS_PROP_INCONSISTENT, "inconsistent", + PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "INCONSISTENT"); /* oddball properties */ zprop_register_impl(ZFS_PROP_CREATION, "creation", PROP_TYPE_NUMBER, 0, Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 13:59:06 2014 (r262157) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 14:06:41 2014 (r262158) @@ -1648,7 +1648,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * return (error); } error = dsl_dataset_snapshot_check_impl(origin_head, - drc->drc_tosnap, tx); + drc->drc_tosnap, tx, B_TRUE); dsl_dataset_rele(origin_head, FTAG); if (error != 0) return (error); @@ -1656,7 +1656,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_destroy_head_check_impl(drc->drc_ds, 1); } else { error = dsl_dataset_snapshot_check_impl(drc->drc_ds, - drc->drc_tosnap, tx); + drc->drc_tosnap, tx, B_TRUE); } return (error); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 13:59:06 2014 (r262157) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 14:06:41 2014 (r262158) @@ -994,7 +994,7 @@ typedef struct dsl_dataset_snapshot_arg int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, - dmu_tx_t *tx) + dmu_tx_t *tx, boolean_t recv) { int error; uint64_t value; @@ -1020,6 +1020,18 @@ dsl_dataset_snapshot_check_impl(dsl_data if (error != ENOENT) return (error); + /* + * We don't allow taking snapshots of inconsistent datasets, such as + * those into which we are currently receiving. However, if we are + * creating this snapshot as part of a receive, this check will be + * executed atomically with respect to the completion of the receive + * itself but prior to the clearing of DS_FLAG_INCONSISTENT; in this + * case we ignore this, knowing it will be fixed up for us shortly in + * dmu_recv_end_sync(). + */ + if (!recv && DS_IS_INCONSISTENT(ds)) + return (SET_ERROR(EBUSY)); + error = dsl_dataset_snapshot_reserve_space(ds, tx); if (error != 0) return (error); @@ -1056,7 +1068,7 @@ dsl_dataset_snapshot_check(void *arg, dm error = dsl_dataset_hold(dp, dsname, FTAG, &ds); if (error == 0) { error = dsl_dataset_snapshot_check_impl(ds, - atp + 1, tx); + atp + 1, tx, B_FALSE); dsl_dataset_rele(ds, FTAG); } @@ -1322,7 +1334,8 @@ dsl_dataset_snapshot_tmp_check(void *arg if (error != 0) return (error); - error = dsl_dataset_snapshot_check_impl(ds, ddsta->ddsta_snapname, tx); + error = dsl_dataset_snapshot_check_impl(ds, ddsta->ddsta_snapname, + tx, B_FALSE); if (error != 0) { dsl_dataset_rele(ds, FTAG); return (error); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 13:59:06 2014 (r262157) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 14:06:41 2014 (r262158) @@ -251,7 +251,7 @@ int dsl_dataset_clone_swap_check_impl(ds void dsl_dataset_clone_swap_sync_impl(dsl_dataset_t *clone, dsl_dataset_t *origin_head, dmu_tx_t *tx); int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, - dmu_tx_t *tx); + dmu_tx_t *tx, boolean_t recv); void dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, const char *snapname, dmu_tx_t *tx); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Feb 18 13:59:06 2014 (r262157) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Feb 18 14:06:41 2014 (r262158) @@ -143,6 +143,7 @@ typedef enum { ZFS_PROP_CLONES, ZFS_PROP_LOGICALUSED, ZFS_PROP_LOGICALREFERENCED, + ZFS_PROP_INCONSISTENT, /* not exposed to the user */ ZFS_NUM_PROPS } zfs_prop_t; From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 14:07:01 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 14F513E3; Tue, 18 Feb 2014 14:07: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E67291895; Tue, 18 Feb 2014 14:07:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IE70Wx064014; Tue, 18 Feb 2014 14:07:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IE6x66063993; Tue, 18 Feb 2014 14:06:59 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181406.s1IE6x66063993@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 14:06:59 +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: r262159 - in stable/8: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/common/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs... X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 14:07:01 -0000 Author: avg Date: Tue Feb 18 14:06:59 2014 New Revision: 262159 URL: http://svnweb.freebsd.org/changeset/base/262159 Log: MFC r253819: MFV r253781 + r253871: 3894 zfs should not allow snapshot of inconsistent dataset Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/cmd/zfs/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 18 14:06:41 2014 (r262158) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 18 14:06:59 2014 (r262159) @@ -3519,6 +3519,12 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void int rv = 0; int error; + if (sd->sd_recursive && + zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) != 0) { + zfs_close(zhp); + return (0); + } + error = asprintf(&name, "%s@%s", zfs_get_name(zhp), sd->sd_snapname); if (error == -1) nomem(); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 18 14:06:41 2014 (r262158) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Tue Feb 18 14:06:59 2014 (r262159) @@ -1885,6 +1885,10 @@ get_numeric_property(zfs_handle_t *zhp, zcmd_free_nvlists(&zc); break; + case ZFS_PROP_INCONSISTENT: + *val = zhp->zfs_dmustats.dds_inconsistent; + break; + default: switch (zfs_prop_get_type(prop)) { case PROP_TYPE_NUMBER: @@ -3379,13 +3383,16 @@ zfs_snapshot_cb(zfs_handle_t *zhp, void char name[ZFS_MAXNAMELEN]; int rv = 0; - (void) snprintf(name, sizeof (name), - "%s@%s", zfs_get_name(zhp), sd->sd_snapname); + if (zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) == 0) { + (void) snprintf(name, sizeof (name), + "%s@%s", zfs_get_name(zhp), sd->sd_snapname); - fnvlist_add_boolean(sd->sd_nvl, name); + fnvlist_add_boolean(sd->sd_nvl, name); - rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd); + rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd); + } zfs_close(zhp); + return (rv); } Modified: stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Feb 18 14:06:41 2014 (r262158) +++ stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c Tue Feb 18 14:06:59 2014 (r262159) @@ -397,6 +397,8 @@ zfs_prop_init(void) PROP_READONLY, ZFS_TYPE_DATASET, "UNIQUE"); zprop_register_hidden(ZFS_PROP_OBJSETID, "objsetid", PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID"); + zprop_register_hidden(ZFS_PROP_INCONSISTENT, "inconsistent", + PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "INCONSISTENT"); /* oddball properties */ zprop_register_impl(ZFS_PROP_CREATION, "creation", PROP_TYPE_NUMBER, 0, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 14:06:41 2014 (r262158) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 14:06:59 2014 (r262159) @@ -1648,7 +1648,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * return (error); } error = dsl_dataset_snapshot_check_impl(origin_head, - drc->drc_tosnap, tx); + drc->drc_tosnap, tx, B_TRUE); dsl_dataset_rele(origin_head, FTAG); if (error != 0) return (error); @@ -1656,7 +1656,7 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_destroy_head_check_impl(drc->drc_ds, 1); } else { error = dsl_dataset_snapshot_check_impl(drc->drc_ds, - drc->drc_tosnap, tx); + drc->drc_tosnap, tx, B_TRUE); } return (error); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 14:06:41 2014 (r262158) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 14:06:59 2014 (r262159) @@ -994,7 +994,7 @@ typedef struct dsl_dataset_snapshot_arg int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, - dmu_tx_t *tx) + dmu_tx_t *tx, boolean_t recv) { int error; uint64_t value; @@ -1020,6 +1020,18 @@ dsl_dataset_snapshot_check_impl(dsl_data if (error != ENOENT) return (error); + /* + * We don't allow taking snapshots of inconsistent datasets, such as + * those into which we are currently receiving. However, if we are + * creating this snapshot as part of a receive, this check will be + * executed atomically with respect to the completion of the receive + * itself but prior to the clearing of DS_FLAG_INCONSISTENT; in this + * case we ignore this, knowing it will be fixed up for us shortly in + * dmu_recv_end_sync(). + */ + if (!recv && DS_IS_INCONSISTENT(ds)) + return (SET_ERROR(EBUSY)); + error = dsl_dataset_snapshot_reserve_space(ds, tx); if (error != 0) return (error); @@ -1056,7 +1068,7 @@ dsl_dataset_snapshot_check(void *arg, dm error = dsl_dataset_hold(dp, dsname, FTAG, &ds); if (error == 0) { error = dsl_dataset_snapshot_check_impl(ds, - atp + 1, tx); + atp + 1, tx, B_FALSE); dsl_dataset_rele(ds, FTAG); } @@ -1322,7 +1334,8 @@ dsl_dataset_snapshot_tmp_check(void *arg if (error != 0) return (error); - error = dsl_dataset_snapshot_check_impl(ds, ddsta->ddsta_snapname, tx); + error = dsl_dataset_snapshot_check_impl(ds, ddsta->ddsta_snapname, + tx, B_FALSE); if (error != 0) { dsl_dataset_rele(ds, FTAG); return (error); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 14:06:41 2014 (r262158) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 14:06:59 2014 (r262159) @@ -251,7 +251,7 @@ int dsl_dataset_clone_swap_check_impl(ds void dsl_dataset_clone_swap_sync_impl(dsl_dataset_t *clone, dsl_dataset_t *origin_head, dmu_tx_t *tx); int dsl_dataset_snapshot_check_impl(dsl_dataset_t *ds, const char *snapname, - dmu_tx_t *tx); + dmu_tx_t *tx, boolean_t recv); void dsl_dataset_snapshot_sync_impl(dsl_dataset_t *ds, const char *snapname, dmu_tx_t *tx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Feb 18 14:06:41 2014 (r262158) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h Tue Feb 18 14:06:59 2014 (r262159) @@ -143,6 +143,7 @@ typedef enum { ZFS_PROP_CLONES, ZFS_PROP_LOGICALUSED, ZFS_PROP_LOGICALREFERENCED, + ZFS_PROP_INCONSISTENT, /* not exposed to the user */ ZFS_NUM_PROPS } zfs_prop_t; From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 14:11:06 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 323B6586; Tue, 18 Feb 2014 14:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 12D9118BF; Tue, 18 Feb 2014 14:11:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IEB5nX067105; Tue, 18 Feb 2014 14:11:05 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IEB5rT067097; Tue, 18 Feb 2014 14:11:05 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181411.s1IEB5rT067097@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 14:11:05 +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: r262160 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 14:11:06 -0000 Author: avg Date: Tue Feb 18 14:11:04 2014 New Revision: 262160 URL: http://svnweb.freebsd.org/changeset/base/262160 Log: MFC r253820: MFV r253782: 3888 zfs recv -F should destroy any snapshots created since the incremental source MFC slacker: delphij Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 14:06:59 2014 (r262159) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 14:11:04 2014 (r262160) @@ -723,6 +723,7 @@ typedef struct dmu_recv_begin_arg { const char *drba_origin; dmu_recv_cookie_t *drba_cookie; cred_t *drba_cred; + uint64_t drba_snapobj; } dmu_recv_begin_arg_t; static int @@ -733,11 +734,6 @@ recv_begin_check_existing_impl(dmu_recv_ int error; dsl_pool_t *dp = ds->ds_dir->dd_pool; - /* must not have any changes since most recent snapshot */ - if (!drba->drba_cookie->drc_force && - dsl_dataset_modified_since_lastsnap(ds)) - return (SET_ERROR(ETXTBSY)); - /* 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, @@ -753,41 +749,47 @@ recv_begin_check_existing_impl(dmu_recv_ return (error == 0 ? EEXIST : error); if (fromguid != 0) { - /* if incremental, most recent snapshot must match fromguid */ - if (ds->ds_prev == NULL) + dsl_dataset_t *snap; + uint64_t obj = ds->ds_phys->ds_prev_snap_obj; + + /* Find snapshot in this dir that matches fromguid. */ + while (obj != 0) { + error = dsl_dataset_hold_obj(dp, obj, FTAG, + &snap); + if (error != 0) + return (SET_ERROR(ENODEV)); + if (snap->ds_dir != ds->ds_dir) { + dsl_dataset_rele(snap, FTAG); + return (SET_ERROR(ENODEV)); + } + if (snap->ds_phys->ds_guid == fromguid) + break; + obj = snap->ds_phys->ds_prev_snap_obj; + dsl_dataset_rele(snap, FTAG); + } + if (obj == 0) return (SET_ERROR(ENODEV)); - /* - * most recent snapshot must match fromguid, or there are no - * changes since the fromguid one - */ - if (ds->ds_prev->ds_phys->ds_guid != fromguid) { - uint64_t birth = ds->ds_prev->ds_phys->ds_bp.blk_birth; - uint64_t obj = ds->ds_prev->ds_phys->ds_prev_snap_obj; - while (obj != 0) { - dsl_dataset_t *snap; - error = dsl_dataset_hold_obj(dp, obj, FTAG, - &snap); - if (error != 0) - return (SET_ERROR(ENODEV)); - if (snap->ds_phys->ds_creation_txg < birth) { - dsl_dataset_rele(snap, FTAG); - return (SET_ERROR(ENODEV)); - } - if (snap->ds_phys->ds_guid == fromguid) { - dsl_dataset_rele(snap, FTAG); - break; /* it's ok */ - } - obj = snap->ds_phys->ds_prev_snap_obj; + if (drba->drba_cookie->drc_force) { + drba->drba_snapobj = obj; + } else { + /* + * If we are not forcing, there must be no + * changes since fromsnap. + */ + if (dsl_dataset_modified_since_snap(ds, snap)) { dsl_dataset_rele(snap, FTAG); + return (SET_ERROR(ETXTBSY)); } - if (obj == 0) - return (SET_ERROR(ENODEV)); + drba->drba_snapobj = ds->ds_prev->ds_object; } + + dsl_dataset_rele(snap, FTAG); } else { /* if full, most recent snapshot must be $ORIGIN */ if (ds->ds_phys->ds_prev_snap_txg >= TXG_INITIAL) return (SET_ERROR(ENODEV)); + drba->drba_snapobj = ds->ds_phys->ds_prev_snap_obj; } return (0); @@ -896,8 +898,14 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t error = dsl_dataset_hold(dp, tofs, FTAG, &ds); if (error == 0) { /* create temporary clone */ + dsl_dataset_t *snap = NULL; + if (drba->drba_snapobj != 0) { + VERIFY0(dsl_dataset_hold_obj(dp, + drba->drba_snapobj, FTAG, &snap)); + } dsobj = dsl_dataset_create_sync(ds->ds_dir, recv_clone_name, - ds->ds_prev, crflags, drba->drba_cred, tx); + snap, crflags, drba->drba_cred, tx); + dsl_dataset_rele(snap, FTAG); dsl_dataset_rele(ds, FTAG); } else { dsl_dir_t *dd; @@ -1641,6 +1649,32 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_dataset_hold(dp, drc->drc_tofs, FTAG, &origin_head); if (error != 0) return (error); + if (drc->drc_force) { + /* + * We will destroy any snapshots in tofs (i.e. before + * origin_head) that are after the origin (which is + * 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) { + dsl_dataset_t *snap; + error = dsl_dataset_hold_obj(dp, obj, FTAG, + &snap); + if (error != 0) + return (error); + if (snap->ds_dir != origin_head->ds_dir) + error = SET_ERROR(EINVAL); + if (error == 0) { + error = dsl_destroy_snapshot_check_impl( + snap, B_FALSE); + } + obj = snap->ds_phys->ds_prev_snap_obj; + dsl_dataset_rele(snap, FTAG); + if (error != 0) + return (error); + } + } error = dsl_dataset_clone_swap_check_impl(drc->drc_ds, origin_head, drc->drc_force, drc->drc_owner, tx); if (error != 0) { @@ -1675,6 +1709,27 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t VERIFY0(dsl_dataset_hold(dp, drc->drc_tofs, FTAG, &origin_head)); + + if (drc->drc_force) { + /* + * 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) { + 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; + dsl_destroy_snapshot_sync_impl(snap, + B_FALSE, tx); + dsl_dataset_rele(snap, FTAG); + } + } + VERIFY3P(drc->drc_ds->ds_prev, ==, + origin_head->ds_prev); + dsl_dataset_clone_swap_sync_impl(drc->drc_ds, origin_head, tx); dsl_dataset_snapshot_sync_impl(origin_head, Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 14:06:59 2014 (r262159) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 14:11:04 2014 (r262160) @@ -1593,16 +1593,16 @@ dsl_dataset_space(dsl_dataset_t *ds, } boolean_t -dsl_dataset_modified_since_lastsnap(dsl_dataset_t *ds) +dsl_dataset_modified_since_snap(dsl_dataset_t *ds, dsl_dataset_t *snap) { dsl_pool_t *dp = ds->ds_dir->dd_pool; ASSERT(dsl_pool_config_held(dp)); - if (ds->ds_prev == NULL) + if (snap == NULL) return (B_FALSE); if (ds->ds_phys->ds_bp.blk_birth > - ds->ds_prev->ds_phys->ds_creation_txg) { - objset_t *os, *os_prev; + snap->ds_phys->ds_creation_txg) { + objset_t *os, *os_snap; /* * It may be that only the ZIL differs, because it was * reset in the head. Don't count that as being @@ -1610,10 +1610,10 @@ dsl_dataset_modified_since_lastsnap(dsl_ */ if (dmu_objset_from_ds(ds, &os) != 0) return (B_TRUE); - if (dmu_objset_from_ds(ds->ds_prev, &os_prev) != 0) + if (dmu_objset_from_ds(snap, &os_snap) != 0) return (B_TRUE); return (bcmp(&os->os_phys->os_meta_dnode, - &os_prev->os_phys->os_meta_dnode, + &os_snap->os_phys->os_meta_dnode, sizeof (os->os_phys->os_meta_dnode)) != 0); } return (B_FALSE); @@ -2436,15 +2436,14 @@ dsl_dataset_clone_swap_check_impl(dsl_da dsl_dataset_is_snapshot(origin_head)) return (SET_ERROR(EINVAL)); - /* the branch point should be just before them */ - if (clone->ds_prev != origin_head->ds_prev) + /* if we are not forcing, the branch point should be just before them */ + if (!force && clone->ds_prev != origin_head->ds_prev) return (SET_ERROR(EINVAL)); /* clone should be the clone (unless they are unrelated) */ if (clone->ds_prev != NULL && clone->ds_prev != clone->ds_dir->dd_pool->dp_origin_snap && - origin_head->ds_object != - clone->ds_prev->ds_phys->ds_next_snap_obj) + origin_head->ds_dir != clone->ds_prev->ds_dir) return (SET_ERROR(EINVAL)); /* the clone should be a child of the origin */ @@ -2452,7 +2451,8 @@ dsl_dataset_clone_swap_check_impl(dsl_da return (SET_ERROR(EINVAL)); /* origin_head shouldn't be modified unless 'force' */ - if (!force && dsl_dataset_modified_since_lastsnap(origin_head)) + if (!force && + dsl_dataset_modified_since_snap(origin_head, origin_head->ds_prev)) return (SET_ERROR(ETXTBSY)); /* origin_head should have no long holds (e.g. is not mounted) */ @@ -2489,6 +2489,7 @@ dsl_dataset_clone_swap_sync_impl(dsl_dat ASSERT(clone->ds_reserved == 0); ASSERT(origin_head->ds_quota == 0 || clone->ds_phys->ds_unique_bytes <= origin_head->ds_quota); + ASSERT3P(clone->ds_prev, ==, origin_head->ds_prev); dmu_buf_will_dirty(clone->ds_dbuf, tx); dmu_buf_will_dirty(origin_head->ds_dbuf, tx); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Tue Feb 18 14:06:59 2014 (r262159) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Tue Feb 18 14:11:04 2014 (r262160) @@ -46,10 +46,7 @@ typedef struct dmu_snapshots_destroy_arg nvlist_t *dsda_errlist; } dmu_snapshots_destroy_arg_t; -/* - * ds must be owned. - */ -static int +int dsl_destroy_snapshot_check_impl(dsl_dataset_t *ds, boolean_t defer) { if (!dsl_dataset_is_snapshot(ds)) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 14:06:59 2014 (r262159) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 14:11:04 2014 (r262160) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ @@ -206,7 +206,8 @@ void dsl_dataset_set_blkptr(dsl_dataset_ spa_t *dsl_dataset_get_spa(dsl_dataset_t *ds); -boolean_t dsl_dataset_modified_since_lastsnap(dsl_dataset_t *ds); +boolean_t dsl_dataset_modified_since_snap(dsl_dataset_t *ds, + dsl_dataset_t *snap); void dsl_dataset_sync(dsl_dataset_t *os, zio_t *zio, dmu_tx_t *tx); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h Tue Feb 18 14:06:59 2014 (r262159) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h Tue Feb 18 14:11:04 2014 (r262160) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ @@ -35,15 +35,16 @@ struct nvlist; struct dsl_dataset; struct dmu_tx; -int dsl_destroy_snapshots_nvl(struct nvlist *snaps, boolean_t defer, - struct nvlist *errlist); -int dsl_destroy_snapshot(const char *name, boolean_t defer); -int dsl_destroy_head(const char *name); -int dsl_destroy_head_check_impl(struct dsl_dataset *ds, int expected_holds); -void dsl_destroy_head_sync_impl(struct dsl_dataset *ds, struct dmu_tx *tx); -int dsl_destroy_inconsistent(const char *dsname, void *arg); -void dsl_destroy_snapshot_sync_impl(struct dsl_dataset *ds, - boolean_t defer, struct dmu_tx *tx); +int dsl_destroy_snapshots_nvl(struct nvlist *, boolean_t, + struct nvlist *); +int dsl_destroy_snapshot(const char *, boolean_t); +int dsl_destroy_head(const char *); +int dsl_destroy_head_check_impl(struct dsl_dataset *, int); +void dsl_destroy_head_sync_impl(struct dsl_dataset *, struct dmu_tx *); +int dsl_destroy_inconsistent(const char *, void *); +int dsl_destroy_snapshot_check_impl(struct dsl_dataset *, boolean_t); +void dsl_destroy_snapshot_sync_impl(struct dsl_dataset *, + boolean_t, struct dmu_tx *); #ifdef __cplusplus } From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 14:11:20 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8BFAD675; Tue, 18 Feb 2014 14:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6C94D191B; Tue, 18 Feb 2014 14:11:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IEBKqE067185; Tue, 18 Feb 2014 14:11:20 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IEBJ4v067176; Tue, 18 Feb 2014 14:11:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181411.s1IEBJ4v067176@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 14:11:19 +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: r262161 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 14:11:20 -0000 Author: avg Date: Tue Feb 18 14:11:19 2014 New Revision: 262161 URL: http://svnweb.freebsd.org/changeset/base/262161 Log: MFC r253820: MFV r253782: 3888 zfs recv -F should destroy any snapshots created since the incremental source Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 14:11:04 2014 (r262160) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c Tue Feb 18 14:11:19 2014 (r262161) @@ -723,6 +723,7 @@ typedef struct dmu_recv_begin_arg { const char *drba_origin; dmu_recv_cookie_t *drba_cookie; cred_t *drba_cred; + uint64_t drba_snapobj; } dmu_recv_begin_arg_t; static int @@ -733,11 +734,6 @@ recv_begin_check_existing_impl(dmu_recv_ int error; dsl_pool_t *dp = ds->ds_dir->dd_pool; - /* must not have any changes since most recent snapshot */ - if (!drba->drba_cookie->drc_force && - dsl_dataset_modified_since_lastsnap(ds)) - return (SET_ERROR(ETXTBSY)); - /* 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, @@ -753,41 +749,47 @@ recv_begin_check_existing_impl(dmu_recv_ return (error == 0 ? EEXIST : error); if (fromguid != 0) { - /* if incremental, most recent snapshot must match fromguid */ - if (ds->ds_prev == NULL) + dsl_dataset_t *snap; + uint64_t obj = ds->ds_phys->ds_prev_snap_obj; + + /* Find snapshot in this dir that matches fromguid. */ + while (obj != 0) { + error = dsl_dataset_hold_obj(dp, obj, FTAG, + &snap); + if (error != 0) + return (SET_ERROR(ENODEV)); + if (snap->ds_dir != ds->ds_dir) { + dsl_dataset_rele(snap, FTAG); + return (SET_ERROR(ENODEV)); + } + if (snap->ds_phys->ds_guid == fromguid) + break; + obj = snap->ds_phys->ds_prev_snap_obj; + dsl_dataset_rele(snap, FTAG); + } + if (obj == 0) return (SET_ERROR(ENODEV)); - /* - * most recent snapshot must match fromguid, or there are no - * changes since the fromguid one - */ - if (ds->ds_prev->ds_phys->ds_guid != fromguid) { - uint64_t birth = ds->ds_prev->ds_phys->ds_bp.blk_birth; - uint64_t obj = ds->ds_prev->ds_phys->ds_prev_snap_obj; - while (obj != 0) { - dsl_dataset_t *snap; - error = dsl_dataset_hold_obj(dp, obj, FTAG, - &snap); - if (error != 0) - return (SET_ERROR(ENODEV)); - if (snap->ds_phys->ds_creation_txg < birth) { - dsl_dataset_rele(snap, FTAG); - return (SET_ERROR(ENODEV)); - } - if (snap->ds_phys->ds_guid == fromguid) { - dsl_dataset_rele(snap, FTAG); - break; /* it's ok */ - } - obj = snap->ds_phys->ds_prev_snap_obj; + if (drba->drba_cookie->drc_force) { + drba->drba_snapobj = obj; + } else { + /* + * If we are not forcing, there must be no + * changes since fromsnap. + */ + if (dsl_dataset_modified_since_snap(ds, snap)) { dsl_dataset_rele(snap, FTAG); + return (SET_ERROR(ETXTBSY)); } - if (obj == 0) - return (SET_ERROR(ENODEV)); + drba->drba_snapobj = ds->ds_prev->ds_object; } + + dsl_dataset_rele(snap, FTAG); } else { /* if full, most recent snapshot must be $ORIGIN */ if (ds->ds_phys->ds_prev_snap_txg >= TXG_INITIAL) return (SET_ERROR(ENODEV)); + drba->drba_snapobj = ds->ds_phys->ds_prev_snap_obj; } return (0); @@ -896,8 +898,14 @@ dmu_recv_begin_sync(void *arg, dmu_tx_t error = dsl_dataset_hold(dp, tofs, FTAG, &ds); if (error == 0) { /* create temporary clone */ + dsl_dataset_t *snap = NULL; + if (drba->drba_snapobj != 0) { + VERIFY0(dsl_dataset_hold_obj(dp, + drba->drba_snapobj, FTAG, &snap)); + } dsobj = dsl_dataset_create_sync(ds->ds_dir, recv_clone_name, - ds->ds_prev, crflags, drba->drba_cred, tx); + snap, crflags, drba->drba_cred, tx); + dsl_dataset_rele(snap, FTAG); dsl_dataset_rele(ds, FTAG); } else { dsl_dir_t *dd; @@ -1641,6 +1649,32 @@ dmu_recv_end_check(void *arg, dmu_tx_t * error = dsl_dataset_hold(dp, drc->drc_tofs, FTAG, &origin_head); if (error != 0) return (error); + if (drc->drc_force) { + /* + * We will destroy any snapshots in tofs (i.e. before + * origin_head) that are after the origin (which is + * 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) { + dsl_dataset_t *snap; + error = dsl_dataset_hold_obj(dp, obj, FTAG, + &snap); + if (error != 0) + return (error); + if (snap->ds_dir != origin_head->ds_dir) + error = SET_ERROR(EINVAL); + if (error == 0) { + error = dsl_destroy_snapshot_check_impl( + snap, B_FALSE); + } + obj = snap->ds_phys->ds_prev_snap_obj; + dsl_dataset_rele(snap, FTAG); + if (error != 0) + return (error); + } + } error = dsl_dataset_clone_swap_check_impl(drc->drc_ds, origin_head, drc->drc_force, drc->drc_owner, tx); if (error != 0) { @@ -1675,6 +1709,27 @@ dmu_recv_end_sync(void *arg, dmu_tx_t *t VERIFY0(dsl_dataset_hold(dp, drc->drc_tofs, FTAG, &origin_head)); + + if (drc->drc_force) { + /* + * 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) { + 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; + dsl_destroy_snapshot_sync_impl(snap, + B_FALSE, tx); + dsl_dataset_rele(snap, FTAG); + } + } + VERIFY3P(drc->drc_ds->ds_prev, ==, + origin_head->ds_prev); + dsl_dataset_clone_swap_sync_impl(drc->drc_ds, origin_head, tx); dsl_dataset_snapshot_sync_impl(origin_head, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 14:11:04 2014 (r262160) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 14:11:19 2014 (r262161) @@ -1593,16 +1593,16 @@ dsl_dataset_space(dsl_dataset_t *ds, } boolean_t -dsl_dataset_modified_since_lastsnap(dsl_dataset_t *ds) +dsl_dataset_modified_since_snap(dsl_dataset_t *ds, dsl_dataset_t *snap) { dsl_pool_t *dp = ds->ds_dir->dd_pool; ASSERT(dsl_pool_config_held(dp)); - if (ds->ds_prev == NULL) + if (snap == NULL) return (B_FALSE); if (ds->ds_phys->ds_bp.blk_birth > - ds->ds_prev->ds_phys->ds_creation_txg) { - objset_t *os, *os_prev; + snap->ds_phys->ds_creation_txg) { + objset_t *os, *os_snap; /* * It may be that only the ZIL differs, because it was * reset in the head. Don't count that as being @@ -1610,10 +1610,10 @@ dsl_dataset_modified_since_lastsnap(dsl_ */ if (dmu_objset_from_ds(ds, &os) != 0) return (B_TRUE); - if (dmu_objset_from_ds(ds->ds_prev, &os_prev) != 0) + if (dmu_objset_from_ds(snap, &os_snap) != 0) return (B_TRUE); return (bcmp(&os->os_phys->os_meta_dnode, - &os_prev->os_phys->os_meta_dnode, + &os_snap->os_phys->os_meta_dnode, sizeof (os->os_phys->os_meta_dnode)) != 0); } return (B_FALSE); @@ -2436,15 +2436,14 @@ dsl_dataset_clone_swap_check_impl(dsl_da dsl_dataset_is_snapshot(origin_head)) return (SET_ERROR(EINVAL)); - /* the branch point should be just before them */ - if (clone->ds_prev != origin_head->ds_prev) + /* if we are not forcing, the branch point should be just before them */ + if (!force && clone->ds_prev != origin_head->ds_prev) return (SET_ERROR(EINVAL)); /* clone should be the clone (unless they are unrelated) */ if (clone->ds_prev != NULL && clone->ds_prev != clone->ds_dir->dd_pool->dp_origin_snap && - origin_head->ds_object != - clone->ds_prev->ds_phys->ds_next_snap_obj) + origin_head->ds_dir != clone->ds_prev->ds_dir) return (SET_ERROR(EINVAL)); /* the clone should be a child of the origin */ @@ -2452,7 +2451,8 @@ dsl_dataset_clone_swap_check_impl(dsl_da return (SET_ERROR(EINVAL)); /* origin_head shouldn't be modified unless 'force' */ - if (!force && dsl_dataset_modified_since_lastsnap(origin_head)) + if (!force && + dsl_dataset_modified_since_snap(origin_head, origin_head->ds_prev)) return (SET_ERROR(ETXTBSY)); /* origin_head should have no long holds (e.g. is not mounted) */ @@ -2489,6 +2489,7 @@ dsl_dataset_clone_swap_sync_impl(dsl_dat ASSERT(clone->ds_reserved == 0); ASSERT(origin_head->ds_quota == 0 || clone->ds_phys->ds_unique_bytes <= origin_head->ds_quota); + ASSERT3P(clone->ds_prev, ==, origin_head->ds_prev); dmu_buf_will_dirty(clone->ds_dbuf, tx); dmu_buf_will_dirty(origin_head->ds_dbuf, tx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Tue Feb 18 14:11:04 2014 (r262160) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Tue Feb 18 14:11:19 2014 (r262161) @@ -46,10 +46,7 @@ typedef struct dmu_snapshots_destroy_arg nvlist_t *dsda_errlist; } dmu_snapshots_destroy_arg_t; -/* - * ds must be owned. - */ -static int +int dsl_destroy_snapshot_check_impl(dsl_dataset_t *ds, boolean_t defer) { if (!dsl_dataset_is_snapshot(ds)) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 14:11:04 2014 (r262160) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h Tue Feb 18 14:11:19 2014 (r262161) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2013 Steven Hartland. All rights reserved. */ @@ -206,7 +206,8 @@ void dsl_dataset_set_blkptr(dsl_dataset_ spa_t *dsl_dataset_get_spa(dsl_dataset_t *ds); -boolean_t dsl_dataset_modified_since_lastsnap(dsl_dataset_t *ds); +boolean_t dsl_dataset_modified_since_snap(dsl_dataset_t *ds, + dsl_dataset_t *snap); void dsl_dataset_sync(dsl_dataset_t *os, zio_t *zio, dmu_tx_t *tx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h Tue Feb 18 14:11:04 2014 (r262160) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_destroy.h Tue Feb 18 14:11:19 2014 (r262161) @@ -20,7 +20,7 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. */ @@ -35,15 +35,16 @@ struct nvlist; struct dsl_dataset; struct dmu_tx; -int dsl_destroy_snapshots_nvl(struct nvlist *snaps, boolean_t defer, - struct nvlist *errlist); -int dsl_destroy_snapshot(const char *name, boolean_t defer); -int dsl_destroy_head(const char *name); -int dsl_destroy_head_check_impl(struct dsl_dataset *ds, int expected_holds); -void dsl_destroy_head_sync_impl(struct dsl_dataset *ds, struct dmu_tx *tx); -int dsl_destroy_inconsistent(const char *dsname, void *arg); -void dsl_destroy_snapshot_sync_impl(struct dsl_dataset *ds, - boolean_t defer, struct dmu_tx *tx); +int dsl_destroy_snapshots_nvl(struct nvlist *, boolean_t, + struct nvlist *); +int dsl_destroy_snapshot(const char *, boolean_t); +int dsl_destroy_head(const char *); +int dsl_destroy_head_check_impl(struct dsl_dataset *, int); +void dsl_destroy_head_sync_impl(struct dsl_dataset *, struct dmu_tx *); +int dsl_destroy_inconsistent(const char *, void *); +int dsl_destroy_snapshot_check_impl(struct dsl_dataset *, boolean_t); +void dsl_destroy_snapshot_sync_impl(struct dsl_dataset *, + boolean_t, struct dmu_tx *); #ifdef __cplusplus } From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 14:46:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 13667AB0; Tue, 18 Feb 2014 14:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E5C6B1C6E; Tue, 18 Feb 2014 14:46:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IEkdSE091908; Tue, 18 Feb 2014 14:46:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IEkdVf091906; Tue, 18 Feb 2014 14:46:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402181446.s1IEkdVf091906@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Feb 2014 14:46:39 +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: r262163 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 14:46:40 -0000 Author: mav Date: Tue Feb 18 14:46:39 2014 New Revision: 262163 URL: http://svnweb.freebsd.org/changeset/base/262163 Log: MFC r253992: Disable r252840 when ZFS TRIM is enabled (vfs.zfs.trim.enabled=1) and really disable TRIM otherwise. r252840 (illumos bug 3836) is based on assumption that zio_free_sync() has no lock dependencies and should complete immediately. Unfortunately, with our TRIM implementation that is not true due to ZIO_STAGE_VDEV_IO_START added to the ZIO_FREE_PIPELINE, which, while not really accessing devices, still acquires SCL_ZIO lock for read to be sure devices won't disappear. When TRIM is disabled, this patch enables direct free execution from r252840 and removes ZIO_STAGE_VDEV_IO_START and ZIO_STAGE_VDEV_IO_ASSESS stages from the pipeline to avoid lock acquisition. Otherwise it queues free request as it was before r252840. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Tue Feb 18 14:21:26 2014 (r262162) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h Tue Feb 18 14:46:39 2014 (r262163) @@ -213,9 +213,7 @@ enum zio_stage { #define ZIO_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ ZIO_STAGE_FREE_BP_INIT | \ - ZIO_STAGE_DVA_FREE | \ - ZIO_STAGE_VDEV_IO_START | \ - ZIO_STAGE_VDEV_IO_ASSESS) + ZIO_STAGE_DVA_FREE) #define ZIO_DDT_FREE_PIPELINE \ (ZIO_INTERLOCK_STAGES | \ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 18 14:21:26 2014 (r262162) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Tue Feb 18 14:46:39 2014 (r262163) @@ -750,7 +750,7 @@ zio_free(spa_t *spa, uint64_t txg, const * DEDUP), can be processed immediately. Otherwise, put them on the * in-memory list for later processing. */ - if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp) || + if (zfs_trim_enabled || BP_IS_GANG(bp) || BP_GET_DEDUP(bp) || txg != spa->spa_syncing_txg || spa_sync_pass(spa) >= zfs_sync_pass_deferred_free) { bplist_append(&spa->spa_free_bplist[txg & TXG_MASK], bp); @@ -777,12 +777,15 @@ zio_free_sync(zio_t *pio, spa_t *spa, ui metaslab_check_free(spa, bp); arc_freed(spa, bp); + if (zfs_trim_enabled) + stage |= ZIO_STAGE_ISSUE_ASYNC | ZIO_STAGE_VDEV_IO_START | + ZIO_STAGE_VDEV_IO_ASSESS; /* * GANG and DEDUP blocks can induce a read (for the gang block header, * or the DDT), so issue them asynchronously so that this thread is * not tied up. */ - if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp)) + else if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp)) stage |= ZIO_STAGE_ISSUE_ASYNC; zio = zio_create(pio, spa, txg, bp, NULL, size, From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 14:50:32 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 793A1C4C; Tue, 18 Feb 2014 14:50: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 630FC1CF2; Tue, 18 Feb 2014 14:50:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IEoWVp092729; Tue, 18 Feb 2014 14:50:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IEoV87092723; Tue, 18 Feb 2014 14:50:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402181450.s1IEoV87092723@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Feb 2014 14:50:31 +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: r262164 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 14:50:32 -0000 Author: mav Date: Tue Feb 18 14:50:31 2014 New Revision: 262164 URL: http://svnweb.freebsd.org/changeset/base/262164 Log: MFC: r258137 Introduce allocation cache to store LZ4 compression contexts without kicking VM subsystem twice for every written record. Tests on 24-core system show double reduction of CPU time spent on copying single large well-compressed file. This patch is not really needed on illumos (while not harm either) since their memory allocator by default uses caching for all requests up to 128K. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Tue Feb 18 14:46:39 2014 (r262163) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lz4.c Tue Feb 18 14:50:31 2014 (r262164) @@ -44,6 +44,8 @@ static int LZ4_compressCtx(void *ctx, co static int LZ4_compress64kCtx(void *ctx, const char *source, char *dest, int isize, int osize); +static kmem_cache_t *lz4_ctx_cache; + /*ARGSUSED*/ size_t lz4_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n) @@ -840,7 +842,7 @@ static int real_LZ4_compress(const char *source, char *dest, int isize, int osize) { #if HEAPMODE - void *ctx = kmem_zalloc(sizeof (struct refTables), KM_NOSLEEP); + void *ctx = kmem_cache_alloc(lz4_ctx_cache, KM_NOSLEEP); int result; /* @@ -850,12 +852,13 @@ real_LZ4_compress(const char *source, ch if (ctx == NULL) return (0); + bzero(ctx, sizeof(struct refTables)); if (isize < LZ4_64KLIMIT) result = LZ4_compress64kCtx(ctx, source, dest, isize, osize); else result = LZ4_compressCtx(ctx, source, dest, isize, osize); - kmem_free(ctx, sizeof (struct refTables)); + kmem_cache_free(lz4_ctx_cache, ctx); return (result); #else if (isize < (int)LZ4_64KLIMIT) @@ -1001,3 +1004,22 @@ LZ4_uncompress_unknownOutputSize(const c _output_error: return (int)(-(((char *)ip) - source)); } + +extern void +lz4_init(void) +{ + +#if HEAPMODE + lz4_ctx_cache = kmem_cache_create("lz4_ctx", sizeof(struct refTables), + 0, NULL, NULL, NULL, NULL, NULL, 0); +#endif +} + +extern void +lz4_fini(void) +{ + +#if HEAPMODE + kmem_cache_destroy(lz4_ctx_cache); +#endif +} Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 14:46:39 2014 (r262163) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 14:50:31 2014 (r262164) @@ -1766,6 +1766,7 @@ spa_init(int mode) unique_init(); range_tree_init(); zio_init(); + lz4_init(); dmu_init(); zil_init(); vdev_cache_stat_init(); @@ -1791,6 +1792,7 @@ spa_fini(void) vdev_cache_stat_fini(); zil_fini(); dmu_fini(); + lz4_fini(); zio_fini(); range_tree_fini(); unique_fini(); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Tue Feb 18 14:46:39 2014 (r262163) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Tue Feb 18 14:50:31 2014 (r262164) @@ -70,6 +70,8 @@ extern size_t zle_compress(void *src, vo int level); extern int zle_decompress(void *src, void *dst, size_t s_len, size_t d_len, int level); +extern void lz4_init(void); +extern void lz4_fini(void); extern size_t lz4_compress(void *src, void *dst, size_t s_len, size_t d_len, int level); extern int lz4_decompress(void *src, void *dst, size_t s_len, size_t d_len, From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 14:53:37 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AEC0EDF; Tue, 18 Feb 2014 14:53: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 111C61D40; Tue, 18 Feb 2014 14:53:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IErax6095908; Tue, 18 Feb 2014 14:53:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IErael095906; Tue, 18 Feb 2014 14:53:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402181453.s1IErael095906@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Feb 2014 14:53:36 +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: r262165 - in stable/9: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 14:53:37 -0000 Author: mav Date: Tue Feb 18 14:53:36 2014 New Revision: 262165 URL: http://svnweb.freebsd.org/changeset/base/262165 Log: MFC r259168: Don't even try to read vdev labels from devices smaller then SPA_MINDEVSIZE (64MB). Even if we would find one somehow, ZFS kernel code rejects such devices. It is funny to look on attempts to read 4 256K vdev labels from 1.44MB floppy, though it is not very practical and quite slow. Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Directory Properties: stable/9/ (props changed) stable/9/cddl/ (props changed) stable/9/cddl/contrib/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Tue Feb 18 14:50:31 2014 (r262164) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c Tue Feb 18 14:53:36 2014 (r262165) @@ -995,10 +995,10 @@ nozpool_all_slices(avl_tree_t *r, const #endif /* sun */ } +#ifdef sun static void check_slices(avl_tree_t *r, int fd, const char *sname) { -#ifdef sun struct extvtoc vtoc; struct dk_gpt *gpt; char diskname[MAXNAMELEN]; @@ -1028,8 +1028,8 @@ check_slices(avl_tree_t *r, int fd, cons check_one_slice(r, diskname, i, 0, 1); efi_free(gpt); } -#endif /* sun */ } +#endif /* sun */ static void zpool_open_func(void *arg) @@ -1059,6 +1059,7 @@ zpool_open_func(void *arg) return; } /* this file is too small to hold a zpool */ +#ifdef sun if (S_ISREG(statbuf.st_mode) && statbuf.st_size < SPA_MINDEVSIZE) { (void) close(fd); @@ -1070,6 +1071,12 @@ zpool_open_func(void *arg) */ check_slices(rn->rn_avl, fd, rn->rn_name); } +#else /* !sun */ + if (statbuf.st_size < SPA_MINDEVSIZE) { + (void) close(fd); + return; + } +#endif /* sun */ if ((zpool_read_label(fd, &config)) != 0) { (void) close(fd); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 18 14:50:31 2014 (r262164) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Feb 18 14:53:36 2014 (r262165) @@ -370,10 +370,16 @@ vdev_geom_attach_taster(struct g_consume if (pp->flags & G_PF_WITHER) return (EINVAL); - if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize)) - return (EINVAL); g_attach(cp, pp); error = g_access(cp, 1, 0, 0); + if (error == 0) { + if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize)) + error = EINVAL; + else if (pp->mediasize < SPA_MINDEVSIZE) + error = EINVAL; + if (error != 0) + g_access(cp, -1, 0, 0); + } if (error != 0) g_detach(cp); return (error); From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 14:56:45 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C334234; Tue, 18 Feb 2014 14:56: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 76C7C1D77; Tue, 18 Feb 2014 14:56:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IEujJA096428; Tue, 18 Feb 2014 14:56:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IEujgZ096427; Tue, 18 Feb 2014 14:56:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402181456.s1IEujgZ096427@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Feb 2014 14:56: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: r262167 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 14:56:45 -0000 Author: mav Date: Tue Feb 18 14:56:44 2014 New Revision: 262167 URL: http://svnweb.freebsd.org/changeset/base/262167 Log: MFC r260236: In dmu_zfetch_stream_reclaim() replace division with multiplication and move it out of the loop and lock. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Tue Feb 18 14:54:56 2014 (r262166) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Tue Feb 18 14:56:44 2014 (r262167) @@ -604,14 +604,16 @@ static zstream_t * dmu_zfetch_stream_reclaim(zfetch_t *zf) { zstream_t *zs; + clock_t ticks; + ticks = zfetch_min_sec_reap * hz; if (! rw_tryenter(&zf->zf_rwlock, RW_WRITER)) return (0); for (zs = list_head(&zf->zf_stream); zs; zs = list_next(&zf->zf_stream, zs)) { - if (((ddi_get_lbolt() - zs->zst_last)/hz) > zfetch_min_sec_reap) + if (ddi_get_lbolt() - zs->zst_last > ticks) break; } From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 14:58:38 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4A4293C2; Tue, 18 Feb 2014 14:58: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 3529C1DA4; Tue, 18 Feb 2014 14:58:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IEwcK5096679; Tue, 18 Feb 2014 14:58:38 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IEwcHj096678; Tue, 18 Feb 2014 14:58:38 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402181458.s1IEwcHj096678@svn.freebsd.org> From: Alexander Motin Date: Tue, 18 Feb 2014 14:58:38 +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: r262168 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 14:58:38 -0000 Author: mav Date: Tue Feb 18 14:58:37 2014 New Revision: 262168 URL: http://svnweb.freebsd.org/changeset/base/262168 Log: MFC r260236: In dmu_zfetch_stream_reclaim() replace division with multiplication and move it out of the loop and lock. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Tue Feb 18 14:56:44 2014 (r262167) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Tue Feb 18 14:58:37 2014 (r262168) @@ -604,14 +604,16 @@ static zstream_t * dmu_zfetch_stream_reclaim(zfetch_t *zf) { zstream_t *zs; + clock_t ticks; + ticks = zfetch_min_sec_reap * hz; if (! rw_tryenter(&zf->zf_rwlock, RW_WRITER)) return (0); for (zs = list_head(&zf->zf_stream); zs; zs = list_next(&zf->zf_stream, zs)) { - if (((ddi_get_lbolt() - zs->zst_last)/hz) > zfetch_min_sec_reap) + if (ddi_get_lbolt() - zs->zst_last > ticks) break; } From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 15:05:10 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A54B26F7; Tue, 18 Feb 2014 15:05: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8559E1F8D; Tue, 18 Feb 2014 15:05:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IF5Asl000530; Tue, 18 Feb 2014 15:05:10 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IF59dV000526; Tue, 18 Feb 2014 15:05:09 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181505.s1IF59dV000526@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:05:09 +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: r262169 - in stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 15:05:10 -0000 Author: avg Date: Tue Feb 18 15:05:09 2014 New Revision: 262169 URL: http://svnweb.freebsd.org/changeset/base/262169 Log: MFC r254608: Add kstat entries for ZFS compression statistics Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Feb 18 14:58:37 2014 (r262168) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Feb 18 15:05:09 2014 (r262169) @@ -1834,6 +1834,7 @@ dmu_init(void) dnode_init(); dbuf_init(); zfetch_init(); + zio_compress_init(); l2arc_init(); arc_init(); } @@ -1844,6 +1845,7 @@ dmu_fini(void) arc_fini(); /* arc depends on l2arc, so arc must go first */ l2arc_fini(); zfetch_fini(); + zio_compress_fini(); dbuf_fini(); dnode_fini(); dmu_objset_fini(); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Tue Feb 18 14:58:37 2014 (r262168) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Tue Feb 18 15:05:09 2014 (r262169) @@ -83,6 +83,12 @@ extern size_t zio_compress_data(enum zio extern int zio_decompress_data(enum zio_compress c, void *src, void *dst, size_t s_len, size_t d_len); +/* + * Module lifetime management. + */ +extern void zio_compress_init(void); +extern void zio_compress_fini(void); + #ifdef __cplusplus } #endif Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Tue Feb 18 14:58:37 2014 (r262168) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Tue Feb 18 15:05:09 2014 (r262169) @@ -33,10 +33,32 @@ #include #include +#include #include #include #include +typedef struct zcomp_stats { + kstat_named_t zcompstat_attempts; + kstat_named_t zcompstat_empty; + kstat_named_t zcompstat_skipped_minblocksize; + kstat_named_t zcompstat_skipped_insufficient_gain; +} zcomp_stats_t; + +static zcomp_stats_t zcomp_stats = { + { "attempts", KSTAT_DATA_UINT64 }, + { "empty", KSTAT_DATA_UINT64 }, + { "skipped_minblocksize", KSTAT_DATA_UINT64 }, + { "skipped_insufficient_gain", KSTAT_DATA_UINT64 } +}; + +#define ZCOMPSTAT_INCR(stat, val) \ + atomic_add_64(&zcomp_stats.stat.value.ui64, (val)); + +#define ZCOMPSTAT_BUMP(stat) ZCOMPSTAT_INCR(stat, 1); + +kstat_t *zcomp_ksp; + /* * Compression vectors. */ @@ -87,6 +109,8 @@ zio_compress_data(enum zio_compress c, v ASSERT((uint_t)c < ZIO_COMPRESS_FUNCTIONS); ASSERT((uint_t)c == ZIO_COMPRESS_EMPTY || ci->ci_compress != NULL); + ZCOMPSTAT_BUMP(zcompstat_attempts); + /* * If the data is all zeroes, we don't even need to allocate * a block for it. We indicate this by returning zero size. @@ -96,21 +120,27 @@ zio_compress_data(enum zio_compress c, v if (*word != 0) break; - if (word == word_end) - return (0); + if (word == word_end) { + ZCOMPSTAT_BUMP(zcompstat_empty); + return (0); + } if (c == ZIO_COMPRESS_EMPTY) return (s_len); /* Compress at least 12.5% */ d_len = P2ALIGN(s_len - (s_len >> 3), minblocksize); - if (d_len == 0) + if (d_len == 0) { + ZCOMPSTAT_BUMP(zcompstat_skipped_minblocksize); return (s_len); + } c_len = ci->ci_compress(src, dst, s_len, d_len, ci->ci_level); - if (c_len > d_len) + if (c_len > d_len) { + ZCOMPSTAT_BUMP(zcompstat_skipped_insufficient_gain); return (s_len); + } /* * Cool. We compressed at least as much as we were hoping to. @@ -139,3 +169,26 @@ zio_decompress_data(enum zio_compress c, return (ci->ci_decompress(src, dst, s_len, d_len, ci->ci_level)); } + +void +zio_compress_init(void) +{ + + zcomp_ksp = kstat_create("zfs", 0, "zcompstats", "misc", + KSTAT_TYPE_NAMED, sizeof (zcomp_stats) / sizeof (kstat_named_t), + KSTAT_FLAG_VIRTUAL); + + if (zcomp_ksp != NULL) { + zcomp_ksp->ks_data = &zcomp_stats; + kstat_install(zcomp_ksp); + } +} + +void +zio_compress_fini(void) +{ + if (zcomp_ksp != NULL) { + kstat_delete(zcomp_ksp); + zcomp_ksp = NULL; + } +} From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 15:07:26 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0E58B87C; Tue, 18 Feb 2014 15:07: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E1C821FB9; Tue, 18 Feb 2014 15:07:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IF7P2K000816; Tue, 18 Feb 2014 15:07:25 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IF7Pi2000811; Tue, 18 Feb 2014 15:07:25 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181507.s1IF7Pi2000811@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:07: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: r262170 - in stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 15:07:26 -0000 Author: avg Date: Tue Feb 18 15:07:24 2014 New Revision: 262170 URL: http://svnweb.freebsd.org/changeset/base/262170 Log: MFC r254608: Add kstat entries for ZFS compression statistics MFC slacker: gibbs Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Feb 18 15:05:09 2014 (r262169) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Tue Feb 18 15:07:24 2014 (r262170) @@ -1893,6 +1893,7 @@ dmu_init(void) dnode_init(); dbuf_init(); zfetch_init(); + zio_compress_init(); l2arc_init(); arc_init(); } @@ -1903,6 +1904,7 @@ dmu_fini(void) arc_fini(); /* arc depends on l2arc, so arc must go first */ l2arc_fini(); zfetch_fini(); + zio_compress_fini(); dbuf_fini(); dnode_fini(); dmu_objset_fini(); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Tue Feb 18 15:05:09 2014 (r262169) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Tue Feb 18 15:07:24 2014 (r262170) @@ -85,6 +85,12 @@ extern size_t zio_compress_data(enum zio extern int zio_decompress_data(enum zio_compress c, void *src, void *dst, size_t s_len, size_t d_len); +/* + * Module lifetime management. + */ +extern void zio_compress_init(void); +extern void zio_compress_fini(void); + #ifdef __cplusplus } #endif Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Tue Feb 18 15:05:09 2014 (r262169) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c Tue Feb 18 15:07:24 2014 (r262170) @@ -33,10 +33,32 @@ #include #include +#include #include #include #include +typedef struct zcomp_stats { + kstat_named_t zcompstat_attempts; + kstat_named_t zcompstat_empty; + kstat_named_t zcompstat_skipped_minblocksize; + kstat_named_t zcompstat_skipped_insufficient_gain; +} zcomp_stats_t; + +static zcomp_stats_t zcomp_stats = { + { "attempts", KSTAT_DATA_UINT64 }, + { "empty", KSTAT_DATA_UINT64 }, + { "skipped_minblocksize", KSTAT_DATA_UINT64 }, + { "skipped_insufficient_gain", KSTAT_DATA_UINT64 } +}; + +#define ZCOMPSTAT_INCR(stat, val) \ + atomic_add_64(&zcomp_stats.stat.value.ui64, (val)); + +#define ZCOMPSTAT_BUMP(stat) ZCOMPSTAT_INCR(stat, 1); + +kstat_t *zcomp_ksp; + /* * Compression vectors. */ @@ -87,6 +109,8 @@ zio_compress_data(enum zio_compress c, v ASSERT((uint_t)c < ZIO_COMPRESS_FUNCTIONS); ASSERT((uint_t)c == ZIO_COMPRESS_EMPTY || ci->ci_compress != NULL); + ZCOMPSTAT_BUMP(zcompstat_attempts); + /* * If the data is all zeroes, we don't even need to allocate * a block for it. We indicate this by returning zero size. @@ -96,21 +120,27 @@ zio_compress_data(enum zio_compress c, v if (*word != 0) break; - if (word == word_end) - return (0); + if (word == word_end) { + ZCOMPSTAT_BUMP(zcompstat_empty); + return (0); + } if (c == ZIO_COMPRESS_EMPTY) return (s_len); /* Compress at least 12.5% */ d_len = P2ALIGN(s_len - (s_len >> 3), minblocksize); - if (d_len == 0) + if (d_len == 0) { + ZCOMPSTAT_BUMP(zcompstat_skipped_minblocksize); return (s_len); + } c_len = ci->ci_compress(src, dst, s_len, d_len, ci->ci_level); - if (c_len > d_len) + if (c_len > d_len) { + ZCOMPSTAT_BUMP(zcompstat_skipped_insufficient_gain); return (s_len); + } /* * Cool. We compressed at least as much as we were hoping to. @@ -139,3 +169,26 @@ zio_decompress_data(enum zio_compress c, return (ci->ci_decompress(src, dst, s_len, d_len, ci->ci_level)); } + +void +zio_compress_init(void) +{ + + zcomp_ksp = kstat_create("zfs", 0, "zcompstats", "misc", + KSTAT_TYPE_NAMED, sizeof (zcomp_stats) / sizeof (kstat_named_t), + KSTAT_FLAG_VIRTUAL); + + if (zcomp_ksp != NULL) { + zcomp_ksp->ks_data = &zcomp_stats; + kstat_install(zcomp_ksp); + } +} + +void +zio_compress_fini(void) +{ + if (zcomp_ksp != NULL) { + kstat_delete(zcomp_ksp); + zcomp_ksp = NULL; + } +} From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 15:18:09 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ACCA4D1B; Tue, 18 Feb 2014 15:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 88A781128; Tue, 18 Feb 2014 15:18:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFI9of005180; Tue, 18 Feb 2014 15:18:09 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFI9j5005178; Tue, 18 Feb 2014 15:18:09 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181518.s1IFI9j5005178@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:18:09 +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: r262171 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 15:18:09 -0000 Author: avg Date: Tue Feb 18 15:18:08 2014 New Revision: 262171 URL: http://svnweb.freebsd.org/changeset/base/262171 Log: MFC r254757: MFV r254749: 4046 dsl_dataset_t ds_dir->dd_lock is highly contended MFC slacker: delphij Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 15:07:24 2014 (r262170) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 15:18:08 2014 (r262171) @@ -101,9 +101,8 @@ dsl_dataset_block_born(dsl_dataset_t *ds used, compressed, uncompressed); return; } - dmu_buf_will_dirty(ds->ds_dbuf, tx); - mutex_enter(&ds->ds_dir->dd_lock); + 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; @@ -115,7 +114,6 @@ dsl_dataset_block_born(dsl_dataset_t *ds compressed, uncompressed, tx); dsl_dir_transfer_space(ds->ds_dir, used - delta, DD_USED_REFRSRV, DD_USED_HEAD, tx); - mutex_exit(&ds->ds_dir->dd_lock); } int @@ -150,7 +148,6 @@ dsl_dataset_block_kill(dsl_dataset_t *ds dprintf_bp(bp, "freeing ds=%llu", ds->ds_object); dsl_free(tx->tx_pool, tx->tx_txg, bp); - mutex_enter(&ds->ds_dir->dd_lock); mutex_enter(&ds->ds_lock); ASSERT(ds->ds_phys->ds_unique_bytes >= used || !DS_UNIQUE_IS_ACCURATE(ds)); @@ -161,7 +158,6 @@ dsl_dataset_block_kill(dsl_dataset_t *ds delta, -compressed, -uncompressed, tx); dsl_dir_transfer_space(ds->ds_dir, -used - delta, DD_USED_REFRSRV, DD_USED_HEAD, tx); - mutex_exit(&ds->ds_dir->dd_lock); } else { dprintf_bp(bp, "putting on dead list: %s", ""); if (async) { @@ -596,31 +592,6 @@ dsl_dataset_name(dsl_dataset_t *ds, char } } -static int -dsl_dataset_namelen(dsl_dataset_t *ds) -{ - int result; - - if (ds == NULL) { - result = 3; /* "mos" */ - } else { - result = dsl_dir_namelen(ds->ds_dir); - VERIFY0(dsl_dataset_get_snapname(ds)); - if (ds->ds_snapname[0]) { - ++result; /* adding one for the @-sign */ - if (!MUTEX_HELD(&ds->ds_lock)) { - mutex_enter(&ds->ds_lock); - result += strlen(ds->ds_snapname); - mutex_exit(&ds->ds_lock); - } else { - result += strlen(ds->ds_snapname); - } - } - } - - return (result); -} - void dsl_dataset_rele(dsl_dataset_t *ds, void *tag) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Feb 18 15:07:24 2014 (r262170) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Feb 18 15:18:08 2014 (r262171) @@ -836,11 +836,21 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u int64_t used, int64_t compressed, int64_t uncompressed, dmu_tx_t *tx) { int64_t accounted_delta; + + /* + * dsl_dataset_set_refreservation_sync_impl() calls this with + * dd_lock held, so that it can atomically update + * ds->ds_reserved and the dsl_dir accounting, so that + * dsl_dataset_check_quota() can see dataset and dir accounting + * consistently. + */ boolean_t needlock = !MUTEX_HELD(&dd->dd_lock); ASSERT(dmu_tx_is_syncing(tx)); ASSERT(type < DD_USED_NUM); + dmu_buf_will_dirty(dd->dd_dbuf, tx); + if (needlock) mutex_enter(&dd->dd_lock); accounted_delta = parent_delta(dd, dd->dd_phys->dd_used_bytes, used); @@ -849,7 +859,6 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u dd->dd_phys->dd_compressed_bytes >= -compressed); ASSERT(uncompressed >= 0 || dd->dd_phys->dd_uncompressed_bytes >= -uncompressed); - dmu_buf_will_dirty(dd->dd_dbuf, tx); dd->dd_phys->dd_used_bytes += used; dd->dd_phys->dd_uncompressed_bytes += uncompressed; dd->dd_phys->dd_compressed_bytes += compressed; @@ -882,8 +891,6 @@ void dsl_dir_transfer_space(dsl_dir_t *dd, int64_t delta, dd_used_t oldtype, dd_used_t newtype, dmu_tx_t *tx) { - boolean_t needlock = !MUTEX_HELD(&dd->dd_lock); - ASSERT(dmu_tx_is_syncing(tx)); ASSERT(oldtype < DD_USED_NUM); ASSERT(newtype < DD_USED_NUM); @@ -891,17 +898,15 @@ dsl_dir_transfer_space(dsl_dir_t *dd, in if (delta == 0 || !(dd->dd_phys->dd_flags & DD_FLAG_USED_BREAKDOWN)) return; - if (needlock) - mutex_enter(&dd->dd_lock); + dmu_buf_will_dirty(dd->dd_dbuf, tx); + mutex_enter(&dd->dd_lock); ASSERT(delta > 0 ? dd->dd_phys->dd_used_breakdown[oldtype] >= delta : dd->dd_phys->dd_used_breakdown[newtype] >= -delta); ASSERT(dd->dd_phys->dd_used_bytes >= ABS(delta)); - dmu_buf_will_dirty(dd->dd_dbuf, tx); dd->dd_phys->dd_used_breakdown[oldtype] -= delta; dd->dd_phys->dd_used_breakdown[newtype] += delta; - if (needlock) - mutex_exit(&dd->dd_lock); + mutex_exit(&dd->dd_lock); } typedef struct dsl_dir_set_qr_arg { From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 15:18:22 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9E1B9E4C; Tue, 18 Feb 2014 15:18: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7E16E112B; Tue, 18 Feb 2014 15:18:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFIMxL005250; Tue, 18 Feb 2014 15:18:22 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFIMUA005247; Tue, 18 Feb 2014 15:18:22 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181518.s1IFIMUA005247@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:18:22 +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: r262172 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 15:18:22 -0000 Author: avg Date: Tue Feb 18 15:18:21 2014 New Revision: 262172 URL: http://svnweb.freebsd.org/changeset/base/262172 Log: MFC r254757: MFV r254749: 4046 dsl_dataset_t ds_dir->dd_lock is highly contended Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 15:18:08 2014 (r262171) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Tue Feb 18 15:18:21 2014 (r262172) @@ -101,9 +101,8 @@ dsl_dataset_block_born(dsl_dataset_t *ds used, compressed, uncompressed); return; } - dmu_buf_will_dirty(ds->ds_dbuf, tx); - mutex_enter(&ds->ds_dir->dd_lock); + 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; @@ -115,7 +114,6 @@ dsl_dataset_block_born(dsl_dataset_t *ds compressed, uncompressed, tx); dsl_dir_transfer_space(ds->ds_dir, used - delta, DD_USED_REFRSRV, DD_USED_HEAD, tx); - mutex_exit(&ds->ds_dir->dd_lock); } int @@ -150,7 +148,6 @@ dsl_dataset_block_kill(dsl_dataset_t *ds dprintf_bp(bp, "freeing ds=%llu", ds->ds_object); dsl_free(tx->tx_pool, tx->tx_txg, bp); - mutex_enter(&ds->ds_dir->dd_lock); mutex_enter(&ds->ds_lock); ASSERT(ds->ds_phys->ds_unique_bytes >= used || !DS_UNIQUE_IS_ACCURATE(ds)); @@ -161,7 +158,6 @@ dsl_dataset_block_kill(dsl_dataset_t *ds delta, -compressed, -uncompressed, tx); dsl_dir_transfer_space(ds->ds_dir, -used - delta, DD_USED_REFRSRV, DD_USED_HEAD, tx); - mutex_exit(&ds->ds_dir->dd_lock); } else { dprintf_bp(bp, "putting on dead list: %s", ""); if (async) { @@ -596,31 +592,6 @@ dsl_dataset_name(dsl_dataset_t *ds, char } } -static int -dsl_dataset_namelen(dsl_dataset_t *ds) -{ - int result; - - if (ds == NULL) { - result = 3; /* "mos" */ - } else { - result = dsl_dir_namelen(ds->ds_dir); - VERIFY0(dsl_dataset_get_snapname(ds)); - if (ds->ds_snapname[0]) { - ++result; /* adding one for the @-sign */ - if (!MUTEX_HELD(&ds->ds_lock)) { - mutex_enter(&ds->ds_lock); - result += strlen(ds->ds_snapname); - mutex_exit(&ds->ds_lock); - } else { - result += strlen(ds->ds_snapname); - } - } - } - - return (result); -} - void dsl_dataset_rele(dsl_dataset_t *ds, void *tag) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Feb 18 15:18:08 2014 (r262171) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Tue Feb 18 15:18:21 2014 (r262172) @@ -836,11 +836,21 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u int64_t used, int64_t compressed, int64_t uncompressed, dmu_tx_t *tx) { int64_t accounted_delta; + + /* + * dsl_dataset_set_refreservation_sync_impl() calls this with + * dd_lock held, so that it can atomically update + * ds->ds_reserved and the dsl_dir accounting, so that + * dsl_dataset_check_quota() can see dataset and dir accounting + * consistently. + */ boolean_t needlock = !MUTEX_HELD(&dd->dd_lock); ASSERT(dmu_tx_is_syncing(tx)); ASSERT(type < DD_USED_NUM); + dmu_buf_will_dirty(dd->dd_dbuf, tx); + if (needlock) mutex_enter(&dd->dd_lock); accounted_delta = parent_delta(dd, dd->dd_phys->dd_used_bytes, used); @@ -849,7 +859,6 @@ dsl_dir_diduse_space(dsl_dir_t *dd, dd_u dd->dd_phys->dd_compressed_bytes >= -compressed); ASSERT(uncompressed >= 0 || dd->dd_phys->dd_uncompressed_bytes >= -uncompressed); - dmu_buf_will_dirty(dd->dd_dbuf, tx); dd->dd_phys->dd_used_bytes += used; dd->dd_phys->dd_uncompressed_bytes += uncompressed; dd->dd_phys->dd_compressed_bytes += compressed; @@ -882,8 +891,6 @@ void dsl_dir_transfer_space(dsl_dir_t *dd, int64_t delta, dd_used_t oldtype, dd_used_t newtype, dmu_tx_t *tx) { - boolean_t needlock = !MUTEX_HELD(&dd->dd_lock); - ASSERT(dmu_tx_is_syncing(tx)); ASSERT(oldtype < DD_USED_NUM); ASSERT(newtype < DD_USED_NUM); @@ -891,17 +898,15 @@ dsl_dir_transfer_space(dsl_dir_t *dd, in if (delta == 0 || !(dd->dd_phys->dd_flags & DD_FLAG_USED_BREAKDOWN)) return; - if (needlock) - mutex_enter(&dd->dd_lock); + dmu_buf_will_dirty(dd->dd_dbuf, tx); + mutex_enter(&dd->dd_lock); ASSERT(delta > 0 ? dd->dd_phys->dd_used_breakdown[oldtype] >= delta : dd->dd_phys->dd_used_breakdown[newtype] >= -delta); ASSERT(dd->dd_phys->dd_used_bytes >= ABS(delta)); - dmu_buf_will_dirty(dd->dd_dbuf, tx); dd->dd_phys->dd_used_breakdown[oldtype] -= delta; dd->dd_phys->dd_used_breakdown[newtype] += delta; - if (needlock) - mutex_exit(&dd->dd_lock); + mutex_exit(&dd->dd_lock); } typedef struct dsl_dir_set_qr_arg { From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 15:24:49 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D276D557; Tue, 18 Feb 2014 15:24: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BAAB011FD; Tue, 18 Feb 2014 15:24:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFOnn8009230; Tue, 18 Feb 2014 15:24:49 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFOnsh009229; Tue, 18 Feb 2014 15:24:49 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181524.s1IFOnsh009229@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:24: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: r262173 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 15:24:49 -0000 Author: avg Date: Tue Feb 18 15:24:49 2014 New Revision: 262173 URL: http://svnweb.freebsd.org/changeset/base/262173 Log: MFC r256889: Use the vdev's ashift to calculate the supported min block size passed to zio_compress_data Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 18 15:18:21 2014 (r262172) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 18 15:24:49 2014 (r262173) @@ -5196,7 +5196,7 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd len = l2hdr->b_asize; cdata = zio_data_buf_alloc(len); csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr->b_tmp_cdata, - cdata, l2hdr->b_asize, (size_t)SPA_MINBLOCKSIZE); + cdata, l2hdr->b_asize, (size_t)(1ULL << l2hdr->b_dev->l2ad_vdev->vdev_ashift)); if (csize == 0) { /* zero block, indicate that there's nothing to write */ From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 15:25:00 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5D2B7684; Tue, 18 Feb 2014 15: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4792B1200; Tue, 18 Feb 2014 15:25:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFP0w4009294; Tue, 18 Feb 2014 15:25:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFP0Tb009293; Tue, 18 Feb 2014 15:25:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181525.s1IFP0Tb009293@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:25:00 +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: r262174 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 15:25:00 -0000 Author: avg Date: Tue Feb 18 15:24:59 2014 New Revision: 262174 URL: http://svnweb.freebsd.org/changeset/base/262174 Log: MFC r256889: Use the vdev's ashift to calculate the supported min block size passed to zio_compress_data Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 18 15:24:49 2014 (r262173) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 18 15:24:59 2014 (r262174) @@ -5166,7 +5166,7 @@ l2arc_compress_buf(l2arc_buf_hdr_t *l2hd len = l2hdr->b_asize; cdata = zio_data_buf_alloc(len); csize = zio_compress_data(ZIO_COMPRESS_LZ4, l2hdr->b_tmp_cdata, - cdata, l2hdr->b_asize, (size_t)SPA_MINBLOCKSIZE); + cdata, l2hdr->b_asize, (size_t)(1ULL << l2hdr->b_dev->l2ad_vdev->vdev_ashift)); if (csize == 0) { /* zero block, indicate that there's nothing to write */ From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 15:29:54 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BCC493C; Tue, 18 Feb 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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id EB669123C; Tue, 18 Feb 2014 15:29:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFTrda009948; Tue, 18 Feb 2014 15:29:53 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFTrtc009947; Tue, 18 Feb 2014 15:29:53 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181529.s1IFTrtc009947@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:29:53 +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: r262175 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 15:29:54 -0000 Author: avg Date: Tue Feb 18 15:29:53 2014 New Revision: 262175 URL: http://svnweb.freebsd.org/changeset/base/262175 Log: MFC r258294: Fix ZFS deadlock when sending a snapshot which is mounted MFC slacker: smh Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Tue Feb 18 15:24:59 2014 (r262174) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Tue Feb 18 15:29:53 2014 (r262175) @@ -564,21 +564,23 @@ dsl_dataset_user_release_impl(nvlist_t * ddura.ddura_holdfunc = dsl_dataset_hold_obj_string; pool = spa_name(tmpdp->dp_spa); #ifdef _KERNEL - dsl_pool_config_enter(tmpdp, FTAG); for (pair = nvlist_next_nvpair(holds, NULL); pair != NULL; pair = nvlist_next_nvpair(holds, pair)) { dsl_dataset_t *ds; + dsl_pool_config_enter(tmpdp, FTAG); error = dsl_dataset_hold_obj_string(tmpdp, nvpair_name(pair), FTAG, &ds); if (error == 0) { char name[MAXNAMELEN]; dsl_dataset_name(ds, name); + dsl_pool_config_exit(tmpdp, FTAG); dsl_dataset_rele(ds, FTAG); (void) zfs_unmount_snap(name); + } else { + dsl_pool_config_exit(tmpdp, FTAG); } } - dsl_pool_config_exit(tmpdp, FTAG); #endif } else { /* Non-temporary holds are specified by name. */ From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 15:30:12 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 06852AEC; Tue, 18 Feb 2014 15:30:12 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E623B1249; Tue, 18 Feb 2014 15:30:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFUBES010543; Tue, 18 Feb 2014 15:30:11 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFUBke010542; Tue, 18 Feb 2014 15:30:11 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181530.s1IFUBke010542@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:30:11 +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: r262176 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 15:30:12 -0000 Author: avg Date: Tue Feb 18 15:30:11 2014 New Revision: 262176 URL: http://svnweb.freebsd.org/changeset/base/262176 Log: MFC r258294: Fix ZFS deadlock when sending a snapshot which is mounted Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Tue Feb 18 15:29:53 2014 (r262175) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Tue Feb 18 15:30:11 2014 (r262176) @@ -564,21 +564,23 @@ dsl_dataset_user_release_impl(nvlist_t * ddura.ddura_holdfunc = dsl_dataset_hold_obj_string; pool = spa_name(tmpdp->dp_spa); #ifdef _KERNEL - dsl_pool_config_enter(tmpdp, FTAG); for (pair = nvlist_next_nvpair(holds, NULL); pair != NULL; pair = nvlist_next_nvpair(holds, pair)) { dsl_dataset_t *ds; + dsl_pool_config_enter(tmpdp, FTAG); error = dsl_dataset_hold_obj_string(tmpdp, nvpair_name(pair), FTAG, &ds); if (error == 0) { char name[MAXNAMELEN]; dsl_dataset_name(ds, name); + dsl_pool_config_exit(tmpdp, FTAG); dsl_dataset_rele(ds, FTAG); (void) zfs_unmount_snap(name); + } else { + dsl_pool_config_exit(tmpdp, FTAG); } } - dsl_pool_config_exit(tmpdp, FTAG); #endif } else { /* Non-temporary holds are specified by name. */ From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 15:38:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 938FBFF5; Tue, 18 Feb 2014 15:38: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F5CA1332; Tue, 18 Feb 2014 15:38:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFchlx013949; Tue, 18 Feb 2014 15:38:43 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFchhf013948; Tue, 18 Feb 2014 15:38:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181538.s1IFchhf013948@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:38:43 +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: r262177 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 15:38:43 -0000 Author: avg Date: Tue Feb 18 15:38:43 2014 New Revision: 262177 URL: http://svnweb.freebsd.org/changeset/base/262177 Log: MFC r259052: Expose spa_asize_inflation Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 15:30:11 2014 (r262176) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 15:38:43 2014 (r262177) @@ -304,6 +304,9 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_e * (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2 == 24 */ int spa_asize_inflation = 24; +TUNABLE_INT("vfs.zfs.spa_asize_inflation", &spa_asize_inflation); +SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN, + &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes"); #ifndef illumos #ifdef _KERNEL From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 15:38:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 039D0149; Tue, 18 Feb 2014 15:38: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E37171333; Tue, 18 Feb 2014 15:38:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFcoVX013999; Tue, 18 Feb 2014 15:38:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFcoKT013998; Tue, 18 Feb 2014 15:38:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181538.s1IFcoKT013998@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:38:50 +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: r262178 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 15:38:51 -0000 Author: avg Date: Tue Feb 18 15:38:50 2014 New Revision: 262178 URL: http://svnweb.freebsd.org/changeset/base/262178 Log: MFC r259052: Expose spa_asize_inflation Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 15:38:43 2014 (r262177) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 15:38:50 2014 (r262178) @@ -304,6 +304,9 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_e * (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2 == 24 */ int spa_asize_inflation = 24; +TUNABLE_INT("vfs.zfs.spa_asize_inflation", &spa_asize_inflation); +SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN, + &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes"); #ifndef illumos #ifdef _KERNEL From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 15:40:00 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8347C2E8; Tue, 18 Feb 2014 15:40: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6EAB41348; Tue, 18 Feb 2014 15:40:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFe0w1014219; Tue, 18 Feb 2014 15:40:00 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFe0p5014217; Tue, 18 Feb 2014 15:40:00 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181540.s1IFe0p5014217@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:40:00 +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: r262179 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 15:40:00 -0000 Author: avg Date: Tue Feb 18 15:39:59 2014 New Revision: 262179 URL: http://svnweb.freebsd.org/changeset/base/262179 Log: MFC r259052: Expose spa_asize_inflation 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 Tue Feb 18 15:38:50 2014 (r262178) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Tue Feb 18 15:39:59 2014 (r262179) @@ -304,6 +304,9 @@ SYSCTL_INT(_vfs_zfs, OID_AUTO, deadman_e * (VDEV_RAIDZ_MAXPARITY + 1) * SPA_DVAS_PER_BP * 2 == 24 */ int spa_asize_inflation = 24; +TUNABLE_INT("vfs.zfs.spa_asize_inflation", &spa_asize_inflation); +SYSCTL_INT(_vfs_zfs, OID_AUTO, spa_asize_inflation, CTLFLAG_RWTUN, + &spa_asize_inflation, 0, "Worst case inflation factor for single sector writes"); #ifndef illumos #ifdef _KERNEL From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 15:45:03 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60A995E3; Tue, 18 Feb 2014 15:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4A52E13E5; Tue, 18 Feb 2014 15:45:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFj3Hx017613; Tue, 18 Feb 2014 15:45:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFj3O0017612; Tue, 18 Feb 2014 15:45:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181545.s1IFj3O0017612@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:45: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: r262180 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 15:45:03 -0000 Author: avg Date: Tue Feb 18 15:45:02 2014 New Revision: 262180 URL: http://svnweb.freebsd.org/changeset/base/262180 Log: MFC r259576: MFV r258923: 4188 assertion failed in dmu_tx_hold_free(): dn_datablkshift != 0 Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Tue Feb 18 15:39:59 2014 (r262179) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Tue Feb 18 15:45:02 2014 (r262180) @@ -636,9 +636,16 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t uint64_t start = off >> shift; uint64_t end = (off + len) >> shift; - ASSERT(dn->dn_datablkshift != 0); ASSERT(dn->dn_indblkshift != 0); + /* + * dnode_reallocate() can result in an object with indirect + * blocks having an odd data block size. In this case, + * just check the single block. + */ + if (dn->dn_datablkshift == 0) + start = end = 0; + zio = zio_root(tx->tx_pool->dp_spa, NULL, NULL, ZIO_FLAG_CANFAIL); for (uint64_t i = start; i <= end; i++) { From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 15:45:16 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F3383718; Tue, 18 Feb 2014 15:45: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DBED1141A; Tue, 18 Feb 2014 15:45:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IFjFqp017677; Tue, 18 Feb 2014 15:45:15 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IFjFwY017676; Tue, 18 Feb 2014 15:45:15 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201402181545.s1IFjFwY017676@svn.freebsd.org> From: Andriy Gapon Date: Tue, 18 Feb 2014 15:45:15 +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: r262181 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 15:45:16 -0000 Author: avg Date: Tue Feb 18 15:45:15 2014 New Revision: 262181 URL: http://svnweb.freebsd.org/changeset/base/262181 Log: MFC r259576: MFV r258923: 4188 assertion failed in dmu_tx_hold_free(): dn_datablkshift != 0 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Tue Feb 18 15:45:02 2014 (r262180) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Tue Feb 18 15:45:15 2014 (r262181) @@ -636,9 +636,16 @@ dmu_tx_hold_free(dmu_tx_t *tx, uint64_t uint64_t start = off >> shift; uint64_t end = (off + len) >> shift; - ASSERT(dn->dn_datablkshift != 0); ASSERT(dn->dn_indblkshift != 0); + /* + * dnode_reallocate() can result in an object with indirect + * blocks having an odd data block size. In this case, + * just check the single block. + */ + if (dn->dn_datablkshift == 0) + start = end = 0; + zio = zio_root(tx->tx_pool->dp_spa, NULL, NULL, ZIO_FLAG_CANFAIL); for (uint64_t i = start; i <= end; i++) { From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 20:16:33 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F14E8FD; Tue, 18 Feb 2014 20:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id C23FA1FFC; Tue, 18 Feb 2014 20:16:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IKGW4x027966; Tue, 18 Feb 2014 20:16:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IKGW3U027965; Tue, 18 Feb 2014 20:16:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402182016.s1IKGW3U027965@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 20:16: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: r262190 - in stable: 10/share/man/man3 8/share/man/man3 9/share/man/man3 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 20:16:33 -0000 Author: jhb Date: Tue Feb 18 20:16:32 2014 New Revision: 262190 URL: http://svnweb.freebsd.org/changeset/base/262190 Log: MFC 261518: - Update a few places to account for va_copy(). - Create a separate 'return values' section and move some statements about return values to that section. - Note that each invocation of va_start() and va_copy() must be paired with va_end() in the same function. Modified: stable/10/share/man/man3/stdarg.3 Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/share/man/man3/stdarg.3 stable/9/share/man/man3/stdarg.3 Directory Properties: stable/8/share/man/man3/ (props changed) stable/9/share/man/man3/ (props changed) Modified: stable/10/share/man/man3/stdarg.3 ============================================================================== --- stable/10/share/man/man3/stdarg.3 Tue Feb 18 19:58:01 2014 (r262189) +++ stable/10/share/man/man3/stdarg.3 Tue Feb 18 20:16:32 2014 (r262190) @@ -59,7 +59,7 @@ The include file .In stdarg.h declares a type .Pq Em va_list -and defines three macros for stepping +and defines four macros for stepping through a list of arguments whose number and types are not known to the called function. .Pp @@ -77,7 +77,8 @@ The macro initializes .Fa ap for subsequent use by -.Fn va_arg +.Fn va_arg , +.Fn va_copy , and .Fn va_end , and must be called first. @@ -93,10 +94,6 @@ macro, it should not be declared as a re function or an array type. .Pp The -.Fn va_start -macro returns no value. -.Pp -The .Fn va_arg macro expands to an expression that has the type and value of the next argument in the call. @@ -105,7 +102,9 @@ The parameter is the .Em va_list Fa ap initialized by -.Fn va_start . +.Fn va_start +or +.Fn va_copy . Each call to .Fn va_arg modifies @@ -152,18 +151,28 @@ the same number of times as called with .Fa src . .Pp The -.Fn va_copy -macro returns no value. +.Fn va_end +macro cleans up any state associated with the variable argument list +.Fa ap . .Pp -The +Each invocation of +.Fn va_start +or +.Fn va_copy +must be paired with a corresponding invocation of .Fn va_end -macro handles a normal return from the function whose variable argument -list was initialized by -.Fn va_start . +in the same function. +.Sh RETURN VALUES +The +.Fn va_arg +macro returns the value of the next argument. .Pp The +.Fn va_start , +.Fn va_copy , +and .Fn va_end -macro returns no value. +macros return no value. .Sh EXAMPLES The function .Em foo From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 20:16:33 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A293DFF; Tue, 18 Feb 2014 20:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 724431FFE; Tue, 18 Feb 2014 20:16:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IKGX8x027980; Tue, 18 Feb 2014 20:16:33 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IKGXMB027979; Tue, 18 Feb 2014 20:16:33 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402182016.s1IKGXMB027979@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 20:16:33 +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: r262190 - in stable: 10/share/man/man3 8/share/man/man3 9/share/man/man3 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 20:16:33 -0000 Author: jhb Date: Tue Feb 18 20:16:32 2014 New Revision: 262190 URL: http://svnweb.freebsd.org/changeset/base/262190 Log: MFC 261518: - Update a few places to account for va_copy(). - Create a separate 'return values' section and move some statements about return values to that section. - Note that each invocation of va_start() and va_copy() must be paired with va_end() in the same function. Modified: stable/9/share/man/man3/stdarg.3 Directory Properties: stable/9/share/man/man3/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man3/stdarg.3 stable/8/share/man/man3/stdarg.3 Directory Properties: stable/10/ (props changed) stable/8/share/man/man3/ (props changed) Modified: stable/9/share/man/man3/stdarg.3 ============================================================================== --- stable/9/share/man/man3/stdarg.3 Tue Feb 18 19:58:01 2014 (r262189) +++ stable/9/share/man/man3/stdarg.3 Tue Feb 18 20:16:32 2014 (r262190) @@ -59,7 +59,7 @@ The include file .In stdarg.h declares a type .Pq Em va_list -and defines three macros for stepping +and defines four macros for stepping through a list of arguments whose number and types are not known to the called function. .Pp @@ -77,7 +77,8 @@ The macro initializes .Fa ap for subsequent use by -.Fn va_arg +.Fn va_arg , +.Fn va_copy , and .Fn va_end , and must be called first. @@ -93,10 +94,6 @@ macro, it should not be declared as a re function or an array type. .Pp The -.Fn va_start -macro returns no value. -.Pp -The .Fn va_arg macro expands to an expression that has the type and value of the next argument in the call. @@ -105,7 +102,9 @@ The parameter is the .Em va_list Fa ap initialized by -.Fn va_start . +.Fn va_start +or +.Fn va_copy . Each call to .Fn va_arg modifies @@ -152,18 +151,28 @@ the same number of times as called with .Fa src . .Pp The -.Fn va_copy -macro returns no value. +.Fn va_end +macro cleans up any state associated with the variable argument list +.Fa ap . .Pp -The +Each invocation of +.Fn va_start +or +.Fn va_copy +must be paired with a corresponding invocation of .Fn va_end -macro handles a normal return from the function whose variable argument -list was initialized by -.Fn va_start . +in the same function. +.Sh RETURN VALUES +The +.Fn va_arg +macro returns the value of the next argument. .Pp The +.Fn va_start , +.Fn va_copy , +and .Fn va_end -macro returns no value. +macros return no value. .Sh EXAMPLES The function .Em foo From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 20:16:33 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4D7BCFE; Tue, 18 Feb 2014 20:16: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1E1621FFD; Tue, 18 Feb 2014 20:16:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IKGW6V027974; Tue, 18 Feb 2014 20:16:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IKGWBv027973; Tue, 18 Feb 2014 20:16:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402182016.s1IKGWBv027973@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 20:16:32 +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: r262190 - in stable: 10/share/man/man3 8/share/man/man3 9/share/man/man3 X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 20:16:33 -0000 Author: jhb Date: Tue Feb 18 20:16:32 2014 New Revision: 262190 URL: http://svnweb.freebsd.org/changeset/base/262190 Log: MFC 261518: - Update a few places to account for va_copy(). - Create a separate 'return values' section and move some statements about return values to that section. - Note that each invocation of va_start() and va_copy() must be paired with va_end() in the same function. Modified: stable/8/share/man/man3/stdarg.3 Directory Properties: stable/8/share/man/man3/ (props changed) Changes in other areas also in this revision: Modified: stable/10/share/man/man3/stdarg.3 stable/9/share/man/man3/stdarg.3 Directory Properties: stable/10/ (props changed) stable/9/share/man/man3/ (props changed) Modified: stable/8/share/man/man3/stdarg.3 ============================================================================== --- stable/8/share/man/man3/stdarg.3 Tue Feb 18 19:58:01 2014 (r262189) +++ stable/8/share/man/man3/stdarg.3 Tue Feb 18 20:16:32 2014 (r262190) @@ -59,7 +59,7 @@ The include file .In stdarg.h declares a type .Pq Em va_list -and defines three macros for stepping +and defines four macros for stepping through a list of arguments whose number and types are not known to the called function. .Pp @@ -77,7 +77,8 @@ The macro initializes .Fa ap for subsequent use by -.Fn va_arg +.Fn va_arg , +.Fn va_copy , and .Fn va_end , and must be called first. @@ -93,10 +94,6 @@ macro, it should not be declared as a re function or an array type. .Pp The -.Fn va_start -macro returns no value. -.Pp -The .Fn va_arg macro expands to an expression that has the type and value of the next argument in the call. @@ -105,7 +102,9 @@ The parameter is the .Em va_list Fa ap initialized by -.Fn va_start . +.Fn va_start +or +.Fn va_copy . Each call to .Fn va_arg modifies @@ -152,18 +151,28 @@ the same number of times as called with .Fa src . .Pp The -.Fn va_copy -macro returns no value. +.Fn va_end +macro cleans up any state associated with the variable argument list +.Fa ap . .Pp -The +Each invocation of +.Fn va_start +or +.Fn va_copy +must be paired with a corresponding invocation of .Fn va_end -macro handles a normal return from the function whose variable argument -list was initialized by -.Fn va_start . +in the same function. +.Sh RETURN VALUES +The +.Fn va_arg +macro returns the value of the next argument. .Pp The +.Fn va_start , +.Fn va_copy , +and .Fn va_end -macro returns no value. +macros return no value. .Sh EXAMPLES The function .Em foo From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 20:27:22 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B0B8A9DA; Tue, 18 Feb 2014 20:27: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9836A1112; Tue, 18 Feb 2014 20:27:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IKRMoV032170; Tue, 18 Feb 2014 20:27:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IKRIKM032140; Tue, 18 Feb 2014 20:27:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402182027.s1IKRIKM032140@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 20:27: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: r262192 - in stable: 10/sbin/hastd 10/sys/amd64/include 10/sys/boot/i386/cdboot 10/sys/boot/i386/pxeldr 10/sys/dev/pci 10/sys/i386/include 10/sys/kern 10/sys/sys 10/sys/x86/acpica 10/sy... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 20:27:22 -0000 Author: jhb Date: Tue Feb 18 20:27:17 2014 New Revision: 262192 URL: http://svnweb.freebsd.org/changeset/base/262192 Log: MFC 261517,261520: Convert the license on files where I am the sole copyright holder to 2 clause BSD licenses. Modified: stable/10/sbin/hastd/refcnt.h stable/10/sys/amd64/include/apicvar.h stable/10/sys/boot/i386/cdboot/cdboot.S stable/10/sys/boot/i386/pxeldr/pxeldr.S stable/10/sys/dev/pci/vga_pci.c stable/10/sys/i386/include/apicvar.h stable/10/sys/kern/kern_ktr.c stable/10/sys/kern/kern_rwlock.c stable/10/sys/kern/subr_lock.c stable/10/sys/kern/subr_sleepqueue.c stable/10/sys/kern/subr_smp.c stable/10/sys/sys/_rwlock.h stable/10/sys/sys/refcount.h stable/10/sys/sys/rwlock.h stable/10/sys/sys/sleepqueue.h stable/10/sys/sys/turnstile.h stable/10/sys/x86/acpica/madt.c stable/10/sys/x86/isa/atpic.c stable/10/sys/x86/isa/elcr.c stable/10/sys/x86/x86/intr_machdep.c stable/10/sys/x86/x86/io_apic.c stable/10/sys/x86/x86/mptable_pci.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sbin/hastd/refcnt.h stable/9/sys/amd64/include/apicvar.h stable/9/sys/boot/i386/cdboot/cdboot.S stable/9/sys/boot/i386/pxeldr/pxeldr.S stable/9/sys/dev/pci/vga_pci.c stable/9/sys/i386/include/apicvar.h stable/9/sys/kern/kern_ktr.c stable/9/sys/kern/kern_rwlock.c stable/9/sys/kern/subr_lock.c stable/9/sys/kern/subr_sleepqueue.c stable/9/sys/kern/subr_smp.c stable/9/sys/sys/_rwlock.h stable/9/sys/sys/refcount.h stable/9/sys/sys/rwlock.h stable/9/sys/sys/sleepqueue.h stable/9/sys/sys/turnstile.h stable/9/sys/x86/acpica/madt.c stable/9/sys/x86/isa/atpic.c stable/9/sys/x86/isa/elcr.c stable/9/sys/x86/x86/intr_machdep.c stable/9/sys/x86/x86/io_apic.c stable/9/sys/x86/x86/mptable_pci.c Directory Properties: stable/9/sbin/hastd/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/10/sbin/hastd/refcnt.h ============================================================================== --- stable/10/sbin/hastd/refcnt.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sbin/hastd/refcnt.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/amd64/include/apicvar.h ============================================================================== --- stable/10/sys/amd64/include/apicvar.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/amd64/include/apicvar.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/boot/i386/cdboot/cdboot.S ============================================================================== --- stable/10/sys/boot/i386/cdboot/cdboot.S Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/boot/i386/cdboot/cdboot.S Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ # 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. -# 3. Neither the name of the author nor the names of any co-contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/boot/i386/pxeldr/pxeldr.S ============================================================================== --- stable/10/sys/boot/i386/pxeldr/pxeldr.S Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/boot/i386/pxeldr/pxeldr.S Tue Feb 18 20:27:17 2014 (r262192) @@ -2,15 +2,26 @@ * Copyright (c) 2000 John Baldwin * All rights reserved. * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. + * 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 "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. + * 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$ */ Modified: stable/10/sys/dev/pci/vga_pci.c ============================================================================== --- stable/10/sys/dev/pci/vga_pci.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/dev/pci/vga_pci.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/i386/include/apicvar.h ============================================================================== --- stable/10/sys/i386/include/apicvar.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/i386/include/apicvar.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/kern/kern_ktr.c ============================================================================== --- stable/10/sys/kern/kern_ktr.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/kern/kern_ktr.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/kern/kern_rwlock.c ============================================================================== --- stable/10/sys/kern/kern_rwlock.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/kern/kern_rwlock.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/kern/subr_lock.c ============================================================================== --- stable/10/sys/kern/subr_lock.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/kern/subr_lock.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/kern/subr_sleepqueue.c ============================================================================== --- stable/10/sys/kern/subr_sleepqueue.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/kern/subr_sleepqueue.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/kern/subr_smp.c ============================================================================== --- stable/10/sys/kern/subr_smp.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/kern/subr_smp.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/sys/_rwlock.h ============================================================================== --- stable/10/sys/sys/_rwlock.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/sys/_rwlock.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/sys/refcount.h ============================================================================== --- stable/10/sys/sys/refcount.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/sys/refcount.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/sys/rwlock.h ============================================================================== --- stable/10/sys/sys/rwlock.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/sys/rwlock.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/sys/sleepqueue.h ============================================================================== --- stable/10/sys/sys/sleepqueue.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/sys/sleepqueue.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/sys/turnstile.h ============================================================================== --- stable/10/sys/sys/turnstile.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/sys/turnstile.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/x86/acpica/madt.c ============================================================================== --- stable/10/sys/x86/acpica/madt.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/x86/acpica/madt.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/x86/isa/atpic.c ============================================================================== --- stable/10/sys/x86/isa/atpic.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/x86/isa/atpic.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/x86/isa/elcr.c ============================================================================== --- stable/10/sys/x86/isa/elcr.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/x86/isa/elcr.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/x86/x86/intr_machdep.c ============================================================================== --- stable/10/sys/x86/x86/intr_machdep.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/x86/x86/intr_machdep.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/x86/x86/io_apic.c ============================================================================== --- stable/10/sys/x86/x86/io_apic.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/x86/x86/io_apic.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/10/sys/x86/x86/mptable_pci.c ============================================================================== --- stable/10/sys/x86/x86/mptable_pci.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/10/sys/x86/x86/mptable_pci.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE From owner-svn-src-stable@FreeBSD.ORG Tue Feb 18 20:27:27 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69CEF9DE; Tue, 18 Feb 2014 20:27: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5186B1114; Tue, 18 Feb 2014 20:27:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1IKRRJ8032203; Tue, 18 Feb 2014 20:27:27 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1IKRMFm032175; Tue, 18 Feb 2014 20:27:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402182027.s1IKRMFm032175@svn.freebsd.org> From: John Baldwin Date: Tue, 18 Feb 2014 20:27:22 +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: r262192 - in stable: 10/sbin/hastd 10/sys/amd64/include 10/sys/boot/i386/cdboot 10/sys/boot/i386/pxeldr 10/sys/dev/pci 10/sys/i386/include 10/sys/kern 10/sys/sys 10/sys/x86/acpica 10/sy... X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Feb 2014 20:27:27 -0000 Author: jhb Date: Tue Feb 18 20:27:17 2014 New Revision: 262192 URL: http://svnweb.freebsd.org/changeset/base/262192 Log: MFC 261517,261520: Convert the license on files where I am the sole copyright holder to 2 clause BSD licenses. Modified: stable/9/sbin/hastd/refcnt.h stable/9/sys/amd64/include/apicvar.h stable/9/sys/boot/i386/cdboot/cdboot.S stable/9/sys/boot/i386/pxeldr/pxeldr.S stable/9/sys/dev/pci/vga_pci.c stable/9/sys/i386/include/apicvar.h stable/9/sys/kern/kern_ktr.c stable/9/sys/kern/kern_rwlock.c stable/9/sys/kern/subr_lock.c stable/9/sys/kern/subr_sleepqueue.c stable/9/sys/kern/subr_smp.c stable/9/sys/sys/_rwlock.h stable/9/sys/sys/refcount.h stable/9/sys/sys/rwlock.h stable/9/sys/sys/sleepqueue.h stable/9/sys/sys/turnstile.h stable/9/sys/x86/acpica/madt.c stable/9/sys/x86/isa/atpic.c stable/9/sys/x86/isa/elcr.c stable/9/sys/x86/x86/intr_machdep.c stable/9/sys/x86/x86/io_apic.c stable/9/sys/x86/x86/mptable_pci.c Directory Properties: stable/9/sbin/hastd/ (props changed) stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sbin/hastd/refcnt.h stable/10/sys/amd64/include/apicvar.h stable/10/sys/boot/i386/cdboot/cdboot.S stable/10/sys/boot/i386/pxeldr/pxeldr.S stable/10/sys/dev/pci/vga_pci.c stable/10/sys/i386/include/apicvar.h stable/10/sys/kern/kern_ktr.c stable/10/sys/kern/kern_rwlock.c stable/10/sys/kern/subr_lock.c stable/10/sys/kern/subr_sleepqueue.c stable/10/sys/kern/subr_smp.c stable/10/sys/sys/_rwlock.h stable/10/sys/sys/refcount.h stable/10/sys/sys/rwlock.h stable/10/sys/sys/sleepqueue.h stable/10/sys/sys/turnstile.h stable/10/sys/x86/acpica/madt.c stable/10/sys/x86/isa/atpic.c stable/10/sys/x86/isa/elcr.c stable/10/sys/x86/x86/intr_machdep.c stable/10/sys/x86/x86/io_apic.c stable/10/sys/x86/x86/mptable_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sbin/hastd/refcnt.h ============================================================================== --- stable/9/sbin/hastd/refcnt.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sbin/hastd/refcnt.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/amd64/include/apicvar.h ============================================================================== --- stable/9/sys/amd64/include/apicvar.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/amd64/include/apicvar.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/boot/i386/cdboot/cdboot.S ============================================================================== --- stable/9/sys/boot/i386/cdboot/cdboot.S Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/boot/i386/cdboot/cdboot.S Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ # 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. -# 3. Neither the name of the author nor the names of any co-contributors -# may be used to endorse or promote products derived from this software -# without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/boot/i386/pxeldr/pxeldr.S ============================================================================== --- stable/9/sys/boot/i386/pxeldr/pxeldr.S Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/boot/i386/pxeldr/pxeldr.S Tue Feb 18 20:27:17 2014 (r262192) @@ -2,15 +2,26 @@ * Copyright (c) 2000 John Baldwin * All rights reserved. * - * Redistribution and use in source and binary forms are freely - * permitted provided that the above copyright notice and this - * paragraph and the following disclaimer are duplicated in all - * such forms. + * 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 "AS IS" and without any express or - * implied warranties, including, without limitation, the implied - * warranties of merchantability and fitness for a particular - * purpose. + * 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$ */ Modified: stable/9/sys/dev/pci/vga_pci.c ============================================================================== --- stable/9/sys/dev/pci/vga_pci.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/dev/pci/vga_pci.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/i386/include/apicvar.h ============================================================================== --- stable/9/sys/i386/include/apicvar.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/i386/include/apicvar.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/kern/kern_ktr.c ============================================================================== --- stable/9/sys/kern/kern_ktr.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/kern/kern_ktr.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/kern/kern_rwlock.c ============================================================================== --- stable/9/sys/kern/kern_rwlock.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/kern/kern_rwlock.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/kern/subr_lock.c ============================================================================== --- stable/9/sys/kern/subr_lock.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/kern/subr_lock.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/kern/subr_sleepqueue.c ============================================================================== --- stable/9/sys/kern/subr_sleepqueue.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/kern/subr_sleepqueue.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/kern/subr_smp.c ============================================================================== --- stable/9/sys/kern/subr_smp.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/kern/subr_smp.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/sys/_rwlock.h ============================================================================== --- stable/9/sys/sys/_rwlock.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/sys/_rwlock.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/sys/refcount.h ============================================================================== --- stable/9/sys/sys/refcount.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/sys/refcount.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/sys/rwlock.h ============================================================================== --- stable/9/sys/sys/rwlock.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/sys/rwlock.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/sys/sleepqueue.h ============================================================================== --- stable/9/sys/sys/sleepqueue.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/sys/sleepqueue.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/sys/turnstile.h ============================================================================== --- stable/9/sys/sys/turnstile.h Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/sys/turnstile.h Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/x86/acpica/madt.c ============================================================================== --- stable/9/sys/x86/acpica/madt.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/x86/acpica/madt.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/x86/isa/atpic.c ============================================================================== --- stable/9/sys/x86/isa/atpic.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/x86/isa/atpic.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/x86/isa/elcr.c ============================================================================== --- stable/9/sys/x86/isa/elcr.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/x86/isa/elcr.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/x86/x86/intr_machdep.c ============================================================================== --- stable/9/sys/x86/x86/intr_machdep.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/x86/x86/intr_machdep.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/x86/x86/io_apic.c ============================================================================== --- stable/9/sys/x86/x86/io_apic.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/x86/x86/io_apic.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE Modified: stable/9/sys/x86/x86/mptable_pci.c ============================================================================== --- stable/9/sys/x86/x86/mptable_pci.c Tue Feb 18 20:25:02 2014 (r262191) +++ stable/9/sys/x86/x86/mptable_pci.c Tue Feb 18 20:27:17 2014 (r262192) @@ -10,9 +10,6 @@ * 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. - * 3. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 07:51:59 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 89161C32; Wed, 19 Feb 2014 07:51: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 593FF15F5; Wed, 19 Feb 2014 07:51:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J7pxJJ007613; Wed, 19 Feb 2014 07:51:59 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J7pxiN007610; Wed, 19 Feb 2014 07:51:59 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402190751.s1J7pxiN007610@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Feb 2014 07:51:58 +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: r262210 - in stable: 10/sys/netpfil/ipfw 9/sys/netpfil/ipfw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 07:51:59 -0000 Author: dim Date: Wed Feb 19 07:51:58 2014 New Revision: 262210 URL: http://svnweb.freebsd.org/changeset/base/262210 Log: MFC r261915: Under sys/netpfil/ipfw, surround two IPv6-specific static functions with #ifdef INET6, since they are unused when INET6 is disabled. Modified: stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c stable/9/sys/netpfil/ipfw/ip_fw_table.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/netpfil/ipfw/ip_fw_dynamic.c stable/10/sys/netpfil/ipfw/ip_fw_table.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 19 07:09:14 2014 (r262209) +++ stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 19 07:51:58 2014 (r262210) @@ -231,6 +231,7 @@ SYSEND #endif /* SYSCTL_NODE */ +#ifdef INET6 static __inline int hash_packet6(struct ipfw_flow_id *id) { @@ -242,6 +243,7 @@ hash_packet6(struct ipfw_flow_id *id) (id->dst_port) ^ (id->src_port); return i; } +#endif /* * IMPORTANT: the hash function for dynamic rules must be commutative Modified: stable/9/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- stable/9/sys/netpfil/ipfw/ip_fw_table.c Wed Feb 19 07:09:14 2014 (r262209) +++ stable/9/sys/netpfil/ipfw/ip_fw_table.c Wed Feb 19 07:51:58 2014 (r262210) @@ -123,6 +123,7 @@ struct table_xentry { #define OFF_LEN_IFACE (8 * offsetof(struct xaddr_iface, ifname)) +#ifdef INET6 static inline void ipv6_writemask(struct in6_addr *addr6, uint8_t mask) { @@ -132,6 +133,7 @@ ipv6_writemask(struct in6_addr *addr6, u *cp++ = 0xFFFFFFFF; *cp = htonl(mask ? ~((1 << (32 - mask)) - 1) : 0); } +#endif int ipfw_add_table_entry(struct ip_fw_chain *ch, uint16_t tbl, void *paddr, From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 07:52:00 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 19B64C33; Wed, 19 Feb 2014 07:52: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id DF3A815F6; Wed, 19 Feb 2014 07:51:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J7pxhF007624; Wed, 19 Feb 2014 07:51:59 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J7pxgo007620; Wed, 19 Feb 2014 07:51:59 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402190751.s1J7pxgo007620@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Feb 2014 07:51:59 +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: r262210 - in stable: 10/sys/netpfil/ipfw 9/sys/netpfil/ipfw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 07:52:00 -0000 Author: dim Date: Wed Feb 19 07:51:58 2014 New Revision: 262210 URL: http://svnweb.freebsd.org/changeset/base/262210 Log: MFC r261915: Under sys/netpfil/ipfw, surround two IPv6-specific static functions with #ifdef INET6, since they are unused when INET6 is disabled. Modified: stable/10/sys/netpfil/ipfw/ip_fw_dynamic.c stable/10/sys/netpfil/ipfw/ip_fw_table.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/netpfil/ipfw/ip_fw_dynamic.c stable/9/sys/netpfil/ipfw/ip_fw_table.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/netpfil/ipfw/ip_fw_dynamic.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 19 07:09:14 2014 (r262209) +++ stable/10/sys/netpfil/ipfw/ip_fw_dynamic.c Wed Feb 19 07:51:58 2014 (r262210) @@ -231,6 +231,7 @@ SYSEND #endif /* SYSCTL_NODE */ +#ifdef INET6 static __inline int hash_packet6(struct ipfw_flow_id *id) { @@ -242,6 +243,7 @@ hash_packet6(struct ipfw_flow_id *id) (id->dst_port) ^ (id->src_port); return i; } +#endif /* * IMPORTANT: the hash function for dynamic rules must be commutative Modified: stable/10/sys/netpfil/ipfw/ip_fw_table.c ============================================================================== --- stable/10/sys/netpfil/ipfw/ip_fw_table.c Wed Feb 19 07:09:14 2014 (r262209) +++ stable/10/sys/netpfil/ipfw/ip_fw_table.c Wed Feb 19 07:51:58 2014 (r262210) @@ -123,6 +123,7 @@ struct table_xentry { #define OFF_LEN_IFACE (8 * offsetof(struct xaddr_iface, ifname)) +#ifdef INET6 static inline void ipv6_writemask(struct in6_addr *addr6, uint8_t mask) { @@ -132,6 +133,7 @@ ipv6_writemask(struct in6_addr *addr6, u *cp++ = 0xFFFFFFFF; *cp = htonl(mask ? ~((1 << (32 - mask)) - 1) : 0); } +#endif int ipfw_add_table_entry(struct ip_fw_chain *ch, uint16_t tbl, void *paddr, From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 07:55:29 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 28E14F42; Wed, 19 Feb 2014 07:55: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 147891647; Wed, 19 Feb 2014 07:55:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J7tSVb008147; Wed, 19 Feb 2014 07:55:28 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J7tSWp008146; Wed, 19 Feb 2014 07:55:28 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402190755.s1J7tSWp008146@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Feb 2014 07:55: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: r262211 - stable/10/sys/fs/nandfs X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 07:55:29 -0000 Author: dim Date: Wed Feb 19 07:55:28 2014 New Revision: 262211 URL: http://svnweb.freebsd.org/changeset/base/262211 Log: MFC r261914: In sys/fs/nandfs/nandfs_vfsops.c, #if 0 an unused static function. Modified: stable/10/sys/fs/nandfs/nandfs_vfsops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/nandfs/nandfs_vfsops.c ============================================================================== --- stable/10/sys/fs/nandfs/nandfs_vfsops.c Wed Feb 19 07:51:58 2014 (r262210) +++ stable/10/sys/fs/nandfs/nandfs_vfsops.c Wed Feb 19 07:55:28 2014 (r262211) @@ -285,6 +285,7 @@ nandfs_sblocks_in_block(struct nandfs_de return (fsdev->nd_devblocksize / sizeof(struct nandfs_super_block)); } +#if 0 static __inline int nandfs_sblocks_in_first_block(struct nandfs_device *fsdev) { @@ -297,6 +298,7 @@ nandfs_sblocks_in_first_block(struct nan return (n); } +#endif static int nandfs_write_superblock_at(struct nandfs_device *fsdev, From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 07:59:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 98FE5276; Wed, 19 Feb 2014 07:59: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 81721168F; Wed, 19 Feb 2014 07:59:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J7xpgP008619; Wed, 19 Feb 2014 07:59:51 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J7xp7x008618; Wed, 19 Feb 2014 07:59:51 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402190759.s1J7xp7x008618@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Feb 2014 07:59: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: r262212 - in stable: 10/sys/dev/xen/console 9/sys/dev/xen/console X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 07:59:51 -0000 Author: dim Date: Wed Feb 19 07:59:50 2014 New Revision: 262212 URL: http://svnweb.freebsd.org/changeset/base/262212 Log: MFC r261916: In sys/dev/xen/console/console.c, #if 0 an unused static function. Modified: stable/9/sys/dev/xen/console/console.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/xen/console/console.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/dev/xen/console/console.c ============================================================================== --- stable/9/sys/dev/xen/console/console.c Wed Feb 19 07:55:28 2014 (r262211) +++ stable/9/sys/dev/xen/console/console.c Wed Feb 19 07:59:50 2014 (r262212) @@ -358,6 +358,7 @@ xcclose(struct tty *tp) xen_console_up = 0; } +#if 0 static inline int __xencons_put_char(int ch) { @@ -367,6 +368,7 @@ __xencons_put_char(int ch) wbuf[WBUF_MASK(wp++)] = _ch; return 1; } +#endif static void From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 07:59:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE646277; Wed, 19 Feb 2014 07:59: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D81CD1690; Wed, 19 Feb 2014 07:59:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J7xpWT008625; Wed, 19 Feb 2014 07:59:51 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J7xpp3008624; Wed, 19 Feb 2014 07:59:51 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402190759.s1J7xpp3008624@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Feb 2014 07:59: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: r262212 - in stable: 10/sys/dev/xen/console 9/sys/dev/xen/console X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 07:59:52 -0000 Author: dim Date: Wed Feb 19 07:59:50 2014 New Revision: 262212 URL: http://svnweb.freebsd.org/changeset/base/262212 Log: MFC r261916: In sys/dev/xen/console/console.c, #if 0 an unused static function. Modified: stable/10/sys/dev/xen/console/console.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/xen/console/console.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/dev/xen/console/console.c ============================================================================== --- stable/10/sys/dev/xen/console/console.c Wed Feb 19 07:55:28 2014 (r262211) +++ stable/10/sys/dev/xen/console/console.c Wed Feb 19 07:59:50 2014 (r262212) @@ -356,6 +356,7 @@ xcclose(struct tty *tp) xen_console_up = 0; } +#if 0 static inline int __xencons_put_char(int ch) { @@ -365,6 +366,7 @@ __xencons_put_char(int ch) wbuf[WBUF_MASK(wp++)] = _ch; return 1; } +#endif static void From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 08:05:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 65BDE7B5; Wed, 19 Feb 2014 08:05: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5189C1744; Wed, 19 Feb 2014 08:05:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J85hPi012507; Wed, 19 Feb 2014 08:05:43 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J85haY012506; Wed, 19 Feb 2014 08:05:43 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402190805.s1J85haY012506@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Feb 2014 08:05:43 +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: r262213 - in stable: 10/sys/dev/usb/controller 9/sys/dev/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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 08:05:43 -0000 Author: dim Date: Wed Feb 19 08:05:42 2014 New Revision: 262213 URL: http://svnweb.freebsd.org/changeset/base/262213 Log: MFC r261977: In sys/dev/usb/controller/musb_otg.c, fix a warning about musbotg_odevd being unused, by adding it to the part that handles getting descriptors. Reviewed by: hselasky Modified: stable/10/sys/dev/usb/controller/musb_otg.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/usb/controller/musb_otg.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/10/sys/dev/usb/controller/musb_otg.c ============================================================================== --- stable/10/sys/dev/usb/controller/musb_otg.c Wed Feb 19 07:59:50 2014 (r262212) +++ stable/10/sys/dev/usb/controller/musb_otg.c Wed Feb 19 08:05:42 2014 (r262213) @@ -3776,6 +3776,13 @@ tr_handle_get_descriptor: len = sizeof(musbotg_devd); ptr = (const void *)&musbotg_devd; goto tr_valid; + case UDESC_DEVICE_QUALIFIER: + if (value & 0xff) { + goto tr_stalled; + } + len = sizeof(musbotg_odevd); + ptr = (const void *)&musbotg_odevd; + goto tr_valid; case UDESC_CONFIG: if (value & 0xff) { goto tr_stalled; From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 08:05:43 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 135927B3; Wed, 19 Feb 2014 08:05: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F0F7E1743; Wed, 19 Feb 2014 08:05:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J85gMf012501; Wed, 19 Feb 2014 08:05:42 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J85gkg012500; Wed, 19 Feb 2014 08:05:42 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201402190805.s1J85gkg012500@svn.freebsd.org> From: Dimitry Andric Date: Wed, 19 Feb 2014 08:05: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: r262213 - in stable: 10/sys/dev/usb/controller 9/sys/dev/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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 08:05:43 -0000 Author: dim Date: Wed Feb 19 08:05:42 2014 New Revision: 262213 URL: http://svnweb.freebsd.org/changeset/base/262213 Log: MFC r261977: In sys/dev/usb/controller/musb_otg.c, fix a warning about musbotg_odevd being unused, by adding it to the part that handles getting descriptors. Reviewed by: hselasky Modified: stable/9/sys/dev/usb/controller/musb_otg.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/usb/controller/musb_otg.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/dev/usb/controller/musb_otg.c ============================================================================== --- stable/9/sys/dev/usb/controller/musb_otg.c Wed Feb 19 07:59:50 2014 (r262212) +++ stable/9/sys/dev/usb/controller/musb_otg.c Wed Feb 19 08:05:42 2014 (r262213) @@ -3776,6 +3776,13 @@ tr_handle_get_descriptor: len = sizeof(musbotg_devd); ptr = (const void *)&musbotg_devd; goto tr_valid; + case UDESC_DEVICE_QUALIFIER: + if (value & 0xff) { + goto tr_stalled; + } + len = sizeof(musbotg_odevd); + ptr = (const void *)&musbotg_odevd; + goto tr_valid; case UDESC_CONFIG: if (value & 0xff) { goto tr_stalled; From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 08:15:10 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4C344D3D; Wed, 19 Feb 2014 08:15: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 37EA41818; Wed, 19 Feb 2014 08:15:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1J8FAvd017297; Wed, 19 Feb 2014 08:15:10 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1J8FAfl017296; Wed, 19 Feb 2014 08:15:10 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201402190815.s1J8FAfl017296@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 19 Feb 2014 08:15:10 +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: r262214 - stable/10/sys/dev/netmap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 08:15:10 -0000 Author: luigi Date: Wed Feb 19 08:15:09 2014 New Revision: 262214 URL: http://svnweb.freebsd.org/changeset/base/262214 Log: allow building without INET Modified: stable/10/sys/dev/netmap/netmap_freebsd.c Modified: stable/10/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- stable/10/sys/dev/netmap/netmap_freebsd.c Wed Feb 19 08:05:42 2014 (r262213) +++ stable/10/sys/dev/netmap/netmap_freebsd.c Wed Feb 19 08:15:09 2014 (r262214) @@ -101,6 +101,7 @@ uint16_t nm_csum_ipv4(struct nm_iphdr *i void nm_csum_tcpudp_ipv4(struct nm_iphdr *iph, void *data, size_t datalen, uint16_t *check) { +#ifdef INET uint16_t pseudolen = datalen + iph->protocol; /* Compute and insert the pseudo-header cheksum. */ @@ -110,6 +111,13 @@ void nm_csum_tcpudp_ipv4(struct nm_iphdr * (includes the pseudo-header). */ *check = nm_csum_fold(nm_csum_raw(data, datalen, 0)); +#else + static int notsupported = 0; + if (!notsupported) { + notsupported = 1; + D("inet4 segmentation not supported"); + } +#endif } void nm_csum_tcpudp_ipv6(struct nm_ipv6hdr *ip6h, void *data, From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 15:00:56 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7AD6C8B9; Wed, 19 Feb 2014 15: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6545E1FA7; Wed, 19 Feb 2014 15:00:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JF0uDK085048; Wed, 19 Feb 2014 15:00:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JF0uQ2085047; Wed, 19 Feb 2014 15:00:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191500.s1JF0uQ2085047@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 15:00:56 +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: r262221 - in stable: 8/lib/libthr/thread 9/lib/libthr/thread X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 15:00:56 -0000 Author: jhb Date: Wed Feb 19 15:00:55 2014 New Revision: 262221 URL: http://svnweb.freebsd.org/changeset/base/262221 Log: MFC 250691: Return one-based key so that user can check if the key is ever allocated in the first place. Modified: stable/8/lib/libthr/thread/thr_spec.c Directory Properties: stable/8/lib/libthr/ (props changed) Changes in other areas also in this revision: Modified: stable/9/lib/libthr/thread/thr_spec.c Directory Properties: stable/9/lib/libthr/ (props changed) Modified: stable/8/lib/libthr/thread/thr_spec.c ============================================================================== --- stable/8/lib/libthr/thread/thr_spec.c Wed Feb 19 13:06:50 2014 (r262220) +++ stable/8/lib/libthr/thread/thr_spec.c Wed Feb 19 15:00:55 2014 (r262221) @@ -69,7 +69,7 @@ _pthread_key_create(pthread_key_t *key, /* Unlock the key table: */ THR_LOCK_RELEASE(curthread, &_keytable_lock); - *key = i; + *key = i + 1; return (0); } @@ -80,9 +80,10 @@ _pthread_key_create(pthread_key_t *key, } int -_pthread_key_delete(pthread_key_t key) +_pthread_key_delete(pthread_key_t userkey) { struct pthread *curthread = _get_curthread(); + int key = userkey - 1; int ret = 0; if ((unsigned int)key < PTHREAD_KEYS_MAX) { @@ -177,9 +178,10 @@ pthread_key_allocate_data(void) } int -_pthread_setspecific(pthread_key_t key, const void *value) +_pthread_setspecific(pthread_key_t userkey, const void *value) { struct pthread *pthread; + pthread_key_t key = userkey - 1; int ret = 0; /* Point to the running thread: */ @@ -208,9 +210,10 @@ _pthread_setspecific(pthread_key_t key, } void * -_pthread_getspecific(pthread_key_t key) +_pthread_getspecific(pthread_key_t userkey) { struct pthread *pthread; + pthread_key_t key = userkey - 1; const void *data; /* Point to the running thread: */ From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 15:00:56 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id CF1468BA; Wed, 19 Feb 2014 15: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B8DB01FA8; Wed, 19 Feb 2014 15:00:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JF0ux1085054; Wed, 19 Feb 2014 15:00:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JF0u1v085053; Wed, 19 Feb 2014 15:00:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191500.s1JF0u1v085053@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 15:00:56 +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: r262221 - in stable: 8/lib/libthr/thread 9/lib/libthr/thread X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 15:00:56 -0000 Author: jhb Date: Wed Feb 19 15:00:55 2014 New Revision: 262221 URL: http://svnweb.freebsd.org/changeset/base/262221 Log: MFC 250691: Return one-based key so that user can check if the key is ever allocated in the first place. Modified: stable/9/lib/libthr/thread/thr_spec.c Directory Properties: stable/9/lib/libthr/ (props changed) Changes in other areas also in this revision: Modified: stable/8/lib/libthr/thread/thr_spec.c Directory Properties: stable/8/lib/libthr/ (props changed) Modified: stable/9/lib/libthr/thread/thr_spec.c ============================================================================== --- stable/9/lib/libthr/thread/thr_spec.c Wed Feb 19 13:06:50 2014 (r262220) +++ stable/9/lib/libthr/thread/thr_spec.c Wed Feb 19 15:00:55 2014 (r262221) @@ -70,7 +70,7 @@ _pthread_key_create(pthread_key_t *key, /* Unlock the key table: */ THR_LOCK_RELEASE(curthread, &_keytable_lock); - *key = i; + *key = i + 1; return (0); } @@ -81,9 +81,10 @@ _pthread_key_create(pthread_key_t *key, } int -_pthread_key_delete(pthread_key_t key) +_pthread_key_delete(pthread_key_t userkey) { struct pthread *curthread = _get_curthread(); + int key = userkey - 1; int ret = 0; if ((unsigned int)key < PTHREAD_KEYS_MAX) { @@ -178,9 +179,10 @@ pthread_key_allocate_data(void) } int -_pthread_setspecific(pthread_key_t key, const void *value) +_pthread_setspecific(pthread_key_t userkey, const void *value) { struct pthread *pthread; + pthread_key_t key = userkey - 1; int ret = 0; /* Point to the running thread: */ @@ -209,9 +211,10 @@ _pthread_setspecific(pthread_key_t key, } void * -_pthread_getspecific(pthread_key_t key) +_pthread_getspecific(pthread_key_t userkey) { struct pthread *pthread; + pthread_key_t key = userkey - 1; const void *data; /* Point to the running thread: */ From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 18:34:48 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 436D6157; Wed, 19 Feb 2014 18:34: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2211B158F; Wed, 19 Feb 2014 18:34:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JIYlPd004175; Wed, 19 Feb 2014 18:34:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JIYlaB004172; Wed, 19 Feb 2014 18:34:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191834.s1JIYlaB004172@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 18:34:47 +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: r262225 - in stable: 10/sys/dev/pci 9/sys/dev/pci X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 18:34:48 -0000 Author: jhb Date: Wed Feb 19 18:34:47 2014 New Revision: 262225 URL: http://svnweb.freebsd.org/changeset/base/262225 Log: MFC 261524,261526,261527: - Properly set the alignment flags when allocating the initial range for a BAR. This only really matters when pci_do_realloc_bars is enabled and the initial allocation of a specific range fails. - Simplify pci_reserve_map() by calling resource_list_reserve() to allocate the resource after creating a resource list entry rather than reimplementing it by hand. - Add two tunables to ignore certain firmware-assigned resources. These are mostly useful for debugging. - hw.pci.clear_bars ignores all firmware-assigned ranges for BARs when set. - hw.pci.clear_pcib ignores all firmware-assigned ranges for PCI-PCI bridge I/O windows when set. Modified: stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pci_pci.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/10/sys/dev/pci/pci.c ============================================================================== --- stable/10/sys/dev/pci/pci.c Wed Feb 19 17:44:59 2014 (r262224) +++ stable/10/sys/dev/pci/pci.c Wed Feb 19 18:34:47 2014 (r262225) @@ -332,6 +332,11 @@ SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_ Disable this if you depend on BIOS emulation of USB devices, that is\n\ you use USB devices (like keyboard or mouse) but do not load USB drivers"); +static int pci_clear_bars; +TUNABLE_INT("hw.pci.clear_bars", &pci_clear_bars); +SYSCTL_INT(_hw_pci, OID_AUTO, clear_bars, CTLFLAG_RDTUN, &pci_clear_bars, 0, + "Ignore firmware-assigned resources for BARs."); + static int pci_has_quirk(uint32_t devid, int quirk) { @@ -2742,7 +2747,7 @@ pci_add_map(device_t bus, device_t dev, struct pci_map *pm; pci_addr_t base, map, testval; pci_addr_t start, end, count; - int barlen, basezero, maprange, mapsize, type; + int barlen, basezero, flags, maprange, mapsize, type; uint16_t cmd; struct resource *res; @@ -2848,7 +2853,10 @@ pci_add_map(device_t bus, device_t dev, } count = (pci_addr_t)1 << mapsize; - if (basezero || base == pci_mapbase(testval)) { + flags = RF_ALIGNMENT_LOG2(mapsize); + if (prefetch) + flags |= RF_PREFETCHABLE; + if (basezero || base == pci_mapbase(testval) || pci_clear_bars) { start = 0; /* Let the parent decide. */ end = ~0ul; } else { @@ -2864,7 +2872,7 @@ pci_add_map(device_t bus, device_t dev, * pci_alloc_resource(). */ res = resource_list_reserve(rl, bus, dev, type, ®, start, end, count, - prefetch ? RF_PREFETCHABLE : 0); + flags); if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0ul)) { /* * If the allocation fails, try to allocate a resource for @@ -2875,7 +2883,7 @@ pci_add_map(device_t bus, device_t dev, resource_list_delete(rl, type, reg); resource_list_add(rl, type, reg, 0, ~0ul, count); res = resource_list_reserve(rl, bus, dev, type, ®, 0, ~0ul, - count, prefetch ? RF_PREFETCHABLE : 0); + count, flags); } if (res == NULL) { /* @@ -4174,7 +4182,6 @@ pci_reserve_map(device_t dev, device_t c { struct pci_devinfo *dinfo = device_get_ivars(child); struct resource_list *rl = &dinfo->resources; - struct resource_list_entry *rle; struct resource *res; struct pci_map *pm; pci_addr_t map, testval; @@ -4247,23 +4254,16 @@ pci_reserve_map(device_t dev, device_t c * Allocate enough resource, and then write back the * appropriate BAR for that resource. */ - res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, - start, end, count, flags & ~RF_ACTIVE); + resource_list_add(rl, type, *rid, start, end, count); + res = resource_list_reserve(rl, dev, child, type, rid, start, end, + count, flags & ~RF_ACTIVE); if (res == NULL) { + resource_list_delete(rl, type, *rid); device_printf(child, "%#lx bytes of rid %#x res %d failed (%#lx, %#lx).\n", count, *rid, type, start, end); goto out; } - resource_list_add(rl, type, *rid, start, end, count); - rle = resource_list_find(rl, type, *rid); - if (rle == NULL) - panic("pci_reserve_map: unexpectedly can't find resource."); - rle->res = res; - rle->start = rman_get_start(res); - rle->end = rman_get_end(res); - rle->count = count; - rle->flags = RLE_RESERVED; if (bootverbose) device_printf(child, "Lazy allocation of %#lx bytes rid %#x type %d at %#lx\n", Modified: stable/10/sys/dev/pci/pci_pci.c ============================================================================== --- stable/10/sys/dev/pci/pci_pci.c Wed Feb 19 17:44:59 2014 (r262224) +++ stable/10/sys/dev/pci/pci_pci.c Wed Feb 19 18:34:47 2014 (r262225) @@ -103,6 +103,12 @@ DEFINE_CLASS_0(pcib, pcib_driver, pcib_m DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL); #ifdef NEW_PCIB +SYSCTL_DECL(_hw_pci); + +static int pci_clear_pcib; +TUNABLE_INT("hw.pci.clear_pcib", &pci_clear_pcib); +SYSCTL_INT(_hw_pci, OID_AUTO, clear_pcib, CTLFLAG_RDTUN, &pci_clear_pcib, 0, + "Clear firmware-assigned resources for PCI-PCI bridge I/O windows."); /* * Is a resource from a child device sub-allocated from one of our @@ -416,6 +422,19 @@ pcib_probe_windows(struct pcib_softc *sc dev = sc->dev; + if (pci_clear_pcib) { + pci_write_config(dev, PCIR_IOBASEL_1, 0xff, 1); + pci_write_config(dev, PCIR_IOBASEH_1, 0xffff, 2); + pci_write_config(dev, PCIR_IOLIMITL_1, 0, 1); + pci_write_config(dev, PCIR_IOLIMITH_1, 0, 2); + pci_write_config(dev, PCIR_MEMBASE_1, 0xffff, 2); + pci_write_config(dev, PCIR_MEMLIMIT_1, 0, 2); + pci_write_config(dev, PCIR_PMBASEL_1, 0xffff, 2); + pci_write_config(dev, PCIR_PMBASEH_1, 0xffffffff, 4); + pci_write_config(dev, PCIR_PMLIMITL_1, 0, 2); + pci_write_config(dev, PCIR_PMLIMITH_1, 0, 4); + } + /* Determine if the I/O port window is implemented. */ val = pci_read_config(dev, PCIR_IOBASEL_1, 1); if (val == 0) { From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 18:34:48 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C92D0158; Wed, 19 Feb 2014 18:34: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8B3F1592; Wed, 19 Feb 2014 18:34:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JIYm46004182; Wed, 19 Feb 2014 18:34:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JIYmQo004180; Wed, 19 Feb 2014 18:34:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191834.s1JIYmQo004180@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 18:34:48 +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: r262225 - in stable: 10/sys/dev/pci 9/sys/dev/pci X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 18:34:48 -0000 Author: jhb Date: Wed Feb 19 18:34:47 2014 New Revision: 262225 URL: http://svnweb.freebsd.org/changeset/base/262225 Log: MFC 261524,261526,261527: - Properly set the alignment flags when allocating the initial range for a BAR. This only really matters when pci_do_realloc_bars is enabled and the initial allocation of a specific range fails. - Simplify pci_reserve_map() by calling resource_list_reserve() to allocate the resource after creating a resource list entry rather than reimplementing it by hand. - Add two tunables to ignore certain firmware-assigned resources. These are mostly useful for debugging. - hw.pci.clear_bars ignores all firmware-assigned ranges for BARs when set. - hw.pci.clear_pcib ignores all firmware-assigned ranges for PCI-PCI bridge I/O windows when set. Modified: stable/9/sys/dev/pci/pci.c stable/9/sys/dev/pci/pci_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/pci/pci.c stable/10/sys/dev/pci/pci_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/dev/pci/pci.c ============================================================================== --- stable/9/sys/dev/pci/pci.c Wed Feb 19 17:44:59 2014 (r262224) +++ stable/9/sys/dev/pci/pci.c Wed Feb 19 18:34:47 2014 (r262225) @@ -345,6 +345,11 @@ SYSCTL_INT(_hw_pci, OID_AUTO, usb_early_ Disable this if you depend on BIOS emulation of USB devices, that is\n\ you use USB devices (like keyboard or mouse) but do not load USB drivers"); +static int pci_clear_bars; +TUNABLE_INT("hw.pci.clear_bars", &pci_clear_bars); +SYSCTL_INT(_hw_pci, OID_AUTO, clear_bars, CTLFLAG_RDTUN, &pci_clear_bars, 0, + "Ignore firmware-assigned resources for BARs."); + static int pci_has_quirk(uint32_t devid, int quirk) { @@ -2675,7 +2680,7 @@ pci_add_map(device_t bus, device_t dev, struct pci_map *pm; pci_addr_t base, map, testval; pci_addr_t start, end, count; - int barlen, basezero, maprange, mapsize, type; + int barlen, basezero, flags, maprange, mapsize, type; uint16_t cmd; struct resource *res; @@ -2781,7 +2786,10 @@ pci_add_map(device_t bus, device_t dev, } count = (pci_addr_t)1 << mapsize; - if (basezero || base == pci_mapbase(testval)) { + flags = RF_ALIGNMENT_LOG2(mapsize); + if (prefetch) + flags |= RF_PREFETCHABLE; + if (basezero || base == pci_mapbase(testval) || pci_clear_bars) { start = 0; /* Let the parent decide. */ end = ~0ul; } else { @@ -2797,7 +2805,7 @@ pci_add_map(device_t bus, device_t dev, * pci_alloc_resource(). */ res = resource_list_reserve(rl, bus, dev, type, ®, start, end, count, - prefetch ? RF_PREFETCHABLE : 0); + flags); if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0ul)) { /* * If the allocation fails, try to allocate a resource for @@ -2808,7 +2816,7 @@ pci_add_map(device_t bus, device_t dev, resource_list_delete(rl, type, reg); resource_list_add(rl, type, reg, 0, ~0ul, count); res = resource_list_reserve(rl, bus, dev, type, ®, 0, ~0ul, - count, prefetch ? RF_PREFETCHABLE : 0); + count, flags); } if (res == NULL) { /* @@ -4079,7 +4087,6 @@ pci_reserve_map(device_t dev, device_t c { struct pci_devinfo *dinfo = device_get_ivars(child); struct resource_list *rl = &dinfo->resources; - struct resource_list_entry *rle; struct resource *res; struct pci_map *pm; pci_addr_t map, testval; @@ -4152,23 +4159,16 @@ pci_reserve_map(device_t dev, device_t c * Allocate enough resource, and then write back the * appropriate BAR for that resource. */ - res = BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, - start, end, count, flags & ~RF_ACTIVE); + resource_list_add(rl, type, *rid, start, end, count); + res = resource_list_reserve(rl, dev, child, type, rid, start, end, + count, flags & ~RF_ACTIVE); if (res == NULL) { + resource_list_delete(rl, type, *rid); device_printf(child, "%#lx bytes of rid %#x res %d failed (%#lx, %#lx).\n", count, *rid, type, start, end); goto out; } - resource_list_add(rl, type, *rid, start, end, count); - rle = resource_list_find(rl, type, *rid); - if (rle == NULL) - panic("pci_reserve_map: unexpectedly can't find resource."); - rle->res = res; - rle->start = rman_get_start(res); - rle->end = rman_get_end(res); - rle->count = count; - rle->flags = RLE_RESERVED; if (bootverbose) device_printf(child, "Lazy allocation of %#lx bytes rid %#x type %d at %#lx\n", Modified: stable/9/sys/dev/pci/pci_pci.c ============================================================================== --- stable/9/sys/dev/pci/pci_pci.c Wed Feb 19 17:44:59 2014 (r262224) +++ stable/9/sys/dev/pci/pci_pci.c Wed Feb 19 18:34:47 2014 (r262225) @@ -103,6 +103,12 @@ DEFINE_CLASS_0(pcib, pcib_driver, pcib_m DRIVER_MODULE(pcib, pci, pcib_driver, pcib_devclass, NULL, NULL); #ifdef NEW_PCIB +SYSCTL_DECL(_hw_pci); + +static int pci_clear_pcib; +TUNABLE_INT("hw.pci.clear_pcib", &pci_clear_pcib); +SYSCTL_INT(_hw_pci, OID_AUTO, clear_pcib, CTLFLAG_RDTUN, &pci_clear_pcib, 0, + "Clear firmware-assigned resources for PCI-PCI bridge I/O windows."); /* * Is a resource from a child device sub-allocated from one of our @@ -416,6 +422,19 @@ pcib_probe_windows(struct pcib_softc *sc dev = sc->dev; + if (pci_clear_pcib) { + pci_write_config(dev, PCIR_IOBASEL_1, 0xff, 1); + pci_write_config(dev, PCIR_IOBASEH_1, 0xffff, 2); + pci_write_config(dev, PCIR_IOLIMITL_1, 0, 1); + pci_write_config(dev, PCIR_IOLIMITH_1, 0, 2); + pci_write_config(dev, PCIR_MEMBASE_1, 0xffff, 2); + pci_write_config(dev, PCIR_MEMLIMIT_1, 0, 2); + pci_write_config(dev, PCIR_PMBASEL_1, 0xffff, 2); + pci_write_config(dev, PCIR_PMBASEH_1, 0xffffffff, 4); + pci_write_config(dev, PCIR_PMLIMITL_1, 0, 2); + pci_write_config(dev, PCIR_PMLIMITH_1, 0, 4); + } + /* Determine if the I/O port window is implemented. */ val = pci_read_config(dev, PCIR_IOBASEL_1, 1); if (val == 0) { From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 18:35:22 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE2AD8AE; Wed, 19 Feb 2014 18:35: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id BFCA915B4; Wed, 19 Feb 2014 18:35:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JIZM5S004836; Wed, 19 Feb 2014 18:35:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JIZMRo004835; Wed, 19 Feb 2014 18:35:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191835.s1JIZMRo004835@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 18:35:22 +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: r262226 - stable/8/sys/dev/pci X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 18:35:23 -0000 Author: jhb Date: Wed Feb 19 18:35:22 2014 New Revision: 262226 URL: http://svnweb.freebsd.org/changeset/base/262226 Log: MFC 261524: Properly set the alignment flags when allocating the initial range for a BAR. This only really matters when pci_do_realloc_bars is enabled and the initial allocation of a specific range fails. Modified: stable/8/sys/dev/pci/pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/pci/ (props changed) Modified: stable/8/sys/dev/pci/pci.c ============================================================================== --- stable/8/sys/dev/pci/pci.c Wed Feb 19 18:34:47 2014 (r262225) +++ stable/8/sys/dev/pci/pci.c Wed Feb 19 18:35:22 2014 (r262226) @@ -2637,7 +2637,7 @@ pci_add_map(device_t bus, device_t dev, struct pci_map *pm; pci_addr_t base, map, testval; pci_addr_t start, end, count; - int barlen, basezero, maprange, mapsize, type; + int barlen, basezero, flags, maprange, mapsize, type; uint16_t cmd; struct resource *res; @@ -2743,6 +2743,9 @@ pci_add_map(device_t bus, device_t dev, } count = (pci_addr_t)1 << mapsize; + flags = RF_ALIGNMENT_LOG2(mapsize); + if (prefetch) + flags |= RF_PREFETCHABLE; if (basezero || base == pci_mapbase(testval)) { start = 0; /* Let the parent decide. */ end = ~0ul; @@ -2759,7 +2762,7 @@ pci_add_map(device_t bus, device_t dev, * pci_alloc_resource(). */ res = resource_list_alloc(rl, bus, dev, type, ®, start, end, count, - prefetch ? RF_PREFETCHABLE : 0); + flags); if (pci_do_realloc_bars && res == NULL && (start != 0 || end != ~0ul)) { /* * If the allocation fails, try to allocate a resource for @@ -2770,7 +2773,7 @@ pci_add_map(device_t bus, device_t dev, resource_list_delete(rl, type, reg); resource_list_add(rl, type, reg, 0, ~0ul, count); res = resource_list_alloc(rl, bus, dev, type, ®, 0, ~0ul, - count, prefetch ? RF_PREFETCHABLE : 0); + count, flags); } if (res == NULL) { /* From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 18:36:54 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 82ED0B9C; Wed, 19 Feb 2014 18:36: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D1B315D6; Wed, 19 Feb 2014 18:36:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JIas8M005034; Wed, 19 Feb 2014 18:36:54 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JIasJX005032; Wed, 19 Feb 2014 18:36:54 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191836.s1JIasJX005032@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 18:36: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: r262227 - stable/10/usr.sbin/bhyve X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 18:36:54 -0000 Author: jhb Date: Wed Feb 19 18:36:53 2014 New Revision: 262227 URL: http://svnweb.freebsd.org/changeset/base/262227 Log: MFC 261607: Mark the I/O ports used by the bhyve console and debug devices as system resources. Modified: stable/10/usr.sbin/bhyve/consport.c stable/10/usr.sbin/bhyve/dbgport.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bhyve/consport.c ============================================================================== --- stable/10/usr.sbin/bhyve/consport.c Wed Feb 19 18:35:22 2014 (r262226) +++ stable/10/usr.sbin/bhyve/consport.c Wed Feb 19 18:36:53 2014 (r262227) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include "inout.h" +#include "pci_lpc.h" #define BVM_CONSOLE_PORT 0x220 #define BVM_CONS_SIG ('b' << 8 | 'v') @@ -125,6 +126,8 @@ console_handler(struct vmctx *ctx, int v return (0); } +SYSRES_IO(BVM_CONSOLE_PORT, 4); + static struct inout_port consport = { "bvmcons", BVM_CONSOLE_PORT, Modified: stable/10/usr.sbin/bhyve/dbgport.c ============================================================================== --- stable/10/usr.sbin/bhyve/dbgport.c Wed Feb 19 18:35:22 2014 (r262226) +++ stable/10/usr.sbin/bhyve/dbgport.c Wed Feb 19 18:36:53 2014 (r262227) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include "inout.h" #include "dbgport.h" +#include "pci_lpc.h" #define BVM_DBG_PORT 0x224 #define BVM_DBG_SIG ('B' << 8 | 'V') @@ -110,6 +111,8 @@ static struct inout_port dbgport = { dbg_handler }; +SYSRES_IO(BVM_DBG_PORT, 4); + void init_dbgport(int sport) { From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 18:58:34 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 961302F8; Wed, 19 Feb 2014 18:58:34 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 69876176D; Wed, 19 Feb 2014 18:58:34 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 3F71DB918; Wed, 19 Feb 2014 13:58:33 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Subject: Re: svn commit: r262221 - in stable: 8/lib/libthr/thread 9/lib/libthr/thread Date: Wed, 19 Feb 2014 13:21:56 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <201402191500.s1JF0u1v085053@svn.freebsd.org> In-Reply-To: <201402191500.s1JF0u1v085053@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201402191321.56516.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 19 Feb 2014 13:58:33 -0500 (EST) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 18:58:34 -0000 On Wednesday, February 19, 2014 10:00:56 am John Baldwin wrote: > Author: jhb > Date: Wed Feb 19 15:00:55 2014 > New Revision: 262221 > URL: http://svnweb.freebsd.org/changeset/base/262221 > > Log: > MFC 250691: > Return one-based key so that user can check if the key is ever allocated > in the first place. This also works around potential application bugs if an application calls pthread_key_delete() on an uninitialized key. (QT 4.7 is one such offender) -- John Baldwin From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 19:11:15 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 95DDC9DC; Wed, 19 Feb 2014 19:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 64C5118D0; Wed, 19 Feb 2014 19:11:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJBFQK020277; Wed, 19 Feb 2014 19:11:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJBE5L020268; Wed, 19 Feb 2014 19:11:14 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191911.s1JJBE5L020268@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 19:11: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: r262228 - in stable: 10/sys/kern 10/sys/sys 10/usr.bin/procstat 9/sys/kern 9/sys/sys 9/usr.bin/procstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 19:11:15 -0000 Author: jhb Date: Wed Feb 19 19:11:14 2014 New Revision: 262228 URL: http://svnweb.freebsd.org/changeset/base/262228 Log: MFC 261780: Expose OBJT_MGTDEVICE VM objects used for GEM/TTM with drm2 as an explicit object type. Modified: stable/10/sys/kern/kern_proc.c stable/10/sys/sys/user.h stable/10/usr.bin/procstat/procstat.1 stable/10/usr.bin/procstat/procstat_vm.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/kern/kern_proc.c stable/9/sys/sys/user.h stable/9/usr.bin/procstat/procstat.1 stable/9/usr.bin/procstat/procstat_vm.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) stable/9/usr.bin/procstat/ (props changed) Modified: stable/10/sys/kern/kern_proc.c ============================================================================== --- stable/10/sys/kern/kern_proc.c Wed Feb 19 18:36:53 2014 (r262227) +++ stable/10/sys/kern/kern_proc.c Wed Feb 19 19:11:14 2014 (r262228) @@ -2256,6 +2256,9 @@ kern_proc_vmmap_out(struct proc *p, stru case OBJT_SG: kve->kve_type = KVME_TYPE_SG; break; + case OBJT_MGTDEVICE: + kve->kve_type = KVME_TYPE_MGTDEVICE; + break; default: kve->kve_type = KVME_TYPE_UNKNOWN; break; Modified: stable/10/sys/sys/user.h ============================================================================== --- stable/10/sys/sys/user.h Wed Feb 19 18:36:53 2014 (r262227) +++ stable/10/sys/sys/user.h Wed Feb 19 19:11:14 2014 (r262228) @@ -414,6 +414,7 @@ struct kinfo_file { #define KVME_TYPE_PHYS 5 #define KVME_TYPE_DEAD 6 #define KVME_TYPE_SG 7 +#define KVME_TYPE_MGTDEVICE 8 #define KVME_TYPE_UNKNOWN 255 #define KVME_PROT_READ 0x00000001 Modified: stable/10/usr.bin/procstat/procstat.1 ============================================================================== --- stable/10/usr.bin/procstat/procstat.1 Wed Feb 19 18:36:53 2014 (r262227) +++ stable/10/usr.bin/procstat/procstat.1 Wed Feb 19 19:11:14 2014 (r262228) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 27, 2013 +.Dd February 11, 2014 .Dt PROCSTAT 1 .Os .Sh NAME @@ -416,6 +416,9 @@ dead default .It dv device +.It md +device with managed pages +.Pq GEM/TTM .It ph physical .It sg Modified: stable/10/usr.bin/procstat/procstat_vm.c ============================================================================== --- stable/10/usr.bin/procstat/procstat_vm.c Wed Feb 19 18:36:53 2014 (r262227) +++ stable/10/usr.bin/procstat/procstat_vm.c Wed Feb 19 19:11:14 2014 (r262228) @@ -100,6 +100,9 @@ procstat_vm(struct procstat *procstat, s case KVME_TYPE_SG: str = "sg"; break; + case KVME_TYPE_MGTDEVICE: + str = "md"; + break; case KVME_TYPE_UNKNOWN: default: str = "??"; From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 19:11:16 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8E9079DD; Wed, 19 Feb 2014 19:11: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 5F2BC18D1; Wed, 19 Feb 2014 19:11:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJBGnY020289; Wed, 19 Feb 2014 19:11:16 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJBFNm020283; Wed, 19 Feb 2014 19:11:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191911.s1JJBFNm020283@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 19:11:15 +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: r262228 - in stable: 10/sys/kern 10/sys/sys 10/usr.bin/procstat 9/sys/kern 9/sys/sys 9/usr.bin/procstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 19:11:16 -0000 Author: jhb Date: Wed Feb 19 19:11:14 2014 New Revision: 262228 URL: http://svnweb.freebsd.org/changeset/base/262228 Log: MFC 261780: Expose OBJT_MGTDEVICE VM objects used for GEM/TTM with drm2 as an explicit object type. Modified: stable/9/sys/kern/kern_proc.c stable/9/sys/sys/user.h stable/9/usr.bin/procstat/procstat.1 stable/9/usr.bin/procstat/procstat_vm.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) stable/9/usr.bin/procstat/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/kern/kern_proc.c stable/10/sys/sys/user.h stable/10/usr.bin/procstat/procstat.1 stable/10/usr.bin/procstat/procstat_vm.c Directory Properties: stable/10/ (props changed) Modified: stable/9/sys/kern/kern_proc.c ============================================================================== --- stable/9/sys/kern/kern_proc.c Wed Feb 19 18:36:53 2014 (r262227) +++ stable/9/sys/kern/kern_proc.c Wed Feb 19 19:11:14 2014 (r262228) @@ -2261,6 +2261,9 @@ kern_proc_vmmap_out(struct proc *p, stru case OBJT_SG: kve->kve_type = KVME_TYPE_SG; break; + case OBJT_MGTDEVICE: + kve->kve_type = KVME_TYPE_MGTDEVICE; + break; default: kve->kve_type = KVME_TYPE_UNKNOWN; break; Modified: stable/9/sys/sys/user.h ============================================================================== --- stable/9/sys/sys/user.h Wed Feb 19 18:36:53 2014 (r262227) +++ stable/9/sys/sys/user.h Wed Feb 19 19:11:14 2014 (r262228) @@ -409,6 +409,7 @@ struct kinfo_file { #define KVME_TYPE_PHYS 5 #define KVME_TYPE_DEAD 6 #define KVME_TYPE_SG 7 +#define KVME_TYPE_MGTDEVICE 8 #define KVME_TYPE_UNKNOWN 255 #define KVME_PROT_READ 0x00000001 Modified: stable/9/usr.bin/procstat/procstat.1 ============================================================================== --- stable/9/usr.bin/procstat/procstat.1 Wed Feb 19 18:36:53 2014 (r262227) +++ stable/9/usr.bin/procstat/procstat.1 Wed Feb 19 19:11:14 2014 (r262228) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 20, 2013 +.Dd February 11, 2014 .Dt PROCSTAT 1 .Os .Sh NAME @@ -418,6 +418,9 @@ dead default .It dv device +.It md +device with managed pages +.Pq GEM/TTM .It ph physical .It sg Modified: stable/9/usr.bin/procstat/procstat_vm.c ============================================================================== --- stable/9/usr.bin/procstat/procstat_vm.c Wed Feb 19 18:36:53 2014 (r262227) +++ stable/9/usr.bin/procstat/procstat_vm.c Wed Feb 19 19:11:14 2014 (r262228) @@ -100,6 +100,9 @@ procstat_vm(struct procstat *procstat, s case KVME_TYPE_SG: str = "sg"; break; + case KVME_TYPE_MGTDEVICE: + str = "md"; + break; case KVME_TYPE_UNKNOWN: default: str = "??"; From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 19:28:50 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 642E81E3; Wed, 19 Feb 2014 19:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4DEE81A30; Wed, 19 Feb 2014 19:28:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJSojW025538; Wed, 19 Feb 2014 19:28:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJSoDU025537; Wed, 19 Feb 2014 19:28:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191928.s1JJSoDU025537@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 19:28:50 +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: r262229 - in stable: 10/usr.bin/nfsstat 8/usr.bin/nfsstat 9/usr.bin/nfsstat X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 19:28:50 -0000 Author: jhb Date: Wed Feb 19 19:28:49 2014 New Revision: 262229 URL: http://svnweb.freebsd.org/changeset/base/262229 Log: MFC 261512,261514: - Partially revert r52493 and change client side interval statistics to report the actual number of RPCs issued, not the theoretical number that would be issued if all caching was disabled. - Use the DELTA() macro to tidy the server-side interval stats code a bit. Modified: stable/10/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/8/usr.bin/nfsstat/nfsstat.c stable/9/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/8/usr.bin/nfsstat/ (props changed) stable/9/usr.bin/nfsstat/ (props changed) Modified: stable/10/usr.bin/nfsstat/nfsstat.c ============================================================================== --- stable/10/usr.bin/nfsstat/nfsstat.c Wed Feb 19 19:11:14 2014 (r262228) +++ stable/10/usr.bin/nfsstat/nfsstat.c Wed Feb 19 19:28:49 2014 (r262229) @@ -604,14 +604,15 @@ sidewaysintpr(u_int interval, int client if (clientOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(attrcache_hits) + DELTA(attrcache_misses), - DELTA(lookupcache_hits) + DELTA(lookupcache_misses), - DELTA(biocache_readlinks), - DELTA(biocache_reads), - DELTA(biocache_writes), - nfsstats.rpccnt[NFSPROC_RENAME]-lastst.rpccnt[NFSPROC_RENAME], - DELTA(accesscache_hits) + DELTA(accesscache_misses), - DELTA(biocache_readdirs) + DELTA(rpccnt[NFSPROC_GETATTR]), + DELTA(rpccnt[NFSPROC_LOOKUP]), + DELTA(rpccnt[NFSPROC_READLINK]), + DELTA(rpccnt[NFSPROC_READ]), + DELTA(rpccnt[NFSPROC_WRITE]), + DELTA(rpccnt[NFSPROC_RENAME]), + DELTA(rpccnt[NFSPROC_ACCESS]), + DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS]) ); if (widemode) { printf(" %s %s %s %s %s %s", @@ -993,15 +994,15 @@ exp_sidewaysintpr(u_int interval, int cl if (clientOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(attrcache_hits) + DELTA(attrcache_misses), - DELTA(lookupcache_hits) + DELTA(lookupcache_misses), - DELTA(biocache_readlinks), - DELTA(biocache_reads), - DELTA(biocache_writes), - nfsstats.rpccnt[NFSPROC_RENAME] - - lastst.rpccnt[NFSPROC_RENAME], - DELTA(accesscache_hits) + DELTA(accesscache_misses), - DELTA(biocache_readdirs) + DELTA(rpccnt[NFSPROC_GETATTR]), + DELTA(rpccnt[NFSPROC_LOOKUP]), + DELTA(rpccnt[NFSPROC_READLINK]), + DELTA(rpccnt[NFSPROC_READ]), + DELTA(rpccnt[NFSPROC_WRITE]), + DELTA(rpccnt[NFSPROC_RENAME]), + DELTA(rpccnt[NFSPROC_ACCESS]), + DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS]) ); if (widemode) { printf(" %s %s %s %s %s %s", @@ -1024,24 +1025,15 @@ exp_sidewaysintpr(u_int interval, int cl if (serverOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Server:" : ""), - nfsstats.srvrpccnt[NFSV4OP_GETATTR] - - lastst.srvrpccnt[NFSV4OP_GETATTR], - nfsstats.srvrpccnt[NFSV4OP_LOOKUP] - - lastst.srvrpccnt[NFSV4OP_LOOKUP], - nfsstats.srvrpccnt[NFSV4OP_READLINK] - - lastst.srvrpccnt[NFSV4OP_READLINK], - nfsstats.srvrpccnt[NFSV4OP_READ] - - lastst.srvrpccnt[NFSV4OP_READ], - nfsstats.srvrpccnt[NFSV4OP_WRITE] - - lastst.srvrpccnt[NFSV4OP_WRITE], - nfsstats.srvrpccnt[NFSV4OP_RENAME] - - lastst.srvrpccnt[NFSV4OP_RENAME], - nfsstats.srvrpccnt[NFSV4OP_ACCESS] - - lastst.srvrpccnt[NFSV4OP_ACCESS], - (nfsstats.srvrpccnt[NFSV4OP_READDIR] - - lastst.srvrpccnt[NFSV4OP_READDIR]) + - (nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS] - - lastst.srvrpccnt[NFSV4OP_READDIRPLUS])); + DELTA(srvrpccnt[NFSV4OP_GETATTR]), + DELTA(srvrpccnt[NFSV4OP_LOOKUP]), + DELTA(srvrpccnt[NFSV4OP_READLINK]), + DELTA(srvrpccnt[NFSV4OP_READ]), + DELTA(srvrpccnt[NFSV4OP_WRITE]), + DELTA(srvrpccnt[NFSV4OP_RENAME]), + DELTA(srvrpccnt[NFSV4OP_ACCESS]), + DELTA(srvrpccnt[NFSV4OP_READDIR]) + + DELTA(srvrpccnt[NFSV4OP_READDIRPLUS])); printf("\n"); } lastst = nfsstats; From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 19:28:51 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 183D61E5; Wed, 19 Feb 2014 19:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 024791A32; Wed, 19 Feb 2014 19:28:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJSon7025551; Wed, 19 Feb 2014 19:28:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJSov4025550; Wed, 19 Feb 2014 19:28:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191928.s1JJSov4025550@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 19:28:50 +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: r262229 - in stable: 10/usr.bin/nfsstat 8/usr.bin/nfsstat 9/usr.bin/nfsstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 19:28:51 -0000 Author: jhb Date: Wed Feb 19 19:28:49 2014 New Revision: 262229 URL: http://svnweb.freebsd.org/changeset/base/262229 Log: MFC 261512,261514: - Partially revert r52493 and change client side interval statistics to report the actual number of RPCs issued, not the theoretical number that would be issued if all caching was disabled. - Use the DELTA() macro to tidy the server-side interval stats code a bit. Modified: stable/9/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/9/usr.bin/nfsstat/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.bin/nfsstat/nfsstat.c stable/8/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/10/ (props changed) stable/8/usr.bin/nfsstat/ (props changed) Modified: stable/9/usr.bin/nfsstat/nfsstat.c ============================================================================== --- stable/9/usr.bin/nfsstat/nfsstat.c Wed Feb 19 19:11:14 2014 (r262228) +++ stable/9/usr.bin/nfsstat/nfsstat.c Wed Feb 19 19:28:49 2014 (r262229) @@ -604,14 +604,15 @@ sidewaysintpr(u_int interval, int client if (clientOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(attrcache_hits) + DELTA(attrcache_misses), - DELTA(lookupcache_hits) + DELTA(lookupcache_misses), - DELTA(biocache_readlinks), - DELTA(biocache_reads), - DELTA(biocache_writes), - nfsstats.rpccnt[NFSPROC_RENAME]-lastst.rpccnt[NFSPROC_RENAME], - DELTA(accesscache_hits) + DELTA(accesscache_misses), - DELTA(biocache_readdirs) + DELTA(rpccnt[NFSPROC_GETATTR]), + DELTA(rpccnt[NFSPROC_LOOKUP]), + DELTA(rpccnt[NFSPROC_READLINK]), + DELTA(rpccnt[NFSPROC_READ]), + DELTA(rpccnt[NFSPROC_WRITE]), + DELTA(rpccnt[NFSPROC_RENAME]), + DELTA(rpccnt[NFSPROC_ACCESS]), + DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS]) ); if (widemode) { printf(" %s %s %s %s %s %s", @@ -993,15 +994,15 @@ exp_sidewaysintpr(u_int interval, int cl if (clientOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(attrcache_hits) + DELTA(attrcache_misses), - DELTA(lookupcache_hits) + DELTA(lookupcache_misses), - DELTA(biocache_readlinks), - DELTA(biocache_reads), - DELTA(biocache_writes), - nfsstats.rpccnt[NFSPROC_RENAME] - - lastst.rpccnt[NFSPROC_RENAME], - DELTA(accesscache_hits) + DELTA(accesscache_misses), - DELTA(biocache_readdirs) + DELTA(rpccnt[NFSPROC_GETATTR]), + DELTA(rpccnt[NFSPROC_LOOKUP]), + DELTA(rpccnt[NFSPROC_READLINK]), + DELTA(rpccnt[NFSPROC_READ]), + DELTA(rpccnt[NFSPROC_WRITE]), + DELTA(rpccnt[NFSPROC_RENAME]), + DELTA(rpccnt[NFSPROC_ACCESS]), + DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS]) ); if (widemode) { printf(" %s %s %s %s %s %s", @@ -1025,24 +1026,15 @@ exp_sidewaysintpr(u_int interval, int cl if (serverOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Server:" : ""), - nfsstats.srvrpccnt[NFSV4OP_GETATTR] - - lastst.srvrpccnt[NFSV4OP_GETATTR], - nfsstats.srvrpccnt[NFSV4OP_LOOKUP] - - lastst.srvrpccnt[NFSV4OP_LOOKUP], - nfsstats.srvrpccnt[NFSV4OP_READLINK] - - lastst.srvrpccnt[NFSV4OP_READLINK], - nfsstats.srvrpccnt[NFSV4OP_READ] - - lastst.srvrpccnt[NFSV4OP_READ], - nfsstats.srvrpccnt[NFSV4OP_WRITE] - - lastst.srvrpccnt[NFSV4OP_WRITE], - nfsstats.srvrpccnt[NFSV4OP_RENAME] - - lastst.srvrpccnt[NFSV4OP_RENAME], - nfsstats.srvrpccnt[NFSV4OP_ACCESS] - - lastst.srvrpccnt[NFSV4OP_ACCESS], - (nfsstats.srvrpccnt[NFSV4OP_READDIR] - - lastst.srvrpccnt[NFSV4OP_READDIR]) + - (nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS] - - lastst.srvrpccnt[NFSV4OP_READDIRPLUS])); + DELTA(srvrpccnt[NFSV4OP_GETATTR]), + DELTA(srvrpccnt[NFSV4OP_LOOKUP]), + DELTA(srvrpccnt[NFSV4OP_READLINK]), + DELTA(srvrpccnt[NFSV4OP_READ]), + DELTA(srvrpccnt[NFSV4OP_WRITE]), + DELTA(srvrpccnt[NFSV4OP_RENAME]), + DELTA(srvrpccnt[NFSV4OP_ACCESS]), + DELTA(srvrpccnt[NFSV4OP_READDIR]) + + DELTA(srvrpccnt[NFSV4OP_READDIRPLUS])); printf("\n"); lastst = nfsstats; } From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 19:28:50 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B78DD1E4; Wed, 19 Feb 2014 19:28: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A24D71A31; Wed, 19 Feb 2014 19:28:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJSo6o025545; Wed, 19 Feb 2014 19:28:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJSoBN025544; Wed, 19 Feb 2014 19:28:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402191928.s1JJSoBN025544@svn.freebsd.org> From: John Baldwin Date: Wed, 19 Feb 2014 19:28:50 +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: r262229 - in stable: 10/usr.bin/nfsstat 8/usr.bin/nfsstat 9/usr.bin/nfsstat X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 19:28:50 -0000 Author: jhb Date: Wed Feb 19 19:28:49 2014 New Revision: 262229 URL: http://svnweb.freebsd.org/changeset/base/262229 Log: MFC 261512,261514: - Partially revert r52493 and change client side interval statistics to report the actual number of RPCs issued, not the theoretical number that would be issued if all caching was disabled. - Use the DELTA() macro to tidy the server-side interval stats code a bit. Modified: stable/8/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/8/usr.bin/nfsstat/ (props changed) Changes in other areas also in this revision: Modified: stable/10/usr.bin/nfsstat/nfsstat.c stable/9/usr.bin/nfsstat/nfsstat.c Directory Properties: stable/10/ (props changed) stable/9/usr.bin/nfsstat/ (props changed) Modified: stable/8/usr.bin/nfsstat/nfsstat.c ============================================================================== --- stable/8/usr.bin/nfsstat/nfsstat.c Wed Feb 19 19:11:14 2014 (r262228) +++ stable/8/usr.bin/nfsstat/nfsstat.c Wed Feb 19 19:28:49 2014 (r262229) @@ -436,14 +436,15 @@ sidewaysintpr(u_int interval, int client if (clientOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(attrcache_hits) + DELTA(attrcache_misses), - DELTA(lookupcache_hits) + DELTA(lookupcache_misses), - DELTA(biocache_readlinks), - DELTA(biocache_reads), - DELTA(biocache_writes), - nfsstats.rpccnt[NFSPROC_RENAME]-lastst.rpccnt[NFSPROC_RENAME], - DELTA(accesscache_hits) + DELTA(accesscache_misses), - DELTA(biocache_readdirs) + DELTA(rpccnt[NFSPROC_GETATTR]), + DELTA(rpccnt[NFSPROC_LOOKUP]), + DELTA(rpccnt[NFSPROC_READLINK]), + DELTA(rpccnt[NFSPROC_READ]), + DELTA(rpccnt[NFSPROC_WRITE]), + DELTA(rpccnt[NFSPROC_RENAME]), + DELTA(rpccnt[NFSPROC_ACCESS]), + DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS]) ); if (widemode) { printf(" %s %s %s %s %s %s", @@ -825,15 +826,15 @@ exp_sidewaysintpr(u_int interval, int cl if (clientOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Client:" : ""), - DELTA(attrcache_hits) + DELTA(attrcache_misses), - DELTA(lookupcache_hits) + DELTA(lookupcache_misses), - DELTA(biocache_readlinks), - DELTA(biocache_reads), - DELTA(biocache_writes), - nfsstats.rpccnt[NFSPROC_RENAME] - - lastst.rpccnt[NFSPROC_RENAME], - DELTA(accesscache_hits) + DELTA(accesscache_misses), - DELTA(biocache_readdirs) + DELTA(rpccnt[NFSPROC_GETATTR]), + DELTA(rpccnt[NFSPROC_LOOKUP]), + DELTA(rpccnt[NFSPROC_READLINK]), + DELTA(rpccnt[NFSPROC_READ]), + DELTA(rpccnt[NFSPROC_WRITE]), + DELTA(rpccnt[NFSPROC_RENAME]), + DELTA(rpccnt[NFSPROC_ACCESS]), + DELTA(rpccnt[NFSPROC_READDIR]) + + DELTA(rpccnt[NFSPROC_READDIRPLUS]) ); if (widemode) { printf(" %s %s %s %s %s %s", @@ -857,24 +858,15 @@ exp_sidewaysintpr(u_int interval, int cl if (serverOnly) { printf("%s %6d %6d %6d %6d %6d %6d %6d %6d", ((clientOnly && serverOnly) ? "Server:" : ""), - nfsstats.srvrpccnt[NFSV4OP_GETATTR] - - lastst.srvrpccnt[NFSV4OP_GETATTR], - nfsstats.srvrpccnt[NFSV4OP_LOOKUP] - - lastst.srvrpccnt[NFSV4OP_LOOKUP], - nfsstats.srvrpccnt[NFSV4OP_READLINK] - - lastst.srvrpccnt[NFSV4OP_READLINK], - nfsstats.srvrpccnt[NFSV4OP_READ] - - lastst.srvrpccnt[NFSV4OP_READ], - nfsstats.srvrpccnt[NFSV4OP_WRITE] - - lastst.srvrpccnt[NFSV4OP_WRITE], - nfsstats.srvrpccnt[NFSV4OP_RENAME] - - lastst.srvrpccnt[NFSV4OP_RENAME], - nfsstats.srvrpccnt[NFSV4OP_ACCESS] - - lastst.srvrpccnt[NFSV4OP_ACCESS], - (nfsstats.srvrpccnt[NFSV4OP_READDIR] - - lastst.srvrpccnt[NFSV4OP_READDIR]) + - (nfsstats.srvrpccnt[NFSV4OP_READDIRPLUS] - - lastst.srvrpccnt[NFSV4OP_READDIRPLUS])); + DELTA(srvrpccnt[NFSV4OP_GETATTR]), + DELTA(srvrpccnt[NFSV4OP_LOOKUP]), + DELTA(srvrpccnt[NFSV4OP_READLINK]), + DELTA(srvrpccnt[NFSV4OP_READ]), + DELTA(srvrpccnt[NFSV4OP_WRITE]), + DELTA(srvrpccnt[NFSV4OP_RENAME]), + DELTA(srvrpccnt[NFSV4OP_ACCESS]), + DELTA(srvrpccnt[NFSV4OP_READDIR]) + + DELTA(srvrpccnt[NFSV4OP_READDIRPLUS])); printf("\n"); lastst = nfsstats; } From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 19:38:26 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 7F75BAC0; Wed, 19 Feb 2014 19:38: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6B6711B5D; Wed, 19 Feb 2014 19:38:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJcQMp029662; Wed, 19 Feb 2014 19:38:26 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJcQtf029661; Wed, 19 Feb 2014 19:38:26 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402191938.s1JJcQtf029661@svn.freebsd.org> From: Eitan Adler Date: Wed, 19 Feb 2014 19:38: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: r262230 - stable/10/sys/dev/ppc X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 19:38:26 -0000 Author: eadler Date: Wed Feb 19 19:38:25 2014 New Revision: 262230 URL: http://svnweb.freebsd.org/changeset/base/262230 Log: MFC r257883: Add support for SIIG x1 pci-e single parallel port card (JJ-E01211-S1) PR: kern/182217 Modified: stable/10/sys/dev/ppc/ppc_pci.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ppc/ppc_pci.c ============================================================================== --- stable/10/sys/dev/ppc/ppc_pci.c Wed Feb 19 19:28:49 2014 (r262229) +++ stable/10/sys/dev/ppc/ppc_pci.c Wed Feb 19 19:38:25 2014 (r262230) @@ -88,6 +88,7 @@ static struct pci_id pci_ids[] = { { 0x80001407, "Lava Computers 2SP-PCI parallel port", 0x10 }, { 0x84031415, "Oxford Semiconductor OX12PCI840 Parallel port", 0x10 }, { 0x95131415, "Oxford Semiconductor OX16PCI954 Parallel port", 0x10 }, + { 0xc1101415, "Oxford Semiconductor OXPCIe952 Parallel port", 0x10 }, { 0x98059710, "NetMos NM9805 1284 Printer port", 0x10 }, { 0x98659710, "MosChip MCS9865 1284 Printer port", 0x10 }, { 0x99019710, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 19:46:44 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9BBEA18C; Wed, 19 Feb 2014 19:46: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 868B61C40; Wed, 19 Feb 2014 19:46:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJki3H033641; Wed, 19 Feb 2014 19:46:44 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJkiYR033640; Wed, 19 Feb 2014 19:46:44 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402191946.s1JJkiYR033640@svn.freebsd.org> From: Eitan Adler Date: Wed, 19 Feb 2014 19:46:44 +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: r262231 - stable/9/sys/dev/ppc X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 19:46:44 -0000 Author: eadler Date: Wed Feb 19 19:46:44 2014 New Revision: 262231 URL: http://svnweb.freebsd.org/changeset/base/262231 Log: MFC r257883: Add support for SIIG x1 pci-e single parallel port card (JJ-E01211-S1) PR: kern/182217 Modified: stable/9/sys/dev/ppc/ppc_pci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ppc/ppc_pci.c ============================================================================== --- stable/9/sys/dev/ppc/ppc_pci.c Wed Feb 19 19:38:25 2014 (r262230) +++ stable/9/sys/dev/ppc/ppc_pci.c Wed Feb 19 19:46:44 2014 (r262231) @@ -88,6 +88,7 @@ static struct pci_id pci_ids[] = { { 0x80001407, "Lava Computers 2SP-PCI parallel port", 0x10 }, { 0x84031415, "Oxford Semiconductor OX12PCI840 Parallel port", 0x10 }, { 0x95131415, "Oxford Semiconductor OX16PCI954 Parallel port", 0x10 }, + { 0xc1101415, "Oxford Semiconductor OXPCIe952 Parallel port", 0x10 }, { 0x98059710, "NetMos NM9805 1284 Printer port", 0x10 }, { 0x98659710, "MosChip MCS9865 1284 Printer port", 0x10 }, { 0x99019710, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, From owner-svn-src-stable@FreeBSD.ORG Wed Feb 19 19:47:08 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 953C52CD; Wed, 19 Feb 2014 19:47: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7EA0C1C47; Wed, 19 Feb 2014 19:47:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1JJl8ud033730; Wed, 19 Feb 2014 19:47:08 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1JJl8r9033729; Wed, 19 Feb 2014 19:47:08 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201402191947.s1JJl8r9033729@svn.freebsd.org> From: Eitan Adler Date: Wed, 19 Feb 2014 19:47:08 +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: r262232 - stable/8/sys/dev/ppc X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Feb 2014 19:47:08 -0000 Author: eadler Date: Wed Feb 19 19:47:08 2014 New Revision: 262232 URL: http://svnweb.freebsd.org/changeset/base/262232 Log: MFC r257883: Add support for SIIG x1 pci-e single parallel port card (JJ-E01211-S1) PR: kern/182217 Modified: stable/8/sys/dev/ppc/ppc_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/ppc/ (props changed) Modified: stable/8/sys/dev/ppc/ppc_pci.c ============================================================================== --- stable/8/sys/dev/ppc/ppc_pci.c Wed Feb 19 19:46:44 2014 (r262231) +++ stable/8/sys/dev/ppc/ppc_pci.c Wed Feb 19 19:47:08 2014 (r262232) @@ -88,6 +88,7 @@ static struct pci_id pci_ids[] = { { 0x80001407, "Lava Computers 2SP-PCI parallel port", 0x10 }, { 0x84031415, "Oxford Semiconductor OX12PCI840 Parallel port", 0x10 }, { 0x95131415, "Oxford Semiconductor OX16PCI954 Parallel port", 0x10 }, + { 0xc1101415, "Oxford Semiconductor OXPCIe952 Parallel port", 0x10 }, { 0x98059710, "NetMos NM9805 1284 Printer port", 0x10 }, { 0x99019710, "MosChip MCS9901 PCIe to Peripheral Controller", 0x10 }, { 0xffff } From owner-svn-src-stable@FreeBSD.ORG Thu Feb 20 04:50:13 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C34BB7F7; Thu, 20 Feb 2014 04:50: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ACACE1FC7; Thu, 20 Feb 2014 04:50:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1K4oDiK054861; Thu, 20 Feb 2014 04:50:13 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1K4oDBC054860; Thu, 20 Feb 2014 04:50:13 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201402200450.s1K4oDBC054860@svn.freebsd.org> From: Luigi Rizzo Date: Thu, 20 Feb 2014 04:50:13 +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: r262237 - stable/9/sys/dev/netmap X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2014 04:50:13 -0000 Author: luigi Date: Thu Feb 20 04:50:13 2014 New Revision: 262237 URL: http://svnweb.freebsd.org/changeset/base/262237 Log: make this code compile with NOINET Modified: stable/9/sys/dev/netmap/netmap_freebsd.c Modified: stable/9/sys/dev/netmap/netmap_freebsd.c ============================================================================== --- stable/9/sys/dev/netmap/netmap_freebsd.c Thu Feb 20 01:48:25 2014 (r262236) +++ stable/9/sys/dev/netmap/netmap_freebsd.c Thu Feb 20 04:50:13 2014 (r262237) @@ -101,6 +101,7 @@ uint16_t nm_csum_ipv4(struct nm_iphdr *i void nm_csum_tcpudp_ipv4(struct nm_iphdr *iph, void *data, size_t datalen, uint16_t *check) { +#ifdef INET uint16_t pseudolen = datalen + iph->protocol; /* Compute and insert the pseudo-header cheksum. */ @@ -110,6 +111,13 @@ void nm_csum_tcpudp_ipv4(struct nm_iphdr * (includes the pseudo-header). */ *check = nm_csum_fold(nm_csum_raw(data, datalen, 0)); +#else + static int notsupported = 0; + if (!notsupported) { + notsupported = 1; + D("inet4 segmentation not supported"); + } +#endif } void nm_csum_tcpudp_ipv6(struct nm_ipv6hdr *ip6h, void *data, From owner-svn-src-stable@FreeBSD.ORG Thu Feb 20 08:56:00 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 838D8B71; Thu, 20 Feb 2014 08:56: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6D45F154E; Thu, 20 Feb 2014 08:56:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1K8u0cF054975; Thu, 20 Feb 2014 08:56:00 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1K8u0lf054974; Thu, 20 Feb 2014 08:56:00 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402200856.s1K8u0lf054974@svn.freebsd.org> From: Christian Brueffer Date: Thu, 20 Feb 2014 08:56:00 +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: r262239 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2014 08:56:00 -0000 Author: brueffer Date: Thu Feb 20 08:55:59 2014 New Revision: 262239 URL: http://svnweb.freebsd.org/changeset/base/262239 Log: MFC: r261858 Fix a bug in be_uuid_dec(); it called le16dec() instead of be16dec(), probably due to copy+pasting le_uuid_dec(). PR: 146588 Submitted by: Erwin Rol Reviewed by: marcel Modified: stable/10/sys/kern/kern_uuid.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/kern_uuid.c ============================================================================== --- stable/10/sys/kern/kern_uuid.c Thu Feb 20 04:56:55 2014 (r262238) +++ stable/10/sys/kern/kern_uuid.c Thu Feb 20 08:55:59 2014 (r262239) @@ -371,7 +371,7 @@ be_uuid_dec(void const *buf, struct uuid p = buf; uuid->time_low = be32dec(p); - uuid->time_mid = le16dec(p + 4); + uuid->time_mid = be16dec(p + 4); uuid->time_hi_and_version = be16dec(p + 6); uuid->clock_seq_hi_and_reserved = p[8]; uuid->clock_seq_low = p[9]; From owner-svn-src-stable@FreeBSD.ORG Thu Feb 20 08:58:05 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C4AEDCB7; Thu, 20 Feb 2014 08:58: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id AFF051567; Thu, 20 Feb 2014 08:58:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1K8w55f055264; Thu, 20 Feb 2014 08:58:05 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1K8w5wS055263; Thu, 20 Feb 2014 08:58:05 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402200858.s1K8w5wS055263@svn.freebsd.org> From: Christian Brueffer Date: Thu, 20 Feb 2014 08:58:05 +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: r262240 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2014 08:58:05 -0000 Author: brueffer Date: Thu Feb 20 08:58:05 2014 New Revision: 262240 URL: http://svnweb.freebsd.org/changeset/base/262240 Log: MFC: r261858 Fix a bug in be_uuid_dec(); it called le16dec() instead of be16dec(), probably due to copy+pasting le_uuid_dec(). PR: 146588 Submitted by: Erwin Rol Reviewed by: marcel Modified: stable/9/sys/kern/kern_uuid.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_uuid.c ============================================================================== --- stable/9/sys/kern/kern_uuid.c Thu Feb 20 08:55:59 2014 (r262239) +++ stable/9/sys/kern/kern_uuid.c Thu Feb 20 08:58:05 2014 (r262240) @@ -314,7 +314,7 @@ be_uuid_dec(void const *buf, struct uuid p = buf; uuid->time_low = be32dec(p); - uuid->time_mid = le16dec(p + 4); + uuid->time_mid = be16dec(p + 4); uuid->time_hi_and_version = be16dec(p + 6); uuid->clock_seq_hi_and_reserved = p[8]; uuid->clock_seq_low = p[9]; From owner-svn-src-stable@FreeBSD.ORG Thu Feb 20 09:00:14 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 11C28E32; Thu, 20 Feb 2014 09:00: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F1C671593; Thu, 20 Feb 2014 09:00:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1K90DXB056208; Thu, 20 Feb 2014 09:00:13 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1K90D2L056207; Thu, 20 Feb 2014 09:00:13 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402200900.s1K90D2L056207@svn.freebsd.org> From: Christian Brueffer Date: Thu, 20 Feb 2014 09:00:13 +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: r262241 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2014 09:00:14 -0000 Author: brueffer Date: Thu Feb 20 09:00:13 2014 New Revision: 262241 URL: http://svnweb.freebsd.org/changeset/base/262241 Log: MFC: r261858 Fix a bug in be_uuid_dec(); it called le16dec() instead of be16dec(), probably due to copy+pasting le_uuid_dec(). PR: 146588 Submitted by: Erwin Rol Reviewed by: marcel Modified: stable/8/sys/kern/kern_uuid.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_uuid.c ============================================================================== --- stable/8/sys/kern/kern_uuid.c Thu Feb 20 08:58:05 2014 (r262240) +++ stable/8/sys/kern/kern_uuid.c Thu Feb 20 09:00:13 2014 (r262241) @@ -314,7 +314,7 @@ be_uuid_dec(void const *buf, struct uuid p = buf; uuid->time_low = be32dec(p); - uuid->time_mid = le16dec(p + 4); + uuid->time_mid = be16dec(p + 4); uuid->time_hi_and_version = be16dec(p + 6); uuid->clock_seq_hi_and_reserved = p[8]; uuid->clock_seq_low = p[9]; From owner-svn-src-stable@FreeBSD.ORG Thu Feb 20 20:34:06 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BF500EE6; Thu, 20 Feb 2014 20:34: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A4EE41C3A; Thu, 20 Feb 2014 20:34:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KKY6JZ041403; Thu, 20 Feb 2014 20:34:06 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KKY2dZ041374; Thu, 20 Feb 2014 20:34:02 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402202034.s1KKY2dZ041374@svn.freebsd.org> From: Peter Wemm Date: Thu, 20 Feb 2014 20:34:02 +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: r262253 - in stable/10: contrib/apr-util contrib/apr-util/crypto contrib/apr-util/dbd contrib/apr-util/dbm contrib/apr-util/include contrib/apr-util/memcache contrib/apr-util/misc contr... X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2014 20:34:06 -0000 Author: peter Date: Thu Feb 20 20:34:01 2014 New Revision: 262253 URL: http://svnweb.freebsd.org/changeset/base/262253 Log: MFC r257129,257936,258084,258569,258602,262250,262251 svn-1.8.4, 1.8.5, 1.8.8 and self-contained private support libraries Deleted: stable/10/contrib/apr-util/test/testssl.c Modified: stable/10/contrib/apr-util/CHANGES stable/10/contrib/apr-util/apr-util.spec stable/10/contrib/apr-util/configure stable/10/contrib/apr-util/crypto/apr_crypto.c stable/10/contrib/apr-util/dbd/apr_dbd.c stable/10/contrib/apr-util/dbd/apr_dbd_odbc.c stable/10/contrib/apr-util/dbm/apr_dbm.c stable/10/contrib/apr-util/include/apr_buckets.h stable/10/contrib/apr-util/include/apr_dbd.h stable/10/contrib/apr-util/include/apr_hooks.h stable/10/contrib/apr-util/include/apr_optional_hooks.h stable/10/contrib/apr-util/include/apr_queue.h stable/10/contrib/apr-util/include/apr_reslist.h stable/10/contrib/apr-util/include/apu.hw stable/10/contrib/apr-util/include/apu_version.h stable/10/contrib/apr-util/libaprutil.rc stable/10/contrib/apr-util/memcache/apr_memcache.c stable/10/contrib/apr-util/misc/apu_dso.c stable/10/contrib/apr-util/test/abts.c stable/10/contrib/apr-util/test/testpass.c stable/10/contrib/subversion/CHANGES stable/10/contrib/subversion/INSTALL stable/10/contrib/subversion/Makefile.in stable/10/contrib/subversion/NOTICE stable/10/contrib/subversion/build-outputs.mk stable/10/contrib/subversion/build.conf stable/10/contrib/subversion/configure stable/10/contrib/subversion/configure.ac stable/10/contrib/subversion/subversion/include/private/svn_auth_private.h stable/10/contrib/subversion/subversion/include/private/svn_client_private.h stable/10/contrib/subversion/subversion/include/private/svn_diff_tree.h stable/10/contrib/subversion/subversion/include/private/svn_mutex.h stable/10/contrib/subversion/subversion/include/private/svn_subr_private.h stable/10/contrib/subversion/subversion/include/svn_auth.h stable/10/contrib/subversion/subversion/include/svn_client.h stable/10/contrib/subversion/subversion/include/svn_config.h stable/10/contrib/subversion/subversion/include/svn_diff.h stable/10/contrib/subversion/subversion/include/svn_dirent_uri.h stable/10/contrib/subversion/subversion/include/svn_io.h stable/10/contrib/subversion/subversion/include/svn_repos.h stable/10/contrib/subversion/subversion/include/svn_types.h stable/10/contrib/subversion/subversion/include/svn_version.h stable/10/contrib/subversion/subversion/include/svn_wc.h stable/10/contrib/subversion/subversion/libsvn_client/commit.c stable/10/contrib/subversion/subversion/libsvn_client/copy.c stable/10/contrib/subversion/subversion/libsvn_client/externals.c stable/10/contrib/subversion/subversion/libsvn_client/log.c stable/10/contrib/subversion/subversion/libsvn_client/merge.c stable/10/contrib/subversion/subversion/libsvn_client/mergeinfo.c stable/10/contrib/subversion/subversion/libsvn_client/prop_commands.c stable/10/contrib/subversion/subversion/libsvn_client/update.c stable/10/contrib/subversion/subversion/libsvn_client/util.c stable/10/contrib/subversion/subversion/libsvn_diff/diff_file.c stable/10/contrib/subversion/subversion/libsvn_fs/fs-loader.c stable/10/contrib/subversion/subversion/libsvn_fs_base/fs.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/fs_fs.c stable/10/contrib/subversion/subversion/libsvn_fs_fs/rep-cache-db.h stable/10/contrib/subversion/subversion/libsvn_fs_fs/rep-cache.c stable/10/contrib/subversion/subversion/libsvn_ra/ra_loader.c stable/10/contrib/subversion/subversion/libsvn_ra/ra_loader.h stable/10/contrib/subversion/subversion/libsvn_ra_local/ra_plugin.c stable/10/contrib/subversion/subversion/libsvn_ra_local/split_url.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/commit.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/ra_serf.h stable/10/contrib/subversion/subversion/libsvn_ra_serf/replay.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/serf.c stable/10/contrib/subversion/subversion/libsvn_ra_serf/util.c stable/10/contrib/subversion/subversion/libsvn_ra_svn/client.c stable/10/contrib/subversion/subversion/libsvn_repos/commit.c stable/10/contrib/subversion/subversion/libsvn_repos/reporter.c stable/10/contrib/subversion/subversion/libsvn_subr/auth.c stable/10/contrib/subversion/subversion/libsvn_subr/cache-membuffer.c stable/10/contrib/subversion/subversion/libsvn_subr/cache_config.c stable/10/contrib/subversion/subversion/libsvn_subr/cmdline.c stable/10/contrib/subversion/subversion/libsvn_subr/config_auth.c stable/10/contrib/subversion/subversion/libsvn_subr/deprecated.c stable/10/contrib/subversion/subversion/libsvn_subr/dirent_uri.c stable/10/contrib/subversion/subversion/libsvn_subr/internal_statements.h stable/10/contrib/subversion/subversion/libsvn_subr/io.c stable/10/contrib/subversion/subversion/libsvn_subr/sqlite.c stable/10/contrib/subversion/subversion/libsvn_subr/sqlite3wrapper.c stable/10/contrib/subversion/subversion/libsvn_subr/subst.c stable/10/contrib/subversion/subversion/libsvn_subr/sysinfo.c stable/10/contrib/subversion/subversion/libsvn_subr/utf.c stable/10/contrib/subversion/subversion/libsvn_subr/version.c stable/10/contrib/subversion/subversion/libsvn_subr/win32_crashrpt.c stable/10/contrib/subversion/subversion/libsvn_subr/win32_crypto.c stable/10/contrib/subversion/subversion/libsvn_wc/conflicts.h stable/10/contrib/subversion/subversion/libsvn_wc/diff.h stable/10/contrib/subversion/subversion/libsvn_wc/diff_editor.c stable/10/contrib/subversion/subversion/libsvn_wc/diff_local.c stable/10/contrib/subversion/subversion/libsvn_wc/info.c stable/10/contrib/subversion/subversion/libsvn_wc/old-and-busted.c stable/10/contrib/subversion/subversion/libsvn_wc/update_editor.c stable/10/contrib/subversion/subversion/libsvn_wc/upgrade.c stable/10/contrib/subversion/subversion/libsvn_wc/wc-checks.h stable/10/contrib/subversion/subversion/libsvn_wc/wc-metadata.h stable/10/contrib/subversion/subversion/libsvn_wc/wc-metadata.sql stable/10/contrib/subversion/subversion/libsvn_wc/wc-queries.h stable/10/contrib/subversion/subversion/libsvn_wc/wc-queries.sql stable/10/contrib/subversion/subversion/libsvn_wc/wc.h stable/10/contrib/subversion/subversion/libsvn_wc/wc_db.c stable/10/contrib/subversion/subversion/libsvn_wc/wc_db.h stable/10/contrib/subversion/subversion/libsvn_wc/wc_db_private.h stable/10/contrib/subversion/subversion/libsvn_wc/wc_db_update_move.c stable/10/contrib/subversion/subversion/libsvn_wc/wc_db_util.c stable/10/contrib/subversion/subversion/svn/cl.h stable/10/contrib/subversion/subversion/svn/conflict-callbacks.c stable/10/contrib/subversion/subversion/svn/status-cmd.c stable/10/contrib/subversion/subversion/svn/status.c stable/10/contrib/subversion/subversion/svn/svn.c stable/10/contrib/subversion/subversion/svnadmin/svnadmin.c stable/10/contrib/subversion/subversion/svndumpfilter/svndumpfilter.c stable/10/contrib/subversion/subversion/svnlook/svnlook.c stable/10/contrib/subversion/subversion/svnmucc/svnmucc.c stable/10/contrib/subversion/subversion/svnserve/svnserve.c stable/10/contrib/subversion/subversion/svnsync/svnsync.c stable/10/contrib/subversion/subversion/svnversion/svnversion.c stable/10/usr.bin/svn/lib/libapr_util/apu_config.h stable/10/usr.bin/svn/svn/Makefile stable/10/usr.bin/svn/svn_private_config.h Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/apr-util/CHANGES ============================================================================== --- stable/10/contrib/apr-util/CHANGES Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/CHANGES Thu Feb 20 20:34:01 2014 (r262253) @@ -1,4 +1,23 @@ -*- coding: utf-8 -*- +Changes with APR-util 1.5.3 + + *) Cygwin: Use correct file extension when loading APR DSOs. PR 55587. + [Carlo Bramini ] + + *) Add experimental cmake-based build system for Windows. Refer to + README.cmake for more information. [Jeff Trawick, Tom Donovan] + + *) Fix warnings in odbc driver on 64bit systems. + PR 55197 [Tom Donovan] + + *) Add support to apr_memcache for unix domain sockets. PR 54573 [Remi + Gacogne ] + + *) Add support for Berkeley DB 6.0. [Rainer Jung] + + *) Improve platform detection for bundled expat by updating + config.guess and config.sub. [Rainer Jung] + Changes with APR-util 1.5.2 *) Windows: Add command line makefiles. [Gregg Smith] Modified: stable/10/contrib/apr-util/apr-util.spec ============================================================================== --- stable/10/contrib/apr-util/apr-util.spec Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/apr-util.spec Thu Feb 20 20:34:01 2014 (r262253) @@ -3,7 +3,7 @@ Summary: Apache Portable Runtime Utility library Name: apr-util -Version: 1.5.2 +Version: 1.5.3 Release: 1 License: Apache Software License Group: System Environment/Libraries Modified: stable/10/contrib/apr-util/configure ============================================================================== --- stable/10/contrib/apr-util/configure Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/configure Thu Feb 20 20:34:01 2014 (r262253) @@ -1440,7 +1440,7 @@ Optional Packages: --with-ldap-lib=path path to ldap lib file --with-ldap=library ldap library to use --with-dbm=DBM choose the DBM type to use. - DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db4X,db5X} + DBM={sdbm,gdbm,ndbm,db,db1,db185,db2,db3,db4,db4X,db5X,db6X} for some X=0,...,9 --with-gdbm=DIR enable GDBM support --with-ndbm=PATH Find the NDBM header and library in `PATH/include' @@ -11218,8 +11218,10 @@ fi fi - test ${apu_has_ldap} != "1" && as_fn_error $? "could not find an LDAP library" "$LINENO" 5 - test ${apu_has_ldap} == "1" && + if test ${apu_has_ldap} != "1"; then + as_fn_error $? "could not find an LDAP library" "$LINENO" 5 + else + if test "x$LDADD_ldap" = "x"; then test "x$silent" != "xyes" && echo " setting LDADD_ldap to \"$LDADD_ldap_found\"" LDADD_ldap="$LDADD_ldap_found" @@ -11240,6 +11242,7 @@ fi done fi + fi as_ac_Lib=`$as_echo "ac_cv_lib_$apu_liblber_name''_ber_init" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ber_init in -l$apu_liblber_name" >&5 $as_echo_n "checking for ber_init in -l$apu_liblber_name... " >&6; } @@ -11617,6 +11620,7 @@ fi dbm_list="$dbm_list, db$db_version" db_version=`expr $db_version + 1` done + dbm_list="$dbm_list, db60" # Check whether --with-dbm was given. @@ -15708,7 +15712,7 @@ fi as_fn_error $? "Berkeley db3 not found" "$LINENO" 5 fi ;; - db[45][0-9]) + db[456][0-9]) db_major=`echo "$requested" | sed -e 's/db//' -e 's/.$//'` db_minor=`echo "$requested" | sed -e 's/db//' -e 's/.//'` @@ -16113,7 +16117,7 @@ fi as_fn_error $? "Berkeley db$db_major not found" "$LINENO" 5 fi ;; - db[45]) + db[456]) db_major=`echo "$requested" | sed -e 's/db//'` # Start version search at version x.9 db_minor=9 @@ -18561,11 +18565,11 @@ fi eval "apu_use_$requested=1" apu_default_dbm=$requested ;; - db185 | db[12345]) + db185 | db[123456]) apu_use_db=1 apu_default_dbm=$requested ;; - db[45][0-9]) + db[456][0-9]) apu_use_db=1 apu_default_dbm=`echo $requested | sed -e 's/.$//'` ;; Modified: stable/10/contrib/apr-util/crypto/apr_crypto.c ============================================================================== --- stable/10/contrib/apr-util/crypto/apr_crypto.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/crypto/apr_crypto.c Thu Feb 20 20:34:01 2014 (r262253) @@ -100,7 +100,9 @@ APU_DECLARE(apr_status_t) apr_crypto_ini } /* Top level pool scope, need process-scope lifetime */ - for (parent = pool; parent; parent = apr_pool_parent_get(pool)) + for (parent = apr_pool_parent_get(pool); + parent && parent != pool; + parent = apr_pool_parent_get(pool)) pool = parent; #if APU_DSO_BUILD /* deprecate in 2.0 - permit implicit initialization */ @@ -176,7 +178,7 @@ APU_DECLARE(apr_status_t) apr_crypto_get #if defined(NETWARE) apr_snprintf(modname, sizeof(modname), "crypto%s.nlm", name); -#elif defined(WIN32) +#elif defined(WIN32) || defined(__CYGWIN__) apr_snprintf(modname, sizeof(modname), "apr_crypto_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", name); #else Modified: stable/10/contrib/apr-util/dbd/apr_dbd.c ============================================================================== --- stable/10/contrib/apr-util/dbd/apr_dbd.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/dbd/apr_dbd.c Thu Feb 20 20:34:01 2014 (r262253) @@ -102,8 +102,10 @@ APU_DECLARE(apr_status_t) apr_dbd_init(a } /* Top level pool scope, need process-scope lifetime */ - for (parent = pool; parent; parent = apr_pool_parent_get(pool)) - pool = parent; + for (parent = apr_pool_parent_get(pool); + parent && parent != pool; + parent = apr_pool_parent_get(pool)) + pool = parent; #if APU_DSO_BUILD /* deprecate in 2.0 - permit implicit initialization */ apu_dso_init(pool); @@ -184,7 +186,7 @@ APU_DECLARE(apr_status_t) apr_dbd_get_dr #if defined(NETWARE) apr_snprintf(modname, sizeof(modname), "dbd%s.nlm", name); -#elif defined(WIN32) +#elif defined(WIN32) || defined(__CYGWIN__) apr_snprintf(modname, sizeof(modname), "apr_dbd_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", name); #else @@ -204,7 +206,7 @@ APU_DECLARE(apr_status_t) apr_dbd_get_dr } apu_dso_mutex_unlock(); -#else /* not builtin and !APR_HAS_DSO => not implemented */ +#else /* not builtin and !APU_DSO_BUILD => not implemented */ rv = APR_ENOTIMPL; #endif Modified: stable/10/contrib/apr-util/dbd/apr_dbd_odbc.c ============================================================================== --- stable/10/contrib/apr-util/dbd/apr_dbd_odbc.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/dbd/apr_dbd_odbc.c Thu Feb 20 20:34:01 2014 (r262253) @@ -114,9 +114,9 @@ struct apr_dbd_t char lastError[MAX_ERROR_STRING]; int defaultBufferSize; /* used for CLOBs in text mode, * and when fld size is indeterminate */ - int transaction_mode; - int dboptions; /* driver options re SQLGetData */ - int default_transaction_mode; + intptr_t transaction_mode; + intptr_t dboptions; /* driver options re SQLGetData */ + intptr_t default_transaction_mode; int can_commit; /* controls end_trans behavior */ }; @@ -359,7 +359,7 @@ static SQLRETURN odbc_set_result_column( SQLHANDLE stmt) { SQLRETURN rc; - int maxsize, textsize, realsize, type, isunsigned = 1; + intptr_t maxsize, textsize, realsize, type, isunsigned = 1; /* discover the sql type */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_UNSIGNED, NULL, 0, NULL, @@ -409,7 +409,7 @@ static SQLRETURN odbc_set_result_column( type = SQL_C_CHAR; } - res->coltypes[icol] = type; + res->coltypes[icol] = (SQLSMALLINT)type; /* size if retrieved as text */ rc = SQLColAttribute(stmt, icol + 1, SQL_DESC_DISPLAY_SIZE, NULL, 0, @@ -441,12 +441,12 @@ static SQLRETURN odbc_set_result_column( res->colptrs[icol] = NULL; res->colstate[icol] = COL_AVAIL; - res->colsizes[icol] = maxsize; + res->colsizes[icol] = (SQLINTEGER)maxsize; rc = SQL_SUCCESS; } else { res->colptrs[icol] = apr_pcalloc(res->pool, maxsize); - res->colsizes[icol] = maxsize; + res->colsizes[icol] = (SQLINTEGER)maxsize; if (res->apr_dbd->dboptions & SQL_GD_BOUND) { /* we are allowed to call SQLGetData if we need to */ rc = SQLBindCol(stmt, icol + 1, res->coltypes[icol], @@ -747,7 +747,7 @@ static void *odbc_get(const apr_dbd_row_ SQLRETURN rc; SQLLEN indicator; int state = row->res->colstate[col]; - int options = row->res->apr_dbd->dboptions; + intptr_t options = row->res->apr_dbd->dboptions; switch (state) { case (COL_UNAVAIL): @@ -817,13 +817,13 @@ static apr_status_t odbc_parse_params(ap int *connect, SQLCHAR **datasource, SQLCHAR **user, SQLCHAR **password, int *defaultBufferSize, int *nattrs, - int **attrs, int **attrvals) + int **attrs, intptr_t **attrvals) { char *seps, *last, *next, *name[MAX_PARAMS], *val[MAX_PARAMS]; int nparams = 0, i, j; *attrs = apr_pcalloc(pool, MAX_PARAMS * sizeof(char *)); - *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(int)); + *attrvals = apr_pcalloc(pool, MAX_PARAMS * sizeof(intptr_t)); *nattrs = 0; seps = DEFAULTSEPS; name[nparams] = apr_strtok(apr_pstrdup(pool, params), seps, &last); @@ -1062,7 +1062,8 @@ static apr_dbd_t *odbc_open(apr_pool_t * SQLHANDLE err_h = NULL; SQLCHAR *datasource = (SQLCHAR *)"", *user = (SQLCHAR *)"", *password = (SQLCHAR *)""; - int nattrs = 0, *attrs = NULL, *attrvals = NULL, connect = 0; + int nattrs = 0, *attrs = NULL, connect = 0; + intptr_t *attrvals = NULL; err_step = "SQLAllocHandle (SQL_HANDLE_DBC)"; err_htype = SQL_HANDLE_ENV; @@ -1116,10 +1117,10 @@ static apr_dbd_t *odbc_open(apr_pool_t * handle->default_transaction_mode = 0; handle->can_commit = APR_DBD_TRANSACTION_IGNORE_ERRORS; SQLGetInfo(hdbc, SQL_DEFAULT_TXN_ISOLATION, - &(handle->default_transaction_mode), sizeof(int), NULL); + &(handle->default_transaction_mode), sizeof(intptr_t), NULL); handle->transaction_mode = handle->default_transaction_mode; SQLGetInfo(hdbc, SQL_GETDATA_EXTENSIONS ,&(handle->dboptions), - sizeof(int), NULL); + sizeof(intptr_t), NULL); apr_pool_cleanup_register(pool, handle, odbc_close_cleanup, apr_pool_cleanup_null); return handle; } Modified: stable/10/contrib/apr-util/dbm/apr_dbm.c ============================================================================== --- stable/10/contrib/apr-util/dbm/apr_dbm.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/dbm/apr_dbm.c Thu Feb 20 20:34:01 2014 (r262253) @@ -129,8 +129,10 @@ static apr_status_t dbm_open_type(apr_db apr_pool_t *parent; /* Top level pool scope, need process-scope lifetime */ - for (parent = pool; parent; parent = apr_pool_parent_get(pool)) - pool = parent; + for (parent = apr_pool_parent_get(pool); + parent && parent != pool; + parent = apr_pool_parent_get(pool)) + pool = parent; /* deprecate in 2.0 - permit implicit initialization */ apu_dso_init(pool); @@ -162,7 +164,7 @@ static apr_status_t dbm_open_type(apr_db #if defined(NETWARE) apr_snprintf(modname, sizeof(modname), "dbm%s.nlm", type); -#elif defined(WIN32) +#elif defined(WIN32) || defined (__CYGWIN__) apr_snprintf(modname, sizeof(modname), "apr_dbm_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", type); #else Modified: stable/10/contrib/apr-util/include/apr_buckets.h ============================================================================== --- stable/10/contrib/apr-util/include/apr_buckets.h Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apr_buckets.h Thu Feb 20 20:34:01 2014 (r262253) @@ -351,9 +351,9 @@ typedef apr_status_t (*apr_brigade_flush #define APR_BRIGADE_LAST(b) APR_RING_LAST(&(b)->list) /** - * Insert a list of buckets at the front of a brigade + * Insert a single bucket at the front of a brigade * @param b The brigade to add to - * @param e The first bucket in a list of buckets to insert + * @param e The bucket to insert */ #define APR_BRIGADE_INSERT_HEAD(b, e) do { \ apr_bucket *ap__b = (e); \ @@ -362,9 +362,9 @@ typedef apr_status_t (*apr_brigade_flush } while (0) /** - * Insert a list of buckets at the end of a brigade + * Insert a single bucket at the end of a brigade * @param b The brigade to add to - * @param e The first bucket in a list of buckets to insert + * @param e The bucket to insert */ #define APR_BRIGADE_INSERT_TAIL(b, e) do { \ apr_bucket *ap__b = (e); \ @@ -393,9 +393,9 @@ typedef apr_status_t (*apr_brigade_flush } while (0) /** - * Insert a list of buckets before a specified bucket + * Insert a single bucket before a specified bucket * @param a The bucket to insert before - * @param b The buckets to insert + * @param b The bucket to insert */ #define APR_BUCKET_INSERT_BEFORE(a, b) do { \ apr_bucket *ap__a = (a), *ap__b = (b); \ @@ -404,9 +404,9 @@ typedef apr_status_t (*apr_brigade_flush } while (0) /** - * Insert a list of buckets after a specified bucket + * Insert a single bucket after a specified bucket * @param a The bucket to insert after - * @param b The buckets to insert + * @param b The bucket to insert */ #define APR_BUCKET_INSERT_AFTER(a, b) do { \ apr_bucket *ap__a = (a), *ap__b = (b); \ Modified: stable/10/contrib/apr-util/include/apr_dbd.h ============================================================================== --- stable/10/contrib/apr-util/include/apr_dbd.h Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apr_dbd.h Thu Feb 20 20:34:01 2014 (r262253) @@ -107,10 +107,10 @@ APU_DECLARE(apr_status_t) apr_dbd_get_dr /** apr_dbd_open_ex: open a connection to a backend * + * @param driver - driver struct. * @param pool - working pool * @param params - arguments to driver (implementation-dependent) * @param handle - pointer to handle to return - * @param driver - driver struct. * @param error - descriptive error. * @return APR_SUCCESS for success * @return APR_EGENERAL if driver exists but connection failed @@ -147,10 +147,10 @@ APU_DECLARE(apr_status_t) apr_dbd_open_e /** apr_dbd_open: open a connection to a backend * + * @param driver - driver struct. * @param pool - working pool * @param params - arguments to driver (implementation-dependent) * @param handle - pointer to handle to return - * @param driver - driver struct. * @return APR_SUCCESS for success * @return APR_EGENERAL if driver exists but connection failed * @see apr_dbd_open_ex @@ -161,8 +161,8 @@ APU_DECLARE(apr_status_t) apr_dbd_open(c /** apr_dbd_close: close a connection to a backend * - * @param handle - handle to close * @param driver - driver struct. + * @param handle - handle to close * @return APR_SUCCESS for success or error status */ APU_DECLARE(apr_status_t) apr_dbd_close(const apr_dbd_driver_t *driver, Modified: stable/10/contrib/apr-util/include/apr_hooks.h ============================================================================== --- stable/10/contrib/apr-util/include/apr_hooks.h Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apr_hooks.h Thu Feb 20 20:34:01 2014 (r262253) @@ -313,24 +313,24 @@ APU_DECLARE_DATA extern apr_pool_t *apr_ /** * A global variable to determine if debugging information about the - * hooks functions should be printed + * hooks functions should be printed. */ APU_DECLARE_DATA extern int apr_hook_debug_enabled; /** - * The name of the module that is currently registering a function + * The name of the module that is currently registering a function. */ APU_DECLARE_DATA extern const char *apr_hook_debug_current; /** - * Register a hook function to be sorted + * Register a hook function to be sorted. * @param szHookName The name of the Hook the function is registered for * @param aHooks The array which stores all of the functions for this hook */ APU_DECLARE(void) apr_hook_sort_register(const char *szHookName, apr_array_header_t **aHooks); /** - * Sort all of the registerd functions for a given hook + * Sort all of the registered functions for a given hook. */ APU_DECLARE(void) apr_hook_sort_all(void); Modified: stable/10/contrib/apr-util/include/apr_optional_hooks.h ============================================================================== --- stable/10/contrib/apr-util/include/apr_optional_hooks.h Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apr_optional_hooks.h Thu Feb 20 20:34:01 2014 (r262253) @@ -33,11 +33,11 @@ extern "C" { * @{ */ /** - * Function to implemnt the APR_OPTIONAL_HOOK Macro + * Function to implement the APR_OPTIONAL_HOOK Macro * @internal * @see APR_OPTIONAL_HOOK * - * @param name The name of the hook + * @param szName The name of the hook * @param pfn A pointer to a function that will be called * @param aszPre a NULL-terminated array of strings that name modules whose hooks should precede this one * @param aszSucc a NULL-terminated array of strings that name modules whose hooks should succeed this one Modified: stable/10/contrib/apr-util/include/apr_queue.h ============================================================================== --- stable/10/contrib/apr-util/include/apr_queue.h Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apr_queue.h Thu Feb 20 20:34:01 2014 (r262253) @@ -22,7 +22,7 @@ * @brief Thread Safe FIFO bounded queue * @note Since most implementations of the queue are backed by a condition * variable implementation, it isn't available on systems without threads. - * Although condition variables are some times available without threads. + * Although condition variables are sometimes available without threads. */ #include "apu.h" Modified: stable/10/contrib/apr-util/include/apr_reslist.h ============================================================================== --- stable/10/contrib/apr-util/include/apr_reslist.h Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apr_reslist.h Thu Feb 20 20:34:01 2014 (r262253) @@ -44,7 +44,7 @@ typedef struct apr_reslist_t apr_reslist /* Generic constructor called by resource list when it needs to create a * resource. * @param resource opaque resource - * @param param flags + * @param params flags * @param pool Pool */ typedef apr_status_t (*apr_reslist_constructor)(void **resource, void *params, @@ -53,7 +53,7 @@ typedef apr_status_t (*apr_reslist_const /* Generic destructor called by resource list when it needs to destroy a * resource. * @param resource opaque resource - * @param param flags + * @param params flags * @param pool Pool */ typedef apr_status_t (*apr_reslist_destructor)(void *resource, void *params, @@ -111,12 +111,17 @@ APU_DECLARE(apr_status_t) apr_reslist_de * Retrieve a resource from the list, creating a new one if necessary. * If we have met our maximum number of resources, we will block * until one becomes available. + * @param reslist The resource list. + * @param resource An address where the pointer to the resource + * will be stored. */ APU_DECLARE(apr_status_t) apr_reslist_acquire(apr_reslist_t *reslist, void **resource); /** * Return a resource back to the list of available resources. + * @param reslist The resource list. + * @param resource The resource to return to the list. */ APU_DECLARE(apr_status_t) apr_reslist_release(apr_reslist_t *reslist, void *resource); @@ -140,6 +145,8 @@ APU_DECLARE(apr_uint32_t) apr_reslist_ac * Invalidate a resource in the pool - e.g. a database connection * that returns a "lost connection" error and can't be restored. * Use this instead of apr_reslist_release if the resource is bad. + * @param reslist The resource list. + * @param resource The resource to invalidate. */ APU_DECLARE(apr_status_t) apr_reslist_invalidate(apr_reslist_t *reslist, void *resource); Modified: stable/10/contrib/apr-util/include/apu.hw ============================================================================== --- stable/10/contrib/apr-util/include/apu.hw Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apu.hw Thu Feb 20 20:34:01 2014 (r262253) @@ -42,6 +42,12 @@ * conventions at compile time. */ +/* Make sure we have our platform identifier macro defined we ask for later. + */ +#if defined(_WIN32) && !defined(WIN32) +#define WIN32 1 +#endif + #if defined(DOXYGEN) || !defined(WIN32) /** * The public APR-UTIL functions are declared with APU_DECLARE(), so they may Modified: stable/10/contrib/apr-util/include/apu_version.h ============================================================================== --- stable/10/contrib/apr-util/include/apu_version.h Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/include/apu_version.h Thu Feb 20 20:34:01 2014 (r262253) @@ -38,6 +38,9 @@ */ +#define APU_COPYRIGHT "Copyright (c) 2013 The Apache Software " \ + "Foundation or its licensors, as applicable." + /* The numeric compile-time version constants. These constants are the * authoritative version numbers for APU. */ @@ -59,7 +62,7 @@ * The Patch Level never includes API changes, simply bug fixes. * Reset to 0 when upgrading APR_MINOR_VERSION */ -#define APU_PATCH_VERSION 2 +#define APU_PATCH_VERSION 3 /** * The symbol APU_IS_DEV_VERSION is only defined for internal, @@ -71,7 +74,9 @@ #if defined(APU_IS_DEV_VERSION) || defined(DOXYGEN) /** Internal: string form of the "is dev" flag */ +#ifndef APU_IS_DEV_STRING #define APU_IS_DEV_STRING "-dev" +#endif #else #define APU_IS_DEV_STRING "" #endif Modified: stable/10/contrib/apr-util/libaprutil.rc ============================================================================== --- stable/10/contrib/apr-util/libaprutil.rc Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/libaprutil.rc Thu Feb 20 20:34:01 2014 (r262253) @@ -1,8 +1,5 @@ #include "apu_version.h" -#define APU_COPYRIGHT "Copyright (c) 2011 The Apache Software " \ - "Foundation or its licensors, as applicable." - #define APU_LICENSE \ "Licensed to the Apache Software Foundation (ASF) under one or more " \ "contributor license agreements. See the NOTICE file distributed with " \ Modified: stable/10/contrib/apr-util/memcache/apr_memcache.c ============================================================================== --- stable/10/contrib/apr-util/memcache/apr_memcache.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/memcache/apr_memcache.c Thu Feb 20 20:34:01 2014 (r262253) @@ -181,7 +181,7 @@ apr_memcache_find_server_hash_default(vo #if APR_HAS_THREADS apr_thread_mutex_lock(ms->lock); #endif - /* Try the the dead server, every 5 seconds */ + /* Try the dead server, every 5 seconds */ if (curtime - ms->btime > apr_time_from_sec(5)) { ms->btime = curtime; if (mc_version_ping(ms) == APR_SUCCESS) { @@ -289,8 +289,13 @@ static apr_status_t conn_connect(apr_mem { apr_status_t rv = APR_SUCCESS; apr_sockaddr_t *sa; +#if APR_HAVE_SOCKADDR_UN + apr_int32_t family = conn->ms->host[0] != '/' ? APR_INET : APR_UNIX; +#else + apr_int32_t family = APR_INET; +#endif - rv = apr_sockaddr_info_get(&sa, conn->ms->host, APR_INET, conn->ms->port, 0, conn->p); + rv = apr_sockaddr_info_get(&sa, conn->ms->host, family, conn->ms->port, 0, conn->p); if (rv != APR_SUCCESS) { return rv; } @@ -322,6 +327,11 @@ mc_conn_construct(void **conn_, void *pa apr_pool_t *np; apr_pool_t *tp; apr_memcache_server_t *ms = params; +#if APR_HAVE_SOCKADDR_UN + apr_int32_t family = ms->host[0] != '/' ? APR_INET : APR_UNIX; +#else + apr_int32_t family = APR_INET; +#endif rv = apr_pool_create(&np, pool); if (rv != APR_SUCCESS) { @@ -339,7 +349,7 @@ mc_conn_construct(void **conn_, void *pa conn->p = np; conn->tp = tp; - rv = apr_socket_create(&conn->sock, APR_INET, SOCK_STREAM, 0, np); + rv = apr_socket_create(&conn->sock, family, SOCK_STREAM, 0, np); if (rv != APR_SUCCESS) { apr_pool_destroy(np); Modified: stable/10/contrib/apr-util/misc/apu_dso.c ============================================================================== --- stable/10/contrib/apr-util/misc/apu_dso.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/misc/apu_dso.c Thu Feb 20 20:34:01 2014 (r262253) @@ -75,7 +75,6 @@ static apr_status_t apu_dso_term(void *p apr_status_t apu_dso_init(apr_pool_t *pool) { apr_status_t ret = APR_SUCCESS; - apr_pool_t *global; apr_pool_t *parent; if (apr_atomic_inc32(&initialised)) { @@ -88,17 +87,19 @@ apr_status_t apu_dso_init(apr_pool_t *po } /* Top level pool scope, need process-scope lifetime */ - for (parent = global = pool; parent; parent = apr_pool_parent_get(global)) - global = parent; + for (parent = apr_pool_parent_get(pool); + parent && parent != pool; + parent = apr_pool_parent_get(pool)) + pool = parent; - dsos = apr_hash_make(global); + dsos = apr_hash_make(pool); #if APR_HAS_THREADS - ret = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, global); + ret = apr_thread_mutex_create(&mutex, APR_THREAD_MUTEX_DEFAULT, pool); /* This already registers a pool cleanup */ #endif - apr_pool_cleanup_register(global, NULL, apu_dso_term, + apr_pool_cleanup_register(pool, NULL, apu_dso_term, apr_pool_cleanup_null); apr_atomic_dec32(&in_init); Modified: stable/10/contrib/apr-util/test/abts.c ============================================================================== --- stable/10/contrib/apr-util/test/abts.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/test/abts.c Thu Feb 20 20:34:01 2014 (r262253) @@ -106,6 +106,9 @@ abts_suite *abts_add_suite(abts_suite *s /* suite_name_full may be an absolute path depending on __FILE__ * expansion */ suite_name = strrchr(suite_name_full, '/'); + if (!suite_name) { + suite_name = strrchr(suite_name_full, '\\'); + } if (suite_name) { suite_name++; } else { @@ -247,7 +250,8 @@ void abts_int_nequal(abts_case *tc, cons tc->failed = TRUE; if (verbose) { - fprintf(stderr, "Line %d: expected <%d>, but saw <%d>\n", lineno, expected, actual); + fprintf(stderr, "Line %d: expected something other than <%d>, but saw <%d>\n", + lineno, expected, actual); fflush(stderr); } } @@ -279,7 +283,8 @@ void abts_str_nequal(abts_case *tc, cons tc->failed = TRUE; if (verbose) { - fprintf(stderr, "Line %d: expected <%s>, but saw <%s>\n", lineno, expected, actual); + fprintf(stderr, "Line %d: expected something other than <%s>, but saw <%s>\n", + lineno, expected, actual); fflush(stderr); } } Modified: stable/10/contrib/apr-util/test/testpass.c ============================================================================== --- stable/10/contrib/apr-util/test/testpass.c Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/apr-util/test/testpass.c Thu Feb 20 20:34:01 2014 (r262253) @@ -14,7 +14,6 @@ * limitations under the License. */ -#include #include #include Modified: stable/10/contrib/subversion/CHANGES ============================================================================== --- stable/10/contrib/subversion/CHANGES Thu Feb 20 20:14:43 2014 (r262252) +++ stable/10/contrib/subversion/CHANGES Thu Feb 20 20:34:01 2014 (r262253) @@ -1,3 +1,195 @@ +Version 1.8.8 +(19 Feb 2014, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.8 + + User-visible changes: + - Client-side bugfixes: + * use CryptoAPI to validate intermediary certificates on Windows (r1564623) + * fix automatic relocate for wcs not at repository root (r1541638 et al) + * diff: fix when target is a drive root on Windows (r1541635) + * wc: improve performance when used with SQLite 3.8 (r1542765) + * copy: fix some scenarios that broke the working copy (r1560690) + * move: fix errors when moving files between an external and the parent + working copy (r1551524, r1551579) + * log: resolve performance regression in certain scenarios (r1553101 et al) + * merge: decrease work to detect differences between 3 files (r1548486) + * checkout: don't require flush support for symlinks on Windows (r1547774) + * commit: don't change file permissions inappropriately (issue #4440) + * commit: fix assertion due to invalid pool lifetime (r1553376 et al) + * version: don't cut off the distribution version on Linux (r1544878 et al) + * flush stdout before exiting to avoid information being lost (r1499470) + * status: fix missing sentinel value on warning codes (r1543145) + * update/switch: improve some WC db queries that may return incorrect + results depending on how SQLite is built (r1567109) + + - Server-side bugfixes: + * reduce memory usage during checkout and export (r1564215) + * fsfs: create rep-cache.db with proper permissions (issue #3437) + * mod_dav_svn: prevent crashes with SVNListParentPath on (CVE-2014-0032) + * mod_dav_svn: fix SVNAllowBulkUpdates directive merging (r1548105) + * mod_dav_svn: include requested property changes in reports (r1557522) + * svnserve: correct default cache size in help text (r1563110) + * svnadmin dump: reduce size of dump files with '--deltas' (r1554978) + * resolve integer underflow that resulted in infinite loops (r1567985) + + Developer-visible changes: + - General: + * fix ocassional failure of check_tests.py 12 (r1496127 et al) + * fix failure with SQLite 3.8.1-3.8.3 when built with + SQLITE_ENABLE_STAT3/4 due to bug in SQLite (r1567286, r1567392) + * specify SQLite defaults that can be changed when SQLite is built + to avoid unexpected behavior with Subversion (r1567064) + + - API changes: + * numerous documentation fixes + * svn_client_commit_item3_dup() fix pool lifetime issues (r1550803) + * ra_serf: properly ask multiple certificate validation providers for + acceptance of certificate failures (r1535532) + * release internal fs objects when closing commit editor (r1555499) + * svn_client_proplist4() don't call the callback multiple times for + the same path in order to deliver inherited properties (r1549858 et al) + + - Bindings: + * javahl: make test suite run without installing on OS X (r1535115) + * swig: fix building out of tarball on OS X (r1555654) + * swig-pl: fix with --enable-sqlite-compatibility-version (r1559009) + * swig: fix building bindings on OS X when APR has the -no-cpp-precomp + flag in the apr-config --cppflags output. (r1535610) + * swig: fix building from tarball with an out-of-tree build (r1543187) + + +Version 1.8.7 +(Not released, see changes for 1.8.8.) + +Version 1.8.6 +(Not released, see changes for 1.8.8.) + + +Version 1.8.5 +(25 November 2013, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.5 + + User-visible changes: + - Client-side bugfixes: + * fix externals that point at redirected locations (issues #4428, #4429) + * diff: fix assertion with move inside a copy (issue #4444) + + - Server-side bugfixes: + * mod_dav_svn: Prevent crashes with some 3rd party modules (r1537360 et al) + * mod_dav_svn: canonicalize paths properly (r1542071) + * mod_authz_svn: fix crash of mod_authz_svn with invalid config (r1541432) + * hotcopy: fix hotcopy losing revprop files in packed repos (issue #4448) + + - Other tool improvements and bugfixes: + * mod_dontdothat: Fix the uri parser (r1542069 et al) + + Developer-visible changes: + - General: + * fix compilation with '--enable-optimize' with clang (r1534860) + * fix compilation with debug build of BDB on Windows (r1501656, r1501702) + * fix '--with-openssl' option when building on Windows (r1535139) + * add test to fail when built against broken ZLib (r1537193 et al) + + - Bindings: + * swig-rb: fix tests to run without installing on OS X (r1535161) + * ctypes-python: build with compiler selected via configure (r1536537) + + +Version 1.8.4 +(29 October 2013, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.4 + + User-visible changes: + - Client- and server-side bugfixes: + * fix assertion on urls of the form 'file://./' (r1516806) + * stop linking against psapi.dll on Windows (r1534102) + * translation updates for Swedish + + - Client-side bugfixes: + * revert: fix problems reverting moves (issue #4436) + * update: fix assertion when file external access is denied (issue #4422) + * merge: reduce network connections for automatic merge (r1468980 et al) + * merge: fix path corruption during reintegration (r1523666) + * mergeinfo: fix crash (r1519955) + * ra_serf: verify the result of xml parsing (r1501199 et al) + * ra_serf: improve error messages during commit (r1526439) + * ra_local: fix error with repository in Windows drive root (r1518184) + * fix crash on windows when piped command is interrupted (r1522892) + * fix crash in the crash handler on windows (r1532023) + * fix assertion when upgrading old working copies (r1520529) + + - Server-side bugfixes: + * hotcopy: cleanup unpacked revprops with '--incremental' (r1512300 et al) + * fix OOM on concurrent requests at threaded server start (r1527103 et al) + * fsfs: improve error message when unsupported fsfs format found (r1534158) + * fix memory problem in 3rd party FS module loader (r1519615 et al) + + Developer-visible changes: + - General: + * allow compiling against serf 1.3 and later on Windows (r1517123) + + - Bindings: + * javahl: canonicalize path for streamFileContent method (r1524869) + + +Version 1.8.3 +(29 August 2013, from /branches/1.8.x) +http://svn.apache.org/repos/asf/subversion/tags/1.8.3 + + User-visible changes: + - Client- and server-side bugfixes: + * translation updates for Swedish + * enforce strict version equality between tools and libraries (r1502267) + * consistently output revisions as "r%ld" in error messags (r1499044 et al) + + - Client-side bugfixes: + * status: always use absolute paths in XML output (issue #4398) + * ra_serf: 'svn log -v' fails with a 1.2.x server (issue #4044) + * ra_serf: fix crash when committing cp with deep deletion (issue #4400) + * diff: issue an error for files that can't fit in memory (r1513119 et al) + * svnmucc: generate proper error for mismatched URLs (r1511353) + * update: fix a crash when a temp file doesn't exist (r1513156) + * commit & update: improve sleep for timestamps performance (r1508438) + * diff: continue on missing or obstructing files (issue #4396) + * ra_serf: use runtime serf version for User-Agent (r1514315, r1514628) + * ra_serf: ignore case when checking certificate common names (r1514763) + * ra_serf: format distinguished names properly (r1514804) + * ra_serf: do not retry HTTP requests if we started to parse them (r1503318) + * ra_serf: output ssl cert verification failure reason (r1514785 et al) + * ra_serf: allow session reuse after SVN_ERR_CEASE_INVOCATION (r1502901) + * ra_serf: include library version in '--version' output (r1514295 et al) + * info: fix spurious error on wc root with child in conflict (r1515366) + + - Server-side bugfixes: + * svnserve: fix creation of pid files (r1516556) + * svnadmin: fix output encoding in non-UTF8 environments (r1506966) + * svnsync: fix high memory usage when running over ra_serf (r1515249 et al) + * mod_dav_svn: do not map requests to filesystem (r1512432 et al) + * svnauthz: improve help strings (r1511272) + * fsfs: fixed manifest file growth with revprop changes (r1513874) + * fsfs: fix packed revprops causing loss of revprops (r1513879 et al) + + - Other tool improvements and bugfixes: + * svnwcsub/irkerbridge: fix symlink attack via pid file (r175 from upstream) + + Developer-visible changes: + - General: + * describe APR unimplemented errors as coming from APR (r1503010 et al) + * mod_dav_svn: update INSTALL to reflect configure defaults (r1515141) + * davautocheck: use the correct apxs binary by default (r1507889, r1507891) + + - API changes: + * svn_config_walk_auth_data() config_dir arg: permit NULL (r1507382 et al) + + - Bindings: + * swig-pl: fix SVN::Client not honoring config file settings (r150744) + * swig-pl & swig-py: disable unusable svn_fs_set_warning_func (r1515119) + + +Version 1.8.2 +(Not released, see changes for 1.8.3.) + + Version 1.8.1 (23 July 2013, from /branches/1.8.x) http://svn.apache.org/repos/asf/subversion/tags/1.8.1 @@ -54,6 +246,8 @@ http://svn.apache.org/repos/asf/subversi * svnadmin create: deny '--fs-type=fsfs --compatible-version=1.0' (r1494223) * svnadmin upgrade: fix data loss when cancelling in last stage (r1494298) * mod_dav_svn: fix incorrect path canonicalization (r1503528) + See CVE-2013-4131, and descriptive advisory at + http://subversion.apache.org/security/CVE-2013-4131-advisory.txt - Other tool improvements and bugfixes: * fsfs-stats (tool): resolve segfault when passing invalid path (r1492164) @@ -178,7 +372,7 @@ http://svn.apache.org/repos/asf/subversi * decreased default http timeout for ra_serf (issue #3968) * prevent ra_serf from corrupting the working copy (issue #3993) * ra_serf transmits property changes inline to reduce requests (r1378927) - * allow client to avoid SSL certificate prompts (issue #2410) + * by default avoid SSL certificate prompts in client (issue #2410) * improve interactive resolution of property conflicts (r1387678 et al) * make ra_serf raise an error upon delta-base mismatch (issue #4235) * tune ra_svn transmit buffer handling (r1391788) @@ -361,7 +555,7 @@ http://svn.apache.org/repos/asf/subversi * support for Serf 2 (r1147538) * introduction of editor v2 (via private APIs only) (r1166332 et al) * improve SQLite setup for compatibility with OS X 10.7. (r1181666) - * rework switch statement to accomodate OWC compiler limitations (r1204407) + * rework switch statement to accommodate OWC compiler limitations (r1204407) * new --enable-sqlite-compatibility-version configure option (r1201421) * make test suite LD_LIBRARY_PATH include just-built auth plugins (r1200474) * packages/ directory removed, contents were outdated and unused (r1442167) @@ -388,7 +582,7 @@ http://svn.apache.org/repos/asf/subversi * configure now script auto-detects GNOME keyring (r1387230) * allow configure to detect BDB on Debian-based Linux distros (r1390633) * auto-detect serf via pkg-config (r1391662) - * improve queries for compatability with SQLite 3.7.16 (r1455239) + * improve queries for compatibility with SQLite 3.7.16 (r1455239) * remove support for in-tree apr, apr-util and apr-memcache (r1456924) * FSFS caching supports prefixes now (r1462436) * maintainer mode now prints symbolic error codes (r1465157) @@ -426,6 +620,84 @@ http://svn.apache.org/repos/asf/subversi * fix some reference counting bugs in swig-py bindings (r1464899, r1466524) +Version 1.7.15 +(12 Feb 2014, from /branches/1.7.x) +http://svn.apache.org/repos/asf/subversion/tags/1.7.15 + + User-visible changes: + - Client-side bugfixes: + * copy: fix some scenarios that broke the working copy (r1560690) + * diff: fix regressions due to fixes in 1.7.14 (issue #4460) + + - Server-side bugfixes: + * mod_dav_svn: prevent crashes with SVNListParentPath on (CVE-2014-0032) + * reduce memory usage during checkout and export (r1564215) + + Developer-visible changes: + - General: + * fix failure in checkout_tests.py + * support compiling against Cyrus sasl 2.1.25 (r1404912, r1413402) + + +Version 1.7.14 +(25 Nov 2013, from /branches/1.7.x) +http://svn.apache.org/repos/asf/subversion/tags/1.7.14 + + User-visible changes: + - Client- and server-side bugfixes: + * fix assertion on urls of the form 'file://./' (r1516806) + + - Client-side bugfixes: + * upgrade: fix an assertion when used with pre-1.3 wcs (r1530849) + * ra_local: fix error with repository in Windows drive root (r1518184) + * fix crash on windows when piped command is interrupted (r1522892) + * fix externals that point at redirected locations (issues #4428, #4429) + * diff: fix incorrect calculation of changes in some cases (issue #4283) + * diff: fix errors with added/deleted targets (issues #4153, #4421) + + - Server-side bugfixes: + * mod_dav_svn: Prevent crashes with some 3rd party modules (r1537360 et al) + * fix OOM on concurrent requests at threaded server start (r1527103 et al) + * fsfs: limit commit time of files with deep change histories (r1536790) + * mod_dav_svn: canonicalize paths properly (r1542071) + + - Other tool improvements and bugfixes: + * mod_dontdothat: Fix the uri parser (r1542069 et al) + + Developer-visible changes: + - Bindings: + * javahl: canonicalize path for streamFileContent method (r1524869) + + +Version 1.7.13 +(29 Aug 2013, from /branches/1.7.x) +http://svn.apache.org/repos/asf/subversion/tags/1.7.13 + + User-visible changes: + - General + * merge: fix bogus mergeinfo with conflicting file merges (issue #4306) + * diff: fix duplicated path component in '--summarize' output (issue #4408) + * ra_serf: ignore case when checking certificate common names (r1514763) + + - Server-side bugfixes: + * svnserve: fix creation of pid files (r1516556) + * mod_dav_svn: better status codes for commit failures (r1490684) + * mod_dav_svn: do not map requests to filesystem (r1512432 et al) + + Developer-visible changes: + - General: + * support linking against gssapi on Solaris 10 (r1515068) + * don't use uninitialized variable to produce an error code (r1482282) + + - Bindings: + * swig-pl: fix SVN::Client not honoring config file settings (r150744) + * swig-pl & swig-py: disable unusable svn_fs_set_warning_func (r1515119) + + +Version 1.7.12 +(Not released, see changes for 1.7.13.) + + Version 1.7.11 (23 Jul 2013, from /branches/1.7.x) http://svn.apache.org/repos/asf/subversion/tags/1.7.11 @@ -436,9 +708,13 @@ http://svn.apache.org/repos/asf/subversi - Server-side bugfixes: * mod_dav_svn: fix incorrect path canonicalization (r1503528) + See CVE-2013-4131, and descriptive advisory at + http://subversion.apache.org/security/CVE-2013-4131-advisory.txt - Other tool improvements and bugfixes: * fix argument processing in contrib hook scripts (r1485350) + See CVE-2013-2088, and descriptive advisory at + http://subversion.apache.org/security/CVE-2013-2088-advisory.txt Developer-visible changes: - Bindings: @@ -464,7 +740,11 @@ http://svn.apache.org/repos/asf/subversi - Server-side bugfixes: * fix FSFS repository corruption due to newline in filename (issue #4340) + See CVE-2013-1968, and descriptive advisory at + http://subversion.apache.org/security/CVE-2013-1968-advisory.txt * fix svnserve exiting when a client connection is aborted (r1482759) + See CVE-2013-2112, and descriptive advisory at + http://subversion.apache.org/security/CVE-2013-2112-advisory.txt * fix svnserve memory use after clear (issue #4365) * fix repository corruption on power/disk failure on Windows (r1483781) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Feb 20 20:51:28 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A7CAE651; Thu, 20 Feb 2014 20: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 914301DE5; Thu, 20 Feb 2014 20:51:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KKpSZ5048963; Thu, 20 Feb 2014 20:51:28 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KKpRWV048959; Thu, 20 Feb 2014 20:51:27 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402202051.s1KKpRWV048959@svn.freebsd.org> From: Peter Wemm Date: Thu, 20 Feb 2014 20:51: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: r262254 - in stable/10/kerberos5/lib: libasn1 libgssapi_spnego libhdb libhx509 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2014 20:51:28 -0000 Author: peter Date: Thu Feb 20 20:51:27 2014 New Revision: 262254 URL: http://svnweb.freebsd.org/changeset/base/262254 Log: MFC r262253: hack to prevent concurrent runs of asn1_compile in the Heimdal build with high -j concurrency. Modified: stable/10/kerberos5/lib/libasn1/Makefile stable/10/kerberos5/lib/libgssapi_spnego/Makefile stable/10/kerberos5/lib/libhdb/Makefile stable/10/kerberos5/lib/libhx509/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/kerberos5/lib/libasn1/Makefile ============================================================================== --- stable/10/kerberos5/lib/libasn1/Makefile Thu Feb 20 20:34:01 2014 (r262253) +++ stable/10/kerberos5/lib/libasn1/Makefile Thu Feb 20 20:51:27 2014 (r262254) @@ -56,10 +56,12 @@ INCS+= krb5_asn1.h \ digest_asn1.h \ kx509_asn1.h +.ORDER: ${GEN_CMS} ${GEN_CMS}: cms.asn1 cms.opt ${ASN1_COMPILE} --one-code-file \ --option-file=${.ALLSRC:M*.opt} ${.ALLSRC:M*.asn1} cms_asn1 +.ORDER: ${GEN_RFC2459} ${GEN_RFC2459}: rfc2459.asn1 ${ASN1_COMPILE} \ --one-code-file \ @@ -70,32 +72,39 @@ ${GEN_RFC2459}: rfc2459.asn1 --sequence=Extensions \ --sequence=CRLDistributionPoints ${.ALLSRC:M*.asn1} rfc2459_asn1 +.ORDER: ${GEN_K5} ${GEN_K5}: krb5.asn1 krb5.opt ${ASN1_COMPILE} \ --one-code-file \ --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} krb5_asn1 +.ORDER: ${GEN_PKINIT} ${GEN_PKINIT}: pkinit.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkinit_asn1 +.ORDER: ${GEN_PKCS8} ${GEN_PKCS8}: pkcs8.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkcs8_asn1 +.ORDER: ${GEN_PKCS9} ${GEN_PKCS9}: pkcs9.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkcs9_asn1 +.ORDER: ${GEN_PKCS12} ${GEN_PKCS12}: pkcs12.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} pkcs12_asn1 +.ORDER: ${GEN_DIGEST} ${GEN_DIGEST}: digest.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} digest_asn1 +.ORDER: ${GEN_KX509} ${GEN_KX509}: kx509.asn1 ${ASN1_COMPILE} --one-code-file \ ${.ALLSRC:M*.asn1} kx509_asn1 Modified: stable/10/kerberos5/lib/libgssapi_spnego/Makefile ============================================================================== --- stable/10/kerberos5/lib/libgssapi_spnego/Makefile Thu Feb 20 20:34:01 2014 (r262253) +++ stable/10/kerberos5/lib/libgssapi_spnego/Makefile Thu Feb 20 20:51:27 2014 (r262254) @@ -38,6 +38,7 @@ CFLAGS+=-I${KRB5DIR}/lib/roken -I. CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx$/.h/} \ spnego_asn1_files spnego_asn1-template.c +.ORDER: ${GEN} ${GEN}: spnego.asn1 spnego.opt ${ASN1_COMPILE} --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} spnego_asn1 Modified: stable/10/kerberos5/lib/libhdb/Makefile ============================================================================== --- stable/10/kerberos5/lib/libhdb/Makefile Thu Feb 20 20:34:01 2014 (r262253) +++ stable/10/kerberos5/lib/libhdb/Makefile Thu Feb 20 20:51:27 2014 (r262254) @@ -84,6 +84,7 @@ GEN= asn1_Salt.x \ CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx$/.h/} hdb_asn1_files \ hdb_asn1-template.[ch]* +.ORDER: ${GEN} ${GEN}: hdb.asn1 ${ASN1_COMPILE} ${.ALLSRC:M*.asn1} hdb_asn1 Modified: stable/10/kerberos5/lib/libhx509/Makefile ============================================================================== --- stable/10/kerberos5/lib/libhx509/Makefile Thu Feb 20 20:34:01 2014 (r262253) +++ stable/10/kerberos5/lib/libhx509/Makefile Thu Feb 20 20:51:27 2014 (r262254) @@ -269,14 +269,17 @@ CLEANFILES= ${GEN} ${GEN:S/.x$/.c/:S/.hx INCS+= ocsp_asn1.h pkcs10_asn1.h crmf_asn1.h +.ORDER: ${GEN_OSCP} ${GEN_OCSP}: ocsp.asn1 ocsp.opt ${ASN1_COMPILE} --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} ocsp_asn1 +.ORDER: ${GEN_PKCS10} ${GEN_PKCS10}: pkcs10.asn1 pkcs10.opt ${ASN1_COMPILE} --option-file=${.ALLSRC:M*.opt} \ ${.ALLSRC:M*.asn1} pkcs10_asn1 +.ORDER: ${GEN_CRMF} ${GEN_CRMF}: crmf.asn1 ${ASN1_COMPILE} ${.ALLSRC:M*.asn1} crmf_asn1 From owner-svn-src-stable@FreeBSD.ORG Thu Feb 20 21:02:00 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60901F24; Thu, 20 Feb 2014 21:02: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 495A71030; Thu, 20 Feb 2014 21:02:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KL20oF053382; Thu, 20 Feb 2014 21:02:00 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KL20r0053381; Thu, 20 Feb 2014 21:02:00 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201402202102.s1KL20r0053381@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 20 Feb 2014 21:02:00 +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: r262256 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2014 21:02:00 -0000 Author: ae Date: Thu Feb 20 21:01:59 2014 New Revision: 262256 URL: http://svnweb.freebsd.org/changeset/base/262256 Log: MFC r261835: Drop packets to multicast address whose scop field contains the reserved value 0. Sponsored by: Yandex LLC Modified: stable/10/sys/netinet6/ip6_input.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/ip6_input.c ============================================================================== --- stable/10/sys/netinet6/ip6_input.c Thu Feb 20 20:53:29 2014 (r262255) +++ stable/10/sys/netinet6/ip6_input.c Thu Feb 20 21:01:59 2014 (r262256) @@ -571,7 +571,18 @@ ip6_input(struct mbuf *m) in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); goto bad; } - + if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) && + IPV6_ADDR_MC_SCOPE(&ip6->ip6_dst) == 0) { + /* + * RFC4291 2.7: + * Nodes must not originate a packet to a multicast address + * whose scop field contains the reserved value 0; if such + * a packet is received, it must be silently dropped. + */ + IP6STAT_INC(ip6s_badscope); + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); + goto bad; + } #ifdef ALTQ if (altq_input != NULL && (*altq_input)(m, AF_INET6) == 0) { /* packet is dropped by traffic conditioner */ From owner-svn-src-stable@FreeBSD.ORG Thu Feb 20 21:02:25 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1A62BE4; Thu, 20 Feb 2014 21:02: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 052991038; Thu, 20 Feb 2014 21:02:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KL2OYd053485; Thu, 20 Feb 2014 21:02:24 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KL2Of4053484; Thu, 20 Feb 2014 21:02:24 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201402202102.s1KL2Of4053484@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 20 Feb 2014 21:02: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: r262257 - stable/9/sys/netinet6 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2014 21:02:25 -0000 Author: ae Date: Thu Feb 20 21:02:24 2014 New Revision: 262257 URL: http://svnweb.freebsd.org/changeset/base/262257 Log: MFC r261835: Drop packets to multicast address whose scop field contains the reserved value 0. Sponsored by: Yandex LLC Modified: stable/9/sys/netinet6/ip6_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_input.c ============================================================================== --- stable/9/sys/netinet6/ip6_input.c Thu Feb 20 21:01:59 2014 (r262256) +++ stable/9/sys/netinet6/ip6_input.c Thu Feb 20 21:02:24 2014 (r262257) @@ -558,7 +558,18 @@ ip6_input(struct mbuf *m) in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); goto bad; } - + if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst) && + IPV6_ADDR_MC_SCOPE(&ip6->ip6_dst) == 0) { + /* + * RFC4291 2.7: + * Nodes must not originate a packet to a multicast address + * whose scop field contains the reserved value 0; if such + * a packet is received, it must be silently dropped. + */ + IP6STAT_INC(ip6s_badscope); + in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); + goto bad; + } #ifdef ALTQ if (altq_input != NULL && (*altq_input)(m, AF_INET6) == 0) { /* packet is dropped by traffic conditioner */ From owner-svn-src-stable@FreeBSD.ORG Thu Feb 20 21:36:05 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id BFAA57E; Thu, 20 Feb 2014 21:36: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id A8D741348; Thu, 20 Feb 2014 21:36:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KLa5MT066524; Thu, 20 Feb 2014 21:36:05 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KLa5wH066523; Thu, 20 Feb 2014 21:36:05 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201402202136.s1KLa5wH066523@svn.freebsd.org> From: Mateusz Guzik Date: Thu, 20 Feb 2014 21:36: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: r262259 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2014 21:36:05 -0000 Author: mjg Date: Thu Feb 20 21:36:05 2014 New Revision: 262259 URL: http://svnweb.freebsd.org/changeset/base/262259 Log: MFC r260233: Plug a memory leak in dup2 when both old and new fd have ioctl caps. Modified: stable/10/sys/kern/kern_descrip.c Modified: stable/10/sys/kern/kern_descrip.c ============================================================================== --- stable/10/sys/kern/kern_descrip.c Thu Feb 20 21:32:24 2014 (r262258) +++ stable/10/sys/kern/kern_descrip.c Thu Feb 20 21:36:05 2014 (r262259) @@ -879,6 +879,7 @@ do_dup(struct thread *td, int flags, int /* * Duplicate the source descriptor. */ + filecaps_free(&newfde->fde_caps); *newfde = *oldfde; filecaps_copy(&oldfde->fde_caps, &newfde->fde_caps); if ((flags & DUP_CLOEXEC) != 0) From owner-svn-src-stable@FreeBSD.ORG Thu Feb 20 21:52:40 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A711F720; Thu, 20 Feb 2014 21:52: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 77F101517; Thu, 20 Feb 2014 21:52:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1KLqepq073894; Thu, 20 Feb 2014 21:52:40 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1KLqe9s073893; Thu, 20 Feb 2014 21:52:40 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201402202152.s1KLqe9s073893@svn.freebsd.org> From: Mateusz Guzik Date: Thu, 20 Feb 2014 21:52:40 +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: r262260 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Feb 2014 21:52:40 -0000 Author: mjg Date: Thu Feb 20 21:52:39 2014 New Revision: 262260 URL: http://svnweb.freebsd.org/changeset/base/262260 Log: MFC r259330,r259331: rlimit: add and utilize lim_shared rlimit: avoid unnecessary copying of rlimits If refcount is 1 just modify rlimits in place. Modified: stable/10/sys/kern/kern_resource.c Modified: stable/10/sys/kern/kern_resource.c ============================================================================== --- stable/10/sys/kern/kern_resource.c Thu Feb 20 21:36:05 2014 (r262259) +++ stable/10/sys/kern/kern_resource.c Thu Feb 20 21:52:39 2014 (r262260) @@ -80,6 +80,8 @@ static int donice(struct thread *td, str static struct uidinfo *uilookup(uid_t uid); static void ruxagg_locked(struct rusage_ext *rux, struct thread *td); +static __inline int lim_shared(struct plimit *limp); + /* * Resource controls and accounting. */ @@ -677,21 +679,29 @@ kern_proc_setrlimit(struct thread *td, s limp->rlim_max = RLIM_INFINITY; oldssiz.rlim_cur = 0; - newlim = lim_alloc(); + newlim = NULL; PROC_LOCK(p); + if (lim_shared(p->p_limit)) { + PROC_UNLOCK(p); + newlim = lim_alloc(); + PROC_LOCK(p); + } oldlim = p->p_limit; alimp = &oldlim->pl_rlimit[which]; if (limp->rlim_cur > alimp->rlim_max || limp->rlim_max > alimp->rlim_max) if ((error = priv_check(td, PRIV_PROC_SETRLIMIT))) { PROC_UNLOCK(p); - lim_free(newlim); + if (newlim != NULL) + lim_free(newlim); return (error); } if (limp->rlim_cur > limp->rlim_max) limp->rlim_cur = limp->rlim_max; - lim_copy(newlim, oldlim); - alimp = &newlim->pl_rlimit[which]; + if (newlim != NULL) { + lim_copy(newlim, oldlim); + alimp = &newlim->pl_rlimit[which]; + } switch (which) { @@ -741,9 +751,11 @@ kern_proc_setrlimit(struct thread *td, s if (p->p_sysent->sv_fixlimit != NULL) p->p_sysent->sv_fixlimit(limp, which); *alimp = *limp; - p->p_limit = newlim; + if (newlim != NULL) + p->p_limit = newlim; PROC_UNLOCK(p); - lim_free(oldlim); + if (newlim != NULL) + lim_free(oldlim); if (which == RLIMIT_STACK) { /* @@ -1129,6 +1141,14 @@ lim_hold(limp) return (limp); } +static __inline int +lim_shared(limp) + struct plimit *limp; +{ + + return (limp->pl_refcnt > 1); +} + void lim_fork(struct proc *p1, struct proc *p2) { @@ -1162,7 +1182,7 @@ lim_copy(dst, src) struct plimit *dst, *src; { - KASSERT(dst->pl_refcnt == 1, ("lim_copy to shared limit")); + KASSERT(!lim_shared(dst), ("lim_copy to shared limit")); bcopy(src->pl_rlimit, dst->pl_rlimit, sizeof(src->pl_rlimit)); } From owner-svn-src-stable@FreeBSD.ORG Fri Feb 21 09:19:17 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0DB1F74A; Fri, 21 Feb 2014 09:19: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id ED3A514C2; Fri, 21 Feb 2014 09:19:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9JGZM053257; Fri, 21 Feb 2014 09:19:16 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9JGDk053256; Fri, 21 Feb 2014 09:19:16 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402210919.s1L9JGDk053256@svn.freebsd.org> From: Christian Brueffer Date: Fri, 21 Feb 2014 09:19: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: r262284 - stable/10/libexec/ftpd X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Feb 2014 09:19:17 -0000 Author: brueffer Date: Fri Feb 21 09:19:16 2014 New Revision: 262284 URL: http://svnweb.freebsd.org/changeset/base/262284 Log: MFC: r261885 In sgetpwnam(), save and free pw_class like all other char members of struct passwd. This fixes spurious "login_getclass: unknown class" errors. PR: 186439 Submitted by: UEMURA Tetsuya Modified: stable/10/libexec/ftpd/ftpd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/libexec/ftpd/ftpd.c ============================================================================== --- stable/10/libexec/ftpd/ftpd.c Fri Feb 21 07:31:24 2014 (r262283) +++ stable/10/libexec/ftpd/ftpd.c Fri Feb 21 09:19:16 2014 (r262284) @@ -965,6 +965,7 @@ sgetpwnam(char *name) if (save.pw_name) { free(save.pw_name); free(save.pw_passwd); + free(save.pw_class); free(save.pw_gecos); free(save.pw_dir); free(save.pw_shell); @@ -972,6 +973,7 @@ sgetpwnam(char *name) save = *p; save.pw_name = sgetsave(p->pw_name); save.pw_passwd = sgetsave(p->pw_passwd); + save.pw_class = sgetsave(p->pw_class); save.pw_gecos = sgetsave(p->pw_gecos); save.pw_dir = sgetsave(p->pw_dir); save.pw_shell = sgetsave(p->pw_shell); From owner-svn-src-stable@FreeBSD.ORG Fri Feb 21 09:21:03 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0BD6C936; Fri, 21 Feb 2014 09:21: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E54CE1539; Fri, 21 Feb 2014 09:21:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9L25I056274; Fri, 21 Feb 2014 09:21:02 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9L25N056273; Fri, 21 Feb 2014 09:21:02 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402210921.s1L9L25N056273@svn.freebsd.org> From: Christian Brueffer Date: Fri, 21 Feb 2014 09:21:02 +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: r262285 - stable/9/libexec/ftpd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Feb 2014 09:21:03 -0000 Author: brueffer Date: Fri Feb 21 09:21:02 2014 New Revision: 262285 URL: http://svnweb.freebsd.org/changeset/base/262285 Log: MFC: r261885 In sgetpwnam(), save and free pw_class like all other char members of struct passwd. This fixes spurious "login_getclass: unknown class" errors. PR: 186439 Submitted by: UEMURA Tetsuya Modified: stable/9/libexec/ftpd/ftpd.c Directory Properties: stable/9/libexec/ftpd/ (props changed) Modified: stable/9/libexec/ftpd/ftpd.c ============================================================================== --- stable/9/libexec/ftpd/ftpd.c Fri Feb 21 09:19:16 2014 (r262284) +++ stable/9/libexec/ftpd/ftpd.c Fri Feb 21 09:21:02 2014 (r262285) @@ -965,6 +965,7 @@ sgetpwnam(char *name) if (save.pw_name) { free(save.pw_name); free(save.pw_passwd); + free(save.pw_class); free(save.pw_gecos); free(save.pw_dir); free(save.pw_shell); @@ -972,6 +973,7 @@ sgetpwnam(char *name) save = *p; save.pw_name = sgetsave(p->pw_name); save.pw_passwd = sgetsave(p->pw_passwd); + save.pw_class = sgetsave(p->pw_class); save.pw_gecos = sgetsave(p->pw_gecos); save.pw_dir = sgetsave(p->pw_dir); save.pw_shell = sgetsave(p->pw_shell); From owner-svn-src-stable@FreeBSD.ORG Fri Feb 21 09:22:38 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2B6FAB94; Fri, 21 Feb 2014 09:22: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 15D88156D; Fri, 21 Feb 2014 09:22:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9MbhJ056596; Fri, 21 Feb 2014 09:22:37 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9Mbl6056595; Fri, 21 Feb 2014 09:22:37 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402210922.s1L9Mbl6056595@svn.freebsd.org> From: Christian Brueffer Date: Fri, 21 Feb 2014 09:22:37 +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: r262286 - stable/8/libexec/ftpd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Feb 2014 09:22:38 -0000 Author: brueffer Date: Fri Feb 21 09:22:37 2014 New Revision: 262286 URL: http://svnweb.freebsd.org/changeset/base/262286 Log: MFC: r261885 In sgetpwnam(), save and free pw_class like all other char members of struct passwd. This fixes spurious "login_getclass: unknown class" errors. PR: 186439 Submitted by: UEMURA Tetsuya Modified: stable/8/libexec/ftpd/ftpd.c Directory Properties: stable/8/libexec/ftpd/ (props changed) Modified: stable/8/libexec/ftpd/ftpd.c ============================================================================== --- stable/8/libexec/ftpd/ftpd.c Fri Feb 21 09:21:02 2014 (r262285) +++ stable/8/libexec/ftpd/ftpd.c Fri Feb 21 09:22:37 2014 (r262286) @@ -967,6 +967,7 @@ sgetpwnam(char *name) if (save.pw_name) { free(save.pw_name); free(save.pw_passwd); + free(save.pw_class); free(save.pw_gecos); free(save.pw_dir); free(save.pw_shell); @@ -974,6 +975,7 @@ sgetpwnam(char *name) save = *p; save.pw_name = sgetsave(p->pw_name); save.pw_passwd = sgetsave(p->pw_passwd); + save.pw_class = sgetsave(p->pw_class); save.pw_gecos = sgetsave(p->pw_gecos); save.pw_dir = sgetsave(p->pw_dir); save.pw_shell = sgetsave(p->pw_shell); From owner-svn-src-stable@FreeBSD.ORG Fri Feb 21 09:25:52 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id EE0B620F; Fri, 21 Feb 2014 09:25: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D961315B3; Fri, 21 Feb 2014 09:25:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9PquU057163; Fri, 21 Feb 2014 09:25:52 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9PqvT057162; Fri, 21 Feb 2014 09:25:52 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402210925.s1L9PqvT057162@svn.freebsd.org> From: Christian Brueffer Date: Fri, 21 Feb 2014 09:25:52 +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: r262287 - stable/10/usr.sbin/ppp X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Feb 2014 09:25:53 -0000 Author: brueffer Date: Fri Feb 21 09:25:52 2014 New Revision: 262287 URL: http://svnweb.freebsd.org/changeset/base/262287 Log: MFC: r261900 In chat_UpdateSet(), initialize the input buffer to prevent stale data from previous timed out commands. PR: 186530 Submitted by: Alexander Zagrebin Reviewed by: brian Modified: stable/10/usr.sbin/ppp/chat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/ppp/chat.c ============================================================================== --- stable/10/usr.sbin/ppp/chat.c Fri Feb 21 09:22:37 2014 (r262286) +++ stable/10/usr.sbin/ppp/chat.c Fri Feb 21 09:25:52 2014 (r262287) @@ -154,6 +154,11 @@ chat_UpdateSet(struct fdescriptor *d, fd else { /* c->state = CHAT_EXPECT; */ c->argptr = &arg_term; + /* + We have to clear the input buffer, because it contains output + from the previous (timed out) command. + */ + c->bufstart = c->bufend; } c->TimedOut = 0; } From owner-svn-src-stable@FreeBSD.ORG Fri Feb 21 09:26:52 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 464BF4FA; Fri, 21 Feb 2014 09:26: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 31F7415C3; Fri, 21 Feb 2014 09:26:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9Qqua057322; Fri, 21 Feb 2014 09:26:52 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9QqJf057321; Fri, 21 Feb 2014 09:26:52 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402210926.s1L9QqJf057321@svn.freebsd.org> From: Christian Brueffer Date: Fri, 21 Feb 2014 09:26:52 +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: r262288 - stable/9/usr.sbin/ppp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Feb 2014 09:26:52 -0000 Author: brueffer Date: Fri Feb 21 09:26:51 2014 New Revision: 262288 URL: http://svnweb.freebsd.org/changeset/base/262288 Log: MFC: r261900 In chat_UpdateSet(), initialize the input buffer to prevent stale data from previous timed out commands. PR: 186530 Submitted by: Alexander Zagrebin Reviewed by: brian Modified: stable/9/usr.sbin/ppp/chat.c Directory Properties: stable/9/usr.sbin/ppp/ (props changed) Modified: stable/9/usr.sbin/ppp/chat.c ============================================================================== --- stable/9/usr.sbin/ppp/chat.c Fri Feb 21 09:25:52 2014 (r262287) +++ stable/9/usr.sbin/ppp/chat.c Fri Feb 21 09:26:51 2014 (r262288) @@ -154,6 +154,11 @@ chat_UpdateSet(struct fdescriptor *d, fd else { /* c->state = CHAT_EXPECT; */ c->argptr = &arg_term; + /* + We have to clear the input buffer, because it contains output + from the previous (timed out) command. + */ + c->bufstart = c->bufend; } c->TimedOut = 0; } From owner-svn-src-stable@FreeBSD.ORG Fri Feb 21 09:27:48 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 9FD846E0; Fri, 21 Feb 2014 09:27: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8914815D8; Fri, 21 Feb 2014 09:27:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9Rmsw057473; Fri, 21 Feb 2014 09:27:48 GMT (envelope-from brueffer@svn.freebsd.org) Received: (from brueffer@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9Rmj1057472; Fri, 21 Feb 2014 09:27:48 GMT (envelope-from brueffer@svn.freebsd.org) Message-Id: <201402210927.s1L9Rmj1057472@svn.freebsd.org> From: Christian Brueffer Date: Fri, 21 Feb 2014 09:27:48 +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: r262289 - stable/8/usr.sbin/ppp X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Feb 2014 09:27:48 -0000 Author: brueffer Date: Fri Feb 21 09:27:48 2014 New Revision: 262289 URL: http://svnweb.freebsd.org/changeset/base/262289 Log: MFC: r261900 In chat_UpdateSet(), initialize the input buffer to prevent stale data from previous timed out commands. PR: 186530 Submitted by: Alexander Zagrebin Reviewed by: brian Modified: stable/8/usr.sbin/ppp/chat.c Directory Properties: stable/8/usr.sbin/ppp/ (props changed) Modified: stable/8/usr.sbin/ppp/chat.c ============================================================================== --- stable/8/usr.sbin/ppp/chat.c Fri Feb 21 09:26:51 2014 (r262288) +++ stable/8/usr.sbin/ppp/chat.c Fri Feb 21 09:27:48 2014 (r262289) @@ -154,6 +154,11 @@ chat_UpdateSet(struct fdescriptor *d, fd else { /* c->state = CHAT_EXPECT; */ c->argptr = &arg_term; + /* + We have to clear the input buffer, because it contains output + from the previous (timed out) command. + */ + c->bufstart = c->bufend; } c->TimedOut = 0; } From owner-svn-src-stable@FreeBSD.ORG Fri Feb 21 09:43:35 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 065F538C; Fri, 21 Feb 2014 09:43: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id E51C2175E; Fri, 21 Feb 2014 09:43:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1L9hYTv065221; Fri, 21 Feb 2014 09:43:34 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1L9hYC4065220; Fri, 21 Feb 2014 09:43:34 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201402210943.s1L9hYC4065220@svn.freebsd.org> From: Attilio Rao Date: Fri, 21 Feb 2014 09:43:34 +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: r262291 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Feb 2014 09:43:35 -0000 Author: attilio Date: Fri Feb 21 09:43:34 2014 New Revision: 262291 URL: http://svnweb.freebsd.org/changeset/base/262291 Log: MFC r261867: Use the right index to free swapspace after vm_page_rename(). Modified: stable/10/sys/vm/vm_object.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_object.c ============================================================================== --- stable/10/sys/vm/vm_object.c Fri Feb 21 09:42:50 2014 (r262290) +++ stable/10/sys/vm/vm_object.c Fri Feb 21 09:43:34 2014 (r262291) @@ -1628,9 +1628,11 @@ vm_object_backing_scan(vm_object_t objec p = TAILQ_FIRST(&backing_object->memq); continue; } + + /* Use the old pindex to free the right page. */ if (backing_object->type == OBJT_SWAP) - swap_pager_freespace(backing_object, p->pindex, - 1); + swap_pager_freespace(backing_object, + new_pindex + backing_offset_index, 1); #if VM_NRESERVLEVEL > 0 /* From owner-svn-src-stable@FreeBSD.ORG Fri Feb 21 18:32:45 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E4B60B1A; Fri, 21 Feb 2014 18:32: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D068E1DB9; Fri, 21 Feb 2014 18:32:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LIWjo4097439; Fri, 21 Feb 2014 18:32:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LIWjh0097438; Fri, 21 Feb 2014 18:32:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402211832.s1LIWjh0097438@svn.freebsd.org> From: Alexander Motin Date: Fri, 21 Feb 2014 18:32: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: r262299 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Feb 2014 18:32:46 -0000 Author: mav Date: Fri Feb 21 18:32:45 2014 New Revision: 262299 URL: http://svnweb.freebsd.org/changeset/base/262299 Log: MFC r261538: Make CTL block backend return proper error code for operations unsupposed by the underlying device. Modified: stable/10/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/10/sys/cam/ctl/ctl_backend_block.c Fri Feb 21 16:14:40 2014 (r262298) +++ stable/10/sys/cam/ctl/ctl_backend_block.c Fri Feb 21 18:32:45 2014 (r262299) @@ -512,6 +512,7 @@ ctl_be_block_biodone(struct bio *bio) struct ctl_be_block_io *beio; struct ctl_be_block_lun *be_lun; union ctl_io *io; + int error; beio = bio->bio_caller1; be_lun = beio->lun; @@ -519,8 +520,9 @@ ctl_be_block_biodone(struct bio *bio) DPRINTF("entered\n"); + error = bio->bio_error; mtx_lock(&be_lun->lock); - if (bio->bio_error != 0) + if (error != 0) beio->num_errors++; beio->num_bios_done++; @@ -552,7 +554,9 @@ ctl_be_block_biodone(struct bio *bio) * entire I/O with a medium error. */ if (beio->num_errors > 0) { - if (beio->bio_cmd == BIO_FLUSH) { + if (error == EOPNOTSUPP) { + ctl_set_invalid_opcode(&io->scsiio); + } else if (beio->bio_cmd == BIO_FLUSH) { /* XXX KDM is there is a better error here? */ ctl_set_internal_failure(&io->scsiio, /*sks_valid*/ 1, From owner-svn-src-stable@FreeBSD.ORG Fri Feb 21 18:33:55 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6D793C6E; Fri, 21 Feb 2014 18:33: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 58BA01DC5; Fri, 21 Feb 2014 18:33:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1LIXtWf097644; Fri, 21 Feb 2014 18:33:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1LIXt97097643; Fri, 21 Feb 2014 18:33:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201402211833.s1LIXt97097643@svn.freebsd.org> From: Alexander Motin Date: Fri, 21 Feb 2014 18:33:55 +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: r262300 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Feb 2014 18:33:55 -0000 Author: mav Date: Fri Feb 21 18:33:54 2014 New Revision: 262300 URL: http://svnweb.freebsd.org/changeset/base/262300 Log: MFC r261538: Make CTL block backend return proper error code for operations unsupposed by the underlying device. Modified: stable/9/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/9/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_block.c Fri Feb 21 18:32:45 2014 (r262299) +++ stable/9/sys/cam/ctl/ctl_backend_block.c Fri Feb 21 18:33:54 2014 (r262300) @@ -512,6 +512,7 @@ ctl_be_block_biodone(struct bio *bio) struct ctl_be_block_io *beio; struct ctl_be_block_lun *be_lun; union ctl_io *io; + int error; beio = bio->bio_caller1; be_lun = beio->lun; @@ -519,8 +520,9 @@ ctl_be_block_biodone(struct bio *bio) DPRINTF("entered\n"); + error = bio->bio_error; mtx_lock(&be_lun->lock); - if (bio->bio_error != 0) + if (error != 0) beio->num_errors++; beio->num_bios_done++; @@ -552,7 +554,9 @@ ctl_be_block_biodone(struct bio *bio) * entire I/O with a medium error. */ if (beio->num_errors > 0) { - if (beio->bio_cmd == BIO_FLUSH) { + if (error == EOPNOTSUPP) { + ctl_set_invalid_opcode(&io->scsiio); + } else if (beio->bio_cmd == BIO_FLUSH) { /* XXX KDM is there is a better error here? */ ctl_set_internal_failure(&io->scsiio, /*sks_valid*/ 1, From owner-svn-src-stable@FreeBSD.ORG Sat Feb 22 00:30:33 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A5639FC1; Sat, 22 Feb 2014 00:30: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F14D1DC5; Sat, 22 Feb 2014 00:30:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M0UXa9044249; Sat, 22 Feb 2014 00:30:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M0UX3T044248; Sat, 22 Feb 2014 00:30:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402220030.s1M0UX3T044248@svn.freebsd.org> From: Xin LI Date: Sat, 22 Feb 2014 00:30: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: r262318 - stable/10/sys/geom/eli X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2014 00:30:33 -0000 Author: delphij Date: Sat Feb 22 00:30:33 2014 New Revision: 262318 URL: http://svnweb.freebsd.org/changeset/base/262318 Log: MFC r261618: In g_eli_crypto_hmac_init(), zero out after using the ipad buffer, k_ipad. Note that the two consumers in geli(4) are not affected by this issue because the way the code is constructed and as such, we believe there is no security impact with or without this change with geli(4)'s usage. Reported by: Serge van den Boom Reviewed by: pjd Modified: stable/10/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/geom/eli/g_eli_crypto.c ============================================================================== --- stable/10/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:16:27 2014 (r262317) +++ stable/10/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:30:33 2014 (r262318) @@ -265,6 +265,7 @@ g_eli_crypto_hmac_init(struct hmac_ctx * /* Perform inner SHA512. */ SHA512_Init(&ctx->shactx); SHA512_Update(&ctx->shactx, k_ipad, sizeof(k_ipad)); + bzero(k_ipad, sizeof(k_ipad)); } void From owner-svn-src-stable@FreeBSD.ORG Sat Feb 22 00:41:04 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 97DAD1F6; Sat, 22 Feb 2014 00:41: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F0541FE6; Sat, 22 Feb 2014 00:41:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M0f46I047907; Sat, 22 Feb 2014 00:41:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M0f4To047906; Sat, 22 Feb 2014 00:41:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402220041.s1M0f4To047906@svn.freebsd.org> From: Xin LI Date: Sat, 22 Feb 2014 00:41:04 +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: r262319 - in stable: 7/sys/geom/eli 8/sys/geom/eli 9/sys/geom/eli X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2014 00:41:04 -0000 Author: delphij Date: Sat Feb 22 00:41:03 2014 New Revision: 262319 URL: http://svnweb.freebsd.org/changeset/base/262319 Log: MFC r261618: In g_eli_crypto_hmac_init(), zero out after using the ipad buffer, k_ipad. Note that the two consumers in geli(4) are not affected by this issue because the way the code is constructed and as such, we believe there is no security impact with or without this change with geli(4)'s usage. Reported by: Serge van den Boom Reviewed by: pjd Modified: stable/9/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/9/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/7/sys/geom/eli/g_eli_crypto.c stable/8/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/7/sys/ (props changed) stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/9/sys/geom/eli/g_eli_crypto.c ============================================================================== --- stable/9/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:30:33 2014 (r262318) +++ stable/9/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:41:03 2014 (r262319) @@ -265,6 +265,7 @@ g_eli_crypto_hmac_init(struct hmac_ctx * /* Perform inner SHA512. */ SHA512_Init(&ctx->shactx); SHA512_Update(&ctx->shactx, k_ipad, sizeof(k_ipad)); + bzero(k_ipad, sizeof(k_ipad)); } void From owner-svn-src-stable@FreeBSD.ORG Sat Feb 22 00:41:04 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E6D181F7; Sat, 22 Feb 2014 00:41: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D27781FE7; Sat, 22 Feb 2014 00:41:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M0f4i0047913; Sat, 22 Feb 2014 00:41:04 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M0f4oc047912; Sat, 22 Feb 2014 00:41:04 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402220041.s1M0f4oc047912@svn.freebsd.org> From: Xin LI Date: Sat, 22 Feb 2014 00:41:04 +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: r262319 - in stable: 7/sys/geom/eli 8/sys/geom/eli 9/sys/geom/eli X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2014 00:41:05 -0000 Author: delphij Date: Sat Feb 22 00:41:03 2014 New Revision: 262319 URL: http://svnweb.freebsd.org/changeset/base/262319 Log: MFC r261618: In g_eli_crypto_hmac_init(), zero out after using the ipad buffer, k_ipad. Note that the two consumers in geli(4) are not affected by this issue because the way the code is constructed and as such, we believe there is no security impact with or without this change with geli(4)'s usage. Reported by: Serge van den Boom Reviewed by: pjd Modified: stable/8/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Changes in other areas also in this revision: Modified: stable/7/sys/geom/eli/g_eli_crypto.c stable/9/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/7/sys/ (props changed) stable/9/sys/ (props changed) Modified: stable/8/sys/geom/eli/g_eli_crypto.c ============================================================================== --- stable/8/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:30:33 2014 (r262318) +++ stable/8/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:41:03 2014 (r262319) @@ -265,6 +265,7 @@ g_eli_crypto_hmac_init(struct hmac_ctx * /* Perform inner SHA512. */ SHA512_Init(&ctx->shactx); SHA512_Update(&ctx->shactx, k_ipad, sizeof(k_ipad)); + bzero(k_ipad, sizeof(k_ipad)); } void From owner-svn-src-stable@FreeBSD.ORG Sat Feb 22 00:41:05 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AE261F8; Sat, 22 Feb 2014 00: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 370FB1FE8; Sat, 22 Feb 2014 00:41:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M0f5rG047919; Sat, 22 Feb 2014 00:41:05 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M0f5bU047918; Sat, 22 Feb 2014 00:41:05 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402220041.s1M0f5bU047918@svn.freebsd.org> From: Xin LI Date: Sat, 22 Feb 2014 00:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r262319 - in stable: 7/sys/geom/eli 8/sys/geom/eli 9/sys/geom/eli X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2014 00:41:05 -0000 Author: delphij Date: Sat Feb 22 00:41:03 2014 New Revision: 262319 URL: http://svnweb.freebsd.org/changeset/base/262319 Log: MFC r261618: In g_eli_crypto_hmac_init(), zero out after using the ipad buffer, k_ipad. Note that the two consumers in geli(4) are not affected by this issue because the way the code is constructed and as such, we believe there is no security impact with or without this change with geli(4)'s usage. Reported by: Serge van den Boom Reviewed by: pjd Modified: stable/7/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/7/sys/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/geom/eli/g_eli_crypto.c stable/9/sys/geom/eli/g_eli_crypto.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) stable/9/sys/ (props changed) Modified: stable/7/sys/geom/eli/g_eli_crypto.c ============================================================================== --- stable/7/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:30:33 2014 (r262318) +++ stable/7/sys/geom/eli/g_eli_crypto.c Sat Feb 22 00:41:03 2014 (r262319) @@ -250,6 +250,7 @@ g_eli_crypto_hmac_init(struct hmac_ctx * /* Perform inner SHA512. */ SHA512_Init(&ctx->shactx); SHA512_Update(&ctx->shactx, k_ipad, sizeof(k_ipad)); + bzero(k_ipad, sizeof(k_ipad)); } void From owner-svn-src-stable@FreeBSD.ORG Sat Feb 22 00:57:56 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5DCF4695; Sat, 22 Feb 2014 00:57: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46FDC10F3; Sat, 22 Feb 2014 00:57:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M0vuTb054885; Sat, 22 Feb 2014 00:57:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M0vubs054884; Sat, 22 Feb 2014 00:57:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402220057.s1M0vubs054884@svn.freebsd.org> From: Xin LI Date: Sat, 22 Feb 2014 00:57:56 +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: r262320 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2014 00:57:56 -0000 Author: delphij Date: Sat Feb 22 00:57:55 2014 New Revision: 262320 URL: http://svnweb.freebsd.org/changeset/base/262320 Log: MFC r261620: MFV r261619: 4574 get_clones_stat does not call zap_count in non-debug kernel zap_count(...) is never called in non-DEBUG kernel. As result "count" variable is always 0, and "goto fail" is always reached. This means get_clones_stat function never makes up list of clones for "clones" properties. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 22 00:41:03 2014 (r262319) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 22 00:57:55 2014 (r262320) @@ -20,9 +20,10 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2011 Martin Matuska * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. - * Portions Copyright (c) 2011 Martin Matuska + * Copyright (c) 2014 RackTop Systems. */ #include @@ -1415,7 +1416,7 @@ get_clones_stat(dsl_dataset_t *ds, nvlis * Only trust it if it has the right number of entries. */ if (ds->ds_phys->ds_next_clones_obj != 0) { - ASSERT0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, + VERIFY0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, &count)); } if (count != ds->ds_phys->ds_num_children - 1) From owner-svn-src-stable@FreeBSD.ORG Sat Feb 22 01:13:49 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 77736D54; Sat, 22 Feb 2014 01:13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 46817126C; Sat, 22 Feb 2014 01:13:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M1Dn8B063113; Sat, 22 Feb 2014 01:13:49 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M1DndZ063106; Sat, 22 Feb 2014 01:13:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402220113.s1M1DndZ063106@svn.freebsd.org> From: Xin LI Date: Sat, 22 Feb 2014 01:13:49 +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: r262323 - in stable: 8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2014 01:13:49 -0000 Author: delphij Date: Sat Feb 22 01:13:48 2014 New Revision: 262323 URL: http://svnweb.freebsd.org/changeset/base/262323 Log: MFC r261620: MFV r261619: 4574 get_clones_stat does not call zap_count in non-debug kernel zap_count(...) is never called in non-DEBUG kernel. As result "count" variable is always 0, and "goto fail" is always reached. This means get_clones_stat function never makes up list of clones for "clones" properties. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Changes in other areas also in this revision: Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 22 01:09:50 2014 (r262322) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 22 01:13:48 2014 (r262323) @@ -20,9 +20,10 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2011 Martin Matuska * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. - * Portions Copyright (c) 2011 Martin Matuska + * Copyright (c) 2014 RackTop Systems. */ #include @@ -1415,7 +1416,7 @@ get_clones_stat(dsl_dataset_t *ds, nvlis * Only trust it if it has the right number of entries. */ if (ds->ds_phys->ds_next_clones_obj != 0) { - ASSERT0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, + VERIFY0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, &count)); } if (count != ds->ds_phys->ds_num_children - 1) From owner-svn-src-stable@FreeBSD.ORG Sat Feb 22 01:13:49 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34C95D53; Sat, 22 Feb 2014 01:13: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F3C1B126B; Sat, 22 Feb 2014 01:13:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1M1DmSI063067; Sat, 22 Feb 2014 01:13:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1M1Dm4n063066; Sat, 22 Feb 2014 01:13:48 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201402220113.s1M1Dm4n063066@svn.freebsd.org> From: Xin LI Date: Sat, 22 Feb 2014 01:13:48 +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: r262323 - in stable: 8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs 9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2014 01:13:49 -0000 Author: delphij Date: Sat Feb 22 01:13:48 2014 New Revision: 262323 URL: http://svnweb.freebsd.org/changeset/base/262323 Log: MFC r261620: MFV r261619: 4574 get_clones_stat does not call zap_count in non-debug kernel zap_count(...) is never called in non-DEBUG kernel. As result "count" variable is always 0, and "goto fail" is always reached. This means get_clones_stat function never makes up list of clones for "clones" properties. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Changes in other areas also in this revision: Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 22 01:09:50 2014 (r262322) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Sat Feb 22 01:13:48 2014 (r262323) @@ -20,9 +20,10 @@ */ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Portions Copyright (c) 2011 Martin Matuska * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. - * Portions Copyright (c) 2011 Martin Matuska + * Copyright (c) 2014 RackTop Systems. */ #include @@ -1415,7 +1416,7 @@ get_clones_stat(dsl_dataset_t *ds, nvlis * Only trust it if it has the right number of entries. */ if (ds->ds_phys->ds_next_clones_obj != 0) { - ASSERT0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, + VERIFY0(zap_count(mos, ds->ds_phys->ds_next_clones_obj, &count)); } if (count != ds->ds_phys->ds_num_children - 1) From owner-svn-src-stable@FreeBSD.ORG Sat Feb 22 18:55:52 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F14AFAB; Sat, 22 Feb 2014 18:55: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 18BAF12EF; Sat, 22 Feb 2014 18:55:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MItqrU097365; Sat, 22 Feb 2014 18:55:52 GMT (envelope-from peter@svn.freebsd.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MIto4x097347; Sat, 22 Feb 2014 18:55:50 GMT (envelope-from peter@svn.freebsd.org) Message-Id: <201402221855.s1MIto4x097347@svn.freebsd.org> From: Peter Wemm Date: Sat, 22 Feb 2014 18:55:50 +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: r262339 - in stable/10/contrib/serf: . auth buckets build X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2014 18:55:52 -0000 Author: peter Date: Sat Feb 22 18:55:49 2014 New Revision: 262339 URL: http://svnweb.freebsd.org/changeset/base/262339 Log: MFC r262324: serf 1.3.4 - improve SSL handling with svn-1.8.8 and other speedups and quality of life fixes. Modified: stable/10/contrib/serf/CHANGES stable/10/contrib/serf/README stable/10/contrib/serf/SConstruct stable/10/contrib/serf/auth/auth.c stable/10/contrib/serf/auth/auth.h stable/10/contrib/serf/auth/auth_basic.c stable/10/contrib/serf/auth/auth_digest.c stable/10/contrib/serf/auth/auth_spnego.c stable/10/contrib/serf/auth/auth_spnego.h stable/10/contrib/serf/auth/auth_spnego_gss.c stable/10/contrib/serf/auth/auth_spnego_sspi.c stable/10/contrib/serf/buckets/headers_buckets.c stable/10/contrib/serf/buckets/response_buckets.c stable/10/contrib/serf/buckets/socket_buckets.c stable/10/contrib/serf/buckets/ssl_buckets.c stable/10/contrib/serf/build/check.py stable/10/contrib/serf/build/gen_def.py stable/10/contrib/serf/build/serf.pc.in stable/10/contrib/serf/context.c stable/10/contrib/serf/outgoing.c stable/10/contrib/serf/serf.h stable/10/contrib/serf/serf_private.h stable/10/contrib/serf/ssltunnel.c Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/serf/CHANGES ============================================================================== --- stable/10/contrib/serf/CHANGES Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/CHANGES Sat Feb 22 18:55:49 2014 (r262339) @@ -1,4 +1,59 @@ -Serf 1.3.0 [2013-07-23, from /tags/1.3.0] +Serf 1.3.4 [2014-02-08, from /tags/1.3.4, rxxxx] + Fix issue #119: Endless loop during ssl tunnel setup with Negotiate authn + Fix issue #123: Can't setup ssl tunnel which sends Connection close header + Fix a race condition when initializing OpenSSL from multiple threads (r2263) + Fix issue #138: Incorrect pkg-config file when GSSAPI isn't configured + + +Serf 1.3.3 [2013-12-09, from /tags/1.3.3, r2242] + Fix issue 129: Try more addresses of multihomed servers + Handle X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE correctly (r2225) + Return APR_TIMEUP from poll() to enable detecting connection timeouts (r2183) + + +Serf 1.3.2 [2013-10-04, from /tags/1.3.2, r2195] + Fix issue 130: HTTP headers should be treated case-insensitively + Fix issue 126: Compilation breaks with Codewarrior compiler + Fix crash during cleanup of SSL buckets in apr_terminate() (r2145) + Fix Windows build: Also export functions with capital letters in .def file + Fix host header when url contains a username or password (r2170) + Ensure less TCP package fragmentation on Windows (r2145) + Handle authentication for responses to HEAD requests (r2178,-9) + Improve serf_get: add option to add request headers, allow url with query, + allow HEAD requests (r2143,r2175,-6) + Improve RFC conformance: don't expect body for certain responses (r2011,-2) + Do not invoke progress callback when no data was received (r2144) + And more test suite fixes and build warning cleanups + SCons-related fixes: + Fix build when GSSAPI not in default include path (2155) + Fix OpenBSD build: always map all LIBPATH entries into RPATH (r2156) + Checksum generation in Windows shared libraries for release builds (2162) + Mac OS X: Use MAJOR version only in dylib install name (r2161) + Use both MAJOR and MINOR version for the shared library name (2163) + Fix the .pc file when installing serf in a non-default LIBDIR (r2191) + + +Serf 1.3.1 [2013-08-15, from /tags/1.3.1, r2138] + Fix issue 77: Endless loop if server doesn't accept Negotiate authentication. + Fix issue 114: ssl/tls renegotiation fails + Fix issue 120: error with ssl tunnel over proxy with KeepAlive off and + Basic authentication. + Fixed bugs with authentication (r2057,2115,2118) + SCons-related fixes: + Fix issue 111: add flag to set custom library path + Fix issue 112: add soname + Fix issue 113: add gssapi libs in the serf pc file + Fix issue 115: Setting RPATH on Solaris broken in SConstruct + Fix issue 116: scons check should return non-zero exit staths + Fix issue 121: make CFLAGS, LIBS, LINKFLAGS and CPPFLAGS take a space- + separated list of flags. + Fix issue 122: make scons PREFIX create the folder if it doesn't exist + Mac OS X: Fix scons --install-sandbox + Solaris: Fix build with cc, don't use unsupported compiler flags + Require SCons version 2.3.0 or higher now (for the soname support). + + +Serf 1.3.0 [2013-07-23, from /tags/1.3.0, r2074] Fix issue 83: use PATH rather than URI within an ssltunnel (r1952) Fix issue 108: improved error reporting from the underlying socket (r1951) NEW: Switch to the SCons build system; retire serfmake, serf.mak, autotools Modified: stable/10/contrib/serf/README ============================================================================== --- stable/10/contrib/serf/README Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/README Sat Feb 22 18:55:49 2014 (r262339) @@ -18,14 +18,14 @@ kept to a minimum to provide high perfor 1.1. SCons build system -serf uses SCons 2.x for its build system. If it is not installed on +serf uses SCons 2.3 for its build system. If it is not installed on your system, then you can install it onto your system. If you do not have permissions, then you can download and install the "local" version into your home directory. When installed privately, simply create a symlink for 'scons' in your PATH to /path/to/scons/scons.py. Fetch the scons-local package: - http://prdownloads.sourceforge.net/scons/scons-local-2.0.1.tar.gz + http://prdownloads.sourceforge.net/scons/scons-local-2.3.0.tar.gz 1.2 Building serf @@ -54,6 +54,12 @@ distinct directory from the source), you $ scons -Y /path/to/serf/source +If you plan to install the library on a system that uses different +paths for architecture dependent files, specify LIBDIR. LIBDIR defaults +to /usr/local/lib otherwise. Example for a 64 bit GNU/Linux system: + +$ scons PREFIX=/usr/ LIBDIR=/usr/lib64 + At any point, the current settings can be examined: $ scons --help @@ -74,6 +80,13 @@ specified on the install command line: $ scons PREFIX=/some/path install +Distribution package maintainers regulary install to a buildroot, and +would normally use something like below in their build systems, with +placeholders for the specific paths: + +$ scons PREFIX=/usr/ LIBDIR=/usr/lib64 +$ scons install --install-sandbox=/path/to/buildroot + 1.4 Cleaning up the build Modified: stable/10/contrib/serf/SConstruct ============================================================================== --- stable/10/contrib/serf/SConstruct Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/SConstruct Sat Feb 22 18:55:49 2014 (r262339) @@ -19,6 +19,8 @@ import sys import os import re +EnsureSConsVersion(2,3,0) + HEADER_FILES = ['serf.h', 'serf_bucket_types.h', 'serf_bucket_util.h', @@ -34,23 +36,35 @@ def _converter(val): if val == 'none': val = [] else: - val = val.split(',') + val = val.split(' ') return val def RawListVariable(key, help, default): """ The input parameters describe a 'raw string list' option. This class - accepts a comma separated list and converts it to a space separated - list. + accepts a space-separated string and converts it to a list. """ return (key, '%s' % (help), default, None, lambda val: _converter(val)) +# Custom path validator, creates directory when a specified option is set. +# To be used to ensure a PREFIX directory is only created when installing. +def createPathIsDirCreateWithTarget(target): + def my_validator(key, val, env): + build_targets = (map(str, BUILD_TARGETS)) + if target in build_targets: + return PathVariable.PathIsDirCreate(key, val, env) + else: + return PathVariable.PathAccept(key, val, env) + return my_validator + # default directories if sys.platform == 'win32': + default_incdir='..' default_libdir='..' default_prefix='Debug' else: - default_libdir='/usr' + default_incdir='/usr' + default_libdir='$PREFIX/lib' default_prefix='/usr/local' opts = Variables(files=[SAVED_CONFIG]) @@ -58,22 +72,26 @@ opts.AddVariables( PathVariable('PREFIX', 'Directory to install under', default_prefix, - PathVariable.PathIsDir), + createPathIsDirCreateWithTarget('install')), + PathVariable('LIBDIR', + 'Directory to install architecture dependent libraries under', + default_libdir, + createPathIsDirCreateWithTarget('install')), PathVariable('APR', "Path to apr-1-config, or to APR's install area", - default_libdir, + default_incdir, PathVariable.PathAccept), PathVariable('APU', "Path to apu-1-config, or to APR's install area", - default_libdir, + default_incdir, PathVariable.PathAccept), PathVariable('OPENSSL', "Path to OpenSSL's install area", - default_libdir, + default_incdir, PathVariable.PathIsDir), PathVariable('ZLIB', "Path to zlib's install area", - default_libdir, + default_incdir, PathVariable.PathIsDir), PathVariable('GSSAPI', "Path to GSSAPI's install area", @@ -86,14 +104,14 @@ opts.AddVariables( "Enable using a static compiled APR", False), RawListVariable('CC', "Command name or path of the C compiler", None), - RawListVariable('CFLAGS', "Extra flags for the C compiler (comma separated)", + RawListVariable('CFLAGS', "Extra flags for the C compiler (space-separated)", None), RawListVariable('LIBS', "Extra libraries passed to the linker, " - "e.g. -l (comma separated)", None), - RawListVariable('LINKFLAGS', "Extra flags for the linker (comma separated)", + "e.g. \"-l -l\" (space separated)", None), + RawListVariable('LINKFLAGS', "Extra flags for the linker (space-separated)", None), RawListVariable('CPPFLAGS', "Extra flags for the C preprocessor " - "(comma separated)", None), + "(space separated)", None), ) if sys.platform == 'win32': @@ -146,6 +164,8 @@ match = re.search('SERF_MAJOR_VERSION ([ re.DOTALL) MAJOR, MINOR, PATCH = [int(x) for x in match.groups()] env.Append(MAJOR=str(MAJOR)) +env.Append(MINOR=str(MINOR)) +env.Append(PATCH=str(PATCH)) # Calling external programs is okay if we're not cleaning or printing help. # (cleaning: no sense in fetching information; help: we may not know where @@ -181,10 +201,18 @@ opts.Save(SAVED_CONFIG, env) # PLATFORM-SPECIFIC BUILD TWEAKS thisdir = os.getcwd() -libdir = '$PREFIX/lib' +libdir = '$LIBDIR' incdir = '$PREFIX/include/serf-$MAJOR' -LIBNAME = 'libserf-${MAJOR}' +# This version string is used in the dynamic library name, and for Mac OS X also +# for the current_version and compatibility_version options in the .dylib +# +# Unfortunately we can't set the .dylib compatibility_version option separately +# from current_version, so don't use the PATCH level to avoid that build and +# runtime patch levels have to be identical. +env['SHLIBVERSION'] = '%d.%d.%d' % (MAJOR, MINOR, 0) + +LIBNAME = 'libserf-%d' % (MAJOR,) if sys.platform != 'win32': LIBNAMESTATIC = LIBNAME else: @@ -196,23 +224,17 @@ env.Append(RPATH=libdir, if sys.platform == 'darwin': # linkflags.append('-Wl,-install_name,@executable_path/%s.dylib' % (LIBNAME,)) env.Append(LINKFLAGS='-Wl,-install_name,%s/%s.dylib' % (thisdir, LIBNAME,)) - # 'man ld' says positive non-zero for the first number, so we add one. - # Mac's interpretation of compatibility is the same as our MINOR version. - env.Append(LINKFLAGS='-Wl,-compatibility_version,%d' % (MINOR+1,)) - env.Append(LINKFLAGS='-Wl,-current_version,%d.%d' % (MINOR+1, PATCH,)) if sys.platform != 'win32': ### gcc only. figure out appropriate test / better way to check these ### flags, and check for gcc. env.Append(CFLAGS='-std=c89') - env.Append(CCFLAGS=[ - '-Wdeclaration-after-statement', - '-Wmissing-prototypes', - ]) - ### -Wall is not available on Solaris + ### These warnings are not available on Solaris if sys.platform != 'sunos5': - env.Append(CCFLAGS='-Wall') + env.Append(CCFLAGS=['-Wdeclaration-after-statement', + '-Wmissing-prototypes', + '-Wall']) if debug: env.Append(CCFLAGS='-g') @@ -239,6 +261,7 @@ else: # Optimize for speed, use DLL runtime env.Append(CCFLAGS=['/O2', '/MD']) env.Append(CPPDEFINES='NDEBUG') + env.Append(LINKFLAGS='/RELEASE') # PLAN THE BUILD SHARED_SOURCES = [] @@ -334,28 +357,32 @@ else: # If build with gssapi, get its information and define SERF_HAVE_GSSAPI if gssapi and CALLOUT_OKAY: - env.ParseConfig('$GSSAPI --libs gssapi') + env.ParseConfig('$GSSAPI --cflags gssapi') + def parse_libs(env, cmd, unique=1): + env['GSSAPI_LIBS'] = cmd.strip() + return env.MergeFlags(cmd, unique) + env.ParseConfig('$GSSAPI --libs gssapi', parse_libs) env.Append(CPPDEFINES='SERF_HAVE_GSSAPI') if sys.platform == 'win32': env.Append(CPPDEFINES=['SERF_HAVE_SSPI']) -# On Solaris, the -R values that APR describes never make it into actual +# On some systems, the -R values that APR describes never make it into actual # RPATH flags. We'll manually map all directories in LIBPATH into new # flags to set RPATH values. -if sys.platform == 'sunos5': - for d in env['LIBPATH']: - env.Append(RPATH=d) +for d in env['LIBPATH']: + env.Append(RPATH=':'+d) # Set up the construction of serf-*.pc -# TODO: add gssapi libs pkgconfig = env.Textfile('serf-%d.pc' % (MAJOR,), env.File('build/serf.pc.in'), SUBST_DICT = { '@MAJOR@': str(MAJOR), '@PREFIX@': '$PREFIX', + '@LIBDIR@': '$LIBDIR', '@INCLUDE_SUBDIR@': 'serf-%d' % (MAJOR,), '@VERSION@': '%d.%d.%d' % (MAJOR, MINOR, PATCH), - '@LIBS@': '%s %s -lz' % (apu_libs, apr_libs), + '@LIBS@': '%s %s %s -lz' % (apu_libs, apr_libs, + env.get('GSSAPI_LIBS', '')), }) env.Default(lib_static, lib_shared, pkgconfig) @@ -371,16 +398,22 @@ if CALLOUT_OKAY: # INSTALLATION STUFF install_static = env.Install(libdir, lib_static) -install_shared = env.Install(libdir, lib_shared) +install_shared = env.InstallVersionedLib(libdir, lib_shared) if sys.platform == 'darwin': + # Change the shared library install name (id) to its final name and location. + # Notes: + # If --install-sandbox= is specified, install_shared_path will point + # to a path in the sandbox. We can't use that path because the sandbox is + # only a temporary location. The id should be the final target path. + # Also, we shouldn't use the complete version number for id, as that'll + # make applications depend on the exact major.minor.patch version of serf. + install_shared_path = install_shared[0].abspath + target_install_shared_path = os.path.join(libdir, '%s.dylib' % LIBNAME) env.AddPostAction(install_shared, ('install_name_tool -id %s %s' - % (install_shared_path, + % (target_install_shared_path, install_shared_path))) - ### construct shared lib symlinks. this also means install the lib - ### as libserf-2.1.0.0.dylib, then add the symlinks. - ### note: see InstallAs env.Alias('install-lib', [install_static, install_shared, ]) Modified: stable/10/contrib/serf/auth/auth.c ============================================================================== --- stable/10/contrib/serf/auth/auth.c Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/auth/auth.c Sat Feb 22 18:55:49 2014 (r262339) @@ -23,7 +23,8 @@ #include static apr_status_t -default_auth_response_handler(peer_t peer, +default_auth_response_handler(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, @@ -151,6 +152,17 @@ static int handle_auth_headers(int code, if (!auth_hdr) continue; + if (code == 401) { + authn_info = serf__get_authn_info_for_server(conn); + } else { + authn_info = &ctx->proxy_authn_info; + } + + if (authn_info->failed_authn_types & scheme->type) { + /* Skip this authn type since we already tried it before. */ + continue; + } + /* Found a matching scheme */ status = APR_SUCCESS; @@ -159,11 +171,6 @@ static int handle_auth_headers(int code, serf__log_skt(AUTH_VERBOSE, __FILE__, conn->skt, "... matched: %s\n", scheme->name); - if (code == 401) { - authn_info = serf__get_authn_info_for_server(conn); - } else { - authn_info = &ctx->proxy_authn_info; - } /* If this is the first time we use this scheme on this context and/or this connection, make sure to initialize the authentication handler first. */ @@ -198,6 +205,12 @@ static int handle_auth_headers(int code, */ serf__log_skt(AUTH_VERBOSE, __FILE__, conn->skt, "%s authentication failed.\n", scheme->name); + + /* Clear per-request auth_baton when switching to next auth scheme. */ + request->auth_baton = NULL; + + /* Remember failed auth types to skip in future. */ + authn_info->failed_authn_types |= scheme->type; } return status; @@ -221,7 +234,7 @@ static int store_header_in_dict(void *ba char *auth_name, *c; /* We're only interested in xxxx-Authenticate headers. */ - if (strcmp(key, ab->header) != 0) + if (strcasecmp(key, ab->header) != 0) return 0; /* Extract the authentication scheme name. */ @@ -378,16 +391,16 @@ apr_status_t serf__handle_auth_response( authn_info = serf__get_authn_info_for_server(conn); if (authn_info->scheme) { validate_resp = authn_info->scheme->validate_response_func; - resp_status = validate_resp(HOST, sl.code, conn, request, response, - pool); + resp_status = validate_resp(authn_info->scheme, HOST, sl.code, + conn, request, response, pool); } /* Validate the response proxy authn headers. */ authn_info = &ctx->proxy_authn_info; if (!resp_status && authn_info->scheme) { validate_resp = authn_info->scheme->validate_response_func; - resp_status = validate_resp(PROXY, sl.code, conn, request, response, - pool); + resp_status = validate_resp(authn_info->scheme, PROXY, sl.code, + conn, request, response, pool); } if (resp_status) { Modified: stable/10/contrib/serf/auth/auth.h ============================================================================== --- stable/10/contrib/serf/auth/auth.h Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/auth/auth.h Sat Feb 22 18:55:49 2014 (r262339) @@ -78,7 +78,8 @@ apr_status_t serf__setup_request_digest_ const char *method, const char *uri, serf_bucket_t *hdrs_bkt); -apr_status_t serf__validate_response_digest_auth(peer_t peer, +apr_status_t serf__validate_response_digest_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, @@ -108,7 +109,8 @@ apr_status_t serf__setup_request_spnego_ const char *method, const char *uri, serf_bucket_t *hdrs_bkt); -apr_status_t serf__validate_response_spnego_auth(peer_t peer, +apr_status_t serf__validate_response_spnego_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, Modified: stable/10/contrib/serf/auth/auth_basic.c ============================================================================== --- stable/10/contrib/serf/auth/auth_basic.c Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/auth/auth_basic.c Sat Feb 22 18:55:49 2014 (r262339) @@ -48,7 +48,7 @@ serf__handle_basic_auth(int code, apr_status_t status; apr_pool_t *cred_pool; char *username, *password, *realm_name; - const char *eq, *realm; + const char *eq, *realm = NULL; /* Can't do Basic authentication if there's no callback to get username & password. */ Modified: stable/10/contrib/serf/auth/auth_digest.c ============================================================================== --- stable/10/contrib/serf/auth/auth_digest.c Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/auth/auth_digest.c Sat Feb 22 18:55:49 2014 (r262339) @@ -96,8 +96,9 @@ random_cnonce(apr_pool_t *pool) return hex_encode((unsigned char*)buf, pool); } -static const char * -build_digest_ha1(const char *username, +static apr_status_t +build_digest_ha1(const char **out_ha1, + const char *username, const char *password, const char *realm_name, apr_pool_t *pool) @@ -113,12 +114,17 @@ build_digest_ha1(const char *username, realm_name, password); status = apr_md5(ha1, tmp, strlen(tmp)); + if (status) + return status; + + *out_ha1 = hex_encode(ha1, pool); - return hex_encode(ha1, pool); + return APR_SUCCESS; } -static const char * -build_digest_ha2(const char *uri, +static apr_status_t +build_digest_ha2(const char **out_ha2, + const char *uri, const char *method, const char *qop, apr_pool_t *pool) @@ -134,17 +140,21 @@ build_digest_ha2(const char *uri, method, uri); status = apr_md5(ha2, tmp, strlen(tmp)); + if (status) + return status; - return hex_encode(ha2, pool); + *out_ha2 = hex_encode(ha2, pool); + + return APR_SUCCESS; } else { /* TODO: auth-int isn't supported! */ + return APR_ENOTIMPL; } - - return NULL; } -static const char * -build_auth_header(digest_authn_info_t *digest_info, +static apr_status_t +build_auth_header(const char **out_header, + digest_authn_info_t *digest_info, const char *path, const char *method, apr_pool_t *pool) @@ -156,7 +166,9 @@ build_auth_header(digest_authn_info_t *d const char *response_hdr_hex; apr_status_t status; - ha2 = build_digest_ha2(path, method, digest_info->qop, pool); + status = build_digest_ha2(&ha2, path, method, digest_info->qop, pool); + if (status) + return status; hdr = apr_psprintf(pool, "Digest realm=\"%s\"," @@ -194,6 +206,9 @@ build_auth_header(digest_authn_info_t *d } status = apr_md5(response_hdr, response, strlen(response)); + if (status) + return status; + response_hdr_hex = hex_encode(response_hdr, pool); hdr = apr_psprintf(pool, "%s, response=\"%s\"", hdr, response_hdr_hex); @@ -207,7 +222,9 @@ build_auth_header(digest_authn_info_t *d digest_info->algorithm); } - return hdr; + *out_header = hdr; + + return APR_SUCCESS; } apr_status_t @@ -330,8 +347,8 @@ serf__handle_digest_auth(int code, digest_info->username = apr_pstrdup(digest_info->pool, username); digest_info->digest_nc++; - digest_info->ha1 = build_digest_ha1(username, password, digest_info->realm, - digest_info->pool); + status = build_digest_ha1(&digest_info->ha1, username, password, + digest_info->realm, digest_info->pool); apr_pool_destroy(cred_pool); @@ -339,7 +356,7 @@ serf__handle_digest_auth(int code, likes. */ serf_connection_set_max_outstanding_requests(conn, 0); - return APR_SUCCESS; + return status; } apr_status_t @@ -387,7 +404,7 @@ serf__setup_request_digest_auth(peer_t p serf_context_t *ctx = conn->ctx; serf__authn_info_t *authn_info; digest_authn_info_t *digest_info; - apr_status_t status = APR_SUCCESS; + apr_status_t status; if (peer == HOST) { authn_info = serf__get_authn_info_for_server(conn); @@ -421,8 +438,10 @@ serf__setup_request_digest_auth(peer_t p /* Build a new Authorization header. */ digest_info->header = (peer == HOST) ? "Authorization" : "Proxy-Authorization"; - value = build_auth_header(digest_info, path, method, - conn->pool); + status = build_auth_header(&value, digest_info, path, method, + conn->pool); + if (status) + return status; serf_bucket_headers_setn(hdrs_bkt, digest_info->header, value); @@ -431,14 +450,15 @@ serf__setup_request_digest_auth(peer_t p /* Store the uri of this request on the serf_request_t object, to make it available when validating the Authentication-Info header of the matching response. */ - request->auth_baton = path; + request->auth_baton = (void *)path; } - return status; + return APR_SUCCESS; } apr_status_t -serf__validate_response_digest_auth(peer_t peer, +serf__validate_response_digest_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, @@ -453,6 +473,7 @@ serf__validate_response_digest_auth(peer const char *nc_str = NULL; serf_bucket_t *hdrs; serf_context_t *ctx = conn->ctx; + apr_status_t status; hdrs = serf_bucket_response_get_headers(response); @@ -516,7 +537,10 @@ serf__validate_response_digest_auth(peer } digest_info = authn_info->baton; - ha2 = build_digest_ha2(req_uri, "", qop, pool); + status = build_digest_ha2(&ha2, req_uri, "", qop, pool); + if (status) + return status; + tmp = apr_psprintf(pool, "%s:%s:%s:%s:%s:%s", digest_info->ha1, digest_info->nonce, nc_str, digest_info->cnonce, digest_info->qop, ha2); Modified: stable/10/contrib/serf/auth/auth_spnego.c ============================================================================== --- stable/10/contrib/serf/auth/auth_spnego.c Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/auth/auth_spnego.c Sat Feb 22 18:55:49 2014 (r262339) @@ -181,7 +181,8 @@ typedef struct claim to be. The session key can only be used with the HTTP service on the target host. */ static apr_status_t -gss_api_get_credentials(char *token, apr_size_t token_len, +gss_api_get_credentials(serf_connection_t *conn, + char *token, apr_size_t token_len, const char *hostname, const char **buf, apr_size_t *buf_len, gss_authn_info_t *gss_info) @@ -202,6 +203,7 @@ gss_api_get_credentials(char *token, apr /* Establish a security context to the server. */ status = serf__spnego_init_sec_context( + conn, gss_info->gss_ctx, KRB_HTTP_SERVICE, hostname, &input_buf, @@ -212,7 +214,11 @@ gss_api_get_credentials(char *token, apr switch(status) { case APR_SUCCESS: - gss_info->state = gss_api_auth_completed; + if (output_buf.length == 0) { + gss_info->state = gss_api_auth_completed; + } else { + gss_info->state = gss_api_auth_in_progress; + } break; case APR_EAGAIN: gss_info->state = gss_api_auth_in_progress; @@ -242,6 +248,7 @@ do_auth(peer_t peer, int code, gss_authn_info_t *gss_info, serf_connection_t *conn, + serf_request_t *request, const char *auth_hdr, apr_pool_t *pool) { @@ -306,6 +313,14 @@ do_auth(peer_t peer, break; } + if (request->auth_baton && !token) { + /* We provided token with this request, but server responded with empty + authentication header. This means server rejected our credentials. + XXX: Probably we need separate error code for this case like + SERF_ERROR_AUTHN_CREDS_REJECTED? */ + return SERF_ERROR_AUTHN_FAILED; + } + /* If the server didn't provide us with a token, start with a new initial step in the SPNEGO authentication. */ if (!token) { @@ -314,14 +329,16 @@ do_auth(peer_t peer, } if (peer == HOST) { - status = gss_api_get_credentials(token, token_len, + status = gss_api_get_credentials(conn, + token, token_len, conn->host_info.hostname, &tmp, &tmp_len, gss_info); } else { char *proxy_host; apr_getnameinfo(&proxy_host, conn->ctx->proxy_address, 0); - status = gss_api_get_credentials(token, token_len, proxy_host, + status = gss_api_get_credentials(conn, + token, token_len, proxy_host, &tmp, &tmp_len, gss_info); } @@ -357,24 +374,32 @@ serf__init_spnego_connection(const serf_ serf_connection_t *conn, apr_pool_t *pool) { - gss_authn_info_t *gss_info; - apr_status_t status; - - gss_info = apr_pcalloc(conn->pool, sizeof(*gss_info)); - gss_info->pool = conn->pool; - gss_info->state = gss_api_auth_not_started; - gss_info->pstate = pstate_init; - status = serf__spnego_create_sec_context(&gss_info->gss_ctx, scheme, - gss_info->pool, pool); - - if (status) { - return status; - } + serf_context_t *ctx = conn->ctx; + serf__authn_info_t *authn_info; + gss_authn_info_t *gss_info = NULL; + /* For proxy authentication, reuse the gss context for all connections. + For server authentication, create a new gss context per connection. */ if (code == 401) { - conn->authn_baton = gss_info; + authn_info = &conn->authn_info; } else { - conn->proxy_authn_baton = gss_info; + authn_info = &ctx->proxy_authn_info; + } + gss_info = authn_info->baton; + + if (!gss_info) { + apr_status_t status; + + gss_info = apr_pcalloc(conn->pool, sizeof(*gss_info)); + gss_info->pool = conn->pool; + gss_info->state = gss_api_auth_not_started; + gss_info->pstate = pstate_init; + status = serf__spnego_create_sec_context(&gss_info->gss_ctx, scheme, + gss_info->pool, pool); + if (status) { + return status; + } + authn_info->baton = gss_info; } /* Make serf send the initial requests one by one */ @@ -397,13 +422,15 @@ serf__handle_spnego_auth(int code, apr_pool_t *pool) { serf_connection_t *conn = request->conn; - gss_authn_info_t *gss_info = (code == 401) ? conn->authn_baton : - conn->proxy_authn_baton; + serf_context_t *ctx = conn->ctx; + gss_authn_info_t *gss_info = (code == 401) ? conn->authn_info.baton : + ctx->proxy_authn_info.baton; return do_auth(code == 401 ? HOST : PROXY, code, gss_info, request->conn, + request, auth_hdr, pool); } @@ -418,8 +445,9 @@ serf__setup_request_spnego_auth(peer_t p const char *uri, serf_bucket_t *hdrs_bkt) { - gss_authn_info_t *gss_info = (peer == HOST) ? conn->authn_baton : - conn->proxy_authn_baton; + serf_context_t *ctx = conn->ctx; + gss_authn_info_t *gss_info = (peer == HOST) ? conn->authn_info.baton : + ctx->proxy_authn_info.baton; /* If we have an ongoing authentication handshake, the handler of the previous response will have created the authn headers for this request @@ -431,6 +459,10 @@ serf__setup_request_spnego_auth(peer_t p serf_bucket_headers_setn(hdrs_bkt, gss_info->header, gss_info->value); + /* Remember that we're using this request for authentication + handshake. */ + request->auth_baton = (void*) TRUE; + /* We should send each token only once. */ gss_info->header = NULL; gss_info->value = NULL; @@ -469,6 +501,7 @@ serf__setup_request_spnego_auth(peer_t p code, gss_info, conn, + request, 0l, /* no response authn header */ conn->pool); if (status) @@ -476,6 +509,11 @@ serf__setup_request_spnego_auth(peer_t p serf_bucket_headers_setn(hdrs_bkt, gss_info->header, gss_info->value); + + /* Remember that we're using this request for authentication + handshake. */ + request->auth_baton = (void*) TRUE; + /* We should send each token only once. */ gss_info->header = NULL; gss_info->value = NULL; @@ -486,19 +524,70 @@ serf__setup_request_spnego_auth(peer_t p return APR_SUCCESS; } +/** + * Baton passed to the get_auth_header callback function. + */ +typedef struct { + const char *hdr_name; + const char *auth_name; + const char *hdr_value; + apr_pool_t *pool; +} get_auth_header_baton_t; + +static int +get_auth_header_cb(void *baton, + const char *key, + const char *header) +{ + get_auth_header_baton_t *b = baton; + + /* We're only interested in xxxx-Authenticate headers. */ + if (strcasecmp(key, b->hdr_name) != 0) + return 0; + + /* Check if header value starts with interesting auth name. */ + if (strncmp(header, b->auth_name, strlen(b->auth_name)) == 0) { + /* Save interesting header value and stop iteration. */ + b->hdr_value = apr_pstrdup(b->pool, header); + return 1; + } + + return 0; +} + +static const char * +get_auth_header(serf_bucket_t *hdrs, + const char *hdr_name, + const char *auth_name, + apr_pool_t *pool) +{ + get_auth_header_baton_t b; + + b.auth_name = hdr_name; + b.hdr_name = auth_name; + b.hdr_value = NULL; + b.pool = pool; + + serf_bucket_headers_do(hdrs, get_auth_header_cb, &b); + + return b.hdr_value; +} + /* Function is called when 2xx responses are received. Normally we don't * have to do anything, except for the first response after the * authentication handshake. This specific response includes authentication * data which should be validated by the client (mutual authentication). */ apr_status_t -serf__validate_response_spnego_auth(peer_t peer, +serf__validate_response_spnego_auth(const serf__authn_scheme_t *scheme, + peer_t peer, int code, serf_connection_t *conn, serf_request_t *request, serf_bucket_t *response, apr_pool_t *pool) { + serf_context_t *ctx = conn->ctx; gss_authn_info_t *gss_info; const char *auth_hdr_name; @@ -511,10 +600,10 @@ serf__validate_response_spnego_auth(peer "Validate Negotiate response header.\n"); if (peer == HOST) { - gss_info = conn->authn_baton; + gss_info = conn->authn_info.baton; auth_hdr_name = "WWW-Authenticate"; } else { - gss_info = conn->proxy_authn_baton; + gss_info = ctx->proxy_authn_info.baton; auth_hdr_name = "Proxy-Authenticate"; } @@ -524,11 +613,23 @@ serf__validate_response_spnego_auth(peer apr_status_t status; hdrs = serf_bucket_response_get_headers(response); - auth_hdr_val = serf_bucket_headers_get(hdrs, auth_hdr_name); + auth_hdr_val = get_auth_header(hdrs, auth_hdr_name, scheme->name, + pool); - status = do_auth(peer, code, gss_info, conn, auth_hdr_val, pool); - if (status) - return status; + if (auth_hdr_val) { + status = do_auth(peer, code, gss_info, conn, request, auth_hdr_val, + pool); + if (status) { + return status; + } + } else { + /* No Authenticate headers, nothing to validate: authentication + completed.*/ + gss_info->state = gss_api_auth_completed; + + serf__log_skt(AUTH_VERBOSE, __FILE__, conn->skt, + "SPNEGO handshake completed.\n"); + } } if (gss_info->state == gss_api_auth_completed) { Modified: stable/10/contrib/serf/auth/auth_spnego.h ============================================================================== --- stable/10/contrib/serf/auth/auth_spnego.h Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/auth/auth_spnego.h Sat Feb 22 18:55:49 2014 (r262339) @@ -88,14 +88,15 @@ serf__spnego_create_sec_context(serf__sp * Other returns values indicates error. */ apr_status_t -serf__spnego_init_sec_context(serf__spnego_context_t *ctx, - const char *service, - const char *hostname, - serf__spnego_buffer_t *input_buf, - serf__spnego_buffer_t *output_buf, - apr_pool_t *result_pool, - apr_pool_t *scratch_pool - ); +serf__spnego_init_sec_context(serf_connection_t *conn, + serf__spnego_context_t *ctx, + const char *service, + const char *hostname, + serf__spnego_buffer_t *input_buf, + serf__spnego_buffer_t *output_buf, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool + ); /* * Reset a previously created security context so we can start with a new one. Modified: stable/10/contrib/serf/auth/auth_spnego_gss.c ============================================================================== --- stable/10/contrib/serf/auth/auth_spnego_gss.c Sat Feb 22 18:53:42 2014 (r262338) +++ stable/10/contrib/serf/auth/auth_spnego_gss.c Sat Feb 22 18:55:49 2014 (r262339) @@ -43,7 +43,7 @@ struct serf__spnego_context_t }; static void -log_error(int verbose_flag, const char *filename, +log_error(int verbose_flag, apr_socket_t *skt, serf__spnego_context_t *ctx, OM_uint32 err_maj_stat, OM_uint32 err_min_stat, @@ -70,7 +70,7 @@ log_error(int verbose_flag, const char * &stat_buff); } - serf__log(verbose_flag, filename, + serf__log_skt(verbose_flag, __FILE__, skt, "%s (%x,%d): %s\n", msg, err_maj_stat, err_min_stat, stat_buff.value); } @@ -89,7 +89,7 @@ cleanup_ctx(void *data) gss_maj_stat = gss_delete_sec_context(&gss_min_stat, &ctx->gss_ctx, GSS_C_NO_BUFFER); if(GSS_ERROR(gss_maj_stat)) { - log_error(AUTH_VERBOSE, __FILE__, ctx, + log_error(AUTH_VERBOSE, NULL, ctx, gss_maj_stat, gss_min_stat, "Error cleaning up GSS security context"); return SERF_ERROR_AUTHN_FAILED; @@ -146,7 +146,8 @@ serf__spnego_reset_sec_context(serf__spn } apr_status_t -serf__spnego_init_sec_context(serf__spnego_context_t *ctx, +serf__spnego_init_sec_context(serf_connection_t *conn, + serf__spnego_context_t *ctx, const char *service, const char *hostname, serf__spnego_buffer_t *input_buf, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Sat Feb 22 20:12:11 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id F282E1B0; Sat, 22 Feb 2014 20:12: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9434F191A; Sat, 22 Feb 2014 20:12:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MKCA8F028460; Sat, 22 Feb 2014 20:12:10 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MKCAW7028459; Sat, 22 Feb 2014 20:12:10 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402222012.s1MKCAW7028459@svn.freebsd.org> From: John Baldwin Date: Sat, 22 Feb 2014 20:12:10 +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: r262342 - 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-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2014 20:12:11 -0000 Author: jhb Date: Sat Feb 22 20:12:10 2014 New Revision: 262342 URL: http://svnweb.freebsd.org/changeset/base/262342 Log: Record earlier merge of 257018. Modified: Directory Properties: stable/10/ (props changed) From owner-svn-src-stable@FreeBSD.ORG Sat Feb 22 23:34:41 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ED438AB7; Sat, 22 Feb 2014 23:34: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)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id D5AA3187E; Sat, 22 Feb 2014 23:34:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s1MNYeJB007254; Sat, 22 Feb 2014 23:34:40 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s1MNYdmD007244; Sat, 22 Feb 2014 23:34:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201402222334.s1MNYdmD007244@svn.freebsd.org> From: John Baldwin Date: Sat, 22 Feb 2014 23:34:39 +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: r262349 - in stable/10/sys/amd64/vmm: . intel X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Feb 2014 23:34:41 -0000 Author: jhb Date: Sat Feb 22 23:34:39 2014 New Revision: 262349 URL: http://svnweb.freebsd.org/changeset/base/262349 Log: MFC 257297: Remove unnecessary includes of Modified: stable/10/sys/amd64/vmm/intel/vmcs.c stable/10/sys/amd64/vmm/intel/vmx.c stable/10/sys/amd64/vmm/intel/vmx_genassym.c stable/10/sys/amd64/vmm/intel/vtd.c stable/10/sys/amd64/vmm/vmm.c stable/10/sys/amd64/vmm/vmm_dev.c stable/10/sys/amd64/vmm/vmm_instruction_emul.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/vmm/intel/vmcs.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmcs.c Sat Feb 22 23:32:33 2014 (r262348) +++ stable/10/sys/amd64/vmm/intel/vmcs.c Sat Feb 22 23:34:39 2014 (r262349) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include "vmm_host.h" #include "vmcs.h" Modified: stable/10/sys/amd64/vmm/intel/vmx.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx.c Sat Feb 22 23:32:33 2014 (r262348) +++ stable/10/sys/amd64/vmm/intel/vmx.c Sat Feb 22 23:34:39 2014 (r262349) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include Modified: stable/10/sys/amd64/vmm/intel/vmx_genassym.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vmx_genassym.c Sat Feb 22 23:32:33 2014 (r262348) +++ stable/10/sys/amd64/vmm/intel/vmx_genassym.c Sat Feb 22 23:34:39 2014 (r262349) @@ -38,8 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include "vmx.h" #include "vmx_cpufunc.h" Modified: stable/10/sys/amd64/vmm/intel/vtd.c ============================================================================== --- stable/10/sys/amd64/vmm/intel/vtd.c Sat Feb 22 23:32:33 2014 (r262348) +++ stable/10/sys/amd64/vmm/intel/vtd.c Sat Feb 22 23:34:39 2014 (r262349) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include Modified: stable/10/sys/amd64/vmm/vmm.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm.c Sat Feb 22 23:32:33 2014 (r262348) +++ stable/10/sys/amd64/vmm/vmm.c Sat Feb 22 23:34:39 2014 (r262349) @@ -57,7 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: stable/10/sys/amd64/vmm/vmm_dev.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_dev.c Sat Feb 22 23:32:33 2014 (r262348) +++ stable/10/sys/amd64/vmm/vmm_dev.c Sat Feb 22 23:34:39 2014 (r262349) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: stable/10/sys/amd64/vmm/vmm_instruction_emul.c ============================================================================== --- stable/10/sys/amd64/vmm/vmm_instruction_emul.c Sat Feb 22 23:32:33 2014 (r262348) +++ stable/10/sys/amd64/vmm/vmm_instruction_emul.c Sat Feb 22 23:34:39 2014 (r262349) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #else /* !_KERNEL */