From owner-svn-src-stable@FreeBSD.ORG Sun Jun 30 08:36:20 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 62C9ABD4; Sun, 30 Jun 2013 08:36:20 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5361017CC; Sun, 30 Jun 2013 08:36:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5U8aKDS013265; Sun, 30 Jun 2013 08:36:20 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5U8aKfe013264; Sun, 30 Jun 2013 08:36:20 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201306300836.r5U8aKfe013264@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 30 Jun 2013 08:36: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: r252410 - stable/9/lib/libprocstat 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.14 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, 30 Jun 2013 08:36:20 -0000 Author: trociny Date: Sun Jun 30 08:36:19 2013 New Revision: 252410 URL: http://svnweb.freebsd.org/changeset/base/252410 Log: MFC r250378: Make errbuf optional, so if a caller is not interested in an error message she can pass NULL (procstat(1) already does this). Modified: stable/9/lib/libprocstat/libprocstat.c Directory Properties: stable/9/lib/libprocstat/ (props changed) Modified: stable/9/lib/libprocstat/libprocstat.c ============================================================================== --- stable/9/lib/libprocstat/libprocstat.c Sun Jun 30 07:46:22 2013 (r252409) +++ stable/9/lib/libprocstat/libprocstat.c Sun Jun 30 08:36:19 2013 (r252410) @@ -902,7 +902,8 @@ procstat_get_pipe_info(struct procstat * return (procstat_get_pipe_info_sysctl(fst, ps, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -931,7 +932,8 @@ procstat_get_pipe_info_kvm(kvm_t *kd, st return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -967,7 +969,8 @@ procstat_get_pts_info(struct procstat *p return (procstat_get_pts_info_sysctl(fst, pts, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -995,7 +998,8 @@ procstat_get_pts_info_kvm(kvm_t *kd, str return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -1030,7 +1034,8 @@ procstat_get_sem_info(struct procstat *p return (procstat_get_sem_info_sysctl(fst, sem, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -1076,7 +1081,8 @@ procstat_get_sem_info_kvm(kvm_t *kd, str return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -1111,7 +1117,8 @@ procstat_get_shm_info(struct procstat *p return (procstat_get_shm_info_sysctl(fst, shm, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -1157,7 +1164,8 @@ procstat_get_shm_info_kvm(kvm_t *kd, str return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -1192,7 +1200,8 @@ procstat_get_vnode_info(struct procstat return (procstat_get_vnode_info_sysctl(fst, vn, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -1264,7 +1273,8 @@ procstat_get_vnode_info_kvm(kvm_t *kd, s break; } if (i == NTYPES) { - snprintf(errbuf, _POSIX2_LINE_MAX, "?(%s)", tagstr); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "?(%s)", tagstr); return (1); } vn->vn_mntdir = getmnton(kd, vnode.v_mount); @@ -1278,7 +1288,8 @@ procstat_get_vnode_info_kvm(kvm_t *kd, s return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } @@ -1359,7 +1370,10 @@ procstat_get_vnode_info_sysctl(struct fi if (vntype == PS_FST_VTYPE_VNON || vntype == PS_FST_VTYPE_VBAD) return (0); if ((status & KF_ATTR_VALID) == 0) { - snprintf(errbuf, _POSIX2_LINE_MAX, "? (no info available)"); + if (errbuf != NULL) { + snprintf(errbuf, _POSIX2_LINE_MAX, + "? (no info available)"); + } return (1); } if (path && *path) { @@ -1400,7 +1414,8 @@ procstat_get_socket_info(struct procstat return (procstat_get_socket_info_sysctl(fst, sock, errbuf)); } else { warnx("unknown access method: %d", procstat->type); - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } } @@ -1498,7 +1513,8 @@ procstat_get_socket_info_kvm(kvm_t *kd, return (0); fail: - snprintf(errbuf, _POSIX2_LINE_MAX, "error"); + if (errbuf != NULL) + snprintf(errbuf, _POSIX2_LINE_MAX, "error"); return (1); } From owner-svn-src-stable@FreeBSD.ORG Sun Jun 30 16:02:43 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6892B764; Sun, 30 Jun 2013 16:02:43 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5AB41127B; Sun, 30 Jun 2013 16:02:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r5UG2hAu043811; Sun, 30 Jun 2013 16:02:43 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r5UG2hQg043810; Sun, 30 Jun 2013 16:02:43 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201306301602.r5UG2hQg043810@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 30 Jun 2013 16:02: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: r252420 - stable/9/sys/fs/ext2fs 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.14 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, 30 Jun 2013 16:02:43 -0000 Author: pfg Date: Sun Jun 30 16:02:42 2013 New Revision: 252420 URL: http://svnweb.freebsd.org/changeset/base/252420 Log: MFC r252259: Minor sort. Modified: stable/9/sys/fs/ext2fs/ext2_extern.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_extern.h ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_extern.h Sun Jun 30 15:00:07 2013 (r252419) +++ stable/9/sys/fs/ext2fs/ext2_extern.h Sun Jun 30 16:02:42 2013 (r252420) @@ -60,8 +60,8 @@ void ext2_dirbad(struct inode *ip, doff_ void ext2_ei2i(struct ext2fs_dinode *, struct inode *); int ext2_getlbns(struct vnode *, int32_t, struct indir *, int *); void ext2_i2ei(struct inode *, struct ext2fs_dinode *); -int ext2_reallocblks(struct vop_reallocblks_args *); void ext2_itimes(struct vnode *vp); +int ext2_reallocblks(struct vop_reallocblks_args *); int ext2_reclaim(struct vop_reclaim_args *); void ext2_setblock(struct m_ext2fs *, u_char *, int32_t); int ext2_truncate(struct vnode *, off_t, int, struct ucred *, struct thread *); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 05:24:59 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6F201551; Mon, 1 Jul 2013 05:24:59 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 610B51E21; Mon, 1 Jul 2013 05:24:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r615OxXK079442; Mon, 1 Jul 2013 05:24:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r615Ox0C079441; Mon, 1 Jul 2013 05:24:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010524.r615Ox0C079441@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 05:24: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: r252442 - stable/9/sys/dev/usb/net 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.14 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, 01 Jul 2013 05:24:59 -0000 Author: yongari Date: Mon Jul 1 05:24:58 2013 New Revision: 252442 URL: http://svnweb.freebsd.org/changeset/base/252442 Log: MFC r252143: When RX checksum offloading is active, AX88772B will prepend a checksum header. The header contains a received frame length but the defined length for AX88772B is different with other ASIX controllers. When the RX checksum is off, AX88772B controller does not prepend a checksum header so driver has to use normal header length mask. This change should fix RX errors when RX checksum offloading is off. Modified: stable/9/sys/dev/usb/net/if_axe.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/9/sys/dev/usb/net/if_axe.c Mon Jul 1 05:17:55 2013 (r252441) +++ stable/9/sys/dev/usb/net/if_axe.c Mon Jul 1 05:24:58 2013 (r252442) @@ -1354,15 +1354,14 @@ axe_init(struct usb_ether *ue) if (AXE_IS_178_FAMILY(sc)) { sc->sc_flags &= ~(AXE_FLAG_STD_FRAME | AXE_FLAG_CSUM_FRAME); - if ((sc->sc_flags & AXE_FLAG_772B) != 0) - sc->sc_lenmask = AXE_CSUM_HDR_LEN_MASK; - else - sc->sc_lenmask = AXE_HDR_LEN_MASK; if ((sc->sc_flags & AXE_FLAG_772B) != 0 && - (ifp->if_capenable & IFCAP_RXCSUM) != 0) + (ifp->if_capenable & IFCAP_RXCSUM) != 0) { + sc->sc_lenmask = AXE_CSUM_HDR_LEN_MASK; sc->sc_flags |= AXE_FLAG_CSUM_FRAME; - else + } else { + sc->sc_lenmask = AXE_HDR_LEN_MASK; sc->sc_flags |= AXE_FLAG_STD_FRAME; + } } /* Configure TX/RX checksum offloading. */ From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 05:26:30 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0B653827; Mon, 1 Jul 2013 05:26:30 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F22851E47; Mon, 1 Jul 2013 05:26:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r615QT9l079730; Mon, 1 Jul 2013 05:26:29 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r615QTdw079729; Mon, 1 Jul 2013 05:26:29 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010526.r615QTdw079729@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 05:26:29 +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: r252443 - stable/8/sys/dev/usb/net 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.14 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, 01 Jul 2013 05:26:30 -0000 Author: yongari Date: Mon Jul 1 05:26:29 2013 New Revision: 252443 URL: http://svnweb.freebsd.org/changeset/base/252443 Log: MFC r252143: When RX checksum offloading is active, AX88772B will prepend a checksum header. The header contains a received frame length but the defined length for AX88772B is different with other ASIX controllers. When the RX checksum is off, AX88772B controller does not prepend a checksum header so driver has to use normal header length mask. This change should fix RX errors when RX checksum offloading is off. Modified: stable/8/sys/dev/usb/net/if_axe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Mon Jul 1 05:24:58 2013 (r252442) +++ stable/8/sys/dev/usb/net/if_axe.c Mon Jul 1 05:26:29 2013 (r252443) @@ -1355,15 +1355,14 @@ axe_init(struct usb_ether *ue) if (AXE_IS_178_FAMILY(sc)) { sc->sc_flags &= ~(AXE_FLAG_STD_FRAME | AXE_FLAG_CSUM_FRAME); - if ((sc->sc_flags & AXE_FLAG_772B) != 0) - sc->sc_lenmask = AXE_CSUM_HDR_LEN_MASK; - else - sc->sc_lenmask = AXE_HDR_LEN_MASK; if ((sc->sc_flags & AXE_FLAG_772B) != 0 && - (ifp->if_capenable & IFCAP_RXCSUM) != 0) + (ifp->if_capenable & IFCAP_RXCSUM) != 0) { + sc->sc_lenmask = AXE_CSUM_HDR_LEN_MASK; sc->sc_flags |= AXE_FLAG_CSUM_FRAME; - else + } else { + sc->sc_lenmask = AXE_HDR_LEN_MASK; sc->sc_flags |= AXE_FLAG_STD_FRAME; + } } /* Configure TX/RX checksum offloading. */ From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 05:29:42 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BCBB89A6; Mon, 1 Jul 2013 05:29:42 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AE8811E5E; Mon, 1 Jul 2013 05:29:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r615TgZj080139; Mon, 1 Jul 2013 05:29:42 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r615Tgd6080137; Mon, 1 Jul 2013 05:29:42 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010529.r615Tgd6080137@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 05:29: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: r252444 - in stable/9/sys/dev/usb: . net 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.14 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, 01 Jul 2013 05:29:42 -0000 Author: yongari Date: Mon Jul 1 05:29:42 2013 New Revision: 252444 URL: http://svnweb.freebsd.org/changeset/base/252444 Log: MFC r252185: Add Lenovo USB 2.0 Ethernet adapter. PR: usb/179920 Modified: stable/9/sys/dev/usb/net/if_axe.c stable/9/sys/dev/usb/usbdevs Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/9/sys/dev/usb/net/if_axe.c Mon Jul 1 05:26:29 2013 (r252443) +++ stable/9/sys/dev/usb/net/if_axe.c Mon Jul 1 05:29:42 2013 (r252444) @@ -162,6 +162,7 @@ static const STRUCT_USB_HOST_ID axe_devs AXE_DEV(GOODWAY, GWUSB2E, 0), AXE_DEV(IODATA, ETGUS2, AXE_FLAG_178), AXE_DEV(JVC, MP_PRX1, 0), + AXE_DEV(LENOVO, ETHERNET, AXE_FLAG_772B), AXE_DEV(LINKSYS2, USB200M, 0), AXE_DEV(LINKSYS4, USB1000, AXE_FLAG_178), AXE_DEV(LOGITEC, LAN_GTJU2A, AXE_FLAG_178), Modified: stable/9/sys/dev/usb/usbdevs ============================================================================== --- stable/9/sys/dev/usb/usbdevs Mon Jul 1 05:26:29 2013 (r252443) +++ stable/9/sys/dev/usb/usbdevs Mon Jul 1 05:29:42 2013 (r252444) @@ -678,6 +678,7 @@ vendor ASUS2 0x1761 ASUS vendor SWEEX2 0x177f Sweex vendor METAGEEK 0x1781 MetaGeek vendor KAMSTRUP 0x17a8 Kamstrup A/S +vendor LENOVO 0x17ef Lenovo vendor WAVESENSE 0x17f4 WaveSense vendor VAISALA 0x1843 Vaisala vendor AMIT 0x18c5 AMIT @@ -2420,6 +2421,9 @@ product LARSENBRUSGAARD ALTITRACK 0x0001 /* Leadtek products */ product LEADTEK 9531 0x2101 9531 GPS +/* Lenovo products */ +product LENOVO ETHERNET 0x7203 USB 2.0 Ethernet + /* Lexar products */ product LEXAR JUMPSHOT 0x0001 jumpSHOT CompactFlash Reader product LEXAR CF_READER 0xb002 USB CF Reader From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 05:30:38 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C853BBCD; Mon, 1 Jul 2013 05:30:38 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9FFB1F15; Mon, 1 Jul 2013 05:30:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r615UcUY082045; Mon, 1 Jul 2013 05:30:38 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r615UcgK082043; Mon, 1 Jul 2013 05:30:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010530.r615UcgK082043@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 05:30: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: r252445 - in stable/8/sys/dev/usb: . net 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.14 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, 01 Jul 2013 05:30:38 -0000 Author: yongari Date: Mon Jul 1 05:30:38 2013 New Revision: 252445 URL: http://svnweb.freebsd.org/changeset/base/252445 Log: MFC r252185: Add Lenovo USB 2.0 Ethernet adapter. PR: usb/179920 Modified: stable/8/sys/dev/usb/net/if_axe.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/net/if_axe.c ============================================================================== --- stable/8/sys/dev/usb/net/if_axe.c Mon Jul 1 05:29:42 2013 (r252444) +++ stable/8/sys/dev/usb/net/if_axe.c Mon Jul 1 05:30:38 2013 (r252445) @@ -163,6 +163,7 @@ static const STRUCT_USB_HOST_ID axe_devs AXE_DEV(GOODWAY, GWUSB2E, 0), AXE_DEV(IODATA, ETGUS2, AXE_FLAG_178), AXE_DEV(JVC, MP_PRX1, 0), + AXE_DEV(LENOVO, ETHERNET, AXE_FLAG_772B), AXE_DEV(LINKSYS2, USB200M, 0), AXE_DEV(LINKSYS4, USB1000, AXE_FLAG_178), AXE_DEV(LOGITEC, LAN_GTJU2A, AXE_FLAG_178), Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Mon Jul 1 05:29:42 2013 (r252444) +++ stable/8/sys/dev/usb/usbdevs Mon Jul 1 05:30:38 2013 (r252445) @@ -677,6 +677,7 @@ vendor ASUS2 0x1761 ASUS vendor SWEEX2 0x177f Sweex vendor METAGEEK 0x1781 MetaGeek vendor KAMSTRUP 0x17a8 Kamstrup A/S +vendor LENOVO 0x17ef Lenovo vendor WAVESENSE 0x17f4 WaveSense vendor VAISALA 0x1843 Vaisala vendor AMIT 0x18c5 AMIT @@ -2421,6 +2422,9 @@ product LARSENBRUSGAARD ALTITRACK 0x0001 /* Leadtek products */ product LEADTEK 9531 0x2101 9531 GPS +/* Lenovo products */ +product LENOVO ETHERNET 0x7203 USB 2.0 Ethernet + /* Lexar products */ product LEXAR JUMPSHOT 0x0001 jumpSHOT CompactFlash Reader product LEXAR CF_READER 0xb002 USB CF Reader From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 05:33:02 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4CD22D57; Mon, 1 Jul 2013 05:33:02 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3EDA21F2D; Mon, 1 Jul 2013 05:33:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r615X2v3082439; Mon, 1 Jul 2013 05:33:02 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r615X2Vg082438; Mon, 1 Jul 2013 05:33:02 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010533.r615X2Vg082438@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 05:33: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: r252446 - 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.14 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, 01 Jul 2013 05:33:02 -0000 Author: yongari Date: Mon Jul 1 05:33:01 2013 New Revision: 252446 URL: http://svnweb.freebsd.org/changeset/base/252446 Log: MFC r252186: Add Lenovo USB 2.0 Ethernet adapter to the list of supported devices. Modified: stable/9/share/man/man4/axe.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/axe.4 ============================================================================== --- stable/9/share/man/man4/axe.4 Mon Jul 1 05:30:38 2013 (r252445) +++ stable/9/share/man/man4/axe.4 Mon Jul 1 05:33:01 2013 (r252446) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2011 +.Dd June 25, 2013 .Dt AXE 4 .Os .Sh NAME @@ -215,6 +215,8 @@ AX88772B: .Bl -bullet -compact .It ASIX AX88772B +.It +Lenovo USB 2.0 Ethernet .El .Pp AX88760: From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 05:33:55 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C1517ED4; Mon, 1 Jul 2013 05:33:55 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B39131F37; Mon, 1 Jul 2013 05:33:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r615XtSv082597; Mon, 1 Jul 2013 05:33:55 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r615Xtxn082596; Mon, 1 Jul 2013 05:33:55 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010533.r615Xtxn082596@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 05:33:55 +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: r252448 - 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.14 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, 01 Jul 2013 05:33:55 -0000 Author: yongari Date: Mon Jul 1 05:33:55 2013 New Revision: 252448 URL: http://svnweb.freebsd.org/changeset/base/252448 Log: MFC r252186: Add Lenovo USB 2.0 Ethernet adapter to the list of supported devices. Modified: stable/8/share/man/man4/axe.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/axe.4 ============================================================================== --- stable/8/share/man/man4/axe.4 Mon Jul 1 05:33:53 2013 (r252447) +++ stable/8/share/man/man4/axe.4 Mon Jul 1 05:33:55 2013 (r252448) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2011 +.Dd June 25, 2013 .Dt AXE 4 .Os .Sh NAME @@ -215,6 +215,8 @@ AX88772B: .Bl -bullet -compact .It ASIX AX88772B +.It +Lenovo USB 2.0 Ethernet .El .Pp AX88760: From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 06:58:06 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 15693B6; Mon, 1 Jul 2013 06:58:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0779A119B; Mon, 1 Jul 2013 06:58:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r616w5Fc006726; Mon, 1 Jul 2013 06:58:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r616w5PA006725; Mon, 1 Jul 2013 06:58:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010658.r616w5PA006725@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 06: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: r252452 - stable/9/sys/dev/bge 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.14 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, 01 Jul 2013 06:58:06 -0000 Author: yongari Date: Mon Jul 1 06:58:05 2013 New Revision: 252452 URL: http://svnweb.freebsd.org/changeset/base/252452 Log: MFC r251481: Do not report current link status if driver is not running. Reporting link status in driver has a side-effect that makes mii(4) check current link status. mii(4) will call link status change callback when it sees link state change. Normally this wouldn't have problems. However, ASF/IPMI firmware can actively access PHY regardless of driver's running state such that reporting link status for not-running interface can generate meaningless link UP/DOWN messages. This change also makes dhclient think driver got a valid link regardless of link establishment so it will bypass dhclient's initial link status check. I think that wouldn't be issue though. Modified: stable/9/sys/dev/bge/if_bge.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Jul 1 06:44:27 2013 (r252451) +++ stable/9/sys/dev/bge/if_bge.c Mon Jul 1 06:58:05 2013 (r252452) @@ -5608,6 +5608,10 @@ bge_ifmedia_sts(struct ifnet *ifp, struc BGE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + BGE_UNLOCK(sc); + return; + } if (sc->bge_flags & BGE_FLAG_TBI) { ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 06:58:36 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1BE97236; Mon, 1 Jul 2013 06:58:36 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0E12511A3; Mon, 1 Jul 2013 06:58:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r616wZvG006824; Mon, 1 Jul 2013 06:58:35 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r616wZr8006823; Mon, 1 Jul 2013 06:58:35 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010658.r616wZr8006823@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 06:58:35 +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: r252453 - stable/8/sys/dev/bge 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.14 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, 01 Jul 2013 06:58:36 -0000 Author: yongari Date: Mon Jul 1 06:58:35 2013 New Revision: 252453 URL: http://svnweb.freebsd.org/changeset/base/252453 Log: MFC r251481: Do not report current link status if driver is not running. Reporting link status in driver has a side-effect that makes mii(4) check current link status. mii(4) will call link status change callback when it sees link state change. Normally this wouldn't have problems. However, ASF/IPMI firmware can actively access PHY regardless of driver's running state such that reporting link status for not-running interface can generate meaningless link UP/DOWN messages. This change also makes dhclient think driver got a valid link regardless of link establishment so it will bypass dhclient's initial link status check. I think that wouldn't be issue though. Modified: stable/8/sys/dev/bge/if_bge.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/bge/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Jul 1 06:58:05 2013 (r252452) +++ stable/8/sys/dev/bge/if_bge.c Mon Jul 1 06:58:35 2013 (r252453) @@ -5621,6 +5621,10 @@ bge_ifmedia_sts(struct ifnet *ifp, struc BGE_LOCK(sc); + if ((ifp->if_flags & IFF_UP) == 0) { + BGE_UNLOCK(sc); + return; + } if (sc->bge_flags & BGE_FLAG_TBI) { ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 07:02:45 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 85EEA5BB; Mon, 1 Jul 2013 07:02:45 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E4BB11DA; Mon, 1 Jul 2013 07:02:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6172jJN009317; Mon, 1 Jul 2013 07:02:45 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6172jFu009315; Mon, 1 Jul 2013 07:02:45 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010702.r6172jFu009315@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 07:02:45 +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: r252455 - stable/9/sys/dev/bge 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.14 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, 01 Jul 2013 07:02:45 -0000 Author: yongari Date: Mon Jul 1 07:02:44 2013 New Revision: 252455 URL: http://svnweb.freebsd.org/changeset/base/252455 Log: MFC r251482,251733: r251482: Correct setting TX random backoff register. This register is implemented as a 10 bits linear feedback shift register so only lower 10 bits are valid. Because this register is used to initialize random backoff interval register only when resolved duplex is half-duplex, it wouldn't have caused issues in these days. r251733: Fix a typo introduced in r213280. IFM_OPTIONS macro should see current media word. Modified: stable/9/sys/dev/bge/if_bge.c stable/9/sys/dev/bge/if_bgereg.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Mon Jul 1 07:00:12 2013 (r252454) +++ stable/9/sys/dev/bge/if_bge.c Mon Jul 1 07:02:44 2013 (r252455) @@ -1284,7 +1284,7 @@ bge_miibus_statchg(device_t dev) /* Set MAC flow control behavior to match link flow control settings. */ tx_mode &= ~BGE_TXMODE_FLOWCTL_ENABLE; rx_mode &= ~BGE_RXMODE_FLOWCTL_ENABLE; - if (IFM_OPTIONS(mii->mii_media_active & IFM_FDX) != 0) { + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) tx_mode |= BGE_TXMODE_FLOWCTL_ENABLE; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) @@ -2280,9 +2280,9 @@ bge_blockinit(struct bge_softc *sc) /* Set random backoff seed for TX */ CSR_WRITE_4(sc, BGE_TX_RANDOM_BACKOFF, - IF_LLADDR(sc->bge_ifp)[0] + IF_LLADDR(sc->bge_ifp)[1] + + (IF_LLADDR(sc->bge_ifp)[0] + IF_LLADDR(sc->bge_ifp)[1] + IF_LLADDR(sc->bge_ifp)[2] + IF_LLADDR(sc->bge_ifp)[3] + - IF_LLADDR(sc->bge_ifp)[4] + IF_LLADDR(sc->bge_ifp)[5] + + IF_LLADDR(sc->bge_ifp)[4] + IF_LLADDR(sc->bge_ifp)[5]) & BGE_TX_BACKOFF_SEED_MASK); /* Set inter-packet gap */ Modified: stable/9/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/9/sys/dev/bge/if_bgereg.h Mon Jul 1 07:00:12 2013 (r252454) +++ stable/9/sys/dev/bge/if_bgereg.h Mon Jul 1 07:02:44 2013 (r252455) @@ -797,7 +797,7 @@ #define BGE_LEDCTL_BLINKPERIOD_OVERRIDE 0x80000000 /* TX backoff seed register */ -#define BGE_TX_BACKOFF_SEED_MASK 0x3F +#define BGE_TX_BACKOFF_SEED_MASK 0x3FF /* Autopoll status register */ #define BGE_AUTOPOLLSTS_ERROR 0x00000001 From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 07:03:39 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6777974B; Mon, 1 Jul 2013 07:03:39 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 41B4F11E2; Mon, 1 Jul 2013 07:03:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6173dCS009495; Mon, 1 Jul 2013 07:03:39 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6173cSK009493; Mon, 1 Jul 2013 07:03:38 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201307010703.r6173cSK009493@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 1 Jul 2013 07:03: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: r252456 - stable/8/sys/dev/bge 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.14 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, 01 Jul 2013 07:03:39 -0000 Author: yongari Date: Mon Jul 1 07:03:38 2013 New Revision: 252456 URL: http://svnweb.freebsd.org/changeset/base/252456 Log: MFC r251482,251733: r251482: Correct setting TX random backoff register. This register is implemented as a 10 bits linear feedback shift register so only lower 10 bits are valid. Because this register is used to initialize random backoff interval register only when resolved duplex is half-duplex, it wouldn't have caused issues in these days. r251733: Fix a typo introduced in r213280. IFM_OPTIONS macro should see current media word. Modified: stable/8/sys/dev/bge/if_bge.c stable/8/sys/dev/bge/if_bgereg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/bge/ (props changed) Modified: stable/8/sys/dev/bge/if_bge.c ============================================================================== --- stable/8/sys/dev/bge/if_bge.c Mon Jul 1 07:02:44 2013 (r252455) +++ stable/8/sys/dev/bge/if_bge.c Mon Jul 1 07:03:38 2013 (r252456) @@ -1283,7 +1283,7 @@ bge_miibus_statchg(device_t dev) /* Set MAC flow control behavior to match link flow control settings. */ tx_mode &= ~BGE_TXMODE_FLOWCTL_ENABLE; rx_mode &= ~BGE_RXMODE_FLOWCTL_ENABLE; - if (IFM_OPTIONS(mii->mii_media_active & IFM_FDX) != 0) { + if ((IFM_OPTIONS(mii->mii_media_active) & IFM_FDX) != 0) { if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_TXPAUSE) != 0) tx_mode |= BGE_TXMODE_FLOWCTL_ENABLE; if ((IFM_OPTIONS(mii->mii_media_active) & IFM_ETH_RXPAUSE) != 0) @@ -2279,9 +2279,9 @@ bge_blockinit(struct bge_softc *sc) /* Set random backoff seed for TX */ CSR_WRITE_4(sc, BGE_TX_RANDOM_BACKOFF, - IF_LLADDR(sc->bge_ifp)[0] + IF_LLADDR(sc->bge_ifp)[1] + + (IF_LLADDR(sc->bge_ifp)[0] + IF_LLADDR(sc->bge_ifp)[1] + IF_LLADDR(sc->bge_ifp)[2] + IF_LLADDR(sc->bge_ifp)[3] + - IF_LLADDR(sc->bge_ifp)[4] + IF_LLADDR(sc->bge_ifp)[5] + + IF_LLADDR(sc->bge_ifp)[4] + IF_LLADDR(sc->bge_ifp)[5]) & BGE_TX_BACKOFF_SEED_MASK); /* Set inter-packet gap */ Modified: stable/8/sys/dev/bge/if_bgereg.h ============================================================================== --- stable/8/sys/dev/bge/if_bgereg.h Mon Jul 1 07:02:44 2013 (r252455) +++ stable/8/sys/dev/bge/if_bgereg.h Mon Jul 1 07:03:38 2013 (r252456) @@ -797,7 +797,7 @@ #define BGE_LEDCTL_BLINKPERIOD_OVERRIDE 0x80000000 /* TX backoff seed register */ -#define BGE_TX_BACKOFF_SEED_MASK 0x3F +#define BGE_TX_BACKOFF_SEED_MASK 0x3FF /* Autopoll status register */ #define BGE_AUTOPOLLSTS_ERROR 0x00000001 From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 08:21:06 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B2F10D1B; Mon, 1 Jul 2013 08:21:06 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A54A71670; Mon, 1 Jul 2013 08:21:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r618L66N032584; Mon, 1 Jul 2013 08:21:06 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r618L6lL032583; Mon, 1 Jul 2013 08:21:06 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307010821.r618L6lL032583@svn.freebsd.org> From: Steven Hartland Date: Mon, 1 Jul 2013 08:21: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: r252459 - 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.14 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, 01 Jul 2013 08:21:06 -0000 Author: smh Date: Mon Jul 1 08:21:06 2013 New Revision: 252459 URL: http://svnweb.freebsd.org/changeset/base/252459 Log: MFC r252390: Remove invalid ASSERT Modified: 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_dir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Mon Jul 1 08:06:26 2013 (r252458) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Mon Jul 1 08:21:06 2013 (r252459) @@ -1258,8 +1258,6 @@ dsl_dir_rename_sync(void *arg, dmu_tx_t int error; objset_t *mos = dp->dp_meta_objset; - ASSERT(dmu_buf_refcount(dd->dd_dbuf) <= 2); - VERIFY0(dsl_dir_hold(dp, ddra->ddra_oldname, FTAG, &dd, NULL)); VERIFY0(dsl_dir_hold(dp, ddra->ddra_newname, FTAG, &newparent, &mynewname)); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 08:24:15 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1AD6AEDB; Mon, 1 Jul 2013 08:24:15 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0CBC9169D; Mon, 1 Jul 2013 08:24:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r618OEda033030; Mon, 1 Jul 2013 08:24:14 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r618OEru033029; Mon, 1 Jul 2013 08:24:14 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307010824.r618OEru033029@svn.freebsd.org> From: Steven Hartland Date: Mon, 1 Jul 2013 08:24:14 +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: r252460 - 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.14 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, 01 Jul 2013 08:24:15 -0000 Author: smh Date: Mon Jul 1 08:24:14 2013 New Revision: 252460 URL: http://svnweb.freebsd.org/changeset/base/252460 Log: MFC r252392: style(9) fixes Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Mon Jul 1 08:21:06 2013 (r252459) +++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Mon Jul 1 08:24:14 2013 (r252460) @@ -75,7 +75,8 @@ cmn_err(int type, const char *fmt, ...) } int -assfail(const char *a, const char *f, int l) { +assfail(const char *a, const char *f, int l) +{ panic("solaris assert: %s, file: %s, line: %d", a, f, l); @@ -84,7 +85,8 @@ assfail(const char *a, const char *f, in void assfail3(const char *a, uintmax_t lv, const char *op, uintmax_t rv, - const char *f, int l) { + const char *f, int l) +{ panic("solaris assert: %s (0x%jx %s 0x%jx), file: %s, line: %d", a, lv, op, rv, f, l); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 08:25:51 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 237D42D3; Mon, 1 Jul 2013 08:25:51 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 147E916C3; Mon, 1 Jul 2013 08:25:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r618PoFT033280; Mon, 1 Jul 2013 08:25:50 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r618Pos5033279; Mon, 1 Jul 2013 08:25:50 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307010825.r618Pos5033279@svn.freebsd.org> From: Steven Hartland Date: Mon, 1 Jul 2013 08:25: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: r252461 - 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.14 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, 01 Jul 2013 08:25:51 -0000 Author: smh Date: Mon Jul 1 08:25:50 2013 New Revision: 252461 URL: http://svnweb.freebsd.org/changeset/base/252461 Log: MFC r252390: Remove invalid ASSERT Modified: 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_dir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Mon Jul 1 08:24:14 2013 (r252460) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c Mon Jul 1 08:25:50 2013 (r252461) @@ -1258,8 +1258,6 @@ dsl_dir_rename_sync(void *arg, dmu_tx_t int error; objset_t *mos = dp->dp_meta_objset; - ASSERT(dmu_buf_refcount(dd->dd_dbuf) <= 2); - VERIFY0(dsl_dir_hold(dp, ddra->ddra_oldname, FTAG, &dd, NULL)); VERIFY0(dsl_dir_hold(dp, ddra->ddra_newname, FTAG, &newparent, &mynewname)); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 08:27:15 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E59D649D; Mon, 1 Jul 2013 08:27:15 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D7E9716F1; Mon, 1 Jul 2013 08:27:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r618RFfK033489; Mon, 1 Jul 2013 08:27:15 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r618RFMj033488; Mon, 1 Jul 2013 08:27:15 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307010827.r618RFMj033488@svn.freebsd.org> From: Steven Hartland Date: Mon, 1 Jul 2013 08:27: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: r252462 - 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.14 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, 01 Jul 2013 08:27:16 -0000 Author: smh Date: Mon Jul 1 08:27:15 2013 New Revision: 252462 URL: http://svnweb.freebsd.org/changeset/base/252462 Log: MFC r252392: style(9) fixes Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Mon Jul 1 08:25:50 2013 (r252461) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c Mon Jul 1 08:27:15 2013 (r252462) @@ -75,7 +75,8 @@ cmn_err(int type, const char *fmt, ...) } int -assfail(const char *a, const char *f, int l) { +assfail(const char *a, const char *f, int l) +{ panic("solaris assert: %s, file: %s, line: %d", a, f, l); @@ -84,7 +85,8 @@ assfail(const char *a, const char *f, in void assfail3(const char *a, uintmax_t lv, const char *op, uintmax_t rv, - const char *f, int l) { + const char *f, int l) +{ panic("solaris assert: %s (0x%jx %s 0x%jx), file: %s, line: %d", a, lv, op, rv, f, l); From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 20:45:56 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5A1DDAF5; Mon, 1 Jul 2013 20:45:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4B7C410ED; Mon, 1 Jul 2013 20:45:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61KjuRS049572; Mon, 1 Jul 2013 20:45:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61KjuSl049571; Mon, 1 Jul 2013 20:45:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307012045.r61KjuSl049571@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jul 2013 20:45: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: r252477 - stable/9/etc/rc.d 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.14 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, 01 Jul 2013 20:45:56 -0000 Author: delphij Date: Mon Jul 1 20:45:55 2013 New Revision: 252477 URL: http://svnweb.freebsd.org/changeset/base/252477 Log: MFC r252062: Call sshd_precmd instead of sshd_configtest when the operator requests reload or restart, which, in addition of testing the configuration, will also generate host keys when they are not present (previous behavior). Obtained from: FreeNAS Ok'ed by: bdrewery, des Modified: stable/9/etc/rc.d/sshd Directory Properties: stable/9/etc/rc.d/ (props changed) Modified: stable/9/etc/rc.d/sshd ============================================================================== --- stable/9/etc/rc.d/sshd Mon Jul 1 20:30:48 2013 (r252476) +++ stable/9/etc/rc.d/sshd Mon Jul 1 20:45:55 2013 (r252477) @@ -14,8 +14,8 @@ rcvar="sshd_enable" command="/usr/sbin/${name}" keygen_cmd="sshd_keygen" start_precmd="sshd_precmd" -reload_precmd="sshd_configtest" -restart_precmd="sshd_configtest" +reload_precmd="sshd_precmd" +restart_precmd="sshd_precmd" configtest_cmd="sshd_configtest" pidfile="/var/run/${name}.pid" extra_commands="configtest keygen reload" From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 20:46:35 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DF3E3C53; Mon, 1 Jul 2013 20:46:35 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D13E510F9; Mon, 1 Jul 2013 20:46:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61KkZZn049737; Mon, 1 Jul 2013 20:46:35 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61KkZ5n049736; Mon, 1 Jul 2013 20:46:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307012046.r61KkZ5n049736@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jul 2013 20:46:35 +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: r252478 - stable/8/etc/rc.d 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.14 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, 01 Jul 2013 20:46:36 -0000 Author: delphij Date: Mon Jul 1 20:46:35 2013 New Revision: 252478 URL: http://svnweb.freebsd.org/changeset/base/252478 Log: MFC r252062: Call sshd_precmd instead of sshd_configtest when the operator requests reload or restart, which, in addition of testing the configuration, will also generate host keys when they are not present (previous behavior). Obtained from: FreeNAS Ok'ed by: bdrewery, des Modified: stable/8/etc/rc.d/sshd Directory Properties: stable/8/etc/rc.d/ (props changed) Modified: stable/8/etc/rc.d/sshd ============================================================================== --- stable/8/etc/rc.d/sshd Mon Jul 1 20:45:55 2013 (r252477) +++ stable/8/etc/rc.d/sshd Mon Jul 1 20:46:35 2013 (r252478) @@ -14,8 +14,8 @@ rcvar="sshd_enable" command="/usr/sbin/${name}" keygen_cmd="sshd_keygen" start_precmd="sshd_precmd" -reload_precmd="sshd_configtest" -restart_precmd="sshd_configtest" +reload_precmd="sshd_precmd" +restart_precmd="sshd_precmd" configtest_cmd="sshd_configtest" pidfile="/var/run/${name}.pid" extra_commands="configtest keygen reload" From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 21:59:18 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DEB0C6D7; Mon, 1 Jul 2013 21:59:18 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B6AB415FC; Mon, 1 Jul 2013 21:59:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61LxIIb070762; Mon, 1 Jul 2013 21:59:18 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61LxHej070754; Mon, 1 Jul 2013 21:59:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307012159.r61LxHej070754@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jul 2013 21:59:17 +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: r252487 - in 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.14 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, 01 Jul 2013 21:59:19 -0000 Author: delphij Date: Mon Jul 1 21:59:17 2013 New Revision: 252487 URL: http://svnweb.freebsd.org/changeset/base/252487 Log: MFC r251825,252486: Remove vfs_mount(9), it have been died since 2004. Deleted: stable/9/share/man/man9/vfs_mount.9 Modified: stable/9/ObsoleteFiles.inc (contents, props changed) stable/9/share/man/man9/Makefile stable/9/share/man/man9/kernel_mount.9 stable/9/share/man/man9/vfsconf.9 Directory Properties: stable/9/share/man/man9/ (props changed) Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Mon Jul 1 21:58:08 2013 (r252486) +++ stable/9/ObsoleteFiles.inc Mon Jul 1 21:59:17 2013 (r252487) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20130701: vfs_mount.9 removed +OLD_FILES+=usr/share/man/man9/vfs_mount.9.gz # 20130624: vinum.4 removed OLD_FILES+=usr/share/man/man4/vinum.4.gz # 20130415: Ports are no more available via cvsup Modified: stable/9/share/man/man9/Makefile ============================================================================== --- stable/9/share/man/man9/Makefile Mon Jul 1 21:58:08 2013 (r252486) +++ stable/9/share/man/man9/Makefile Mon Jul 1 21:59:17 2013 (r252487) @@ -280,7 +280,6 @@ MAN= accept_filter.9 \ vfs_getvfs.9 \ VFS_LOCK_GIANT.9 \ VFS_MOUNT.9 \ - vfs_mount.9 \ vfs_mountedfrom.9 \ VFS_QUOTACTL.9 \ VFS_ROOT.9 \ Modified: stable/9/share/man/man9/kernel_mount.9 ============================================================================== --- stable/9/share/man/man9/kernel_mount.9 Mon Jul 1 21:58:08 2013 (r252486) +++ stable/9/share/man/man9/kernel_mount.9 Mon Jul 1 21:59:17 2013 (r252487) @@ -195,7 +195,6 @@ must come in pairs, e.g., .Sh SEE ALSO .Xr VFS 9 , .Xr VFS_MOUNT 9 , -.Xr vfs_mount 9 .Sh HISTORY The .Fn kernel_mount Modified: stable/9/share/man/man9/vfsconf.9 ============================================================================== --- stable/9/share/man/man9/vfsconf.9 Mon Jul 1 21:58:08 2013 (r252486) +++ stable/9/share/man/man9/vfsconf.9 Mon Jul 1 21:59:17 2013 (r252487) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 21, 2001 +.Dd June 16, 2013 .Dt VFSCONF 9 .Os .Sh NAME @@ -58,7 +58,7 @@ struct vfsconf { .Ed .Pp When a new file system is mounted, -.Xr vfs_mount 9 +.Xr mount 2 does a lookup of the .Vt vfsconf structure by its name, and if it is not already registered, @@ -143,7 +143,7 @@ or .Fn vfs_unregister , whatever the case. .Sh SEE ALSO -.Xr vfs_mount 9 , +.Xr mount 2 , .Xr vfs_rootmountalloc 9 , .Xr VFS_SET 9 .Sh AUTHORS From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 22:02:41 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2916C90E; Mon, 1 Jul 2013 22:02:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 01B201624; Mon, 1 Jul 2013 22:02:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61M2eDl073102; Mon, 1 Jul 2013 22:02:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61M2eux073098; Mon, 1 Jul 2013 22:02:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307012202.r61M2eux073098@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jul 2013 22:02: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: r252488 - in 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.14 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, 01 Jul 2013 22:02:41 -0000 Author: delphij Date: Mon Jul 1 22:02:39 2013 New Revision: 252488 URL: http://svnweb.freebsd.org/changeset/base/252488 Log: MFC r251825,252486: Remove vfs_mount(9), it have been died since 2004. Deleted: stable/8/share/man/man9/vfs_mount.9 Modified: stable/8/ObsoleteFiles.inc (contents, props changed) stable/8/share/man/man9/Makefile stable/8/share/man/man9/kernel_mount.9 stable/8/share/man/man9/vfsconf.9 Directory Properties: stable/8/share/man/man9/ (props changed) Modified: stable/8/ObsoleteFiles.inc ============================================================================== --- stable/8/ObsoleteFiles.inc Mon Jul 1 21:59:17 2013 (r252487) +++ stable/8/ObsoleteFiles.inc Mon Jul 1 22:02:39 2013 (r252488) @@ -14,6 +14,8 @@ # The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last. # +# 20130701: vfs_mount.9 removed +OLD_FILES+=usr/share/man/man9/vfs_mount.9.gz # 20110915: rename congestion control manpages OLD_FILES+=usr/share/man/man4/cc.4.gz OLD_FILES+=usr/share/man/man9/cc.9.gz Modified: stable/8/share/man/man9/Makefile ============================================================================== --- stable/8/share/man/man9/Makefile Mon Jul 1 21:59:17 2013 (r252487) +++ stable/8/share/man/man9/Makefile Mon Jul 1 22:02:39 2013 (r252488) @@ -277,7 +277,6 @@ MAN= accept_filter.9 \ vfs_getvfs.9 \ VFS_LOCK_GIANT.9 \ VFS_MOUNT.9 \ - vfs_mount.9 \ vfs_mountedfrom.9 \ VFS_QUOTACTL.9 \ VFS_ROOT.9 \ Modified: stable/8/share/man/man9/kernel_mount.9 ============================================================================== --- stable/8/share/man/man9/kernel_mount.9 Mon Jul 1 21:59:17 2013 (r252487) +++ stable/8/share/man/man9/kernel_mount.9 Mon Jul 1 22:02:39 2013 (r252488) @@ -195,7 +195,6 @@ must come in pairs, e.g., .Sh SEE ALSO .Xr VFS 9 , .Xr VFS_MOUNT 9 , -.Xr vfs_mount 9 .Sh HISTORY The .Fn kernel_mount Modified: stable/8/share/man/man9/vfsconf.9 ============================================================================== --- stable/8/share/man/man9/vfsconf.9 Mon Jul 1 21:59:17 2013 (r252487) +++ stable/8/share/man/man9/vfsconf.9 Mon Jul 1 22:02:39 2013 (r252488) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 21, 2001 +.Dd June 16, 2013 .Dt VFSCONF 9 .Os .Sh NAME @@ -58,7 +58,7 @@ struct vfsconf { .Ed .Pp When a new file system is mounted, -.Xr vfs_mount 9 +.Xr mount 2 does a lookup of the .Vt vfsconf structure by its name, and if it is not already registered, @@ -143,7 +143,7 @@ or .Fn vfs_unregister , whatever the case. .Sh SEE ALSO -.Xr vfs_mount 9 , +.Xr mount 2 , .Xr vfs_rootmountalloc 9 , .Xr VFS_SET 9 .Sh AUTHORS From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 22:05:43 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 90A2DA7E; Mon, 1 Jul 2013 22:05:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8339F163B; Mon, 1 Jul 2013 22:05:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61M5hIS073602; Mon, 1 Jul 2013 22:05:43 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61M5hKU073601; Mon, 1 Jul 2013 22:05:43 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307012205.r61M5hKU073601@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jul 2013 22:05: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: r252489 - stable/9/sys/net 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.14 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, 01 Jul 2013 22:05:43 -0000 Author: delphij Date: Mon Jul 1 22:05:43 2013 New Revision: 252489 URL: http://svnweb.freebsd.org/changeset/base/252489 Log: MFC r251859: Return ENETDOWN instead of ENOENT when all lagg(4) links are inactive when upper layer tries to transmit packet. This gives better feedback and meaningful errors for applications. Reviewed by: thompsa Modified: stable/9/sys/net/if_lagg.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/net/if_lagg.c ============================================================================== --- stable/9/sys/net/if_lagg.c Mon Jul 1 22:02:39 2013 (r252488) +++ stable/9/sys/net/if_lagg.c Mon Jul 1 22:05:43 2013 (r252489) @@ -1597,7 +1597,7 @@ lagg_rr_start(struct lagg_softc *sc, str */ if ((lp = lagg_link_active(sc, lp)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */ @@ -1645,7 +1645,7 @@ lagg_fail_start(struct lagg_softc *sc, s /* Use the master port if active or the next available port */ if ((lp = lagg_link_active(sc, sc->sc_primary)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */ @@ -1774,7 +1774,7 @@ lagg_lb_start(struct lagg_softc *sc, str */ if ((lp = lagg_link_active(sc, lp)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */ From owner-svn-src-stable@FreeBSD.ORG Mon Jul 1 22:07:01 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 93332BED; Mon, 1 Jul 2013 22:07:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 862E2164E; Mon, 1 Jul 2013 22:07:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r61M71fq073844; Mon, 1 Jul 2013 22:07:01 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r61M71om073843; Mon, 1 Jul 2013 22:07:01 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307012207.r61M71om073843@svn.freebsd.org> From: Xin LI Date: Mon, 1 Jul 2013 22:07: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: r252490 - stable/8/sys/net 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.14 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, 01 Jul 2013 22:07:01 -0000 Author: delphij Date: Mon Jul 1 22:07:01 2013 New Revision: 252490 URL: http://svnweb.freebsd.org/changeset/base/252490 Log: MFC r251859: Return ENETDOWN instead of ENOENT when all lagg(4) links are inactive when upper layer tries to transmit packet. This gives better feedback and meaningful errors for applications. Reviewed by: thompsa Modified: stable/8/sys/net/if_lagg.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/net/ (props changed) Modified: stable/8/sys/net/if_lagg.c ============================================================================== --- stable/8/sys/net/if_lagg.c Mon Jul 1 22:05:43 2013 (r252489) +++ stable/8/sys/net/if_lagg.c Mon Jul 1 22:07:01 2013 (r252490) @@ -1572,7 +1572,7 @@ lagg_rr_start(struct lagg_softc *sc, str */ if ((lp = lagg_link_active(sc, lp)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */ @@ -1620,7 +1620,7 @@ lagg_fail_start(struct lagg_softc *sc, s /* Use the master port if active or the next available port */ if ((lp = lagg_link_active(sc, sc->sc_primary)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */ @@ -1749,7 +1749,7 @@ lagg_lb_start(struct lagg_softc *sc, str */ if ((lp = lagg_link_active(sc, lp)) == NULL) { m_freem(m); - return (ENOENT); + return (ENETDOWN); } /* Send mbuf */ From owner-svn-src-stable@FreeBSD.ORG Tue Jul 2 04:27:17 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E130745F; Tue, 2 Jul 2013 04:27:17 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D052A135C; Tue, 2 Jul 2013 04:27:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r624RHs0086507; Tue, 2 Jul 2013 04:27:17 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r624RGHP086501; Tue, 2 Jul 2013 04:27:16 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307020427.r624RGHP086501@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 2 Jul 2013 04:27: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: r252495 - in stable/9: share/man/man4 sys/dev/cxgb sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/firmware sys/dev/cxgbe/tom sys/modules/cxgbe sys/modules/cxgbe/firmware sys/modules/c... 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.14 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, 02 Jul 2013 04:27:18 -0000 Author: np Date: Tue Jul 2 04:27:16 2013 New Revision: 252495 URL: http://svnweb.freebsd.org/changeset/base/252495 Log: MFC all cxgbe(4) changes missing from stable/9: r248925, r249368, r249370, r249376, r249382, r249383, r249385, r249391, r249392, r249393, r249627, r249629, r250090, r250092, r250093, r250117, r250218, r250221, r250614, r251213, r251317, r251358, r251434, r251518, r251638, r252312, r252469, r252470, r250697(kib). r248925: Support for Chelsio's 40G Terminator 5 (aka T5) ASIC. ... r249368: Set and display the IP fragment bit correctly when dealing with the filter mode. r249370: cxgbe(4): Ensure that the MOD_LOAD handler runs before either t4nex or t5nex attach to their devices. r249376: - Explain clearly why a different firmware is being installed (if/when it is being installed). Improve other error messages while here. - Select special FPGA specific configuration profile when appropriate. r249382: There is no need for elaborate queries and error checking when trying to set FW4MSG_ENCAP. r249383: Get rid of a couple of stray \n's. r249385: cxgbe/tom: Slight simplification of code that calculates options2. r249391: Auto-reduce the holdoff timers that are greater than the maximum value allowed by the hardware. r249392: Cosmetic change (s/wrwc/wcwr/;s/WRWC/WCWR/). r249393: Add pciids of the T5 based cards. The ones that I haven't tested with cxgbe(4) are disabled for now. This will change. r249627: cxgbe/tom: Update the CLIP table on the chip when there are changes to the list of IPv6 addresses on the system. The table is used for TOE+IPv6 only. r249629: cxgbe(4): Refuse to install T5 firmwares on a T4 card (and vice versa). r250090: cxgbe(4): Some updates to shared code. r250092: - Provide accurate ifmedia information so that 40G ports/transceivers are displayed properly in ifconfig, etc. - Use the same number of tx and rx queues for a 40G port as for a 10G port. r250093: Attach to the T580 (2 x 40G) card. r250117: Fix DDP breakage introduced in r248925. Bitwise OR has higher precedence than ternary conditional. r250218: cxgbe/tom: Do not use M_PROTO1 to mark rx zero-copy mbufs as special. All the M_PROTOn flags are clobbered when an mbuf is appended to the socket buffer. r250221: cxgbe: Switch to a better way to install firmware. r250614: Deal correctly with 40G ports that don't have any transceiver plugged in. Do not claim that they have unknown tranceivers. r251213: cxgbe(4): Some more debug sysctls. These work on both T4 and T5 based cards. r251317: cxgbe(4): t4fw_cfg must be explicitly loaded if the driver is being loaded via loader.conf. r251358: cxgbe(4): Provide accurate hit count for filters on T5 cards. The location within the TCB and the size have both changed. r251434: cxgbe(4): Never install a firmware if hw.cxgbe.fw_install is 0. r251518: cxgbe/tom: Fix bad signed/unsigned mixup in the stid allocator. This fixes a panic when allocating a mixture of IPv6 and IPv4 stids. r251638: cxgbe/tom: Allow caller to select the queue (control or data) used to send the CPL_SET_TCB_FIELD request in t4_set_tcb_field(). r252312: Update T5 register ranges. This is so that regdump skips over registers with read side-effects. r252469: Add a sysctl to get the number of filters available. sysctl dev.t4nex..nfilters sysctl dev.t5nex..nfilters r252470: Count the number of hits for a filter by default. r250697: Add dependencies on the firmware, which allows the loading of the cxgb and cxgbe modules. Added: stable/9/sys/modules/cxgbe/t4_firmware/ - copied from r248925, head/sys/modules/cxgbe/t4_firmware/ stable/9/tools/tools/cxgbetool/reg_defs_t5.c - copied unchanged from r248925, head/tools/tools/cxgbetool/reg_defs_t5.c Deleted: stable/9/sys/modules/cxgbe/firmware/ Modified: stable/9/share/man/man4/cxgbe.4 stable/9/sys/dev/cxgb/cxgb_main.c stable/9/sys/dev/cxgbe/adapter.h stable/9/sys/dev/cxgbe/common/common.h stable/9/sys/dev/cxgbe/common/t4_hw.c stable/9/sys/dev/cxgbe/common/t4_hw.h stable/9/sys/dev/cxgbe/common/t4_msg.h stable/9/sys/dev/cxgbe/common/t4_regs.h stable/9/sys/dev/cxgbe/firmware/t4fw_interface.h stable/9/sys/dev/cxgbe/offload.h stable/9/sys/dev/cxgbe/osdep.h stable/9/sys/dev/cxgbe/t4_ioctl.h stable/9/sys/dev/cxgbe/t4_main.c stable/9/sys/dev/cxgbe/t4_sge.c stable/9/sys/dev/cxgbe/tom/t4_connect.c stable/9/sys/dev/cxgbe/tom/t4_cpl_io.c stable/9/sys/dev/cxgbe/tom/t4_ddp.c stable/9/sys/dev/cxgbe/tom/t4_listen.c stable/9/sys/dev/cxgbe/tom/t4_tom.c stable/9/sys/dev/cxgbe/tom/t4_tom.h stable/9/sys/modules/cxgbe/Makefile stable/9/tools/tools/cxgbetool/cxgbetool.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/modules/ (props changed) stable/9/tools/tools/cxgbetool/ (props changed) Modified: stable/9/share/man/man4/cxgbe.4 ============================================================================== --- stable/9/share/man/man4/cxgbe.4 Mon Jul 1 23:53:22 2013 (r252494) +++ stable/9/share/man/man4/cxgbe.4 Tue Jul 2 04:27:16 2013 (r252495) @@ -46,9 +46,10 @@ kernel configuration file: .Ed .Pp To load the driver as a -module at boot time, place the following line in +module at boot time, place the following lines in .Xr loader.conf 5 : .Bd -literal -offset indent +t4fw_cfg_load="YES" if_cxgbe_load="YES" .Ed .Sh DESCRIPTION Modified: stable/9/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/9/sys/dev/cxgb/cxgb_main.c Mon Jul 1 23:53:22 2013 (r252494) +++ stable/9/sys/dev/cxgb/cxgb_main.c Tue Jul 2 04:27:16 2013 (r252495) @@ -149,6 +149,7 @@ static devclass_t cxgb_controller_devcla DRIVER_MODULE(cxgbc, pci, cxgb_controller_driver, cxgb_controller_devclass, cxgbc_mod_event, 0); MODULE_VERSION(cxgbc, 1); +MODULE_DEPEND(cxgbc, firmware, 1, 1, 1); /* * Attachment glue for the ports. Attachment is done directly to the Modified: stable/9/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/9/sys/dev/cxgbe/adapter.h Mon Jul 1 23:53:22 2013 (r252494) +++ stable/9/sys/dev/cxgbe/adapter.h Tue Jul 2 04:27:16 2013 (r252495) @@ -50,9 +50,6 @@ #include "offload.h" #include "firmware/t4fw_interface.h" -#define T4_CFGNAME "t4fw_cfg" -#define T4_FWNAME "t4fw" - MALLOC_DECLARE(M_CXGBE); #define CXGBE_UNIMPLEMENTED(s) \ panic("%s (%s, line %d) not implemented yet.", s, __FILE__, __LINE__) @@ -144,12 +141,6 @@ enum { TX_WR_FLITS = SGE_MAX_WR_LEN / 8 }; -#ifdef T4_PKT_TIMESTAMP -#define RX_COPY_THRESHOLD (MINCLSIZE - 8) -#else -#define RX_COPY_THRESHOLD MINCLSIZE -#endif - enum { /* adapter intr_type */ INTR_INTX = (1 << 0), @@ -327,6 +318,9 @@ enum { EQ_STALLED = (1 << 6), /* out of hw descriptors or dmamaps */ }; +/* Listed in order of preference. Update t4_sysctls too if you change these */ +enum {DOORBELL_UDB, DOORBELL_WCWR, DOORBELL_UDBWC, DOORBELL_KDB}; + /* * Egress Queue: driver is producer, T4 is consumer. * @@ -344,6 +338,9 @@ struct sge_eq { struct tx_desc *desc; /* KVA of descriptor ring */ bus_addr_t ba; /* bus address of descriptor ring */ struct sge_qstat *spg; /* status page, for convenience */ + int doorbells; + volatile uint32_t *udb; /* KVA of doorbell (lies within BAR2) */ + u_int udb_qid; /* relative qid within the doorbell page */ uint16_t cap; /* max # of desc, for convenience */ uint16_t avail; /* available descriptors, for convenience */ uint16_t qsize; /* size (# of entries) of the queue */ @@ -496,6 +493,7 @@ struct sge { int timer_val[SGE_NTIMERS]; int counter_val[SGE_NCOUNTERS]; int fl_starve_threshold; + int s_qpp; int nrxq; /* total # of Ethernet rx queues */ int ntxq; /* total # of Ethernet tx tx queues */ @@ -541,6 +539,9 @@ struct adapter { bus_space_handle_t bh; bus_space_tag_t bt; bus_size_t mmio_len; + int udbs_rid; + struct resource *udbs_res; + volatile uint8_t *udbs_base; unsigned int pf; unsigned int mbox; @@ -570,6 +571,7 @@ struct adapter { struct l2t_data *l2t; /* L2 table */ struct tid_info tids; + int doorbells; int open_device_map; #ifdef TCP_OFFLOAD int offload_map; @@ -748,13 +750,22 @@ t4_os_set_hw_addr(struct adapter *sc, in bcopy(hw_addr, sc->port[idx]->hw_addr, ETHER_ADDR_LEN); } -static inline bool is_10G_port(const struct port_info *pi) +static inline bool +is_10G_port(const struct port_info *pi) { return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) != 0); } -static inline int tx_resume_threshold(struct sge_eq *eq) +static inline bool +is_40G_port(const struct port_info *pi) +{ + + return ((pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) != 0); +} + +static inline int +tx_resume_threshold(struct sge_eq *eq) { return (eq->qsize / 4); @@ -778,7 +789,9 @@ void end_synchronized_op(struct adapter /* t4_sge.c */ void t4_sge_modload(void); -int t4_sge_init(struct adapter *); +void t4_init_sge_cpl_handlers(struct adapter *); +void t4_tweak_chip_settings(struct adapter *); +int t4_read_chip_settings(struct adapter *); int t4_create_dma_tag(struct adapter *); int t4_destroy_dma_tag(struct adapter *); int t4_setup_adapter_queues(struct adapter *); Modified: stable/9/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/9/sys/dev/cxgbe/common/common.h Mon Jul 1 23:53:22 2013 (r252494) +++ stable/9/sys/dev/cxgbe/common/common.h Tue Jul 2 04:27:16 2013 (r252495) @@ -42,15 +42,19 @@ enum { MACADDR_LEN = 12, /* MAC Address length */ }; -enum { MEM_EDC0, MEM_EDC1, MEM_MC }; +enum { MEM_EDC0, MEM_EDC1, MEM_MC, MEM_MC0 = MEM_MC, MEM_MC1 }; enum { MEMWIN0_APERTURE = 2048, MEMWIN0_BASE = 0x1b800, MEMWIN1_APERTURE = 32768, MEMWIN1_BASE = 0x28000, - MEMWIN2_APERTURE = 65536, - MEMWIN2_BASE = 0x30000, + + MEMWIN2_APERTURE_T4 = 65536, + MEMWIN2_BASE_T4 = 0x30000, + + MEMWIN2_APERTURE_T5 = 128 * 1024, + MEMWIN2_BASE_T5 = 0x60000, }; enum dev_master { MASTER_CANT, MASTER_MAY, MASTER_MUST }; @@ -63,15 +67,20 @@ enum { PAUSE_AUTONEG = 1 << 2 }; -#define FW_VERSION_MAJOR 1 -#define FW_VERSION_MINOR 8 -#define FW_VERSION_MICRO 4 -#define FW_VERSION_BUILD 0 - -#define FW_VERSION (V_FW_HDR_FW_VER_MAJOR(FW_VERSION_MAJOR) | \ - V_FW_HDR_FW_VER_MINOR(FW_VERSION_MINOR) | \ - V_FW_HDR_FW_VER_MICRO(FW_VERSION_MICRO) | \ - V_FW_HDR_FW_VER_BUILD(FW_VERSION_BUILD)) +#define FW_VERSION_MAJOR_T4 1 +#define FW_VERSION_MINOR_T4 8 +#define FW_VERSION_MICRO_T4 4 +#define FW_VERSION_BUILD_T4 0 + +#define FW_VERSION_MAJOR_T5 0 +#define FW_VERSION_MINOR_T5 5 +#define FW_VERSION_MICRO_T5 18 +#define FW_VERSION_BUILD_T5 0 + +struct memwin { + uint32_t base; + uint32_t aperture; +}; struct port_stats { u64 tx_octets; /* total # of octets in good frames */ @@ -267,18 +276,20 @@ struct adapter_params { unsigned int cim_la_size; - /* Used as int in sysctls, do not reduce size */ - unsigned int nports; /* # of ethernet ports */ - unsigned int portvec; - unsigned int rev; /* chip revision */ - unsigned int offload; + uint8_t nports; /* # of ethernet ports */ + uint8_t portvec; + unsigned int chipid:4; /* chip ID. T4 = 4, T5 = 5, ... */ + unsigned int rev:4; /* chip revision */ + unsigned int fpga:1; /* this is an FPGA */ + unsigned int offload:1; /* hw is TOE capable, fw has divvied up card + resources for TOE operation. */ + unsigned int bypass:1; /* this is a bypass card */ unsigned int ofldq_wr_cred; }; -enum { /* chip revisions */ - T4_REV_A = 0, -}; +#define CHELSIO_T4 0x4 +#define CHELSIO_T5 0x5 struct trace_params { u32 data[TRACE_LEN / 4]; @@ -316,6 +327,31 @@ static inline int is_offload(const struc return adap->params.offload; } +static inline int chip_id(struct adapter *adap) +{ + return adap->params.chipid; +} + +static inline int chip_rev(struct adapter *adap) +{ + return adap->params.rev; +} + +static inline int is_t4(struct adapter *adap) +{ + return adap->params.chipid == CHELSIO_T4; +} + +static inline int is_t5(struct adapter *adap) +{ + return adap->params.chipid == CHELSIO_T5; +} + +static inline int is_fpga(struct adapter *adap) +{ + return adap->params.fpga; +} + static inline unsigned int core_ticks_per_usec(const struct adapter *adap) { return adap->params.vpd.cclk / 1000; @@ -388,7 +424,7 @@ int t4_read_flash(struct adapter *adapte int t4_load_fw(struct adapter *adapter, const u8 *fw_data, unsigned int size); int t4_load_boot(struct adapter *adap, u8 *boot_data, unsigned int boot_addr, unsigned int size); -unsigned int t4_flash_cfg_addr(struct adapter *adapter); +int t4_flash_cfg_addr(struct adapter *adapter); int t4_load_cfg(struct adapter *adapter, const u8 *cfg_data, unsigned int size); int t4_get_fw_version(struct adapter *adapter, u32 *vers); int t4_get_tp_version(struct adapter *adapter, u32 *vers); @@ -437,7 +473,8 @@ int t4_cim_read_la(struct adapter *adap, void t4_cim_read_pif_la(struct adapter *adap, u32 *pif_req, u32 *pif_rsp, unsigned int *pif_req_wrptr, unsigned int *pif_rsp_wrptr); void t4_cim_read_ma_la(struct adapter *adap, u32 *ma_req, u32 *ma_rsp); -int t4_mc_read(struct adapter *adap, u32 addr, __be32 *data, u64 *parity); +int t4_mc_read(struct adapter *adap, int idx, u32 addr, + __be32 *data, u64 *parity); int t4_edc_read(struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *parity); int t4_mem_read(struct adapter *adap, int mtype, u32 addr, u32 size, __be32 *data); Modified: stable/9/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/9/sys/dev/cxgbe/common/t4_hw.c Mon Jul 1 23:53:22 2013 (r252494) +++ stable/9/sys/dev/cxgbe/common/t4_hw.c Tue Jul 2 04:27:16 2013 (r252495) @@ -176,9 +176,7 @@ static void t4_report_fw_error(struct ad u32 pcie_fw; pcie_fw = t4_read_reg(adap, A_PCIE_FW); - if (!(pcie_fw & F_PCIE_FW_ERR)) - CH_ERR(adap, "Firmware error report called with no error\n"); - else + if (pcie_fw & F_PCIE_FW_ERR) CH_ERR(adap, "Firmware reports adapter error: %s\n", reason[G_PCIE_FW_EVAL(pcie_fw)]); } @@ -312,6 +310,7 @@ int t4_wr_mbox_meat(struct adapter *adap /** * t4_mc_read - read from MC through backdoor accesses * @adap: the adapter + * @idx: which MC to access * @addr: address of first byte requested * @data: 64 bytes of data containing the requested address * @ecc: where to store the corresponding 64-bit ECC word @@ -320,22 +319,40 @@ int t4_wr_mbox_meat(struct adapter *adap * that covers the requested address @addr. If @parity is not %NULL it * is assigned the 64-bit ECC word for the read data. */ -int t4_mc_read(struct adapter *adap, u32 addr, __be32 *data, u64 *ecc) +int t4_mc_read(struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *ecc) { int i; + u32 mc_bist_cmd_reg, mc_bist_cmd_addr_reg, mc_bist_cmd_len_reg; + u32 mc_bist_status_rdata_reg, mc_bist_data_pattern_reg; + + if (is_t4(adap)) { + mc_bist_cmd_reg = A_MC_BIST_CMD; + mc_bist_cmd_addr_reg = A_MC_BIST_CMD_ADDR; + mc_bist_cmd_len_reg = A_MC_BIST_CMD_LEN; + mc_bist_status_rdata_reg = A_MC_BIST_STATUS_RDATA; + mc_bist_data_pattern_reg = A_MC_BIST_DATA_PATTERN; + } else { + mc_bist_cmd_reg = MC_REG(A_MC_P_BIST_CMD, idx); + mc_bist_cmd_addr_reg = MC_REG(A_MC_P_BIST_CMD_ADDR, idx); + mc_bist_cmd_len_reg = MC_REG(A_MC_P_BIST_CMD_LEN, idx); + mc_bist_status_rdata_reg = MC_REG(A_MC_P_BIST_STATUS_RDATA, + idx); + mc_bist_data_pattern_reg = MC_REG(A_MC_P_BIST_DATA_PATTERN, + idx); + } - if (t4_read_reg(adap, A_MC_BIST_CMD) & F_START_BIST) + if (t4_read_reg(adap, mc_bist_cmd_reg) & F_START_BIST) return -EBUSY; - t4_write_reg(adap, A_MC_BIST_CMD_ADDR, addr & ~0x3fU); - t4_write_reg(adap, A_MC_BIST_CMD_LEN, 64); - t4_write_reg(adap, A_MC_BIST_DATA_PATTERN, 0xc); - t4_write_reg(adap, A_MC_BIST_CMD, V_BIST_OPCODE(1) | F_START_BIST | - V_BIST_CMD_GAP(1)); - i = t4_wait_op_done(adap, A_MC_BIST_CMD, F_START_BIST, 0, 10, 1); + t4_write_reg(adap, mc_bist_cmd_addr_reg, addr & ~0x3fU); + t4_write_reg(adap, mc_bist_cmd_len_reg, 64); + t4_write_reg(adap, mc_bist_data_pattern_reg, 0xc); + t4_write_reg(adap, mc_bist_cmd_reg, V_BIST_OPCODE(1) | + F_START_BIST | V_BIST_CMD_GAP(1)); + i = t4_wait_op_done(adap, mc_bist_cmd_reg, F_START_BIST, 0, 10, 1); if (i) return i; -#define MC_DATA(i) MC_BIST_STATUS_REG(A_MC_BIST_STATUS_RDATA, i) +#define MC_DATA(i) MC_BIST_STATUS_REG(mc_bist_status_rdata_reg, i) for (i = 15; i >= 0; i--) *data++ = ntohl(t4_read_reg(adap, MC_DATA(i))); @@ -360,20 +377,47 @@ int t4_mc_read(struct adapter *adap, u32 int t4_edc_read(struct adapter *adap, int idx, u32 addr, __be32 *data, u64 *ecc) { int i; + u32 edc_bist_cmd_reg, edc_bist_cmd_addr_reg, edc_bist_cmd_len_reg; + u32 edc_bist_cmd_data_pattern, edc_bist_status_rdata_reg; - idx *= EDC_STRIDE; - if (t4_read_reg(adap, A_EDC_BIST_CMD + idx) & F_START_BIST) + if (is_t4(adap)) { + edc_bist_cmd_reg = EDC_REG(A_EDC_BIST_CMD, idx); + edc_bist_cmd_addr_reg = EDC_REG(A_EDC_BIST_CMD_ADDR, idx); + edc_bist_cmd_len_reg = EDC_REG(A_EDC_BIST_CMD_LEN, idx); + edc_bist_cmd_data_pattern = EDC_REG(A_EDC_BIST_DATA_PATTERN, + idx); + edc_bist_status_rdata_reg = EDC_REG(A_EDC_BIST_STATUS_RDATA, + idx); + } else { +/* + * These macro are missing in t4_regs.h file. + * Added temporarily for testing. + */ +#define EDC_STRIDE_T5 (EDC_T51_BASE_ADDR - EDC_T50_BASE_ADDR) +#define EDC_REG_T5(reg, idx) (reg + EDC_STRIDE_T5 * idx) + edc_bist_cmd_reg = EDC_REG_T5(A_EDC_H_BIST_CMD, idx); + edc_bist_cmd_addr_reg = EDC_REG_T5(A_EDC_H_BIST_CMD_ADDR, idx); + edc_bist_cmd_len_reg = EDC_REG_T5(A_EDC_H_BIST_CMD_LEN, idx); + edc_bist_cmd_data_pattern = EDC_REG_T5(A_EDC_H_BIST_DATA_PATTERN, + idx); + edc_bist_status_rdata_reg = EDC_REG_T5(A_EDC_H_BIST_STATUS_RDATA, + idx); +#undef EDC_REG_T5 +#undef EDC_STRIDE_T5 + } + + if (t4_read_reg(adap, edc_bist_cmd_reg) & F_START_BIST) return -EBUSY; - t4_write_reg(adap, A_EDC_BIST_CMD_ADDR + idx, addr & ~0x3fU); - t4_write_reg(adap, A_EDC_BIST_CMD_LEN + idx, 64); - t4_write_reg(adap, A_EDC_BIST_DATA_PATTERN + idx, 0xc); - t4_write_reg(adap, A_EDC_BIST_CMD + idx, + t4_write_reg(adap, edc_bist_cmd_addr_reg, addr & ~0x3fU); + t4_write_reg(adap, edc_bist_cmd_len_reg, 64); + t4_write_reg(adap, edc_bist_cmd_data_pattern, 0xc); + t4_write_reg(adap, edc_bist_cmd_reg, V_BIST_OPCODE(1) | V_BIST_CMD_GAP(1) | F_START_BIST); - i = t4_wait_op_done(adap, A_EDC_BIST_CMD + idx, F_START_BIST, 0, 10, 1); + i = t4_wait_op_done(adap, edc_bist_cmd_reg, F_START_BIST, 0, 10, 1); if (i) return i; -#define EDC_DATA(i) (EDC_BIST_STATUS_REG(A_EDC_BIST_STATUS_RDATA, i) + idx) +#define EDC_DATA(i) EDC_BIST_STATUS_REG(edc_bist_status_rdata_reg, i) for (i = 15; i >= 0; i--) *data++ = ntohl(t4_read_reg(adap, EDC_DATA(i))); @@ -425,8 +469,8 @@ int t4_mem_read(struct adapter *adap, in /* * Read the chip's memory block and bail if there's an error. */ - if (mtype == MEM_MC) - ret = t4_mc_read(adap, pos, data, NULL); + if ((mtype == MEM_MC) || (mtype == MEM_MC1)) + ret = t4_mc_read(adap, mtype - MEM_MC, pos, data, NULL); else ret = t4_edc_read(adap, mtype, pos, data, NULL); if (ret) @@ -464,8 +508,9 @@ struct t4_vpd_hdr { #define EEPROM_STAT_ADDR 0x7bfc #define VPD_BASE 0x400 #define VPD_BASE_OLD 0 -#define VPD_LEN 512 +#define VPD_LEN 1024 #define VPD_INFO_FLD_HDR_SIZE 3 +#define CHELSIO_VPD_UNIQUE_ID 0x82 /** * t4_seeprom_read - read a serial EEPROM location @@ -630,7 +675,7 @@ static int get_vpd_params(struct adapter * it at 0. */ ret = t4_seeprom_read(adapter, VPD_BASE, (u32 *)(vpd)); - addr = *vpd == 0x82 ? VPD_BASE : VPD_BASE_OLD; + addr = *vpd == CHELSIO_VPD_UNIQUE_ID ? VPD_BASE : VPD_BASE_OLD; for (i = 0; i < sizeof(vpd); i += 4) { ret = t4_seeprom_read(adapter, addr + i, (u32 *)(vpd + i)); @@ -668,8 +713,10 @@ static int get_vpd_params(struct adapter i = vpd[sn - VPD_INFO_FLD_HDR_SIZE + 2]; memcpy(p->sn, vpd + sn, min(i, SERNUM_LEN)); strstrip(p->sn); + i = vpd[pn - VPD_INFO_FLD_HDR_SIZE + 2]; memcpy(p->pn, vpd + pn, min(i, PN_LEN)); strstrip((char *)p->pn); + i = vpd[na - VPD_INFO_FLD_HDR_SIZE + 2]; memcpy(p->na, vpd + na, min(i, MACADDR_LEN)); strstrip((char *)p->na); @@ -914,6 +961,7 @@ int t4_get_tp_version(struct adapter *ad int t4_check_fw_version(struct adapter *adapter) { int ret, major, minor, micro; + int exp_major, exp_minor, exp_micro; ret = t4_get_fw_version(adapter, &adapter->params.fw_vers); if (!ret) @@ -925,13 +973,30 @@ int t4_check_fw_version(struct adapter * minor = G_FW_HDR_FW_VER_MINOR(adapter->params.fw_vers); micro = G_FW_HDR_FW_VER_MICRO(adapter->params.fw_vers); - if (major != FW_VERSION_MAJOR) { /* major mismatch - fail */ + switch (chip_id(adapter)) { + case CHELSIO_T4: + exp_major = FW_VERSION_MAJOR_T4; + exp_minor = FW_VERSION_MINOR_T4; + exp_micro = FW_VERSION_MICRO_T4; + break; + case CHELSIO_T5: + exp_major = FW_VERSION_MAJOR_T5; + exp_minor = FW_VERSION_MINOR_T5; + exp_micro = FW_VERSION_MICRO_T5; + break; + default: + CH_ERR(adapter, "Unsupported chip type, %x\n", + chip_id(adapter)); + return -EINVAL; + } + + if (major != exp_major) { /* major mismatch - fail */ CH_ERR(adapter, "card FW has major version %u, driver wants " - "%u\n", major, FW_VERSION_MAJOR); + "%u\n", major, exp_major); return -EINVAL; } - if (minor == FW_VERSION_MINOR && micro == FW_VERSION_MICRO) + if (minor == exp_minor && micro == exp_micro) return 0; /* perfect match */ /* Minor/micro version mismatch. Report it but often it's OK. */ @@ -970,14 +1035,19 @@ static int t4_flash_erase_sectors(struct * @adapter: the adapter * * Return the address within the flash where the Firmware Configuration - * File is stored. + * File is stored, or an error if the device FLASH is too small to contain + * a Firmware Configuration File. */ -unsigned int t4_flash_cfg_addr(struct adapter *adapter) +int t4_flash_cfg_addr(struct adapter *adapter) { - if (adapter->params.sf_size == 0x100000) - return FLASH_FPGA_CFG_START; - else - return FLASH_CFG_START; + /* + * If the device FLASH isn't large enough to hold a Firmware + * Configuration File, return an error. + */ + if (adapter->params.sf_size < FLASH_CFG_START + FLASH_CFG_MAX_SIZE) + return -ENOSPC; + + return FLASH_CFG_START; } /** @@ -990,12 +1060,16 @@ unsigned int t4_flash_cfg_addr(struct ad */ int t4_load_cfg(struct adapter *adap, const u8 *cfg_data, unsigned int size) { - int ret, i, n; + int ret, i, n, cfg_addr; unsigned int addr; unsigned int flash_cfg_start_sec; unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; - addr = t4_flash_cfg_addr(adap); + cfg_addr = t4_flash_cfg_addr(adap); + if (cfg_addr < 0) + return cfg_addr; + + addr = cfg_addr; flash_cfg_start_sec = addr / SF_SEC_SIZE; if (size > FLASH_CFG_MAX_SIZE) { @@ -1072,6 +1146,13 @@ int t4_load_fw(struct adapter *adap, con FLASH_FW_MAX_SIZE); return -EFBIG; } + if ((is_t4(adap) && hdr->chip != FW_HDR_CHIP_T4) || + (is_t5(adap) && hdr->chip != FW_HDR_CHIP_T5)) { + CH_ERR(adap, + "FW image (%d) is not suitable for this adapter (%d)\n", + hdr->chip, chip_id(adap)); + return -EINVAL; + } for (csum = 0, i = 0; i < size / sizeof(csum); i++) csum += ntohl(p[i]); @@ -1407,6 +1488,7 @@ out: void t4_read_cimq_cfg(struct adapter *adap, u16 *base, u16 *size, u16 *thres) { unsigned int i, v; + int cim_num_obq = is_t4(adap) ? CIM_NUM_OBQ : CIM_NUM_OBQ_T5; for (i = 0; i < CIM_NUM_IBQ; i++) { t4_write_reg(adap, A_CIM_QUEUE_CONFIG_REF, F_IBQSELECT | @@ -1416,7 +1498,7 @@ void t4_read_cimq_cfg(struct adapter *ad *size++ = G_CIMQSIZE(v) * 256; /* value is in 256-byte units */ *thres++ = G_QUEFULLTHRSH(v) * 8; /* 8-byte unit */ } - for (i = 0; i < CIM_NUM_OBQ; i++) { + for (i = 0; i < cim_num_obq; i++) { t4_write_reg(adap, A_CIM_QUEUE_CONFIG_REF, F_OBQSELECT | V_QUENUMSELECT(i)); v = t4_read_reg(adap, A_CIM_QUEUE_CONFIG_CTRL); @@ -1452,8 +1534,12 @@ int t4_read_cim_ibq(struct adapter *adap for (i = 0; i < n; i++, addr++) { t4_write_reg(adap, A_CIM_IBQ_DBG_CFG, V_IBQDBGADDR(addr) | F_IBQDBGEN); + /* + * It might take 3-10ms before the IBQ debug read access is + * allowed. Wait for 1 Sec with a delay of 1 usec. + */ err = t4_wait_op_done(adap, A_CIM_IBQ_DBG_CFG, F_IBQDBGBUSY, 0, - 2, 1); + 1000000, 1); if (err) return err; *data++ = t4_read_reg(adap, A_CIM_IBQ_DBG_DATA); @@ -1477,8 +1563,9 @@ int t4_read_cim_obq(struct adapter *adap { int i, err; unsigned int addr, v, nwords; + int cim_num_obq = is_t4(adap) ? CIM_NUM_OBQ : CIM_NUM_OBQ_T5; - if (qid > 5 || (n & 3)) + if (qid >= cim_num_obq || (n & 3)) return -EINVAL; t4_write_reg(adap, A_CIM_QUEUE_CONFIG_REF, F_OBQSELECT | @@ -1762,7 +1849,8 @@ void t4_ulprx_read_la(struct adapter *ad } #define ADVERT_MASK (FW_PORT_CAP_SPEED_100M | FW_PORT_CAP_SPEED_1G |\ - FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_ANEG) + FW_PORT_CAP_SPEED_10G | FW_PORT_CAP_SPEED_40G | \ + FW_PORT_CAP_SPEED_100G | FW_PORT_CAP_ANEG) /** * t4_link_start - apply link configuration to MAC/PHY @@ -1933,6 +2021,47 @@ static void pcie_intr_handler(struct ada { 0 } }; + static struct intr_info t5_pcie_intr_info[] = { + { F_MSTGRPPERR, "Master Response Read Queue parity error", + -1, 1 }, + { F_MSTTIMEOUTPERR, "Master Timeout FIFO parity error", -1, 1 }, + { F_MSIXSTIPERR, "MSI-X STI SRAM parity error", -1, 1 }, + { F_MSIXADDRLPERR, "MSI-X AddrL parity error", -1, 1 }, + { F_MSIXADDRHPERR, "MSI-X AddrH parity error", -1, 1 }, + { F_MSIXDATAPERR, "MSI-X data parity error", -1, 1 }, + { F_MSIXDIPERR, "MSI-X DI parity error", -1, 1 }, + { F_PIOCPLGRPPERR, "PCI PIO completion Group FIFO parity error", + -1, 1 }, + { F_PIOREQGRPPERR, "PCI PIO request Group FIFO parity error", + -1, 1 }, + { F_TARTAGPERR, "PCI PCI target tag FIFO parity error", -1, 1 }, + { F_MSTTAGQPERR, "PCI master tag queue parity error", -1, 1 }, + { F_CREQPERR, "PCI CMD channel request parity error", -1, 1 }, + { F_CRSPPERR, "PCI CMD channel response parity error", -1, 1 }, + { F_DREQWRPERR, "PCI DMA channel write request parity error", + -1, 1 }, + { F_DREQPERR, "PCI DMA channel request parity error", -1, 1 }, + { F_DRSPPERR, "PCI DMA channel response parity error", -1, 1 }, + { F_HREQWRPERR, "PCI HMA channel count parity error", -1, 1 }, + { F_HREQPERR, "PCI HMA channel request parity error", -1, 1 }, + { F_HRSPPERR, "PCI HMA channel response parity error", -1, 1 }, + { F_CFGSNPPERR, "PCI config snoop FIFO parity error", -1, 1 }, + { F_FIDPERR, "PCI FID parity error", -1, 1 }, + { F_VFIDPERR, "PCI INTx clear parity error", -1, 1 }, + { F_MAGRPPERR, "PCI MA group FIFO parity error", -1, 1 }, + { F_PIOTAGPERR, "PCI PIO tag parity error", -1, 1 }, + { F_IPRXHDRGRPPERR, "PCI IP Rx header group parity error", + -1, 1 }, + { F_IPRXDATAGRPPERR, "PCI IP Rx data group parity error", + -1, 1 }, + { F_RPLPERR, "PCI IP replay buffer parity error", -1, 1 }, + { F_IPSOTPERR, "PCI IP SOT buffer parity error", -1, 1 }, + { F_TRGT1GRPPERR, "PCI TRGT1 group FIFOs parity error", -1, 1 }, + { F_READRSPERR, "Outbound read error", -1, + 0 }, + { 0 } + }; + int fat; fat = t4_handle_intr_status(adapter, @@ -1941,7 +2070,9 @@ static void pcie_intr_handler(struct ada t4_handle_intr_status(adapter, A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, pcie_port_intr_info) + - t4_handle_intr_status(adapter, A_PCIE_INT_CAUSE, pcie_intr_info); + t4_handle_intr_status(adapter, A_PCIE_INT_CAUSE, + is_t4(adapter) ? + pcie_intr_info : t5_pcie_intr_info); if (fat) t4_fatal_err(adapter); } @@ -2286,8 +2417,13 @@ static void mem_intr_handler(struct adap addr = EDC_REG(A_EDC_INT_CAUSE, idx); cnt_addr = EDC_REG(A_EDC_ECC_STATUS, idx); } else { - addr = A_MC_INT_CAUSE; - cnt_addr = A_MC_ECC_STATUS; + if (is_t4(adapter)) { + addr = A_MC_INT_CAUSE; + cnt_addr = A_MC_ECC_STATUS; + } else { + addr = A_MC_P_INT_CAUSE; + cnt_addr = A_MC_P_ECC_STATUS; + } } v = t4_read_reg(adapter, addr) & MEM_INT_MASK; @@ -2368,9 +2504,15 @@ static void ncsi_intr_handler(struct ada */ static void xgmac_intr_handler(struct adapter *adap, int port) { - u32 v = t4_read_reg(adap, PORT_REG(port, A_XGMAC_PORT_INT_CAUSE)); + u32 v, int_cause_reg; + + if (is_t4(adap)) + int_cause_reg = PORT_REG(port, A_XGMAC_PORT_INT_CAUSE); + else + int_cause_reg = T5_PORT_REG(port, A_MAC_PORT_INT_CAUSE); - v &= F_TXFIFO_PRTY_ERR | F_RXFIFO_PRTY_ERR; + v = t4_read_reg(adap, int_cause_reg); + v &= (F_TXFIFO_PRTY_ERR | F_RXFIFO_PRTY_ERR); if (!v) return; @@ -2378,7 +2520,7 @@ static void xgmac_intr_handler(struct ad CH_ALERT(adap, "XGMAC %d Tx FIFO parity error\n", port); if (v & F_RXFIFO_PRTY_ERR) CH_ALERT(adap, "XGMAC %d Rx FIFO parity error\n", port); - t4_write_reg(adap, PORT_REG(port, A_XGMAC_PORT_INT_CAUSE), v); + t4_write_reg(adap, int_cause_reg, v); t4_fatal_err(adap); } @@ -2388,12 +2530,19 @@ static void xgmac_intr_handler(struct ad static void pl_intr_handler(struct adapter *adap) { static struct intr_info pl_intr_info[] = { - { F_FATALPERR, "T4 fatal parity error", -1, 1 }, + { F_FATALPERR, "Fatal parity error", -1, 1 }, { F_PERRVFID, "PL VFID_MAP parity error", -1, 1 }, { 0 } }; - if (t4_handle_intr_status(adap, A_PL_PL_INT_CAUSE, pl_intr_info)) + static struct intr_info t5_pl_intr_info[] = { + { F_PL_BUSPERR, "PL bus parity error", -1, 1 }, + { F_FATALPERR, "Fatal parity error", -1, 1 }, + { 0 } + }; + + if (t4_handle_intr_status(adap, A_PL_PL_INT_CAUSE, + is_t4(adap) ? pl_intr_info : t5_pl_intr_info)) t4_fatal_err(adap); } @@ -2526,7 +2675,6 @@ void t4_intr_clear(struct adapter *adapt A_PCIE_CORE_UTL_SYSTEM_BUS_AGENT_STATUS, A_PCIE_CORE_UTL_PCI_EXPRESS_PORT_STATUS, A_PCIE_NONFAT_ERR, A_PCIE_INT_CAUSE, - A_MC_INT_CAUSE, A_MA_INT_WRAP_STATUS, A_MA_PARITY_ERROR_STATUS, A_MA_INT_CAUSE, A_EDC_INT_CAUSE, EDC_REG(A_EDC_INT_CAUSE, 1), A_CIM_HOST_INT_CAUSE, A_CIM_HOST_UPACC_INT_CAUSE, @@ -2546,6 +2694,9 @@ void t4_intr_clear(struct adapter *adapt for (i = 0; i < ARRAY_SIZE(cause_reg); ++i) t4_write_reg(adapter, cause_reg[i], 0xffffffff); + t4_write_reg(adapter, is_t4(adapter) ? A_MC_INT_CAUSE : + A_MC_P_INT_CAUSE, 0xffffffff); + t4_write_reg(adapter, A_PL_INT_CAUSE, GLBL_INTR_MASK); (void) t4_read_reg(adapter, A_PL_INT_CAUSE); /* flush */ } @@ -3531,7 +3682,10 @@ int t4_set_trace_filter(struct adapter * V_TFMINPKTSIZE(tp->min_len)); t4_write_reg(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst, V_TFOFFSET(tp->skip_ofst) | V_TFLENGTH(tp->skip_len) | - V_TFPORT(tp->port) | F_TFEN | V_TFINVERTMATCH(tp->invert)); + is_t4(adap) ? + V_TFPORT(tp->port) | F_TFEN | V_TFINVERTMATCH(tp->invert) : + V_T5_TFPORT(tp->port) | F_T5_TFEN | + V_T5_TFINVERTMATCH(tp->invert)); return 0; } @@ -3555,13 +3709,18 @@ void t4_get_trace_filter(struct adapter ctla = t4_read_reg(adap, A_MPS_TRC_FILTER_MATCH_CTL_A + ofst); ctlb = t4_read_reg(adap, A_MPS_TRC_FILTER_MATCH_CTL_B + ofst); - *enabled = !!(ctla & F_TFEN); + if (is_t4(adap)) { + *enabled = !!(ctla & F_TFEN); + tp->port = G_TFPORT(ctla); + } else { + *enabled = !!(ctla & F_T5_TFEN); + tp->port = G_T5_TFPORT(ctla); + } tp->snap_len = G_TFCAPTUREMAX(ctlb); tp->min_len = G_TFMINPKTSIZE(ctlb); tp->skip_ofst = G_TFOFFSET(ctla); tp->skip_len = G_TFLENGTH(ctla); tp->invert = !!(ctla & F_TFINVERTMATCH); - tp->port = G_TFPORT(ctla); ofst = (A_MPS_TRC_FILTER1_MATCH - A_MPS_TRC_FILTER0_MATCH) * idx; data_reg = A_MPS_TRC_FILTER0_MATCH + ofst; @@ -3584,11 +3743,19 @@ void t4_get_trace_filter(struct adapter void t4_pmtx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]) { int i; + u32 data[2]; for (i = 0; i < PM_NSTATS; i++) { t4_write_reg(adap, A_PM_TX_STAT_CONFIG, i + 1); cnt[i] = t4_read_reg(adap, A_PM_TX_STAT_COUNT); - cycles[i] = t4_read_reg64(adap, A_PM_TX_STAT_LSB); + if (is_t4(adap)) + cycles[i] = t4_read_reg64(adap, A_PM_TX_STAT_LSB); + else { + t4_read_indirect(adap, A_PM_TX_DBG_CTRL, + A_PM_TX_DBG_DATA, data, 2, + A_PM_TX_DBG_STAT_MSB); + cycles[i] = (((u64)data[0] << 32) | data[1]); + } } } @@ -3603,11 +3770,19 @@ void t4_pmtx_get_stats(struct adapter *a void t4_pmrx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]) { int i; + u32 data[2]; for (i = 0; i < PM_NSTATS; i++) { t4_write_reg(adap, A_PM_RX_STAT_CONFIG, i + 1); cnt[i] = t4_read_reg(adap, A_PM_RX_STAT_COUNT); - cycles[i] = t4_read_reg64(adap, A_PM_RX_STAT_LSB); + if (is_t4(adap)) + cycles[i] = t4_read_reg64(adap, A_PM_RX_STAT_LSB); + else { + t4_read_indirect(adap, A_PM_RX_DBG_CTRL, + A_PM_RX_DBG_DATA, data, 2, + A_PM_RX_DBG_STAT_MSB); + cycles[i] = (((u64)data[0] << 32) | data[1]); + } } } @@ -3666,7 +3841,9 @@ void t4_get_port_stats(struct adapter *a u32 bgmap = get_mps_bg_map(adap, idx); #define GET_STAT(name) \ - t4_read_reg64(adap, PORT_REG(idx, A_MPS_PORT_STAT_##name##_L)) + t4_read_reg64(adap, \ + (is_t4(adap) ? PORT_REG(idx, A_MPS_PORT_STAT_##name##_L) : \ + T5_PORT_REG(idx, A_MPS_PORT_STAT_##name##_L))) #define GET_STAT_COM(name) t4_read_reg64(adap, A_MPS_STAT_##name##_L) p->tx_pause = GET_STAT(TX_PORT_PAUSE); @@ -3745,13 +3922,19 @@ void t4_clr_port_stats(struct adapter *a { unsigned int i; u32 bgmap = get_mps_bg_map(adap, idx); + u32 port_base_addr; + + if (is_t4(adap)) + port_base_addr = PORT_BASE(idx); + else + port_base_addr = T5_PORT_BASE(idx); for (i = A_MPS_PORT_STAT_TX_PORT_BYTES_L; - i <= A_MPS_PORT_STAT_TX_PORT_PPP7_H; i += 8) - t4_write_reg(adap, PORT_REG(idx, i), 0); + i <= A_MPS_PORT_STAT_TX_PORT_PPP7_H; i += 8) + t4_write_reg(adap, port_base_addr + i, 0); for (i = A_MPS_PORT_STAT_RX_PORT_BYTES_L; - i <= A_MPS_PORT_STAT_RX_PORT_LESS_64B_H; i += 8) - t4_write_reg(adap, PORT_REG(idx, i), 0); + i <= A_MPS_PORT_STAT_RX_PORT_LESS_64B_H; i += 8) + t4_write_reg(adap, port_base_addr + i, 0); for (i = 0; i < 4; i++) if (bgmap & (1 << i)) { t4_write_reg(adap, @@ -3774,7 +3957,10 @@ void t4_get_lb_stats(struct adapter *ada u32 bgmap = get_mps_bg_map(adap, idx); #define GET_STAT(name) \ - t4_read_reg64(adap, PORT_REG(idx, A_MPS_PORT_STAT_LB_PORT_##name##_L)) + t4_read_reg64(adap, \ + (is_t4(adap) ? \ + PORT_REG(idx, A_MPS_PORT_STAT_LB_PORT_##name##_L) : \ + T5_PORT_REG(idx, A_MPS_PORT_STAT_LB_PORT_##name##_L))) #define GET_STAT_COM(name) t4_read_reg64(adap, A_MPS_STAT_##name##_L) p->octets = GET_STAT(BYTES); @@ -3791,8 +3977,7 @@ void t4_get_lb_stats(struct adapter *ada p->frames_512_1023 = GET_STAT(512B_1023B); p->frames_1024_1518 = GET_STAT(1024B_1518B); p->frames_1519_max = GET_STAT(1519B_MAX); - p->drop = t4_read_reg(adap, PORT_REG(idx, - A_MPS_PORT_STAT_LB_PORT_DROP_FRAMES)); + p->drop = GET_STAT(DROP_FRAMES); p->ovflow0 = (bgmap & 1) ? GET_STAT_COM(RX_BG_0_LB_DROP_FRAME) : 0; p->ovflow1 = (bgmap & 2) ? GET_STAT_COM(RX_BG_1_LB_DROP_FRAME) : 0; @@ -3818,14 +4003,26 @@ void t4_get_lb_stats(struct adapter *ada void t4_wol_magic_enable(struct adapter *adap, unsigned int port, const u8 *addr) { + u32 mag_id_reg_l, mag_id_reg_h, port_cfg_reg; + + if (is_t4(adap)) { + mag_id_reg_l = PORT_REG(port, A_XGMAC_PORT_MAGIC_MACID_LO); + mag_id_reg_h = PORT_REG(port, A_XGMAC_PORT_MAGIC_MACID_HI); + port_cfg_reg = PORT_REG(port, A_XGMAC_PORT_CFG2); + } else { + mag_id_reg_l = T5_PORT_REG(port, A_MAC_PORT_MAGIC_MACID_LO); + mag_id_reg_h = T5_PORT_REG(port, A_MAC_PORT_MAGIC_MACID_HI); + port_cfg_reg = T5_PORT_REG(port, A_MAC_PORT_CFG2); + } + if (addr) { - t4_write_reg(adap, PORT_REG(port, A_XGMAC_PORT_MAGIC_MACID_LO), + t4_write_reg(adap, mag_id_reg_l, (addr[2] << 24) | (addr[3] << 16) | (addr[4] << 8) | addr[5]); - t4_write_reg(adap, PORT_REG(port, A_XGMAC_PORT_MAGIC_MACID_HI), + t4_write_reg(adap, mag_id_reg_h, (addr[0] << 8) | addr[1]); } - t4_set_reg_field(adap, PORT_REG(port, A_XGMAC_PORT_CFG2), F_MAGICEN, + t4_set_reg_field(adap, port_cfg_reg, F_MAGICEN, V_MAGICEN(addr != NULL)); } @@ -3848,16 +4045,23 @@ int t4_wol_pat_enable(struct adapter *ad u64 mask0, u64 mask1, unsigned int crc, bool enable) { int i; + u32 port_cfg_reg; + + if (is_t4(adap)) + port_cfg_reg = PORT_REG(port, A_XGMAC_PORT_CFG2); + else + port_cfg_reg = T5_PORT_REG(port, A_MAC_PORT_CFG2); if (!enable) { - t4_set_reg_field(adap, PORT_REG(port, A_XGMAC_PORT_CFG2), - F_PATEN, 0); + t4_set_reg_field(adap, port_cfg_reg, F_PATEN, 0); return 0; } if (map > 0xff) return -EINVAL; -#define EPIO_REG(name) PORT_REG(port, A_XGMAC_PORT_EPIO_##name) +#define EPIO_REG(name) \ + (is_t4(adap) ? PORT_REG(port, A_XGMAC_PORT_EPIO_##name) : \ + T5_PORT_REG(port, A_MAC_PORT_EPIO_##name)) t4_write_reg(adap, EPIO_REG(DATA1), mask0 >> 32); t4_write_reg(adap, EPIO_REG(DATA2), mask1); @@ -3883,7 +4087,7 @@ int t4_wol_pat_enable(struct adapter *ad } #undef EPIO_REG - t4_set_reg_field(adap, PORT_REG(port, A_XGMAC_PORT_CFG2), 0, F_PATEN); + t4_set_reg_field(adap, port_cfg_reg, 0, F_PATEN); return 0; } @@ -4487,8 +4691,8 @@ int t4_query_params(struct adapter *adap V_FW_PARAMS_CMD_VFN(vf)); c.retval_len16 = htonl(FW_LEN16(c)); - for (i = 0; i < nparams; i++, p += 2) - *p = htonl(*params++); + for (i = 0; i < nparams; i++, p += 2, params++) + *p = htonl(*params); ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); if (ret == 0) @@ -4527,8 +4731,10 @@ int t4_set_params(struct adapter *adap, c.retval_len16 = htonl(FW_LEN16(c)); while (nparams--) { - *p++ = htonl(*params++); - *p++ = htonl(*val++); + *p++ = htonl(*params); + params++; + *p++ = htonl(*val); + val++; } return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); @@ -4763,9 +4969,12 @@ int t4_alloc_mac_filt(struct adapter *ad int offset, ret = 0; struct fw_vi_mac_cmd c; unsigned int nfilters = 0; + unsigned int max_naddr = is_t4(adap) ? + NUM_MPS_CLS_SRAM_L_INSTANCES : + NUM_MPS_T5_CLS_SRAM_L_INSTANCES; unsigned int rem = naddr; - if (naddr > NUM_MPS_CLS_SRAM_L_INSTANCES) + if (naddr > max_naddr) return -EINVAL; for (offset = 0; offset < naddr ; /**/) { @@ -4806,10 +5015,10 @@ int t4_alloc_mac_filt(struct adapter *ad u16 index = G_FW_VI_MAC_CMD_IDX(ntohs(p->valid_to_idx)); if (idx) - idx[offset+i] = (index >= NUM_MPS_CLS_SRAM_L_INSTANCES + idx[offset+i] = (index >= max_naddr ? 0xffff : index); - if (index < NUM_MPS_CLS_SRAM_L_INSTANCES) + if (index < max_naddr) nfilters++; else if (hash) *hash |= (1ULL << hash_mac_addr(addr[offset+i])); @@ -4853,6 +5062,9 @@ int t4_change_mac(struct adapter *adap, int ret, mode; struct fw_vi_mac_cmd c; struct fw_vi_mac_exact *p = c.u.exact; + unsigned int max_mac_addr = is_t4(adap) ? + NUM_MPS_CLS_SRAM_L_INSTANCES : + NUM_MPS_T5_CLS_SRAM_L_INSTANCES; if (idx < 0) /* new allocation */ idx = persist ? FW_VI_MAC_ADD_PERSIST_MAC : FW_VI_MAC_ADD_MAC; @@ -4867,10 +5079,10 @@ int t4_change_mac(struct adapter *adap, V_FW_VI_MAC_CMD_IDX(idx)); memcpy(p->macaddr, addr, sizeof(p->macaddr)); - ret = t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), &c); + ret = t4_wr_mbox(adap, mbox, &c, sizeof(c), &c); if (ret == 0) { ret = G_FW_VI_MAC_CMD_IDX(ntohs(p->valid_to_idx)); - if (ret >= NUM_MPS_CLS_SRAM_L_INSTANCES) + if (ret >= max_mac_addr) ret = -ENOMEM; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Tue Jul 2 04:42:33 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 058D36D2; Tue, 2 Jul 2013 04:42:33 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ECBD31453; Tue, 2 Jul 2013 04:42:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r624gWRq091556; Tue, 2 Jul 2013 04:42:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r624gWL9091555; Tue, 2 Jul 2013 04:42:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307020442.r624gWL9091555@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 2 Jul 2013 04:42: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: r252496 - stable/9/sys/dev/drm2/i915 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.14 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, 02 Jul 2013 04:42:33 -0000 Author: kib Date: Tue Jul 2 04:42:32 2013 New Revision: 252496 URL: http://svnweb.freebsd.org/changeset/base/252496 Log: MFC r251960: Since the gem pagefault handler relocks the vm object lock, other thread might fault on the same GTT offset meantime and instantiate the mapping. Recheck that the mgt device object still does not have a page at the current offset after relocking, and return a possibly installed page. Modified: stable/9/sys/dev/drm2/i915/i915_gem.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/i915/i915_gem.c ============================================================================== --- stable/9/sys/dev/drm2/i915/i915_gem.c Tue Jul 2 04:27:16 2013 (r252495) +++ stable/9/sys/dev/drm2/i915/i915_gem.c Tue Jul 2 04:42:32 2013 (r252496) @@ -1371,6 +1371,23 @@ unlocked_vmobj: } else DRM_LOCK(dev); + /* + * Since the object lock was dropped, other thread might have + * faulted on the same GTT address and instantiated the + * mapping for the page. Recheck. + */ + VM_OBJECT_LOCK(vm_obj); + m = vm_page_lookup(vm_obj, OFF_TO_IDX(offset)); + if (m != NULL) { + if ((m->flags & VPO_BUSY) != 0) { + DRM_UNLOCK(dev); + vm_page_sleep(m, "915pee"); + goto retry; + } + goto have_page; + } else + VM_OBJECT_UNLOCK(vm_obj); + /* Now bind it into the GTT if needed */ if (!obj->map_and_fenceable) { ret = i915_gem_object_unbind(obj); @@ -1424,8 +1441,9 @@ unlocked_vmobj: goto retry; } m->valid = VM_PAGE_BITS_ALL; - *mres = m; vm_page_insert(m, vm_obj, OFF_TO_IDX(offset)); +have_page: + *mres = m; vm_page_busy(m); CTR4(KTR_DRM, "fault %p %jx %x phys %x", gem_obj, offset, prot, From owner-svn-src-stable@FreeBSD.ORG Tue Jul 2 04:45:52 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 47D538E1; Tue, 2 Jul 2013 04:45:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 380F9147E; Tue, 2 Jul 2013 04:45:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r624jqcl092045; Tue, 2 Jul 2013 04:45:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r624jpjG092043; Tue, 2 Jul 2013 04:45:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307020445.r624jpjG092043@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 2 Jul 2013 04:45: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: r252497 - in stable/9/sys/dev: drm2/i915 syscons 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.14 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, 02 Jul 2013 04:45:52 -0000 Author: kib Date: Tue Jul 2 04:45:51 2013 New Revision: 252497 URL: http://svnweb.freebsd.org/changeset/base/252497 Log: MFC r251961: Disable wait for the retrace if KMS is activated. Modified: stable/9/sys/dev/drm2/i915/intel_fb.c stable/9/sys/dev/syscons/scvgarndr.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/drm2/i915/intel_fb.c ============================================================================== --- stable/9/sys/dev/drm2/i915/intel_fb.c Tue Jul 2 04:42:32 2013 (r252496) +++ stable/9/sys/dev/drm2/i915/intel_fb.c Tue Jul 2 04:45:51 2013 (r252497) @@ -207,6 +207,8 @@ static void intel_fbdev_destroy(struct d } } +extern int sc_txtmouse_no_retrace_wait; + int intel_fbdev_init(struct drm_device *dev) { struct intel_fbdev *ifbdev; @@ -229,6 +231,7 @@ int intel_fbdev_init(struct drm_device * drm_fb_helper_single_add_all_connectors(&ifbdev->helper); drm_fb_helper_initial_config(&ifbdev->helper, 32); + sc_txtmouse_no_retrace_wait = 1; return 0; } Modified: stable/9/sys/dev/syscons/scvgarndr.c ============================================================================== --- stable/9/sys/dev/syscons/scvgarndr.c Tue Jul 2 04:42:32 2013 (r252496) +++ stable/9/sys/dev/syscons/scvgarndr.c Tue Jul 2 04:45:51 2013 (r252497) @@ -395,6 +395,8 @@ vga_txtblink(scr_stat *scp, int at, int { } +int sc_txtmouse_no_retrace_wait; + #ifndef SC_NO_CUTPASTE static void @@ -445,7 +447,9 @@ draw_txtmouse(scr_stat *scp, int x, int #if 1 /* wait for vertical retrace to avoid jitter on some videocards */ crtc_addr = scp->sc->adp->va_crtc_addr; - while (!(inb(crtc_addr + 6) & 0x08)) /* idle */ ; + while (!sc_txtmouse_no_retrace_wait && + !(inb(crtc_addr + 6) & 0x08)) + /* idle */ ; #endif c = scp->sc->mouse_char; vidd_load_font(scp->sc->adp, 0, 32, 8, font_buf, c, 4); From owner-svn-src-stable@FreeBSD.ORG Tue Jul 2 05:53:41 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A6DE789B; Tue, 2 Jul 2013 05:53:41 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from thoth.sbs.de (thoth.sbs.de [192.35.17.2]) by mx1.freebsd.org (Postfix) with ESMTP id 3D5211792; Tue, 2 Jul 2013 05:53:40 +0000 (UTC) Received: from mail2.siemens.de (localhost [127.0.0.1]) by thoth.sbs.de (8.13.6/8.13.6) with ESMTP id r625rY8Z022428; Tue, 2 Jul 2013 07:53:34 +0200 Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130]) by mail2.siemens.de (8.13.6/8.13.6) with ESMTP id r625rYKp017918; Tue, 2 Jul 2013 07:53:34 +0200 Received: (from localhost) by curry.mchp.siemens.de (8.14.7/8.14.7) id r625rYXC006155; Date: Tue, 2 Jul 2013 07:53:33 +0200 From: Andre Albsmeier To: "Kenneth D. Merry" Subject: Re: svn commit: r252214 - in stable/9: bin/chio sys/cam/scsi sys/sys Message-ID: <20130702055333.GA2729@bali> References: <201306252143.r5PLhoM0064338@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201306252143.r5PLhoM0064338@svn.freebsd.org> X-Echelon: X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses! User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "svn-src-stable@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "svn-src-stable-9@freebsd.org" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 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, 02 Jul 2013 05:53:41 -0000 On Tue, 25-Jun-2013 at 23:43:50 +0200, Kenneth D. Merry wrote: > Author: ken > Date: Tue Jun 25 21:43:49 2013 > New Revision: 252214 > URL: http://svnweb.freebsd.org/changeset/base/252214 Hi Ken, > Log: > MFC: 249658, 249701 > > Update chio(1) and ch(4) to support reporting element designators. > > This allows mapping a tape drive in a changer (as reported by > 'chio status') to a sa(4) driver instance by comparing the > serial numbers. > > The designators can be ASCII (which is printed out directly), binary > (which is printed in hex format) or UTF-8, which is printed in either > native UTF-8 format if the terminal can support it, or in %XX notation > for non-ASCII characters. Thanks to Hiroki Sato for the > explanation and example UTF-8 printing code. > > chio.h: Modify the changer_element_status structure to add new > fields and definitions from the SMC3r16 spec. > > Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and > define a new CHIOGSTATUS ioctl. > > Clean up some tab/space issues. > > chio.c: For the 'status' subcommand, print the designator field > if it is supplied by a device. > > scsi_ch.h: Add new flags for DVCID and CURDATA to the READ > ELEMENT STATUS command structure. > > Add a read_element_status_device_id structure > for the data fields in the new standard. Add new > unions, dt_or_obsolete and voltage_devid, to hold > and address data from either SCSI-2 or newer devices. > > scsi_ch.c: Implement support for fetching device IDs with READ > ELEMENT STATUS data. > > Add new arguments to scsi_read_element_status() to > allow the user to request the DVCID and CURDATA bits. This broke "chio status" when talking to my QUALSTAR TLS-8211 library: Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): READ ELEMENT STATUS. CDB: b8 10 fd e8 00 01 03 00 04 00 00 00 Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): CAM status: SCSI Status Error Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): SCSI status: Check Condition Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB) Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): Command byte 6 is invalid Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): Error 22, Unretryable error scsi_cmd->flags (Byte 6) must be zero for this library so I had to use this workaround to make it work again until a better solution is available: --- sys/cam/scsi/scsi_ch.c.ORI 2013-06-26 13:38:54.000000000 +0200 +++ sys/cam/scsi/scsi_ch.c 2013-07-02 07:42:24.000000000 +0200 @@ -1245,8 +1245,8 @@ /* tag_action */ MSG_SIMPLE_Q_TAG, /* voltag */ want_voltags, /* sea */ softc->sc_firsts[chet], - /* dvcid */ 1, - /* curdata */ 1, + /* dvcid */ 0, + /* curdata */ 0, /* count */ 1, /* data_ptr */ data, /* dxfer_len */ 1024, @@ -1284,8 +1284,8 @@ /* voltag */ want_voltags, /* sea */ softc->sc_firsts[chet] + cesr->cesr_element_base, - /* dvcid */ 1, - /* curdata */ 1, + /* dvcid */ 0, + /* curdata */ 0, /* count */ cesr->cesr_element_count, /* data_ptr */ data, /* dxfer_len */ size, -Andre From owner-svn-src-stable@FreeBSD.ORG Tue Jul 2 19:27:08 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8543F876; Tue, 2 Jul 2013 19:27:08 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5CBBE10A8; Tue, 2 Jul 2013 19:27:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62JR8PX057163; Tue, 2 Jul 2013 19:27:08 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62JR8Na057161; Tue, 2 Jul 2013 19:27:08 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307021927.r62JR8Na057161@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 2 Jul 2013 19:27:08 +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: r252517 - stable/9/sbin/hastd 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.14 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, 02 Jul 2013 19:27:08 -0000 Author: trociny Date: Tue Jul 2 19:27:07 2013 New Revision: 252517 URL: http://svnweb.freebsd.org/changeset/base/252517 Log: MFC r248294, r248296: r248294 (pjd): Delete requests can be larger than MAXPHYS. r248296 (pjd): Minor corrections. Modified: stable/9/sbin/hastd/hastd.8 stable/9/sbin/hastd/secondary.c Directory Properties: stable/9/sbin/hastd/ (props changed) Modified: stable/9/sbin/hastd/hastd.8 ============================================================================== --- stable/9/sbin/hastd/hastd.8 Tue Jul 2 18:54:39 2013 (r252516) +++ stable/9/sbin/hastd/hastd.8 Tue Jul 2 19:27:07 2013 (r252517) @@ -51,7 +51,7 @@ Only one machine (cluster node) can acti This machine is called primary. The .Nm -daemon operates on block level, which makes it transparent for file +daemon operates on block level, which makes it transparent to file systems and applications. .Pp There is one main @@ -68,7 +68,7 @@ The exact format is: hastd: () .Ed .Pp -When (and only when) +If (and only if) .Nm operates in primary role for the given resource, corresponding .Pa /dev/hast/ @@ -77,8 +77,8 @@ File systems and applications can use th requests to. Every write, delete and flush operation .Dv ( BIO_WRITE , BIO_DELETE , BIO_FLUSH ) -is send to local component and synchronously replicated -to the remote (secondary) node if it is available. +is send to local component and replicated to the remote (secondary) node if it +is available. Read operations .Dv ( BIO_READ ) are handled locally unless I/O error occurs or local version of the data Modified: stable/9/sbin/hastd/secondary.c ============================================================================== --- stable/9/sbin/hastd/secondary.c Tue Jul 2 18:54:39 2013 (r252516) +++ stable/9/sbin/hastd/secondary.c Tue Jul 2 19:27:07 2013 (r252517) @@ -582,7 +582,7 @@ requnpack(struct hast_resource *res, str hio->hio_error = EINVAL; goto end; } - if (hio->hio_length > MAXPHYS) { + if (hio->hio_cmd != HIO_DELETE && hio->hio_length > MAXPHYS) { pjdlog_error("Data length is too large (%ju > %ju).", (uintmax_t)hio->hio_length, (uintmax_t)MAXPHYS); hio->hio_error = EINVAL; From owner-svn-src-stable@FreeBSD.ORG Tue Jul 2 19:28:17 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9C1089DB; Tue, 2 Jul 2013 19:28:17 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7429710B7; Tue, 2 Jul 2013 19:28:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62JSHxb057365; Tue, 2 Jul 2013 19:28:17 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62JSHti057363; Tue, 2 Jul 2013 19:28:17 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307021928.r62JSHti057363@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 2 Jul 2013 19:28:17 +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: r252518 - stable/8/sbin/hastd 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.14 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, 02 Jul 2013 19:28:17 -0000 Author: trociny Date: Tue Jul 2 19:28:16 2013 New Revision: 252518 URL: http://svnweb.freebsd.org/changeset/base/252518 Log: MFC r248294, r248296: r248294 (pjd): Delete requests can be larger than MAXPHYS. r248296 (pjd): Minor corrections. Modified: stable/8/sbin/hastd/hastd.8 stable/8/sbin/hastd/secondary.c Directory Properties: stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastd/hastd.8 ============================================================================== --- stable/8/sbin/hastd/hastd.8 Tue Jul 2 19:27:07 2013 (r252517) +++ stable/8/sbin/hastd/hastd.8 Tue Jul 2 19:28:16 2013 (r252518) @@ -51,7 +51,7 @@ Only one machine (cluster node) can acti This machine is called primary. The .Nm -daemon operates on block level, which makes it transparent for file +daemon operates on block level, which makes it transparent to file systems and applications. .Pp There is one main @@ -68,7 +68,7 @@ The exact format is: hastd: () .Ed .Pp -When (and only when) +If (and only if) .Nm operates in primary role for the given resource, corresponding .Pa /dev/hast/ @@ -77,8 +77,8 @@ File systems and applications can use th requests to. Every write, delete and flush operation .Dv ( BIO_WRITE , BIO_DELETE , BIO_FLUSH ) -is send to local component and synchronously replicated -to the remote (secondary) node if it is available. +is send to local component and replicated to the remote (secondary) node if it +is available. Read operations .Dv ( BIO_READ ) are handled locally unless I/O error occurs or local version of the data Modified: stable/8/sbin/hastd/secondary.c ============================================================================== --- stable/8/sbin/hastd/secondary.c Tue Jul 2 19:27:07 2013 (r252517) +++ stable/8/sbin/hastd/secondary.c Tue Jul 2 19:28:16 2013 (r252518) @@ -582,7 +582,7 @@ requnpack(struct hast_resource *res, str hio->hio_error = EINVAL; goto end; } - if (hio->hio_length > MAXPHYS) { + if (hio->hio_cmd != HIO_DELETE && hio->hio_length > MAXPHYS) { pjdlog_error("Data length is too large (%ju > %ju).", (uintmax_t)hio->hio_length, (uintmax_t)MAXPHYS); hio->hio_error = EINVAL; From owner-svn-src-stable@FreeBSD.ORG Tue Jul 2 19:29:00 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A7798B7B; Tue, 2 Jul 2013 19:29:00 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 95E7110C0; Tue, 2 Jul 2013 19:29:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62JT0Kj057473; Tue, 2 Jul 2013 19:29:00 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62JT0Rl057472; Tue, 2 Jul 2013 19:29:00 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307021929.r62JT0Rl057472@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 2 Jul 2013 19:29: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: r252519 - stable/9/sbin/hastctl 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.14 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, 02 Jul 2013 19:29:00 -0000 Author: trociny Date: Tue Jul 2 19:29:00 2013 New Revision: 252519 URL: http://svnweb.freebsd.org/changeset/base/252519 Log: MFC r248286 (pjd): Removed redundant includes. Modified: stable/9/sbin/hastctl/hastctl.c Directory Properties: stable/9/sbin/hastctl/ (props changed) Modified: stable/9/sbin/hastctl/hastctl.c ============================================================================== --- stable/9/sbin/hastctl/hastctl.c Tue Jul 2 19:28:16 2013 (r252518) +++ stable/9/sbin/hastctl/hastctl.c Tue Jul 2 19:29:00 2013 (r252519) @@ -31,21 +31,11 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include #include -#include -#include #include -#include -#include #include -#include #include -#include #include #include From owner-svn-src-stable@FreeBSD.ORG Tue Jul 2 19:29:46 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 31444CE5; Tue, 2 Jul 2013 19:29:46 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2378910CE; Tue, 2 Jul 2013 19:29:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62JTkox057604; Tue, 2 Jul 2013 19:29:46 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62JTkvR057603; Tue, 2 Jul 2013 19:29:46 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307021929.r62JTkvR057603@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 2 Jul 2013 19:29:46 +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: r252520 - stable/8/sbin/hastctl 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.14 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, 02 Jul 2013 19:29:46 -0000 Author: trociny Date: Tue Jul 2 19:29:45 2013 New Revision: 252520 URL: http://svnweb.freebsd.org/changeset/base/252520 Log: MFC r248286 (pjd): Removed redundant includes. Modified: stable/8/sbin/hastctl/hastctl.c Directory Properties: stable/8/sbin/hastctl/ (props changed) Modified: stable/8/sbin/hastctl/hastctl.c ============================================================================== --- stable/8/sbin/hastctl/hastctl.c Tue Jul 2 19:29:00 2013 (r252519) +++ stable/8/sbin/hastctl/hastctl.c Tue Jul 2 19:29:45 2013 (r252520) @@ -31,21 +31,11 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include #include -#include -#include #include -#include -#include #include -#include #include -#include #include #include From owner-svn-src-stable@FreeBSD.ORG Tue Jul 2 19:44:03 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1FC3C90C; Tue, 2 Jul 2013 19:44:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1199C11B0; Tue, 2 Jul 2013 19:44:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62Ji2J0063025; Tue, 2 Jul 2013 19:44:02 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62Ji2d3063024; Tue, 2 Jul 2013 19:44:02 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201307021944.r62Ji2d3063024@svn.freebsd.org> From: Martin Matuska Date: Tue, 2 Jul 2013 19:44: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: r252524 - 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.14 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, 02 Jul 2013 19:44:03 -0000 Author: mm Date: Tue Jul 2 19:44:02 2013 New Revision: 252524 URL: http://svnweb.freebsd.org/changeset/base/252524 Log: MFC r252380: Unbreak "zfs jail" and "zfs unjail" (broken in stable/9 since r249643) I missed to register zfs_ioc_jail and zfs_ioc_unjail as legacy ioctl's with the new zfs_ioctl_register_legacy() function. These operations do not modify pools or datasets so there is no need to log them to pool history. Reported by: Alexander Leidinger on current@ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.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_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Jul 2 19:42:47 2013 (r252523) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Jul 2 19:44:02 2013 (r252524) @@ -5575,6 +5575,13 @@ zfs_ioctl_init(void) zfs_ioctl_register_dataset_nolog(ZFS_IOC_TMP_SNAPSHOT, zfs_ioc_tmp_snapshot, zfs_secpolicy_tmp_snapshot, POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY); + +#ifdef __FreeBSD__ + zfs_ioctl_register_dataset_nolog(ZFS_IOC_JAIL, zfs_ioc_jail, + zfs_secpolicy_config, POOL_CHECK_NONE); + zfs_ioctl_register_dataset_nolog(ZFS_IOC_UNJAIL, zfs_ioc_unjail, + zfs_secpolicy_config, POOL_CHECK_NONE); +#endif } int From owner-svn-src-stable@FreeBSD.ORG Tue Jul 2 19:45:15 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2A552A5E; Tue, 2 Jul 2013 19:45:15 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1C8BD11C8; Tue, 2 Jul 2013 19:45:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r62JjEYj063262; Tue, 2 Jul 2013 19:45:15 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r62JjEMd063261; Tue, 2 Jul 2013 19:45:14 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201307021945.r62JjEMd063261@svn.freebsd.org> From: Martin Matuska Date: Tue, 2 Jul 2013 19:45: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: r252525 - 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.14 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, 02 Jul 2013 19:45:15 -0000 Author: mm Date: Tue Jul 2 19:45:14 2013 New Revision: 252525 URL: http://svnweb.freebsd.org/changeset/base/252525 Log: MFC r252380: Unbreak "zfs jail" and "zfs unjail" (broken in stable/8 since r251757) I missed to register zfs_ioc_jail and zfs_ioc_unjail as legacy ioctl's with the new zfs_ioctl_register_legacy() function. These operations do not modify pools or datasets so there is no need to log them to pool history. Reported by: Alexander Leidinger on current@ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.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_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Jul 2 19:44:02 2013 (r252524) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Jul 2 19:45:14 2013 (r252525) @@ -5575,6 +5575,13 @@ zfs_ioctl_init(void) zfs_ioctl_register_dataset_nolog(ZFS_IOC_TMP_SNAPSHOT, zfs_ioc_tmp_snapshot, zfs_secpolicy_tmp_snapshot, POOL_CHECK_SUSPENDED | POOL_CHECK_READONLY); + +#ifdef __FreeBSD__ + zfs_ioctl_register_dataset_nolog(ZFS_IOC_JAIL, zfs_ioc_jail, + zfs_secpolicy_config, POOL_CHECK_NONE); + zfs_ioctl_register_dataset_nolog(ZFS_IOC_UNJAIL, zfs_ioc_unjail, + zfs_secpolicy_config, POOL_CHECK_NONE); +#endif } int From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 03:36:37 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 13B8D9F8; Wed, 3 Jul 2013 03:36:37 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 064341927; Wed, 3 Jul 2013 03:36:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r633aaVD003513; Wed, 3 Jul 2013 03:36:36 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r633aaqt003512; Wed, 3 Jul 2013 03:36:36 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030336.r633aaqt003512@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 03:36: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: r252532 - 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.14 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, 03 Jul 2013 03:36:37 -0000 Author: lstewart Date: Wed Jul 3 03:36:36 2013 New Revision: 252532 URL: http://svnweb.freebsd.org/changeset/base/252532 Log: When a previous call to sbsndptr() leaves sb->sb_sndptroff at the start of an mbuf that was fully consumed by the previous call, the mbuf ptr returned by the current call ends up being the previous mbuf in the sb chain to the one that contains the data we want. This does not cause any observable issues because the mbuf copy routines happily walk the mbuf chain to get to the data at the moff offset, which in this case means they effectively skip over the mbuf returned by sbsndptr(). We can't adjust sb->sb_sndptr during the previous call for this case because the next mbuf in the chain may not exist yet. We therefore need to detect the condition and make the adjustment during the current call. Fix by detecting the special case of moff being at the start of the next mbuf in the chain and adjust the required accounting variables accordingly. Reviewed by: andre Modified: stable/9/sys/kern/uipc_sockbuf.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_sockbuf.c ============================================================================== --- stable/9/sys/kern/uipc_sockbuf.c Wed Jul 3 02:14:12 2013 (r252531) +++ stable/9/sys/kern/uipc_sockbuf.c Wed Jul 3 03:36:36 2013 (r252532) @@ -939,6 +939,13 @@ sbsndptr(struct sockbuf *sb, u_int off, /* Return closest mbuf in chain for current offset. */ *moff = off - sb->sb_sndptroff; m = ret = sb->sb_sndptr ? sb->sb_sndptr : sb->sb_mb; + if (*moff == m->m_len) { + *moff = 0; + sb->sb_sndptroff += m->m_len; + m = ret = m->m_next; + KASSERT(ret->m_len > 0, + ("mbuf %p in sockbuf %p chain has no valid data", ret, sb)); + } /* Advance by len to be as close as possible for the next transmit. */ for (off = off - sb->sb_sndptroff + len - 1; From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 03:40:06 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C8B0DC1E; Wed, 3 Jul 2013 03:40:06 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BBA5A1951; Wed, 3 Jul 2013 03:40:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r633e6nV005392; Wed, 3 Jul 2013 03:40:06 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r633e6RZ005391; Wed, 3 Jul 2013 03:40:06 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030340.r633e6RZ005391@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 03:40: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: r252533 - 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.14 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, 03 Jul 2013 03:40:06 -0000 Author: lstewart Date: Wed Jul 3 03:40:06 2013 New Revision: 252533 URL: http://svnweb.freebsd.org/changeset/base/252533 Log: When a previous call to sbsndptr() leaves sb->sb_sndptroff at the start of an mbuf that was fully consumed by the previous call, the mbuf ptr returned by the current call ends up being the previous mbuf in the sb chain to the one that contains the data we want. This does not cause any observable issues because the mbuf copy routines happily walk the mbuf chain to get to the data at the moff offset, which in this case means they effectively skip over the mbuf returned by sbsndptr(). We can't adjust sb->sb_sndptr during the previous call for this case because the next mbuf in the chain may not exist yet. We therefore need to detect the condition and make the adjustment during the current call. Fix by detecting the special case of moff being at the start of the next mbuf in the chain and adjust the required accounting variables accordingly. Reviewed by: andre Modified: stable/8/sys/kern/uipc_sockbuf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/uipc_sockbuf.c ============================================================================== --- stable/8/sys/kern/uipc_sockbuf.c Wed Jul 3 03:36:36 2013 (r252532) +++ stable/8/sys/kern/uipc_sockbuf.c Wed Jul 3 03:40:06 2013 (r252533) @@ -939,6 +939,13 @@ sbsndptr(struct sockbuf *sb, u_int off, /* Return closest mbuf in chain for current offset. */ *moff = off - sb->sb_sndptroff; m = ret = sb->sb_sndptr ? sb->sb_sndptr : sb->sb_mb; + if (*moff == m->m_len) { + *moff = 0; + sb->sb_sndptroff += m->m_len; + m = ret = m->m_next; + KASSERT(ret->m_len > 0, + ("mbuf %p in sockbuf %p chain has no valid data", ret, sb)); + } /* Advance by len to be as close as possible for the next transmit. */ for (off = off - sb->sb_sndptroff + len - 1; From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 04:20:37 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B5955613; Wed, 3 Jul 2013 04:20:37 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 976FE1AB7; Wed, 3 Jul 2013 04:20:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r634KbgF017320; Wed, 3 Jul 2013 04:20:37 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r634Kbpo017318; Wed, 3 Jul 2013 04:20:37 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030420.r634Kbpo017318@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 04:20: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: r252534 - in stable/9/sys: kern 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.14 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, 03 Jul 2013 04:20:37 -0000 Author: lstewart Date: Wed Jul 3 04:20:36 2013 New Revision: 252534 URL: http://svnweb.freebsd.org/changeset/base/252534 Log: MFC r251732,251752: Add support for non-virtualised hhook points, which are uniquely identified by type and id, as compared to virtualised hook points which are now uniquely identified by type, id and a vid (which for vimage is the pointer to the vnet that the hhook resides in). All hhook_head structs for both virtualised and non-virtualised hook points coexist in hhook_head_list, and a separate list is maintained for hhook points within each vnet to simplify some vimage-related housekeeping. Reviewed by: scottl Modified: stable/9/sys/kern/kern_hhook.c stable/9/sys/sys/hhook.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/kern/kern_hhook.c ============================================================================== --- stable/9/sys/kern/kern_hhook.c Wed Jul 3 03:40:06 2013 (r252533) +++ stable/9/sys/kern/kern_hhook.c Wed Jul 3 04:20:36 2013 (r252534) @@ -61,8 +61,9 @@ struct hhook { static MALLOC_DEFINE(M_HHOOK, "hhook", "Helper hooks are linked off hhook_head lists"); LIST_HEAD(hhookheadhead, hhook_head); -VNET_DEFINE(struct hhookheadhead, hhook_head_list); -#define V_hhook_head_list VNET(hhook_head_list) +struct hhookheadhead hhook_head_list; +VNET_DEFINE(struct hhookheadhead, hhook_vhead_list); +#define V_hhook_vhead_list VNET(hhook_vhead_list) static struct mtx hhook_head_list_lock; MTX_SYSINIT(hhookheadlistlock, &hhook_head_list_lock, "hhook_head list lock", @@ -245,13 +246,6 @@ hhook_head_register(int32_t hhook_type, return (EEXIST); } - /* XXXLAS: Need to implement support for non-virtualised hooks. */ - if ((flags & HHOOK_HEADISINVNET) == 0) { - printf("%s: only vnet-style virtualised hooks can be used\n", - __func__); - return (EINVAL); - } - tmphhh = malloc(sizeof(struct hhook_head), M_HHOOK, M_ZERO | ((flags & HHOOK_WAITOK) ? M_WAITOK : M_NOWAIT)); @@ -270,14 +264,17 @@ hhook_head_register(int32_t hhook_type, } else refcount_init(&tmphhh->hhh_refcount, 0); + HHHLIST_LOCK(); if (flags & HHOOK_HEADISINVNET) { tmphhh->hhh_flags |= HHH_ISINVNET; - HHHLIST_LOCK(); - LIST_INSERT_HEAD(&V_hhook_head_list, tmphhh, hhh_next); - HHHLIST_UNLOCK(); - } else { - /* XXXLAS: Add tmphhh to the non-virtualised list. */ +#ifdef VIMAGE + KASSERT(curvnet != NULL, ("curvnet is NULL")); + tmphhh->hhh_vid = (uintptr_t)curvnet; + LIST_INSERT_HEAD(&V_hhook_vhead_list, tmphhh, hhh_vnext); +#endif } + LIST_INSERT_HEAD(&hhook_head_list, tmphhh, hhh_next); + HHHLIST_UNLOCK(); return (0); } @@ -290,6 +287,10 @@ hhook_head_destroy(struct hhook_head *hh HHHLIST_LOCK_ASSERT(); LIST_REMOVE(hhh, hhh_next); +#ifdef VIMAGE + if (hhook_head_is_virtualised(hhh) == HHOOK_HEADISINVNET) + LIST_REMOVE(hhh, hhh_vnext); +#endif HHH_WLOCK(hhh); STAILQ_FOREACH_SAFE(tmp, &hhh->hhh_hooks, hhk_next, tmp2) free(tmp, M_HHOOK); @@ -347,10 +348,17 @@ hhook_head_get(int32_t hhook_type, int32 { struct hhook_head *hhh; - /* XXXLAS: Pick hhook_head_list based on hhook_head flags. */ HHHLIST_LOCK(); - LIST_FOREACH(hhh, &V_hhook_head_list, hhh_next) { + LIST_FOREACH(hhh, &hhook_head_list, hhh_next) { if (hhh->hhh_type == hhook_type && hhh->hhh_id == hhook_id) { +#ifdef VIMAGE + if (hhook_head_is_virtualised(hhh) == + HHOOK_HEADISINVNET) { + KASSERT(curvnet != NULL, ("curvnet is NULL")); + if (hhh->hhh_vid != (uintptr_t)curvnet) + continue; + } +#endif refcount_acquire(&hhh->hhh_refcount); break; } @@ -412,7 +420,7 @@ static void hhook_vnet_init(const void *unused __unused) { - LIST_INIT(&V_hhook_head_list); + LIST_INIT(&V_hhook_vhead_list); } /* @@ -429,7 +437,7 @@ hhook_vnet_uninit(const void *unused __u * subsystem should have already called hhook_head_deregister(). */ HHHLIST_LOCK(); - LIST_FOREACH_SAFE(hhh, &V_hhook_head_list, hhh_next, tmphhh) { + LIST_FOREACH_SAFE(hhh, &V_hhook_vhead_list, hhh_vnext, tmphhh) { printf("%s: hhook_head type=%d, id=%d cleanup required\n", __func__, hhh->hhh_type, hhh->hhh_id); hhook_head_destroy(hhh); @@ -439,7 +447,7 @@ hhook_vnet_uninit(const void *unused __u /* - * When a vnet is created and being initialised, init the V_hhook_head_list. + * When a vnet is created and being initialised, init the V_hhook_vhead_list. */ VNET_SYSINIT(hhook_vnet_init, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, hhook_vnet_init, NULL); Modified: stable/9/sys/sys/hhook.h ============================================================================== --- stable/9/sys/sys/hhook.h Wed Jul 3 03:40:06 2013 (r252533) +++ stable/9/sys/sys/hhook.h Wed Jul 3 04:20:36 2013 (r252534) @@ -91,12 +91,14 @@ struct hookinfo { struct hhook_head { STAILQ_HEAD(hhook_list, hhook) hhh_hooks; struct rmlock hhh_lock; + uintptr_t hhh_vid; int32_t hhh_id; int32_t hhh_nhooks; int32_t hhh_type; uint32_t hhh_flags; volatile uint32_t hhh_refcount; LIST_ENTRY(hhook_head) hhh_next; + LIST_ENTRY(hhook_head) hhh_vnext; }; /* Public KPI functions. */ From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 04:21:29 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E0906743; Wed, 3 Jul 2013 04:21:29 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C364B1ABF; Wed, 3 Jul 2013 04:21:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r634LTph017475; Wed, 3 Jul 2013 04:21:29 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r634LTgT017472; Wed, 3 Jul 2013 04:21:29 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030421.r634LTgT017472@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 04:21:29 +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: r252535 - in stable/8/sys: kern 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.14 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, 03 Jul 2013 04:21:30 -0000 Author: lstewart Date: Wed Jul 3 04:21:29 2013 New Revision: 252535 URL: http://svnweb.freebsd.org/changeset/base/252535 Log: MFC r251732,251752: Add support for non-virtualised hhook points, which are uniquely identified by type and id, as compared to virtualised hook points which are now uniquely identified by type, id and a vid (which for vimage is the pointer to the vnet that the hhook resides in). All hhook_head structs for both virtualised and non-virtualised hook points coexist in hhook_head_list, and a separate list is maintained for hhook points within each vnet to simplify some vimage-related housekeeping. Reviewed by: scottl Modified: stable/8/sys/kern/kern_hhook.c stable/8/sys/sys/hhook.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sys/kern/kern_hhook.c ============================================================================== --- stable/8/sys/kern/kern_hhook.c Wed Jul 3 04:20:36 2013 (r252534) +++ stable/8/sys/kern/kern_hhook.c Wed Jul 3 04:21:29 2013 (r252535) @@ -61,8 +61,9 @@ struct hhook { static MALLOC_DEFINE(M_HHOOK, "hhook", "Helper hooks are linked off hhook_head lists"); LIST_HEAD(hhookheadhead, hhook_head); -VNET_DEFINE(struct hhookheadhead, hhook_head_list); -#define V_hhook_head_list VNET(hhook_head_list) +struct hhookheadhead hhook_head_list; +VNET_DEFINE(struct hhookheadhead, hhook_vhead_list); +#define V_hhook_vhead_list VNET(hhook_vhead_list) static struct mtx hhook_head_list_lock; MTX_SYSINIT(hhookheadlistlock, &hhook_head_list_lock, "hhook_head list lock", @@ -245,13 +246,6 @@ hhook_head_register(int32_t hhook_type, return (EEXIST); } - /* XXXLAS: Need to implement support for non-virtualised hooks. */ - if ((flags & HHOOK_HEADISINVNET) == 0) { - printf("%s: only vnet-style virtualised hooks can be used\n", - __func__); - return (EINVAL); - } - tmphhh = malloc(sizeof(struct hhook_head), M_HHOOK, M_ZERO | ((flags & HHOOK_WAITOK) ? M_WAITOK : M_NOWAIT)); @@ -270,14 +264,17 @@ hhook_head_register(int32_t hhook_type, } else refcount_init(&tmphhh->hhh_refcount, 0); + HHHLIST_LOCK(); if (flags & HHOOK_HEADISINVNET) { tmphhh->hhh_flags |= HHH_ISINVNET; - HHHLIST_LOCK(); - LIST_INSERT_HEAD(&V_hhook_head_list, tmphhh, hhh_next); - HHHLIST_UNLOCK(); - } else { - /* XXXLAS: Add tmphhh to the non-virtualised list. */ +#ifdef VIMAGE + KASSERT(curvnet != NULL, ("curvnet is NULL")); + tmphhh->hhh_vid = (uintptr_t)curvnet; + LIST_INSERT_HEAD(&V_hhook_vhead_list, tmphhh, hhh_vnext); +#endif } + LIST_INSERT_HEAD(&hhook_head_list, tmphhh, hhh_next); + HHHLIST_UNLOCK(); return (0); } @@ -290,6 +287,10 @@ hhook_head_destroy(struct hhook_head *hh HHHLIST_LOCK_ASSERT(); LIST_REMOVE(hhh, hhh_next); +#ifdef VIMAGE + if (hhook_head_is_virtualised(hhh) == HHOOK_HEADISINVNET) + LIST_REMOVE(hhh, hhh_vnext); +#endif HHH_WLOCK(hhh); STAILQ_FOREACH_SAFE(tmp, &hhh->hhh_hooks, hhk_next, tmp2) free(tmp, M_HHOOK); @@ -347,10 +348,17 @@ hhook_head_get(int32_t hhook_type, int32 { struct hhook_head *hhh; - /* XXXLAS: Pick hhook_head_list based on hhook_head flags. */ HHHLIST_LOCK(); - LIST_FOREACH(hhh, &V_hhook_head_list, hhh_next) { + LIST_FOREACH(hhh, &hhook_head_list, hhh_next) { if (hhh->hhh_type == hhook_type && hhh->hhh_id == hhook_id) { +#ifdef VIMAGE + if (hhook_head_is_virtualised(hhh) == + HHOOK_HEADISINVNET) { + KASSERT(curvnet != NULL, ("curvnet is NULL")); + if (hhh->hhh_vid != (uintptr_t)curvnet) + continue; + } +#endif refcount_acquire(&hhh->hhh_refcount); break; } @@ -412,7 +420,7 @@ static void hhook_vnet_init(const void *unused __unused) { - LIST_INIT(&V_hhook_head_list); + LIST_INIT(&V_hhook_vhead_list); } /* @@ -429,7 +437,7 @@ hhook_vnet_uninit(const void *unused __u * subsystem should have already called hhook_head_deregister(). */ HHHLIST_LOCK(); - LIST_FOREACH_SAFE(hhh, &V_hhook_head_list, hhh_next, tmphhh) { + LIST_FOREACH_SAFE(hhh, &V_hhook_vhead_list, hhh_vnext, tmphhh) { printf("%s: hhook_head type=%d, id=%d cleanup required\n", __func__, hhh->hhh_type, hhh->hhh_id); hhook_head_destroy(hhh); @@ -439,7 +447,7 @@ hhook_vnet_uninit(const void *unused __u /* - * When a vnet is created and being initialised, init the V_hhook_head_list. + * When a vnet is created and being initialised, init the V_hhook_vhead_list. */ VNET_SYSINIT(hhook_vnet_init, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, hhook_vnet_init, NULL); Modified: stable/8/sys/sys/hhook.h ============================================================================== --- stable/8/sys/sys/hhook.h Wed Jul 3 04:20:36 2013 (r252534) +++ stable/8/sys/sys/hhook.h Wed Jul 3 04:21:29 2013 (r252535) @@ -91,12 +91,14 @@ struct hookinfo { struct hhook_head { STAILQ_HEAD(hhook_list, hhook) hhh_hooks; struct rmlock hhh_lock; + uintptr_t hhh_vid; int32_t hhh_id; int32_t hhh_nhooks; int32_t hhh_type; uint32_t hhh_flags; volatile uint32_t hhh_refcount; LIST_ENTRY(hhook_head) hhh_next; + LIST_ENTRY(hhook_head) hhh_vnext; }; /* Public KPI functions. */ From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 04:25:01 2013 Return-Path: Delivered-To: svn-src-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 075FF88C; Wed, 3 Jul 2013 04:25:01 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 856C61AD5; Wed, 3 Jul 2013 04:24:54 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id 589E27E84A; Wed, 3 Jul 2013 14:24:46 +1000 (EST) Message-ID: <51D3A78E.4070701@freebsd.org> Date: Wed, 03 Jul 2013 14:24:46 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130521 Thunderbird/17.0.6 MIME-Version: 1.0 To: src-committers@FreeBSD.org Subject: Re: svn commit: r252532 - stable/9/sys/kern References: <201307030336.r633aaqt003512@svn.freebsd.org> In-Reply-To: <201307030336.r633aaqt003512@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net 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.14 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, 03 Jul 2013 04:25:01 -0000 On 07/03/13 13:36, Lawrence Stewart wrote: > Author: lstewart > Date: Wed Jul 3 03:36:36 2013 > New Revision: 252532 > URL: http://svnweb.freebsd.org/changeset/base/252532 > > Log: MFC r251984: > When a previous call to sbsndptr() leaves sb->sb_sndptroff at the start of an > mbuf that was fully consumed by the previous call, the mbuf ptr returned by the > current call ends up being the previous mbuf in the sb chain to the one that > contains the data we want. > > This does not cause any observable issues because the mbuf copy routines happily > walk the mbuf chain to get to the data at the moff offset, which in this case > means they effectively skip over the mbuf returned by sbsndptr(). > > We can't adjust sb->sb_sndptr during the previous call for this case because the > next mbuf in the chain may not exist yet. We therefore need to detect the > condition and make the adjustment during the current call. > > Fix by detecting the special case of moff being at the start of the next mbuf in > the chain and adjust the required accounting variables accordingly. > > Reviewed by: andre From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 04:26:06 2013 Return-Path: Delivered-To: svn-src-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BD0609FC; Wed, 3 Jul 2013 04:26:06 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 84F8A1AE1; Wed, 3 Jul 2013 04:26:03 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id 224A67E84A; Wed, 3 Jul 2013 14:26:02 +1000 (EST) Message-ID: <51D3A7D9.8030200@freebsd.org> Date: Wed, 03 Jul 2013 14:26:01 +1000 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130521 Thunderbird/17.0.6 MIME-Version: 1.0 To: src-committers@FreeBSD.org Subject: Re: svn commit: r252533 - stable/8/sys/kern References: <201307030340.r633e6RZ005391@svn.freebsd.org> In-Reply-To: <201307030340.r633e6RZ005391@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on lauren.room52.net Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-stable-8@FreeBSD.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Jul 2013 04:26:06 -0000 On 07/03/13 13:40, Lawrence Stewart wrote: > Author: lstewart > Date: Wed Jul 3 03:40:06 2013 > New Revision: 252533 > URL: http://svnweb.freebsd.org/changeset/base/252533 > > Log: MFC r251984: > When a previous call to sbsndptr() leaves sb->sb_sndptroff at the start of an > mbuf that was fully consumed by the previous call, the mbuf ptr returned by the > current call ends up being the previous mbuf in the sb chain to the one that > contains the data we want. > > This does not cause any observable issues because the mbuf copy routines happily > walk the mbuf chain to get to the data at the moff offset, which in this case > means they effectively skip over the mbuf returned by sbsndptr(). > > We can't adjust sb->sb_sndptr during the previous call for this case because the > next mbuf in the chain may not exist yet. We therefore need to detect the > condition and make the adjustment during the current call. > > Fix by detecting the special case of moff being at the start of the next mbuf in > the chain and adjust the required accounting variables accordingly. > > Reviewed by: andre From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 05:22:43 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E861713E; Wed, 3 Jul 2013 05:22:43 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id B77B51D58; Wed, 3 Jul 2013 05:22:43 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id r635Mbg2066446; Tue, 2 Jul 2013 23:22:37 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id r635Ma5w066445; Tue, 2 Jul 2013 23:22:36 -0600 (MDT) (envelope-from ken) Date: Tue, 2 Jul 2013 23:22:36 -0600 From: "Kenneth D. Merry" To: Andre Albsmeier Subject: Re: svn commit: r252214 - in stable/9: bin/chio sys/cam/scsi sys/sys Message-ID: <20130703052236.GA65730@nargothrond.kdm.org> References: <201306252143.r5PLhoM0064338@svn.freebsd.org> <20130702055333.GA2729@bali> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130702055333.GA2729@bali> User-Agent: Mutt/1.4.2i Cc: "src-committers@freebsd.org" , asomers@freebsd.org, "svn-src-stable@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable-9@freebsd.org" , gibbs@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Jul 2013 05:22:44 -0000 On Tue, Jul 02, 2013 at 07:53:33 +0200, Andre Albsmeier wrote: > On Tue, 25-Jun-2013 at 23:43:50 +0200, Kenneth D. Merry wrote: > > Author: ken > > Date: Tue Jun 25 21:43:49 2013 > > New Revision: 252214 > > URL: http://svnweb.freebsd.org/changeset/base/252214 > > Hi Ken, > > > Log: > > MFC: 249658, 249701 > > > > Update chio(1) and ch(4) to support reporting element designators. > > > > This allows mapping a tape drive in a changer (as reported by > > 'chio status') to a sa(4) driver instance by comparing the > > serial numbers. > > > > The designators can be ASCII (which is printed out directly), binary > > (which is printed in hex format) or UTF-8, which is printed in either > > native UTF-8 format if the terminal can support it, or in %XX notation > > for non-ASCII characters. Thanks to Hiroki Sato for the > > explanation and example UTF-8 printing code. > > > > chio.h: Modify the changer_element_status structure to add new > > fields and definitions from the SMC3r16 spec. > > > > Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and > > define a new CHIOGSTATUS ioctl. > > > > Clean up some tab/space issues. > > > > chio.c: For the 'status' subcommand, print the designator field > > if it is supplied by a device. > > > > scsi_ch.h: Add new flags for DVCID and CURDATA to the READ > > ELEMENT STATUS command structure. > > > > Add a read_element_status_device_id structure > > for the data fields in the new standard. Add new > > unions, dt_or_obsolete and voltage_devid, to hold > > and address data from either SCSI-2 or newer devices. > > > > scsi_ch.c: Implement support for fetching device IDs with READ > > ELEMENT STATUS data. > > > > Add new arguments to scsi_read_element_status() to > > allow the user to request the DVCID and CURDATA bits. > > This broke "chio status" when talking to my QUALSTAR TLS-8211 library: > > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): READ ELEMENT STATUS. CDB: b8 10 fd e8 00 01 03 00 04 00 00 00 > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): CAM status: SCSI Status Error > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): SCSI status: Check Condition > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB) > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): Command byte 6 is invalid > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): Error 22, Unretryable error > > scsi_cmd->flags (Byte 6) must be zero for this library so I had to use > this workaround to make it work again until a better solution is available: > > --- sys/cam/scsi/scsi_ch.c.ORI 2013-06-26 13:38:54.000000000 +0200 > +++ sys/cam/scsi/scsi_ch.c 2013-07-02 07:42:24.000000000 +0200 > @@ -1245,8 +1245,8 @@ > /* tag_action */ MSG_SIMPLE_Q_TAG, > /* voltag */ want_voltags, > /* sea */ softc->sc_firsts[chet], > - /* dvcid */ 1, > - /* curdata */ 1, > + /* dvcid */ 0, > + /* curdata */ 0, > /* count */ 1, > /* data_ptr */ data, > /* dxfer_len */ 1024, > @@ -1284,8 +1284,8 @@ > /* voltag */ want_voltags, > /* sea */ softc->sc_firsts[chet] > + cesr->cesr_element_base, > - /* dvcid */ 1, > - /* curdata */ 1, > + /* dvcid */ 0, > + /* curdata */ 0, > /* count */ cesr->cesr_element_count, > /* data_ptr */ data, > /* dxfer_len */ size, > > -Andre Oops, sorry. We need to check the SCSI version to see whether to set those bits, and also fall back in case it doesn't work. I am on vacation and have very spotty net access. I can't do anything about it until I get back next week. Justin and Alan (CCed) can work on the fix, though. Ken -- Kenneth Merry ken@FreeBSD.ORG From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 05:28:23 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 560FB794; Wed, 3 Jul 2013 05:28:23 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 380201DD1; Wed, 3 Jul 2013 05:28:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r635SNsN035558; Wed, 3 Jul 2013 05:28:23 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r635SMuq035555; Wed, 3 Jul 2013 05:28:22 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030528.r635SMuq035555@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 05:28: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: r252536 - in stable/9/sys: kern 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.14 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, 03 Jul 2013 05:28:23 -0000 Author: lstewart Date: Wed Jul 3 05:28:22 2013 New Revision: 252536 URL: http://svnweb.freebsd.org/changeset/base/252536 Log: MFC r251770: Internalise handling of virtualised hook points inside hhook_{add|remove}_hook_lookup() so that khelp (and other potential API consumers) do not have to care when they attempt to (un)hook a particular hook point identified by id and type. Reviewed by: scottl Modified: stable/9/sys/kern/kern_hhook.c stable/9/sys/kern/kern_khelp.c stable/9/sys/sys/hhook.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/kern/kern_hhook.c ============================================================================== --- stable/9/sys/kern/kern_hhook.c Wed Jul 3 04:21:29 2013 (r252535) +++ stable/9/sys/kern/kern_hhook.c Wed Jul 3 05:28:22 2013 (r252536) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Lawrence Stewart + * Copyright (c) 2010,2013 Lawrence Stewart * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * @@ -69,6 +69,9 @@ static struct mtx hhook_head_list_lock; MTX_SYSINIT(hhookheadlistlock, &hhook_head_list_lock, "hhook_head list lock", MTX_DEF); +/* Protected by hhook_head_list_lock. */ +static uint32_t n_hhookheads; + /* Private function prototypes. */ static void hhook_head_destroy(struct hhook_head *hhh); @@ -165,21 +168,71 @@ hhook_add_hook(struct hhook_head *hhh, s } /* - * Lookup a helper hook point and register a new helper hook function with it. + * Register a helper hook function with a helper hook point (including all + * virtual instances of the hook point if it is virtualised). + * + * The logic is unfortunately far more complex than for + * hhook_remove_hook_lookup() because hhook_add_hook() can call malloc() with + * M_WAITOK and thus we cannot call hhook_add_hook() with the + * hhook_head_list_lock held. + * + * The logic assembles an array of hhook_head structs that correspond to the + * helper hook point being hooked and bumps the refcount on each (all done with + * the hhook_head_list_lock held). The hhook_head_list_lock is then dropped, and + * hhook_add_hook() is called and the refcount dropped for each hhook_head + * struct in the array. */ int hhook_add_hook_lookup(struct hookinfo *hki, uint32_t flags) { - struct hhook_head *hhh; - int error; + struct hhook_head **heads_to_hook, *hhh; + int error, i, n_heads_to_hook; - hhh = hhook_head_get(hki->hook_type, hki->hook_id); +tryagain: + error = i = 0; + /* + * Accessing n_hhookheads without hhook_head_list_lock held opens up a + * race with hhook_head_register() which we are unlikely to lose, but + * nonetheless have to cope with - hence the complex goto logic. + */ + n_heads_to_hook = n_hhookheads; + heads_to_hook = malloc(n_heads_to_hook * sizeof(struct hhook_head *), + M_HHOOK, flags & HHOOK_WAITOK ? M_WAITOK : M_NOWAIT); + if (heads_to_hook == NULL) + return (ENOMEM); - if (hhh == NULL) - return (ENOENT); + HHHLIST_LOCK(); + LIST_FOREACH(hhh, &hhook_head_list, hhh_next) { + if (hhh->hhh_type == hki->hook_type && + hhh->hhh_id == hki->hook_id) { + if (i < n_heads_to_hook) { + heads_to_hook[i] = hhh; + refcount_acquire(&heads_to_hook[i]->hhh_refcount); + i++; + } else { + /* + * We raced with hhook_head_register() which + * inserted a hhook_head that we need to hook + * but did not malloc space for. Abort this run + * and try again. + */ + for (i--; i >= 0; i--) + refcount_release(&heads_to_hook[i]->hhh_refcount); + free(heads_to_hook, M_HHOOK); + HHHLIST_UNLOCK(); + goto tryagain; + } + } + } + HHHLIST_UNLOCK(); - error = hhook_add_hook(hhh, hki, flags); - hhook_head_release(hhh); + for (i--; i >= 0; i--) { + if (!error) + error = hhook_add_hook(heads_to_hook[i], hki, flags); + refcount_release(&heads_to_hook[i]->hhh_refcount); + } + + free(heads_to_hook, M_HHOOK); return (error); } @@ -211,20 +264,21 @@ hhook_remove_hook(struct hhook_head *hhh } /* - * Lookup a helper hook point and remove a helper hook function from it. + * Remove a helper hook function from a helper hook point (including all + * virtual instances of the hook point if it is virtualised). */ int hhook_remove_hook_lookup(struct hookinfo *hki) { struct hhook_head *hhh; - hhh = hhook_head_get(hki->hook_type, hki->hook_id); - - if (hhh == NULL) - return (ENOENT); - - hhook_remove_hook(hhh, hki); - hhook_head_release(hhh); + HHHLIST_LOCK(); + LIST_FOREACH(hhh, &hhook_head_list, hhh_next) { + if (hhh->hhh_type == hki->hook_type && + hhh->hhh_id == hki->hook_id) + hhook_remove_hook(hhh, hki); + } + HHHLIST_UNLOCK(); return (0); } @@ -274,6 +328,7 @@ hhook_head_register(int32_t hhook_type, #endif } LIST_INSERT_HEAD(&hhook_head_list, tmphhh, hhh_next); + n_hhookheads++; HHHLIST_UNLOCK(); return (0); @@ -285,6 +340,7 @@ hhook_head_destroy(struct hhook_head *hh struct hhook *tmp, *tmp2; HHHLIST_LOCK_ASSERT(); + KASSERT(n_hhookheads > 0, ("n_hhookheads should be > 0")); LIST_REMOVE(hhh, hhh_next); #ifdef VIMAGE @@ -297,6 +353,7 @@ hhook_head_destroy(struct hhook_head *hh HHH_WUNLOCK(hhh); HHH_LOCK_DESTROY(hhh); free(hhh, M_HHOOK); + n_hhookheads--; } /* Modified: stable/9/sys/kern/kern_khelp.c ============================================================================== --- stable/9/sys/kern/kern_khelp.c Wed Jul 3 04:21:29 2013 (r252535) +++ stable/9/sys/kern/kern_khelp.c Wed Jul 3 05:28:22 2013 (r252536) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Lawrence Stewart + * Copyright (c) 2010,2013 Lawrence Stewart * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * @@ -84,12 +84,13 @@ khelp_register_helper(struct helper *h) for (i = 0; i < h->h_nhooks && !error; i++) { /* We don't require the module to assign hook_helper. */ h->h_hooks[i].hook_helper = h; - error = khelp_add_hhook(&h->h_hooks[i], HHOOK_NOWAIT); + error = hhook_add_hook_lookup(&h->h_hooks[i], + HHOOK_WAITOK); } if (error) { for (i--; i >= 0; i--) - khelp_remove_hhook(&h->h_hooks[i]); + hhook_remove_hook_lookup(&h->h_hooks[i]); osd_deregister(OSD_KHELP, h->h_id); } @@ -144,7 +145,7 @@ khelp_deregister_helper(struct helper *h if (!error) { if (h->h_nhooks > 0) { for (i = 0; i < h->h_nhooks; i++) - khelp_remove_hhook(&h->h_hooks[i]); + hhook_remove_hook_lookup(&h->h_hooks[i]); } osd_deregister(OSD_KHELP, h->h_id); } @@ -263,28 +264,13 @@ khelp_get_id(char *hname) int khelp_add_hhook(struct hookinfo *hki, uint32_t flags) { - VNET_ITERATOR_DECL(vnet_iter); int error; - error = 0; - /* - * XXXLAS: If a helper is dynamically adding a helper hook function at - * runtime using this function, we should update the helper's h_hooks - * struct member to include the additional hookinfo struct. + * XXXLAS: Should probably include the functionality to update the + * helper's h_hooks struct member. */ - - VNET_LIST_RLOCK_NOSLEEP(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - error = hhook_add_hook_lookup(hki, flags); - CURVNET_RESTORE(); -#ifdef VIMAGE - if (error) - break; -#endif - } - VNET_LIST_RUNLOCK_NOSLEEP(); + error = hhook_add_hook_lookup(hki, flags); return (error); } @@ -292,28 +278,13 @@ khelp_add_hhook(struct hookinfo *hki, ui int khelp_remove_hhook(struct hookinfo *hki) { - VNET_ITERATOR_DECL(vnet_iter); int error; - error = 0; - /* - * XXXLAS: If a helper is dynamically removing a helper hook function at - * runtime using this function, we should update the helper's h_hooks - * struct member to remove the defunct hookinfo struct. + * XXXLAS: Should probably include the functionality to update the + * helper's h_hooks struct member. */ - - VNET_LIST_RLOCK_NOSLEEP(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - error = hhook_remove_hook_lookup(hki); - CURVNET_RESTORE(); -#ifdef VIMAGE - if (error) - break; -#endif - } - VNET_LIST_RUNLOCK_NOSLEEP(); + error = hhook_remove_hook_lookup(hki); return (error); } Modified: stable/9/sys/sys/hhook.h ============================================================================== --- stable/9/sys/sys/hhook.h Wed Jul 3 04:21:29 2013 (r252535) +++ stable/9/sys/sys/hhook.h Wed Jul 3 05:28:22 2013 (r252536) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Lawrence Stewart + * Copyright (c) 2010,2013 Lawrence Stewart * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 05:29:22 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 95A018C0; Wed, 3 Jul 2013 05:29:22 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 78A071DD6; Wed, 3 Jul 2013 05:29:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r635TMH1035709; Wed, 3 Jul 2013 05:29:22 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r635TLje035704; Wed, 3 Jul 2013 05:29:21 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030529.r635TLje035704@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 05:29:21 +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: r252537 - in stable/8/sys: kern 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.14 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, 03 Jul 2013 05:29:22 -0000 Author: lstewart Date: Wed Jul 3 05:29:21 2013 New Revision: 252537 URL: http://svnweb.freebsd.org/changeset/base/252537 Log: MFC r251770: Internalise handling of virtualised hook points inside hhook_{add|remove}_hook_lookup() so that khelp (and other potential API consumers) do not have to care when they attempt to (un)hook a particular hook point identified by id and type. Reviewed by: scottl Modified: stable/8/sys/kern/kern_hhook.c stable/8/sys/kern/kern_khelp.c stable/8/sys/sys/hhook.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sys/kern/kern_hhook.c ============================================================================== --- stable/8/sys/kern/kern_hhook.c Wed Jul 3 05:28:22 2013 (r252536) +++ stable/8/sys/kern/kern_hhook.c Wed Jul 3 05:29:21 2013 (r252537) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Lawrence Stewart + * Copyright (c) 2010,2013 Lawrence Stewart * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * @@ -69,6 +69,9 @@ static struct mtx hhook_head_list_lock; MTX_SYSINIT(hhookheadlistlock, &hhook_head_list_lock, "hhook_head list lock", MTX_DEF); +/* Protected by hhook_head_list_lock. */ +static uint32_t n_hhookheads; + /* Private function prototypes. */ static void hhook_head_destroy(struct hhook_head *hhh); @@ -165,21 +168,71 @@ hhook_add_hook(struct hhook_head *hhh, s } /* - * Lookup a helper hook point and register a new helper hook function with it. + * Register a helper hook function with a helper hook point (including all + * virtual instances of the hook point if it is virtualised). + * + * The logic is unfortunately far more complex than for + * hhook_remove_hook_lookup() because hhook_add_hook() can call malloc() with + * M_WAITOK and thus we cannot call hhook_add_hook() with the + * hhook_head_list_lock held. + * + * The logic assembles an array of hhook_head structs that correspond to the + * helper hook point being hooked and bumps the refcount on each (all done with + * the hhook_head_list_lock held). The hhook_head_list_lock is then dropped, and + * hhook_add_hook() is called and the refcount dropped for each hhook_head + * struct in the array. */ int hhook_add_hook_lookup(struct hookinfo *hki, uint32_t flags) { - struct hhook_head *hhh; - int error; + struct hhook_head **heads_to_hook, *hhh; + int error, i, n_heads_to_hook; - hhh = hhook_head_get(hki->hook_type, hki->hook_id); +tryagain: + error = i = 0; + /* + * Accessing n_hhookheads without hhook_head_list_lock held opens up a + * race with hhook_head_register() which we are unlikely to lose, but + * nonetheless have to cope with - hence the complex goto logic. + */ + n_heads_to_hook = n_hhookheads; + heads_to_hook = malloc(n_heads_to_hook * sizeof(struct hhook_head *), + M_HHOOK, flags & HHOOK_WAITOK ? M_WAITOK : M_NOWAIT); + if (heads_to_hook == NULL) + return (ENOMEM); - if (hhh == NULL) - return (ENOENT); + HHHLIST_LOCK(); + LIST_FOREACH(hhh, &hhook_head_list, hhh_next) { + if (hhh->hhh_type == hki->hook_type && + hhh->hhh_id == hki->hook_id) { + if (i < n_heads_to_hook) { + heads_to_hook[i] = hhh; + refcount_acquire(&heads_to_hook[i]->hhh_refcount); + i++; + } else { + /* + * We raced with hhook_head_register() which + * inserted a hhook_head that we need to hook + * but did not malloc space for. Abort this run + * and try again. + */ + for (i--; i >= 0; i--) + refcount_release(&heads_to_hook[i]->hhh_refcount); + free(heads_to_hook, M_HHOOK); + HHHLIST_UNLOCK(); + goto tryagain; + } + } + } + HHHLIST_UNLOCK(); - error = hhook_add_hook(hhh, hki, flags); - hhook_head_release(hhh); + for (i--; i >= 0; i--) { + if (!error) + error = hhook_add_hook(heads_to_hook[i], hki, flags); + refcount_release(&heads_to_hook[i]->hhh_refcount); + } + + free(heads_to_hook, M_HHOOK); return (error); } @@ -211,20 +264,21 @@ hhook_remove_hook(struct hhook_head *hhh } /* - * Lookup a helper hook point and remove a helper hook function from it. + * Remove a helper hook function from a helper hook point (including all + * virtual instances of the hook point if it is virtualised). */ int hhook_remove_hook_lookup(struct hookinfo *hki) { struct hhook_head *hhh; - hhh = hhook_head_get(hki->hook_type, hki->hook_id); - - if (hhh == NULL) - return (ENOENT); - - hhook_remove_hook(hhh, hki); - hhook_head_release(hhh); + HHHLIST_LOCK(); + LIST_FOREACH(hhh, &hhook_head_list, hhh_next) { + if (hhh->hhh_type == hki->hook_type && + hhh->hhh_id == hki->hook_id) + hhook_remove_hook(hhh, hki); + } + HHHLIST_UNLOCK(); return (0); } @@ -274,6 +328,7 @@ hhook_head_register(int32_t hhook_type, #endif } LIST_INSERT_HEAD(&hhook_head_list, tmphhh, hhh_next); + n_hhookheads++; HHHLIST_UNLOCK(); return (0); @@ -285,6 +340,7 @@ hhook_head_destroy(struct hhook_head *hh struct hhook *tmp, *tmp2; HHHLIST_LOCK_ASSERT(); + KASSERT(n_hhookheads > 0, ("n_hhookheads should be > 0")); LIST_REMOVE(hhh, hhh_next); #ifdef VIMAGE @@ -297,6 +353,7 @@ hhook_head_destroy(struct hhook_head *hh HHH_WUNLOCK(hhh); HHH_LOCK_DESTROY(hhh); free(hhh, M_HHOOK); + n_hhookheads--; } /* Modified: stable/8/sys/kern/kern_khelp.c ============================================================================== --- stable/8/sys/kern/kern_khelp.c Wed Jul 3 05:28:22 2013 (r252536) +++ stable/8/sys/kern/kern_khelp.c Wed Jul 3 05:29:21 2013 (r252537) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Lawrence Stewart + * Copyright (c) 2010,2013 Lawrence Stewart * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * @@ -84,12 +84,13 @@ khelp_register_helper(struct helper *h) for (i = 0; i < h->h_nhooks && !error; i++) { /* We don't require the module to assign hook_helper. */ h->h_hooks[i].hook_helper = h; - error = khelp_add_hhook(&h->h_hooks[i], HHOOK_NOWAIT); + error = hhook_add_hook_lookup(&h->h_hooks[i], + HHOOK_WAITOK); } if (error) { for (i--; i >= 0; i--) - khelp_remove_hhook(&h->h_hooks[i]); + hhook_remove_hook_lookup(&h->h_hooks[i]); osd_deregister(OSD_KHELP, h->h_id); } @@ -144,7 +145,7 @@ khelp_deregister_helper(struct helper *h if (!error) { if (h->h_nhooks > 0) { for (i = 0; i < h->h_nhooks; i++) - khelp_remove_hhook(&h->h_hooks[i]); + hhook_remove_hook_lookup(&h->h_hooks[i]); } osd_deregister(OSD_KHELP, h->h_id); } @@ -263,28 +264,13 @@ khelp_get_id(char *hname) int khelp_add_hhook(struct hookinfo *hki, uint32_t flags) { - VNET_ITERATOR_DECL(vnet_iter); int error; - error = 0; - /* - * XXXLAS: If a helper is dynamically adding a helper hook function at - * runtime using this function, we should update the helper's h_hooks - * struct member to include the additional hookinfo struct. + * XXXLAS: Should probably include the functionality to update the + * helper's h_hooks struct member. */ - - VNET_LIST_RLOCK_NOSLEEP(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - error = hhook_add_hook_lookup(hki, flags); - CURVNET_RESTORE(); -#ifdef VIMAGE - if (error) - break; -#endif - } - VNET_LIST_RUNLOCK_NOSLEEP(); + error = hhook_add_hook_lookup(hki, flags); return (error); } @@ -292,28 +278,13 @@ khelp_add_hhook(struct hookinfo *hki, ui int khelp_remove_hhook(struct hookinfo *hki) { - VNET_ITERATOR_DECL(vnet_iter); int error; - error = 0; - /* - * XXXLAS: If a helper is dynamically removing a helper hook function at - * runtime using this function, we should update the helper's h_hooks - * struct member to remove the defunct hookinfo struct. + * XXXLAS: Should probably include the functionality to update the + * helper's h_hooks struct member. */ - - VNET_LIST_RLOCK_NOSLEEP(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - error = hhook_remove_hook_lookup(hki); - CURVNET_RESTORE(); -#ifdef VIMAGE - if (error) - break; -#endif - } - VNET_LIST_RUNLOCK_NOSLEEP(); + error = hhook_remove_hook_lookup(hki); return (error); } Modified: stable/8/sys/sys/hhook.h ============================================================================== --- stable/8/sys/sys/hhook.h Wed Jul 3 05:28:22 2013 (r252536) +++ stable/8/sys/sys/hhook.h Wed Jul 3 05:29:21 2013 (r252537) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Lawrence Stewart + * Copyright (c) 2010,2013 Lawrence Stewart * Copyright (c) 2010 The FreeBSD Foundation * All rights reserved. * From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 05:43:58 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0A228A68; Wed, 3 Jul 2013 05:43:58 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from goliath.siemens.de (goliath.siemens.de [192.35.17.28]) by mx1.freebsd.org (Postfix) with ESMTP id 9004B1E1E; Wed, 3 Jul 2013 05:43:56 +0000 (UTC) Received: from mail2.siemens.de (localhost [127.0.0.1]) by goliath.siemens.de (8.13.6/8.13.6) with ESMTP id r635ho8g013734; Wed, 3 Jul 2013 07:43:50 +0200 Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130]) by mail2.siemens.de (8.13.6/8.13.6) with ESMTP id r635hoI1021766; Wed, 3 Jul 2013 07:43:50 +0200 Received: (from localhost) by curry.mchp.siemens.de (8.14.7/8.14.7) id r635hoEY010515; Date: Wed, 3 Jul 2013 07:43:49 +0200 From: Andre Albsmeier To: "Kenneth D. Merry" Subject: Re: svn commit: r252214 - in stable/9: bin/chio sys/cam/scsi sys/sys Message-ID: <20130703054349.GA13656@bali> References: <201306252143.r5PLhoM0064338@svn.freebsd.org> <20130702055333.GA2729@bali> <20130703052236.GA65730@nargothrond.kdm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130703052236.GA65730@nargothrond.kdm.org> X-Echelon: X-Advice: Drop that crappy M$-Outlook, I'm tired of your viruses! User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "src-committers@freebsd.org" , "asomers@freebsd.org" , "Albsmeier, Andre" , "svn-src-stable@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-stable-9@freebsd.org" , "gibbs@freebsd.org" X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 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, 03 Jul 2013 05:43:58 -0000 On Wed, 03-Jul-2013 at 07:22:36 +0200, Kenneth D. Merry wrote: > On Tue, Jul 02, 2013 at 07:53:33 +0200, Andre Albsmeier wrote: > > On Tue, 25-Jun-2013 at 23:43:50 +0200, Kenneth D. Merry wrote: > > > Author: ken > > > Date: Tue Jun 25 21:43:49 2013 > > > New Revision: 252214 > > > URL: http://svnweb.freebsd.org/changeset/base/252214 > > > > Hi Ken, > > > > > Log: > > > MFC: 249658, 249701 > > > > > > Update chio(1) and ch(4) to support reporting element designators. > > > > > > This allows mapping a tape drive in a changer (as reported by > > > 'chio status') to a sa(4) driver instance by comparing the > > > serial numbers. > > > > > > The designators can be ASCII (which is printed out directly), binary > > > (which is printed in hex format) or UTF-8, which is printed in either > > > native UTF-8 format if the terminal can support it, or in %XX notation > > > for non-ASCII characters. Thanks to Hiroki Sato for the > > > explanation and example UTF-8 printing code. > > > > > > chio.h: Modify the changer_element_status structure to add new > > > fields and definitions from the SMC3r16 spec. > > > > > > Rename the original CHIOGSTATUS ioctl to OCHIOGTATUS and > > > define a new CHIOGSTATUS ioctl. > > > > > > Clean up some tab/space issues. > > > > > > chio.c: For the 'status' subcommand, print the designator field > > > if it is supplied by a device. > > > > > > scsi_ch.h: Add new flags for DVCID and CURDATA to the READ > > > ELEMENT STATUS command structure. > > > > > > Add a read_element_status_device_id structure > > > for the data fields in the new standard. Add new > > > unions, dt_or_obsolete and voltage_devid, to hold > > > and address data from either SCSI-2 or newer devices. > > > > > > scsi_ch.c: Implement support for fetching device IDs with READ > > > ELEMENT STATUS data. > > > > > > Add new arguments to scsi_read_element_status() to > > > allow the user to request the DVCID and CURDATA bits. > > > > This broke "chio status" when talking to my QUALSTAR TLS-8211 library: > > > > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): READ ELEMENT STATUS. CDB: b8 10 fd e8 00 01 03 00 04 00 00 00 > > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): CAM status: SCSI Status Error > > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): SCSI status: Check Condition > > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB) > > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): Command byte 6 is invalid > > Jul 2 07:08:22 server kernel: (ch0:ahd3:0:1:0): Error 22, Unretryable error > > > > scsi_cmd->flags (Byte 6) must be zero for this library so I had to use > > this workaround to make it work again until a better solution is available: > > > > --- sys/cam/scsi/scsi_ch.c.ORI 2013-06-26 13:38:54.000000000 +0200 > > +++ sys/cam/scsi/scsi_ch.c 2013-07-02 07:42:24.000000000 +0200 > > @@ -1245,8 +1245,8 @@ > > /* tag_action */ MSG_SIMPLE_Q_TAG, > > /* voltag */ want_voltags, > > /* sea */ softc->sc_firsts[chet], > > - /* dvcid */ 1, > > - /* curdata */ 1, > > + /* dvcid */ 0, > > + /* curdata */ 0, > > /* count */ 1, > > /* data_ptr */ data, > > /* dxfer_len */ 1024, > > @@ -1284,8 +1284,8 @@ > > /* voltag */ want_voltags, > > /* sea */ softc->sc_firsts[chet] > > + cesr->cesr_element_base, > > - /* dvcid */ 1, > > - /* curdata */ 1, > > + /* dvcid */ 0, > > + /* curdata */ 0, > > /* count */ cesr->cesr_element_count, > > /* data_ptr */ data, > > /* dxfer_len */ size, > > > > -Andre > > Oops, sorry. > > We need to check the SCSI version to see whether to set those bits, and > also fall back in case it doesn't work. > > I am on vacation and have very spotty net access. I can't do anything > about it until I get back next week. > > Justin and Alan (CCed) can work on the fix, though. Take your time, for me it's working right now with the above patch... -Andre > > Ken > -- > Kenneth Merry > ken@FreeBSD.ORG > -- Linux: Sozialismus, der nicht funktioniert From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 05:47:29 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 34BA2BB3; Wed, 3 Jul 2013 05:47:29 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 274FE1E30; Wed, 3 Jul 2013 05:47:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r635lTd0041240; Wed, 3 Jul 2013 05:47:29 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r635lS9o041236; Wed, 3 Jul 2013 05:47:28 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030547.r635lS9o041236@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 05:47: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: r252538 - 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.14 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, 03 Jul 2013 05:47:29 -0000 Author: lstewart Date: Wed Jul 3 05:47:28 2013 New Revision: 252538 URL: http://svnweb.freebsd.org/changeset/base/252538 Log: MFC r251774: Add a private KPI between hhook and khelp that allows khelp modules to insert hook functions into hhook points which register after the modules were loaded - potentially useful during boot or if hhook points are dynamically registered. Modified: stable/8/sys/kern/kern_hhook.c stable/8/sys/kern/kern_khelp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_hhook.c ============================================================================== --- stable/8/sys/kern/kern_hhook.c Wed Jul 3 05:29:21 2013 (r252537) +++ stable/8/sys/kern/kern_hhook.c Wed Jul 3 05:47:28 2013 (r252538) @@ -74,6 +74,7 @@ static uint32_t n_hhookheads; /* Private function prototypes. */ static void hhook_head_destroy(struct hhook_head *hhh); +void khelp_new_hhook_registered(struct hhook_head *hhh, uint32_t flags); #define HHHLIST_LOCK() mtx_lock(&hhook_head_list_lock) #define HHHLIST_UNLOCK() mtx_unlock(&hhook_head_list_lock) @@ -311,12 +312,7 @@ hhook_head_register(int32_t hhook_type, tmphhh->hhh_nhooks = 0; STAILQ_INIT(&tmphhh->hhh_hooks); HHH_LOCK_INIT(tmphhh); - - if (hhh != NULL) { - refcount_init(&tmphhh->hhh_refcount, 1); - *hhh = tmphhh; - } else - refcount_init(&tmphhh->hhh_refcount, 0); + refcount_init(&tmphhh->hhh_refcount, 1); HHHLIST_LOCK(); if (flags & HHOOK_HEADISINVNET) { @@ -331,6 +327,13 @@ hhook_head_register(int32_t hhook_type, n_hhookheads++; HHHLIST_UNLOCK(); + khelp_new_hhook_registered(tmphhh, flags); + + if (hhh != NULL) + *hhh = tmphhh; + else + refcount_release(&tmphhh->hhh_refcount); + return (0); } Modified: stable/8/sys/kern/kern_khelp.c ============================================================================== --- stable/8/sys/kern/kern_khelp.c Wed Jul 3 05:29:21 2013 (r252537) +++ stable/8/sys/kern/kern_khelp.c Wed Jul 3 05:47:28 2013 (r252538) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -52,8 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - static struct rwlock khelp_list_lock; RW_SYSINIT(khelplistlock, &khelp_list_lock, "helper list lock"); @@ -61,6 +58,7 @@ static TAILQ_HEAD(helper_head, helper) h /* Private function prototypes. */ static inline void khelp_remove_osd(struct helper *h, struct osd *hosd); +void khelp_new_hhook_registered(struct hhook_head *hhh, uint32_t flags); #define KHELP_LIST_WLOCK() rw_wlock(&khelp_list_lock) #define KHELP_LIST_WUNLOCK() rw_wunlock(&khelp_list_lock) @@ -289,6 +287,36 @@ khelp_remove_hhook(struct hookinfo *hki) return (error); } +/* + * Private KPI between hhook and khelp that allows khelp modules to insert hook + * functions into hhook points which register after the modules were loaded. + */ +void +khelp_new_hhook_registered(struct hhook_head *hhh, uint32_t flags) +{ + struct helper *h; + int error, i; + + KHELP_LIST_RLOCK(); + TAILQ_FOREACH(h, &helpers, h_next) { + for (i = 0; i < h->h_nhooks; i++) { + if (hhh->hhh_type != h->h_hooks[i].hook_type || + hhh->hhh_id != h->h_hooks[i].hook_id) + continue; + error = hhook_add_hook(hhh, &h->h_hooks[i], flags); + if (error) { + printf("%s: \"%s\" khelp module unable to " + "hook type %d id %d due to error %d\n", + __func__, h->h_name, + h->h_hooks[i].hook_type, + h->h_hooks[i].hook_id, error); + error = 0; + } + } + } + KHELP_LIST_RUNLOCK(); +} + int khelp_modevent(module_t mod, int event_type, void *data) { @@ -348,95 +376,3 @@ khelp_modevent(module_t mod, int event_t return (error); } - -/* - * This function is called in two separate situations: - * - * - When the kernel is booting, it is called directly by the SYSINIT framework - * to allow Khelp modules which were compiled into the kernel or loaded by the - * boot loader to insert their non-virtualised hook functions into the kernel. - * - * - When the kernel is booting or a vnet is created, this function is also - * called indirectly through khelp_vnet_init() by the vnet initialisation code. - * In this situation, Khelp modules are able to insert their virtualised hook - * functions into the virtualised hook points in the vnet which is being - * initialised. In the case where the kernel is not compiled with "options - * VIMAGE", this step is still run once at boot, but the hook functions get - * transparently inserted into the standard unvirtualised network stack. - */ -static void -khelp_init(const void *vnet) -{ - struct helper *h; - int error, i, vinit; - int32_t htype, hid; - - error = 0; - vinit = vnet != NULL; - - KHELP_LIST_RLOCK(); - TAILQ_FOREACH(h, &helpers, h_next) { - for (i = 0; i < h->h_nhooks && !error; i++) { - htype = h->h_hooks[i].hook_type; - hid = h->h_hooks[i].hook_id; - - /* - * If we're doing a virtualised init (vinit != 0) and - * the hook point is virtualised, or we're doing a plain - * sysinit at boot and the hook point is not - * virtualised, insert the hook. - */ - if ((hhook_head_is_virtualised_lookup(htype, hid) == - HHOOK_HEADISINVNET && vinit) || - (!hhook_head_is_virtualised_lookup(htype, hid) && - !vinit)) { - error = hhook_add_hook_lookup(&h->h_hooks[i], - HHOOK_NOWAIT); - } - } - - if (error) { - /* Remove any helper's hooks we successfully added. */ - for (i--; i >= 0; i--) - hhook_remove_hook_lookup(&h->h_hooks[i]); - - printf("%s: Failed to add hooks for helper \"%s\" (%p)", - __func__, h->h_name, h); - if (vinit) - printf(" to vnet %p.\n", vnet); - else - printf(".\n"); - - error = 0; - } - } - KHELP_LIST_RUNLOCK(); -} - -/* - * Vnet created and being initialised. - */ -static void -khelp_vnet_init(const void *unused __unused) -{ - - khelp_init(TD_TO_VNET(curthread)); -} - - -/* - * As the kernel boots, allow Khelp modules which were compiled into the kernel - * or loaded by the boot loader to insert their non-virtualised hook functions - * into the kernel. - */ -SYSINIT(khelp_init, SI_SUB_PROTO_END, SI_ORDER_FIRST, khelp_init, NULL); - -/* - * When a vnet is created and being initialised, we need to insert the helper - * hook functions for all currently registered Khelp modules into the vnet's - * helper hook points. The hhook KPI provides a mechanism for subsystems which - * export helper hook points to clean up on vnet shutdown, so we don't need a - * VNET_SYSUNINIT for Khelp. - */ -VNET_SYSINIT(khelp_vnet_init, SI_SUB_PROTO_END, SI_ORDER_FIRST, - khelp_vnet_init, NULL); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 05:48:46 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C98FFDBE; Wed, 3 Jul 2013 05:48:46 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BAD361E3A; Wed, 3 Jul 2013 05:48:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r635mkua041486; Wed, 3 Jul 2013 05:48:46 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r635mk93041484; Wed, 3 Jul 2013 05:48:46 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030548.r635mk93041484@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 05:48: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: r252539 - 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.14 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, 03 Jul 2013 05:48:46 -0000 Author: lstewart Date: Wed Jul 3 05:48:46 2013 New Revision: 252539 URL: http://svnweb.freebsd.org/changeset/base/252539 Log: MFC r251774: Add a private KPI between hhook and khelp that allows khelp modules to insert hook functions into hhook points which register after the modules were loaded - potentially useful during boot or if hhook points are dynamically registered. Modified: stable/9/sys/kern/kern_hhook.c stable/9/sys/kern/kern_khelp.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_hhook.c ============================================================================== --- stable/9/sys/kern/kern_hhook.c Wed Jul 3 05:47:28 2013 (r252538) +++ stable/9/sys/kern/kern_hhook.c Wed Jul 3 05:48:46 2013 (r252539) @@ -74,6 +74,7 @@ static uint32_t n_hhookheads; /* Private function prototypes. */ static void hhook_head_destroy(struct hhook_head *hhh); +void khelp_new_hhook_registered(struct hhook_head *hhh, uint32_t flags); #define HHHLIST_LOCK() mtx_lock(&hhook_head_list_lock) #define HHHLIST_UNLOCK() mtx_unlock(&hhook_head_list_lock) @@ -311,12 +312,7 @@ hhook_head_register(int32_t hhook_type, tmphhh->hhh_nhooks = 0; STAILQ_INIT(&tmphhh->hhh_hooks); HHH_LOCK_INIT(tmphhh); - - if (hhh != NULL) { - refcount_init(&tmphhh->hhh_refcount, 1); - *hhh = tmphhh; - } else - refcount_init(&tmphhh->hhh_refcount, 0); + refcount_init(&tmphhh->hhh_refcount, 1); HHHLIST_LOCK(); if (flags & HHOOK_HEADISINVNET) { @@ -331,6 +327,13 @@ hhook_head_register(int32_t hhook_type, n_hhookheads++; HHHLIST_UNLOCK(); + khelp_new_hhook_registered(tmphhh, flags); + + if (hhh != NULL) + *hhh = tmphhh; + else + refcount_release(&tmphhh->hhh_refcount); + return (0); } Modified: stable/9/sys/kern/kern_khelp.c ============================================================================== --- stable/9/sys/kern/kern_khelp.c Wed Jul 3 05:47:28 2013 (r252538) +++ stable/9/sys/kern/kern_khelp.c Wed Jul 3 05:48:46 2013 (r252539) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -52,8 +51,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - static struct rwlock khelp_list_lock; RW_SYSINIT(khelplistlock, &khelp_list_lock, "helper list lock"); @@ -61,6 +58,7 @@ static TAILQ_HEAD(helper_head, helper) h /* Private function prototypes. */ static inline void khelp_remove_osd(struct helper *h, struct osd *hosd); +void khelp_new_hhook_registered(struct hhook_head *hhh, uint32_t flags); #define KHELP_LIST_WLOCK() rw_wlock(&khelp_list_lock) #define KHELP_LIST_WUNLOCK() rw_wunlock(&khelp_list_lock) @@ -289,6 +287,36 @@ khelp_remove_hhook(struct hookinfo *hki) return (error); } +/* + * Private KPI between hhook and khelp that allows khelp modules to insert hook + * functions into hhook points which register after the modules were loaded. + */ +void +khelp_new_hhook_registered(struct hhook_head *hhh, uint32_t flags) +{ + struct helper *h; + int error, i; + + KHELP_LIST_RLOCK(); + TAILQ_FOREACH(h, &helpers, h_next) { + for (i = 0; i < h->h_nhooks; i++) { + if (hhh->hhh_type != h->h_hooks[i].hook_type || + hhh->hhh_id != h->h_hooks[i].hook_id) + continue; + error = hhook_add_hook(hhh, &h->h_hooks[i], flags); + if (error) { + printf("%s: \"%s\" khelp module unable to " + "hook type %d id %d due to error %d\n", + __func__, h->h_name, + h->h_hooks[i].hook_type, + h->h_hooks[i].hook_id, error); + error = 0; + } + } + } + KHELP_LIST_RUNLOCK(); +} + int khelp_modevent(module_t mod, int event_type, void *data) { @@ -348,95 +376,3 @@ khelp_modevent(module_t mod, int event_t return (error); } - -/* - * This function is called in two separate situations: - * - * - When the kernel is booting, it is called directly by the SYSINIT framework - * to allow Khelp modules which were compiled into the kernel or loaded by the - * boot loader to insert their non-virtualised hook functions into the kernel. - * - * - When the kernel is booting or a vnet is created, this function is also - * called indirectly through khelp_vnet_init() by the vnet initialisation code. - * In this situation, Khelp modules are able to insert their virtualised hook - * functions into the virtualised hook points in the vnet which is being - * initialised. In the case where the kernel is not compiled with "options - * VIMAGE", this step is still run once at boot, but the hook functions get - * transparently inserted into the standard unvirtualised network stack. - */ -static void -khelp_init(const void *vnet) -{ - struct helper *h; - int error, i, vinit; - int32_t htype, hid; - - error = 0; - vinit = vnet != NULL; - - KHELP_LIST_RLOCK(); - TAILQ_FOREACH(h, &helpers, h_next) { - for (i = 0; i < h->h_nhooks && !error; i++) { - htype = h->h_hooks[i].hook_type; - hid = h->h_hooks[i].hook_id; - - /* - * If we're doing a virtualised init (vinit != 0) and - * the hook point is virtualised, or we're doing a plain - * sysinit at boot and the hook point is not - * virtualised, insert the hook. - */ - if ((hhook_head_is_virtualised_lookup(htype, hid) == - HHOOK_HEADISINVNET && vinit) || - (!hhook_head_is_virtualised_lookup(htype, hid) && - !vinit)) { - error = hhook_add_hook_lookup(&h->h_hooks[i], - HHOOK_NOWAIT); - } - } - - if (error) { - /* Remove any helper's hooks we successfully added. */ - for (i--; i >= 0; i--) - hhook_remove_hook_lookup(&h->h_hooks[i]); - - printf("%s: Failed to add hooks for helper \"%s\" (%p)", - __func__, h->h_name, h); - if (vinit) - printf(" to vnet %p.\n", vnet); - else - printf(".\n"); - - error = 0; - } - } - KHELP_LIST_RUNLOCK(); -} - -/* - * Vnet created and being initialised. - */ -static void -khelp_vnet_init(const void *unused __unused) -{ - - khelp_init(TD_TO_VNET(curthread)); -} - - -/* - * As the kernel boots, allow Khelp modules which were compiled into the kernel - * or loaded by the boot loader to insert their non-virtualised hook functions - * into the kernel. - */ -SYSINIT(khelp_init, SI_SUB_PROTO_END, SI_ORDER_FIRST, khelp_init, NULL); - -/* - * When a vnet is created and being initialised, we need to insert the helper - * hook functions for all currently registered Khelp modules into the vnet's - * helper hook points. The hhook KPI provides a mechanism for subsystems which - * export helper hook points to clean up on vnet shutdown, so we don't need a - * VNET_SYSUNINIT for Khelp. - */ -VNET_SYSINIT(khelp_vnet_init, SI_SUB_PROTO_END, SI_ORDER_FIRST, - khelp_vnet_init, NULL); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 05:58:52 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 23C22375; Wed, 3 Jul 2013 05:58:52 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F24AD1EA3; Wed, 3 Jul 2013 05:58:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r635wpvP044384; Wed, 3 Jul 2013 05:58:51 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r635wpQc044383; Wed, 3 Jul 2013 05:58:51 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030558.r635wpQc044383@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 05: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: r252541 - 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.14 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, 03 Jul 2013 05:58:52 -0000 Author: lstewart Date: Wed Jul 3 05:58:51 2013 New Revision: 252541 URL: http://svnweb.freebsd.org/changeset/base/252541 Log: MFC r251778: Cleanup and simplification in khelp_{register|deregister}_helper(). No functional changes. Modified: stable/9/sys/kern/kern_khelp.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_khelp.c ============================================================================== --- stable/9/sys/kern/kern_khelp.c Wed Jul 3 05:54:23 2013 (r252540) +++ stable/9/sys/kern/kern_khelp.c Wed Jul 3 05:58:51 2013 (r252541) @@ -72,34 +72,32 @@ khelp_register_helper(struct helper *h) struct helper *tmph; int error, i, inserted; - error = 0; - inserted = 0; + error = inserted = 0; refcount_init(&h->h_refcount, 0); h->h_id = osd_register(OSD_KHELP, NULL, NULL); /* It's only safe to add the hooks after osd_register(). */ - if (h->h_nhooks > 0) { - for (i = 0; i < h->h_nhooks && !error; i++) { - /* We don't require the module to assign hook_helper. */ - h->h_hooks[i].hook_helper = h; - error = hhook_add_hook_lookup(&h->h_hooks[i], - HHOOK_WAITOK); - } - - if (error) { - for (i--; i >= 0; i--) - hhook_remove_hook_lookup(&h->h_hooks[i]); - - osd_deregister(OSD_KHELP, h->h_id); - } + for (i = 0; i < h->h_nhooks && !error; i++) { + /* We don't require the module to assign hook_helper. */ + h->h_hooks[i].hook_helper = h; + error = hhook_add_hook_lookup(&h->h_hooks[i], HHOOK_WAITOK); + if (error) + printf("%s: \"%s\" khelp module unable to " + "hook type %d id %d due to error %d\n", __func__, + h->h_name, h->h_hooks[i].hook_type, + h->h_hooks[i].hook_id, error); } - if (!error) { + if (error) { + for (i--; i >= 0; i--) + hhook_remove_hook_lookup(&h->h_hooks[i]); + osd_deregister(OSD_KHELP, h->h_id); + } else { KHELP_LIST_WLOCK(); /* * Keep list of helpers sorted in descending h_id order. Due to * the way osd_set() works, a sorted list ensures - * init_helper_osd() will operate with improved efficiency. + * khelp_init_osd() will operate with improved efficiency. */ TAILQ_FOREACH(tmph, &helpers, h_next) { if (tmph->h_id < h->h_id) { @@ -123,8 +121,6 @@ khelp_deregister_helper(struct helper *h struct helper *tmph; int error, i; - error = 0; - KHELP_LIST_WLOCK(); if (h->h_refcount > 0) error = EBUSY; @@ -141,10 +137,8 @@ khelp_deregister_helper(struct helper *h KHELP_LIST_WUNLOCK(); if (!error) { - if (h->h_nhooks > 0) { - for (i = 0; i < h->h_nhooks; i++) - hhook_remove_hook_lookup(&h->h_hooks[i]); - } + for (i = 0; i < h->h_nhooks; i++) + hhook_remove_hook_lookup(&h->h_hooks[i]); osd_deregister(OSD_KHELP, h->h_id); } From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 05:59:49 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2C2774D6; Wed, 3 Jul 2013 05:59:49 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04AA91EBA; Wed, 3 Jul 2013 05:59:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r635xm9v044525; Wed, 3 Jul 2013 05:59:48 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r635xmYq044524; Wed, 3 Jul 2013 05:59:48 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030559.r635xmYq044524@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 05:59: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: r252542 - 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.14 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, 03 Jul 2013 05:59:49 -0000 Author: lstewart Date: Wed Jul 3 05:59:48 2013 New Revision: 252542 URL: http://svnweb.freebsd.org/changeset/base/252542 Log: MFC r251778: Cleanup and simplification in khelp_{register|deregister}_helper(). No functional changes. Modified: stable/8/sys/kern/kern_khelp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_khelp.c ============================================================================== --- stable/8/sys/kern/kern_khelp.c Wed Jul 3 05:58:51 2013 (r252541) +++ stable/8/sys/kern/kern_khelp.c Wed Jul 3 05:59:48 2013 (r252542) @@ -72,34 +72,32 @@ khelp_register_helper(struct helper *h) struct helper *tmph; int error, i, inserted; - error = 0; - inserted = 0; + error = inserted = 0; refcount_init(&h->h_refcount, 0); h->h_id = osd_register(OSD_KHELP, NULL, NULL); /* It's only safe to add the hooks after osd_register(). */ - if (h->h_nhooks > 0) { - for (i = 0; i < h->h_nhooks && !error; i++) { - /* We don't require the module to assign hook_helper. */ - h->h_hooks[i].hook_helper = h; - error = hhook_add_hook_lookup(&h->h_hooks[i], - HHOOK_WAITOK); - } - - if (error) { - for (i--; i >= 0; i--) - hhook_remove_hook_lookup(&h->h_hooks[i]); - - osd_deregister(OSD_KHELP, h->h_id); - } + for (i = 0; i < h->h_nhooks && !error; i++) { + /* We don't require the module to assign hook_helper. */ + h->h_hooks[i].hook_helper = h; + error = hhook_add_hook_lookup(&h->h_hooks[i], HHOOK_WAITOK); + if (error) + printf("%s: \"%s\" khelp module unable to " + "hook type %d id %d due to error %d\n", __func__, + h->h_name, h->h_hooks[i].hook_type, + h->h_hooks[i].hook_id, error); } - if (!error) { + if (error) { + for (i--; i >= 0; i--) + hhook_remove_hook_lookup(&h->h_hooks[i]); + osd_deregister(OSD_KHELP, h->h_id); + } else { KHELP_LIST_WLOCK(); /* * Keep list of helpers sorted in descending h_id order. Due to * the way osd_set() works, a sorted list ensures - * init_helper_osd() will operate with improved efficiency. + * khelp_init_osd() will operate with improved efficiency. */ TAILQ_FOREACH(tmph, &helpers, h_next) { if (tmph->h_id < h->h_id) { @@ -123,8 +121,6 @@ khelp_deregister_helper(struct helper *h struct helper *tmph; int error, i; - error = 0; - KHELP_LIST_WLOCK(); if (h->h_refcount > 0) error = EBUSY; @@ -141,10 +137,8 @@ khelp_deregister_helper(struct helper *h KHELP_LIST_WUNLOCK(); if (!error) { - if (h->h_nhooks > 0) { - for (i = 0; i < h->h_nhooks; i++) - hhook_remove_hook_lookup(&h->h_hooks[i]); - } + for (i = 0; i < h->h_nhooks; i++) + hhook_remove_hook_lookup(&h->h_hooks[i]); osd_deregister(OSD_KHELP, h->h_id); } From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 06:20:48 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0D2808CF; Wed, 3 Jul 2013 06:20:48 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D9F481F4E; Wed, 3 Jul 2013 06:20:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r636Kl4u052545; Wed, 3 Jul 2013 06:20:47 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r636KlNF052544; Wed, 3 Jul 2013 06:20:47 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030620.r636KlNF052544@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 06:20: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: r252543 - 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.14 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, 03 Jul 2013 06:20:48 -0000 Author: lstewart Date: Wed Jul 3 06:20:47 2013 New Revision: 252543 URL: http://svnweb.freebsd.org/changeset/base/252543 Log: MFC r251787: Move hhook's per-vnet initialisation to an earlier SYSINIT SI_SUB stage to ensure all per-vnet related hhook initialisation is completed prior to any virtualised hhook points attempting registration. vnet_register_sysinit() requires that a stage later than SI_SUB_VNET be chosen. There are no per-vnet initialisors in the source tree at this time which run earlier than SI_SUB_INIT_IF. A quick audit of non-virtualised SYSINITs indicates there are no subsystems pre SI_SUB_MBUF that would likely be interested in registering a virtualised hhook point. Settle on SI_SUB_MBUF as hhook's per-vnet initialisation stage as it's the first overtly network-related initilisation stage to run after SI_SUB_VNET. If a subsystem that initialises earlier than SI_SUB_MBUF ends up wanting to register virtualised hhook points in future, hhook's use of SI_SUB_MBUF will need to be revisited and would probably warrant creating a dedicated SI_SUB_HHOOK which runs immediately after SI_SUB_VNET. Modified: stable/9/sys/kern/kern_hhook.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_hhook.c ============================================================================== --- stable/9/sys/kern/kern_hhook.c Wed Jul 3 05:59:48 2013 (r252542) +++ stable/9/sys/kern/kern_hhook.c Wed Jul 3 06:20:47 2013 (r252543) @@ -509,7 +509,7 @@ hhook_vnet_uninit(const void *unused __u /* * When a vnet is created and being initialised, init the V_hhook_vhead_list. */ -VNET_SYSINIT(hhook_vnet_init, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, +VNET_SYSINIT(hhook_vnet_init, SI_SUB_MBUF, SI_ORDER_FIRST, hhook_vnet_init, NULL); /* @@ -517,5 +517,5 @@ VNET_SYSINIT(hhook_vnet_init, SI_SUB_PRO * points to clean up on vnet tear down, but in case the KPI is misused, * provide a function to clean up and free memory for a vnet being destroyed. */ -VNET_SYSUNINIT(hhook_vnet_uninit, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, +VNET_SYSUNINIT(hhook_vnet_uninit, SI_SUB_MBUF, SI_ORDER_ANY, hhook_vnet_uninit, NULL); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 06:23:47 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9B7D5AE8; Wed, 3 Jul 2013 06:23:47 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7464E1F72; Wed, 3 Jul 2013 06:23:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r636NlDP053026; Wed, 3 Jul 2013 06:23:47 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r636NlcJ053025; Wed, 3 Jul 2013 06:23:47 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030623.r636NlcJ053025@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 06:23:47 +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: r252544 - 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.14 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, 03 Jul 2013 06:23:47 -0000 Author: lstewart Date: Wed Jul 3 06:23:46 2013 New Revision: 252544 URL: http://svnweb.freebsd.org/changeset/base/252544 Log: MFC r251787: Move hhook's per-vnet initialisation to an earlier SYSINIT SI_SUB stage to ensure all per-vnet related hhook initialisation is completed prior to any virtualised hhook points attempting registration. vnet_register_sysinit() requires that a stage later than SI_SUB_VNET be chosen. There are no per-vnet initialisors in the source tree at this time which run earlier than SI_SUB_INIT_IF. A quick audit of non-virtualised SYSINITs indicates there are no subsystems pre SI_SUB_MBUF that would likely be interested in registering a virtualised hhook point. Settle on SI_SUB_MBUF as hhook's per-vnet initialisation stage as it's the first overtly network-related initilisation stage to run after SI_SUB_VNET. If a subsystem that initialises earlier than SI_SUB_MBUF ends up wanting to register virtualised hhook points in future, hhook's use of SI_SUB_MBUF will need to be revisited and would probably warrant creating a dedicated SI_SUB_HHOOK which runs immediately after SI_SUB_VNET. Modified: stable/8/sys/kern/kern_hhook.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/kern_hhook.c ============================================================================== --- stable/8/sys/kern/kern_hhook.c Wed Jul 3 06:20:47 2013 (r252543) +++ stable/8/sys/kern/kern_hhook.c Wed Jul 3 06:23:46 2013 (r252544) @@ -509,7 +509,7 @@ hhook_vnet_uninit(const void *unused __u /* * When a vnet is created and being initialised, init the V_hhook_vhead_list. */ -VNET_SYSINIT(hhook_vnet_init, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, +VNET_SYSINIT(hhook_vnet_init, SI_SUB_MBUF, SI_ORDER_FIRST, hhook_vnet_init, NULL); /* @@ -517,5 +517,5 @@ VNET_SYSINIT(hhook_vnet_init, SI_SUB_PRO * points to clean up on vnet tear down, but in case the KPI is misused, * provide a function to clean up and free memory for a vnet being destroyed. */ -VNET_SYSUNINIT(hhook_vnet_uninit, SI_SUB_PROTO_BEGIN, SI_ORDER_FIRST, +VNET_SYSUNINIT(hhook_vnet_uninit, SI_SUB_MBUF, SI_ORDER_ANY, hhook_vnet_uninit, NULL); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 07:57:23 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0C19AF33; Wed, 3 Jul 2013 07:57:23 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F27A11270; Wed, 3 Jul 2013 07:57:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r637vMLU079446; Wed, 3 Jul 2013 07:57:22 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r637vM28079445; Wed, 3 Jul 2013 07:57:22 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030757.r637vM28079445@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 07:57: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: r252549 - 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.14 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, 03 Jul 2013 07:57:23 -0000 Author: lstewart Date: Wed Jul 3 07:57:22 2013 New Revision: 252549 URL: http://svnweb.freebsd.org/changeset/base/252549 Log: MFC r251789: Now that the necessary infrastructure is in place to ensure hhook points which register after a khelp module will get hooked, move khelp module initialisation to the earlier SI_SUB_KLD stage. Modified: stable/9/sys/sys/module_khelp.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/sys/module_khelp.h ============================================================================== --- stable/9/sys/sys/module_khelp.h Wed Jul 3 07:31:07 2013 (r252548) +++ stable/9/sys/sys/module_khelp.h Wed Jul 3 07:57:22 2013 (r252549) @@ -85,8 +85,7 @@ struct khelp_modevent_data { .evhand = khelp_modevent, \ .priv = &kmd_##hname \ }; \ - DECLARE_MODULE(hname, h_##hname, SI_SUB_PROTO_IFATTACHDOMAIN, \ - SI_ORDER_ANY); \ + DECLARE_MODULE(hname, h_##hname, SI_SUB_KLD, SI_ORDER_ANY); \ MODULE_VERSION(hname, version) #define KHELP_DECLARE_MOD(hname, hdata, hhooks, version) \ From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 07:58:15 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 526B7ED; Wed, 3 Jul 2013 07:58:15 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 44C361274; Wed, 3 Jul 2013 07:58:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r637wFui079597; Wed, 3 Jul 2013 07:58:15 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r637wFWW079596; Wed, 3 Jul 2013 07:58:15 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030758.r637wFWW079596@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 07:58: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: r252550 - stable/8/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.14 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, 03 Jul 2013 07:58:15 -0000 Author: lstewart Date: Wed Jul 3 07:58:14 2013 New Revision: 252550 URL: http://svnweb.freebsd.org/changeset/base/252550 Log: MFC r251789: Now that the necessary infrastructure is in place to ensure hhook points which register after a khelp module will get hooked, move khelp module initialisation to the earlier SI_SUB_KLD stage. Modified: stable/8/sys/sys/module_khelp.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/sys/ (props changed) Modified: stable/8/sys/sys/module_khelp.h ============================================================================== --- stable/8/sys/sys/module_khelp.h Wed Jul 3 07:57:22 2013 (r252549) +++ stable/8/sys/sys/module_khelp.h Wed Jul 3 07:58:14 2013 (r252550) @@ -85,8 +85,7 @@ struct khelp_modevent_data { .evhand = khelp_modevent, \ .priv = &kmd_##hname \ }; \ - DECLARE_MODULE(hname, h_##hname, SI_SUB_PROTO_IFATTACHDOMAIN, \ - SI_ORDER_ANY); \ + DECLARE_MODULE(hname, h_##hname, SI_SUB_KLD, SI_ORDER_ANY); \ MODULE_VERSION(hname, version) #define KHELP_DECLARE_MOD(hname, hdata, hhooks, version) \ From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 08:20:40 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8882F584; Wed, 3 Jul 2013 08:20:40 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 794E7133C; Wed, 3 Jul 2013 08:20:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r638KedP087851; Wed, 3 Jul 2013 08:20:40 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r638Ke5I087850; Wed, 3 Jul 2013 08:20:40 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030820.r638Ke5I087850@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 08:20: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: r252551 - 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.14 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, 03 Jul 2013 08:20:40 -0000 Author: lstewart Date: Wed Jul 3 08:20:40 2013 New Revision: 252551 URL: http://svnweb.freebsd.org/changeset/base/252551 Log: MFC r252052: Non-virtualised hhook points are supported as of r251732. Modified: stable/9/share/man/man9/hhook.9 Directory Properties: stable/9/share/man/ (props changed) stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/hhook.9 ============================================================================== --- stable/9/share/man/man9/hhook.9 Wed Jul 3 07:58:14 2013 (r252550) +++ stable/9/share/man/man9/hhook.9 Wed Jul 3 08:20:40 2013 (r252551) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2011 +.Dd June 21, 2013 .Dt HHOOK 9 .Os .Sh NAME @@ -380,9 +380,3 @@ This manual page was written by .An David Hayes Aq david.hayes@ieee.org and .An Lawrence Stewart Aq lstewart@FreeBSD.org . -.Sh BUGS -The framework does not currently support registering hook points in subsystems -which have not been virtualised with VIMAGE. -Fairly minimal internal changes to the -.Nm -implementation are required to address this. From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 08:21:05 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D04E76AF; Wed, 3 Jul 2013 08:21:05 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C2B161342; Wed, 3 Jul 2013 08:21:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r638L5rb088107; Wed, 3 Jul 2013 08:21:05 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r638L5Ri088106; Wed, 3 Jul 2013 08:21:05 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201307030821.r638L5Ri088106@svn.freebsd.org> From: Lawrence Stewart Date: Wed, 3 Jul 2013 08:21: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: r252552 - 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.14 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, 03 Jul 2013 08:21:05 -0000 Author: lstewart Date: Wed Jul 3 08:21:05 2013 New Revision: 252552 URL: http://svnweb.freebsd.org/changeset/base/252552 Log: MFC r252052: Non-virtualised hhook points are supported as of r251732. Modified: stable/8/share/man/man9/hhook.9 Directory Properties: stable/8/share/man/ (props changed) stable/8/share/man/man9/ (props changed) Modified: stable/8/share/man/man9/hhook.9 ============================================================================== --- stable/8/share/man/man9/hhook.9 Wed Jul 3 08:20:40 2013 (r252551) +++ stable/8/share/man/man9/hhook.9 Wed Jul 3 08:21:05 2013 (r252552) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2011 +.Dd June 21, 2013 .Dt HHOOK 9 .Os .Sh NAME @@ -380,9 +380,3 @@ This manual page was written by .An David Hayes Aq david.hayes@ieee.org and .An Lawrence Stewart Aq lstewart@FreeBSD.org . -.Sh BUGS -The framework does not currently support registering hook points in subsystems -which have not been virtualised with VIMAGE. -Fairly minimal internal changes to the -.Nm -implementation are required to address this. From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 08:35:14 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C6550B64; Wed, 3 Jul 2013 08:35:14 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B82B91447; Wed, 3 Jul 2013 08:35:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r638ZE1d091548; Wed, 3 Jul 2013 08:35:14 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r638ZEkL091547; Wed, 3 Jul 2013 08:35:14 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307030835.r638ZEkL091547@svn.freebsd.org> From: Steven Hartland Date: Wed, 3 Jul 2013 08:35: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: r252553 - stable/8/sys/dev/mfi 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.14 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, 03 Jul 2013 08:35:14 -0000 Author: smh Date: Wed Jul 3 08:35:14 2013 New Revision: 252553 URL: http://svnweb.freebsd.org/changeset/base/252553 Log: MFC r252471: Remove forced timeout of in-flight commands from mfi_timeout. While this prevents commands getting stuck forever there is no way to guarantee that data from the command hasn't been committed to the device. In addition older mfi firmware has a bug that would cause the controller to frequently stall IO for over our timeout value, which when combined with a forced timeout often resulted in panics in UFS; which would otherwise be avoided when the command eventually completed if left alone. For reference this timeout issue is resolved in Dell FW package 21.2.1-0000. Fixed FW package version for none Dell controller will likely vary. Modified: stable/8/sys/dev/mfi/mfi.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mfi/ (props changed) Modified: stable/8/sys/dev/mfi/mfi.c ============================================================================== --- stable/8/sys/dev/mfi/mfi.c Wed Jul 3 08:21:05 2013 (r252552) +++ stable/8/sys/dev/mfi/mfi.c Wed Jul 3 08:35:14 2013 (r252553) @@ -3762,12 +3762,15 @@ mfi_timeout(void *data) MFI_PRINT_CMD(cm); MFI_VALIDATE_CMD(sc, cm); /* - * Fail the command instead of leaving it on - * the queue where it could remain stuck forever + * While commands can get stuck forever we do + * not fail them as there is no way to tell if + * the controller has actually processed them + * or not. + * + * In addition its very likely that force + * failing a command here would cause a panic + * e.g. in UFS. */ - mfi_remove_busy(cm); - cm->cm_error = ETIMEDOUT; - mfi_complete(sc, cm); timedout++; } } From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 08:39:19 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3CF27E34; Wed, 3 Jul 2013 08:39:19 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 297B815BF; Wed, 3 Jul 2013 08:39:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r638dJj9092033; Wed, 3 Jul 2013 08:39:19 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r638dJX3092031; Wed, 3 Jul 2013 08:39:19 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307030839.r638dJX3092031@svn.freebsd.org> From: Steven Hartland Date: Wed, 3 Jul 2013 08:39: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: r252554 - stable/9/sys/dev/mfi 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.14 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, 03 Jul 2013 08:39:19 -0000 Author: smh Date: Wed Jul 3 08:39:18 2013 New Revision: 252554 URL: http://svnweb.freebsd.org/changeset/base/252554 Log: MFC r252471: Remove forced timeout of in-flight commands from mfi_timeout. While this prevents commands getting stuck forever there is no way to guarantee that data from the command hasn't been committed to the device. In addition older mfi firmware has a bug that would cause the controller to frequently stall IO for over our timeout value, which when combined with a forced timeout often resulted in panics in UFS; which would otherwise be avoided when the command eventually completed if left alone. For reference this timeout issue is resolved in Dell FW package 21.2.1-0000. Fixed FW package version for none Dell controller will likely vary. Modified: stable/9/sys/dev/mfi/mfi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mfi/mfi.c ============================================================================== --- stable/9/sys/dev/mfi/mfi.c Wed Jul 3 08:35:14 2013 (r252553) +++ stable/9/sys/dev/mfi/mfi.c Wed Jul 3 08:39:18 2013 (r252554) @@ -3768,12 +3768,15 @@ mfi_timeout(void *data) MFI_PRINT_CMD(cm); MFI_VALIDATE_CMD(sc, cm); /* - * Fail the command instead of leaving it on - * the queue where it could remain stuck forever + * While commands can get stuck forever we do + * not fail them as there is no way to tell if + * the controller has actually processed them + * or not. + * + * In addition its very likely that force + * failing a command here would cause a panic + * e.g. in UFS. */ - mfi_remove_busy(cm); - cm->cm_error = ETIMEDOUT; - mfi_complete(sc, cm); timedout++; } } From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 09:25:34 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 90C34D27; Wed, 3 Jul 2013 09:25:34 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 80324185A; Wed, 3 Jul 2013 09:25:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r639PYb2006394; Wed, 3 Jul 2013 09:25:34 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r639PTUL006359; Wed, 3 Jul 2013 09:25:29 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307030925.r639PTUL006359@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 3 Jul 2013 09:25:29 +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: r252555 - in stable/9: sbin/ifconfig sys/amd64/conf sys/conf sys/contrib/rdma sys/contrib/rdma/krping sys/dev/cxgb/ulp/tom sys/i386/conf sys/modules sys/modules/rdma/krping sys/modules/... 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.14 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, 03 Jul 2013 09:25:34 -0000 Author: np Date: Wed Jul 3 09:25:29 2013 New Revision: 252555 URL: http://svnweb.freebsd.org/changeset/base/252555 Log: MFC/backport core kernel and userspace parts of r237263 (TCP_OFFLOAD rework). MFC r237563, r239511, r243603, r245915, r245916, r245919, r245921, r245922, r245924, r245925, r245932, r245934 too. Build tested with make universe. r237263: - Updated TOE support in the kernel. ... r237563: Fix clang warning when compiling iw_cxgb. r239511: Correctly handle the case where an inp has already been dropped by the time the TOE driver reports that an active open failed. toe_connect_failed is supposed to handle this but it should be provided the inpcb instead of the tcpcb which may no longer be around. r243603: Make sure that tcp_timer_activate() correctly sees TCP_OFFLOAD (or not). r245915: Heed SO_NO_OFFLOAD. r245916: Teach toe_4tuple_check() to deal with IPv6 4-tuples too. r245919: Add TCP_OFFLOAD hook in syncache_respond for IPv6 too, just like the one that exists for IPv4. r245921: There is no need to call into the TOE driver twice in pru_rcvd (tod_rcvd and then tod_output right after that). r245922: Avoid NULL dereference in nd6_storelladdr when no mbuf is provided. It is called this way from a couple of places in the OFED code. (toecore calls it too but that's going to change shortly). r245924: Move lle_event to if_llatbl.h lle_event replaced arp_update_event after the ARP rewrite and ended up in if_ether.h simply because arp_update_event used to be there too. IPv6 neighbor discovery is going to grow lle_event support and this is a good time to move it to if_llatbl.h. The two in-tree consumers of this event - OFED and toecore - are not affected. r245925: Generate lle_event in the IPv6 neighbor discovery code too. r245932: Teach toe_l2_resolve to resolve IPv6 destinations too. r245934: Add checks for SO_NO_OFFLOAD in a couple of places that I missed earlier in r245915. Added: stable/9/sys/modules/toecore/ - copied from r237263, head/sys/modules/toecore/ stable/9/sys/netinet/toecore.c - copied, changed from r237263, head/sys/netinet/toecore.c stable/9/sys/netinet/toecore.h - copied, changed from r237263, head/sys/netinet/toecore.h Deleted: stable/9/sys/netinet/toedev.h Modified: stable/9/sbin/ifconfig/ifconfig.c stable/9/sys/amd64/conf/GENERIC stable/9/sys/conf/NOTES stable/9/sys/conf/files stable/9/sys/conf/options stable/9/sys/contrib/rdma/krping/krping.c stable/9/sys/contrib/rdma/krping/krping.h stable/9/sys/contrib/rdma/krping/krping_dev.c stable/9/sys/contrib/rdma/rdma_addr.c stable/9/sys/contrib/rdma/rdma_cache.c stable/9/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/9/sys/i386/conf/GENERIC stable/9/sys/i386/conf/XEN stable/9/sys/modules/Makefile stable/9/sys/modules/rdma/krping/Makefile stable/9/sys/net/if_llatbl.h stable/9/sys/net/if_var.h stable/9/sys/net/if_vlan.c stable/9/sys/netinet/if_ether.c stable/9/sys/netinet/if_ether.h stable/9/sys/netinet/in.c stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_offload.c stable/9/sys/netinet/tcp_offload.h stable/9/sys/netinet/tcp_output.c stable/9/sys/netinet/tcp_subr.c stable/9/sys/netinet/tcp_syncache.c stable/9/sys/netinet/tcp_syncache.h stable/9/sys/netinet/tcp_timer.c stable/9/sys/netinet/tcp_usrreq.c stable/9/sys/netinet/tcp_var.h stable/9/sys/netinet6/nd6.c stable/9/sys/netinet6/nd6_nbr.c stable/9/sys/ofed/drivers/infiniband/core/cma.c stable/9/sys/ofed/drivers/infiniband/core/iwcm.c stable/9/sys/ofed/include/linux/net.h stable/9/sys/ofed/include/linux/workqueue.h stable/9/sys/ofed/include/net/netevent.h stable/9/sys/ofed/include/rdma/iw_cm.h stable/9/usr.bin/netstat/inet.c stable/9/usr.bin/sockstat/sockstat.c Directory Properties: stable/9/sbin/ifconfig/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/net/ (props changed) stable/9/usr.bin/netstat/ (props changed) stable/9/usr.bin/sockstat/ (props changed) Modified: stable/9/sbin/ifconfig/ifconfig.c ============================================================================== --- stable/9/sbin/ifconfig/ifconfig.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sbin/ifconfig/ifconfig.c Wed Jul 3 09:25:29 2013 (r252555) @@ -910,7 +910,7 @@ unsetifdescr(const char *val, int value, #define IFCAPBITS \ "\020\1RXCSUM\2TXCSUM\3NETCONS\4VLAN_MTU\5VLAN_HWTAGGING\6JUMBO_MTU\7POLLING" \ "\10VLAN_HWCSUM\11TSO4\12TSO6\13LRO\14WOL_UCAST\15WOL_MCAST\16WOL_MAGIC" \ -"\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ +"\17TOE4\20TOE6\21VLAN_HWFILTER\23VLAN_HWTSO\24LINKSTATE\25NETMAP" \ "\26RXCSUM_IPV6\27TXCSUM_IPV6" /* @@ -1189,6 +1189,8 @@ static struct cmd basic_cmds[] = { DEF_CMD("-tso4", -IFCAP_TSO4, setifcap), DEF_CMD("tso", IFCAP_TSO, setifcap), DEF_CMD("-tso", -IFCAP_TSO, setifcap), + DEF_CMD("toe", IFCAP_TOE, setifcap), + DEF_CMD("-toe", -IFCAP_TOE, setifcap), DEF_CMD("lro", IFCAP_LRO, setifcap), DEF_CMD("-lro", -IFCAP_LRO, setifcap), DEF_CMD("wol", IFCAP_WOL, setifcap), Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/amd64/conf/GENERIC Wed Jul 3 09:25:29 2013 (r252555) @@ -28,6 +28,7 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: stable/9/sys/conf/NOTES ============================================================================== --- stable/9/sys/conf/NOTES Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/conf/NOTES Wed Jul 3 09:25:29 2013 (r252555) @@ -545,6 +545,8 @@ options INET6 #IPv6 communications pr options ROUTETABLES=2 # max 16. 1 is back compatible. +options TCP_OFFLOAD # TCP offload support. + # In order to enable IPSEC you MUST also add device crypto to # your kernel configuration options IPSEC #IP security (requires device crypto) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/conf/files Wed Jul 3 09:25:29 2013 (r252555) @@ -2886,7 +2886,7 @@ netinet/tcp_hostcache.c optional inet | netinet/tcp_input.c optional inet | inet6 netinet/tcp_lro.c optional inet | inet6 netinet/tcp_output.c optional inet | inet6 -netinet/tcp_offload.c optional inet | inet6 +netinet/tcp_offload.c optional tcp_offload inet | tcp_offload inet6 netinet/tcp_reass.c optional inet | inet6 netinet/tcp_sack.c optional inet | inet6 netinet/tcp_subr.c optional inet | inet6 Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/conf/options Wed Jul 3 09:25:29 2013 (r252555) @@ -431,7 +431,7 @@ RADIX_MPATH opt_mpath.h ROUTETABLES opt_route.h SLIP_IFF_OPTS opt_slip.h TCPDEBUG -TCP_OFFLOAD_DISABLE opt_inet.h #Disable code to dispatch tcp offloading +TCP_OFFLOAD opt_inet.h # Enable code to dispatch TCP offloading TCP_SIGNATURE opt_inet.h VLAN_ARRAY opt_vlan.h XBONEHACK Modified: stable/9/sys/contrib/rdma/krping/krping.c ============================================================================== --- stable/9/sys/contrib/rdma/krping/krping.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/contrib/rdma/krping/krping.c Wed Jul 3 09:25:29 2013 (r252555) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include #include @@ -53,11 +52,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include -#include +#include +#include #include "getopt.h" #include "krping.h" @@ -83,6 +84,7 @@ static const struct krping_option krping {"bw", OPT_NOPARAM, 'B'}, {"tx-depth", OPT_INT, 't'}, {"poll", OPT_NOPARAM, 'P'}, + {"memlimit", OPT_INT, 'm'}, {NULL, 0, 0} }; @@ -254,10 +256,14 @@ static void krping_cq_event_handler(stru ib_req_notify_cq(cb->cq, IB_CQ_NEXT_COMP); while ((ret = ib_poll_cq(cb->cq, 1, &wc)) == 1) { if (wc.status) { - if (wc.status != IB_WC_WR_FLUSH_ERR) - log(LOG_ERR, "cq completion failed status %d\n", + if (wc.status == IB_WC_WR_FLUSH_ERR) { + DEBUG_LOG("cq flushed\n"); + continue; + } else { + log(LOG_CRIT, "cq completion failed status %d\n", wc.status); - goto error; + goto error; + } } switch (wc.opcode) { @@ -432,8 +438,17 @@ static int krping_setup_buffers(struct k } } - cb->rdma_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, 0, -1UL, - PAGE_SIZE, 0); + /* RNIC adapters have a limit upto which it can register physical memory + * If DMA-MR memory mode is set then normally driver registers maximum + * supported memory. After that if contigmalloc allocates memory beyond the + * specified RNIC limit then Krping may not work. + */ + if (cb->use_dmamr && cb->memlimit) + cb->rdma_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, 0, cb->memlimit, + PAGE_SIZE, 0); + else + cb->rdma_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, 0, -1UL, + PAGE_SIZE, 0); if (!cb->rdma_buf) { log(LOG_ERR, "rdma_buf malloc failed\n"); @@ -458,8 +473,12 @@ static int krping_setup_buffers(struct k } if (!cb->server || cb->wlat || cb->rlat || cb->bw) { - cb->start_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, - 0, -1UL, PAGE_SIZE, 0); + if (cb->use_dmamr && cb->memlimit) + cb->start_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, + 0, cb->memlimit, PAGE_SIZE, 0); + else + cb->start_buf = contigmalloc(cb->size, M_DEVBUF, M_WAITOK, + 0, -1UL, PAGE_SIZE, 0); if (!cb->start_buf) { log(LOG_ERR, "start_buf malloc failed\n"); ret = ENOMEM; @@ -1636,6 +1655,8 @@ int krping_doit(char *cmd) cb->state = IDLE; cb->size = 64; cb->txdepth = RPING_SQ_DEPTH; + cb->use_dmamr = 1; + cb->memlimit = 0; mtx_init(&cb->lock, "krping mtx", NULL, MTX_DUPOK|MTX_DEF); while ((op = krping_getopt("krping", &cmd, krping_opts, NULL, &optarg, @@ -1713,6 +1734,15 @@ int krping_doit(char *cmd) case 'd': debug++; break; + case 'm': + cb->memlimit = optint; + if (cb->memlimit < 1) { + log(LOG_ERR, "Invalid memory limit %ju\n", + cb->memlimit); + ret = EINVAL; + } else + DEBUG_LOG(PFX "memory limit %d\n", (int)optint); + break; default: log(LOG_ERR, "unknown opt %s\n", optarg); ret = EINVAL; Modified: stable/9/sys/contrib/rdma/krping/krping.h ============================================================================== --- stable/9/sys/contrib/rdma/krping/krping.h Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/contrib/rdma/krping/krping.h Wed Jul 3 09:25:29 2013 (r252555) @@ -1,7 +1,7 @@ /* * $FreeBSD$ */ -#include +#include #include /* @@ -92,6 +92,8 @@ struct krping_cb { int count; /* ping count */ int size; /* ping data size */ int validate; /* validate ping data */ + uint64_t memlimit; /* limit of the physical memory that + can be registered with dma_mr mode */ /* CM stuff */ struct rdma_cm_id *cm_id; /* connection on client side,*/ Modified: stable/9/sys/contrib/rdma/krping/krping_dev.c ============================================================================== --- stable/9/sys/contrib/rdma/krping/krping_dev.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/contrib/rdma/krping/krping_dev.c Wed Jul 3 09:25:29 2013 (r252555) @@ -14,7 +14,6 @@ __FBSDID("$FreeBSD$"); #include -#include #include /* uprintf */ #include #include /* defines used in kernel.h */ @@ -51,6 +50,9 @@ typedef struct s_krping { /* vars */ static struct cdev *krping_dev; +#undef MODULE_VERSION +#include + static int krping_loader(struct module *m, int what, void *arg) { @@ -175,6 +177,4 @@ krping_write(struct cdev *dev, struct ui return(err); } -MODULE_DEPEND(krping, rdma_core, 1, 1, 1); -MODULE_DEPEND(krping, rdma_cma, 1, 1, 1); DEV_MODULE(krping,krping_loader,NULL); Modified: stable/9/sys/contrib/rdma/rdma_addr.c ============================================================================== --- stable/9/sys/contrib/rdma/rdma_addr.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/contrib/rdma/rdma_addr.c Wed Jul 3 09:25:29 2013 (r252555) @@ -117,7 +117,8 @@ int rdma_copy_addr(struct rdma_dev_addr const unsigned char *dst_dev_addr) { dev_addr->dev_type = RDMA_NODE_RNIC; - memcpy(dev_addr->src_dev_addr, IF_LLADDR(dev), MAX_ADDR_LEN); + memset(dev_addr->src_dev_addr, 0, MAX_ADDR_LEN); + memcpy(dev_addr->src_dev_addr, IF_LLADDR(dev), dev->if_addrlen); memcpy(dev_addr->broadcast, dev->if_broadcastaddr, MAX_ADDR_LEN); if (dst_dev_addr) memcpy(dev_addr->dst_dev_addr, dst_dev_addr, MAX_ADDR_LEN); @@ -207,7 +208,7 @@ static int addr_resolve_remote(struct so goto put; } ret = arpresolve(iproute.ro_rt->rt_ifp, iproute.ro_rt, NULL, - rt_key(iproute.ro_rt), dmac, &lle); + (struct sockaddr *)dst_in, dmac, &lle); if (ret) { goto put; } Modified: stable/9/sys/contrib/rdma/rdma_cache.c ============================================================================== --- stable/9/sys/contrib/rdma/rdma_cache.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/contrib/rdma/rdma_cache.c Wed Jul 3 09:25:29 2013 (r252555) @@ -132,7 +132,7 @@ int ib_find_cached_gid(struct ib_device for (p = 0; p <= end_port(device) - start_port(device); ++p) { cache = device->cache.gid_cache[p]; for (i = 0; i < cache->table_len; ++i) { - if (!memcmp(gid, &cache->table[i], 6)) { /* XXX */ + if (!memcmp(gid, &cache->table[i], sizeof *gid)) { *port_num = p + start_port(device); if (index) *index = i; Modified: stable/9/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- stable/9/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Wed Jul 3 09:25:29 2013 (r252555) @@ -880,10 +880,10 @@ act_open_rpl_status_to_errno(int status) case CPL_ERR_CONN_TIMEDOUT: return (ETIMEDOUT); case CPL_ERR_TCAM_FULL: - return (ENOMEM); + return (EAGAIN); case CPL_ERR_CONN_EXIST: log(LOG_ERR, "ACTIVE_OPEN_RPL: 4-tuple in use\n"); - return (EADDRINUSE); + return (EAGAIN); default: return (EIO); } @@ -912,8 +912,7 @@ do_act_open_rpl(struct sge_qset *qs, str unsigned int atid = G_TID(ntohl(rpl->atid)); struct toepcb *toep = lookup_atid(&td->tid_maps, atid); struct inpcb *inp = toep->tp_inp; - struct tcpcb *tp = intotcpcb(inp); - int s = rpl->status; + int s = rpl->status, rc; CTR3(KTR_CXGB, "%s: atid %u, status %u ", __func__, atid, s); @@ -923,17 +922,14 @@ do_act_open_rpl(struct sge_qset *qs, str if (act_open_has_tid(s)) queue_tid_release(tod, GET_TID(rpl)); - if (s == CPL_ERR_TCAM_FULL || s == CPL_ERR_CONN_EXIST) { - INP_WLOCK(inp); - toe_connect_failed(tod, tp, EAGAIN); - toepcb_release(toep); /* unlocks inp */ - } else { + rc = act_open_rpl_status_to_errno(s); + if (rc != EAGAIN) INP_INFO_WLOCK(&V_tcbinfo); - INP_WLOCK(inp); - toe_connect_failed(tod, tp, act_open_rpl_status_to_errno(s)); - toepcb_release(toep); /* unlocks inp */ + INP_WLOCK(inp); + toe_connect_failed(tod, inp, rc); + toepcb_release(toep); /* unlocks inp */ + if (rc != EAGAIN) INP_INFO_WUNLOCK(&V_tcbinfo); - } m_freem(m); return (0); Modified: stable/9/sys/i386/conf/GENERIC ============================================================================== --- stable/9/sys/i386/conf/GENERIC Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/i386/conf/GENERIC Wed Jul 3 09:25:29 2013 (r252555) @@ -30,6 +30,7 @@ options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption options INET # InterNETworking options INET6 # IPv6 communications protocols +options TCP_OFFLOAD # TCP offload options SCTP # Stream Control Transmission Protocol options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support Modified: stable/9/sys/i386/conf/XEN ============================================================================== --- stable/9/sys/i386/conf/XEN Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/i386/conf/XEN Wed Jul 3 09:25:29 2013 (r252555) @@ -7,7 +7,7 @@ cpu I686_CPU ident XEN makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols -makeoptions WITHOUT_MODULES="aha ahb amd cxgb dpt drm drm2 hptmv ida malo mps mwl nve sound sym trm xfs" +makeoptions WITHOUT_MODULES="aha ahb amd cxgb dpt drm drm2 hptmv ida malo mps mwl nve rdma sound sym trm xfs" options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/modules/Makefile Wed Jul 3 09:25:29 2013 (r252555) @@ -313,6 +313,7 @@ SUBDIR= \ ${_ti} \ tl \ tmpfs \ + ${_toecore} \ ${_tpm} \ trm \ ${_twa} \ @@ -395,6 +396,7 @@ _if_gre= if_gre .if (${MK_INET_SUPPORT} != "no" || ${MK_INET6_SUPPORT} != "no") || \ defined(ALL_MODULES) _if_carp= if_carp +_toecore= toecore .endif .if ${MK_IPFILTER} != "no" || defined(ALL_MODULES) Modified: stable/9/sys/modules/rdma/krping/Makefile ============================================================================== --- stable/9/sys/modules/rdma/krping/Makefile Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/modules/rdma/krping/Makefile Wed Jul 3 09:25:29 2013 (r252555) @@ -6,5 +6,7 @@ RDMA= ${.CURDIR}/../../../contrib/rdma/k KMOD= krping SRCS= krping.c krping_dev.c getopt.c SRCS+= bus_if.h device_if.h opt_sched.h pci_if.h pcib_if.h +SRCS+= vnode_if.h +CFLAGS+= -I${.CURDIR}/../../../ofed/include .include Modified: stable/9/sys/net/if_llatbl.h ============================================================================== --- stable/9/sys/net/if_llatbl.h Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/net/if_llatbl.h Wed Jul 3 09:25:29 2013 (r252555) @@ -205,4 +205,14 @@ lla_lookup(struct lltable *llt, u_int fl } int lla_rt_output(struct rt_msghdr *, struct rt_addrinfo *); + +#include +enum { + LLENTRY_RESOLVED, + LLENTRY_TIMEDOUT, + LLENTRY_DELETED, + LLENTRY_EXPIRED, +}; +typedef void (*lle_event_fn)(void *, struct llentry *, int); +EVENTHANDLER_DECLARE(lle_event, lle_event_fn); #endif /* _NET_IF_LLATBL_H_ */ Modified: stable/9/sys/net/if_var.h ============================================================================== --- stable/9/sys/net/if_var.h Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/net/if_var.h Wed Jul 3 09:25:29 2013 (r252555) @@ -755,6 +755,8 @@ drbr_inuse(struct ifnet *ifp, struct buf #define IF_MINMTU 72 #define IF_MAXMTU 65535 +#define TOEDEV(ifp) ((ifp)->if_llsoftc) + #endif /* _KERNEL */ /* Modified: stable/9/sys/net/if_vlan.c ============================================================================== --- stable/9/sys/net/if_vlan.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/net/if_vlan.c Wed Jul 3 09:25:29 2013 (r252555) @@ -748,8 +748,8 @@ vlan_modevent(module_t mod, int type, vo vlan_trunk_cap_p = NULL; vlan_trunkdev_p = NULL; vlan_tag_p = NULL; - vlan_cookie_p = vlan_cookie; - vlan_setcookie_p = vlan_setcookie; + vlan_cookie_p = NULL; + vlan_setcookie_p = NULL; vlan_devat_p = NULL; VLAN_LOCK_DESTROY(); if (bootverbose) @@ -1510,6 +1510,22 @@ vlan_capabilities(struct ifvlan *ifv) ifp->if_capenable &= ~(p->if_capenable & IFCAP_TSO); ifp->if_hwassist &= ~(p->if_hwassist & CSUM_TSO); } + + /* + * If the parent interface can offload TCP connections over VLANs then + * propagate its TOE capability to the VLAN interface. + * + * All TOE drivers in the tree today can deal with VLANs. If this + * changes then IFCAP_VLAN_TOE should be promoted to a full capability + * with its own bit. + */ +#define IFCAP_VLAN_TOE IFCAP_TOE + if (p->if_capabilities & IFCAP_VLAN_TOE) + ifp->if_capabilities |= p->if_capabilities & IFCAP_TOE; + if (p->if_capenable & IFCAP_VLAN_TOE) { + TOEDEV(ifp) = TOEDEV(p); + ifp->if_capenable |= p->if_capenable & IFCAP_TOE; + } } static void Modified: stable/9/sys/netinet/if_ether.c ============================================================================== --- stable/9/sys/netinet/if_ether.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/netinet/if_ether.c Wed Jul 3 09:25:29 2013 (r252555) @@ -178,6 +178,16 @@ arptimer(void *arg) ifp = lle->lle_tbl->llt_ifp; CURVNET_SET(ifp->if_vnet); + if ((lle->la_flags & LLE_DELETED) == 0) { + int evt; + + if (lle->la_flags & LLE_VALID) + evt = LLENTRY_EXPIRED; + else + evt = LLENTRY_TIMEDOUT; + EVENTHANDLER_INVOKE(lle_event, lle, evt); + } + callout_stop(&lle->la_timer); /* XXX: LOR avoidance. We still have ref on lle. */ @@ -730,7 +740,7 @@ match: (void)memcpy(&la->ll_addr, ar_sha(ah), ifp->if_addrlen); la->la_flags |= LLE_VALID; - EVENTHANDLER_INVOKE(arp_update_event, la); + EVENTHANDLER_INVOKE(lle_event, la, LLENTRY_RESOLVED); if (!(la->la_flags & LLE_STATIC)) { int canceled; Modified: stable/9/sys/netinet/if_ether.h ============================================================================== --- stable/9/sys/netinet/if_ether.h Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/netinet/if_ether.h Wed Jul 3 09:25:29 2013 (r252555) @@ -117,11 +117,6 @@ int arpresolve(struct ifnet *ifp, struct struct llentry **lle); void arp_ifinit(struct ifnet *, struct ifaddr *); void arp_ifinit2(struct ifnet *, struct ifaddr *, u_char *); - -#include -typedef void (*llevent_arp_update_fn)(void *, struct llentry *); -EVENTHANDLER_DECLARE(arp_update_event, llevent_arp_update_fn); - #endif #endif Modified: stable/9/sys/netinet/in.c ============================================================================== --- stable/9/sys/netinet/in.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/netinet/in.c Wed Jul 3 09:25:29 2013 (r252555) @@ -1527,7 +1527,7 @@ in_lltable_lookup(struct lltable *llt, u if (!(lle->la_flags & LLE_IFADDR) || (flags & LLE_IFADDR)) { LLE_WLOCK(lle); lle->la_flags |= LLE_DELETED; - EVENTHANDLER_INVOKE(arp_update_event, lle); + EVENTHANDLER_INVOKE(lle_event, lle, LLENTRY_DELETED); #ifdef DIAGNOSTIC log(LOG_INFO, "ifaddr cache = %p is deleted\n", lle); #endif Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/netinet/tcp_input.c Wed Jul 3 09:25:29 2013 (r252555) @@ -105,6 +105,9 @@ __FBSDID("$FreeBSD$"); #ifdef TCPDEBUG #include #endif /* TCPDEBUG */ +#ifdef TCP_OFFLOAD +#include +#endif #ifdef IPSEC #include @@ -995,6 +998,14 @@ relocked: goto dropwithreset; } +#ifdef TCP_OFFLOAD + if (tp->t_flags & TF_TOE) { + tcp_offload_input(tp, m); + m = NULL; /* consumed by the TOE driver */ + goto dropunlock; + } +#endif + /* * We've identified a valid inpcb, but it could be that we need an * inpcbinfo write lock but don't hold it. In this case, attempt to Modified: stable/9/sys/netinet/tcp_offload.c ============================================================================== --- stable/9/sys/netinet/tcp_offload.c Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/netinet/tcp_offload.c Wed Jul 3 09:25:29 2013 (r252555) @@ -1,145 +1,176 @@ /*- - * Copyright (c) 2007, Chelsio Inc. + * Copyright (c) 2012 Chelsio Communications, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 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. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Neither the name of the Chelsio Corporation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * 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 COPYRIGHT OWNER 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. + * 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$"); +#include "opt_inet.h" + #include #include #include -#include -#include -#include #include #include #include - +#include #include -#include -#include #include -#include - #include -#include #include #include #include #include -#include +#define TCPOUTFLAGS +#include +#include -uint32_t toedev_registration_count; +int registered_toedevs; +/* + * Provide an opportunity for a TOE driver to offload. + */ int tcp_offload_connect(struct socket *so, struct sockaddr *nam) { struct ifnet *ifp; - struct toedev *tdev; + struct toedev *tod; struct rtentry *rt; - int error; + int error = EOPNOTSUPP; + + INP_WLOCK_ASSERT(sotoinpcb(so)); + KASSERT(nam->sa_family == AF_INET || nam->sa_family == AF_INET6, + ("%s: called with sa_family %d", __func__, nam->sa_family)); - if (toedev_registration_count == 0) - return (EINVAL); - - /* - * Look up the route used for the connection to - * determine if it uses an interface capable of - * offloading the connection. - */ - rt = rtalloc1(nam, 0 /*report*/, 0 /*ignflags*/); - if (rt) + if (registered_toedevs == 0) + return (error); + + rt = rtalloc1(nam, 0, 0); + if (rt) RT_UNLOCK(rt); - else + else return (EHOSTUNREACH); ifp = rt->rt_ifp; - if ((ifp->if_capenable & IFCAP_TOE) == 0) { - error = EINVAL; - goto fail; - } - - tdev = TOEDEV(ifp); - if (tdev == NULL) { - error = EPERM; - goto fail; - } - - if (tdev->tod_can_offload(tdev, so) == 0) { - error = EPERM; - goto fail; - } - - return (tdev->tod_connect(tdev, so, rt, nam)); -fail: + + if (nam->sa_family == AF_INET && !(ifp->if_capenable & IFCAP_TOE4)) + goto done; + if (nam->sa_family == AF_INET6 && !(ifp->if_capenable & IFCAP_TOE6)) + goto done; + + tod = TOEDEV(ifp); + if (tod != NULL) + error = tod->tod_connect(tod, so, rt, nam); +done: RTFREE(rt); return (error); } +void +tcp_offload_listen_start(struct tcpcb *tp) +{ -/* - * This file contains code as a short-term staging area before it is moved in - * to sys/netinet/tcp_offload.c - */ + INP_WLOCK_ASSERT(tp->t_inpcb); + + EVENTHANDLER_INVOKE(tcp_offload_listen_start, tp); +} void -tcp_offload_twstart(struct tcpcb *tp) +tcp_offload_listen_stop(struct tcpcb *tp) { - INP_INFO_WLOCK(&V_tcbinfo); - INP_WLOCK(tp->t_inpcb); - tcp_twstart(tp); - INP_INFO_WUNLOCK(&V_tcbinfo); + INP_WLOCK_ASSERT(tp->t_inpcb); + + EVENTHANDLER_INVOKE(tcp_offload_listen_stop, tp); } -struct tcpcb * -tcp_offload_close(struct tcpcb *tp) +void +tcp_offload_input(struct tcpcb *tp, struct mbuf *m) { + struct toedev *tod = tp->tod; - INP_INFO_WLOCK(&V_tcbinfo); - INP_WLOCK(tp->t_inpcb); - tp = tcp_close(tp); - INP_INFO_WUNLOCK(&V_tcbinfo); - if (tp) - INP_WUNLOCK(tp->t_inpcb); + KASSERT(tod != NULL, ("%s: tp->tod is NULL, tp %p", __func__, tp)); + INP_WLOCK_ASSERT(tp->t_inpcb); - return (tp); + tod->tod_input(tod, tp, m); } -struct tcpcb * -tcp_offload_drop(struct tcpcb *tp, int error) +int +tcp_offload_output(struct tcpcb *tp) { + struct toedev *tod = tp->tod; + int error, flags; + + KASSERT(tod != NULL, ("%s: tp->tod is NULL, tp %p", __func__, tp)); + INP_WLOCK_ASSERT(tp->t_inpcb); - INP_INFO_WLOCK(&V_tcbinfo); - INP_WLOCK(tp->t_inpcb); - tp = tcp_drop(tp, error); - INP_INFO_WUNLOCK(&V_tcbinfo); - if (tp) - INP_WUNLOCK(tp->t_inpcb); + flags = tcp_outflags[tp->t_state]; - return (tp); + if (flags & TH_RST) { + /* XXX: avoid repeated calls like we do for FIN */ + error = tod->tod_send_rst(tod, tp); + } else if ((flags & TH_FIN || tp->t_flags & TF_NEEDFIN) && + (tp->t_flags & TF_SENTFIN) == 0) { + error = tod->tod_send_fin(tod, tp); + if (error == 0) + tp->t_flags |= TF_SENTFIN; + } else + error = tod->tod_output(tod, tp); + + return (error); +} + +void +tcp_offload_rcvd(struct tcpcb *tp) +{ + struct toedev *tod = tp->tod; + + KASSERT(tod != NULL, ("%s: tp->tod is NULL, tp %p", __func__, tp)); + INP_WLOCK_ASSERT(tp->t_inpcb); + + tod->tod_rcvd(tod, tp); } +void +tcp_offload_ctloutput(struct tcpcb *tp, int sopt_dir, int sopt_name) +{ + struct toedev *tod = tp->tod; + + KASSERT(tod != NULL, ("%s: tp->tod is NULL, tp %p", __func__, tp)); + INP_WLOCK_ASSERT(tp->t_inpcb); + + tod->tod_ctloutput(tod, tp, sopt_dir, sopt_name); +} + +void +tcp_offload_detach(struct tcpcb *tp) +{ + struct toedev *tod = tp->tod; + + KASSERT(tod != NULL, ("%s: tp->tod is NULL, tp %p", __func__, tp)); + INP_WLOCK_ASSERT(tp->t_inpcb); + + tod->tod_pcb_detach(tod, tp); +} Modified: stable/9/sys/netinet/tcp_offload.h ============================================================================== --- stable/9/sys/netinet/tcp_offload.h Wed Jul 3 08:39:18 2013 (r252554) +++ stable/9/sys/netinet/tcp_offload.h Wed Jul 3 09:25:29 2013 (r252555) @@ -1,30 +1,30 @@ /*- - * Copyright (c) 2007, Chelsio Inc. + * Copyright (c) 2012 Chelsio Communications, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 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. * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * - * 2. Neither the name of the Chelsio Corporation nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * 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 COPYRIGHT OWNER 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. + * 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$ + * */ #ifndef _NETINET_TCP_OFFLOAD_H_ @@ -34,321 +34,15 @@ #error "no user-serviceable parts inside" #endif -/* - * A driver publishes that it provides offload services - * by setting IFCAP_TOE in the ifnet. The offload connect - * will bypass any further work if the interface that a - * connection would use does not support TCP offload. - * - * The TOE API assumes that the tcp offload engine can offload the - * the entire connection from set up to teardown, with some provision - * being made to allowing the software stack to handle time wait. If - * the device does not meet these criteria, it is the driver's responsibility - * to overload the functions that it needs to in tcp_usrreqs and make - * its own calls to tcp_output if it needs to do so. - * - * There is currently no provision for the device advertising the congestion - * control algorithms it supports as there is currently no API for querying - * an operating system for the protocols that it has loaded. This is a desirable - * future extension. - * - * - * - * It is assumed that individuals deploying TOE will want connections - * to be offloaded without software changes so all connections on an - * interface providing TOE are offloaded unless the SO_NO_OFFLOAD - * flag is set on the socket. - * - * - * The toe_usrreqs structure constitutes the TOE driver's - * interface to the TCP stack for functionality that doesn't - * interact directly with userspace. If one wants to provide - * (optional) functionality to do zero-copy to/from - * userspace one still needs to override soreceive/sosend - * with functions that fault in and pin the user buffers. - * - * + tu_send - * - tells the driver that new data may have been added to the - * socket's send buffer - the driver should not fail if the - * buffer is in fact unchanged - * - the driver is responsible for providing credits (bytes in the send window) - * back to the socket by calling sbdrop() as segments are acknowledged. - * - The driver expects the inpcb lock to be held - the driver is expected - * not to drop the lock. Hence the driver is not allowed to acquire the - * pcbinfo lock during this call. - * - * + tu_rcvd - * - returns credits to the driver and triggers window updates - * to the peer (a credit as used here is a byte in the peer's receive window) - * - the driver is expected to determine how many bytes have been - * consumed and credit that back to the card so that it can grow - * the window again by maintaining its own state between invocations. - * - In principle this could be used to shrink the window as well as - * grow the window, although it is not used for that now. - * - this function needs to correctly handle being called any number of - * times without any bytes being consumed from the receive buffer. - * - The driver expects the inpcb lock to be held - the driver is expected - * not to drop the lock. Hence the driver is not allowed to acquire the - * pcbinfo lock during this call. - * - * + tu_disconnect - * - tells the driver to send FIN to peer - * - driver is expected to send the remaining data and then do a clean half close - * - disconnect implies at least half-close so only send, reset, and detach - * are legal - * - the driver is expected to handle transition through the shutdown - * state machine and allow the stack to support SO_LINGER. - * - The driver expects the inpcb lock to be held - the driver is expected - * not to drop the lock. Hence the driver is not allowed to acquire the - * pcbinfo lock during this call. - * - * + tu_reset - * - closes the connection and sends a RST to peer - * - driver is expectd to trigger an RST and detach the toepcb - * - no further calls are legal after reset - * - The driver expects the inpcb lock to be held - the driver is expected - * not to drop the lock. Hence the driver is not allowed to acquire the - * pcbinfo lock during this call. - * - * The following fields in the tcpcb are expected to be referenced by the driver: - * + iss - * + rcv_nxt - * + rcv_wnd - * + snd_isn - * + snd_max - * + snd_nxt - * + snd_una - * + t_flags - * + t_inpcb - * + t_maxseg - * + t_toe - * - * The following fields in the inpcb are expected to be referenced by the driver: - * + inp_lport - * + inp_fport - * + inp_laddr - * + inp_fport - * + inp_socket - * + inp_ip_tos - * - * The following fields in the socket are expected to be referenced by the - * driver: - * + so_comp - * + so_error - * + so_linger - * + so_options - * + so_rcv - * + so_snd - * + so_state - * + so_timeo - * - * These functions all return 0 on success and can return the following errors - * as appropriate: - * + EPERM: - * + ENOBUFS: memory allocation failed - * + EMSGSIZE: MTU changed during the call - * + EHOSTDOWN: - * + EHOSTUNREACH: - * + ENETDOWN: - * * ENETUNREACH: the peer is no longer reachable - * - * + tu_detach - * - tells driver that the socket is going away so disconnect - * the toepcb and free appropriate resources - * - allows the driver to cleanly handle the case of connection state - * outliving the socket - * - no further calls are legal after detach - * - the driver is expected to provide its own synchronization between - * detach and receiving new data. - * - * + tu_syncache_event - * - even if it is not actually needed, the driver is expected to - * call syncache_add for the initial SYN and then syncache_expand - * for the SYN,ACK - * - tells driver that a connection either has not been added or has - * been dropped from the syncache - * - the driver is expected to maintain state that lives outside the - * software stack so the syncache needs to be able to notify the - * toe driver that the software stack is not going to create a connection - * for a received SYN - * - The driver is responsible for any synchronization required between - * the syncache dropping an entry and the driver processing the SYN,ACK. - * - */ -struct toe_usrreqs { - int (*tu_send)(struct tcpcb *tp); - int (*tu_rcvd)(struct tcpcb *tp); - int (*tu_disconnect)(struct tcpcb *tp); - int (*tu_reset)(struct tcpcb *tp); - void (*tu_detach)(struct tcpcb *tp); - void (*tu_syncache_event)(int event, void *toep); -}; - -/* - * Proxy for struct tcpopt between TOE drivers and TCP functions. - */ -struct toeopt { - u_int64_t to_flags; /* see tcpopt in tcp_var.h */ - u_int16_t to_mss; /* maximum segment size */ - u_int8_t to_wscale; /* window scaling */ - - u_int8_t _pad1; /* explicit pad for 64bit alignment */ - u_int32_t _pad2; /* explicit pad for 64bit alignment */ - u_int64_t _pad3[4]; /* TBD */ -}; - -#define TOE_SC_ENTRY_PRESENT 1 /* 4-tuple already present */ -#define TOE_SC_DROP 2 /* connection was timed out */ - -/* - * Because listen is a one-to-many relationship (a socket can be listening - * on all interfaces on a machine some of which may be using different TCP - * offload devices), listen uses a publish/subscribe mechanism. The TCP - * offload driver registers a listen notification function with the stack. - * When a listen socket is created all TCP offload devices are notified - * so that they can do the appropriate set up to offload connections on the - * port to which the socket is bound. When the listen socket is closed, - * the offload devices are notified so that they will stop listening on that - * port and free any associated resources as well as sending RSTs on any - * connections in the SYN_RCVD state. - * - */ - -typedef void (*tcp_offload_listen_start_fn)(void *, struct tcpcb *); -typedef void (*tcp_offload_listen_stop_fn)(void *, struct tcpcb *); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 12:58:18 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6BDA5567; Wed, 3 Jul 2013 12:58:18 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D8FF1A9C; Wed, 3 Jul 2013 12:58:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63CwIpF068820; Wed, 3 Jul 2013 12:58:18 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63CwIV3068819; Wed, 3 Jul 2013 12:58:18 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201307031258.r63CwIV3068819@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 3 Jul 2013 12:58: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: r252563 - 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.14 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, 03 Jul 2013 12:58:18 -0000 Author: ae Date: Wed Jul 3 12:58:17 2013 New Revision: 252563 URL: http://svnweb.freebsd.org/changeset/base/252563 Log: MFC r251995: Use ICMP6STAT_INC() macro for ICMPv6 errors accounting. Modified: stable/9/sys/netinet6/icmp6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/icmp6.c ============================================================================== --- stable/9/sys/netinet6/icmp6.c Wed Jul 3 12:53:06 2013 (r252562) +++ stable/9/sys/netinet6/icmp6.c Wed Jul 3 12:58:17 2013 (r252563) @@ -130,7 +130,7 @@ VNET_DECLARE(int, icmp6_nodeinfo); #define V_icmp6errppslim_last VNET(icmp6errppslim_last) #define V_icmp6_nodeinfo VNET(icmp6_nodeinfo) -static void icmp6_errcount(struct icmp6errstat *, int, int); +static void icmp6_errcount(int, int); static int icmp6_rip6_input(struct mbuf **, int); static int icmp6_ratelimit(const struct in6_addr *, const int, const int); static const char *icmp6_redirect_diag(struct in6_addr *, @@ -159,59 +159,59 @@ kmod_icmp6stat_inc(int statnum) } static void -icmp6_errcount(struct icmp6errstat *stat, int type, int code) +icmp6_errcount(int type, int code) { switch (type) { case ICMP6_DST_UNREACH: switch (code) { case ICMP6_DST_UNREACH_NOROUTE: - stat->icp6errs_dst_unreach_noroute++; + ICMP6STAT_INC(icp6s_odst_unreach_noroute); return; case ICMP6_DST_UNREACH_ADMIN: - stat->icp6errs_dst_unreach_admin++; + ICMP6STAT_INC(icp6s_odst_unreach_admin); return; case ICMP6_DST_UNREACH_BEYONDSCOPE: - stat->icp6errs_dst_unreach_beyondscope++; + ICMP6STAT_INC(icp6s_odst_unreach_beyondscope); return; case ICMP6_DST_UNREACH_ADDR: - stat->icp6errs_dst_unreach_addr++; + ICMP6STAT_INC(icp6s_odst_unreach_addr); return; case ICMP6_DST_UNREACH_NOPORT: - stat->icp6errs_dst_unreach_noport++; + ICMP6STAT_INC(icp6s_odst_unreach_noport); return; } break; case ICMP6_PACKET_TOO_BIG: - stat->icp6errs_packet_too_big++; + ICMP6STAT_INC(icp6s_opacket_too_big); return; case ICMP6_TIME_EXCEEDED: switch (code) { case ICMP6_TIME_EXCEED_TRANSIT: - stat->icp6errs_time_exceed_transit++; + ICMP6STAT_INC(icp6s_otime_exceed_transit); return; case ICMP6_TIME_EXCEED_REASSEMBLY: - stat->icp6errs_time_exceed_reassembly++; + ICMP6STAT_INC(icp6s_otime_exceed_reassembly); return; } break; case ICMP6_PARAM_PROB: switch (code) { case ICMP6_PARAMPROB_HEADER: - stat->icp6errs_paramprob_header++; + ICMP6STAT_INC(icp6s_oparamprob_header); return; case ICMP6_PARAMPROB_NEXTHEADER: - stat->icp6errs_paramprob_nextheader++; + ICMP6STAT_INC(icp6s_oparamprob_nextheader); return; case ICMP6_PARAMPROB_OPTION: - stat->icp6errs_paramprob_option++; + ICMP6STAT_INC(icp6s_oparamprob_option); return; } break; case ND_REDIRECT: - stat->icp6errs_redirect++; + ICMP6STAT_INC(icp6s_oredirect); return; } - stat->icp6errs_unknown++; + ICMP6STAT_INC(icp6s_ounknown); } /* @@ -262,7 +262,7 @@ icmp6_error(struct mbuf *m, int type, in ICMP6STAT_INC(icp6s_error); /* count per-type-code statistics */ - icmp6_errcount(&V_icmp6stat.icp6s_outerrhist, type, code); + icmp6_errcount(type, code); #ifdef M_DECRYPTED /*not openbsd*/ if (m->m_flags & M_DECRYPTED) { @@ -2558,7 +2558,7 @@ icmp6_redirect_output(struct mbuf *m0, s struct ifnet *outif = NULL; struct sockaddr_in6 src_sa; - icmp6_errcount(&V_icmp6stat.icp6s_outerrhist, ND_REDIRECT, 0); + icmp6_errcount(ND_REDIRECT, 0); /* if we are not router, we don't send icmp6 redirect */ if (!V_ip6_forwarding) From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 13:00:36 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5BC828B1; Wed, 3 Jul 2013 13:00:36 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 33EA01AE3; Wed, 3 Jul 2013 13:00:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63D0agA070806; Wed, 3 Jul 2013 13:00:36 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63D0Zqw070804; Wed, 3 Jul 2013 13:00:35 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201307031300.r63D0Zqw070804@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 3 Jul 2013 13:00: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: r252565 - 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.14 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, 03 Jul 2013 13:00:36 -0000 Author: ae Date: Wed Jul 3 13:00:35 2013 New Revision: 252565 URL: http://svnweb.freebsd.org/changeset/base/252565 Log: MFC r252007: Use RIP6STAT_INC() macro for raw ip6 statistics accounting. Modified: stable/9/sys/netinet6/raw_ip6.c stable/9/sys/netinet6/raw_ip6.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/raw_ip6.c ============================================================================== --- stable/9/sys/netinet6/raw_ip6.c Wed Jul 3 12:58:53 2013 (r252564) +++ stable/9/sys/netinet6/raw_ip6.c Wed Jul 3 13:00:35 2013 (r252565) @@ -160,7 +160,7 @@ rip6_input(struct mbuf **mp, int *offp, struct mbuf *opts = NULL; struct sockaddr_in6 fromsa; - V_rip6stat.rip6s_ipackets++; + RIP6STAT_INC(rip6s_ipackets); if (faithprefix_p != NULL && (*faithprefix_p)(&ip6->ip6_dst)) { /* XXX Send icmp6 host/port unreach? */ @@ -199,11 +199,11 @@ rip6_input(struct mbuf **mp, int *offp, } INP_RLOCK(in6p); if (in6p->in6p_cksum != -1) { - V_rip6stat.rip6s_isum++; + RIP6STAT_INC(rip6s_isum); if (in6_cksum(m, proto, *offp, m->m_pkthdr.len - *offp)) { INP_RUNLOCK(in6p); - V_rip6stat.rip6s_badsum++; + RIP6STAT_INC(rip6s_badsum); continue; } } @@ -279,7 +279,7 @@ rip6_input(struct mbuf **mp, int *offp, m_freem(n); if (opts) m_freem(opts); - V_rip6stat.rip6s_fullsock++; + RIP6STAT_INC(rip6s_fullsock); } else sorwakeup(last->inp_socket); opts = NULL; @@ -312,14 +312,14 @@ rip6_input(struct mbuf **mp, int *offp, m_freem(m); if (opts) m_freem(opts); - V_rip6stat.rip6s_fullsock++; + RIP6STAT_INC(rip6s_fullsock); } else sorwakeup(last->inp_socket); INP_RUNLOCK(last); } else { - V_rip6stat.rip6s_nosock++; + RIP6STAT_INC(rip6s_nosock); if (m->m_flags & M_MCAST) - V_rip6stat.rip6s_nosockmcast++; + RIP6STAT_INC(rip6s_nosockmcast); if (proto == IPPROTO_NONE) m_freem(m); else { @@ -559,7 +559,7 @@ rip6_output(m, va_alist) icmp6_ifoutstat_inc(oifp, type, code); ICMP6STAT_INC(icp6s_outhist[type]); } else - V_rip6stat.rip6s_opackets++; + RIP6STAT_INC(rip6s_opackets); goto freectl; Modified: stable/9/sys/netinet6/raw_ip6.h ============================================================================== --- stable/9/sys/netinet6/raw_ip6.h Wed Jul 3 12:58:53 2013 (r252564) +++ stable/9/sys/netinet6/raw_ip6.h Wed Jul 3 13:00:35 2013 (r252565) @@ -48,6 +48,8 @@ struct rip6stat { }; #ifdef _KERNEL +#define RIP6STAT_ADD(name, val) V_rip6stat.name += (val) +#define RIP6STAT_INC(name) RIP6STAT_ADD(name, 1) VNET_DECLARE(struct rip6stat, rip6stat); #define V_rip6stat VNET(rip6stat) #endif From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 13:03:10 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 32EFDA1D; Wed, 3 Jul 2013 13:03:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 153F01B02; Wed, 3 Jul 2013 13:03:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63D39aO071423; Wed, 3 Jul 2013 13:03:09 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63D39qE071422; Wed, 3 Jul 2013 13:03:09 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201307031303.r63D39qE071422@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Wed, 3 Jul 2013 13:03: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: r252566 - 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.14 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, 03 Jul 2013 13:03:10 -0000 Author: ae Date: Wed Jul 3 13:03:09 2013 New Revision: 252566 URL: http://svnweb.freebsd.org/changeset/base/252566 Log: MFC r252009: Use PIM6STAT_INC() and MRT6STAT_INC() macros for IPv6 multicast statistics accounting. Modified: stable/9/sys/netinet6/ip6_mroute.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/ip6_mroute.c ============================================================================== --- stable/9/sys/netinet6/ip6_mroute.c Wed Jul 3 13:00:35 2013 (r252565) +++ stable/9/sys/netinet6/ip6_mroute.c Wed Jul 3 13:03:09 2013 (r252566) @@ -162,6 +162,7 @@ SYSCTL_STRUCT(_net_inet6_ip6, OID_AUTO, &mrt6stat, mrt6stat, "Multicast Routing Statistics (struct mrt6stat, netinet6/ip6_mroute.h)"); +#define MRT6STAT_INC(name) mrt6stat.name += 1 #define NO_RTE_FOUND 0x1 #define RTE_FOUND 0x2 @@ -251,8 +252,9 @@ static mifi_t reg_mif_num = (mifi_t)-1; static struct pim6stat pim6stat; SYSCTL_STRUCT(_net_inet6_pim, PIM6CTL_STATS, stats, CTLFLAG_RW, &pim6stat, pim6stat, - "PIM Statistics (struct pim6stat, netinet6/pim_var.h)"); + "PIM Statistics (struct pim6stat, netinet6/pim6_var.h)"); +#define PIM6STAT_INC(name) pim6stat.name += 1 static VNET_DEFINE(int, pim6); #define V_pim6 VNET(pim6) @@ -270,7 +272,7 @@ static VNET_DEFINE(int, pim6); #define MF6CFIND(o, g, rt) do { \ struct mf6c *_rt = mf6ctable[MF6CHASH(o,g)]; \ rt = NULL; \ - mrt6stat.mrt6s_mfc_lookups++; \ + MRT6STAT_INC(mrt6s_mfc_lookups); \ while (_rt) { \ if (IN6_ARE_ADDR_EQUAL(&_rt->mf6c_origin.sin6_addr, &(o)) && \ IN6_ARE_ADDR_EQUAL(&_rt->mf6c_mcastgrp.sin6_addr, &(g)) && \ @@ -281,7 +283,7 @@ static VNET_DEFINE(int, pim6); _rt = _rt->mf6c_next; \ } \ if (rt == NULL) { \ - mrt6stat.mrt6s_mfc_misses++; \ + MRT6STAT_INC(mrt6s_mfc_misses); \ } \ } while (/*CONSTCOND*/ 0) @@ -1142,7 +1144,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru GET_TIME(tp); #endif /* UPCALL_TIMING */ - mrt6stat.mrt6s_no_route++; + MRT6STAT_INC(mrt6s_no_route); #ifdef MRT6DEBUG if (V_mrt6debug & (DEBUG_FORWARD | DEBUG_MFC)) log(LOG_DEBUG, "ip6_mforward: no rte s %s g %s\n", @@ -1269,7 +1271,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) { log(LOG_WARNING, "ip6_mforward: ip6_mrouter " "socket queue full\n"); - mrt6stat.mrt6s_upq_sockfull++; + MRT6STAT_INC(mrt6s_upq_sockfull); free(rte, M_MRTABLE6); m_freem(mb0); free(rt, M_MRTABLE6); @@ -1277,7 +1279,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru return (ENOBUFS); } - mrt6stat.mrt6s_upcalls++; + MRT6STAT_INC(mrt6s_upcalls); /* insert new entry at head of hash chain */ bzero(rt, sizeof(*rt)); @@ -1303,7 +1305,7 @@ X_ip6_mforward(struct ip6_hdr *ip6, stru for (p = &rt->mf6c_stall; *p != NULL; p = &(*p)->next) if (++npkts > MAX_UPQ6) { - mrt6stat.mrt6s_upq_ovflw++; + MRT6STAT_INC(mrt6s_upq_ovflw); free(rte, M_MRTABLE6); m_freem(mb0); MFC6_UNLOCK(); @@ -1372,7 +1374,7 @@ expire_upcalls(void *unused) free(rte, M_MRTABLE6); rte = n; } while (rte != NULL); - mrt6stat.mrt6s_cache_cleanups++; + MRT6STAT_INC(mrt6s_cache_cleanups); n6expire[i]--; *nptr = mfc->mf6c_next; @@ -1428,7 +1430,7 @@ ip6_mdq(struct mbuf *m, struct ifnet *if ifp->if_index, mifi, mif6table[mifi].m6_ifp->if_index); #endif - mrt6stat.mrt6s_wrong_if++; + MRT6STAT_INC(mrt6s_wrong_if); rt->mf6c_wrong_if++; /* * If we are doing PIM processing, and we are forwarding @@ -1501,14 +1503,14 @@ ip6_mdq(struct mbuf *m, struct ifnet *if break; } - mrt6stat.mrt6s_upcalls++; + MRT6STAT_INC(mrt6s_upcalls); if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) { #ifdef MRT6DEBUG if (V_mrt6debug) log(LOG_WARNING, "mdq, ip6_mrouter socket queue full\n"); #endif - ++mrt6stat.mrt6s_upq_sockfull; + MRT6STAT_INC(mrt6s_upq_sockfull); return (ENOBUFS); } /* if socket Q full */ } /* if PIM */ @@ -1696,7 +1698,7 @@ register_send(struct ip6_hdr *ip6, struc ip6_sprintf(ip6bufd, &ip6->ip6_dst)); } #endif - ++pim6stat.pim6s_snd_registers; + PIM6STAT_INC(pim6s_snd_registers); /* Make a copy of the packet to send to the user level process */ MGETHDR(mm, M_DONTWAIT, MT_HEADER); @@ -1731,7 +1733,7 @@ register_send(struct ip6_hdr *ip6, struc im6->im6_mif = mif - mif6table; /* iif info is not given for reg. encap.n */ - mrt6stat.mrt6s_upcalls++; + MRT6STAT_INC(mrt6s_upcalls); if (socket_send(V_ip6_mrouter, mm, &sin6) < 0) { #ifdef MRT6DEBUG @@ -1739,7 +1741,7 @@ register_send(struct ip6_hdr *ip6, struc log(LOG_WARNING, "register_send: ip6_mrouter socket queue full\n"); #endif - ++mrt6stat.mrt6s_upq_sockfull; + MRT6STAT_INC(mrt6s_upq_sockfull); return (ENOBUFS); } return (0); @@ -1780,7 +1782,7 @@ pim6_input(struct mbuf **mp, int *offp, int minlen; int off = *offp; - ++pim6stat.pim6s_rcv_total; + PIM6STAT_INC(pim6s_rcv_total); ip6 = mtod(m, struct ip6_hdr *); pimlen = m->m_pkthdr.len - *offp; @@ -1789,7 +1791,7 @@ pim6_input(struct mbuf **mp, int *offp, * Validate lengths */ if (pimlen < PIM_MINLEN) { - ++pim6stat.pim6s_rcv_tooshort; + PIM6STAT_INC(pim6s_rcv_tooshort); #ifdef MRT6DEBUG if (V_mrt6debug & DEBUG_PIM) log(LOG_DEBUG,"pim6_input: PIM packet too short\n"); @@ -1822,7 +1824,7 @@ pim6_input(struct mbuf **mp, int *offp, #else IP6_EXTHDR_GET(pim, struct pim *, m, off, minlen); if (pim == NULL) { - pim6stat.pim6s_rcv_tooshort++; + PIM6STAT_INC(pim6s_rcv_tooshort); return (IPPROTO_DONE); } #endif @@ -1842,7 +1844,7 @@ pim6_input(struct mbuf **mp, int *offp, cksumlen = pimlen; if (in6_cksum(m, IPPROTO_PIM, off, cksumlen)) { - ++pim6stat.pim6s_rcv_badsum; + PIM6STAT_INC(pim6s_rcv_badsum); #ifdef MRT6DEBUG if (V_mrt6debug & DEBUG_PIM) log(LOG_DEBUG, @@ -1856,7 +1858,7 @@ pim6_input(struct mbuf **mp, int *offp, /* PIM version check */ if (pim->pim_ver != PIM_VERSION) { - ++pim6stat.pim6s_rcv_badversion; + PIM6STAT_INC(pim6s_rcv_badversion); #ifdef MRT6DEBUG log(LOG_ERR, "pim6_input: incorrect version %d, expecting %d\n", @@ -1882,7 +1884,7 @@ pim6_input(struct mbuf **mp, int *offp, char ip6bufs[INET6_ADDRSTRLEN], ip6bufd[INET6_ADDRSTRLEN]; #endif - ++pim6stat.pim6s_rcv_registers; + PIM6STAT_INC(pim6s_rcv_registers); if ((reg_mif_num >= nummifs) || (reg_mif_num == (mifi_t) -1)) { #ifdef MRT6DEBUG @@ -1904,8 +1906,8 @@ pim6_input(struct mbuf **mp, int *offp, * Validate length */ if (pimlen < PIM6_REG_MINLEN) { - ++pim6stat.pim6s_rcv_tooshort; - ++pim6stat.pim6s_rcv_badregisters; + PIM6STAT_INC(pim6s_rcv_tooshort); + PIM6STAT_INC(pim6s_rcv_badregisters); #ifdef MRT6DEBUG log(LOG_ERR, "pim6_input: register packet size too " @@ -1929,7 +1931,7 @@ pim6_input(struct mbuf **mp, int *offp, /* verify the version number of the inner packet */ if ((eip6->ip6_vfc & IPV6_VERSION_MASK) != IPV6_VERSION) { - ++pim6stat.pim6s_rcv_badregisters; + PIM6STAT_INC(pim6s_rcv_badregisters); #ifdef MRT6DEBUG log(LOG_DEBUG, "pim6_input: invalid IP version (%d) " "of the inner packet\n", @@ -1941,7 +1943,7 @@ pim6_input(struct mbuf **mp, int *offp, /* verify the inner packet is destined to a mcast group */ if (!IN6_IS_ADDR_MULTICAST(&eip6->ip6_dst)) { - ++pim6stat.pim6s_rcv_badregisters; + PIM6STAT_INC(pim6s_rcv_badregisters); #ifdef MRT6DEBUG if (V_mrt6debug & DEBUG_PIM) log(LOG_DEBUG, From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 19:12:36 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A87C9AA1; Wed, 3 Jul 2013 19:12:36 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9B1A71084; Wed, 3 Jul 2013 19:12:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63JCaju082222; Wed, 3 Jul 2013 19:12:36 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63JCaTU082220; Wed, 3 Jul 2013 19:12:36 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307031912.r63JCaTU082220@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 3 Jul 2013 19:12: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: r252588 - 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.14 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, 03 Jul 2013 19:12:36 -0000 Author: obrien Date: Wed Jul 3 19:12:35 2013 New Revision: 252588 URL: http://svnweb.freebsd.org/changeset/base/252588 Log: MFC: r238051: Add "hier" as an alternate spelling of "hierarchy" to match hier(9). Modified: stable/9/Makefile (contents, props changed) stable/9/Makefile.inc1 (contents, props changed) Directory Properties: stable/9/ (props changed) Modified: stable/9/Makefile ============================================================================== --- stable/9/Makefile Wed Jul 3 19:08:10 2013 (r252587) +++ stable/9/Makefile Wed Jul 3 19:12:35 2013 (r252588) @@ -91,7 +91,7 @@ TGTS= all all-man buildenv buildenvvars delete-old delete-old-dirs delete-old-files delete-old-libs \ depend distribute distributekernel distributekernel.debug \ distributeworld distrib-dirs distribution doxygen \ - everything hierarchy install installcheck installkernel \ + everything hier hierarchy install installcheck installkernel \ installkernel.debug packagekernel packageworld \ reinstallkernel reinstallkernel.debug \ installworld kernel-toolchain libraries lint maninstall \ Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Wed Jul 3 19:08:10 2013 (r252587) +++ stable/9/Makefile.inc1 Wed Jul 3 19:12:35 2013 (r252588) @@ -1272,7 +1272,7 @@ cross-tools: # # hierarchy - ensure that all the needed directories are present # -hierarchy: +hierarchy hier: .if defined(NO_ROOT) cd ${.CURDIR}/etc; ${MAKE} LOCAL_MTREE=${LOCAL_MTREE} \ -DNO_ROOT METALOG=${METALOG} distrib-dirs From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 20:24:38 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7D7294C0; Wed, 3 Jul 2013 20:24:38 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6F67F15ED; Wed, 3 Jul 2013 20:24:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63KOcbG003750; Wed, 3 Jul 2013 20:24:38 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63KOcts003749; Wed, 3 Jul 2013 20:24:38 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201307032024.r63KOcts003749@svn.freebsd.org> From: Mateusz Guzik Date: Wed, 3 Jul 2013 20:24: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: r252595 - stable/9/usr.bin/truss 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.14 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, 03 Jul 2013 20:24:38 -0000 Author: mjg Date: Wed Jul 3 20:24:37 2013 New Revision: 252595 URL: http://svnweb.freebsd.org/changeset/base/252595 Log: MFC r252414: truss: recognize O_DIRECTORY, O_EXEC, O_TTY_INIT and O_CLOEXEC Modified: stable/9/usr.bin/truss/syscalls.c Directory Properties: stable/9/usr.bin/truss/ (props changed) Modified: stable/9/usr.bin/truss/syscalls.c ============================================================================== --- stable/9/usr.bin/truss/syscalls.c Wed Jul 3 20:22:12 2013 (r252594) +++ stable/9/usr.bin/truss/syscalls.c Wed Jul 3 20:24:37 2013 (r252595) @@ -343,7 +343,7 @@ static struct xlat open_flags[] = { X(O_RDONLY) X(O_WRONLY) X(O_RDWR) X(O_ACCMODE) X(O_NONBLOCK) X(O_APPEND) X(O_SHLOCK) X(O_EXLOCK) X(O_ASYNC) X(O_FSYNC) X(O_NOFOLLOW) X(O_CREAT) X(O_TRUNC) X(O_EXCL) X(O_NOCTTY) - X(O_DIRECT) XEND + X(O_DIRECT) X(O_DIRECTORY) X(O_EXEC) X(O_TTY_INIT) X(O_CLOEXEC) XEND }; static struct xlat shutdown_arg[] = { From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 20:54:26 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2DE1C6C6; Wed, 3 Jul 2013 20:54:26 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1FBAD17BD; Wed, 3 Jul 2013 20:54:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63KsQ3m012578; Wed, 3 Jul 2013 20:54:26 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63KsPkM012577; Wed, 3 Jul 2013 20:54:25 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307032054.r63KsPkM012577@svn.freebsd.org> From: Devin Teske Date: Wed, 3 Jul 2013 20:54: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: r252600 - stable/9/usr.sbin/sysinstall 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.14 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, 03 Jul 2013 20:54:26 -0000 Author: dteske Date: Wed Jul 3 20:54:25 2013 New Revision: 252600 URL: http://svnweb.freebsd.org/changeset/base/252600 Log: Fix grammar in a comment. Modified: stable/9/usr.sbin/sysinstall/package.c Modified: stable/9/usr.sbin/sysinstall/package.c ============================================================================== --- stable/9/usr.sbin/sysinstall/package.c Wed Jul 3 20:44:47 2013 (r252599) +++ stable/9/usr.sbin/sysinstall/package.c Wed Jul 3 20:54:25 2013 (r252600) @@ -106,7 +106,7 @@ package_installed(char *name) /* XXX KLUDGE ALERT! This makes evil assumptions about how XXX * packages register themselves and should *really be done with - * `pkg_info -e ' except that this it's too slow for an + * `pkg_info -e ' except that this is too slow for an * item check routine.. :-( */ snprintf(fname, FILENAME_MAX, "/var/db/pkg/%s", name); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 20:55:49 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B85BB7FA; Wed, 3 Jul 2013 20:55:49 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AA11717C6; Wed, 3 Jul 2013 20:55:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63KtnKG012856; Wed, 3 Jul 2013 20:55:49 GMT (envelope-from dteske@svn.freebsd.org) Received: (from dteske@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63KtnMM012855; Wed, 3 Jul 2013 20:55:49 GMT (envelope-from dteske@svn.freebsd.org) Message-Id: <201307032055.r63KtnMM012855@svn.freebsd.org> From: Devin Teske Date: Wed, 3 Jul 2013 20:55: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: r252601 - stable/8/usr.sbin/sysinstall 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.14 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, 03 Jul 2013 20:55:49 -0000 Author: dteske Date: Wed Jul 3 20:55:49 2013 New Revision: 252601 URL: http://svnweb.freebsd.org/changeset/base/252601 Log: MFC r252600: Fix grammar in a comment. Modified: stable/8/usr.sbin/sysinstall/package.c Modified: stable/8/usr.sbin/sysinstall/package.c ============================================================================== --- stable/8/usr.sbin/sysinstall/package.c Wed Jul 3 20:54:25 2013 (r252600) +++ stable/8/usr.sbin/sysinstall/package.c Wed Jul 3 20:55:49 2013 (r252601) @@ -106,7 +106,7 @@ package_installed(char *name) /* XXX KLUDGE ALERT! This makes evil assumptions about how XXX * packages register themselves and should *really be done with - * `pkg_info -e ' except that this it's too slow for an + * `pkg_info -e ' except that this is too slow for an * item check routine.. :-( */ snprintf(fname, FILENAME_MAX, "/var/db/pkg/%s", name); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 21:05:35 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DA9C0DF9; Wed, 3 Jul 2013 21:05:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CCAB61852; Wed, 3 Jul 2013 21:05:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63L5ZLw016181; Wed, 3 Jul 2013 21:05:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63L5ZMK016180; Wed, 3 Jul 2013 21:05:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032105.r63L5ZMK016180@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:05: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: r252604 - stable/9/lib/libc/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.14 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, 03 Jul 2013 21:05:35 -0000 Author: jilles Date: Wed Jul 3 21:05:35 2013 New Revision: 252604 URL: http://svnweb.freebsd.org/changeset/base/252604 Log: MFC r250982: sigreturn(2): Remove ancient compatibility warning about 4.2BSD The HISTORY subsection still says that sigreturn() was added in 4.3BSD. Modified: stable/9/lib/libc/sys/sigreturn.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/sigreturn.2 ============================================================================== --- stable/9/lib/libc/sys/sigreturn.2 Wed Jul 3 21:04:20 2013 (r252603) +++ stable/9/lib/libc/sys/sigreturn.2 Wed Jul 3 21:05:35 2013 (r252604) @@ -56,10 +56,6 @@ Execution resumes at the specified pc. This system call is used by the trampoline code and .Xr longjmp 3 when returning from a signal to the previously executing program. -.Sh NOTES -This system call is not available in -.Bx 4.2 -hence it should not be used if backward compatibility is needed. .Sh RETURN VALUES If successful, the system call does not return. Otherwise, a value of -1 is returned and From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 21:11:56 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BD6BF2AC; Wed, 3 Jul 2013 21:11:56 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF8EA18BC; Wed, 3 Jul 2013 21:11:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LBubr018978; Wed, 3 Jul 2013 21:11:56 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LBuY2018977; Wed, 3 Jul 2013 21:11:56 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032111.r63LBuY2018977@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:11: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: r252606 - stable/9/bin/sleep 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.14 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, 03 Jul 2013 21:11:56 -0000 Author: jilles Date: Wed Jul 3 21:11:56 2013 New Revision: 252606 URL: http://svnweb.freebsd.org/changeset/base/252606 Log: MFC r251078,r251433: sleep: Improve nanosleep() error handling: * Work around kernel bugs that cause a spurious [EINTR] return if a debugger (such as truss(1)) is attached. * Write an error message if an error other than [EINTR] occurs. PR: bin/178664 Modified: stable/9/bin/sleep/sleep.c Directory Properties: stable/9/bin/sleep/ (props changed) Modified: stable/9/bin/sleep/sleep.c ============================================================================== --- stable/9/bin/sleep/sleep.c Wed Jul 3 21:07:02 2013 (r252605) +++ stable/9/bin/sleep/sleep.c Wed Jul 3 21:11:56 2013 (r252606) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -81,14 +82,20 @@ main(int argc, char *argv[]) time_to_sleep.tv_nsec = 1e9 * (d - time_to_sleep.tv_sec); signal(SIGINFO, report_request); + + /* + * Note: [EINTR] is supposed to happen only when a signal was handled + * but the kernel also returns it when a ptrace-based debugger + * attaches. This is a bug but it is hard to fix. + */ while (nanosleep(&time_to_sleep, &time_to_sleep) != 0) { if (report_requested) { /* Reporting does not bother with nanoseconds. */ warnx("about %d second(s) left out of the original %d", (int)time_to_sleep.tv_sec, (int)original); report_requested = 0; - } else - break; + } else if (errno != EINTR) + err(1, "nanosleep"); } return (0); } From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 21:14:57 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AD64F413; Wed, 3 Jul 2013 21:14:57 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0F118DF; Wed, 3 Jul 2013 21:14:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LEvOG019452; Wed, 3 Jul 2013 21:14:57 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LEvO4019451; Wed, 3 Jul 2013 21:14:57 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032114.r63LEvO4019451@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:14: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: r252607 - stable/9/bin/test 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.14 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, 03 Jul 2013 21:14:57 -0000 Author: jilles Date: Wed Jul 3 21:14:57 2013 New Revision: 252607 URL: http://svnweb.freebsd.org/changeset/base/252607 Log: MFC r251209: test(1): List non-standard primaries. Modified: stable/9/bin/test/test.1 Directory Properties: stable/9/bin/test/ (props changed) Modified: stable/9/bin/test/test.1 ============================================================================== --- stable/9/bin/test/test.1 Wed Jul 3 21:11:56 2013 (r252606) +++ stable/9/bin/test/test.1 Wed Jul 3 21:14:57 2013 (r252607) @@ -32,7 +32,7 @@ .\" @(#)test.1 8.1 (Berkeley) 5/31/93 .\" $FreeBSD$ .\" -.Dd December 27, 2012 +.Dd June 1, 2013 .Dt TEST 1 .Os .Sh NAME @@ -349,6 +349,17 @@ The utility implements a superset of the .St -p1003.2 specification. +The primaries +.Cm < , +.Cm == , +.Cm > , +.Fl ef , +.Fl nt , +.Fl ot , +.Fl G , +and +.Fl O +are extensions. .Sh BUGS Both sides are always evaluated in .Fl a From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 21:22:47 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B376E7A7; Wed, 3 Jul 2013 21:22:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A586C1925; Wed, 3 Jul 2013 21:22:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LMlNn022205; Wed, 3 Jul 2013 21:22:47 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LMlgV022204; Wed, 3 Jul 2013 21:22:47 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032122.r63LMlgV022204@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:22: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: r252609 - stable/9/bin/sh 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.14 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, 03 Jul 2013 21:22:47 -0000 Author: jilles Date: Wed Jul 3 21:22:47 2013 New Revision: 252609 URL: http://svnweb.freebsd.org/changeset/base/252609 Log: MFC r248692: sh(1): Mention possible ambiguities with $(( and ((. In some other shells, things like $((a);(b)) are command substitutions. Also, there are shells that have an extension ((ARITH)) that evaluates an arithmetic expression and returns status 1 if the result is zero, 0 otherwise. This extension may lead to ambiguity with two subshells starting in sequence. Modified: stable/9/bin/sh/sh.1 Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/sh.1 ============================================================================== --- stable/9/bin/sh/sh.1 Wed Jul 3 21:21:54 2013 (r252608) +++ stable/9/bin/sh/sh.1 Wed Jul 3 21:22:47 2013 (r252609) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd November 5, 2011 +.Dd March 24, 2013 .Dt SH 1 .Os .Sh NAME @@ -1061,6 +1061,9 @@ A subshell environment may be implemente If job control is enabled in an interactive shell, commands grouped in parentheses can be suspended and continued as a unit. .Pp +For compatibility with other shells, +two open parentheses in sequence should be separated by whitespace. +.Pp The second form never forks another shell, so it is slightly more efficient. Grouping commands together this way allows the user to @@ -1604,6 +1607,16 @@ and .Ic times returns information about the same process if they are the only command in a command substitution. +.Pp +If a command substitution of the +.Li $( +form begins with a subshell, +the +.Li $( +and +.Li ( +must be separated by whitespace +to avoid ambiguity with arithmetic expansion. .Ss Arithmetic Expansion Arithmetic expansion provides a mechanism for evaluating an arithmetic expression and substituting its value. From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 21:25:47 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3D43190A; Wed, 3 Jul 2013 21:25:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DFFD1946; Wed, 3 Jul 2013 21:25:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LPk9q022609; Wed, 3 Jul 2013 21:25:46 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LPkq4022608; Wed, 3 Jul 2013 21:25:46 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032125.r63LPkq4022608@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:25: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: r252610 - stable/9/bin/sh 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.14 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, 03 Jul 2013 21:25:47 -0000 Author: jilles Date: Wed Jul 3 21:25:46 2013 New Revision: 252610 URL: http://svnweb.freebsd.org/changeset/base/252610 Log: MFC r248870 by joel: Minor mdoc fix in previous commit. Modified: stable/9/bin/sh/sh.1 Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/sh.1 ============================================================================== --- stable/9/bin/sh/sh.1 Wed Jul 3 21:22:47 2013 (r252609) +++ stable/9/bin/sh/sh.1 Wed Jul 3 21:25:46 2013 (r252610) @@ -1614,7 +1614,7 @@ form begins with a subshell, the .Li $( and -.Li ( +.Li (\& must be separated by whitespace to avoid ambiguity with arithmetic expansion. .Ss Arithmetic Expansion From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 21:31:13 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BAC38CE6; Wed, 3 Jul 2013 21:31:13 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AD16D1995; Wed, 3 Jul 2013 21:31:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LVDer024995; Wed, 3 Jul 2013 21:31:13 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LVDO1024994; Wed, 3 Jul 2013 21:31:13 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032131.r63LVDO1024994@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:31: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: r252611 - stable/9/bin/sh 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.14 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, 03 Jul 2013 21:31:13 -0000 Author: jilles Date: Wed Jul 3 21:31:13 2013 New Revision: 252611 URL: http://svnweb.freebsd.org/changeset/base/252611 Log: MFC r251763: sh(1): A subshell environment has its own rlimits (ulimit). This has always been the case and is intended (just like cd). This matches Austin group issue #706. Modified: stable/9/bin/sh/sh.1 Directory Properties: stable/9/bin/sh/ (props changed) Modified: stable/9/bin/sh/sh.1 ============================================================================== --- stable/9/bin/sh/sh.1 Wed Jul 3 21:25:46 2013 (r252610) +++ stable/9/bin/sh/sh.1 Wed Jul 3 21:31:13 2013 (r252611) @@ -32,7 +32,7 @@ .\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95 .\" $FreeBSD$ .\" -.Dd March 24, 2013 +.Dd June 14, 2013 .Dt SH 1 .Os .Sh NAME @@ -1036,6 +1036,9 @@ The current working directory as set by The file creation mask as set by .Ic umask . .It +Resource limits as set by +.Ic ulimit . +.It References to open files. .It Traps as set by From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 21:43:44 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C0A833FA; Wed, 3 Jul 2013 21:43:44 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A224A1A27; Wed, 3 Jul 2013 21:43:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Lhi5E028190; Wed, 3 Jul 2013 21:43:44 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LhgTQ028171; Wed, 3 Jul 2013 21:43:42 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032143.r63LhgTQ028171@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:43: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: r252613 - in stable/9/tools/regression/bin/sh: builtins execution expansion 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.14 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, 03 Jul 2013 21:43:44 -0000 Author: jilles Date: Wed Jul 3 21:43:41 2013 New Revision: 252613 URL: http://svnweb.freebsd.org/changeset/base/252613 Log: MFC r245383,245392,247190,249220,251180,251797: New sh testcases. These already work on stable/9. Added: stable/9/tools/regression/bin/sh/builtins/break4.4 - copied unchanged from r251180, head/tools/regression/bin/sh/builtins/break4.4 stable/9/tools/regression/bin/sh/builtins/break5.4 - copied unchanged from r251180, head/tools/regression/bin/sh/builtins/break5.4 stable/9/tools/regression/bin/sh/builtins/eval6.0 - copied unchanged from r249220, head/tools/regression/bin/sh/builtins/eval6.0 stable/9/tools/regression/bin/sh/builtins/local2.0 - copied unchanged from r251797, head/tools/regression/bin/sh/builtins/local2.0 stable/9/tools/regression/bin/sh/builtins/local3.0 - copied unchanged from r251797, head/tools/regression/bin/sh/builtins/local3.0 stable/9/tools/regression/bin/sh/builtins/read6.0 - copied unchanged from r247190, head/tools/regression/bin/sh/builtins/read6.0 stable/9/tools/regression/bin/sh/execution/subshell1.0 - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell1.0 stable/9/tools/regression/bin/sh/execution/subshell1.0.stdout - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell1.0.stdout stable/9/tools/regression/bin/sh/execution/subshell2.0 - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell2.0 stable/9/tools/regression/bin/sh/execution/subshell3.0 - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell3.0 stable/9/tools/regression/bin/sh/execution/subshell4.0 - copied unchanged from r245383, head/tools/regression/bin/sh/execution/subshell4.0 stable/9/tools/regression/bin/sh/expansion/cmdsubst16.0 - copied unchanged from r245392, head/tools/regression/bin/sh/expansion/cmdsubst16.0 Modified: Directory Properties: stable/9/tools/regression/bin/sh/ (props changed) Copied: stable/9/tools/regression/bin/sh/builtins/break4.4 (from r251180, head/tools/regression/bin/sh/builtins/break4.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/break4.4 Wed Jul 3 21:43:41 2013 (r252613, copy of r251180, head/tools/regression/bin/sh/builtins/break4.4) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0) +# appear to depend on it. + +break +exit 4 Copied: stable/9/tools/regression/bin/sh/builtins/break5.4 (from r251180, head/tools/regression/bin/sh/builtins/break5.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/break5.4 Wed Jul 3 21:43:41 2013 (r252613, copy of r251180, head/tools/regression/bin/sh/builtins/break5.4) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +# Although this is not specified by POSIX, some configure scripts (gawk 4.1.0) +# appear to depend on it. +# In some uncommitted code, the subshell environment corrupted the outer +# shell environment's state. + +(for i in a b c; do + exit 3 +done) +break +exit 4 Copied: stable/9/tools/regression/bin/sh/builtins/eval6.0 (from r249220, head/tools/regression/bin/sh/builtins/eval6.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/eval6.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r249220, head/tools/regression/bin/sh/builtins/eval6.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +# eval should preserve $? from command substitutions when starting +# the parsed command. +[ $(false; eval 'echo $?' $(:)) = 0 ] Copied: stable/9/tools/regression/bin/sh/builtins/local2.0 (from r251797, head/tools/regression/bin/sh/builtins/local2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/local2.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r251797, head/tools/regression/bin/sh/builtins/local2.0) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +f() { + local - + set -a + case $- in + *a*) : ;; + *) echo In-function \$- bad + esac +} +case $- in +*a*) echo Initial \$- bad +esac +f +case $- in +*a*) echo Final \$- bad +esac Copied: stable/9/tools/regression/bin/sh/builtins/local3.0 (from r251797, head/tools/regression/bin/sh/builtins/local3.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/local3.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r251797, head/tools/regression/bin/sh/builtins/local3.0) @@ -0,0 +1,26 @@ +# $FreeBSD$ + +f() { + local "$@" + set -a + x=7 + case $- in + *a*) : ;; + *) echo In-function \$- bad + esac + [ "$x" = 7 ] || echo In-function \$x bad +} +x=1 +case $- in +*a*) echo Initial \$- bad +esac +f x - +case $- in +*a*) echo Intermediate \$- bad +esac +[ "$x" = 1 ] || echo Intermediate \$x bad +f - x +case $- in +*a*) echo Final \$- bad +esac +[ "$x" = 1 ] || echo Final \$x bad Copied: stable/9/tools/regression/bin/sh/builtins/read6.0 (from r247190, head/tools/regression/bin/sh/builtins/read6.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/read6.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r247190, head/tools/regression/bin/sh/builtins/read6.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +: | read x +r=$? +[ "$r" = 1 ] Copied: stable/9/tools/regression/bin/sh/execution/subshell1.0 (from r245383, head/tools/regression/bin/sh/execution/subshell1.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell1.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell1.0) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +(eval "cd / +v=$(printf %0100000d 1) +echo \${#v}") +echo end Copied: stable/9/tools/regression/bin/sh/execution/subshell1.0.stdout (from r245383, head/tools/regression/bin/sh/execution/subshell1.0.stdout) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell1.0.stdout Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell1.0.stdout) @@ -0,0 +1,2 @@ +100000 +end Copied: stable/9/tools/regression/bin/sh/execution/subshell2.0 (from r245383, head/tools/regression/bin/sh/execution/subshell2.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell2.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell2.0) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +f() { + x=2 +} +( + x=1 + f + [ "$x" = 2 ] +) Copied: stable/9/tools/regression/bin/sh/execution/subshell3.0 (from r245383, head/tools/regression/bin/sh/execution/subshell3.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell3.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell3.0) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +(false; exit) && exit 3 +exit 0 Copied: stable/9/tools/regression/bin/sh/execution/subshell4.0 (from r245383, head/tools/regression/bin/sh/execution/subshell4.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/execution/subshell4.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245383, head/tools/regression/bin/sh/execution/subshell4.0) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +(eval "set v=1"; false) && echo bad; : Copied: stable/9/tools/regression/bin/sh/expansion/cmdsubst16.0 (from r245392, head/tools/regression/bin/sh/expansion/cmdsubst16.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/expansion/cmdsubst16.0 Wed Jul 3 21:43:41 2013 (r252613, copy of r245392, head/tools/regression/bin/sh/expansion/cmdsubst16.0) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +f() { return 3; } +f +[ `echo $?` = 3 ] From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 21:56:26 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E28ECB98; Wed, 3 Jul 2013 21:56:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BB15D1AD5; Wed, 3 Jul 2013 21:56:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63LuQgo031550; Wed, 3 Jul 2013 21:56:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63LuQqi031547; Wed, 3 Jul 2013 21:56:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032156.r63LuQqi031547@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 21:56:26 +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: r252617 - in stable/9: bin/sh tools/regression/bin/sh/builtins 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.14 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, 03 Jul 2013 21:56:27 -0000 Author: jilles Date: Wed Jul 3 21:56:25 2013 New Revision: 252617 URL: http://svnweb.freebsd.org/changeset/base/252617 Log: MFC r248349: sh: Recognize "--" and explicitly reject options in wait builtin. If syntactically invalid job identifiers are to be taken as jobs that exited with status 127, this should not apply to options, so that we can add options later if need be. Added: stable/9/tools/regression/bin/sh/builtins/wait6.0 - copied unchanged from r248349, head/tools/regression/bin/sh/builtins/wait6.0 stable/9/tools/regression/bin/sh/builtins/wait7.0 - copied unchanged from r248349, head/tools/regression/bin/sh/builtins/wait7.0 Modified: stable/9/bin/sh/jobs.c Directory Properties: stable/9/bin/sh/ (props changed) stable/9/tools/regression/bin/sh/ (props changed) Modified: stable/9/bin/sh/jobs.c ============================================================================== --- stable/9/bin/sh/jobs.c Wed Jul 3 21:53:54 2013 (r252616) +++ stable/9/bin/sh/jobs.c Wed Jul 3 21:56:25 2013 (r252617) @@ -459,14 +459,15 @@ freejob(struct job *jp) int -waitcmd(int argc, char **argv) +waitcmd(int argc __unused, char **argv __unused) { struct job *job; int status, retval; struct job *jp; - if (argc > 1) { - job = getjob(argv[1]); + nextopt(""); + if (*argptr != NULL) { + job = getjob(*argptr); } else { job = NULL; } Copied: stable/9/tools/regression/bin/sh/builtins/wait6.0 (from r248349, head/tools/regression/bin/sh/builtins/wait6.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/wait6.0 Wed Jul 3 21:56:25 2013 (r252617, copy of r248349, head/tools/regression/bin/sh/builtins/wait6.0) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +wait -- Copied: stable/9/tools/regression/bin/sh/builtins/wait7.0 (from r248349, head/tools/regression/bin/sh/builtins/wait7.0) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/bin/sh/builtins/wait7.0 Wed Jul 3 21:56:25 2013 (r252617, copy of r248349, head/tools/regression/bin/sh/builtins/wait7.0) @@ -0,0 +1,4 @@ +# $FreeBSD$ + +: & +wait -- $! From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 22:04:35 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C119A45C; Wed, 3 Jul 2013 22:04:35 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B27251B3A; Wed, 3 Jul 2013 22:04:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63M4ZAw034657; Wed, 3 Jul 2013 22:04:35 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63M4ZNk034656; Wed, 3 Jul 2013 22:04:35 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032204.r63M4ZNk034656@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 22:04: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: r252622 - stable/9/lib/libc/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.14 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, 03 Jul 2013 22:04:35 -0000 Author: jilles Date: Wed Jul 3 22:04:35 2013 New Revision: 252622 URL: http://svnweb.freebsd.org/changeset/base/252622 Log: MFC r248774: accept(2): Mention inheritance of O_ASYNC and signal destination. While almost nobody uses O_ASYNC, and rightly so, the inheritance of the related properties across accept() is a portability issue like the inheritance of O_NONBLOCK. Modified: stable/9/lib/libc/sys/accept.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/accept.2 ============================================================================== --- stable/9/lib/libc/sys/accept.2 Wed Jul 3 22:03:19 2013 (r252621) +++ stable/9/lib/libc/sys/accept.2 Wed Jul 3 22:04:35 2013 (r252622) @@ -28,7 +28,7 @@ .\" @(#)accept.2 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd December 11, 1993 +.Dd March 26, 2013 .Dt ACCEPT 2 .Os .Sh NAME @@ -57,7 +57,13 @@ queue of pending connections, creates a and allocates a new file descriptor for the socket which inherits the state of the .Dv O_NONBLOCK -property from the original socket +and +.Dv O_ASYNC +properties and the destination of +.Dv SIGIO +and +.Dv SIGURG +signals from the original socket .Fa s . .Pp If no pending connections are @@ -129,7 +135,11 @@ to pre-process incoming connections. .Pp Portable programs should not rely on the .Dv O_NONBLOCK -property being inherited. +and +.Dv O_ASYNC +properties and the signal destination being inherited, +but should set them explicitly using +.Xr fcntl 2 . .Sh RETURN VALUES The call returns \-1 on error. If it succeeds, it returns a non-negative From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 22:14:13 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 79E9EAEA; Wed, 3 Jul 2013 22:14:13 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6BDF91BA5; Wed, 3 Jul 2013 22:14:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MEDQ3038133; Wed, 3 Jul 2013 22:14:13 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MEDtA038132; Wed, 3 Jul 2013 22:14:13 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307032214.r63MEDtA038132@svn.freebsd.org> From: Jilles Tjoelker Date: Wed, 3 Jul 2013 22:14: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: r252627 - stable/9/lib/libc/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.14 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, 03 Jul 2013 22:14:13 -0000 Author: jilles Date: Wed Jul 3 22:14:12 2013 New Revision: 252627 URL: http://svnweb.freebsd.org/changeset/base/252627 Log: MFC r251181: fork(2): #include is not needed. Modified: stable/9/lib/libc/sys/fork.2 Directory Properties: stable/9/lib/libc/ (props changed) stable/9/lib/libc/sys/ (props changed) Modified: stable/9/lib/libc/sys/fork.2 ============================================================================== --- stable/9/lib/libc/sys/fork.2 Wed Jul 3 22:12:54 2013 (r252626) +++ stable/9/lib/libc/sys/fork.2 Wed Jul 3 22:14:12 2013 (r252627) @@ -28,7 +28,7 @@ .\" @(#)fork.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd May 31, 2013 .Dt FORK 2 .Os .Sh NAME @@ -37,7 +37,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In sys/types.h .In unistd.h .Ft pid_t .Fn fork void From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 22:25:00 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CF65860E; Wed, 3 Jul 2013 22:25:00 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C1E8D1C0A; Wed, 3 Jul 2013 22:25:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MP0xO041479; Wed, 3 Jul 2013 22:25:00 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MP07w041478; Wed, 3 Jul 2013 22:25:00 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307032225.r63MP07w041478@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 3 Jul 2013 22:25: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: r252635 - stable/9/usr.sbin/pkg_install/lib 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.14 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, 03 Jul 2013 22:25:00 -0000 Author: obrien Date: Wed Jul 3 22:25:00 2013 New Revision: 252635 URL: http://svnweb.freebsd.org/changeset/base/252635 Log: MFC: r252348, r252363: sysconf(3) returns a long, not an int. Modified: stable/9/usr.sbin/pkg_install/lib/exec.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/pkg_install/ (props changed) Modified: stable/9/usr.sbin/pkg_install/lib/exec.c ============================================================================== --- stable/9/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 22:23:25 2013 (r252634) +++ stable/9/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 22:25:00 2013 (r252635) @@ -34,7 +34,8 @@ vsystem(const char *fmt, ...) { va_list args; char *cmd; - int ret, maxargs; + long maxargs; + int ret; maxargs = sysconf(_SC_ARG_MAX); maxargs -= 32; /* some slop for the sh -c */ From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 22:57:21 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 782BFD0; Wed, 3 Jul 2013 22:57:21 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 500081CFE; Wed, 3 Jul 2013 22:57:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63MvLZX050453; Wed, 3 Jul 2013 22:57:21 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MvKhd050450; Wed, 3 Jul 2013 22:57:20 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307032257.r63MvKhd050450@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 3 Jul 2013 22:57: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: r252638 - in stable/9/usr.sbin/pkg_install: add create lib 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.14 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, 03 Jul 2013 22:57:21 -0000 Author: obrien Date: Wed Jul 3 22:57:20 2013 New Revision: 252638 URL: http://svnweb.freebsd.org/changeset/base/252638 Log: Really MFC r252363 (sysconf(3) returns a long, not an int). Modified: stable/9/usr.sbin/pkg_install/add/extract.c stable/9/usr.sbin/pkg_install/create/pl.c stable/9/usr.sbin/pkg_install/lib/exec.c Directory Properties: stable/9/ (props changed) stable/9/usr.sbin/ (props changed) stable/9/usr.sbin/pkg_install/ (props changed) stable/9/usr.sbin/pkg_install/add/ (props changed) Modified: stable/9/usr.sbin/pkg_install/add/extract.c ============================================================================== --- stable/9/usr.sbin/pkg_install/add/extract.c Wed Jul 3 22:46:30 2013 (r252637) +++ stable/9/usr.sbin/pkg_install/add/extract.c Wed Jul 3 22:57:20 2013 (r252638) @@ -110,7 +110,8 @@ extract_plist(const char *home, Package PackingList p = pkg->head; char *last_file, *prefix = NULL; char *where_args, *perm_args, *last_chdir; - int maxargs, where_count = 0, perm_count = 0, add_count; + long maxargs; + int where_count = 0, perm_count = 0, add_count; Boolean preserve; maxargs = sysconf(_SC_ARG_MAX) / 2; /* Just use half the argument space */ Modified: stable/9/usr.sbin/pkg_install/create/pl.c ============================================================================== --- stable/9/usr.sbin/pkg_install/create/pl.c Wed Jul 3 22:46:30 2013 (r252637) +++ stable/9/usr.sbin/pkg_install/create/pl.c Wed Jul 3 22:57:20 2013 (r252638) @@ -140,7 +140,8 @@ copy_plist(const char *home, Package *pl const char *there = NULL, *mythere; char *where_args, *prefix = NULL; const char *last_chdir, *root = "/"; - int maxargs, where_count = 0, add_count; + long maxargs; + int where_count = 0, add_count; struct stat stb; dev_t curdir; Modified: stable/9/usr.sbin/pkg_install/lib/exec.c ============================================================================== --- stable/9/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 22:46:30 2013 (r252637) +++ stable/9/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 22:57:20 2013 (r252638) @@ -64,7 +64,7 @@ vpipe(const char *fmt, ...) { FILE *fp; char *cmd, *rp; - int maxargs; + long maxargs; va_list args; rp = malloc(MAXPATHLEN); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 22:59:47 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 87833225; Wed, 3 Jul 2013 22:59:47 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5F2991D11; Wed, 3 Jul 2013 22:59:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Mxlsi050781; Wed, 3 Jul 2013 22:59:47 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63MxkdY050778; Wed, 3 Jul 2013 22:59:46 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307032259.r63MxkdY050778@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 3 Jul 2013 22:59:46 +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: r252639 - in stable/8/usr.sbin/pkg_install: add create lib 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.14 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, 03 Jul 2013 22:59:47 -0000 Author: obrien Date: Wed Jul 3 22:59:46 2013 New Revision: 252639 URL: http://svnweb.freebsd.org/changeset/base/252639 Log: MF9: r252635, r252638: MFC: r252348, r252363: sysconf(3) returns a long, not an int. Modified: stable/8/usr.sbin/pkg_install/add/extract.c stable/8/usr.sbin/pkg_install/create/pl.c stable/8/usr.sbin/pkg_install/lib/exec.c Directory Properties: stable/8/ (props changed) stable/8/usr.sbin/ (props changed) stable/8/usr.sbin/pkg_install/ (props changed) stable/8/usr.sbin/pkg_install/add/ (props changed) Modified: stable/8/usr.sbin/pkg_install/add/extract.c ============================================================================== --- stable/8/usr.sbin/pkg_install/add/extract.c Wed Jul 3 22:57:20 2013 (r252638) +++ stable/8/usr.sbin/pkg_install/add/extract.c Wed Jul 3 22:59:46 2013 (r252639) @@ -110,7 +110,8 @@ extract_plist(const char *home, Package PackingList p = pkg->head; char *last_file, *prefix = NULL; char *where_args, *perm_args, *last_chdir; - int maxargs, where_count = 0, perm_count = 0, add_count; + long maxargs; + int where_count = 0, perm_count = 0, add_count; Boolean preserve; maxargs = sysconf(_SC_ARG_MAX) / 2; /* Just use half the argument space */ Modified: stable/8/usr.sbin/pkg_install/create/pl.c ============================================================================== --- stable/8/usr.sbin/pkg_install/create/pl.c Wed Jul 3 22:57:20 2013 (r252638) +++ stable/8/usr.sbin/pkg_install/create/pl.c Wed Jul 3 22:59:46 2013 (r252639) @@ -140,7 +140,8 @@ copy_plist(const char *home, Package *pl const char *there = NULL, *mythere; char *where_args, *prefix = NULL; const char *last_chdir, *root = "/"; - int maxargs, where_count = 0, add_count; + long maxargs; + int where_count = 0, add_count; struct stat stb; dev_t curdir; Modified: stable/8/usr.sbin/pkg_install/lib/exec.c ============================================================================== --- stable/8/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 22:57:20 2013 (r252638) +++ stable/8/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 22:59:46 2013 (r252639) @@ -34,7 +34,8 @@ vsystem(const char *fmt, ...) { va_list args; char *cmd; - int ret, maxargs; + long maxargs; + int ret; maxargs = sysconf(_SC_ARG_MAX); maxargs -= 32; /* some slop for the sh -c */ @@ -64,7 +65,7 @@ vpipe(const char *fmt, ...) { FILE *fp; char *cmd, *rp; - int maxargs; + long maxargs; va_list args; rp = malloc(MAXPATHLEN); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:03:29 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 979CC381; Wed, 3 Jul 2013 23:03:29 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6EE5A1D21; Wed, 3 Jul 2013 23:03:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63N3TdW053241; Wed, 3 Jul 2013 23:03:29 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63N3SQx053236; Wed, 3 Jul 2013 23:03:28 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307032303.r63N3SQx053236@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 3 Jul 2013 23:03:28 +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: r252640 - in stable/7/usr.sbin/pkg_install: add create lib 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.14 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, 03 Jul 2013 23:03:29 -0000 Author: obrien Date: Wed Jul 3 23:03:28 2013 New Revision: 252640 URL: http://svnweb.freebsd.org/changeset/base/252640 Log: MF8: r252639 MF9: r252635, r252638: MFC: r252348, r252363: sysconf(3) returns a long, not an int. Modified: stable/7/usr.sbin/pkg_install/add/extract.c stable/7/usr.sbin/pkg_install/create/pl.c stable/7/usr.sbin/pkg_install/lib/exec.c Directory Properties: stable/7/ (props changed) stable/7/usr.sbin/ (props changed) stable/7/usr.sbin/pkg_install/ (props changed) Modified: stable/7/usr.sbin/pkg_install/add/extract.c ============================================================================== --- stable/7/usr.sbin/pkg_install/add/extract.c Wed Jul 3 22:59:46 2013 (r252639) +++ stable/7/usr.sbin/pkg_install/add/extract.c Wed Jul 3 23:03:28 2013 (r252640) @@ -110,7 +110,8 @@ extract_plist(const char *home, Package PackingList p = pkg->head; char *last_file, *prefix = NULL; char *where_args, *perm_args, *last_chdir; - int maxargs, where_count = 0, perm_count = 0, add_count; + long maxargs; + int where_count = 0, perm_count = 0, add_count; Boolean preserve; maxargs = sysconf(_SC_ARG_MAX) / 2; /* Just use half the argument space */ Modified: stable/7/usr.sbin/pkg_install/create/pl.c ============================================================================== --- stable/7/usr.sbin/pkg_install/create/pl.c Wed Jul 3 22:59:46 2013 (r252639) +++ stable/7/usr.sbin/pkg_install/create/pl.c Wed Jul 3 23:03:28 2013 (r252640) @@ -140,7 +140,8 @@ copy_plist(const char *home, Package *pl const char *there = NULL, *mythere; char *where_args, *prefix = NULL; const char *last_chdir, *root = "/"; - int maxargs, where_count = 0, add_count; + long maxargs; + int where_count = 0, add_count; struct stat stb; dev_t curdir; Modified: stable/7/usr.sbin/pkg_install/lib/exec.c ============================================================================== --- stable/7/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 22:59:46 2013 (r252639) +++ stable/7/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 23:03:28 2013 (r252640) @@ -34,7 +34,8 @@ vsystem(const char *fmt, ...) { va_list args; char *cmd; - int ret, maxargs; + long maxargs; + int ret; maxargs = sysconf(_SC_ARG_MAX); maxargs -= 32; /* some slop for the sh -c */ @@ -63,7 +64,7 @@ vpipe(const char *fmt, ...) { FILE *fp; char *cmd, *rp; - int maxargs; + long maxargs; va_list args; rp = malloc(MAXPATHLEN); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:06:59 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CC7A76D4; Wed, 3 Jul 2013 23:06:59 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A43F21D4D; Wed, 3 Jul 2013 23:06:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63N6xYw053925; Wed, 3 Jul 2013 23:06:59 GMT (envelope-from obrien@svn.freebsd.org) Received: (from obrien@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63N6xRZ053920; Wed, 3 Jul 2013 23:06:59 GMT (envelope-from obrien@svn.freebsd.org) Message-Id: <201307032306.r63N6xRZ053920@svn.freebsd.org> From: "David E. O'Brien" Date: Wed, 3 Jul 2013 23:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org Subject: svn commit: r252642 - in stable/6/usr.sbin/pkg_install: add create lib X-SVN-Group: stable-6 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.14 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, 03 Jul 2013 23:06:59 -0000 Author: obrien Date: Wed Jul 3 23:06:58 2013 New Revision: 252642 URL: http://svnweb.freebsd.org/changeset/base/252642 Log: MF7: r252640 MF8: r252639 MF9: r252635, r252638: MFC: r252348, r252363: sysconf(3) returns a long, not an int. Modified: stable/6/usr.sbin/pkg_install/add/extract.c stable/6/usr.sbin/pkg_install/create/pl.c stable/6/usr.sbin/pkg_install/lib/exec.c Directory Properties: stable/6/ (props changed) stable/6/usr.sbin/pkg_install/ (props changed) Modified: stable/6/usr.sbin/pkg_install/add/extract.c ============================================================================== --- stable/6/usr.sbin/pkg_install/add/extract.c Wed Jul 3 23:05:17 2013 (r252641) +++ stable/6/usr.sbin/pkg_install/add/extract.c Wed Jul 3 23:06:58 2013 (r252642) @@ -110,7 +110,8 @@ extract_plist(const char *home, Package PackingList p = pkg->head; char *last_file, *prefix = NULL; char *where_args, *perm_args, *last_chdir; - int maxargs, where_count = 0, perm_count = 0, add_count; + long maxargs; + int where_count = 0, perm_count = 0, add_count; Boolean preserve; maxargs = sysconf(_SC_ARG_MAX) / 2; /* Just use half the argument space */ Modified: stable/6/usr.sbin/pkg_install/create/pl.c ============================================================================== --- stable/6/usr.sbin/pkg_install/create/pl.c Wed Jul 3 23:05:17 2013 (r252641) +++ stable/6/usr.sbin/pkg_install/create/pl.c Wed Jul 3 23:06:58 2013 (r252642) @@ -140,7 +140,8 @@ copy_plist(const char *home, Package *pl const char *there = NULL, *mythere; char *where_args, *prefix = NULL; const char *last_chdir, *root = "/"; - int maxargs, where_count = 0, add_count; + long maxargs; + int where_count = 0, add_count; struct stat stb; dev_t curdir; Modified: stable/6/usr.sbin/pkg_install/lib/exec.c ============================================================================== --- stable/6/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 23:05:17 2013 (r252641) +++ stable/6/usr.sbin/pkg_install/lib/exec.c Wed Jul 3 23:06:58 2013 (r252642) @@ -34,7 +34,8 @@ vsystem(const char *fmt, ...) { va_list args; char *cmd; - int ret, maxargs; + long maxargs; + int ret; maxargs = sysconf(_SC_ARG_MAX); maxargs -= 32; /* some slop for the sh -c */ @@ -63,7 +64,7 @@ vpipe(const char *fmt, ...) { FILE *fp; char *cmd, *rp; - int maxargs; + long maxargs; va_list args; rp = malloc(MAXPATHLEN); From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:15:31 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4047F9C3; Wed, 3 Jul 2013 23:15:31 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 224D61DBB; Wed, 3 Jul 2013 23:15:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NFVik056839; Wed, 3 Jul 2013 23:15:31 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NFU3j056833; Wed, 3 Jul 2013 23:15:30 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307032315.r63NFU3j056833@svn.freebsd.org> From: Mark Johnston Date: Wed, 3 Jul 2013 23:15:30 +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: r252643 - stable/9/sys/dev/mfi 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.14 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, 03 Jul 2013 23:15:31 -0000 Author: markj Date: Wed Jul 3 23:15:30 2013 New Revision: 252643 URL: http://svnweb.freebsd.org/changeset/base/252643 Log: MFC r242726 (ambrisko): Add support for SCSI pass through devices to be attached and detached. MFC r251172 (sbruno): xpt_create_path() requires mfi_io_lock to be held, so do it. mfi(4) doesn't panic on host startup now. Modified: stable/9/sys/dev/mfi/mfi.c stable/9/sys/dev/mfi/mfi_cam.c stable/9/sys/dev/mfi/mfivar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mfi/mfi.c ============================================================================== --- stable/9/sys/dev/mfi/mfi.c Wed Jul 3 23:06:58 2013 (r252642) +++ stable/9/sys/dev/mfi/mfi.c Wed Jul 3 23:15:30 2013 (r252643) @@ -1628,6 +1628,11 @@ mfi_decode_evt(struct mfi_softc *sc, str sx_xunlock(&sc->mfi_config_lock); } } + if (sc->mfi_cam_rescan_cb != NULL && + (detail->code == MR_EVT_PD_INSERTED || + detail->code == MR_EVT_PD_REMOVED)) { + sc->mfi_cam_rescan_cb(sc, detail->args.pd.device_id); + } break; } } Modified: stable/9/sys/dev/mfi/mfi_cam.c ============================================================================== --- stable/9/sys/dev/mfi/mfi_cam.c Wed Jul 3 23:06:58 2013 (r252642) +++ stable/9/sys/dev/mfi/mfi_cam.c Wed Jul 3 23:15:30 2013 (r252643) @@ -50,7 +50,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -63,12 +65,19 @@ __FBSDID("$FreeBSD$"); #include #include +enum mfip_state { + MFIP_STATE_NONE, + MFIP_STATE_DETACH, + MFIP_STATE_RESCAN +}; + struct mfip_softc { device_t dev; struct mfi_softc *mfi_sc; struct cam_devq *devq; struct cam_sim *sim; struct cam_path *path; + enum mfip_state state; }; static int mfip_probe(device_t); @@ -76,6 +85,7 @@ static int mfip_attach(device_t); static int mfip_detach(device_t); static void mfip_cam_action(struct cam_sim *, union ccb *); static void mfip_cam_poll(struct cam_sim *); +static void mfip_cam_rescan(struct mfi_softc *, uint32_t tid); static struct mfi_command * mfip_start(void *); static void mfip_done(struct mfi_command *cm); @@ -122,6 +132,7 @@ mfip_attach(device_t dev) mfisc = device_get_softc(device_get_parent(dev)); sc->dev = dev; + sc->state = MFIP_STATE_NONE; sc->mfi_sc = mfisc; mfisc->mfi_cam_start = mfip_start; @@ -138,6 +149,8 @@ mfip_attach(device_t dev) return (EINVAL); } + mfisc->mfi_cam_rescan_cb = mfip_cam_rescan; + mtx_lock(&mfisc->mfi_io_lock); if (xpt_bus_register(sc->sim, dev, 0) != 0) { device_printf(dev, "XPT bus registration failed\n"); @@ -162,6 +175,16 @@ mfip_detach(device_t dev) if (sc == NULL) return (EINVAL); + mtx_lock(&sc->mfi_sc->mfi_io_lock); + if (sc->state == MFIP_STATE_RESCAN) { + mtx_unlock(&sc->mfi_sc->mfi_io_lock); + return (EBUSY); + } + sc->state = MFIP_STATE_DETACH; + mtx_unlock(&sc->mfi_sc->mfi_io_lock); + + sc->mfi_sc->mfi_cam_rescan_cb = NULL; + if (sc->sim != NULL) { mtx_lock(&sc->mfi_sc->mfi_io_lock); xpt_bus_deregister(cam_sim_path(sc->sim)); @@ -261,6 +284,57 @@ mfip_cam_action(struct cam_sim *sim, uni return; } +static void +mfip_cam_rescan(struct mfi_softc *sc, uint32_t tid) +{ + union ccb *ccb; + struct mfip_softc *camsc; + struct cam_sim *sim; + device_t mfip_dev; + + mtx_lock(&Giant); + mfip_dev = device_find_child(sc->mfi_dev, "mfip", -1); + mtx_unlock(&Giant); + if (mfip_dev == NULL) { + device_printf(sc->mfi_dev, "Couldn't find mfip child device!\n"); + return; + } + + mtx_lock(&sc->mfi_io_lock); + camsc = device_get_softc(mfip_dev); + if (camsc->state == MFIP_STATE_DETACH) { + mtx_unlock(&sc->mfi_io_lock); + return; + } + camsc->state = MFIP_STATE_RESCAN; + mtx_unlock(&sc->mfi_io_lock); + + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + device_printf(sc->mfi_dev, + "Cannot allocate ccb for bus rescan.\n"); + return; + } + + sim = camsc->sim; + mtx_lock(&sc->mfi_io_lock); + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim), + tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + xpt_free_ccb(ccb); + mtx_unlock(&sc->mfi_io_lock); + device_printf(sc->mfi_dev, + "Cannot create path for bus rescan.\n"); + return; + } + mtx_unlock(&sc->mfi_io_lock); + + xpt_rescan(ccb); + + mtx_lock(&sc->mfi_io_lock); + camsc->state = MFIP_STATE_NONE; + mtx_unlock(&sc->mfi_io_lock); +} + static struct mfi_command * mfip_start(void *data) { Modified: stable/9/sys/dev/mfi/mfivar.h ============================================================================== --- stable/9/sys/dev/mfi/mfivar.h Wed Jul 3 23:06:58 2013 (r252642) +++ stable/9/sys/dev/mfi/mfivar.h Wed Jul 3 23:15:30 2013 (r252643) @@ -313,6 +313,8 @@ struct mfi_softc { TAILQ_HEAD(, ccb_hdr) mfi_cam_ccbq; struct mfi_command * (* mfi_cam_start)(void *); + void (*mfi_cam_rescan_cb)(struct mfi_softc *, + uint32_t); struct callout mfi_watchdog_callout; struct mtx mfi_io_lock; struct sx mfi_config_lock; From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:16:34 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7A334AFF; Wed, 3 Jul 2013 23:16:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5C7131DC5; Wed, 3 Jul 2013 23:16:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NGYeA057003; Wed, 3 Jul 2013 23:16:34 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NGXux057000; Wed, 3 Jul 2013 23:16:33 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307032316.r63NGXux057000@svn.freebsd.org> From: Mark Johnston Date: Wed, 3 Jul 2013 23:16: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: r252644 - stable/8/sys/dev/mfi 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.14 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, 03 Jul 2013 23:16:34 -0000 Author: markj Date: Wed Jul 3 23:16:33 2013 New Revision: 252644 URL: http://svnweb.freebsd.org/changeset/base/252644 Log: MFC r242726 (ambrisko): Add support for SCSI pass through devices to be attached and detached. MFC r251172 (sbruno): xpt_create_path() requires mfi_io_lock to be held, so do it. mfi(4) doesn't panic on host startup now. Modified: stable/8/sys/dev/mfi/mfi.c stable/8/sys/dev/mfi/mfi_cam.c stable/8/sys/dev/mfi/mfivar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mfi/ (props changed) Modified: stable/8/sys/dev/mfi/mfi.c ============================================================================== --- stable/8/sys/dev/mfi/mfi.c Wed Jul 3 23:15:30 2013 (r252643) +++ stable/8/sys/dev/mfi/mfi.c Wed Jul 3 23:16:33 2013 (r252644) @@ -1628,6 +1628,11 @@ mfi_decode_evt(struct mfi_softc *sc, str sx_xunlock(&sc->mfi_config_lock); } } + if (sc->mfi_cam_rescan_cb != NULL && + (detail->code == MR_EVT_PD_INSERTED || + detail->code == MR_EVT_PD_REMOVED)) { + sc->mfi_cam_rescan_cb(sc, detail->args.pd.device_id); + } break; } } Modified: stable/8/sys/dev/mfi/mfi_cam.c ============================================================================== --- stable/8/sys/dev/mfi/mfi_cam.c Wed Jul 3 23:15:30 2013 (r252643) +++ stable/8/sys/dev/mfi/mfi_cam.c Wed Jul 3 23:16:33 2013 (r252644) @@ -50,7 +50,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include +#include #include #include #include @@ -66,12 +68,19 @@ __FBSDID("$FreeBSD$"); #include #include +enum mfip_state { + MFIP_STATE_NONE, + MFIP_STATE_DETACH, + MFIP_STATE_RESCAN +}; + struct mfip_softc { device_t dev; struct mfi_softc *mfi_sc; struct cam_devq *devq; struct cam_sim *sim; struct cam_path *path; + enum mfip_state state; }; static int mfip_probe(device_t); @@ -79,6 +88,7 @@ static int mfip_attach(device_t); static int mfip_detach(device_t); static void mfip_cam_action(struct cam_sim *, union ccb *); static void mfip_cam_poll(struct cam_sim *); +static void mfip_cam_rescan(struct mfi_softc *, uint32_t tid); static struct mfi_command * mfip_start(void *); static void mfip_done(struct mfi_command *cm); @@ -125,6 +135,7 @@ mfip_attach(device_t dev) mfisc = device_get_softc(device_get_parent(dev)); sc->dev = dev; + sc->state = MFIP_STATE_NONE; sc->mfi_sc = mfisc; mfisc->mfi_cam_start = mfip_start; @@ -141,6 +152,8 @@ mfip_attach(device_t dev) return (EINVAL); } + mfisc->mfi_cam_rescan_cb = mfip_cam_rescan; + mtx_lock(&mfisc->mfi_io_lock); if (xpt_bus_register(sc->sim, dev, 0) != 0) { device_printf(dev, "XPT bus registration failed\n"); @@ -165,6 +178,16 @@ mfip_detach(device_t dev) if (sc == NULL) return (EINVAL); + mtx_lock(&sc->mfi_sc->mfi_io_lock); + if (sc->state == MFIP_STATE_RESCAN) { + mtx_unlock(&sc->mfi_sc->mfi_io_lock); + return (EBUSY); + } + sc->state = MFIP_STATE_DETACH; + mtx_unlock(&sc->mfi_sc->mfi_io_lock); + + sc->mfi_sc->mfi_cam_rescan_cb = NULL; + if (sc->sim != NULL) { mtx_lock(&sc->mfi_sc->mfi_io_lock); xpt_bus_deregister(cam_sim_path(sc->sim)); @@ -275,6 +298,57 @@ mfip_cam_action(struct cam_sim *sim, uni return; } +static void +mfip_cam_rescan(struct mfi_softc *sc, uint32_t tid) +{ + union ccb *ccb; + struct mfip_softc *camsc; + struct cam_sim *sim; + device_t mfip_dev; + + mtx_lock(&Giant); + mfip_dev = device_find_child(sc->mfi_dev, "mfip", -1); + mtx_unlock(&Giant); + if (mfip_dev == NULL) { + device_printf(sc->mfi_dev, "Couldn't find mfip child device!\n"); + return; + } + + mtx_lock(&sc->mfi_io_lock); + camsc = device_get_softc(mfip_dev); + if (camsc->state == MFIP_STATE_DETACH) { + mtx_unlock(&sc->mfi_io_lock); + return; + } + camsc->state = MFIP_STATE_RESCAN; + mtx_unlock(&sc->mfi_io_lock); + + ccb = xpt_alloc_ccb_nowait(); + if (ccb == NULL) { + device_printf(sc->mfi_dev, + "Cannot allocate ccb for bus rescan.\n"); + return; + } + + sim = camsc->sim; + mtx_lock(&sc->mfi_io_lock); + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(sim), + tid, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + xpt_free_ccb(ccb); + mtx_unlock(&sc->mfi_io_lock); + device_printf(sc->mfi_dev, + "Cannot create path for bus rescan.\n"); + return; + } + mtx_unlock(&sc->mfi_io_lock); + + xpt_rescan(ccb); + + mtx_lock(&sc->mfi_io_lock); + camsc->state = MFIP_STATE_NONE; + mtx_unlock(&sc->mfi_io_lock); +} + static struct mfi_command * mfip_start(void *data) { Modified: stable/8/sys/dev/mfi/mfivar.h ============================================================================== --- stable/8/sys/dev/mfi/mfivar.h Wed Jul 3 23:15:30 2013 (r252643) +++ stable/8/sys/dev/mfi/mfivar.h Wed Jul 3 23:16:33 2013 (r252644) @@ -313,6 +313,8 @@ struct mfi_softc { TAILQ_HEAD(, ccb_hdr) mfi_cam_ccbq; struct mfi_command * (* mfi_cam_start)(void *); + void (*mfi_cam_rescan_cb)(struct mfi_softc *, + uint32_t); struct callout mfi_watchdog_callout; struct mtx mfi_io_lock; struct sx mfi_config_lock; From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:24:53 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 90D2D170; Wed, 3 Jul 2013 23:24:53 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 82D8C1E47; Wed, 3 Jul 2013 23:24:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NOrpi059989; Wed, 3 Jul 2013 23:24:53 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NOreC059988; Wed, 3 Jul 2013 23:24:53 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032324.r63NOreC059988@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:24:53 +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: r252647 - stable/7/sys/dev/isci/scil 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.14 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, 03 Jul 2013 23:24:53 -0000 Author: jimharris Date: Wed Jul 3 23:24:53 2013 New Revision: 252647 URL: http://svnweb.freebsd.org/changeset/base/252647 Log: MFC r252262: For ATA_PASSTHROUGH commands, pretend isci(4) supports multiword DMA by treating it as UDMA. This fixes a problem introduced in r249933/r249939, where CAM sends ATA_DSM_TRIM to SATA devices using ATA_PASSTHROUGH_16. scsi_ata_trim() sets protocol as DMA (not UDMA) which is for multi-word DMA, even though no such mode is selected for the device. isci(4) would fail these commands which is the correct behavior but not consistent with other HBAs, namely LSI's. smh@ did some further testing on an LSI controller, which rejected ATA_PASSTHROUGH_16 commands with mode=UDMA_OUT, even though only a UDMA mode was selected on the device. So this precludes adding any kind of mode detection in CAM to determine which mode to use on a per-device basis. Note: The reasons behind this change do not apply to stable/7. This MFC is to keep the driver consistent across stable branches and current. Sponsored by: Intel Modified: stable/7/sys/dev/isci/scil/sati_passthrough.c Directory Properties: stable/7/sys/ (props changed) Modified: stable/7/sys/dev/isci/scil/sati_passthrough.c ============================================================================== --- stable/7/sys/dev/isci/scil/sati_passthrough.c Wed Jul 3 23:21:25 2013 (r252646) +++ stable/7/sys/dev/isci/scil/sati_passthrough.c Wed Jul 3 23:24:53 2013 (r252647) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); // Protocols #define PASSTHROUGH_PIO_DATA_IN 0x4 #define PASSTHROUGH_PIO_DATA_OUT 0x5 +#define PASSTHROUGH_DMA 0x6 #define PASSTHROUGH_UDMA_DATA_IN 0xA #define PASSTHROUGH_UDMA_DATA_OUT 0xB #define PASSTHROUGH_RETURN_RESPONSE 0xF @@ -252,8 +253,8 @@ SATI_STATUS sati_passthrough_check_direc U8 * cdb ) { - if ((PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_PIO_DATA_IN) || - (PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_UDMA_DATA_IN)) + if ((sequence->protocol == PASSTHROUGH_PIO_DATA_IN) || + (sequence->protocol == PASSTHROUGH_UDMA_DATA_IN)) { if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x0) { @@ -264,8 +265,8 @@ SATI_STATUS sati_passthrough_check_direc sequence->data_direction = SATI_DATA_DIRECTION_IN; } } - else if ((PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_PIO_DATA_OUT) || - (PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_UDMA_DATA_OUT)) + else if ((sequence->protocol == PASSTHROUGH_PIO_DATA_OUT) || + (sequence->protocol == PASSTHROUGH_UDMA_DATA_OUT)) { if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) { @@ -318,6 +319,26 @@ SATI_STATUS sati_passthrough_12_translat sequence->protocol = PASSTHROUGH_CDB_PROTOCOL (cdb); register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + /* + * CAM will send passthrough commands with protocol set to multiword + * DMA even though no multiword DMA mode is selected on the device. + * This is because some controllers (LSI) will only accept + * ATA_PASSTHROUGH commands with DMA mode - not UDMA_IN/OUT. + * + * Since isci does not support multiword DMA, fix this up here. + */ + if (sequence->protocol == PASSTHROUGH_DMA) + { + if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_IN; + } + else + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_OUT; + } + } + if (sati_passthrough_check_direction(sequence, cdb) != SATI_COMPLETE || sati_passthrough_multiple_count_error(cdb) ) @@ -376,6 +397,26 @@ SATI_STATUS sati_passthrough_16_translat sequence->protocol = PASSTHROUGH_CDB_PROTOCOL(cdb); register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + /* + * CAM will send passthrough commands with protocol set to multiword + * DMA even though no multiword DMA mode is selected on the device. + * This is because some controllers (LSI) will only accept + * ATA_PASSTHROUGH commands with DMA mode - not UDMA_IN/OUT. + * + * Since isci does not support multiword DMA, fix this up here. + */ + if (sequence->protocol == PASSTHROUGH_DMA) + { + if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_IN; + } + else + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_OUT; + } + } + if (sati_passthrough_check_direction(sequence, cdb) != SATI_COMPLETE || sati_passthrough_multiple_count_error(cdb) ) From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:28:07 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B2E384C5; Wed, 3 Jul 2013 23:28:07 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A4C671E65; Wed, 3 Jul 2013 23:28:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NS7gm060496; Wed, 3 Jul 2013 23:28:07 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NS7Yu060495; Wed, 3 Jul 2013 23:28:07 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032328.r63NS7Yu060495@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:28:07 +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: r252650 - stable/8/sys/dev/isci/scil 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.14 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, 03 Jul 2013 23:28:07 -0000 Author: jimharris Date: Wed Jul 3 23:28:07 2013 New Revision: 252650 URL: http://svnweb.freebsd.org/changeset/base/252650 Log: MFC r252262: For ATA_PASSTHROUGH commands, pretend isci(4) supports multiword DMA by treating it as UDMA. This fixes a problem introduced in r249933/r249939, where CAM sends ATA_DSM_TRIM to SATA devices using ATA_PASSTHROUGH_16. scsi_ata_trim() sets protocol as DMA (not UDMA) which is for multi-word DMA, even though no such mode is selected for the device. isci(4) would fail these commands which is the correct behavior but not consistent with other HBAs, namely LSI's. smh@ did some further testing on an LSI controller, which rejected ATA_PASSTHROUGH_16 commands with mode=UDMA_OUT, even though only a UDMA mode was selected on the device. So this precludes adding any kind of mode detection in CAM to determine which mode to use on a per-device basis. Sponsored by: Intel Modified: stable/8/sys/dev/isci/scil/sati_passthrough.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/isci/ (props changed) Modified: stable/8/sys/dev/isci/scil/sati_passthrough.c ============================================================================== --- stable/8/sys/dev/isci/scil/sati_passthrough.c Wed Jul 3 23:27:59 2013 (r252649) +++ stable/8/sys/dev/isci/scil/sati_passthrough.c Wed Jul 3 23:28:07 2013 (r252650) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); // Protocols #define PASSTHROUGH_PIO_DATA_IN 0x4 #define PASSTHROUGH_PIO_DATA_OUT 0x5 +#define PASSTHROUGH_DMA 0x6 #define PASSTHROUGH_UDMA_DATA_IN 0xA #define PASSTHROUGH_UDMA_DATA_OUT 0xB #define PASSTHROUGH_RETURN_RESPONSE 0xF @@ -252,8 +253,8 @@ SATI_STATUS sati_passthrough_check_direc U8 * cdb ) { - if ((PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_PIO_DATA_IN) || - (PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_UDMA_DATA_IN)) + if ((sequence->protocol == PASSTHROUGH_PIO_DATA_IN) || + (sequence->protocol == PASSTHROUGH_UDMA_DATA_IN)) { if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x0) { @@ -264,8 +265,8 @@ SATI_STATUS sati_passthrough_check_direc sequence->data_direction = SATI_DATA_DIRECTION_IN; } } - else if ((PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_PIO_DATA_OUT) || - (PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_UDMA_DATA_OUT)) + else if ((sequence->protocol == PASSTHROUGH_PIO_DATA_OUT) || + (sequence->protocol == PASSTHROUGH_UDMA_DATA_OUT)) { if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) { @@ -318,6 +319,26 @@ SATI_STATUS sati_passthrough_12_translat sequence->protocol = PASSTHROUGH_CDB_PROTOCOL (cdb); register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + /* + * CAM will send passthrough commands with protocol set to multiword + * DMA even though no multiword DMA mode is selected on the device. + * This is because some controllers (LSI) will only accept + * ATA_PASSTHROUGH commands with DMA mode - not UDMA_IN/OUT. + * + * Since isci does not support multiword DMA, fix this up here. + */ + if (sequence->protocol == PASSTHROUGH_DMA) + { + if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_IN; + } + else + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_OUT; + } + } + if (sati_passthrough_check_direction(sequence, cdb) != SATI_COMPLETE || sati_passthrough_multiple_count_error(cdb) ) @@ -376,6 +397,26 @@ SATI_STATUS sati_passthrough_16_translat sequence->protocol = PASSTHROUGH_CDB_PROTOCOL(cdb); register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + /* + * CAM will send passthrough commands with protocol set to multiword + * DMA even though no multiword DMA mode is selected on the device. + * This is because some controllers (LSI) will only accept + * ATA_PASSTHROUGH commands with DMA mode - not UDMA_IN/OUT. + * + * Since isci does not support multiword DMA, fix this up here. + */ + if (sequence->protocol == PASSTHROUGH_DMA) + { + if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_IN; + } + else + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_OUT; + } + } + if (sati_passthrough_check_direction(sequence, cdb) != SATI_COMPLETE || sati_passthrough_multiple_count_error(cdb) ) From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:29:41 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 60A5960D; Wed, 3 Jul 2013 23:29:41 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 517271E75; Wed, 3 Jul 2013 23:29:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NTfrJ060710; Wed, 3 Jul 2013 23:29:41 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NTfZ0060709; Wed, 3 Jul 2013 23:29:41 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032329.r63NTfZ0060709@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:29: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: r252651 - stable/9/sys/dev/isci/scil 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.14 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, 03 Jul 2013 23:29:41 -0000 Author: jimharris Date: Wed Jul 3 23:29:40 2013 New Revision: 252651 URL: http://svnweb.freebsd.org/changeset/base/252651 Log: MFC r252262: For ATA_PASSTHROUGH commands, pretend isci(4) supports multiword DMA by treating it as UDMA. This fixes a problem introduced in r249933/r249939, where CAM sends ATA_DSM_TRIM to SATA devices using ATA_PASSTHROUGH_16. scsi_ata_trim() sets protocol as DMA (not UDMA) which is for multi-word DMA, even though no such mode is selected for the device. isci(4) would fail these commands which is the correct behavior but not consistent with other HBAs, namely LSI's. smh@ did some further testing on an LSI controller, which rejected ATA_PASSTHROUGH_16 commands with mode=UDMA_OUT, even though only a UDMA mode was selected on the device. So this precludes adding any kind of mode detection in CAM to determine which mode to use on a per-device basis. Sponsored by: Intel Modified: stable/9/sys/dev/isci/scil/sati_passthrough.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/isci/scil/sati_passthrough.c ============================================================================== --- stable/9/sys/dev/isci/scil/sati_passthrough.c Wed Jul 3 23:28:07 2013 (r252650) +++ stable/9/sys/dev/isci/scil/sati_passthrough.c Wed Jul 3 23:29:40 2013 (r252651) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); // Protocols #define PASSTHROUGH_PIO_DATA_IN 0x4 #define PASSTHROUGH_PIO_DATA_OUT 0x5 +#define PASSTHROUGH_DMA 0x6 #define PASSTHROUGH_UDMA_DATA_IN 0xA #define PASSTHROUGH_UDMA_DATA_OUT 0xB #define PASSTHROUGH_RETURN_RESPONSE 0xF @@ -252,8 +253,8 @@ SATI_STATUS sati_passthrough_check_direc U8 * cdb ) { - if ((PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_PIO_DATA_IN) || - (PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_UDMA_DATA_IN)) + if ((sequence->protocol == PASSTHROUGH_PIO_DATA_IN) || + (sequence->protocol == PASSTHROUGH_UDMA_DATA_IN)) { if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x0) { @@ -264,8 +265,8 @@ SATI_STATUS sati_passthrough_check_direc sequence->data_direction = SATI_DATA_DIRECTION_IN; } } - else if ((PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_PIO_DATA_OUT) || - (PASSTHROUGH_CDB_PROTOCOL(cdb) == PASSTHROUGH_UDMA_DATA_OUT)) + else if ((sequence->protocol == PASSTHROUGH_PIO_DATA_OUT) || + (sequence->protocol == PASSTHROUGH_UDMA_DATA_OUT)) { if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) { @@ -318,6 +319,26 @@ SATI_STATUS sati_passthrough_12_translat sequence->protocol = PASSTHROUGH_CDB_PROTOCOL (cdb); register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + /* + * CAM will send passthrough commands with protocol set to multiword + * DMA even though no multiword DMA mode is selected on the device. + * This is because some controllers (LSI) will only accept + * ATA_PASSTHROUGH commands with DMA mode - not UDMA_IN/OUT. + * + * Since isci does not support multiword DMA, fix this up here. + */ + if (sequence->protocol == PASSTHROUGH_DMA) + { + if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_IN; + } + else + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_OUT; + } + } + if (sati_passthrough_check_direction(sequence, cdb) != SATI_COMPLETE || sati_passthrough_multiple_count_error(cdb) ) @@ -376,6 +397,26 @@ SATI_STATUS sati_passthrough_16_translat sequence->protocol = PASSTHROUGH_CDB_PROTOCOL(cdb); register_fis = sati_cb_get_h2d_register_fis_address(ata_io); + /* + * CAM will send passthrough commands with protocol set to multiword + * DMA even though no multiword DMA mode is selected on the device. + * This is because some controllers (LSI) will only accept + * ATA_PASSTHROUGH commands with DMA mode - not UDMA_IN/OUT. + * + * Since isci does not support multiword DMA, fix this up here. + */ + if (sequence->protocol == PASSTHROUGH_DMA) + { + if (PASSTHROUGH_CDB_T_DIR(cdb) == 0x1) + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_IN; + } + else + { + sequence->protocol = PASSTHROUGH_UDMA_DATA_OUT; + } + } + if (sati_passthrough_check_direction(sequence, cdb) != SATI_COMPLETE || sati_passthrough_multiple_count_error(cdb) ) From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:40:43 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AE626B4A; Wed, 3 Jul 2013 23:40:43 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 921AA1ED9; Wed, 3 Jul 2013 23:40:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NehmN063862; Wed, 3 Jul 2013 23:40:43 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Nehjw063861; Wed, 3 Jul 2013 23:40:43 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032340.r63Nehjw063861@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:40: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: r252654 - stable/9/sbin/nvmecontrol 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.14 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, 03 Jul 2013 23:40:43 -0000 Author: jimharris Date: Wed Jul 3 23:40:43 2013 New Revision: 252654 URL: http://svnweb.freebsd.org/changeset/base/252654 Log: MFC r252263: Add an open_dev() helper function to be used in the various places where nvmecontrol needs to open a handle to a controller or namespace device node. Sponsored by: Intel Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:38:37 2013 (r252653) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:40:43 2013 (r252654) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Intel Corporation + * Copyright (C) 2012-2013 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -258,13 +258,42 @@ read_namespace_data(int fd, int nsid, st } } +static int +open_dev(const char *str, int *fd, int show_error, int exit_on_error) +{ + struct stat devstat; + char full_path[64]; + + snprintf(full_path, sizeof(full_path), "/dev/%s", str); + if (stat(full_path, &devstat) != 0) { + if (show_error) + fprintf(stderr, "error\n"); + if (exit_on_error) + exit(EX_NOINPUT); + else + return (EX_NOINPUT); + } + + *fd = open(full_path, O_RDWR); + if (*fd < 0) { + if (show_error) + printf("Could not open %s. errno=%d (%s)\n", full_path, + errno, strerror(errno)); + if (exit_on_error) + exit(EX_NOPERM); + else + return (EX_NOPERM); + } + + return (EX_OK); +} + static void devlist(int argc, char *argv[]) { struct nvme_controller_data cdata; struct nvme_namespace_data nsdata; - struct stat devstat; - char name[64], path[64]; + char name[64]; uint32_t i; int ch, ctrlr, exit_code, fd, found; @@ -283,21 +312,18 @@ devlist(int argc, char *argv[]) while (1) { ctrlr++; sprintf(name, "nvme%d", ctrlr); - sprintf(path, "/dev/%s", name); - - if (stat(path, &devstat) != 0) - break; - found++; + exit_code = open_dev(name, &fd, 0, 0); - fd = open(path, O_RDWR); - if (fd < 0) { - printf("Could not open %s. errno=%d (%s)\n", path, - errno, strerror(errno)); - exit_code = EX_NOPERM; + if (exit_code == EX_NOINPUT) + break; + else if (exit_code == EX_NOPERM) { + printf("Could not open /dev/%s, errno = %d (%s)\n", + name, errno, strerror(errno)); continue; } + found++; read_controller_data(fd, &cdata); printf("%6s: %s\n", name, cdata.mn); @@ -310,20 +336,20 @@ devlist(int argc, char *argv[]) (long long)ns_get_sector_size(&nsdata) / 1024 / 1024 / 1024); } + + close(fd); } if (found == 0) printf("No NVMe controllers found.\n"); - exit(exit_code); + exit(EX_OK); } static void identify_ctrlr(int argc, char *argv[]) { struct nvme_controller_data cdata; - struct stat devstat; - char path[64]; int ch, fd, hexflag = 0, hexlength; int verboseflag = 0; @@ -340,22 +366,9 @@ identify_ctrlr(int argc, char *argv[]) } } - sprintf(path, "/dev/%s", argv[optind]); - - if (stat(path, &devstat) < 0) { - printf("Invalid device node %s. errno=%d (%s)\n", path, errno, - strerror(errno)); - exit(EX_IOERR); - } - - fd = open(path, O_RDWR); - if (fd < 0) { - printf("Could not open %s. errno=%d (%s)\n", path, errno, - strerror(errno)); - exit(EX_NOPERM); - } - + open_dev(argv[optind], &fd, 1, 1); read_controller_data(fd, &cdata); + close(fd); if (hexflag == 1) { if (verboseflag == 1) @@ -380,7 +393,6 @@ static void identify_ns(int argc, char *argv[]) { struct nvme_namespace_data nsdata; - struct stat devstat; char path[64]; char *nsloc; int ch, fd, hexflag = 0, hexlength, nsid; @@ -404,25 +416,18 @@ identify_ns(int argc, char *argv[]) * This is a cleaner check for cases where the correct controller * is specified, but an invalid namespace on that controller. */ - sprintf(path, "/dev/%s", argv[optind]); - if (stat(path, &devstat) < 0) { - printf("Invalid device node %s. errno=%d (%s)\n", path, errno, - strerror(errno)); - exit(EX_IOERR); - } - - nsloc = strstr(argv[optind], "ns"); - if (nsloc == NULL) { - printf("Invalid namepsace %s.\n", argv[optind]); - exit(EX_IOERR); - } + open_dev(argv[optind], &fd, 1, 1); + close(fd); /* * Pull the namespace id from the string. +2 skips past the "ns" part - * of the string. + * of the string. Don't search past 10 characters into the string, + * otherwise we know it is malformed. */ - nsid = strtol(nsloc + 2, NULL, 10); - if (nsid == 0 && errno != 0) { + nsloc = strnstr(argv[optind], "ns", 10); + if (nsloc != NULL) + nsid = strtol(nsloc + 2, NULL, 10); + if (nsloc == NULL || (nsid == 0 && errno != 0)) { printf("Invalid namespace ID %s.\n", argv[optind]); exit(EX_IOERR); } @@ -432,22 +437,10 @@ identify_ns(int argc, char *argv[]) * since it is an admin cmd. So the path should only include the * nvmeX part of the nvmeXnsY string. */ - sprintf(path, "/dev/"); - strncat(path, argv[optind], nsloc - argv[optind]); - if (stat(path, &devstat) < 0) { - printf("Invalid device node %s. errno=%d (%s)\n", path, errno, - strerror(errno)); - exit(EX_IOERR); - } - - fd = open(path, O_RDWR); - if (fd < 0) { - printf("Could not open %s. errno=%d (%s)\n", path, errno, - strerror(errno)); - exit(EX_NOPERM); - } - + snprintf(path, nsloc - argv[optind] + 1, "%s", argv[optind]); + open_dev(path, &fd, 1, 1); read_namespace_data(fd, nsid, &nsdata); + close(fd); if (hexflag == 1) { if (verboseflag == 1) @@ -480,12 +473,6 @@ identify(int argc, char *argv[]) target = argv[optind]; - /* Specified device node must have "nvme" in it. */ - if (strstr(argv[optind], "nvme") == NULL) { - printf("Invalid device node '%s'.\n", argv[optind]); - exit(EX_IOERR); - } - optreset = 1; optind = 1; @@ -538,14 +525,11 @@ perftest(int argc, char *argv[]) int fd; char ch; char *p; - const char *name; - char path[64]; u_long ioctl_cmd = NVME_IO_TEST; bool nflag, oflag, sflag, tflag; int perthread = 0; nflag = oflag = sflag = tflag = false; - name = NULL; memset(&io_test, 0, sizeof(io_test)); @@ -623,26 +607,18 @@ perftest(int argc, char *argv[]) } } - name = argv[optind]; - - if (!nflag || !oflag || !sflag || !tflag || name == NULL) + if (!nflag || !oflag || !sflag || !tflag || optind >= argc) perftest_usage(); - sprintf(path, "/dev/%s", name); - - fd = open(path, O_RDWR); - if (fd < 0) { - fprintf(stderr, "%s not valid device. errno=%d (%s)\n", path, - errno, strerror(errno)); - perftest_usage(); - } - + open_dev(argv[optind], &fd, 1, 1); if (ioctl(fd, ioctl_cmd, &io_test) < 0) { fprintf(stderr, "NVME_IO_TEST failed. errno=%d (%s)\n", errno, strerror(errno)); + close(fd); exit(EX_IOERR); } + close(fd); print_perftest(&io_test, perthread); exit(EX_OK); } @@ -650,9 +626,7 @@ perftest(int argc, char *argv[]) static void reset_ctrlr(int argc, char *argv[]) { - struct stat devstat; - char path[64]; - int ch, fd; + int ch, fd; while ((ch = getopt(argc, argv, "")) != -1) { switch ((char)ch) { @@ -661,24 +635,10 @@ reset_ctrlr(int argc, char *argv[]) } } - sprintf(path, "/dev/%s", argv[optind]); - - if (stat(path, &devstat) < 0) { - printf("Invalid device node %s. errno=%d (%s)\n", path, errno, - strerror(errno)); - exit(EX_IOERR); - } - - fd = open(path, O_RDWR); - if (fd < 0) { - printf("Could not open %s. errno=%d (%s)\n", path, errno, - strerror(errno)); - exit(EX_NOPERM); - } - + open_dev(argv[optind], &fd, 1, 1); if (ioctl(fd, NVME_RESET_CONTROLLER) < 0) { - printf("Reset request to %s failed. errno=%d (%s)\n", path, - errno, strerror(errno)); + printf("Reset request to %s failed. errno=%d (%s)\n", + argv[optind], errno, strerror(errno)); exit(EX_IOERR); } From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:42:13 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 25BC3C91; Wed, 3 Jul 2013 23:42:13 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F27041EE5; Wed, 3 Jul 2013 23:42:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NgCLH065671; Wed, 3 Jul 2013 23:42:12 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NgCEb065669; Wed, 3 Jul 2013 23:42:12 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032342.r63NgCEb065669@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:42:12 +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: r252655 - stable/9/sbin/nvmecontrol 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.14 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, 03 Jul 2013 23:42:13 -0000 Author: jimharris Date: Wed Jul 3 23:42:12 2013 New Revision: 252655 URL: http://svnweb.freebsd.org/changeset/base/252655 Log: MFC r252264: Add separate *_usage() functions for each nvmecontrol command. Sponsored by: Intel Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:40:43 2013 (r252654) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:42:12 2013 (r252655) @@ -289,6 +289,14 @@ open_dev(const char *str, int *fd, int s } static void +devlist_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, DEVLIST_USAGE); + exit(EX_USAGE); +} + +static void devlist(int argc, char *argv[]) { struct nvme_controller_data cdata; @@ -302,7 +310,7 @@ devlist(int argc, char *argv[]) while ((ch = getopt(argc, argv, "")) != -1) { switch ((char)ch) { default: - usage(); + devlist_usage(); } } @@ -347,6 +355,14 @@ devlist(int argc, char *argv[]) } static void +identify_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, IDENTIFY_USAGE); + exit(EX_USAGE); +} + +static void identify_ctrlr(int argc, char *argv[]) { struct nvme_controller_data cdata; @@ -362,7 +378,7 @@ identify_ctrlr(int argc, char *argv[]) hexflag = 1; break; default: - usage(); + identify_usage(); } } @@ -382,7 +398,7 @@ identify_ctrlr(int argc, char *argv[]) if (verboseflag == 1) { printf("-v not currently supported without -x.\n"); - usage(); + identify_usage(); } print_controller(&cdata); @@ -407,7 +423,7 @@ identify_ns(int argc, char *argv[]) hexflag = 1; break; default: - usage(); + identify_usage(); } } @@ -454,7 +470,7 @@ identify_ns(int argc, char *argv[]) if (verboseflag == 1) { printf("-v not currently supported without -x.\n"); - usage(); + identify_usage(); } print_namespace(&nsdata); @@ -467,7 +483,7 @@ identify(int argc, char *argv[]) char *target; if (argc < 2) - usage(); + identify_usage(); while (getopt(argc, argv, "vx") != -1) ; @@ -624,6 +640,14 @@ perftest(int argc, char *argv[]) } static void +reset_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, RESET_USAGE); + exit(EX_USAGE); +} + +static void reset_ctrlr(int argc, char *argv[]) { int ch, fd; @@ -631,7 +655,7 @@ reset_ctrlr(int argc, char *argv[]) while ((ch = getopt(argc, argv, "")) != -1) { switch ((char)ch) { default: - usage(); + reset_usage(); } } From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:45:59 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C3211DE4; Wed, 3 Jul 2013 23:45:59 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A4C801EFD; Wed, 3 Jul 2013 23:45:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Njxgs066231; Wed, 3 Jul 2013 23:45:59 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NjwiR066227; Wed, 3 Jul 2013 23:45:58 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032345.r63NjwiR066227@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:45: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: r252656 - stable/9/sbin/nvmecontrol 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.14 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, 03 Jul 2013 23:45:59 -0000 Author: jimharris Date: Wed Jul 3 23:45:58 2013 New Revision: 252656 URL: http://svnweb.freebsd.org/changeset/base/252656 Log: MFC r252265: Break out code related to the devlist command into a separate source file. Sponsored by: Intel Added: stable/9/sbin/nvmecontrol/devlist.c - copied unchanged from r252265, head/sbin/nvmecontrol/devlist.c stable/9/sbin/nvmecontrol/nvmecontrol.h - copied unchanged from r252265, head/sbin/nvmecontrol/nvmecontrol.h Modified: stable/9/sbin/nvmecontrol/Makefile stable/9/sbin/nvmecontrol/nvmecontrol.c Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/Makefile ============================================================================== --- stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:42:12 2013 (r252655) +++ stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:45:58 2013 (r252656) @@ -1,6 +1,7 @@ # $FreeBSD$ PROG= nvmecontrol +SRCS= nvmecontrol.c devlist.c MAN= nvmecontrol.8 .include Copied: stable/9/sbin/nvmecontrol/devlist.c (from r252265, head/sbin/nvmecontrol/devlist.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sbin/nvmecontrol/devlist.c Wed Jul 3 23:45:58 2013 (r252656, copy of r252265, head/sbin/nvmecontrol/devlist.c) @@ -0,0 +1,114 @@ +/*- + * Copyright (C) 2012-2013 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY 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$"); + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nvmecontrol.h" + +static void +devlist_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, DEVLIST_USAGE); + exit(EX_USAGE); +} + +static inline uint32_t +ns_get_sector_size(struct nvme_namespace_data *nsdata) +{ + + return (1 << nsdata->lbaf[0].lbads); +} + +void +devlist(int argc, char *argv[]) +{ + struct nvme_controller_data cdata; + struct nvme_namespace_data nsdata; + char name[64]; + uint32_t i; + int ch, ctrlr, exit_code, fd, found; + + exit_code = EX_OK; + + while ((ch = getopt(argc, argv, "")) != -1) { + switch ((char)ch) { + default: + devlist_usage(); + } + } + + ctrlr = -1; + found = 0; + + while (1) { + ctrlr++; + sprintf(name, "nvme%d", ctrlr); + + exit_code = open_dev(name, &fd, 0, 0); + + if (exit_code == EX_NOINPUT) + break; + else if (exit_code == EX_NOPERM) { + printf("Could not open /dev/%s, errno = %d (%s)\n", + name, errno, strerror(errno)); + continue; + } + + found++; + read_controller_data(fd, &cdata); + printf("%6s: %s\n", name, cdata.mn); + + for (i = 0; i < cdata.nn; i++) { + sprintf(name, "nvme%dns%d", ctrlr, i+1); + read_namespace_data(fd, i+1, &nsdata); + printf(" %10s (%lldGB)\n", + name, + nsdata.nsze * + (long long)ns_get_sector_size(&nsdata) / + 1024 / 1024 / 1024); + } + + close(fd); + } + + if (found == 0) + printf("No NVMe controllers found.\n"); + + exit(EX_OK); +} Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:42:12 2013 (r252655) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:45:58 2013 (r252656) @@ -31,8 +31,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include @@ -44,20 +42,7 @@ __FBSDID("$FreeBSD$"); #include #include -#define DEVLIST_USAGE \ -" nvmecontrol devlist\n" - -#define IDENTIFY_USAGE \ -" nvmecontrol identify \n" - -#define PERFTEST_USAGE \ -" nvmecontrol perftest <-n num_threads> <-o read|write>\n" \ -" <-s size_in_bytes> <-t time_in_seconds>\n" \ -" <-i intr|wait> [-f refthread] [-p]\n" \ -" \n" - -#define RESET_USAGE \ -" nvmecontrol reset \n" +#include "nvmecontrol.h" static void perftest_usage(void); @@ -203,14 +188,7 @@ print_namespace(struct nvme_namespace_da } } -static uint32_t -ns_get_sector_size(struct nvme_namespace_data *nsdata) -{ - - return (1 << nsdata->lbaf[0].lbads); -} - -static void +void read_controller_data(int fd, struct nvme_controller_data *cdata) { struct nvme_pt_command pt; @@ -234,7 +212,7 @@ read_controller_data(int fd, struct nvme } } -static void +void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata) { struct nvme_pt_command pt; @@ -258,7 +236,7 @@ read_namespace_data(int fd, int nsid, st } } -static int +int open_dev(const char *str, int *fd, int show_error, int exit_on_error) { struct stat devstat; @@ -289,72 +267,6 @@ open_dev(const char *str, int *fd, int s } static void -devlist_usage(void) -{ - fprintf(stderr, "usage:\n"); - fprintf(stderr, DEVLIST_USAGE); - exit(EX_USAGE); -} - -static void -devlist(int argc, char *argv[]) -{ - struct nvme_controller_data cdata; - struct nvme_namespace_data nsdata; - char name[64]; - uint32_t i; - int ch, ctrlr, exit_code, fd, found; - - exit_code = EX_OK; - - while ((ch = getopt(argc, argv, "")) != -1) { - switch ((char)ch) { - default: - devlist_usage(); - } - } - - ctrlr = -1; - found = 0; - - while (1) { - ctrlr++; - sprintf(name, "nvme%d", ctrlr); - - exit_code = open_dev(name, &fd, 0, 0); - - if (exit_code == EX_NOINPUT) - break; - else if (exit_code == EX_NOPERM) { - printf("Could not open /dev/%s, errno = %d (%s)\n", - name, errno, strerror(errno)); - continue; - } - - found++; - read_controller_data(fd, &cdata); - printf("%6s: %s\n", name, cdata.mn); - - for (i = 0; i < cdata.nn; i++) { - sprintf(name, "nvme%dns%d", ctrlr, i+1); - read_namespace_data(fd, i+1, &nsdata); - printf(" %10s (%lldGB)\n", - name, - nsdata.nsze * - (long long)ns_get_sector_size(&nsdata) / - 1024 / 1024 / 1024); - } - - close(fd); - } - - if (found == 0) - printf("No NVMe controllers found.\n"); - - exit(EX_OK); -} - -static void identify_usage(void) { fprintf(stderr, "usage:\n"); Copied: stable/9/sbin/nvmecontrol/nvmecontrol.h (from r252265, head/sbin/nvmecontrol/nvmecontrol.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:45:58 2013 (r252656, copy of r252265, head/sbin/nvmecontrol/nvmecontrol.h) @@ -0,0 +1,56 @@ +/*- + * Copyright (C) 2012-2013 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY 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$ + */ + +#ifndef __NVMECONTROL_H__ +#define __NVMECONTROL_H__ + +#include + +#define DEVLIST_USAGE \ +" nvmecontrol devlist\n" + +#define IDENTIFY_USAGE \ +" nvmecontrol identify \n" + +#define PERFTEST_USAGE \ +" nvmecontrol perftest <-n num_threads> <-o read|write>\n" \ +" <-s size_in_bytes> <-t time_in_seconds>\n" \ +" <-i intr|wait> [-f refthread] [-p]\n" \ +" \n" + +#define RESET_USAGE \ +" nvmecontrol reset \n" + +int open_dev(const char *str, int *fd, int show_error, int exit_on_error); +void read_controller_data(int fd, struct nvme_controller_data *cdata); +void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata); + +void devlist(int argc, char *argv[]); + +#endif + From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:47:24 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 35AE61ED; Wed, 3 Jul 2013 23:47:24 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 270BD1F1D; Wed, 3 Jul 2013 23:47:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NlORA066527; Wed, 3 Jul 2013 23:47:24 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NlNbO066521; Wed, 3 Jul 2013 23:47:23 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032347.r63NlNbO066521@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:47: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: r252658 - stable/9/sbin/nvmecontrol 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.14 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, 03 Jul 2013 23:47:24 -0000 Author: jimharris Date: Wed Jul 3 23:47:23 2013 New Revision: 252658 URL: http://svnweb.freebsd.org/changeset/base/252658 Log: MFC r252266: Break out code related to the identify command into a separate source file. Sponsored by: Intel Added: stable/9/sbin/nvmecontrol/identify.c - copied unchanged from r252266, head/sbin/nvmecontrol/identify.c Modified: stable/9/sbin/nvmecontrol/Makefile stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/Makefile ============================================================================== --- stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:46:30 2013 (r252657) +++ stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:47:23 2013 (r252658) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= nvmecontrol -SRCS= nvmecontrol.c devlist.c +SRCS= nvmecontrol.c devlist.c identify.c MAN= nvmecontrol.8 .include Copied: stable/9/sbin/nvmecontrol/identify.c (from r252266, head/sbin/nvmecontrol/identify.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sbin/nvmecontrol/identify.c Wed Jul 3 23:47:23 2013 (r252658, copy of r252266, head/sbin/nvmecontrol/identify.c) @@ -0,0 +1,321 @@ +/*- + * Copyright (C) 2012-2013 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY 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$"); + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nvmecontrol.h" + +static void +print_controller_hex(struct nvme_controller_data *cdata, uint32_t length) +{ + uint32_t *p; + uint32_t i, j; + + p = (uint32_t *)cdata; + length /= sizeof(uint32_t); + + for (i = 0; i < length; i+=8) { + printf("%03x: ", i*4); + for (j = 0; j < 8; j++) + printf("%08x ", p[i+j]); + printf("\n"); + } + + printf("\n"); +} + +static void +print_controller(struct nvme_controller_data *cdata) +{ + printf("Controller Capabilities/Features\n"); + printf("================================\n"); + printf("Vendor ID: %04x\n", cdata->vid); + printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); + printf("Serial Number: %s\n", cdata->sn); + printf("Model Number: %s\n", cdata->mn); + printf("Firmware Version: %s\n", cdata->fr); + printf("Recommended Arb Burst: %d\n", cdata->rab); + printf("IEEE OUI Identifier: %02x %02x %02x\n", + cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]); + printf("Multi-Interface Cap: %02x\n", cdata->mic); + /* TODO: Use CAP.MPSMIN to determine true memory page size. */ + printf("Max Data Transfer Size: "); + if (cdata->mdts == 0) + printf("Unlimited\n"); + else + printf("%d\n", PAGE_SIZE * (1 << cdata->mdts)); + printf("\n"); + + printf("Admin Command Set Attributes\n"); + printf("============================\n"); + printf("Security Send/Receive: %s\n", + cdata->oacs.security ? "Supported" : "Not Supported"); + printf("Format NVM: %s\n", + cdata->oacs.format ? "Supported" : "Not Supported"); + printf("Firmware Activate/Download: %s\n", + cdata->oacs.firmware ? "Supported" : "Not Supported"); + printf("Abort Command Limit: %d\n", cdata->acl+1); + printf("Async Event Request Limit: %d\n", cdata->aerl+1); + printf("Number of Firmware Slots: "); + if (cdata->oacs.firmware != 0) + printf("%d\n", cdata->frmw.num_slots); + else + printf("N/A\n"); + printf("Firmware Slot 1 Read-Only: "); + if (cdata->oacs.firmware != 0) + printf("%s\n", cdata->frmw.slot1_ro ? "Yes" : "No"); + else + printf("N/A\n"); + printf("Per-Namespace SMART Log: %s\n", + cdata->lpa.ns_smart ? "Yes" : "No"); + printf("Error Log Page Entries: %d\n", cdata->elpe+1); + printf("Number of Power States: %d\n", cdata->npss+1); + printf("\n"); + + printf("NVM Command Set Attributes\n"); + printf("==========================\n"); + printf("Submission Queue Entry Size\n"); + printf(" Max: %d\n", 1 << cdata->sqes.max); + printf(" Min: %d\n", 1 << cdata->sqes.min); + printf("Completion Queue Entry Size\n"); + printf(" Max: %d\n", 1 << cdata->cqes.max); + printf(" Min: %d\n", 1 << cdata->cqes.min); + printf("Number of Namespaces: %d\n", cdata->nn); + printf("Compare Command: %s\n", + cdata->oncs.compare ? "Supported" : "Not Supported"); + printf("Write Uncorrectable Command: %s\n", + cdata->oncs.write_unc ? "Supported" : "Not Supported"); + printf("Dataset Management Command: %s\n", + cdata->oncs.dsm ? "Supported" : "Not Supported"); + printf("Volatile Write Cache: %s\n", + cdata->vwc.present ? "Present" : "Not Present"); +} + +static void +print_namespace_hex(struct nvme_namespace_data *nsdata, uint32_t length) +{ + uint32_t *p; + uint32_t i, j; + + p = (uint32_t *)nsdata; + length /= sizeof(uint32_t); + + for (i = 0; i < length; i+=8) { + printf("%03x: ", i*4); + for (j = 0; j < 8; j++) + printf("%08x ", p[i+j]); + printf("\n"); + } + + printf("\n"); +} + +static void +print_namespace(struct nvme_namespace_data *nsdata) +{ + uint32_t i; + + printf("Size (in LBAs): %lld (%lldM)\n", + (long long)nsdata->nsze, + (long long)nsdata->nsze / 1024 / 1024); + printf("Capacity (in LBAs): %lld (%lldM)\n", + (long long)nsdata->ncap, + (long long)nsdata->ncap / 1024 / 1024); + printf("Utilization (in LBAs): %lld (%lldM)\n", + (long long)nsdata->nuse, + (long long)nsdata->nuse / 1024 / 1024); + printf("Thin Provisioning: %s\n", + nsdata->nsfeat.thin_prov ? "Supported" : "Not Supported"); + printf("Number of LBA Formats: %d\n", nsdata->nlbaf+1); + printf("Current LBA Format: LBA Format #%d\n", + nsdata->flbas.format); + for (i = 0; i <= nsdata->nlbaf; i++) { + printf("LBA Format #%d:\n", i); + printf(" LBA Data Size: %d\n", + 1 << nsdata->lbaf[i].lbads); + } +} + +static void +identify_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, IDENTIFY_USAGE); + exit(EX_USAGE); +} + +static void +identify_ctrlr(int argc, char *argv[]) +{ + struct nvme_controller_data cdata; + int ch, fd, hexflag = 0, hexlength; + int verboseflag = 0; + + while ((ch = getopt(argc, argv, "vx")) != -1) { + switch ((char)ch) { + case 'v': + verboseflag = 1; + break; + case 'x': + hexflag = 1; + break; + default: + identify_usage(); + } + } + + open_dev(argv[optind], &fd, 1, 1); + read_controller_data(fd, &cdata); + close(fd); + + if (hexflag == 1) { + if (verboseflag == 1) + hexlength = sizeof(struct nvme_controller_data); + else + hexlength = offsetof(struct nvme_controller_data, + reserved5); + print_controller_hex(&cdata, hexlength); + exit(EX_OK); + } + + if (verboseflag == 1) { + printf("-v not currently supported without -x.\n"); + identify_usage(); + } + + print_controller(&cdata); + exit(EX_OK); +} + +static void +identify_ns(int argc, char *argv[]) +{ + struct nvme_namespace_data nsdata; + char path[64]; + char *nsloc; + int ch, fd, hexflag = 0, hexlength, nsid; + int verboseflag = 0; + + while ((ch = getopt(argc, argv, "vx")) != -1) { + switch ((char)ch) { + case 'v': + verboseflag = 1; + break; + case 'x': + hexflag = 1; + break; + default: + identify_usage(); + } + } + + /* + * Check if the specified device node exists before continuing. + * This is a cleaner check for cases where the correct controller + * is specified, but an invalid namespace on that controller. + */ + open_dev(argv[optind], &fd, 1, 1); + close(fd); + + /* + * Pull the namespace id from the string. +2 skips past the "ns" part + * of the string. Don't search past 10 characters into the string, + * otherwise we know it is malformed. + */ + nsloc = strnstr(argv[optind], "ns", 10); + if (nsloc != NULL) + nsid = strtol(nsloc + 2, NULL, 10); + if (nsloc == NULL || (nsid == 0 && errno != 0)) { + printf("Invalid namespace ID %s.\n", argv[optind]); + exit(EX_IOERR); + } + + /* + * We send IDENTIFY commands to the controller, not the namespace, + * since it is an admin cmd. So the path should only include the + * nvmeX part of the nvmeXnsY string. + */ + snprintf(path, nsloc - argv[optind] + 1, "%s", argv[optind]); + open_dev(path, &fd, 1, 1); + read_namespace_data(fd, nsid, &nsdata); + close(fd); + + if (hexflag == 1) { + if (verboseflag == 1) + hexlength = sizeof(struct nvme_namespace_data); + else + hexlength = offsetof(struct nvme_namespace_data, + reserved6); + print_namespace_hex(&nsdata, hexlength); + exit(EX_OK); + } + + if (verboseflag == 1) { + printf("-v not currently supported without -x.\n"); + identify_usage(); + } + + print_namespace(&nsdata); + exit(EX_OK); +} + +void +identify(int argc, char *argv[]) +{ + char *target; + + if (argc < 2) + identify_usage(); + + while (getopt(argc, argv, "vx") != -1) ; + + target = argv[optind]; + + optreset = 1; + optind = 1; + + /* + * If device node contains "ns", we consider it a namespace, + * otherwise, consider it a controller. + */ + if (strstr(target, "ns") == NULL) + identify_ctrlr(argc, argv); + else + identify_ns(argc, argv); +} Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:46:30 2013 (r252657) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:47:23 2013 (r252658) @@ -57,137 +57,6 @@ usage(void) exit(EX_USAGE); } -static void -print_controller_hex(struct nvme_controller_data *cdata, uint32_t length) -{ - uint32_t *p; - uint32_t i, j; - - p = (uint32_t *)cdata; - length /= sizeof(uint32_t); - - for (i = 0; i < length; i+=8) { - printf("%03x: ", i*4); - for (j = 0; j < 8; j++) - printf("%08x ", p[i+j]); - printf("\n"); - } - - printf("\n"); -} - -static void -print_controller(struct nvme_controller_data *cdata) -{ - printf("Controller Capabilities/Features\n"); - printf("================================\n"); - printf("Vendor ID: %04x\n", cdata->vid); - printf("Subsystem Vendor ID: %04x\n", cdata->ssvid); - printf("Serial Number: %s\n", cdata->sn); - printf("Model Number: %s\n", cdata->mn); - printf("Firmware Version: %s\n", cdata->fr); - printf("Recommended Arb Burst: %d\n", cdata->rab); - printf("IEEE OUI Identifier: %02x %02x %02x\n", - cdata->ieee[0], cdata->ieee[1], cdata->ieee[2]); - printf("Multi-Interface Cap: %02x\n", cdata->mic); - /* TODO: Use CAP.MPSMIN to determine true memory page size. */ - printf("Max Data Transfer Size: "); - if (cdata->mdts == 0) - printf("Unlimited\n"); - else - printf("%d\n", PAGE_SIZE * (1 << cdata->mdts)); - printf("\n"); - - printf("Admin Command Set Attributes\n"); - printf("============================\n"); - printf("Security Send/Receive: %s\n", - cdata->oacs.security ? "Supported" : "Not Supported"); - printf("Format NVM: %s\n", - cdata->oacs.format ? "Supported" : "Not Supported"); - printf("Firmware Activate/Download: %s\n", - cdata->oacs.firmware ? "Supported" : "Not Supported"); - printf("Abort Command Limit: %d\n", cdata->acl+1); - printf("Async Event Request Limit: %d\n", cdata->aerl+1); - printf("Number of Firmware Slots: "); - if (cdata->oacs.firmware != 0) - printf("%d\n", cdata->frmw.num_slots); - else - printf("N/A\n"); - printf("Firmware Slot 1 Read-Only: "); - if (cdata->oacs.firmware != 0) - printf("%s\n", cdata->frmw.slot1_ro ? "Yes" : "No"); - else - printf("N/A\n"); - printf("Per-Namespace SMART Log: %s\n", - cdata->lpa.ns_smart ? "Yes" : "No"); - printf("Error Log Page Entries: %d\n", cdata->elpe+1); - printf("Number of Power States: %d\n", cdata->npss+1); - printf("\n"); - - printf("NVM Command Set Attributes\n"); - printf("==========================\n"); - printf("Submission Queue Entry Size\n"); - printf(" Max: %d\n", 1 << cdata->sqes.max); - printf(" Min: %d\n", 1 << cdata->sqes.min); - printf("Completion Queue Entry Size\n"); - printf(" Max: %d\n", 1 << cdata->cqes.max); - printf(" Min: %d\n", 1 << cdata->cqes.min); - printf("Number of Namespaces: %d\n", cdata->nn); - printf("Compare Command: %s\n", - cdata->oncs.compare ? "Supported" : "Not Supported"); - printf("Write Uncorrectable Command: %s\n", - cdata->oncs.write_unc ? "Supported" : "Not Supported"); - printf("Dataset Management Command: %s\n", - cdata->oncs.dsm ? "Supported" : "Not Supported"); - printf("Volatile Write Cache: %s\n", - cdata->vwc.present ? "Present" : "Not Present"); -} - -static void -print_namespace_hex(struct nvme_namespace_data *nsdata, uint32_t length) -{ - uint32_t *p; - uint32_t i, j; - - p = (uint32_t *)nsdata; - length /= sizeof(uint32_t); - - for (i = 0; i < length; i+=8) { - printf("%03x: ", i*4); - for (j = 0; j < 8; j++) - printf("%08x ", p[i+j]); - printf("\n"); - } - - printf("\n"); -} - -static void -print_namespace(struct nvme_namespace_data *nsdata) -{ - uint32_t i; - - printf("Size (in LBAs): %lld (%lldM)\n", - (long long)nsdata->nsze, - (long long)nsdata->nsze / 1024 / 1024); - printf("Capacity (in LBAs): %lld (%lldM)\n", - (long long)nsdata->ncap, - (long long)nsdata->ncap / 1024 / 1024); - printf("Utilization (in LBAs): %lld (%lldM)\n", - (long long)nsdata->nuse, - (long long)nsdata->nuse / 1024 / 1024); - printf("Thin Provisioning: %s\n", - nsdata->nsfeat.thin_prov ? "Supported" : "Not Supported"); - printf("Number of LBA Formats: %d\n", nsdata->nlbaf+1); - printf("Current LBA Format: LBA Format #%d\n", - nsdata->flbas.format); - for (i = 0; i <= nsdata->nlbaf; i++) { - printf("LBA Format #%d:\n", i); - printf(" LBA Data Size: %d\n", - 1 << nsdata->lbaf[i].lbads); - } -} - void read_controller_data(int fd, struct nvme_controller_data *cdata) { @@ -267,154 +136,6 @@ open_dev(const char *str, int *fd, int s } static void -identify_usage(void) -{ - fprintf(stderr, "usage:\n"); - fprintf(stderr, IDENTIFY_USAGE); - exit(EX_USAGE); -} - -static void -identify_ctrlr(int argc, char *argv[]) -{ - struct nvme_controller_data cdata; - int ch, fd, hexflag = 0, hexlength; - int verboseflag = 0; - - while ((ch = getopt(argc, argv, "vx")) != -1) { - switch ((char)ch) { - case 'v': - verboseflag = 1; - break; - case 'x': - hexflag = 1; - break; - default: - identify_usage(); - } - } - - open_dev(argv[optind], &fd, 1, 1); - read_controller_data(fd, &cdata); - close(fd); - - if (hexflag == 1) { - if (verboseflag == 1) - hexlength = sizeof(struct nvme_controller_data); - else - hexlength = offsetof(struct nvme_controller_data, - reserved5); - print_controller_hex(&cdata, hexlength); - exit(EX_OK); - } - - if (verboseflag == 1) { - printf("-v not currently supported without -x.\n"); - identify_usage(); - } - - print_controller(&cdata); - exit(EX_OK); -} - -static void -identify_ns(int argc, char *argv[]) -{ - struct nvme_namespace_data nsdata; - char path[64]; - char *nsloc; - int ch, fd, hexflag = 0, hexlength, nsid; - int verboseflag = 0; - - while ((ch = getopt(argc, argv, "vx")) != -1) { - switch ((char)ch) { - case 'v': - verboseflag = 1; - break; - case 'x': - hexflag = 1; - break; - default: - identify_usage(); - } - } - - /* - * Check if the specified device node exists before continuing. - * This is a cleaner check for cases where the correct controller - * is specified, but an invalid namespace on that controller. - */ - open_dev(argv[optind], &fd, 1, 1); - close(fd); - - /* - * Pull the namespace id from the string. +2 skips past the "ns" part - * of the string. Don't search past 10 characters into the string, - * otherwise we know it is malformed. - */ - nsloc = strnstr(argv[optind], "ns", 10); - if (nsloc != NULL) - nsid = strtol(nsloc + 2, NULL, 10); - if (nsloc == NULL || (nsid == 0 && errno != 0)) { - printf("Invalid namespace ID %s.\n", argv[optind]); - exit(EX_IOERR); - } - - /* - * We send IDENTIFY commands to the controller, not the namespace, - * since it is an admin cmd. So the path should only include the - * nvmeX part of the nvmeXnsY string. - */ - snprintf(path, nsloc - argv[optind] + 1, "%s", argv[optind]); - open_dev(path, &fd, 1, 1); - read_namespace_data(fd, nsid, &nsdata); - close(fd); - - if (hexflag == 1) { - if (verboseflag == 1) - hexlength = sizeof(struct nvme_namespace_data); - else - hexlength = offsetof(struct nvme_namespace_data, - reserved6); - print_namespace_hex(&nsdata, hexlength); - exit(EX_OK); - } - - if (verboseflag == 1) { - printf("-v not currently supported without -x.\n"); - identify_usage(); - } - - print_namespace(&nsdata); - exit(EX_OK); -} - -static void -identify(int argc, char *argv[]) -{ - char *target; - - if (argc < 2) - identify_usage(); - - while (getopt(argc, argv, "vx") != -1) ; - - target = argv[optind]; - - optreset = 1; - optind = 1; - - /* - * If device node contains "ns", we consider it a namespace, - * otherwise, consider it a controller. - */ - if (strstr(target, "ns") == NULL) - identify_ctrlr(argc, argv); - else - identify_ns(argc, argv); -} - -static void print_perftest(struct nvme_io_test *io_test, bool perthread) { uint32_t i, io_completed = 0, iops, mbps; Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:46:30 2013 (r252657) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:47:23 2013 (r252658) @@ -51,6 +51,7 @@ void read_controller_data(int fd, struct void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata); void devlist(int argc, char *argv[]); +void identify(int argc, char *argv[]); #endif From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:48:59 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C5F74331; Wed, 3 Jul 2013 23:48:59 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A6B531F2B; Wed, 3 Jul 2013 23:48:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Nmx8t066756; Wed, 3 Jul 2013 23:48:59 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NmwJM066749; Wed, 3 Jul 2013 23:48:58 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032348.r63NmwJM066749@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:48: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: r252659 - stable/9/sbin/nvmecontrol 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.14 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, 03 Jul 2013 23:48:59 -0000 Author: jimharris Date: Wed Jul 3 23:48:58 2013 New Revision: 252659 URL: http://svnweb.freebsd.org/changeset/base/252659 Log: MFC r252267: Break out code related to the perftest command into a separate file. Sponsored by: Intel Added: stable/9/sbin/nvmecontrol/perftest.c - copied unchanged from r252267, head/sbin/nvmecontrol/perftest.c Modified: stable/9/sbin/nvmecontrol/Makefile stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/Makefile ============================================================================== --- stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:47:23 2013 (r252658) +++ stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:48:58 2013 (r252659) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= nvmecontrol -SRCS= nvmecontrol.c devlist.c identify.c +SRCS= nvmecontrol.c devlist.c identify.c perftest.c MAN= nvmecontrol.8 .include Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:47:23 2013 (r252658) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:48:58 2013 (r252659) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include "nvmecontrol.h" -static void perftest_usage(void); - static void usage(void) { @@ -136,143 +134,6 @@ open_dev(const char *str, int *fd, int s } static void -print_perftest(struct nvme_io_test *io_test, bool perthread) -{ - uint32_t i, io_completed = 0, iops, mbps; - - for (i = 0; i < io_test->num_threads; i++) - io_completed += io_test->io_completed[i]; - - iops = io_completed/io_test->time; - mbps = iops * io_test->size / (1024*1024); - - printf("Threads: %2d Size: %6d %5s Time: %3d IO/s: %7d MB/s: %4d\n", - io_test->num_threads, io_test->size, - io_test->opc == NVME_OPC_READ ? "READ" : "WRITE", - io_test->time, iops, mbps); - - if (perthread) - for (i = 0; i < io_test->num_threads; i++) - printf("\t%3d: %8d IO/s\n", i, - io_test->io_completed[i]/io_test->time); - - exit(1); -} - -static void -perftest_usage(void) -{ - fprintf(stderr, "usage:\n"); - fprintf(stderr, PERFTEST_USAGE); - exit(EX_USAGE); -} - -static void -perftest(int argc, char *argv[]) -{ - struct nvme_io_test io_test; - int fd; - char ch; - char *p; - u_long ioctl_cmd = NVME_IO_TEST; - bool nflag, oflag, sflag, tflag; - int perthread = 0; - - nflag = oflag = sflag = tflag = false; - - memset(&io_test, 0, sizeof(io_test)); - - while ((ch = getopt(argc, argv, "f:i:n:o:ps:t:")) != -1) { - switch (ch) { - case 'f': - if (!strcmp(optarg, "refthread")) - io_test.flags |= NVME_TEST_FLAG_REFTHREAD; - break; - case 'i': - if (!strcmp(optarg, "bio") || - !strcmp(optarg, "wait")) - ioctl_cmd = NVME_BIO_TEST; - else if (!strcmp(optarg, "io") || - !strcmp(optarg, "intr")) - ioctl_cmd = NVME_IO_TEST; - break; - case 'n': - nflag = true; - io_test.num_threads = strtoul(optarg, &p, 0); - if (p != NULL && *p != '\0') { - fprintf(stderr, - "\"%s\" not valid number of threads.\n", - optarg); - perftest_usage(); - } else if (io_test.num_threads == 0 || - io_test.num_threads > 128) { - fprintf(stderr, - "\"%s\" not valid number of threads.\n", - optarg); - perftest_usage(); - } - break; - case 'o': - oflag = true; - if (!strcmp(optarg, "read") || !strcmp(optarg, "READ")) - io_test.opc = NVME_OPC_READ; - else if (!strcmp(optarg, "write") || - !strcmp(optarg, "WRITE")) - io_test.opc = NVME_OPC_WRITE; - else { - fprintf(stderr, "\"%s\" not valid opcode.\n", - optarg); - perftest_usage(); - } - break; - case 'p': - perthread = 1; - break; - case 's': - sflag = true; - io_test.size = strtoul(optarg, &p, 0); - if (p == NULL || *p == '\0' || toupper(*p) == 'B') { - // do nothing - } else if (toupper(*p) == 'K') { - io_test.size *= 1024; - } else if (toupper(*p) == 'M') { - io_test.size *= 1024 * 1024; - } else { - fprintf(stderr, "\"%s\" not valid size.\n", - optarg); - perftest_usage(); - } - break; - case 't': - tflag = true; - io_test.time = strtoul(optarg, &p, 0); - if (p != NULL && *p != '\0') { - fprintf(stderr, - "\"%s\" not valid time duration.\n", - optarg); - perftest_usage(); - } - break; - } - } - - if (!nflag || !oflag || !sflag || !tflag || optind >= argc) - perftest_usage(); - - open_dev(argv[optind], &fd, 1, 1); - if (ioctl(fd, ioctl_cmd, &io_test) < 0) { - fprintf(stderr, "NVME_IO_TEST failed. errno=%d (%s)\n", errno, - strerror(errno)); - close(fd); - exit(EX_IOERR); - } - - close(fd); - print_perftest(&io_test, perthread); - exit(EX_OK); -} - -static void reset_usage(void) { fprintf(stderr, "usage:\n"); Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:47:23 2013 (r252658) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:48:58 2013 (r252659) @@ -52,6 +52,7 @@ void read_namespace_data(int fd, int nsi void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); +void perftest(int argc, char *argv[]); #endif Copied: stable/9/sbin/nvmecontrol/perftest.c (from r252267, head/sbin/nvmecontrol/perftest.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sbin/nvmecontrol/perftest.c Wed Jul 3 23:48:58 2013 (r252659, copy of r252267, head/sbin/nvmecontrol/perftest.c) @@ -0,0 +1,181 @@ +/*- + * Copyright (C) 2012-2013 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY 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$"); + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nvmecontrol.h" + +static void +print_perftest(struct nvme_io_test *io_test, bool perthread) +{ + uint32_t i, io_completed = 0, iops, mbps; + + for (i = 0; i < io_test->num_threads; i++) + io_completed += io_test->io_completed[i]; + + iops = io_completed/io_test->time; + mbps = iops * io_test->size / (1024*1024); + + printf("Threads: %2d Size: %6d %5s Time: %3d IO/s: %7d MB/s: %4d\n", + io_test->num_threads, io_test->size, + io_test->opc == NVME_OPC_READ ? "READ" : "WRITE", + io_test->time, iops, mbps); + + if (perthread) + for (i = 0; i < io_test->num_threads; i++) + printf("\t%3d: %8d IO/s\n", i, + io_test->io_completed[i]/io_test->time); + + exit(1); +} + +static void +perftest_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, PERFTEST_USAGE); + exit(EX_USAGE); +} + +void +perftest(int argc, char *argv[]) +{ + struct nvme_io_test io_test; + int fd; + char ch; + char *p; + u_long ioctl_cmd = NVME_IO_TEST; + bool nflag, oflag, sflag, tflag; + int perthread = 0; + + nflag = oflag = sflag = tflag = false; + + memset(&io_test, 0, sizeof(io_test)); + + while ((ch = getopt(argc, argv, "f:i:n:o:ps:t:")) != -1) { + switch (ch) { + case 'f': + if (!strcmp(optarg, "refthread")) + io_test.flags |= NVME_TEST_FLAG_REFTHREAD; + break; + case 'i': + if (!strcmp(optarg, "bio") || + !strcmp(optarg, "wait")) + ioctl_cmd = NVME_BIO_TEST; + else if (!strcmp(optarg, "io") || + !strcmp(optarg, "intr")) + ioctl_cmd = NVME_IO_TEST; + break; + case 'n': + nflag = true; + io_test.num_threads = strtoul(optarg, &p, 0); + if (p != NULL && *p != '\0') { + fprintf(stderr, + "\"%s\" not valid number of threads.\n", + optarg); + perftest_usage(); + } else if (io_test.num_threads == 0 || + io_test.num_threads > 128) { + fprintf(stderr, + "\"%s\" not valid number of threads.\n", + optarg); + perftest_usage(); + } + break; + case 'o': + oflag = true; + if (!strcmp(optarg, "read") || !strcmp(optarg, "READ")) + io_test.opc = NVME_OPC_READ; + else if (!strcmp(optarg, "write") || + !strcmp(optarg, "WRITE")) + io_test.opc = NVME_OPC_WRITE; + else { + fprintf(stderr, "\"%s\" not valid opcode.\n", + optarg); + perftest_usage(); + } + break; + case 'p': + perthread = 1; + break; + case 's': + sflag = true; + io_test.size = strtoul(optarg, &p, 0); + if (p == NULL || *p == '\0' || toupper(*p) == 'B') { + // do nothing + } else if (toupper(*p) == 'K') { + io_test.size *= 1024; + } else if (toupper(*p) == 'M') { + io_test.size *= 1024 * 1024; + } else { + fprintf(stderr, "\"%s\" not valid size.\n", + optarg); + perftest_usage(); + } + break; + case 't': + tflag = true; + io_test.time = strtoul(optarg, &p, 0); + if (p != NULL && *p != '\0') { + fprintf(stderr, + "\"%s\" not valid time duration.\n", + optarg); + perftest_usage(); + } + break; + } + } + + if (!nflag || !oflag || !sflag || !tflag || optind >= argc) + perftest_usage(); + + open_dev(argv[optind], &fd, 1, 1); + if (ioctl(fd, ioctl_cmd, &io_test) < 0) { + fprintf(stderr, "NVME_IO_TEST failed. errno=%d (%s)\n", errno, + strerror(errno)); + close(fd); + exit(EX_IOERR); + } + + close(fd); + print_perftest(&io_test, perthread); + exit(EX_OK); +} From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:51:04 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B5A5E479; Wed, 3 Jul 2013 23:51:04 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 97EAE1F3B; Wed, 3 Jul 2013 23:51:04 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Np4xe068690; Wed, 3 Jul 2013 23:51:04 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Np3DZ068686; Wed, 3 Jul 2013 23:51:03 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032351.r63Np3DZ068686@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:51: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: r252660 - stable/9/sbin/nvmecontrol 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.14 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, 03 Jul 2013 23:51:04 -0000 Author: jimharris Date: Wed Jul 3 23:51:03 2013 New Revision: 252660 URL: http://svnweb.freebsd.org/changeset/base/252660 Log: MFC r252268: Break out code related to the reset command into a separate source file. Sponsored by: Intel Added: stable/9/sbin/nvmecontrol/reset.c - copied unchanged from r252268, head/sbin/nvmecontrol/reset.c Modified: stable/9/sbin/nvmecontrol/Makefile stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/Makefile ============================================================================== --- stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:48:58 2013 (r252659) +++ stable/9/sbin/nvmecontrol/Makefile Wed Jul 3 23:51:03 2013 (r252660) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= nvmecontrol -SRCS= nvmecontrol.c devlist.c identify.c perftest.c +SRCS= nvmecontrol.c devlist.c identify.c perftest.c reset.c MAN= nvmecontrol.8 .include Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:48:58 2013 (r252659) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:51:03 2013 (r252660) @@ -133,36 +133,6 @@ open_dev(const char *str, int *fd, int s return (EX_OK); } -static void -reset_usage(void) -{ - fprintf(stderr, "usage:\n"); - fprintf(stderr, RESET_USAGE); - exit(EX_USAGE); -} - -static void -reset_ctrlr(int argc, char *argv[]) -{ - int ch, fd; - - while ((ch = getopt(argc, argv, "")) != -1) { - switch ((char)ch) { - default: - reset_usage(); - } - } - - open_dev(argv[optind], &fd, 1, 1); - if (ioctl(fd, NVME_RESET_CONTROLLER) < 0) { - printf("Reset request to %s failed. errno=%d (%s)\n", - argv[optind], errno, strerror(errno)); - exit(EX_IOERR); - } - - exit(EX_OK); -} - int main(int argc, char *argv[]) { @@ -177,7 +147,7 @@ main(int argc, char *argv[]) else if (strcmp(argv[1], "perftest") == 0) perftest(argc-1, &argv[1]); else if (strcmp(argv[1], "reset") == 0) - reset_ctrlr(argc-1, &argv[1]); + reset(argc-1, &argv[1]); usage(); Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:48:58 2013 (r252659) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:51:03 2013 (r252660) @@ -53,6 +53,7 @@ void read_namespace_data(int fd, int nsi void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); void perftest(int argc, char *argv[]); +void reset(int argc, char *argv[]); #endif Copied: stable/9/sbin/nvmecontrol/reset.c (from r252268, head/sbin/nvmecontrol/reset.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sbin/nvmecontrol/reset.c Wed Jul 3 23:51:03 2013 (r252660, copy of r252268, head/sbin/nvmecontrol/reset.c) @@ -0,0 +1,71 @@ +/*- + * Copyright (C) 2012-2013 Intel Corporation + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY 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$"); + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "nvmecontrol.h" + +static void +reset_usage(void) +{ + fprintf(stderr, "usage:\n"); + fprintf(stderr, RESET_USAGE); + exit(EX_USAGE); +} + +void +reset(int argc, char *argv[]) +{ + int ch, fd; + + while ((ch = getopt(argc, argv, "")) != -1) { + switch ((char)ch) { + default: + reset_usage(); + } + } + + open_dev(argv[optind], &fd, 1, 1); + if (ioctl(fd, NVME_RESET_CONTROLLER) < 0) { + printf("Reset request to %s failed. errno=%d (%s)\n", + argv[optind], errno, strerror(errno)); + exit(EX_IOERR); + } + + exit(EX_OK); +} From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:53:29 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A71166EE; Wed, 3 Jul 2013 23:53:29 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 991C51F4A; Wed, 3 Jul 2013 23:53:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NrTB2069054; Wed, 3 Jul 2013 23:53:29 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63NrTRm069050; Wed, 3 Jul 2013 23:53:29 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032353.r63NrTRm069050@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:53:29 +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: r252662 - stable/9/sbin/nvmecontrol 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.14 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, 03 Jul 2013 23:53:29 -0000 Author: jimharris Date: Wed Jul 3 23:53:28 2013 New Revision: 252662 URL: http://svnweb.freebsd.org/changeset/base/252662 Log: MFC r252269: Add an nvme_function structure array, defining the name, C function and usage message for each nvmecontrol command. This helps reduce some code clutter both now and for future commits which will add logpage and firmware support to nvmecontrol(8). Also move helper function prototypes to the end of the header file, after the per-command functions. Also add missing static keyword that glebius@ fixed as part of r252302. Sponsored by: Intel Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:52:15 2013 (r252661) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:53:28 2013 (r252662) @@ -44,14 +44,31 @@ __FBSDID("$FreeBSD$"); #include "nvmecontrol.h" +typedef void (*nvme_fn_t)(int argc, char *argv[]); + +static struct nvme_function { + const char *name; + nvme_fn_t fn; + const char *usage; +} funcs[] = { + {"devlist", devlist, DEVLIST_USAGE}, + {"identify", identify, IDENTIFY_USAGE}, + {"perftest", perftest, PERFTEST_USAGE}, + {"reset", reset, RESET_USAGE}, + {NULL, NULL, NULL}, +}; + static void usage(void) { + struct nvme_function *f; + + f = funcs; fprintf(stderr, "usage:\n"); - fprintf(stderr, DEVLIST_USAGE); - fprintf(stderr, IDENTIFY_USAGE); - fprintf(stderr, RESET_USAGE); - fprintf(stderr, PERFTEST_USAGE); + while (f->name != NULL) { + fprintf(stderr, "%s", f->usage); + f++; + } exit(EX_USAGE); } @@ -136,18 +153,17 @@ open_dev(const char *str, int *fd, int s int main(int argc, char *argv[]) { + struct nvme_function *f; if (argc < 2) usage(); - if (strcmp(argv[1], "devlist") == 0) - devlist(argc-1, &argv[1]); - else if (strcmp(argv[1], "identify") == 0) - identify(argc-1, &argv[1]); - else if (strcmp(argv[1], "perftest") == 0) - perftest(argc-1, &argv[1]); - else if (strcmp(argv[1], "reset") == 0) - reset(argc-1, &argv[1]); + f = funcs; + while (f->name != NULL) { + if (strcmp(argv[1], f->name) == 0) + f->fn(argc-1, &argv[1]); + f++; + } usage(); Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:52:15 2013 (r252661) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:53:28 2013 (r252662) @@ -46,14 +46,14 @@ #define RESET_USAGE \ " nvmecontrol reset \n" -int open_dev(const char *str, int *fd, int show_error, int exit_on_error); -void read_controller_data(int fd, struct nvme_controller_data *cdata); -void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata); - void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); void perftest(int argc, char *argv[]); void reset(int argc, char *argv[]); +int open_dev(const char *str, int *fd, int show_error, int exit_on_error); +void read_controller_data(int fd, struct nvme_controller_data *cdata); +void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata); + #endif From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:54:37 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 159AF8C1; Wed, 3 Jul 2013 23:54:37 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E36431F5B; Wed, 3 Jul 2013 23:54:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NsaKG069249; Wed, 3 Jul 2013 23:54:36 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Nsa3D069246; Wed, 3 Jul 2013 23:54:36 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032354.r63Nsa3D069246@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:54: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: r252663 - stable/9/sbin/nvmecontrol 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.14 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, 03 Jul 2013 23:54:37 -0000 Author: jimharris Date: Wed Jul 3 23:54:36 2013 New Revision: 252663 URL: http://svnweb.freebsd.org/changeset/base/252663 Log: MFC r252270: Create #defines for NVME_CTRLR_PREFIX and NVME_NS_PREFIX for the "nvme" and "ns" strings, rather than hardcoding the string values throughout the nvmecontrol code base. Sponsored by: Intel Modified: stable/9/sbin/nvmecontrol/devlist.c stable/9/sbin/nvmecontrol/identify.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/devlist.c ============================================================================== --- stable/9/sbin/nvmecontrol/devlist.c Wed Jul 3 23:53:28 2013 (r252662) +++ stable/9/sbin/nvmecontrol/devlist.c Wed Jul 3 23:54:36 2013 (r252663) @@ -78,7 +78,7 @@ devlist(int argc, char *argv[]) while (1) { ctrlr++; - sprintf(name, "nvme%d", ctrlr); + sprintf(name, "%s%d", NVME_CTRLR_PREFIX, ctrlr); exit_code = open_dev(name, &fd, 0, 0); @@ -95,7 +95,8 @@ devlist(int argc, char *argv[]) printf("%6s: %s\n", name, cdata.mn); for (i = 0; i < cdata.nn; i++) { - sprintf(name, "nvme%dns%d", ctrlr, i+1); + sprintf(name, "%s%d%s%d", NVME_CTRLR_PREFIX, ctrlr, + NVME_NS_PREFIX, i+1); read_namespace_data(fd, i+1, &nsdata); printf(" %10s (%lldGB)\n", name, Modified: stable/9/sbin/nvmecontrol/identify.c ============================================================================== --- stable/9/sbin/nvmecontrol/identify.c Wed Jul 3 23:53:28 2013 (r252662) +++ stable/9/sbin/nvmecontrol/identify.c Wed Jul 3 23:54:36 2013 (r252663) @@ -258,7 +258,7 @@ identify_ns(int argc, char *argv[]) * of the string. Don't search past 10 characters into the string, * otherwise we know it is malformed. */ - nsloc = strnstr(argv[optind], "ns", 10); + nsloc = strnstr(argv[optind], NVME_NS_PREFIX, 10); if (nsloc != NULL) nsid = strtol(nsloc + 2, NULL, 10); if (nsloc == NULL || (nsid == 0 && errno != 0)) { @@ -314,7 +314,7 @@ identify(int argc, char *argv[]) * If device node contains "ns", we consider it a namespace, * otherwise, consider it a controller. */ - if (strstr(target, "ns") == NULL) + if (strstr(target, NVME_NS_PREFIX) == NULL) identify_ctrlr(argc, argv); else identify_ns(argc, argv); Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:53:28 2013 (r252662) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Wed Jul 3 23:54:36 2013 (r252663) @@ -31,6 +31,9 @@ #include +#define NVME_CTRLR_PREFIX "nvme" +#define NVME_NS_PREFIX "ns" + #define DEVLIST_USAGE \ " nvmecontrol devlist\n" From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:56:43 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F0829A08; Wed, 3 Jul 2013 23:56:42 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D2BF71F6D; Wed, 3 Jul 2013 23:56:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63NugYb069607; Wed, 3 Jul 2013 23:56:42 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Nugc0069603; Wed, 3 Jul 2013 23:56:42 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032356.r63Nugc0069603@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:56: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: r252664 - stable/9/sys/dev/nvme 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.14 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, 03 Jul 2013 23:56:43 -0000 Author: jimharris Date: Wed Jul 3 23:56:41 2013 New Revision: 252664 URL: http://svnweb.freebsd.org/changeset/base/252664 Log: MFC r252271: Use MAXPHYS to specify the maximum I/O size for nvme(4). Also allow admin commands to transfer up to this maximum I/O size, rather than the artificial limit previously imposed. The larger I/O size is very beneficial for upcoming firmware download support. This has the added benefit of simplifying the code since both admin and I/O commands now use the same maximum I/O size. Sponsored by: Intel Modified: stable/9/sys/dev/nvme/nvme.h stable/9/sys/dev/nvme/nvme_ctrlr.c stable/9/sys/dev/nvme/nvme_private.h stable/9/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/nvme/nvme.h ============================================================================== --- stable/9/sys/dev/nvme/nvme.h Wed Jul 3 23:54:36 2013 (r252663) +++ stable/9/sys/dev/nvme/nvme.h Wed Jul 3 23:56:41 2013 (r252664) @@ -33,6 +33,8 @@ #include #endif +#include + #define NVME_PASSTHROUGH_CMD _IOWR('n', 0, struct nvme_pt_command) #define NVME_RESET_CONTROLLER _IO('n', 1) @@ -45,6 +47,8 @@ */ #define NVME_GLOBAL_NAMESPACE_TAG ((uint32_t)0xFFFFFFFF) +#define NVME_MAX_XFER_SIZE MAXPHYS + union cap_lo_register { uint32_t raw; struct { Modified: stable/9/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/9/sys/dev/nvme/nvme_ctrlr.c Wed Jul 3 23:54:36 2013 (r252663) +++ stable/9/sys/dev/nvme/nvme_ctrlr.c Wed Jul 3 23:56:41 2013 (r252664) @@ -222,7 +222,6 @@ nvme_ctrlr_construct_admin_qpair(struct 0, /* vector */ num_entries, NVME_ADMIN_TRACKERS, - 16*1024, /* max xfer size */ ctrlr); } @@ -256,16 +255,6 @@ nvme_ctrlr_construct_io_qpairs(struct nv */ num_trackers = min(num_trackers, (num_entries-1)); - ctrlr->max_xfer_size = NVME_MAX_XFER_SIZE; - TUNABLE_INT_FETCH("hw.nvme.max_xfer_size", &ctrlr->max_xfer_size); - /* - * Check that tunable doesn't specify a size greater than what our - * driver supports, and is an even PAGE_SIZE multiple. - */ - if (ctrlr->max_xfer_size > NVME_MAX_XFER_SIZE || - ctrlr->max_xfer_size % PAGE_SIZE) - ctrlr->max_xfer_size = NVME_MAX_XFER_SIZE; - ctrlr->ioq = malloc(ctrlr->num_io_queues * sizeof(struct nvme_qpair), M_NVME, M_ZERO | M_WAITOK); @@ -284,7 +273,6 @@ nvme_ctrlr_construct_io_qpairs(struct nv ctrlr->msix_enabled ? i+1 : 0, /* vector */ num_entries, num_trackers, - ctrlr->max_xfer_size, ctrlr); if (ctrlr->per_cpu_io_queues) @@ -1089,8 +1077,8 @@ intx: if (!ctrlr->msix_enabled) nvme_ctrlr_configure_intx(ctrlr); + ctrlr->max_xfer_size = NVME_MAX_XFER_SIZE; nvme_ctrlr_construct_admin_qpair(ctrlr); - status = nvme_ctrlr_construct_io_qpairs(ctrlr); if (status != 0) Modified: stable/9/sys/dev/nvme/nvme_private.h ============================================================================== --- stable/9/sys/dev/nvme/nvme_private.h Wed Jul 3 23:54:36 2013 (r252663) +++ stable/9/sys/dev/nvme/nvme_private.h Wed Jul 3 23:56:41 2013 (r252664) @@ -60,8 +60,6 @@ MALLOC_DECLARE(M_NVME); #define IDT32_PCI_ID 0x80d0111d /* 32 channel board */ #define IDT8_PCI_ID 0x80d2111d /* 8 channel board */ -#define NVME_MAX_PRP_LIST_ENTRIES (32) - /* * For commands requiring more than 2 PRP entries, one PRP will be * embedded in the command (prp1), and the rest of the PRP entries @@ -69,7 +67,7 @@ MALLOC_DECLARE(M_NVME); * that real max number of PRP entries we support is 32+1, which * results in a max xfer size of 32*PAGE_SIZE. */ -#define NVME_MAX_XFER_SIZE NVME_MAX_PRP_LIST_ENTRIES * PAGE_SIZE +#define NVME_MAX_PRP_LIST_ENTRIES (NVME_MAX_XFER_SIZE / PAGE_SIZE) #define NVME_ADMIN_TRACKERS (16) #define NVME_ADMIN_ENTRIES (128) @@ -194,7 +192,6 @@ struct nvme_qpair { struct resource *res; void *tag; - uint32_t max_xfer_size; uint32_t num_entries; uint32_t num_trackers; uint32_t sq_tdbl_off; @@ -446,7 +443,7 @@ void nvme_ctrlr_post_failed_request(stru void nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, uint16_t vector, uint32_t num_entries, - uint32_t num_trackers, uint32_t max_xfer_size, + uint32_t num_trackers, struct nvme_controller *ctrlr); void nvme_qpair_submit_tracker(struct nvme_qpair *qpair, struct nvme_tracker *tr); Modified: stable/9/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/9/sys/dev/nvme/nvme_qpair.c Wed Jul 3 23:54:36 2013 (r252663) +++ stable/9/sys/dev/nvme/nvme_qpair.c Wed Jul 3 23:56:41 2013 (r252664) @@ -460,7 +460,7 @@ nvme_qpair_msix_handler(void *arg) void nvme_qpair_construct(struct nvme_qpair *qpair, uint32_t id, uint16_t vector, uint32_t num_entries, uint32_t num_trackers, - uint32_t max_xfer_size, struct nvme_controller *ctrlr) + struct nvme_controller *ctrlr) { struct nvme_tracker *tr; uint32_t i; @@ -478,7 +478,6 @@ nvme_qpair_construct(struct nvme_qpair * num_trackers = min(num_trackers, 64); #endif qpair->num_trackers = num_trackers; - qpair->max_xfer_size = max_xfer_size; qpair->ctrlr = ctrlr; if (ctrlr->msix_enabled) { @@ -501,8 +500,8 @@ nvme_qpair_construct(struct nvme_qpair * bus_dma_tag_create(bus_get_dma_tag(ctrlr->dev), sizeof(uint64_t), PAGE_SIZE, BUS_SPACE_MAXADDR, - BUS_SPACE_MAXADDR, NULL, NULL, qpair->max_xfer_size, - (qpair->max_xfer_size/PAGE_SIZE)+1, PAGE_SIZE, 0, + BUS_SPACE_MAXADDR, NULL, NULL, NVME_MAX_XFER_SIZE, + (NVME_MAX_XFER_SIZE/PAGE_SIZE)+1, PAGE_SIZE, 0, NULL, NULL, &qpair->dma_tag); qpair->num_cmds = 0; From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:58:09 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DD2ABBB3; Wed, 3 Jul 2013 23:58:09 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B4E8C1F7D; Wed, 3 Jul 2013 23:58:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Nw9Mk069824; Wed, 3 Jul 2013 23:58:09 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Nw9Z7069822; Wed, 3 Jul 2013 23:58:09 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032358.r63Nw9Z7069822@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:58: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: r252665 - stable/9/sys/dev/nvme 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.14 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, 03 Jul 2013 23:58:10 -0000 Author: jimharris Date: Wed Jul 3 23:58:09 2013 New Revision: 252665 URL: http://svnweb.freebsd.org/changeset/base/252665 Log: MFC r252272: Fail any passthrough command whose transfer size exceeds the controller's max transfer size. This guards against rogue commands coming in from userspace. Also add KASSERTS for the virtual address and unmapped bio cases, if the transfer size exceeds the controller's max transfer size. Sponsored by: Intel Modified: stable/9/sys/dev/nvme/nvme_ctrlr.c stable/9/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/9/sys/dev/nvme/nvme_ctrlr.c Wed Jul 3 23:56:41 2013 (r252664) +++ stable/9/sys/dev/nvme/nvme_ctrlr.c Wed Jul 3 23:58:09 2013 (r252665) @@ -895,7 +895,13 @@ nvme_ctrlr_passthrough_cmd(struct nvme_c struct buf *buf = NULL; int ret = 0; - if (pt->len > 0) + if (pt->len > 0) { + if (pt->len > ctrlr->max_xfer_size) { + nvme_printf(ctrlr, "pt->len (%d) " + "exceeds max_xfer_size (%d)\n", pt->len, + ctrlr->max_xfer_size); + return EIO; + } if (is_user_buffer) { /* * Ensure the user buffer is wired for the duration of @@ -920,7 +926,7 @@ nvme_ctrlr_passthrough_cmd(struct nvme_c } else req = nvme_allocate_request_vaddr(pt->buf, pt->len, nvme_pt_done, pt); - else + } else req = nvme_allocate_request_null(nvme_pt_done, pt); req->cmd.opc = pt->cmd.opc; Modified: stable/9/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/9/sys/dev/nvme/nvme_qpair.c Wed Jul 3 23:56:41 2013 (r252664) +++ stable/9/sys/dev/nvme/nvme_qpair.c Wed Jul 3 23:58:09 2013 (r252665) @@ -786,6 +786,9 @@ _nvme_qpair_submit_request(struct nvme_q switch (req->type) { case NVME_REQUEST_VADDR: + KASSERT(req->payload_size <= qpair->ctrlr->max_xfer_size, + ("payload_size (%d) exceeds max_xfer_size (%d)\n", + req->payload_size, qpair->ctrlr->max_xfer_size)); err = bus_dmamap_load(tr->qpair->dma_tag, tr->payload_dma_map, req->u.payload, req->payload_size, nvme_payload_map, tr, 0); if (err != 0) @@ -805,6 +808,10 @@ _nvme_qpair_submit_request(struct nvme_q break; #ifdef NVME_UNMAPPED_BIO_SUPPORT case NVME_REQUEST_BIO: + KASSERT(req->u.bio->bio_bcount <= qpair->ctrlr->max_xfer_size, + ("bio->bio_bcount (%jd) exceeds max_xfer_size (%d)\n", + (intmax_t)req->u.bio->bio_bcount, + qpair->ctrlr->max_xfer_size)); err = bus_dmamap_load_bio(tr->qpair->dma_tag, tr->payload_dma_map, req->u.bio, nvme_payload_map, tr, 0); if (err != 0) From owner-svn-src-stable@FreeBSD.ORG Wed Jul 3 23:59:09 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BBA04CEE; Wed, 3 Jul 2013 23:59:09 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 82F5B1F85; Wed, 3 Jul 2013 23:59:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r63Nx959069983; Wed, 3 Jul 2013 23:59:09 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r63Nx8Pi069980; Wed, 3 Jul 2013 23:59:08 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307032359.r63Nx8Pi069980@svn.freebsd.org> From: Jim Harris Date: Wed, 3 Jul 2013 23:59:08 +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: r252666 - stable/9/sys/dev/nvme 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.14 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, 03 Jul 2013 23:59:09 -0000 Author: jimharris Date: Wed Jul 3 23:59:08 2013 New Revision: 252666 URL: http://svnweb.freebsd.org/changeset/base/252666 Log: MFC r252273: Remove remaining uio-related code. The nvme_physio() function was removed quite a while ago, which was the only user of this uio-related code. Sponsored by: Intel Modified: stable/9/sys/dev/nvme/nvme_private.h stable/9/sys/dev/nvme/nvme_qpair.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/nvme/nvme_private.h ============================================================================== --- stable/9/sys/dev/nvme/nvme_private.h Wed Jul 3 23:58:09 2013 (r252665) +++ stable/9/sys/dev/nvme/nvme_private.h Wed Jul 3 23:59:08 2013 (r252666) @@ -145,7 +145,6 @@ struct nvme_request { struct nvme_qpair *qpair; union { void *payload; - struct uio *uio; struct bio *bio; } u; uint32_t type; @@ -469,8 +468,6 @@ int nvme_ns_construct(struct nvme_namesp struct nvme_controller *ctrlr); void nvme_ns_destruct(struct nvme_namespace *ns); -int nvme_ns_physio(struct cdev *dev, struct uio *uio, int ioflag); - void nvme_sysctl_initialize_ctrlr(struct nvme_controller *ctrlr); void nvme_dump_command(struct nvme_command *cmd); @@ -525,19 +522,6 @@ nvme_allocate_request_null(nvme_cb_fn_t } static __inline struct nvme_request * -nvme_allocate_request_uio(struct uio *uio, nvme_cb_fn_t cb_fn, void *cb_arg) -{ - struct nvme_request *req; - - req = _nvme_allocate_request(cb_fn, cb_arg); - if (req != NULL) { - req->type = NVME_REQUEST_UIO; - req->u.uio = uio; - } - return (req); -} - -static __inline struct nvme_request * nvme_allocate_request_bio(struct bio *bio, nvme_cb_fn_t cb_fn, void *cb_arg) { struct nvme_request *req; Modified: stable/9/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/9/sys/dev/nvme/nvme_qpair.c Wed Jul 3 23:58:09 2013 (r252665) +++ stable/9/sys/dev/nvme/nvme_qpair.c Wed Jul 3 23:59:08 2013 (r252666) @@ -735,14 +735,6 @@ nvme_payload_map(void *arg, bus_dma_segm } static void -nvme_payload_map_uio(void *arg, bus_dma_segment_t *seg, int nseg, - bus_size_t mapsize, int error) -{ - - nvme_payload_map(arg, seg, nseg, error); -} - -static void _nvme_qpair_submit_request(struct nvme_qpair *qpair, struct nvme_request *req) { struct nvme_tracker *tr; @@ -798,14 +790,6 @@ _nvme_qpair_submit_request(struct nvme_q case NVME_REQUEST_NULL: nvme_qpair_submit_tracker(tr->qpair, tr); break; - case NVME_REQUEST_UIO: - err = bus_dmamap_load_uio(tr->qpair->dma_tag, - tr->payload_dma_map, req->u.uio, nvme_payload_map_uio, - tr, 0); - if (err != 0) - nvme_printf(qpair->ctrlr, - "bus_dmamap_load_uio returned 0x%x!\n", err); - break; #ifdef NVME_UNMAPPED_BIO_SUPPORT case NVME_REQUEST_BIO: KASSERT(req->u.bio->bio_bcount <= qpair->ctrlr->max_xfer_size, From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 00:01:00 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8AFBFEC2; Thu, 4 Jul 2013 00:01:00 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6DB551FA1; Thu, 4 Jul 2013 00:01:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64010uP072067; Thu, 4 Jul 2013 00:01:00 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6400xJQ072040; Thu, 4 Jul 2013 00:00:59 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307040000.r6400xJQ072040@svn.freebsd.org> From: Jim Harris Date: Thu, 4 Jul 2013 00:00: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: r252667 - stable/9/sbin/nvmecontrol 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.14 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, 04 Jul 2013 00:01:00 -0000 Author: jimharris Date: Thu Jul 4 00:00:59 2013 New Revision: 252667 URL: http://svnweb.freebsd.org/changeset/base/252667 Log: MFC r252274: Ensure that a device node is specified when invoking the identify or reset commands. Also improve the checking of device node names, so that better error messages are displayed when incorrect names are specified. Sponsored by: Intel Modified: stable/9/sbin/nvmecontrol/identify.c stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/reset.c Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/identify.c ============================================================================== --- stable/9/sbin/nvmecontrol/identify.c Wed Jul 3 23:59:08 2013 (r252666) +++ stable/9/sbin/nvmecontrol/identify.c Thu Jul 4 00:00:59 2013 (r252667) @@ -200,6 +200,10 @@ identify_ctrlr(int argc, char *argv[]) } } + /* Check that a controller was specified. */ + if (optind >= argc) + identify_usage(); + open_dev(argv[optind], &fd, 1, 1); read_controller_data(fd, &cdata); close(fd); @@ -245,6 +249,10 @@ identify_ns(int argc, char *argv[]) } } + /* Check that a namespace was specified. */ + if (optind >= argc) + identify_usage(); + /* * Check if the specified device node exists before continuing. * This is a cleaner check for cases where the correct controller Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Wed Jul 3 23:59:08 2013 (r252666) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Thu Jul 4 00:00:59 2013 (r252667) @@ -126,10 +126,22 @@ open_dev(const char *str, int *fd, int s struct stat devstat; char full_path[64]; + if (!strnstr(str, NVME_CTRLR_PREFIX, strlen(NVME_CTRLR_PREFIX))) { + if (show_error) + fprintf(stderr, + "Controller/namespace IDs must begin with '%s'.\n", + NVME_CTRLR_PREFIX); + if (exit_on_error) + exit(EX_USAGE); + else + return (EX_USAGE); + } + snprintf(full_path, sizeof(full_path), "/dev/%s", str); if (stat(full_path, &devstat) != 0) { if (show_error) - fprintf(stderr, "error\n"); + fprintf(stderr, "Could not stat %s. errno=%d (%s)\n", + full_path, errno, strerror(errno)); if (exit_on_error) exit(EX_NOINPUT); else @@ -139,8 +151,8 @@ open_dev(const char *str, int *fd, int s *fd = open(full_path, O_RDWR); if (*fd < 0) { if (show_error) - printf("Could not open %s. errno=%d (%s)\n", full_path, - errno, strerror(errno)); + fprintf(stderr, "Could not open %s. errno=%d (%s)\n", + full_path, errno, strerror(errno)); if (exit_on_error) exit(EX_NOPERM); else Modified: stable/9/sbin/nvmecontrol/reset.c ============================================================================== --- stable/9/sbin/nvmecontrol/reset.c Wed Jul 3 23:59:08 2013 (r252666) +++ stable/9/sbin/nvmecontrol/reset.c Thu Jul 4 00:00:59 2013 (r252667) @@ -60,6 +60,10 @@ reset(int argc, char *argv[]) } } + /* Check that a controller was specified. */ + if (optind >= argc) + reset_usage(); + open_dev(argv[optind], &fd, 1, 1); if (ioctl(fd, NVME_RESET_CONTROLLER) < 0) { printf("Reset request to %s failed. errno=%d (%s)\n", From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 00:03:31 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9E3C51DC; Thu, 4 Jul 2013 00:03:31 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8EEA71FBF; Thu, 4 Jul 2013 00:03:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6403Vjj072602; Thu, 4 Jul 2013 00:03:31 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6403V5T072599; Thu, 4 Jul 2013 00:03:31 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307040003.r6403V5T072599@svn.freebsd.org> From: Jim Harris Date: Thu, 4 Jul 2013 00:03: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: r252669 - stable/9/sbin/nvmecontrol 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.14 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, 04 Jul 2013 00:03:31 -0000 Author: jimharris Date: Thu Jul 4 00:03:30 2013 New Revision: 252669 URL: http://svnweb.freebsd.org/changeset/base/252669 Log: MFC r252275: Add generalized helper functions for printing hex data as part of nvmecontrol commands. Submitted by: Joe Golio Obtained from: EMC / Isilon Storage Division Modified: stable/9/sbin/nvmecontrol/identify.c stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/identify.c ============================================================================== --- stable/9/sbin/nvmecontrol/identify.c Thu Jul 4 00:02:10 2013 (r252668) +++ stable/9/sbin/nvmecontrol/identify.c Thu Jul 4 00:03:30 2013 (r252669) @@ -42,25 +42,6 @@ __FBSDID("$FreeBSD$"); #include "nvmecontrol.h" static void -print_controller_hex(struct nvme_controller_data *cdata, uint32_t length) -{ - uint32_t *p; - uint32_t i, j; - - p = (uint32_t *)cdata; - length /= sizeof(uint32_t); - - for (i = 0; i < length; i+=8) { - printf("%03x: ", i*4); - for (j = 0; j < 8; j++) - printf("%08x ", p[i+j]); - printf("\n"); - } - - printf("\n"); -} - -static void print_controller(struct nvme_controller_data *cdata) { printf("Controller Capabilities/Features\n"); @@ -128,25 +109,6 @@ print_controller(struct nvme_controller_ } static void -print_namespace_hex(struct nvme_namespace_data *nsdata, uint32_t length) -{ - uint32_t *p; - uint32_t i, j; - - p = (uint32_t *)nsdata; - length /= sizeof(uint32_t); - - for (i = 0; i < length; i+=8) { - printf("%03x: ", i*4); - for (j = 0; j < 8; j++) - printf("%08x ", p[i+j]); - printf("\n"); - } - - printf("\n"); -} - -static void print_namespace(struct nvme_namespace_data *nsdata) { uint32_t i; @@ -214,7 +176,7 @@ identify_ctrlr(int argc, char *argv[]) else hexlength = offsetof(struct nvme_controller_data, reserved5); - print_controller_hex(&cdata, hexlength); + print_hex(&cdata, hexlength); exit(EX_OK); } @@ -290,7 +252,7 @@ identify_ns(int argc, char *argv[]) else hexlength = offsetof(struct nvme_namespace_data, reserved6); - print_namespace_hex(&nsdata, hexlength); + print_hex(&nsdata, hexlength); exit(EX_OK); } Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Thu Jul 4 00:02:10 2013 (r252668) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Thu Jul 4 00:03:30 2013 (r252669) @@ -72,6 +72,54 @@ usage(void) exit(EX_USAGE); } +static void +print_bytes(void *data, uint32_t length) +{ + uint32_t i, j; + uint8_t *p, *end; + + end = (uint8_t *)data + length; + + for (i = 0; i < length; i++) { + p = (uint8_t *)data + (i*16); + printf("%03x: ", i*16); + for (j = 0; j < 16 && p < end; j++) + printf("%02x ", *p++); + if (p >= end) + break; + printf("\n"); + } + printf("\n"); +} + +static void +print_dwords(void *data, uint32_t length) +{ + uint32_t *p; + uint32_t i, j; + + p = (uint32_t *)data; + length /= sizeof(uint32_t); + + for (i = 0; i < length; i+=8) { + printf("%03x: ", i*4); + for (j = 0; j < 8; j++) + printf("%08x ", p[i+j]); + printf("\n"); + } + + printf("\n"); +} + +void +print_hex(void *data, uint32_t length) +{ + if (length >= sizeof(uint32_t) || length % sizeof(uint32_t) == 0) + print_dwords(data, length); + else + print_bytes(data, length); +} + void read_controller_data(int fd, struct nvme_controller_data *cdata) { Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Thu Jul 4 00:02:10 2013 (r252668) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Thu Jul 4 00:03:30 2013 (r252669) @@ -57,6 +57,7 @@ void reset(int argc, char *argv[]); int open_dev(const char *str, int *fd, int show_error, int exit_on_error); void read_controller_data(int fd, struct nvme_controller_data *cdata); void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata); +void print_hex(void *data, uint32_t length); #endif From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 00:06:12 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B296039D; Thu, 4 Jul 2013 00:06:12 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A293C1FDA; Thu, 4 Jul 2013 00:06:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6406CZv073097; Thu, 4 Jul 2013 00:06:12 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6406Bva073090; Thu, 4 Jul 2013 00:06:11 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307040006.r6406Bva073090@svn.freebsd.org> From: Jim Harris Date: Thu, 4 Jul 2013 00:06:11 +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: r252670 - stable/9/sbin/nvmecontrol 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.14 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, 04 Jul 2013 00:06:12 -0000 Author: jimharris Date: Thu Jul 4 00:06:11 2013 New Revision: 252670 URL: http://svnweb.freebsd.org/changeset/base/252670 Log: MFC r252277: Add log page support to nvmecontrol(8) through a new logpage command. This includes pretty printers for all of the standard NVMe log pages (Error, SMART/Health, Firmware), as well as hex output for non-standard or vendor-specific log pages. Also add missing static keyword that glebius@ fixed as part of r252302. Submitted by: Joe Golio Obtained from: EMC / Isilon Storage Division Added: stable/9/sbin/nvmecontrol/logpage.c - copied, changed from r252277, head/sbin/nvmecontrol/logpage.c Modified: stable/9/sbin/nvmecontrol/Makefile stable/9/sbin/nvmecontrol/nvmecontrol.8 stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/nvmecontrol.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) Modified: stable/9/sbin/nvmecontrol/Makefile ============================================================================== --- stable/9/sbin/nvmecontrol/Makefile Thu Jul 4 00:03:30 2013 (r252669) +++ stable/9/sbin/nvmecontrol/Makefile Thu Jul 4 00:06:11 2013 (r252670) @@ -1,7 +1,7 @@ # $FreeBSD$ PROG= nvmecontrol -SRCS= nvmecontrol.c devlist.c identify.c perftest.c reset.c +SRCS= nvmecontrol.c devlist.c identify.c logpage.c perftest.c reset.c MAN= nvmecontrol.8 .include Copied and modified: stable/9/sbin/nvmecontrol/logpage.c (from r252277, head/sbin/nvmecontrol/logpage.c) ============================================================================== --- head/sbin/nvmecontrol/logpage.c Wed Jun 26 23:53:54 2013 (r252277, copy source) +++ stable/9/sbin/nvmecontrol/logpage.c Thu Jul 4 00:06:11 2013 (r252670) @@ -227,7 +227,7 @@ print_log_firmware(void *buf, uint32_t s } } -struct logpage_function { +static struct logpage_function { uint8_t log_page; print_fn_t fn; } logfuncs[] = { Modified: stable/9/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.8 Thu Jul 4 00:03:30 2013 (r252669) +++ stable/9/sbin/nvmecontrol/nvmecontrol.8 Thu Jul 4 00:06:11 2013 (r252670) @@ -58,6 +58,12 @@ .Nm .Ic reset .Aq controller id +.Nm +.Ic logpage +.Aq Fl p Ar page_id +.Op Fl x +.Aq device id +.Aq namespace id .Sh DESCRIPTION NVM Express (NVMe) is a storage protocol standard, for SSDs and other high-speed storage devices over PCI Express. @@ -84,6 +90,16 @@ stdout when 30 seconds expires. .Dl nvmecontrol reset nvme0 .Pp Perform a controller-level reset of the nvme0 controller. +.Pp +.Dl nvmecontrol logpage -p 1 nvme0 +.Pp +Display a human-readable summary of the nvme0 controller's Error Information Log. +Log pages defined by the NVMe specification include Error Information Log (ID=1), +SMART/Health Information Log (ID=2), and Firmware Slot Log (ID=3). +.Pp +.Dl nvmecontrol logpage -p 1 -x nvme0 +.Pp +Display a hexidecimal dump of the nvme0 controller's Error Information Log. .Sh AUTHORS .An -nosplit .Nm Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Thu Jul 4 00:03:30 2013 (r252669) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Thu Jul 4 00:06:11 2013 (r252670) @@ -55,6 +55,7 @@ static struct nvme_function { {"identify", identify, IDENTIFY_USAGE}, {"perftest", perftest, PERFTEST_USAGE}, {"reset", reset, RESET_USAGE}, + {"logpage", logpage, LOGPAGE_USAGE}, {NULL, NULL, NULL}, }; Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Thu Jul 4 00:03:30 2013 (r252669) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Thu Jul 4 00:06:11 2013 (r252670) @@ -49,15 +49,21 @@ #define RESET_USAGE \ " nvmecontrol reset \n" +#define LOGPAGE_USAGE \ +" nvmecontrol logpage <-p page_id> [-x] \n" \ + void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); void perftest(int argc, char *argv[]); void reset(int argc, char *argv[]); +void logpage(int argc, char *argv[]); int open_dev(const char *str, int *fd, int show_error, int exit_on_error); void read_controller_data(int fd, struct nvme_controller_data *cdata); void read_namespace_data(int fd, int nsid, struct nvme_namespace_data *nsdata); void print_hex(void *data, uint32_t length); +void read_logpage(int fd, uint8_t log_page, int nsid, void *payload, + uint32_t payload_size); #endif From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 00:16:45 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 24FF2596; Thu, 4 Jul 2013 00:16:45 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 14BE1101E; Thu, 4 Jul 2013 00:16:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r640Gi0b076418; Thu, 4 Jul 2013 00:16:44 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r640GhvI076412; Thu, 4 Jul 2013 00:16:43 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201307040016.r640GhvI076412@svn.freebsd.org> From: Jim Harris Date: Thu, 4 Jul 2013 00:16: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: r252671 - in stable/9: sbin/nvmecontrol sys/dev/nvme 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.14 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, 04 Jul 2013 00:16:45 -0000 Author: jimharris Date: Thu Jul 4 00:16:43 2013 New Revision: 252671 URL: http://svnweb.freebsd.org/changeset/base/252671 Log: MFC r252278: Add firmware replacement and activation support to nvmecontrol(8) through a new firmware command. NVMe controllers may support up to 7 firmware slots for storing of different firmware revisions. This new firmware command supports firmware replacement (i.e. firmware download) with or without immediate activation, or activation of a previously stored firmware image. It also supports selection of the firmware slot during replacement operations, using IDENTIFY information from the controller to check that the specified slot is valid. Newly activated firmware does not take effect until the new controller reset, either via a reboot or separate 'nvmecontrol reset' command to the same controller. Submitted by: Joe Golio Obtained from: EMC / Isilon Storage Division Added: stable/9/sbin/nvmecontrol/firmware.c - copied, changed from r252278, head/sbin/nvmecontrol/firmware.c Modified: stable/9/sbin/nvmecontrol/Makefile stable/9/sbin/nvmecontrol/nvmecontrol.8 stable/9/sbin/nvmecontrol/nvmecontrol.c stable/9/sbin/nvmecontrol/nvmecontrol.h stable/9/sys/dev/nvme/nvme.h Directory Properties: stable/9/sbin/nvmecontrol/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sbin/nvmecontrol/Makefile ============================================================================== --- stable/9/sbin/nvmecontrol/Makefile Thu Jul 4 00:06:11 2013 (r252670) +++ stable/9/sbin/nvmecontrol/Makefile Thu Jul 4 00:16:43 2013 (r252671) @@ -1,7 +1,8 @@ # $FreeBSD$ PROG= nvmecontrol -SRCS= nvmecontrol.c devlist.c identify.c logpage.c perftest.c reset.c +SRCS= nvmecontrol.c devlist.c firmware.c identify.c logpage.c \ + perftest.c reset.c MAN= nvmecontrol.8 .include Copied and modified: stable/9/sbin/nvmecontrol/firmware.c (from r252278, head/sbin/nvmecontrol/firmware.c) ============================================================================== --- head/sbin/nvmecontrol/firmware.c Thu Jun 27 00:08:25 2013 (r252278, copy source) +++ stable/9/sbin/nvmecontrol/firmware.c Thu Jul 4 00:16:43 2013 (r252671) @@ -82,7 +82,7 @@ read_image_file(char *path, void **buf, exit(EX_IOERR); } if ((*buf = malloc(sb.st_size)) == NULL) { - fprintf(stderr, "Unable to malloc %zd bytes.\n", + fprintf(stderr, "Unable to malloc %jd bytes.\n", sb.st_size); close(fd); exit(EX_IOERR); @@ -95,7 +95,7 @@ read_image_file(char *path, void **buf, } if (*size != sb.st_size) { fprintf(stderr, "Error reading '%s', " - "read %zd bytes, requested %zd bytes\n", + "read %zd bytes, requested %jd bytes\n", path, *size, sb.st_size); close(fd); exit(EX_IOERR); Modified: stable/9/sbin/nvmecontrol/nvmecontrol.8 ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.8 Thu Jul 4 00:06:11 2013 (r252670) +++ stable/9/sbin/nvmecontrol/nvmecontrol.8 Thu Jul 4 00:16:43 2013 (r252671) @@ -64,6 +64,12 @@ .Op Fl x .Aq device id .Aq namespace id +.Nm +.Ic firmware +.Op Fl s Ar slot +.Op Fl f Ar path_to_firmware +.Op Fl a +.Aq device id .Sh DESCRIPTION NVM Express (NVMe) is a storage protocol standard, for SSDs and other high-speed storage devices over PCI Express. @@ -100,6 +106,20 @@ SMART/Health Information Log (ID=2), and .Dl nvmecontrol logpage -p 1 -x nvme0 .Pp Display a hexidecimal dump of the nvme0 controller's Error Information Log. +.Pp +.Dl nvmecontrol firmware -s 2 -f /tmp/nvme_firmware nvme0 +.Pp +Download the firmware image contained in "/tmp/nvme_firmware" to slot 2 of the +nvme0 controller, but do not activate the image. +.Pp +.Dl nvmecontrol firmware -s 4 -a nvme0 +.Pp +Activate the firmware in slot 4 of the nvme0 controller on the next reset. +.Pp +.Dl nvmecontrol firmware -s 7 -f /tmp/nvme_firmware -a nvme0 +.Pp +Download the firmware image contained in "/tmp/nvme_firmware" to slot 7 of the +nvme0 controller and activate it on the next reset. .Sh AUTHORS .An -nosplit .Nm Modified: stable/9/sbin/nvmecontrol/nvmecontrol.c ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.c Thu Jul 4 00:06:11 2013 (r252670) +++ stable/9/sbin/nvmecontrol/nvmecontrol.c Thu Jul 4 00:16:43 2013 (r252671) @@ -56,6 +56,7 @@ static struct nvme_function { {"perftest", perftest, PERFTEST_USAGE}, {"reset", reset, RESET_USAGE}, {"logpage", logpage, LOGPAGE_USAGE}, + {"firmware", firmware, FIRMWARE_USAGE}, {NULL, NULL, NULL}, }; Modified: stable/9/sbin/nvmecontrol/nvmecontrol.h ============================================================================== --- stable/9/sbin/nvmecontrol/nvmecontrol.h Thu Jul 4 00:06:11 2013 (r252670) +++ stable/9/sbin/nvmecontrol/nvmecontrol.h Thu Jul 4 00:16:43 2013 (r252671) @@ -52,11 +52,15 @@ #define LOGPAGE_USAGE \ " nvmecontrol logpage <-p page_id> [-x] \n" \ +#define FIRMWARE_USAGE \ +" nvmecontrol firmware [-s slot] [-f path_to_firmware] [-a] \n" + void devlist(int argc, char *argv[]); void identify(int argc, char *argv[]); void perftest(int argc, char *argv[]); void reset(int argc, char *argv[]); void logpage(int argc, char *argv[]); +void firmware(int argc, char *argv[]); int open_dev(const char *str, int *fd, int show_error, int exit_on_error); void read_controller_data(int fd, struct nvme_controller_data *cdata); Modified: stable/9/sys/dev/nvme/nvme.h ============================================================================== --- stable/9/sys/dev/nvme/nvme.h Thu Jul 4 00:06:11 2013 (r252670) +++ stable/9/sys/dev/nvme/nvme.h Thu Jul 4 00:16:43 2013 (r252671) @@ -383,6 +383,12 @@ enum nvme_dsm_attribute { NVME_DSM_ATTR_DEALLOCATE = 0x4, }; +enum nvme_activate_action { + NVME_AA_REPLACE_NO_ACTIVATE = 0x0, + NVME_AA_REPLACE_ACTIVATE = 0x1, + NVME_AA_ACTIVATE = 0x2, +}; + struct nvme_controller_data { /* bytes 0-255: controller capabilities and features */ From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 01:15:44 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C8761DF; Thu, 4 Jul 2013 01:15:44 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA39A11F7; Thu, 4 Jul 2013 01:15:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r641FiQd094350; Thu, 4 Jul 2013 01:15:44 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r641FiGM094349; Thu, 4 Jul 2013 01:15:44 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201307040115.r641FiGM094349@svn.freebsd.org> From: Rick Macklem Date: Thu, 4 Jul 2013 01:15: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: r252674 - stable/9/usr.sbin/gssd 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.14 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, 04 Jul 2013 01:15:44 -0000 Author: rmacklem Date: Thu Jul 4 01:15:44 2013 New Revision: 252674 URL: http://svnweb.freebsd.org/changeset/base/252674 Log: MFC: r252138 Add a new "-o" option to the gssd which forces gss_init_sec_context() to use DES and the associated old style GSS initialization token. This appears to be required for some non-FreeBSD servers to get a kerberized NFS mount to work. Also, ignore some signals when daemonized, which might fix the gssd from "disappearing" without leaving a core dump. Given the tight timeframe for the FreeBSD9.2 release, I have committed this while waiting for code review. I will commit changes recommended by the review in a separate commit. Modified: stable/9/usr.sbin/gssd/gssd.c Directory Properties: stable/9/usr.sbin/gssd/ (props changed) Modified: stable/9/usr.sbin/gssd/gssd.c ============================================================================== --- stable/9/usr.sbin/gssd/gssd.c Thu Jul 4 00:54:23 2013 (r252673) +++ stable/9/usr.sbin/gssd/gssd.c Thu Jul 4 01:15:44 2013 (r252674) @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#include #include #include #include @@ -73,11 +74,26 @@ int debug_level; static char ccfile_dirlist[PATH_MAX + 1], ccfile_substring[NAME_MAX + 1]; static char pref_realm[1024]; static int verbose; +static int use_old_des; +#ifndef WITHOUT_KERBEROS +/* 1.2.752.43.13.14 */ +static gss_OID_desc gss_krb5_set_allowable_enctypes_x_desc = +{6, (void *) "\x2a\x85\x70\x2b\x0d\x0e"}; +static gss_OID GSS_KRB5_SET_ALLOWABLE_ENCTYPES_X = + &gss_krb5_set_allowable_enctypes_x_desc; +static gss_OID_desc gss_krb5_mech_oid_x_desc = +{9, (void *) "\x2a\x86\x48\x86\xf7\x12\x01\x02\x02" }; +static gss_OID GSS_KRB5_MECH_OID_X = + &gss_krb5_mech_oid_x_desc; +#endif static void gssd_load_mech(void); static int find_ccache_file(const char *, uid_t, char *); static int is_a_valid_tgt_cache(const char *, uid_t, int *, time_t *); static void gssd_verbose_out(const char *, ...); +#ifndef WITHOUT_KERBEROS +static OM_uint32 gssd_get_user_cred(OM_uint32 *, uid_t, gss_cred_id_t *); +#endif extern void gssd_1(struct svc_req *rqstp, SVCXPRT *transp); extern int gssd_syscall(char *path); @@ -103,11 +119,22 @@ main(int argc, char **argv) pref_realm[0] = '\0'; debug = 0; verbose = 0; - while ((ch = getopt(argc, argv, "dvs:c:r:")) != -1) { + while ((ch = getopt(argc, argv, "dovs:c:r:")) != -1) { switch (ch) { case 'd': debug_level++; break; + case 'o': +#ifndef WITHOUT_KERBEROS + /* + * Force use of DES and the old type of GSSAPI token. + */ + use_old_des = 1; +#else + errx(1, "This option not available when built" + " without MK_KERBEROS\n"); +#endif + break; case 'v': verbose = 1; break; @@ -149,8 +176,12 @@ main(int argc, char **argv) gssd_load_mech(); - if (!debug_level) + if (!debug_level) { daemon(0, 0); + signal(SIGINT, SIG_IGN); + signal(SIGQUIT, SIG_IGN); + signal(SIGHUP, SIG_IGN); + } memset(&sun, 0, sizeof sun); sun.sun_family = AF_LOCAL; @@ -336,7 +367,14 @@ gssd_init_sec_context_1_svc(init_sec_con gss_ctx_id_t ctx = GSS_C_NO_CONTEXT; gss_name_t name = GSS_C_NO_NAME; char ccname[PATH_MAX + 5 + 1], *cp, *cp2; - int gotone; + int gotone, gotcred; + OM_uint32 min_stat; +#ifndef WITHOUT_KERBEROS + gss_buffer_desc principal_desc; + char enctype[sizeof(uint32_t)]; + int key_enctype; + OM_uint32 maj_stat; +#endif memset(result, 0, sizeof(*result)); if (ccfile_dirlist[0] != '\0' && argp->cred == 0) { @@ -411,7 +449,46 @@ gssd_init_sec_context_1_svc(init_sec_con return (TRUE); } } + gotcred = 0; +#ifndef WITHOUT_KERBEROS + if (use_old_des != 0) { + if (cred == GSS_C_NO_CREDENTIAL) { + /* Acquire a credential for the uid. */ + maj_stat = gssd_get_user_cred(&min_stat, argp->uid, + &cred); + if (maj_stat == GSS_S_COMPLETE) + gotcred = 1; + else + gssd_verbose_out("gssd_init_sec_context: " + "get user cred failed uid=%d major=0x%x " + "minor=%d\n", (int)argp->uid, + (unsigned int)maj_stat, (int)min_stat); + } + if (cred != GSS_C_NO_CREDENTIAL) { + key_enctype = ETYPE_DES_CBC_CRC; + enctype[0] = (key_enctype >> 24) & 0xff; + enctype[1] = (key_enctype >> 16) & 0xff; + enctype[2] = (key_enctype >> 8) & 0xff; + enctype[3] = key_enctype & 0xff; + principal_desc.length = sizeof(enctype); + principal_desc.value = enctype; + result->major_status = gss_set_cred_option( + &result->minor_status, &cred, + GSS_KRB5_SET_ALLOWABLE_ENCTYPES_X, + &principal_desc); + gssd_verbose_out("gssd_init_sec_context: set allowable " + "enctype major=0x%x minor=%d\n", + (unsigned int)result->major_status, + (int)result->minor_status); + if (result->major_status != GSS_S_COMPLETE) { + if (gotcred != 0) + gss_release_cred(&min_stat, &cred); + return (TRUE); + } + } + } +#endif result->major_status = gss_init_sec_context(&result->minor_status, cred, &ctx, name, argp->mech_type, argp->req_flags, argp->time_req, argp->input_chan_bindings, @@ -420,6 +497,8 @@ gssd_init_sec_context_1_svc(init_sec_con gssd_verbose_out("gssd_init_sec_context: done major=0x%x minor=%d" " uid=%d\n", (unsigned int)result->major_status, (int)result->minor_status, (int)argp->uid); + if (gotcred != 0) + gss_release_cred(&min_stat, &cred); if (result->major_status == GSS_S_COMPLETE || result->major_status == GSS_S_CONTINUE_NEEDED) { @@ -687,6 +766,11 @@ gssd_acquire_cred_1_svc(acquire_cred_arg gss_cred_id_t cred; char ccname[PATH_MAX + 5 + 1], *cp, *cp2; int gotone; +#ifndef WITHOUT_KERBEROS + gss_buffer_desc namebuf; + uint32_t minstat; + krb5_error_code kret; +#endif memset(result, 0, sizeof(*result)); if (ccfile_dirlist[0] != '\0' && argp->desired_name == 0) { @@ -1026,3 +1110,52 @@ is_a_valid_tgt_cache(const char *filepat #endif /* !WITHOUT_KERBEROS */ } +#ifndef WITHOUT_KERBEROS +/* + * Acquire a gss credential for a uid. + */ +static OM_uint32 +gssd_get_user_cred(OM_uint32 *min_statp, uid_t uid, gss_cred_id_t *credp) +{ + gss_buffer_desc principal_desc; + gss_name_t name; + OM_uint32 maj_stat, min_stat; + gss_OID_set mechlist; + struct passwd *pw; + + pw = getpwuid(uid); + if (pw == NULL) { + *min_statp = 0; + return (GSS_S_FAILURE); + } + + /* + * The mechanism must be set to KerberosV for acquisition + * of credentials to work reliably. + */ + maj_stat = gss_create_empty_oid_set(min_statp, &mechlist); + if (maj_stat != GSS_S_COMPLETE) + return (maj_stat); + maj_stat = gss_add_oid_set_member(min_statp, GSS_KRB5_MECH_OID_X, + &mechlist); + if (maj_stat != GSS_S_COMPLETE) { + gss_release_oid_set(&min_stat, &mechlist); + return (maj_stat); + } + + principal_desc.value = (void *)pw->pw_name; + principal_desc.length = strlen(pw->pw_name); + maj_stat = gss_import_name(min_statp, &principal_desc, + GSS_C_NT_USER_NAME, &name); + if (maj_stat != GSS_S_COMPLETE) { + gss_release_oid_set(&min_stat, &mechlist); + return (maj_stat); + } + /* Acquire the credentials. */ + maj_stat = gss_acquire_cred(min_statp, name, 0, mechlist, + GSS_C_INITIATE, credp, NULL, NULL); + gss_release_name(&min_stat, &name); + gss_release_oid_set(&min_stat, &mechlist); + return (maj_stat); +} +#endif /* !WITHOUT_KERBEROS */ From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 01:18:39 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5CBA522C; Thu, 4 Jul 2013 01:18:39 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3A1120D; Thu, 4 Jul 2013 01:18:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r641IduP094758; Thu, 4 Jul 2013 01:18:39 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r641IdlD094757; Thu, 4 Jul 2013 01:18:39 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201307040118.r641IdlD094757@svn.freebsd.org> From: Rick Macklem Date: Thu, 4 Jul 2013 01:18: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: r252675 - stable/9/usr.sbin/gssd 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.14 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, 04 Jul 2013 01:18:39 -0000 Author: rmacklem Date: Thu Jul 4 01:18:38 2013 New Revision: 252675 URL: http://svnweb.freebsd.org/changeset/base/252675 Log: MFC: r252139 Document the "-o" option added by r252138. This is a content change. Modified: stable/9/usr.sbin/gssd/gssd.8 Directory Properties: stable/9/usr.sbin/gssd/ (props changed) Modified: stable/9/usr.sbin/gssd/gssd.8 ============================================================================== --- stable/9/usr.sbin/gssd/gssd.8 Thu Jul 4 01:15:44 2013 (r252674) +++ stable/9/usr.sbin/gssd/gssd.8 Thu Jul 4 01:18:38 2013 (r252675) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 5, 2013 +.Dd June 23, 2013 .Dt GSSD 8 .Os .Sh NAME @@ -34,6 +34,7 @@ .Sh SYNOPSIS .Nm .Op Fl d +.Op Fl o .Op Fl v .Op Fl s Ar dir-list .Op Fl c Ar file-substring @@ -50,6 +51,10 @@ Run in debug mode. In this mode, .Nm will not fork when it starts. +.It Fl o +Force use of DES and the associated old style GSS-API initialization token. +This may be required to make kerberized NFS mounts work against some +non-FreeBSD NFS servers. .It Fl v Run in verbose mode. In this mode, From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 01:22:53 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 67A8F388; Thu, 4 Jul 2013 01:22:53 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58845122A; Thu, 4 Jul 2013 01:22:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r641Mr1U096983; Thu, 4 Jul 2013 01:22:53 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r641MrfA096982; Thu, 4 Jul 2013 01:22:53 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201307040122.r641MrfA096982@svn.freebsd.org> From: Rick Macklem Date: Thu, 4 Jul 2013 01:22: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: r252676 - stable/9/usr.sbin/nfsd 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.14 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, 04 Jul 2013 01:22:53 -0000 Author: rmacklem Date: Thu Jul 4 01:22:52 2013 New Revision: 252676 URL: http://svnweb.freebsd.org/changeset/base/252676 Log: MFC: r252483 Document that NFSv4 mounts won't work if hostid_enable="NO" is set in /etc/rc.conf because the host uuid is used to uniquely identify the client to the server. This is a content change. Modified: stable/9/usr.sbin/nfsd/nfsv4.4 Directory Properties: stable/9/usr.sbin/nfsd/ (props changed) Modified: stable/9/usr.sbin/nfsd/nfsv4.4 ============================================================================== --- stable/9/usr.sbin/nfsd/nfsv4.4 Thu Jul 4 01:18:38 2013 (r252675) +++ stable/9/usr.sbin/nfsd/nfsv4.4 Thu Jul 4 01:22:52 2013 (r252676) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 1, 2013 +.Dd July 1, 2013 .Dt NFSV4 4 .Os .Sh NAME @@ -235,6 +235,20 @@ plus set ``tcp'' and The .Xr nfsuserd 8 must be running, as above. +Also, since an +.Nm +mount uses the host uuid to identify the client uniquely to the server, +you cannot safely do an +.Nm +mount when +.sp +.Bd -literal -offset indent -compact +hostid_enable="NO" +.Ed +.sp +is set in +.Xr rc.conf 5 . +.sp If the .Nm server that is being mounted on supports delegations, you can start the From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 01:40:33 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 12A8B683; Thu, 4 Jul 2013 01:40:33 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 04D9D12A6; Thu, 4 Jul 2013 01:40:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r641eWY1002555; Thu, 4 Jul 2013 01:40:32 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r641eW1C002554; Thu, 4 Jul 2013 01:40:32 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201307040140.r641eW1C002554@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Thu, 4 Jul 2013 01:40: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: r252677 - stable/9/sys/fs/ext2fs 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.14 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, 04 Jul 2013 01:40:33 -0000 Author: pfg Date: Thu Jul 4 01:40:32 2013 New Revision: 252677 URL: http://svnweb.freebsd.org/changeset/base/252677 Log: MFC r252364: Bring some updates from ufs/ufs_lookup to ext2fs. Don't set IN_CHANGE and IN_UPDATE on inodes for potentially suspended file systems. Only set i_offset in the parent directory's i-node during a lookup for non-LOOKUP operations. Relax a VOP assertion for a DELETE lookup. Move the code from ufs_lookup.c used to do dotdot lookup, into the helper function. It is supposed to be useful for any filesystem that has to unlock dvp to walk to the ".." entry in lookup routine. Modified: stable/9/sys/fs/ext2fs/ext2_lookup.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/ext2fs/ext2_lookup.c ============================================================================== --- stable/9/sys/fs/ext2fs/ext2_lookup.c Thu Jul 4 01:22:52 2013 (r252676) +++ stable/9/sys/fs/ext2fs/ext2_lookup.c Thu Jul 4 01:40:32 2013 (r252677) @@ -289,9 +289,9 @@ ext2_lookup_ino(struct vnode *vdp, struc int entryoffsetinblock; /* offset of ep in bp's buffer */ enum {NONE, COMPACT, FOUND} slotstatus; doff_t slotoffset; /* offset of area with free space */ - int slotsize; /* size of area at slotoffset */ doff_t i_diroff; /* cached i_diroff value */ doff_t i_offset; /* cached i_offset value */ + int slotsize; /* size of area at slotoffset */ int slotfreespace; /* amount of space free in slot */ int slotneeded; /* size of the entry we're seeking */ int numdirpasses; /* strategy for directory search */ @@ -476,7 +476,6 @@ searchloop: endsearch = i_diroff; goto searchloop; } - dp->i_offset = i_offset; if (bp != NULL) brelse(bp); /* @@ -512,7 +511,6 @@ searchloop: enduseful = slotoffset + slotsize; } dp->i_endoff = roundup2(enduseful, DIRBLKSIZ); - dp->i_flag |= IN_CHANGE | IN_UPDATE; /* * We return with the directory locked, so that * the parameters we set up above will still be @@ -560,12 +558,13 @@ found: */ if ((flags & ISLASTCN) && nameiop == LOOKUP) dp->i_diroff = i_offset &~ (DIRBLKSIZ - 1); - dp->i_offset = i_offset; /* * If deleting, and at end of pathname, return * parameters which can be used to remove file. */ if (nameiop == DELETE && (flags & ISLASTCN)) { + if (flags & LOCKPARENT) + ASSERT_VOP_ELOCKED(vdp, __FUNCTION__); /* * Write access to directory required to delete files. */ @@ -576,7 +575,13 @@ found: * and distance past previous entry (if there * is a previous entry in this block) in dp->i_count. * Save directory inode pointer in ndp->ni_dvp for dirremove(). + * + * Technically we shouldn't be setting these in the + * WANTPARENT case (first lookup in rename()), but any + * lookups that will result in directory changes will + * overwrite these. */ + dp->i_offset = i_offset; if ((dp->i_offset & (DIRBLKSIZ - 1)) == 0) dp->i_count = 0; else @@ -621,6 +626,7 @@ found: * Careful about locking second inode. * This can only occur if the target is ".". */ + dp->i_offset = i_offset; if (dp->i_number == ino) return (EISDIR); if (dd_ino != NULL) @@ -656,10 +662,7 @@ found: */ pdp = vdp; if (flags & ISDOTDOT) { - ltype = VOP_ISLOCKED(pdp); - VOP_UNLOCK(pdp, 0); /* race to get the inode */ - error = VFS_VGET(vdp->v_mount, ino, cnp->cn_lkflags, &tdp); - vn_lock(pdp, ltype | LK_RETRY); + error = vn_vget_ino(pdp, ino, cnp->cn_lkflags, &tdp); if (pdp->v_iflag & VI_DOOMED) { if (error == 0) vput(tdp); From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 08:57:16 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 66DABB1C; Thu, 4 Jul 2013 08:57:16 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 497AD184C; Thu, 4 Jul 2013 08:57:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r648vGlY029570; Thu, 4 Jul 2013 08:57:16 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r648vEAX029556; Thu, 4 Jul 2013 08:57:14 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201307040857.r648vEAX029556@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 4 Jul 2013 08:57:14 +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: r252692 - in stable/9/sys: netinet netinet6 netipsec 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.14 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, 04 Jul 2013 08:57:16 -0000 Author: ae Date: Thu Jul 4 08:57:13 2013 New Revision: 252692 URL: http://svnweb.freebsd.org/changeset/base/252692 Log: MFC r252026: Use IPSECSTAT_INC() and IPSEC6STAT_INC() macros for ipsec statistics accounting. Modified: stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/udp_usrreq.c stable/9/sys/netinet6/ip6_forward.c stable/9/sys/netinet6/raw_ip6.c stable/9/sys/netinet6/udp6_usrreq.c stable/9/sys/netipsec/ipsec.c stable/9/sys/netipsec/ipsec.h stable/9/sys/netipsec/ipsec6.h stable/9/sys/netipsec/ipsec_mbuf.c stable/9/sys/netipsec/ipsec_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netinet/tcp_input.c Thu Jul 4 08:57:13 2013 (r252692) @@ -920,12 +920,12 @@ findpcb: #ifdef IPSEC #ifdef INET6 if (isipv6 && ipsec6_in_reject(m, inp)) { - V_ipsec6stat.in_polvio++; + IPSEC6STAT_INC(in_polvio); goto dropunlock; } else #endif /* INET6 */ if (ipsec4_in_reject(m, inp) != 0) { - V_ipsec4stat.in_polvio++; + IPSECSTAT_INC(in_polvio); goto dropunlock; } #endif /* IPSEC */ Modified: stable/9/sys/netinet/udp_usrreq.c ============================================================================== --- stable/9/sys/netinet/udp_usrreq.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netinet/udp_usrreq.c Thu Jul 4 08:57:13 2013 (r252692) @@ -278,7 +278,7 @@ udp_append(struct inpcb *inp, struct ip /* Check AH/ESP integrity. */ if (ipsec4_in_reject(n, inp)) { m_freem(n); - V_ipsec4stat.in_polvio++; + IPSECSTAT_INC(in_polvio); return; } #ifdef IPSEC_NAT_T @@ -1291,7 +1291,7 @@ udp4_espdecap(struct inpcb *inp, struct if (minlen > m->m_pkthdr.len) minlen = m->m_pkthdr.len; if ((m = m_pullup(m, minlen)) == NULL) { - V_ipsec4stat.in_inval++; + IPSECSTAT_INC(in_inval); return (NULL); /* Bypass caller processing. */ } data = mtod(m, caddr_t); /* Points to ip header. */ @@ -1331,7 +1331,7 @@ udp4_espdecap(struct inpcb *inp, struct uint32_t spi; if (payload <= sizeof(struct esp)) { - V_ipsec4stat.in_inval++; + IPSECSTAT_INC(in_inval); m_freem(m); return (NULL); /* Discard. */ } @@ -1352,7 +1352,7 @@ udp4_espdecap(struct inpcb *inp, struct tag = m_tag_get(PACKET_TAG_IPSEC_NAT_T_PORTS, 2 * sizeof(uint16_t), M_NOWAIT); if (tag == NULL) { - V_ipsec4stat.in_nomem++; + IPSECSTAT_INC(in_nomem); m_freem(m); return (NULL); /* Discard. */ } Modified: stable/9/sys/netinet6/ip6_forward.c ============================================================================== --- stable/9/sys/netinet6/ip6_forward.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netinet6/ip6_forward.c Thu Jul 4 08:57:13 2013 (r252692) @@ -120,7 +120,7 @@ ip6_forward(struct mbuf *m, int srcrt) * before forwarding packet actually. */ if (ipsec6_in_reject(m, NULL)) { - V_ipsec6stat.in_polvio++; + IPSEC6STAT_INC(in_polvio); m_freem(m); return; } @@ -182,7 +182,7 @@ ip6_forward(struct mbuf *m, int srcrt) sp = ipsec_getpolicybyaddr(m, IPSEC_DIR_OUTBOUND, IP_FORWARDING, &error); if (sp == NULL) { - V_ipsec6stat.out_inval++; + IPSEC6STAT_INC(out_inval); IP6STAT_INC(ip6s_cantforward); if (mcopy) { #if 0 @@ -203,7 +203,7 @@ ip6_forward(struct mbuf *m, int srcrt) /* * This packet is just discarded. */ - V_ipsec6stat.out_polvio++; + IPSEC6STAT_INC(out_polvio); IP6STAT_INC(ip6s_cantforward); KEY_FREESP(&sp); if (mcopy) { Modified: stable/9/sys/netinet6/raw_ip6.c ============================================================================== --- stable/9/sys/netinet6/raw_ip6.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netinet6/raw_ip6.c Thu Jul 4 08:57:13 2013 (r252692) @@ -263,7 +263,7 @@ rip6_input(struct mbuf **mp, int *offp, */ if (n && ipsec6_in_reject(n, last)) { m_freem(n); - V_ipsec6stat.in_polvio++; + IPSEC6STAT_INC(in_polvio); /* Do not inject data into pcb. */ } else #endif /* IPSEC */ @@ -295,7 +295,7 @@ rip6_input(struct mbuf **mp, int *offp, */ if ((last != NULL) && ipsec6_in_reject(m, last)) { m_freem(m); - V_ipsec6stat.in_polvio++; + IPSEC6STAT_INC(in_polvio); IP6STAT_DEC(ip6s_delivered); /* Do not inject data into pcb. */ INP_RUNLOCK(last); Modified: stable/9/sys/netinet6/udp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/udp6_usrreq.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netinet6/udp6_usrreq.c Thu Jul 4 08:57:13 2013 (r252692) @@ -141,7 +141,7 @@ udp6_append(struct inpcb *inp, struct mb /* Check AH/ESP integrity. */ if (ipsec6_in_reject(n, inp)) { m_freem(n); - V_ipsec6stat.in_polvio++; + IPSEC6STAT_INC(in_polvio); return; } #endif /* IPSEC */ Modified: stable/9/sys/netipsec/ipsec.c ============================================================================== --- stable/9/sys/netipsec/ipsec.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netipsec/ipsec.c Thu Jul 4 08:57:13 2013 (r252692) @@ -454,7 +454,7 @@ ipsec4_checkpolicy(struct mbuf *m, u_int sp = ipsec_getpolicybysock(m, dir, inp, error); if (sp == NULL) { IPSEC_ASSERT(*error != 0, ("getpolicy failed w/o error")); - V_ipsec4stat.ips_out_inval++; + IPSECSTAT_INC(ips_out_inval); return (NULL); } IPSEC_ASSERT(*error == 0, ("sp w/ error set to %u", *error)); @@ -464,7 +464,7 @@ ipsec4_checkpolicy(struct mbuf *m, u_int printf("%s: invalid policy %u\n", __func__, sp->policy); /* FALLTHROUGH */ case IPSEC_POLICY_DISCARD: - V_ipsec4stat.ips_out_polvio++; + IPSECSTAT_INC(ips_out_polvio); *error = -EINVAL; /* Packet is discarded by caller. */ break; case IPSEC_POLICY_BYPASS: @@ -1315,7 +1315,7 @@ ipsec4_in_reject(struct mbuf *m, struct result = ipsec46_in_reject(m, inp); if (result) - V_ipsec4stat.ips_in_polvio++; + IPSECSTAT_INC(ips_in_polvio); return (result); } @@ -1333,7 +1333,7 @@ ipsec6_in_reject(struct mbuf *m, struct result = ipsec46_in_reject(m, inp); if (result) - V_ipsec6stat.ips_in_polvio++; + IPSEC6STAT_INC(ips_in_polvio); return (result); } Modified: stable/9/sys/netipsec/ipsec.h ============================================================================== --- stable/9/sys/netipsec/ipsec.h Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netipsec/ipsec.h Thu Jul 4 08:57:13 2013 (r252692) @@ -359,6 +359,7 @@ VNET_DECLARE(int, ip4_ipsec_ecn); VNET_DECLARE(int, ip4_esp_randpad); VNET_DECLARE(int, crypto_support); +#define IPSECSTAT_INC(name) V_ipsec4stat.name += 1 #define V_ipsec4stat VNET(ipsec4stat) #define V_ip4_def_policy VNET(ip4_def_policy) #define V_ip4_esp_trans_deflev VNET(ip4_esp_trans_deflev) Modified: stable/9/sys/netipsec/ipsec6.h ============================================================================== --- stable/9/sys/netipsec/ipsec6.h Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netipsec/ipsec6.h Thu Jul 4 08:57:13 2013 (r252692) @@ -48,6 +48,7 @@ VNET_DECLARE(int, ip6_ah_trans_deflev); VNET_DECLARE(int, ip6_ah_net_deflev); VNET_DECLARE(int, ip6_ipsec_ecn); +#define IPSEC6STAT_INC(name) V_ipsec6stat.name += 1 #define V_ipsec6stat VNET(ipsec6stat) #define V_ip6_esp_trans_deflev VNET(ip6_esp_trans_deflev) #define V_ip6_esp_net_deflev VNET(ip6_esp_net_deflev) Modified: stable/9/sys/netipsec/ipsec_mbuf.c ============================================================================== --- stable/9/sys/netipsec/ipsec_mbuf.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netipsec/ipsec_mbuf.c Thu Jul 4 08:57:13 2013 (r252692) @@ -135,7 +135,7 @@ m_makespace(struct mbuf *m0, int skip, i m = n; /* header is at front ... */ *off = 0; /* ... of new mbuf */ } - V_ipsec4stat.ips_mbinserted++; + IPSECSTAT_INC(ips_mbinserted); } else { /* * Copy the remainder to the back of the mbuf @@ -241,7 +241,7 @@ m_striphdr(struct mbuf *m, int skip, int /* Remove the header and associated data from the mbuf. */ if (roff == 0) { /* The header was at the beginning of the mbuf */ - V_ipsec4stat.ips_input_front++; + IPSECSTAT_INC(ips_input_front); m_adj(m1, hlen); if ((m1->m_flags & M_PKTHDR) == 0) m->m_pkthdr.len -= hlen; @@ -253,7 +253,7 @@ m_striphdr(struct mbuf *m, int skip, int * so first let's remove the remainder of the header from * the beginning of the remainder of the mbuf chain, if any. */ - V_ipsec4stat.ips_input_end++; + IPSECSTAT_INC(ips_input_end); if (roff + hlen > m1->m_len) { /* Adjust the next mbuf by the remainder */ m_adj(m1->m_next, roff + hlen - m1->m_len); @@ -278,7 +278,7 @@ m_striphdr(struct mbuf *m, int skip, int * The header lies in the "middle" of the mbuf; copy * the remainder of the mbuf down over the header. */ - V_ipsec4stat.ips_input_middle++; + IPSECSTAT_INC(ips_input_middle); bcopy(mtod(m1, u_char *) + roff + hlen, mtod(m1, u_char *) + roff, m1->m_len - (roff + hlen)); Modified: stable/9/sys/netipsec/ipsec_output.c ============================================================================== --- stable/9/sys/netipsec/ipsec_output.c Thu Jul 4 08:42:20 2013 (r252691) +++ stable/9/sys/netipsec/ipsec_output.c Thu Jul 4 08:57:13 2013 (r252692) @@ -164,7 +164,7 @@ ipsec_process_done(struct mbuf *m, struc * doing further processing. */ if (isr->next) { - V_ipsec4stat.ips_out_bundlesa++; + IPSECSTAT_INC(ips_out_bundlesa); /* XXX-BZ currently only support same AF bundles. */ switch (saidx->dst.sa.sa_family) { #ifdef INET @@ -362,7 +362,7 @@ again: * this packet because it is responsibility for * upper layer to retransmit the packet. */ - V_ipsec4stat.ips_out_nosa++; + IPSECSTAT_INC(ips_out_nosa); goto bad; } sav = isr->sav; @@ -833,14 +833,14 @@ ipsec6_output_tunnel(struct ipsec_output ipseclog((LOG_ERR, "%s: family mismatched between " "inner and outer, spi=%u\n", __func__, ntohl(isr->sav->spi))); - V_ipsec6stat.ips_out_inval++; + IPSEC6STAT_INC(ips_out_inval); error = EAFNOSUPPORT; goto bad; } m = ipsec6_splithdr(m); if (!m) { - V_ipsec6stat.ips_out_nomem++; + IPSEC6STAT_INC(ips_out_nomem); error = ENOMEM; goto bad; } @@ -870,7 +870,7 @@ ipsec6_output_tunnel(struct ipsec_output } if (state->ro->ro_rt == NULL) { IP6STAT_INC(ip6s_noroute); - V_ipsec6stat.ips_out_noroute++; + IPSEC6STAT_INC(ips_out_noroute); error = EHOSTUNREACH; goto bad; } @@ -882,7 +882,7 @@ ipsec6_output_tunnel(struct ipsec_output m = ipsec6_splithdr(m); if (!m) { - V_ipsec6stat.ips_out_nomem++; + IPSEC6STAT_INC(ips_out_nomem); error = ENOMEM; goto bad; } From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 08:59:37 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 33CE8E05; Thu, 4 Jul 2013 08:59:37 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 25839186B; Thu, 4 Jul 2013 08:59:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r648xbXi029930; Thu, 4 Jul 2013 08:59:37 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r648xYoG029912; Thu, 4 Jul 2013 08:59:34 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201307040859.r648xYoG029912@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 4 Jul 2013 08:59:34 +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: r252693 - stable/9/sys/netipsec 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.14 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, 04 Jul 2013 08:59:37 -0000 Author: ae Date: Thu Jul 4 08:59:34 2013 New Revision: 252693 URL: http://svnweb.freebsd.org/changeset/base/252693 Log: MFC r252028: Use corresponding macros to update statistics for AH, ESP, IPIP, IPCOMP, PFKEY. Modified: stable/9/sys/netipsec/ah_var.h stable/9/sys/netipsec/esp_var.h stable/9/sys/netipsec/ipcomp_var.h stable/9/sys/netipsec/ipip_var.h stable/9/sys/netipsec/ipsec_input.c stable/9/sys/netipsec/ipsec_output.c stable/9/sys/netipsec/key.c stable/9/sys/netipsec/keysock.c stable/9/sys/netipsec/keysock.h stable/9/sys/netipsec/xform_ah.c stable/9/sys/netipsec/xform_esp.c stable/9/sys/netipsec/xform_ipcomp.c stable/9/sys/netipsec/xform_ipip.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netipsec/ah_var.h ============================================================================== --- stable/9/sys/netipsec/ah_var.h Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/ah_var.h Thu Jul 4 08:59:34 2013 (r252693) @@ -75,6 +75,8 @@ VNET_DECLARE(int, ah_enable); VNET_DECLARE(int, ah_cleartos); VNET_DECLARE(struct ahstat, ahstat); +#define AHSTAT_ADD(name, val) V_ahstat.name += (val) +#define AHSTAT_INC(name) AHSTAT_ADD(name, 1) #define V_ah_enable VNET(ah_enable) #define V_ah_cleartos VNET(ah_cleartos) #define V_ahstat VNET(ahstat) Modified: stable/9/sys/netipsec/esp_var.h ============================================================================== --- stable/9/sys/netipsec/esp_var.h Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/esp_var.h Thu Jul 4 08:59:34 2013 (r252693) @@ -75,6 +75,8 @@ struct espstat { VNET_DECLARE(int, esp_enable); VNET_DECLARE(struct espstat, espstat); +#define ESPSTAT_ADD(name, val) V_espstat.name += (val) +#define ESPSTAT_INC(name) ESPSTAT_ADD(name, 1) #define V_esp_enable VNET(esp_enable) #define V_espstat VNET(espstat) #endif /* _KERNEL */ Modified: stable/9/sys/netipsec/ipcomp_var.h ============================================================================== --- stable/9/sys/netipsec/ipcomp_var.h Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/ipcomp_var.h Thu Jul 4 08:59:34 2013 (r252693) @@ -68,6 +68,8 @@ struct ipcompstat { VNET_DECLARE(int, ipcomp_enable); VNET_DECLARE(struct ipcompstat, ipcompstat); +#define IPCOMPSTAT_ADD(name, val) V_ipcompstat.name += (val) +#define IPCOMPSTAT_INC(name) IPCOMPSTAT_ADD(name, 1) #define V_ipcomp_enable VNET(ipcomp_enable) #define V_ipcompstat VNET(ipcompstat) #endif /* _KERNEL */ Modified: stable/9/sys/netipsec/ipip_var.h ============================================================================== --- stable/9/sys/netipsec/ipip_var.h Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/ipip_var.h Thu Jul 4 08:59:34 2013 (r252693) @@ -62,6 +62,8 @@ struct ipipstat VNET_DECLARE(int, ipip_allow); VNET_DECLARE(struct ipipstat, ipipstat); +#define IPIPSTAT_ADD(name, val) V_ipipstat.name += (val) +#define IPIPSTAT_INC(name) IPIPSTAT_ADD(name, 1) #define V_ipip_allow VNET(ipip_allow) #define V_ipipstat VNET(ipipstat) #endif /* _KERNEL */ Modified: stable/9/sys/netipsec/ipsec_input.c ============================================================================== --- stable/9/sys/netipsec/ipsec_input.c Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/ipsec_input.c Thu Jul 4 08:59:34 2013 (r252693) @@ -99,8 +99,14 @@ #endif -#define IPSEC_ISTAT(p,x,y,z) ((p) == IPPROTO_ESP ? (x)++ : \ - (p) == IPPROTO_AH ? (y)++ : (z)++) +#define IPSEC_ISTAT(proto, name) do { \ + if ((proto) == IPPROTO_ESP) \ + ESPSTAT_INC(esps_##name); \ + else if ((proto) == IPPROTO_AH) \ + AHSTAT_INC(ahs_##name); \ + else \ + IPCOMPSTAT_INC(ipcomps_##name); \ +} while (0) #ifdef INET static void ipsec4_common_ctlinput(int, struct sockaddr *, void *, int); @@ -125,8 +131,7 @@ ipsec_common_input(struct mbuf *m, int s #endif #endif - IPSEC_ISTAT(sproto, V_espstat.esps_input, V_ahstat.ahs_input, - V_ipcompstat.ipcomps_input); + IPSEC_ISTAT(sproto, input); IPSEC_ASSERT(m != NULL, ("null packet")); @@ -138,15 +143,13 @@ ipsec_common_input(struct mbuf *m, int s (sproto == IPPROTO_AH && !V_ah_enable) || (sproto == IPPROTO_IPCOMP && !V_ipcomp_enable)) { m_freem(m); - IPSEC_ISTAT(sproto, V_espstat.esps_pdrops, V_ahstat.ahs_pdrops, - V_ipcompstat.ipcomps_pdrops); + IPSEC_ISTAT(sproto, pdrops); return EOPNOTSUPP; } if (m->m_pkthdr.len - skip < 2 * sizeof (u_int32_t)) { m_freem(m); - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); DPRINTF(("%s: packet too small\n", __func__)); return EINVAL; } @@ -197,8 +200,7 @@ ipsec_common_input(struct mbuf *m, int s default: DPRINTF(("%s: unsupported protocol family %u\n", __func__, af)); m_freem(m); - IPSEC_ISTAT(sproto, V_espstat.esps_nopf, V_ahstat.ahs_nopf, - V_ipcompstat.ipcomps_nopf); + IPSEC_ISTAT(sproto, nopf); return EPFNOSUPPORT; } @@ -208,8 +210,7 @@ ipsec_common_input(struct mbuf *m, int s DPRINTF(("%s: no key association found for SA %s/%08lx/%u\n", __func__, ipsec_address(&dst_address), (u_long) ntohl(spi), sproto)); - IPSEC_ISTAT(sproto, V_espstat.esps_notdb, V_ahstat.ahs_notdb, - V_ipcompstat.ipcomps_notdb); + IPSEC_ISTAT(sproto, notdb); m_freem(m); return ENOENT; } @@ -218,8 +219,7 @@ ipsec_common_input(struct mbuf *m, int s DPRINTF(("%s: attempted to use uninitialized SA %s/%08lx/%u\n", __func__, ipsec_address(&dst_address), (u_long) ntohl(spi), sproto)); - IPSEC_ISTAT(sproto, V_espstat.esps_noxform, V_ahstat.ahs_noxform, - V_ipcompstat.ipcomps_noxform); + IPSEC_ISTAT(sproto, noxform); KEY_FREESAV(&sav); m_freem(m); return ENXIO; @@ -321,8 +321,7 @@ ipsec4_common_input_cb(struct mbuf *m, s /* Sanity check */ if (m == NULL) { DPRINTF(("%s: null mbuf", __func__)); - IPSEC_ISTAT(sproto, V_espstat.esps_badkcr, V_ahstat.ahs_badkcr, - V_ipcompstat.ipcomps_badkcr); + IPSEC_ISTAT(sproto, badkcr); KEY_FREESAV(&sav); return EINVAL; } @@ -333,8 +332,7 @@ ipsec4_common_input_cb(struct mbuf *m, s DPRINTF(("%s: processing failed for SA %s/%08lx\n", __func__, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = ENOBUFS; goto bad; } @@ -355,9 +353,7 @@ ipsec4_common_input_cb(struct mbuf *m, s struct ip ipn; if (m->m_pkthdr.len - skip < sizeof(struct ip)) { - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, - V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } @@ -386,9 +382,7 @@ ipsec4_common_input_cb(struct mbuf *m, s ipsp_address(saidx->dst), (u_long) ntohl(sav->spi))); - IPSEC_ISTAT(sproto, V_espstat.esps_pdrops, - V_ahstat.ahs_pdrops, - V_ipcompstat.ipcomps_pdrops); + IPSEC_ISTAT(sproto, pdrops); error = EACCES; goto bad; } @@ -399,9 +393,7 @@ ipsec4_common_input_cb(struct mbuf *m, s struct ip6_hdr ip6n; if (m->m_pkthdr.len - skip < sizeof(struct ip6_hdr)) { - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, - V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } @@ -428,9 +420,7 @@ ipsec4_common_input_cb(struct mbuf *m, s ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); - IPSEC_ISTAT(sproto, V_espstat.esps_pdrops, - V_ahstat.ahs_pdrops, - V_ipcompstat.ipcomps_pdrops); + IPSEC_ISTAT(sproto, pdrops); error = EACCES; goto bad; } @@ -451,8 +441,7 @@ ipsec4_common_input_cb(struct mbuf *m, s sizeof(struct tdb_ident), M_NOWAIT); if (mtag == NULL) { DPRINTF(("%s: failed to get tag\n", __func__)); - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, - V_ahstat.ahs_hdrops, V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = ENOMEM; goto bad; } @@ -494,9 +483,7 @@ ipsec4_common_input_cb(struct mbuf *m, s * Re-dispatch via software interrupt. */ if ((error = netisr_queue_src(NETISR_IP, (uintptr_t)sav->spi, m))) { - IPSEC_ISTAT(sproto, V_espstat.esps_qfull, V_ahstat.ahs_qfull, - V_ipcompstat.ipcomps_qfull); - + IPSEC_ISTAT(sproto, qfull); DPRINTF(("%s: queue full; proto %u packet dropped\n", __func__, sproto)); return error; @@ -548,9 +535,7 @@ ipsec6_common_input(struct mbuf **mp, in if (protoff + l != *offp) { DPRINTF(("%s: bad packet header chain, protoff %u, " "l %u, off %u\n", __func__, protoff, l, *offp)); - IPSEC_ISTAT(proto, V_espstat.esps_hdrops, - V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(proto, hdrops); m_freem(*mp); *mp = NULL; return IPPROTO_DONE; @@ -595,8 +580,7 @@ ipsec6_common_input_cb(struct mbuf *m, s /* Sanity check */ if (m == NULL) { DPRINTF(("%s: null mbuf", __func__)); - IPSEC_ISTAT(sproto, V_espstat.esps_badkcr, V_ahstat.ahs_badkcr, - V_ipcompstat.ipcomps_badkcr); + IPSEC_ISTAT(sproto, badkcr); error = EINVAL; goto bad; } @@ -609,8 +593,7 @@ ipsec6_common_input_cb(struct mbuf *m, s __func__, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = EACCES; goto bad; } @@ -628,9 +611,7 @@ ipsec6_common_input_cb(struct mbuf *m, s struct ip ipn; if (m->m_pkthdr.len - skip < sizeof(struct ip)) { - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, - V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } @@ -655,8 +636,7 @@ ipsec6_common_input_cb(struct mbuf *m, s ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); - IPSEC_ISTATsproto, (V_espstat.esps_pdrops, - V_ahstat.ahs_pdrops, V_ipcompstat.ipcomps_pdrops); + IPSEC_ISTAT(sproto, pdrops); error = EACCES; goto bad; } @@ -668,9 +648,7 @@ ipsec6_common_input_cb(struct mbuf *m, s struct ip6_hdr ip6n; if (m->m_pkthdr.len - skip < sizeof(struct ip6_hdr)) { - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, - V_ahstat.ahs_hdrops, - V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = EINVAL; goto bad; } @@ -697,8 +675,7 @@ ipsec6_common_input_cb(struct mbuf *m, s ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); - IPSEC_ISTAT(sproto, V_espstat.esps_pdrops, - V_ahstat.ahs_pdrops, V_ipcompstat.ipcomps_pdrops); + IPSEC_ISTAT(sproto, pdrops); error = EACCES; goto bad; } @@ -718,8 +695,7 @@ ipsec6_common_input_cb(struct mbuf *m, s sizeof(struct tdb_ident), M_NOWAIT); if (mtag == NULL) { DPRINTF(("%s: failed to get tag\n", __func__)); - IPSEC_ISTAT(sproto, V_espstat.esps_hdrops, - V_ahstat.ahs_hdrops, V_ipcompstat.ipcomps_hdrops); + IPSEC_ISTAT(sproto, hdrops); error = ENOMEM; goto bad; } Modified: stable/9/sys/netipsec/ipsec_output.c ============================================================================== --- stable/9/sys/netipsec/ipsec_output.c Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/ipsec_output.c Thu Jul 4 08:59:34 2013 (r252693) @@ -282,8 +282,14 @@ ipsec_nextisr( int *error ) { -#define IPSEC_OSTAT(x,y,z) (isr->saidx.proto == IPPROTO_ESP ? (x)++ : \ - isr->saidx.proto == IPPROTO_AH ? (y)++ : (z)++) +#define IPSEC_OSTAT(name) do { \ + if (isr->saidx.proto == IPPROTO_ESP) \ + ESPSTAT_INC(esps_##name); \ + else if (isr->saidx.proto == IPPROTO_AH)\ + AHSTAT_INC(ahs_##name); \ + else \ + IPCOMPSTAT_INC(ipcomps_##name); \ +} while (0) struct secasvar *sav; IPSECREQUEST_LOCK_ASSERT(isr); @@ -391,8 +397,7 @@ again: (isr->saidx.proto == IPPROTO_IPCOMP && !V_ipcomp_enable)) { DPRINTF(("%s: IPsec outbound packet dropped due" " to policy (check your sysctls)\n", __func__)); - IPSEC_OSTAT(V_espstat.esps_pdrops, V_ahstat.ahs_pdrops, - V_ipcompstat.ipcomps_pdrops); + IPSEC_OSTAT(pdrops); *error = EHOSTUNREACH; goto bad; } @@ -403,8 +408,7 @@ again: */ if (sav->tdb_xform == NULL) { DPRINTF(("%s: no transform for SA\n", __func__)); - IPSEC_OSTAT(V_espstat.esps_noxform, V_ahstat.ahs_noxform, - V_ipcompstat.ipcomps_noxform); + IPSEC_OSTAT(noxform); *error = EHOSTUNREACH; goto bad; } Modified: stable/9/sys/netipsec/key.c ============================================================================== --- stable/9/sys/netipsec/key.c Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/key.c Thu Jul 4 08:59:34 2013 (r252693) @@ -7340,7 +7340,7 @@ key_parse(m, so) if ((m->m_flags & M_PKTHDR) == 0 || m->m_pkthdr.len != m->m_pkthdr.len) { ipseclog((LOG_DEBUG, "%s: invalid message length.\n",__func__)); - V_pfkeystat.out_invlen++; + PFKEYSTAT_INC(out_invlen); error = EINVAL; goto senderror; } @@ -7348,7 +7348,7 @@ key_parse(m, so) if (msg->sadb_msg_version != PF_KEY_V2) { ipseclog((LOG_DEBUG, "%s: PF_KEY version %u is mismatched.\n", __func__, msg->sadb_msg_version)); - V_pfkeystat.out_invver++; + PFKEYSTAT_INC(out_invver); error = EINVAL; goto senderror; } @@ -7356,7 +7356,7 @@ key_parse(m, so) if (msg->sadb_msg_type > SADB_MAX) { ipseclog((LOG_DEBUG, "%s: invalid type %u is passed.\n", __func__, msg->sadb_msg_type)); - V_pfkeystat.out_invmsgtype++; + PFKEYSTAT_INC(out_invmsgtype); error = EINVAL; goto senderror; } @@ -7409,7 +7409,7 @@ key_parse(m, so) ipseclog((LOG_DEBUG, "%s: must specify satype " "when msg type=%u.\n", __func__, msg->sadb_msg_type)); - V_pfkeystat.out_invsatype++; + PFKEYSTAT_INC(out_invsatype); error = EINVAL; goto senderror; } @@ -7429,7 +7429,7 @@ key_parse(m, so) case SADB_X_SPDDELETE2: ipseclog((LOG_DEBUG, "%s: illegal satype=%u\n", __func__, msg->sadb_msg_type)); - V_pfkeystat.out_invsatype++; + PFKEYSTAT_INC(out_invsatype); error = EINVAL; goto senderror; } @@ -7440,7 +7440,7 @@ key_parse(m, so) case SADB_SATYPE_MIP: ipseclog((LOG_DEBUG, "%s: type %u isn't supported.\n", __func__, msg->sadb_msg_satype)); - V_pfkeystat.out_invsatype++; + PFKEYSTAT_INC(out_invsatype); error = EOPNOTSUPP; goto senderror; case 1: /* XXX: What does it do? */ @@ -7450,7 +7450,7 @@ key_parse(m, so) default: ipseclog((LOG_DEBUG, "%s: invalid type %u is passed.\n", __func__, msg->sadb_msg_satype)); - V_pfkeystat.out_invsatype++; + PFKEYSTAT_INC(out_invsatype); error = EINVAL; goto senderror; } @@ -7468,7 +7468,7 @@ key_parse(m, so) if (src0->sadb_address_proto != dst0->sadb_address_proto) { ipseclog((LOG_DEBUG, "%s: upper layer protocol " "mismatched.\n", __func__)); - V_pfkeystat.out_invaddr++; + PFKEYSTAT_INC(out_invaddr); error = EINVAL; goto senderror; } @@ -7478,7 +7478,7 @@ key_parse(m, so) PFKEY_ADDR_SADDR(dst0)->sa_family) { ipseclog((LOG_DEBUG, "%s: address family mismatched.\n", __func__)); - V_pfkeystat.out_invaddr++; + PFKEYSTAT_INC(out_invaddr); error = EINVAL; goto senderror; } @@ -7486,7 +7486,7 @@ key_parse(m, so) PFKEY_ADDR_SADDR(dst0)->sa_len) { ipseclog((LOG_DEBUG, "%s: address struct size " "mismatched.\n", __func__)); - V_pfkeystat.out_invaddr++; + PFKEYSTAT_INC(out_invaddr); error = EINVAL; goto senderror; } @@ -7495,7 +7495,7 @@ key_parse(m, so) case AF_INET: if (PFKEY_ADDR_SADDR(src0)->sa_len != sizeof(struct sockaddr_in)) { - V_pfkeystat.out_invaddr++; + PFKEYSTAT_INC(out_invaddr); error = EINVAL; goto senderror; } @@ -7503,7 +7503,7 @@ key_parse(m, so) case AF_INET6: if (PFKEY_ADDR_SADDR(src0)->sa_len != sizeof(struct sockaddr_in6)) { - V_pfkeystat.out_invaddr++; + PFKEYSTAT_INC(out_invaddr); error = EINVAL; goto senderror; } @@ -7511,7 +7511,7 @@ key_parse(m, so) default: ipseclog((LOG_DEBUG, "%s: unsupported address family\n", __func__)); - V_pfkeystat.out_invaddr++; + PFKEYSTAT_INC(out_invaddr); error = EAFNOSUPPORT; goto senderror; } @@ -7533,7 +7533,7 @@ key_parse(m, so) dst0->sadb_address_prefixlen > plen) { ipseclog((LOG_DEBUG, "%s: illegal prefixlen.\n", __func__)); - V_pfkeystat.out_invaddr++; + PFKEYSTAT_INC(out_invaddr); error = EINVAL; goto senderror; } @@ -7546,7 +7546,7 @@ key_parse(m, so) if (msg->sadb_msg_type >= sizeof(key_typesw)/sizeof(key_typesw[0]) || key_typesw[msg->sadb_msg_type] == NULL) { - V_pfkeystat.out_invmsgtype++; + PFKEYSTAT_INC(out_invmsgtype); error = EINVAL; goto senderror; } @@ -7648,7 +7648,7 @@ key_align(m, mhp) ipseclog((LOG_DEBUG, "%s: duplicate ext_type " "%u\n", __func__, ext->sadb_ext_type)); m_freem(m); - V_pfkeystat.out_dupext++; + PFKEYSTAT_INC(out_dupext); return EINVAL; } break; @@ -7656,7 +7656,7 @@ key_align(m, mhp) ipseclog((LOG_DEBUG, "%s: invalid ext_type %u\n", __func__, ext->sadb_ext_type)); m_freem(m); - V_pfkeystat.out_invexttype++; + PFKEYSTAT_INC(out_invexttype); return EINVAL; } @@ -7664,7 +7664,7 @@ key_align(m, mhp) if (key_validate_ext(ext, extlen)) { m_freem(m); - V_pfkeystat.out_invlen++; + PFKEYSTAT_INC(out_invlen); return EINVAL; } @@ -7682,7 +7682,7 @@ key_align(m, mhp) if (off != end) { m_freem(m); - V_pfkeystat.out_invlen++; + PFKEYSTAT_INC(out_invlen); return EINVAL; } Modified: stable/9/sys/netipsec/keysock.c ============================================================================== --- stable/9/sys/netipsec/keysock.c Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/keysock.c Thu Jul 4 08:59:34 2013 (r252693) @@ -91,19 +91,19 @@ key_output(struct mbuf *m, struct socket if (m == 0) panic("%s: NULL pointer was passed.\n", __func__); - V_pfkeystat.out_total++; - V_pfkeystat.out_bytes += m->m_pkthdr.len; + PFKEYSTAT_INC(out_total); + PFKEYSTAT_ADD(out_bytes, m->m_pkthdr.len); len = m->m_pkthdr.len; if (len < sizeof(struct sadb_msg)) { - V_pfkeystat.out_tooshort++; + PFKEYSTAT_INC(out_tooshort); error = EINVAL; goto end; } if (m->m_len < sizeof(struct sadb_msg)) { if ((m = m_pullup(m, sizeof(struct sadb_msg))) == 0) { - V_pfkeystat.out_nomem++; + PFKEYSTAT_INC(out_nomem); error = ENOBUFS; goto end; } @@ -114,9 +114,9 @@ key_output(struct mbuf *m, struct socket KEYDEBUG(KEYDEBUG_KEY_DUMP, kdebug_mbuf(m)); msg = mtod(m, struct sadb_msg *); - V_pfkeystat.out_msgtype[msg->sadb_msg_type]++; + PFKEYSTAT_INC(out_msgtype[msg->sadb_msg_type]); if (len != PFKEY_UNUNIT64(msg->sadb_msg_len)) { - V_pfkeystat.out_invlen++; + PFKEYSTAT_INC(out_invlen); error = EINVAL; goto end; } @@ -147,7 +147,7 @@ key_sendup0(rp, m, promisc) if (m && m->m_len < sizeof(struct sadb_msg)) m = m_pullup(m, sizeof(struct sadb_msg)); if (!m) { - V_pfkeystat.in_nomem++; + PFKEYSTAT_INC(in_nomem); m_freem(m); return ENOBUFS; } @@ -160,12 +160,12 @@ key_sendup0(rp, m, promisc) pmsg->sadb_msg_len = PFKEY_UNIT64(m->m_pkthdr.len); /* pid and seq? */ - V_pfkeystat.in_msgtype[pmsg->sadb_msg_type]++; + PFKEYSTAT_INC(in_msgtype[pmsg->sadb_msg_type]); } if (!sbappendaddr(&rp->rcb_socket->so_rcv, (struct sockaddr *)&key_src, m, NULL)) { - V_pfkeystat.in_nomem++; + PFKEYSTAT_INC(in_nomem); m_freem(m); error = ENOBUFS; } else @@ -197,9 +197,9 @@ key_sendup(so, msg, len, target) * we increment statistics here, just in case we have ENOBUFS * in this function. */ - V_pfkeystat.in_total++; - V_pfkeystat.in_bytes += len; - V_pfkeystat.in_msgtype[msg->sadb_msg_type]++; + PFKEYSTAT_INC(in_total); + PFKEYSTAT_ADD(in_bytes, len); + PFKEYSTAT_INC(in_msgtype[msg->sadb_msg_type]); /* * Get mbuf chain whenever possible (not clusters), @@ -216,14 +216,14 @@ key_sendup(so, msg, len, target) if (tlen == len) { MGETHDR(n, M_DONTWAIT, MT_DATA); if (n == NULL) { - V_pfkeystat.in_nomem++; + PFKEYSTAT_INC(in_nomem); return ENOBUFS; } n->m_len = MHLEN; } else { MGET(n, M_DONTWAIT, MT_DATA); if (n == NULL) { - V_pfkeystat.in_nomem++; + PFKEYSTAT_INC(in_nomem); return ENOBUFS; } n->m_len = MLEN; @@ -233,7 +233,7 @@ key_sendup(so, msg, len, target) if ((n->m_flags & M_EXT) == 0) { m_free(n); m_freem(m); - V_pfkeystat.in_nomem++; + PFKEYSTAT_INC(in_nomem); return ENOBUFS; } n->m_len = MCLBYTES; @@ -256,9 +256,9 @@ key_sendup(so, msg, len, target) m_copyback(m, 0, len, (caddr_t)msg); /* avoid duplicated statistics */ - V_pfkeystat.in_total--; - V_pfkeystat.in_bytes -= len; - V_pfkeystat.in_msgtype[msg->sadb_msg_type]--; + PFKEYSTAT_ADD(in_total, -1); + PFKEYSTAT_ADD(in_bytes, -len); + PFKEYSTAT_ADD(in_msgtype[msg->sadb_msg_type], -1); return key_sendup_mbuf(so, m, target); } @@ -281,19 +281,19 @@ key_sendup_mbuf(so, m, target) if (so == NULL && target == KEY_SENDUP_ONE) panic("%s: NULL pointer was passed.\n", __func__); - V_pfkeystat.in_total++; - V_pfkeystat.in_bytes += m->m_pkthdr.len; + PFKEYSTAT_INC(in_total); + PFKEYSTAT_ADD(in_bytes, m->m_pkthdr.len); if (m->m_len < sizeof(struct sadb_msg)) { m = m_pullup(m, sizeof(struct sadb_msg)); if (m == NULL) { - V_pfkeystat.in_nomem++; + PFKEYSTAT_INC(in_nomem); return ENOBUFS; } } if (m->m_len >= sizeof(struct sadb_msg)) { struct sadb_msg *msg; msg = mtod(m, struct sadb_msg *); - V_pfkeystat.in_msgtype[msg->sadb_msg_type]++; + PFKEYSTAT_INC(in_msgtype[msg->sadb_msg_type]); } mtx_lock(&rawcb_mtx); LIST_FOREACH(rp, &V_rawcb_list, list) @@ -338,14 +338,14 @@ key_sendup_mbuf(so, m, target) sendup++; break; } - V_pfkeystat.in_msgtarget[target]++; + PFKEYSTAT_INC(in_msgtarget[target]); if (!sendup) continue; if ((n = m_copy(m, 0, (int)M_COPYALL)) == NULL) { m_freem(m); - V_pfkeystat.in_nomem++; + PFKEYSTAT_INC(in_nomem); mtx_unlock(&rawcb_mtx); return ENOBUFS; } Modified: stable/9/sys/netipsec/keysock.h ============================================================================== --- stable/9/sys/netipsec/keysock.h Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/keysock.h Thu Jul 4 08:59:34 2013 (r252693) @@ -70,6 +70,8 @@ struct keycb { }; VNET_DECLARE(struct pfkeystat, pfkeystat); +#define PFKEYSTAT_ADD(name, val) V_pfkeystat.name += (val) +#define PFKEYSTAT_INC(name) PFKEYSTAT_ADD(name, 1) #define V_pfkeystat VNET(pfkeystat) extern int key_output(struct mbuf *m, struct socket *so); Modified: stable/9/sys/netipsec/xform_ah.c ============================================================================== --- stable/9/sys/netipsec/xform_ah.c Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/xform_ah.c Thu Jul 4 08:59:34 2013 (r252693) @@ -596,14 +596,14 @@ ah_input(struct mbuf *m, struct secasvar IP6_EXTHDR_GET(ah, struct newah *, m, skip, rplen); if (ah == NULL) { DPRINTF(("ah_input: cannot pullup header\n")); - V_ahstat.ahs_hdrops++; /*XXX*/ + AHSTAT_INC(ahs_hdrops); /*XXX*/ m_freem(m); return ENOBUFS; } /* Check replay window, if applicable. */ if (sav->replay && !ipsec_chkreplay(ntohl(ah->ah_seq), sav)) { - V_ahstat.ahs_replay++; + AHSTAT_INC(ahs_replay); DPRINTF(("%s: packet replay failure: %s\n", __func__, ipsec_logsastr(sav))); m_freem(m); @@ -620,17 +620,17 @@ ah_input(struct mbuf *m, struct secasvar hl, (u_long) (authsize + rplen - sizeof (struct ah)), ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - V_ahstat.ahs_badauthl++; + AHSTAT_INC(ahs_badauthl); m_freem(m); return EACCES; } - V_ahstat.ahs_ibytes += m->m_pkthdr.len - skip - hl; + AHSTAT_ADD(ahs_ibytes, m->m_pkthdr.len - skip - hl); /* Get crypto descriptors. */ crp = crypto_getreq(1); if (crp == NULL) { DPRINTF(("%s: failed to acquire crypto descriptor\n",__func__)); - V_ahstat.ahs_crypto++; + AHSTAT_INC(ahs_crypto); m_freem(m); return ENOBUFS; } @@ -670,7 +670,7 @@ ah_input(struct mbuf *m, struct secasvar } if (tc == NULL) { DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__)); - V_ahstat.ahs_crypto++; + AHSTAT_INC(ahs_crypto); crypto_freereq(crp); m_freem(m); return ENOBUFS; @@ -694,7 +694,7 @@ ah_input(struct mbuf *m, struct secasvar skip, ahx->type, 0); if (error != 0) { /* NB: mbuf is free'd by ah_massage_headers */ - V_ahstat.ahs_hdrops++; + AHSTAT_INC(ahs_hdrops); free(tc, M_XDATA); crypto_freereq(crp); return error; @@ -775,19 +775,19 @@ ah_input_cb(struct cryptop *crp) return error; } - V_ahstat.ahs_noxform++; + AHSTAT_INC(ahs_noxform); DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); error = crp->crp_etype; goto bad; } else { - V_ahstat.ahs_hist[sav->alg_auth]++; + AHSTAT_INC(ahs_hist[sav->alg_auth]); crypto_freereq(crp); /* No longer needed. */ crp = NULL; } /* Shouldn't happen... */ if (m == NULL) { - V_ahstat.ahs_crypto++; + AHSTAT_INC(ahs_crypto); DPRINTF(("%s: bogus returned buffer from crypto\n", __func__)); error = EINVAL; goto bad; @@ -813,7 +813,7 @@ ah_input_cb(struct cryptop *crp) "in SA %s/%08lx\n", __func__, ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); - V_ahstat.ahs_badauth++; + AHSTAT_INC(ahs_badauth); error = EACCES; goto bad; } @@ -844,7 +844,7 @@ ah_input_cb(struct cryptop *crp) m_copydata(m, skip + offsetof(struct newah, ah_seq), sizeof (seq), (caddr_t) &seq); if (ipsec_updatereplay(ntohl(seq), sav)) { - V_ahstat.ahs_replay++; + AHSTAT_INC(ahs_replay); error = ENOBUFS; /*XXX as above*/ goto bad; } @@ -858,7 +858,7 @@ ah_input_cb(struct cryptop *crp) DPRINTF(("%s: mangled mbuf chain for SA %s/%08lx\n", __func__, ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); - V_ahstat.ahs_hdrops++; + AHSTAT_INC(ahs_hdrops); goto bad; } @@ -919,7 +919,7 @@ ah_output( ahx = sav->tdb_authalgxform; IPSEC_ASSERT(ahx != NULL, ("null authentication xform")); - V_ahstat.ahs_output++; + AHSTAT_INC(ahs_output); /* Figure out header size. */ rplen = HDRSIZE(sav); @@ -942,7 +942,7 @@ ah_output( sav->sah->saidx.dst.sa.sa_family, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - V_ahstat.ahs_nopf++; + AHSTAT_INC(ahs_nopf); error = EPFNOSUPPORT; goto bad; } @@ -953,20 +953,20 @@ ah_output( ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi), rplen + authsize + m->m_pkthdr.len, maxpacketsize)); - V_ahstat.ahs_toobig++; + AHSTAT_INC(ahs_toobig); error = EMSGSIZE; goto bad; } /* Update the counters. */ - V_ahstat.ahs_obytes += m->m_pkthdr.len - skip; + AHSTAT_ADD(ahs_obytes, m->m_pkthdr.len - skip); m = m_unshare(m, M_NOWAIT); if (m == NULL) { DPRINTF(("%s: cannot clone mbuf chain, SA %s/%08lx\n", __func__, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - V_ahstat.ahs_hdrops++; + AHSTAT_INC(ahs_hdrops); error = ENOBUFS; goto bad; } @@ -979,7 +979,7 @@ ah_output( rplen + authsize, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - V_ahstat.ahs_hdrops++; /*XXX differs from openbsd */ + AHSTAT_INC(ahs_hdrops); /*XXX differs from openbsd */ error = ENOBUFS; goto bad; } @@ -1007,7 +1007,7 @@ ah_output( __func__, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - V_ahstat.ahs_wrap++; + AHSTAT_INC(ahs_wrap); error = EINVAL; goto bad; } @@ -1024,7 +1024,7 @@ ah_output( if (crp == NULL) { DPRINTF(("%s: failed to acquire crypto descriptors\n", __func__)); - V_ahstat.ahs_crypto++; + AHSTAT_INC(ahs_crypto); error = ENOBUFS; goto bad; } @@ -1046,7 +1046,7 @@ ah_output( if (tc == NULL) { crypto_freereq(crp); DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__)); - V_ahstat.ahs_crypto++; + AHSTAT_INC(ahs_crypto); error = ENOBUFS; goto bad; } @@ -1151,7 +1151,7 @@ ah_output_cb(struct cryptop *crp) sav = tc->tc_sav; /* With the isr lock released SA pointer can be updated. */ if (sav != isr->sav) { - V_ahstat.ahs_notdb++; + AHSTAT_INC(ahs_notdb); DPRINTF(("%s: SA expired while in crypto\n", __func__)); error = ENOBUFS; /*XXX*/ goto bad; @@ -1168,7 +1168,7 @@ ah_output_cb(struct cryptop *crp) return error; } - V_ahstat.ahs_noxform++; + AHSTAT_INC(ahs_noxform); DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); error = crp->crp_etype; goto bad; @@ -1176,12 +1176,12 @@ ah_output_cb(struct cryptop *crp) /* Shouldn't happen... */ if (m == NULL) { - V_ahstat.ahs_crypto++; + AHSTAT_INC(ahs_crypto); DPRINTF(("%s: bogus returned buffer from crypto\n", __func__)); error = EINVAL; goto bad; } - V_ahstat.ahs_hist[sav->alg_auth]++; + AHSTAT_INC(ahs_hist[sav->alg_auth]); /* * Copy original headers (with the new protocol number) back Modified: stable/9/sys/netipsec/xform_esp.c ============================================================================== --- stable/9/sys/netipsec/xform_esp.c Thu Jul 4 08:57:13 2013 (r252692) +++ stable/9/sys/netipsec/xform_esp.c Thu Jul 4 08:59:34 2013 (r252693) @@ -286,7 +286,7 @@ esp_input(struct mbuf *m, struct secasva if ( (skip&3) || (m->m_pkthdr.len&3) ){ DPRINTF(("%s: misaligned packet, skip %u pkt len %u", __func__, skip, m->m_pkthdr.len)); - V_espstat.esps_badilen++; + ESPSTAT_INC(esps_badilen); m_freem(m); return EINVAL; } @@ -332,7 +332,7 @@ esp_input(struct mbuf *m, struct secasva plen, espx->blocksize, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); - V_espstat.esps_badilen++; + ESPSTAT_INC(esps_badilen); m_freem(m); return EINVAL; } @@ -343,13 +343,13 @@ esp_input(struct mbuf *m, struct secasva if (esph && sav->replay && !ipsec_chkreplay(ntohl(esp->esp_seq), sav)) { DPRINTF(("%s: packet replay check for %s\n", __func__, ipsec_logsastr(sav))); /*XXX*/ - V_espstat.esps_replay++; + ESPSTAT_INC(esps_replay); m_freem(m); return ENOBUFS; /*XXX*/ } /* Update the counters */ - V_espstat.esps_ibytes += m->m_pkthdr.len - (skip + hlen + alen); + ESPSTAT_ADD(esps_ibytes, m->m_pkthdr.len - (skip + hlen + alen)); /* Find out if we've already done crypto */ for (mtag = m_tag_find(m, PACKET_TAG_IPSEC_IN_CRYPTO_DONE, NULL); @@ -368,7 +368,7 @@ esp_input(struct mbuf *m, struct secasva if (crp == NULL) { DPRINTF(("%s: failed to acquire crypto descriptors\n", __func__)); - V_espstat.esps_crypto++; + ESPSTAT_INC(esps_crypto); m_freem(m); return ENOBUFS; } @@ -383,7 +383,7 @@ esp_input(struct mbuf *m, struct secasva if (tc == NULL) { crypto_freereq(crp); DPRINTF(("%s: failed to allocate tdb_crypto\n", __func__)); - V_espstat.esps_crypto++; + ESPSTAT_INC(esps_crypto); m_freem(m); return ENOBUFS; } @@ -501,7 +501,7 @@ esp_input_cb(struct cryptop *crp) return error; } - V_espstat.esps_noxform++; + ESPSTAT_INC(esps_noxform); DPRINTF(("%s: crypto error %d\n", __func__, crp->crp_etype)); error = crp->crp_etype; goto bad; @@ -509,12 +509,12 @@ esp_input_cb(struct cryptop *crp) /* Shouldn't happen... */ if (m == NULL) { - V_espstat.esps_crypto++; + ESPSTAT_INC(esps_crypto); DPRINTF(("%s: bogus returned buffer from crypto\n", __func__)); error = EINVAL; goto bad; } - V_espstat.esps_hist[sav->alg_enc]++; + ESPSTAT_INC(esps_hist[sav->alg_enc]); /* If authentication was performed, check now. */ if (esph != NULL) { @@ -533,7 +533,7 @@ esp_input_cb(struct cryptop *crp) * the verification for us. Otherwise we need to * check the authentication calculation. */ - V_ahstat.ahs_hist[sav->alg_auth]++; + AHSTAT_INC(ahs_hist[sav->alg_auth]); if (mtag == NULL) { /* Copy the authenticator from the packet */ m_copydata(m, m->m_pkthdr.len - alen, @@ -548,7 +548,7 @@ esp_input_cb(struct cryptop *crp) __func__, ipsec_address(&saidx->dst), (u_long) ntohl(sav->spi))); - V_espstat.esps_badauth++; + ESPSTAT_INC(esps_badauth); error = EACCES; goto bad; } @@ -578,7 +578,7 @@ esp_input_cb(struct cryptop *crp) if (ipsec_updatereplay(ntohl(seq), sav)) { DPRINTF(("%s: packet replay check for %s\n", __func__, ipsec_logsastr(sav))); - V_espstat.esps_replay++; + ESPSTAT_INC(esps_replay); error = ENOBUFS; goto bad; } @@ -593,7 +593,7 @@ esp_input_cb(struct cryptop *crp) /* Remove the ESP header and IV from the mbuf. */ error = m_striphdr(m, skip, hlen); if (error) { - V_espstat.esps_hdrops++; + ESPSTAT_INC(esps_hdrops); DPRINTF(("%s: bad mbuf chain, SA %s/%08lx\n", __func__, ipsec_address(&sav->sah->saidx.dst), (u_long) ntohl(sav->spi))); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 14:26:42 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9F0F417E; Thu, 4 Jul 2013 14:26:42 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F3B518D3; Thu, 4 Jul 2013 14:26:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64EQgpu026433; Thu, 4 Jul 2013 14:26:42 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64EQgA0026432; Thu, 4 Jul 2013 14:26:42 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201307041426.r64EQgA0026432@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 4 Jul 2013 14:26: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: r252699 - stable/9/lib/libc/stdlib 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.14 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, 04 Jul 2013 14:26:42 -0000 Author: des Date: Thu Jul 4 14:26:42 2013 New Revision: 252699 URL: http://svnweb.freebsd.org/changeset/base/252699 Log: Protect the #define MALLOC_PRODUCTION directive in case it was also defined on the command line (due to MALLOC_PRODUCTION=yes in src.conf). Modified: stable/9/lib/libc/stdlib/malloc.c Modified: stable/9/lib/libc/stdlib/malloc.c ============================================================================== --- stable/9/lib/libc/stdlib/malloc.c Thu Jul 4 12:35:39 2013 (r252698) +++ stable/9/lib/libc/stdlib/malloc.c Thu Jul 4 14:26:42 2013 (r252699) @@ -123,7 +123,9 @@ * defaults the A and J runtime options to off. These settings are appropriate * for production systems. */ +#ifndef MALLOC_PRODUCTION #define MALLOC_PRODUCTION +#endif #ifndef MALLOC_PRODUCTION /* From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 15:19:46 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6633B417; Thu, 4 Jul 2013 15:19:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 45B291C08; Thu, 4 Jul 2013 15:19:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64FJkM1041650; Thu, 4 Jul 2013 15:19:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64FJktN041649; Thu, 4 Jul 2013 15:19:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307041519.r64FJktN041649@svn.freebsd.org> From: Alexander Motin Date: Thu, 4 Jul 2013 15:19: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: r252700 - stable/9/lib/libstand 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.14 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, 04 Jul 2013 15:19:46 -0000 Author: mav Date: Thu Jul 4 15:19:45 2013 New Revision: 252700 URL: http://svnweb.freebsd.org/changeset/base/252700 Log: MFC r240774: Don't use global nfs_root_node variable as per-file storage. There are fields that should be file-specific. Modified: stable/9/lib/libstand/nfs.c Directory Properties: stable/9/lib/libstand/ (props changed) Modified: stable/9/lib/libstand/nfs.c ============================================================================== --- stable/9/lib/libstand/nfs.c Thu Jul 4 14:26:42 2013 (r252699) +++ stable/9/lib/libstand/nfs.c Thu Jul 4 15:19:45 2013 (r252700) @@ -486,6 +486,9 @@ nfs_open(const char *upath, struct open_ desc->destip = rootip; if ((error = nfs_getrootfh(desc, rootpath, nfs_root_node.fh))) return (error); + nfs_root_node.fa.fa_type = htonl(NFDIR); + nfs_root_node.fa.fa_mode = htonl(0755); + nfs_root_node.fa.fa_nlink = htonl(2); nfs_root_node.iodesc = desc; fh = &nfs_root_node.fh[0]; @@ -498,14 +501,15 @@ nfs_open(const char *upath, struct open_ setenv("boot.nfsroot.path", rootpath, 1); setenv("boot.nfsroot.nfshandle", buf, 1); -#ifndef NFS_NOSYMLINK - /* Fake up attributes for the root dir. */ - fa = &nfs_root_node.fa; - fa->fa_type = htonl(NFDIR); - fa->fa_mode = htonl(0755); - fa->fa_nlink = htonl(2); + /* Allocate file system specific data structure */ + currfd = malloc(sizeof(*newfd)); + if (currfd == NULL) { + error = ENOMEM; + goto out; + } - currfd = &nfs_root_node; +#ifndef NFS_NOSYMLINK + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); newfd = 0; cp = path = strdup(upath); @@ -533,7 +537,6 @@ nfs_open(const char *upath, struct open_ /* allocate file system specific data structure */ newfd = malloc(sizeof(*newfd)); newfd->iodesc = currfd->iodesc; - newfd->off = 0; /* * Get next component of path name. @@ -585,11 +588,8 @@ nfs_open(const char *upath, struct open_ * If relative pathname, restart at parent directory. */ cp = namebuf; - if (*cp == '/') { - if (currfd != &nfs_root_node) - free(currfd); - currfd = &nfs_root_node; - } + if (*cp == '/') + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); free(newfd); newfd = 0; @@ -597,8 +597,7 @@ nfs_open(const char *upath, struct open_ continue; } - if (currfd != &nfs_root_node) - free(currfd); + free(currfd); currfd = newfd; newfd = 0; } @@ -611,14 +610,12 @@ out: if (path) free(path); #else - /* allocate file system specific data structure */ - currfd = malloc(sizeof(*currfd)); currfd->iodesc = desc; - currfd->off = 0; error = nfs_lookupfh(&nfs_root_node, upath, currfd); #endif if (!error) { + currfd->off = 0; f->f_fsdata = (void *)currfd; return (0); } @@ -628,10 +625,7 @@ out: printf("nfs_open: %s lookupfh failed: %s\n", path, strerror(error)); #endif -#ifndef NFS_NOSYMLINK - if (currfd != &nfs_root_node) -#endif - free(currfd); + free(currfd); return (error); } @@ -646,7 +640,7 @@ nfs_close(struct open_file *f) printf("nfs_close: fp=0x%lx\n", (u_long)fp); #endif - if (fp != &nfs_root_node && fp) + if (fp) free(fp); f->f_fsdata = (void *)0; @@ -1133,6 +1127,9 @@ nfs_open(const char *upath, struct open_ if ((error = nfs_getrootfh(desc, rootpath, &nfs_root_node.fhsize, nfs_root_node.fh))) return (error); + nfs_root_node.fa.fa_type = htonl(NFDIR); + nfs_root_node.fa.fa_mode = htonl(0755); + nfs_root_node.fa.fa_nlink = htonl(2); nfs_root_node.iodesc = desc; fh = &nfs_root_node.fh[0]; @@ -1147,14 +1144,14 @@ nfs_open(const char *upath, struct open_ sprintf(buf, "%d", nfs_root_node.fhsize); setenv("boot.nfsroot.nfshandlelen", buf, 1); + /* Allocate file system specific data structure */ + currfd = malloc(sizeof(*newfd)); + if (currfd == NULL) { + error = ENOMEM; + goto out; + } #ifndef NFS_NOSYMLINK - /* Fake up attributes for the root dir. */ - fa = &nfs_root_node.fa; - fa->fa_type = htonl(NFDIR); - fa->fa_mode = htonl(0755); - fa->fa_nlink = htonl(2); - - currfd = &nfs_root_node; + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); newfd = 0; cp = path = strdup(upath); @@ -1186,7 +1183,6 @@ nfs_open(const char *upath, struct open_ goto out; } newfd->iodesc = currfd->iodesc; - newfd->off = 0; /* * Get next component of path name. @@ -1238,11 +1234,8 @@ nfs_open(const char *upath, struct open_ * If relative pathname, restart at parent directory. */ cp = namebuf; - if (*cp == '/') { - if (currfd != &nfs_root_node) - free(currfd); - currfd = &nfs_root_node; - } + if (*cp == '/') + bcopy(&nfs_root_node, currfd, sizeof(*currfd)); free(newfd); newfd = 0; @@ -1250,8 +1243,7 @@ nfs_open(const char *upath, struct open_ continue; } - if (currfd != &nfs_root_node) - free(currfd); + free(currfd); currfd = newfd; newfd = 0; } @@ -1262,17 +1254,12 @@ out: free(newfd); free(path); #else - /* allocate file system specific data structure */ - currfd = malloc(sizeof(*currfd)); - if (currfd != NULL) { - currfd->iodesc = desc; - currfd->off = 0; + currfd->iodesc = desc; - error = nfs_lookupfh(&nfs_root_node, upath, currfd); - } else - error = ENOMEM; + error = nfs_lookupfh(&nfs_root_node, upath, currfd); #endif if (!error) { + currfd->off = 0; f->f_fsdata = (void *)currfd; return (0); } @@ -1282,10 +1269,7 @@ out: printf("nfs_open: %s lookupfh failed: %s\n", path, strerror(error)); #endif -#ifndef NFS_NOSYMLINK - if (currfd != &nfs_root_node) -#endif - free(currfd); + free(currfd); return (error); } @@ -1300,7 +1284,7 @@ nfs_close(struct open_file *f) printf("nfs_close: fp=0x%lx\n", (u_long)fp); #endif - if (fp != &nfs_root_node && fp) + if (fp) free(fp); f->f_fsdata = (void *)0; From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 15:21:27 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D340D65E; Thu, 4 Jul 2013 15:21:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B45F71C3F; Thu, 4 Jul 2013 15:21:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64FLR3Y043528; Thu, 4 Jul 2013 15:21:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64FLRhF043527; Thu, 4 Jul 2013 15:21:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201307041521.r64FLRhF043527@svn.freebsd.org> From: Alexander Motin Date: Thu, 4 Jul 2013 15:21: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: r252701 - stable/9/lib/libstand 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.14 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, 04 Jul 2013 15:21:27 -0000 Author: mav Date: Thu Jul 4 15:21:27 2013 New Revision: 252701 URL: http://svnweb.freebsd.org/changeset/base/252701 Log: MFC r240780, r252468: Make nfs_readdir() more careful about using response data, cached in global buffer. For now it fixes bug when following `ls` command will return data from previous one aborted by pager. Also it should allow to read several directories same time, for example, for recursive tracerse. Modified: stable/9/lib/libstand/nfs.c Directory Properties: stable/9/lib/libstand/ (props changed) Modified: stable/9/lib/libstand/nfs.c ============================================================================== --- stable/9/lib/libstand/nfs.c Thu Jul 4 15:19:45 2013 (r252700) +++ stable/9/lib/libstand/nfs.c Thu Jul 4 15:21:27 2013 (r252701) @@ -181,6 +181,7 @@ struct nfs_iodesc { uint32_t fhsize; u_char fh[NFS_V3MAXFHSIZE]; struct nfsv3_fattrs fa; /* all in network order */ + uint64_t cookie; }; #endif /* OLD_NFSV2 */ @@ -755,6 +756,7 @@ nfs_readdir(struct open_file *f, struct struct nfs_readdir_data *rd; struct nfs_readdir_off *roff = NULL; static char *buf; + static struct nfs_iodesc *pfp = NULL; static n_long cookie = 0; size_t cc; n_long eof; @@ -768,13 +770,14 @@ nfs_readdir(struct open_file *f, struct u_char d[NFS_READDIRSIZE]; } rdata; - if (cookie == 0) { + if (fp != pfp || fp->off != cookie) { + pfp = NULL; refill: args = &sdata.d; bzero(args, sizeof(*args)); bcopy(fp->fh, args->fh, NFS_FHSIZE); - args->cookie = htonl(cookie); + args->cookie = htonl(fp->off); args->count = htonl(NFS_READDIRSIZE); cc = rpc_call(fp->iodesc, NFS_PROG, NFS_VER2, NFSPROC_READDIR, @@ -784,6 +787,8 @@ nfs_readdir(struct open_file *f, struct roff = (struct nfs_readdir_off *)buf; if (ntohl(roff->cookie) != 0) return EIO; + pfp = fp; + cookie = fp->off; } roff = (struct nfs_readdir_off *)buf; @@ -804,7 +809,7 @@ nfs_readdir(struct open_file *f, struct buf += (sizeof(struct nfs_readdir_data) + roundup(htonl(rd->len),4)); roff = (struct nfs_readdir_off *)buf; - cookie = ntohl(roff->cookie); + fp->off = cookie = ntohl(roff->cookie); return 0; } #else /* !OLD_NFSV2 */ @@ -1260,6 +1265,7 @@ out: #endif if (!error) { currfd->off = 0; + currfd->cookie = 0; f->f_fsdata = (void *)currfd; return (0); } @@ -1398,11 +1404,9 @@ nfs_readdir(struct open_file *f, struct struct nfsv3_readdir_repl *repl; struct nfsv3_readdir_entry *rent; static char *buf; - static uint32_t cookie0 = 0; - static uint32_t cookie1 = 0; + static struct nfs_iodesc *pfp = NULL; + static uint64_t cookie = 0; size_t cc; - static uint32_t cookieverf0 = 0; - static uint32_t cookieverf1 = 0; int pos; struct args { @@ -1418,7 +1422,8 @@ nfs_readdir(struct open_file *f, struct u_char d[NFS_READDIRSIZE]; } rdata; - if (cookie0 == 0 && cookie1 == 0) { + if (fp != pfp || fp->off != cookie) { + pfp = NULL; refill: args = &sdata.d; bzero(args, sizeof(*args)); @@ -1426,10 +1431,10 @@ nfs_readdir(struct open_file *f, struct args->fhsize = htonl(fp->fhsize); bcopy(fp->fh, args->fhpluscookie, fp->fhsize); pos = roundup(fp->fhsize, sizeof(uint32_t)) / sizeof(uint32_t); - args->fhpluscookie[pos++] = cookie0; - args->fhpluscookie[pos++] = cookie1; - args->fhpluscookie[pos++] = cookieverf0; - args->fhpluscookie[pos++] = cookieverf1; + args->fhpluscookie[pos++] = htonl(fp->off >> 32); + args->fhpluscookie[pos++] = htonl(fp->off); + args->fhpluscookie[pos++] = htonl(fp->cookie >> 32); + args->fhpluscookie[pos++] = htonl(fp->cookie); args->fhpluscookie[pos] = htonl(NFS_READDIRSIZE); cc = rpc_call(fp->iodesc, NFS_PROG, NFS_VER3, NFSPROCV3_READDIR, @@ -1440,8 +1445,10 @@ nfs_readdir(struct open_file *f, struct repl = (struct nfsv3_readdir_repl *)buf; if (repl->errno != 0) return (ntohl(repl->errno)); - cookieverf0 = repl->cookiev0; - cookieverf1 = repl->cookiev1; + pfp = fp; + cookie = fp->off; + fp->cookie = ((uint64_t)ntohl(repl->cookiev0) << 32) | + ntohl(repl->cookiev1); buf += sizeof (struct nfsv3_readdir_repl); } rent = (struct nfsv3_readdir_entry *)buf; @@ -1449,10 +1456,7 @@ nfs_readdir(struct open_file *f, struct if (rent->follows == 0) { /* fid0 is actually eof */ if (rent->fid0 != 0) { - cookie0 = 0; - cookie1 = 0; - cookieverf0 = 0; - cookieverf1 = 0; + cookie = 0; return (ENOENT); } goto refill; @@ -1463,8 +1467,9 @@ nfs_readdir(struct open_file *f, struct d->d_name[d->d_namlen] = '\0'; pos = roundup(d->d_namlen, sizeof(uint32_t)) / sizeof(uint32_t); - cookie0 = rent->nameplus[pos++]; - cookie1 = rent->nameplus[pos++]; + fp->off = cookie = ((uint64_t)ntohl(rent->nameplus[pos]) << 32) | + ntohl(rent->nameplus[pos + 1]); + pos += 2; buf = (u_char *)&rent->nameplus[pos]; return (0); } From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 20:17:12 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C912A4F0; Thu, 4 Jul 2013 20:17:12 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B789D1CE6; Thu, 4 Jul 2013 20:17:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64KHCO0029565; Thu, 4 Jul 2013 20:17:12 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64KH9gQ029542; Thu, 4 Jul 2013 20:17:09 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307042017.r64KH9gQ029542@svn.freebsd.org> From: Dimitry Andric Date: Thu, 4 Jul 2013 20:17: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: r252723 - in stable/9: . contrib/gcc contrib/llvm contrib/llvm/include/llvm contrib/llvm/include/llvm-c contrib/llvm/include/llvm-c/Transforms contrib/llvm/include/llvm/ADT contrib/llvm... 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.14 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, 04 Jul 2013 20:17:12 -0000 Author: dim Date: Thu Jul 4 20:17:04 2013 New Revision: 252723 URL: http://svnweb.freebsd.org/changeset/base/252723 Log: Merge clang 3.3 release and various fixes: r241214, r246705, r248548, r249423, r249817, r250217, r250593, r250616, r250997, r251216, r251662, r251761, r251785, r251790, r252039. MFC r241214 (by jkim): Do not install incomplete unwind.h from clang. This header file was meant to be a wrapper for the canonical system header file. Unfortunately, we do not have one (yet) and some times it is causing weird failures when clang is used for building ports. More complete and correct file will come from libcxxrt in the future. Discussed with: dim, kib, theraven MFC r246705 (by andrew): Allow us to build clang for ARM EABI. Clang and llvm use the arm-gnueabi-freebsd10.0 triple for EABI. Use this when we are on arm or armv6 and are building for EABI. Reviewed by: dim MFC r248548 (by andrew): Pull in r177252 from upstream clang trunk: Make sure to use same EABI version for external assembler as for integrated as. This allows us to use gcc on a world built with clang on ARM. MFC r249423: Upgrade our copy of llvm/clang to trunk r178860, in preparation of the upcoming 3.3 release (branching and freezing expected in a few weeks). Preliminary release notes can be found at the usual location: An MFC is planned once the actual 3.3 release is finished. MFC r249817: Pull in r180121 from upstream llvm trunk: LoopVectorizer: Fix 15830. When scalarizing and unrolling stores make sure that the order in which the elements are scalarized is the same as the original order. This fixes a miscompilation in FreeBSD's regex library. This should fix lib/libc/regex/regcomp.c at -O3 with clang 3.3 r178860 on CPUs with SSE. Before this change, the vectorizer could incorrectly rearrange the second loop in computejumps(), leading to possibly invalid entries in the re_gets::charjump table. The net result was that for example "sed s/@CC@/foo/" failed to work correctly, leading to trouble with many configure scripts. MFC r250217: Allow building clang on older FreeBSD releases, where log2() does not exist yet. With this change, I have verified that building head on 8.1-RELEASE works. Noticed by: Ryan Stone MFC r250593: Pull in r181286 from upstream llvm trunk: LoopVectorize: getConsecutiveVector must respect signed arithmetic We were passing an i32 to ConstantInt::get where an i64 was needed and we must also pass the sign if we pass negatives numbers. The start index passed to getConsecutiveVector must also be signed. Should fix PR15882. This should fix Firefox crashes some people have been reporting, when it is compiled with -O3. MFC r250616: Use an ugly hack to get around bootstrapping problems when building clang on head between r239347 and r245428. The former revision introduced CLOCK_PROCESS_CPUTIME_ID as a clock id for the clock_gettime() function and friends, but it was only added in , not in . Any program including would therefore not be able to use CLOCK_PROCESS_CPUTIME_ID, even though the value of _POSIX_CPUTIME indicates its existence. The latter revision synchronized the defines again. Work around this problem by defining the id on the command line for the particular .cpp file that needs it. If the id ever changes value, this hack will need to be updated. MFC r250997: Pull in r182656 from upstream llvm trunk: LoopVectorize: LoopSimplify can't canonicalize loops with an indirectbr in it, don't assert on those cases. Fixes PR16139. This should fix clang assertion failures when optimizing at -O3, similar to: Assertion failed: (TheLoop->getLoopPreheader() && "No preheader!!"), function canVectorize, file contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp, line 2171. Reported by: O. Hartmann PR: ports/178332, ports/178977 MFC r251216 (by ed): Pull in r183033 and r183036 from LLVM trunk: Add support for optimized (non-generic) atomic libcalls. For integer types of sizes 1, 2, 4 and 8, libcompiler-rt (and libgcc) provide atomic functions that pass parameters by value and return results directly. libgcc and libcompiler-rt only provide optimized libcalls for __atomic_fetch_*, as generic libcalls on non-integer types would make little sense. This means that we can finally make __atomic_fetch_* work on architectures for which we don't provide these operations as builtins (e.g. ARM). This should fix the dreaded "cannot compile this atomic library call yet" error that would pop up once every while. This should make it possible for me to get C11 atomics working on all of our platforms. MFC r251662: Upgrade our copy of llvm/clang to 3.3 release. Release notes are still in the works, these will follow soon. MFC r251761: Pull in r181620 from llvm trunk: [ms-inline asm] Fix a crasher when we fail on a direct match. The issue was that the MatchingInlineAsm and VariantID args to the MatchInstructionImpl function weren't being set properly. Specifically, when parsing intel syntax, the parser thought it was parsing inline assembly in the at&t dialect; that will never be the case. The crash was caused when the emitter tried to emit the instruction, but the operands weren't set. When parsing inline assembly we only set the opcode, not the operands, which is used to lookup the instruction descriptor. rdar://13854391 and PR15945 Also, this commit reverts r176036. Now that we're correctly parsing the intel syntax the pushad/popad don't match properly. I've reimplemented that fix using a MnemonicAlias. Pull in r183907 from llvm trunk: X86: Make the cmov aliases work with intel syntax too. These commits make a number of Intel-style inline assembly mnemonics aliases (occurring in several ports) work properly, which could cause assertions otherwise. Reported by: kwm, bapt MFC r251785 (by ed) Pull in r184040 from upstream clang trunk: Emit native implementations of atomic operations on FreeBSD/armv6. Just like on Linux, FreeBSD/armv6 assumes the system supports ldrex/strex unconditionally. It is also used by the kernel. We can therefore enable support for it, like we do on Linux. While there, change one of the unit tests to explicitly test against armv5 instead of armv7, as it actually tests whether libcalls are emitted. MFC r251790 (by andrew): Pull in r183926 from LLVM trunk: Allow clang to build __clear_cache on ARM. __clear_cache is special. It needs no signature, but is a real function in compiler_rt or libgcc. Patch by Andrew Turner. This allows us to build the __clear_cache function in compiler-rt. MFC r252039: Pull in r183984 from llvm trunk: Make PrologEpilogInserter save/restore all callee saved registers in functions which call __builtin_unwind_init() __builtin_unwind_init() is an undocumented gcc intrinsic which has this effect, and is used in libgcc_eh. Goes part of the way toward fixing PR8541. This obsoletes the ugly hack to libgcc's unwind code from r245272, and should also work for other arches, so revert the hack too. Added: stable/9/contrib/llvm/include/llvm/ADT/None.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/ADT/None.h stable/9/contrib/llvm/include/llvm/ADT/SparseMultiSet.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/ADT/SparseMultiSet.h stable/9/contrib/llvm/include/llvm/Analysis/CallGraphSCCPass.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Analysis/CallGraphSCCPass.h stable/9/contrib/llvm/include/llvm/Analysis/CallPrinter.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Analysis/CallPrinter.h stable/9/contrib/llvm/include/llvm/Analysis/PtrUseVisitor.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Analysis/PtrUseVisitor.h stable/9/contrib/llvm/include/llvm/Analysis/TargetTransformInfo.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Analysis/TargetTransformInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/DAGCombine.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/CodeGen/DAGCombine.h stable/9/contrib/llvm/include/llvm/CodeGen/LiveIntervalUnion.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/CodeGen/LiveIntervalUnion.h stable/9/contrib/llvm/include/llvm/CodeGen/LiveRegMatrix.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/CodeGen/LiveRegMatrix.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineTraceMetrics.h - copied, changed from r249423, head/contrib/llvm/include/llvm/CodeGen/MachineTraceMetrics.h stable/9/contrib/llvm/include/llvm/CodeGen/ScheduleDFS.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/CodeGen/ScheduleDFS.h stable/9/contrib/llvm/include/llvm/CodeGen/VirtRegMap.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/CodeGen/VirtRegMap.h stable/9/contrib/llvm/include/llvm/DebugInfo/DWARFFormValue.h - copied unchanged from r251662, head/contrib/llvm/include/llvm/DebugInfo/DWARFFormValue.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/ObjectCache.h - copied unchanged from r251662, head/contrib/llvm/include/llvm/ExecutionEngine/ObjectCache.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h - copied, changed from r249423, head/contrib/llvm/include/llvm/ExecutionEngine/SectionMemoryManager.h stable/9/contrib/llvm/include/llvm/IR/ - copied from r249423, head/contrib/llvm/include/llvm/IR/ stable/9/contrib/llvm/include/llvm/IRReader/ - copied from r249423, head/contrib/llvm/include/llvm/IRReader/ stable/9/contrib/llvm/include/llvm/InstVisitor.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/InstVisitor.h stable/9/contrib/llvm/include/llvm/LinkAllIR.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/LinkAllIR.h stable/9/contrib/llvm/include/llvm/MC/MCELF.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/MC/MCELF.h stable/9/contrib/llvm/include/llvm/MC/MCELFStreamer.h - copied, changed from r249423, head/contrib/llvm/include/llvm/MC/MCELFStreamer.h stable/9/contrib/llvm/include/llvm/MC/MCInstBuilder.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/MC/MCInstBuilder.h stable/9/contrib/llvm/include/llvm/Option/ - copied from r249423, head/contrib/llvm/include/llvm/Option/ stable/9/contrib/llvm/include/llvm/Support/ArrayRecycler.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Support/ArrayRecycler.h stable/9/contrib/llvm/include/llvm/Support/CBindingWrapping.h - copied unchanged from r251662, head/contrib/llvm/include/llvm/Support/CBindingWrapping.h stable/9/contrib/llvm/include/llvm/Support/Compression.h - copied unchanged from r251662, head/contrib/llvm/include/llvm/Support/Compression.h stable/9/contrib/llvm/include/llvm/Support/ConvertUTF.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Support/ConvertUTF.h stable/9/contrib/llvm/include/llvm/Support/ErrorOr.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Support/ErrorOr.h stable/9/contrib/llvm/include/llvm/Support/Watchdog.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Support/Watchdog.h stable/9/contrib/llvm/include/llvm/Support/YAMLTraits.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Support/YAMLTraits.h stable/9/contrib/llvm/include/llvm/Target/CostTable.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Target/CostTable.h stable/9/contrib/llvm/include/llvm/Transforms/ObjCARC.h - copied unchanged from r249423, head/contrib/llvm/include/llvm/Transforms/ObjCARC.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/BlackList.h - copied, changed from r249423, head/contrib/llvm/include/llvm/Transforms/Utils/BlackList.h stable/9/contrib/llvm/lib/Analysis/IPA/CallPrinter.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Analysis/IPA/CallPrinter.cpp stable/9/contrib/llvm/lib/Analysis/IPA/InlineCost.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Analysis/IPA/InlineCost.cpp stable/9/contrib/llvm/lib/Analysis/PtrUseVisitor.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Analysis/PtrUseVisitor.cpp stable/9/contrib/llvm/lib/Analysis/TargetTransformInfo.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Analysis/TargetTransformInfo.cpp stable/9/contrib/llvm/lib/Bitcode/Reader/BitstreamReader.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Bitcode/Reader/BitstreamReader.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp - copied unchanged from r249423, head/contrib/llvm/lib/CodeGen/AsmPrinter/ErlangGCPrinter.cpp stable/9/contrib/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp - copied, changed from r249423, head/contrib/llvm/lib/CodeGen/BasicTargetTransformInfo.cpp stable/9/contrib/llvm/lib/CodeGen/ErlangGC.cpp - copied unchanged from r249423, head/contrib/llvm/lib/CodeGen/ErlangGC.cpp stable/9/contrib/llvm/lib/CodeGen/TargetInstrInfo.cpp - copied unchanged from r249423, head/contrib/llvm/lib/CodeGen/TargetInstrInfo.cpp stable/9/contrib/llvm/lib/CodeGen/TargetLoweringBase.cpp - copied, changed from r249423, head/contrib/llvm/lib/CodeGen/TargetLoweringBase.cpp stable/9/contrib/llvm/lib/CodeGen/TargetRegisterInfo.cpp - copied unchanged from r249423, head/contrib/llvm/lib/CodeGen/TargetRegisterInfo.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugFrame.cpp - copied unchanged from r249423, head/contrib/llvm/lib/DebugInfo/DWARFDebugFrame.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugFrame.h - copied unchanged from r249423, head/contrib/llvm/lib/DebugInfo/DWARFDebugFrame.h stable/9/contrib/llvm/lib/DebugInfo/DWARFRelocMap.h - copied unchanged from r249423, head/contrib/llvm/lib/DebugInfo/DWARFRelocMap.h stable/9/contrib/llvm/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp - copied, changed from r249423, head/contrib/llvm/lib/ExecutionEngine/MCJIT/SectionMemoryManager.cpp stable/9/contrib/llvm/lib/IR/ - copied from r249423, head/contrib/llvm/lib/IR/ stable/9/contrib/llvm/lib/IRReader/ - copied from r249423, head/contrib/llvm/lib/IRReader/ stable/9/contrib/llvm/lib/Option/ - copied from r249423, head/contrib/llvm/lib/Option/ stable/9/contrib/llvm/lib/Support/Compression.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Support/Compression.cpp stable/9/contrib/llvm/lib/Support/ConvertUTF.c - copied unchanged from r249423, head/contrib/llvm/lib/Support/ConvertUTF.c stable/9/contrib/llvm/lib/Support/ConvertUTFWrapper.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Support/ConvertUTFWrapper.cpp stable/9/contrib/llvm/lib/Support/Unix/Watchdog.inc - copied unchanged from r249423, head/contrib/llvm/lib/Support/Unix/Watchdog.inc stable/9/contrib/llvm/lib/Support/Watchdog.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Support/Watchdog.cpp stable/9/contrib/llvm/lib/Support/Windows/Watchdog.inc - copied unchanged from r249423, head/contrib/llvm/lib/Support/Windows/Watchdog.inc stable/9/contrib/llvm/lib/Support/YAMLTraits.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Support/YAMLTraits.cpp stable/9/contrib/llvm/lib/Target/AArch64/ - copied from r249423, head/contrib/llvm/lib/Target/AArch64/ stable/9/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/ARM/A15SDOptimizer.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/LICENSE.TXT - copied unchanged from r249423, head/contrib/llvm/lib/Target/ARM/LICENSE.TXT stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.cpp stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.h - copied unchanged from r249423, head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFStreamer.h stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOp.h - copied, changed from r249423, head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOp.h stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.cpp stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.h - copied unchanged from r251662, head/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMUnwindOpAsm.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonFixupHwLoops.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/Hexagon/HexagonFixupHwLoops.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonOperands.td - copied unchanged from r249423, head/contrib/llvm/lib/Target/Hexagon/HexagonOperands.td stable/9/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.cpp stable/9/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.h - copied unchanged from r249423, head/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCInst.h stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.cpp stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h - copied unchanged from r249423, head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsReginfo.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsReginfo.cpp stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsReginfo.h - copied unchanged from r249423, head/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsReginfo.h stable/9/contrib/llvm/lib/Target/Mips/MicroMipsInstrFormats.td - copied unchanged from r251662, head/contrib/llvm/lib/Target/Mips/MicroMipsInstrFormats.td stable/9/contrib/llvm/lib/Target/Mips/MicroMipsInstrInfo.td - copied unchanged from r251662, head/contrib/llvm/lib/Target/Mips/MicroMipsInstrInfo.td stable/9/contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.h - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/Mips16ISelDAGToDAG.h stable/9/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.cpp stable/9/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.h - copied unchanged from r249423, head/contrib/llvm/lib/Target/Mips/Mips16ISelLowering.h stable/9/contrib/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/MipsConstantIslandPass.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.h - copied unchanged from r249423, head/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.h stable/9/contrib/llvm/lib/Target/Mips/MipsModuleISelDAGToDAG.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/Mips/MipsModuleISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsModuleISelDAGToDAG.h - copied unchanged from r251662, head/contrib/llvm/lib/Target/Mips/MipsModuleISelDAGToDAG.h stable/9/contrib/llvm/lib/Target/Mips/MipsOs16.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/Mips/MipsOs16.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsOs16.h - copied unchanged from r251662, head/contrib/llvm/lib/Target/Mips/MipsOs16.h stable/9/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.h - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/MipsSEISelDAGToDAG.h stable/9/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.h - copied, changed from r249423, head/contrib/llvm/lib/Target/Mips/MipsSEISelLowering.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/NVPTX/NVPTXGenericToNVVM.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVVMReflect.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/NVPTX/NVVMReflect.cpp stable/9/contrib/llvm/lib/Target/PowerPC/AsmParser/ - copied from r251662, head/contrib/llvm/lib/Target/PowerPC/AsmParser/ stable/9/contrib/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/PowerPC/PPCTargetTransformInfo.cpp stable/9/contrib/llvm/lib/Target/R600/ - copied from r249423, head/contrib/llvm/lib/Target/R600/ stable/9/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUELFObjectWriter.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUELFObjectWriter.cpp stable/9/contrib/llvm/lib/Target/R600/R600Packetizer.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/R600/R600Packetizer.cpp stable/9/contrib/llvm/lib/Target/R600/SIDefines.h - copied unchanged from r251662, head/contrib/llvm/lib/Target/R600/SIDefines.h stable/9/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcBaseInfo.h - copied unchanged from r251662, head/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcBaseInfo.h stable/9/contrib/llvm/lib/Target/Sparc/SparcInstr64Bit.td - copied, changed from r249423, head/contrib/llvm/lib/Target/Sparc/SparcInstr64Bit.td stable/9/contrib/llvm/lib/Target/SystemZ/ - copied from r251662, head/contrib/llvm/lib/Target/SystemZ/ stable/9/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/X86/X86FixupLEAs.cpp stable/9/contrib/llvm/lib/Target/X86/X86PadShortFunction.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/X86/X86PadShortFunction.cpp stable/9/contrib/llvm/lib/Target/X86/X86SchedHaswell.td - copied, changed from r249423, head/contrib/llvm/lib/Target/X86/X86SchedHaswell.td stable/9/contrib/llvm/lib/Target/X86/X86SchedSandyBridge.td - copied, changed from r249423, head/contrib/llvm/lib/Target/X86/X86SchedSandyBridge.td stable/9/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.cpp - copied, changed from r249423, head/contrib/llvm/lib/Target/X86/X86TargetTransformInfo.cpp stable/9/contrib/llvm/lib/Target/XCore/Disassembler/ - copied from r249423, head/contrib/llvm/lib/Target/XCore/Disassembler/ stable/9/contrib/llvm/lib/Target/XCore/InstPrinter/ - copied from r249423, head/contrib/llvm/lib/Target/XCore/InstPrinter/ stable/9/contrib/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Target/XCore/XCoreLowerThreadLocal.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreMCInstLower.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Target/XCore/XCoreMCInstLower.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreMCInstLower.h - copied unchanged from r249423, head/contrib/llvm/lib/Target/XCore/XCoreMCInstLower.h stable/9/contrib/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp - copied unchanged from r249423, head/contrib/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp stable/9/contrib/llvm/lib/Transforms/ObjCARC/ - copied from r249423, head/contrib/llvm/lib/Transforms/ObjCARC/ stable/9/contrib/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp stable/9/contrib/llvm/lib/Transforms/Vectorize/VecUtils.cpp - copied unchanged from r251662, head/contrib/llvm/lib/Transforms/Vectorize/VecUtils.cpp stable/9/contrib/llvm/lib/Transforms/Vectorize/VecUtils.h - copied unchanged from r251662, head/contrib/llvm/lib/Transforms/Vectorize/VecUtils.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ASTTypeTraits.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/AST/ASTTypeTraits.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ASTUnresolvedSet.h - copied, changed from r249423, head/contrib/llvm/tools/clang/include/clang/AST/ASTUnresolvedSet.h stable/9/contrib/llvm/tools/clang/include/clang/AST/AttrIterator.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/AST/AttrIterator.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CommentHTMLNamedCharacterReferences.td - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/AST/CommentHTMLNamedCharacterReferences.td stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclOpenMP.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/AST/DeclOpenMP.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsAArch64.def - copied, changed from r251662, head/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsAArch64.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/CapturedStmt.h - copied unchanged from r251662, head/contrib/llvm/tools/clang/include/clang/Basic/CapturedStmt.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/CharInfo.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/Basic/CharInfo.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/CommentOptions.h - copied, changed from r249423, head/contrib/llvm/tools/clang/include/clang/Basic/CommentOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.def - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/Basic/OpenMPKinds.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/OperatorPrecedence.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/Basic/OperatorPrecedence.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/TargetCXXABI.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/Basic/TargetCXXABI.h stable/9/contrib/llvm/tools/clang/include/clang/Format/ - copied from r249423, head/contrib/llvm/tools/clang/include/clang/Format/ stable/9/contrib/llvm/tools/clang/include/clang/Lex/MacroArgs.h - copied unchanged from r251662, head/contrib/llvm/tools/clang/include/clang/Lex/MacroArgs.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/PPConditionalDirectiveRecord.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/include/clang/Lex/PPConditionalDirectiveRecord.h stable/9/contrib/llvm/tools/clang/include/clang/Serialization/GlobalModuleIndex.h - copied, changed from r249423, head/contrib/llvm/tools/clang/include/clang/Serialization/GlobalModuleIndex.h stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransProtectedScope.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/ARCMigrate/TransProtectedScope.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ASTDumper.cpp - copied, changed from r249423, head/contrib/llvm/tools/clang/lib/AST/ASTDumper.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclOpenMP.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/AST/DeclOpenMP.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/CharInfo.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Basic/CharInfo.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/OpenMPKinds.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Basic/OpenMPKinds.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/OperatorPrecedence.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Basic/OperatorPrecedence.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp - copied, changed from r249423, head/contrib/llvm/tools/clang/lib/CodeGen/CGAtomic.cpp stable/9/contrib/llvm/tools/clang/lib/Format/ - copied from r249423, head/contrib/llvm/tools/clang/lib/Format/ stable/9/contrib/llvm/tools/clang/lib/Format/BreakableToken.cpp - copied unchanged from r251662, head/contrib/llvm/tools/clang/lib/Format/BreakableToken.cpp stable/9/contrib/llvm/tools/clang/lib/Format/BreakableToken.h - copied unchanged from r251662, head/contrib/llvm/tools/clang/lib/Format/BreakableToken.h stable/9/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.cpp - copied unchanged from r251662, head/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.cpp stable/9/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.h - copied unchanged from r251662, head/contrib/llvm/tools/clang/lib/Format/WhitespaceManager.h stable/9/contrib/llvm/tools/clang/lib/Headers/prfchwintrin.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Headers/prfchwintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/rdseedintrin.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Headers/rdseedintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/stdnoreturn.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Headers/stdnoreturn.h stable/9/contrib/llvm/tools/clang/lib/Lex/PPConditionalDirectiveRecord.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Lex/PPConditionalDirectiveRecord.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/UnicodeCharSets.h - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Lex/UnicodeCharSets.h stable/9/contrib/llvm/tools/clang/lib/Parse/ParseOpenMP.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/Parse/ParseOpenMP.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaOpenMP.cpp - copied, changed from r249423, head/contrib/llvm/tools/clang/lib/Sema/SemaOpenMP.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/GlobalModuleIndex.cpp - copied, changed from r249423, head/contrib/llvm/tools/clang/lib/Serialization/GlobalModuleIndex.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp - copied unchanged from r251662, head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.h - copied unchanged from r251662, head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AllocationDiagnostics.h stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp - copied unchanged from r249423, head/contrib/llvm/tools/clang/utils/TableGen/ClangCommentHTMLNamedCharacterReferenceEmitter.cpp stable/9/contrib/llvm/tools/llvm-objdump/COFFDump.cpp - copied unchanged from r249423, head/contrib/llvm/tools/llvm-objdump/COFFDump.cpp stable/9/contrib/llvm/tools/llvm-objdump/ELFDump.cpp - copied unchanged from r249423, head/contrib/llvm/tools/llvm-objdump/ELFDump.cpp stable/9/contrib/llvm/tools/llvm-readobj/COFFDumper.cpp - copied, changed from r249423, head/contrib/llvm/tools/llvm-readobj/COFFDumper.cpp stable/9/contrib/llvm/tools/llvm-readobj/ELFDumper.cpp - copied, changed from r249423, head/contrib/llvm/tools/llvm-readobj/ELFDumper.cpp stable/9/contrib/llvm/tools/llvm-readobj/Error.cpp - copied unchanged from r249423, head/contrib/llvm/tools/llvm-readobj/Error.cpp stable/9/contrib/llvm/tools/llvm-readobj/Error.h - copied unchanged from r249423, head/contrib/llvm/tools/llvm-readobj/Error.h stable/9/contrib/llvm/tools/llvm-readobj/MachODumper.cpp - copied, changed from r249423, head/contrib/llvm/tools/llvm-readobj/MachODumper.cpp stable/9/contrib/llvm/tools/llvm-readobj/ObjDumper.cpp - copied unchanged from r249423, head/contrib/llvm/tools/llvm-readobj/ObjDumper.cpp stable/9/contrib/llvm/tools/llvm-readobj/ObjDumper.h - copied, changed from r249423, head/contrib/llvm/tools/llvm-readobj/ObjDumper.h stable/9/contrib/llvm/tools/llvm-readobj/StreamWriter.cpp - copied unchanged from r249423, head/contrib/llvm/tools/llvm-readobj/StreamWriter.cpp stable/9/contrib/llvm/tools/llvm-readobj/StreamWriter.h - copied unchanged from r249423, head/contrib/llvm/tools/llvm-readobj/StreamWriter.h stable/9/contrib/llvm/tools/llvm-readobj/llvm-readobj.h - copied, changed from r249423, head/contrib/llvm/tools/llvm-readobj/llvm-readobj.h stable/9/contrib/llvm/tools/llvm-symbolizer/ - copied from r249423, head/contrib/llvm/tools/llvm-symbolizer/ stable/9/contrib/llvm/utils/TableGen/CTagsEmitter.cpp - copied unchanged from r249423, head/contrib/llvm/utils/TableGen/CTagsEmitter.cpp stable/9/contrib/llvm/utils/TableGen/OptParserEmitter.cpp - copied unchanged from r249423, head/contrib/llvm/utils/TableGen/OptParserEmitter.cpp stable/9/lib/clang/include/clang/AST/AttrDump.inc - copied unchanged from r249423, head/lib/clang/include/clang/AST/AttrDump.inc stable/9/lib/clang/include/clang/AST/CommentCommandList.inc - copied unchanged from r249423, head/lib/clang/include/clang/AST/CommentCommandList.inc stable/9/lib/clang/include/clang/AST/CommentHTMLNamedCharacterReferences.inc - copied unchanged from r249423, head/lib/clang/include/clang/AST/CommentHTMLNamedCharacterReferences.inc stable/9/lib/clang/include/clang/Parse/AttrExprArgs.inc - copied unchanged from r251662, head/lib/clang/include/clang/Parse/AttrExprArgs.inc stable/9/lib/clang/include/clang/Sema/AttrSpellingListIndex.inc - copied unchanged from r249423, head/lib/clang/include/clang/Sema/AttrSpellingListIndex.inc stable/9/lib/clang/include/llvm/IR/ - copied from r249423, head/lib/clang/include/llvm/IR/ stable/9/lib/clang/libllvmirreader/ - copied from r249423, head/lib/clang/libllvmirreader/ stable/9/lib/clang/libllvmobjcarcopts/ - copied from r249423, head/lib/clang/libllvmobjcarcopts/ Deleted: stable/9/contrib/llvm/include/llvm-c/EnhancedDisassembly.h stable/9/contrib/llvm/include/llvm/ADT/InMemoryStruct.h stable/9/contrib/llvm/include/llvm/AddressingMode.h stable/9/contrib/llvm/include/llvm/Argument.h stable/9/contrib/llvm/include/llvm/Attributes.h stable/9/contrib/llvm/include/llvm/BasicBlock.h stable/9/contrib/llvm/include/llvm/CallGraphSCCPass.h stable/9/contrib/llvm/include/llvm/CallingConv.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineLoopRanges.h stable/9/contrib/llvm/include/llvm/CodeGen/ScheduleDAGILP.h stable/9/contrib/llvm/include/llvm/Constant.h stable/9/contrib/llvm/include/llvm/Constants.h stable/9/contrib/llvm/include/llvm/DataLayout.h stable/9/contrib/llvm/include/llvm/DefaultPasses.h stable/9/contrib/llvm/include/llvm/DerivedTypes.h stable/9/contrib/llvm/include/llvm/Function.h stable/9/contrib/llvm/include/llvm/GlobalAlias.h stable/9/contrib/llvm/include/llvm/GlobalValue.h stable/9/contrib/llvm/include/llvm/GlobalVariable.h stable/9/contrib/llvm/include/llvm/IRBuilder.h stable/9/contrib/llvm/include/llvm/InlineAsm.h stable/9/contrib/llvm/include/llvm/InstrTypes.h stable/9/contrib/llvm/include/llvm/Instruction.def stable/9/contrib/llvm/include/llvm/Instruction.h stable/9/contrib/llvm/include/llvm/Instructions.h stable/9/contrib/llvm/include/llvm/IntrinsicInst.h stable/9/contrib/llvm/include/llvm/Intrinsics.h stable/9/contrib/llvm/include/llvm/Intrinsics.td stable/9/contrib/llvm/include/llvm/IntrinsicsARM.td stable/9/contrib/llvm/include/llvm/IntrinsicsCellSPU.td stable/9/contrib/llvm/include/llvm/IntrinsicsHexagon.td stable/9/contrib/llvm/include/llvm/IntrinsicsMips.td stable/9/contrib/llvm/include/llvm/IntrinsicsNVVM.td stable/9/contrib/llvm/include/llvm/IntrinsicsPowerPC.td stable/9/contrib/llvm/include/llvm/IntrinsicsX86.td stable/9/contrib/llvm/include/llvm/IntrinsicsXCore.td stable/9/contrib/llvm/include/llvm/LLVMContext.h stable/9/contrib/llvm/include/llvm/LinkAllVMCore.h stable/9/contrib/llvm/include/llvm/MC/EDInstInfo.h stable/9/contrib/llvm/include/llvm/MC/MCTargetAsmLexer.h stable/9/contrib/llvm/include/llvm/MDBuilder.h stable/9/contrib/llvm/include/llvm/Metadata.h stable/9/contrib/llvm/include/llvm/Module.h stable/9/contrib/llvm/include/llvm/Object/MachOObject.h stable/9/contrib/llvm/include/llvm/OperandTraits.h stable/9/contrib/llvm/include/llvm/Operator.h stable/9/contrib/llvm/include/llvm/Support/IRReader.h stable/9/contrib/llvm/include/llvm/Support/InstVisitor.h stable/9/contrib/llvm/include/llvm/SymbolTableListTraits.h stable/9/contrib/llvm/include/llvm/Target/TargetTransformImpl.h stable/9/contrib/llvm/include/llvm/TargetTransformInfo.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/AddrModeMatcher.h stable/9/contrib/llvm/include/llvm/Type.h stable/9/contrib/llvm/include/llvm/TypeBuilder.h stable/9/contrib/llvm/include/llvm/TypeFinder.h stable/9/contrib/llvm/include/llvm/Use.h stable/9/contrib/llvm/include/llvm/User.h stable/9/contrib/llvm/include/llvm/Value.h stable/9/contrib/llvm/include/llvm/ValueSymbolTable.h stable/9/contrib/llvm/lib/Analysis/DbgInfoPrinter.cpp stable/9/contrib/llvm/lib/Analysis/InlineCost.cpp stable/9/contrib/llvm/lib/CodeGen/CodePlacementOpt.cpp stable/9/contrib/llvm/lib/CodeGen/LiveIntervalUnion.h stable/9/contrib/llvm/lib/CodeGen/LiveRegMatrix.h stable/9/contrib/llvm/lib/CodeGen/MachineLoopRanges.cpp stable/9/contrib/llvm/lib/CodeGen/MachineTraceMetrics.h stable/9/contrib/llvm/lib/CodeGen/TargetInstrInfoImpl.cpp stable/9/contrib/llvm/lib/CodeGen/VirtRegMap.h stable/9/contrib/llvm/lib/DebugInfo/DWARFFormValue.h stable/9/contrib/llvm/lib/Linker/LinkArchives.cpp stable/9/contrib/llvm/lib/Linker/LinkItems.cpp stable/9/contrib/llvm/lib/Linker/Linker.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/EDDisassembler.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/EDDisassembler.h stable/9/contrib/llvm/lib/MC/MCDisassembler/EDInfo.h stable/9/contrib/llvm/lib/MC/MCDisassembler/EDInst.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/EDInst.h stable/9/contrib/llvm/lib/MC/MCDisassembler/EDMain.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/EDOperand.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/EDOperand.h stable/9/contrib/llvm/lib/MC/MCDisassembler/EDToken.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/EDToken.h stable/9/contrib/llvm/lib/MC/MCELF.h stable/9/contrib/llvm/lib/MC/MCTargetAsmLexer.cpp stable/9/contrib/llvm/lib/Object/MachOObject.cpp stable/9/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmLexer.cpp stable/9/contrib/llvm/lib/Target/CellSPU/ stable/9/contrib/llvm/lib/Target/Hexagon/HexagonImmediates.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonMCInst.h stable/9/contrib/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmLexer.cpp stable/9/contrib/llvm/lib/Target/NVPTX/InstPrinter/Makefile stable/9/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/Makefile stable/9/contrib/llvm/lib/Target/NVPTX/Makefile stable/9/contrib/llvm/lib/Target/NVPTX/TargetInfo/Makefile stable/9/contrib/llvm/lib/Target/NVPTX/VectorElementize.cpp stable/9/contrib/llvm/lib/Target/NVPTX/gen-register-defs.py stable/9/contrib/llvm/lib/Target/PTX/ stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCBaseInfo.h stable/9/contrib/llvm/lib/Target/R600/AMDILPeepholeOptimizer.cpp stable/9/contrib/llvm/lib/Target/TargetInstrInfo.cpp stable/9/contrib/llvm/lib/Target/TargetRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/TargetTransformImpl.cpp stable/9/contrib/llvm/lib/Target/X86/AsmParser/X86AsmLexer.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/BlackList.h stable/9/contrib/llvm/lib/Transforms/Scalar/ObjCARC.cpp stable/9/contrib/llvm/lib/Transforms/Utils/AddrModeMatcher.cpp stable/9/contrib/llvm/lib/VMCore/ stable/9/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTTypeTraits.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/ConvertUTF.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/PPMutationListener.h stable/9/contrib/llvm/tools/clang/lib/AST/CommentDumper.cpp stable/9/contrib/llvm/tools/clang/lib/AST/StmtDumper.cpp stable/9/contrib/llvm/tools/clang/lib/ASTMatchers/Makefile stable/9/contrib/llvm/tools/clang/lib/Basic/ConvertUTF.c stable/9/contrib/llvm/tools/clang/lib/Basic/ConvertUTFWrapper.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/MacroArgs.h stable/9/contrib/llvm/tools/clang/lib/Rewrite/Core/CMakeLists.txt stable/9/contrib/llvm/tools/clang/lib/Rewrite/Core/Makefile stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/CMakeLists.txt stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/Makefile stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AttrNonNullChecker.cpp stable/9/contrib/llvm/utils/TableGen/EDEmitter.cpp stable/9/lib/clang/include/ARMGenEDInfo.inc stable/9/lib/clang/include/MipsGenEDInfo.inc stable/9/lib/clang/include/X86GenEDInfo.inc stable/9/lib/clang/include/llvm/Intrinsics.gen Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/ObsoleteFiles.inc (contents, props changed) stable/9/contrib/gcc/unwind-dw2.c stable/9/contrib/llvm/LICENSE.TXT stable/9/contrib/llvm/include/llvm-c/Core.h stable/9/contrib/llvm/include/llvm-c/Disassembler.h stable/9/contrib/llvm/include/llvm-c/ExecutionEngine.h stable/9/contrib/llvm/include/llvm-c/Initialization.h stable/9/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h stable/9/contrib/llvm/include/llvm-c/Object.h stable/9/contrib/llvm/include/llvm-c/Target.h stable/9/contrib/llvm/include/llvm-c/TargetMachine.h stable/9/contrib/llvm/include/llvm-c/Transforms/PassManagerBuilder.h stable/9/contrib/llvm/include/llvm-c/Transforms/Vectorize.h stable/9/contrib/llvm/include/llvm-c/lto.h stable/9/contrib/llvm/include/llvm/ADT/APFloat.h stable/9/contrib/llvm/include/llvm/ADT/APInt.h stable/9/contrib/llvm/include/llvm/ADT/APSInt.h stable/9/contrib/llvm/include/llvm/ADT/ArrayRef.h stable/9/contrib/llvm/include/llvm/ADT/BitVector.h stable/9/contrib/llvm/include/llvm/ADT/DAGDeltaAlgorithm.h stable/9/contrib/llvm/include/llvm/ADT/DeltaAlgorithm.h stable/9/contrib/llvm/include/llvm/ADT/DenseMap.h stable/9/contrib/llvm/include/llvm/ADT/DenseSet.h stable/9/contrib/llvm/include/llvm/ADT/DepthFirstIterator.h stable/9/contrib/llvm/include/llvm/ADT/FoldingSet.h stable/9/contrib/llvm/include/llvm/ADT/Hashing.h stable/9/contrib/llvm/include/llvm/ADT/ImmutableIntervalMap.h stable/9/contrib/llvm/include/llvm/ADT/ImmutableList.h stable/9/contrib/llvm/include/llvm/ADT/ImmutableMap.h stable/9/contrib/llvm/include/llvm/ADT/ImmutableSet.h stable/9/contrib/llvm/include/llvm/ADT/IntervalMap.h stable/9/contrib/llvm/include/llvm/ADT/IntrusiveRefCntPtr.h stable/9/contrib/llvm/include/llvm/ADT/MapVector.h stable/9/contrib/llvm/include/llvm/ADT/NullablePtr.h stable/9/contrib/llvm/include/llvm/ADT/Optional.h stable/9/contrib/llvm/include/llvm/ADT/OwningPtr.h stable/9/contrib/llvm/include/llvm/ADT/PointerIntPair.h stable/9/contrib/llvm/include/llvm/ADT/PointerUnion.h stable/9/contrib/llvm/include/llvm/ADT/PostOrderIterator.h stable/9/contrib/llvm/include/llvm/ADT/PriorityQueue.h stable/9/contrib/llvm/include/llvm/ADT/SCCIterator.h stable/9/contrib/llvm/include/llvm/ADT/STLExtras.h stable/9/contrib/llvm/include/llvm/ADT/SmallBitVector.h stable/9/contrib/llvm/include/llvm/ADT/SmallPtrSet.h stable/9/contrib/llvm/include/llvm/ADT/SmallSet.h stable/9/contrib/llvm/include/llvm/ADT/SmallString.h stable/9/contrib/llvm/include/llvm/ADT/SmallVector.h stable/9/contrib/llvm/include/llvm/ADT/SparseSet.h stable/9/contrib/llvm/include/llvm/ADT/Statistic.h stable/9/contrib/llvm/include/llvm/ADT/StringExtras.h stable/9/contrib/llvm/include/llvm/ADT/StringMap.h stable/9/contrib/llvm/include/llvm/ADT/StringRef.h stable/9/contrib/llvm/include/llvm/ADT/StringSet.h stable/9/contrib/llvm/include/llvm/ADT/TinyPtrVector.h stable/9/contrib/llvm/include/llvm/ADT/Triple.h stable/9/contrib/llvm/include/llvm/ADT/Twine.h stable/9/contrib/llvm/include/llvm/ADT/ValueMap.h stable/9/contrib/llvm/include/llvm/ADT/VariadicFunction.h stable/9/contrib/llvm/include/llvm/ADT/ilist.h stable/9/contrib/llvm/include/llvm/ADT/ilist_node.h stable/9/contrib/llvm/include/llvm/Analysis/AliasAnalysis.h stable/9/contrib/llvm/include/llvm/Analysis/AliasSetTracker.h stable/9/contrib/llvm/include/llvm/Analysis/BlockFrequencyImpl.h stable/9/contrib/llvm/include/llvm/Analysis/BranchProbabilityInfo.h stable/9/contrib/llvm/include/llvm/Analysis/CFGPrinter.h stable/9/contrib/llvm/include/llvm/Analysis/CallGraph.h stable/9/contrib/llvm/include/llvm/Analysis/CaptureTracking.h stable/9/contrib/llvm/include/llvm/Analysis/CodeMetrics.h stable/9/contrib/llvm/include/llvm/Analysis/DOTGraphTraitsPass.h stable/9/contrib/llvm/include/llvm/Analysis/DependenceAnalysis.h stable/9/contrib/llvm/include/llvm/Analysis/DominatorInternals.h stable/9/contrib/llvm/include/llvm/Analysis/Dominators.h stable/9/contrib/llvm/include/llvm/Analysis/IVUsers.h stable/9/contrib/llvm/include/llvm/Analysis/InlineCost.h stable/9/contrib/llvm/include/llvm/Analysis/InstructionSimplify.h stable/9/contrib/llvm/include/llvm/Analysis/Interval.h stable/9/contrib/llvm/include/llvm/Analysis/IntervalIterator.h stable/9/contrib/llvm/include/llvm/Analysis/IntervalPartition.h stable/9/contrib/llvm/include/llvm/Analysis/LibCallAliasAnalysis.h stable/9/contrib/llvm/include/llvm/Analysis/Loads.h stable/9/contrib/llvm/include/llvm/Analysis/LoopInfo.h stable/9/contrib/llvm/include/llvm/Analysis/LoopInfoImpl.h stable/9/contrib/llvm/include/llvm/Analysis/LoopIterator.h stable/9/contrib/llvm/include/llvm/Analysis/LoopPass.h stable/9/contrib/llvm/include/llvm/Analysis/MemoryBuiltins.h stable/9/contrib/llvm/include/llvm/Analysis/MemoryDependenceAnalysis.h stable/9/contrib/llvm/include/llvm/Analysis/PHITransAddr.h stable/9/contrib/llvm/include/llvm/Analysis/Passes.h stable/9/contrib/llvm/include/llvm/Analysis/PathNumbering.h stable/9/contrib/llvm/include/llvm/Analysis/PathProfileInfo.h stable/9/contrib/llvm/include/llvm/Analysis/PostDominators.h stable/9/contrib/llvm/include/llvm/Analysis/ProfileDataLoader.h stable/9/contrib/llvm/include/llvm/Analysis/ProfileInfo.h stable/9/contrib/llvm/include/llvm/Analysis/ProfileInfoLoader.h stable/9/contrib/llvm/include/llvm/Analysis/RegionInfo.h stable/9/contrib/llvm/include/llvm/Analysis/RegionIterator.h stable/9/contrib/llvm/include/llvm/Analysis/RegionPass.h stable/9/contrib/llvm/include/llvm/Analysis/ScalarEvolution.h stable/9/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h stable/9/contrib/llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h stable/9/contrib/llvm/include/llvm/Analysis/ScalarEvolutionNormalization.h stable/9/contrib/llvm/include/llvm/Analysis/SparsePropagation.h stable/9/contrib/llvm/include/llvm/Analysis/Trace.h stable/9/contrib/llvm/include/llvm/Analysis/ValueTracking.h stable/9/contrib/llvm/include/llvm/Assembly/PrintModulePass.h stable/9/contrib/llvm/include/llvm/Bitcode/Archive.h stable/9/contrib/llvm/include/llvm/Bitcode/BitCodes.h stable/9/contrib/llvm/include/llvm/Bitcode/BitstreamReader.h stable/9/contrib/llvm/include/llvm/Bitcode/BitstreamWriter.h stable/9/contrib/llvm/include/llvm/Bitcode/LLVMBitCodes.h stable/9/contrib/llvm/include/llvm/Bitcode/ReaderWriter.h stable/9/contrib/llvm/include/llvm/CodeGen/Analysis.h stable/9/contrib/llvm/include/llvm/CodeGen/AsmPrinter.h stable/9/contrib/llvm/include/llvm/CodeGen/CalcSpillWeights.h stable/9/contrib/llvm/include/llvm/CodeGen/CallingConvLower.h stable/9/contrib/llvm/include/llvm/CodeGen/CommandFlags.h stable/9/contrib/llvm/include/llvm/CodeGen/DFAPacketizer.h stable/9/contrib/llvm/include/llvm/CodeGen/FastISel.h stable/9/contrib/llvm/include/llvm/CodeGen/FunctionLoweringInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/GCMetadata.h stable/9/contrib/llvm/include/llvm/CodeGen/GCs.h stable/9/contrib/llvm/include/llvm/CodeGen/ISDOpcodes.h stable/9/contrib/llvm/include/llvm/CodeGen/IntrinsicLowering.h stable/9/contrib/llvm/include/llvm/CodeGen/JITCodeEmitter.h stable/9/contrib/llvm/include/llvm/CodeGen/LatencyPriorityQueue.h stable/9/contrib/llvm/include/llvm/CodeGen/LexicalScopes.h stable/9/contrib/llvm/include/llvm/CodeGen/LinkAllAsmWriterComponents.h stable/9/contrib/llvm/include/llvm/CodeGen/LinkAllCodegenComponents.h stable/9/contrib/llvm/include/llvm/CodeGen/LiveInterval.h stable/9/contrib/llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h stable/9/contrib/llvm/include/llvm/CodeGen/LiveRangeEdit.h stable/9/contrib/llvm/include/llvm/CodeGen/LiveStackAnalysis.h stable/9/contrib/llvm/include/llvm/CodeGen/LiveVariables.h stable/9/contrib/llvm/include/llvm/CodeGen/MachORelocation.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineBasicBlock.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineBranchProbabilityInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineCodeEmitter.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineCodeInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineDominators.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineFrameInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineFunction.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineFunctionAnalysis.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineFunctionPass.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineInstr.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineInstrBuilder.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineInstrBundle.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineJumpTableInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineLoopInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineMemOperand.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineModuleInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineOperand.h stable/9/contrib/llvm/include/llvm/CodeGen/MachinePostDominators.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineRegisterInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/MachineScheduler.h stable/9/contrib/llvm/include/llvm/CodeGen/PBQP/Graph.h stable/9/contrib/llvm/include/llvm/CodeGen/PBQP/HeuristicSolver.h stable/9/contrib/llvm/include/llvm/CodeGen/PBQP/Heuristics/Briggs.h stable/9/contrib/llvm/include/llvm/CodeGen/PBQP/Math.h stable/9/contrib/llvm/include/llvm/CodeGen/PBQP/Solution.h stable/9/contrib/llvm/include/llvm/CodeGen/Passes.h stable/9/contrib/llvm/include/llvm/CodeGen/PseudoSourceValue.h stable/9/contrib/llvm/include/llvm/CodeGen/RegAllocPBQP.h stable/9/contrib/llvm/include/llvm/CodeGen/RegAllocRegistry.h stable/9/contrib/llvm/include/llvm/CodeGen/RegisterClassInfo.h stable/9/contrib/llvm/include/llvm/CodeGen/RegisterPressure.h stable/9/contrib/llvm/include/llvm/CodeGen/RegisterScavenging.h stable/9/contrib/llvm/include/llvm/CodeGen/ResourcePriorityQueue.h stable/9/contrib/llvm/include/llvm/CodeGen/RuntimeLibcalls.h stable/9/contrib/llvm/include/llvm/CodeGen/ScheduleDAG.h stable/9/contrib/llvm/include/llvm/CodeGen/ScheduleDAGInstrs.h stable/9/contrib/llvm/include/llvm/CodeGen/SchedulerRegistry.h stable/9/contrib/llvm/include/llvm/CodeGen/ScoreboardHazardRecognizer.h stable/9/contrib/llvm/include/llvm/CodeGen/SelectionDAG.h stable/9/contrib/llvm/include/llvm/CodeGen/SelectionDAGISel.h stable/9/contrib/llvm/include/llvm/CodeGen/SelectionDAGNodes.h stable/9/contrib/llvm/include/llvm/CodeGen/SlotIndexes.h stable/9/contrib/llvm/include/llvm/CodeGen/TargetLoweringObjectFileImpl.h stable/9/contrib/llvm/include/llvm/CodeGen/TargetSchedule.h stable/9/contrib/llvm/include/llvm/CodeGen/ValueTypes.h stable/9/contrib/llvm/include/llvm/CodeGen/ValueTypes.td stable/9/contrib/llvm/include/llvm/DIBuilder.h stable/9/contrib/llvm/include/llvm/DebugInfo.h stable/9/contrib/llvm/include/llvm/DebugInfo/DIContext.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/ExecutionEngine.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/GenericValue.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/Interpreter.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/JIT.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/JITEventListener.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/JITMemoryManager.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/MCJIT.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/OProfileWrapper.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/ObjectBuffer.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/ObjectImage.h stable/9/contrib/llvm/include/llvm/ExecutionEngine/RuntimeDyld.h stable/9/contrib/llvm/include/llvm/GVMaterializer.h stable/9/contrib/llvm/include/llvm/IR/Argument.h stable/9/contrib/llvm/include/llvm/IR/Attributes.h stable/9/contrib/llvm/include/llvm/IR/BasicBlock.h stable/9/contrib/llvm/include/llvm/IR/Constants.h stable/9/contrib/llvm/include/llvm/IR/DataLayout.h stable/9/contrib/llvm/include/llvm/IR/DerivedTypes.h stable/9/contrib/llvm/include/llvm/IR/GlobalValue.h stable/9/contrib/llvm/include/llvm/IR/IRBuilder.h stable/9/contrib/llvm/include/llvm/IR/Intrinsics.h stable/9/contrib/llvm/include/llvm/IR/IntrinsicsMips.td stable/9/contrib/llvm/include/llvm/IR/IntrinsicsNVVM.td stable/9/contrib/llvm/include/llvm/IR/IntrinsicsPowerPC.td stable/9/contrib/llvm/include/llvm/IR/LLVMContext.h stable/9/contrib/llvm/include/llvm/IR/MDBuilder.h stable/9/contrib/llvm/include/llvm/IR/Module.h stable/9/contrib/llvm/include/llvm/IR/Type.h stable/9/contrib/llvm/include/llvm/IR/Use.h stable/9/contrib/llvm/include/llvm/IR/Value.h stable/9/contrib/llvm/include/llvm/InitializePasses.h stable/9/contrib/llvm/include/llvm/LinkAllPasses.h stable/9/contrib/llvm/include/llvm/Linker.h stable/9/contrib/llvm/include/llvm/MC/MCAsmBackend.h stable/9/contrib/llvm/include/llvm/MC/MCAsmInfo.h stable/9/contrib/llvm/include/llvm/MC/MCAsmInfoCOFF.h stable/9/contrib/llvm/include/llvm/MC/MCAsmInfoDarwin.h stable/9/contrib/llvm/include/llvm/MC/MCAsmLayout.h stable/9/contrib/llvm/include/llvm/MC/MCAssembler.h stable/9/contrib/llvm/include/llvm/MC/MCAtom.h stable/9/contrib/llvm/include/llvm/MC/MCCodeEmitter.h stable/9/contrib/llvm/include/llvm/MC/MCContext.h stable/9/contrib/llvm/include/llvm/MC/MCDisassembler.h stable/9/contrib/llvm/include/llvm/MC/MCDwarf.h stable/9/contrib/llvm/include/llvm/MC/MCELFObjectWriter.h stable/9/contrib/llvm/include/llvm/MC/MCExpr.h stable/9/contrib/llvm/include/llvm/MC/MCFixedLenDisassembler.h stable/9/contrib/llvm/include/llvm/MC/MCInst.h stable/9/contrib/llvm/include/llvm/MC/MCInstPrinter.h stable/9/contrib/llvm/include/llvm/MC/MCInstrDesc.h stable/9/contrib/llvm/include/llvm/MC/MCMachObjectWriter.h stable/9/contrib/llvm/include/llvm/MC/MCObjectFileInfo.h stable/9/contrib/llvm/include/llvm/MC/MCObjectStreamer.h stable/9/contrib/llvm/include/llvm/MC/MCObjectWriter.h stable/9/contrib/llvm/include/llvm/MC/MCParser/AsmCond.h stable/9/contrib/llvm/include/llvm/MC/MCParser/AsmLexer.h stable/9/contrib/llvm/include/llvm/MC/MCParser/MCAsmLexer.h stable/9/contrib/llvm/include/llvm/MC/MCParser/MCAsmParser.h stable/9/contrib/llvm/include/llvm/MC/MCParser/MCAsmParserExtension.h stable/9/contrib/llvm/include/llvm/MC/MCParser/MCParsedAsmOperand.h stable/9/contrib/llvm/include/llvm/MC/MCRegisterInfo.h stable/9/contrib/llvm/include/llvm/MC/MCSchedule.h stable/9/contrib/llvm/include/llvm/MC/MCSection.h stable/9/contrib/llvm/include/llvm/MC/MCSectionCOFF.h stable/9/contrib/llvm/include/llvm/MC/MCSectionELF.h stable/9/contrib/llvm/include/llvm/MC/MCSectionMachO.h stable/9/contrib/llvm/include/llvm/MC/MCStreamer.h stable/9/contrib/llvm/include/llvm/MC/MCSubtargetInfo.h stable/9/contrib/llvm/include/llvm/MC/MCTargetAsmParser.h stable/9/contrib/llvm/include/llvm/MC/MCValue.h stable/9/contrib/llvm/include/llvm/MC/MCWinCOFFObjectWriter.h stable/9/contrib/llvm/include/llvm/MC/MachineLocation.h stable/9/contrib/llvm/include/llvm/MC/SubtargetFeature.h stable/9/contrib/llvm/include/llvm/Object/Archive.h stable/9/contrib/llvm/include/llvm/Object/Binary.h stable/9/contrib/llvm/include/llvm/Object/ELF.h stable/9/contrib/llvm/include/llvm/Object/MachO.h stable/9/contrib/llvm/include/llvm/Object/MachOFormat.h stable/9/contrib/llvm/include/llvm/Object/ObjectFile.h stable/9/contrib/llvm/include/llvm/Object/RelocVisitor.h stable/9/contrib/llvm/include/llvm/Pass.h stable/9/contrib/llvm/include/llvm/PassAnalysisSupport.h stable/9/contrib/llvm/include/llvm/PassManager.h stable/9/contrib/llvm/include/llvm/PassManagers.h stable/9/contrib/llvm/include/llvm/PassRegistry.h stable/9/contrib/llvm/include/llvm/PassSupport.h stable/9/contrib/llvm/include/llvm/Support/AlignOf.h stable/9/contrib/llvm/include/llvm/Support/Allocator.h stable/9/contrib/llvm/include/llvm/Support/Atomic.h stable/9/contrib/llvm/include/llvm/Support/CFG.h stable/9/contrib/llvm/include/llvm/Support/COFF.h stable/9/contrib/llvm/include/llvm/Support/CallSite.h stable/9/contrib/llvm/include/llvm/Support/Casting.h stable/9/contrib/llvm/include/llvm/Support/CodeGen.h stable/9/contrib/llvm/include/llvm/Support/CommandLine.h stable/9/contrib/llvm/include/llvm/Support/Compiler.h stable/9/contrib/llvm/include/llvm/Support/ConstantFolder.h stable/9/contrib/llvm/include/llvm/Support/ConstantRange.h stable/9/contrib/llvm/include/llvm/Support/DOTGraphTraits.h stable/9/contrib/llvm/include/llvm/Support/DataExtractor.h stable/9/contrib/llvm/include/llvm/Support/DataFlow.h stable/9/contrib/llvm/include/llvm/Support/DataStream.h stable/9/contrib/llvm/include/llvm/Support/DebugLoc.h stable/9/contrib/llvm/include/llvm/Support/Dwarf.h stable/9/contrib/llvm/include/llvm/Support/DynamicLibrary.h stable/9/contrib/llvm/include/llvm/Support/ELF.h stable/9/contrib/llvm/include/llvm/Support/Endian.h stable/9/contrib/llvm/include/llvm/Support/Errno.h stable/9/contrib/llvm/include/llvm/Support/ErrorHandling.h stable/9/contrib/llvm/include/llvm/Support/FEnv.h stable/9/contrib/llvm/include/llvm/Support/FileOutputBuffer.h stable/9/contrib/llvm/include/llvm/Support/FileSystem.h stable/9/contrib/llvm/include/llvm/Support/FormattedStream.h stable/9/contrib/llvm/include/llvm/Support/GCOV.h stable/9/contrib/llvm/include/llvm/Support/GetElementPtrTypeIterator.h stable/9/contrib/llvm/include/llvm/Support/GraphWriter.h stable/9/contrib/llvm/include/llvm/Support/Host.h stable/9/contrib/llvm/include/llvm/Support/IncludeFile.h stable/9/contrib/llvm/include/llvm/Support/InstIterator.h stable/9/contrib/llvm/include/llvm/Support/IntegersSubset.h stable/9/contrib/llvm/include/llvm/Support/IntegersSubsetMapping.h stable/9/contrib/llvm/include/llvm/Support/LEB128.h stable/9/contrib/llvm/include/llvm/Support/Locale.h stable/9/contrib/llvm/include/llvm/Support/LockFileManager.h stable/9/contrib/llvm/include/llvm/Support/MathExtras.h stable/9/contrib/llvm/include/llvm/Support/Memory.h stable/9/contrib/llvm/include/llvm/Support/MemoryBuffer.h stable/9/contrib/llvm/include/llvm/Support/MemoryObject.h stable/9/contrib/llvm/include/llvm/Support/Mutex.h stable/9/contrib/llvm/include/llvm/Support/NoFolder.h stable/9/contrib/llvm/include/llvm/Support/PassNameParser.h stable/9/contrib/llvm/include/llvm/Support/PathV1.h stable/9/contrib/llvm/include/llvm/Support/PatternMatch.h stable/9/contrib/llvm/include/llvm/Support/PredIteratorCache.h stable/9/contrib/llvm/include/llvm/Support/Process.h stable/9/contrib/llvm/include/llvm/Support/Program.h stable/9/contrib/llvm/include/llvm/Support/Recycler.h stable/9/contrib/llvm/include/llvm/Support/Regex.h stable/9/contrib/llvm/include/llvm/Support/RegistryParser.h stable/9/contrib/llvm/include/llvm/Support/SMLoc.h stable/9/contrib/llvm/include/llvm/Support/SaveAndRestore.h stable/9/contrib/llvm/include/llvm/Support/Signals.h stable/9/contrib/llvm/include/llvm/Support/Solaris.h stable/9/contrib/llvm/include/llvm/Support/SourceMgr.h stable/9/contrib/llvm/include/llvm/Support/StreamableMemoryObject.h stable/9/contrib/llvm/include/llvm/Support/StringPool.h stable/9/contrib/llvm/include/llvm/Support/SwapByteOrder.h stable/9/contrib/llvm/include/llvm/Support/TargetFolder.h stable/9/contrib/llvm/include/llvm/Support/TargetRegistry.h stable/9/contrib/llvm/include/llvm/Support/ThreadLocal.h stable/9/contrib/llvm/include/llvm/Support/Threading.h stable/9/contrib/llvm/include/llvm/Support/TimeValue.h stable/9/contrib/llvm/include/llvm/Support/Timer.h stable/9/contrib/llvm/include/llvm/Support/ToolOutputFile.h stable/9/contrib/llvm/include/llvm/Support/Valgrind.h stable/9/contrib/llvm/include/llvm/Support/ValueHandle.h stable/9/contrib/llvm/include/llvm/Support/Win64EH.h stable/9/contrib/llvm/include/llvm/Support/YAMLParser.h stable/9/contrib/llvm/include/llvm/Support/circular_raw_ostream.h stable/9/contrib/llvm/include/llvm/Support/raw_ostream.h stable/9/contrib/llvm/include/llvm/Support/system_error.h stable/9/contrib/llvm/include/llvm/Support/type_traits.h stable/9/contrib/llvm/include/llvm/TableGen/Error.h stable/9/contrib/llvm/include/llvm/TableGen/Record.h stable/9/contrib/llvm/include/llvm/TableGen/StringMatcher.h stable/9/contrib/llvm/include/llvm/Target/Mangler.h stable/9/contrib/llvm/include/llvm/Target/Target.td stable/9/contrib/llvm/include/llvm/Target/TargetCallingConv.h stable/9/contrib/llvm/include/llvm/Target/TargetFrameLowering.h stable/9/contrib/llvm/include/llvm/Target/TargetInstrInfo.h stable/9/contrib/llvm/include/llvm/Target/TargetJITInfo.h stable/9/contrib/llvm/include/llvm/Target/TargetLibraryInfo.h stable/9/contrib/llvm/include/llvm/Target/TargetLowering.h stable/9/contrib/llvm/include/llvm/Target/TargetLoweringObjectFile.h stable/9/contrib/llvm/include/llvm/Target/TargetMachine.h stable/9/contrib/llvm/include/llvm/Target/TargetOptions.h stable/9/contrib/llvm/include/llvm/Target/TargetRegisterInfo.h stable/9/contrib/llvm/include/llvm/Target/TargetSchedule.td stable/9/contrib/llvm/include/llvm/Target/TargetSelectionDAG.td stable/9/contrib/llvm/include/llvm/Target/TargetSubtargetInfo.h stable/9/contrib/llvm/include/llvm/Transforms/IPO.h stable/9/contrib/llvm/include/llvm/Transforms/IPO/InlinerPass.h stable/9/contrib/llvm/include/llvm/Transforms/IPO/PassManagerBuilder.h stable/9/contrib/llvm/include/llvm/Transforms/Instrumentation.h stable/9/contrib/llvm/include/llvm/Transforms/Scalar.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/BasicBlockUtils.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/BuildLibCalls.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/BypassSlowDivision.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/Cloning.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/CmpInstAnalysis.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/IntegerDivision.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/Local.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/ModuleUtils.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/PromoteMemToReg.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/SSAUpdater.h stable/9/contrib/llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h stable/9/contrib/llvm/include/llvm/Transforms/Vectorize.h stable/9/contrib/llvm/lib/Analysis/AliasAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/AliasAnalysisCounter.cpp stable/9/contrib/llvm/lib/Analysis/AliasAnalysisEvaluator.cpp stable/9/contrib/llvm/lib/Analysis/AliasDebugger.cpp stable/9/contrib/llvm/lib/Analysis/AliasSetTracker.cpp stable/9/contrib/llvm/lib/Analysis/Analysis.cpp stable/9/contrib/llvm/lib/Analysis/BasicAliasAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/BlockFrequencyInfo.cpp stable/9/contrib/llvm/lib/Analysis/BranchProbabilityInfo.cpp stable/9/contrib/llvm/lib/Analysis/CFGPrinter.cpp stable/9/contrib/llvm/lib/Analysis/CaptureTracking.cpp stable/9/contrib/llvm/lib/Analysis/CodeMetrics.cpp stable/9/contrib/llvm/lib/Analysis/ConstantFolding.cpp stable/9/contrib/llvm/lib/Analysis/CostModel.cpp stable/9/contrib/llvm/lib/Analysis/DependenceAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/DominanceFrontier.cpp stable/9/contrib/llvm/lib/Analysis/IPA/CallGraph.cpp stable/9/contrib/llvm/lib/Analysis/IPA/CallGraphSCCPass.cpp stable/9/contrib/llvm/lib/Analysis/IPA/FindUsedTypes.cpp stable/9/contrib/llvm/lib/Analysis/IPA/GlobalsModRef.cpp stable/9/contrib/llvm/lib/Analysis/IPA/IPA.cpp stable/9/contrib/llvm/lib/Analysis/IVUsers.cpp stable/9/contrib/llvm/lib/Analysis/InstCount.cpp stable/9/contrib/llvm/lib/Analysis/InstructionSimplify.cpp stable/9/contrib/llvm/lib/Analysis/Interval.cpp stable/9/contrib/llvm/lib/Analysis/LazyValueInfo.cpp stable/9/contrib/llvm/lib/Analysis/LibCallAliasAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/LibCallSemantics.cpp stable/9/contrib/llvm/lib/Analysis/Lint.cpp stable/9/contrib/llvm/lib/Analysis/Loads.cpp stable/9/contrib/llvm/lib/Analysis/LoopInfo.cpp stable/9/contrib/llvm/lib/Analysis/MemDepPrinter.cpp stable/9/contrib/llvm/lib/Analysis/MemoryBuiltins.cpp stable/9/contrib/llvm/lib/Analysis/MemoryDependenceAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/ModuleDebugInfoPrinter.cpp stable/9/contrib/llvm/lib/Analysis/NoAliasAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/PHITransAddr.cpp stable/9/contrib/llvm/lib/Analysis/PathNumbering.cpp stable/9/contrib/llvm/lib/Analysis/PathProfileInfo.cpp stable/9/contrib/llvm/lib/Analysis/PathProfileVerifier.cpp stable/9/contrib/llvm/lib/Analysis/PostDominators.cpp stable/9/contrib/llvm/lib/Analysis/ProfileDataLoader.cpp stable/9/contrib/llvm/lib/Analysis/ProfileDataLoaderPass.cpp stable/9/contrib/llvm/lib/Analysis/ProfileEstimatorPass.cpp stable/9/contrib/llvm/lib/Analysis/ProfileInfo.cpp stable/9/contrib/llvm/lib/Analysis/ProfileInfoLoader.cpp stable/9/contrib/llvm/lib/Analysis/ProfileInfoLoaderPass.cpp stable/9/contrib/llvm/lib/Analysis/ProfileVerifierPass.cpp stable/9/contrib/llvm/lib/Analysis/RegionInfo.cpp stable/9/contrib/llvm/lib/Analysis/RegionPrinter.cpp stable/9/contrib/llvm/lib/Analysis/ScalarEvolution.cpp stable/9/contrib/llvm/lib/Analysis/ScalarEvolutionAliasAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp stable/9/contrib/llvm/lib/Analysis/SparsePropagation.cpp stable/9/contrib/llvm/lib/Analysis/Trace.cpp stable/9/contrib/llvm/lib/Analysis/TypeBasedAliasAnalysis.cpp stable/9/contrib/llvm/lib/Analysis/ValueTracking.cpp stable/9/contrib/llvm/lib/Archive/Archive.cpp stable/9/contrib/llvm/lib/Archive/ArchiveInternals.h stable/9/contrib/llvm/lib/Archive/ArchiveReader.cpp stable/9/contrib/llvm/lib/Archive/ArchiveWriter.cpp stable/9/contrib/llvm/lib/AsmParser/LLLexer.cpp stable/9/contrib/llvm/lib/AsmParser/LLLexer.h stable/9/contrib/llvm/lib/AsmParser/LLParser.cpp stable/9/contrib/llvm/lib/AsmParser/LLParser.h stable/9/contrib/llvm/lib/AsmParser/LLToken.h stable/9/contrib/llvm/lib/AsmParser/Parser.cpp stable/9/contrib/llvm/lib/Bitcode/Reader/BitReader.cpp stable/9/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.cpp stable/9/contrib/llvm/lib/Bitcode/Reader/BitcodeReader.h stable/9/contrib/llvm/lib/Bitcode/Writer/BitWriter.cpp stable/9/contrib/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp stable/9/contrib/llvm/lib/Bitcode/Writer/BitcodeWriterPass.cpp stable/9/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.cpp stable/9/contrib/llvm/lib/Bitcode/Writer/ValueEnumerator.h stable/9/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.cpp stable/9/contrib/llvm/lib/CodeGen/AggressiveAntiDepBreaker.h stable/9/contrib/llvm/lib/CodeGen/AllocationOrder.cpp stable/9/contrib/llvm/lib/CodeGen/AllocationOrder.h stable/9/contrib/llvm/lib/CodeGen/Analysis.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterDwarf.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DIE.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DIE.h stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfAccelTable.h stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCFIException.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfCompileUnit.h stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.h stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/DwarfException.h stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/OcamlGCPrinter.cpp stable/9/contrib/llvm/lib/CodeGen/AsmPrinter/Win64Exception.cpp stable/9/contrib/llvm/lib/CodeGen/BranchFolding.cpp stable/9/contrib/llvm/lib/CodeGen/CalcSpillWeights.cpp stable/9/contrib/llvm/lib/CodeGen/CallingConvLower.cpp stable/9/contrib/llvm/lib/CodeGen/CodeGen.cpp stable/9/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.cpp stable/9/contrib/llvm/lib/CodeGen/CriticalAntiDepBreaker.h stable/9/contrib/llvm/lib/CodeGen/DFAPacketizer.cpp stable/9/contrib/llvm/lib/CodeGen/DeadMachineInstructionElim.cpp stable/9/contrib/llvm/lib/CodeGen/DwarfEHPrepare.cpp stable/9/contrib/llvm/lib/CodeGen/EarlyIfConversion.cpp stable/9/contrib/llvm/lib/CodeGen/ExecutionDepsFix.cpp stable/9/contrib/llvm/lib/CodeGen/ExpandISelPseudos.cpp stable/9/contrib/llvm/lib/CodeGen/ExpandPostRAPseudos.cpp stable/9/contrib/llvm/lib/CodeGen/GCMetadata.cpp stable/9/contrib/llvm/lib/CodeGen/GCStrategy.cpp stable/9/contrib/llvm/lib/CodeGen/IfConversion.cpp stable/9/contrib/llvm/lib/CodeGen/InlineSpiller.cpp stable/9/contrib/llvm/lib/CodeGen/InterferenceCache.cpp stable/9/contrib/llvm/lib/CodeGen/InterferenceCache.h stable/9/contrib/llvm/lib/CodeGen/IntrinsicLowering.cpp stable/9/contrib/llvm/lib/CodeGen/LLVMTargetMachine.cpp stable/9/contrib/llvm/lib/CodeGen/LexicalScopes.cpp stable/9/contrib/llvm/lib/CodeGen/LiveDebugVariables.cpp stable/9/contrib/llvm/lib/CodeGen/LiveInterval.cpp stable/9/contrib/llvm/lib/CodeGen/LiveIntervalAnalysis.cpp stable/9/contrib/llvm/lib/CodeGen/LiveIntervalUnion.cpp stable/9/contrib/llvm/lib/CodeGen/LiveRangeCalc.cpp stable/9/contrib/llvm/lib/CodeGen/LiveRangeCalc.h stable/9/contrib/llvm/lib/CodeGen/LiveRangeEdit.cpp stable/9/contrib/llvm/lib/CodeGen/LiveRegMatrix.cpp stable/9/contrib/llvm/lib/CodeGen/LiveStackAnalysis.cpp stable/9/contrib/llvm/lib/CodeGen/LiveVariables.cpp stable/9/contrib/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp stable/9/contrib/llvm/lib/CodeGen/MachineBasicBlock.cpp stable/9/contrib/llvm/lib/CodeGen/MachineBlockFrequencyInfo.cpp stable/9/contrib/llvm/lib/CodeGen/MachineBlockPlacement.cpp stable/9/contrib/llvm/lib/CodeGen/MachineBranchProbabilityInfo.cpp stable/9/contrib/llvm/lib/CodeGen/MachineCSE.cpp stable/9/contrib/llvm/lib/CodeGen/MachineCopyPropagation.cpp stable/9/contrib/llvm/lib/CodeGen/MachineFunction.cpp stable/9/contrib/llvm/lib/CodeGen/MachineFunctionPass.cpp stable/9/contrib/llvm/lib/CodeGen/MachineFunctionPrinterPass.cpp stable/9/contrib/llvm/lib/CodeGen/MachineInstr.cpp stable/9/contrib/llvm/lib/CodeGen/MachineInstrBundle.cpp stable/9/contrib/llvm/lib/CodeGen/MachineLICM.cpp stable/9/contrib/llvm/lib/CodeGen/MachineLoopInfo.cpp stable/9/contrib/llvm/lib/CodeGen/MachineModuleInfo.cpp stable/9/contrib/llvm/lib/CodeGen/MachineRegisterInfo.cpp stable/9/contrib/llvm/lib/CodeGen/MachineSSAUpdater.cpp stable/9/contrib/llvm/lib/CodeGen/MachineScheduler.cpp stable/9/contrib/llvm/lib/CodeGen/MachineSink.cpp stable/9/contrib/llvm/lib/CodeGen/MachineTraceMetrics.cpp stable/9/contrib/llvm/lib/CodeGen/MachineVerifier.cpp stable/9/contrib/llvm/lib/CodeGen/OptimizePHIs.cpp stable/9/contrib/llvm/lib/CodeGen/PHIElimination.cpp stable/9/contrib/llvm/lib/CodeGen/PHIEliminationUtils.cpp stable/9/contrib/llvm/lib/CodeGen/Passes.cpp stable/9/contrib/llvm/lib/CodeGen/PeepholeOptimizer.cpp stable/9/contrib/llvm/lib/CodeGen/PostRASchedulerList.cpp stable/9/contrib/llvm/lib/CodeGen/PrologEpilogInserter.cpp stable/9/contrib/llvm/lib/CodeGen/PrologEpilogInserter.h stable/9/contrib/llvm/lib/CodeGen/PseudoSourceValue.cpp stable/9/contrib/llvm/lib/CodeGen/RegAllocBase.cpp stable/9/contrib/llvm/lib/CodeGen/RegAllocBase.h stable/9/contrib/llvm/lib/CodeGen/RegAllocBasic.cpp stable/9/contrib/llvm/lib/CodeGen/RegAllocFast.cpp stable/9/contrib/llvm/lib/CodeGen/RegAllocGreedy.cpp stable/9/contrib/llvm/lib/CodeGen/RegAllocPBQP.cpp stable/9/contrib/llvm/lib/CodeGen/RegisterClassInfo.cpp stable/9/contrib/llvm/lib/CodeGen/RegisterCoalescer.cpp stable/9/contrib/llvm/lib/CodeGen/RegisterPressure.cpp stable/9/contrib/llvm/lib/CodeGen/RegisterScavenging.cpp stable/9/contrib/llvm/lib/CodeGen/ScheduleDAG.cpp stable/9/contrib/llvm/lib/CodeGen/ScheduleDAGInstrs.cpp stable/9/contrib/llvm/lib/CodeGen/ScheduleDAGPrinter.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.h stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypes.h stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ResourcePriorityQueue.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SDNodeDbgValue.h stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SDNodeOrdering.h stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGFast.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGRRList.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGSDNodes.h stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/ScheduleDAGVLIW.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp stable/9/contrib/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp stable/9/contrib/llvm/lib/CodeGen/ShadowStackGC.cpp stable/9/contrib/llvm/lib/CodeGen/ShrinkWrapping.cpp stable/9/contrib/llvm/lib/CodeGen/SjLjEHPrepare.cpp stable/9/contrib/llvm/lib/CodeGen/SlotIndexes.cpp stable/9/contrib/llvm/lib/CodeGen/SpillPlacement.cpp stable/9/contrib/llvm/lib/CodeGen/Spiller.cpp stable/9/contrib/llvm/lib/CodeGen/SplitKit.cpp stable/9/contrib/llvm/lib/CodeGen/StackColoring.cpp stable/9/contrib/llvm/lib/CodeGen/StackProtector.cpp stable/9/contrib/llvm/lib/CodeGen/StackSlotColoring.cpp stable/9/contrib/llvm/lib/CodeGen/StrongPHIElimination.cpp stable/9/contrib/llvm/lib/CodeGen/TailDuplication.cpp stable/9/contrib/llvm/lib/CodeGen/TargetFrameLoweringImpl.cpp stable/9/contrib/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp stable/9/contrib/llvm/lib/CodeGen/TargetOptionsImpl.cpp stable/9/contrib/llvm/lib/CodeGen/TargetSchedule.cpp stable/9/contrib/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp stable/9/contrib/llvm/lib/CodeGen/UnreachableBlockElim.cpp stable/9/contrib/llvm/lib/CodeGen/VirtRegMap.cpp stable/9/contrib/llvm/lib/DebugInfo/DIContext.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFAbbreviationDeclaration.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFAbbreviationDeclaration.h stable/9/contrib/llvm/lib/DebugInfo/DWARFCompileUnit.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFCompileUnit.h stable/9/contrib/llvm/lib/DebugInfo/DWARFContext.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFContext.h stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugArangeSet.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugArangeSet.h stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugAranges.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugAranges.h stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugInfoEntry.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugInfoEntry.h stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugLine.cpp stable/9/contrib/llvm/lib/DebugInfo/DWARFDebugLine.h stable/9/contrib/llvm/lib/DebugInfo/DWARFFormValue.cpp stable/9/contrib/llvm/lib/ExecutionEngine/EventListenerCommon.h stable/9/contrib/llvm/lib/ExecutionEngine/ExecutionEngine.cpp stable/9/contrib/llvm/lib/ExecutionEngine/ExecutionEngineBindings.cpp stable/9/contrib/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventListener.cpp stable/9/contrib/llvm/lib/ExecutionEngine/IntelJITEvents/IntelJITEventsWrapper.h stable/9/contrib/llvm/lib/ExecutionEngine/Interpreter/Execution.cpp stable/9/contrib/llvm/lib/ExecutionEngine/Interpreter/ExternalFunctions.cpp stable/9/contrib/llvm/lib/ExecutionEngine/Interpreter/Interpreter.cpp stable/9/contrib/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h stable/9/contrib/llvm/lib/ExecutionEngine/JIT/JIT.cpp stable/9/contrib/llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.cpp stable/9/contrib/llvm/lib/ExecutionEngine/JIT/JITDwarfEmitter.h stable/9/contrib/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp stable/9/contrib/llvm/lib/ExecutionEngine/JIT/JITMemoryManager.cpp stable/9/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp stable/9/contrib/llvm/lib/ExecutionEngine/MCJIT/MCJIT.h stable/9/contrib/llvm/lib/ExecutionEngine/OProfileJIT/OProfileJITEventListener.cpp stable/9/contrib/llvm/lib/ExecutionEngine/OProfileJIT/OProfileWrapper.cpp stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/GDBRegistrar.cpp stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/ObjectImageCommon.h stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.h stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.cpp stable/9/contrib/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldMachO.h stable/9/contrib/llvm/lib/ExecutionEngine/TargetSelect.cpp stable/9/contrib/llvm/lib/IR/AsmWriter.cpp stable/9/contrib/llvm/lib/IR/AttributeImpl.h stable/9/contrib/llvm/lib/IR/Attributes.cpp stable/9/contrib/llvm/lib/IR/Constants.cpp stable/9/contrib/llvm/lib/IR/ConstantsContext.h stable/9/contrib/llvm/lib/IR/Core.cpp stable/9/contrib/llvm/lib/IR/DIBuilder.cpp stable/9/contrib/llvm/lib/IR/DataLayout.cpp stable/9/contrib/llvm/lib/IR/DebugInfo.cpp stable/9/contrib/llvm/lib/IR/Function.cpp stable/9/contrib/llvm/lib/IR/Metadata.cpp stable/9/contrib/llvm/lib/IR/PassManager.cpp stable/9/contrib/llvm/lib/IR/Type.cpp stable/9/contrib/llvm/lib/IR/Value.cpp stable/9/contrib/llvm/lib/IR/Verifier.cpp stable/9/contrib/llvm/lib/Linker/LinkModules.cpp stable/9/contrib/llvm/lib/MC/ELFObjectWriter.cpp stable/9/contrib/llvm/lib/MC/MCAsmInfo.cpp stable/9/contrib/llvm/lib/MC/MCAsmInfoCOFF.cpp stable/9/contrib/llvm/lib/MC/MCAsmStreamer.cpp stable/9/contrib/llvm/lib/MC/MCAssembler.cpp stable/9/contrib/llvm/lib/MC/MCContext.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/Disassembler.cpp stable/9/contrib/llvm/lib/MC/MCDisassembler/Disassembler.h stable/9/contrib/llvm/lib/MC/MCDwarf.cpp stable/9/contrib/llvm/lib/MC/MCELF.cpp stable/9/contrib/llvm/lib/MC/MCELFObjectTargetWriter.cpp stable/9/contrib/llvm/lib/MC/MCELFStreamer.cpp stable/9/contrib/llvm/lib/MC/MCExpr.cpp stable/9/contrib/llvm/lib/MC/MCInstPrinter.cpp stable/9/contrib/llvm/lib/MC/MCMachOStreamer.cpp stable/9/contrib/llvm/lib/MC/MCNullStreamer.cpp stable/9/contrib/llvm/lib/MC/MCObjectFileInfo.cpp stable/9/contrib/llvm/lib/MC/MCObjectStreamer.cpp stable/9/contrib/llvm/lib/MC/MCParser/AsmLexer.cpp stable/9/contrib/llvm/lib/MC/MCParser/AsmParser.cpp stable/9/contrib/llvm/lib/MC/MCParser/COFFAsmParser.cpp stable/9/contrib/llvm/lib/MC/MCParser/DarwinAsmParser.cpp stable/9/contrib/llvm/lib/MC/MCParser/ELFAsmParser.cpp stable/9/contrib/llvm/lib/MC/MCParser/MCAsmLexer.cpp stable/9/contrib/llvm/lib/MC/MCParser/MCAsmParser.cpp stable/9/contrib/llvm/lib/MC/MCPureStreamer.cpp stable/9/contrib/llvm/lib/MC/MCSection.cpp stable/9/contrib/llvm/lib/MC/MCSectionCOFF.cpp stable/9/contrib/llvm/lib/MC/MCSectionELF.cpp stable/9/contrib/llvm/lib/MC/MCSectionMachO.cpp stable/9/contrib/llvm/lib/MC/MCStreamer.cpp stable/9/contrib/llvm/lib/MC/MCSubtargetInfo.cpp stable/9/contrib/llvm/lib/MC/MCWin64EH.cpp stable/9/contrib/llvm/lib/MC/MachObjectWriter.cpp stable/9/contrib/llvm/lib/MC/WinCOFFObjectWriter.cpp stable/9/contrib/llvm/lib/MC/WinCOFFStreamer.cpp stable/9/contrib/llvm/lib/Object/Archive.cpp stable/9/contrib/llvm/lib/Object/COFFObjectFile.cpp stable/9/contrib/llvm/lib/Object/ELFObjectFile.cpp stable/9/contrib/llvm/lib/Object/MachOObjectFile.cpp stable/9/contrib/llvm/lib/Object/Object.cpp stable/9/contrib/llvm/lib/Object/ObjectFile.cpp stable/9/contrib/llvm/lib/Support/APFloat.cpp stable/9/contrib/llvm/lib/Support/APInt.cpp stable/9/contrib/llvm/lib/Support/Allocator.cpp stable/9/contrib/llvm/lib/Support/CommandLine.cpp stable/9/contrib/llvm/lib/Support/ConstantRange.cpp stable/9/contrib/llvm/lib/Support/CrashRecoveryContext.cpp stable/9/contrib/llvm/lib/Support/DataExtractor.cpp stable/9/contrib/llvm/lib/Support/DataStream.cpp stable/9/contrib/llvm/lib/Support/Debug.cpp stable/9/contrib/llvm/lib/Support/Disassembler.cpp stable/9/contrib/llvm/lib/Support/Dwarf.cpp stable/9/contrib/llvm/lib/Support/DynamicLibrary.cpp stable/9/contrib/llvm/lib/Support/ErrorHandling.cpp stable/9/contrib/llvm/lib/Support/FileOutputBuffer.cpp stable/9/contrib/llvm/lib/Support/FileUtilities.cpp stable/9/contrib/llvm/lib/Support/FoldingSet.cpp stable/9/contrib/llvm/lib/Support/GraphWriter.cpp stable/9/contrib/llvm/lib/Support/Host.cpp stable/9/contrib/llvm/lib/Support/LocaleWindows.inc stable/9/contrib/llvm/lib/Support/LocaleXlocale.inc stable/9/contrib/llvm/lib/Support/LockFileManager.cpp stable/9/contrib/llvm/lib/Support/Memory.cpp stable/9/contrib/llvm/lib/Support/MemoryBuffer.cpp stable/9/contrib/llvm/lib/Support/Path.cpp stable/9/contrib/llvm/lib/Support/PathV2.cpp stable/9/contrib/llvm/lib/Support/PluginLoader.cpp stable/9/contrib/llvm/lib/Support/PrettyStackTrace.cpp stable/9/contrib/llvm/lib/Support/Process.cpp stable/9/contrib/llvm/lib/Support/Program.cpp stable/9/contrib/llvm/lib/Support/Regex.cpp stable/9/contrib/llvm/lib/Support/SmallPtrSet.cpp stable/9/contrib/llvm/lib/Support/SourceMgr.cpp stable/9/contrib/llvm/lib/Support/Statistic.cpp stable/9/contrib/llvm/lib/Support/StringRef.cpp stable/9/contrib/llvm/lib/Support/Threading.cpp stable/9/contrib/llvm/lib/Support/TimeValue.cpp stable/9/contrib/llvm/lib/Support/Timer.cpp stable/9/contrib/llvm/lib/Support/Triple.cpp stable/9/contrib/llvm/lib/Support/Unix/Memory.inc stable/9/contrib/llvm/lib/Support/Unix/PathV2.inc stable/9/contrib/llvm/lib/Support/Unix/Process.inc stable/9/contrib/llvm/lib/Support/Unix/Program.inc stable/9/contrib/llvm/lib/Support/Unix/Signals.inc stable/9/contrib/llvm/lib/Support/Unix/TimeValue.inc stable/9/contrib/llvm/lib/Support/Unix/Unix.h stable/9/contrib/llvm/lib/Support/Windows/Memory.inc stable/9/contrib/llvm/lib/Support/Windows/Path.inc stable/9/contrib/llvm/lib/Support/Windows/PathV2.inc stable/9/contrib/llvm/lib/Support/Windows/Process.inc stable/9/contrib/llvm/lib/Support/Windows/Program.inc stable/9/contrib/llvm/lib/Support/Windows/Signals.inc stable/9/contrib/llvm/lib/Support/YAMLParser.cpp stable/9/contrib/llvm/lib/Support/raw_ostream.cpp stable/9/contrib/llvm/lib/Support/regcomp.c stable/9/contrib/llvm/lib/Support/system_error.cpp stable/9/contrib/llvm/lib/TableGen/Error.cpp stable/9/contrib/llvm/lib/TableGen/Main.cpp stable/9/contrib/llvm/lib/TableGen/Record.cpp stable/9/contrib/llvm/lib/TableGen/TGLexer.cpp stable/9/contrib/llvm/lib/TableGen/TGLexer.h stable/9/contrib/llvm/lib/TableGen/TGParser.cpp stable/9/contrib/llvm/lib/TableGen/TGParser.h stable/9/contrib/llvm/lib/TableGen/TableGenBackend.cpp stable/9/contrib/llvm/lib/Target/AArch64/AArch64FrameLowering.cpp stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp stable/9/contrib/llvm/lib/Target/AArch64/AArch64ISelLowering.h stable/9/contrib/llvm/lib/Target/AArch64/AArch64InstrFormats.td stable/9/contrib/llvm/lib/Target/AArch64/AArch64InstrInfo.td stable/9/contrib/llvm/lib/Target/AArch64/AArch64MCInstLower.cpp stable/9/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64ELFStreamer.cpp stable/9/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCExpr.h stable/9/contrib/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/AArch64/TargetInfo/AArch64TargetInfo.cpp stable/9/contrib/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.cpp stable/9/contrib/llvm/lib/Target/AArch64/Utils/AArch64BaseInfo.h stable/9/contrib/llvm/lib/Target/ARM/ARM.h stable/9/contrib/llvm/lib/Target/ARM/ARM.td stable/9/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMAsmPrinter.h stable/9/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMBaseInstrInfo.h stable/9/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMBaseRegisterInfo.h stable/9/contrib/llvm/lib/Target/ARM/ARMCallingConv.h stable/9/contrib/llvm/lib/Target/ARM/ARMCallingConv.td stable/9/contrib/llvm/lib/Target/ARM/ARMCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMConstantIslandPass.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMConstantPoolValue.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMConstantPoolValue.h stable/9/contrib/llvm/lib/Target/ARM/ARMExpandPseudoInsts.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMFastISel.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMFrameLowering.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMFrameLowering.h stable/9/contrib/llvm/lib/Target/ARM/ARMISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMISelLowering.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMISelLowering.h stable/9/contrib/llvm/lib/Target/ARM/ARMInstrInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMInstrInfo.td stable/9/contrib/llvm/lib/Target/ARM/ARMInstrNEON.td stable/9/contrib/llvm/lib/Target/ARM/ARMInstrThumb2.td stable/9/contrib/llvm/lib/Target/ARM/ARMJITInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMJITInfo.h stable/9/contrib/llvm/lib/Target/ARM/ARMLoadStoreOptimizer.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMMCInstLower.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMMachineFunctionInfo.h stable/9/contrib/llvm/lib/Target/ARM/ARMSchedule.td stable/9/contrib/llvm/lib/Target/ARM/ARMScheduleA9.td stable/9/contrib/llvm/lib/Target/ARM/ARMScheduleSwift.td stable/9/contrib/llvm/lib/Target/ARM/ARMSelectionDAGInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMSubtarget.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMSubtarget.h stable/9/contrib/llvm/lib/Target/ARM/ARMTargetMachine.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMTargetMachine.h stable/9/contrib/llvm/lib/Target/ARM/ARMTargetObjectFile.cpp stable/9/contrib/llvm/lib/Target/ARM/ARMTargetObjectFile.h stable/9/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp stable/9/contrib/llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp stable/9/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp stable/9/contrib/llvm/lib/Target/ARM/InstPrinter/ARMInstPrinter.h stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMELFObjectWriter.cpp stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCExpr.cpp stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCExpr.h stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/ARM/MCTargetDesc/ARMMachObjectWriter.cpp stable/9/contrib/llvm/lib/Target/ARM/MLxExpansionPass.cpp stable/9/contrib/llvm/lib/Target/ARM/TargetInfo/ARMTargetInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp stable/9/contrib/llvm/lib/Target/ARM/Thumb1FrameLowering.h stable/9/contrib/llvm/lib/Target/ARM/Thumb1InstrInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/Thumb1RegisterInfo.h stable/9/contrib/llvm/lib/Target/ARM/Thumb2ITBlockPass.cpp stable/9/contrib/llvm/lib/Target/ARM/Thumb2InstrInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/Thumb2RegisterInfo.cpp stable/9/contrib/llvm/lib/Target/ARM/Thumb2SizeReduction.cpp stable/9/contrib/llvm/lib/Target/CppBackend/CPPBackend.cpp stable/9/contrib/llvm/lib/Target/CppBackend/CPPTargetMachine.h stable/9/contrib/llvm/lib/Target/CppBackend/TargetInfo/CppBackendTargetInfo.cpp stable/9/contrib/llvm/lib/Target/Hexagon/Hexagon.h stable/9/contrib/llvm/lib/Target/Hexagon/Hexagon.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonCFGOptimizer.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonCallingConvLower.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonCallingConvLower.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonExpandPredSpillCode.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonFrameLowering.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonFrameLowering.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonHardwareLoops.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonISelLowering.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormats.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonInstrFormatsV4.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfo.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV3.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonInstrInfoV4.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonMCInstLower.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonMachineFunctionInfo.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonMachineScheduler.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonMachineScheduler.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonNewValueJump.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonPeephole.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonRegisterInfo.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonRemoveSZExtArgs.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonSchedule.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonScheduleV4.td stable/9/contrib/llvm/lib/Target/Hexagon/HexagonSplitTFRCondSets.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonSubtarget.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonTargetMachine.h stable/9/contrib/llvm/lib/Target/Hexagon/HexagonTargetObjectFile.cpp stable/9/contrib/llvm/lib/Target/Hexagon/HexagonVLIWPacketizer.cpp stable/9/contrib/llvm/lib/Target/Hexagon/InstPrinter/HexagonInstPrinter.cpp stable/9/contrib/llvm/lib/Target/Hexagon/InstPrinter/HexagonInstPrinter.h stable/9/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonBaseInfo.h stable/9/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/Hexagon/MCTargetDesc/HexagonMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/Hexagon/TargetInfo/HexagonTargetInfo.cpp stable/9/contrib/llvm/lib/Target/MBlaze/AsmParser/MBlazeAsmParser.cpp stable/9/contrib/llvm/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.cpp stable/9/contrib/llvm/lib/Target/MBlaze/Disassembler/MBlazeDisassembler.h stable/9/contrib/llvm/lib/Target/MBlaze/InstPrinter/MBlazeInstPrinter.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeDelaySlotFiller.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeFrameLowering.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeFrameLowering.h stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeISelLowering.h stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeInstrInfo.td stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeMCInstLower.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeMachineFunction.h stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeRegisterInfo.h stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeSubtarget.h stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeTargetMachine.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeTargetMachine.h stable/9/contrib/llvm/lib/Target/MBlaze/MBlazeTargetObjectFile.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MCTargetDesc/MBlazeAsmBackend.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MCTargetDesc/MBlazeMCCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/MBlaze/MCTargetDesc/MBlazeMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/MBlaze/TargetInfo/MBlazeTargetInfo.cpp stable/9/contrib/llvm/lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp stable/9/contrib/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/MSP430/MCTargetDesc/MSP430MCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430AsmPrinter.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430BranchSelector.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430CallingConv.td stable/9/contrib/llvm/lib/Target/MSP430/MSP430FrameLowering.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430FrameLowering.h stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430ISelLowering.h stable/9/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430InstrInfo.td stable/9/contrib/llvm/lib/Target/MSP430/MSP430MCInstLower.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430MachineFunctionInfo.h stable/9/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430RegisterInfo.h stable/9/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.cpp stable/9/contrib/llvm/lib/Target/MSP430/MSP430TargetMachine.h stable/9/contrib/llvm/lib/Target/MSP430/TargetInfo/MSP430TargetInfo.cpp stable/9/contrib/llvm/lib/Target/Mangler.cpp stable/9/contrib/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp stable/9/contrib/llvm/lib/Target/Mips/Disassembler/MipsDisassembler.cpp stable/9/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp stable/9/contrib/llvm/lib/Target/Mips/InstPrinter/MipsInstPrinter.h stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsAsmBackend.cpp stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsBaseInfo.h stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsELFObjectWriter.cpp stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/Mips/MCTargetDesc/MipsMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/Mips/Mips.h stable/9/contrib/llvm/lib/Target/Mips/Mips.td stable/9/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.cpp stable/9/contrib/llvm/lib/Target/Mips/Mips16FrameLowering.h stable/9/contrib/llvm/lib/Target/Mips/Mips16InstrFormats.td stable/9/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.h stable/9/contrib/llvm/lib/Target/Mips/Mips16InstrInfo.td stable/9/contrib/llvm/lib/Target/Mips/Mips16RegisterInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/Mips16RegisterInfo.h stable/9/contrib/llvm/lib/Target/Mips/Mips64InstrInfo.td stable/9/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsAsmPrinter.h stable/9/contrib/llvm/lib/Target/Mips/MipsCallingConv.td stable/9/contrib/llvm/lib/Target/Mips/MipsCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsCondMov.td stable/9/contrib/llvm/lib/Target/Mips/MipsDSPInstrFormats.td stable/9/contrib/llvm/lib/Target/Mips/MipsDSPInstrInfo.td stable/9/contrib/llvm/lib/Target/Mips/MipsDelaySlotFiller.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsFrameLowering.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsFrameLowering.h stable/9/contrib/llvm/lib/Target/Mips/MipsISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsISelLowering.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsISelLowering.h stable/9/contrib/llvm/lib/Target/Mips/MipsInstrFPU.td stable/9/contrib/llvm/lib/Target/Mips/MipsInstrFormats.td stable/9/contrib/llvm/lib/Target/Mips/MipsInstrInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsInstrInfo.h stable/9/contrib/llvm/lib/Target/Mips/MipsInstrInfo.td stable/9/contrib/llvm/lib/Target/Mips/MipsJITInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsLongBranch.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsMCInstLower.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsMachineFunction.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsMachineFunction.h stable/9/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.h stable/9/contrib/llvm/lib/Target/Mips/MipsRegisterInfo.td stable/9/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsSEFrameLowering.h stable/9/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsSEInstrInfo.h stable/9/contrib/llvm/lib/Target/Mips/MipsSERegisterInfo.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsSERegisterInfo.h stable/9/contrib/llvm/lib/Target/Mips/MipsSubtarget.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsSubtarget.h stable/9/contrib/llvm/lib/Target/Mips/MipsTargetMachine.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsTargetMachine.h stable/9/contrib/llvm/lib/Target/Mips/MipsTargetObjectFile.cpp stable/9/contrib/llvm/lib/Target/Mips/MipsTargetObjectFile.h stable/9/contrib/llvm/lib/Target/Mips/TargetInfo/MipsTargetInfo.cpp stable/9/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXBaseInfo.h stable/9/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/NVPTX/MCTargetDesc/NVPTXMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/NVPTX/ManagedStringPool.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTX.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTX.td stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXAllocaHoisting.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXAllocaHoisting.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXAsmPrinter.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXFrameLowering.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXFrameLowering.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXISelLowering.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXInstrInfo.td stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXIntrinsics.td stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXNumRegisters.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXRegisterInfo.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXRegisterInfo.td stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXSection.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXSplitBBatBar.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXSplitBBatBar.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXSubtarget.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXTargetMachine.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXTargetMachine.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXTargetObjectFile.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXUtilities.cpp stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXUtilities.h stable/9/contrib/llvm/lib/Target/NVPTX/NVPTXutil.cpp stable/9/contrib/llvm/lib/Target/NVPTX/TargetInfo/NVPTXTargetInfo.cpp stable/9/contrib/llvm/lib/Target/NVPTX/cl_common_defines.h stable/9/contrib/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCELFObjectWriter.cpp stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCFixupKinds.h stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCMCTargetDesc.h stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.cpp stable/9/contrib/llvm/lib/Target/PowerPC/MCTargetDesc/PPCPredicates.h stable/9/contrib/llvm/lib/Target/PowerPC/PPC.h stable/9/contrib/llvm/lib/Target/PowerPC/PPC.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCBranchSelector.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCCTRLoops.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCCallingConv.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCFrameLowering.h stable/9/contrib/llvm/lib/Target/PowerPC/PPCHazardRecognizers.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCISelLowering.h stable/9/contrib/llvm/lib/Target/PowerPC/PPCInstr64Bit.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCInstrAltivec.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCInstrFormats.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.h stable/9/contrib/llvm/lib/Target/PowerPC/PPCInstrInfo.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCJITInfo.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCJITInfo.h stable/9/contrib/llvm/lib/Target/PowerPC/PPCMCInstLower.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.h stable/9/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.h stable/9/contrib/llvm/lib/Target/PowerPC/PPCRegisterInfo.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCScheduleA2.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCScheduleG5.td stable/9/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCSubtarget.h stable/9/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.cpp stable/9/contrib/llvm/lib/Target/PowerPC/PPCTargetMachine.h stable/9/contrib/llvm/lib/Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp stable/9/contrib/llvm/lib/Target/R600/AMDGPU.h stable/9/contrib/llvm/lib/Target/R600/AMDGPUAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/R600/AMDGPUAsmPrinter.h stable/9/contrib/llvm/lib/Target/R600/AMDGPUCallingConv.td stable/9/contrib/llvm/lib/Target/R600/AMDGPUISelLowering.h stable/9/contrib/llvm/lib/Target/R600/AMDGPUInstructions.td stable/9/contrib/llvm/lib/Target/R600/AMDGPUMachineFunction.cpp stable/9/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.cpp stable/9/contrib/llvm/lib/Target/R600/AMDGPUSubtarget.h stable/9/contrib/llvm/lib/Target/R600/AMDGPUTargetMachine.cpp stable/9/contrib/llvm/lib/Target/R600/AMDILBase.td stable/9/contrib/llvm/lib/Target/R600/AMDILDeviceInfo.cpp stable/9/contrib/llvm/lib/Target/R600/AMDILISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp stable/9/contrib/llvm/lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h stable/9/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUAsmBackend.cpp stable/9/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/R600/MCTargetDesc/AMDGPUMCTargetDesc.h stable/9/contrib/llvm/lib/Target/R600/MCTargetDesc/R600MCCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/R600/Processors.td stable/9/contrib/llvm/lib/Target/R600/R600ControlFlowFinalizer.cpp stable/9/contrib/llvm/lib/Target/R600/R600Defines.h stable/9/contrib/llvm/lib/Target/R600/R600ISelLowering.cpp stable/9/contrib/llvm/lib/Target/R600/R600InstrInfo.cpp stable/9/contrib/llvm/lib/Target/R600/R600InstrInfo.h stable/9/contrib/llvm/lib/Target/R600/R600Instructions.td stable/9/contrib/llvm/lib/Target/R600/R600MachineFunctionInfo.h stable/9/contrib/llvm/lib/Target/R600/R600RegisterInfo.td stable/9/contrib/llvm/lib/Target/R600/R600Schedule.td stable/9/contrib/llvm/lib/Target/R600/SIISelLowering.cpp stable/9/contrib/llvm/lib/Target/R600/SIISelLowering.h stable/9/contrib/llvm/lib/Target/R600/SIInstrFormats.td stable/9/contrib/llvm/lib/Target/R600/SIInstrInfo.cpp stable/9/contrib/llvm/lib/Target/R600/SIInstrInfo.h stable/9/contrib/llvm/lib/Target/R600/SIInstrInfo.td stable/9/contrib/llvm/lib/Target/R600/SIInstructions.td stable/9/contrib/llvm/lib/Target/R600/SIIntrinsics.td stable/9/contrib/llvm/lib/Target/R600/SIRegisterInfo.td stable/9/contrib/llvm/lib/Target/Sparc/DelaySlotFiller.cpp stable/9/contrib/llvm/lib/Target/Sparc/FPMover.cpp stable/9/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/Sparc/MCTargetDesc/SparcMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcCallingConv.td stable/9/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcFrameLowering.h stable/9/contrib/llvm/lib/Target/Sparc/SparcISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcISelLowering.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcISelLowering.h stable/9/contrib/llvm/lib/Target/Sparc/SparcInstrFormats.td stable/9/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcInstrInfo.td stable/9/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.h stable/9/contrib/llvm/lib/Target/Sparc/SparcRegisterInfo.td stable/9/contrib/llvm/lib/Target/Sparc/SparcSubtarget.h stable/9/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.cpp stable/9/contrib/llvm/lib/Target/Sparc/SparcTargetMachine.h stable/9/contrib/llvm/lib/Target/Sparc/TargetInfo/SparcTargetInfo.cpp stable/9/contrib/llvm/lib/Target/Target.cpp stable/9/contrib/llvm/lib/Target/TargetIntrinsicInfo.cpp stable/9/contrib/llvm/lib/Target/TargetLibraryInfo.cpp stable/9/contrib/llvm/lib/Target/TargetLoweringObjectFile.cpp stable/9/contrib/llvm/lib/Target/TargetMachine.cpp stable/9/contrib/llvm/lib/Target/TargetMachineC.cpp stable/9/contrib/llvm/lib/Target/TargetSubtargetInfo.cpp stable/9/contrib/llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp stable/9/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.cpp stable/9/contrib/llvm/lib/Target/X86/Disassembler/X86Disassembler.h stable/9/contrib/llvm/lib/Target/X86/Disassembler/X86DisassemblerDecoder.c stable/9/contrib/llvm/lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp stable/9/contrib/llvm/lib/Target/X86/InstPrinter/X86InstComments.cpp stable/9/contrib/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCAsmInfo.cpp stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86MachObjectWriter.cpp stable/9/contrib/llvm/lib/Target/X86/MCTargetDesc/X86WinCOFFObjectWriter.cpp stable/9/contrib/llvm/lib/Target/X86/TargetInfo/X86TargetInfo.cpp stable/9/contrib/llvm/lib/Target/X86/Utils/X86ShuffleDecode.cpp stable/9/contrib/llvm/lib/Target/X86/Utils/X86ShuffleDecode.h stable/9/contrib/llvm/lib/Target/X86/X86.h stable/9/contrib/llvm/lib/Target/X86/X86.td stable/9/contrib/llvm/lib/Target/X86/X86AsmPrinter.cpp stable/9/contrib/llvm/lib/Target/X86/X86AsmPrinter.h stable/9/contrib/llvm/lib/Target/X86/X86COFFMachineModuleInfo.h stable/9/contrib/llvm/lib/Target/X86/X86CallingConv.td stable/9/contrib/llvm/lib/Target/X86/X86CodeEmitter.cpp stable/9/contrib/llvm/lib/Target/X86/X86FastISel.cpp stable/9/contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp stable/9/contrib/llvm/lib/Target/X86/X86FrameLowering.cpp stable/9/contrib/llvm/lib/Target/X86/X86FrameLowering.h stable/9/contrib/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.cpp stable/9/contrib/llvm/lib/Target/X86/X86ISelLowering.h stable/9/contrib/llvm/lib/Target/X86/X86Instr3DNow.td stable/9/contrib/llvm/lib/Target/X86/X86InstrArithmetic.td stable/9/contrib/llvm/lib/Target/X86/X86InstrCMovSetCC.td stable/9/contrib/llvm/lib/Target/X86/X86InstrCompiler.td stable/9/contrib/llvm/lib/Target/X86/X86InstrControl.td stable/9/contrib/llvm/lib/Target/X86/X86InstrExtension.td stable/9/contrib/llvm/lib/Target/X86/X86InstrFMA.td stable/9/contrib/llvm/lib/Target/X86/X86InstrFPStack.td stable/9/contrib/llvm/lib/Target/X86/X86InstrFormats.td stable/9/contrib/llvm/lib/Target/X86/X86InstrFragmentsSIMD.td stable/9/contrib/llvm/lib/Target/X86/X86InstrInfo.cpp stable/9/contrib/llvm/lib/Target/X86/X86InstrInfo.td stable/9/contrib/llvm/lib/Target/X86/X86InstrMMX.td stable/9/contrib/llvm/lib/Target/X86/X86InstrSSE.td stable/9/contrib/llvm/lib/Target/X86/X86InstrShiftRotate.td stable/9/contrib/llvm/lib/Target/X86/X86InstrSystem.td stable/9/contrib/llvm/lib/Target/X86/X86InstrTSX.td stable/9/contrib/llvm/lib/Target/X86/X86JITInfo.cpp stable/9/contrib/llvm/lib/Target/X86/X86JITInfo.h stable/9/contrib/llvm/lib/Target/X86/X86MCInstLower.cpp stable/9/contrib/llvm/lib/Target/X86/X86RegisterInfo.cpp stable/9/contrib/llvm/lib/Target/X86/X86RegisterInfo.h stable/9/contrib/llvm/lib/Target/X86/X86Schedule.td stable/9/contrib/llvm/lib/Target/X86/X86ScheduleAtom.td stable/9/contrib/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp stable/9/contrib/llvm/lib/Target/X86/X86Subtarget.cpp stable/9/contrib/llvm/lib/Target/X86/X86Subtarget.h stable/9/contrib/llvm/lib/Target/X86/X86TargetMachine.cpp stable/9/contrib/llvm/lib/Target/X86/X86TargetMachine.h stable/9/contrib/llvm/lib/Target/X86/X86TargetObjectFile.cpp stable/9/contrib/llvm/lib/Target/X86/X86TargetObjectFile.h stable/9/contrib/llvm/lib/Target/X86/X86VZeroUpper.cpp stable/9/contrib/llvm/lib/Target/XCore/Disassembler/XCoreDisassembler.cpp stable/9/contrib/llvm/lib/Target/XCore/InstPrinter/XCoreInstPrinter.cpp stable/9/contrib/llvm/lib/Target/XCore/MCTargetDesc/XCoreMCTargetDesc.cpp stable/9/contrib/llvm/lib/Target/XCore/TargetInfo/XCoreTargetInfo.cpp stable/9/contrib/llvm/lib/Target/XCore/XCore.h stable/9/contrib/llvm/lib/Target/XCore/XCore.td stable/9/contrib/llvm/lib/Target/XCore/XCoreAsmPrinter.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreFrameLowering.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreFrameLowering.h stable/9/contrib/llvm/lib/Target/XCore/XCoreISelDAGToDAG.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreISelLowering.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreISelLowering.h stable/9/contrib/llvm/lib/Target/XCore/XCoreInstrFormats.td stable/9/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreInstrInfo.td stable/9/contrib/llvm/lib/Target/XCore/XCoreMachineFunctionInfo.h stable/9/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.h stable/9/contrib/llvm/lib/Target/XCore/XCoreRegisterInfo.td stable/9/contrib/llvm/lib/Target/XCore/XCoreSubtarget.h stable/9/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.cpp stable/9/contrib/llvm/lib/Target/XCore/XCoreTargetMachine.h stable/9/contrib/llvm/lib/Target/XCore/XCoreTargetObjectFile.cpp stable/9/contrib/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp stable/9/contrib/llvm/lib/Transforms/IPO/ConstantMerge.cpp stable/9/contrib/llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp stable/9/contrib/llvm/lib/Transforms/IPO/ExtractGV.cpp stable/9/contrib/llvm/lib/Transforms/IPO/FunctionAttrs.cpp stable/9/contrib/llvm/lib/Transforms/IPO/GlobalDCE.cpp stable/9/contrib/llvm/lib/Transforms/IPO/GlobalOpt.cpp stable/9/contrib/llvm/lib/Transforms/IPO/IPConstantPropagation.cpp stable/9/contrib/llvm/lib/Transforms/IPO/InlineAlways.cpp stable/9/contrib/llvm/lib/Transforms/IPO/InlineSimple.cpp stable/9/contrib/llvm/lib/Transforms/IPO/Inliner.cpp stable/9/contrib/llvm/lib/Transforms/IPO/Internalize.cpp stable/9/contrib/llvm/lib/Transforms/IPO/LoopExtractor.cpp stable/9/contrib/llvm/lib/Transforms/IPO/MergeFunctions.cpp stable/9/contrib/llvm/lib/Transforms/IPO/PartialInlining.cpp stable/9/contrib/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp stable/9/contrib/llvm/lib/Transforms/IPO/PruneEH.cpp stable/9/contrib/llvm/lib/Transforms/IPO/StripDeadPrototypes.cpp stable/9/contrib/llvm/lib/Transforms/IPO/StripSymbols.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombine.h stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineCasts.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombinePHI.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp stable/9/contrib/llvm/lib/Transforms/InstCombine/InstCombineWorklist.h stable/9/contrib/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/BlackList.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/BoundsChecking.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/EdgeProfiling.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/MaximumSpanningTree.h stable/9/contrib/llvm/lib/Transforms/Instrumentation/OptimalEdgeProfiling.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/PathProfiling.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/ProfilingUtils.cpp stable/9/contrib/llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp stable/9/contrib/llvm/lib/Transforms/ObjCARC/ObjCARC.cpp stable/9/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCContract.cpp stable/9/contrib/llvm/lib/Transforms/ObjCARC/ObjCARCOpts.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/ADCE.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/BasicBlockPlacement.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/ConstantProp.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/DCE.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/EarlyCSE.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/GVN.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/GlobalMerge.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/IndVarSimplify.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/JumpThreading.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LICM.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LoopDeletion.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LoopInstSimplify.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LoopRotation.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LoopUnrollPass.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/LowerAtomic.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/Reassociate.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/Reg2Mem.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/SCCP.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/SROA.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/Scalar.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/ScalarReplAggregates.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/SimplifyLibCalls.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/Sink.cpp stable/9/contrib/llvm/lib/Transforms/Scalar/TailRecursionElimination.cpp stable/9/contrib/llvm/lib/Transforms/Utils/BasicBlockUtils.cpp stable/9/contrib/llvm/lib/Transforms/Utils/BreakCriticalEdges.cpp stable/9/contrib/llvm/lib/Transforms/Utils/BuildLibCalls.cpp stable/9/contrib/llvm/lib/Transforms/Utils/BypassSlowDivision.cpp stable/9/contrib/llvm/lib/Transforms/Utils/CloneFunction.cpp stable/9/contrib/llvm/lib/Transforms/Utils/CloneModule.cpp stable/9/contrib/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp stable/9/contrib/llvm/lib/Transforms/Utils/CodeExtractor.cpp stable/9/contrib/llvm/lib/Transforms/Utils/DemoteRegToStack.cpp stable/9/contrib/llvm/lib/Transforms/Utils/InlineFunction.cpp stable/9/contrib/llvm/lib/Transforms/Utils/InstructionNamer.cpp stable/9/contrib/llvm/lib/Transforms/Utils/IntegerDivision.cpp stable/9/contrib/llvm/lib/Transforms/Utils/LCSSA.cpp stable/9/contrib/llvm/lib/Transforms/Utils/Local.cpp stable/9/contrib/llvm/lib/Transforms/Utils/LoopSimplify.cpp stable/9/contrib/llvm/lib/Transforms/Utils/LoopUnroll.cpp stable/9/contrib/llvm/lib/Transforms/Utils/LoopUnrollRuntime.cpp stable/9/contrib/llvm/lib/Transforms/Utils/LowerExpectIntrinsic.cpp stable/9/contrib/llvm/lib/Transforms/Utils/LowerInvoke.cpp stable/9/contrib/llvm/lib/Transforms/Utils/LowerSwitch.cpp stable/9/contrib/llvm/lib/Transforms/Utils/Mem2Reg.cpp stable/9/contrib/llvm/lib/Transforms/Utils/MetaRenamer.cpp stable/9/contrib/llvm/lib/Transforms/Utils/ModuleUtils.cpp stable/9/contrib/llvm/lib/Transforms/Utils/PromoteMemoryToRegister.cpp stable/9/contrib/llvm/lib/Transforms/Utils/SSAUpdater.cpp stable/9/contrib/llvm/lib/Transforms/Utils/SimplifyCFG.cpp stable/9/contrib/llvm/lib/Transforms/Utils/SimplifyIndVar.cpp stable/9/contrib/llvm/lib/Transforms/Utils/SimplifyInstructions.cpp stable/9/contrib/llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp stable/9/contrib/llvm/lib/Transforms/Utils/UnifyFunctionExitNodes.cpp stable/9/contrib/llvm/lib/Transforms/Utils/Utils.cpp stable/9/contrib/llvm/lib/Transforms/Utils/ValueMapper.cpp stable/9/contrib/llvm/lib/Transforms/Vectorize/BBVectorize.cpp stable/9/contrib/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp stable/9/contrib/llvm/lib/Transforms/Vectorize/Vectorize.cpp stable/9/contrib/llvm/tools/bugpoint/BugDriver.cpp stable/9/contrib/llvm/tools/bugpoint/BugDriver.h stable/9/contrib/llvm/tools/bugpoint/CrashDebugger.cpp stable/9/contrib/llvm/tools/bugpoint/ExecutionDriver.cpp stable/9/contrib/llvm/tools/bugpoint/ExtractFunction.cpp stable/9/contrib/llvm/tools/bugpoint/ListReducer.h stable/9/contrib/llvm/tools/bugpoint/Miscompilation.cpp stable/9/contrib/llvm/tools/bugpoint/OptimizerDriver.cpp stable/9/contrib/llvm/tools/bugpoint/ToolRunner.cpp stable/9/contrib/llvm/tools/bugpoint/ToolRunner.h stable/9/contrib/llvm/tools/bugpoint/bugpoint.cpp stable/9/contrib/llvm/tools/clang/LICENSE.TXT stable/9/contrib/llvm/tools/clang/include/clang-c/CXCompilationDatabase.h stable/9/contrib/llvm/tools/clang/include/clang-c/CXString.h stable/9/contrib/llvm/tools/clang/include/clang-c/Index.h stable/9/contrib/llvm/tools/clang/include/clang/ARCMigrate/ARCMT.h stable/9/contrib/llvm/tools/clang/include/clang/ARCMigrate/ARCMTActions.h stable/9/contrib/llvm/tools/clang/include/clang/ARCMigrate/FileRemapper.h stable/9/contrib/llvm/tools/clang/include/clang/AST/APValue.h stable/9/contrib/llvm/tools/clang/include/clang/AST/AST.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ASTConsumer.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ASTContext.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ASTImporter.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ASTMutationListener.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ASTVector.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Attr.h stable/9/contrib/llvm/tools/clang/include/clang/AST/BuiltinTypes.def stable/9/contrib/llvm/tools/clang/include/clang/AST/CXXInheritance.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CanonicalType.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CharUnits.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Comment.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CommentCommandTraits.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CommentCommands.td stable/9/contrib/llvm/tools/clang/include/clang/AST/CommentLexer.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CommentParser.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CommentSema.h stable/9/contrib/llvm/tools/clang/include/clang/AST/CommentVisitor.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Decl.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclAccessPair.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclBase.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclCXX.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclContextInternals.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclFriend.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclLookups.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclObjC.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclTemplate.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclVisitor.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DeclarationName.h stable/9/contrib/llvm/tools/clang/include/clang/AST/DependentDiagnostic.h stable/9/contrib/llvm/tools/clang/include/clang/AST/EvaluatedExprVisitor.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Expr.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ExprCXX.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ExprObjC.h stable/9/contrib/llvm/tools/clang/include/clang/AST/ExternalASTSource.h stable/9/contrib/llvm/tools/clang/include/clang/AST/LambdaMangleContext.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Mangle.h stable/9/contrib/llvm/tools/clang/include/clang/AST/NSAPI.h stable/9/contrib/llvm/tools/clang/include/clang/AST/NestedNameSpecifier.h stable/9/contrib/llvm/tools/clang/include/clang/AST/OperationKinds.h stable/9/contrib/llvm/tools/clang/include/clang/AST/PrettyPrinter.h stable/9/contrib/llvm/tools/clang/include/clang/AST/RawCommentList.h stable/9/contrib/llvm/tools/clang/include/clang/AST/RecursiveASTVisitor.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Stmt.h stable/9/contrib/llvm/tools/clang/include/clang/AST/StmtCXX.h stable/9/contrib/llvm/tools/clang/include/clang/AST/StmtGraphTraits.h stable/9/contrib/llvm/tools/clang/include/clang/AST/StmtObjC.h stable/9/contrib/llvm/tools/clang/include/clang/AST/TemplateBase.h stable/9/contrib/llvm/tools/clang/include/clang/AST/TemplateName.h stable/9/contrib/llvm/tools/clang/include/clang/AST/Type.h stable/9/contrib/llvm/tools/clang/include/clang/AST/TypeLoc.h stable/9/contrib/llvm/tools/clang/include/clang/AST/TypeLocVisitor.h stable/9/contrib/llvm/tools/clang/include/clang/AST/TypeNodes.def stable/9/contrib/llvm/tools/clang/include/clang/AST/TypeOrdering.h stable/9/contrib/llvm/tools/clang/include/clang/AST/UnresolvedSet.h stable/9/contrib/llvm/tools/clang/include/clang/AST/VTTBuilder.h stable/9/contrib/llvm/tools/clang/include/clang/AST/VTableBuilder.h stable/9/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchFinder.h stable/9/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchers.h stable/9/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchersInternal.h stable/9/contrib/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchersMacros.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/Dominators.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/FormatString.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/LiveVariables.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/ThreadSafety.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Analyses/UninitializedValues.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/AnalysisContext.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/CFG.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/CallGraph.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/FlowSensitive/DataflowSolver.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/ProgramPoint.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Support/BlkExprDeclBitVector.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Support/BumpVector.h stable/9/contrib/llvm/tools/clang/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Attr.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/AttrKinds.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Builtins.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/Builtins.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsARM.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/BuiltinsX86.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/DeclNodes.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/Diagnostic.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticASTKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommentKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticCommonKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticDriverKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticFrontendKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticIDs.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticLexKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticOptions.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticParseKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSemaKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/DiagnosticSerializationKinds.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/FileManager.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/FileSystemStatCache.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/IdentifierTable.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/LLVM.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/LangOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Linkage.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/MacroBuilder.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Module.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/ObjCRuntime.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/OnDiskHashTable.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/PartialDiagnostic.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Sanitizers.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/SourceLocation.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/SourceManager.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Specifiers.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/StmtNodes.td stable/9/contrib/llvm/tools/clang/include/clang/Basic/TargetBuiltins.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/TargetInfo.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/TargetOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.def stable/9/contrib/llvm/tools/clang/include/clang/Basic/TokenKinds.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/TypeTraits.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Version.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/VersionTuple.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/Visibility.h stable/9/contrib/llvm/tools/clang/include/clang/Basic/arm_neon.td stable/9/contrib/llvm/tools/clang/include/clang/CodeGen/ModuleBuilder.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Arg.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/ArgList.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/CC1AsOptions.td stable/9/contrib/llvm/tools/clang/include/clang/Driver/CC1Options.td stable/9/contrib/llvm/tools/clang/include/clang/Driver/Compilation.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Driver.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Job.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/OptSpecifier.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Option.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Options.td stable/9/contrib/llvm/tools/clang/include/clang/Driver/Phases.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Tool.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/ToolChain.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Types.def stable/9/contrib/llvm/tools/clang/include/clang/Driver/Types.h stable/9/contrib/llvm/tools/clang/include/clang/Driver/Util.h stable/9/contrib/llvm/tools/clang/include/clang/Edit/Commit.h stable/9/contrib/llvm/tools/clang/include/clang/Edit/EditedSource.h stable/9/contrib/llvm/tools/clang/include/clang/Edit/Rewriters.h stable/9/contrib/llvm/tools/clang/include/clang/Format/Format.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/ASTUnit.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/ChainedDiagnosticConsumer.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/ChainedIncludesSource.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.def stable/9/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInstance.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/CompilerInvocation.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/DiagnosticRenderer.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/FrontendAction.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/FrontendActions.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/FrontendOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/LangStandard.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/LangStandards.def stable/9/contrib/llvm/tools/clang/include/clang/Frontend/LayoutOverrideSource.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/LogDiagnosticPrinter.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/MultiplexConsumer.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/PreprocessorOutputOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/SerializedDiagnosticPrinter.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnostic.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnosticBuffer.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/TextDiagnosticPrinter.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/Utils.h stable/9/contrib/llvm/tools/clang/include/clang/Frontend/VerifyDiagnosticConsumer.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/DirectoryLookup.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/ExternalPreprocessorSource.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearch.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/HeaderSearchOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/Lexer.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/LiteralSupport.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/MacroInfo.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/ModuleLoader.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/ModuleMap.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/PPCallbacks.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/PTHManager.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/PreprocessingRecord.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/Preprocessor.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/PreprocessorOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Lex/Token.h stable/9/contrib/llvm/tools/clang/include/clang/Parse/Parser.h stable/9/contrib/llvm/tools/clang/include/clang/Rewrite/Core/RewriteRope.h stable/9/contrib/llvm/tools/clang/include/clang/Rewrite/Core/Rewriter.h stable/9/contrib/llvm/tools/clang/include/clang/Rewrite/Frontend/ASTConsumers.h stable/9/contrib/llvm/tools/clang/include/clang/Rewrite/Frontend/FixItRewriter.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/AttributeList.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/CXXFieldCollector.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteConsumer.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/CodeCompleteOptions.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/DeclSpec.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/DelayedDiagnostic.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/ExternalSemaSource.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/IdentifierResolver.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/Initialization.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/Lookup.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/MultiplexExternalSemaSource.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/ObjCMethodList.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/Overload.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/Ownership.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/Scope.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/ScopeInfo.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/Sema.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/SemaInternal.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/Template.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/TemplateDeduction.h stable/9/contrib/llvm/tools/clang/include/clang/Sema/TypoCorrection.h stable/9/contrib/llvm/tools/clang/include/clang/Serialization/ASTBitCodes.h stable/9/contrib/llvm/tools/clang/include/clang/Serialization/ASTReader.h stable/9/contrib/llvm/tools/clang/include/clang/Serialization/ASTWriter.h stable/9/contrib/llvm/tools/clang/include/clang/Serialization/ContinuousRangeMap.h stable/9/contrib/llvm/tools/clang/include/clang/Serialization/Module.h stable/9/contrib/llvm/tools/clang/include/clang/Serialization/ModuleManager.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Analyses.def stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/AnalyzerOptions.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporter.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugReporterVisitor.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/BugType.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/BugReporter/PathDiagnostic.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/Checker.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerManager.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerOptInfo.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/CheckerRegistry.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathDiagnosticConsumers.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/APSIntType.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/AnalysisManager.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/BasicValueFactory.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CheckerContext.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CoreEngine.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Environment.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExplodedGraph.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/FunctionSummary.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/MemRegion.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramState.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ProgramStateTrait.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SValBuilder.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SVals.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/Store.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SubEngine.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SymbolManager.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Core/PathSensitive/WorkList.h stable/9/contrib/llvm/tools/clang/include/clang/StaticAnalyzer/Frontend/CheckerRegistration.h stable/9/contrib/llvm/tools/clang/include/clang/Tooling/CommonOptionsParser.h stable/9/contrib/llvm/tools/clang/include/clang/Tooling/CompilationDatabase.h stable/9/contrib/llvm/tools/clang/include/clang/Tooling/FileMatchTrie.h stable/9/contrib/llvm/tools/clang/include/clang/Tooling/JSONCompilationDatabase.h stable/9/contrib/llvm/tools/clang/include/clang/Tooling/Refactoring.h stable/9/contrib/llvm/tools/clang/include/clang/Tooling/Tooling.h stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/ARCMT.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/FileRemapper.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/Internals.h stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/ObjCMT.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/PlistReporter.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransAPIUses.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransARCAssign.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransAutoreleasePool.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransBlockObjCVariable.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransEmptyStatementsAndDealloc.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransGCAttrs.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransGCCalls.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransProperties.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransUnbridgedCasts.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransUnusedInitDelegate.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/TransformActions.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/Transforms.cpp stable/9/contrib/llvm/tools/clang/lib/ARCMigrate/Transforms.h stable/9/contrib/llvm/tools/clang/lib/AST/APValue.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ASTConsumer.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ASTContext.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ASTDiagnostic.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ASTImporter.cpp stable/9/contrib/llvm/tools/clang/lib/AST/AttrImpl.cpp stable/9/contrib/llvm/tools/clang/lib/AST/CXXABI.h stable/9/contrib/llvm/tools/clang/lib/AST/CXXInheritance.cpp stable/9/contrib/llvm/tools/clang/lib/AST/Comment.cpp stable/9/contrib/llvm/tools/clang/lib/AST/CommentBriefParser.cpp stable/9/contrib/llvm/tools/clang/lib/AST/CommentCommandTraits.cpp stable/9/contrib/llvm/tools/clang/lib/AST/CommentLexer.cpp stable/9/contrib/llvm/tools/clang/lib/AST/CommentParser.cpp stable/9/contrib/llvm/tools/clang/lib/AST/CommentSema.cpp stable/9/contrib/llvm/tools/clang/lib/AST/Decl.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclBase.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclCXX.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclFriend.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclGroup.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclObjC.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclPrinter.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclTemplate.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DeclarationName.cpp stable/9/contrib/llvm/tools/clang/lib/AST/DumpXML.cpp stable/9/contrib/llvm/tools/clang/lib/AST/Expr.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ExprCXX.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ExprClassification.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ExternalASTSource.cpp stable/9/contrib/llvm/tools/clang/lib/AST/InheritViz.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ItaniumCXXABI.cpp stable/9/contrib/llvm/tools/clang/lib/AST/ItaniumMangle.cpp stable/9/contrib/llvm/tools/clang/lib/AST/LambdaMangleContext.cpp stable/9/contrib/llvm/tools/clang/lib/AST/Mangle.cpp stable/9/contrib/llvm/tools/clang/lib/AST/MicrosoftCXXABI.cpp stable/9/contrib/llvm/tools/clang/lib/AST/MicrosoftMangle.cpp stable/9/contrib/llvm/tools/clang/lib/AST/NSAPI.cpp stable/9/contrib/llvm/tools/clang/lib/AST/NestedNameSpecifier.cpp stable/9/contrib/llvm/tools/clang/lib/AST/RawCommentList.cpp stable/9/contrib/llvm/tools/clang/lib/AST/RecordLayout.cpp stable/9/contrib/llvm/tools/clang/lib/AST/RecordLayoutBuilder.cpp stable/9/contrib/llvm/tools/clang/lib/AST/Stmt.cpp stable/9/contrib/llvm/tools/clang/lib/AST/StmtPrinter.cpp stable/9/contrib/llvm/tools/clang/lib/AST/StmtProfile.cpp stable/9/contrib/llvm/tools/clang/lib/AST/TemplateBase.cpp stable/9/contrib/llvm/tools/clang/lib/AST/TemplateName.cpp stable/9/contrib/llvm/tools/clang/lib/AST/Type.cpp stable/9/contrib/llvm/tools/clang/lib/AST/TypeLoc.cpp stable/9/contrib/llvm/tools/clang/lib/AST/TypePrinter.cpp stable/9/contrib/llvm/tools/clang/lib/AST/VTableBuilder.cpp stable/9/contrib/llvm/tools/clang/lib/ASTMatchers/ASTMatchFinder.cpp stable/9/contrib/llvm/tools/clang/lib/ASTMatchers/ASTMatchersInternal.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/AnalysisDeclContext.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/BodyFarm.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/BodyFarm.h stable/9/contrib/llvm/tools/clang/lib/Analysis/CFG.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/CFGStmtMap.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/CallGraph.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/CocoaConventions.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/FormatString.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/FormatStringParsing.h stable/9/contrib/llvm/tools/clang/lib/Analysis/LiveVariables.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/PrintfFormatString.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/ReachableCode.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/ScanfFormatString.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/ThreadSafety.cpp stable/9/contrib/llvm/tools/clang/lib/Analysis/UninitializedValues.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/Builtins.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/Diagnostic.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/DiagnosticIDs.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/FileManager.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/FileSystemStatCache.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/IdentifierTable.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/LangOptions.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/Module.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/SourceLocation.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/SourceManager.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/TargetInfo.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/TokenKinds.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/Version.cpp stable/9/contrib/llvm/tools/clang/lib/Basic/VersionTuple.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/ABIInfo.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/BackendUtil.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGBlocks.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGBuilder.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCUDANV.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCUDARuntime.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCXX.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCXXABI.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCall.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCall.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGClass.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGCleanup.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDecl.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGDeclCXX.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGException.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGExpr.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGExprAgg.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGExprCXX.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGExprComplex.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGExprConstant.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGExprScalar.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGObjC.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGObjCGNU.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGObjCMac.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGObjCRuntime.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGOpenCLRuntime.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGOpenCLRuntime.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGRTTI.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayout.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGStmt.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGVTables.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CGValue.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenAction.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenFunction.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenModule.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTBAA.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/CodeGenTypes.h stable/9/contrib/llvm/tools/clang/lib/CodeGen/ItaniumCXXABI.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/MicrosoftCXXABI.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/ModuleBuilder.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.cpp stable/9/contrib/llvm/tools/clang/lib/CodeGen/TargetInfo.h stable/9/contrib/llvm/tools/clang/lib/Driver/Action.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/ArgList.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/CC1AsOptions.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/Compilation.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/Driver.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/InputInfo.h stable/9/contrib/llvm/tools/clang/lib/Driver/Job.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/OptTable.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/Option.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/Phases.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/SanitizerArgs.h stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChain.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/ToolChains.h stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/Tools.h stable/9/contrib/llvm/tools/clang/lib/Driver/Types.cpp stable/9/contrib/llvm/tools/clang/lib/Driver/WindowsToolChain.cpp stable/9/contrib/llvm/tools/clang/lib/Edit/Commit.cpp stable/9/contrib/llvm/tools/clang/lib/Edit/EditedSource.cpp stable/9/contrib/llvm/tools/clang/lib/Edit/RewriteObjCFoundationAPI.cpp stable/9/contrib/llvm/tools/clang/lib/Format/Format.cpp stable/9/contrib/llvm/tools/clang/lib/Format/TokenAnnotator.cpp stable/9/contrib/llvm/tools/clang/lib/Format/TokenAnnotator.h stable/9/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.cpp stable/9/contrib/llvm/tools/clang/lib/Format/UnwrappedLineParser.h stable/9/contrib/llvm/tools/clang/lib/Frontend/ASTConsumers.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/ASTMerge.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/ASTUnit.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/CacheTokens.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/ChainedIncludesSource.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/CompilerInstance.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/CreateInvocationFromCommandLine.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/DependencyFile.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/DependencyGraph.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/DiagnosticRenderer.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/FrontendActions.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/FrontendOptions.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/InitHeaderSearch.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/InitPreprocessor.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/LayoutOverrideSource.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/LogDiagnosticPrinter.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/MultiplexConsumer.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/PrintPreprocessedOutput.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/SerializedDiagnosticPrinter.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/TextDiagnostic.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticBuffer.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/TextDiagnosticPrinter.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/VerifyDiagnosticConsumer.cpp stable/9/contrib/llvm/tools/clang/lib/Frontend/Warnings.cpp stable/9/contrib/llvm/tools/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp stable/9/contrib/llvm/tools/clang/lib/Headers/altivec.h stable/9/contrib/llvm/tools/clang/lib/Headers/avx2intrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/avxintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/cpuid.h stable/9/contrib/llvm/tools/clang/lib/Headers/emmintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/f16cintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/immintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/mm3dnow.h stable/9/contrib/llvm/tools/clang/lib/Headers/mm_malloc.h stable/9/contrib/llvm/tools/clang/lib/Headers/module.map stable/9/contrib/llvm/tools/clang/lib/Headers/pmmintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/smmintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/stdalign.h stable/9/contrib/llvm/tools/clang/lib/Headers/stddef.h stable/9/contrib/llvm/tools/clang/lib/Headers/stdint.h stable/9/contrib/llvm/tools/clang/lib/Headers/tmmintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/unwind.h stable/9/contrib/llvm/tools/clang/lib/Headers/x86intrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/xmmintrin.h stable/9/contrib/llvm/tools/clang/lib/Headers/xopintrin.h stable/9/contrib/llvm/tools/clang/lib/Lex/HeaderMap.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/HeaderSearch.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/Lexer.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/LiteralSupport.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/MacroArgs.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/MacroInfo.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/ModuleMap.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/PPDirectives.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/PPExpressions.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/PPLexerChange.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/PPMacroExpansion.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/PTHLexer.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/Pragma.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/PreprocessingRecord.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/Preprocessor.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/PreprocessorLexer.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/TokenConcatenation.cpp stable/9/contrib/llvm/tools/clang/lib/Lex/TokenLexer.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseAST.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseCXXInlineMethods.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseDecl.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseDeclCXX.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseExpr.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseExprCXX.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseInit.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseObjc.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParsePragma.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParsePragma.h stable/9/contrib/llvm/tools/clang/lib/Parse/ParseStmt.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseTemplate.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/ParseTentative.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/Parser.cpp stable/9/contrib/llvm/tools/clang/lib/Parse/RAIIObjectsForParser.h stable/9/contrib/llvm/tools/clang/lib/Rewrite/Core/DeltaTree.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Core/HTMLRewrite.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Core/Rewriter.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Core/TokenRewriter.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/FixItRewriter.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/FrontendActions.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/InclusionRewriter.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/RewriteMacros.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/RewriteModernObjC.cpp stable/9/contrib/llvm/tools/clang/lib/Rewrite/Frontend/RewriteObjC.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/AnalysisBasedWarnings.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/AttributeList.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/CodeCompleteConsumer.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/DeclSpec.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/IdentifierResolver.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/JumpDiagnostics.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/MultiplexExternalSemaSource.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/ScopeInfo.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/Sema.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaAccess.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaAttr.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaCXXScopeSpec.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaCast.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaChecking.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaCodeComplete.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclAttr.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclCXX.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDeclObjC.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExceptionSpec.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExpr.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExprCXX.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExprMember.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaExprObjC.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaFixItUtils.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaInit.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaLambda.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaLookup.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaObjCProperty.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaOverload.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaPseudoObject.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaStmt.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaStmtAsm.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaStmtAttr.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaTemplate.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaTemplateDeduction.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiate.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaTemplateVariadic.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/SemaType.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/TargetAttributesSema.cpp stable/9/contrib/llvm/tools/clang/lib/Sema/TreeTransform.h stable/9/contrib/llvm/tools/clang/lib/Sema/TypeLocBuilder.h stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTCommon.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTCommon.h stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTReader.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTReaderDecl.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTReaderInternals.h stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTReaderStmt.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTWriter.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTWriterDecl.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/ASTWriterStmt.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/GeneratePCH.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/Module.cpp stable/9/contrib/llvm/tools/clang/lib/Serialization/ModuleManager.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/AnalyzerStatsChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ArrayBoundChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ArrayBoundCheckerV2.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BoolAssignmentChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/BuiltinFunctionChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CStringSyntaxChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CallAndMessageChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CastSizeChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CastToStructChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckObjCDealloc.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckObjCInstMethSignature.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckSizeofPointer.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/CheckerDocumentation.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/Checkers.td stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ChrootChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ClangSACheckers.h stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DeadStoresChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DebugCheckers.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DereferenceChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DirectIvarAssignment.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DivZeroChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/DynamicTypePropagation.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ExprInspectionChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/FixedAddressChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/GenericTaintChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IdempotentOperationChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/IvarInvalidationChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/LLVMConventionsChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MacOSXAPIChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocOverflowSecurityChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/MallocSizeofChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NSAutoreleasePoolChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NSErrorChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/NoReturnFunctionChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCAtSyncChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCContainersASTChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCContainersChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCMissingSuperCallChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCSelfInitChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ObjCUnusedIVarsChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PointerArithChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PointerSubChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/PthreadLockChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/RetainCountChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ReturnPointerRangeChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/ReturnUndefChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/SimpleStreamChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/StackAddrEscapeChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/StreamChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/TaintTesterChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/TraversalChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefBranchChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefCapturedBlockVarChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefResultChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefinedArraySubscriptChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UndefinedAssignmentChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/UnreachableCodeChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/VLASizeChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Checkers/VirtualCallChecker.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/APSIntType.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/AnalysisManager.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporter.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CallEvent.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerManager.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CheckerRegistry.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Environment.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExplodedGraph.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCXX.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ExprEngineObjC.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/FunctionSummary.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/HTMLDiagnostics.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/MemRegion.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PathDiagnostic.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/ProgramState.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RangeConstraintManager.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/RegionStore.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SVals.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleConstraintManager.h stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/Store.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/SymbolManager.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Core/TextPathDiagnostics.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/CheckerRegistration.cpp stable/9/contrib/llvm/tools/clang/lib/StaticAnalyzer/Frontend/FrontendActions.cpp stable/9/contrib/llvm/tools/clang/lib/Tooling/CommonOptionsParser.cpp stable/9/contrib/llvm/tools/clang/lib/Tooling/CompilationDatabase.cpp stable/9/contrib/llvm/tools/clang/lib/Tooling/FileMatchTrie.cpp stable/9/contrib/llvm/tools/clang/lib/Tooling/JSONCompilationDatabase.cpp stable/9/contrib/llvm/tools/clang/lib/Tooling/Refactoring.cpp stable/9/contrib/llvm/tools/clang/lib/Tooling/Tooling.cpp stable/9/contrib/llvm/tools/clang/tools/driver/cc1_main.cpp stable/9/contrib/llvm/tools/clang/tools/driver/cc1as_main.cpp stable/9/contrib/llvm/tools/clang/tools/driver/driver.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/ClangASTNodesEmitter.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/ClangAttrEmitter.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/ClangCommentCommandInfoEmitter.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/ClangCommentHTMLTagsEmitter.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/ClangDiagnosticsEmitter.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/NeonEmitter.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/OptParserEmitter.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/TableGen.cpp stable/9/contrib/llvm/tools/clang/utils/TableGen/TableGenBackends.h stable/9/contrib/llvm/tools/llc/llc.cpp stable/9/contrib/llvm/tools/lli/RecordingMemoryManager.cpp stable/9/contrib/llvm/tools/lli/RecordingMemoryManager.h stable/9/contrib/llvm/tools/lli/RemoteTarget.h stable/9/contrib/llvm/tools/lli/lli.cpp stable/9/contrib/llvm/tools/llvm-ar/llvm-ar.cpp stable/9/contrib/llvm/tools/llvm-as/llvm-as.cpp stable/9/contrib/llvm/tools/llvm-bcanalyzer/llvm-bcanalyzer.cpp stable/9/contrib/llvm/tools/llvm-diff/DiffConsumer.cpp stable/9/contrib/llvm/tools/llvm-diff/DiffConsumer.h stable/9/contrib/llvm/tools/llvm-diff/DiffLog.cpp stable/9/contrib/llvm/tools/llvm-diff/DifferenceEngine.cpp stable/9/contrib/llvm/tools/llvm-diff/DifferenceEngine.h stable/9/contrib/llvm/tools/llvm-diff/llvm-diff.cpp stable/9/contrib/llvm/tools/llvm-dis/llvm-dis.cpp stable/9/contrib/llvm/tools/llvm-extract/llvm-extract.cpp stable/9/contrib/llvm/tools/llvm-link/llvm-link.cpp stable/9/contrib/llvm/tools/llvm-mc/Disassembler.cpp stable/9/contrib/llvm/tools/llvm-mc/Disassembler.h stable/9/contrib/llvm/tools/llvm-mc/llvm-mc.cpp stable/9/contrib/llvm/tools/llvm-nm/llvm-nm.cpp stable/9/contrib/llvm/tools/llvm-objdump/MachODump.cpp stable/9/contrib/llvm/tools/llvm-objdump/llvm-objdump.cpp stable/9/contrib/llvm/tools/llvm-objdump/llvm-objdump.h stable/9/contrib/llvm/tools/llvm-prof/llvm-prof.cpp stable/9/contrib/llvm/tools/llvm-ranlib/llvm-ranlib.cpp stable/9/contrib/llvm/tools/llvm-readobj/llvm-readobj.cpp stable/9/contrib/llvm/tools/llvm-rtdyld/llvm-rtdyld.cpp stable/9/contrib/llvm/tools/llvm-stress/llvm-stress.cpp stable/9/contrib/llvm/tools/macho-dump/macho-dump.cpp stable/9/contrib/llvm/tools/opt/AnalysisWrappers.cpp stable/9/contrib/llvm/tools/opt/GraphPrinters.cpp stable/9/contrib/llvm/tools/opt/PrintSCC.cpp stable/9/contrib/llvm/tools/opt/opt.cpp stable/9/contrib/llvm/utils/TableGen/AsmMatcherEmitter.cpp stable/9/contrib/llvm/utils/TableGen/AsmWriterEmitter.cpp stable/9/contrib/llvm/utils/TableGen/CodeEmitterGen.cpp stable/9/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.cpp stable/9/contrib/llvm/utils/TableGen/CodeGenDAGPatterns.h stable/9/contrib/llvm/utils/TableGen/CodeGenInstruction.cpp stable/9/contrib/llvm/utils/TableGen/CodeGenInstruction.h stable/9/contrib/llvm/utils/TableGen/CodeGenIntrinsics.h stable/9/contrib/llvm/utils/TableGen/CodeGenMapTable.cpp stable/9/contrib/llvm/utils/TableGen/CodeGenRegisters.cpp stable/9/contrib/llvm/utils/TableGen/CodeGenRegisters.h stable/9/contrib/llvm/utils/TableGen/CodeGenSchedule.cpp stable/9/contrib/llvm/utils/TableGen/CodeGenSchedule.h stable/9/contrib/llvm/utils/TableGen/CodeGenTarget.cpp stable/9/contrib/llvm/utils/TableGen/CodeGenTarget.h stable/9/contrib/llvm/utils/TableGen/DAGISelMatcher.cpp stable/9/contrib/llvm/utils/TableGen/DAGISelMatcher.h stable/9/contrib/llvm/utils/TableGen/DAGISelMatcherEmitter.cpp stable/9/contrib/llvm/utils/TableGen/DAGISelMatcherGen.cpp stable/9/contrib/llvm/utils/TableGen/DFAPacketizerEmitter.cpp stable/9/contrib/llvm/utils/TableGen/DisassemblerEmitter.cpp stable/9/contrib/llvm/utils/TableGen/FixedLenDecoderEmitter.cpp stable/9/contrib/llvm/utils/TableGen/InstrInfoEmitter.cpp stable/9/contrib/llvm/utils/TableGen/IntrinsicEmitter.cpp stable/9/contrib/llvm/utils/TableGen/PseudoLoweringEmitter.cpp stable/9/contrib/llvm/utils/TableGen/RegisterInfoEmitter.cpp stable/9/contrib/llvm/utils/TableGen/SequenceToOffsetTable.h stable/9/contrib/llvm/utils/TableGen/SetTheory.cpp stable/9/contrib/llvm/utils/TableGen/SetTheory.h stable/9/contrib/llvm/utils/TableGen/StringToOffsetTable.h stable/9/contrib/llvm/utils/TableGen/SubtargetEmitter.cpp stable/9/contrib/llvm/utils/TableGen/TableGen.cpp stable/9/contrib/llvm/utils/TableGen/TableGenBackends.h stable/9/contrib/llvm/utils/TableGen/X86DisassemblerShared.h stable/9/contrib/llvm/utils/TableGen/X86DisassemblerTables.cpp stable/9/contrib/llvm/utils/TableGen/X86DisassemblerTables.h stable/9/contrib/llvm/utils/TableGen/X86RecognizableInstr.cpp stable/9/contrib/llvm/utils/TableGen/X86RecognizableInstr.h stable/9/etc/mtree/BSD.include.dist stable/9/lib/clang/Makefile stable/9/lib/clang/clang.build.mk stable/9/lib/clang/include/Makefile stable/9/lib/clang/include/clang/Basic/Version.inc stable/9/lib/clang/include/llvm/Config/config.h stable/9/lib/clang/include/llvm/Config/llvm-config.h stable/9/lib/clang/libclanganalysis/Makefile stable/9/lib/clang/libclangarcmigrate/Makefile stable/9/lib/clang/libclangast/Makefile stable/9/lib/clang/libclangbasic/Makefile stable/9/lib/clang/libclangcodegen/Makefile stable/9/lib/clang/libclangedit/Makefile stable/9/lib/clang/libclangfrontend/Makefile stable/9/lib/clang/libclanglex/Makefile stable/9/lib/clang/libclangparse/Makefile stable/9/lib/clang/libclangrewritefrontend/Makefile stable/9/lib/clang/libclangsema/Makefile stable/9/lib/clang/libclangserialization/Makefile stable/9/lib/clang/libclangstaticanalyzercheckers/Makefile stable/9/lib/clang/libclangstaticanalyzercore/Makefile stable/9/lib/clang/libclangstaticanalyzerfrontend/Makefile stable/9/lib/clang/libllvmanalysis/Makefile stable/9/lib/clang/libllvmarmasmparser/Makefile stable/9/lib/clang/libllvmarmcodegen/Makefile stable/9/lib/clang/libllvmarmdesc/Makefile stable/9/lib/clang/libllvmarmdisassembler/Makefile stable/9/lib/clang/libllvmasmprinter/Makefile stable/9/lib/clang/libllvmbitreader/Makefile stable/9/lib/clang/libllvmbitwriter/Makefile stable/9/lib/clang/libllvmcodegen/Makefile stable/9/lib/clang/libllvmcore/Makefile stable/9/lib/clang/libllvmdebuginfo/Makefile stable/9/lib/clang/libllvminstrumentation/Makefile stable/9/lib/clang/libllvmipa/Makefile stable/9/lib/clang/libllvmlinker/Makefile stable/9/lib/clang/libllvmmc/Makefile stable/9/lib/clang/libllvmmcdisassembler/Makefile stable/9/lib/clang/libllvmmcjit/Makefile stable/9/lib/clang/libllvmmipscodegen/Makefile stable/9/lib/clang/libllvmmipsdesc/Makefile stable/9/lib/clang/libllvmmipsdisassembler/Makefile stable/9/lib/clang/libllvmobject/Makefile stable/9/lib/clang/libllvmpowerpccodegen/Makefile stable/9/lib/clang/libllvmscalaropts/Makefile stable/9/lib/clang/libllvmsupport/Makefile stable/9/lib/clang/libllvmtablegen/Makefile stable/9/lib/clang/libllvmtarget/Makefile stable/9/lib/clang/libllvmtransformutils/Makefile stable/9/lib/clang/libllvmvectorize/Makefile stable/9/lib/clang/libllvmx86asmparser/Makefile stable/9/lib/clang/libllvmx86codegen/Makefile stable/9/lib/clang/libllvmx86disassembler/Makefile stable/9/tools/build/mk/OptionalObsoleteFiles.inc stable/9/usr.bin/clang/bugpoint/Makefile stable/9/usr.bin/clang/bugpoint/bugpoint.1 stable/9/usr.bin/clang/clang-tblgen/Makefile stable/9/usr.bin/clang/clang/Makefile stable/9/usr.bin/clang/clang/clang.1 stable/9/usr.bin/clang/llc/Makefile stable/9/usr.bin/clang/llc/llc.1 stable/9/usr.bin/clang/lli/Makefile stable/9/usr.bin/clang/lli/lli.1 stable/9/usr.bin/clang/llvm-ar/Makefile stable/9/usr.bin/clang/llvm-ar/llvm-ar.1 stable/9/usr.bin/clang/llvm-as/Makefile stable/9/usr.bin/clang/llvm-as/llvm-as.1 stable/9/usr.bin/clang/llvm-bcanalyzer/Makefile stable/9/usr.bin/clang/llvm-bcanalyzer/llvm-bcanalyzer.1 stable/9/usr.bin/clang/llvm-diff/Makefile stable/9/usr.bin/clang/llvm-diff/llvm-diff.1 stable/9/usr.bin/clang/llvm-dis/Makefile stable/9/usr.bin/clang/llvm-dis/llvm-dis.1 stable/9/usr.bin/clang/llvm-extract/Makefile stable/9/usr.bin/clang/llvm-extract/llvm-extract.1 stable/9/usr.bin/clang/llvm-link/Makefile stable/9/usr.bin/clang/llvm-link/llvm-link.1 stable/9/usr.bin/clang/llvm-mc/Makefile stable/9/usr.bin/clang/llvm-nm/Makefile stable/9/usr.bin/clang/llvm-nm/llvm-nm.1 stable/9/usr.bin/clang/llvm-objdump/Makefile stable/9/usr.bin/clang/llvm-prof/Makefile stable/9/usr.bin/clang/llvm-prof/llvm-prof.1 stable/9/usr.bin/clang/llvm-ranlib/Makefile stable/9/usr.bin/clang/llvm-ranlib/llvm-ranlib.1 stable/9/usr.bin/clang/llvm-rtdyld/Makefile stable/9/usr.bin/clang/macho-dump/Makefile stable/9/usr.bin/clang/opt/Makefile stable/9/usr.bin/clang/opt/opt.1 stable/9/usr.bin/clang/tblgen/Makefile stable/9/usr.bin/clang/tblgen/tblgen.1 Directory Properties: stable/9/contrib/gcc/ (props changed) stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) stable/9/etc/ (props changed) stable/9/etc/mtree/ (props changed) stable/9/lib/ (props changed) stable/9/lib/clang/ (props changed) stable/9/lib/clang/include/ (props changed) stable/9/tools/ (props changed) stable/9/tools/build/ (props changed) stable/9/usr.bin/ (props changed) stable/9/usr.bin/clang/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/Makefile.inc1 Thu Jul 4 20:17:04 2013 (r252723) @@ -371,7 +371,7 @@ IMAKE_MTREE= MTREE_CMD="nmtree ${MTREEFL # kernel stage KMAKEENV= ${WMAKEENV} -KMAKE= ${KMAKEENV} ${MAKE} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME} +KMAKE= ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME} # # buildworld Modified: stable/9/ObsoleteFiles.inc ============================================================================== --- stable/9/ObsoleteFiles.inc Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/ObsoleteFiles.inc Thu Jul 4 20:17:04 2013 (r252723) @@ -38,6 +38,38 @@ # xargs -n1 | sort | uniq -d; # done +# 20130704: new clang import which bumps version from 3.2 to 3.3. +OLD_FILES+=usr/include/clang/3.2/__wmmintrin_aes.h +OLD_FILES+=usr/include/clang/3.2/__wmmintrin_pclmul.h +OLD_FILES+=usr/include/clang/3.2/altivec.h +OLD_FILES+=usr/include/clang/3.2/ammintrin.h +OLD_FILES+=usr/include/clang/3.2/avx2intrin.h +OLD_FILES+=usr/include/clang/3.2/avxintrin.h +OLD_FILES+=usr/include/clang/3.2/bmi2intrin.h +OLD_FILES+=usr/include/clang/3.2/bmiintrin.h +OLD_FILES+=usr/include/clang/3.2/cpuid.h +OLD_FILES+=usr/include/clang/3.2/emmintrin.h +OLD_FILES+=usr/include/clang/3.2/f16cintrin.h +OLD_FILES+=usr/include/clang/3.2/fma4intrin.h +OLD_FILES+=usr/include/clang/3.2/fmaintrin.h +OLD_FILES+=usr/include/clang/3.2/immintrin.h +OLD_FILES+=usr/include/clang/3.2/lzcntintrin.h +OLD_FILES+=usr/include/clang/3.2/mm3dnow.h +OLD_FILES+=usr/include/clang/3.2/mm_malloc.h +OLD_FILES+=usr/include/clang/3.2/mmintrin.h +OLD_FILES+=usr/include/clang/3.2/module.map +OLD_FILES+=usr/include/clang/3.2/nmmintrin.h +OLD_FILES+=usr/include/clang/3.2/pmmintrin.h +OLD_FILES+=usr/include/clang/3.2/popcntintrin.h +OLD_FILES+=usr/include/clang/3.2/rtmintrin.h +OLD_FILES+=usr/include/clang/3.2/smmintrin.h +OLD_FILES+=usr/include/clang/3.2/tmmintrin.h +OLD_FILES+=usr/include/clang/3.2/unwind.h +OLD_FILES+=usr/include/clang/3.2/wmmintrin.h +OLD_FILES+=usr/include/clang/3.2/x86intrin.h +OLD_FILES+=usr/include/clang/3.2/xmmintrin.h +OLD_FILES+=usr/include/clang/3.2/xopintrin.h +OLD_DIRS+=usr/include/clang/3.2 # 20130701: vfs_mount.9 removed OLD_FILES+=usr/share/man/man9/vfs_mount.9.gz # 20130624: vinum.4 removed Modified: stable/9/contrib/gcc/unwind-dw2.c ============================================================================== --- stable/9/contrib/gcc/unwind-dw2.c Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/gcc/unwind-dw2.c Thu Jul 4 20:17:04 2013 (r252723) @@ -1438,17 +1438,6 @@ uw_init_context_1 (struct _Unwind_Contex context->ra = __builtin_extract_return_addr (outer_ra); } -#if defined(__clang__) && defined(__amd64__) -/* Some versions of clang don't save and restore all callee registers, if a - __builtin_eh_return() intrinsic is used in a function. This is particularly - bad on amd64. For now, use the following ugly hack to force it to assume - those registers are clobbered, when invoking __builtin_eh_return(), so it - will emit code to save and restore them. */ -#define CLOBBER_REGS_HACK \ - __asm __volatile(" " : : : "r15", "r14", "r13", "r12", "rbx", "rdx", "rax"); -#else -#define CLOBBER_REGS_HACK -#endif /* __clang__ */ /* Install TARGET into CURRENT so that we can return to it. This is a macro because __builtin_eh_return must be invoked in the context of @@ -1459,7 +1448,6 @@ uw_init_context_1 (struct _Unwind_Contex { \ long offset = uw_install_context_1 ((CURRENT), (TARGET)); \ void *handler = __builtin_frob_return_addr ((TARGET)->ra); \ - CLOBBER_REGS_HACK \ __builtin_eh_return (offset, handler); \ } \ while (0) Modified: stable/9/contrib/llvm/LICENSE.TXT ============================================================================== --- stable/9/contrib/llvm/LICENSE.TXT Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/LICENSE.TXT Thu Jul 4 20:17:04 2013 (r252723) @@ -4,7 +4,7 @@ LLVM Release License University of Illinois/NCSA Open Source License -Copyright (c) 2003-2012 University of Illinois at Urbana-Champaign. +Copyright (c) 2003-2013 University of Illinois at Urbana-Champaign. All rights reserved. Developed by: @@ -64,7 +64,7 @@ Program Directory Autoconf llvm/autoconf llvm/projects/ModuleMaker/autoconf llvm/projects/sample/autoconf -CellSPU backend llvm/lib/Target/CellSPU/README.txt Google Test llvm/utils/unittest/googletest OpenBSD regex llvm/lib/Support/{reg*, COPYRIGHT.regex} pyyaml tests llvm/test/YAMLParser/{*.data, LICENSE.TXT} +ARM contributions llvm/lib/Target/ARM/LICENSE.TXT Modified: stable/9/contrib/llvm/include/llvm-c/Core.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/Core.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/Core.h Thu Jul 4 20:17:04 2013 (r252723) @@ -18,13 +18,6 @@ #include "llvm/Support/DataTypes.h" #ifdef __cplusplus - -/* Need these includes to support the LLVM 'cast' template for the C++ 'wrap' - and 'unwrap' conversion functions. */ -#include "llvm/IRBuilder.h" -#include "llvm/Module.h" -#include "llvm/PassRegistry.h" - extern "C" { #endif @@ -60,11 +53,6 @@ extern "C" { * with C++ due to name mangling. So in addition to C, this interface enables * tools written in such languages. * - * When included into a C++ source file, also declares 'wrap' and 'unwrap' - * helpers to perform opaque reference<-->pointer conversions. These helpers - * are shorter and more tightly typed than writing the casts by hand when - * authoring bindings. In assert builds, they will do runtime type checking. - * * @{ */ @@ -173,10 +161,11 @@ typedef enum { LLVMUWTable = 1 << 30, LLVMNonLazyBind = 1 << 31 - /* FIXME: This attribute is currently not included in the C API as + /* FIXME: These attributes are currently not included in the C API as a temporary measure until the API/ABI impact to the C API is understood and the path forward agreed upon. - LLVMAddressSafety = 1ULL << 32 + LLVMAddressSafety = 1ULL << 32, + LLVMStackProtectStrongAttribute = 1ULL<<33 */ } LLVMAttribute; @@ -351,12 +340,74 @@ typedef enum { LLVMLandingPadFilter /**< A filter clause */ } LLVMLandingPadClauseTy; +typedef enum { + LLVMNotThreadLocal = 0, + LLVMGeneralDynamicTLSModel, + LLVMLocalDynamicTLSModel, + LLVMInitialExecTLSModel, + LLVMLocalExecTLSModel +} LLVMThreadLocalMode; + +typedef enum { + LLVMAtomicOrderingNotAtomic = 0, /**< A load or store which is not atomic */ + LLVMAtomicOrderingUnordered = 1, /**< Lowest level of atomicity, guarantees + somewhat sane results, lock free. */ + LLVMAtomicOrderingMonotonic = 2, /**< guarantees that if you take all the + operations affecting a specific address, + a consistent ordering exists */ + LLVMAtomicOrderingAcquire = 4, /**< Acquire provides a barrier of the sort + necessary to acquire a lock to access other + memory with normal loads and stores. */ + LLVMAtomicOrderingRelease = 5, /**< Release is similar to Acquire, but with + a barrier of the sort necessary to release + a lock. */ + LLVMAtomicOrderingAcquireRelease = 6, /**< provides both an Acquire and a + Release barrier (for fences and + operations which both read and write + memory). */ + LLVMAtomicOrderingSequentiallyConsistent = 7 /**< provides Acquire semantics + for loads and Release + semantics for stores. + Additionally, it guarantees + that a total ordering exists + between all + SequentiallyConsistent + operations. */ +} LLVMAtomicOrdering; + +typedef enum { + LLVMAtomicRMWBinOpXchg, /**< Set the new value and return the one old */ + LLVMAtomicRMWBinOpAdd, /**< Add a value and return the old one */ + LLVMAtomicRMWBinOpSub, /**< Subtract a value and return the old one */ + LLVMAtomicRMWBinOpAnd, /**< And a value and return the old one */ + LLVMAtomicRMWBinOpNand, /**< Not-And a value and return the old one */ + LLVMAtomicRMWBinOpOr, /**< OR a value and return the old one */ + LLVMAtomicRMWBinOpXor, /**< Xor a value and return the old one */ + LLVMAtomicRMWBinOpMax, /**< Sets the value if it's greater than the + original using a signed comparison and return + the old one */ + LLVMAtomicRMWBinOpMin, /**< Sets the value if it's Smaller than the + original using a signed comparison and return + the old one */ + LLVMAtomicRMWBinOpUMax, /**< Sets the value if it's greater than the + original using an unsigned comparison and return + the old one */ + LLVMAtomicRMWBinOpUMin /**< Sets the value if it's greater than the + original using an unsigned comparison and return + the old one */ +} LLVMAtomicRMWBinOp; + /** * @} */ void LLVMInitializeCore(LLVMPassRegistryRef R); +/** Deallocate and destroy all ManagedStatic variables. + @see llvm::llvm_shutdown + @see ManagedStatic */ +void LLVMShutdown(); + /*===-- Error handling ----------------------------------------------------===*/ @@ -1051,24 +1102,24 @@ LLVMTypeRef LLVMX86MMXType(void); macro(SwitchInst) \ macro(UnreachableInst) \ macro(ResumeInst) \ - macro(UnaryInstruction) \ - macro(AllocaInst) \ - macro(CastInst) \ - macro(BitCastInst) \ - macro(FPExtInst) \ - macro(FPToSIInst) \ - macro(FPToUIInst) \ - macro(FPTruncInst) \ - macro(IntToPtrInst) \ - macro(PtrToIntInst) \ - macro(SExtInst) \ - macro(SIToFPInst) \ - macro(TruncInst) \ - macro(UIToFPInst) \ - macro(ZExtInst) \ - macro(ExtractValueInst) \ - macro(LoadInst) \ - macro(VAArgInst) + macro(UnaryInstruction) \ + macro(AllocaInst) \ + macro(CastInst) \ + macro(BitCastInst) \ + macro(FPExtInst) \ + macro(FPToSIInst) \ + macro(FPToUIInst) \ + macro(FPTruncInst) \ + macro(IntToPtrInst) \ + macro(PtrToIntInst) \ + macro(SExtInst) \ + macro(SIToFPInst) \ + macro(TruncInst) \ + macro(UIToFPInst) \ + macro(ZExtInst) \ + macro(ExtractValueInst) \ + macro(LoadInst) \ + macro(VAArgInst) /** * @defgroup LLVMCCoreValueGeneral General APIs @@ -1600,6 +1651,10 @@ LLVMBool LLVMIsThreadLocal(LLVMValueRef void LLVMSetThreadLocal(LLVMValueRef GlobalVar, LLVMBool IsThreadLocal); LLVMBool LLVMIsGlobalConstant(LLVMValueRef GlobalVar); void LLVMSetGlobalConstant(LLVMValueRef GlobalVar, LLVMBool IsConstant); +LLVMThreadLocalMode LLVMGetThreadLocalMode(LLVMValueRef GlobalVar); +void LLVMSetThreadLocalMode(LLVMValueRef GlobalVar, LLVMThreadLocalMode Mode); +LLVMBool LLVMIsExternallyInitialized(LLVMValueRef GlobalVar); +void LLVMSetExternallyInitialized(LLVMValueRef GlobalVar, LLVMBool IsExtInit); /** * @} @@ -1688,6 +1743,13 @@ void LLVMSetGC(LLVMValueRef Fn, const ch void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA); /** + * Add a target-dependent attribute to a fuction + * @see llvm::AttrBuilder::addAttribute() + */ +void LLVMAddTargetDependentFunctionAttr(LLVMValueRef Fn, const char *A, + const char *V); + +/** * Obtain an attribute from a function. * * @see llvm::Function::getAttributes() @@ -2509,6 +2571,10 @@ LLVMValueRef LLVMBuildIsNotNull(LLVMBuil const char *Name); LLVMValueRef LLVMBuildPtrDiff(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS, const char *Name); +LLVMValueRef LLVMBuildAtomicRMW(LLVMBuilderRef B,LLVMAtomicRMWBinOp op, + LLVMValueRef PTR, LLVMValueRef Val, + LLVMAtomicOrdering ordering, + LLVMBool singleThread); /** * @} @@ -2547,6 +2613,15 @@ LLVMBool LLVMCreateMemoryBufferWithConte char **OutMessage); LLVMBool LLVMCreateMemoryBufferWithSTDIN(LLVMMemoryBufferRef *OutMemBuf, char **OutMessage); +LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRange(const char *InputData, + size_t InputDataLength, + const char *BufferName, + LLVMBool RequiresNullTerminator); +LLVMMemoryBufferRef LLVMCreateMemoryBufferWithMemoryRangeCopy(const char *InputData, + size_t InputDataLength, + const char *BufferName); +const char *LLVMGetBufferStart(LLVMMemoryBufferRef MemBuf); +size_t LLVMGetBufferSize(LLVMMemoryBufferRef MemBuf); void LLVMDisposeMemoryBuffer(LLVMMemoryBufferRef MemBuf); /** @@ -2619,6 +2694,30 @@ void LLVMDisposePassManager(LLVMPassMana */ /** + * @defgroup LLVMCCoreThreading Threading + * + * Handle the structures needed to make LLVM safe for multithreading. + * + * @{ + */ + +/** Allocate and initialize structures needed to make LLVM safe for + multithreading. The return value indicates whether multithreaded + initialization succeeded. Must be executed in isolation from all + other LLVM api calls. + @see llvm::llvm_start_multithreaded */ +LLVMBool LLVMStartMultithreaded(); + +/** Deallocate structures necessary to make LLVM safe for multithreading. + Must be executed in isolation from all other LLVM api calls. + @see llvm::llvm_stop_multithreaded */ +void LLVMStopMultithreaded(); + +/** Check whether LLVM is executing in thread-safe mode or not. + @see llvm::llvm_is_multithreaded */ +LLVMBool LLVMIsMultithreaded(); + +/** * @} */ @@ -2626,102 +2725,12 @@ void LLVMDisposePassManager(LLVMPassMana * @} */ -#ifdef __cplusplus -} +/** + * @} + */ -namespace llvm { - class MemoryBuffer; - class PassManagerBase; - - #define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \ - inline ty *unwrap(ref P) { \ - return reinterpret_cast(P); \ - } \ - \ - inline ref wrap(const ty *P) { \ - return reinterpret_cast(const_cast(P)); \ - } - - #define DEFINE_ISA_CONVERSION_FUNCTIONS(ty, ref) \ - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \ - \ - template \ - inline T *unwrap(ref P) { \ - return cast(unwrap(P)); \ - } - - #define DEFINE_STDCXX_CONVERSION_FUNCTIONS(ty, ref) \ - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \ - \ - template \ - inline T *unwrap(ref P) { \ - T *Q = (T*)unwrap(P); \ - assert(Q && "Invalid cast!"); \ - return Q; \ - } - - DEFINE_ISA_CONVERSION_FUNCTIONS (Type, LLVMTypeRef ) - DEFINE_ISA_CONVERSION_FUNCTIONS (Value, LLVMValueRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Module, LLVMModuleRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(BasicBlock, LLVMBasicBlockRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(IRBuilder<>, LLVMBuilderRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(MemoryBuffer, LLVMMemoryBufferRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(LLVMContext, LLVMContextRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(Use, LLVMUseRef ) - DEFINE_STDCXX_CONVERSION_FUNCTIONS(PassManagerBase, LLVMPassManagerRef ) - DEFINE_STDCXX_CONVERSION_FUNCTIONS(PassRegistry, LLVMPassRegistryRef ) - /* LLVMModuleProviderRef exists for historical reasons, but now just holds a - * Module. - */ - inline Module *unwrap(LLVMModuleProviderRef MP) { - return reinterpret_cast(MP); - } - - #undef DEFINE_STDCXX_CONVERSION_FUNCTIONS - #undef DEFINE_ISA_CONVERSION_FUNCTIONS - #undef DEFINE_SIMPLE_CONVERSION_FUNCTIONS - - /* Specialized opaque context conversions. - */ - inline LLVMContext **unwrap(LLVMContextRef* Tys) { - return reinterpret_cast(Tys); - } - - inline LLVMContextRef *wrap(const LLVMContext **Tys) { - return reinterpret_cast(const_cast(Tys)); - } - - /* Specialized opaque type conversions. - */ - inline Type **unwrap(LLVMTypeRef* Tys) { - return reinterpret_cast(Tys); - } - - inline LLVMTypeRef *wrap(Type **Tys) { - return reinterpret_cast(const_cast(Tys)); - } - - /* Specialized opaque value conversions. - */ - inline Value **unwrap(LLVMValueRef *Vals) { - return reinterpret_cast(Vals); - } - - template - inline T **unwrap(LLVMValueRef *Vals, unsigned Length) { - #ifdef DEBUG - for (LLVMValueRef *I = Vals, *E = Vals + Length; I != E; ++I) - cast(*I); - #endif - (void)Length; - return reinterpret_cast(Vals); - } - - inline LLVMValueRef *wrap(const Value **Vals) { - return reinterpret_cast(const_cast(Vals)); - } +#ifdef __cplusplus } - #endif /* !defined(__cplusplus) */ #endif /* !defined(LLVM_C_CORE_H) */ Modified: stable/9/contrib/llvm/include/llvm-c/Disassembler.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/Disassembler.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/Disassembler.h Thu Jul 4 20:17:04 2013 (r252723) @@ -139,13 +139,26 @@ extern "C" { * by passing a block of information in the DisInfo parameter and specifying the * TagType and callback functions as described above. These can all be passed * as NULL. If successful, this returns a disassembler context. If not, it - * returns NULL. + * returns NULL. This function is equivalent to calling LLVMCreateDisasmCPU() + * with an empty CPU name. */ LLVMDisasmContextRef LLVMCreateDisasm(const char *TripleName, void *DisInfo, int TagType, LLVMOpInfoCallback GetOpInfo, LLVMSymbolLookupCallback SymbolLookUp); /** + * Create a disassembler for the TripleName and a specific CPU. Symbolic + * disassembly is supported by passing a block of information in the DisInfo + * parameter and specifying the TagType and callback functions as described + * above. These can all be passed * as NULL. If successful, this returns a + * disassembler context. If not, it returns NULL. + */ +LLVMDisasmContextRef LLVMCreateDisasmCPU(const char *Triple, const char *CPU, + void *DisInfo, int TagType, + LLVMOpInfoCallback GetOpInfo, + LLVMSymbolLookupCallback SymbolLookUp); + +/** * Set the disassembler's options. Returns 1 if it can set the Options and 0 * otherwise. */ @@ -153,6 +166,10 @@ int LLVMSetDisasmOptions(LLVMDisasmConte /* The option to produce marked up assembly. */ #define LLVMDisassembler_Option_UseMarkup 1 +/* The option to print immediates as hex. */ +#define LLVMDisassembler_Option_PrintImmHex 2 +/* The option use the other assembler printer variant */ +#define LLVMDisassembler_Option_AsmPrinterVariant 4 /** * Dispose of a disassembler context. Modified: stable/9/contrib/llvm/include/llvm-c/ExecutionEngine.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/ExecutionEngine.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/ExecutionEngine.h Thu Jul 4 20:17:04 2013 (r252723) @@ -21,6 +21,7 @@ #include "llvm-c/Core.h" #include "llvm-c/Target.h" +#include "llvm-c/TargetMachine.h" #ifdef __cplusplus extern "C" { @@ -34,11 +35,19 @@ extern "C" { */ void LLVMLinkInJIT(void); +void LLVMLinkInMCJIT(void); void LLVMLinkInInterpreter(void); typedef struct LLVMOpaqueGenericValue *LLVMGenericValueRef; typedef struct LLVMOpaqueExecutionEngine *LLVMExecutionEngineRef; +struct LLVMMCJITCompilerOptions { + unsigned OptLevel; + LLVMCodeModel CodeModel; + LLVMBool NoFramePointerElim; + LLVMBool EnableFastISel; +}; + /*===-- Operations on generic values --------------------------------------===*/ LLVMGenericValueRef LLVMCreateGenericValueOfInt(LLVMTypeRef Ty, @@ -75,6 +84,31 @@ LLVMBool LLVMCreateJITCompilerForModule( unsigned OptLevel, char **OutError); +void LLVMInitializeMCJITCompilerOptions( + struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions); + +/** + * Create an MCJIT execution engine for a module, with the given options. It is + * the responsibility of the caller to ensure that all fields in Options up to + * the given SizeOfOptions are initialized. It is correct to pass a smaller + * value of SizeOfOptions that omits some fields. The canonical way of using + * this is: + * + * LLVMMCJITCompilerOptions options; + * LLVMInitializeMCJITCompilerOptions(&options, sizeof(options)); + * ... fill in those options you care about + * LLVMCreateMCJITCompilerForModule(&jit, mod, &options, sizeof(options), + * &error); + * + * Note that this is also correct, though possibly suboptimal: + * + * LLVMCreateMCJITCompilerForModule(&jit, mod, 0, 0, &error); + */ +LLVMBool LLVMCreateMCJITCompilerForModule( + LLVMExecutionEngineRef *OutJIT, LLVMModuleRef M, + struct LLVMMCJITCompilerOptions *Options, size_t SizeOfOptions, + char **OutError); + /** Deprecated: Use LLVMCreateExecutionEngineForModule instead. */ LLVMBool LLVMCreateExecutionEngine(LLVMExecutionEngineRef *OutEE, LLVMModuleProviderRef MP, @@ -123,7 +157,8 @@ LLVMBool LLVMRemoveModuleProvider(LLVMEx LLVMBool LLVMFindFunction(LLVMExecutionEngineRef EE, const char *Name, LLVMValueRef *OutFn); -void *LLVMRecompileAndRelinkFunction(LLVMExecutionEngineRef EE, LLVMValueRef Fn); +void *LLVMRecompileAndRelinkFunction(LLVMExecutionEngineRef EE, + LLVMValueRef Fn); LLVMTargetDataRef LLVMGetExecutionEngineTargetData(LLVMExecutionEngineRef EE); @@ -137,27 +172,7 @@ void *LLVMGetPointerToGlobal(LLVMExecuti */ #ifdef __cplusplus -} - -namespace llvm { - struct GenericValue; - class ExecutionEngine; - - #define DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ty, ref) \ - inline ty *unwrap(ref P) { \ - return reinterpret_cast(P); \ - } \ - \ - inline ref wrap(const ty *P) { \ - return reinterpret_cast(const_cast(P)); \ - } - - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(GenericValue, LLVMGenericValueRef ) - DEFINE_SIMPLE_CONVERSION_FUNCTIONS(ExecutionEngine, LLVMExecutionEngineRef) - - #undef DEFINE_SIMPLE_CONVERSION_FUNCTIONS -} - +} #endif /* defined(__cplusplus) */ #endif Modified: stable/9/contrib/llvm/include/llvm-c/Initialization.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/Initialization.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/Initialization.h Thu Jul 4 20:17:04 2013 (r252723) @@ -34,6 +34,7 @@ extern "C" { void LLVMInitializeCore(LLVMPassRegistryRef R); void LLVMInitializeTransformUtils(LLVMPassRegistryRef R); void LLVMInitializeScalarOpts(LLVMPassRegistryRef R); +void LLVMInitializeObjCARCOpts(LLVMPassRegistryRef R); void LLVMInitializeVectorization(LLVMPassRegistryRef R); void LLVMInitializeInstCombine(LLVMPassRegistryRef R); void LLVMInitializeIPO(LLVMPassRegistryRef R); Modified: stable/9/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/LinkTimeOptimizer.h Thu Jul 4 20:17:04 2013 (r252723) @@ -13,8 +13,8 @@ // //===----------------------------------------------------------------------===// -#ifndef __LTO_CAPI_H__ -#define __LTO_CAPI_H__ +#ifndef LLVM_C_LINKTIMEOPTIMIZER_H +#define LLVM_C_LINKTIMEOPTIMIZER_H #ifdef __cplusplus extern "C" { Modified: stable/9/contrib/llvm/include/llvm-c/Object.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/Object.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/Object.h Thu Jul 4 20:17:04 2013 (r252723) @@ -23,8 +23,6 @@ #include "llvm/Config/llvm-config.h" #ifdef __cplusplus -#include "llvm/Object/ObjectFile.h" - extern "C" { #endif @@ -99,50 +97,6 @@ const char *LLVMGetRelocationValueString #ifdef __cplusplus } - -namespace llvm { - namespace object { - inline ObjectFile *unwrap(LLVMObjectFileRef OF) { - return reinterpret_cast(OF); - } - - inline LLVMObjectFileRef wrap(const ObjectFile *OF) { - return reinterpret_cast(const_cast(OF)); - } - - inline section_iterator *unwrap(LLVMSectionIteratorRef SI) { - return reinterpret_cast(SI); - } - - inline LLVMSectionIteratorRef - wrap(const section_iterator *SI) { - return reinterpret_cast - (const_cast(SI)); - } - - inline symbol_iterator *unwrap(LLVMSymbolIteratorRef SI) { - return reinterpret_cast(SI); - } - - inline LLVMSymbolIteratorRef - wrap(const symbol_iterator *SI) { - return reinterpret_cast - (const_cast(SI)); - } - - inline relocation_iterator *unwrap(LLVMRelocationIteratorRef SI) { - return reinterpret_cast(SI); - } - - inline LLVMRelocationIteratorRef - wrap(const relocation_iterator *SI) { - return reinterpret_cast - (const_cast(SI)); - } - - } -} - #endif /* defined(__cplusplus) */ #endif Modified: stable/9/contrib/llvm/include/llvm-c/Target.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/Target.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/Target.h Thu Jul 4 20:17:04 2013 (r252723) @@ -235,29 +235,6 @@ void LLVMDisposeTargetData(LLVMTargetDat #ifdef __cplusplus } - -namespace llvm { - class DataLayout; - class TargetLibraryInfo; - - inline DataLayout *unwrap(LLVMTargetDataRef P) { - return reinterpret_cast(P); - } - - inline LLVMTargetDataRef wrap(const DataLayout *P) { - return reinterpret_cast(const_cast(P)); - } - - inline TargetLibraryInfo *unwrap(LLVMTargetLibraryInfoRef P) { - return reinterpret_cast(P); - } - - inline LLVMTargetLibraryInfoRef wrap(const TargetLibraryInfo *P) { - TargetLibraryInfo *X = const_cast(P); - return reinterpret_cast(X); - } -} - #endif /* defined(__cplusplus) */ #endif Modified: stable/9/contrib/llvm/include/llvm-c/TargetMachine.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/TargetMachine.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/TargetMachine.h Thu Jul 4 20:17:04 2013 (r252723) @@ -20,11 +20,12 @@ #define LLVM_C_TARGETMACHINE_H #include "llvm-c/Core.h" +#include "llvm-c/Target.h" #ifdef __cplusplus extern "C" { #endif -typedef struct LLVMTargetMachine *LLVMTargetMachineRef; +typedef struct LLVMOpaqueTargetMachine *LLVMTargetMachineRef; typedef struct LLVMTarget *LLVMTargetRef; typedef enum { @@ -113,30 +114,11 @@ LLVMTargetDataRef LLVMGetTargetMachineDa LLVMBool LLVMTargetMachineEmitToFile(LLVMTargetMachineRef T, LLVMModuleRef M, char *Filename, LLVMCodeGenFileType codegen, char **ErrorMessage); - - - +/** Compile the LLVM IR stored in \p M and store the result in \p OutMemBuf. */ +LLVMBool LLVMTargetMachineEmitToMemoryBuffer(LLVMTargetMachineRef T, LLVMModuleRef M, + LLVMCodeGenFileType codegen, char** ErrorMessage, LLVMMemoryBufferRef *OutMemBuf); #ifdef __cplusplus } - -namespace llvm { - class TargetMachine; - class Target; - - inline TargetMachine *unwrap(LLVMTargetMachineRef P) { - return reinterpret_cast(P); - } - inline Target *unwrap(LLVMTargetRef P) { - return reinterpret_cast(P); - } - inline LLVMTargetMachineRef wrap(const TargetMachine *P) { - return reinterpret_cast( - const_cast(P)); - } - inline LLVMTargetRef wrap(const Target * P) { - return reinterpret_cast(const_cast(P)); - } -} #endif #endif Modified: stable/9/contrib/llvm/include/llvm-c/Transforms/PassManagerBuilder.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/Transforms/PassManagerBuilder.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/Transforms/PassManagerBuilder.h Thu Jul 4 20:17:04 2013 (r252723) @@ -11,8 +11,8 @@ |* *| \*===----------------------------------------------------------------------===*/ -#ifndef LLVM_C_PASSMANAGERBUILDER -#define LLVM_C_PASSMANAGERBUILDER +#ifndef LLVM_C_TRANSFORMS_PASSMANAGERBUILDER_H +#define LLVM_C_TRANSFORMS_PASSMANAGERBUILDER_H #include "llvm-c/Core.h" @@ -77,8 +77,8 @@ LLVMPassManagerBuilderPopulateModulePass /** See llvm::PassManagerBuilder::populateLTOPassManager. */ void LLVMPassManagerBuilderPopulateLTOPassManager(LLVMPassManagerBuilderRef PMB, LLVMPassManagerRef PM, - bool Internalize, - bool RunInliner); + LLVMBool Internalize, + LLVMBool RunInliner); /** * @} @@ -86,16 +86,6 @@ void LLVMPassManagerBuilderPopulateLTOPa #ifdef __cplusplus } - -namespace llvm { - inline PassManagerBuilder *unwrap(LLVMPassManagerBuilderRef P) { - return reinterpret_cast(P); - } - - inline LLVMPassManagerBuilderRef wrap(PassManagerBuilder *P) { - return reinterpret_cast(P); - } -} #endif #endif Modified: stable/9/contrib/llvm/include/llvm-c/Transforms/Vectorize.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/Transforms/Vectorize.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/Transforms/Vectorize.h Thu Jul 4 20:17:04 2013 (r252723) @@ -39,6 +39,9 @@ void LLVMAddBBVectorizePass(LLVMPassMana /** See llvm::createLoopVectorizePass function. */ void LLVMAddLoopVectorizePass(LLVMPassManagerRef PM); +/** See llvm::createSLPVectorizerPass function. */ +void LLVMAddSLPVectorizePass(LLVMPassManagerRef PM); + /** * @} */ Modified: stable/9/contrib/llvm/include/llvm-c/lto.h ============================================================================== --- stable/9/contrib/llvm/include/llvm-c/lto.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm-c/lto.h Thu Jul 4 20:17:04 2013 (r252723) @@ -13,8 +13,8 @@ |* *| \*===----------------------------------------------------------------------===*/ -#ifndef LTO_H -#define LTO_H 1 +#ifndef LLVM_C_LTO_H +#define LLVM_C_LTO_H #include #include @@ -291,6 +291,13 @@ lto_codegen_compile_to_file(lto_code_gen extern void lto_codegen_debug_options(lto_code_gen_t cg, const char *); +/** + * Initializes LLVM disassemblers. + * FIXME: This doesn't really belong here. + */ +extern void +lto_initialize_disassembler(void); + #ifdef __cplusplus } #endif Modified: stable/9/contrib/llvm/include/llvm/ADT/APFloat.h ============================================================================== --- stable/9/contrib/llvm/include/llvm/ADT/APFloat.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm/ADT/APFloat.h Thu Jul 4 20:17:04 2013 (r252723) @@ -97,8 +97,8 @@ nexttoward. */ -#ifndef LLVM_FLOAT_H -#define LLVM_FLOAT_H +#ifndef LLVM_ADT_APFLOAT_H +#define LLVM_ADT_APFLOAT_H // APInt contains static functions implementing bignum arithmetic. #include "llvm/ADT/APInt.h" @@ -184,9 +184,9 @@ namespace llvm { APFloat(const fltSemantics &, integerPart); APFloat(const fltSemantics &, fltCategory, bool negative); APFloat(const fltSemantics &, uninitializedTag); + APFloat(const fltSemantics &, const APInt &); explicit APFloat(double d); explicit APFloat(float f); - explicit APFloat(const APInt &, bool isIEEE = false); APFloat(const APFloat &); ~APFloat(); @@ -300,7 +300,7 @@ namespace llvm { /* The definition of equality is not straightforward for floating point, so we won't use operator==. Use one of the following, or write whatever it is you really mean. */ - // bool operator==(const APFloat &) const; // DO NOT IMPLEMENT + bool operator==(const APFloat &) const LLVM_DELETED_FUNCTION; /* IEEE comparison with another floating point number (NaNs compare unordered, 0==-0). */ @@ -327,6 +327,7 @@ namespace llvm { bool isNegative() const { return sign; } bool isPosZero() const { return isZero() && !isNegative(); } bool isNegZero() const { return isZero() && isNegative(); } + bool isDenormal() const; APFloat& operator=(const APFloat &); @@ -422,7 +423,7 @@ namespace llvm { APInt convertQuadrupleAPFloatToAPInt() const; APInt convertF80LongDoubleAPFloatToAPInt() const; APInt convertPPCDoubleDoubleAPFloatToAPInt() const; - void initFromAPInt(const APInt& api, bool isIEEE = false); + void initFromAPInt(const fltSemantics *Sem, const APInt& api); void initFromHalfAPInt(const APInt& api); void initFromFloatAPInt(const APInt& api); void initFromDoubleAPInt(const APInt& api); @@ -462,4 +463,4 @@ namespace llvm { hash_code hash_value(const APFloat &Arg); } /* namespace llvm */ -#endif /* LLVM_FLOAT_H */ +#endif /* LLVM_ADT_APFLOAT_H */ Modified: stable/9/contrib/llvm/include/llvm/ADT/APInt.h ============================================================================== --- stable/9/contrib/llvm/include/llvm/ADT/APInt.h Thu Jul 4 20:13:22 2013 (r252722) +++ stable/9/contrib/llvm/include/llvm/ADT/APInt.h Thu Jul 4 20:17:04 2013 (r252723) @@ -12,8 +12,8 @@ // //===----------------------------------------------------------------------===// -#ifndef LLVM_APINT_H -#define LLVM_APINT_H +#ifndef LLVM_ADT_APINT_H +#define LLVM_ADT_APINT_H #include "llvm/ADT/ArrayRef.h" #include "llvm/Support/Compiler.h" @@ -274,7 +274,7 @@ public: initSlowCase(that); } -#if LLVM_USE_RVALUE_REFERENCES +#if LLVM_HAS_RVALUE_REFERENCES /// @brief Move Constructor. APInt(APInt&& that) : BitWidth(that.BitWidth), VAL(that.VAL) { that.BitWidth = 0; @@ -427,7 +427,7 @@ public: /// @returns the all-ones value for an APInt of the specified bit-width. /// @brief Get the all-ones value. static APInt getAllOnesValue(unsigned numBits) { - return APInt(numBits, -1ULL, true); + return APInt(numBits, UINT64_MAX, true); } /// @returns the '0' value for an APInt of the specified bit-width. @@ -498,13 +498,24 @@ public: if (loBitsSet == 0) return APInt(numBits, 0); if (loBitsSet == APINT_BITS_PER_WORD) - return APInt(numBits, -1ULL); + return APInt(numBits, UINT64_MAX); // For small values, return quickly. if (loBitsSet <= APINT_BITS_PER_WORD) - return APInt(numBits, -1ULL >> (APINT_BITS_PER_WORD - loBitsSet)); + return APInt(numBits, UINT64_MAX >> (APINT_BITS_PER_WORD - loBitsSet)); return getAllOnesValue(numBits).lshr(numBits - loBitsSet); } + /// \brief Return a value containing V broadcasted over NewLen bits. + static APInt getSplat(unsigned NewLen, const APInt &V) { + assert(NewLen >= V.getBitWidth() && "Can't splat to smaller bit width!"); + + APInt Val = V.zextOrSelf(NewLen); + for (unsigned I = V.getBitWidth(); I < NewLen; I <<= 1) + Val |= Val << I; + + return Val; + } + /// \brief Determine if two APInts have the same value, after zero-extending /// one of them (if needed!) to ensure that the bit-widths match. static bool isSameValue(const APInt &I1, const APInt &I2) { @@ -601,7 +612,7 @@ public: return AssignSlowCase(RHS); } -#if LLVM_USE_RVALUE_REFERENCES +#if LLVM_HAS_RVALUE_REFERENCES /// @brief Move assignment operator. APInt& operator=(APInt&& that) { if (!isSingleWord()) @@ -799,16 +810,7 @@ public: /// Signed divide this APInt by APInt RHS. /// @brief Signed division function for APInt. - APInt sdiv(const APInt &RHS) const { - if (isNegative()) - if (RHS.isNegative()) - return (-(*this)).udiv(-RHS); - else - return -((-(*this)).udiv(RHS)); - else if (RHS.isNegative()) - return -(this->udiv(-RHS)); - return this->udiv(RHS); - } + APInt sdiv(const APInt &RHS) const; /// Perform an unsigned remainder operation on this APInt with RHS being the /// divisor. Both this and RHS are treated as unsigned quantities for purposes @@ -821,16 +823,7 @@ public: /// Signed remainder operation on APInt. /// @brief Function for signed remainder operation. - APInt srem(const APInt &RHS) const { - if (isNegative()) - if (RHS.isNegative()) - return -((-(*this)).urem(-RHS)); - else - return -((-(*this)).urem(RHS)); - else if (RHS.isNegative()) - return this->urem(-RHS); - return this->urem(RHS); - } + APInt srem(const APInt &RHS) const; /// Sometimes it is convenient to divide two APInt values and obtain both the /// quotient and remainder. This function does both operations in the same @@ -842,24 +835,9 @@ public: APInt &Quotient, APInt &Remainder); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 21:57:10 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6B9F4875; Thu, 4 Jul 2013 21:57:10 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D38F1100; Thu, 4 Jul 2013 21:57:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64LvAhV059228; Thu, 4 Jul 2013 21:57:10 GMT (envelope-from smh@svn.freebsd.org) Received: (from smh@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64Lv9FW059220; Thu, 4 Jul 2013 21:57:09 GMT (envelope-from smh@svn.freebsd.org) Message-Id: <201307042157.r64Lv9FW059220@svn.freebsd.org> From: Steven Hartland Date: Thu, 4 Jul 2013 21:57: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: r252730 - in stable/9/sys: cam/ata cam/scsi geom 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.14 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, 04 Jul 2013 21:57:10 -0000 Author: smh Date: Thu Jul 4 21:57:09 2013 New Revision: 252730 URL: http://svnweb.freebsd.org/changeset/base/252730 Log: MFC r249940: Teach GEOM and CAM about the difference between the max "size" of r/w and delete requests. MFC r252657: Bump disk(9) ABI version to signify the addition of d_delmaxsize. Make the addition of the d_delmaxsize binary compatible. This allows storage drivers compiled for 9.0 and 9.1 to work by preserving the ABI for disks. Reviewed by: mav Modified: stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/scsi/scsi_da.c stable/9/sys/geom/geom_disk.c stable/9/sys/geom/geom_disk.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Thu Jul 4 21:31:28 2013 (r252729) +++ stable/9/sys/cam/ata/ata_da.c Thu Jul 4 21:57:09 2013 (r252730) @@ -1239,10 +1239,15 @@ adaregister(struct cam_periph *periph, v softc->disk->d_flags |= DISKFLAG_CANFLUSHCACHE; if (softc->flags & ADA_FLAG_CAN_TRIM) { softc->disk->d_flags |= DISKFLAG_CANDELETE; + softc->disk->d_delmaxsize = softc->params.secsize * + ATA_DSM_RANGE_MAX * + softc->trim_max_ranges; } else if ((softc->flags & ADA_FLAG_CAN_CFA) && !(softc->flags & ADA_FLAG_CAN_48BIT)) { softc->disk->d_flags |= DISKFLAG_CANDELETE; - } + softc->disk->d_delmaxsize = 256 * softc->params.secsize; + } else + softc->disk->d_delmaxsize = maxio; if ((cpi.hba_misc & PIM_UNMAPPED) != 0) softc->disk->d_flags |= DISKFLAG_UNMAPPED_BIO; strlcpy(softc->disk->d_descr, cgd->ident_data.model, Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Thu Jul 4 21:31:28 2013 (r252729) +++ stable/9/sys/cam/scsi/scsi_da.c Thu Jul 4 21:57:09 2013 (r252730) @@ -1064,8 +1064,11 @@ static void daasync(void *callback_arg, static void dasysctlinit(void *context, int pending); static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS); static int dadeletemethodsysctl(SYSCTL_HANDLER_ARGS); +static int dadeletemaxsysctl(SYSCTL_HANDLER_ARGS); static void dadeletemethodset(struct da_softc *softc, da_delete_methods delete_method); +static off_t dadeletemaxsize(struct da_softc *softc, + da_delete_methods delete_method); static void dadeletemethodchoose(struct da_softc *softc, da_delete_methods default_method); static void daprobedone(struct cam_periph *periph, union ccb *ccb); @@ -1692,6 +1695,10 @@ dasysctlinit(void *context, int pending) softc, 0, dadeletemethodsysctl, "A", "BIO_DELETE execution method"); SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), + OID_AUTO, "delete_max", CTLTYPE_U64 | CTLFLAG_RW, + softc, 0, dadeletemaxsysctl, "Q", + "Maximum BIO_DELETE size"); + SYSCTL_ADD_PROC(&softc->sysctl_ctx, SYSCTL_CHILDREN(softc->sysctl_tree), OID_AUTO, "minimum_cmd_size", CTLTYPE_INT | CTLFLAG_RW, &softc->minimum_cmd_size, 0, dacmdsizesysctl, "I", "Minimum CDB size"); @@ -1737,6 +1744,29 @@ dasysctlinit(void *context, int pending) } static int +dadeletemaxsysctl(SYSCTL_HANDLER_ARGS) +{ + int error; + uint64_t value; + struct da_softc *softc; + + softc = (struct da_softc *)arg1; + + value = softc->disk->d_delmaxsize; + error = sysctl_handle_64(oidp, &value, 0, req); + if ((error != 0) || (req->newptr == NULL)) + return (error); + + /* only accept values smaller than the calculated value */ + if (value > dadeletemaxsize(softc, softc->delete_method)) { + return (EINVAL); + } + softc->disk->d_delmaxsize = value; + + return (0); +} + +static int dacmdsizesysctl(SYSCTL_HANDLER_ARGS) { int error, value; @@ -1774,6 +1804,7 @@ dadeletemethodset(struct da_softc *softc softc->delete_method = delete_method; + softc->disk->d_delmaxsize = dadeletemaxsize(softc, delete_method); if (softc->delete_method > DA_DELETE_DISABLE) softc->disk->d_flags |= DISKFLAG_CANDELETE; @@ -1781,6 +1812,33 @@ dadeletemethodset(struct da_softc *softc softc->disk->d_flags &= ~DISKFLAG_CANDELETE; } +static off_t +dadeletemaxsize(struct da_softc *softc, da_delete_methods delete_method) +{ + off_t sectors; + + switch(delete_method) { + case DA_DELETE_UNMAP: + sectors = (off_t)softc->unmap_max_lba * softc->unmap_max_ranges; + break; + case DA_DELETE_ATA_TRIM: + sectors = (off_t)ATA_DSM_RANGE_MAX * softc->trim_max_ranges; + break; + case DA_DELETE_WS16: + sectors = (off_t)min(softc->ws_max_blks, WS16_MAX_BLKS); + break; + case DA_DELETE_ZERO: + case DA_DELETE_WS10: + sectors = (off_t)min(softc->ws_max_blks, WS10_MAX_BLKS); + break; + default: + return 0; + } + + return (off_t)softc->params.secsize * + min(sectors, (off_t)softc->params.sectors); +} + static void daprobedone(struct cam_periph *periph, union ccb *ccb) { @@ -2304,8 +2362,13 @@ skipstate: } else if (softc->delete_method == DA_DELETE_ZERO || softc->delete_method == DA_DELETE_WS10 || softc->delete_method == DA_DELETE_WS16) { + /* + * We calculate ws_max_blks here based off d_delmaxsize instead + * of using softc->ws_max_blks as it is absolute max for the + * device not the protocol max which may well be lower + */ uint64_t ws_max_blks; - ws_max_blks = softc->ws_max_blks / softc->params.secsize; + ws_max_blks = softc->disk->d_delmaxsize / softc->params.secsize; softc->delete_running = 1; lba = bp->bio_pblkno; count = 0; Modified: stable/9/sys/geom/geom_disk.c ============================================================================== --- stable/9/sys/geom/geom_disk.c Thu Jul 4 21:31:28 2013 (r252729) +++ stable/9/sys/geom/geom_disk.c Thu Jul 4 21:57:09 2013 (r252730) @@ -155,6 +155,13 @@ g_disk_access(struct g_provider *pp, int dp->d_name, dp->d_unit); dp->d_maxsize = DFLTPHYS; } + if (dp->d_delmaxsize == 0) { + if (bootverbose && dp->d_flags & DISKFLAG_CANDELETE) { + printf("WARNING: Disk drive %s%d has no " + "d_delmaxsize\n", dp->d_name, dp->d_unit); + } + dp->d_delmaxsize = dp->d_maxsize; + } } else if ((pp->acr + pp->acw + pp->ace) > 0 && (r + w + e) == 0) { if (dp->d_close != NULL) { g_disk_lock_giant(dp); @@ -299,6 +306,12 @@ g_disk_start(struct bio *bp) break; } do { + off_t d_maxsize; + + d_maxsize = (bp->bio_cmd == BIO_DELETE && + (dp->d_flags & DISKFLAG_LACKS_DELMAX) == 0) ? + dp->d_delmaxsize : dp->d_maxsize; + bp2->bio_offset += off; bp2->bio_length -= off; if ((bp->bio_flags & BIO_UNMAPPED) == 0) { @@ -313,18 +326,20 @@ g_disk_start(struct bio *bp) bp2->bio_ma_offset %= PAGE_SIZE; bp2->bio_ma_n -= off / PAGE_SIZE; } - if (bp2->bio_length > dp->d_maxsize) { + if (bp2->bio_length > d_maxsize) { /* * XXX: If we have a stripesize we should really - * use it here. + * use it here. Care should be taken in the delete + * case if this is done as deletes can be very + * sensitive to size given how they are processed. */ - bp2->bio_length = dp->d_maxsize; + bp2->bio_length = d_maxsize; if ((bp->bio_flags & BIO_UNMAPPED) != 0) { bp2->bio_ma_n = howmany( bp2->bio_ma_offset + bp2->bio_length, PAGE_SIZE); } - off += dp->d_maxsize; + off += d_maxsize; /* * To avoid a race, we need to grab the next bio * before we schedule this one. See "notes". @@ -603,7 +618,8 @@ void disk_create(struct disk *dp, int version) { - if (version != DISK_VERSION_02 && version != DISK_VERSION_01) { + if (version != DISK_VERSION_03 && version != DISK_VERSION_02 && + version != DISK_VERSION_01) { printf("WARNING: Attempt to add disk %s%d %s", dp->d_name, dp->d_unit, " using incompatible ABI version of disk(9)\n"); @@ -613,6 +629,8 @@ disk_create(struct disk *dp, int version } if (version == DISK_VERSION_01) dp->d_flags |= DISKFLAG_LACKS_GONE; + if (version < DISK_VERSION_03) + dp->d_flags |= DISKFLAG_LACKS_DELMAX; KASSERT(dp->d_strategy != NULL, ("disk_create need d_strategy")); KASSERT(dp->d_name != NULL, ("disk_create need d_name")); KASSERT(*dp->d_name != 0, ("disk_create need d_name")); Modified: stable/9/sys/geom/geom_disk.h ============================================================================== --- stable/9/sys/geom/geom_disk.h Thu Jul 4 21:31:28 2013 (r252729) +++ stable/9/sys/geom/geom_disk.h Thu Jul 4 21:57:09 2013 (r252730) @@ -99,6 +99,9 @@ struct disk { /* new fields in stable - don't use if DISKFLAG_LACKS_GONE is set */ disk_gone_t *d_gone; + + /* new fields in stable - don't use if DISKFLAG_LACKS_DELMAX is set */ + off_t d_delmaxsize; }; #define DISKFLAG_NEEDSGIANT 0x1 @@ -106,7 +109,8 @@ struct disk { #define DISKFLAG_CANDELETE 0x4 #define DISKFLAG_CANFLUSHCACHE 0x8 #define DISKFLAG_LACKS_GONE 0x10 -#define DISKFLAG_UNMAPPED_BIO 0x20 +#define DISKFLAG_UNMAPPED_BIO 0x20 +#define DISKFLAG_LACKS_DELMAX 0x40 struct disk *disk_alloc(void); void disk_create(struct disk *disk, int version); @@ -119,7 +123,8 @@ void disk_media_gone(struct disk *dp, in #define DISK_VERSION_00 0x58561059 #define DISK_VERSION_01 0x5856105a #define DISK_VERSION_02 0x5856105b -#define DISK_VERSION DISK_VERSION_02 +#define DISK_VERSION_03 0x5856105c +#define DISK_VERSION DISK_VERSION_03 #endif /* _KERNEL */ #endif /* _GEOM_GEOM_DISK_H_ */ From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 22:09:14 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E1FAFC9F; Thu, 4 Jul 2013 22:09:14 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D302C1170; Thu, 4 Jul 2013 22:09:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64M9EbQ062867; Thu, 4 Jul 2013 22:09:14 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64M9EbD062866; Thu, 4 Jul 2013 22:09:14 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307042209.r64M9EbD062866@svn.freebsd.org> From: Dimitry Andric Date: Thu, 4 Jul 2013 22:09:14 +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: r252731 - in stable: 7/contrib/libstdc++/libsupc++ 8/contrib/libstdc++/libsupc++ 9/contrib/libstdc++/libsupc++ 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.14 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, 04 Jul 2013 22:09:15 -0000 Author: dim Date: Thu Jul 4 22:09:14 2013 New Revision: 252731 URL: http://svnweb.freebsd.org/changeset/base/252731 Log: MFC r252387: Make libsupc++'s __cxa_call_terminate() prototype consistent with the definition. Submitted by: dt71@gmx.com Modified: stable/9/contrib/libstdc++/libsupc++/unwind-cxx.h Directory Properties: stable/9/contrib/libstdc++/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/libstdc++/libsupc++/unwind-cxx.h stable/8/contrib/libstdc++/libsupc++/unwind-cxx.h Directory Properties: stable/7/contrib/libstdc++/ (props changed) stable/8/contrib/libstdc++/ (props changed) Modified: stable/9/contrib/libstdc++/libsupc++/unwind-cxx.h ============================================================================== --- stable/9/contrib/libstdc++/libsupc++/unwind-cxx.h Thu Jul 4 21:57:09 2013 (r252730) +++ stable/9/contrib/libstdc++/libsupc++/unwind-cxx.h Thu Jul 4 22:09:14 2013 (r252731) @@ -133,7 +133,7 @@ extern "C" void __cxa_bad_typeid (); // throws, and if bad_exception needs to be thrown. Called from the // compiler. extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn)); -extern "C" void __cxa_call_terminate (void*) __attribute__((noreturn)); +extern "C" void __cxa_call_terminate (_Unwind_Exception*) __attribute__((noreturn)); #ifdef __ARM_EABI_UNWINDER__ // Arm EABI specified routines. From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 22:09:15 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3FF50CA0; Thu, 4 Jul 2013 22:09:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3165B1171; Thu, 4 Jul 2013 22:09:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64M9F1V062873; Thu, 4 Jul 2013 22:09:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64M9Fcx062872; Thu, 4 Jul 2013 22:09:15 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307042209.r64M9Fcx062872@svn.freebsd.org> From: Dimitry Andric Date: Thu, 4 Jul 2013 22:09: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: r252731 - in stable: 7/contrib/libstdc++/libsupc++ 8/contrib/libstdc++/libsupc++ 9/contrib/libstdc++/libsupc++ 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.14 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, 04 Jul 2013 22:09:15 -0000 Author: dim Date: Thu Jul 4 22:09:14 2013 New Revision: 252731 URL: http://svnweb.freebsd.org/changeset/base/252731 Log: MFC r252387: Make libsupc++'s __cxa_call_terminate() prototype consistent with the definition. Submitted by: dt71@gmx.com Modified: stable/8/contrib/libstdc++/libsupc++/unwind-cxx.h Directory Properties: stable/8/contrib/libstdc++/ (props changed) Changes in other areas also in this revision: Modified: stable/7/contrib/libstdc++/libsupc++/unwind-cxx.h stable/9/contrib/libstdc++/libsupc++/unwind-cxx.h Directory Properties: stable/7/contrib/libstdc++/ (props changed) stable/9/contrib/libstdc++/ (props changed) Modified: stable/8/contrib/libstdc++/libsupc++/unwind-cxx.h ============================================================================== --- stable/8/contrib/libstdc++/libsupc++/unwind-cxx.h Thu Jul 4 21:57:09 2013 (r252730) +++ stable/8/contrib/libstdc++/libsupc++/unwind-cxx.h Thu Jul 4 22:09:14 2013 (r252731) @@ -133,7 +133,7 @@ extern "C" void __cxa_bad_typeid (); // throws, and if bad_exception needs to be thrown. Called from the // compiler. extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn)); -extern "C" void __cxa_call_terminate (void*) __attribute__((noreturn)); +extern "C" void __cxa_call_terminate (_Unwind_Exception*) __attribute__((noreturn)); #ifdef __ARM_EABI_UNWINDER__ // Arm EABI specified routines. From owner-svn-src-stable@FreeBSD.ORG Thu Jul 4 22:09:15 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9559CCA2; Thu, 4 Jul 2013 22:09:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 867F01172; Thu, 4 Jul 2013 22:09:15 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r64M9FgB062881; Thu, 4 Jul 2013 22:09:15 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r64M9FfA062879; Thu, 4 Jul 2013 22:09:15 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307042209.r64M9FfA062879@svn.freebsd.org> From: Dimitry Andric Date: Thu, 4 Jul 2013 22:09:15 +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: r252731 - in stable: 7/contrib/libstdc++/libsupc++ 8/contrib/libstdc++/libsupc++ 9/contrib/libstdc++/libsupc++ 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.14 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, 04 Jul 2013 22:09:15 -0000 Author: dim Date: Thu Jul 4 22:09:14 2013 New Revision: 252731 URL: http://svnweb.freebsd.org/changeset/base/252731 Log: MFC r252387: Make libsupc++'s __cxa_call_terminate() prototype consistent with the definition. Submitted by: dt71@gmx.com Modified: stable/7/contrib/libstdc++/libsupc++/unwind-cxx.h Directory Properties: stable/7/contrib/libstdc++/ (props changed) Changes in other areas also in this revision: Modified: stable/8/contrib/libstdc++/libsupc++/unwind-cxx.h stable/9/contrib/libstdc++/libsupc++/unwind-cxx.h Directory Properties: stable/8/contrib/libstdc++/ (props changed) stable/9/contrib/libstdc++/ (props changed) Modified: stable/7/contrib/libstdc++/libsupc++/unwind-cxx.h ============================================================================== --- stable/7/contrib/libstdc++/libsupc++/unwind-cxx.h Thu Jul 4 21:57:09 2013 (r252730) +++ stable/7/contrib/libstdc++/libsupc++/unwind-cxx.h Thu Jul 4 22:09:14 2013 (r252731) @@ -133,7 +133,7 @@ extern "C" void __cxa_bad_typeid (); // throws, and if bad_exception needs to be thrown. Called from the // compiler. extern "C" void __cxa_call_unexpected (void *) __attribute__((noreturn)); -extern "C" void __cxa_call_terminate (void*) __attribute__((noreturn)); +extern "C" void __cxa_call_terminate (_Unwind_Exception*) __attribute__((noreturn)); #ifdef __ARM_EABI_UNWINDER__ // Arm EABI specified routines. From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 01:22:38 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 67E0AE0C; Fri, 5 Jul 2013 01:22:38 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 59C621859; Fri, 5 Jul 2013 01:22:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r651McSM024182; Fri, 5 Jul 2013 01:22:38 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r651McZD024181; Fri, 5 Jul 2013 01:22:38 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201307050122.r651McZD024181@svn.freebsd.org> From: Rick Macklem Date: Fri, 5 Jul 2013 01:22: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: r252739 - stable/9/sys/fs/nfsclient 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.14 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, 05 Jul 2013 01:22:38 -0000 Author: rmacklem Date: Fri Jul 5 01:22:37 2013 New Revision: 252739 URL: http://svnweb.freebsd.org/changeset/base/252739 Log: MFC: r252067 Since some NFSv4 servers enforce the requirement for a reserved port#, enable use of the (no)resvport mount option for NFSv4. I had thought that the RFC required that non-reserved port #s be allowed, but I couldn't find it in the RFC. Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvfsops.c Fri Jul 5 01:21:01 2013 (r252738) +++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c Fri Jul 5 01:22:37 2013 (r252739) @@ -588,12 +588,6 @@ nfs_decode_args(struct mount *mp, struct nmp->nm_flag &= ~NFSMNT_RDIRPLUS; } - /* Clear NFSMNT_RESVPORT for NFSv4, since it is not required. */ - if ((argp->flags & NFSMNT_NFSV4) != 0) { - argp->flags &= ~NFSMNT_RESVPORT; - nmp->nm_flag &= ~NFSMNT_RESVPORT; - } - /* Re-bind if rsrvd port requested and wasn't on one */ adjsock = !(nmp->nm_flag & NFSMNT_RESVPORT) && (argp->flags & NFSMNT_RESVPORT); From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 02:07:00 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5BC1B36B; Fri, 5 Jul 2013 02:07:00 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3407819C3; Fri, 5 Jul 2013 02:07:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65270CF036854; Fri, 5 Jul 2013 02:07:00 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6526xZN036843; Fri, 5 Jul 2013 02:06:59 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201307050206.r6526xZN036843@svn.freebsd.org> From: Rui Paulo Date: Fri, 5 Jul 2013 02:06: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: r252748 - in stable/9/etc: . rc.d 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.14 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, 05 Jul 2013 02:07:00 -0000 Author: rpaulo Date: Fri Jul 5 02:06:59 2013 New Revision: 252748 URL: http://svnweb.freebsd.org/changeset/base/252748 Log: Merge r252230: Implement ifconfig_wlanX="HOSTAP". Not only this is a bit cleaner, it allows multiple instances of hostapd to be running on the system host, useful for simultaneous dual-band WiFi. This is similar to ifconfig_wlanX="WPA" but it uses /etc/hostapd-wlanX.conf. Compatibility with hostapd_enable=YES/NO was kept. Modified: stable/9/etc/network.subr stable/9/etc/rc.d/hostapd Directory Properties: stable/9/etc/ (props changed) stable/9/etc/rc.d/ (props changed) Modified: stable/9/etc/network.subr ============================================================================== --- stable/9/etc/network.subr Fri Jul 5 01:53:51 2013 (r252747) +++ stable/9/etc/network.subr Fri Jul 5 02:06:59 2013 (r252748) @@ -159,6 +159,9 @@ ifconfig_up() if wpaif $1; then /etc/rc.d/wpa_supplicant start $1 _cfg=0 # XXX: not sure this should count + elif hostapif $1; then + /etc/rc.d/hostapd start $1 + _cfg=0 fi if dhcpif $1; then @@ -186,6 +189,9 @@ ifconfig_down() if wpaif $1; then /etc/rc.d/wpa_supplicant stop $1 _cfg=0 + elif hostapif $1; then + /etc/rc.d/hostapd stop $1 + _cfg=0 fi if dhcpif $1; then @@ -264,6 +270,7 @@ ifconfig_getargs() [Nn][Oo][Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;; [Ss][Yy][Nn][Cc][Dd][Hh][Cc][Pp]) ;; [Ww][Pp][Aa]) ;; + [Hh][Oo][Ss][Tt][Aa][Pp]) ;; *) _args="$_args $_arg" ;; @@ -364,6 +371,24 @@ wpaif() return 1 } +# hostapif if +# Returns 0 if the interface is a HOSTAP interface and 1 otherwise. +hostapif() +{ + local _tmpargs _arg + _tmpargs=`_ifconfig_getargs $1` + + for _arg in $_tmpargs; do + case $_arg in + [Hh][Oo][Ss][Tt][Aa][Pp]) + return 0 + ;; + esac + done + + return 1 +} + # afexists af # Returns 0 if the address family is enabled in the kernel # 1 otherwise. Modified: stable/9/etc/rc.d/hostapd ============================================================================== --- stable/9/etc/rc.d/hostapd Fri Jul 5 01:53:51 2013 (r252747) +++ stable/9/etc/rc.d/hostapd Fri Jul 5 02:06:59 2013 (r252748) @@ -10,11 +10,18 @@ . /etc/rc.subr name="hostapd" -rcvar="hostapd_enable" command="/usr/sbin/${name}" -conf_file="/etc/${name}.conf" -pidfile="/var/run/${name}.pid" +ifn="$2" +if [ -z "$ifn" ]; then + rcvar="hostapd_enable" + conf_file="/etc/${name}.conf" + pidfile="/var/run/${name}.pid" +else + rcvar= + conf_file="/etc/${name}-${ifn}.conf" + pidfile="/var/run/${name}-${ifn}.pid" +fi command_args="-P ${pidfile} -B ${conf_file}" required_files="${conf_file}" From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 03:01:38 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 899E1B04; Fri, 5 Jul 2013 03:01:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6CDA41C26; Fri, 5 Jul 2013 03:01:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6531cin054927; Fri, 5 Jul 2013 03:01:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6531aJf054912; Fri, 5 Jul 2013 03:01:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050301.r6531aJf054912@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:01: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: r252749 - in stable/9: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.14 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, 05 Jul 2013 03:01:38 -0000 Author: delphij Date: Fri Jul 5 03:01:35 2013 New Revision: 252749 URL: http://svnweb.freebsd.org/changeset/base/252749 Log: MFC r251629: 3741 zfs needs better comments Embellish the comments in various components of ZFS. Move some comments around closer to what they describe. Specifically, answer the questions: - What are some of the edge cases of the dbuf state machine? - What does a txg quiesce do? - When does the DMU notify threads waiting on txg's that they may proceed? - How do the calculations for RAIDZ map allocations work? - What process do the RAIDZ I/O start and done callbacks follow? While here, adjust the function prototype of dmu_zfetch.c:dmu_zfetch_colinear() to match its comment which describes its return as a boolean. Submitted by: asomers, gibbs, will Reviewed by: Matthew Ahrens , Eric Schrock , Christopher Siden Sponsored by: Spectra Logic Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.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/dmu_tx.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: 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_dataset.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 03:01:35 2013 (r252749) @@ -4538,6 +4538,11 @@ zfs_get_holds(zfs_handle_t *zhp, nvlist_ return (err); } +/* + * Convert the zvol's volume size to an appropriate reservation. + * Note: If this routine is updated, it is necessary to update the ZFS test + * suite's shell version in reservation.kshlib. + */ uint64_t zvol_volsize_to_reservation(uint64_t volsize, nvlist_t *props) { 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 Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 5 03:01:35 2013 (r252749) @@ -289,7 +289,18 @@ typedef struct arc_stats { kstat_named_t arcstat_deleted; kstat_named_t arcstat_stolen; kstat_named_t arcstat_recycle_miss; + /* + * Number of buffers that could not be evicted because the hash lock + * was held by another thread. The lock may not necessarily be held + * by something using the same buffer, since hash locks are shared + * by multiple buffers. + */ kstat_named_t arcstat_mutex_miss; + /* + * Number of buffers skipped because they have I/O in progress, are + * indrect prefetch buffers that have not lived long enough, or are + * not from the spa we're trying to evict from. + */ kstat_named_t arcstat_evict_skip; kstat_named_t arcstat_evict_l2_cached; kstat_named_t arcstat_evict_l2_eligible; @@ -3247,6 +3258,10 @@ top: mutex_exit(hash_lock); + /* + * At this point, we have a level 1 cache miss. Try again in + * L2ARC if possible. + */ ASSERT3U(hdr->b_size, ==, size); DTRACE_PROBE4(arc__miss, arc_buf_hdr_t *, hdr, blkptr_t *, bp, uint64_t, size, zbookmark_t *, zb); @@ -3488,8 +3503,8 @@ arc_buf_evict(arc_buf_t *buf) } /* - * Release this buffer from the cache. This must be done - * after a read and prior to modifying the buffer contents. + * Release this buffer from the cache, making it an anonymous buffer. This + * must be done after a read and prior to modifying the buffer contents. * If the buffer has more than one reference, we must make * a new hdr for the buffer. */ 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 Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Jul 5 03:01:35 2013 (r252749) @@ -641,6 +641,14 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio if (!havepzio) err = zio_wait(zio); } else { + /* + * Another reader came in while the dbuf was in flight + * between UNCACHED and CACHED. Either a writer will finish + * writing the buffer (sending the dbuf to CACHED) or the + * first reader's request will reach the read_done callback + * and send the dbuf to CACHED. Otherwise, a failure + * occurred and the dbuf went to UNCACHED. + */ mutex_exit(&db->db_mtx); if (prefetch) dmu_zfetch(&dn->dn_zfetch, db->db.db_offset, @@ -649,6 +657,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio rw_exit(&dn->dn_struct_rwlock); DB_DNODE_EXIT(db); + /* Skip the wait per the caller's request. */ mutex_enter(&db->db_mtx); if ((flags & DB_RF_NEVERWAIT) == 0) { while (db->db_state == DB_READ || @@ -1264,7 +1273,8 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t } /* - * Return TRUE if this evicted the dbuf. + * Undirty a buffer in the transaction group referenced by the given + * transaction. Return whether this evicted the dbuf. */ static boolean_t dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx) @@ -2225,6 +2235,7 @@ dbuf_sync_indirect(dbuf_dirty_record_t * ASSERT(db->db_level > 0); DBUF_VERIFY(db); + /* Read the block if it hasn't been read yet. */ if (db->db_buf == NULL) { mutex_exit(&db->db_mtx); (void) dbuf_read(db, NULL, DB_RF_MUST_SUCCEED); @@ -2235,10 +2246,12 @@ dbuf_sync_indirect(dbuf_dirty_record_t * DB_DNODE_ENTER(db); dn = DB_DNODE(db); + /* Indirect block size must match what the dnode thinks it is. */ ASSERT3U(db->db.db_size, ==, 1<dn_phys->dn_indblkshift); dbuf_check_blkptr(dn, db); DB_DNODE_EXIT(db); + /* Provide the pending dirty record to child dbufs */ db->db_data_pending = dr; mutex_exit(&db->db_mtx); @@ -2629,6 +2642,7 @@ dbuf_write_override_done(zio_t *zio) dbuf_write_done(zio, NULL, db); } +/* Issue I/O to commit a dirty buffer to disk. */ static void dbuf_write(dbuf_dirty_record_t *dr, arc_buf_t *data, dmu_tx_t *tx) { @@ -2663,11 +2677,19 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ } if (parent != dn->dn_dbuf) { + /* Our parent is an indirect block. */ + /* We have a dirty parent that has been scheduled for write. */ ASSERT(parent && parent->db_data_pending); + /* Our parent's buffer is one level closer to the dnode. */ ASSERT(db->db_level == parent->db_level-1); + /* + * We're about to modify our parent's db_data by modifying + * our block pointer, so the parent must be released. + */ ASSERT(arc_released(parent->db_buf)); zio = parent->db_data_pending->dr_zio; } else { + /* Our parent is the dnode itself. */ ASSERT((db->db_level == dn->dn_phys->dn_nlevels-1 && db->db_blkid != DMU_SPILL_BLKID) || (db->db_blkid == DMU_SPILL_BLKID && db->db_level == 0)); 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 Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Jul 5 03:01:35 2013 (r252749) @@ -1839,7 +1839,7 @@ dmu_init(void) void dmu_fini(void) { - arc_fini(); + arc_fini(); /* arc depends on l2arc, so arc must go first */ l2arc_fini(); zfetch_fini(); dbuf_fini(); 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 Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Fri Jul 5 03:01:35 2013 (r252749) @@ -1014,6 +1014,10 @@ dmu_tx_unassign(dmu_tx_t *tx) txg_rele_to_quiesce(&tx->tx_txgh); + /* + * Walk the transaction's hold list, removing the hold on the + * associated dnode, and notifying waiters if the refcount drops to 0. + */ for (txh = list_head(&tx->tx_holds); txh != tx->tx_needassign_txh; txh = list_next(&tx->tx_holds, txh)) { dnode_t *dn = txh->txh_dnode; @@ -1126,6 +1130,10 @@ dmu_tx_commit(dmu_tx_t *tx) ASSERT(tx->tx_txg != 0); + /* + * Go through the transaction's hold list and remove holds on + * associated dnodes, notifying waiters if no holds remain. + */ while (txh = list_head(&tx->tx_holds)) { dnode_t *dn = txh->txh_dnode; 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 Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Fri Jul 5 03:01:35 2013 (r252749) @@ -66,11 +66,11 @@ SYSCTL_UQUAD(_vfs_zfs_zfetch, OID_AUTO, "Number of bytes in a array_read at which we stop prefetching"); /* forward decls for static routines */ -static int dmu_zfetch_colinear(zfetch_t *, zstream_t *); +static boolean_t dmu_zfetch_colinear(zfetch_t *, zstream_t *); static void dmu_zfetch_dofetch(zfetch_t *, zstream_t *); static uint64_t dmu_zfetch_fetch(dnode_t *, uint64_t, uint64_t); static uint64_t dmu_zfetch_fetchsz(dnode_t *, uint64_t, uint64_t); -static int dmu_zfetch_find(zfetch_t *, zstream_t *, int); +static boolean_t dmu_zfetch_find(zfetch_t *, zstream_t *, int); static int dmu_zfetch_stream_insert(zfetch_t *, zstream_t *); static zstream_t *dmu_zfetch_stream_reclaim(zfetch_t *); static void dmu_zfetch_stream_remove(zfetch_t *, zstream_t *); @@ -122,9 +122,9 @@ kstat_t *zfetch_ksp; * last stream, then we are probably in a strided access pattern. So * combine the two sequential streams into a single strided stream. * - * If no co-linear streams are found, return NULL. + * Returns whether co-linear streams were found. */ -static int +static boolean_t dmu_zfetch_colinear(zfetch_t *zf, zstream_t *zh) { zstream_t *z_walk; @@ -344,7 +344,7 @@ dmu_zfetch_fetchsz(dnode_t *dn, uint64_t * for this block read. If so, it starts a prefetch for the stream it * located and returns true, otherwise it returns false */ -static int +static boolean_t dmu_zfetch_find(zfetch_t *zf, zstream_t *zh, int prefetched) { zstream_t *zs; @@ -669,7 +669,7 @@ dmu_zfetch(zfetch_t *zf, uint64_t offset { zstream_t zst; zstream_t *newstream; - int fetched; + boolean_t fetched; int inserted; unsigned int blkshft; uint64_t blksz; @@ -695,7 +695,8 @@ dmu_zfetch(zfetch_t *zf, uint64_t offset ZFETCHSTAT_BUMP(zfetchstat_hits); } else { ZFETCHSTAT_BUMP(zfetchstat_misses); - if (fetched = dmu_zfetch_colinear(zf, &zst)) { + fetched = dmu_zfetch_colinear(zf, &zst); + if (fetched) { ZFETCHSTAT_BUMP(zfetchstat_colinear_hits); } else { ZFETCHSTAT_BUMP(zfetchstat_colinear_misses); 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 Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 03:01:35 2013 (r252749) @@ -27,6 +27,8 @@ */ /* + * SPA: Storage Pool Allocator + * * This file contains all the routines used when modifying on-disk SPA state. * This includes opening, importing, destroying, exporting a pool, and syncing a * pool. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Jul 5 03:01:35 2013 (r252749) @@ -411,6 +411,8 @@ void dmu_write_policy(objset_t *os, stru * object must be held in an assigned transaction before calling * dmu_buf_will_dirty. You may use dmu_buf_set_user() on the bonus * buffer as well. You must release your hold with dmu_buf_rele(). + * + * Returns ENOENT, EIO, or 0. */ int dmu_bonus_hold(objset_t *os, uint64_t object, void *tag, dmu_buf_t **); int dmu_bonus_max(void); @@ -666,8 +668,14 @@ extern const dmu_object_byteswap_info_t * If doi is NULL, just indicates whether the object exists. */ int dmu_object_info(objset_t *os, uint64_t object, dmu_object_info_t *doi); +/* Like dmu_object_info, but faster if you have a held dnode in hand. */ void dmu_object_info_from_dnode(struct dnode *dn, dmu_object_info_t *doi); +/* Like dmu_object_info, but faster if you have a held dbuf in hand. */ void dmu_object_info_from_db(dmu_buf_t *db, dmu_object_info_t *doi); +/* + * Like dmu_object_info_from_db, but faster still when you only care about + * the size. This is specifically optimized for zfs_getattr(). + */ void dmu_object_size_from_db(dmu_buf_t *db, uint32_t *blksize, u_longlong_t *nblk512); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:01:35 2013 (r252749) @@ -348,6 +348,12 @@ txg_rele_to_sync(txg_handle_t *th) th->th_cpu = NULL; /* defensive */ } +/* + * Blocks until all transactions in the group are committed. + * + * On return, the transaction group has reached a stable state in which it can + * then be passed off to the syncing context. + */ static void txg_quiesce(dsl_pool_t *dp, uint64_t txg) { @@ -397,6 +403,9 @@ txg_do_callbacks(void *arg) /* * Dispatch the commit callbacks registered on this txg to worker threads. + * + * If no callbacks are registered for a given TXG, nothing happens. + * This function creates a taskq for the associated pool, if needed. */ static void txg_dispatch_callbacks(dsl_pool_t *dp, uint64_t txg) @@ -407,7 +416,10 @@ txg_dispatch_callbacks(dsl_pool_t *dp, u for (c = 0; c < max_ncpus; c++) { tx_cpu_t *tc = &tx->tx_cpu[c]; - /* No need to lock tx_cpu_t at this point */ + /* + * No need to lock tx_cpu_t at this point, since this can + * only be called once a txg has been synced. + */ int g = txg & TXG_MASK; 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 Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Jul 5 03:01:35 2013 (r252749) @@ -1044,6 +1044,7 @@ vdev_uberblock_sync(zio_t *zio, uberbloc zio_buf_free(ubbuf, VDEV_UBERBLOCK_SIZE(vd)); } +/* Sync the uberblocks to all vdevs in svd[] */ int vdev_uberblock_sync_list(vdev_t **svd, int svdcount, uberblock_t *ub, int flags) { 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 Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Fri Jul 5 03:01:35 2013 (r252749) @@ -433,23 +433,50 @@ static const zio_vsd_ops_t vdev_raidz_vs vdev_raidz_cksum_report }; +/* + * Divides the IO evenly across all child vdevs; usually, dcols is + * 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) { raidz_map_t *rm; + /* The starting RAIDZ (parent) vdev sector of the block. */ uint64_t b = zio->io_offset >> unit_shift; + /* The zio's size in units of the vdev's minimum sector size. */ uint64_t s = zio->io_size >> unit_shift; + /* The first column for this stripe. */ uint64_t f = b % dcols; + /* The starting byte offset on each child vdev. */ uint64_t o = (b / dcols) << unit_shift; uint64_t q, r, c, bc, col, acols, scols, coff, devidx, asize, tot; + /* + * "Quotient": The number of data sectors for this stripe on all but + * the "big column" child vdevs that also contain "remainder" data. + */ q = s / (dcols - nparity); + + /* + * "Remainder": The number of partial stripe data sectors in this I/O. + * This will add a sector to some, but not all, child vdevs. + */ r = s - q * (dcols - nparity); + + /* The number of "big columns" - those which contain remainder data. */ bc = (r == 0 ? 0 : r + nparity); + + /* + * The total number of data and parity sectors associated with + * this I/O. + */ tot = s + nparity * (q + (r == 0 ? 0 : 1)); + /* acols: The columns that will be accessed. */ + /* scols: The columns that will be accessed or skipped. */ if (q == 0) { + /* Our I/O request doesn't span all child vdevs. */ acols = bc; scols = MIN(dcols, roundup(bc, nparity + 1)); } else { @@ -1529,6 +1556,23 @@ vdev_raidz_child_done(zio_t *zio) rc->rc_skipped = 0; } +/* + * Start an IO operation on a RAIDZ VDev + * + * Outline: + * - For write operations: + * 1. Generate the parity data + * 2. Create child zio write operations to each column's vdev, for both + * data and parity. + * 3. If the column skips any sectors for padding, create optional dummy + * write zio children for those areas to improve aggregation continuity. + * - For read operations: + * 1. Create child zio read operations to each data column's vdev to read + * the range of data required for zio. + * 2. If this is a scrub or resilver operation, or if any of the data + * vdevs have had errors, then create zio read operations to the parity + * columns' VDevs as well. + */ static int vdev_raidz_io_start(zio_t *zio) { @@ -1881,6 +1925,27 @@ done: return (ret); } +/* + * Complete an IO operation on a RAIDZ VDev + * + * Outline: + * - For write operations: + * 1. Check for errors on the child IOs. + * 2. Return, setting an error code if too few child VDevs were written + * to reconstruct the data later. Note that partial writes are + * considered successful if they can be reconstructed at all. + * - For read operations: + * 1. Check for errors on the child IOs. + * 2. If data errors occurred: + * a. Try to reassemble the data from the parity available. + * b. If we haven't yet read the parity drives, read them now. + * c. If all parity drives have been read but the data still doesn't + * reassemble with a correct checksum, then try combinatorial + * reconstruction. + * d. If that doesn't work, return an error. + * 3. If there were unexpected errors or this is a resilver operation, + * rewrite the vdevs that had errors. + */ static void vdev_raidz_io_done(zio_t *zio) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 02:06:59 2013 (r252748) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 03:01:35 2013 (r252749) @@ -633,6 +633,11 @@ static struct vop_vector zfsctl_ops_root .vop_fid = zfsctl_common_fid, }; +/* + * Gets the full dataset name that corresponds to the given snapshot name + * Example: + * zfsctl_snapshot_zname("snap1") -> "mypool/myfs@snap1" + */ static int zfsctl_snapshot_zname(vnode_t *vp, const char *name, int len, char *zname) { From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 03:02:22 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4F353C52; Fri, 5 Jul 2013 03:02:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 324B91C4B; Fri, 5 Jul 2013 03:02:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6532MGf055311; Fri, 5 Jul 2013 03:02:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6532J5H055296; Fri, 5 Jul 2013 03:02:19 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050302.r6532J5H055296@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:02: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: r252750 - in stable/8: cddl/contrib/opensolaris/lib/libzfs/common sys/cddl/contrib/opensolaris/uts/common/fs/zfs 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.14 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, 05 Jul 2013 03:02:22 -0000 Author: delphij Date: Fri Jul 5 03:02:19 2013 New Revision: 252750 URL: http://svnweb.freebsd.org/changeset/base/252750 Log: MFC r251629: 3741 zfs needs better comments Embellish the comments in various components of ZFS. Move some comments around closer to what they describe. Specifically, answer the questions: - What are some of the edge cases of the dbuf state machine? - What does a txg quiesce do? - When does the DMU notify threads waiting on txg's that they may proceed? - How do the calculations for RAIDZ map allocations work? - What process do the RAIDZ I/O start and done callbacks follow? While here, adjust the function prototype of dmu_zfetch.c:dmu_zfetch_colinear() to match its comment which describes its return as a boolean. Submitted by: asomers, gibbs, will Reviewed by: Matthew Ahrens , Eric Schrock , Christopher Siden Sponsored by: Spectra Logic Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.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/dmu_tx.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (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/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 03:02:19 2013 (r252750) @@ -4538,6 +4538,11 @@ zfs_get_holds(zfs_handle_t *zhp, nvlist_ return (err); } +/* + * Convert the zvol's volume size to an appropriate reservation. + * Note: If this routine is updated, it is necessary to update the ZFS test + * suite's shell version in reservation.kshlib. + */ uint64_t zvol_volsize_to_reservation(uint64_t volsize, nvlist_t *props) { 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 Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 5 03:02:19 2013 (r252750) @@ -287,7 +287,18 @@ typedef struct arc_stats { kstat_named_t arcstat_deleted; kstat_named_t arcstat_stolen; kstat_named_t arcstat_recycle_miss; + /* + * Number of buffers that could not be evicted because the hash lock + * was held by another thread. The lock may not necessarily be held + * by something using the same buffer, since hash locks are shared + * by multiple buffers. + */ kstat_named_t arcstat_mutex_miss; + /* + * Number of buffers skipped because they have I/O in progress, are + * indrect prefetch buffers that have not lived long enough, or are + * not from the spa we're trying to evict from. + */ kstat_named_t arcstat_evict_skip; kstat_named_t arcstat_evict_l2_cached; kstat_named_t arcstat_evict_l2_eligible; @@ -3211,6 +3222,10 @@ top: mutex_exit(hash_lock); + /* + * At this point, we have a level 1 cache miss. Try again in + * L2ARC if possible. + */ ASSERT3U(hdr->b_size, ==, size); DTRACE_PROBE4(arc__miss, arc_buf_hdr_t *, hdr, blkptr_t *, bp, uint64_t, size, zbookmark_t *, zb); @@ -3408,8 +3423,8 @@ arc_buf_evict(arc_buf_t *buf) } /* - * Release this buffer from the cache. This must be done - * after a read and prior to modifying the buffer contents. + * Release this buffer from the cache, making it an anonymous buffer. This + * must be done after a read and prior to modifying the buffer contents. * If the buffer has more than one reference, we must make * a new hdr for the buffer. */ 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 Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c Fri Jul 5 03:02:19 2013 (r252750) @@ -638,6 +638,14 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio if (!havepzio) err = zio_wait(zio); } else { + /* + * Another reader came in while the dbuf was in flight + * between UNCACHED and CACHED. Either a writer will finish + * writing the buffer (sending the dbuf to CACHED) or the + * first reader's request will reach the read_done callback + * and send the dbuf to CACHED. Otherwise, a failure + * occurred and the dbuf went to UNCACHED. + */ mutex_exit(&db->db_mtx); if (prefetch) dmu_zfetch(&dn->dn_zfetch, db->db.db_offset, @@ -646,6 +654,7 @@ dbuf_read(dmu_buf_impl_t *db, zio_t *zio rw_exit(&dn->dn_struct_rwlock); DB_DNODE_EXIT(db); + /* Skip the wait per the caller's request. */ mutex_enter(&db->db_mtx); if ((flags & DB_RF_NEVERWAIT) == 0) { while (db->db_state == DB_READ || @@ -1261,7 +1270,8 @@ dbuf_dirty(dmu_buf_impl_t *db, dmu_tx_t } /* - * Return TRUE if this evicted the dbuf. + * Undirty a buffer in the transaction group referenced by the given + * transaction. Return whether this evicted the dbuf. */ static boolean_t dbuf_undirty(dmu_buf_impl_t *db, dmu_tx_t *tx) @@ -2222,6 +2232,7 @@ dbuf_sync_indirect(dbuf_dirty_record_t * ASSERT(db->db_level > 0); DBUF_VERIFY(db); + /* Read the block if it hasn't been read yet. */ if (db->db_buf == NULL) { mutex_exit(&db->db_mtx); (void) dbuf_read(db, NULL, DB_RF_MUST_SUCCEED); @@ -2232,10 +2243,12 @@ dbuf_sync_indirect(dbuf_dirty_record_t * DB_DNODE_ENTER(db); dn = DB_DNODE(db); + /* Indirect block size must match what the dnode thinks it is. */ ASSERT3U(db->db.db_size, ==, 1<dn_phys->dn_indblkshift); dbuf_check_blkptr(dn, db); DB_DNODE_EXIT(db); + /* Provide the pending dirty record to child dbufs */ db->db_data_pending = dr; mutex_exit(&db->db_mtx); @@ -2626,6 +2639,7 @@ dbuf_write_override_done(zio_t *zio) dbuf_write_done(zio, NULL, db); } +/* Issue I/O to commit a dirty buffer to disk. */ static void dbuf_write(dbuf_dirty_record_t *dr, arc_buf_t *data, dmu_tx_t *tx) { @@ -2660,11 +2674,19 @@ dbuf_write(dbuf_dirty_record_t *dr, arc_ } if (parent != dn->dn_dbuf) { + /* Our parent is an indirect block. */ + /* We have a dirty parent that has been scheduled for write. */ ASSERT(parent && parent->db_data_pending); + /* Our parent's buffer is one level closer to the dnode. */ ASSERT(db->db_level == parent->db_level-1); + /* + * We're about to modify our parent's db_data by modifying + * our block pointer, so the parent must be released. + */ ASSERT(arc_released(parent->db_buf)); zio = parent->db_data_pending->dr_zio; } else { + /* Our parent is the dnode itself. */ ASSERT((db->db_level == dn->dn_phys->dn_nlevels-1 && db->db_blkid != DMU_SPILL_BLKID) || (db->db_blkid == DMU_SPILL_BLKID && db->db_level == 0)); 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 Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c Fri Jul 5 03:02:19 2013 (r252750) @@ -1837,7 +1837,7 @@ dmu_init(void) void dmu_fini(void) { - arc_fini(); + arc_fini(); /* arc depends on l2arc, so arc must go first */ l2arc_fini(); zfetch_fini(); dbuf_fini(); 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 Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c Fri Jul 5 03:02:19 2013 (r252750) @@ -1014,6 +1014,10 @@ dmu_tx_unassign(dmu_tx_t *tx) txg_rele_to_quiesce(&tx->tx_txgh); + /* + * Walk the transaction's hold list, removing the hold on the + * associated dnode, and notifying waiters if the refcount drops to 0. + */ for (txh = list_head(&tx->tx_holds); txh != tx->tx_needassign_txh; txh = list_next(&tx->tx_holds, txh)) { dnode_t *dn = txh->txh_dnode; @@ -1126,6 +1130,10 @@ dmu_tx_commit(dmu_tx_t *tx) ASSERT(tx->tx_txg != 0); + /* + * Go through the transaction's hold list and remove holds on + * associated dnodes, notifying waiters if no holds remain. + */ while (txh = list_head(&tx->tx_holds)) { dnode_t *dn = txh->txh_dnode; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c Fri Jul 5 03:02:19 2013 (r252750) @@ -66,11 +66,11 @@ SYSCTL_QUAD(_vfs_zfs_zfetch, OID_AUTO, a "Number of bytes in a array_read at which we stop prefetching"); /* forward decls for static routines */ -static int dmu_zfetch_colinear(zfetch_t *, zstream_t *); +static boolean_t dmu_zfetch_colinear(zfetch_t *, zstream_t *); static void dmu_zfetch_dofetch(zfetch_t *, zstream_t *); static uint64_t dmu_zfetch_fetch(dnode_t *, uint64_t, uint64_t); static uint64_t dmu_zfetch_fetchsz(dnode_t *, uint64_t, uint64_t); -static int dmu_zfetch_find(zfetch_t *, zstream_t *, int); +static boolean_t dmu_zfetch_find(zfetch_t *, zstream_t *, int); static int dmu_zfetch_stream_insert(zfetch_t *, zstream_t *); static zstream_t *dmu_zfetch_stream_reclaim(zfetch_t *); static void dmu_zfetch_stream_remove(zfetch_t *, zstream_t *); @@ -122,9 +122,9 @@ kstat_t *zfetch_ksp; * last stream, then we are probably in a strided access pattern. So * combine the two sequential streams into a single strided stream. * - * If no co-linear streams are found, return NULL. + * Returns whether co-linear streams were found. */ -static int +static boolean_t dmu_zfetch_colinear(zfetch_t *zf, zstream_t *zh) { zstream_t *z_walk; @@ -344,7 +344,7 @@ dmu_zfetch_fetchsz(dnode_t *dn, uint64_t * for this block read. If so, it starts a prefetch for the stream it * located and returns true, otherwise it returns false */ -static int +static boolean_t dmu_zfetch_find(zfetch_t *zf, zstream_t *zh, int prefetched) { zstream_t *zs; @@ -669,7 +669,7 @@ dmu_zfetch(zfetch_t *zf, uint64_t offset { zstream_t zst; zstream_t *newstream; - int fetched; + boolean_t fetched; int inserted; unsigned int blkshft; uint64_t blksz; @@ -695,7 +695,8 @@ dmu_zfetch(zfetch_t *zf, uint64_t offset ZFETCHSTAT_BUMP(zfetchstat_hits); } else { ZFETCHSTAT_BUMP(zfetchstat_misses); - if (fetched = dmu_zfetch_colinear(zf, &zst)) { + fetched = dmu_zfetch_colinear(zf, &zst); + if (fetched) { ZFETCHSTAT_BUMP(zfetchstat_colinear_hits); } else { ZFETCHSTAT_BUMP(zfetchstat_colinear_misses); 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 Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 03:02:19 2013 (r252750) @@ -27,6 +27,8 @@ */ /* + * SPA: Storage Pool Allocator + * * This file contains all the routines used when modifying on-disk SPA state. * This includes opening, importing, destroying, exporting a pool, and syncing a * pool. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h Fri Jul 5 03:02:19 2013 (r252750) @@ -411,6 +411,8 @@ void dmu_write_policy(objset_t *os, stru * object must be held in an assigned transaction before calling * dmu_buf_will_dirty. You may use dmu_buf_set_user() on the bonus * buffer as well. You must release your hold with dmu_buf_rele(). + * + * Returns ENOENT, EIO, or 0. */ int dmu_bonus_hold(objset_t *os, uint64_t object, void *tag, dmu_buf_t **); int dmu_bonus_max(void); @@ -666,8 +668,14 @@ extern const dmu_object_byteswap_info_t * If doi is NULL, just indicates whether the object exists. */ int dmu_object_info(objset_t *os, uint64_t object, dmu_object_info_t *doi); +/* Like dmu_object_info, but faster if you have a held dnode in hand. */ void dmu_object_info_from_dnode(struct dnode *dn, dmu_object_info_t *doi); +/* Like dmu_object_info, but faster if you have a held dbuf in hand. */ void dmu_object_info_from_db(dmu_buf_t *db, dmu_object_info_t *doi); +/* + * Like dmu_object_info_from_db, but faster still when you only care about + * the size. This is specifically optimized for zfs_getattr(). + */ void dmu_object_size_from_db(dmu_buf_t *db, uint32_t *blksize, u_longlong_t *nblk512); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:02:19 2013 (r252750) @@ -279,6 +279,12 @@ txg_rele_to_sync(txg_handle_t *th) th->th_cpu = NULL; /* defensive */ } +/* + * Blocks until all transactions in the group are committed. + * + * On return, the transaction group has reached a stable state in which it can + * then be passed off to the syncing context. + */ static void txg_quiesce(dsl_pool_t *dp, uint64_t txg) { @@ -328,6 +334,9 @@ txg_do_callbacks(void *arg) /* * Dispatch the commit callbacks registered on this txg to worker threads. + * + * If no callbacks are registered for a given TXG, nothing happens. + * This function creates a taskq for the associated pool, if needed. */ static void txg_dispatch_callbacks(dsl_pool_t *dp, uint64_t txg) @@ -338,7 +347,10 @@ txg_dispatch_callbacks(dsl_pool_t *dp, u for (c = 0; c < max_ncpus; c++) { tx_cpu_t *tc = &tx->tx_cpu[c]; - /* No need to lock tx_cpu_t at this point */ + /* + * No need to lock tx_cpu_t at this point, since this can + * only be called once a txg has been synced. + */ int g = txg & TXG_MASK; 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 Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c Fri Jul 5 03:02:19 2013 (r252750) @@ -1044,6 +1044,7 @@ vdev_uberblock_sync(zio_t *zio, uberbloc zio_buf_free(ubbuf, VDEV_UBERBLOCK_SIZE(vd)); } +/* Sync the uberblocks to all vdevs in svd[] */ int vdev_uberblock_sync_list(vdev_t **svd, int svdcount, uberblock_t *ub, int flags) { 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 Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Fri Jul 5 03:02:19 2013 (r252750) @@ -433,23 +433,50 @@ static const zio_vsd_ops_t vdev_raidz_vs vdev_raidz_cksum_report }; +/* + * Divides the IO evenly across all child vdevs; usually, dcols is + * 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) { raidz_map_t *rm; + /* The starting RAIDZ (parent) vdev sector of the block. */ uint64_t b = zio->io_offset >> unit_shift; + /* The zio's size in units of the vdev's minimum sector size. */ uint64_t s = zio->io_size >> unit_shift; + /* The first column for this stripe. */ uint64_t f = b % dcols; + /* The starting byte offset on each child vdev. */ uint64_t o = (b / dcols) << unit_shift; uint64_t q, r, c, bc, col, acols, scols, coff, devidx, asize, tot; + /* + * "Quotient": The number of data sectors for this stripe on all but + * the "big column" child vdevs that also contain "remainder" data. + */ q = s / (dcols - nparity); + + /* + * "Remainder": The number of partial stripe data sectors in this I/O. + * This will add a sector to some, but not all, child vdevs. + */ r = s - q * (dcols - nparity); + + /* The number of "big columns" - those which contain remainder data. */ bc = (r == 0 ? 0 : r + nparity); + + /* + * The total number of data and parity sectors associated with + * this I/O. + */ tot = s + nparity * (q + (r == 0 ? 0 : 1)); + /* acols: The columns that will be accessed. */ + /* scols: The columns that will be accessed or skipped. */ if (q == 0) { + /* Our I/O request doesn't span all child vdevs. */ acols = bc; scols = MIN(dcols, roundup(bc, nparity + 1)); } else { @@ -1529,6 +1556,23 @@ vdev_raidz_child_done(zio_t *zio) rc->rc_skipped = 0; } +/* + * Start an IO operation on a RAIDZ VDev + * + * Outline: + * - For write operations: + * 1. Generate the parity data + * 2. Create child zio write operations to each column's vdev, for both + * data and parity. + * 3. If the column skips any sectors for padding, create optional dummy + * write zio children for those areas to improve aggregation continuity. + * - For read operations: + * 1. Create child zio read operations to each data column's vdev to read + * the range of data required for zio. + * 2. If this is a scrub or resilver operation, or if any of the data + * vdevs have had errors, then create zio read operations to the parity + * columns' VDevs as well. + */ static int vdev_raidz_io_start(zio_t *zio) { @@ -1881,6 +1925,27 @@ done: return (ret); } +/* + * Complete an IO operation on a RAIDZ VDev + * + * Outline: + * - For write operations: + * 1. Check for errors on the child IOs. + * 2. Return, setting an error code if too few child VDevs were written + * to reconstruct the data later. Note that partial writes are + * considered successful if they can be reconstructed at all. + * - For read operations: + * 1. Check for errors on the child IOs. + * 2. If data errors occurred: + * a. Try to reassemble the data from the parity available. + * b. If we haven't yet read the parity drives, read them now. + * c. If all parity drives have been read but the data still doesn't + * reassemble with a correct checksum, then try combinatorial + * reconstruction. + * d. If that doesn't work, return an error. + * 3. If there were unexpected errors or this is a resilver operation, + * rewrite the vdevs that had errors. + */ static void vdev_raidz_io_done(zio_t *zio) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 03:01:35 2013 (r252749) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 03:02:19 2013 (r252750) @@ -633,6 +633,11 @@ static struct vop_vector zfsctl_ops_root .vop_fid = zfsctl_common_fid, }; +/* + * Gets the full dataset name that corresponds to the given snapshot name + * Example: + * zfsctl_snapshot_zname("snap1") -> "mypool/myfs@snap1" + */ static int zfsctl_snapshot_zname(vnode_t *vp, const char *name, int len, char *zname) { From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 03:06:07 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 49A16DDF; Fri, 5 Jul 2013 03:06:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3AEFF1CA0; Fri, 5 Jul 2013 03:06:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65367fa055974; Fri, 5 Jul 2013 03:06:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65360gf055900; Fri, 5 Jul 2013 03:06:00 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050306.r65360gf055900@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:06: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: r252751 - 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.14 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, 05 Jul 2013 03:06:07 -0000 Author: delphij Date: Fri Jul 5 03:05:59 2013 New Revision: 252751 URL: http://svnweb.freebsd.org/changeset/base/252751 Log: MFC r251631: illumos #3742 zfs comments need cleaner, more consistent style - Make more of ZFS's comments use a natural English writing flow. - Break up long paragraphs, fix various typos and spelling errors. - Don't prefix a function description with its name when the function definition immediately follows. - Remove useless comments. - Add extra whitespace where it makes the comments more readable. New comments were separated from this change and added in r251629. Submitted by: asomers, gibbs, will Reviewed by: Matthew Ahrens , George Wilson , Eric Schrock , Christopher Siden Sponsored by: Spectra Logic Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.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/spa_misc.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_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/unique.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/zap.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.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/txg.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.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 stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c 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/arc.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 5 03:05:59 2013 (r252751) @@ -58,11 +58,11 @@ * tight. * * 3. The Megiddo and Modha model assumes a fixed page size. All - * elements of the cache are therefor exactly the same size. So + * elements of the cache are therefore exactly the same size. So * when adjusting the cache size following a cache miss, its simply * a matter of choosing a single page to evict. In our model, we * have variable sized cache blocks (rangeing from 512 bytes to - * 128K bytes). We therefor choose a set of blocks to evict to make + * 128K bytes). We therefore choose a set of blocks to evict to make * space for a cache miss that approximates as closely as possible * the space used by the new block. * @@ -77,7 +77,7 @@ * ways: 1) via a hash table lookup using the DVA as a key, * or 2) via one of the ARC lists. The arc_read() interface * uses method 1, while the internal arc algorithms for - * adjusting the cache use method 2. We therefor provide two + * adjusting the cache use method 2. We therefore provide two * types of locks: 1) the hash table lock array, and 2) the * arc list locks. * @@ -438,7 +438,7 @@ static arc_stats_t arc_stats = { #define ARCSTAT(stat) (arc_stats.stat.value.ui64) #define ARCSTAT_INCR(stat, val) \ - atomic_add_64(&arc_stats.stat.value.ui64, (val)); + atomic_add_64(&arc_stats.stat.value.ui64, (val)) #define ARCSTAT_BUMP(stat) ARCSTAT_INCR(stat, 1) #define ARCSTAT_BUMPDOWN(stat) ARCSTAT_INCR(stat, -1) @@ -672,9 +672,7 @@ uint64_t zfs_crc64_table[256]; #define l2arc_writes_sent ARCSTAT(arcstat_l2_writes_sent) #define l2arc_writes_done ARCSTAT(arcstat_l2_writes_done) -/* - * L2ARC Performance Tunables - */ +/* L2ARC Performance Tunables */ uint64_t l2arc_write_max = L2ARC_WRITE_SIZE; /* default max write size */ uint64_t l2arc_write_boost = L2ARC_WRITE_SIZE; /* extra write during warmup */ uint64_t l2arc_headroom = L2ARC_HEADROOM; /* number of dev writes */ @@ -3900,7 +3898,7 @@ arc_tempreserve_space(uint64_t reserve, /* * Writes will, almost always, require additional memory allocations - * in order to compress/encrypt/etc the data. We therefor need to + * in order to compress/encrypt/etc the data. We therefore need to * make sure that there is sufficient available memory for this. */ if (error = arc_memory_throttle(reserve, anon_size, txg)) 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 Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Fri Jul 5 03:05:59 2013 (r252751) @@ -43,7 +43,7 @@ * dsl_scan_sync. This allows the delete operation to finish without traversing * all the dataset's blocks. * - * Note that while bt_begin and bt_end are only ever incremented in this code + * Note that while bt_begin and bt_end are only ever incremented in this code, * they are effectively reset to 0 every time the entire bptree is freed because * the bptree's object is destroyed and re-created. */ 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 Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Jul 5 03:05:59 2013 (r252751) @@ -1808,14 +1808,16 @@ dnode_willuse_space(dnode_t *dn, int64_t } /* - * This function scans a block at the indicated "level" looking for - * a hole or data (depending on 'flags'). If level > 0, then we are - * scanning an indirect block looking at its pointers. If level == 0, - * then we are looking at a block of dnodes. If we don't find what we - * are looking for in the block, we return ESRCH. Otherwise, return - * with *offset pointing to the beginning (if searching forwards) or - * end (if searching backwards) of the range covered by the block - * pointer we matched on (or dnode). + * Scans a block at the indicated "level" looking for a hole or data, + * depending on 'flags'. + * + * If level > 0, then we are scanning an indirect block looking at its + * pointers. If level == 0, then we are looking at a block of dnodes. + * + * If we don't find what we are looking for in the block, we return ESRCH. + * Otherwise, return with *offset pointing to the beginning (if searching + * forwards) or end (if searching backwards) of the range covered by the + * block pointer we matched on (or dnode). * * The basic search algorithm used below by dnode_next_offset() is to * use this function to search up the block tree (widen the search) until Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Jul 5 03:05:59 2013 (r252751) @@ -302,7 +302,7 @@ free_children(dmu_buf_impl_t *db, uint64 } /* - * free_range: Traverse the indicated range of the provided file + * Traverse the indicated range of the provided file * and "free" all the blocks contained there. */ static void @@ -370,7 +370,7 @@ dnode_sync_free_range(dnode_t *dn, uint6 } /* - * Try to kick all the dnodes dbufs out of the cache... + * Try to kick all the dnode's dbufs out of the cache... */ void dnode_evict_dbufs(dnode_t *dn) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Fri Jul 5 03:05:59 2013 (r252751) @@ -379,7 +379,7 @@ dsl_prop_predict(dsl_dir_t *dd, const ch /* * Unregister this callback. Return 0 on success, ENOENT if ddname is - * invalid, ENOMSG if no matching callback registered. + * invalid, or ENOMSG if no matching callback registered. */ int dsl_prop_unregister(dsl_dataset_t *ds, const char *propname, Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Fri Jul 5 03:05:59 2013 (r252751) @@ -111,6 +111,7 @@ * location. * * Byteswap implications: + * * Since the SA attributes are not entirely self describing we can't do * the normal byteswap processing. The special ZAP layout attribute and * attribute registration attributes define the byteswap function and the @@ -189,7 +190,6 @@ sa_attr_reg_t sa_legacy_attrs[] = { }; /* - * ZPL legacy layout * This is only used for objects of type DMU_OT_ZNODE */ sa_attr_type_t sa_legacy_zpl_layout[] = { @@ -199,7 +199,6 @@ sa_attr_type_t sa_legacy_zpl_layout[] = /* * Special dummy layout used for buffers with no attributes. */ - sa_attr_type_t sa_dummy_zpl_layout[] = { 0 }; static int sa_legacy_attr_count = 16; 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 Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 03:05:59 2013 (r252751) @@ -4698,6 +4698,7 @@ spa_vdev_attach(spa_t *spa, uint64_t gui /* * Detach a device from a mirror or replacing vdev. + * * If 'replace_done' is specified, only detach if the parent * is a replacing vdev. */ @@ -5359,11 +5360,9 @@ spa_vdev_remove_from_namespace(spa_t *sp * the spa_vdev_config_[enter/exit] functions which allow us to * grab and release the spa_config_lock while still holding the namespace * lock. During each step the configuration is synced out. - */ - -/* - * Remove a device from the pool. Currently, this supports removing only hot - * spares, slogs, and level 2 ARC devices. + * + * Currently, this supports removing only hot spares, slogs, and level 2 ARC + * devices. */ int spa_vdev_remove(spa_t *spa, uint64_t guid, boolean_t unspare) @@ -5473,7 +5472,7 @@ spa_vdev_remove(spa_t *spa, uint64_t gui /* * Find any device that's done replacing, or a vdev marked 'unspare' that's - * current spared, so we can detach it. + * currently spared, so we can detach it. */ static vdev_t * spa_vdev_resilver_done_hunt(vdev_t *vd) 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 Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Fri Jul 5 03:05:59 2013 (r252751) @@ -315,6 +315,7 @@ spa_config_set(spa_t *spa, nvlist_t *con /* * Generate the pool's configuration based on the current in-core state. + * * We infer whether to generate a complete config or just one top-level config * based on whether vd is the root vdev. */ 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 Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Jul 5 03:05:59 2013 (r252751) @@ -1369,7 +1369,7 @@ zfs_panic_recover(const char *fmt, ...) /* * This is a stripped-down version of strtoull, suitable only for converting - * lowercase hexidecimal numbers that don't overflow. + * lowercase hexadecimal numbers that don't overflow. */ uint64_t zfs_strtonum(const char *str, char **nptr) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Fri Jul 5 03:05:59 2013 (r252751) @@ -63,16 +63,15 @@ enum ddt_class { */ typedef struct ddt_key { zio_cksum_t ddk_cksum; /* 256-bit block checksum */ - uint64_t ddk_prop; /* LSIZE, PSIZE, compression */ + /* + * Encoded with logical & physical size, and compression, as follows: + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * | 0 | 0 | 0 | comp | PSIZE | LSIZE | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + */ + uint64_t ddk_prop; } ddt_key_t; -/* - * ddk_prop layout: - * - * +-------+-------+-------+-------+-------+-------+-------+-------+ - * | 0 | 0 | 0 | comp | PSIZE | LSIZE | - * +-------+-------+-------+-------+-------+-------+-------+-------+ - */ #define DDK_GET_LSIZE(ddk) \ BF64_GET_SB((ddk)->ddk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1) #define DDK_SET_LSIZE(ddk, x) \ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri Jul 5 03:05:59 2013 (r252751) @@ -145,9 +145,8 @@ typedef struct dnode_phys { typedef struct dnode { /* - * dn_struct_rwlock protects the structure of the dnode, - * including the number of levels of indirection (dn_nlevels), - * dn_maxblkid, and dn_next_* + * Protects the structure of the dnode, including the number of levels + * of indirection (dn_nlevels), dn_maxblkid, and dn_next_* */ krwlock_t dn_struct_rwlock; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Fri Jul 5 03:05:59 2013 (r252751) @@ -110,6 +110,7 @@ typedef struct dsl_pool { /* * Protects administrative changes (properties, namespace) + * * It is only held for write in syncing context. Therefore * syncing context does not need to ever have it for read, since * nobody else could possibly have it for write. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h Fri Jul 5 03:05:59 2013 (r252751) @@ -150,6 +150,7 @@ struct sa_os { /* * header for all bonus and spill buffers. + * * The header has a fixed portion with a variable number * of "lengths" depending on the number of variable sized * attribues which are determined by the "layout number" @@ -158,29 +159,27 @@ struct sa_os { #define SA_MAGIC 0x2F505A /* ZFS SA */ typedef struct sa_hdr_phys { uint32_t sa_magic; - uint16_t sa_layout_info; /* Encoded with hdrsize and layout number */ + /* + * Encoded with hdrsize and layout number as follows: + * 16 10 0 + * +--------+-------+ + * | hdrsz |layout | + * +--------+-------+ + * + * Bits 0-10 are the layout number + * Bits 11-16 are the size of the header. + * The hdrsize is the number * 8 + * + * For example. + * hdrsz of 1 ==> 8 byte header + * 2 ==> 16 byte header + * + */ + uint16_t sa_layout_info; uint16_t sa_lengths[1]; /* optional sizes for variable length attrs */ /* ... Data follows the lengths. */ } sa_hdr_phys_t; -/* - * sa_hdr_phys -> sa_layout_info - * - * 16 10 0 - * +--------+-------+ - * | hdrsz |layout | - * +--------+-------+ - * - * Bits 0-10 are the layout number - * Bits 11-16 are the size of the header. - * The hdrsize is the number * 8 - * - * For example. - * hdrsz of 1 ==> 8 byte header - * 2 ==> 16 byte header - * - */ - #define SA_HDR_LAYOUT_NUM(hdr) BF32_GET(hdr->sa_layout_info, 0, 10) #define SA_HDR_SIZE(hdr) BF32_GET_SB(hdr->sa_layout_info, 10, 6, 3, 0) #define SA_HDR_LAYOUT_INFO_ENCODE(x, num, size) \ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Jul 5 03:05:59 2013 (r252751) @@ -242,7 +242,7 @@ struct spa { uint64_t spa_sync_starttime; /* starting time fo spa_sync */ uint64_t spa_deadman_synctime; /* deadman expiration timer */ /* - * spa_refcnt & spa_config_lock must be the last elements + * spa_refcount & spa_config_lock must be the last elements * because refcount_t changes size based on compilation options. * In order for the MDB module to function correctly, the other * fields must remain in the same location. Modified: 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/space_map.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Fri Jul 5 03:05:59 2013 (r252751) @@ -94,7 +94,6 @@ struct space_map_ops { * 63 62 60 59 50 49 0 * * - * * non-debug entry * * 1 47 1 15 Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h Fri Jul 5 03:05:59 2013 (r252751) @@ -26,8 +26,6 @@ #ifndef _SYS_UNIQUE_H #define _SYS_UNIQUE_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifdef __cplusplus @@ -42,7 +40,7 @@ void unique_fini(void); /* * Return a new unique value (which will not be uniquified against until - * it is unique_insert()-ed. + * it is unique_insert()-ed). */ uint64_t unique_create(void); 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 Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Fri Jul 5 03:05:59 2013 (r252751) @@ -247,12 +247,13 @@ typedef struct vdev_label { #define VDD_METASLAB 0x01 #define VDD_DTL 0x02 +/* Offset of embedded boot loader region on each label */ +#define VDEV_BOOT_OFFSET (2 * sizeof (vdev_label_t)) /* - * Size and offset of embedded boot loader region on each label. + * Size of embedded boot loader region on each label. * The total size of the first two labels plus the boot area is 4MB. */ -#define VDEV_BOOT_OFFSET (2 * sizeof (vdev_label_t)) -#define VDEV_BOOT_SIZE (7ULL << 19) /* 3.5M */ +#define VDEV_BOOT_SIZE (7ULL << 19) /* 3.5M */ /* * Size of label regions at the start and end of each leaf device. @@ -323,8 +324,9 @@ extern uint64_t vdev_get_min_asize(vdev_ extern void vdev_set_min_asize(vdev_t *vd); /* - * zdb uses this tunable, so it must be declared here to make lint happy. + * Global variables */ +/* zdb uses this tunable, so it must be declared here to make lint happy. */ extern int zfs_vdev_cache_size; #ifdef __cplusplus Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Fri Jul 5 03:05:59 2013 (r252751) @@ -86,18 +86,22 @@ extern "C" { #endif /* - * The matchtype specifies which entry will be accessed. - * MT_EXACT: only find an exact match (non-normalized) - * MT_FIRST: find the "first" normalized (case and Unicode - * form) match; the designated "first" match will not change as long - * as the set of entries with this normalization doesn't change - * MT_BEST: if there is an exact match, find that, otherwise find the - * first normalized match + * Specifies matching criteria for ZAP lookups. */ typedef enum matchtype { + /* Only find an exact match (non-normalized) */ MT_EXACT, + /* + * If there is an exact match, find that, otherwise find the + * first normalized match. + */ MT_BEST, + /* + * Find the "first" normalized (case and Unicode form) match; + * the designated "first" match will not change as long as the + * set of entries with this normalization doesn't change. + */ MT_FIRST } matchtype_t; @@ -174,16 +178,21 @@ int zap_destroy(objset_t *ds, uint64_t z * call will fail and return EINVAL. * * If 'integer_size' is equal to or larger than the attribute's integer - * size, the call will succeed and return 0. * When converting to a - * larger integer size, the integers will be treated as unsigned (ie. no - * sign-extension will be performed). + * size, the call will succeed and return 0. + * + * When converting to a larger integer size, the integers will be treated as + * unsigned (ie. no sign-extension will be performed). * * 'num_integers' is the length (in integers) of 'buf'. * * If the attribute is longer than the buffer, as many integers as will * fit will be transferred to 'buf'. If the entire attribute was not * transferred, the call will return EOVERFLOW. - * + */ +int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name, + uint64_t integer_size, uint64_t num_integers, void *buf); + +/* * If rn_len is nonzero, realname will be set to the name of the found * entry (which may be different from the requested name if matchtype is * not MT_EXACT). @@ -191,8 +200,6 @@ int zap_destroy(objset_t *ds, uint64_t z * If normalization_conflictp is not NULL, it will be set if there is * another name with the same case/unicode normalized form. */ -int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name, - uint64_t integer_size, uint64_t num_integers, void *buf); int zap_lookup_norm(objset_t *ds, uint64_t zapobj, const char *name, uint64_t integer_size, uint64_t num_integers, void *buf, matchtype_t mt, char *realname, int rn_len, Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h Fri Jul 5 03:05:59 2013 (r252751) @@ -101,6 +101,7 @@ typedef enum zap_chunk_type { */ typedef struct zap_leaf_phys { struct zap_leaf_header { + /* Public to ZAP */ uint64_t lh_block_type; /* ZBT_LEAF */ uint64_t lh_pad1; uint64_t lh_prefix; /* hash prefix of this leaf */ @@ -109,8 +110,7 @@ typedef struct zap_leaf_phys { uint16_t lh_nentries; /* number of entries */ uint16_t lh_prefix_len; /* num bits used to id this */ -/* above is accessable to zap, below is zap_leaf private */ - + /* Private to zap_leaf */ uint16_t lh_freelist; /* chunk head of free list */ uint8_t lh_flags; /* ZLF_* flags */ uint8_t lh_pad2[11]; @@ -161,13 +161,13 @@ typedef struct zap_leaf { typedef struct zap_entry_handle { - /* below is set by zap_leaf.c and is public to zap.c */ + /* Set by zap_leaf and public to ZAP */ uint64_t zeh_num_integers; uint64_t zeh_hash; uint32_t zeh_cd; uint8_t zeh_integer_size; - /* below is private to zap_leaf.c */ + /* Private to zap_leaf */ uint16_t zeh_fakechunk; uint16_t *zeh_chunkp; zap_leaf_t *zeh_leaf; @@ -202,7 +202,7 @@ extern int zap_entry_read_name(struct za /* * Replace the value of an existing entry. * - * zap_entry_update may fail if it runs out of space (ENOSPC). + * May fail if it runs out of space (ENOSPC). */ extern int zap_entry_update(zap_entry_handle_t *zeh, uint8_t integer_size, uint64_t num_integers, const void *buf); @@ -221,10 +221,7 @@ extern int zap_entry_create(zap_leaf_t * uint8_t integer_size, uint64_t num_integers, const void *buf, zap_entry_handle_t *zeh); -/* - * Return true if there are additional entries with the same normalized - * form. - */ +/* Determine whether there is another entry with the same normalized form. */ extern boolean_t zap_entry_normalization_conflict(zap_entry_handle_t *zeh, struct zap_name *zn, const char *name, struct zap *zap); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Fri Jul 5 03:05:59 2013 (r252751) @@ -45,7 +45,8 @@ struct znode_phys; #define ZFS_ACL_VERSION ZFS_ACL_VERSION_FUID /* - * ZFS ACLs are store in various forms. + * ZFS ACLs (Access Control Lists) are stored in various forms. + * * Files created with ACL version ZFS_ACL_VERSION_INITIAL * will all be created with fixed length ACEs of type * zfs_oldace_t. @@ -135,8 +136,8 @@ typedef struct acl_ops { size_t (*ace_size)(void *acep); /* how big is this ace */ size_t (*ace_abstract_size)(void); /* sizeof abstract entry */ int (*ace_mask_off)(void); /* off of access mask in ace */ + /* ptr to data if any */ int (*ace_data)(void *acep, void **datap); - /* ptr to data if any */ } acl_ops_t; /* Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h Fri Jul 5 03:05:59 2013 (r252751) @@ -26,8 +26,6 @@ #ifndef _SYS_FS_ZFS_RLOCK_H #define _SYS_FS_ZFS_RLOCK_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -57,16 +55,14 @@ typedef struct rl { } rl_t; /* - * Lock a range (offset, length) as either shared (READER) - * or exclusive (WRITER or APPEND). APPEND is a special type that - * is converted to WRITER that specified to lock from the start of the - * end of file. zfs_range_lock() returns the range lock structure. + * Lock a range (offset, length) as either shared (RL_READER) + * or exclusive (RL_WRITER or RL_APPEND). RL_APPEND is a special type that + * is converted to RL_WRITER that specified to lock from the start of the + * end of file. Returns the range lock structure. */ rl_t *zfs_range_lock(znode_t *zp, uint64_t off, uint64_t len, rl_type_t type); -/* - * Unlock range and destroy range lock structure. - */ +/* Unlock range and destroy range lock structure. */ void zfs_range_unlock(rl_t *rl); /* @@ -76,7 +72,8 @@ void zfs_range_unlock(rl_t *rl); void zfs_range_reduce(rl_t *rl, uint64_t off, uint64_t len); /* - * AVL comparison function used to compare range locks + * AVL comparison function used to order range locks + * Locks are ordered on the start offset of the range. */ int zfs_range_compare(const void *arg1, const void *arg2); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Fri Jul 5 03:05:59 2013 (r252751) @@ -135,8 +135,9 @@ extern "C" { #define ZFS_MAX_BLOCKSIZE (SPA_MAXBLOCKSIZE) -/* Path component length */ /* + * Path component length + * * The generic fs code uses MAXNAMELEN to represent * what the largest component length is. Unfortunately, * this length includes the terminating NULL. ZFS needs @@ -252,12 +253,7 @@ VTOZ(vnode_t *vp) #define VTOZ(VP) ((znode_t *)(VP)->v_data) #endif -/* - * ZFS_ENTER() is called on entry to each ZFS vnode and vfs operation. - * ZFS_ENTER_NOERROR() is called when we can't return EIO. - * ZFS_EXIT() must be called before exitting the vop. - * ZFS_VERIFY_ZP() verifies the znode is valid. - */ +/* Called on entry to each ZFS vnode and vfs operation */ #define ZFS_ENTER(zfsvfs) \ { \ rrw_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \ @@ -267,11 +263,14 @@ VTOZ(vnode_t *vp) } \ } +/* Called on entry to each ZFS vnode and vfs operation that can not return EIO */ #define ZFS_ENTER_NOERROR(zfsvfs) \ rrw_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) +/* Must be called before exiting the vop */ #define ZFS_EXIT(zfsvfs) rrw_exit(&(zfsvfs)->z_teardown_lock, FTAG) +/* Verifies the znode is valid */ #define ZFS_VERIFY_ZP(zp) \ if ((zp)->z_sa_hdl == NULL) { \ ZFS_EXIT((zp)->z_zfsvfs); \ @@ -291,15 +290,14 @@ VTOZ(vnode_t *vp) #define ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num) \ mutex_exit(ZFS_OBJ_MUTEX((zfsvfs), (obj_num))) -/* - * Macros to encode/decode ZFS stored time values from/to struct timespec - */ +/* Encode ZFS stored time values from a struct timespec */ #define ZFS_TIME_ENCODE(tp, stmp) \ { \ (stmp)[0] = (uint64_t)(tp)->tv_sec; \ (stmp)[1] = (uint64_t)(tp)->tv_nsec; \ } +/* Decode ZFS stored time values to a struct timespec */ #define ZFS_TIME_DECODE(tp, stmp) \ { \ (tp)->tv_sec = (time_t)(stmp)[0]; \ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Fri Jul 5 03:05:59 2013 (r252751) @@ -242,6 +242,12 @@ typedef struct { * information needed for replaying the create. If the * file doesn't have any actual ACEs then the lr_aclcnt * would be zero. + * + * After lr_acl_flags, there are a lr_acl_bytes number of variable sized ace's. + * If create is also setting xvattr's, then acl data follows xvattr. + * If ACE FUIDs are needed then they will follow the xvattr_t. Following + * the FUIDs will be the domain table information. The FUIDs for the owner + * and group will be in lr_create. Name follows ACL data. */ typedef struct { lr_create_t lr_create; /* common create portion */ @@ -250,13 +256,6 @@ typedef struct { uint64_t lr_fuidcnt; /* number of real fuids */ uint64_t lr_acl_bytes; /* number of bytes in ACL */ uint64_t lr_acl_flags; /* ACL flags */ - /* lr_acl_bytes number of variable sized ace's follows */ - /* if create is also setting xvattr's, then acl data follows xvattr */ - /* if ACE FUIDs are needed then they will follow the xvattr_t */ - /* Following the FUIDs will be the domain table information. */ - /* The FUIDs for the owner and group will be in the lr_create */ - /* portion of the record. */ - /* name follows ACL data */ } lr_acl_create_t; typedef struct { 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 Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Fri Jul 5 03:05:59 2013 (r252751) @@ -36,11 +36,10 @@ extern "C" { #endif -/* - * Common signature for all zio compress/decompress functions. - */ +/* Common signature for all zio compress functions. */ typedef size_t zio_compress_func_t(void *src, void *dst, size_t s_len, size_t d_len, int); +/* Common signature for all zio decompress functions. */ typedef int zio_decompress_func_t(void *src, void *dst, size_t s_len, size_t d_len, int); Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:05:59 2013 (r252751) @@ -570,8 +570,8 @@ txg_quiesce_thread(void *arg) /* * Delay this thread by 'ticks' if we are still in the open transaction - * group and there is already a waiting txg quiesing or quiesced. Abort - * the delay if this txg stalls or enters the quiesing state. + * group and there is already a waiting txg quiescing or quiesced. + * Abort the delay if this txg stalls or enters the quiescing state. */ void txg_delay(dsl_pool_t *dp, uint64_t txg, int ticks) @@ -579,7 +579,7 @@ txg_delay(dsl_pool_t *dp, uint64_t txg, tx_state_t *tx = &dp->dp_tx; clock_t timeout = ddi_get_lbolt() + ticks; - /* don't delay if this txg could transition to quiesing immediately */ + /* don't delay if this txg could transition to quiescing immediately */ if (tx->tx_open_txg > txg || tx->tx_syncing_txg == txg-1 || tx->tx_synced_txg == txg-1) return; 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 Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Jul 5 03:05:59 2013 (r252751) @@ -963,9 +963,11 @@ vdev_probe_done(zio_t *zio) } /* - * Determine whether this device is accessible by reading and writing - * to several known locations: the pad regions of each vdev label - * but the first (which we leave alone in case it contains a VTOC). + * Determine whether this device is accessible. + * + * Read and write to several known locations: the pad regions of each + * vdev label but the first, which we leave alone in case it contains + * a VTOC. */ zio_t * vdev_probe(vdev_t *vd, zio_t *zio) @@ -2191,10 +2193,12 @@ vdev_degrade(spa_t *spa, uint64_t guid, } /* - * Online the given vdev. If 'unspare' is set, it implies two things. First, - * any attached spare device should be detached when the device finishes - * resilvering. Second, the online should be treated like a 'test' online case, - * so no FMA events are generated if the device fails to open. + * Online the given vdev. + * + * If 'ZFS_ONLINE_UNSPARE' is set, it implies two things. First, any attached + * spare device should be detached when the device finishes resilvering. + * Second, the online should be treated like a 'test' online case, so no FMA + * events are generated if the device fails to open. */ int vdev_online(spa_t *spa, uint64_t guid, uint64_t flags, vdev_state_t *newstate) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Jul 5 03:05:59 2013 (r252751) @@ -35,13 +35,14 @@ /* * These tunables are for performance analysis. */ + +/* The maximum number of I/Os concurrently pending to each device. */ +int zfs_vdev_max_pending = 10; + /* - * zfs_vdev_max_pending is the maximum number of i/os concurrently - * pending to each device. zfs_vdev_min_pending is the initial number - * of i/os pending to each device (before it starts ramping up to - * max_pending). + * The initial number of I/Os pending to each device, before it starts ramping + * up to zfs_vdev_max_pending. */ -int zfs_vdev_max_pending = 10; int zfs_vdev_min_pending = 4; /* 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 Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Fri Jul 5 03:05:59 2013 (r252751) @@ -60,6 +60,7 @@ * o addition (+) is represented by a bitwise XOR * o subtraction (-) is therefore identical to addition: A + B = A - B * o multiplication of A by 2 is defined by the following bitwise expression: + * * (A * 2)_7 = A_6 * (A * 2)_6 = A_5 * (A * 2)_5 = A_4 @@ -118,7 +119,7 @@ typedef struct raidz_map { uint64_t rm_missingparity; /* Count of missing parity devices */ uint64_t rm_firstdatacol; /* First data column/parity count */ uint64_t rm_nskip; /* Skipped sectors for padding */ - uint64_t rm_skipstart; /* Column index of padding start */ + uint64_t rm_skipstart; /* Column index of padding start */ void *rm_datacopy; /* rm_asize-buffer of copied data */ uintptr_t rm_reports; /* # of referencing checksum reports */ uint8_t rm_freed; /* map no longer has referencing ZIO */ @@ -158,10 +159,7 @@ typedef struct raidz_map { */ int vdev_raidz_default_to_general; -/* - * These two tables represent powers and logs of 2 in the Galois field defined - * above. These values were computed by repeatedly multiplying by 2 as above. - */ +/* Powers of 2 in the Galois field defined above. */ static const uint8_t vdev_raidz_pow2[256] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26, @@ -196,6 +194,7 @@ static const uint8_t vdev_raidz_pow2[256 0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x01 }; +/* Logs of 2 in the Galois field defined above. */ static const uint8_t vdev_raidz_log2[256] = { 0x00, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b, Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Fri Jul 5 03:05:59 2013 (r252751) @@ -1359,7 +1359,8 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mo zacep = (void *)((uintptr_t)zacep + abstract_size); new_count++; new_bytes += abstract_size; - } if (masks.deny1) { + } + if (masks.deny1) { zfs_set_ace(aclp, zacep, masks.deny1, DENY, -1, ACE_OWNER); zacep = (void *)((uintptr_t)zacep + abstract_size); new_count++; @@ -1767,7 +1768,7 @@ zfs_acl_ids_overquota(zfsvfs_t *zfsvfs, } /* - * Retrieve a files ACL + * Retrieve a file's ACL */ int zfs_getacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr) @@ -1922,7 +1923,7 @@ zfs_vsec_2_aclp(zfsvfs_t *zfsvfs, vtype_ } /* - * Set a files ACL + * Set a file's ACL */ int zfs_setacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr) @@ -2355,6 +2356,7 @@ slow: /* * Determine whether Access should be granted/denied. + * * The least priv subsytem is always consulted as a basic privilege * can define any form of access. */ @@ -2560,7 +2562,6 @@ zfs_delete_final_check(znode_t *zp, znod * Determine whether Access should be granted/deny, without * consulting least priv subsystem. * - * * The following chart is the recommended NFSv4 enforcement for * ability to delete an object. * Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 03:05:59 2013 (r252751) @@ -1234,6 +1234,7 @@ zfsctl_shares_readdir(ap) /* * pvp is the '.zfs' directory (zfsctl_node_t). + * * Creates vp, which is '.zfs/snapshot' (zfsctl_snapdir_t). * * This function is the callback to create a GFS vnode for '.zfs/snapshot' Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:05:59 2013 (r252751) @@ -335,9 +335,7 @@ zfs_is_bootfs(const char *name) } /* - * zfs_earlier_version - * - * Return non-zero if the spa version is less than requested version. + * Return non-zero if the spa version is less than requested version. */ static int zfs_earlier_version(const char *name, int version) @@ -355,8 +353,6 @@ zfs_earlier_version(const char *name, in } /* - * zpl_earlier_version - * * Return TRUE if the ZPL version is less than requested version. */ static boolean_t @@ -3000,10 +2996,10 @@ zfs_create_cb(objset_t *os, void *arg, c /* * inputs: - * createprops list of properties requested by creator - * default_zplver zpl version to use if unspecified in createprops - * fuids_ok fuids allowed in this version of the spa? * os parent objset pointer (NULL if root fs) + * fuids_ok fuids allowed in this version of the spa? + * sa_ok SAs allowed in this version of the spa? + * createprops list of properties requested by creator * * outputs: * zplprops values for the zplprops we attach to the master node object Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Fri Jul 5 03:05:59 2013 (r252751) @@ -216,9 +216,8 @@ zfs_log_fuid_domains(zfs_fuid_info_t *fu } /* - * zfs_log_create() is used to handle TX_CREATE, TX_CREATE_ATTR, TX_MKDIR, - * TX_MKDIR_ATTR and TX_MKXATTR - * transactions. + * Handles TX_CREATE, TX_CREATE_ATTR, TX_MKDIR, TX_MKDIR_ATTR and + * TK_MKXATTR transactions. * * TX_CREATE and TX_MKDIR are standard creates, but they may have FUID * domain information appended prior to the name. In this case the @@ -345,7 +344,7 @@ zfs_log_create(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_remove() handles both TX_REMOVE and TX_RMDIR transactions. + * Handles both TX_REMOVE and TX_RMDIR transactions. */ void zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -369,7 +368,7 @@ zfs_log_remove(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_link() handles TX_LINK transactions. + * Handles TX_LINK transactions. */ void zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -392,7 +391,7 @@ zfs_log_link(zilog_t *zilog, dmu_tx_t *t } /* - * zfs_log_symlink() handles TX_SYMLINK transactions. + * Handles TX_SYMLINK transactions. */ void zfs_log_symlink(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -424,7 +423,7 @@ zfs_log_symlink(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_rename() handles TX_RENAME transactions. + * Handles TX_RENAME transactions. */ void zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -450,7 +449,7 @@ zfs_log_rename(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_write() handles TX_WRITE transactions. + * Handles TX_WRITE transactions. */ ssize_t zfs_immediate_write_sz = 32768; @@ -529,7 +528,7 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t * } /* - * zfs_log_truncate() handles TX_TRUNCATE transactions. + * Handles TX_TRUNCATE transactions. */ void zfs_log_truncate(zilog_t *zilog, dmu_tx_t *tx, int txtype, @@ -552,7 +551,7 @@ zfs_log_truncate(zilog_t *zilog, dmu_tx_ } /* - * zfs_log_setattr() handles TX_SETATTR transactions. + * Handles TX_SETATTR transactions. */ void zfs_log_setattr(zilog_t *zilog, dmu_tx_t *tx, int txtype, @@ -614,7 +613,7 @@ zfs_log_setattr(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_acl() handles TX_ACL transactions. + * Handles TX_ACL transactions. */ void zfs_log_acl(zilog_t *zilog, dmu_tx_t *tx, znode_t *zp, Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Fri Jul 5 03:05:59 2013 (r252751) @@ -28,7 +28,7 @@ /* * This file contains the code to implement file range locking in - * ZFS, although there isn't much specific to ZFS (all that comes to mind + * ZFS, although there isn't much specific to ZFS (all that comes to mind is * support for growing the blocksize). * * Interface Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c Fri Jul 5 03:05:59 2013 (r252751) @@ -187,7 +187,7 @@ zfs_sa_set_scanstamp(znode_t *zp, xvattr /* * I'm not convinced we should do any of this upgrade. * since the SA code can read both old/new znode formats - * with probably little to know performance difference. + * with probably little to no performance difference. * * All new files will be created with the new format. */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jul 5 03:02:19 2013 (r252750) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jul 5 03:05:59 2013 (r252751) @@ -1341,13 +1341,12 @@ zfs_parse_bootfs(char *bpath, char *outp } /* - * zfs_check_global_label: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 03:06:44 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8371AFAC; Fri, 5 Jul 2013 03:06:44 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 71C7B1CB4; Fri, 5 Jul 2013 03:06:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6536i89056140; Fri, 5 Jul 2013 03:06:44 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6536b50056092; Fri, 5 Jul 2013 03:06:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050306.r6536b50056092@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:06: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: r252752 - 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.14 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, 05 Jul 2013 03:06:44 -0000 Author: delphij Date: Fri Jul 5 03:06:36 2013 New Revision: 252752 URL: http://svnweb.freebsd.org/changeset/base/252752 Log: MFC r251631: illumos #3742 zfs comments need cleaner, more consistent style - Make more of ZFS's comments use a natural English writing flow. - Break up long paragraphs, fix various typos and spelling errors. - Don't prefix a function description with its name when the function definition immediately follows. - Remove useless comments. - Add extra whitespace where it makes the comments more readable. New comments were separated from this change and added in r251629. Submitted by: asomers, gibbs, will Reviewed by: Matthew Ahrens , George Wilson , Eric Schrock , Christopher Siden Sponsored by: Spectra Logic Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.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/spa_misc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_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/unique.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/zap.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.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/txg.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.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 stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c 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/arc.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Fri Jul 5 03:06:36 2013 (r252752) @@ -57,11 +57,11 @@ * tight. * * 3. The Megiddo and Modha model assumes a fixed page size. All - * elements of the cache are therefor exactly the same size. So + * elements of the cache are therefore exactly the same size. So * when adjusting the cache size following a cache miss, its simply * a matter of choosing a single page to evict. In our model, we * have variable sized cache blocks (rangeing from 512 bytes to - * 128K bytes). We therefor choose a set of blocks to evict to make + * 128K bytes). We therefore choose a set of blocks to evict to make * space for a cache miss that approximates as closely as possible * the space used by the new block. * @@ -76,7 +76,7 @@ * ways: 1) via a hash table lookup using the DVA as a key, * or 2) via one of the ARC lists. The arc_read() interface * uses method 1, while the internal arc algorithms for - * adjusting the cache use method 2. We therefor provide two + * adjusting the cache use method 2. We therefore provide two * types of locks: 1) the hash table lock array, and 2) the * arc list locks. * @@ -428,7 +428,7 @@ static arc_stats_t arc_stats = { #define ARCSTAT(stat) (arc_stats.stat.value.ui64) #define ARCSTAT_INCR(stat, val) \ - atomic_add_64(&arc_stats.stat.value.ui64, (val)); + atomic_add_64(&arc_stats.stat.value.ui64, (val)) #define ARCSTAT_BUMP(stat) ARCSTAT_INCR(stat, 1) #define ARCSTAT_BUMPDOWN(stat) ARCSTAT_INCR(stat, -1) @@ -654,9 +654,7 @@ uint64_t zfs_crc64_table[256]; #define l2arc_writes_sent ARCSTAT(arcstat_l2_writes_sent) #define l2arc_writes_done ARCSTAT(arcstat_l2_writes_done) -/* - * L2ARC Performance Tunables - */ +/* L2ARC Performance Tunables */ uint64_t l2arc_write_max = L2ARC_WRITE_SIZE; /* default max write size */ uint64_t l2arc_write_boost = L2ARC_WRITE_SIZE; /* extra write during warmup */ uint64_t l2arc_headroom = L2ARC_HEADROOM; /* number of dev writes */ @@ -3817,7 +3815,7 @@ arc_tempreserve_space(uint64_t reserve, /* * Writes will, almost always, require additional memory allocations - * in order to compress/encrypt/etc the data. We therefor need to + * in order to compress/encrypt/etc the data. We therefore need to * make sure that there is sufficient available memory for this. */ if (error = arc_memory_throttle(reserve, anon_size, txg)) 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 Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bptree.c Fri Jul 5 03:06:36 2013 (r252752) @@ -43,7 +43,7 @@ * dsl_scan_sync. This allows the delete operation to finish without traversing * all the dataset's blocks. * - * Note that while bt_begin and bt_end are only ever incremented in this code + * Note that while bt_begin and bt_end are only ever incremented in this code, * they are effectively reset to 0 every time the entire bptree is freed because * the bptree's object is destroyed and re-created. */ 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 Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c Fri Jul 5 03:06:36 2013 (r252752) @@ -1808,14 +1808,16 @@ dnode_willuse_space(dnode_t *dn, int64_t } /* - * This function scans a block at the indicated "level" looking for - * a hole or data (depending on 'flags'). If level > 0, then we are - * scanning an indirect block looking at its pointers. If level == 0, - * then we are looking at a block of dnodes. If we don't find what we - * are looking for in the block, we return ESRCH. Otherwise, return - * with *offset pointing to the beginning (if searching forwards) or - * end (if searching backwards) of the range covered by the block - * pointer we matched on (or dnode). + * Scans a block at the indicated "level" looking for a hole or data, + * depending on 'flags'. + * + * If level > 0, then we are scanning an indirect block looking at its + * pointers. If level == 0, then we are looking at a block of dnodes. + * + * If we don't find what we are looking for in the block, we return ESRCH. + * Otherwise, return with *offset pointing to the beginning (if searching + * forwards) or end (if searching backwards) of the range covered by the + * block pointer we matched on (or dnode). * * The basic search algorithm used below by dnode_next_offset() is to * use this function to search up the block tree (widen the search) until Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c Fri Jul 5 03:06:36 2013 (r252752) @@ -302,7 +302,7 @@ free_children(dmu_buf_impl_t *db, uint64 } /* - * free_range: Traverse the indicated range of the provided file + * Traverse the indicated range of the provided file * and "free" all the blocks contained there. */ static void @@ -370,7 +370,7 @@ dnode_sync_free_range(dnode_t *dn, uint6 } /* - * Try to kick all the dnodes dbufs out of the cache... + * Try to kick all the dnode's dbufs out of the cache... */ void dnode_evict_dbufs(dnode_t *dn) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c Fri Jul 5 03:06:36 2013 (r252752) @@ -379,7 +379,7 @@ dsl_prop_predict(dsl_dir_t *dd, const ch /* * Unregister this callback. Return 0 on success, ENOENT if ddname is - * invalid, ENOMSG if no matching callback registered. + * invalid, or ENOMSG if no matching callback registered. */ int dsl_prop_unregister(dsl_dataset_t *ds, const char *propname, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c Fri Jul 5 03:06:36 2013 (r252752) @@ -111,6 +111,7 @@ * location. * * Byteswap implications: + * * Since the SA attributes are not entirely self describing we can't do * the normal byteswap processing. The special ZAP layout attribute and * attribute registration attributes define the byteswap function and the @@ -189,7 +190,6 @@ sa_attr_reg_t sa_legacy_attrs[] = { }; /* - * ZPL legacy layout * This is only used for objects of type DMU_OT_ZNODE */ sa_attr_type_t sa_legacy_zpl_layout[] = { @@ -199,7 +199,6 @@ sa_attr_type_t sa_legacy_zpl_layout[] = /* * Special dummy layout used for buffers with no attributes. */ - sa_attr_type_t sa_dummy_zpl_layout[] = { 0 }; static int sa_legacy_attr_count = 16; 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 Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 03:06:36 2013 (r252752) @@ -4698,6 +4698,7 @@ spa_vdev_attach(spa_t *spa, uint64_t gui /* * Detach a device from a mirror or replacing vdev. + * * If 'replace_done' is specified, only detach if the parent * is a replacing vdev. */ @@ -5359,11 +5360,9 @@ spa_vdev_remove_from_namespace(spa_t *sp * the spa_vdev_config_[enter/exit] functions which allow us to * grab and release the spa_config_lock while still holding the namespace * lock. During each step the configuration is synced out. - */ - -/* - * Remove a device from the pool. Currently, this supports removing only hot - * spares, slogs, and level 2 ARC devices. + * + * Currently, this supports removing only hot spares, slogs, and level 2 ARC + * devices. */ int spa_vdev_remove(spa_t *spa, uint64_t guid, boolean_t unspare) @@ -5473,7 +5472,7 @@ spa_vdev_remove(spa_t *spa, uint64_t gui /* * Find any device that's done replacing, or a vdev marked 'unspare' that's - * current spared, so we can detach it. + * currently spared, so we can detach it. */ static vdev_t * spa_vdev_resilver_done_hunt(vdev_t *vd) 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 Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Fri Jul 5 03:06:36 2013 (r252752) @@ -307,6 +307,7 @@ spa_config_set(spa_t *spa, nvlist_t *con /* * Generate the pool's configuration based on the current in-core state. + * * We infer whether to generate a complete config or just one top-level config * based on whether vd is the root vdev. */ 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 Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c Fri Jul 5 03:06:36 2013 (r252752) @@ -1369,7 +1369,7 @@ zfs_panic_recover(const char *fmt, ...) /* * This is a stripped-down version of strtoull, suitable only for converting - * lowercase hexidecimal numbers that don't overflow. + * lowercase hexadecimal numbers that don't overflow. */ uint64_t zfs_strtonum(const char *str, char **nptr) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Fri Jul 5 03:06:36 2013 (r252752) @@ -63,16 +63,15 @@ enum ddt_class { */ typedef struct ddt_key { zio_cksum_t ddk_cksum; /* 256-bit block checksum */ - uint64_t ddk_prop; /* LSIZE, PSIZE, compression */ + /* + * Encoded with logical & physical size, and compression, as follows: + * +-------+-------+-------+-------+-------+-------+-------+-------+ + * | 0 | 0 | 0 | comp | PSIZE | LSIZE | + * +-------+-------+-------+-------+-------+-------+-------+-------+ + */ + uint64_t ddk_prop; } ddt_key_t; -/* - * ddk_prop layout: - * - * +-------+-------+-------+-------+-------+-------+-------+-------+ - * | 0 | 0 | 0 | comp | PSIZE | LSIZE | - * +-------+-------+-------+-------+-------+-------+-------+-------+ - */ #define DDK_GET_LSIZE(ddk) \ BF64_GET_SB((ddk)->ddk_prop, 0, 16, SPA_MINBLOCKSHIFT, 1) #define DDK_SET_LSIZE(ddk, x) \ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h Fri Jul 5 03:06:36 2013 (r252752) @@ -145,9 +145,8 @@ typedef struct dnode_phys { typedef struct dnode { /* - * dn_struct_rwlock protects the structure of the dnode, - * including the number of levels of indirection (dn_nlevels), - * dn_maxblkid, and dn_next_* + * Protects the structure of the dnode, including the number of levels + * of indirection (dn_nlevels), dn_maxblkid, and dn_next_* */ krwlock_t dn_struct_rwlock; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Fri Jul 5 03:06:36 2013 (r252752) @@ -110,6 +110,7 @@ typedef struct dsl_pool { /* * Protects administrative changes (properties, namespace) + * * It is only held for write in syncing context. Therefore * syncing context does not need to ever have it for read, since * nobody else could possibly have it for write. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h Fri Jul 5 03:06:36 2013 (r252752) @@ -150,6 +150,7 @@ struct sa_os { /* * header for all bonus and spill buffers. + * * The header has a fixed portion with a variable number * of "lengths" depending on the number of variable sized * attribues which are determined by the "layout number" @@ -158,29 +159,27 @@ struct sa_os { #define SA_MAGIC 0x2F505A /* ZFS SA */ typedef struct sa_hdr_phys { uint32_t sa_magic; - uint16_t sa_layout_info; /* Encoded with hdrsize and layout number */ + /* + * Encoded with hdrsize and layout number as follows: + * 16 10 0 + * +--------+-------+ + * | hdrsz |layout | + * +--------+-------+ + * + * Bits 0-10 are the layout number + * Bits 11-16 are the size of the header. + * The hdrsize is the number * 8 + * + * For example. + * hdrsz of 1 ==> 8 byte header + * 2 ==> 16 byte header + * + */ + uint16_t sa_layout_info; uint16_t sa_lengths[1]; /* optional sizes for variable length attrs */ /* ... Data follows the lengths. */ } sa_hdr_phys_t; -/* - * sa_hdr_phys -> sa_layout_info - * - * 16 10 0 - * +--------+-------+ - * | hdrsz |layout | - * +--------+-------+ - * - * Bits 0-10 are the layout number - * Bits 11-16 are the size of the header. - * The hdrsize is the number * 8 - * - * For example. - * hdrsz of 1 ==> 8 byte header - * 2 ==> 16 byte header - * - */ - #define SA_HDR_LAYOUT_NUM(hdr) BF32_GET(hdr->sa_layout_info, 0, 10) #define SA_HDR_SIZE(hdr) BF32_GET_SB(hdr->sa_layout_info, 10, 6, 3, 0) #define SA_HDR_LAYOUT_INFO_ENCODE(x, num, size) \ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Jul 5 03:06:36 2013 (r252752) @@ -242,7 +242,7 @@ struct spa { uint64_t spa_sync_starttime; /* starting time fo spa_sync */ uint64_t spa_deadman_synctime; /* deadman expiration timer */ /* - * spa_refcnt & spa_config_lock must be the last elements + * spa_refcount & spa_config_lock must be the last elements * because refcount_t changes size based on compilation options. * In order for the MDB module to function correctly, the other * fields must remain in the same location. Modified: 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/space_map.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/space_map.h Fri Jul 5 03:06:36 2013 (r252752) @@ -94,7 +94,6 @@ struct space_map_ops { * 63 62 60 59 50 49 0 * * - * * non-debug entry * * 1 47 1 15 Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/unique.h Fri Jul 5 03:06:36 2013 (r252752) @@ -26,8 +26,6 @@ #ifndef _SYS_UNIQUE_H #define _SYS_UNIQUE_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include #ifdef __cplusplus @@ -42,7 +40,7 @@ void unique_fini(void); /* * Return a new unique value (which will not be uniquified against until - * it is unique_insert()-ed. + * it is unique_insert()-ed). */ uint64_t unique_create(void); 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 Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h Fri Jul 5 03:06:36 2013 (r252752) @@ -247,12 +247,13 @@ typedef struct vdev_label { #define VDD_METASLAB 0x01 #define VDD_DTL 0x02 +/* Offset of embedded boot loader region on each label */ +#define VDEV_BOOT_OFFSET (2 * sizeof (vdev_label_t)) /* - * Size and offset of embedded boot loader region on each label. + * Size of embedded boot loader region on each label. * The total size of the first two labels plus the boot area is 4MB. */ -#define VDEV_BOOT_OFFSET (2 * sizeof (vdev_label_t)) -#define VDEV_BOOT_SIZE (7ULL << 19) /* 3.5M */ +#define VDEV_BOOT_SIZE (7ULL << 19) /* 3.5M */ /* * Size of label regions at the start and end of each leaf device. @@ -323,8 +324,9 @@ extern uint64_t vdev_get_min_asize(vdev_ extern void vdev_set_min_asize(vdev_t *vd); /* - * zdb uses this tunable, so it must be declared here to make lint happy. + * Global variables */ +/* zdb uses this tunable, so it must be declared here to make lint happy. */ extern int zfs_vdev_cache_size; #ifdef __cplusplus Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h Fri Jul 5 03:06:36 2013 (r252752) @@ -86,18 +86,22 @@ extern "C" { #endif /* - * The matchtype specifies which entry will be accessed. - * MT_EXACT: only find an exact match (non-normalized) - * MT_FIRST: find the "first" normalized (case and Unicode - * form) match; the designated "first" match will not change as long - * as the set of entries with this normalization doesn't change - * MT_BEST: if there is an exact match, find that, otherwise find the - * first normalized match + * Specifies matching criteria for ZAP lookups. */ typedef enum matchtype { + /* Only find an exact match (non-normalized) */ MT_EXACT, + /* + * If there is an exact match, find that, otherwise find the + * first normalized match. + */ MT_BEST, + /* + * Find the "first" normalized (case and Unicode form) match; + * the designated "first" match will not change as long as the + * set of entries with this normalization doesn't change. + */ MT_FIRST } matchtype_t; @@ -174,16 +178,21 @@ int zap_destroy(objset_t *ds, uint64_t z * call will fail and return EINVAL. * * If 'integer_size' is equal to or larger than the attribute's integer - * size, the call will succeed and return 0. * When converting to a - * larger integer size, the integers will be treated as unsigned (ie. no - * sign-extension will be performed). + * size, the call will succeed and return 0. + * + * When converting to a larger integer size, the integers will be treated as + * unsigned (ie. no sign-extension will be performed). * * 'num_integers' is the length (in integers) of 'buf'. * * If the attribute is longer than the buffer, as many integers as will * fit will be transferred to 'buf'. If the entire attribute was not * transferred, the call will return EOVERFLOW. - * + */ +int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name, + uint64_t integer_size, uint64_t num_integers, void *buf); + +/* * If rn_len is nonzero, realname will be set to the name of the found * entry (which may be different from the requested name if matchtype is * not MT_EXACT). @@ -191,8 +200,6 @@ int zap_destroy(objset_t *ds, uint64_t z * If normalization_conflictp is not NULL, it will be set if there is * another name with the same case/unicode normalized form. */ -int zap_lookup(objset_t *ds, uint64_t zapobj, const char *name, - uint64_t integer_size, uint64_t num_integers, void *buf); int zap_lookup_norm(objset_t *ds, uint64_t zapobj, const char *name, uint64_t integer_size, uint64_t num_integers, void *buf, matchtype_t mt, char *realname, int rn_len, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h Fri Jul 5 03:06:36 2013 (r252752) @@ -101,6 +101,7 @@ typedef enum zap_chunk_type { */ typedef struct zap_leaf_phys { struct zap_leaf_header { + /* Public to ZAP */ uint64_t lh_block_type; /* ZBT_LEAF */ uint64_t lh_pad1; uint64_t lh_prefix; /* hash prefix of this leaf */ @@ -109,8 +110,7 @@ typedef struct zap_leaf_phys { uint16_t lh_nentries; /* number of entries */ uint16_t lh_prefix_len; /* num bits used to id this */ -/* above is accessable to zap, below is zap_leaf private */ - + /* Private to zap_leaf */ uint16_t lh_freelist; /* chunk head of free list */ uint8_t lh_flags; /* ZLF_* flags */ uint8_t lh_pad2[11]; @@ -161,13 +161,13 @@ typedef struct zap_leaf { typedef struct zap_entry_handle { - /* below is set by zap_leaf.c and is public to zap.c */ + /* Set by zap_leaf and public to ZAP */ uint64_t zeh_num_integers; uint64_t zeh_hash; uint32_t zeh_cd; uint8_t zeh_integer_size; - /* below is private to zap_leaf.c */ + /* Private to zap_leaf */ uint16_t zeh_fakechunk; uint16_t *zeh_chunkp; zap_leaf_t *zeh_leaf; @@ -202,7 +202,7 @@ extern int zap_entry_read_name(struct za /* * Replace the value of an existing entry. * - * zap_entry_update may fail if it runs out of space (ENOSPC). + * May fail if it runs out of space (ENOSPC). */ extern int zap_entry_update(zap_entry_handle_t *zeh, uint8_t integer_size, uint64_t num_integers, const void *buf); @@ -221,10 +221,7 @@ extern int zap_entry_create(zap_leaf_t * uint8_t integer_size, uint64_t num_integers, const void *buf, zap_entry_handle_t *zeh); -/* - * Return true if there are additional entries with the same normalized - * form. - */ +/* Determine whether there is another entry with the same normalized form. */ extern boolean_t zap_entry_normalization_conflict(zap_entry_handle_t *zeh, struct zap_name *zn, const char *name, struct zap *zap); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h Fri Jul 5 03:06:36 2013 (r252752) @@ -45,7 +45,8 @@ struct znode_phys; #define ZFS_ACL_VERSION ZFS_ACL_VERSION_FUID /* - * ZFS ACLs are store in various forms. + * ZFS ACLs (Access Control Lists) are stored in various forms. + * * Files created with ACL version ZFS_ACL_VERSION_INITIAL * will all be created with fixed length ACEs of type * zfs_oldace_t. @@ -135,8 +136,8 @@ typedef struct acl_ops { size_t (*ace_size)(void *acep); /* how big is this ace */ size_t (*ace_abstract_size)(void); /* sizeof abstract entry */ int (*ace_mask_off)(void); /* off of access mask in ace */ + /* ptr to data if any */ int (*ace_data)(void *acep, void **datap); - /* ptr to data if any */ } acl_ops_t; /* Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_rlock.h Fri Jul 5 03:06:36 2013 (r252752) @@ -26,8 +26,6 @@ #ifndef _SYS_FS_ZFS_RLOCK_H #define _SYS_FS_ZFS_RLOCK_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -57,16 +55,14 @@ typedef struct rl { } rl_t; /* - * Lock a range (offset, length) as either shared (READER) - * or exclusive (WRITER or APPEND). APPEND is a special type that - * is converted to WRITER that specified to lock from the start of the - * end of file. zfs_range_lock() returns the range lock structure. + * Lock a range (offset, length) as either shared (RL_READER) + * or exclusive (RL_WRITER or RL_APPEND). RL_APPEND is a special type that + * is converted to RL_WRITER that specified to lock from the start of the + * end of file. Returns the range lock structure. */ rl_t *zfs_range_lock(znode_t *zp, uint64_t off, uint64_t len, rl_type_t type); -/* - * Unlock range and destroy range lock structure. - */ +/* Unlock range and destroy range lock structure. */ void zfs_range_unlock(rl_t *rl); /* @@ -76,7 +72,8 @@ void zfs_range_unlock(rl_t *rl); void zfs_range_reduce(rl_t *rl, uint64_t off, uint64_t len); /* - * AVL comparison function used to compare range locks + * AVL comparison function used to order range locks + * Locks are ordered on the start offset of the range. */ int zfs_range_compare(const void *arg1, const void *arg2); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Fri Jul 5 03:06:36 2013 (r252752) @@ -135,8 +135,9 @@ extern "C" { #define ZFS_MAX_BLOCKSIZE (SPA_MAXBLOCKSIZE) -/* Path component length */ /* + * Path component length + * * The generic fs code uses MAXNAMELEN to represent * what the largest component length is. Unfortunately, * this length includes the terminating NULL. ZFS needs @@ -252,12 +253,7 @@ VTOZ(vnode_t *vp) #define VTOZ(VP) ((znode_t *)(VP)->v_data) #endif -/* - * ZFS_ENTER() is called on entry to each ZFS vnode and vfs operation. - * ZFS_ENTER_NOERROR() is called when we can't return EIO. - * ZFS_EXIT() must be called before exitting the vop. - * ZFS_VERIFY_ZP() verifies the znode is valid. - */ +/* Called on entry to each ZFS vnode and vfs operation */ #define ZFS_ENTER(zfsvfs) \ { \ rrw_enter_read(&(zfsvfs)->z_teardown_lock, FTAG); \ @@ -267,11 +263,14 @@ VTOZ(vnode_t *vp) } \ } +/* Called on entry to each ZFS vnode and vfs operation that can not return EIO */ #define ZFS_ENTER_NOERROR(zfsvfs) \ rrw_enter(&(zfsvfs)->z_teardown_lock, RW_READER, FTAG) +/* Must be called before exiting the vop */ #define ZFS_EXIT(zfsvfs) rrw_exit(&(zfsvfs)->z_teardown_lock, FTAG) +/* Verifies the znode is valid */ #define ZFS_VERIFY_ZP(zp) \ if ((zp)->z_sa_hdl == NULL) { \ ZFS_EXIT((zp)->z_zfsvfs); \ @@ -291,15 +290,14 @@ VTOZ(vnode_t *vp) #define ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num) \ mutex_exit(ZFS_OBJ_MUTEX((zfsvfs), (obj_num))) -/* - * Macros to encode/decode ZFS stored time values from/to struct timespec - */ +/* Encode ZFS stored time values from a struct timespec */ #define ZFS_TIME_ENCODE(tp, stmp) \ { \ (stmp)[0] = (uint64_t)(tp)->tv_sec; \ (stmp)[1] = (uint64_t)(tp)->tv_nsec; \ } +/* Decode ZFS stored time values to a struct timespec */ #define ZFS_TIME_DECODE(tp, stmp) \ { \ (tp)->tv_sec = (time_t)(stmp)[0]; \ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h Fri Jul 5 03:06:36 2013 (r252752) @@ -242,6 +242,12 @@ typedef struct { * information needed for replaying the create. If the * file doesn't have any actual ACEs then the lr_aclcnt * would be zero. + * + * After lr_acl_flags, there are a lr_acl_bytes number of variable sized ace's. + * If create is also setting xvattr's, then acl data follows xvattr. + * If ACE FUIDs are needed then they will follow the xvattr_t. Following + * the FUIDs will be the domain table information. The FUIDs for the owner + * and group will be in lr_create. Name follows ACL data. */ typedef struct { lr_create_t lr_create; /* common create portion */ @@ -250,13 +256,6 @@ typedef struct { uint64_t lr_fuidcnt; /* number of real fuids */ uint64_t lr_acl_bytes; /* number of bytes in ACL */ uint64_t lr_acl_flags; /* ACL flags */ - /* lr_acl_bytes number of variable sized ace's follows */ - /* if create is also setting xvattr's, then acl data follows xvattr */ - /* if ACE FUIDs are needed then they will follow the xvattr_t */ - /* Following the FUIDs will be the domain table information. */ - /* The FUIDs for the owner and group will be in the lr_create */ - /* portion of the record. */ - /* name follows ACL data */ } lr_acl_create_t; typedef struct { 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 Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h Fri Jul 5 03:06:36 2013 (r252752) @@ -36,11 +36,10 @@ extern "C" { #endif -/* - * Common signature for all zio compress/decompress functions. - */ +/* Common signature for all zio compress functions. */ typedef size_t zio_compress_func_t(void *src, void *dst, size_t s_len, size_t d_len, int); +/* Common signature for all zio decompress functions. */ typedef int zio_decompress_func_t(void *src, void *dst, size_t s_len, size_t d_len, int); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:06:36 2013 (r252752) @@ -501,8 +501,8 @@ txg_quiesce_thread(void *arg) /* * Delay this thread by 'ticks' if we are still in the open transaction - * group and there is already a waiting txg quiesing or quiesced. Abort - * the delay if this txg stalls or enters the quiesing state. + * group and there is already a waiting txg quiescing or quiesced. + * Abort the delay if this txg stalls or enters the quiescing state. */ void txg_delay(dsl_pool_t *dp, uint64_t txg, int ticks) @@ -510,7 +510,7 @@ txg_delay(dsl_pool_t *dp, uint64_t txg, tx_state_t *tx = &dp->dp_tx; clock_t timeout = ddi_get_lbolt() + ticks; - /* don't delay if this txg could transition to quiesing immediately */ + /* don't delay if this txg could transition to quiescing immediately */ if (tx->tx_open_txg > txg || tx->tx_syncing_txg == txg-1 || tx->tx_synced_txg == txg-1) return; 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 Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c Fri Jul 5 03:06:36 2013 (r252752) @@ -963,9 +963,11 @@ vdev_probe_done(zio_t *zio) } /* - * Determine whether this device is accessible by reading and writing - * to several known locations: the pad regions of each vdev label - * but the first (which we leave alone in case it contains a VTOC). + * Determine whether this device is accessible. + * + * Read and write to several known locations: the pad regions of each + * vdev label but the first, which we leave alone in case it contains + * a VTOC. */ zio_t * vdev_probe(vdev_t *vd, zio_t *zio) @@ -2191,10 +2193,12 @@ vdev_degrade(spa_t *spa, uint64_t guid, } /* - * Online the given vdev. If 'unspare' is set, it implies two things. First, - * any attached spare device should be detached when the device finishes - * resilvering. Second, the online should be treated like a 'test' online case, - * so no FMA events are generated if the device fails to open. + * Online the given vdev. + * + * If 'ZFS_ONLINE_UNSPARE' is set, it implies two things. First, any attached + * spare device should be detached when the device finishes resilvering. + * Second, the online should be treated like a 'test' online case, so no FMA + * events are generated if the device fails to open. */ int vdev_online(spa_t *spa, uint64_t guid, uint64_t flags, vdev_state_t *newstate) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c Fri Jul 5 03:06:36 2013 (r252752) @@ -35,13 +35,14 @@ /* * These tunables are for performance analysis. */ + +/* The maximum number of I/Os concurrently pending to each device. */ +int zfs_vdev_max_pending = 10; + /* - * zfs_vdev_max_pending is the maximum number of i/os concurrently - * pending to each device. zfs_vdev_min_pending is the initial number - * of i/os pending to each device (before it starts ramping up to - * max_pending). + * The initial number of I/Os pending to each device, before it starts ramping + * up to zfs_vdev_max_pending. */ -int zfs_vdev_max_pending = 10; int zfs_vdev_min_pending = 4; /* 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 Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c Fri Jul 5 03:06:36 2013 (r252752) @@ -60,6 +60,7 @@ * o addition (+) is represented by a bitwise XOR * o subtraction (-) is therefore identical to addition: A + B = A - B * o multiplication of A by 2 is defined by the following bitwise expression: + * * (A * 2)_7 = A_6 * (A * 2)_6 = A_5 * (A * 2)_5 = A_4 @@ -118,7 +119,7 @@ typedef struct raidz_map { uint64_t rm_missingparity; /* Count of missing parity devices */ uint64_t rm_firstdatacol; /* First data column/parity count */ uint64_t rm_nskip; /* Skipped sectors for padding */ - uint64_t rm_skipstart; /* Column index of padding start */ + uint64_t rm_skipstart; /* Column index of padding start */ void *rm_datacopy; /* rm_asize-buffer of copied data */ uintptr_t rm_reports; /* # of referencing checksum reports */ uint8_t rm_freed; /* map no longer has referencing ZIO */ @@ -158,10 +159,7 @@ typedef struct raidz_map { */ int vdev_raidz_default_to_general; -/* - * These two tables represent powers and logs of 2 in the Galois field defined - * above. These values were computed by repeatedly multiplying by 2 as above. - */ +/* Powers of 2 in the Galois field defined above. */ static const uint8_t vdev_raidz_pow2[256] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1d, 0x3a, 0x74, 0xe8, 0xcd, 0x87, 0x13, 0x26, @@ -196,6 +194,7 @@ static const uint8_t vdev_raidz_pow2[256 0x2c, 0x58, 0xb0, 0x7d, 0xfa, 0xe9, 0xcf, 0x83, 0x1b, 0x36, 0x6c, 0xd8, 0xad, 0x47, 0x8e, 0x01 }; +/* Logs of 2 in the Galois field defined above. */ static const uint8_t vdev_raidz_log2[256] = { 0x00, 0x00, 0x01, 0x19, 0x02, 0x32, 0x1a, 0xc6, 0x03, 0xdf, 0x33, 0xee, 0x1b, 0x68, 0xc7, 0x4b, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Fri Jul 5 03:06:36 2013 (r252752) @@ -1359,7 +1359,8 @@ zfs_acl_chmod(vtype_t vtype, uint64_t mo zacep = (void *)((uintptr_t)zacep + abstract_size); new_count++; new_bytes += abstract_size; - } if (masks.deny1) { + } + if (masks.deny1) { zfs_set_ace(aclp, zacep, masks.deny1, DENY, -1, ACE_OWNER); zacep = (void *)((uintptr_t)zacep + abstract_size); new_count++; @@ -1767,7 +1768,7 @@ zfs_acl_ids_overquota(zfsvfs_t *zfsvfs, } /* - * Retrieve a files ACL + * Retrieve a file's ACL */ int zfs_getacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr) @@ -1922,7 +1923,7 @@ zfs_vsec_2_aclp(zfsvfs_t *zfsvfs, vtype_ } /* - * Set a files ACL + * Set a file's ACL */ int zfs_setacl(znode_t *zp, vsecattr_t *vsecp, boolean_t skipaclchk, cred_t *cr) @@ -2355,6 +2356,7 @@ slow: /* * Determine whether Access should be granted/denied. + * * The least priv subsytem is always consulted as a basic privilege * can define any form of access. */ @@ -2560,7 +2562,6 @@ zfs_delete_final_check(znode_t *zp, znod * Determine whether Access should be granted/deny, without * consulting least priv subsystem. * - * * The following chart is the recommended NFSv4 enforcement for * ability to delete an object. * Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Fri Jul 5 03:06:36 2013 (r252752) @@ -1234,6 +1234,7 @@ zfsctl_shares_readdir(ap) /* * pvp is the '.zfs' directory (zfsctl_node_t). + * * Creates vp, which is '.zfs/snapshot' (zfsctl_snapdir_t). * * This function is the callback to create a GFS vnode for '.zfs/snapshot' Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:06:36 2013 (r252752) @@ -335,9 +335,7 @@ zfs_is_bootfs(const char *name) } /* - * zfs_earlier_version - * - * Return non-zero if the spa version is less than requested version. + * Return non-zero if the spa version is less than requested version. */ static int zfs_earlier_version(const char *name, int version) @@ -355,8 +353,6 @@ zfs_earlier_version(const char *name, in } /* - * zpl_earlier_version - * * Return TRUE if the ZPL version is less than requested version. */ static boolean_t @@ -3000,10 +2996,10 @@ zfs_create_cb(objset_t *os, void *arg, c /* * inputs: - * createprops list of properties requested by creator - * default_zplver zpl version to use if unspecified in createprops - * fuids_ok fuids allowed in this version of the spa? * os parent objset pointer (NULL if root fs) + * fuids_ok fuids allowed in this version of the spa? + * sa_ok SAs allowed in this version of the spa? + * createprops list of properties requested by creator * * outputs: * zplprops values for the zplprops we attach to the master node object Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c Fri Jul 5 03:06:36 2013 (r252752) @@ -216,9 +216,8 @@ zfs_log_fuid_domains(zfs_fuid_info_t *fu } /* - * zfs_log_create() is used to handle TX_CREATE, TX_CREATE_ATTR, TX_MKDIR, - * TX_MKDIR_ATTR and TX_MKXATTR - * transactions. + * Handles TX_CREATE, TX_CREATE_ATTR, TX_MKDIR, TX_MKDIR_ATTR and + * TK_MKXATTR transactions. * * TX_CREATE and TX_MKDIR are standard creates, but they may have FUID * domain information appended prior to the name. In this case the @@ -345,7 +344,7 @@ zfs_log_create(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_remove() handles both TX_REMOVE and TX_RMDIR transactions. + * Handles both TX_REMOVE and TX_RMDIR transactions. */ void zfs_log_remove(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -369,7 +368,7 @@ zfs_log_remove(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_link() handles TX_LINK transactions. + * Handles TX_LINK transactions. */ void zfs_log_link(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -392,7 +391,7 @@ zfs_log_link(zilog_t *zilog, dmu_tx_t *t } /* - * zfs_log_symlink() handles TX_SYMLINK transactions. + * Handles TX_SYMLINK transactions. */ void zfs_log_symlink(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -424,7 +423,7 @@ zfs_log_symlink(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_rename() handles TX_RENAME transactions. + * Handles TX_RENAME transactions. */ void zfs_log_rename(zilog_t *zilog, dmu_tx_t *tx, uint64_t txtype, @@ -450,7 +449,7 @@ zfs_log_rename(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_write() handles TX_WRITE transactions. + * Handles TX_WRITE transactions. */ ssize_t zfs_immediate_write_sz = 32768; @@ -529,7 +528,7 @@ zfs_log_write(zilog_t *zilog, dmu_tx_t * } /* - * zfs_log_truncate() handles TX_TRUNCATE transactions. + * Handles TX_TRUNCATE transactions. */ void zfs_log_truncate(zilog_t *zilog, dmu_tx_t *tx, int txtype, @@ -552,7 +551,7 @@ zfs_log_truncate(zilog_t *zilog, dmu_tx_ } /* - * zfs_log_setattr() handles TX_SETATTR transactions. + * Handles TX_SETATTR transactions. */ void zfs_log_setattr(zilog_t *zilog, dmu_tx_t *tx, int txtype, @@ -614,7 +613,7 @@ zfs_log_setattr(zilog_t *zilog, dmu_tx_t } /* - * zfs_log_acl() handles TX_ACL transactions. + * Handles TX_ACL transactions. */ void zfs_log_acl(zilog_t *zilog, dmu_tx_t *tx, znode_t *zp, Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c Fri Jul 5 03:06:36 2013 (r252752) @@ -28,7 +28,7 @@ /* * This file contains the code to implement file range locking in - * ZFS, although there isn't much specific to ZFS (all that comes to mind + * ZFS, although there isn't much specific to ZFS (all that comes to mind is * support for growing the blocksize). * * Interface Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c Fri Jul 5 03:06:36 2013 (r252752) @@ -187,7 +187,7 @@ zfs_sa_set_scanstamp(znode_t *zp, xvattr /* * I'm not convinced we should do any of this upgrade. * since the SA code can read both old/new znode formats - * with probably little to know performance difference. + * with probably little to no performance difference. * * All new files will be created with the new format. */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jul 5 03:05:59 2013 (r252751) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Fri Jul 5 03:06:36 2013 (r252752) @@ -1340,13 +1340,12 @@ zfs_parse_bootfs(char *bpath, char *outp } /* - * zfs_check_global_label: *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 03:38:07 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2C7F29D4; Fri, 5 Jul 2013 03:38:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0E8441E40; Fri, 5 Jul 2013 03:38:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653c68g065007; Fri, 5 Jul 2013 03:38:06 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653c6Pt065004; Fri, 5 Jul 2013 03:38:06 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050338.r653c6Pt065004@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:38: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: r252754 - 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.14 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, 05 Jul 2013 03:38:07 -0000 Author: delphij Date: Fri Jul 5 03:38:06 2013 New Revision: 252754 URL: http://svnweb.freebsd.org/changeset/base/252754 Log: MFC r251632: illumos #3743 zfs needs a refcount audit Audit zap cursor usage and correct missing calls to zap_cursor_fini(). sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c: Correct early exit handling of several functions that previously failed to close a cursor prior to returning. Submitted by: gibbs Audit holders of dmu_bufs and correct missing calls to dmu_buf_rele(). sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c: Correct early exit handling of several functions that previously failed to release a dmu_buf prior to returning. Submitted by: will Reviewed by: Matthew Ahrens , Eric Schrock , George Wilson , Christopher Siden Sponsored by: Spectra Logic Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.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 Fri Jul 5 03:12:29 2013 (r252753) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Jul 5 03:38:06 2013 (r252754) @@ -361,8 +361,10 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin /* Make sure dsobj has the correct object type. */ dmu_object_info_from_db(dbuf, &doi); - if (doi.doi_type != DMU_OT_DSL_DATASET) + if (doi.doi_type != DMU_OT_DSL_DATASET) { + dmu_buf_rele(dbuf, tag); return (SET_ERROR(EINVAL)); + } ds = dmu_buf_get_user(dbuf); if (ds == NULL) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c Fri Jul 5 03:12:29 2013 (r252753) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c Fri Jul 5 03:38:06 2013 (r252754) @@ -183,8 +183,10 @@ process_error_log(spa_t *spa, uint64_t o if (copyout(&zb, (char *)addr + (*count - 1) * sizeof (zbookmark_t), - sizeof (zbookmark_t)) != 0) + sizeof (zbookmark_t)) != 0) { + zap_cursor_fini(&zc); return (SET_ERROR(EFAULT)); + } *count -= 1; } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Fri Jul 5 03:12:29 2013 (r252753) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Fri Jul 5 03:38:06 2013 (r252754) @@ -295,7 +295,8 @@ zap_table_load(zap_t *zap, zap_table_phy err = dmu_buf_hold(zap->zap_objset, zap->zap_object, (tbl->zt_nextblk + blk) << bs, FTAG, &db, DMU_READ_NO_PREFETCH); - dmu_buf_rele(db, FTAG); + if (err == 0) + dmu_buf_rele(db, FTAG); } return (err); } @@ -992,18 +993,21 @@ zap_join(objset_t *os, uint64_t fromobj, zap_attribute_t za; int err; + err = 0; for (zap_cursor_init(&zc, os, fromobj); zap_cursor_retrieve(&zc, &za) == 0; (void) zap_cursor_advance(&zc)) { - if (za.za_integer_length != 8 || za.za_num_integers != 1) - return (SET_ERROR(EINVAL)); + if (za.za_integer_length != 8 || za.za_num_integers != 1) { + err = SET_ERROR(EINVAL); + break; + } err = zap_add(os, intoobj, za.za_name, 8, 1, &za.za_first_integer, tx); if (err) - return (err); + break; } zap_cursor_fini(&zc); - return (0); + return (err); } int @@ -1014,18 +1018,21 @@ zap_join_key(objset_t *os, uint64_t from zap_attribute_t za; int err; + err = 0; for (zap_cursor_init(&zc, os, fromobj); zap_cursor_retrieve(&zc, &za) == 0; (void) zap_cursor_advance(&zc)) { - if (za.za_integer_length != 8 || za.za_num_integers != 1) - return (SET_ERROR(EINVAL)); + if (za.za_integer_length != 8 || za.za_num_integers != 1) { + err = SET_ERROR(EINVAL); + break; + } err = zap_add(os, intoobj, za.za_name, 8, 1, &value, tx); if (err) - return (err); + break; } zap_cursor_fini(&zc); - return (0); + return (err); } int @@ -1036,24 +1043,27 @@ zap_join_increment(objset_t *os, uint64_ zap_attribute_t za; int err; + err = 0; for (zap_cursor_init(&zc, os, fromobj); zap_cursor_retrieve(&zc, &za) == 0; (void) zap_cursor_advance(&zc)) { uint64_t delta = 0; - if (za.za_integer_length != 8 || za.za_num_integers != 1) - return (SET_ERROR(EINVAL)); + if (za.za_integer_length != 8 || za.za_num_integers != 1) { + err = SET_ERROR(EINVAL); + break; + } err = zap_lookup(os, intoobj, za.za_name, 8, 1, &delta); if (err != 0 && err != ENOENT) - return (err); + break; delta += za.za_first_integer; err = zap_update(os, intoobj, za.za_name, 8, 1, &delta, tx); if (err) - return (err); + break; } zap_cursor_fini(&zc); - return (0); + return (err); } int From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 03:38:55 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 10E29B02; Fri, 5 Jul 2013 03:38:55 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E6EE71E49; Fri, 5 Jul 2013 03:38:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653cstB065126; Fri, 5 Jul 2013 03:38:54 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653csJ2065123; Fri, 5 Jul 2013 03:38:54 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050338.r653csJ2065123@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:38:54 +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: r252755 - 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.14 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, 05 Jul 2013 03:38:55 -0000 Author: delphij Date: Fri Jul 5 03:38:53 2013 New Revision: 252755 URL: http://svnweb.freebsd.org/changeset/base/252755 Log: MFC r251632: illumos #3743 zfs needs a refcount audit Audit zap cursor usage and correct missing calls to zap_cursor_fini(). sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c: Correct early exit handling of several functions that previously failed to close a cursor prior to returning. Submitted by: gibbs Audit holders of dmu_bufs and correct missing calls to dmu_buf_rele(). sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c: Correct early exit handling of several functions that previously failed to release a dmu_buf prior to returning. Submitted by: will Reviewed by: Matthew Ahrens , Eric Schrock , George Wilson , Christopher Siden Sponsored by: Spectra Logic Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.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 Fri Jul 5 03:38:06 2013 (r252754) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c Fri Jul 5 03:38:53 2013 (r252755) @@ -361,8 +361,10 @@ dsl_dataset_hold_obj(dsl_pool_t *dp, uin /* Make sure dsobj has the correct object type. */ dmu_object_info_from_db(dbuf, &doi); - if (doi.doi_type != DMU_OT_DSL_DATASET) + if (doi.doi_type != DMU_OT_DSL_DATASET) { + dmu_buf_rele(dbuf, tag); return (SET_ERROR(EINVAL)); + } ds = dmu_buf_get_user(dbuf); if (ds == NULL) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c Fri Jul 5 03:38:06 2013 (r252754) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c Fri Jul 5 03:38:53 2013 (r252755) @@ -183,8 +183,10 @@ process_error_log(spa_t *spa, uint64_t o if (copyout(&zb, (char *)addr + (*count - 1) * sizeof (zbookmark_t), - sizeof (zbookmark_t)) != 0) + sizeof (zbookmark_t)) != 0) { + zap_cursor_fini(&zc); return (SET_ERROR(EFAULT)); + } *count -= 1; } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Fri Jul 5 03:38:06 2013 (r252754) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c Fri Jul 5 03:38:53 2013 (r252755) @@ -295,7 +295,8 @@ zap_table_load(zap_t *zap, zap_table_phy err = dmu_buf_hold(zap->zap_objset, zap->zap_object, (tbl->zt_nextblk + blk) << bs, FTAG, &db, DMU_READ_NO_PREFETCH); - dmu_buf_rele(db, FTAG); + if (err == 0) + dmu_buf_rele(db, FTAG); } return (err); } @@ -992,18 +993,21 @@ zap_join(objset_t *os, uint64_t fromobj, zap_attribute_t za; int err; + err = 0; for (zap_cursor_init(&zc, os, fromobj); zap_cursor_retrieve(&zc, &za) == 0; (void) zap_cursor_advance(&zc)) { - if (za.za_integer_length != 8 || za.za_num_integers != 1) - return (SET_ERROR(EINVAL)); + if (za.za_integer_length != 8 || za.za_num_integers != 1) { + err = SET_ERROR(EINVAL); + break; + } err = zap_add(os, intoobj, za.za_name, 8, 1, &za.za_first_integer, tx); if (err) - return (err); + break; } zap_cursor_fini(&zc); - return (0); + return (err); } int @@ -1014,18 +1018,21 @@ zap_join_key(objset_t *os, uint64_t from zap_attribute_t za; int err; + err = 0; for (zap_cursor_init(&zc, os, fromobj); zap_cursor_retrieve(&zc, &za) == 0; (void) zap_cursor_advance(&zc)) { - if (za.za_integer_length != 8 || za.za_num_integers != 1) - return (SET_ERROR(EINVAL)); + if (za.za_integer_length != 8 || za.za_num_integers != 1) { + err = SET_ERROR(EINVAL); + break; + } err = zap_add(os, intoobj, za.za_name, 8, 1, &value, tx); if (err) - return (err); + break; } zap_cursor_fini(&zc); - return (0); + return (err); } int @@ -1036,24 +1043,27 @@ zap_join_increment(objset_t *os, uint64_ zap_attribute_t za; int err; + err = 0; for (zap_cursor_init(&zc, os, fromobj); zap_cursor_retrieve(&zc, &za) == 0; (void) zap_cursor_advance(&zc)) { uint64_t delta = 0; - if (za.za_integer_length != 8 || za.za_num_integers != 1) - return (SET_ERROR(EINVAL)); + if (za.za_integer_length != 8 || za.za_num_integers != 1) { + err = SET_ERROR(EINVAL); + break; + } err = zap_lookup(os, intoobj, za.za_name, 8, 1, &delta); if (err != 0 && err != ENOENT) - return (err); + break; delta += za.za_first_integer; err = zap_update(os, intoobj, za.za_name, 8, 1, &delta, tx); if (err) - return (err); + break; } zap_cursor_fini(&zc); - return (0); + return (err); } int From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 03:44:09 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 50FB8C66; Fri, 5 Jul 2013 03:44:09 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 336321E6E; Fri, 5 Jul 2013 03:44:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653i9bB067428; Fri, 5 Jul 2013 03:44:09 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653i891067425; Fri, 5 Jul 2013 03:44:08 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050344.r653i891067425@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:44:08 +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: r252756 - 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.14 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, 05 Jul 2013 03:44:09 -0000 Author: delphij Date: Fri Jul 5 03:44:08 2013 New Revision: 252756 URL: http://svnweb.freebsd.org/changeset/base/252756 Log: MFC r251633: illumos #3744 zfs shouldn't ignore errors unmounting snapshots Propagate errors from zfs_unmount_snap() up to its callers wherever feasible. Submitted by: will Reviewed by: Matthew Ahrens , Christopher Siden Sponsored by: Spectra Logic Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.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 Fri Jul 5 03:38:53 2013 (r252755) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Fri Jul 5 03:44:08 2013 (r252756) @@ -433,7 +433,7 @@ dsl_dataset_user_release_tmp(dsl_pool_t dsl_dataset_name(ds, name); dsl_dataset_rele(ds, FTAG); dsl_pool_config_exit(dp, FTAG); - zfs_unmount_snap(name); + (void) zfs_unmount_snap(name); } else { dsl_pool_config_exit(dp, FTAG); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Fri Jul 5 03:38:53 2013 (r252755) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Fri Jul 5 03:44:08 2013 (r252756) @@ -360,7 +360,7 @@ extern int zfs_secpolicy_rename_perms(co const char *to, cred_t *cr); extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr); extern int zfs_busy(void); -extern void zfs_unmount_snap(const char *); +extern int zfs_unmount_snap(const char *); extern void zfs_destroy_unmount_origin(const char *); /* Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:38:53 2013 (r252755) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:44:08 2013 (r252756) @@ -3405,28 +3405,31 @@ zfs_ioc_log_history(const char *unused, * * This function is best-effort. Callers must deal gracefully if it * remains mounted (or is remounted after this call). + * + * Returns 0 if the argument is not a snapshot, or it is not currently a + * filesystem, or we were able to unmount it. Returns error code otherwise. */ -void +int zfs_unmount_snap(const char *snapname) { vfs_t *vfsp; zfsvfs_t *zfsvfs; + int err; if (strchr(snapname, '@') == NULL) - return; + return (0); vfsp = zfs_get_vfs(snapname); if (vfsp == NULL) - return; + return (0); zfsvfs = vfsp->vfs_data; ASSERT(!dsl_pool_config_held(dmu_objset_pool(zfsvfs->z_os))); - if (vn_vfswlock(vfsp->vfs_vnodecovered) != 0) { - VFS_RELE(vfsp); - return; - } + err = vn_vfswlock(vfsp->vfs_vnodecovered); VFS_RELE(vfsp); + if (err != 0) + return (SET_ERROR(err)); /* * Always force the unmount for snapshots. @@ -3436,17 +3439,17 @@ zfs_unmount_snap(const char *snapname) (void) dounmount(vfsp, MS_FORCE, kcred); #else mtx_lock(&Giant); /* dounmount() */ - dounmount(vfsp, MS_FORCE, curthread); + (void) dounmount(vfsp, MS_FORCE, curthread); mtx_unlock(&Giant); /* dounmount() */ #endif + return (0); } /* ARGSUSED */ static int zfs_unmount_snap_cb(const char *snapname, void *arg) { - zfs_unmount_snap(snapname); - return (0); + return (zfs_unmount_snap(snapname)); } /* @@ -3469,7 +3472,7 @@ zfs_destroy_unmount_origin(const char *f char originname[MAXNAMELEN]; dsl_dataset_name(ds->ds_prev, originname); dmu_objset_rele(os, FTAG); - zfs_unmount_snap(originname); + (void) zfs_unmount_snap(originname); } else { dmu_objset_rele(os, FTAG); } @@ -3487,7 +3490,7 @@ zfs_destroy_unmount_origin(const char *f static int zfs_ioc_destroy_snaps(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl) { - int poollen; + int error, poollen; nvlist_t *snaps; nvpair_t *pair; boolean_t defer; @@ -3508,7 +3511,9 @@ zfs_ioc_destroy_snaps(const char *poolna (name[poollen] != '/' && name[poollen] != '@')) return (SET_ERROR(EXDEV)); - zfs_unmount_snap(name); + error = zfs_unmount_snap(name); + if (error != 0) + return (error); (void) zvol_remove_minor(name); } @@ -3527,8 +3532,12 @@ static int zfs_ioc_destroy(zfs_cmd_t *zc) { int err; - if (strchr(zc->zc_name, '@') && zc->zc_objset_type == DMU_OST_ZFS) - zfs_unmount_snap(zc->zc_name); + + if (zc->zc_objset_type == DMU_OST_ZFS) { + err = zfs_unmount_snap(zc->zc_name); + if (err != 0) + return (err); + } if (strchr(zc->zc_name, '@')) err = dsl_destroy_snapshot(zc->zc_name, zc->zc_defer_destroy); @@ -3574,8 +3583,7 @@ recursive_unmount(const char *fsname, vo char fullname[MAXNAMELEN]; (void) snprintf(fullname, sizeof (fullname), "%s@%s", fsname, snapname); - zfs_unmount_snap(fullname); - return (0); + return (zfs_unmount_snap(fullname)); } /* @@ -5071,14 +5079,18 @@ static int zfs_ioc_release(const char *pool, nvlist_t *holds, nvlist_t *errlist) { nvpair_t *pair; + int err; /* * The release may cause the snapshot to be destroyed; make sure it * is not mounted. */ for (pair = nvlist_next_nvpair(holds, NULL); pair != NULL; - pair = nvlist_next_nvpair(holds, pair)) - zfs_unmount_snap(nvpair_name(pair)); + pair = nvlist_next_nvpair(holds, pair)) { + err = zfs_unmount_snap(nvpair_name(pair)); + if (err != 0) + return (err); + } return (dsl_dataset_user_release(holds, errlist)); } From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 03:44:50 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A2D82D99; Fri, 5 Jul 2013 03:44:50 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 859AA1E78; Fri, 5 Jul 2013 03:44:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653ioa8067536; Fri, 5 Jul 2013 03:44:50 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653in9E067531; Fri, 5 Jul 2013 03:44:49 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050344.r653in9E067531@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:44: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: r252757 - 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.14 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, 05 Jul 2013 03:44:50 -0000 Author: delphij Date: Fri Jul 5 03:44:49 2013 New Revision: 252757 URL: http://svnweb.freebsd.org/changeset/base/252757 Log: MFC r251633: illumos #3744 zfs shouldn't ignore errors unmounting snapshots Propagate errors from zfs_unmount_snap() up to its callers wherever feasible. Submitted by: will Reviewed by: Matthew Ahrens , Christopher Siden Sponsored by: Spectra Logic Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.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 Fri Jul 5 03:44:08 2013 (r252756) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Fri Jul 5 03:44:49 2013 (r252757) @@ -433,7 +433,7 @@ dsl_dataset_user_release_tmp(dsl_pool_t dsl_dataset_name(ds, name); dsl_dataset_rele(ds, FTAG); dsl_pool_config_exit(dp, FTAG); - zfs_unmount_snap(name); + (void) zfs_unmount_snap(name); } else { dsl_pool_config_exit(dp, FTAG); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Fri Jul 5 03:44:08 2013 (r252756) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Fri Jul 5 03:44:49 2013 (r252757) @@ -360,7 +360,7 @@ extern int zfs_secpolicy_rename_perms(co const char *to, cred_t *cr); extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr); extern int zfs_busy(void); -extern void zfs_unmount_snap(const char *); +extern int zfs_unmount_snap(const char *); extern void zfs_destroy_unmount_origin(const char *); /* Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:44:08 2013 (r252756) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jul 5 03:44:49 2013 (r252757) @@ -3405,28 +3405,31 @@ zfs_ioc_log_history(const char *unused, * * This function is best-effort. Callers must deal gracefully if it * remains mounted (or is remounted after this call). + * + * Returns 0 if the argument is not a snapshot, or it is not currently a + * filesystem, or we were able to unmount it. Returns error code otherwise. */ -void +int zfs_unmount_snap(const char *snapname) { vfs_t *vfsp; zfsvfs_t *zfsvfs; + int err; if (strchr(snapname, '@') == NULL) - return; + return (0); vfsp = zfs_get_vfs(snapname); if (vfsp == NULL) - return; + return (0); zfsvfs = vfsp->vfs_data; ASSERT(!dsl_pool_config_held(dmu_objset_pool(zfsvfs->z_os))); - if (vn_vfswlock(vfsp->vfs_vnodecovered) != 0) { - VFS_RELE(vfsp); - return; - } + err = vn_vfswlock(vfsp->vfs_vnodecovered); VFS_RELE(vfsp); + if (err != 0) + return (SET_ERROR(err)); /* * Always force the unmount for snapshots. @@ -3436,17 +3439,17 @@ zfs_unmount_snap(const char *snapname) (void) dounmount(vfsp, MS_FORCE, kcred); #else mtx_lock(&Giant); /* dounmount() */ - dounmount(vfsp, MS_FORCE, curthread); + (void) dounmount(vfsp, MS_FORCE, curthread); mtx_unlock(&Giant); /* dounmount() */ #endif + return (0); } /* ARGSUSED */ static int zfs_unmount_snap_cb(const char *snapname, void *arg) { - zfs_unmount_snap(snapname); - return (0); + return (zfs_unmount_snap(snapname)); } /* @@ -3469,7 +3472,7 @@ zfs_destroy_unmount_origin(const char *f char originname[MAXNAMELEN]; dsl_dataset_name(ds->ds_prev, originname); dmu_objset_rele(os, FTAG); - zfs_unmount_snap(originname); + (void) zfs_unmount_snap(originname); } else { dmu_objset_rele(os, FTAG); } @@ -3487,7 +3490,7 @@ zfs_destroy_unmount_origin(const char *f static int zfs_ioc_destroy_snaps(const char *poolname, nvlist_t *innvl, nvlist_t *outnvl) { - int poollen; + int error, poollen; nvlist_t *snaps; nvpair_t *pair; boolean_t defer; @@ -3508,7 +3511,9 @@ zfs_ioc_destroy_snaps(const char *poolna (name[poollen] != '/' && name[poollen] != '@')) return (SET_ERROR(EXDEV)); - zfs_unmount_snap(name); + error = zfs_unmount_snap(name); + if (error != 0) + return (error); (void) zvol_remove_minor(name); } @@ -3527,8 +3532,12 @@ static int zfs_ioc_destroy(zfs_cmd_t *zc) { int err; - if (strchr(zc->zc_name, '@') && zc->zc_objset_type == DMU_OST_ZFS) - zfs_unmount_snap(zc->zc_name); + + if (zc->zc_objset_type == DMU_OST_ZFS) { + err = zfs_unmount_snap(zc->zc_name); + if (err != 0) + return (err); + } if (strchr(zc->zc_name, '@')) err = dsl_destroy_snapshot(zc->zc_name, zc->zc_defer_destroy); @@ -3574,8 +3583,7 @@ recursive_unmount(const char *fsname, vo char fullname[MAXNAMELEN]; (void) snprintf(fullname, sizeof (fullname), "%s@%s", fsname, snapname); - zfs_unmount_snap(fullname); - return (0); + return (zfs_unmount_snap(fullname)); } /* @@ -5071,14 +5079,18 @@ static int zfs_ioc_release(const char *pool, nvlist_t *holds, nvlist_t *errlist) { nvpair_t *pair; + int err; /* * The release may cause the snapshot to be destroyed; make sure it * is not mounted. */ for (pair = nvlist_next_nvpair(holds, NULL); pair != NULL; - pair = nvlist_next_nvpair(holds, pair)) - zfs_unmount_snap(nvpair_name(pair)); + pair = nvlist_next_nvpair(holds, pair)) { + err = zfs_unmount_snap(nvpair_name(pair)); + if (err != 0) + return (err); + } return (dsl_dataset_user_release(holds, errlist)); } From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 03:49:53 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 35411EEF; Fri, 5 Jul 2013 03:49:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1656A1E95; Fri, 5 Jul 2013 03:49:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653nqDm068170; Fri, 5 Jul 2013 03:49:52 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653nqW9068168; Fri, 5 Jul 2013 03:49:52 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050349.r653nqW9068168@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:49: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: r252758 - in stable/9/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/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.14 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, 05 Jul 2013 03:49:53 -0000 Author: delphij Date: Fri Jul 5 03:49:52 2013 New Revision: 252758 URL: http://svnweb.freebsd.org/changeset/base/252758 Log: MFC r251634: illumos #3745 zpool create should treat -O mountpoint and -m the same cddl/contrib/opensolaris/cmd/zpool/zpool_main.c: (change 644608) This allows specifying a mountpoint using the latter form and having its value checked and used as it would be using the former form. As a consequence of this change: 1. The mountpoint property is set in the fsprops nvlist prior to creating the pool, rather than being set after creating the pool. To me, this is the proper approach, since it avoids creating the pool if the mountpoint setting would cause the command to fail. 2. The mountpoint property, unlike all others, can be specified more than once. Only the last setting takes effect. This is to avoid breaking potential existing users that specify -m more than once. Submitted by: will cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fix "zpool create -R -m ". Ever since change 644608, this has been broken. The problem is that some old code in libzfs_pool.c would force a pool's mountpoint to "/" when creating a pool with an altroot. That probably implemented some old policy decision regarding altroots, but it conflicts with the current manpage. It also had no effect until 644608, because the zpool command would _always_ change the pool's mountpoint after creating it. The solution is to delete the old code from libzfs_pool.c. Submitted by: asomers Reviewed by: Matthew Ahrens , Christopher Siden Sponsored by: Spectra Logic Modified: stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c 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 Fri Jul 5 03:44:49 2013 (r252757) +++ stable/9/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Jul 5 03:49:52 2013 (r252758) @@ -804,6 +804,7 @@ zpool_do_create(int argc, char **argv) goto errout; break; case 'm': + /* Equivalent to -O mountpoint=optarg */ mountpoint = optarg; break; case 'o': @@ -842,8 +843,18 @@ zpool_do_create(int argc, char **argv) *propval = '\0'; propval++; - if (add_prop_list(optarg, propval, &fsprops, B_FALSE)) + /* + * Mountpoints are checked and then added later. + * Uniquely among properties, they can be specified + * more than once, to avoid conflict with -m. + */ + if (0 == strcmp(optarg, + zfs_prop_to_name(ZFS_PROP_MOUNTPOINT))) { + mountpoint = propval; + } else if (add_prop_list(optarg, propval, &fsprops, + B_FALSE)) { goto errout; + } break; case ':': (void) fprintf(stderr, gettext("missing argument for " @@ -960,6 +971,18 @@ zpool_do_create(int argc, char **argv) } } + /* + * Now that the mountpoint's validity has been checked, ensure that + * the property is set appropriately prior to creating the pool. + */ + if (mountpoint != NULL) { + ret = add_prop_list(zfs_prop_to_name(ZFS_PROP_MOUNTPOINT), + mountpoint, &fsprops, B_FALSE); + if (ret != 0) + goto errout; + } + + ret = 1; if (dryrun) { /* * For a dry run invocation, print out a basic message and run @@ -994,21 +1017,19 @@ zpool_do_create(int argc, char **argv) if (nvlist_exists(props, propname)) continue; - if (add_prop_list(propname, ZFS_FEATURE_ENABLED, - &props, B_TRUE) != 0) + ret = add_prop_list(propname, + ZFS_FEATURE_ENABLED, &props, B_TRUE); + if (ret != 0) goto errout; } } + + ret = 1; if (zpool_create(g_zfs, poolname, nvroot, props, fsprops) == 0) { zfs_handle_t *pool = zfs_open(g_zfs, poolname, ZFS_TYPE_FILESYSTEM); if (pool != NULL) { - if (mountpoint != NULL) - verify(zfs_prop_set(pool, - zfs_prop_to_name( - ZFS_PROP_MOUNTPOINT), - mountpoint) == 0); if (zfs_mount(pool, NULL, 0) == 0) ret = zfs_shareall(pool); zfs_close(pool); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Jul 5 03:44:49 2013 (r252757) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Jul 5 03:49:52 2013 (r252758) @@ -1112,7 +1112,6 @@ zpool_create(libzfs_handle_t *hdl, const nvlist_t *zc_fsprops = NULL; nvlist_t *zc_props = NULL; char msg[1024]; - char *altroot; int ret = -1; (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN, @@ -1211,21 +1210,6 @@ zpool_create(libzfs_handle_t *hdl, const } } - /* - * If this is an alternate root pool, then we automatically set the - * mountpoint of the root dataset to be '/'. - */ - if (nvlist_lookup_string(props, zpool_prop_to_name(ZPOOL_PROP_ALTROOT), - &altroot) == 0) { - zfs_handle_t *zhp; - - verify((zhp = zfs_open(hdl, pool, ZFS_TYPE_DATASET)) != NULL); - verify(zfs_prop_set(zhp, zfs_prop_to_name(ZFS_PROP_MOUNTPOINT), - "/") == 0); - - zfs_close(zhp); - } - create_failed: zcmd_free_nvlists(&zc); nvlist_free(zc_props); From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 03:50:12 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4BB0C7E; Fri, 5 Jul 2013 03:50:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D95D1E97; Fri, 5 Jul 2013 03:50:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653oCkw068325; Fri, 5 Jul 2013 03:50:12 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653oB7P068321; Fri, 5 Jul 2013 03:50:11 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050350.r653oB7P068321@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:50: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: r252759 - in stable/8/cddl/contrib/opensolaris: cmd/zpool lib/libzfs/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.14 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, 05 Jul 2013 03:50:12 -0000 Author: delphij Date: Fri Jul 5 03:50:11 2013 New Revision: 252759 URL: http://svnweb.freebsd.org/changeset/base/252759 Log: MFC r251634: illumos #3745 zpool create should treat -O mountpoint and -m the same cddl/contrib/opensolaris/cmd/zpool/zpool_main.c: (change 644608) This allows specifying a mountpoint using the latter form and having its value checked and used as it would be using the former form. As a consequence of this change: 1. The mountpoint property is set in the fsprops nvlist prior to creating the pool, rather than being set after creating the pool. To me, this is the proper approach, since it avoids creating the pool if the mountpoint setting would cause the command to fail. 2. The mountpoint property, unlike all others, can be specified more than once. Only the last setting takes effect. This is to avoid breaking potential existing users that specify -m more than once. Submitted by: will cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fix "zpool create -R -m ". Ever since change 644608, this has been broken. The problem is that some old code in libzfs_pool.c would force a pool's mountpoint to "/" when creating a pool with an altroot. That probably implemented some old policy decision regarding altroots, but it conflicts with the current manpage. It also had no effect until 644608, because the zpool command would _always_ change the pool's mountpoint after creating it. The solution is to delete the old code from libzfs_pool.c. Submitted by: asomers Reviewed by: Matthew Ahrens , Christopher Siden Sponsored by: Spectra Logic Modified: stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c 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 Fri Jul 5 03:49:52 2013 (r252758) +++ stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c Fri Jul 5 03:50:11 2013 (r252759) @@ -804,6 +804,7 @@ zpool_do_create(int argc, char **argv) goto errout; break; case 'm': + /* Equivalent to -O mountpoint=optarg */ mountpoint = optarg; break; case 'o': @@ -842,8 +843,18 @@ zpool_do_create(int argc, char **argv) *propval = '\0'; propval++; - if (add_prop_list(optarg, propval, &fsprops, B_FALSE)) + /* + * Mountpoints are checked and then added later. + * Uniquely among properties, they can be specified + * more than once, to avoid conflict with -m. + */ + if (0 == strcmp(optarg, + zfs_prop_to_name(ZFS_PROP_MOUNTPOINT))) { + mountpoint = propval; + } else if (add_prop_list(optarg, propval, &fsprops, + B_FALSE)) { goto errout; + } break; case ':': (void) fprintf(stderr, gettext("missing argument for " @@ -970,6 +981,18 @@ zpool_do_create(int argc, char **argv) } } + /* + * Now that the mountpoint's validity has been checked, ensure that + * the property is set appropriately prior to creating the pool. + */ + if (mountpoint != NULL) { + ret = add_prop_list(zfs_prop_to_name(ZFS_PROP_MOUNTPOINT), + mountpoint, &fsprops, B_FALSE); + if (ret != 0) + goto errout; + } + + ret = 1; if (dryrun) { /* * For a dry run invocation, print out a basic message and run @@ -1004,21 +1027,19 @@ zpool_do_create(int argc, char **argv) if (nvlist_exists(props, propname)) continue; - if (add_prop_list(propname, ZFS_FEATURE_ENABLED, - &props, B_TRUE) != 0) + ret = add_prop_list(propname, + ZFS_FEATURE_ENABLED, &props, B_TRUE); + if (ret != 0) goto errout; } } + + ret = 1; if (zpool_create(g_zfs, poolname, nvroot, props, fsprops) == 0) { zfs_handle_t *pool = zfs_open(g_zfs, poolname, ZFS_TYPE_FILESYSTEM); if (pool != NULL) { - if (mountpoint != NULL) - verify(zfs_prop_set(pool, - zfs_prop_to_name( - ZFS_PROP_MOUNTPOINT), - mountpoint) == 0); if (zfs_mount(pool, NULL, 0) == 0) ret = zfs_shareall(pool); zfs_close(pool); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Jul 5 03:49:52 2013 (r252758) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c Fri Jul 5 03:50:11 2013 (r252759) @@ -1112,7 +1112,6 @@ zpool_create(libzfs_handle_t *hdl, const nvlist_t *zc_fsprops = NULL; nvlist_t *zc_props = NULL; char msg[1024]; - char *altroot; int ret = -1; (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN, @@ -1211,21 +1210,6 @@ zpool_create(libzfs_handle_t *hdl, const } } - /* - * If this is an alternate root pool, then we automatically set the - * mountpoint of the root dataset to be '/'. - */ - if (nvlist_lookup_string(props, zpool_prop_to_name(ZPOOL_PROP_ALTROOT), - &altroot) == 0) { - zfs_handle_t *zhp; - - verify((zhp = zfs_open(hdl, pool, ZFS_TYPE_DATASET)) != NULL); - verify(zfs_prop_set(zhp, zfs_prop_to_name(ZFS_PROP_MOUNTPOINT), - "/") == 0); - - zfs_close(zhp); - } - create_failed: zcmd_free_nvlists(&zc); nvlist_free(zc_props); From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 03:54:14 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ABF891EB; Fri, 5 Jul 2013 03:54:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 83AEC1EB3; Fri, 5 Jul 2013 03:54:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653sERX070383; Fri, 5 Jul 2013 03:54:14 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653sEZx070378; Fri, 5 Jul 2013 03:54:14 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050354.r653sEZx070378@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:54:14 +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: r252760 - 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.14 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, 05 Jul 2013 03:54:14 -0000 Author: delphij Date: Fri Jul 5 03:54:13 2013 New Revision: 252760 URL: http://svnweb.freebsd.org/changeset/base/252760 Log: MFC r251635: illumos #3747 txg commit callbacks don't work sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c: Fix commit callbacks by moving them to the task's list. Previously, list_move_tail() returned without doing anything because the task list was passed as the source rather than destination. cddl/contrib/opensolaris/cmd/ztest/ztest.c: Check the commit callback threshold correctly. Submitted by: will Reviewed by: Matthew Ahrens , Christopher Siden Sponsored by: Spectra Logic Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.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 Fri Jul 5 03:50:11 2013 (r252759) +++ stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 5 03:54:13 2013 (r252760) @@ -4509,7 +4509,7 @@ ztest_dmu_commit_callbacks(ztest_ds_t *z */ tmp_cb = list_head(&zcl.zcl_callbacks); if (tmp_cb != NULL && - tmp_cb->zcd_txg > txg - ZTEST_COMMIT_CALLBACK_THRESH) { + (txg - ZTEST_COMMIT_CALLBACK_THRESH) > tmp_cb->zcd_txg) { fatal(0, "Commit callback threshold exceeded, oldest txg: %" PRIu64 ", open txg: %" PRIu64 "\n", tmp_cb->zcd_txg, txg); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:50:11 2013 (r252759) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:54:13 2013 (r252760) @@ -439,7 +439,7 @@ txg_dispatch_callbacks(dsl_pool_t *dp, u list_create(cb_list, sizeof (dmu_tx_callback_t), offsetof(dmu_tx_callback_t, dcb_node)); - list_move_tail(&tc->tc_callbacks[g], cb_list); + list_move_tail(cb_list, &tc->tc_callbacks[g]); (void) taskq_dispatch(tx->tx_commit_cb_taskq, (task_func_t *) txg_do_callbacks, cb_list, TQ_SLEEP); From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 03:55:14 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2A24631A; Fri, 5 Jul 2013 03:55:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 021561EB9; Fri, 5 Jul 2013 03:55:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r653tDGP070614; Fri, 5 Jul 2013 03:55:13 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r653tDWg070612; Fri, 5 Jul 2013 03:55:13 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050355.r653tDWg070612@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 03:55: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: r252761 - 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.14 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, 05 Jul 2013 03:55:14 -0000 Author: delphij Date: Fri Jul 5 03:55:13 2013 New Revision: 252761 URL: http://svnweb.freebsd.org/changeset/base/252761 Log: MFC r251635: illumos #3747 txg commit callbacks don't work sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c: Fix commit callbacks by moving them to the task's list. Previously, list_move_tail() returned without doing anything because the task list was passed as the source rather than destination. cddl/contrib/opensolaris/cmd/ztest/ztest.c: Check the commit callback threshold correctly. Submitted by: will Reviewed by: Matthew Ahrens , Christopher Siden Sponsored by: Spectra Logic Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.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 Fri Jul 5 03:54:13 2013 (r252760) +++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 5 03:55:13 2013 (r252761) @@ -4509,7 +4509,7 @@ ztest_dmu_commit_callbacks(ztest_ds_t *z */ tmp_cb = list_head(&zcl.zcl_callbacks); if (tmp_cb != NULL && - tmp_cb->zcd_txg > txg - ZTEST_COMMIT_CALLBACK_THRESH) { + (txg - ZTEST_COMMIT_CALLBACK_THRESH) > tmp_cb->zcd_txg) { fatal(0, "Commit callback threshold exceeded, oldest txg: %" PRIu64 ", open txg: %" PRIu64 "\n", tmp_cb->zcd_txg, txg); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:54:13 2013 (r252760) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c Fri Jul 5 03:55:13 2013 (r252761) @@ -370,7 +370,7 @@ txg_dispatch_callbacks(dsl_pool_t *dp, u list_create(cb_list, sizeof (dmu_tx_callback_t), offsetof(dmu_tx_callback_t, dcb_node)); - list_move_tail(&tc->tc_callbacks[g], cb_list); + list_move_tail(cb_list, &tc->tc_callbacks[g]); (void) taskq_dispatch(tx->tx_commit_cb_taskq, (task_func_t *) txg_do_callbacks, cb_list, TQ_SLEEP); From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 04:01:27 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2305C48A; Fri, 5 Jul 2013 04:01:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 13D921EE4; Fri, 5 Jul 2013 04:01:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6541QYT073191; Fri, 5 Jul 2013 04:01:26 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6541PLE073186; Fri, 5 Jul 2013 04:01:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050401.r6541PLE073186@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:01: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: r252762 - in stable/9/sys/cddl/contrib/opensolaris/uts/common: fs/zfs fs/zfs/sys sys/fm/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.14 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, 05 Jul 2013 04:01:27 -0000 Author: delphij Date: Fri Jul 5 04:01:25 2013 New Revision: 252762 URL: http://svnweb.freebsd.org/changeset/base/252762 Log: MFC r251636: illumos #3749 zfs event processing should work on R/O root filesystems This log is a modified version of the original one written by gibbs@, to account for changes made during the illumos RTI process. Allow ZFS asynchronous event handling to proceed even if the root file system is mounted read-only. This restriction appears to have been put in place to avoid errors with updating the configuration cache file. However: o The majority of asynchronous event handling does not involve configuration cache file updates. o The configuration cache file need not be on the root file system, so the check was not complete. o Other classes of errors (e.g. file system full) can also prevent a successful update yet do not prevent asynchronous event processing. o Configurations such as NanoBSD never have a read-write root, so ZFS event processing is permanently disabled in these systems. o Failure to handle asynchronous events promptly can extend the window of time that a pool is in a critical state. At worst, a missed configuration cache update will force the operator to perform a manual "zfs import" (note -f is not required) to inform the system about a newly created pool. To minimize the likelihood of this rare occurrence, configuration cache write failures now emit FMA events (via devctl) so the operator can take corrective action, and the write is retried every 5 minutes. The retry interval, in seconds, is tunable via the sysctl "vfs.zfs.ccw_retry_interval". As a side effect of reporting configuration cache events, other sysevents, such as re-silver start/stop, are now also reported via devctl. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c: o As is done in zfs_fm.c, provide a manual declaration for devctl_notify(). Both declarations could be combined into spa_impl.h, but the declaration is fault management related, not spa specific. sys/fm/fs/zfs.h would be ideal if it weren't so public and reserved for FMA string definitions. I'm open to suggestions on how to improve this nit while minimizing our divergence from Solaris. o Use devctl_notify() to implement sysevent support in spa_event_notify(). The subsystem is EC_ZFS so that these events can never collide with those emitted in zfs_fm.c. o Add the sysctl "vfs.zfs.ccw_retry_interval". The value defaults to 5 minutes and is used to rate limit, on a per-pool basis, configuration cache file write attempts. o Modify spa_async_dispatch to honor configuration cache write limiting. If other events are pending, a configuration cache write will be attempted at the same time, so the rate limiting only applies when the asynchronous dispatch system is otherwise idle. Async events should be rare (e.g. device arrival/departure) and configuration cache writes rarer, so a more complicated system to strictly honor the retry limit seems unwarranted. o Remove check in spa_async_dispatch() for the root file system being read-write. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c: Instead of silently ignoring configuration cache write failures, report them via a new FMA event as well as to the console. The current zfs_ereport_post() doesn't allow arbitrary name=value pairs to be appended to the report, so the configuration cache file name is only available on the console output. This limitation should be addressed in a future update. Note: This error report is only posted once per incident, to avoid spamming. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h: Add a hrtime_t to the spa data structure to track the time (via gethrtime()) of the last configuration cache file write failure. This is referenced in spa_async_dispatch() to effect the rate limiting. sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h: Add FM_EREPORT_ZFS_CONFIG_CACHE_WRITE as an ereport class. Submitted by: gibbs Reviewed by: Matthew Ahrens , Eric Schrock , Christopher Siden Sponsored by: Spectra Logic Modified: 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/spa_impl.h stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fm/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/spa.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 03:55:13 2013 (r252761) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 04:01:25 2013 (r252762) @@ -88,6 +88,12 @@ TUNABLE_INT("vfs.zfs.check_hostid", &che SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RW, &check_hostid, 0, "Check hostid on import?"); +/* + * The interval, in seconds, at which failed configuration cache file writes + * should be retried. + */ +static int zfs_ccw_retry_interval = 300; + typedef enum zti_modes { zti_mode_fixed, /* value is # of threads (min 1) */ zti_mode_online_percent, /* value is % of online CPUs */ @@ -5852,13 +5858,34 @@ spa_async_resume(spa_t *spa) mutex_exit(&spa->spa_async_lock); } +static boolean_t +spa_async_tasks_pending(spa_t *spa) +{ + uint_t non_config_tasks; + uint_t config_task; + boolean_t config_task_suspended; + + non_config_tasks = spa->spa_async_tasks & ~SPA_ASYNC_CONFIG_UPDATE; + config_task = spa->spa_async_tasks & SPA_ASYNC_CONFIG_UPDATE; + if (spa->spa_ccw_fail_time == 0) { + config_task_suspended = B_FALSE; + } else { + config_task_suspended = + (gethrtime() - spa->spa_ccw_fail_time) < + (zfs_ccw_retry_interval * NANOSEC); + } + + return (non_config_tasks || (config_task && !config_task_suspended)); +} + static void spa_async_dispatch(spa_t *spa) { mutex_enter(&spa->spa_async_lock); - if (spa->spa_async_tasks && !spa->spa_async_suspended && + if (spa_async_tasks_pending(spa) && + !spa->spa_async_suspended && spa->spa_async_thread == NULL && - rootdir != NULL && !vn_is_readonly(rootdir)) + rootdir != NULL) spa->spa_async_thread = thread_create(NULL, 0, spa_async_thread, spa, 0, &p0, TS_RUN, maxclsyspri); mutex_exit(&spa->spa_async_lock); 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 Fri Jul 5 03:55:13 2013 (r252761) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Fri Jul 5 04:01:25 2013 (r252762) @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -139,7 +140,7 @@ out: kobj_close_file(file); } -static void +static int spa_config_write(spa_config_dirent_t *dp, nvlist_t *nvl) { size_t buflen; @@ -147,13 +148,14 @@ spa_config_write(spa_config_dirent_t *dp vnode_t *vp; int oflags = FWRITE | FTRUNC | FCREAT | FOFFMAX; char *temp; + int err; /* * If the nvlist is empty (NULL), then remove the old cachefile. */ if (nvl == NULL) { - (void) vn_remove(dp->scd_path, UIO_SYSSPACE, RMFILE); - return; + err = vn_remove(dp->scd_path, UIO_SYSSPACE, RMFILE); + return (err); } /* @@ -174,12 +176,14 @@ spa_config_write(spa_config_dirent_t *dp */ (void) snprintf(temp, MAXPATHLEN, "%s.tmp", dp->scd_path); - if (vn_open(temp, UIO_SYSSPACE, oflags, 0644, &vp, CRCREAT, 0) == 0) { - if (vn_rdwr(UIO_WRITE, vp, buf, buflen, 0, UIO_SYSSPACE, - 0, RLIM64_INFINITY, kcred, NULL) == 0 && - VOP_FSYNC(vp, FSYNC, kcred, NULL) == 0) { - (void) vn_rename(temp, dp->scd_path, UIO_SYSSPACE); - } + err = vn_open(temp, UIO_SYSSPACE, oflags, 0644, &vp, CRCREAT, 0); + if (err == 0) { + err = vn_rdwr(UIO_WRITE, vp, buf, buflen, 0, UIO_SYSSPACE, + 0, RLIM64_INFINITY, kcred, NULL); + if (err == 0) + err = VOP_FSYNC(vp, FSYNC, kcred, NULL); + if (err == 0) + err = vn_rename(temp, dp->scd_path, UIO_SYSSPACE); (void) VOP_CLOSE(vp, oflags, 1, 0, kcred, NULL); } @@ -187,6 +191,7 @@ spa_config_write(spa_config_dirent_t *dp kmem_free(buf, buflen); kmem_free(temp, MAXPATHLEN); + return (err); } /* @@ -198,6 +203,8 @@ spa_config_sync(spa_t *target, boolean_t { spa_config_dirent_t *dp, *tdp; nvlist_t *nvl; + boolean_t ccw_failure; + int error; ASSERT(MUTEX_HELD(&spa_namespace_lock)); @@ -209,6 +216,7 @@ spa_config_sync(spa_t *target, boolean_t * cachefile is changed, the new one is pushed onto this list, allowing * us to update previous cachefiles that no longer contain this pool. */ + ccw_failure = B_FALSE; for (dp = list_head(&target->spa_config_list); dp != NULL; dp = list_next(&target->spa_config_list, dp)) { spa_t *spa = NULL; @@ -249,10 +257,32 @@ spa_config_sync(spa_t *target, boolean_t mutex_exit(&spa->spa_props_lock); } - spa_config_write(dp, nvl); + error = spa_config_write(dp, nvl); + if (error != 0) + ccw_failure = B_TRUE; nvlist_free(nvl); } + if (ccw_failure) { + /* + * Keep trying so that configuration data is + * written if/when any temporary filesystem + * resource issues are resolved. + */ + if (target->spa_ccw_fail_time == 0) { + zfs_ereport_post(FM_EREPORT_ZFS_CONFIG_CACHE_WRITE, + target, NULL, NULL, 0, 0); + } + target->spa_ccw_fail_time = gethrtime(); + spa_async_request(target, SPA_ASYNC_CONFIG_UPDATE); + } else { + /* + * Do not rate limit future attempts to update + * the config cache. + */ + target->spa_ccw_fail_time = 0; + } + /* * Remove any config entries older than the current one. */ Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Jul 5 03:55:13 2013 (r252761) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Jul 5 04:01:25 2013 (r252762) @@ -241,6 +241,7 @@ struct spa { uint64_t spa_deadman_calls; /* number of deadman calls */ uint64_t spa_sync_starttime; /* starting time fo spa_sync */ uint64_t spa_deadman_synctime; /* deadman expiration timer */ + hrtime_t spa_ccw_fail_time; /* Conf cache write fail time */ /* * spa_refcount & spa_config_lock must be the last elements * because refcount_t changes size based on compilation options. Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h Fri Jul 5 03:55:13 2013 (r252761) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h Fri Jul 5 04:01:25 2013 (r252762) @@ -46,6 +46,7 @@ extern "C" { #define FM_EREPORT_ZFS_IO_FAILURE "io_failure" #define FM_EREPORT_ZFS_PROBE_FAILURE "probe_failure" #define FM_EREPORT_ZFS_LOG_REPLAY "log_replay" +#define FM_EREPORT_ZFS_CONFIG_CACHE_WRITE "config_cache_write" #define FM_EREPORT_PAYLOAD_ZFS_POOL "pool" #define FM_EREPORT_PAYLOAD_ZFS_POOL_FAILMODE "pool_failmode" From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 04:02:16 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5E52B5B5; Fri, 5 Jul 2013 04:02:16 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F1E71EEC; Fri, 5 Jul 2013 04:02:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6542GtH073384; Fri, 5 Jul 2013 04:02:16 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6542FrE073379; Fri, 5 Jul 2013 04:02:15 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050402.r6542FrE073379@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:02: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: r252763 - in stable/8/sys/cddl/contrib/opensolaris/uts/common: fs/zfs fs/zfs/sys sys/fm/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.14 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, 05 Jul 2013 04:02:16 -0000 Author: delphij Date: Fri Jul 5 04:02:15 2013 New Revision: 252763 URL: http://svnweb.freebsd.org/changeset/base/252763 Log: MFC r251636: illumos #3749 zfs event processing should work on R/O root filesystems This log is a modified version of the original one written by gibbs@, to account for changes made during the illumos RTI process. Allow ZFS asynchronous event handling to proceed even if the root file system is mounted read-only. This restriction appears to have been put in place to avoid errors with updating the configuration cache file. However: o The majority of asynchronous event handling does not involve configuration cache file updates. o The configuration cache file need not be on the root file system, so the check was not complete. o Other classes of errors (e.g. file system full) can also prevent a successful update yet do not prevent asynchronous event processing. o Configurations such as NanoBSD never have a read-write root, so ZFS event processing is permanently disabled in these systems. o Failure to handle asynchronous events promptly can extend the window of time that a pool is in a critical state. At worst, a missed configuration cache update will force the operator to perform a manual "zfs import" (note -f is not required) to inform the system about a newly created pool. To minimize the likelihood of this rare occurrence, configuration cache write failures now emit FMA events (via devctl) so the operator can take corrective action, and the write is retried every 5 minutes. The retry interval, in seconds, is tunable via the sysctl "vfs.zfs.ccw_retry_interval". As a side effect of reporting configuration cache events, other sysevents, such as re-silver start/stop, are now also reported via devctl. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c: o As is done in zfs_fm.c, provide a manual declaration for devctl_notify(). Both declarations could be combined into spa_impl.h, but the declaration is fault management related, not spa specific. sys/fm/fs/zfs.h would be ideal if it weren't so public and reserved for FMA string definitions. I'm open to suggestions on how to improve this nit while minimizing our divergence from Solaris. o Use devctl_notify() to implement sysevent support in spa_event_notify(). The subsystem is EC_ZFS so that these events can never collide with those emitted in zfs_fm.c. o Add the sysctl "vfs.zfs.ccw_retry_interval". The value defaults to 5 minutes and is used to rate limit, on a per-pool basis, configuration cache file write attempts. o Modify spa_async_dispatch to honor configuration cache write limiting. If other events are pending, a configuration cache write will be attempted at the same time, so the rate limiting only applies when the asynchronous dispatch system is otherwise idle. Async events should be rare (e.g. device arrival/departure) and configuration cache writes rarer, so a more complicated system to strictly honor the retry limit seems unwarranted. o Remove check in spa_async_dispatch() for the root file system being read-write. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c: Instead of silently ignoring configuration cache write failures, report them via a new FMA event as well as to the console. The current zfs_ereport_post() doesn't allow arbitrary name=value pairs to be appended to the report, so the configuration cache file name is only available on the console output. This limitation should be addressed in a future update. Note: This error report is only posted once per incident, to avoid spamming. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h: Add a hrtime_t to the spa data structure to track the time (via gethrtime()) of the last configuration cache file write failure. This is referenced in spa_async_dispatch() to effect the rate limiting. sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h: Add FM_EREPORT_ZFS_CONFIG_CACHE_WRITE as an ereport class. Submitted by: gibbs Reviewed by: Matthew Ahrens , Eric Schrock , Christopher Siden Sponsored by: Spectra Logic Modified: 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/spa_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fm/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/spa.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 04:01:25 2013 (r252762) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c Fri Jul 5 04:02:15 2013 (r252763) @@ -88,6 +88,12 @@ TUNABLE_INT("vfs.zfs.check_hostid", &che SYSCTL_INT(_vfs_zfs, OID_AUTO, check_hostid, CTLFLAG_RW, &check_hostid, 0, "Check hostid on import?"); +/* + * The interval, in seconds, at which failed configuration cache file writes + * should be retried. + */ +static int zfs_ccw_retry_interval = 300; + typedef enum zti_modes { zti_mode_fixed, /* value is # of threads (min 1) */ zti_mode_online_percent, /* value is % of online CPUs */ @@ -5852,13 +5858,34 @@ spa_async_resume(spa_t *spa) mutex_exit(&spa->spa_async_lock); } +static boolean_t +spa_async_tasks_pending(spa_t *spa) +{ + uint_t non_config_tasks; + uint_t config_task; + boolean_t config_task_suspended; + + non_config_tasks = spa->spa_async_tasks & ~SPA_ASYNC_CONFIG_UPDATE; + config_task = spa->spa_async_tasks & SPA_ASYNC_CONFIG_UPDATE; + if (spa->spa_ccw_fail_time == 0) { + config_task_suspended = B_FALSE; + } else { + config_task_suspended = + (gethrtime() - spa->spa_ccw_fail_time) < + (zfs_ccw_retry_interval * NANOSEC); + } + + return (non_config_tasks || (config_task && !config_task_suspended)); +} + static void spa_async_dispatch(spa_t *spa) { mutex_enter(&spa->spa_async_lock); - if (spa->spa_async_tasks && !spa->spa_async_suspended && + if (spa_async_tasks_pending(spa) && + !spa->spa_async_suspended && spa->spa_async_thread == NULL && - rootdir != NULL && !vn_is_readonly(rootdir)) + rootdir != NULL) spa->spa_async_thread = thread_create(NULL, 0, spa_async_thread, spa, 0, &p0, TS_RUN, maxclsyspri); mutex_exit(&spa->spa_async_lock); 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 Fri Jul 5 04:01:25 2013 (r252762) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c Fri Jul 5 04:02:15 2013 (r252763) @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -139,7 +140,7 @@ out: kobj_close_file(file); } -static void +static int spa_config_write(spa_config_dirent_t *dp, nvlist_t *nvl) { size_t buflen; @@ -147,13 +148,14 @@ spa_config_write(spa_config_dirent_t *dp vnode_t *vp; int oflags = FWRITE | FTRUNC | FCREAT | FOFFMAX; char *temp; + int err; /* * If the nvlist is empty (NULL), then remove the old cachefile. */ if (nvl == NULL) { - (void) vn_remove(dp->scd_path, UIO_SYSSPACE, RMFILE); - return; + err = vn_remove(dp->scd_path, UIO_SYSSPACE, RMFILE); + return (err); } /* @@ -174,12 +176,14 @@ spa_config_write(spa_config_dirent_t *dp */ (void) snprintf(temp, MAXPATHLEN, "%s.tmp", dp->scd_path); - if (vn_open(temp, UIO_SYSSPACE, oflags, 0644, &vp, CRCREAT, 0) == 0) { - if (vn_rdwr(UIO_WRITE, vp, buf, buflen, 0, UIO_SYSSPACE, - 0, RLIM64_INFINITY, kcred, NULL) == 0 && - VOP_FSYNC(vp, FSYNC, kcred, NULL) == 0) { - (void) vn_rename(temp, dp->scd_path, UIO_SYSSPACE); - } + err = vn_open(temp, UIO_SYSSPACE, oflags, 0644, &vp, CRCREAT, 0); + if (err == 0) { + err = vn_rdwr(UIO_WRITE, vp, buf, buflen, 0, UIO_SYSSPACE, + 0, RLIM64_INFINITY, kcred, NULL); + if (err == 0) + err = VOP_FSYNC(vp, FSYNC, kcred, NULL); + if (err == 0) + err = vn_rename(temp, dp->scd_path, UIO_SYSSPACE); (void) VOP_CLOSE(vp, oflags, 1, 0, kcred, NULL); } @@ -187,6 +191,7 @@ spa_config_write(spa_config_dirent_t *dp kmem_free(buf, buflen); kmem_free(temp, MAXPATHLEN); + return (err); } /* @@ -198,6 +203,8 @@ spa_config_sync(spa_t *target, boolean_t { spa_config_dirent_t *dp, *tdp; nvlist_t *nvl; + boolean_t ccw_failure; + int error; ASSERT(MUTEX_HELD(&spa_namespace_lock)); @@ -209,6 +216,7 @@ spa_config_sync(spa_t *target, boolean_t * cachefile is changed, the new one is pushed onto this list, allowing * us to update previous cachefiles that no longer contain this pool. */ + ccw_failure = B_FALSE; for (dp = list_head(&target->spa_config_list); dp != NULL; dp = list_next(&target->spa_config_list, dp)) { spa_t *spa = NULL; @@ -241,10 +249,32 @@ spa_config_sync(spa_t *target, boolean_t mutex_exit(&spa->spa_props_lock); } - spa_config_write(dp, nvl); + error = spa_config_write(dp, nvl); + if (error != 0) + ccw_failure = B_TRUE; nvlist_free(nvl); } + if (ccw_failure) { + /* + * Keep trying so that configuration data is + * written if/when any temporary filesystem + * resource issues are resolved. + */ + if (target->spa_ccw_fail_time == 0) { + zfs_ereport_post(FM_EREPORT_ZFS_CONFIG_CACHE_WRITE, + target, NULL, NULL, 0, 0); + } + target->spa_ccw_fail_time = gethrtime(); + spa_async_request(target, SPA_ASYNC_CONFIG_UPDATE); + } else { + /* + * Do not rate limit future attempts to update + * the config cache. + */ + target->spa_ccw_fail_time = 0; + } + /* * Remove any config entries older than the current one. */ Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Jul 5 04:01:25 2013 (r252762) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h Fri Jul 5 04:02:15 2013 (r252763) @@ -241,6 +241,7 @@ struct spa { uint64_t spa_deadman_calls; /* number of deadman calls */ uint64_t spa_sync_starttime; /* starting time fo spa_sync */ uint64_t spa_deadman_synctime; /* deadman expiration timer */ + hrtime_t spa_ccw_fail_time; /* Conf cache write fail time */ /* * spa_refcount & spa_config_lock must be the last elements * because refcount_t changes size based on compilation options. Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h Fri Jul 5 04:01:25 2013 (r252762) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h Fri Jul 5 04:02:15 2013 (r252763) @@ -46,6 +46,7 @@ extern "C" { #define FM_EREPORT_ZFS_IO_FAILURE "io_failure" #define FM_EREPORT_ZFS_PROBE_FAILURE "probe_failure" #define FM_EREPORT_ZFS_LOG_REPLAY "log_replay" +#define FM_EREPORT_ZFS_CONFIG_CACHE_WRITE "config_cache_write" #define FM_EREPORT_PAYLOAD_ZFS_POOL "pool" #define FM_EREPORT_PAYLOAD_ZFS_POOL_FAILMODE "pool_failmode" From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 04:08:48 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 42D7F748; Fri, 5 Jul 2013 04:08:48 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3282B1F21; Fri, 5 Jul 2013 04:08:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6548mgd074539; Fri, 5 Jul 2013 04:08:48 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6548k0K074526; Fri, 5 Jul 2013 04:08:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050408.r6548k0K074526@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:08: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: r252764 - in stable/9: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/ope... 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.14 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, 05 Jul 2013 04:08:48 -0000 Author: delphij Date: Fri Jul 5 04:08:45 2013 New Revision: 252764 URL: http://svnweb.freebsd.org/changeset/base/252764 Log: MFC r251646 + r252219: MFV r251644: Poor ZFS send / receive performance due to snapshot hold / release processing (by smh@) Illumos ZFS issues: 3740 Poor ZFS send / receive performance due to snapshot hold / release processing MFV r252215: Restore a previous behavior before r251646, where when destructing ZFS snapshot, the ioctl would return ENOENT when it hit any of them in the errlist (the new behavior was only return ENOENT when all returns error). Illumos ZFS issues: 3829 fix for 3740 changed behavior of zfs destroy/hold/release ioctl Modified: stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.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_userhold.h stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.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_main.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Jul 5 04:08:45 2013 (r252764) @@ -28,6 +28,7 @@ * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -5222,8 +5223,7 @@ zfs_do_hold_rele_impl(int argc, char **a continue; } if (holding) { - if (zfs_hold(zhp, delim+1, tag, recursive, - B_FALSE, -1) != 0) + if (zfs_hold(zhp, delim+1, tag, recursive, -1) != 0) ++errors; } else { if (zfs_release(zhp, delim+1, tag, recursive) != 0) Modified: stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/cddl/contrib/opensolaris/cmd/zhack/zhack.c Fri Jul 5 04:08:45 2013 (r252764) @@ -21,6 +21,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ /* @@ -153,7 +154,7 @@ import_pool(const char *target, boolean_ g_importargs.poolname = g_pool; pools = zpool_search_import(g_zfs, &g_importargs); - if (pools == NULL || nvlist_next_nvpair(pools, NULL) == NULL) { + if (nvlist_empty(pools)) { if (!g_importargs.can_be_active) { g_importargs.can_be_active = B_TRUE; if (zpool_search_import(g_zfs, &g_importargs) != NULL || Modified: stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 5 04:08:45 2013 (r252764) @@ -23,6 +23,7 @@ * Copyright (c) 2012 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. */ /* @@ -4713,7 +4714,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, error = user_release_one(fullname, tag); if (error) - fatal(0, "user_release_one(%s)", fullname, tag); + fatal(0, "user_release_one(%s, %s) = %d", fullname, tag, error); VERIFY3U(dmu_objset_hold(fullname, FTAG, &origin), ==, ENOENT); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Jul 5 04:08:45 2013 (r252764) @@ -27,6 +27,7 @@ * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #ifndef _LIBZFS_H @@ -611,7 +612,8 @@ extern int zfs_send(zfs_handle_t *, cons extern int zfs_promote(zfs_handle_t *); extern int zfs_hold(zfs_handle_t *, const char *, const char *, - boolean_t, boolean_t, int); + boolean_t, int); +extern int zfs_hold_nvl(zfs_handle_t *, int, nvlist_t *); extern int zfs_release(zfs_handle_t *, const char *, const char *, boolean_t); extern int zfs_get_holds(zfs_handle_t *, nvlist_t **); extern uint64_t zvol_volsize_to_reservation(uint64_t, nvlist_t *); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 04:08:45 2013 (r252764) @@ -21,12 +21,13 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -3158,18 +3159,14 @@ static int zfs_check_snap_cb(zfs_handle_t *zhp, void *arg) { struct destroydata *dd = arg; - zfs_handle_t *szhp; char name[ZFS_MAXNAMELEN]; int rv = 0; (void) snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name, dd->snapname); - szhp = make_dataset_handle(zhp->zfs_hdl, name); - if (szhp) { + if (lzc_exists(name)) verify(nvlist_add_boolean(dd->nvl, name) == 0); - zfs_close(szhp); - } rv = zfs_iter_filesystems(zhp, zfs_check_snap_cb, dd); zfs_close(zhp); @@ -3189,7 +3186,7 @@ zfs_destroy_snaps(zfs_handle_t *zhp, cha verify(nvlist_alloc(&dd.nvl, NV_UNIQUE_NAME, 0) == 0); (void) zfs_check_snap_cb(zfs_handle_dup(zhp), &dd); - if (nvlist_next_nvpair(dd.nvl, NULL) == NULL) { + if (nvlist_empty(dd.nvl)) { ret = zfs_standard_error_fmt(zhp->zfs_hdl, ENOENT, dgettext(TEXT_DOMAIN, "cannot destroy '%s@%s'"), zhp->zfs_name, snapname); @@ -3214,7 +3211,7 @@ zfs_destroy_snaps_nvl(libzfs_handle_t *h if (ret == 0) return (0); - if (nvlist_next_nvpair(errlist, NULL) == NULL) { + if (nvlist_empty(errlist)) { char errbuf[1024]; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot destroy snapshots")); @@ -4162,24 +4159,21 @@ struct holdarg { const char *snapname; const char *tag; boolean_t recursive; + int error; }; static int zfs_hold_one(zfs_handle_t *zhp, void *arg) { struct holdarg *ha = arg; - zfs_handle_t *szhp; char name[ZFS_MAXNAMELEN]; int rv = 0; (void) snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name, ha->snapname); - szhp = make_dataset_handle(zhp->zfs_hdl, name); - if (szhp) { + if (lzc_exists(name)) fnvlist_add_string(ha->nvl, name, ha->tag); - zfs_close(szhp); - } if (ha->recursive) rv = zfs_iter_filesystems(zhp, zfs_hold_one, ha); @@ -4189,14 +4183,10 @@ zfs_hold_one(zfs_handle_t *zhp, void *ar int zfs_hold(zfs_handle_t *zhp, const char *snapname, const char *tag, - boolean_t recursive, boolean_t enoent_ok, int cleanup_fd) + boolean_t recursive, int cleanup_fd) { int ret; struct holdarg ha; - nvlist_t *errors; - libzfs_handle_t *hdl = zhp->zfs_hdl; - char errbuf[1024]; - nvpair_t *elem; ha.nvl = fnvlist_alloc(); ha.snapname = snapname; @@ -4204,26 +4194,44 @@ zfs_hold(zfs_handle_t *zhp, const char * ha.recursive = recursive; (void) zfs_hold_one(zfs_handle_dup(zhp), &ha); - if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { + if (nvlist_empty(ha.nvl)) { + char errbuf[1024]; + fnvlist_free(ha.nvl); ret = ENOENT; - if (!enoent_ok) { - (void) snprintf(errbuf, sizeof (errbuf), - dgettext(TEXT_DOMAIN, - "cannot hold snapshot '%s@%s'"), - zhp->zfs_name, snapname); - (void) zfs_standard_error(hdl, ret, errbuf); - } + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, + "cannot hold snapshot '%s@%s'"), + zhp->zfs_name, snapname); + (void) zfs_standard_error(zhp->zfs_hdl, ret, errbuf); return (ret); } - ret = lzc_hold(ha.nvl, cleanup_fd, &errors); + ret = zfs_hold_nvl(zhp, cleanup_fd, ha.nvl); fnvlist_free(ha.nvl); - if (ret == 0) + return (ret); +} + +int +zfs_hold_nvl(zfs_handle_t *zhp, int cleanup_fd, nvlist_t *holds) +{ + int ret; + nvlist_t *errors; + libzfs_handle_t *hdl = zhp->zfs_hdl; + char errbuf[1024]; + nvpair_t *elem; + + errors = NULL; + ret = lzc_hold(holds, cleanup_fd, &errors); + + if (ret == 0) { + /* There may be errors even in the success case. */ + fnvlist_free(errors); return (0); + } - if (nvlist_next_nvpair(errors, NULL) == NULL) { + if (nvlist_empty(errors)) { /* no hold-specific errors */ (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot hold")); @@ -4263,10 +4271,6 @@ zfs_hold(zfs_handle_t *zhp, const char * case EEXIST: (void) zfs_error(hdl, EZFS_REFTAG_HOLD, errbuf); break; - case ENOENT: - if (enoent_ok) - return (ENOENT); - /* FALLTHROUGH */ default: (void) zfs_standard_error(hdl, fnvpair_value_int32(elem), errbuf); @@ -4277,30 +4281,26 @@ zfs_hold(zfs_handle_t *zhp, const char * return (ret); } -struct releasearg { - nvlist_t *nvl; - const char *snapname; - const char *tag; - boolean_t recursive; -}; - static int zfs_release_one(zfs_handle_t *zhp, void *arg) { struct holdarg *ha = arg; - zfs_handle_t *szhp; char name[ZFS_MAXNAMELEN]; int rv = 0; + nvlist_t *existing_holds; (void) snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name, ha->snapname); - szhp = make_dataset_handle(zhp->zfs_hdl, name); - if (szhp) { - nvlist_t *holds = fnvlist_alloc(); - fnvlist_add_boolean(holds, ha->tag); - fnvlist_add_nvlist(ha->nvl, name, holds); - zfs_close(szhp); + if (lzc_get_holds(name, &existing_holds) != 0) { + ha->error = ENOENT; + } else if (!nvlist_exists(existing_holds, ha->tag)) { + ha->error = ESRCH; + } else { + nvlist_t *torelease = fnvlist_alloc(); + fnvlist_add_boolean(torelease, ha->tag); + fnvlist_add_nvlist(ha->nvl, name, torelease); + fnvlist_free(torelease); } if (ha->recursive) @@ -4315,7 +4315,7 @@ zfs_release(zfs_handle_t *zhp, const cha { int ret; struct holdarg ha; - nvlist_t *errors; + nvlist_t *errors = NULL; nvpair_t *elem; libzfs_handle_t *hdl = zhp->zfs_hdl; char errbuf[1024]; @@ -4324,26 +4324,34 @@ zfs_release(zfs_handle_t *zhp, const cha ha.snapname = snapname; ha.tag = tag; ha.recursive = recursive; + ha.error = 0; (void) zfs_release_one(zfs_handle_dup(zhp), &ha); - if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { + if (nvlist_empty(ha.nvl)) { fnvlist_free(ha.nvl); - ret = ENOENT; + ret = ha.error; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot release hold from snapshot '%s@%s'"), zhp->zfs_name, snapname); - (void) zfs_standard_error(hdl, ret, errbuf); + if (ret == ESRCH) { + (void) zfs_error(hdl, EZFS_REFTAG_RELE, errbuf); + } else { + (void) zfs_standard_error(hdl, ret, errbuf); + } return (ret); } ret = lzc_release(ha.nvl, &errors); fnvlist_free(ha.nvl); - if (ret == 0) + if (ret == 0) { + /* There may be errors even in the success case. */ + fnvlist_free(errors); return (0); + } - if (nvlist_next_nvpair(errors, NULL) == NULL) { + if (nvlist_empty(errors)) { /* no hold-specific errors */ (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot release")); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Jul 5 04:08:45 2013 (r252764) @@ -25,6 +25,7 @@ * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -802,6 +803,7 @@ typedef struct send_dump_data { int outfd; boolean_t err; nvlist_t *fss; + nvlist_t *snapholds; avl_tree_t *fsavl; snapfilter_cb_t *filter_cb; void *filter_cb_arg; @@ -952,41 +954,19 @@ dump_ioctl(zfs_handle_t *zhp, const char return (0); } -static int -hold_for_send(zfs_handle_t *zhp, send_dump_data_t *sdd) +static void +gather_holds(zfs_handle_t *zhp, send_dump_data_t *sdd) { - zfs_handle_t *pzhp; - int error = 0; - char *thissnap; - assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT); - if (sdd->dryrun) - return (0); - /* - * zfs_send() only opens a cleanup_fd for sends that need it, + * zfs_send() only sets snapholds for sends that need them, * e.g. replication and doall. */ - if (sdd->cleanup_fd == -1) - return (0); - - thissnap = strchr(zhp->zfs_name, '@') + 1; - *(thissnap - 1) = '\0'; - pzhp = zfs_open(zhp->zfs_hdl, zhp->zfs_name, ZFS_TYPE_DATASET); - *(thissnap - 1) = '@'; - - /* - * It's OK if the parent no longer exists. The send code will - * handle that error. - */ - if (pzhp) { - error = zfs_hold(pzhp, thissnap, sdd->holdtag, - B_FALSE, B_TRUE, sdd->cleanup_fd); - zfs_close(pzhp); - } + if (sdd->snapholds == NULL) + return; - return (error); + fnvlist_add_string(sdd->snapholds, zhp->zfs_name, sdd->holdtag); } static void * @@ -1042,28 +1022,23 @@ dump_snapshot(zfs_handle_t *zhp, void *a send_dump_data_t *sdd = arg; progress_arg_t pa = { 0 }; pthread_t tid; - char *thissnap; int err; boolean_t isfromsnap, istosnap, fromorigin; boolean_t exclude = B_FALSE; + err = 0; thissnap = strchr(zhp->zfs_name, '@') + 1; isfromsnap = (sdd->fromsnap != NULL && strcmp(sdd->fromsnap, thissnap) == 0); if (!sdd->seenfrom && isfromsnap) { - err = hold_for_send(zhp, sdd); - if (err == 0) { - sdd->seenfrom = B_TRUE; - (void) strcpy(sdd->prevsnap, thissnap); - sdd->prevsnap_obj = zfs_prop_get_int(zhp, - ZFS_PROP_OBJSETID); - } else if (err == ENOENT) { - err = 0; - } + gather_holds(zhp, sdd); + sdd->seenfrom = B_TRUE; + (void) strcpy(sdd->prevsnap, thissnap); + sdd->prevsnap_obj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID); zfs_close(zhp); - return (err); + return (0); } if (sdd->seento || !sdd->seenfrom) { @@ -1114,14 +1089,7 @@ dump_snapshot(zfs_handle_t *zhp, void *a return (0); } - err = hold_for_send(zhp, sdd); - if (err) { - if (err == ENOENT) - err = 0; - zfs_close(zhp); - return (err); - } - + gather_holds(zhp, sdd); fromorigin = sdd->prevsnap[0] == '\0' && (sdd->fromorigin || sdd->replicate); @@ -1389,7 +1357,7 @@ zfs_send(zfs_handle_t *zhp, const char * avl_tree_t *fsavl = NULL; static uint64_t holdseq; int spa_version; - pthread_t tid; + pthread_t tid = 0; int pipefd[2]; dedup_arg_t dda = { 0 }; int featureflags = 0; @@ -1462,11 +1430,8 @@ zfs_send(zfs_handle_t *zhp, const char * *debugnvp = hdrnv; else nvlist_free(hdrnv); - if (err) { - fsavl_destroy(fsavl); - nvlist_free(fss); + if (err) goto stderr_out; - } } if (!flags->dryrun) { @@ -1490,8 +1455,6 @@ zfs_send(zfs_handle_t *zhp, const char * } free(packbuf); if (err == -1) { - fsavl_destroy(fsavl); - nvlist_free(fss); err = errno; goto stderr_out; } @@ -1502,8 +1465,6 @@ zfs_send(zfs_handle_t *zhp, const char * drr.drr_u.drr_end.drr_checksum = zc; err = write(outfd, &drr, sizeof (drr)); if (err == -1) { - fsavl_destroy(fsavl); - nvlist_free(fss); err = errno; goto stderr_out; } @@ -1515,7 +1476,7 @@ zfs_send(zfs_handle_t *zhp, const char * /* dump each stream */ sdd.fromsnap = fromsnap; sdd.tosnap = tosnap; - if (flags->dedup) + if (tid != 0) sdd.outfd = pipefd[0]; else sdd.outfd = outfd; @@ -1552,36 +1513,71 @@ zfs_send(zfs_handle_t *zhp, const char * err = errno; goto stderr_out; } + sdd.snapholds = fnvlist_alloc(); } else { sdd.cleanup_fd = -1; + sdd.snapholds = NULL; } - if (flags->verbose) { + if (flags->verbose || sdd.snapholds != NULL) { /* * Do a verbose no-op dry run to get all the verbose output - * before generating any data. Then do a non-verbose real - * run to generate the streams. + * or to gather snapshot hold's before generating any data, + * then do a non-verbose real run to generate the streams. */ sdd.dryrun = B_TRUE; err = dump_filesystems(zhp, &sdd); - sdd.dryrun = flags->dryrun; - sdd.verbose = B_FALSE; - if (flags->parsable) { - (void) fprintf(stderr, "size\t%llu\n", - (longlong_t)sdd.size); - } else { - char buf[16]; - zfs_nicenum(sdd.size, buf, sizeof (buf)); - (void) fprintf(stderr, dgettext(TEXT_DOMAIN, - "total estimated size is %s\n"), buf); + + if (err != 0) + goto stderr_out; + + if (flags->verbose) { + if (flags->parsable) { + (void) fprintf(stderr, "size\t%llu\n", + (longlong_t)sdd.size); + } else { + char buf[16]; + zfs_nicenum(sdd.size, buf, sizeof (buf)); + (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + "total estimated size is %s\n"), buf); + } + } + + /* Ensure no snaps found is treated as an error. */ + if (!sdd.seento) { + err = ENOENT; + goto err_out; } + + /* Skip the second run if dryrun was requested. */ + if (flags->dryrun) + goto err_out; + + if (sdd.snapholds != NULL) { + err = zfs_hold_nvl(zhp, sdd.cleanup_fd, sdd.snapholds); + if (err != 0) + goto stderr_out; + + fnvlist_free(sdd.snapholds); + sdd.snapholds = NULL; + } + + sdd.dryrun = B_FALSE; + sdd.verbose = B_FALSE; } + err = dump_filesystems(zhp, &sdd); fsavl_destroy(fsavl); nvlist_free(fss); - if (flags->dedup) { - (void) close(pipefd[0]); + /* Ensure no snaps found is treated as an error. */ + if (err == 0 && !sdd.seento) + err = ENOENT; + + if (tid != 0) { + if (err != 0) + (void) pthread_cancel(tid); (void) pthread_join(tid, NULL); + (void) close(pipefd[0]); } if (sdd.cleanup_fd != -1) { @@ -1609,9 +1605,13 @@ zfs_send(zfs_handle_t *zhp, const char * stderr_out: err = zfs_standard_error(zhp->zfs_hdl, err, errbuf); err_out: + fsavl_destroy(fsavl); + nvlist_free(fss); + fnvlist_free(sdd.snapholds); + if (sdd.cleanup_fd != -1) VERIFY(0 == close(sdd.cleanup_fd)); - if (flags->dedup) { + if (tid != 0) { (void) pthread_cancel(tid); (void) pthread_join(tid, NULL); (void) close(pipefd[0]); Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Fri Jul 5 04:08:45 2013 (r252764) @@ -21,6 +21,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ /* @@ -333,7 +334,6 @@ lzc_destroy_snaps(nvlist_t *snaps, boole nvlist_free(args); return (error); - } int @@ -393,11 +393,17 @@ lzc_exists(const char *dataset) * uncleanly, the holds will be released when the pool is next opened * or imported. * - * The return value will be 0 if all holds were created. Otherwise the return - * value will be the errno of a (unspecified) hold that failed, no holds will - * be created, and the errlist will have an entry for each hold that - * failed (name = snapshot). The value in the errlist will be the error - * code (int32). + * Holds for snapshots which don't exist will be skipped and have an entry + * added to errlist, but will not cause an overall failure. + * + * The return value will be 0 if all holds, for snapshots that existed, + * were succesfully created. + * + * Otherwise the return value will be the errno of a (unspecified) hold that + * failed and no holds will be created. + * + * In all cases the errlist will have an entry for each hold that failed + * (name = snapshot), with its value being the error code (int32). */ int lzc_hold(nvlist_t *holds, int cleanup_fd, nvlist_t **errlist) @@ -434,11 +440,17 @@ lzc_hold(nvlist_t *holds, int cleanup_fd * The snapshots must all be in the same pool. * The value is a nvlist whose keys are the holds to remove. * - * The return value will be 0 if all holds were removed. - * Otherwise the return value will be the errno of a (unspecified) release - * that failed, no holds will be released, and the errlist will have an - * entry for each snapshot that has failed releases (name = snapshot). - * The value in the errlist will be the error code (int32) of a failed release. + * Holds which failed to release because they didn't exist will have an entry + * added to errlist, but will not cause an overall failure. + * + * The return value will be 0 if the nvl holds was empty or all holds that + * existed, were successfully removed. + * + * Otherwise the return value will be the errno of a (unspecified) hold that + * failed to release and no holds will be released. + * + * In all cases the errlist will have an entry for each hold that failed to + * to release. */ int lzc_release(nvlist_t *holds, nvlist_t **errlist) 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 Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Fri Jul 5 04:08:45 2013 (r252764) @@ -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 Steven Hartland. All rights reserved. */ #include @@ -127,6 +128,7 @@ dsl_destroy_snapshot_check(void *arg, dm pair = nvlist_next_nvpair(dsda->dsda_errlist, NULL); if (pair != NULL) return (fnvpair_value_int32(pair)); + return (0); } Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Jul 5 04:08:45 2013 (r252764) @@ -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 Steven Hartland. All rights reserved. */ #include @@ -856,23 +857,34 @@ dsl_pool_clean_tmp_userrefs(dsl_pool_t * zap_cursor_t zc; objset_t *mos = dp->dp_meta_objset; uint64_t zapobj = dp->dp_tmp_userrefs_obj; + nvlist_t *holds; if (zapobj == 0) return; ASSERT(spa_version(dp->dp_spa) >= SPA_VERSION_USERREFS); + holds = fnvlist_alloc(); + for (zap_cursor_init(&zc, mos, zapobj); zap_cursor_retrieve(&zc, &za) == 0; zap_cursor_advance(&zc)) { char *htag; - uint64_t dsobj; + nvlist_t *tags; htag = strchr(za.za_name, '-'); *htag = '\0'; ++htag; - dsobj = strtonum(za.za_name, NULL); - dsl_dataset_user_release_tmp(dp, dsobj, htag); + if (nvlist_lookup_nvlist(holds, za.za_name, &tags) != 0) { + tags = fnvlist_alloc(); + fnvlist_add_boolean(tags, htag); + fnvlist_add_nvlist(holds, za.za_name, tags); + fnvlist_free(tags); + } else { + fnvlist_add_boolean(tags, htag); + } } + dsl_dataset_user_release_tmp(dp, holds); + fnvlist_free(holds); zap_cursor_fini(&zc); } 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 Fri Jul 5 04:02:15 2013 (r252763) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Fri Jul 5 04:08:45 2013 (r252764) @@ -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 Steven Hartland. All rights reserved. */ #include @@ -37,6 +38,7 @@ typedef struct dsl_dataset_user_hold_arg { nvlist_t *dduha_holds; + nvlist_t *dduha_chkholds; nvlist_t *dduha_errlist; minor_t dduha_minor; } dsl_dataset_user_hold_arg_t; @@ -53,25 +55,24 @@ dsl_dataset_user_hold_check_one(dsl_data objset_t *mos = dp->dp_meta_objset; int error = 0; + ASSERT(dsl_pool_config_held(dp)); + if (strlen(htag) > MAXNAMELEN) - return (E2BIG); + return (SET_ERROR(E2BIG)); /* Tempholds have a more restricted length */ if (temphold && strlen(htag) + MAX_TAG_PREFIX_LEN >= MAXNAMELEN) - return (E2BIG); + return (SET_ERROR(E2BIG)); /* tags must be unique (if ds already exists) */ - if (ds != NULL) { - mutex_enter(&ds->ds_lock); - if (ds->ds_phys->ds_userrefs_obj != 0) { - uint64_t value; - error = zap_lookup(mos, ds->ds_phys->ds_userrefs_obj, - htag, 8, 1, &value); - if (error == 0) - error = SET_ERROR(EEXIST); - else if (error == ENOENT) - error = 0; - } - mutex_exit(&ds->ds_lock); + if (ds != NULL && ds->ds_phys->ds_userrefs_obj != 0) { + uint64_t value; + + error = zap_lookup(mos, ds->ds_phys->ds_userrefs_obj, + htag, 8, 1, &value); + if (error == 0) + error = SET_ERROR(EEXIST); + else if (error == ENOENT) + error = 0; } return (error); @@ -82,52 +83,63 @@ dsl_dataset_user_hold_check(void *arg, d { dsl_dataset_user_hold_arg_t *dduha = arg; dsl_pool_t *dp = dmu_tx_pool(tx); - nvpair_t *pair; - int rv = 0; if (spa_version(dp->dp_spa) < SPA_VERSION_USERREFS) return (SET_ERROR(ENOTSUP)); - for (pair = nvlist_next_nvpair(dduha->dduha_holds, NULL); pair != NULL; - pair = nvlist_next_nvpair(dduha->dduha_holds, pair)) { - int error = 0; + if (!dmu_tx_is_syncing(tx)) + return (0); + + for (nvpair_t *pair = nvlist_next_nvpair(dduha->dduha_holds, NULL); + pair != NULL; pair = nvlist_next_nvpair(dduha->dduha_holds, pair)) { dsl_dataset_t *ds; - char *htag; + int error = 0; + char *htag, *name; /* must be a snapshot */ - if (strchr(nvpair_name(pair), '@') == NULL) + name = nvpair_name(pair); + if (strchr(name, '@') == NULL) error = SET_ERROR(EINVAL); if (error == 0) error = nvpair_value_string(pair, &htag); - if (error == 0) { - error = dsl_dataset_hold(dp, - nvpair_name(pair), FTAG, &ds); - } + + if (error == 0) + error = dsl_dataset_hold(dp, name, FTAG, &ds); + if (error == 0) { error = dsl_dataset_user_hold_check_one(ds, htag, dduha->dduha_minor != 0, tx); dsl_dataset_rele(ds, FTAG); } - if (error != 0) { - rv = error; - fnvlist_add_int32(dduha->dduha_errlist, - nvpair_name(pair), error); + if (error == 0) { + fnvlist_add_string(dduha->dduha_chkholds, name, htag); + } else { + /* + * We register ENOENT errors so they can be correctly + * reported if needed, such as when all holds fail. + */ + fnvlist_add_int32(dduha->dduha_errlist, name, error); + if (error != ENOENT) + return (error); } } - return (rv); + + return (0); } -void -dsl_dataset_user_hold_sync_one(dsl_dataset_t *ds, const char *htag, - minor_t minor, uint64_t now, dmu_tx_t *tx) + +static void +dsl_dataset_user_hold_sync_one_impl(nvlist_t *tmpholds, dsl_dataset_t *ds, + const char *htag, minor_t minor, uint64_t now, dmu_tx_t *tx) { dsl_pool_t *dp = ds->ds_dir->dd_pool; objset_t *mos = dp->dp_meta_objset; uint64_t zapobj; - mutex_enter(&ds->ds_lock); + ASSERT(RRW_WRITE_HELD(&dp->dp_config_rwlock)); + if (ds->ds_phys->ds_userrefs_obj == 0) { /* * This is the first user hold for this dataset. Create @@ -140,14 +152,26 @@ dsl_dataset_user_hold_sync_one(dsl_datas zapobj = ds->ds_phys->ds_userrefs_obj; } ds->ds_userrefs++; - mutex_exit(&ds->ds_lock); VERIFY0(zap_add(mos, zapobj, htag, 8, 1, &now, tx)); if (minor != 0) { + char name[MAXNAMELEN]; + nvlist_t *tags; + VERIFY0(dsl_pool_user_hold(dp, ds->ds_object, htag, now, tx)); - dsl_register_onexit_hold_cleanup(ds, htag, minor); + (void) snprintf(name, sizeof (name), "%llx", + (u_longlong_t)ds->ds_object); + + if (nvlist_lookup_nvlist(tmpholds, name, &tags) != 0) { + tags = fnvlist_alloc(); + fnvlist_add_boolean(tags, htag); + fnvlist_add_nvlist(tmpholds, name, tags); + fnvlist_free(tags); + } else { + fnvlist_add_boolean(tags, htag); + } } spa_history_log_internal_ds(ds, "hold", tx, @@ -155,140 +179,292 @@ dsl_dataset_user_hold_sync_one(dsl_datas htag, minor != 0, ds->ds_userrefs); } +typedef struct zfs_hold_cleanup_arg { + char zhca_spaname[MAXNAMELEN]; + uint64_t zhca_spa_load_guid; + nvlist_t *zhca_holds; +} zfs_hold_cleanup_arg_t; + +static void +dsl_dataset_user_release_onexit(void *arg) +{ + zfs_hold_cleanup_arg_t *ca = arg; + spa_t *spa; + int error; + + error = spa_open(ca->zhca_spaname, &spa, FTAG); + if (error != 0) { + zfs_dbgmsg("couldn't release holds on pool=%s " + "because pool is no longer loaded", + ca->zhca_spaname); + return; + } + if (spa_load_guid(spa) != ca->zhca_spa_load_guid) { + zfs_dbgmsg("couldn't release holds on pool=%s " + "because pool is no longer loaded (guid doesn't match)", + ca->zhca_spaname); + spa_close(spa, FTAG); + return; + } + + (void) dsl_dataset_user_release_tmp(spa_get_dsl(spa), ca->zhca_holds); + fnvlist_free(ca->zhca_holds); + kmem_free(ca, sizeof (zfs_hold_cleanup_arg_t)); + spa_close(spa, FTAG); +} + +static void +dsl_onexit_hold_cleanup(spa_t *spa, nvlist_t *holds, minor_t minor) +{ + zfs_hold_cleanup_arg_t *ca; + + if (minor == 0 || nvlist_empty(holds)) { + fnvlist_free(holds); + return; + } + + ASSERT(spa != NULL); + ca = kmem_alloc(sizeof (*ca), KM_SLEEP); + + (void) strlcpy(ca->zhca_spaname, spa_name(spa), + sizeof (ca->zhca_spaname)); + ca->zhca_spa_load_guid = spa_load_guid(spa); + ca->zhca_holds = holds; + VERIFY0(zfs_onexit_add_cb(minor, + dsl_dataset_user_release_onexit, ca, NULL)); +} + +void +dsl_dataset_user_hold_sync_one(dsl_dataset_t *ds, const char *htag, + minor_t minor, uint64_t now, dmu_tx_t *tx) +{ + nvlist_t *tmpholds; + + if (minor != 0) + tmpholds = fnvlist_alloc(); + else + tmpholds = NULL; + dsl_dataset_user_hold_sync_one_impl(tmpholds, ds, htag, minor, now, tx); + dsl_onexit_hold_cleanup(dsl_dataset_get_spa(ds), tmpholds, minor); +} + static void dsl_dataset_user_hold_sync(void *arg, dmu_tx_t *tx) { dsl_dataset_user_hold_arg_t *dduha = arg; dsl_pool_t *dp = dmu_tx_pool(tx); - nvpair_t *pair; + nvlist_t *tmpholds; uint64_t now = gethrestime_sec(); - for (pair = nvlist_next_nvpair(dduha->dduha_holds, NULL); pair != NULL; - pair = nvlist_next_nvpair(dduha->dduha_holds, pair)) { + if (dduha->dduha_minor != 0) + tmpholds = fnvlist_alloc(); + else + tmpholds = NULL; + for (nvpair_t *pair = nvlist_next_nvpair(dduha->dduha_chkholds, NULL); + pair != NULL; + pair = nvlist_next_nvpair(dduha->dduha_chkholds, pair)) { dsl_dataset_t *ds; + VERIFY0(dsl_dataset_hold(dp, nvpair_name(pair), FTAG, &ds)); - dsl_dataset_user_hold_sync_one(ds, fnvpair_value_string(pair), - dduha->dduha_minor, now, tx); + dsl_dataset_user_hold_sync_one_impl(tmpholds, ds, + fnvpair_value_string(pair), dduha->dduha_minor, now, tx); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 04:11:37 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5F105890; Fri, 5 Jul 2013 04:11:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3301F36; Fri, 5 Jul 2013 04:11:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r654Bb2f076747; Fri, 5 Jul 2013 04:11:37 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r654BZID076733; Fri, 5 Jul 2013 04:11:35 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050411.r654BZID076733@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:11:35 +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: r252765 - in stable/8: cddl/contrib/opensolaris/cmd/zfs cddl/contrib/opensolaris/cmd/zhack cddl/contrib/opensolaris/cmd/ztest cddl/contrib/opensolaris/lib/libzfs/common cddl/contrib/ope... 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.14 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, 05 Jul 2013 04:11:37 -0000 Author: delphij Date: Fri Jul 5 04:11:34 2013 New Revision: 252765 URL: http://svnweb.freebsd.org/changeset/base/252765 Log: MFC r251646 + r252219: MFV r251644: Poor ZFS send / receive performance due to snapshot hold / release processing (by smh@) Illumos ZFS issues: 3740 Poor ZFS send / receive performance due to snapshot hold / release processing MFV r252215: Restore a previous behavior before r251646, where when destructing ZFS snapshot, the ioctl would return ENOENT when it hit any of them in the errlist (the new behavior was only return ENOENT when all returns error). Illumos ZFS issues: 3829 fix for 3740 changed behavior of zfs destroy/hold/release ioctl Modified: stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/8/cddl/contrib/opensolaris/cmd/zhack/zhack.c stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/8/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.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_userhold.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.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_main.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Fri Jul 5 04:11:34 2013 (r252765) @@ -28,6 +28,7 @@ * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -5222,8 +5223,7 @@ zfs_do_hold_rele_impl(int argc, char **a continue; } if (holding) { - if (zfs_hold(zhp, delim+1, tag, recursive, - B_FALSE, -1) != 0) + if (zfs_hold(zhp, delim+1, tag, recursive, -1) != 0) ++errors; } else { if (zfs_release(zhp, delim+1, tag, recursive) != 0) Modified: stable/8/cddl/contrib/opensolaris/cmd/zhack/zhack.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zhack/zhack.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/cddl/contrib/opensolaris/cmd/zhack/zhack.c Fri Jul 5 04:11:34 2013 (r252765) @@ -21,6 +21,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ /* @@ -153,7 +154,7 @@ import_pool(const char *target, boolean_ g_importargs.poolname = g_pool; pools = zpool_search_import(g_zfs, &g_importargs); - if (pools == NULL || nvlist_next_nvpair(pools, NULL) == NULL) { + if (nvlist_empty(pools)) { if (!g_importargs.can_be_active) { g_importargs.can_be_active = B_TRUE; if (zpool_search_import(g_zfs, &g_importargs) != NULL || Modified: stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c Fri Jul 5 04:11:34 2013 (r252765) @@ -23,6 +23,7 @@ * Copyright (c) 2012 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. */ /* @@ -4713,7 +4714,7 @@ ztest_dmu_snapshot_hold(ztest_ds_t *zd, error = user_release_one(fullname, tag); if (error) - fatal(0, "user_release_one(%s)", fullname, tag); + fatal(0, "user_release_one(%s, %s) = %d", fullname, tag, error); VERIFY3U(dmu_objset_hold(fullname, FTAG, &origin), ==, ENOENT); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h Fri Jul 5 04:11:34 2013 (r252765) @@ -27,6 +27,7 @@ * Copyright (c) 2012 by Delphix. All rights reserved. * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #ifndef _LIBZFS_H @@ -611,7 +612,8 @@ extern int zfs_send(zfs_handle_t *, cons extern int zfs_promote(zfs_handle_t *); extern int zfs_hold(zfs_handle_t *, const char *, const char *, - boolean_t, boolean_t, int); + boolean_t, int); +extern int zfs_hold_nvl(zfs_handle_t *, int, nvlist_t *); extern int zfs_release(zfs_handle_t *, const char *, const char *, boolean_t); extern int zfs_get_holds(zfs_handle_t *, nvlist_t **); extern uint64_t zvol_volsize_to_reservation(uint64_t, nvlist_t *); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Fri Jul 5 04:11:34 2013 (r252765) @@ -21,12 +21,13 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012 Nexenta Systems, Inc. All rights reserved. - * Copyright (c) 2011 by Delphix. All rights reserved. + * Copyright (c) 2013 by Delphix. All rights reserved. * Copyright (c) 2012 DEY Storage Systems, Inc. All rights reserved. + * Copyright 2012 Nexenta Systems, Inc. All rights reserved. * Copyright (c) 2011-2012 Pawel Jakub Dawidek . * All rights reserved. * Copyright (c) 2012 Martin Matuska . All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -3158,18 +3159,14 @@ static int zfs_check_snap_cb(zfs_handle_t *zhp, void *arg) { struct destroydata *dd = arg; - zfs_handle_t *szhp; char name[ZFS_MAXNAMELEN]; int rv = 0; (void) snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name, dd->snapname); - szhp = make_dataset_handle(zhp->zfs_hdl, name); - if (szhp) { + if (lzc_exists(name)) verify(nvlist_add_boolean(dd->nvl, name) == 0); - zfs_close(szhp); - } rv = zfs_iter_filesystems(zhp, zfs_check_snap_cb, dd); zfs_close(zhp); @@ -3189,7 +3186,7 @@ zfs_destroy_snaps(zfs_handle_t *zhp, cha verify(nvlist_alloc(&dd.nvl, NV_UNIQUE_NAME, 0) == 0); (void) zfs_check_snap_cb(zfs_handle_dup(zhp), &dd); - if (nvlist_next_nvpair(dd.nvl, NULL) == NULL) { + if (nvlist_empty(dd.nvl)) { ret = zfs_standard_error_fmt(zhp->zfs_hdl, ENOENT, dgettext(TEXT_DOMAIN, "cannot destroy '%s@%s'"), zhp->zfs_name, snapname); @@ -3214,7 +3211,7 @@ zfs_destroy_snaps_nvl(libzfs_handle_t *h if (ret == 0) return (0); - if (nvlist_next_nvpair(errlist, NULL) == NULL) { + if (nvlist_empty(errlist)) { char errbuf[1024]; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot destroy snapshots")); @@ -4162,24 +4159,21 @@ struct holdarg { const char *snapname; const char *tag; boolean_t recursive; + int error; }; static int zfs_hold_one(zfs_handle_t *zhp, void *arg) { struct holdarg *ha = arg; - zfs_handle_t *szhp; char name[ZFS_MAXNAMELEN]; int rv = 0; (void) snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name, ha->snapname); - szhp = make_dataset_handle(zhp->zfs_hdl, name); - if (szhp) { + if (lzc_exists(name)) fnvlist_add_string(ha->nvl, name, ha->tag); - zfs_close(szhp); - } if (ha->recursive) rv = zfs_iter_filesystems(zhp, zfs_hold_one, ha); @@ -4189,14 +4183,10 @@ zfs_hold_one(zfs_handle_t *zhp, void *ar int zfs_hold(zfs_handle_t *zhp, const char *snapname, const char *tag, - boolean_t recursive, boolean_t enoent_ok, int cleanup_fd) + boolean_t recursive, int cleanup_fd) { int ret; struct holdarg ha; - nvlist_t *errors; - libzfs_handle_t *hdl = zhp->zfs_hdl; - char errbuf[1024]; - nvpair_t *elem; ha.nvl = fnvlist_alloc(); ha.snapname = snapname; @@ -4204,26 +4194,44 @@ zfs_hold(zfs_handle_t *zhp, const char * ha.recursive = recursive; (void) zfs_hold_one(zfs_handle_dup(zhp), &ha); - if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { + if (nvlist_empty(ha.nvl)) { + char errbuf[1024]; + fnvlist_free(ha.nvl); ret = ENOENT; - if (!enoent_ok) { - (void) snprintf(errbuf, sizeof (errbuf), - dgettext(TEXT_DOMAIN, - "cannot hold snapshot '%s@%s'"), - zhp->zfs_name, snapname); - (void) zfs_standard_error(hdl, ret, errbuf); - } + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, + "cannot hold snapshot '%s@%s'"), + zhp->zfs_name, snapname); + (void) zfs_standard_error(zhp->zfs_hdl, ret, errbuf); return (ret); } - ret = lzc_hold(ha.nvl, cleanup_fd, &errors); + ret = zfs_hold_nvl(zhp, cleanup_fd, ha.nvl); fnvlist_free(ha.nvl); - if (ret == 0) + return (ret); +} + +int +zfs_hold_nvl(zfs_handle_t *zhp, int cleanup_fd, nvlist_t *holds) +{ + int ret; + nvlist_t *errors; + libzfs_handle_t *hdl = zhp->zfs_hdl; + char errbuf[1024]; + nvpair_t *elem; + + errors = NULL; + ret = lzc_hold(holds, cleanup_fd, &errors); + + if (ret == 0) { + /* There may be errors even in the success case. */ + fnvlist_free(errors); return (0); + } - if (nvlist_next_nvpair(errors, NULL) == NULL) { + if (nvlist_empty(errors)) { /* no hold-specific errors */ (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot hold")); @@ -4263,10 +4271,6 @@ zfs_hold(zfs_handle_t *zhp, const char * case EEXIST: (void) zfs_error(hdl, EZFS_REFTAG_HOLD, errbuf); break; - case ENOENT: - if (enoent_ok) - return (ENOENT); - /* FALLTHROUGH */ default: (void) zfs_standard_error(hdl, fnvpair_value_int32(elem), errbuf); @@ -4277,30 +4281,26 @@ zfs_hold(zfs_handle_t *zhp, const char * return (ret); } -struct releasearg { - nvlist_t *nvl; - const char *snapname; - const char *tag; - boolean_t recursive; -}; - static int zfs_release_one(zfs_handle_t *zhp, void *arg) { struct holdarg *ha = arg; - zfs_handle_t *szhp; char name[ZFS_MAXNAMELEN]; int rv = 0; + nvlist_t *existing_holds; (void) snprintf(name, sizeof (name), "%s@%s", zhp->zfs_name, ha->snapname); - szhp = make_dataset_handle(zhp->zfs_hdl, name); - if (szhp) { - nvlist_t *holds = fnvlist_alloc(); - fnvlist_add_boolean(holds, ha->tag); - fnvlist_add_nvlist(ha->nvl, name, holds); - zfs_close(szhp); + if (lzc_get_holds(name, &existing_holds) != 0) { + ha->error = ENOENT; + } else if (!nvlist_exists(existing_holds, ha->tag)) { + ha->error = ESRCH; + } else { + nvlist_t *torelease = fnvlist_alloc(); + fnvlist_add_boolean(torelease, ha->tag); + fnvlist_add_nvlist(ha->nvl, name, torelease); + fnvlist_free(torelease); } if (ha->recursive) @@ -4315,7 +4315,7 @@ zfs_release(zfs_handle_t *zhp, const cha { int ret; struct holdarg ha; - nvlist_t *errors; + nvlist_t *errors = NULL; nvpair_t *elem; libzfs_handle_t *hdl = zhp->zfs_hdl; char errbuf[1024]; @@ -4324,26 +4324,34 @@ zfs_release(zfs_handle_t *zhp, const cha ha.snapname = snapname; ha.tag = tag; ha.recursive = recursive; + ha.error = 0; (void) zfs_release_one(zfs_handle_dup(zhp), &ha); - if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { + if (nvlist_empty(ha.nvl)) { fnvlist_free(ha.nvl); - ret = ENOENT; + ret = ha.error; (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot release hold from snapshot '%s@%s'"), zhp->zfs_name, snapname); - (void) zfs_standard_error(hdl, ret, errbuf); + if (ret == ESRCH) { + (void) zfs_error(hdl, EZFS_REFTAG_RELE, errbuf); + } else { + (void) zfs_standard_error(hdl, ret, errbuf); + } return (ret); } ret = lzc_release(ha.nvl, &errors); fnvlist_free(ha.nvl); - if (ret == 0) + if (ret == 0) { + /* There may be errors even in the success case. */ + fnvlist_free(errors); return (0); + } - if (nvlist_next_nvpair(errors, NULL) == NULL) { + if (nvlist_empty(errors)) { /* no hold-specific errors */ (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN, "cannot release")); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c Fri Jul 5 04:11:34 2013 (r252765) @@ -25,6 +25,7 @@ * Copyright (c) 2012, Joyent, Inc. All rights reserved. * Copyright (c) 2012 Pawel Jakub Dawidek . * All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ #include @@ -802,6 +803,7 @@ typedef struct send_dump_data { int outfd; boolean_t err; nvlist_t *fss; + nvlist_t *snapholds; avl_tree_t *fsavl; snapfilter_cb_t *filter_cb; void *filter_cb_arg; @@ -952,41 +954,19 @@ dump_ioctl(zfs_handle_t *zhp, const char return (0); } -static int -hold_for_send(zfs_handle_t *zhp, send_dump_data_t *sdd) +static void +gather_holds(zfs_handle_t *zhp, send_dump_data_t *sdd) { - zfs_handle_t *pzhp; - int error = 0; - char *thissnap; - assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT); - if (sdd->dryrun) - return (0); - /* - * zfs_send() only opens a cleanup_fd for sends that need it, + * zfs_send() only sets snapholds for sends that need them, * e.g. replication and doall. */ - if (sdd->cleanup_fd == -1) - return (0); - - thissnap = strchr(zhp->zfs_name, '@') + 1; - *(thissnap - 1) = '\0'; - pzhp = zfs_open(zhp->zfs_hdl, zhp->zfs_name, ZFS_TYPE_DATASET); - *(thissnap - 1) = '@'; - - /* - * It's OK if the parent no longer exists. The send code will - * handle that error. - */ - if (pzhp) { - error = zfs_hold(pzhp, thissnap, sdd->holdtag, - B_FALSE, B_TRUE, sdd->cleanup_fd); - zfs_close(pzhp); - } + if (sdd->snapholds == NULL) + return; - return (error); + fnvlist_add_string(sdd->snapholds, zhp->zfs_name, sdd->holdtag); } static void * @@ -1042,28 +1022,23 @@ dump_snapshot(zfs_handle_t *zhp, void *a send_dump_data_t *sdd = arg; progress_arg_t pa = { 0 }; pthread_t tid; - char *thissnap; int err; boolean_t isfromsnap, istosnap, fromorigin; boolean_t exclude = B_FALSE; + err = 0; thissnap = strchr(zhp->zfs_name, '@') + 1; isfromsnap = (sdd->fromsnap != NULL && strcmp(sdd->fromsnap, thissnap) == 0); if (!sdd->seenfrom && isfromsnap) { - err = hold_for_send(zhp, sdd); - if (err == 0) { - sdd->seenfrom = B_TRUE; - (void) strcpy(sdd->prevsnap, thissnap); - sdd->prevsnap_obj = zfs_prop_get_int(zhp, - ZFS_PROP_OBJSETID); - } else if (err == ENOENT) { - err = 0; - } + gather_holds(zhp, sdd); + sdd->seenfrom = B_TRUE; + (void) strcpy(sdd->prevsnap, thissnap); + sdd->prevsnap_obj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID); zfs_close(zhp); - return (err); + return (0); } if (sdd->seento || !sdd->seenfrom) { @@ -1114,14 +1089,7 @@ dump_snapshot(zfs_handle_t *zhp, void *a return (0); } - err = hold_for_send(zhp, sdd); - if (err) { - if (err == ENOENT) - err = 0; - zfs_close(zhp); - return (err); - } - + gather_holds(zhp, sdd); fromorigin = sdd->prevsnap[0] == '\0' && (sdd->fromorigin || sdd->replicate); @@ -1389,7 +1357,7 @@ zfs_send(zfs_handle_t *zhp, const char * avl_tree_t *fsavl = NULL; static uint64_t holdseq; int spa_version; - pthread_t tid; + pthread_t tid = 0; int pipefd[2]; dedup_arg_t dda = { 0 }; int featureflags = 0; @@ -1462,11 +1430,8 @@ zfs_send(zfs_handle_t *zhp, const char * *debugnvp = hdrnv; else nvlist_free(hdrnv); - if (err) { - fsavl_destroy(fsavl); - nvlist_free(fss); + if (err) goto stderr_out; - } } if (!flags->dryrun) { @@ -1490,8 +1455,6 @@ zfs_send(zfs_handle_t *zhp, const char * } free(packbuf); if (err == -1) { - fsavl_destroy(fsavl); - nvlist_free(fss); err = errno; goto stderr_out; } @@ -1502,8 +1465,6 @@ zfs_send(zfs_handle_t *zhp, const char * drr.drr_u.drr_end.drr_checksum = zc; err = write(outfd, &drr, sizeof (drr)); if (err == -1) { - fsavl_destroy(fsavl); - nvlist_free(fss); err = errno; goto stderr_out; } @@ -1515,7 +1476,7 @@ zfs_send(zfs_handle_t *zhp, const char * /* dump each stream */ sdd.fromsnap = fromsnap; sdd.tosnap = tosnap; - if (flags->dedup) + if (tid != 0) sdd.outfd = pipefd[0]; else sdd.outfd = outfd; @@ -1552,36 +1513,71 @@ zfs_send(zfs_handle_t *zhp, const char * err = errno; goto stderr_out; } + sdd.snapholds = fnvlist_alloc(); } else { sdd.cleanup_fd = -1; + sdd.snapholds = NULL; } - if (flags->verbose) { + if (flags->verbose || sdd.snapholds != NULL) { /* * Do a verbose no-op dry run to get all the verbose output - * before generating any data. Then do a non-verbose real - * run to generate the streams. + * or to gather snapshot hold's before generating any data, + * then do a non-verbose real run to generate the streams. */ sdd.dryrun = B_TRUE; err = dump_filesystems(zhp, &sdd); - sdd.dryrun = flags->dryrun; - sdd.verbose = B_FALSE; - if (flags->parsable) { - (void) fprintf(stderr, "size\t%llu\n", - (longlong_t)sdd.size); - } else { - char buf[16]; - zfs_nicenum(sdd.size, buf, sizeof (buf)); - (void) fprintf(stderr, dgettext(TEXT_DOMAIN, - "total estimated size is %s\n"), buf); + + if (err != 0) + goto stderr_out; + + if (flags->verbose) { + if (flags->parsable) { + (void) fprintf(stderr, "size\t%llu\n", + (longlong_t)sdd.size); + } else { + char buf[16]; + zfs_nicenum(sdd.size, buf, sizeof (buf)); + (void) fprintf(stderr, dgettext(TEXT_DOMAIN, + "total estimated size is %s\n"), buf); + } + } + + /* Ensure no snaps found is treated as an error. */ + if (!sdd.seento) { + err = ENOENT; + goto err_out; } + + /* Skip the second run if dryrun was requested. */ + if (flags->dryrun) + goto err_out; + + if (sdd.snapholds != NULL) { + err = zfs_hold_nvl(zhp, sdd.cleanup_fd, sdd.snapholds); + if (err != 0) + goto stderr_out; + + fnvlist_free(sdd.snapholds); + sdd.snapholds = NULL; + } + + sdd.dryrun = B_FALSE; + sdd.verbose = B_FALSE; } + err = dump_filesystems(zhp, &sdd); fsavl_destroy(fsavl); nvlist_free(fss); - if (flags->dedup) { - (void) close(pipefd[0]); + /* Ensure no snaps found is treated as an error. */ + if (err == 0 && !sdd.seento) + err = ENOENT; + + if (tid != 0) { + if (err != 0) + (void) pthread_cancel(tid); (void) pthread_join(tid, NULL); + (void) close(pipefd[0]); } if (sdd.cleanup_fd != -1) { @@ -1609,9 +1605,13 @@ zfs_send(zfs_handle_t *zhp, const char * stderr_out: err = zfs_standard_error(zhp->zfs_hdl, err, errbuf); err_out: + fsavl_destroy(fsavl); + nvlist_free(fss); + fnvlist_free(sdd.snapholds); + if (sdd.cleanup_fd != -1) VERIFY(0 == close(sdd.cleanup_fd)); - if (flags->dedup) { + if (tid != 0) { (void) pthread_cancel(tid); (void) pthread_join(tid, NULL); (void) close(pipefd[0]); Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs_core/common/libzfs_core.c Fri Jul 5 04:11:34 2013 (r252765) @@ -21,6 +21,7 @@ /* * Copyright (c) 2012 by Delphix. All rights reserved. + * Copyright (c) 2013 Steven Hartland. All rights reserved. */ /* @@ -333,7 +334,6 @@ lzc_destroy_snaps(nvlist_t *snaps, boole nvlist_free(args); return (error); - } int @@ -393,11 +393,17 @@ lzc_exists(const char *dataset) * uncleanly, the holds will be released when the pool is next opened * or imported. * - * The return value will be 0 if all holds were created. Otherwise the return - * value will be the errno of a (unspecified) hold that failed, no holds will - * be created, and the errlist will have an entry for each hold that - * failed (name = snapshot). The value in the errlist will be the error - * code (int32). + * Holds for snapshots which don't exist will be skipped and have an entry + * added to errlist, but will not cause an overall failure. + * + * The return value will be 0 if all holds, for snapshots that existed, + * were succesfully created. + * + * Otherwise the return value will be the errno of a (unspecified) hold that + * failed and no holds will be created. + * + * In all cases the errlist will have an entry for each hold that failed + * (name = snapshot), with its value being the error code (int32). */ int lzc_hold(nvlist_t *holds, int cleanup_fd, nvlist_t **errlist) @@ -434,11 +440,17 @@ lzc_hold(nvlist_t *holds, int cleanup_fd * The snapshots must all be in the same pool. * The value is a nvlist whose keys are the holds to remove. * - * The return value will be 0 if all holds were removed. - * Otherwise the return value will be the errno of a (unspecified) release - * that failed, no holds will be released, and the errlist will have an - * entry for each snapshot that has failed releases (name = snapshot). - * The value in the errlist will be the error code (int32) of a failed release. + * Holds which failed to release because they didn't exist will have an entry + * added to errlist, but will not cause an overall failure. + * + * The return value will be 0 if the nvl holds was empty or all holds that + * existed, were successfully removed. + * + * Otherwise the return value will be the errno of a (unspecified) hold that + * failed to release and no holds will be released. + * + * In all cases the errlist will have an entry for each hold that failed to + * to release. */ int lzc_release(nvlist_t *holds, nvlist_t **errlist) 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 Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_destroy.c Fri Jul 5 04:11:34 2013 (r252765) @@ -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 Steven Hartland. All rights reserved. */ #include @@ -127,6 +128,7 @@ dsl_destroy_snapshot_check(void *arg, dm pair = nvlist_next_nvpair(dsda->dsda_errlist, NULL); if (pair != NULL) return (fnvpair_value_int32(pair)); + return (0); } Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c Fri Jul 5 04:11:34 2013 (r252765) @@ -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 Steven Hartland. All rights reserved. */ #include @@ -856,23 +857,34 @@ dsl_pool_clean_tmp_userrefs(dsl_pool_t * zap_cursor_t zc; objset_t *mos = dp->dp_meta_objset; uint64_t zapobj = dp->dp_tmp_userrefs_obj; + nvlist_t *holds; if (zapobj == 0) return; ASSERT(spa_version(dp->dp_spa) >= SPA_VERSION_USERREFS); + holds = fnvlist_alloc(); + for (zap_cursor_init(&zc, mos, zapobj); zap_cursor_retrieve(&zc, &za) == 0; zap_cursor_advance(&zc)) { char *htag; - uint64_t dsobj; + nvlist_t *tags; htag = strchr(za.za_name, '-'); *htag = '\0'; ++htag; - dsobj = strtonum(za.za_name, NULL); - dsl_dataset_user_release_tmp(dp, dsobj, htag); + if (nvlist_lookup_nvlist(holds, za.za_name, &tags) != 0) { + tags = fnvlist_alloc(); + fnvlist_add_boolean(tags, htag); + fnvlist_add_nvlist(holds, za.za_name, tags); + fnvlist_free(tags); + } else { + fnvlist_add_boolean(tags, htag); + } } + dsl_dataset_user_release_tmp(dp, holds); + fnvlist_free(holds); zap_cursor_fini(&zc); } 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 Fri Jul 5 04:08:45 2013 (r252764) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c Fri Jul 5 04:11:34 2013 (r252765) @@ -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 Steven Hartland. All rights reserved. */ #include @@ -37,6 +38,7 @@ typedef struct dsl_dataset_user_hold_arg { nvlist_t *dduha_holds; + nvlist_t *dduha_chkholds; nvlist_t *dduha_errlist; minor_t dduha_minor; } dsl_dataset_user_hold_arg_t; @@ -53,25 +55,24 @@ dsl_dataset_user_hold_check_one(dsl_data objset_t *mos = dp->dp_meta_objset; int error = 0; + ASSERT(dsl_pool_config_held(dp)); + if (strlen(htag) > MAXNAMELEN) - return (E2BIG); + return (SET_ERROR(E2BIG)); /* Tempholds have a more restricted length */ if (temphold && strlen(htag) + MAX_TAG_PREFIX_LEN >= MAXNAMELEN) - return (E2BIG); + return (SET_ERROR(E2BIG)); /* tags must be unique (if ds already exists) */ - if (ds != NULL) { - mutex_enter(&ds->ds_lock); - if (ds->ds_phys->ds_userrefs_obj != 0) { - uint64_t value; - error = zap_lookup(mos, ds->ds_phys->ds_userrefs_obj, - htag, 8, 1, &value); - if (error == 0) - error = SET_ERROR(EEXIST); - else if (error == ENOENT) - error = 0; - } - mutex_exit(&ds->ds_lock); + if (ds != NULL && ds->ds_phys->ds_userrefs_obj != 0) { + uint64_t value; + + error = zap_lookup(mos, ds->ds_phys->ds_userrefs_obj, + htag, 8, 1, &value); + if (error == 0) + error = SET_ERROR(EEXIST); + else if (error == ENOENT) + error = 0; } return (error); @@ -82,52 +83,63 @@ dsl_dataset_user_hold_check(void *arg, d { dsl_dataset_user_hold_arg_t *dduha = arg; dsl_pool_t *dp = dmu_tx_pool(tx); - nvpair_t *pair; - int rv = 0; if (spa_version(dp->dp_spa) < SPA_VERSION_USERREFS) return (SET_ERROR(ENOTSUP)); - for (pair = nvlist_next_nvpair(dduha->dduha_holds, NULL); pair != NULL; - pair = nvlist_next_nvpair(dduha->dduha_holds, pair)) { - int error = 0; + if (!dmu_tx_is_syncing(tx)) + return (0); + + for (nvpair_t *pair = nvlist_next_nvpair(dduha->dduha_holds, NULL); + pair != NULL; pair = nvlist_next_nvpair(dduha->dduha_holds, pair)) { dsl_dataset_t *ds; - char *htag; + int error = 0; + char *htag, *name; /* must be a snapshot */ - if (strchr(nvpair_name(pair), '@') == NULL) + name = nvpair_name(pair); + if (strchr(name, '@') == NULL) error = SET_ERROR(EINVAL); if (error == 0) error = nvpair_value_string(pair, &htag); - if (error == 0) { - error = dsl_dataset_hold(dp, - nvpair_name(pair), FTAG, &ds); - } + + if (error == 0) + error = dsl_dataset_hold(dp, name, FTAG, &ds); + if (error == 0) { error = dsl_dataset_user_hold_check_one(ds, htag, dduha->dduha_minor != 0, tx); dsl_dataset_rele(ds, FTAG); } - if (error != 0) { - rv = error; - fnvlist_add_int32(dduha->dduha_errlist, - nvpair_name(pair), error); + if (error == 0) { + fnvlist_add_string(dduha->dduha_chkholds, name, htag); + } else { + /* + * We register ENOENT errors so they can be correctly + * reported if needed, such as when all holds fail. + */ + fnvlist_add_int32(dduha->dduha_errlist, name, error); + if (error != ENOENT) + return (error); } } - return (rv); + + return (0); } -void -dsl_dataset_user_hold_sync_one(dsl_dataset_t *ds, const char *htag, - minor_t minor, uint64_t now, dmu_tx_t *tx) + +static void +dsl_dataset_user_hold_sync_one_impl(nvlist_t *tmpholds, dsl_dataset_t *ds, + const char *htag, minor_t minor, uint64_t now, dmu_tx_t *tx) { dsl_pool_t *dp = ds->ds_dir->dd_pool; objset_t *mos = dp->dp_meta_objset; uint64_t zapobj; - mutex_enter(&ds->ds_lock); + ASSERT(RRW_WRITE_HELD(&dp->dp_config_rwlock)); + if (ds->ds_phys->ds_userrefs_obj == 0) { /* * This is the first user hold for this dataset. Create @@ -140,14 +152,26 @@ dsl_dataset_user_hold_sync_one(dsl_datas zapobj = ds->ds_phys->ds_userrefs_obj; } ds->ds_userrefs++; - mutex_exit(&ds->ds_lock); VERIFY0(zap_add(mos, zapobj, htag, 8, 1, &now, tx)); if (minor != 0) { + char name[MAXNAMELEN]; + nvlist_t *tags; + VERIFY0(dsl_pool_user_hold(dp, ds->ds_object, htag, now, tx)); - dsl_register_onexit_hold_cleanup(ds, htag, minor); + (void) snprintf(name, sizeof (name), "%llx", + (u_longlong_t)ds->ds_object); + + if (nvlist_lookup_nvlist(tmpholds, name, &tags) != 0) { + tags = fnvlist_alloc(); + fnvlist_add_boolean(tags, htag); + fnvlist_add_nvlist(tmpholds, name, tags); + fnvlist_free(tags); + } else { + fnvlist_add_boolean(tags, htag); + } } spa_history_log_internal_ds(ds, "hold", tx, @@ -155,140 +179,292 @@ dsl_dataset_user_hold_sync_one(dsl_datas htag, minor != 0, ds->ds_userrefs); } +typedef struct zfs_hold_cleanup_arg { + char zhca_spaname[MAXNAMELEN]; + uint64_t zhca_spa_load_guid; + nvlist_t *zhca_holds; +} zfs_hold_cleanup_arg_t; + +static void +dsl_dataset_user_release_onexit(void *arg) +{ + zfs_hold_cleanup_arg_t *ca = arg; + spa_t *spa; + int error; + + error = spa_open(ca->zhca_spaname, &spa, FTAG); + if (error != 0) { + zfs_dbgmsg("couldn't release holds on pool=%s " + "because pool is no longer loaded", + ca->zhca_spaname); + return; + } + if (spa_load_guid(spa) != ca->zhca_spa_load_guid) { + zfs_dbgmsg("couldn't release holds on pool=%s " + "because pool is no longer loaded (guid doesn't match)", + ca->zhca_spaname); + spa_close(spa, FTAG); + return; + } + + (void) dsl_dataset_user_release_tmp(spa_get_dsl(spa), ca->zhca_holds); + fnvlist_free(ca->zhca_holds); + kmem_free(ca, sizeof (zfs_hold_cleanup_arg_t)); + spa_close(spa, FTAG); +} + +static void +dsl_onexit_hold_cleanup(spa_t *spa, nvlist_t *holds, minor_t minor) +{ + zfs_hold_cleanup_arg_t *ca; + + if (minor == 0 || nvlist_empty(holds)) { + fnvlist_free(holds); + return; + } + + ASSERT(spa != NULL); + ca = kmem_alloc(sizeof (*ca), KM_SLEEP); + + (void) strlcpy(ca->zhca_spaname, spa_name(spa), + sizeof (ca->zhca_spaname)); + ca->zhca_spa_load_guid = spa_load_guid(spa); + ca->zhca_holds = holds; + VERIFY0(zfs_onexit_add_cb(minor, + dsl_dataset_user_release_onexit, ca, NULL)); +} + +void +dsl_dataset_user_hold_sync_one(dsl_dataset_t *ds, const char *htag, + minor_t minor, uint64_t now, dmu_tx_t *tx) +{ + nvlist_t *tmpholds; + + if (minor != 0) + tmpholds = fnvlist_alloc(); + else + tmpholds = NULL; + dsl_dataset_user_hold_sync_one_impl(tmpholds, ds, htag, minor, now, tx); + dsl_onexit_hold_cleanup(dsl_dataset_get_spa(ds), tmpholds, minor); +} + static void dsl_dataset_user_hold_sync(void *arg, dmu_tx_t *tx) { dsl_dataset_user_hold_arg_t *dduha = arg; dsl_pool_t *dp = dmu_tx_pool(tx); - nvpair_t *pair; + nvlist_t *tmpholds; uint64_t now = gethrestime_sec(); - for (pair = nvlist_next_nvpair(dduha->dduha_holds, NULL); pair != NULL; - pair = nvlist_next_nvpair(dduha->dduha_holds, pair)) { + if (dduha->dduha_minor != 0) + tmpholds = fnvlist_alloc(); + else + tmpholds = NULL; + for (nvpair_t *pair = nvlist_next_nvpair(dduha->dduha_chkholds, NULL); + pair != NULL; + pair = nvlist_next_nvpair(dduha->dduha_chkholds, pair)) { dsl_dataset_t *ds; + VERIFY0(dsl_dataset_hold(dp, nvpair_name(pair), FTAG, &ds)); - dsl_dataset_user_hold_sync_one(ds, fnvpair_value_string(pair), - dduha->dduha_minor, now, tx); + dsl_dataset_user_hold_sync_one_impl(tmpholds, ds, + fnvpair_value_string(pair), dduha->dduha_minor, now, tx); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 04:16:03 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BE110A2D; Fri, 5 Jul 2013 04:16:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AEE551F67; Fri, 5 Jul 2013 04:16:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r654G3iR077321; Fri, 5 Jul 2013 04:16:03 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r654G3BX077320; Fri, 5 Jul 2013 04:16:03 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050416.r654G3BX077320@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:16:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252766 - stable/9/cddl/contrib/opensolaris/lib/libzfs/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.14 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, 05 Jul 2013 04:16:03 -0000 Author: delphij Date: Fri Jul 5 04:16:03 2013 New Revision: 252766 URL: http://svnweb.freebsd.org/changeset/base/252766 Log: MFC r252218: Diff reduction against Illumos, no real change to code itself. This marks vendor branch revision 252213 as merged, the actual code was committed in r245479. Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Directory Properties: stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Fri Jul 5 04:11:34 2013 (r252765) +++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Fri Jul 5 04:16:03 2013 (r252766) @@ -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 Steven Hartland. All rights reserved. */ /* From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 04:16:53 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6B67EB65; Fri, 5 Jul 2013 04:16:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D63B1F6F; Fri, 5 Jul 2013 04:16:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r654GrB1077439; Fri, 5 Jul 2013 04:16:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r654GrL1077438; Fri, 5 Jul 2013 04:16:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050416.r654GrL1077438@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:16:53 +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: r252767 - stable/8/cddl/contrib/opensolaris/lib/libzfs/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.14 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, 05 Jul 2013 04:16:53 -0000 Author: delphij Date: Fri Jul 5 04:16:52 2013 New Revision: 252767 URL: http://svnweb.freebsd.org/changeset/base/252767 Log: MFC r252218: Diff reduction against Illumos, no real change to code itself. This marks vendor branch revision 252213 as merged, the actual code was committed in r245479. Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Directory Properties: stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/lib/libzfs/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Fri Jul 5 04:16:03 2013 (r252766) +++ stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c Fri Jul 5 04:16:52 2013 (r252767) @@ -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 Steven Hartland. All rights reserved. */ /* From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 04:22:40 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B3AC3CDD; Fri, 5 Jul 2013 04:22:40 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A68641F9A; Fri, 5 Jul 2013 04:22:40 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r654Me9Z079804; Fri, 5 Jul 2013 04:22:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r654MeGJ079803; Fri, 5 Jul 2013 04:22:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050422.r654MeGJ079803@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:22: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: r252768 - stable/9/etc 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.14 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, 05 Jul 2013 04:22:40 -0000 Author: delphij Date: Fri Jul 5 04:22:40 2013 New Revision: 252768 URL: http://svnweb.freebsd.org/changeset/base/252768 Log: MFC r252360: Don't attempt to do DHCP on certain interfaces, similar to what's done for ipv6_autoconfif() in r212577. Modified: stable/9/etc/network.subr Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/network.subr ============================================================================== --- stable/9/etc/network.subr Fri Jul 5 04:16:52 2013 (r252767) +++ stable/9/etc/network.subr Fri Jul 5 04:22:40 2013 (r252768) @@ -306,6 +306,15 @@ dhcpif() local _tmpargs _arg _tmpargs=`_ifconfig_getargs $1` + case $1 in + lo[0-9]*|\ + stf[0-9]*|\ + faith[0-9]*|\ + lp[0-9]*|\ + sl[0-9]*) + return 1 + ;; + esac if noafif $1; then return 1 fi @@ -491,7 +500,7 @@ ipv6_autoconfif() _if=$1 case $_if in - lo0|\ + lo[0-9]*|\ stf[0-9]*|\ faith[0-9]*|\ lp[0-9]*|\ From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 04:24:22 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 607DDE20; Fri, 5 Jul 2013 04:24:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5310B1FAA; Fri, 5 Jul 2013 04:24:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r654OMOH080066; Fri, 5 Jul 2013 04:24:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r654OMKj080065; Fri, 5 Jul 2013 04:24:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307050424.r654OMKj080065@svn.freebsd.org> From: Xin LI Date: Fri, 5 Jul 2013 04:24: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: r252769 - stable/9/sbin/mdconfig 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.14 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, 05 Jul 2013 04:24:22 -0000 Author: delphij Date: Fri Jul 5 04:24:21 2013 New Revision: 252769 URL: http://svnweb.freebsd.org/changeset/base/252769 Log: MFC r252523: When listing with -f, skip all memory disks that are not vnode-backed. Noticed by: kevlo Modified: stable/9/sbin/mdconfig/mdconfig.c Directory Properties: stable/9/sbin/mdconfig/ (props changed) Modified: stable/9/sbin/mdconfig/mdconfig.c ============================================================================== --- stable/9/sbin/mdconfig/mdconfig.c Fri Jul 5 04:22:40 2013 (r252768) +++ stable/9/sbin/mdconfig/mdconfig.c Fri Jul 5 04:24:21 2013 (r252769) @@ -429,7 +429,8 @@ md_list(const char *units, int opt, cons continue; else ffound = 1; - } + } else if (fflag != NULL) + continue; if (nflag && strncmp(pp->lg_name, MD_NAME, 2) == 0) printf("%s", pp->lg_name + 2); else From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 08:16:41 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 66AEE373; Fri, 5 Jul 2013 08:16:41 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 58C131A00; Fri, 5 Jul 2013 08:16:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r658GfmD047981; Fri, 5 Jul 2013 08:16:41 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r658GeNL047974; Fri, 5 Jul 2013 08:16:40 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201307050816.r658GeNL047974@svn.freebsd.org> From: Dmitry Morozovsky Date: Fri, 5 Jul 2013 08:16: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: r252776 - in stable/9: . sbin/hastctl 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.14 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, 05 Jul 2013 08:16:41 -0000 Author: marck (doc committer) Date: Fri Jul 5 08:16:40 2013 New Revision: 252776 URL: http://svnweb.freebsd.org/changeset/base/252776 Log: Finish MFC of r248291,249741: Change 'status' command to produce one-line easy-parseable output. Approved by: trociny Modified: stable/9/UPDATING stable/9/sbin/hastctl/hastctl.8 stable/9/sbin/hastctl/hastctl.c Directory Properties: stable/9/sbin/hastctl/ (props changed) Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Fri Jul 5 06:52:07 2013 (r252775) +++ stable/9/UPDATING Fri Jul 5 08:16:40 2013 (r252776) @@ -11,6 +11,10 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20130705: + hastctl(8)'s `status' command output changed to terse one-liner format. + Scripts using this should switch to `list' command or be rewritten. + 20130618: Fix a bug that allowed a tracing process (e.g. gdb) to write to a memory-mapped file in the traced process's address space Modified: stable/9/sbin/hastctl/hastctl.8 ============================================================================== --- stable/9/sbin/hastctl/hastctl.8 Fri Jul 5 06:52:07 2013 (r252775) +++ stable/9/sbin/hastctl/hastctl.8 Fri Jul 5 08:16:40 2013 (r252776) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 24, 2013 +.Dd July 5, 2013 .Dt HASTCTL 8 .Os .Sh NAME @@ -145,18 +145,10 @@ GEOM provider will not be created on secondary node. .El .It Cm list -.It Cm status Present verbose status of the configured resources. -For now, list and status commands are equivalent. -In the near future the output of -.Nm -status command will change to more terse format. -If you use ` -.Nm -status' for parsing in your scripts, switch to ` -.Nm -list'. - +.It Cm status +Present terse (and more easy machine-parseable) status of the configured +resources. .It Cm dump Dump metadata stored on local component for the configured resources. .El Modified: stable/9/sbin/hastctl/hastctl.c ============================================================================== --- stable/9/sbin/hastctl/hastctl.c Fri Jul 5 06:52:07 2013 (r252775) +++ stable/9/sbin/hastctl/hastctl.c Fri Jul 5 08:16:40 2013 (r252776) @@ -291,7 +291,7 @@ control_set_role(struct nv *nv, const ch } static int -control_status(struct nv *nv) +control_list(struct nv *nv) { unsigned int ii; const char *str; @@ -355,6 +355,43 @@ control_status(struct nv *nv) return (ret); } +static int +control_status(struct nv *nv) +{ + unsigned int ii; + const char *str; + int error, hprinted, ret; + + hprinted = 0; + ret = 0; + + for (ii = 0; ; ii++) { + str = nv_get_string(nv, "resource%u", ii); + if (str == NULL) + break; + if (!hprinted) { + printf("Name\tStatus\t Role\t\tComponents\n"); + hprinted = 1; + } + printf("%s\t", str); + error = nv_get_int16(nv, "error%u", ii); + if (error != 0) { + if (ret == 0) + ret = error; + printf("ERR%d\n", error); + continue; + } + str = nv_get_string(nv, "status%u", ii); + printf("%-9s", (str != NULL) ? str : "-"); + printf("%-15s", nv_get_string(nv, "role%u", ii)); + printf("%s\t", + nv_get_string(nv, "localpath%u", ii)); + printf("%s\n", + nv_get_string(nv, "remoteaddr%u", ii)); + } + return (ret); +} + int main(int argc, char *argv[]) { @@ -523,6 +560,8 @@ main(int argc, char *argv[]) error = control_set_role(nv, argv[0]); break; case CMD_LIST: + error = control_list(nv); + break; case CMD_STATUS: error = control_status(nv); break; From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 08:17:49 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6B11A4CE; Fri, 5 Jul 2013 08:17:49 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D38A1A1F; Fri, 5 Jul 2013 08:17:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r658HnAk048160; Fri, 5 Jul 2013 08:17:49 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r658Hm0c048157; Fri, 5 Jul 2013 08:17:48 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201307050817.r658Hm0c048157@svn.freebsd.org> From: Dmitry Morozovsky Date: Fri, 5 Jul 2013 08:17: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: r252777 - in stable/8: . sbin/hastctl 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.14 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, 05 Jul 2013 08:17:49 -0000 Author: marck (doc committer) Date: Fri Jul 5 08:17:48 2013 New Revision: 252777 URL: http://svnweb.freebsd.org/changeset/base/252777 Log: Finish MFC of r248291,249741: Change 'status' command to produce one-line easy-parseable output. Approved by: trociny Modified: stable/8/UPDATING stable/8/sbin/hastctl/hastctl.8 stable/8/sbin/hastctl/hastctl.c Directory Properties: stable/8/sbin/hastctl/ (props changed) Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Fri Jul 5 08:16:40 2013 (r252776) +++ stable/8/UPDATING Fri Jul 5 08:17:48 2013 (r252777) @@ -15,6 +15,10 @@ 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. +20130705: + hastctl(8)'s `status' command output changed to terse one-liner format. + Scripts using this should switch to `list' command or be rewritten. + 20130624: Added ZFS TRIM support which is enabled by default. To disable ZFS TRIM support set vfs.zfs.trim.enabled=0 in loader.conf. Modified: stable/8/sbin/hastctl/hastctl.8 ============================================================================== --- stable/8/sbin/hastctl/hastctl.8 Fri Jul 5 08:16:40 2013 (r252776) +++ stable/8/sbin/hastctl/hastctl.8 Fri Jul 5 08:17:48 2013 (r252777) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 24, 2013 +.Dd July 5, 2013 .Dt HASTCTL 8 .Os .Sh NAME @@ -145,18 +145,10 @@ GEOM provider will not be created on secondary node. .El .It Cm list -.It Cm status Present verbose status of the configured resources. -For now, list and status commands are equivalent. -In the near future the output of -.Nm -status command will change to more terse format. -If you use ` -.Nm -status' for parsing in your scripts, switch to ` -.Nm -list'. - +.It Cm status +Present terse (and more easy machine-parseable) status of the configured +resources. .It Cm dump Dump metadata stored on local component for the configured resources. .El Modified: stable/8/sbin/hastctl/hastctl.c ============================================================================== --- stable/8/sbin/hastctl/hastctl.c Fri Jul 5 08:16:40 2013 (r252776) +++ stable/8/sbin/hastctl/hastctl.c Fri Jul 5 08:17:48 2013 (r252777) @@ -291,7 +291,7 @@ control_set_role(struct nv *nv, const ch } static int -control_status(struct nv *nv) +control_list(struct nv *nv) { unsigned int ii; const char *str; @@ -355,6 +355,43 @@ control_status(struct nv *nv) return (ret); } +static int +control_status(struct nv *nv) +{ + unsigned int ii; + const char *str; + int error, hprinted, ret; + + hprinted = 0; + ret = 0; + + for (ii = 0; ; ii++) { + str = nv_get_string(nv, "resource%u", ii); + if (str == NULL) + break; + if (!hprinted) { + printf("Name\tStatus\t Role\t\tComponents\n"); + hprinted = 1; + } + printf("%s\t", str); + error = nv_get_int16(nv, "error%u", ii); + if (error != 0) { + if (ret == 0) + ret = error; + printf("ERR%d\n", error); + continue; + } + str = nv_get_string(nv, "status%u", ii); + printf("%-9s", (str != NULL) ? str : "-"); + printf("%-15s", nv_get_string(nv, "role%u", ii)); + printf("%s\t", + nv_get_string(nv, "localpath%u", ii)); + printf("%s\n", + nv_get_string(nv, "remoteaddr%u", ii)); + } + return (ret); +} + int main(int argc, char *argv[]) { @@ -523,6 +560,8 @@ main(int argc, char *argv[]) error = control_set_role(nv, argv[0]); break; case CMD_LIST: + error = control_list(nv); + break; case CMD_STATUS: error = control_status(nv); break; From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 09:36:12 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C02056EA; Fri, 5 Jul 2013 09:36:12 +0000 (UTC) (envelope-from achim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B0A2A1EF1; Fri, 5 Jul 2013 09:36:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r659aCWU071335; Fri, 5 Jul 2013 09:36:12 GMT (envelope-from achim@svn.freebsd.org) Received: (from achim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r659aAZM071318; Fri, 5 Jul 2013 09:36:10 GMT (envelope-from achim@svn.freebsd.org) Message-Id: <201307050936.r659aAZM071318@svn.freebsd.org> From: Achim Leubner Date: Fri, 5 Jul 2013 09:36:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252778 - in stable/9: share/man/man4 sys/amd64/conf sys/conf sys/dev/aacraid sys/i386/conf sys/ia64/conf sys/modules sys/modules/aacraid 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.14 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, 05 Jul 2013 09:36:12 -0000 Author: achim Date: Fri Jul 5 09:36:09 2013 New Revision: 252778 URL: http://svnweb.freebsd.org/changeset/base/252778 Log: MFC r250963, r251013, r251056: Driver 'aacraid' added to support Adaptec by PMC RAID controller families Series 6, 7, 8 and upcoming products. Approved by: emaste (co-mentor) Added: stable/9/share/man/man4/aacraid.4 - copied, changed from r250963, head/share/man/man4/aacraid.4 stable/9/sys/dev/aacraid/ - copied from r250963, head/sys/dev/aacraid/ stable/9/sys/modules/aacraid/ - copied from r250963, head/sys/modules/aacraid/ Modified: stable/9/share/man/man4/Makefile stable/9/sys/amd64/conf/GENERIC stable/9/sys/amd64/conf/NOTES stable/9/sys/conf/files stable/9/sys/conf/options stable/9/sys/dev/aacraid/aacraid.c stable/9/sys/i386/conf/GENERIC stable/9/sys/i386/conf/NOTES stable/9/sys/ia64/conf/GENERIC stable/9/sys/modules/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/amd64/include/xen/ (props changed) stable/9/sys/boot/ (props changed) stable/9/sys/boot/i386/efi/ (props changed) stable/9/sys/boot/ia64/efi/ (props changed) stable/9/sys/boot/ia64/ski/ (props changed) stable/9/sys/boot/powerpc/boot1.chrp/ (props changed) stable/9/sys/boot/powerpc/ofw/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/contrib/dev/acpica/ (props changed) stable/9/sys/contrib/octeon-sdk/ (props changed) stable/9/sys/contrib/pf/ (props changed) stable/9/sys/contrib/x86emu/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/dev/e1000/ (props changed) stable/9/sys/dev/isp/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/dev/puc/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/fs/ntfs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/sys/net/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/share/man/man4/Makefile Fri Jul 5 09:36:09 2013 (r252778) @@ -2,6 +2,7 @@ # $FreeBSD$ MAN= aac.4 \ + aacraid.4 \ acpi.4 \ ${_acpi_asus.4} \ ${_acpi_dock.4} \ Copied and modified: stable/9/share/man/man4/aacraid.4 (from r250963, head/share/man/man4/aacraid.4) ============================================================================== --- head/share/man/man4/aacraid.4 Fri May 24 09:22:43 2013 (r250963, copy source) +++ stable/9/share/man/man4/aacraid.4 Fri Jul 5 09:36:09 2013 (r252778) @@ -53,10 +53,10 @@ The driver provides support for the Adaptec by PMC RAID controllers, including Series 6/7/8 and upcoming families. .Pp -The RAID containers are handled via the +The RAID containers are handled via the .Nm aacraidp0 bus. -The physical buses are represented by the +The physical buses are represented by the .Nm aacraidp? devices (beginning with aacraidp1). These devices enable the SCSI pass-thru interface and allows devices connected @@ -135,5 +135,4 @@ and are also queued for retrieval by a m .An Scott Long .Aq scottl@FreeBSD.org .Sh BUGS -.Pp The controller is not actually paused on suspend/resume. Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/amd64/conf/GENERIC Fri Jul 5 09:36:09 2013 (r252778) @@ -145,6 +145,7 @@ device tws # LSI 3ware 9750 SATA+SAS 6 # RAID controllers device aac # Adaptec FSA RAID device aacp # SCSI passthrough for aac (requires CAM) +device aacraid # Adaptec by PMC RAID device ida # Compaq Smart RAID device mfi # LSI MegaRAID SAS device mlx # Mylex DAC960 family Modified: stable/9/sys/amd64/conf/NOTES ============================================================================== --- stable/9/sys/amd64/conf/NOTES Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/amd64/conf/NOTES Fri Jul 5 09:36:09 2013 (r252778) @@ -407,6 +407,10 @@ device aac device aacp # SCSI Passthrough interface (optional, CAM required) # +# Adaptec by PMC RAID controllers, Series 6/7/8 and upcoming families +device aacraid # Container interface, CAM required + +# # Highpoint RocketRAID 27xx. device hpt27xx Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/conf/files Fri Jul 5 09:36:09 2013 (r252778) @@ -440,6 +440,11 @@ dev/aac/aac_debug.c optional aac dev/aac/aac_disk.c optional aac dev/aac/aac_linux.c optional aac compat_linux dev/aac/aac_pci.c optional aac pci +dev/aacraid/aacraid.c optional aacraid +dev/aacraid/aacraid_cam.c optional aacraid scbus +dev/aacraid/aacraid_debug.c optional aacraid +dev/aacraid/aacraid_linux.c optional aacraid compat_linux +dev/aacraid/aacraid_pci.c optional aacraid pci dev/acpi_support/acpi_wmi.c optional acpi_wmi acpi dev/acpi_support/acpi_asus.c optional acpi_asus acpi dev/acpi_support/acpi_fujitsu.c optional acpi_fujitsu acpi Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/conf/options Fri Jul 5 09:36:09 2013 (r252778) @@ -31,6 +31,7 @@ # opt_.h AAC_DEBUG opt_aac.h +AACRAID_DEBUG opt_aacraid.h AHC_ALLOW_MEMIO opt_aic7xxx.h AHC_TMODE_ENABLE opt_aic7xxx.h AHC_DUMP_EEPROM opt_aic7xxx.h Modified: stable/9/sys/dev/aacraid/aacraid.c ============================================================================== --- head/sys/dev/aacraid/aacraid.c Fri May 24 09:22:43 2013 (r250963) +++ stable/9/sys/dev/aacraid/aacraid.c Fri Jul 5 09:36:09 2013 (r252778) @@ -2522,7 +2522,7 @@ aac_ioctl_send_raw_srb(struct aac_softc srb_sg_address = (u_int64_t)sgp->SgAddress; } else if (fibsize == (sizeof(struct aac_srb) + srbcmd->sg_map.SgCount * sizeof(struct aac_sg_entry64))) { -#ifdef __amd64__ +#ifdef __LP64__ struct aac_sg_entry64 *sgp = (struct aac_sg_entry64 *)srbcmd->sg_map.SgEntry; srb_sg_bytecount = sgp->SgByteCount; @@ -2576,12 +2576,7 @@ aac_ioctl_send_raw_srb(struct aac_softc cm->cm_flags |= AAC_CMD_DATAOUT; if (srbcmd->flags & AAC_SRB_FLAGS_DATA_OUT) { - if ((error = copyin( -#ifdef __amd64__ - (void *)srb_sg_address, -#else - (void *)(u_int32_t)srb_sg_address, -#endif + if ((error = copyin((void *)(uintptr_t)srb_sg_address, cm->cm_data, cm->cm_datalen)) != 0) goto out; /* sync required for bus_dmamem_alloc() alloc. mem.? */ @@ -2624,12 +2619,8 @@ aac_ioctl_send_raw_srb(struct aac_softc /* copy data */ if (transfer_data && (srbcmd->flags & AAC_SRB_FLAGS_DATA_IN)) { - if ((error = copyout(cm->cm_data, -#ifdef __amd64__ - (void *)srb_sg_address, -#else - (void *)(u_int32_t)srb_sg_address, -#endif + if ((error = copyout(cm->cm_data, + (void *)(uintptr_t)srb_sg_address, cm->cm_datalen)) != 0) goto out; /* sync required for bus_dmamem_alloc() allocated mem.? */ Modified: stable/9/sys/i386/conf/GENERIC ============================================================================== --- stable/9/sys/i386/conf/GENERIC Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/i386/conf/GENERIC Fri Jul 5 09:36:09 2013 (r252778) @@ -151,6 +151,7 @@ device tws # LSI 3ware 9750 SATA+SAS 6 # RAID controllers device aac # Adaptec FSA RAID device aacp # SCSI passthrough for aac (requires CAM) +device aacraid # Adaptec by PMC RAID device ida # Compaq Smart RAID device mfi # LSI MegaRAID SAS device mlx # Mylex DAC960 family Modified: stable/9/sys/i386/conf/NOTES ============================================================================== --- stable/9/sys/i386/conf/NOTES Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/i386/conf/NOTES Fri Jul 5 09:36:09 2013 (r252778) @@ -719,6 +719,10 @@ hint.stg.0.port="11" device aac device aacp # SCSI Passthrough interface (optional, CAM required) +# +# Adaptec by PMC RAID controllers, Series 6/7/8 and upcoming families +device aacraid # Container interface, CAM required + # The 'asr' driver provides support for current DPT/Adaptec SCSI RAID # controllers (SmartRAID V and VI and later). # These controllers require the CAM infrastructure. Modified: stable/9/sys/ia64/conf/GENERIC ============================================================================== --- stable/9/sys/ia64/conf/GENERIC Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/ia64/conf/GENERIC Fri Jul 5 09:36:09 2013 (r252778) @@ -105,6 +105,7 @@ device ctl # CAM Target Layer # RAID controllers device aac # Adaptec FSA RAID device aacp # SCSI passthrough for aac (requires CAM) +device aacraid # Adaptec by PMC RAID device ida # Compaq Smart RAID device mlx # Mylex DAC960 family Modified: stable/9/sys/modules/Makefile ============================================================================== --- stable/9/sys/modules/Makefile Fri Jul 5 08:17:48 2013 (r252777) +++ stable/9/sys/modules/Makefile Fri Jul 5 09:36:09 2013 (r252778) @@ -9,6 +9,7 @@ SUBDIR= \ ${_3dfx} \ ${_3dfx_linux} \ ${_aac} \ + ${_aacraid} \ accf_data \ accf_dns \ accf_http \ @@ -532,6 +533,7 @@ _zfs= zfs .endif .if ${MACHINE} == "i386" _aac= aac +_aacraid= aacraid _acpi= acpi .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) _aesni= aesni @@ -613,6 +615,7 @@ _snc= snc .if ${MACHINE_CPUARCH} == "amd64" _aac= aac +_aacraid= aacraid _aout= aout _acpi= acpi .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) @@ -736,6 +739,7 @@ _zfs= zfs .if ${MACHINE_CPUARCH} == "ia64" _aac= aac +_aacraid= aacraid _aic= aic _an= an _arcnet= arcnet From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 13:48:34 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1F58D23B; Fri, 5 Jul 2013 13:48:34 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0ECFE1E41; Fri, 5 Jul 2013 13:48:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65DmXaW044900; Fri, 5 Jul 2013 13:48:33 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65DmWA9044893; Fri, 5 Jul 2013 13:48:32 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051348.r65DmWA9044893@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 13:48: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: r252781 - in stable/9/sys: dev/xen/netfront net netinet 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.14 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, 05 Jul 2013 13:48:34 -0000 Author: andre Date: Fri Jul 5 13:48:32 2013 New Revision: 252781 URL: http://svnweb.freebsd.org/changeset/base/252781 Log: MFC r291296, r291297, r291393: Allow drivers to specify a maximum TSP length in bytes if they are limited in the amount of data they can handle at once. Apply this to the netfront driver. Spare fields in struct tcpcb and struct ifnet are used to keep the structure sizes the same. Modified: stable/9/sys/dev/xen/netfront/netfront.c stable/9/sys/net/if.c stable/9/sys/net/if_var.h stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_output.c stable/9/sys/netinet/tcp_subr.c stable/9/sys/netinet/tcp_var.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) stable/9/sys/net/ (props changed) Modified: stable/9/sys/dev/xen/netfront/netfront.c ============================================================================== --- stable/9/sys/dev/xen/netfront/netfront.c Fri Jul 5 13:37:57 2013 (r252780) +++ stable/9/sys/dev/xen/netfront/netfront.c Fri Jul 5 13:48:32 2013 (r252781) @@ -134,6 +134,7 @@ static const int MODPARM_rx_flip = 0; * to mirror the Linux MAX_SKB_FRAGS constant. */ #define MAX_TX_REQ_FRAGS (65536 / PAGE_SIZE + 2) +#define NF_TSO_MAXBURST ((IP_MAXPACKET / PAGE_SIZE) * MCLBYTES) #define RX_COPY_THRESHOLD 256 @@ -2123,6 +2124,7 @@ create_netdev(device_t dev) ifp->if_hwassist = XN_CSUM_FEATURES; ifp->if_capabilities = IFCAP_HWCSUM; + ifp->if_hw_tsomax = NF_TSO_MAXBURST; ether_ifattach(ifp, np->mac); callout_init(&np->xn_stat_ch, CALLOUT_MPSAFE); Modified: stable/9/sys/net/if.c ============================================================================== --- stable/9/sys/net/if.c Fri Jul 5 13:37:57 2013 (r252780) +++ stable/9/sys/net/if.c Fri Jul 5 13:48:32 2013 (r252781) @@ -74,18 +74,18 @@ #include #if defined(INET) || defined(INET6) -/*XXX*/ #include #include +#include #include +#ifdef INET +#include +#endif /* INET */ #ifdef INET6 #include #include -#endif -#endif -#ifdef INET -#include -#endif +#endif /* INET6 */ +#endif /* INET || INET6 */ #include @@ -669,6 +669,15 @@ if_attach_internal(struct ifnet *ifp, in TAILQ_INSERT_HEAD(&ifp->if_addrhead, ifa, ifa_link); /* Reliably crash if used uninitialized. */ ifp->if_broadcastaddr = NULL; + +#if defined(INET) || defined(INET6) + /* Initialize to max value. */ + if (ifp->if_hw_tsomax == 0) + ifp->if_hw_tsomax = IP_MAXPACKET; + KASSERT(ifp->if_hw_tsomax <= IP_MAXPACKET && + ifp->if_hw_tsomax >= IP_MAXPACKET / 8, + ("%s: tsomax outside of range", __func__)); +#endif } #ifdef VIMAGE else { Modified: stable/9/sys/net/if_var.h ============================================================================== --- stable/9/sys/net/if_var.h Fri Jul 5 13:37:57 2013 (r252780) +++ stable/9/sys/net/if_var.h Fri Jul 5 13:48:32 2013 (r252781) @@ -205,7 +205,11 @@ struct ifnet { * be used with care where binary compatibility is required. */ char if_cspare[3]; - int if_ispare[4]; + u_int if_hw_tsomax; /* tso burst length limit, the minmum + * is (IP_MAXPACKET / 8). + * XXXAO: Have to find a better place + * for it eventually. */ + int if_ispare[3]; void *if_pspare[8]; /* 1 netmap, 7 TDB */ }; Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 13:37:57 2013 (r252780) +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 13:48:32 2013 (r252781) @@ -3393,7 +3393,7 @@ tcp_xmit_timer(struct tcpcb *tp, int rtt */ void tcp_mss_update(struct tcpcb *tp, int offer, int mtuoffer, - struct hc_metrics_lite *metricptr, int *mtuflags) + struct hc_metrics_lite *metricptr, struct tcp_ifcap *cap) { int mss = 0; u_long maxmtu = 0; @@ -3420,7 +3420,7 @@ tcp_mss_update(struct tcpcb *tp, int off /* Initialize. */ #ifdef INET6 if (isipv6) { - maxmtu = tcp_maxmtu6(&inp->inp_inc, mtuflags); + maxmtu = tcp_maxmtu6(&inp->inp_inc, cap); tp->t_maxopd = tp->t_maxseg = V_tcp_v6mssdflt; } #endif @@ -3429,7 +3429,7 @@ tcp_mss_update(struct tcpcb *tp, int off #endif #ifdef INET { - maxmtu = tcp_maxmtu(&inp->inp_inc, mtuflags); + maxmtu = tcp_maxmtu(&inp->inp_inc, cap); tp->t_maxopd = tp->t_maxseg = V_tcp_mssdflt; } #endif @@ -3571,11 +3571,12 @@ tcp_mss(struct tcpcb *tp, int offer) struct inpcb *inp; struct socket *so; struct hc_metrics_lite metrics; - int mtuflags = 0; + struct tcp_ifcap cap; KASSERT(tp != NULL, ("%s: tp == NULL", __func__)); - - tcp_mss_update(tp, offer, -1, &metrics, &mtuflags); + + bzero(&cap, sizeof(cap)); + tcp_mss_update(tp, offer, -1, &metrics, &cap); mss = tp->t_maxseg; inp = tp->t_inpcb; @@ -3620,8 +3621,10 @@ tcp_mss(struct tcpcb *tp, int offer) SOCKBUF_UNLOCK(&so->so_rcv); /* Check the interface for TSO capabilities. */ - if (mtuflags & CSUM_TSO) + if (cap.ifcap & CSUM_TSO) { tp->t_flags |= TF_TSO; + tp->t_tsomax = cap.tsomax; + } } /* Modified: stable/9/sys/netinet/tcp_output.c ============================================================================== --- stable/9/sys/netinet/tcp_output.c Fri Jul 5 13:37:57 2013 (r252780) +++ stable/9/sys/netinet/tcp_output.c Fri Jul 5 13:48:32 2013 (r252781) @@ -752,12 +752,13 @@ send: ("%s: TSO can't do IP options", __func__)); /* - * Limit a burst to IP_MAXPACKET minus IP, + * Limit a burst to t_tsomax minus IP, * TCP and options length to keep ip->ip_len - * from overflowing. + * from overflowing or exceeding the maximum + * length allowed by the network interface. */ - if (len > IP_MAXPACKET - hdrlen) { - len = IP_MAXPACKET - hdrlen; + if (len > tp->t_tsomax - hdrlen) { + len = tp->t_tsomax - hdrlen; sendalot = 1; } Modified: stable/9/sys/netinet/tcp_subr.c ============================================================================== --- stable/9/sys/netinet/tcp_subr.c Fri Jul 5 13:37:57 2013 (r252780) +++ stable/9/sys/netinet/tcp_subr.c Fri Jul 5 13:48:32 2013 (r252781) @@ -1714,7 +1714,7 @@ tcp_mtudisc(struct inpcb *inp, int mtuof * tcp_mss_update to get the peer/interface MTU. */ u_long -tcp_maxmtu(struct in_conninfo *inc, int *flags) +tcp_maxmtu(struct in_conninfo *inc, struct tcp_ifcap *cap) { struct route sro; struct sockaddr_in *dst; @@ -1739,10 +1739,11 @@ tcp_maxmtu(struct in_conninfo *inc, int maxmtu = min(sro.ro_rt->rt_rmx.rmx_mtu, ifp->if_mtu); /* Report additional interface capabilities. */ - if (flags != NULL) { + if (cap != NULL) { if (ifp->if_capenable & IFCAP_TSO4 && ifp->if_hwassist & CSUM_TSO) - *flags |= CSUM_TSO; + cap->ifcap |= CSUM_TSO; + cap->tsomax = ifp->if_hw_tsomax; } RTFREE(sro.ro_rt); } @@ -1752,7 +1753,7 @@ tcp_maxmtu(struct in_conninfo *inc, int #ifdef INET6 u_long -tcp_maxmtu6(struct in_conninfo *inc, int *flags) +tcp_maxmtu6(struct in_conninfo *inc, struct tcp_ifcap *cap) { struct route_in6 sro6; struct ifnet *ifp; @@ -1776,10 +1777,11 @@ tcp_maxmtu6(struct in_conninfo *inc, int IN6_LINKMTU(sro6.ro_rt->rt_ifp)); /* Report additional interface capabilities. */ - if (flags != NULL) { + if (cap != NULL) { if (ifp->if_capenable & IFCAP_TSO6 && ifp->if_hwassist & CSUM_TSO) - *flags |= CSUM_TSO; + cap->ifcap |= CSUM_TSO; + cap->tsomax = ifp->if_hw_tsomax; } RTFREE(sro6.ro_rt); } Modified: stable/9/sys/netinet/tcp_var.h ============================================================================== --- stable/9/sys/netinet/tcp_var.h Fri Jul 5 13:37:57 2013 (r252780) +++ stable/9/sys/netinet/tcp_var.h Fri Jul 5 13:48:32 2013 (r252781) @@ -208,7 +208,9 @@ struct tcpcb { u_int t_keepintvl; /* interval between keepalives */ u_int t_keepcnt; /* number of keepalives before close */ - uint32_t t_ispare[8]; /* 5 UTO, 3 TBD */ + u_int t_tsomax; /* tso burst length limit */ + + uint32_t t_ispare[7]; /* 5 UTO, 2 TBD */ void *t_pspare2[4]; /* 4 TBD */ uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ }; @@ -324,6 +326,15 @@ struct hc_metrics_lite { /* must stay in u_long rmx_recvpipe; /* inbound delay-bandwidth product */ }; +/* + * Used by tcp_maxmtu() to communicate interface specific features + * and limits at the time of connection setup. + */ +struct tcp_ifcap { + int ifcap; + u_int tsomax; +}; + #ifndef _NETINET_IN_PCB_H_ struct in_conninfo; #endif /* _NETINET_IN_PCB_H_ */ @@ -673,10 +684,10 @@ void tcp_reass_flush(struct tcpcb *); void tcp_reass_destroy(void); #endif void tcp_input(struct mbuf *, int); -u_long tcp_maxmtu(struct in_conninfo *, int *); -u_long tcp_maxmtu6(struct in_conninfo *, int *); +u_long tcp_maxmtu(struct in_conninfo *, struct tcp_ifcap *); +u_long tcp_maxmtu6(struct in_conninfo *, struct tcp_ifcap *); void tcp_mss_update(struct tcpcb *, int, int, struct hc_metrics_lite *, - int *); + struct tcp_ifcap *); void tcp_mss(struct tcpcb *, int); int tcp_mssopt(struct in_conninfo *); struct inpcb * From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 14:08:36 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9D3FD70F; Fri, 5 Jul 2013 14:08:36 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 764551F02; Fri, 5 Jul 2013 14:08:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65E8a3j051047; Fri, 5 Jul 2013 14:08:36 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65E8aOM051046; Fri, 5 Jul 2013 14:08:36 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051408.r65E8aOM051046@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 14:08: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: r252782 - 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.14 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, 05 Jul 2013 14:08:36 -0000 Author: andre Date: Fri Jul 5 14:08:36 2013 New Revision: 252782 URL: http://svnweb.freebsd.org/changeset/base/252782 Log: MFC r242306, r250365: Add logging for socket attach failures in sonewconn() during accept(2). Include the pointer to the PCB so it can be attributed to a particular application by corresponding it to "netstat -A" output. Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Fri Jul 5 13:48:32 2013 (r252781) +++ stable/9/sys/kern/uipc_socket.c Fri Jul 5 14:08:36 2013 (r252782) @@ -135,6 +135,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -447,16 +448,24 @@ sonewconn(struct socket *head, int conns over = (head->so_qlen > 3 * head->so_qlimit / 2); ACCEPT_UNLOCK(); #ifdef REGRESSION - if (regression_sonewconn_earlytest && over) + if (regression_sonewconn_earlytest && over) { #else - if (over) + if (over) { #endif + log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: " + "%i already in queue awaiting acceptance\n", + __func__, head->so_pcb, head->so_qlen); return (NULL); + } VNET_ASSERT(head->so_vnet != NULL, ("%s:%d so_vnet is NULL, head=%p", __func__, __LINE__, head)); so = soalloc(head->so_vnet); - if (so == NULL) + if (so == NULL) { + log(LOG_DEBUG, "%s: pcb %p: New socket allocation failure: " + "limit reached or out of memory\n", + __func__, head->so_pcb); return (NULL); + } if ((head->so_options & SO_ACCEPTFILTER) != 0) connstatus = 0; so->so_head = head; @@ -473,9 +482,16 @@ sonewconn(struct socket *head, int conns knlist_init_mtx(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv)); knlist_init_mtx(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd)); VNET_SO_ASSERT(head); - if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat) || - (*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) { + if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat)) { + sodealloc(so); + log(LOG_DEBUG, "%s: pcb %p: soreserve() failed\n", + __func__, head->so_pcb); + return (NULL); + } + if ((*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) { sodealloc(so); + log(LOG_DEBUG, "%s: pcb %p: pru_attach() failed\n", + __func__, head->so_pcb); return (NULL); } so->so_rcv.sb_lowat = head->so_rcv.sb_lowat; From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 14:12:27 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6B85BA24; Fri, 5 Jul 2013 14:12:27 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 43E0A1F39; Fri, 5 Jul 2013 14:12:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65ECRhN053427; Fri, 5 Jul 2013 14:12:27 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65ECRRM053426; Fri, 5 Jul 2013 14:12:27 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051412.r65ECRRM053426@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 14:12: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: r252783 - 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.14 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, 05 Jul 2013 14:12:27 -0000 Author: andre Date: Fri Jul 5 14:12:26 2013 New Revision: 252783 URL: http://svnweb.freebsd.org/changeset/base/252783 Log: MFC r243627, r243638: Fix a race on listen socket teardown where while draining the accept queues a new socket/connection may be added to the queue due to a race on the ACCEPT_LOCK. The submitted patch is slightly changed in comments, teardown and locking order and extended with KASSERT's. Submitted by: Vijay Singh Found by: His team. Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Fri Jul 5 14:08:36 2013 (r252782) +++ stable/9/sys/kern/uipc_socket.c Fri Jul 5 14:12:26 2013 (r252783) @@ -502,6 +502,16 @@ sonewconn(struct socket *head, int conns so->so_snd.sb_flags |= head->so_snd.sb_flags & SB_AUTOSIZE; so->so_state |= connstatus; ACCEPT_LOCK(); + /* + * The accept socket may be tearing down but we just + * won a race on the ACCEPT_LOCK. + */ + if (!(head->so_options & SO_ACCEPTCONN)) { + SOCK_LOCK(so); + so->so_head = NULL; + sofree(so); /* NB: returns ACCEPT_UNLOCK'ed. */ + return (NULL); + } if (connstatus) { TAILQ_INSERT_TAIL(&head->so_comp, so, so_list); so->so_qstate |= SQ_COMP; @@ -727,9 +737,14 @@ soclose(struct socket *so) drop: if (so->so_proto->pr_usrreqs->pru_close != NULL) (*so->so_proto->pr_usrreqs->pru_close)(so); + ACCEPT_LOCK(); if (so->so_options & SO_ACCEPTCONN) { struct socket *sp; - ACCEPT_LOCK(); + /* + * Prevent new additions to the accept queues due + * to ACCEPT_LOCK races while we are draining them. + */ + so->so_options &= ~SO_ACCEPTCONN; while ((sp = TAILQ_FIRST(&so->so_incomp)) != NULL) { TAILQ_REMOVE(&so->so_incomp, sp, so_list); so->so_incqlen--; @@ -748,13 +763,15 @@ drop: soabort(sp); ACCEPT_LOCK(); } - ACCEPT_UNLOCK(); + KASSERT((TAILQ_EMPTY(&so->so_comp)), + ("%s: so_comp populated", __func__)); + KASSERT((TAILQ_EMPTY(&so->so_incomp)), + ("%s: so_incomp populated", __func__)); } - ACCEPT_LOCK(); SOCK_LOCK(so); KASSERT((so->so_state & SS_NOFDREF) == 0, ("soclose: NOFDREF")); so->so_state |= SS_NOFDREF; - sorele(so); + sorele(so); /* NB: Returns with ACCEPT_UNLOCK(). */ CURVNET_RESTORE(); return (error); } From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 14:18:10 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id F2BC7EC7; Fri, 5 Jul 2013 14:18:09 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C95011F73; Fri, 5 Jul 2013 14:18:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65EI9lZ054260; Fri, 5 Jul 2013 14:18:09 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65EI9Qs054259; Fri, 5 Jul 2013 14:18:09 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051418.r65EI9Qs054259@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 14: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: r252785 - 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.14 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, 05 Jul 2013 14:18:10 -0000 Author: andre Date: Fri Jul 5 14:18:09 2013 New Revision: 252785 URL: http://svnweb.freebsd.org/changeset/base/252785 Log: MFC r242309: Fix a couple of soreceive_stream() issues. Submitted by: trociny Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Fri Jul 5 14:16:04 2013 (r252784) +++ stable/9/sys/kern/uipc_socket.c Fri Jul 5 14:18:09 2013 (r252785) @@ -1948,6 +1948,7 @@ release: /* * Optimized version of soreceive() for stream (TCP) sockets. + * XXXAO: (MSG_WAITALL | MSG_PEEK) isn't properly handled. */ int soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, @@ -2036,7 +2037,7 @@ restart: /* On MSG_WAITALL we must wait until all data or error arrives. */ if ((flags & MSG_WAITALL) && - (sb->sb_cc >= uio->uio_resid || sb->sb_cc >= sb->sb_lowat)) + (sb->sb_cc >= uio->uio_resid || sb->sb_cc >= sb->sb_hiwat)) goto deliver; /* @@ -2062,7 +2063,11 @@ deliver: if (mp0 != NULL) { /* Dequeue as many mbufs as possible. */ if (!(flags & MSG_PEEK) && len >= sb->sb_mb->m_len) { - for (*mp0 = m = sb->sb_mb; + if (*mp0 == NULL) + *mp0 = sb->sb_mb; + else + m_cat(*mp0, sb->sb_mb); + for (m = sb->sb_mb; m != NULL && m->m_len <= len; m = m->m_next) { len -= m->m_len; @@ -2070,10 +2075,11 @@ deliver: sbfree(sb, m); n = m; } + n->m_next = NULL; sb->sb_mb = m; + sb->sb_lastrecord = sb->sb_mb; if (sb->sb_mb == NULL) SB_EMPTY_FIXUP(sb); - n->m_next = NULL; } /* Copy the remainder. */ if (len > 0) { @@ -2084,9 +2090,9 @@ deliver: if (m == NULL) len = 0; /* Don't flush data from sockbuf. */ else - uio->uio_resid -= m->m_len; + uio->uio_resid -= len; if (*mp0 != NULL) - n->m_next = m; + m_cat(*mp0, m); else *mp0 = m; if (*mp0 == NULL) { From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 14:24:38 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 2FFED110; Fri, 5 Jul 2013 14:24:38 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 225C41FAC; Fri, 5 Jul 2013 14:24:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65EOcoR056663; Fri, 5 Jul 2013 14:24:38 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65EOco3056662; Fri, 5 Jul 2013 14:24:38 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051424.r65EOco3056662@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 14:24: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: r252786 - stable/9/sys/netinet 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.14 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, 05 Jul 2013 14:24:38 -0000 Author: andre Date: Fri Jul 5 14:24:37 2013 New Revision: 252786 URL: http://svnweb.freebsd.org/changeset/base/252786 Log: MFC r249809: When doing RFC3042 limited transmit on the first on second duplicate ACK make sure we actually have new data to send. This prevents us from sending unneccessary pure ACKs. Reported by: Matt Miller Modified: stable/9/sys/netinet/tcp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:18:09 2013 (r252785) +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:24:37 2013 (r252786) @@ -2532,6 +2532,7 @@ tcp_do_segment(struct mbuf *m, struct tc u_long oldcwnd = tp->snd_cwnd; tcp_seq oldsndmax = tp->snd_max; u_int sent; + int avail; KASSERT(tp->t_dupacks == 1 || tp->t_dupacks == 2, @@ -2553,7 +2554,17 @@ tcp_do_segment(struct mbuf *m, struct tc */ break; } - (void) tcp_output(tp); + /* + * Only call tcp_output when there + * is new data available to be sent. + * Otherwise we would send pure ACKs. + */ + SOCKBUF_LOCK(&so->so_snd); + avail = so->so_snd.sb_cc - + (tp->snd_nxt - tp->snd_una); + SOCKBUF_UNLOCK(&so->so_snd); + if (avail > 0) + (void) tcp_output(tp); sent = tp->snd_max - oldsndmax; if (sent > tp->t_maxseg) { KASSERT((tp->t_dupacks == 2 && From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 14:30:54 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B05F0407; Fri, 5 Jul 2013 14:30:54 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A2D161FF1; Fri, 5 Jul 2013 14:30:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65EUsYf059155; Fri, 5 Jul 2013 14:30:54 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65EUs2S059154; Fri, 5 Jul 2013 14:30:54 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051430.r65EUs2S059154@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 14:30: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: r252787 - stable/9/sys/netinet 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.14 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, 05 Jul 2013 14:30:54 -0000 Author: andre Date: Fri Jul 5 14:30:54 2013 New Revision: 252787 URL: http://svnweb.freebsd.org/changeset/base/252787 Log: MFC r249317: Fix a race condition on tcp listen socket teardown with pending connections in the accept queue and contiguous new incoming SYNs. Compared to the original submitters patch I've moved the test next to the SYN handling to have it together in a logical unit and reworded the comment explaining the issue. Submitted by: Matt Miller Submitted by: Juan Mojica Reviewed by: Matt Miller (changes) Tested by: pho Modified: stable/9/sys/netinet/tcp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:24:37 2013 (r252786) +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:30:54 2013 (r252787) @@ -1375,6 +1375,15 @@ relocked: */ INP_INFO_UNLOCK_ASSERT(&V_tcbinfo); return; + } else if (tp->t_state == TCPS_LISTEN) { + /* + * When a listen socket is torn down the SO_ACCEPTCONN + * flag is removed first while connections are drained + * from the accept queue in a unlock/lock cycle of the + * ACCEPT_LOCK, opening a race condition allowing a SYN + * attempt go through unhandled. + */ + goto dropunlock; } #ifdef TCP_SIGNATURE From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 14:50:08 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1874ECC3; Fri, 5 Jul 2013 14:50:08 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F028810B1; Fri, 5 Jul 2013 14:50:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Eo7HL063632; Fri, 5 Jul 2013 14:50:07 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65Eo79t063625; Fri, 5 Jul 2013 14:50:07 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051450.r65Eo79t063625@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 14:50: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: r252788 - stable/9/sys/netinet 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.14 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, 05 Jul 2013 14:50:08 -0000 Author: andre Date: Fri Jul 5 14:50:06 2013 New Revision: 252788 URL: http://svnweb.freebsd.org/changeset/base/252788 Log: MFC r226447: Remove the ss_fltsz and ss_fltsz_local sysctl's which have long been superseded by the RFC3390 initial CWND sizing. Also remove the remnants of TCP_METRICS_CWND which used the TCP hostcache to set the initial CWND in a non-RFC compliant way. MFC r242249: Adjust the initial default CWND upon connection establishment to the new and increased values specified by RFC5681 Section 3.1. The even larger initial CWND per RFC3390, if enabled, is not affected. MFC r242250: When SYN or SYN/ACK had to be retransmitted RFC5681 requires us to reduce the initial CWND to one segment. This reduction got lost some time ago due to a change in initialization ordering. Additionally in tcp_timer_rexmt() avoid entering fast recovery when we're still in TCPS_SYN_SENT state. MFC r242255: Allow arbitrary MSS sizes and don't mind about the cluster size anymore. We've got more cluster sizes for quite some time now and the orginally imposed limits and the previously codified thoughts on efficiency gains are no longer true. Modified: stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_output.c stable/9/sys/netinet/tcp_syncache.c stable/9/sys/netinet/tcp_timer.c stable/9/sys/netinet/tcp_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:30:54 2013 (r252787) +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:50:06 2013 (r252788) @@ -304,9 +304,6 @@ cc_conn_init(struct tcpcb *tp) struct hc_metrics_lite metrics; struct inpcb *inp = tp->t_inpcb; int rtt; -#ifdef INET6 - int isipv6 = ((inp->inp_vflag & INP_IPV6) != 0) ? 1 : 0; -#endif INP_WLOCK_ASSERT(tp->t_inpcb); @@ -340,49 +337,29 @@ cc_conn_init(struct tcpcb *tp) } /* - * Set the slow-start flight size depending on whether this - * is a local network or not. + * Set the initial slow-start flight size. * - * Extend this so we cache the cwnd too and retrieve it here. - * Make cwnd even bigger than RFC3390 suggests but only if we - * have previous experience with the remote host. Be careful - * not make cwnd bigger than remote receive window or our own - * send socket buffer. Maybe put some additional upper bound - * on the retrieved cwnd. Should do incremental updates to - * hostcache when cwnd collapses so next connection doesn't - * overloads the path again. + * RFC5681 Section 3.1 specifies the default conservative values. + * RFC3390 specifies slightly more aggressive values. * - * XXXAO: Initializing the CWND from the hostcache is broken - * and in its current form not RFC conformant. It is disabled - * until fixed or removed entirely. - * - * RFC3390 says only do this if SYN or SYN/ACK didn't got lost. - * We currently check only in syncache_socket for that. - */ -/* #define TCP_METRICS_CWND */ -#ifdef TCP_METRICS_CWND - if (metrics.rmx_cwnd) - tp->snd_cwnd = max(tp->t_maxseg, min(metrics.rmx_cwnd / 2, - min(tp->snd_wnd, so->so_snd.sb_hiwat))); - else -#endif - if (V_tcp_do_rfc3390) + * If a SYN or SYN/ACK was lost and retransmitted, we have to + * reduce the initial CWND to one segment as congestion is likely + * requiring us to be cautious. + */ + if (tp->snd_cwnd == 1) + tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ + else if (V_tcp_do_rfc3390) tp->snd_cwnd = min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380)); -#ifdef INET6 - else if (isipv6 && in6_localaddr(&inp->in6p_faddr)) - tp->snd_cwnd = tp->t_maxseg * V_ss_fltsz_local; -#endif -#if defined(INET) && defined(INET6) - else if (!isipv6 && in_localaddr(inp->inp_faddr)) - tp->snd_cwnd = tp->t_maxseg * V_ss_fltsz_local; -#endif -#ifdef INET - else if (in_localaddr(inp->inp_faddr)) - tp->snd_cwnd = tp->t_maxseg * V_ss_fltsz_local; -#endif - else - tp->snd_cwnd = tp->t_maxseg * V_ss_fltsz; + else { + /* Per RFC5681 Section 3.1 */ + if (tp->t_maxseg > 2190) + tp->snd_cwnd = 2 * tp->t_maxseg; + else if (tp->t_maxseg > 1095) + tp->snd_cwnd = 3 * tp->t_maxseg; + else + tp->snd_cwnd = 4 * tp->t_maxseg; + } if (CC_ALGO(tp)->conn_init != NULL) CC_ALGO(tp)->conn_init(tp->ccv); @@ -3389,10 +3366,8 @@ tcp_xmit_timer(struct tcpcb *tp, int rtt /* * Determine a reasonable value for maxseg size. * If the route is known, check route for mtu. - * If none, use an mss that can be handled on the outgoing - * interface without forcing IP to fragment; if bigger than - * an mbuf cluster (MCLBYTES), round down to nearest multiple of MCLBYTES - * to utilize large mbufs. If no route is found, route has no mtu, + * If none, use an mss that can be handled on the outgoing interface + * without forcing IP to fragment. If no route is found, route has no mtu, * or the destination isn't local, use a default, hopefully conservative * size (usually 512 or the default IP max size, but no more than the mtu * of the interface), as we can't discover anything about intervening @@ -3573,13 +3548,6 @@ tcp_mss_update(struct tcpcb *tp, int off (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP)) mss -= TCPOLEN_TSTAMP_APPA; -#if (MCLBYTES & (MCLBYTES - 1)) == 0 - if (mss > MCLBYTES) - mss &= ~(MCLBYTES-1); -#else - if (mss > MCLBYTES) - mss = mss / MCLBYTES * MCLBYTES; -#endif tp->t_maxseg = mss; } Modified: stable/9/sys/netinet/tcp_output.c ============================================================================== --- stable/9/sys/netinet/tcp_output.c Fri Jul 5 14:30:54 2013 (r252787) +++ stable/9/sys/netinet/tcp_output.c Fri Jul 5 14:50:06 2013 (r252788) @@ -92,16 +92,6 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(path_mtu_discovery), 1, "Enable Path MTU Discovery"); -VNET_DEFINE(int, ss_fltsz) = 1; -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, slowstart_flightsize, CTLFLAG_RW, - &VNET_NAME(ss_fltsz), 1, - "Slow start flight size"); - -VNET_DEFINE(int, ss_fltsz_local) = 4; -SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, local_slowstart_flightsize, - CTLFLAG_RW, &VNET_NAME(ss_fltsz_local), 1, - "Slow start flight size for local networks"); - VNET_DEFINE(int, tcp_do_tso) = 1; #define V_tcp_do_tso VNET(tcp_do_tso) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, tso, CTLFLAG_RW, Modified: stable/9/sys/netinet/tcp_syncache.c ============================================================================== --- stable/9/sys/netinet/tcp_syncache.c Fri Jul 5 14:30:54 2013 (r252787) +++ stable/9/sys/netinet/tcp_syncache.c Fri Jul 5 14:50:06 2013 (r252788) @@ -852,11 +852,12 @@ syncache_socket(struct syncache *sc, str tcp_mss(tp, sc->sc_peer_mss); /* - * If the SYN,ACK was retransmitted, reset cwnd to 1 segment. + * If the SYN,ACK was retransmitted, indicate that CWND to be + * limited to one segment in cc_conn_init(). * NB: sc_rxmits counts all SYN,ACK transmits, not just retransmits. */ if (sc->sc_rxmits > 1) - tp->snd_cwnd = tp->t_maxseg; + tp->snd_cwnd = 1; #ifdef TCP_OFFLOAD /* Modified: stable/9/sys/netinet/tcp_timer.c ============================================================================== --- stable/9/sys/netinet/tcp_timer.c Fri Jul 5 14:30:54 2013 (r252787) +++ stable/9/sys/netinet/tcp_timer.c Fri Jul 5 14:50:06 2013 (r252788) @@ -545,7 +545,13 @@ tcp_timer_rexmt(void * xtp) } INP_INFO_RUNLOCK(&V_tcbinfo); headlocked = 0; - if (tp->t_rxtshift == 1) { + if (tp->t_state == TCPS_SYN_SENT) { + /* + * If the SYN was retransmitted, indicate CWND to be + * limited to 1 segment in cc_conn_init(). + */ + tp->snd_cwnd = 1; + } else if (tp->t_rxtshift == 1) { /* * first retransmit; record ssthresh and cwnd so they can * be recovered if this turns out to be a "bad" retransmit. Modified: stable/9/sys/netinet/tcp_var.h ============================================================================== --- stable/9/sys/netinet/tcp_var.h Fri Jul 5 14:30:54 2013 (r252787) +++ stable/9/sys/netinet/tcp_var.h Fri Jul 5 14:50:06 2013 (r252788) @@ -623,8 +623,6 @@ VNET_DECLARE(int, tcp_minmss); VNET_DECLARE(int, tcp_delack_enabled); VNET_DECLARE(int, tcp_do_rfc3390); VNET_DECLARE(int, path_mtu_discovery); -VNET_DECLARE(int, ss_fltsz); -VNET_DECLARE(int, ss_fltsz_local); VNET_DECLARE(int, tcp_do_rfc3465); VNET_DECLARE(int, tcp_abc_l_var); #define V_tcb VNET(tcb) @@ -635,8 +633,6 @@ VNET_DECLARE(int, tcp_abc_l_var); #define V_tcp_delack_enabled VNET(tcp_delack_enabled) #define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) #define V_path_mtu_discovery VNET(path_mtu_discovery) -#define V_ss_fltsz VNET(ss_fltsz) -#define V_ss_fltsz_local VNET(ss_fltsz_local) #define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) #define V_tcp_abc_l_var VNET(tcp_abc_l_var) From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 14:58:25 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 18E79FD9; Fri, 5 Jul 2013 14:58:25 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0AD3610FD; Fri, 5 Jul 2013 14:58:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65EwOV2066271; Fri, 5 Jul 2013 14:58:24 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65EwObo066269; Fri, 5 Jul 2013 14:58:24 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051458.r65EwObo066269@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 14:58: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: r252789 - stable/9/sys/netinet 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.14 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, 05 Jul 2013 14:58:25 -0000 Author: andre Date: Fri Jul 5 14:58:24 2013 New Revision: 252789 URL: http://svnweb.freebsd.org/changeset/base/252789 Log: MFC r242266: Increase the initial CWND to 10 segments as defined in IETF TCPM draft-ietf-tcpm-initcwnd-05. It explains why the increased initial window improves the overall performance of many web services without risking congestion collapse. As long as it remains a draft it is placed under a sysctl marking it as experimental: net.inet.tcp.experimental.initcwnd10 = 1 When it becomes an official RFC soon the sysctl will be changed to the RFC number and moved to net.inet.tcp. This implementation differs from the RFC draft in that it is a bit more conservative in the case of packet loss on SYN or SYN|ACK because we haven't reduced the default RTO to 1 second yet. Also the restart window isn't yet increased as allowed. Both will be adjusted with upcoming changes. Is is enabled by default. In Linux it is enabled since kernel 3.0. Modified: stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:50:06 2013 (r252788) +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 14:58:24 2013 (r252789) @@ -158,6 +158,14 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_do_rfc3390), 0, "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)"); +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, experimental, CTLFLAG_RW, 0, + "Experimental TCP extensions"); + +VNET_DEFINE(int, tcp_do_initcwnd10) = 1; +SYSCTL_VNET_INT(_net_inet_tcp_experimental, OID_AUTO, initcwnd10, CTLFLAG_RW, + &VNET_NAME(tcp_do_initcwnd10), 0, + "Enable draft-ietf-tcpm-initcwnd-05 (Increasing initial CWND to 10)"); + VNET_DEFINE(int, tcp_do_rfc3465) = 1; SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3465), 0, @@ -341,6 +349,7 @@ cc_conn_init(struct tcpcb *tp) * * RFC5681 Section 3.1 specifies the default conservative values. * RFC3390 specifies slightly more aggressive values. + * Draft-ietf-tcpm-initcwnd-05 increases it to ten segments. * * If a SYN or SYN/ACK was lost and retransmitted, we have to * reduce the initial CWND to one segment as congestion is likely @@ -348,6 +357,9 @@ cc_conn_init(struct tcpcb *tp) */ if (tp->snd_cwnd == 1) tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ + else if (V_tcp_do_initcwnd10) + tp->snd_cwnd = min(10 * tp->t_maxseg, + max(2 * tp->t_maxseg, 14600)); else if (V_tcp_do_rfc3390) tp->snd_cwnd = min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380)); Modified: stable/9/sys/netinet/tcp_var.h ============================================================================== --- stable/9/sys/netinet/tcp_var.h Fri Jul 5 14:50:06 2013 (r252788) +++ stable/9/sys/netinet/tcp_var.h Fri Jul 5 14:58:24 2013 (r252789) @@ -622,6 +622,7 @@ VNET_DECLARE(int, tcp_mssdflt); /* XXX * VNET_DECLARE(int, tcp_minmss); VNET_DECLARE(int, tcp_delack_enabled); VNET_DECLARE(int, tcp_do_rfc3390); +VNET_DECLARE(int, tcp_do_initcwnd10); VNET_DECLARE(int, path_mtu_discovery); VNET_DECLARE(int, tcp_do_rfc3465); VNET_DECLARE(int, tcp_abc_l_var); @@ -632,6 +633,7 @@ VNET_DECLARE(int, tcp_abc_l_var); #define V_tcp_minmss VNET(tcp_minmss) #define V_tcp_delack_enabled VNET(tcp_delack_enabled) #define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) +#define V_tcp_do_initcwnd10 VNET(tcp_do_initcwnd10) #define V_path_mtu_discovery VNET(path_mtu_discovery) #define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) #define V_tcp_abc_l_var VNET(tcp_abc_l_var) From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 15:18:55 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E5FEC80E; Fri, 5 Jul 2013 15:18:55 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D7CF511EB; Fri, 5 Jul 2013 15:18:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65FItj8072933; Fri, 5 Jul 2013 15:18:55 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65FIt53072930; Fri, 5 Jul 2013 15:18:55 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051518.r65FIt53072930@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 15:18: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: r252790 - stable/9/sys/netinet 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.14 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, 05 Jul 2013 15:18:56 -0000 Author: andre Date: Fri Jul 5 15:18:54 2013 New Revision: 252790 URL: http://svnweb.freebsd.org/changeset/base/252790 Log: MFC r242253: Simplify implementation of net.inet.tcp.reass.maxsegments and net.inet.tcp.reass.cursegments. MFC r242254: Change the syncache count reporting the current number of entries from an unprotected u_int that reports garbage on SMP to a function based sysctl obtaining the current value from UMA. Also read back the actual cache_limit after page size rounding by UMA. PR: kern/165879 MFC r244680: Fix sysctl_handle_int() usage. Either arg1 or arg2 should be supplied, and arg2 doesn't pass size of arg1. MFC r246208: uma_zone_set_max() directly returns the rounded effective zone limit. Use the return value directly instead of doing a second uma_zone_set_max() step. Modified: stable/9/sys/netinet/tcp_reass.c stable/9/sys/netinet/tcp_syncache.c stable/9/sys/netinet/tcp_syncache.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_reass.c ============================================================================== --- stable/9/sys/netinet/tcp_reass.c Fri Jul 5 14:58:24 2013 (r252789) +++ stable/9/sys/netinet/tcp_reass.c Fri Jul 5 15:18:54 2013 (r252790) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); #include #endif /* TCPDEBUG */ -static int tcp_reass_sysctl_maxseg(SYSCTL_HANDLER_ARGS); static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS); static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, @@ -82,16 +81,12 @@ static SYSCTL_NODE(_net_inet_tcp, OID_AU static VNET_DEFINE(int, tcp_reass_maxseg) = 0; #define V_tcp_reass_maxseg VNET(tcp_reass_maxseg) -SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, maxsegments, - CTLTYPE_INT | CTLFLAG_RDTUN, - &VNET_NAME(tcp_reass_maxseg), 0, &tcp_reass_sysctl_maxseg, "I", +SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN, + &VNET_NAME(tcp_reass_maxseg), 0, "Global maximum number of TCP Segments in Reassembly Queue"); -static VNET_DEFINE(int, tcp_reass_qsize) = 0; -#define V_tcp_reass_qsize VNET(tcp_reass_qsize) SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments, - CTLTYPE_INT | CTLFLAG_RD, - &VNET_NAME(tcp_reass_qsize), 0, &tcp_reass_sysctl_qsize, "I", + (CTLTYPE_INT | CTLFLAG_RD), NULL, 0, &tcp_reass_sysctl_qsize, "I", "Global number of TCP Segments currently in Reassembly Queue"); static VNET_DEFINE(int, tcp_reass_overflows) = 0; @@ -109,8 +104,10 @@ static void tcp_reass_zone_change(void *tag) { + /* Set the zone limit and read back the effective value. */ V_tcp_reass_maxseg = nmbclusters / 16; - uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); + V_tcp_reass_maxseg = uma_zone_set_max(V_tcp_reass_zone, + V_tcp_reass_maxseg); } void @@ -122,7 +119,9 @@ tcp_reass_init(void) &V_tcp_reass_maxseg); V_tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); - uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); + /* Set the zone limit and read back the effective value. */ + V_tcp_reass_maxseg = uma_zone_set_max(V_tcp_reass_zone, + V_tcp_reass_maxseg); EVENTHANDLER_REGISTER(nmbclusters_change, tcp_reass_zone_change, NULL, EVENTHANDLER_PRI_ANY); } @@ -156,17 +155,12 @@ tcp_reass_flush(struct tcpcb *tp) } static int -tcp_reass_sysctl_maxseg(SYSCTL_HANDLER_ARGS) -{ - V_tcp_reass_maxseg = uma_zone_get_max(V_tcp_reass_zone); - return (sysctl_handle_int(oidp, arg1, arg2, req)); -} - -static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS) { - V_tcp_reass_qsize = uma_zone_get_cur(V_tcp_reass_zone); - return (sysctl_handle_int(oidp, arg1, arg2, req)); + int qsize; + + qsize = uma_zone_get_cur(V_tcp_reass_zone); + return (sysctl_handle_int(oidp, &qsize, 0, req)); } int Modified: stable/9/sys/netinet/tcp_syncache.c ============================================================================== --- stable/9/sys/netinet/tcp_syncache.c Fri Jul 5 14:58:24 2013 (r252789) +++ stable/9/sys/netinet/tcp_syncache.c Fri Jul 5 15:18:54 2013 (r252790) @@ -123,6 +123,7 @@ struct syncache *syncache_lookup(struct static int syncache_respond(struct syncache *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); +static int syncache_sysctl_count(SYSCTL_HANDLER_ARGS); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, int docallout); static void syncache_timer(void *); @@ -158,8 +159,8 @@ SYSCTL_VNET_UINT(_net_inet_tcp_syncache, &VNET_NAME(tcp_syncache.cache_limit), 0, "Overall entry limit for syncache"); -SYSCTL_VNET_UINT(_net_inet_tcp_syncache, OID_AUTO, count, CTLFLAG_RD, - &VNET_NAME(tcp_syncache.cache_count), 0, +SYSCTL_VNET_PROC(_net_inet_tcp_syncache, OID_AUTO, count, (CTLTYPE_UINT|CTLFLAG_RD), + NULL, 0, &syncache_sysctl_count, "IU", "Current number of entries in syncache"); SYSCTL_VNET_UINT(_net_inet_tcp_syncache, OID_AUTO, hashsize, CTLFLAG_RDTUN, @@ -225,7 +226,6 @@ syncache_init(void) { int i; - V_tcp_syncache.cache_count = 0; V_tcp_syncache.hashsize = TCP_SYNCACHE_HASHSIZE; V_tcp_syncache.bucket_limit = TCP_SYNCACHE_BUCKETLIMIT; V_tcp_syncache.rexmt_limit = SYNCACHE_MAXREXMTS; @@ -268,7 +268,8 @@ syncache_init(void) /* Create the syncache entry zone. */ V_tcp_syncache.zone = uma_zcreate("syncache", sizeof(struct syncache), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - uma_zone_set_max(V_tcp_syncache.zone, V_tcp_syncache.cache_limit); + V_tcp_syncache.cache_limit = uma_zone_set_max(V_tcp_syncache.zone, + V_tcp_syncache.cache_limit); } #ifdef VIMAGE @@ -296,8 +297,8 @@ syncache_destroy(void) mtx_destroy(&sch->sch_mtx); } - KASSERT(V_tcp_syncache.cache_count == 0, ("%s: cache_count %d not 0", - __func__, V_tcp_syncache.cache_count)); + KASSERT(uma_zone_get_cur(V_tcp_syncache.zone) == 0, + ("%s: cache_count not 0", __func__)); /* Free the allocated global resources. */ uma_zdestroy(V_tcp_syncache.zone); @@ -305,6 +306,15 @@ syncache_destroy(void) } #endif +static int +syncache_sysctl_count(SYSCTL_HANDLER_ARGS) +{ + int count; + + count = uma_zone_get_cur(V_tcp_syncache.zone); + return (sysctl_handle_int(oidp, &count, 0, req)); +} + /* * Inserts a syncache entry into the specified bucket row. * Locks and unlocks the syncache_head autonomously. @@ -347,7 +357,6 @@ syncache_insert(struct syncache *sc, str SCH_UNLOCK(sch); - V_tcp_syncache.cache_count++; TCPSTAT_INC(tcps_sc_added); } @@ -373,7 +382,6 @@ syncache_drop(struct syncache *sc, struc #endif syncache_free(sc); - V_tcp_syncache.cache_count--; } /* @@ -958,7 +966,6 @@ syncache_expand(struct in_conninfo *inc, tod->tod_syncache_removed(tod, sc->sc_todctx); } #endif - V_tcp_syncache.cache_count--; SCH_UNLOCK(sch); } Modified: stable/9/sys/netinet/tcp_syncache.h ============================================================================== --- stable/9/sys/netinet/tcp_syncache.h Fri Jul 5 14:58:24 2013 (r252789) +++ stable/9/sys/netinet/tcp_syncache.h Fri Jul 5 15:18:54 2013 (r252790) @@ -113,7 +113,6 @@ struct tcp_syncache { u_int hashsize; u_int hashmask; u_int bucket_limit; - u_int cache_count; /* XXX: unprotected */ u_int cache_limit; u_int rexmt_limit; u_int hash_secret; From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 15:26:13 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 231E5A10; Fri, 5 Jul 2013 15:26:13 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 151661230; Fri, 5 Jul 2013 15:26:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65FQC6V075489; Fri, 5 Jul 2013 15:26:12 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65FQCQp075488; Fri, 5 Jul 2013 15:26:12 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051526.r65FQCQp075488@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 15:26:12 +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: r252791 - stable/9/usr.bin/fetch 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.14 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, 05 Jul 2013 15:26:13 -0000 Author: andre Date: Fri Jul 5 15:26:12 2013 New Revision: 252791 URL: http://svnweb.freebsd.org/changeset/base/252791 Log: MFC r243147: Change fetch(1) to: o Report the instantaneous bandwidth instead of an average since the beginning of the download. o At the finish of the download report the average bandwidth and also the total time it took instead of 00m00s. Reviewed by: des MFC r244058: Fix bandwidth reporting when doing a restarted download with "-r". The offset is already accounted for in xs->lastrcvd and doesn't have to be subtracted again. Reported by: Florian Smeets Submitted by: Mateusz Guzik Tested by: Florian Smeets Modified: stable/9/usr.bin/fetch/fetch.c Directory Properties: stable/9/ (props changed) stable/9/usr.bin/ (props changed) stable/9/usr.bin/fetch/ (props changed) Modified: stable/9/usr.bin/fetch/fetch.c ============================================================================== --- stable/9/usr.bin/fetch/fetch.c Fri Jul 5 15:18:54 2013 (r252790) +++ stable/9/usr.bin/fetch/fetch.c Fri Jul 5 15:26:12 2013 (r252791) @@ -115,11 +115,13 @@ sig_handler(int sig) struct xferstat { char name[64]; - struct timeval start; - struct timeval last; - off_t size; - off_t offset; - off_t rcvd; + struct timeval start; /* start of transfer */ + struct timeval last; /* time of last update */ + struct timeval last2; /* time of previous last update */ + off_t size; /* size of file per HTTP hdr */ + off_t offset; /* starting offset in file */ + off_t rcvd; /* bytes already received */ + off_t lastrcvd; /* bytes received since last update */ }; /* @@ -139,9 +141,12 @@ stat_eta(struct xferstat *xs) if (eta > 3600) snprintf(str, sizeof str, "%02ldh%02ldm", eta / 3600, (eta % 3600) / 60); - else + else if (eta > 0) snprintf(str, sizeof str, "%02ldm%02lds", eta / 60, eta % 60); + else + snprintf(str, sizeof str, "%02ldm%02lds", + elapsed / 60, elapsed % 60); return (str); } @@ -173,11 +178,12 @@ stat_bps(struct xferstat *xs) double delta, bps; delta = (xs->last.tv_sec + (xs->last.tv_usec / 1.e6)) - - (xs->start.tv_sec + (xs->start.tv_usec / 1.e6)); + - (xs->last2.tv_sec + (xs->last2.tv_usec / 1.e6)); + if (delta == 0.0) { snprintf(str, sizeof str, "?? Bps"); } else { - bps = (xs->rcvd - xs->offset) / delta; + bps = (xs->rcvd - xs->lastrcvd) / delta; snprintf(str, sizeof str, "%sps", stat_bytes((off_t)bps)); } return (str); @@ -200,6 +206,7 @@ stat_display(struct xferstat *xs, int fo gettimeofday(&now, NULL); if (!force && now.tv_sec <= xs->last.tv_sec) return; + xs->last2 = xs->last; xs->last = now; fprintf(stderr, "\r%-46.46s", xs->name); @@ -214,10 +221,16 @@ stat_display(struct xferstat *xs, int fo (int)((100.0 * xs->rcvd) / xs->size), stat_bytes(xs->size)); } + if (force == 2) { + xs->lastrcvd = xs->offset; + xs->last2 = xs->start; + } fprintf(stderr, " %s", stat_bps(xs)); - if (xs->size > 0 && xs->rcvd > 0 && - xs->last.tv_sec >= xs->start.tv_sec + 10) + if ((xs->size > 0 && xs->rcvd > 0 && + xs->last.tv_sec >= xs->start.tv_sec + 3) || + force == 2) fprintf(stderr, " %s", stat_eta(xs)); + xs->lastrcvd = xs->rcvd; } /* @@ -232,6 +245,7 @@ stat_start(struct xferstat *xs, const ch xs->size = size; xs->offset = offset; xs->rcvd = offset; + xs->lastrcvd = offset; if (v_tty && v_level > 0) stat_display(xs, 1); else if (v_level > 0) @@ -257,7 +271,7 @@ stat_end(struct xferstat *xs) { gettimeofday(&xs->last, NULL); if (v_tty && v_level > 0) { - stat_display(xs, 1); + stat_display(xs, 2); putc('\n', stderr); } else if (v_level > 0) { fprintf(stderr, " %s %s\n", From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 15:30:03 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0841BB72; Fri, 5 Jul 2013 15:30:03 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DF372124F; Fri, 5 Jul 2013 15:30:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65FU2sR076017; Fri, 5 Jul 2013 15:30:02 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65FU2So076016; Fri, 5 Jul 2013 15:30:02 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051530.r65FU2So076016@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 15:30: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: r252792 - stable/9/share/man/man7 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.14 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, 05 Jul 2013 15:30:03 -0000 Author: andre Date: Fri Jul 5 15:30:02 2013 New Revision: 252792 URL: http://svnweb.freebsd.org/changeset/base/252792 Log: MFC r244039: Remove outdated reference to tcp inflight tuning. Modified: stable/9/share/man/man7/tuning.7 Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man7/ (props changed) Modified: stable/9/share/man/man7/tuning.7 ============================================================================== --- stable/9/share/man/man7/tuning.7 Fri Jul 5 15:26:12 2013 (r252791) +++ stable/9/share/man/man7/tuning.7 Fri Jul 5 15:30:02 2013 (r252792) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2010 +.Dd December 8, 2012 .Dt TUNING 7 .Os .Sh NAME @@ -666,52 +666,6 @@ the sysctl rather than disable delayed acks. .Pp The -.Va net.inet.tcp.inflight.enable -sysctl turns on bandwidth delay product limiting for all TCP connections. -The system will attempt to calculate the bandwidth delay product for each -connection and limit the amount of data queued to the network to just the -amount required to maintain optimum throughput. -This feature is useful -if you are serving data over modems, GigE, or high speed WAN links (or -any other link with a high bandwidth*delay product), especially if you are -also using window scaling or have configured a large send window. -If you enable this option, you should also be sure to set -.Va net.inet.tcp.inflight.debug -to 0 (disable debugging), and for production use setting -.Va net.inet.tcp.inflight.min -to at least 6144 may be beneficial. -Note however, that setting high -minimums may effectively disable bandwidth limiting depending on the link. -The limiting feature reduces the amount of data built up in intermediate -router and switch packet queues as well as reduces the amount of data built -up in the local host's interface queue. -With fewer packets queued up, -interactive connections, especially over slow modems, will also be able -to operate with lower round trip times. -However, note that this feature -only affects data transmission (uploading / server-side). -It does not -affect data reception (downloading). -.Pp -Adjusting -.Va net.inet.tcp.inflight.stab -is not recommended. -This parameter defaults to 20, representing 2 maximal packets added -to the bandwidth delay product window calculation. -The additional -window is required to stabilize the algorithm and improve responsiveness -to changing conditions, but it can also result in higher ping times -over slow links (though still much lower than you would get without -the inflight algorithm). -In such cases you may -wish to try reducing this parameter to 15, 10, or 5, and you may also -have to reduce -.Va net.inet.tcp.inflight.min -(for example, to 3500) to get the desired effect. -Reducing these parameters -should be done as a last resort only. -.Pp -The .Va net.inet.ip.portrange.* sysctls control the port number ranges automatically bound to TCP and UDP sockets. From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 15:47:59 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EAD6137D; Fri, 5 Jul 2013 15:47:59 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DBD221353; Fri, 5 Jul 2013 15:47:59 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Flx3J081511; Fri, 5 Jul 2013 15:47:59 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65FlxFF081510; Fri, 5 Jul 2013 15:47:59 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051547.r65FlxFF081510@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 15: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: r252793 - stable/9/sys/netinet 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.14 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, 05 Jul 2013 15:48:00 -0000 Author: andre Date: Fri Jul 5 15:47:59 2013 New Revision: 252793 URL: http://svnweb.freebsd.org/changeset/base/252793 Log: MFC r242251, r242311: Defer sending an independent window update if a delayed ACK is pending saving a packet. The window update then gets piggy-backed on the next already scheduled ACK. MFC r242252: Prevent a flurry of forced window updates when an application is doing small reads on a (partially) filled receive socket buffer. Normally one would a send a window update every time the available space in the socket buffer increases by two times MSS. This leads to a flurry of window updates that do not provide any meaningful new information to the sender. There still is available space in the window and the sender can continue sending data. All window updates then get carried by the regular ACKs. Only when the socket buffer was (almost) full and the window closed accordingly a window updates delivery new information and allows the sender to start sending more data again. Send window updates only every two MSS when the socket buffer has less than 1/8 space available, or the available space in the socket buffer increased by 1/4 its full capacity, or the socket buffer is very small. The next regular data ACK will carry and report the exact window size again. Reported by: sbruno Tested by: darrenr Tested by: Darren Baginski PR: kern/116335 Modified: stable/9/sys/netinet/tcp_output.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_output.c ============================================================================== --- stable/9/sys/netinet/tcp_output.c Fri Jul 5 15:30:02 2013 (r252792) +++ stable/9/sys/netinet/tcp_output.c Fri Jul 5 15:47:59 2013 (r252793) @@ -540,19 +540,39 @@ after_sack_rexmit: } /* - * Compare available window to amount of window - * known to peer (as advertised window less - * next expected input). If the difference is at least two - * max size segments, or at least 50% of the maximum possible - * window, then want to send a window update to peer. - * Skip this if the connection is in T/TCP half-open state. - * Don't send pure window updates when the peer has closed - * the connection and won't ever send more data. + * Sending of standalone window updates. + * + * Window updates are important when we close our window due to a + * full socket buffer and are opening it again after the application + * reads data from it. Once the window has opened again and the + * remote end starts to send again the ACK clock takes over and + * provides the most current window information. + * + * We must avoid the silly window syndrome whereas every read + * from the receive buffer, no matter how small, causes a window + * update to be sent. We also should avoid sending a flurry of + * window updates when the socket buffer had queued a lot of data + * and the application is doing small reads. + * + * Prevent a flurry of pointless window updates by only sending + * an update when we can increase the advertized window by more + * than 1/4th of the socket buffer capacity. When the buffer is + * getting full or is very small be more aggressive and send an + * update whenever we can increase by two mss sized segments. + * In all other situations the ACK's to new incoming data will + * carry further window increases. + * + * Don't send an independent window update if a delayed + * ACK is pending (it will get piggy-backed on it) or the + * remote side already has done a half-close and won't send + * more data. Skip this if the connection is in T/TCP + * half-open state. */ if (recwin > 0 && !(tp->t_flags & TF_NEEDSYN) && + !(tp->t_flags & TF_DELACK) && !TCPS_HAVERCVDFIN(tp->t_state)) { /* - * "adv" is the amount we can increase the window, + * "adv" is the amount we could increase the window, * taking into account that we are limited by * TCP_MAXWIN << tp->rcv_scale. */ @@ -572,9 +592,11 @@ after_sack_rexmit: */ if (oldwin >> tp->rcv_scale == (adv + oldwin) >> tp->rcv_scale) goto dontupdate; - if (adv >= (long) (2 * tp->t_maxseg)) - goto send; - if (2 * adv >= (long) so->so_rcv.sb_hiwat) + + if (adv >= (long)(2 * tp->t_maxseg) && + (adv >= (long)(so->so_rcv.sb_hiwat / 4) || + recwin <= (long)(so->so_rcv.sb_hiwat / 8) || + so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg)) goto send; } dontupdate: From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 15:57:36 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A0E64691; Fri, 5 Jul 2013 15:57:36 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8304013B0; Fri, 5 Jul 2013 15:57:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Fvama084323; Fri, 5 Jul 2013 15:57:36 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65Fvaix084322; Fri, 5 Jul 2013 15:57:36 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051557.r65Fvaix084322@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 15:57: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: r252794 - stable/9/sys/netinet 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.14 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, 05 Jul 2013 15:57:36 -0000 Author: andre Date: Fri Jul 5 15:57:36 2013 New Revision: 252794 URL: http://svnweb.freebsd.org/changeset/base/252794 Log: MFC r242257: Remove bogus 'else' in #ifdef that prevented the rttvar from being reset tcp_timer_rexmt() on retransmit for IPv6 sessions. MFC r242260: When retransmitting SYN in TCPS_SYN_SENT state use TCPTV_RTOBASE, the default retransmit timeout, as base to calculate the backoff time until next try instead of the TCP_REXMTVAL() macro which only works correctly when we already have measured an actual RTT+RTTVAR. MFC r242263, r242264: Add SACK_PERMIT to the list of TCP options that are switched off after retransmitting a SYN three times. MFC r242267: If the user has closed the socket then drop a persisting connection after a much reduced timeout. Typically web servers close their sockets quickly under the assumption that the TCP connections goes away as well. That is not entirely true however. If the peer closed the window we're going to wait for a long time with lots of data in the send buffer. Modified: stable/9/sys/netinet/tcp_timer.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_timer.c ============================================================================== --- stable/9/sys/netinet/tcp_timer.c Fri Jul 5 15:47:59 2013 (r252793) +++ stable/9/sys/netinet/tcp_timer.c Fri Jul 5 15:57:36 2013 (r252794) @@ -453,6 +453,16 @@ tcp_timer_persist(void *xtp) tp = tcp_drop(tp, ETIMEDOUT); goto out; } + /* + * If the user has closed the socket then drop a persisting + * connection after a much reduced timeout. + */ + if (tp->t_state > TCPS_CLOSE_WAIT && + (ticks - tp->t_rcvtime) >= TCPTV_PERSMAX) { + TCPSTAT_INC(tcps_persistdrop); + tp = tcp_drop(tp, ETIMEDOUT); + goto out; + } tcp_setpersist(tp); tp->t_flags |= TF_FORCEDATA; (void) tcp_output(tp); @@ -578,13 +588,13 @@ tcp_timer_rexmt(void * xtp) tp->t_flags &= ~TF_PREVVALID; TCPSTAT_INC(tcps_rexmttimeo); if (tp->t_state == TCPS_SYN_SENT) - rexmt = TCP_REXMTVAL(tp) * tcp_syn_backoff[tp->t_rxtshift]; + rexmt = TCPTV_RTOBASE * tcp_syn_backoff[tp->t_rxtshift]; else rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; TCPT_RANGESET(tp->t_rxtcur, rexmt, tp->t_rttmin, TCPTV_REXMTMAX); /* - * Disable rfc1323 if we haven't got any response to + * Disable RFC1323 and SACK if we haven't got any response to * our third SYN to work-around some broken terminal servers * (most of which have hopefully been retired) that have bad VJ * header compression code which trashes TCP segments containing @@ -592,7 +602,7 @@ tcp_timer_rexmt(void * xtp) */ if (tcp_rexmit_drop_options && (tp->t_state == TCPS_SYN_SENT) && (tp->t_rxtshift == 3)) - tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP); + tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP|TF_SACK_PERMIT); /* * If we backed off this far, our srtt estimate is probably bogus. * Clobber it so we'll take the next rtt measurement as our srtt; @@ -603,7 +613,6 @@ tcp_timer_rexmt(void * xtp) #ifdef INET6 if ((tp->t_inpcb->inp_vflag & INP_IPV6) != 0) in6_losing(tp->t_inpcb); - else #endif tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT); tp->t_srtt = 0; From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 16:03:20 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 57802A18; Fri, 5 Jul 2013 16:03:20 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 47E25147E; Fri, 5 Jul 2013 16:03:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65G3KHQ086966; Fri, 5 Jul 2013 16:03:20 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65G3Ku1086965; Fri, 5 Jul 2013 16:03:20 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051603.r65G3Ku1086965@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 16:03: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: r252796 - 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.14 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, 05 Jul 2013 16:03:20 -0000 Author: andre Date: Fri Jul 5 16:03:19 2013 New Revision: 252796 URL: http://svnweb.freebsd.org/changeset/base/252796 Log: MFC r242256: Improve m_cat() by being able to also merge contents from M_EXT mbuf's by doing proper testing with M_WRITABLE(). In m_collapse() replace an incomplete manual check for M_RDONLY with the M_WRITABLE() macro that also tests for shared buffers and other cases that make a particular mbuf immutable. Modified: stable/9/sys/kern/uipc_mbuf.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_mbuf.c ============================================================================== --- stable/9/sys/kern/uipc_mbuf.c Fri Jul 5 16:00:01 2013 (r252795) +++ stable/9/sys/kern/uipc_mbuf.c Fri Jul 5 16:03:19 2013 (r252796) @@ -911,8 +911,8 @@ m_cat(struct mbuf *m, struct mbuf *n) while (m->m_next) m = m->m_next; while (n) { - if (m->m_flags & M_EXT || - m->m_data + m->m_len + n->m_len >= &m->m_dat[MLEN]) { + if (!M_WRITABLE(m) || + M_TRAILINGSPACE(m) < n->m_len) { /* just join the two chains */ m->m_next = n; return; @@ -1584,7 +1584,7 @@ again: n = m->m_next; if (n == NULL) break; - if ((m->m_flags & M_RDONLY) == 0 && + if (M_WRITABLE(m) && n->m_len < M_TRAILINGSPACE(m)) { bcopy(mtod(n, void *), mtod(m, char *) + m->m_len, n->m_len); From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 17:57:26 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 35708313; Fri, 5 Jul 2013 17:57:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0D46019DB; Fri, 5 Jul 2013 17:57:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65HvPKN020958; Fri, 5 Jul 2013 17:57:25 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65HvP90020957; Fri, 5 Jul 2013 17:57:25 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201307051757.r65HvP90020957@svn.freebsd.org> From: Ed Maste Date: Fri, 5 Jul 2013 17:57: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: r252812 - stable/9/tools/build/options 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.14 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, 05 Jul 2013 17:57:26 -0000 Author: emaste Date: Fri Jul 5 17:57:25 2013 New Revision: 252812 URL: http://svnweb.freebsd.org/changeset/base/252812 Log: MFC r251601, r251685: Handle options that override other options Modified: stable/9/tools/build/options/makeman Directory Properties: stable/9/tools/build/options/ (props changed) Modified: stable/9/tools/build/options/makeman ============================================================================== --- stable/9/tools/build/options/makeman Fri Jul 5 17:56:15 2013 (r252811) +++ stable/9/tools/build/options/makeman Fri Jul 5 17:57:25 2013 (r252812) @@ -198,7 +198,12 @@ that can be used for source builds. .Bl -tag -width indent EOF show settings SRCCONF=/dev/null | sort > $t/config_default - show with SRCCONF=/dev/null | sort > $t/config_WITH_ALL + # Work around WITH_LDNS_UTILS forcing BIND_UTILS off by parsing the + # actual config that results from enabling every WITH_ option. This + # can be reverted if/when we no longer have options that disable + # others. + show with SRCCONF=/dev/null | sort | sed 's/$/=/' > $t/src.conf + show settings SRCCONF=$t/src.conf | sort > $t/config_WITH_ALL show without SRCCONF=/dev/null | sort > $t/config_WITHOUT_ALL show_options | @@ -229,6 +234,18 @@ EOF exit 1 fi + show settings SRCCONF=/dev/null -D${opt} | sort > $t/config_${opt} + comm -13 $t/config_default $t/config_${opt} | sed -n "/^${opt}$/!p" | + comm -13 $t/deps - > $t/deps2 + + # Work around BIND_UTILS=no being the default when every WITH_ + # option is enabled. + if [ "$(cat $t/deps2)" = WITHOUT_BIND_UTILS ]; then + sort $t/deps $t/deps2 > $t/_deps + mv $t/_deps $t/deps + :> $t/deps2 + fi + if [ -s $t/deps ] ; then echo 'When set, it also enforces the following options:' echo '.Pp' @@ -240,10 +257,6 @@ EOF echo '.El' fi - show settings SRCCONF=/dev/null -D${opt} | sort > $t/config_${opt} - comm -13 $t/config_default $t/config_${opt} | sed -n "/^${opt}$/!p" | - comm -13 $t/deps - > $t/deps2 - if [ -s $t/deps2 ] ; then if [ -s $t/deps ] ; then echo '.Pp' From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 18:27:41 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 34216A82; Fri, 5 Jul 2013 18:27:41 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 23ABD1B36; Fri, 5 Jul 2013 18:27:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65IRe3o030218; Fri, 5 Jul 2013 18:27:40 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IRdIu030207; Fri, 5 Jul 2013 18:27:39 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201307051827.r65IRdIu030207@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 5 Jul 2013 18:27: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: r252814 - in stable/9/sys: conf dev/cxgbe dev/cxgbe/common dev/cxgbe/firmware dev/cxgbe/tom modules/cxgb modules/cxgbe modules/cxgbe/t4_firmware modules/cxgbe/t5_firmware 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.14 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, 05 Jul 2013 18:27:41 -0000 Author: np Date: Fri Jul 5 18:27:38 2013 New Revision: 252814 URL: http://svnweb.freebsd.org/changeset/base/252814 Log: - MFC r252661, r252705, r252711, r252715, r252716, r252724, r252728, r252747. - Connect t3_tom and t4_tom to the build (r252555 enables them). r252661: - Include the T5 firmware with the driver. - Update the T4 firmware to the latest. - Minor reorganization and updates to the version macros, etc. r252705: - Read all TP parameters in one place. - Read the filter mode, calculate various shifts, and use them properly during active open (in select_ntuple). r252711: The T5 allows the driver to specify the ISS. Do so; use the ISS picked by the kernel. r252715: Ring the egress queue's doorbell as soon as there are 8 or more descriptors ready to be processed. r252716: Pay attention to TCP_NODELAY when it's set/unset after the connection is established. r252724: On-the-fly changes to the interrupt coalescing timer should apply to the TOE rx queues too. r252728: - Make note of interface MTU change if the rx queues exist, and not just when the interface is up. - Add a tunable to control the TOE's rx coalesce feature (enabled by default as it always has been). Consider the interface MTU or the coalesce size when deciding which cluster zone to use to fill the offload rx queue's free list. The tunable is: dev.{t4nex,t5nex}..toe.rx_coalesce r252747: - Show the reason why link is down if this information is available. - Display the temperature and PHY firmware version of the BT PHY. Added: stable/9/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu - copied unchanged from r252661, head/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu stable/9/sys/dev/cxgbe/firmware/t5fw-1.8.22.0.bin.uu - copied unchanged from r252661, head/sys/dev/cxgbe/firmware/t5fw-1.8.22.0.bin.uu stable/9/sys/dev/cxgbe/firmware/t5fw_cfg.txt - copied unchanged from r252661, head/sys/dev/cxgbe/firmware/t5fw_cfg.txt stable/9/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt - copied unchanged from r252661, head/sys/dev/cxgbe/firmware/t5fw_cfg_fpga.txt stable/9/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt - copied unchanged from r252661, head/sys/dev/cxgbe/firmware/t5fw_cfg_uwire.txt stable/9/sys/modules/cxgbe/t5_firmware/ - copied from r252661, head/sys/modules/cxgbe/t5_firmware/ Deleted: stable/9/sys/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu Modified: stable/9/sys/conf/files stable/9/sys/dev/cxgbe/adapter.h stable/9/sys/dev/cxgbe/common/common.h stable/9/sys/dev/cxgbe/common/t4_hw.c stable/9/sys/dev/cxgbe/common/t4_hw.h stable/9/sys/dev/cxgbe/common/t4_msg.h stable/9/sys/dev/cxgbe/common/t4_regs_values.h stable/9/sys/dev/cxgbe/firmware/t4fw_cfg.txt stable/9/sys/dev/cxgbe/firmware/t4fw_cfg_uwire.txt stable/9/sys/dev/cxgbe/firmware/t4fw_interface.h stable/9/sys/dev/cxgbe/offload.h stable/9/sys/dev/cxgbe/t4_main.c stable/9/sys/dev/cxgbe/t4_sge.c stable/9/sys/dev/cxgbe/tom/t4_connect.c stable/9/sys/dev/cxgbe/tom/t4_listen.c stable/9/sys/dev/cxgbe/tom/t4_tom.c stable/9/sys/dev/cxgbe/tom/t4_tom.h stable/9/sys/modules/cxgb/Makefile stable/9/sys/modules/cxgbe/Makefile stable/9/sys/modules/cxgbe/t4_firmware/Makefile Directory Properties: 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/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Fri Jul 5 18:03:00 2013 (r252813) +++ stable/9/sys/conf/files Fri Jul 5 18:27:38 2013 (r252814) @@ -965,10 +965,34 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.8.4.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" +t5fw_cfg.c optional cxgbe \ + compile-with "${AWK} -f $S/tools/fw_stub.awk t5fw_cfg.fw:t5fw_cfg t5fw.fw:t5fw -mt5fw_cfg -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "t5fw_cfg.c" +t5fw_cfg.fwo optional cxgbe \ + dependency "t5fw_cfg.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t5fw_cfg.fwo" +t5fw_cfg.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t5fw_cfg.txt" \ + compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "t5fw_cfg.fw" +t5fw.fwo optional cxgbe \ + dependency "t5fw.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t5fw.fwo" +t5fw.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.8.22.0.bin.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "t5fw.fw" dev/cy/cy.c optional cy dev/cy/cy_isa.c optional cy isa dev/cy/cy_pci.c optional cy pci Modified: stable/9/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/9/sys/dev/cxgbe/adapter.h Fri Jul 5 18:03:00 2013 (r252813) +++ stable/9/sys/dev/cxgbe/adapter.h Fri Jul 5 18:27:38 2013 (r252814) @@ -132,7 +132,6 @@ enum { #else FL_BUF_SIZES = 3, /* cluster, jumbo9k, jumbo16k */ #endif - OFLD_BUF_SIZE = MJUM16BYTES, /* size of fl buffer for TOE rxq */ CTRL_EQ_QSIZE = 128, @@ -219,6 +218,7 @@ struct port_info { int qsize_rxq; int qsize_txq; + int linkdnrc; struct link_config link_cfg; struct port_stats stats; @@ -562,7 +562,6 @@ struct adapter { struct taskqueue *tq[NCHAN]; /* taskqueues that flush data out */ struct port_info *port[MAX_NPORTS]; uint8_t chan_map[NCHAN]; - uint32_t filter_mode; #ifdef TCP_OFFLOAD void *tom_softc; /* (struct tom_data *) */ @@ -778,7 +777,7 @@ int t4_os_find_pci_capability(struct ada int t4_os_pci_save_state(struct adapter *); int t4_os_pci_restore_state(struct adapter *); void t4_os_portmod_changed(const struct adapter *, int); -void t4_os_link_changed(struct adapter *, int, int); +void t4_os_link_changed(struct adapter *, int, int, int); void t4_iterate(void (*)(struct adapter *, void *), void *); int t4_register_cpl_handler(struct adapter *, int, cpl_handler_t); int t4_register_an_handler(struct adapter *, an_handler_t); Modified: stable/9/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/9/sys/dev/cxgbe/common/common.h Fri Jul 5 18:03:00 2013 (r252813) +++ stable/9/sys/dev/cxgbe/common/common.h Fri Jul 5 18:27:38 2013 (r252814) @@ -67,16 +67,6 @@ enum { PAUSE_AUTONEG = 1 << 2 }; -#define FW_VERSION_MAJOR_T4 1 -#define FW_VERSION_MINOR_T4 8 -#define FW_VERSION_MICRO_T4 4 -#define FW_VERSION_BUILD_T4 0 - -#define FW_VERSION_MAJOR_T5 0 -#define FW_VERSION_MINOR_T5 5 -#define FW_VERSION_MICRO_T5 18 -#define FW_VERSION_BUILD_T5 0 - struct memwin { uint32_t base; uint32_t aperture; @@ -229,6 +219,12 @@ struct tp_params { unsigned int dack_re; /* DACK timer resolution */ unsigned int la_mask; /* what events are recorded by TP LA */ unsigned short tx_modq[NCHAN]; /* channel to modulation queue map */ + uint32_t vlan_pri_map; + uint32_t ingress_config; + int8_t vlan_shift; + int8_t vnic_shift; + int8_t port_shift; + int8_t protocol_shift; }; struct vpd_params { @@ -431,6 +427,8 @@ int t4_get_tp_version(struct adapter *ad int t4_check_fw_version(struct adapter *adapter); int t4_init_hw(struct adapter *adapter, u32 fw_params); int t4_prep_adapter(struct adapter *adapter); +int t4_init_tp_params(struct adapter *adap); +int t4_filter_field_shift(const struct adapter *adap, int filter_sel); int t4_port_init(struct port_info *p, int mbox, int pf, int vf); int t4_reinit_adapter(struct adapter *adap); void t4_fatal_err(struct adapter *adapter); Modified: stable/9/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/9/sys/dev/cxgbe/common/t4_hw.c Fri Jul 5 18:03:00 2013 (r252813) +++ stable/9/sys/dev/cxgbe/common/t4_hw.c Fri Jul 5 18:27:38 2013 (r252814) @@ -975,14 +975,14 @@ int t4_check_fw_version(struct adapter * switch (chip_id(adapter)) { case CHELSIO_T4: - exp_major = FW_VERSION_MAJOR_T4; - exp_minor = FW_VERSION_MINOR_T4; - exp_micro = FW_VERSION_MICRO_T4; + exp_major = T4FW_VERSION_MAJOR; + exp_minor = T4FW_VERSION_MINOR; + exp_micro = T4FW_VERSION_MICRO; break; case CHELSIO_T5: - exp_major = FW_VERSION_MAJOR_T5; - exp_minor = FW_VERSION_MINOR_T5; - exp_micro = FW_VERSION_MICRO_T5; + exp_major = T5FW_VERSION_MAJOR; + exp_minor = T5FW_VERSION_MINOR; + exp_micro = T5FW_VERSION_MICRO; break; default: CH_ERR(adapter, "Unsupported chip type, %x\n", @@ -1128,7 +1128,19 @@ int t4_load_fw(struct adapter *adap, con const u32 *p = (const u32 *)fw_data; const struct fw_hdr *hdr = (const struct fw_hdr *)fw_data; unsigned int sf_sec_size = adap->params.sf_size / adap->params.sf_nsec; - + unsigned int fw_start_sec; + unsigned int fw_start; + unsigned int fw_size; + + if (ntohl(hdr->magic) == FW_HDR_MAGIC_BOOTSTRAP) { + fw_start_sec = FLASH_FWBOOTSTRAP_START_SEC; + fw_start = FLASH_FWBOOTSTRAP_START; + fw_size = FLASH_FWBOOTSTRAP_MAX_SIZE; + } else { + fw_start_sec = FLASH_FW_START_SEC; + fw_start = FLASH_FW_START; + fw_size = FLASH_FW_MAX_SIZE; + } if (!size) { CH_ERR(adap, "FW image has no data\n"); return -EINVAL; @@ -1141,9 +1153,8 @@ int t4_load_fw(struct adapter *adap, con CH_ERR(adap, "FW image size differs from size in FW header\n"); return -EINVAL; } - if (size > FLASH_FW_MAX_SIZE) { - CH_ERR(adap, "FW image too large, max is %u bytes\n", - FLASH_FW_MAX_SIZE); + if (size > fw_size) { + CH_ERR(adap, "FW image too large, max is %u bytes\n", fw_size); return -EFBIG; } if ((is_t4(adap) && hdr->chip != FW_HDR_CHIP_T4) || @@ -1164,8 +1175,7 @@ int t4_load_fw(struct adapter *adap, con } i = DIV_ROUND_UP(size, sf_sec_size); /* # of sectors spanned */ - ret = t4_flash_erase_sectors(adap, FLASH_FW_START_SEC, - FLASH_FW_START_SEC + i - 1); + ret = t4_flash_erase_sectors(adap, fw_start_sec, fw_start_sec + i - 1); if (ret) goto out; @@ -1176,11 +1186,11 @@ int t4_load_fw(struct adapter *adap, con */ memcpy(first_page, fw_data, SF_PAGE_SIZE); ((struct fw_hdr *)first_page)->fw_ver = htonl(0xffffffff); - ret = t4_write_flash(adap, FLASH_FW_START, SF_PAGE_SIZE, first_page, 1); + ret = t4_write_flash(adap, fw_start, SF_PAGE_SIZE, first_page, 1); if (ret) goto out; - addr = FLASH_FW_START; + addr = fw_start; for (size -= SF_PAGE_SIZE; size; size -= SF_PAGE_SIZE) { addr += SF_PAGE_SIZE; fw_data += SF_PAGE_SIZE; @@ -1190,7 +1200,7 @@ int t4_load_fw(struct adapter *adap, con } ret = t4_write_flash(adap, - FLASH_FW_START + offsetof(struct fw_hdr, fw_ver), + fw_start + offsetof(struct fw_hdr, fw_ver), sizeof(hdr->fw_ver), (const u8 *)&hdr->fw_ver, 1); out: if (ret) @@ -4622,14 +4632,17 @@ int t4_fw_upgrade(struct adapter *adap, const u8 *fw_data, unsigned int size, int force) { const struct fw_hdr *fw_hdr = (const struct fw_hdr *)fw_data; + unsigned int bootstrap = ntohl(fw_hdr->magic) == FW_HDR_MAGIC_BOOTSTRAP; int reset, ret; - ret = t4_fw_halt(adap, mbox, force); - if (ret < 0 && !force) - return ret; + if (!bootstrap) { + ret = t4_fw_halt(adap, mbox, force); + if (ret < 0 && !force) + return ret; + } ret = t4_load_fw(adap, fw_data, size); - if (ret < 0) + if (ret < 0 || bootstrap) return ret; /* @@ -5338,11 +5351,18 @@ int t4_handle_fw_rpl(struct adapter *ada if (link_ok != lc->link_ok || speed != lc->speed || fc != lc->fc) { /* something changed */ + int reason; + + if (!link_ok && lc->link_ok) + reason = G_FW_PORT_CMD_LINKDNRC(stat); + else + reason = -1; + lc->link_ok = link_ok; lc->speed = speed; lc->fc = fc; lc->supported = ntohs(p->u.info.pcap); - t4_os_link_changed(adap, i, link_ok); + t4_os_link_changed(adap, i, link_ok, reason); } if (mod != pi->mod_type) { pi->mod_type = mod; @@ -5508,6 +5528,91 @@ int __devinit t4_prep_adapter(struct ada return 0; } +/** + * t4_init_tp_params - initialize adap->params.tp + * @adap: the adapter + * + * Initialize various fields of the adapter's TP Parameters structure. + */ +int __devinit t4_init_tp_params(struct adapter *adap) +{ + int chan; + u32 v; + + v = t4_read_reg(adap, A_TP_TIMER_RESOLUTION); + adap->params.tp.tre = G_TIMERRESOLUTION(v); + adap->params.tp.dack_re = G_DELAYEDACKRESOLUTION(v); + + /* MODQ_REQ_MAP defaults to setting queues 0-3 to chan 0-3 */ + for (chan = 0; chan < NCHAN; chan++) + adap->params.tp.tx_modq[chan] = chan; + + /* + * Cache the adapter's Compressed Filter Mode and global Incress + * Configuration. + */ + t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, + &adap->params.tp.vlan_pri_map, 1, + A_TP_VLAN_PRI_MAP); + t4_read_indirect(adap, A_TP_PIO_ADDR, A_TP_PIO_DATA, + &adap->params.tp.ingress_config, 1, + A_TP_INGRESS_CONFIG); + + /* + * Now that we have TP_VLAN_PRI_MAP cached, we can calculate the field + * shift positions of several elements of the Compressed Filter Tuple + * for this adapter which we need frequently ... + */ + adap->params.tp.vlan_shift = t4_filter_field_shift(adap, F_VLAN); + adap->params.tp.vnic_shift = t4_filter_field_shift(adap, F_VNIC_ID); + adap->params.tp.port_shift = t4_filter_field_shift(adap, F_PORT); + adap->params.tp.protocol_shift = t4_filter_field_shift(adap, F_PROTOCOL); + + /* + * If TP_INGRESS_CONFIG.VNID == 0, then TP_VLAN_PRI_MAP.VNIC_ID + * represents the presense of an Outer VLAN instead of a VNIC ID. + */ + if ((adap->params.tp.ingress_config & F_VNIC) == 0) + adap->params.tp.vnic_shift = -1; + + return 0; +} + +/** + * t4_filter_field_shift - calculate filter field shift + * @adap: the adapter + * @filter_sel: the desired field (from TP_VLAN_PRI_MAP bits) + * + * Return the shift position of a filter field within the Compressed + * Filter Tuple. The filter field is specified via its selection bit + * within TP_VLAN_PRI_MAL (filter mode). E.g. F_VLAN. + */ +int t4_filter_field_shift(const struct adapter *adap, int filter_sel) +{ + unsigned int filter_mode = adap->params.tp.vlan_pri_map; + unsigned int sel; + int field_shift; + + if ((filter_mode & filter_sel) == 0) + return -1; + + for (sel = 1, field_shift = 0; sel < filter_sel; sel <<= 1) { + switch (filter_mode & sel) { + case F_FCOE: field_shift += W_FT_FCOE; break; + case F_PORT: field_shift += W_FT_PORT; break; + case F_VNIC_ID: field_shift += W_FT_VNIC_ID; break; + case F_VLAN: field_shift += W_FT_VLAN; break; + case F_TOS: field_shift += W_FT_TOS; break; + case F_PROTOCOL: field_shift += W_FT_PROTOCOL; break; + case F_ETHERTYPE: field_shift += W_FT_ETHERTYPE; break; + case F_MACMATCH: field_shift += W_FT_MACMATCH; break; + case F_MPSHITTYPE: field_shift += W_FT_MPSHITTYPE; break; + case F_FRAGMENTATION: field_shift += W_FT_FRAGMENTATION; break; + } + } + return field_shift; +} + int __devinit t4_port_init(struct port_info *p, int mbox, int pf, int vf) { u8 addr[6]; Modified: stable/9/sys/dev/cxgbe/common/t4_hw.h ============================================================================== --- stable/9/sys/dev/cxgbe/common/t4_hw.h Fri Jul 5 18:03:00 2013 (r252813) +++ stable/9/sys/dev/cxgbe/common/t4_hw.h Fri Jul 5 18:27:38 2013 (r252814) @@ -230,7 +230,15 @@ enum { FLASH_FW_NSECS = 16, FLASH_FW_START = FLASH_START(FLASH_FW_START_SEC), FLASH_FW_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FW_NSECS), - + + /* + * Location of bootstrap firmware image in FLASH. + */ + FLASH_FWBOOTSTRAP_START_SEC = 27, + FLASH_FWBOOTSTRAP_NSECS = 1, + FLASH_FWBOOTSTRAP_START = FLASH_START(FLASH_FWBOOTSTRAP_START_SEC), + FLASH_FWBOOTSTRAP_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FWBOOTSTRAP_NSECS), + /* * iSCSI persistent/crash information. */ @@ -248,19 +256,13 @@ enum { FLASH_FCOE_CRASH_MAX_SIZE = FLASH_MAX_SIZE(FLASH_FCOE_CRASH_NSECS), /* - * Location of Firmware Configuration File in FLASH. Since the FPGA - * "FLASH" is smaller we need to store the Configuration File in a - * different location -- which will overlap the end of the firmware - * image if firmware ever gets that large ... + * Location of Firmware Configuration File in FLASH. */ FLASH_CFG_START_SEC = 31, FLASH_CFG_NSECS = 1, FLASH_CFG_START = FLASH_START(FLASH_CFG_START_SEC), FLASH_CFG_MAX_SIZE = FLASH_MAX_SIZE(FLASH_CFG_NSECS), - FLASH_FPGA_CFG_START_SEC = 15, - FLASH_FPGA_CFG_START = FLASH_START(FLASH_FPGA_CFG_START_SEC), - /* * Sectors 32-63 are reserved for FLASH failover. */ Modified: stable/9/sys/dev/cxgbe/common/t4_msg.h ============================================================================== --- stable/9/sys/dev/cxgbe/common/t4_msg.h Fri Jul 5 18:03:00 2013 (r252813) +++ stable/9/sys/dev/cxgbe/common/t4_msg.h Fri Jul 5 18:27:38 2013 (r252814) @@ -678,6 +678,15 @@ struct cpl_pass_accept_rpl { __be64 opt0; }; +struct cpl_t5_pass_accept_rpl { + WR_HDR; + union opcode_tid ot; + __be32 opt2; + __be64 opt0; + __be32 iss; + __be32 rsvd; +}; + struct cpl_act_open_req { WR_HDR; union opcode_tid ot; @@ -702,7 +711,7 @@ struct cpl_t5_act_open_req { __be32 local_ip; __be32 peer_ip; __be64 opt0; - __be32 rsvd; + __be32 iss; __be32 opt2; __be64 params; }; @@ -731,7 +740,7 @@ struct cpl_t5_act_open_req6 { __be64 peer_ip_hi; __be64 peer_ip_lo; __be64 opt0; - __be32 rsvd; + __be32 iss; __be32 opt2; __be64 params; }; Modified: stable/9/sys/dev/cxgbe/common/t4_regs_values.h ============================================================================== --- stable/9/sys/dev/cxgbe/common/t4_regs_values.h Fri Jul 5 18:03:00 2013 (r252813) +++ stable/9/sys/dev/cxgbe/common/t4_regs_values.h Fri Jul 5 18:27:38 2013 (r252814) @@ -189,4 +189,57 @@ #define X_MBOWNER_FW 1 #define X_MBOWNER_PL 2 +/* + * PCI-E definitions. + * ================== + */ + +#define X_WINDOW_SHIFT 10 +#define X_PCIEOFST_SHIFT 10 + +/* + * TP definitions. + * =============== + */ + +/* + * TP_VLAN_PRI_MAP controls which subset of fields will be present in the + * Compressed Filter Tuple for LE filters. Each bit set in TP_VLAN_PRI_MAP + * selects for a particular field being present. These fields, when present + * in the Compressed Filter Tuple, have the following widths in bits. + */ +#define W_FT_FCOE 1 +#define W_FT_PORT 3 +#define W_FT_VNIC_ID 17 +#define W_FT_VLAN 17 +#define W_FT_TOS 8 +#define W_FT_PROTOCOL 8 +#define W_FT_ETHERTYPE 16 +#define W_FT_MACMATCH 9 +#define W_FT_MPSHITTYPE 3 +#define W_FT_FRAGMENTATION 1 + +/* + * Some of the Compressed Filter Tuple fields have internal structure. These + * bit shifts/masks describe those structures. All shifts are relative to the + * base position of the fields within the Compressed Filter Tuple + */ +#define S_FT_VLAN_VLD 16 +#define V_FT_VLAN_VLD(x) ((x) << S_FT_VLAN_VLD) +#define F_FT_VLAN_VLD V_FT_VLAN_VLD(1U) + +#define S_FT_VNID_ID_VF 0 +#define M_FT_VNID_ID_VF 0x7fU +#define V_FT_VNID_ID_VF(x) ((x) << S_FT_VNID_ID_VF) +#define G_FT_VNID_ID_VF(x) (((x) >> S_FT_VNID_ID_VF) & M_FT_VNID_ID_VF) + +#define S_FT_VNID_ID_PF 7 +#define M_FT_VNID_ID_PF 0x7U +#define V_FT_VNID_ID_PF(x) ((x) << S_FT_VNID_ID_PF) +#define G_FT_VNID_ID_PF(x) (((x) >> S_FT_VNID_ID_PF) & M_FT_VNID_ID_PF) + +#define S_FT_VNID_ID_VLD 16 +#define V_FT_VNID_ID_VLD(x) ((x) << S_FT_VNID_ID_VLD) +#define F_FT_VNID_ID_VLD(x) V_FT_VNID_ID_VLD(1U) + #endif /* __T4_REGS_VALUES_H__ */ Copied: stable/9/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu (from r252661, head/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu Fri Jul 5 18:27:38 2013 (r252814, copy of r252661, head/sys/dev/cxgbe/firmware/t4fw-1.8.11.0.bin.uu) @@ -0,0 +1,8417 @@ +/*- + * Copyright (c) 2013 Chelsio Communications, Inc. + * 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. + */ +begin-base64 644 t4fw +AAADpgEICwAAAQkBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAA4sDmgOhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAENoZWxzaW8gRlcgUlVOTUVNIERFQlVHPTAgKEJ1aWx0IEZyaSBNYXkgMjQgMTM6 +NDA6MTQgUERUIDIwMTMgb24gY2xlb3BhdHJhLmFzaWNkZXNpZ25lcnMuY29tOi9ob21lL2Zpcm13 +YXJlL2N2cy9mdy1yZWxlYXNlKSwgVmVyc2lvbiBUNHh4IDAxLjA4LjBiLjAwAAAAAAAAAPj2L99g +AMAA4QAwuHj///8f/OFAgAAAAeEAe3AAABAAH//8EOEBlHAgAAAA4QGcBOEAeQAAAgBA4QB5gAAG +AEAAAgAKAAYACuEAeQQACgAAgAABAuEAezzhAHtE4QB75OIAAAAAAQAA4QB7kCAAAAAAAIAA4QB7 +AAAAQAHhAHucAABAAERERELgAAAA4wAEY0REREDjAAgAIAACXAAAAAAf/5BQAAAAAB//kFQAAAAA +H/+QWAAAAAAf/5BcH//AAAAAAAAAAAAAwAAS/88T/8+EIAQzAZMgEf/OEv/OkhAR/84S/86SEBH/ +zgH0MRH/zSIK/5IQAOQxAAUxAQIAEv/KAucxAhYAEf/JgRABAV/AIQIRAckREf/GEv/GkhAR/8YS +/8aSEGAADxH/wRL/xZIQEf/BEv/EkhCBEBH/w8AgkhES/8KSEsAgkhMS/8GSEIIQAvJQZS/3Ef+/ +xy+SEBH/vpIQEv++E/++kyDAMpMhE/+9kyKCIhL/vBP/vJMgIyIhFP+7BDMByTgT/7qDMAODFAgz +ERT/uKQzkyET/6yTImAACMIwkyET/6mTIhL/s5AgkCGQIpAjkCSQJZAmkCeQKJApkCqQK5AskC2Q +LpAvICYQICYRgiIS/6bAMC03MC03NC03OC03PCM9AXIz7QACABL/o8AwLzcALzcQLzcgLzcwIz0B +cjPtAAIAEv+ZwDAoNzAoNzQoNzgoNzwjPQFyM+0DAgAS/5YjCgAnNwAnNxAnNyAnNzAjPQFyM+0D +AgAS/5AV/5EW/5HAMNcgBWYBYAASBDYFAAIA0w/TDwUzDG47FAdHFAcEQ3Yx5gQ2BQUzDG877QAC +ABL/hRX/gyMKAAInAgcEQwQ+BQUzDAdHFG878AMCABL/f8kugyCEIYUivCJ0Ow6GULRVljC0M3Qz +9GP/5gBlP+JlX98S/3PAMgMuBQMCABL/asAwKDdAKDdEKDdIKDdMIz0BcjPtAwIAAAIAEv9tLScA +wBEBSTEASDEBAgDAABT/aQTSMRX/aJRQFP9oBNMxFf9olFAU/2cE1DEV/2eUUBT/ZwTVMRX/ZpRQ +EP9mAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAf/AAA +H/wAAOMACfgf/AAAH/wAAOMACfgf/AAAH/wAAOMACfgf/4AAH/+I8OMACfgf/4jwH/+I8OMAEugf +/4jwH/+I8OMAEugf/4jwH/+KcOMAEugf/4pwH/+QUOMAFGgf/5BQH/+snOMAGkgf/6ycH/+snOMA +NpQf/8AAH//9DeMANpQgAAAAIAABauMAc6QgAAF4IAABfOMAdRAgAAF8IAABheMAdRQgAAGYIAAB +nOMAdSAgAAGcIAABpeMAdSQgAAG4IAABvOMAdTAgAAG8IAABxeMAdTQgAAHYIAAB2OMAdUAgAAHc +IAAB4uMAdUAgAAH4IAAB+OMAdUggAAH8IAAB/OMAdUggAAIYIAACGOMAdUggAAIcIAACHOMAdUgg +AAI4IAACOOMAdUggAAI8IAACPOMAdUggAAJYIAACWOMAdUggAAJcIAACYuMAdUggAAJ4IAACeOMA +dVAgAAJ8IAACguMAdVAgAAKYIAGsnuMAdVggAoAAIAKTNOMCH2AgApM0IAKTNOMCMpQgApM4IAYK +IOMCMpggBgogIAYO0OMFqYAgBoAAIAaNEOMFrjAgBo0QIAduWuMFu0AgB25gIAdvLOMGnJAgCMAA +IAjAAOMGnVwgCMAAIAjAAOMGnVwgCMAAIAk2z+MGnVwAAAAAAAAAAAAAAAAgAA/2IAAP6CAAFAEg +AA/oIAATbSAAD+ggABCdIAATBSAAEoogAA/oIAASOSAAEeogABF9IAAP1SAAEScgAA/oIAAP6CAA +D+ggABC9AAAAAP///////w/8///w////APwgAJtzIACcsyAAnOMgAJypIACcaSAAnF8gAJwkIACc +GiAAnBAgAJvAIACc4SAAm7YgAJucAAAAAAAAAAAAAAAAAAAACgAAAAoAAAAUAAAACgAAAAoAAAAK +AAAACgAAAAoAAAAKAAAAAAAAAAAAAAAAAAAIAAAAEAAAAEAAAAEAAAAACAAAABAAAABAAAABAAAA +BAAAABAAAABAAAABAAAA/xgwYGAAAAD/AAECAgAAACAG8tUgBvGCIAbzwyAG85ogBvNxIAbzSCAG +8ycgBvL+ECBAAAAAAAAAAAAAAAAAAAQAAgABAACAAEAAIAAQAAggBw0rIAcNKyAHDLkgBwyAIAcL +vyAHC6UgBwulIAcNKyAHDSsgBwulIAcLiyAHC4sgBw0rIAcNKyAHC1IgBw0rIAcNKyAHDSsgBw0r +IAcNKyAHDSsgBw0rIAcNKyAHDSsgBw0rIAcNKyAHDSsgBw0rIAcNKyAHDSsgBw0rIAcLZyACivgA +AAABIAKK/AAAAAIgAo2oAAAA/yACiTgAAAD/IAKJOAAAAAAgAo2oAAAAACACijAAAAABIAKKOAAA +AAQgAopAAAAACCACikwAAAAQIAKKVAAAACAgAopcAAAAQCACimQAAACAIAKKeAAAAQAgAoqMAAAC +ACACiqQAAAQAIAKKuAAACAAgAorIAAAQACACitQAACAAIAKK6AAAQAAgAoocAAAAECACiiQAAAAR +IAKJnAAAAQAgAomoAAAAgCACibgAAABAIAKJyAAAACAgAonYAAAAECACiegAAAAIIAKJ9AAAAAQg +AooAAAAAAiACigwAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAA +AAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAABwAAAAcAAAAGAAAABgAMNQAAEEaqABRY +VQAYagAAACtoAAAjgwAAGGoAAA0GAAALKgAAAAAAAAAAAAAAAAAAaCsAAGgrAABsggAAb5wAAEpo +AABKaAAATSkAAEpoAABO6gAATJgAAFI9AABPuAABhqAAAYagAAII1gACCNYAAgjVAAII1QACiwsA +AosLAAII1QACtnIAArZyAAMNQAAEBgcAAAAAAAAAAAAAAAAgB1wIIAdb5iAHXAMgB1wDIAdb5iAH +W+YgB1wIIAdcCCAHW+YgB1wIIAdb5iAHXAggB1wDIAdb5iAHW+YgB1vmIAdb5iAHW+YgB1wIIAdb +5iAHW+YgB1vmIAdb5iAHW+YAAgIFBQgICwsODhERFBQXFxoaHR0gICMjJiYpKSwsLy8yMjU1ODg7 +OwAAAAAAAAABAxERCAgQCQMBAAAAAAAAIAREDCABeJAgAER4IAFPmCABdBAgAW1sIAEwMCADcNgf +/+tIH//nECAAnXQf/9rEIABsICAAXqAAAAAAAAAAACABURggAIq4AAAAAAAAAAAf/9TcH//GCB// +w+gf/8GYIABaGCAAUiwgAE9gIACUPB//34QgBeNoAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAACABfqggAV9oIACmKCAApVgf//B4H//QBB//y0AgAIgkIASacCABErQgAPMU +IADeSCAA2DQgAMngIAC8pCAAqOAgBEe8IAOP3CABBjwgA6/IIAGkJCAAa+AAAAAAIACmhCAFAwQg +AJroIAFXaCAAApgAAAAAAAAAAAAAAAAf//OwIACmSCADkowAAAAAAAAAACADD+AgACXsIAAcACAA +JSwAAAAAIAAyQCAALuwgACu4AAAAACAAQ4AgAQnwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAIABAiCAEQ6wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQjggAxaE +IABBQAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAgLAAAAIAKQiAgAAAAgApCUCAAAACACkKAK +AAAAIAKQrAwAAAAgApC4EgAAACACkMgNAAAAIAKQ3A4AAAAgApDsEwAAACACkPwKAAAAIAKREA4A +AAAgApEcGAAAACACkSwNAAAAIAKRSA4AAAAgApFYEAAAACACkWgSAAAAIAKRfA4AAAAgApGQEAAA +ACACkaARAAAAIAKRtAoAAAAgApHICwAAACACkdQNAAAAIAKR4BQAAAAgApHwCgAAACACkggPAAAA +IAKSFAYAAAAgApIkBgAAACACkiwGAAAAIAKSNAYAAAAgApI8BgAAACACkkQJAAAAIAKSTAYAAAAg +ApJYBAAAACACkmAGAAAAIAKSaAsAAAAgApJwCwAAACACknwEAAAAIAKSYAQAAAAgApKICQAAACAC +kpAJAAAAIAKSnAAAAAAAAAAADQAAACACkqgKAAAAIAKSuAYAAAAgApLEAgAAACACkswDAAAAIAKQ +hAEAAAAgApLQAAAAAAAAAADXaqR46Me3ViQgcNvBvc7u9XwPr0eHxiqoMEYT/UaVAWmAmNiLRPev +//9bsYlc175rkBEi/Zhxk6Z5Q45JtAgh9h4lYsBAs0AmXlpR6bbHqtYvEF0CRBRT2KHmgefT+8gh +4c3mwzcH1vTVDYdFWhTtqePpBfzvo/hnbwLZjSpMiv/6OUKHcfaBbZ1hIv3lOAykvupES97Pqfa7 +S2C+v7xwKJt+xuqhJ/rU7zCFBIgdBdnU0Dnm25nlH6J8+MSsVmX0KSJEQyr/l6uUI6f8k6A5ZVtZ +w48MzJL/7/R9hYRd0W+ofk/+LObgowFDFE4IEaH3U36CvTryNSrX0rvrhtORBwwRFgcMERYHDBEW +BwwRFgUJDhQFCQ4UBQkOFAUJDhQECxAXBAsQFwQLEBcECxAXBgoPFQYKDxUGCg8VBgoPFR//wAAA +BAAgIAYO0CAGEkAEQQAIBAEACB//qSCBAAAAMAAAAB//nQClAAAAwAAAAMAEAAAf/N4AIAYPEB// +nRADgAAAAP/4AAEAAAAAEAAAgQQBAIEEAAABBAAAAQQBAIAAAAAABf//H/+EIAYAAAAqAAAAH//P +MCADybQCAAAAgBAAAEFAAABBQAEAgwAAAf//v/8f/5WMIAKLgAQAAAiBgAAADAAAAB//m4AgCN6Q +H/+QoP//AAD//wD/IAjewCAI3yAgCN8AH/+RQAAADnAf/5qgH/+fnB/84gAf/58QH/+flB/84ODg +//4AH/+V+A////8f/5Z8H/+cKB//mzQf/5ugAAAM4AAA/4AgCQPwH/+blAAAC4jhAC4A4QGSAB// +nGQf/5sk4AAAoOEAMLgAAIAA4QBgEAAAQADhAhAA4QIwAOECUADhAnAA4QAQCB/84UDhAHtwH/+s +XB//rFQf/OAIH/+sWB//rHQf/6xsH/+scB//rIwf/6yEH/+siB//qSAgBg8QH/zeAAEAAAAf/5qg +H/+ZpCAGDtAEAAAIBQAAAIP/AACBAAAAABAAACoAAAAgAAYoIAKK2B//iDAf/4QgH/+dEGdFIwHv +zauJmLrc/hAyVHYf/4AAIAjEUAAAPyggCMOgIAjEQCAIxHAgCMKwIAKQhM////8gCMLgIAjDMCAI +w2AQAAAAIAjDwD////8CAAAAQAAAACAIxAD//3//H/+dACAAIRwgCMcACAAAAAD///8gCMdg9/// +/yAIzcAgAB0A//7//yAI1FAAIAAAAABAAAwAAAAgCNSAAAD//wAAgAANAAAAIAAj4P/7//8P9oAA +AAP//wAAJ/8gCNcAAAEAAAAEAAAfgAA/IAAyQCAAOnAgAC7sIAAruCAI16Af/5oYIAjYACAJELAg +CNgwIAjYsCAI2SAgCNmQIAjZwAQBAAjgAAAAH/+atCAI2fAgCNlQUwAAAFIAAAAwAAAAUQAAAB/8 +4gCBgAAAH/+VjIIAAAAABgAAAABIAB//n6Af/5+cH/+QoAAADIgAAA2MIAA0eB//mUwgCNowIAja +kCAI2mAgCNsQH/+axCADLejg//4AIAkF0B//mbAgCNxAFAAAAIAAAACAAAACeAAAAIAAAAaAALAA +AAAKAADjMJL///AAgACxAOEBmgAAAgAAIAjcAB//l7wAAH5AH/+RNCgAAAAmAAAAH/+RUAYAAAAF +gAAAH/+Y1CsAAAAgAFVQNQAAAAOAAAADAAAAH/+Y2Af///8AP///gEAAAAgP//8f////IAAAAB// +mpg9AAAAH/+WNAcAAACBBAEAgQQAAAAAOpjDAAAAGAAAAB//kZAAAA//AEMAAB//mmQAAAgABAAA +AB//q9Af/6lA4QB6AB//lfQf/5mAH/+bAB//mZwgCRYQAAMHgCAJFoAf/5iEAEAAAAAACQAAADAC +//z4f8AAAACj/7sAo/+6AOADAACD/7YAD////w//+AD/AAAAIAkWwCAI3iAgCN5QIAkXUAAPAAAA +CgAA//8ADx//mYgD/8AAg//AACAJF9AgCRhAH/+bGB//qbD/YPAAH/+pkB//kGAEgAAIH/+AUABE +AAD/H///AMAAAAAAgQAf/OIMDwAAAP//AAAf/5q4H/+fmB/84ggf/5YwH/+AYCAGDOAAADAAAAAn +EB//2dgf/5lw3q2+7zQAAAA/AAAAAACJBgCZAAAf/6j4EAAHAu4AAAABwIAAH/+nyJkAAAAf/6m0 +AIgACIKAAAEf/6lIH/+oVAMVAAADEQAAAA8D/yAI47AgCOPgIAjkICAJIFAgCSEgIAjkQCAA0OQg +CSCQIAkg0CAI5HAgCOSgKQAAACAA2dTw8PDw/wD/AKqqqqrMzMzMH/+rwAAAGyAf/6nIIADpGAAP +QkAgA7W4H/+bIAAJAAAAgAAAIAELzAAJAAgf/6i8H/+pBAAACAYAAIjMAACJFH8AAADwAAAAIAki +sCAJIeAgCSKAH/+XlB/84HQABAP/CgAAAB//p+Qf/6ikH/+ZoIP/twCD/7YgIAjqIDMAAADhAAAA +H/+oxB//mdAf/6kMA//gAAA/9pAAABpkA//wAAAQAAEAABpsGgAAAB//mQQgCOpgIAFHLB//qQgA +D///AADerR//qMAf/5qQH/+ZrCAGCiAf/5kMH/+bCCAAcEAgAAXoH/+XaB//lcAgCSPwH/+edCAJ +JEDABAAAIAKMECAAcOAf/5ecAIEAAOABAAAA4AEAAADgASAJJYAgCO0AAAANlCAAmIwgAJYUIAkl +ACAJJVAf/5e4IAjvoB//n6wgCPbQH/+arB//koAgCP3gIAj+cCAI/oAgCP6wSAAAACABhiAf/5pw +IAGIFB//lfgf/5os4QAuAB//mjThAF4A4QIOAP//v//hAA4A4QGOAP//vv8f/5s0AAALiB//nHgf +/5x0AAANwAAA/4Af/5xsH/+c2CABi/AgAZWcA/8AAP+///88AAAAAAX//4MAAAAf/5vUIAkFcCAB +qNwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAACBgAAAAAAAAB//+eAf//ngH//5pB//+aQf//mkH//5pB//9Ngf//ds +H//2EB//9hAf//YQIAXlYAAAAAAAAAAAAAAAAAAAAAAgBejgIAXo4AAAAAAAAAAAAAAAAAAAAAAg +AY6YIAXlYB//+GQf//hkH//4ZB//+GQf//hkH//4ZAAAAAAf//TgAAAAAAAAAAAAAAAAAAAAAAIB +AAAAAAAAAAAAAAAAAAAEAAAAAAAAAIGAAAAAAAAQBQAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAgQAA +AAAAABgFAAAAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAACgQAAAAAAAAgAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +AAAAAAAAACAKABHyOxPyO9MPA+YxAQIAFvI5F/I6d2sGkGC0Zndj+FQOnFWSVw8UAGP/+QAAAGwQ +BBjyNx3yMisgBxzyMiohCPoCAAdxuwEA7tw5DdwCgAALqgKcMOPyLBmwBIAACKoCHPIqIzCA+kAI +FeANBQCdZexmAiG43QAA+sCGFaR3HQDpfP8t3gKAAOt7AgzPAoAA62YBJMvhAACZYwIEiZNnKGYG +BiCLGPIbJSEJ9MFmFaQzHQDlZgorkASAAOgABQMowQAAbTkCBQJh0Q8AAABsEAQc8gsmIAcb8gof +8hD+QQQVoNYRAA3LOZswhyD75A4FoAklAPpgRhWgGAUA6DYDK74CgAD45gAMcWYBAPhgJhWgDAUA +5SBXKzQCgAD3xgAOsCsFAP+mAA7wCjUA6PH6EoIBgACcNZw3mzMZ8fkKdQKVMZk2JSEJnTQvIAec +OZQ7+KYACTH/AQDiNgov/AKAAA/uAgjuAu42CC0QBIAA0Q8nIQgqIQmcNZQ3BncCCKoCmjYIdwLn +NgQskASAANEPAAAAAAAAAGwQCCggBScgBykxBfgghhXgGUUA+QAMxWF3AQCKIhbx2xjx2/FVDA3g +DZUADHsRprsssp79gAxD4AqlACuynesWBSWMOYAAjIj3gAxwkgCdAC1irmTROCtireSxNGZz/QAA +7oYIJYm5gAAoIBSkiAgIRygkFPUAC73QDwUAGfHFLiIWLCEpiBUa8cSuzJqA6iIeLmfCgAD9AGYV +oA0lAP0ARhXgC2UA7fGzHVYCgAALqgKLFJqB6QAVBEBBAACJFQgAiig8EP0gxhXgTAUA/SDmFaAM +RQDsuzYEyIEAAG25BQgAhgkCYe7xpRWgh4AAiBXuAAUNzwKAAKmI6IwgJaQ1AAALyQxtmQIIAmEo +ISnqISgkQAUAAAgITyglKflACEQiAJ0A/+M6BeAMFQD6IKgV4B7lAOoiHixtQoAA/CAmFeAJBQD4 +IAYV4A0FAOkWAiXZgQAAWHWoDH4R98AARzANlQD906YV58UBAPmABilSAJ0AwCDRDwDqJAAJ2ASA +AOxEAAroBIAAWHdd0qDRDwDAsArPNO+GCC32jgAA2iD8QGgdoBvFAFh5N2P/ygAAAOokAArYBIAA +WHi80qDRDwD/+ewNoAsFAAAAK3wY6iQACWAEgABYeStj/5zAoFmM6BjxbIyI+Z/zQJAKpQBj/6wq +IQn8QrAVr/0FAA2NAQ2ODC4kFO20Ay5hAoAA77QALVYCgAD9RgANMAkVAAmqApqx+NWmFe/5YgAv +JSn/+9QNoAgFAIon60QACmgEgAD7RAAVoAwFAFhyFNKg0Q8AAABsEAYoIAUrIhDkIAcqUASAAPgD +Ah3gHsUA+94ADPAZRQD5AAxdYUQBAIwiH/FE6hYALgseAAAMSREPmQgtkp4PAgD3oAvjUgCdACeS +nQwGPmRxbospKiIKC6oM90AJC6IAnQAqIE4sIEyxrfuACyQgCxUALSROKjABKSIY80ALRpIAnQAr +IAcsIST8YCQV4AhVAPlABAQwqxEA4IgRDVKCgAAKiAIa8SoI3QIoIQcrIQkKzAL7pgAOuogBAOrx +JhxDAoAACLsCKCEinXCNIJtznHT7BgAMMAplAOh2Ai7uAoAACt0CnXEsIhCcdSsgOBjxGvwAIh3g +TBUA/OEmFeC7GQALzTkc8RWeePsNAA5wCAUAmHcNzAKcdu3xChTYBQAAKyYYG/EAmHuZeu0AFQPI +wQAACQCK63YOIchBAADudg8j8QEAAAkghg4CYwkAhg4CYQxMEa/M6sadIwCpgACOKS0gOKbuninz +oAVXkgCdAAUPR/ngBFFSAJ0AwCDRDwDqJAALWASAAFhRIcHs7/DrFXaRgADqJAAJ2ASAAOwSACro +BIAAWHbC0qDRDwAAAADqJAAK2ASAAFh4KNKg0Q8AAAArTBjqJAAJYASAAFh4mWP/wYgiwJQJiAL4 +QEYVr/7eAAAAAAAAAPxDqBWkiQEAAIEEAL0aDcwC/EOmFa/6HgCKJ40QwMDqrCAu2ASAAFhxjtKg +0Q/aIFh2bGP/UQAAbBAMLSAFJiIQLyAHKyE15RYDKcAEgAD7AIgVpzUBAPJ/wBXgDBUAA8M5+0EA +DXAVhQDrggIsYASAAPdeAAqx/wEA9wAwFaAVRQD1oB/VY7sBAIkiKBYA8z1cDeAOhQCYEPLAHgcS +AJ0AnxKfGpsWFvCrkxXqFgQvrwKAAOZVCAIwDQAA5hYJInAFAACIGi4WCCsSCfUABmISAJ0AKlKe ++0AJq+IAnQAvUp1k87sY8JyIiPcACViSAJ0AGfCYKZKuDAM+6vCWFIn5gAAqoq0W8JTqFgska/0A +AOsSCyUJaYAA7WYIJZuZgACIKYcqCHcM8uAJY+IAnQApGgDzIjIN4Pr1ACsgFpwR+2AJrSIAnQAY +8IyGFI3DKiA4/eDmFeAJBQD54SYV4EcFAPfhBhWgqhkACnk5F/CDKyIXm/orIhub+43ECng5/MAP +EuIAnQCYF54dhhWcEZkc5xIMKwgeAABgAX4Y8G+IiGqBJooZKVKeepNDK1KdmxuNG+nwaRQz/QAA +79QABoHZgACWmGX/HGAC1Z4d/CAmFaAKBQBZi9wY8GCIiIwR7hINJA8HAAD//2gNoA8FAADAkPgh +ZhXv/u4AG/BXwKoKijT7YQYVr/7+AAAAAAAAAP/7OA2gDwUAAJ4dnx78ICYVoAoFAFmLyBjwTIwR +iIiPHo4d+R/12JIAnQBgAlHAkJkbihsd8EXAuguLNOvWCC12jgAAYAI4AJ4dnx6cEeokAAnYBIAA +WFBwjBGPHu4SDSV1+YAAYAHvAJ4dnx76QPAVoAwFAFhQvIwRjx7uEg0tdcYAAGACxgCIEY4X9iDI +Fa+MBQAsJDuMFAZ2AgbuAqy5DNoMmoTpJhssWASAAO0iEClQBIAAWHdtjh2MEfqzphWhBwUAc3sI +KyAWKAr/eLleiikpIDijquomCST5poAALyIQLSE1+4CIFeAIFQD4IKYVoAY1AJYTDbs2+iCGFeAd +hQD/fgAO//a2AIonnx6LEOqsICpgBIAAWHRkjx6aESsiG/1AiBXv/YYAAAAAAADqIAcp4ASAAFhQ +dowR/iGoFa/+QgDaIFh1o4wR/iGoFa/+QgAALSIQihYrIDsW8AQKmQIJiQLmmAINifYAABrwAfhE +hBXjaQEAh8DrIAcrMgKAAAaZAiYhB/rgBAOwuxEA6u/xHdqCgAALdwIrISIKdwIqIQmX8IcgnfX5 +4MYVqmYBAOn2BCszAoAABqoCFu/n6vYDK74CgADn5wIHyMEAAOf2ASZAgQAA5rsCAlP5AADr9gIi +FDUAAG2pBQgAhgkCYSggFKSICAhHKCQU9QAGrdIAnQCKGPqzphWhCQUA8yHyDeD89QArIBb9YAkV +IgCdAC0iF7Hd7SYXIYCpgACPKS4gOKP/nynzwAe/kgCdAIYVZWDSwCDRDwAAAAAoIE5kjD0OmwKb +IusSAClQBIAA7RIDKmAEgABYdZPSoNEPAOsSAylQBIAAWHb60qDRDwDaIPxAaB2gG8UAWHdsY//H +AIsS2iDrvBgpYASAAFh3Z2P/tAAAAAAA6iQADlgEgAD8IIgVr44FAO4kOyxwBIAAWHbq+iEGFaAP +BQAvJhv+R2Yd7/yCAIsbKiEJ/EKwFa/9BQANjQENjgwuJBTkzBANVgKAAAyqAv1gZh3gDgUA/2AG +HaAGFQAGqgKasRnvjvc1phWv+8oAAIon60QACmgEgAD7RAAVoAwFAFhwSdKg0Q8AANogWHUnY/8E +AAAAAADqIAcp4ASAAFhP8mP+04sS2iDrvBIpYASAAFh3OGP+92wQCCggBe3veBnQBIAA897qBeAe +RQD/AAq1IAylACsgTinSCNMP6hYDJdv9AAArJE73IAiYkAcVAC8yrmTyMCoyreakAAURkYAAsJjo +1gglCIGAACkgFLOZCQlHKSQU9SARLdIAnQApIHMrIh37IAQA3//1AOB6GgTABQAA/1cAD/SIAQAo +JHP7QAQFcAgVAAqKOQ+7AesmHS0HPgAAiiJ8pwQrIE7KtH2nCC0gTCwgTn3DGcxsLiAU7yICL1gc +AABk8fzAINEPAAAAAAAAiCfHkwmpAekmAiRQwQAAWGfg4+9OFQE5gAAooADTD9MPA4gKKIIQ7KAH +LVgEgAD6QGgdoA1FAAuAAGWv3Ikn0w9kn6EqmRTKp4qZZK+XKKAAA4gKKIIQ7KAHLVgEgAD6QGgd +oA01AAuAAGWv4GP/dQAA//9UDaAKBQDAoFmKox3vJonYLAoK+T/3AJAeRQAmCgApIBSzmfhChh3v ++/oAAAAA6iQACtgEgABYdmLSoNEPAAAqIAUrIAcPAgD/QA8VIbsBAAUFR/igDylSAJ0AjhPu4gYv +eASAAJ4UC74C9WAKchIAnQAMuhEDqggoop73AA580gCdACqine4WASUK8YAA+kAIFeAMFQBYI+Ub +7wQvIQke7vooISItIAcc7wwpIST/BgAMMN0RAO4SBC7qgoAADZkCDJkCmaCMICimAv9AZhXgDSUA +7qYFLmYCgAANzAL9QCYVoAkFAOsAFQVQYQAAsZnqgx4Mj+gAAI8RDP8R8+AAR/AOpQAu9p30v/KB +EgCdACoiB+tEAApoBIAA+0QAFaAMBQBYb6Jj/jIAAAAAAP/3OA2gCgUADJs069YILW6uAABj/tkA +AC8hCfhCsBWgCwUA+sAGHe/6BQAKmgEqZAPqmgwMQQKAAOokFC/+AoAACP8CB/8Cn2H2daYV7/aq +AIonwLD7RAAVoAwVAFh2YB3u1J2gjCAb7tPrpgIuZgKAAAfMAv1AJhWgG8UA7CQACVAEgABYdnnA +INEPAACJ2PcgBKiSAJ0ADOoRo6ooop73AAV80gCdACqinWSgprCYmNjuFgEtdVYAAIki6xYAJIUZ +gACfEvi/6yFSAJ0AiifAsPtEABWgDBUAWHMAHu60nqCNIBvutewSAi7uAoAAB90CnaGMxpyj+0BG +Fe/0ygDrVAAJUASAAFh14mP9H48Tj/P+IIYV7/iOAAAAAAAAAP/40A2gCgUAAJ8SmxH6IAYV4AoF +AFmKDB3ukIsQidiPEo4R+T/6iJAMpQD//YwNoAoFAMCgDJg0+aEGFa/9WgAAAACLEO8WAilQBIAA +67wYKWAEgABYdj3+IEgV7/0iAGwQBCggFO+LHmoYBIAAiif6YGgd4AwFAOqsICnoBIAAWG830qDR +DwCLInO+fhTucolIapF6G+5v0w8ssq5kwFgqsq1koFSwne1GCCUC4YAAKSAU6SQULNrcAAAvIQn4 +QrAVoA0FAP1ABh3v/AUADJwBLKQD7JwMDEECgADsJBQv/gKAAPnmAA+wDhUADv8Cn6H/daYVr/3m +AMCgwOoOnjTuRggtfWYAAI8iyfXAINEPwKBZic2JSPk/+9CSAJ0AY//lANog/EBoHaAbxQBYdgfA +INEPbBAIiS/vITQpsASAAPZg6BXnhQEA7iAHKlgEgAD7H8AVoAQVAPqNAA0wHUUA/uEAC/HuAQDp +fR8MFIAAACggTw8CAO8gTSRABQAACAhHKCRP+eASu6IAnQAvIAWbEZoQ/eAQ3WIAnQCJIsej+UAN +gOIAnQAsIhmLMv1gEv0iAJ0AjTiPERjuJunuKBaRQYAA6RYCLycCgADoRAgH+A0AAPXADKISAJ0A +KUKe/yAZK+IAnQApQp3tlAAEkWGAAIspiioMBT4Lqgz1QAmr4gCdACwaAPWB8g3g+PUAKyAW+WAX +1SIAnQAa7iApISQrIQcKmQIqIQkLC0oMuxALqgIrIAcc7gwLK0Do7hkd2oKAAAy7AiwhIpvQiyCZ +1JrTCMwCnNL9YAAVsAxVAAy7ApvRG+4Qii+a1SkgOPvcHAWgDAUA/aDmFaBIJQD3oQYV4JkZAPlN +AA3wCiUACYo5iWSZ2YhlmNr8wMgVoAkFAOzWCyOH4YAA6e4BHMKCgAAJiAKY3Ixol9+c3owSiWkp +1hCIaijWEewAFQbJIQAACQCKjGf84AqjogCdABnt6Qq4AgmIApjWwPX+k6YV4Q4FAPXB8g3g+vUA +KyAW+2ASBSIAnQAuIhmMKS0gTysgOOXMCAdwBQAA7iYZJuv9AAAtJE+cKfNgDgeSAJ0AjRBl0b7A +INEPnxOeFJ4VnRbqJAAK2ASAAFhN+I0WjhTvEgMldaGAAI4QZe/XiifbMOwSASVQwQAAWHHwwCDR +Dxrtu4qo90AOyJIAnQArQp7/YA+z4gCdAClCnR3ttOSR6mVj/QAAnNjtlAAM8tYAAGAAegAoIDnx +H/gOEgCdAP/75A2gCRUAwaN6+RIpIDr+IKYVoAv1APsgECViAJ0A6iQACtgEgABYdOjSoNEPAAAA +AAAA8AAYDaAa1QDAoYw3KyEJjTiOMuuvEQ3dAoAAD7sC5LsCCVAEgABYdMrAINEPAAAA//9YDaAa +hQAAACvsGOokAAlgBIAAWHVJY/8oAAq5ApnWwIX4k6YVoQwFAHXLDSsgFioK//tgDUUiAJ0AixBk +sTaLaoxnimmrewfMDJxn92DSDeANBQCxqoxlm2qLZppprNqre3e7AbGqm2aaZYgpLSA4pYiYKfOg +CT+SAJ0AiScqmRTKpouZyrKfExnteyiwAJ4UnhUJiAooghAssAf6QGgdoA01AAuAAI4UjxOLIsej ++1/zYOIAnQAoITSHZ/xB6BXgCRUAmRD44QALsBxFAPz+AA5/88IA2iBYcv5j/juKJ+qsMCtYBIAA +WGAs0qDRDwAAAAAAAAD/83gNoAkFAJ8TnhSeFZ0W+kDwFaAMBQBYTdWNFo4U7xIDLWd+AAAr7BLq +JAAJYASAAFh1BGP+E+ogByrgBIAAWE22Y/21nxOeFP4gphWgCgUAWYi7Gu0+iqiOFI8T+V/weJIA +nQD/+IgNoAkFAMCQHO04wLoLqzT7gQYV7/hCAJ8TiieeFO4WBSnYBIAA7BIBJVDBAABYcWLuEgQt +MASAAP4gaBXv+pIAnxOeFO4WBSlQBIAAWHLJjhT+IGgV7/siAADBU/pAaB2gCwUA/AACHaANNQBY +bNkrIAWOFfV/3Z1iAJ0AY/1jnxOeFJ4V6iAHKuAEgABYTYmOFP4gaBXv+RYAAGwQDJUTJiAFLyAH +hy/qMgQpwASAAPxGhBXnNQEA8n/AFeAOFQAD4zn9QQANcBtFAOerHwxgBIAA+sAehWH/AQCJIpgQ +8zrMDeAOhQAmgAGYEPLAHKcSAJ0AnxKfGhns+5MXFuz56hYGIlgNAADrFgkvrwKAAOZVCAJwBQAA +iBqeGI0Z9QAFWhIAnQArUp79YAgT4gCdAC9SnWTzkIiY9wAH2JIAnQAW7OgmYq4MAz7q7OYTCHmA +ACqireoWCyRr/QAA6xILJQgBgADtlgglmnGAAIcphioHZgzywAfb4gCdACgaAPMCMg3g+vUAKyAW +nBH7YAgdIgCdABbs6CogOPvZzAXgDQUAnff3gIgV4KoZAAprOYYWxIAKjTn2wA9y4gCdAJ0UjRfr +FgUuh14AAGABjoiYaoEgjRkrUp59szwvUp2fG4YbsIrvZAADAdGAAJqYZf9GYALUnhz8ICYVoAoF +AFmINhnsuYiYjBHuEgwkDx8AAP//aA2gDwUAwLD6IWYV7/8KAMDaDY00/SEGFe//DgAA//wEDaAP +BQAAnhyfHfwgJhWgCgUAWYgkGeyojBGImI8djhz5H/dYkgCdAGACWcBglhuKG8C6C4s065YILXgO +AABgAkOeHJ8dnBHqJAAJ2ASAAFhMzYwRjx3uEgwld4GAAGAB+54cnx36QPAVoAwFAFhNGYwRjx3u +Egwtd1YAAGAC05wR/iGGFa+IBQDoJDsmOEEAAOcDHgewgQAABgJhhhaW+I3Hh8SIxq1tBncMl8R2 +2wouFgzsFgEkQAUAAIwWixGGFI4VmLadtwbuAu0iDylQBIAAWHPBGex4jhyMEfqzphWhBwUAc3sI +KyAWKAr/eLlciykqIDiju+smCSV5qoAAhi8vITT9gIgV4AoVAPog5hWgCDUAmBMP3Tb8IMYV4B9F +APe+AA+/9wYAAJ4ciiefHYsQ6qwgKmAEgABYcLfvEg0tYASAAP4hiBWv/NoA6iAHKeAEgABYTMqM +EY4c+disBe/+QgAA2iBYcfaMEY4c+diiBe/+NgAmIDsX7FntuwIHyIEAAPmCABWjqwEA57cCCwjG +AACTH43AE+xSA90BIyAHAyNACjMQA90CE+xGJiEkA90CIyEH6yEJLVICgAD6xgALOjMBAOohIimb +AoAAA7sCgy+d8I0glvSX9pP1m/ODH+vsOh7uAoAADe0CnfELqgLq9gIiDD0AALBKbakFCACGCQJh +KCAUpIgICEcoJBT1AAZd0gCdACoSCPqzphWhCQUA8yHyDeD89QArIBb9YAilIgCdAMg/jiktIDij +7p4p86AHr5IAnQCPF2Xw0sAg0Q8AJiBOZGxpDpsCmyLrEgApUASAAO0SAypgBIAAWHHt0qDRDwDq +JAAK2ASAAFhzVNKg0Q8A2iD8QGgdoBvFAFhzxmP/xwCLEtog67wYKWAEgABYc8Fj/7TbwPwgyBWv +jgUALiQ7CCCGCQJj7PYIKVAEgADtIg8r8ASAAFhzQ/ohBhWgDwUA/kdmHe/8qgCLGyohCfxCsBWv +/QUADY0BDY4MLiQU5MwQDVYCgAAMqgL9YGYd4A4FAP9gBh2gBhUABqoCmrEZ6+f3NaYVr/vyAACK +J+tEAApoBIAA+0QAFaAMBQBYbKLSoNEP2iBYcYFj/wYAAAAA6iAHKeAEgABYTExj/uGLEtog67wS +KWAEgABYc5Jj/vdsEAYoIAUlIAckCgP3AAVkUVUBACggImSAoQIqAlhq+vlABMDQBhUAKSAh4+vI +GAQKgADzIAQv0gCdAOxZEQKlaQAAo5kqkp5uo3Qrkp1ksGopICH6QAgVoPzlAAyZAfcmAAywDQUA ++EQmHeAIBQD4IAYVoA6VAPggJhWgDwUA+CBGFaAMBQBYb8wMXRGj3fWzphWgAgUA0Q8X662KeGqh +JgxZEaOZLpKebuMtK5Kd5LApZWP9AACceGW/lMAg0Q///igNoAsFAMCgWYcdinhroc7//4wNoAsF +AMCwwNoNrTT84QYV7/9SAAAAAGwQCiwgBfhA8BXgCxUA+GBoHaelAQDoFgAlU/kAAOq6OQoYBIAA +6hYELCAEgAD9gcAEUZkBAMGz+4AbBWIAnQCMImXC5hvrhrQ+7hYDLMcCgACriOgWBizABIAA7BIG +KAQKgAD1AAQiEgCdAI0TLMKejxb9gAcr4gCdAC/yne8WBSeVoYAAJSEbikKGKpgYBaU29U8ADfEH +BQB7cwHVoIcpB2YM9MAF4+IAnQAqGgD1QjIN4Pz1ACsgFpgY/WAF/SIAnQCNKaXdnSmKQvqgClKi +AJ0AjBQb63mHQ5gYmRnrdwEGB+mAAGAArgAAGuteiqjoFgglDL+AAIsWjBMrsp6PFnyzQC/ynRvr +V+TwOWUz/QAAlrjvFgUv+24AAGACFQAAAAD4ISYV4AoFAFmGyRrrTYqoiRnoEgglDv8AAP//TA2g +DwUAwPAc60fAugurNPuBBhXv/wYAAAAAAP/8eA2gDwUAmRnqJAAK2ASAAFhLcYkZ6BIIJXmpgABg +Aa0AmRn6QPAVoAwFAFhLvokZ6BIILXmWAABgAozudAAKWASAAOWsDAroBIAA7xIFKVAEgADsRgIp +4ASAAFhvs4gYiRmOFvvTphWhDQUAddsIKyAWLwr/f7ktwGH2IIYVr/oCAIonixDqrCAp4ASAAFhv +dsCy66QCLSAEgAD7QEgVr/5yAAAAAOogByrgBIAAWEuIiRn4IQgVr/8GAACIQ4tAjBTpEgUsOASA +AP8AaB2n2wEA7RYBLgieAAAnIAcY6yEHB0HodwoEyIEAAPb0KBXgrnEA7qwQDVPCgADsqgICQEEA +AOp3AQHT/QAA5+cCAYxFAABtqQUIAIYJAmGOQ4tAwICYEhjrEhbrEokRjxUc6w4tIQf11hoFoa4x +AKyq+1AQFardAQDsIRou7wKAAATdAp3wHerlCloMhCCc9uf2ByTgQQAA6vYFJMg9AADs9gMh0AUA +APaGAAs0mR0A5vYEJMgFAADpOQwKJgKAAASkApTxCY05nfItIBTj3QgNIASAAO0kFCWp7oAAjxaI +EvXzphWhDgUA9cHyDeD29QArIBb3YATNIgCdANKA0Q8AiBRkgJvAINEPACucGOokAAlgBIAAWHKF +Y//kiif4IOYVp5tBAOqsICgECoAA9SAEedIAnQCMFcCx7MwgKegEgABYa3+aEo5D+oAIFe/8KgAA +AACLFexNEQlQBIAA/WAARfAMFQBYabT0gGAVr/3CAGWsoPmf5OjSAJ0ALyAg8f/kl5IAnQBj/3sA +AAAAAAAA6iAHKuAEgABYSxqIEtKA0Q+KJ9ww6xIAJVCBAABYbvvAsvtARh3gAgUA0Q8AAAAA+mBo +HeAMBQDtNAAMOASAAFhrW9tA7DQACugEgADqFgIr8ASAAO8SBSlQBIAAWG8b+oAIFe/7VgAAACuc +EuokAAlgBIAAWHJJY/70AGwQBBTqpiRAgAhEEfqAaB2gCxUAWYRlGOqPZKBC+EYADDAJJQCZoeim +ACEByYAAaCEcbyQZ7iIWZUghAAADQIgJCIoDIIgJBIoDAIgJAIraQPoAQh3gDBUAWYe9wCDRD8ck +0Q8P6DCfog7uMJ6jDcAwnaQMsTD9QKYVoAsFAJum+0DmFe//LgBsEBQjFhqUGYkwIhYb+iNoFedl +AQD838AVoA0VAAzcOSqwB4u3/CGmFaeZAQD4IoYV4aoBAOoWCiXYgQAAKxYe9MAvgRIAnQAuEhuO +4mXkJhLqVYIoE+pS9kAwAJAPpQAmMq5kZiMpMq1klh8a6k6wKJio7ZQABK/5gAAuEh4oEhr7wKQV +r8UFAAXuAS4WHO6uCARAgQAA7uxALCgEgAD/AC/KogCdACYSGiISFCUWFvbAaBWv+AUA5hYRIRA9 +AAAIKQGlluYWECsoBIAA/sAumqIAnQCdFpkVjBkkEhqOGhbqMpYX/iJmFaSiHQDqFhUi2BEAAOsW +CyLQIQAAmhwb6kIqEhvkQQwvdwKAAOPuCAZgQQAALBYSJBYZLBIcKqEHFOo9LhYY/YgAFaqqAQDs +FggtVwKAAAuqAvoh5hWgB7oAAAAAAAAnMADqIgwEyAUAAOoSHid4BQAA/+BoHaBvAQDzKzAN4A8V +ACsSHCzQACqhBQXMC6ur67xALiAEgAD7gBUC4gCdAAkMQPoAIh3gCgUADLo4BKsL5KoKBaAhAAD6 +I6gV4AwFAAb8OBbqHAt3C6bGJmCQ58sLDXgEgADnzAoF2GEAAOhoCAZgQQAAivAEAIkCqjaawAsA +i4zw7dwBIZgFAADzn/rrogCdAI0UAssMCsMMk/DygAgVoAcVAPKAKBXgBgUAC3Y4qWmjo5NBejsC +IiwBkkDzABnf0gCdABzqASMSGSISGhTp/hrp/O4SDycwBQAABNQB6toBDM4CgAAJRAIpEh0KZgIt +EhuWlJRQjycmEhUkEhcD/wz4IsgVoTgdAJ8no2MS6egvEhSTHp5AjdD+I8gVoAsFAO9GAyGYBQAA +4kYCLs4CgAD4ZgAM8ApVAOlGASIQQQAA5hYBKXgEgADoFgApoASAAFmHsi0SHioSFS4SHC3RBSgS +FisSEK7d7dxAKUgEgAD7oBWD4gCdAG2pBQgAhgkCYQM0Ai4SES8SGu/yBy8NLgAAZPGq9dOSBaDy +9QAc6cwuEhovEhgtEhsu4Q3z86YV4ApVAP2gCBXgCwUAWYeXJhIb0w8mYBbywAoFIgCdAC0SGy4S +GigSGf2gCBXgClUA/8DoFeALBQDoFgAqYASAAFmHii4SGy7gFiMK/3PhCioSG4sdWCwzZKKMLxIT +JhIYJxIS9eAFwhIAnQAmYp4pEhj2wBNT4gCdACmSnekWFySHeYAAKhIaIhIZiVCKpy4SF/gghhXg +CCUA+kEACTeZQQDiFhkkkRmAACoSHh3phisSHCqhBa2dLdAAF+mDq6sF3Qvk1AAF2QEAAPugEErg +yQEA+gAiHeAKBQAMujgEqwvkqgoFoCEAAIwV36DnnQgLmASAAP+AAEYwDgUA7BYdJlhhAAD9goAV +r/bqAIQc+iFoFa/2CgAA+48ACj/1ggAS6V6CKPZADpiSAJ0AJhIYJxISJmKeKRIY9sAOy+IAnQAp +kp0b6VXkkc1hU/0AAJq46RYXLPmGAABgABMrEhoqEhsrsQ1YK9hj/rTAINEPAIsaLBIb67wYLlAE +gABYcQPAINEPLOEAscz9wAQdr/laACUSGiYSGSVRDAZVDGVR/yYSGyZgBPTAENkSAJ0AIhIa4xIX +KbcCgACIIaYzIiIC5oI+adgEgADzABLgUAcFACkSG4oZKJAUhB6qiPaAAEJ3iAEA6JQUIiAFAAD1 +ABJeUgCdABzpTC4SGi8SGC0SGy7hDST2nf2gCBXgClUA9c8AD3ALBQBZhxUvEhsv8BYmCv928Q4r +EhorsQ0qEhsFuwxYK6UqEhuNGYqnwMDqrCAu2ASAAFhp1tKg0Q8iEh2LF/MAAgEwBwUA6wAVARBB +AACxd+KDHguP6AAA+QAgFa/ymgAAAC8SFtMP79oMCUAEgAD4IqgV5OodAPHBIA3gDQUADwCG6AwA +BugFAAB+2fEoEhePGA6eDPlAAEQwDQUA5O0hZEBBAAAPIIboLAAG6AUAAH7Z8WP9Cxfo/4Qc+iFo +Fa/4XgAAAPuvAAo/994A//ZkDaAJBQCLGiwSG+u8Ei5QBIAAWHClwCDRD8CgWYRiEujlgij4X/EY +kgCdAP/4/A2gCQUAwJAY6ODAagYmNPcBBhWv+LYALRIU3EDt3A8p2ASAAPojyBWk3R0AWPq4+iNG +FaAOFQD+IaYVr+fCAMCgWYRNEujQgij4X8+wkA+lAP/oBA2gCQUALBIb+4BoHaAbxQBYcIXAINEP +AADAkBjoxg8mNPcBBhWv53YAAAD7DwAKv+geAPrPAAq/6LYALBIaLxIWLsAVLcAUK8AR7MEJKVAE +gADu3QgLcASAAFj6jWP92igSGykSCSaAFC8SGglmCCaEFC/yAPH/8LKSAJ0AKxIX6hIbKe8CgAD9 +YABF8AwFAFhnqPRgYBWv9+IAAAAqEhvrNAAJYASAAFv2jCgSGoiBDKsR6zsIDTgEgADxH+1gUgCd +AOoSGylgBIAAW/Zb90AAQ//2ZgCMFvYjaBXv/wUAD48BD4YMJnQULXEJ/uKwFaALBQArxAAvxAPk +7hAO7gKAAP+mAA6wCRUACd0CncEa6Ij5VaYV7/XmAABsEAiIIi8gB5UU9CBmFaD99QDxGCwN4f8B +ACggFn2BLCsSBNMP0w/+IMYV57sBAPt/wBXgCRUA65s5CVAEgABYKxkvEgbzTpAN4P31ACwwDxXo +ahvocRbob+VQgC4LhgAAhxOwdyVcN/4gphXkVR0A5XUID88CgADmmQgCqA0AAPXgBuIQDKUAKJKe +9QAUy+IAnQAlkp3kVAACigGAAIq490AKOJIAnQAuYq5k4QEpYq3kkP1le/0AAO+2CCSIAYAAKCAW +fYEOmRDrMQYpUASAAFgq3YkQjBMqIBQrIAQMqgj1YAkZEgCdAAoKRyokFPVADK5SAJ0ALTAPKRIE +8bEcDeeZAQD5IA3pUgCdAOlUAAHAQQAAbXkFCACGCQJhwKCaEgx0EaRUKCAE9QAJ+RIAnQCJMeQW +ASpYBIAA5TICLI0iAADzIA4AUAQFAKR5ihXiEgItVwKAAKaqKaad0Q8Airj3QA8QkgCdAIkVDJkR +ppkukp71wA/D4gCdAC6SnZ4QiBDlhAAED5mAALCp+WEGFe/8FgAAAADsEgMpUASAAO0SBCnYBIAA +WG330qDRDwDAkAyuNO62CCz4RgAA2iD8QGgdoBvFAFhv0WP/yicwDvbgAIP/+kYAAAAr/BjqJAAJ +YASAAFhvyWP/rMCgWYOGG+gKirgtCv/5X/VgkAylAGP/uQAAAAAA+kKGHa/7rgAAACwhBx3oGfvQ +PAXqzAEA7jAOLmcCgAANzAIstiiKIBjoHv1AABUwDDUADKoCKrYp6AQFAfhBAAD5IAnBUgCdAG3p +DgQCYw9AhgQCZQ8AhgQCYcDQ/CBGFe/6+gCOMPPACuqSAJ0AjxXiEgIv/wKAAKb/J/ad0Q8rIQn8 +QrAVr/0FAA2tAQ2vDP5Chh3gDgUA7ZQDLmECgADulAAt3gKAAP1mAA2wCBUACLsCm5H41aYVr/jW +AIon/KBoHaALFQDtEgMlUIEAAFhokfogRhWv+Q4AANog60QACuAEgABb9bSLEYkxDKwR7LsIDSAE +gADxP/JAUgCdAOokAArgBIAAW/WDpKSkeYoV4hICLVcCgACmqimmndEP//WoDaAFBQAAACv8Euok +AAlgBIAAWG9zY/5UAAAAAAD+IMYV4AoFAFmDLRvnsYq4/iDIFeD99QD5X/AwkAylAP/0qA2gBQUA +wOD+IAYVr/guAAyoNPlhBhWv9FYAiicloRX7RAAVr8kFAAmpAalZKZxAbekTBAJjD4CGBAJpD2CG +BAJnefsY0w+NE9MP+6BoHeAMBQBYaFj6IEYVr/WOAPXvAA///44A2iD6gGgd4AwFAFhmj7N7jBXi +EgIuZwKAAKbMK8ad0Q9sEAQjIAAkCu10MQYiIQO8ItEPhiCFI4Qh9nAABDs2IQD4YABBs2YBAKYz +DjMR8q8ACX1EAQDjPBohE8kAAAQkLAQzKKMi0Q9sEAiKIicgB4kwlRT4QtAVoXcBAPFbDA3omQEA ++CAmFeD79QB7gSArEgQLC0f7f8AV4AkVAOubOQlQBIAAWCoL809gDeD79QAa52aIqBbnY/cADGCS +AJ0ALWKuZNGsJWKtZFGosIiYqOlUAAKMeYAAFedUJVCAJVw3+CAGFeRVHQDlRQgLzwKAAOaZCAKo +DQAA9OAIWhIAnQAokp71ABLD4gCdACWSnWRRbyogFvtDJg3g7NUAKzAQ/WASJCIAnQArMQu8u9og +WCnSKCAULCAEpIj1gArREgCdAAgIRygkFPUADG5SAJ0AihQe51eNESghBxznNBnnU/+h4BXqiAEA +/wAAFDT/HQDpiAIH+AUAAA9PDJhQiyAP7Dn8oGYV56oBAOxWAi3eAoAA60sCAshBAADrVgEhwEEA +APlAB+lSAJ0A6EENYlP9AABtqQUIAIYJAmHAgJgT6SAEIlv9AAAMuxGrW/UgB4ESAJ0AiDHlMgIl +2EEAAOsWAiwJsgAA8wAKsFADBQCjTIgTDH0Rpt3s1p0sEASAANEPAAAAAAAAAPcADTiSAJ0ADHkR +ppkukp71wA2T4gCdACWSnWRRqbCMnKhlXuRgAFHqJAAJ2ASAAO0SBCpgBIAAWGzd0qDRDwDAoFmC +exrm/oio+R/zUJD79QD/+cgNoAUFAADaIPxAaB2gG8UAWG6zY/+8wFDA2g2INPlBBhWv+UoAK3wY +6iQACWAEgABYbqtj/5wAAAAAAPhChh2v+tIAAAAAiif9IGgdoAsVAOqsICpoBIAAWGem+iBmFa/8 +DgCLMPNgCLqSAJ0A4hIDK+cCgACmzCTGndEPjxAuIQn4QrAV7/oFAAqKAQqMDCwkFOSZEA92AoAA +Ce4C++BmHaALBQD74AYd4A0VAA3uAp7x/NWmFe/49gAA6iQACuAEgABb9LOLEigyAeoWBS1nAoAA +7LsIDRgEgADxH/WQUgCdAOokAArgBIAAW/SBiBOjo6NMDH0Rpt3s1p0sEASAANEP//asDaAFBQCO +NIs3jTX+cAAHu84hAP+AAEZz7gEArswOzBH9bwANvd0BAOzMGiXbyQAADb0sDcwo/WAARb/2QgAA +K3wS6iQACWAEgABYbmNj/nzAoFmCIBrmpIio+R/yeJD79QD/+YQNoAUFAADAUMD6D480/0EGFe/5 +RgCwSwy7EetbCAlQBIAA+2IAFeAMBQBYZZWzTOISAyvvAoAApt0s1p3RDwAAbBAG2iBYKccX5rMl +MBb5zVQFoqYFAAamKIo3qGgFVQoIVQunVYhQ5KwIKQEKgAD6oCgV4AcVAOWBFXvICoAAiDKUsJWi +m6MJiAKUUZgy0Q/aIFgptBzmoCvCherCiC1IBIAAqbvvMBYt3kKAAKuqG+acGOaa7uaRHM8CgACr +mahomBCZEYaRK4J97IJ/L4EKgADuZgEL6AqAAA27AiuGfebGAgYAcYAAWALMixCJESuyfRjmbQaG +OAa/Ao5Rn5KMMpTg7kYBKQEKgADlRgAr6AqAAA3MApRRnDLRD2wQCNogWCmQ1KAX5n8b5oD5zP4F +4qYFAAZEKBXmcOlJCAlXAoAAq6qKoCmSf6VFp0QKmQH4IAYV4GMFAOEABQEzuQAA8ADcDaAHFQAA +AAM8CvWAAgZ/CEUA6MgICVAEgADogh8qWASAAP50ABWvfQUA7cwIC2gEgAALgAABAYcDN2DhAQcJ +9yAAANEPbBAEFuZhFeY+0w+mIgU1AiUmgCQigGdAC20IBSgigGeAAmP/89EPAGwQBCggBSUgB/pg +qBWv9NUA+kBIFeADJQD9ASAR0VUBAMAg0Q8AiCkZ5k+aK/sAB/wiAJ0ACVkJKZ0CKpEIKZEEDwIA ++yAEw6IAnQAqCh/7QARo4gCdAAIqAlhlNIsiDwIAA7oBZK+4iicEuwHrJgIlUMEAAFherOPmGhUB +OYAAKKAA0w/TDwOICiiCEOygBy1YBIAA+kBoHaANRQALgABlr9yJJ9MPZJ92KpkUyqeKmWSvbCig +AAOICiiCEOygBy1YBIAA+kBoHaANNQALgABlr+Bj/0oAAP//VA2gCgUA2iBYZSErICLquwwJUASA +AFhmctpQ+gAiHeAMBQBYZuSLIgO6AfN/+uZiAJ0ALCAH5L0BCVAEgAD8QEYV4bwBAOu8HylgBIAA +WG2ewCDRDwDrICIpUASAAFhmYCogBcHjfqEMaKgpiyLzYAQFf/xmAC8gOsCPePnq+kBoHaALBQD8 +AAIdoA0lAFhljGP/1wAA+kBoHaALBQD8AAIdoA0lAFhlCWP/vwAAbBAKiCsd5fYuICGLN/xgyBWg +/+UAD+4BLiQhDcwBDLsM64kIeMgEgADAINEPAwCGCQJhmxUoIAUlIAf4IQYV7/TVAPxASBXgAyUA +/RtAQdFVAQCKKZsr+0AH7GIAnQAb5d8LWwkrvQIssQgrsQT9YASzogCdAMHP/YAEYOIAnQDaIFhk +yIsiA7oBZK+biicEuwHrJgIlUMEAAFheQQqrAuPlrhUBKYAAKLAA0w8DiAooghAssAf6QGgdoA1F +AAuAAOukAA1/HgAAiSdkn1oqmRQrkgnKqGS/TyiwAAOICiiCECywB/pAaB2gDTUAC4AA66QADX8u +AABj/y0AAAAAAP//SA2gCwUA2iBYZLUrICLquwwJUASAAFhmBtpQ+gAiHeAMBQBYZniLIgO6AfN/ ++s5iAJ0ALCAH5L0BCVAEgAD8QEYV4bwBAOu8HylgBIAAWG0ywCDRDwDrICIpUASAAFhl9CogBcHj +fqEMaKgpiyLzYAQFf/xaAC8gOsCPePnq+kBoHaALBQD8AAIdoA0lAFhlIGP/1wAA+kBoHaALBQD8 +AAIdoA0lAFhknWP/vwAAbBAEKTAWCVkU9SAG2JIAnQDxLrAN7/vlAOPlYxgECoAA9SAEGhIAnQBo +lQTAINEPACogBrCqCgpH6iQGLX9+AACMIoonC8sB6yYCJVDBAABYXefJrSigAAOICiiCEOygBy1Y +BIAA+kBoHaANRQALgABlr+CJJ2SfsiqZFGSgoIqZZK+nKKAAA4gKKIIQ7KAHLVgEgAD6QGgdoA01 +AAuAAGWv4GP/hQAAKSAGsJkJCUfpJAYs+8YAAIknjCIqmRQLzAGLmewmAiUCgYAAKLAAA4gKKIIQ +2iD9YPAVoA01AAuAAMAg0Q8AAOokAAnYBIAA7EQACugEgABYZbnAINEPAOokAAnYBIAA7EQACugE +gABb/0/AINEPAP/+wA2gCwUA//10DaAKBQBsEATRDwAAAGwQCBXlQBTlHBflQJIS+CBIFaAKBQD6 +IGYVoAlFAJkUGuU6CIIJ4IEECReCgAD2QABD8AgVAOoiCAxACoAA+CAmFa/59QD5FwAMcAYFAPgg +BhWgAIoAmxOMFLFm4iwMI7gxAADlXAImY/0AAOwWBCYFMYAALVHC+sAEANALFQDguxoOo0wAAC5x +fmTvygIqAlhmhI8R+sAEANAIFQDgiBoNGASAAOgWAyeAaYAAiaKKEAqZAZkyijcqrDBYXYHKoSig +ANMP0w8EiAooghDsoActWASAAPpgaB2gDUUAC4AAZa/ciTfTD2SfbSqZFMuniplkr2MooAAEiAoo +ghDsoActWASAAPpgaB2gDTUAC4AAZa/gY/9BixP6IEgVoAkVAAubOVhncdEP//8UDaAKBQBsEAYd +5PcLKxGtsyoyfxnk9YigJd31+KAARPAEBQDpuQgEAbGAACwyeC8ye/mABYRiAJ0AZfDsLDZ8KzJ5 +KzZ73UAN5BYBAgCUoA3kFiwKCfxABfQiAJ0ALzJ7wcDt5OIXg3mAACIyfCohBI4g8+H+Daa6AQAk +Nnz0b2YVoAAeAC42fO2vAQXD/QAACP8C7yUEJYxZAAAiMnywzO8yeyEA8YAAycZj/7/aIFhl7WWg +mSohBP9BIAwWmgEAyJnRDwDaIFhnNtEPANogWGdq0Q8A+kBoHaALBQBYZzfRDwAAAOrSYCFj4QAA ++4AEANALFQD9YAEF3/z1AAy7AwuqASrWYFmEwSQ2fCQ2e/pv6BWv/MoAWXu9WGWgLVKwZN85WXuO +Y/8zHOSy/m+IFaAKVQD4b0gVoAtFAOgWACFr5QAAWYJr+m/oFa/70gApMnviNnws+2YAACI2e9EP +AABsEAQU5KQZ5KDo5IoZXsKAAKS0I0J/qYjouAgBgkGAAIoweKkCKkJ7HOSZKzEEKkZ/DLoB6jUE +KdAEgABYZbHOrikxBP8hAAwW2QEAyNfRD9owWGb70Q/aMFhnL9EPAAAAAAAA+kBoHaALBQBYZvvR +DyNGf9EPAABsEATwYOAN7/n1AIgiCTkDCYgBmCKKJyqsMFhc6OPkVRUBGYAAKKAAA4gKKIIQ7KAH +LVgEgAD6QGgdoA1FAAuAAGWv4Ikny5IqmRTKpYqZya0ooAADiAooghDsoActWASAAPpAaB2gDTUA *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 18:44:11 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3AFD74E2; Fri, 5 Jul 2013 18:44:11 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2CCD61C5B; Fri, 5 Jul 2013 18:44:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65IiBXW035816; Fri, 5 Jul 2013 18:44:11 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IiAcb035814; Fri, 5 Jul 2013 18:44:10 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307051844.r65IiAcb035814@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 5 Jul 2013 18:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r252818 - in stable/9/sbin: hastctl hastd 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.14 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, 05 Jul 2013 18:44:11 -0000 Author: trociny Date: Fri Jul 5 18:44:10 2013 New Revision: 252818 URL: http://svnweb.freebsd.org/changeset/base/252818 Log: MFC r252472: Make hastctl(1) ('list' command) output a worker pid. Reviewed by: pjd Modified: stable/9/sbin/hastctl/hastctl.c stable/9/sbin/hastd/control.c Directory Properties: stable/9/sbin/hastctl/ (props changed) stable/9/sbin/hastd/ (props changed) Modified: stable/9/sbin/hastctl/hastctl.c ============================================================================== --- stable/9/sbin/hastctl/hastctl.c Fri Jul 5 18:31:26 2013 (r252817) +++ stable/9/sbin/hastctl/hastctl.c Fri Jul 5 18:44:10 2013 (r252818) @@ -293,6 +293,7 @@ control_set_role(struct nv *nv, const ch static int control_list(struct nv *nv) { + pid_t pid; unsigned int ii; const char *str; int error, ret; @@ -331,6 +332,9 @@ control_list(struct nv *nv) str = nv_get_string(nv, "status%u", ii); if (str != NULL) printf(" status: %s\n", str); + pid = nv_get_int32(nv, "workerpid%u", ii); + if (pid != 0) + printf(" workerpid: %d\n", pid); printf(" dirty: %ju (%NB)\n", (uintmax_t)nv_get_uint64(nv, "dirty%u", ii), (intmax_t)nv_get_uint64(nv, "dirty%u", ii)); Modified: stable/9/sbin/hastd/control.c ============================================================================== --- stable/9/sbin/hastd/control.c Fri Jul 5 18:31:26 2013 (r252817) +++ stable/9/sbin/hastd/control.c Fri Jul 5 18:44:10 2013 (r252818) @@ -271,6 +271,7 @@ control_status(struct hastd_config *cfg, nv_add_string(nvout, compression_name(res->hr_compression), "compression%u", no); nv_add_string(nvout, role2str(res->hr_role), "role%u", no); + nv_add_int32(nvout, res->hr_workerpid, "workerpid%u", no); switch (res->hr_role) { case HAST_ROLE_PRIMARY: From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 18:44:41 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C86046FA; Fri, 5 Jul 2013 18:44:41 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BAA861C63; Fri, 5 Jul 2013 18:44:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Iifkc035907; Fri, 5 Jul 2013 18:44:41 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IifFK035905; Fri, 5 Jul 2013 18:44:41 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307051844.r65IifFK035905@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 5 Jul 2013 18:44: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: r252819 - in stable/8/sbin: hastctl hastd 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.14 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, 05 Jul 2013 18:44:41 -0000 Author: trociny Date: Fri Jul 5 18:44:41 2013 New Revision: 252819 URL: http://svnweb.freebsd.org/changeset/base/252819 Log: MFC r252472: Make hastctl(1) ('list' command) output a worker pid. Reviewed by: pjd Modified: stable/8/sbin/hastctl/hastctl.c stable/8/sbin/hastd/control.c Directory Properties: stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastctl/hastctl.c ============================================================================== --- stable/8/sbin/hastctl/hastctl.c Fri Jul 5 18:44:10 2013 (r252818) +++ stable/8/sbin/hastctl/hastctl.c Fri Jul 5 18:44:41 2013 (r252819) @@ -293,6 +293,7 @@ control_set_role(struct nv *nv, const ch static int control_list(struct nv *nv) { + pid_t pid; unsigned int ii; const char *str; int error, ret; @@ -331,6 +332,9 @@ control_list(struct nv *nv) str = nv_get_string(nv, "status%u", ii); if (str != NULL) printf(" status: %s\n", str); + pid = nv_get_int32(nv, "workerpid%u", ii); + if (pid != 0) + printf(" workerpid: %d\n", pid); printf(" dirty: %ju (%NB)\n", (uintmax_t)nv_get_uint64(nv, "dirty%u", ii), (intmax_t)nv_get_uint64(nv, "dirty%u", ii)); Modified: stable/8/sbin/hastd/control.c ============================================================================== --- stable/8/sbin/hastd/control.c Fri Jul 5 18:44:10 2013 (r252818) +++ stable/8/sbin/hastd/control.c Fri Jul 5 18:44:41 2013 (r252819) @@ -271,6 +271,7 @@ control_status(struct hastd_config *cfg, nv_add_string(nvout, compression_name(res->hr_compression), "compression%u", no); nv_add_string(nvout, role2str(res->hr_role), "role%u", no); + nv_add_int32(nvout, res->hr_workerpid, "workerpid%u", no); switch (res->hr_role) { case HAST_ROLE_PRIMARY: From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 18:46:36 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5DB3E86F; Fri, 5 Jul 2013 18:46:36 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4F5421C72; Fri, 5 Jul 2013 18:46:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Ika1O036381; Fri, 5 Jul 2013 18:46:36 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IkZuD036378; Fri, 5 Jul 2013 18:46:35 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307051846.r65IkZuD036378@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 5 Jul 2013 18:46: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: r252820 - stable/9/usr.sbin/bsnmpd/modules/snmp_hast 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.14 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, 05 Jul 2013 18:46:36 -0000 Author: trociny Date: Fri Jul 5 18:46:35 2013 New Revision: 252820 URL: http://svnweb.freebsd.org/changeset/base/252820 Log: MFC r252516, r252540: Add a mib for worker process ID. Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Directory Properties: stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt ============================================================================== --- stable/9/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Fri Jul 5 18:44:41 2013 (r252819) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Fri Jul 5 18:46:35 2013 (r252820) @@ -57,6 +57,9 @@ begemotHast MODULE-IDENTITY REVISION "201304130000Z" DESCRIPTION "Initial revision." + REVISION "201307010000Z" + DESCRIPTION + "Added hastResourceWorkerPid." ::= { begemot 220 } begemotHastObjects OBJECT IDENTIFIER ::= { begemotHast 1 } @@ -116,7 +119,8 @@ HastResourceEntry ::= SEQUENCE { hastResourceReadErrors Counter64, hastResourceWriteErrors Counter64, hastResourceDeleteErrors Counter64, - hastResourceFlushErrors Counter64 + hastResourceFlushErrors Counter64, + hastResourceWorkerPid INTEGER } hastResourceIndex OBJECT-TYPE @@ -295,4 +299,12 @@ hastResourceFlushErrors OBJECT-TYPE "Count of resource local flush operations that failed." ::= { hastResourceEntry 21 } +hastResourceWorkerPid OBJECT-TYPE + SYNTAX INTEGER + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Worker process ID." + ::= { hastResourceEntry 22 } + END Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c ============================================================================== --- stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c Fri Jul 5 18:44:41 2013 (r252819) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c Fri Jul 5 18:46:35 2013 (r252820) @@ -78,6 +78,7 @@ struct hast_snmp_resource { uint64_t write_errors; uint64_t delete_errors; uint64_t flush_errors; + pid_t workerpid; }; static TAILQ_HEAD(, hast_snmp_resource) resources = @@ -343,6 +344,7 @@ update_resources(void) nv_get_uint64(nvout, "stat_delete_error%u", i); res->flush_errors = nv_get_uint64(nvout, "stat_flush_error%u", i); + res->workerpid = nv_get_int32(nvout, "workerpid%u", i); TAILQ_INSERT_TAIL(&resources, res, link); } nv_free(nvout); @@ -498,6 +500,9 @@ op_hastResourceTable(struct snmp_context case LEAF_hastResourceFlushErrors: value->v.counter64 = res->flush_errors; break; + case LEAF_hastResourceWorkerPid: + value->v.integer = res->workerpid; + break; default: ret = SNMP_ERR_RES_UNAVAIL; break; Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def ============================================================================== --- stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Fri Jul 5 18:44:41 2013 (r252819) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Fri Jul 5 18:46:35 2013 (r252820) @@ -59,6 +59,7 @@ (19 hastResourceWriteErrors COUNTER64 GET) (20 hastResourceDeleteErrors COUNTER64 GET) (21 hastResourceFlushErrors COUNTER64 GET) + (22 hastResourceWorkerPid INTEGER GET) ) ) ) From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 18:47:26 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 478ECA91; Fri, 5 Jul 2013 18:47:26 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3971D1C83; Fri, 5 Jul 2013 18:47:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65IlQDo036546; Fri, 5 Jul 2013 18:47:26 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IlPVn036543; Fri, 5 Jul 2013 18:47:25 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307051847.r65IlPVn036543@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 5 Jul 2013 18:47:25 +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: r252821 - stable/8/usr.sbin/bsnmpd/modules/snmp_hast 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.14 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, 05 Jul 2013 18:47:26 -0000 Author: trociny Date: Fri Jul 5 18:47:25 2013 New Revision: 252821 URL: http://svnweb.freebsd.org/changeset/base/252821 Log: MFC r252516, r252540: Add a mib for worker process ID. Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Directory Properties: stable/8/usr.sbin/bsnmpd/ (props changed) Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Fri Jul 5 18:46:35 2013 (r252820) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/BEGEMOT-HAST-MIB.txt Fri Jul 5 18:47:25 2013 (r252821) @@ -57,6 +57,9 @@ begemotHast MODULE-IDENTITY REVISION "201304130000Z" DESCRIPTION "Initial revision." + REVISION "201307010000Z" + DESCRIPTION + "Added hastResourceWorkerPid." ::= { begemot 220 } begemotHastObjects OBJECT IDENTIFIER ::= { begemotHast 1 } @@ -116,7 +119,8 @@ HastResourceEntry ::= SEQUENCE { hastResourceReadErrors Counter64, hastResourceWriteErrors Counter64, hastResourceDeleteErrors Counter64, - hastResourceFlushErrors Counter64 + hastResourceFlushErrors Counter64, + hastResourceWorkerPid INTEGER } hastResourceIndex OBJECT-TYPE @@ -295,4 +299,12 @@ hastResourceFlushErrors OBJECT-TYPE "Count of resource local flush operations that failed." ::= { hastResourceEntry 21 } +hastResourceWorkerPid OBJECT-TYPE + SYNTAX INTEGER + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "Worker process ID." + ::= { hastResourceEntry 22 } + END Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c Fri Jul 5 18:46:35 2013 (r252820) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_snmp.c Fri Jul 5 18:47:25 2013 (r252821) @@ -78,6 +78,7 @@ struct hast_snmp_resource { uint64_t write_errors; uint64_t delete_errors; uint64_t flush_errors; + pid_t workerpid; }; static TAILQ_HEAD(, hast_snmp_resource) resources = @@ -343,6 +344,7 @@ update_resources(void) nv_get_uint64(nvout, "stat_delete_error%u", i); res->flush_errors = nv_get_uint64(nvout, "stat_flush_error%u", i); + res->workerpid = nv_get_int32(nvout, "workerpid%u", i); TAILQ_INSERT_TAIL(&resources, res, link); } nv_free(nvout); @@ -498,6 +500,9 @@ op_hastResourceTable(struct snmp_context case LEAF_hastResourceFlushErrors: value->v.counter64 = res->flush_errors; break; + case LEAF_hastResourceWorkerPid: + value->v.integer = res->workerpid; + break; default: ret = SNMP_ERR_RES_UNAVAIL; break; Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Fri Jul 5 18:46:35 2013 (r252820) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/hast_tree.def Fri Jul 5 18:47:25 2013 (r252821) @@ -59,6 +59,7 @@ (19 hastResourceWriteErrors COUNTER64 GET) (20 hastResourceDeleteErrors COUNTER64 GET) (21 hastResourceFlushErrors COUNTER64 GET) + (22 hastResourceWorkerPid INTEGER GET) ) ) ) From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 18:51:21 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BA0B9D85; Fri, 5 Jul 2013 18:51:21 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AABE71CBB; Fri, 5 Jul 2013 18:51:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65IpLFk038733; Fri, 5 Jul 2013 18:51:21 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65IpLcn038732; Fri, 5 Jul 2013 18:51:21 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051851.r65IpLcn038732@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 18:51:21 +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: r252823 - 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.14 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, 05 Jul 2013 18:51:21 -0000 Author: andre Date: Fri Jul 5 18:51:21 2013 New Revision: 252823 URL: http://svnweb.freebsd.org/changeset/base/252823 Log: MFC r243628: Update comment to prefer M_NOWAIT over M_DONTWAIT and M_WAITOK over M_WAIT. Modified: stable/9/sys/sys/mbuf.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/sys/mbuf.h ============================================================================== --- stable/9/sys/sys/mbuf.h Fri Jul 5 18:50:17 2013 (r252822) +++ stable/9/sys/sys/mbuf.h Fri Jul 5 18:51:21 2013 (r252823) @@ -350,8 +350,8 @@ struct mbstat { * Flags specifying how an allocation should be made. * * The flag to use is as follows: - * - M_DONTWAIT or M_NOWAIT from an interrupt handler to not block allocation. - * - M_WAIT or M_WAITOK from wherever it is safe to block. + * - M_NOWAIT (M_DONTWAIT) from an interrupt handler to not block allocation. + * - M_WAITOK (M_WAIT) from wherever it is safe to block. * * M_DONTWAIT/M_NOWAIT means that we will not block the thread explicitly and * if we cannot allocate immediately we may return NULL, whereas From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 18:56:05 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 28F0FF2D; Fri, 5 Jul 2013 18:56:05 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0AA281CFB; Fri, 5 Jul 2013 18:56:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Iu4lS039361; Fri, 5 Jul 2013 18:56:04 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65Iu4Wu039360; Fri, 5 Jul 2013 18:56:04 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051856.r65Iu4Wu039360@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 18:56: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: r252824 - 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.14 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, 05 Jul 2013 18:56:05 -0000 Author: andre Date: Fri Jul 5 18:56:04 2013 New Revision: 252824 URL: http://svnweb.freebsd.org/changeset/base/252824 Log: MFC r242998: Remove description of deprecated IP fragment checksum support. Since SMPng it wasn't really supported anymore and if it worked then only by chance. Only very few drivers ever supported it. Discussed with: yongari Modified: stable/9/share/man/man9/mbuf.9 Directory Properties: stable/9/ (props changed) stable/9/share/ (props changed) stable/9/share/man/ (props changed) stable/9/share/man/man9/ (props changed) Modified: stable/9/share/man/man9/mbuf.9 ============================================================================== --- stable/9/share/man/man9/mbuf.9 Fri Jul 5 18:51:21 2013 (r252823) +++ stable/9/share/man/man9/mbuf.9 Fri Jul 5 18:56:04 2013 (r252824) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 18, 2011 +.Dd November 13, 2012 .Dt MBUF 9 .Os .\" @@ -1064,45 +1064,6 @@ In this case, the checksum field will be set by the TCP/IP module to the checksum of the pseudo header defined by the TCP and UDP specifications. .Pp -For outbound packets which have been fragmented -by the host CPU, the following will also be true, -regardless of the checksum flag settings: -.Bl -bullet -offset indent -.It -all fragments will have the flag -.Dv M_FRAG -set in their -.Va m_flags -field; -.It -the first and the last fragments in the chain will have -.Dv M_FIRSTFRAG -or -.Dv M_LASTFRAG -set in their -.Va m_flags , -correspondingly; -.It -the first fragment in the chain will have the total number -of fragments contained in its -.Va csum_data -field. -.El -.Pp -The last rule for fragmented packets takes precedence over the one -for a TCP or UDP checksum. -Nevertheless, offloading a TCP or UDP checksum is possible for a -fragmented packet if the flag -.Dv CSUM_IP_FRAGS -is set in the field -.Va ifnet.if_data.ifi_hwassist -associated with the network interface. -However, in this case the interface is expected to figure out -the location of the checksum field within the sequence of fragments -by itself because -.Va csum_data -contains a fragment count instead of a checksum offset value. -.Pp On input, an interface indicates the actions it has performed on a packet by setting one or more of the following flags in .Va csum_flags @@ -1148,22 +1109,6 @@ It is a peculiarity of the algorithm use calculated over any valid packet will be .Li 0xFFFF as long as the original checksum field is included. -.Pp -For inbound packets which are IP fragments, all -.Va csum_data -fields will be summed during reassembly to obtain the final checksum -value passed to an upper layer in the -.Va csum_data -field of the reassembled packet. -The -.Va csum_flags -fields of all fragments will be consolidated using logical AND -to obtain the final value for -.Va csum_flags . -Thus, in order to successfully -offload checksum computation for fragmented data, -all fragments should have the same value of -.Va csum_flags . .Sh STRESS TESTING When running a kernel compiled with the option .Dv MBUF_STRESS_TEST , From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 19:11:13 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 688DE4EC; Fri, 5 Jul 2013 19:11:13 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5955B1D94; Fri, 5 Jul 2013 19:11:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65JBD6W045049; Fri, 5 Jul 2013 19:11:13 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JBDfW045048; Fri, 5 Jul 2013 19:11:13 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051911.r65JBDfW045048@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 19:11: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: r252825 - stable/9/sys/netinet 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.14 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, 05 Jul 2013 19:11:13 -0000 Author: andre Date: Fri Jul 5 19:11:12 2013 New Revision: 252825 URL: http://svnweb.freebsd.org/changeset/base/252825 Log: MFC r242308: Define the delayed ACK timeout value directly as hz/10 instead of obfuscating it by going through PR_FASTHZ. No functional change. Modified: stable/9/sys/netinet/tcp_timer.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_timer.h ============================================================================== --- stable/9/sys/netinet/tcp_timer.h Fri Jul 5 18:56:04 2013 (r252824) +++ stable/9/sys/netinet/tcp_timer.h Fri Jul 5 19:11:12 2013 (r252825) @@ -118,7 +118,7 @@ #define TCP_MAXRXTSHIFT 12 /* maximum retransmits */ -#define TCPTV_DELACK (hz / PR_FASTHZ / 2) /* 100ms timeout */ +#define TCPTV_DELACK ( hz/10 ) /* 100ms timeout */ #ifdef TCPTIMERS static const char *tcptimers[] = From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 19:35:55 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EEF07E9C; Fri, 5 Jul 2013 19:35:55 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D0AE41F20; Fri, 5 Jul 2013 19:35:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65JZtFF051806; Fri, 5 Jul 2013 19:35:55 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JZpqe051782; Fri, 5 Jul 2013 19:35:51 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201307051935.r65JZpqe051782@svn.freebsd.org> From: Ed Maste Date: Fri, 5 Jul 2013 19:35: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: r252827 - in stable/9: . etc etc/mtree gnu/usr.bin/gdb gnu/usr.bin/gdb/arch/amd64 gnu/usr.bin/gdb/arch/arm gnu/usr.bin/gdb/arch/i386 gnu/usr.bin/gdb/arch/ia64 gnu/usr.bin/gdb/arch/mips ... 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.14 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, 05 Jul 2013 19:35:56 -0000 Author: emaste Date: Fri Jul 5 19:35:51 2013 New Revision: 252827 URL: http://svnweb.freebsd.org/changeset/base/252827 Log: MFC r244236,r244408,r244915,r247054,r251512: Add a new knob WITH_DEBUG_FILES to control the building of standalone debug files for userland programs and libraries. The "-g" debug flag is automatically applied when WITH_DEBUG_FILES is set. The debug files are named ${prog}.debug and ${shlib}.debug for consistency with other systems and documentation. In addition they are installed under /usr/lib/debug, to simplify the process of installing them if needed after a crash. Users of bsd.{prog,lib}.mk outside of the base system place the standalone debug files in a .debug subdirectory. GDB automatically searches both of these directories for standalone debug files. Added: stable/9/etc/mtree/BSD.debug.dist - copied unchanged from r251512, head/etc/mtree/BSD.debug.dist stable/9/tools/build/options/WITH_DEBUG_FILES - copied unchanged from r251512, head/tools/build/options/WITH_DEBUG_FILES Modified: stable/9/Makefile.inc1 (contents, props changed) stable/9/etc/Makefile stable/9/etc/mtree/Makefile stable/9/gnu/usr.bin/gdb/Makefile.inc stable/9/gnu/usr.bin/gdb/arch/amd64/config.h stable/9/gnu/usr.bin/gdb/arch/arm/config.h stable/9/gnu/usr.bin/gdb/arch/i386/config.h stable/9/gnu/usr.bin/gdb/arch/ia64/config.h stable/9/gnu/usr.bin/gdb/arch/mips/config.h stable/9/gnu/usr.bin/gdb/arch/powerpc/config.h stable/9/gnu/usr.bin/gdb/arch/powerpc64/config.h stable/9/gnu/usr.bin/gdb/arch/sparc64/config.h stable/9/gnu/usr.bin/gdb/gdb/Makefile stable/9/share/mk/bsd.crunchgen.mk stable/9/share/mk/bsd.lib.mk stable/9/share/mk/bsd.own.mk stable/9/share/mk/bsd.prog.mk stable/9/share/mk/sys.mk Directory Properties: stable/9/etc/ (props changed) stable/9/etc/mtree/ (props changed) stable/9/gnu/usr.bin/gdb/ (props changed) stable/9/share/mk/ (props changed) stable/9/tools/build/options/ (props changed) Modified: stable/9/Makefile.inc1 ============================================================================== --- stable/9/Makefile.inc1 Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/Makefile.inc1 Fri Jul 5 19:35:51 2013 (r252827) @@ -419,6 +419,13 @@ _worldtmp: mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${WORLDTMP}/usr/include >/dev/null ln -sf ${.CURDIR}/sys ${WORLDTMP} +.if ${MK_DEBUG_FILES} != "no" + # We could instead disable debug files for these build stages + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ + -p ${WORLDTMP}/legacy/usr/lib >/dev/null + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ + -p ${WORLDTMP}/usr/lib >/dev/null +.endif .if ${MK_BIND_LIBS} != "no" mtree -deU -f ${.CURDIR}/etc/mtree/BIND.include.dist \ -p ${WORLDTMP}/usr/include >/dev/null @@ -504,6 +511,10 @@ build32: -p ${LIB32TMP}/usr >/dev/null mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${LIB32TMP}/usr/include >/dev/null +.if ${MK_DEBUG_FILES} != "no" + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ + -p ${LIB32TMP}/usr/lib >/dev/null +.endif mkdir -p ${WORLDTMP} ln -sf ${.CURDIR}/sys ${WORLDTMP} .if ${MK_KERBEROS} != "no" @@ -733,6 +744,10 @@ distributeworld installworld: installche -p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \ -p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null +.if ${MK_DEBUG_FILES} != "no" + mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \ + -p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null +.endif .if defined(NO_ROOT) ${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \ sed -e 's#^\./#./${dist}/#' >> ${METALOG} Modified: stable/9/etc/Makefile ============================================================================== --- stable/9/etc/Makefile Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/etc/Makefile Fri Jul 5 19:35:51 2013 (r252827) @@ -143,6 +143,9 @@ MTREE+= BIND.chroot.dist MTREE+= BIND.include.dist .endif .endif +.if ${MK_DEBUG_FILES} != "no" +MTREE+= BSD.debug.dist +.endif PPPCNF= ppp.conf @@ -309,6 +312,9 @@ MTREES= mtree/BSD.root.dist / \ mtree/BSD.var.dist /var \ mtree/BSD.usr.dist /usr \ mtree/BSD.include.dist /usr/include +.if ${MK_DEBUG_FILES} != "no" +MTREES+= mtree/BSD.debug.dist /usr/lib +.endif .if ${MK_BIND_LIBS} != "no" MTREES+= mtree/BIND.include.dist /usr/include .endif Copied: stable/9/etc/mtree/BSD.debug.dist (from r251512, head/etc/mtree/BSD.debug.dist) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/etc/mtree/BSD.debug.dist Fri Jul 5 19:35:51 2013 (r252827, copy of r251512, head/etc/mtree/BSD.debug.dist) @@ -0,0 +1,48 @@ +# $FreeBSD$ +# +# Please see the file src/etc/mtree/README before making changes to this file. +# + +/set type=dir uname=root gname=wheel mode=0755 +. + debug + bin + .. + boot + .. + lib + geom + .. + .. + libexec + .. + sbin + .. + usr + bin + .. + games + .. + lib + engines + .. + .. + lib32 + .. + libexec + bsdinstall + .. + lpr + ru + .. + .. + sendmail + .. + sm.bin + .. + .. + sbin + .. + .. + .. +.. Modified: stable/9/etc/mtree/Makefile ============================================================================== --- stable/9/etc/mtree/Makefile Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/etc/mtree/Makefile Fri Jul 5 19:35:51 2013 (r252827) @@ -4,6 +4,7 @@ FILES= ${_BIND.chroot.dist} \ ${_BIND.include.dist} \ + ${_BSD.debug.dist} \ BSD.include.dist \ BSD.root.dist \ ${_BSD.sendmail.dist} \ @@ -16,6 +17,9 @@ _BIND.chroot.dist= BIND.chroot.dist _BIND.include.dist= BIND.include.dist .endif .endif +.if ${MK_DEBUG_FILES} != "no" +_BSD.debug.dist= BSD.debug.dist +.endif .if ${MK_GROFF} != "no" _BSD.groff.dist= BSD.groff.dist .endif Modified: stable/9/gnu/usr.bin/gdb/Makefile.inc ============================================================================== --- stable/9/gnu/usr.bin/gdb/Makefile.inc Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/Makefile.inc Fri Jul 5 19:35:51 2013 (r252827) @@ -37,6 +37,7 @@ GDB_CROSS_DEBUGGER= ${CNTRB_GDB}/gdb/signals ${CNTRB_GDB}/gdb/tui ${TARGET_SUBDIR} CFLAGS+= -DHAVE_CONFIG_H -DRL_NO_COMPAT -DMI_OUT=1 -DTUI=1 +CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\" CFLAGS+= -I. CFLAGS+= -I${TARGET_SUBDIR} CFLAGS+= -I${BMAKE_BU}/libbfd -I${BMAKE_BU}/libbfd/${TARGET_CPUARCH} Modified: stable/9/gnu/usr.bin/gdb/arch/amd64/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/amd64/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/amd64/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -439,9 +439,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_i386_arch Modified: stable/9/gnu/usr.bin/gdb/arch/arm/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/arm/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/arm/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -451,9 +451,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_arm_arch Modified: stable/9/gnu/usr.bin/gdb/arch/i386/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/i386/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/i386/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -439,9 +439,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_i386_arch Modified: stable/9/gnu/usr.bin/gdb/arch/ia64/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/ia64/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/ia64/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -439,9 +439,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_ia64_arch Modified: stable/9/gnu/usr.bin/gdb/arch/mips/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/mips/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/mips/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -439,9 +439,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_mips_arch Modified: stable/9/gnu/usr.bin/gdb/arch/powerpc/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/powerpc/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/powerpc/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -439,9 +439,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_rs6000_arch Modified: stable/9/gnu/usr.bin/gdb/arch/powerpc64/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/powerpc64/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/powerpc64/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -439,9 +439,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_rs6000_arch Modified: stable/9/gnu/usr.bin/gdb/arch/sparc64/config.h ============================================================================== --- stable/9/gnu/usr.bin/gdb/arch/sparc64/config.h Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/arch/sparc64/config.h Fri Jul 5 19:35:51 2013 (r252827) @@ -439,9 +439,6 @@ /* Name of this package. */ #define PACKAGE "gdb" -/* Global directory for separate debug files. */ -#define DEBUGDIR "/usr/local/lib/debug" - /* Define to BFD's default architecture. */ #define DEFAULT_BFD_ARCH bfd_sparc_arch Modified: stable/9/gnu/usr.bin/gdb/gdb/Makefile ============================================================================== --- stable/9/gnu/usr.bin/gdb/gdb/Makefile Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/gnu/usr.bin/gdb/gdb/Makefile Fri Jul 5 19:35:51 2013 (r252827) @@ -15,3 +15,4 @@ DPADD= ${GDBLIBS} ${BULIBS} ${LIBM} ${LI LDADD= ${GDBLIBS} ${BULIBS} -lm -lreadline -ltermcap -lgnuregex .include +CFLAGS+= -DDEBUGDIR=\"${DEBUGDIR}\" Modified: stable/9/share/mk/bsd.crunchgen.mk ============================================================================== --- stable/9/share/mk/bsd.crunchgen.mk Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/share/mk/bsd.crunchgen.mk Fri Jul 5 19:35:51 2013 (r252827) @@ -44,6 +44,9 @@ CANONICALOBJDIR:= /usr/obj${.CURDIR} CLEANFILES+= $(CONF) *.o *.lo *.c *.mk *.cache *.a *.h +# Don't try to extract debug info from ${PROG}. +NO_DEBUG_FILES= + # Program names and their aliases contribute hardlinks to 'rescue' executable, # except for those that get suppressed. .for D in $(CRUNCH_SRCDIRS) Modified: stable/9/share/mk/bsd.lib.mk ============================================================================== --- stable/9/share/mk/bsd.lib.mk Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/share/mk/bsd.lib.mk Fri Jul 5 19:35:51 2013 (r252827) @@ -43,6 +43,12 @@ CTFFLAGS+= -g STRIP?= -s .endif +.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ + empty(DEBUG_FLAGS:M-gdwarf*) +CFLAGS+= -g +CTFFLAGS+= -g +.endif + .include # prefer .s to a .c, add .po, remove stuff not used in the BSD libraries @@ -113,12 +119,29 @@ PO_FLAG=-pg all: objwarn +.if defined(SHLIB_NAME) +.if ${MK_DEBUG_FILES} != "no" +SHLIB_NAME_FULL=${SHLIB_NAME}.full +# Use ${DEBUGDIR} for base system debug files, else .debug subdirectory +.if ${SHLIBDIR} == "/boot" ||\ + ${SHLIBDIR:C%/lib(/.*)?$%/lib%} == "/lib" ||\ + ${SHLIBDIR:C%/usr/lib(32)?(/.*)?%/usr/lib%} == "/usr/lib" +DEBUGFILEDIR=${DEBUGDIR}${SHLIBDIR} +.else +DEBUGFILEDIR=${SHLIBDIR}/.debug +DEBUGMKDIR= +.endif +.else +SHLIB_NAME_FULL=${SHLIB_NAME} +.endif +.endif + .include # Allow libraries to specify their own version map or have it # automatically generated (see bsd.symver.mk above). .if ${MK_SYMVER} == "yes" && !empty(VERSION_MAP) -${SHLIB_NAME}: ${VERSION_MAP} +${SHLIB_NAME_FULL}: ${VERSION_MAP} LDFLAGS+= -Wl,--version-script=${VERSION_MAP} .endif @@ -171,11 +194,12 @@ SOLINKOPTS+= -Wl,--fatal-warnings -Wl,-- .endif .if target(beforelinking) -${SHLIB_NAME}: beforelinking +beforelinking: ${SOBJS} +${SHLIB_NAME_FULL}: beforelinking .endif -${SHLIB_NAME}: ${SOBJS} +${SHLIB_NAME_FULL}: ${SOBJS} @${ECHO} building shared library ${SHLIB_NAME} - @rm -f ${.TARGET} ${SHLIB_LINK} + @rm -f ${SHLIB_NAME} ${SHLIB_LINK} .if defined(SHLIB_LINK) @${INSTALL_SYMLINK} ${SHLIB_NAME} ${SHLIB_LINK} .endif @@ -191,6 +215,16 @@ ${SHLIB_NAME}: ${SOBJS} .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${SOBJS} .endif + +.if ${MK_DEBUG_FILES} != "no" +CLEANFILES+= ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug +${SHLIB_NAME}: ${SHLIB_NAME_FULL} ${SHLIB_NAME}.debug + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${SHLIB_NAME}.debug \ + ${SHLIB_NAME_FULL} ${.TARGET} + +${SHLIB_NAME}.debug: ${SHLIB_NAME_FULL} + ${OBJCOPY} --only-keep-debug ${SHLIB_NAME_FULL} ${.TARGET} +.endif .endif .if defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) && ${MK_TOOLCHAIN} != "no" @@ -267,6 +301,14 @@ _libinstall: ${INSTALL} ${STRIP} -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${_SHLINSTALLFLAGS} \ ${SHLIB_NAME} ${DESTDIR}${SHLIBDIR} +.if ${MK_DEBUG_FILES} != "no" +.if defined(DEBUGMKDIR) + ${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR} +.endif + ${INSTALL} -T debug -o ${LIBOWN} -g ${LIBGRP} -m ${DEBUGMODE} \ + ${_INSTALLFLAGS} \ + ${SHLIB_NAME}.debug ${DESTDIR}${DEBUGFILEDIR} +.endif .if defined(SHLIB_LINK) # ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building # and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/share/mk/bsd.own.mk Fri Jul 5 19:35:51 2013 (r252827) @@ -43,6 +43,11 @@ # LIBMODE Library mode. [${NOBINMODE}] # # +# DEBUGDIR Base path for standalone debug files. [/usr/lib/debug] +# +# DEBUGMODE Mode for debug files. [${NOBINMODE}] +# +# # KMODDIR Base path for loadable kernel modules # (see kld(4)). [/boot/kernel] # @@ -147,6 +152,9 @@ LIBOWN?= ${BINOWN} LIBGRP?= ${BINGRP} LIBMODE?= ${NOBINMODE} +DEBUGDIR?= /usr/lib/debug +DEBUGMODE?= ${NOBINMODE} + # Share files SHAREDIR?= /usr/share @@ -213,6 +221,7 @@ COMPRESS_EXT?= .gz # .for var in \ CTF \ + DEBUG_FILES \ INSTALLLIB \ MAN \ PROFILE @@ -434,6 +443,8 @@ __DEFAULT_NO_OPTIONS = \ CLANG_EXTRAS \ CLANG_IS_CC \ CTF \ + DEBUG_FILES \ + GPL_DTC \ HESIOD \ ICONV \ IDEA \ Modified: stable/9/share/mk/bsd.prog.mk ============================================================================== --- stable/9/share/mk/bsd.prog.mk Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/share/mk/bsd.prog.mk Fri Jul 5 19:35:51 2013 (r252827) @@ -24,8 +24,24 @@ CTFFLAGS+= -g .endif .endif +.if defined(PROG_CXX) +PROG= ${PROG_CXX} +.endif + +.if defined(PROG) && target(${PROG}) +MK_DEBUG_FILES= no +.elif !empty(LDFLAGS:M-Wl,*--oformat,*) || !empty(LDFLAGS:M-static) +MK_DEBUG_FILES= no +.endif + .if defined(CRUNCH_CFLAGS) CFLAGS+=${CRUNCH_CFLAGS} +.else +.if ${MK_DEBUG_FILES} != "no" && empty(DEBUG_FLAGS:M-g) && \ + empty(DEBUG_FLAGS:M-gdwarf-*) +CFLAGS+= -g +CTFFLAGS+= -g +.endif .endif .if !defined(DEBUG_FLAGS) @@ -36,20 +52,36 @@ STRIP?= -s LDFLAGS+= -static .endif -.if defined(PROG_CXX) -PROG= ${PROG_CXX} +.if ${MK_DEBUG_FILES} != "no" +PROG_FULL=${PROG}.full +# Use ${DEBUGDIR} for base system debug files, else .debug subdirectory +.if defined(BINDIR) && (\ + ${BINDIR} == "/bin" ||\ + ${BINDIR} == "/libexec" ||\ + ${BINDIR} == "/sbin" ||\ + ${BINDIR:C%/usr/(bin|bsdinstall|games|libexec|lpr|sendmail|sm.bin|sbin)(/.*)?%/usr/bin%} == "/usr/bin"\ + ) +DEBUGFILEDIR= ${DEBUGDIR}${BINDIR} +.else +DEBUGFILEDIR?= ${BINDIR}/.debug +DEBUGMKDIR= +.endif +.else +PROG_FULL= ${PROG} .endif .if defined(PROG) PROGNAME?= ${PROG} + .if defined(SRCS) OBJS+= ${SRCS:N*.h:R:S/$/.o/g} .if target(beforelinking) -${PROG}: beforelinking +beforelinking: ${OBJS} +${PROG_FULL}: beforelinking .endif -${PROG}: ${OBJS} +${PROG_FULL}: ${OBJS} .if defined(PROG_CXX) ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .else @@ -76,9 +108,10 @@ SRCS= ${PROG}.c OBJS= ${PROG}.o .if target(beforelinking) -${PROG}: beforelinking +beforelinking: ${OBJS} +${PROG_FULL}: beforelinking .endif -${PROG}: ${OBJS} +${PROG_FULL}: ${OBJS} .if defined(PROG_CXX) ${CXX} ${CXXFLAGS} ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LDADD} .else @@ -87,10 +120,19 @@ ${PROG}: ${OBJS} .if ${MK_CTF} != "no" ${CTFMERGE} ${CTFFLAGS} -o ${.TARGET} ${OBJS} .endif -.endif +.endif # !target(${PROG}) .endif # !defined(SRCS) +.if ${MK_DEBUG_FILES} != "no" +${PROG}: ${PROG_FULL} ${PROGNAME}.debug + ${OBJCOPY} --strip-debug --add-gnu-debuglink=${PROGNAME}.debug \ + ${PROG_FULL} ${.TARGET} + +${PROGNAME}.debug: ${PROG_FULL} + ${OBJCOPY} --only-keep-debug ${PROG_FULL} ${.TARGET} +.endif + .if ${MK_MAN} != "no" && !defined(MAN) && \ !defined(MAN1) && !defined(MAN2) && !defined(MAN3) && \ !defined(MAN4) && !defined(MAN5) && !defined(MAN6) && \ @@ -107,6 +149,9 @@ all: _manpages .if defined(PROG) CLEANFILES+= ${PROG} +.if ${MK_DEBUG_FILES} != "no" +CLEANFILES+= ${PROG_FULL} ${PROGNAME}.debug +.endif .endif .if defined(OBJS) @@ -154,6 +199,13 @@ _proginstall: .if defined(PROG) ${INSTALL} ${STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ ${_INSTALLFLAGS} ${PROG} ${DESTDIR}${BINDIR}/${PROGNAME} +.if ${MK_DEBUG_FILES} != "no" +.if defined(DEBUGMKDIR) + ${INSTALL} -T debug -d ${DESTDIR}${DEBUGFILEDIR} +.endif + ${INSTALL} -T debug -o ${BINOWN} -g ${BINGRP} -m ${DEBUGMODE} \ + ${PROGNAME}.debug ${DESTDIR}${DEBUGFILEDIR}/${PROGNAME}.debug +.endif .endif .endif # !target(realinstall) Modified: stable/9/share/mk/sys.mk ============================================================================== --- stable/9/share/mk/sys.mk Fri Jul 5 19:26:01 2013 (r252826) +++ stable/9/share/mk/sys.mk Fri Jul 5 19:35:51 2013 (r252827) @@ -130,6 +130,8 @@ MAKE ?= make OBJC ?= cc OBJCFLAGS ?= ${OBJCINCLUDES} ${CFLAGS} -Wno-import +OBJCOPY ?= objcopy + PC ?= pc PFLAGS ?= Copied: stable/9/tools/build/options/WITH_DEBUG_FILES (from r251512, head/tools/build/options/WITH_DEBUG_FILES) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/build/options/WITH_DEBUG_FILES Fri Jul 5 19:35:51 2013 (r252827, copy of r251512, head/tools/build/options/WITH_DEBUG_FILES) @@ -0,0 +1,7 @@ +.\" $FreeBSD$ +Set to strip debug info into a separate file for each executable binary +and shared library. +The debug files will be placed in a subdirectory of +.Pa /usr/lib/debug +and are located automatically by +.Xr gdb 1 . From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 19:36:36 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 48C44D9; Fri, 5 Jul 2013 19:36:36 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3A25F1F37; Fri, 5 Jul 2013 19:36:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65JaaBv051937; Fri, 5 Jul 2013 19:36:36 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JaZOj051931; Fri, 5 Jul 2013 19:36:35 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051936.r65JaZOj051931@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 19:36: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: r252828 - in stable/9/sys: dev/bce dev/bxe net netinet 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.14 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, 05 Jul 2013 19:36:36 -0000 Author: andre Date: Fri Jul 5 19:36:34 2013 New Revision: 252828 URL: http://svnweb.freebsd.org/changeset/base/252828 Log: MFC r243624: Remove unused and unnecessary CSUM_IP_FRAGS checksumming capability. Checksumming the IP header of fragments is no different from doing normal IP headers. Discussed with: yongari Note that the definition of CSUM_IP_FRAGS is left in mbuf.h to allow for stable branch source compatibility. Modified: stable/9/sys/dev/bce/if_bce.c stable/9/sys/dev/bxe/if_bxe.c stable/9/sys/net/if_vlan.c stable/9/sys/netinet/ip_output.c stable/9/sys/sys/mbuf.h 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/dev/bce/if_bce.c ============================================================================== --- stable/9/sys/dev/bce/if_bce.c Fri Jul 5 19:35:51 2013 (r252827) +++ stable/9/sys/dev/bce/if_bce.c Fri Jul 5 19:36:34 2013 (r252828) @@ -9798,7 +9798,7 @@ bce_dump_mbuf(struct bce_softc *sc, stru "\15M_FIRSTFRAG\16M_LASTFRAG\21M_VLANTAG" "\22M_PROMISC\23M_NOFREE", mp->m_pkthdr.csum_flags, - "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP\4CSUM_IP_FRAGS" + "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP" "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED" "\12CSUM_IP_VALID\13CSUM_DATA_VALID" "\14CSUM_PSEUDO_HDR"); Modified: stable/9/sys/dev/bxe/if_bxe.c ============================================================================== --- stable/9/sys/dev/bxe/if_bxe.c Fri Jul 5 19:35:51 2013 (r252827) +++ stable/9/sys/dev/bxe/if_bxe.c Fri Jul 5 19:36:34 2013 (r252828) @@ -16276,7 +16276,7 @@ void bxe_dump_mbuf(struct bxe_softc *sc, "\15M_FIRSTFRAG\16M_LASTFRAG\21M_VLANTAG" "\22M_PROMISC\23M_NOFREE", m->m_pkthdr.csum_flags, - "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP\4CSUM_IP_FRAGS" + "\20\1CSUM_IP\2CSUM_TCP\3CSUM_UDP" "\5CSUM_FRAGMENT\6CSUM_TSO\11CSUM_IP_CHECKED" "\12CSUM_IP_VALID\13CSUM_DATA_VALID" "\14CSUM_PSEUDO_HDR"); Modified: stable/9/sys/net/if_vlan.c ============================================================================== --- stable/9/sys/net/if_vlan.c Fri Jul 5 19:35:51 2013 (r252827) +++ stable/9/sys/net/if_vlan.c Fri Jul 5 19:36:34 2013 (r252828) @@ -1491,7 +1491,7 @@ vlan_capabilities(struct ifvlan *ifv) p->if_capenable & IFCAP_VLAN_HWTAGGING) { ifp->if_capenable = p->if_capenable & IFCAP_HWCSUM; ifp->if_hwassist = p->if_hwassist & (CSUM_IP | CSUM_TCP | - CSUM_UDP | CSUM_SCTP | CSUM_IP_FRAGS | CSUM_FRAGMENT); + CSUM_UDP | CSUM_SCTP | CSUM_FRAGMENT); } else { ifp->if_capenable = 0; ifp->if_hwassist = 0; Modified: stable/9/sys/netinet/ip_output.c ============================================================================== --- stable/9/sys/netinet/ip_output.c Fri Jul 5 19:35:51 2013 (r252827) +++ stable/9/sys/netinet/ip_output.c Fri Jul 5 19:36:34 2013 (r252828) @@ -719,14 +719,12 @@ ip_fragment(struct ip *ip, struct mbuf * * If the interface will not calculate checksums on * fragmented packets, then do it here. */ - if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA && - (if_hwassist_flags & CSUM_IP_FRAGS) == 0) { + if (m0->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { in_delayed_cksum(m0); m0->m_pkthdr.csum_flags &= ~CSUM_DELAY_DATA; } #ifdef SCTP - if (m0->m_pkthdr.csum_flags & CSUM_SCTP && - (if_hwassist_flags & CSUM_IP_FRAGS) == 0) { + if (m0->m_pkthdr.csum_flags & CSUM_SCTP) { sctp_delayed_cksum(m0, hlen); m0->m_pkthdr.csum_flags &= ~CSUM_SCTP; } Modified: stable/9/sys/sys/mbuf.h ============================================================================== --- stable/9/sys/sys/mbuf.h Fri Jul 5 19:35:51 2013 (r252827) +++ stable/9/sys/sys/mbuf.h Fri Jul 5 19:36:34 2013 (r252828) @@ -279,7 +279,7 @@ struct mbuf { #define CSUM_IP 0x0001 /* will csum IP */ #define CSUM_TCP 0x0002 /* will csum TCP */ #define CSUM_UDP 0x0004 /* will csum UDP */ -#define CSUM_IP_FRAGS 0x0008 /* will csum IP fragments */ +#define CSUM_IP_FRAGS 0x0008 /* removed, left for compat */ #define CSUM_FRAGMENT 0x0010 /* will do IP fragmentation */ #define CSUM_TSO 0x0020 /* will do TSO */ #define CSUM_SCTP 0x0040 /* will csum SCTP */ From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 19:38:58 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 37173429; Fri, 5 Jul 2013 19:38:58 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1943E1F5C; Fri, 5 Jul 2013 19:38:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65Jcv5o052236; Fri, 5 Jul 2013 19:38:57 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JcvQY052235; Fri, 5 Jul 2013 19:38:57 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201307051938.r65JcvQY052235@svn.freebsd.org> From: Mikolaj Golub Date: Fri, 5 Jul 2013 19:38: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: r252829 - 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.14 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, 05 Jul 2013 19:38:58 -0000 Author: trociny Date: Fri Jul 5 19:38:57 2013 New Revision: 252829 URL: http://svnweb.freebsd.org/changeset/base/252829 Log: MFC r252313, r252349, 252436: To avoid LOR, drop the filedesc lock in export_fd_to_sb(), before writing to sbuf. MFC r252351 (mjg): Remove duplicate NULL check in kern_proc_filedesc_out. No functional changes. Modified: stable/9/sys/kern/kern_descrip.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_descrip.c ============================================================================== --- stable/9/sys/kern/kern_descrip.c Fri Jul 5 19:36:34 2013 (r252828) +++ stable/9/sys/kern/kern_descrip.c Fri Jul 5 19:38:57 2013 (r252829) @@ -3262,10 +3262,17 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC CTASSERT(sizeof(struct kinfo_file) == KINFO_FILE_SIZE); #endif +struct export_fd_buf { + struct filedesc *fdp; + struct sbuf *sb; + ssize_t remainder; + struct kinfo_file kif; +}; + static int export_fd_to_sb(void *data, int type, int fd, int fflags, int refcnt, int64_t offset, int fd_is_cap, cap_rights_t fd_cap_rights, - struct kinfo_file *kif, struct sbuf *sb, ssize_t *remainder) + struct export_fd_buf *efbuf) { struct { int fflag; @@ -3288,16 +3295,23 @@ export_fd_to_sb(void *data, int type, in { O_TRUNC, KF_FLAG_TRUNC } }; #define NFFLAGS (sizeof(fflags_table) / sizeof(*fflags_table)) + struct kinfo_file *kif; struct vnode *vp; - int error, vfslocked; + int error, locked, vfslocked; unsigned int i; - if (*remainder == 0) + if (efbuf->remainder == 0) return (0); + kif = &efbuf->kif; bzero(kif, sizeof(*kif)); + locked = efbuf->fdp != NULL; switch (type) { case KF_TYPE_FIFO: case KF_TYPE_VNODE: + if (locked) { + FILEDESC_SUNLOCK(efbuf->fdp); + locked = 0; + } vp = (struct vnode *)data; error = fill_vnode_info(vp, kif); vfslocked = VFS_LOCK_GIANT(vp->v_mount); @@ -3346,15 +3360,21 @@ export_fd_to_sb(void *data, int type, in kif->kf_structsize = offsetof(struct kinfo_file, kf_path) + strlen(kif->kf_path) + 1; kif->kf_structsize = roundup(kif->kf_structsize, sizeof(uint64_t)); - if (*remainder != -1) { - if (*remainder < kif->kf_structsize) { + if (efbuf->remainder != -1) { + if (efbuf->remainder < kif->kf_structsize) { /* Terminate export. */ - *remainder = 0; + efbuf->remainder = 0; + if (efbuf->fdp != NULL && !locked) + FILEDESC_SLOCK(efbuf->fdp); return (0); } - *remainder -= kif->kf_structsize; + efbuf->remainder -= kif->kf_structsize; } - error = sbuf_bcat(sb, kif, kif->kf_structsize); + if (locked) + FILEDESC_SUNLOCK(efbuf->fdp); + error = sbuf_bcat(efbuf->sb, kif, kif->kf_structsize); + if (efbuf->fdp != NULL) + FILEDESC_SLOCK(efbuf->fdp); return (error); } @@ -3368,18 +3388,16 @@ kern_proc_filedesc_out(struct proc *p, { struct file *fp; struct filedesc *fdp; - struct kinfo_file *kif; + struct export_fd_buf *efbuf; struct vnode *cttyvp, *textvp, *tracevp; int64_t offset; void *data; - ssize_t remainder; int error, i; int fd_is_cap, type, refcnt, fflags; cap_rights_t fd_cap_rights; PROC_LOCK_ASSERT(p, MA_OWNED); - remainder = maxlen; /* ktrace vnode */ tracevp = p->p_tracevp; if (tracevp != NULL) @@ -3397,46 +3415,44 @@ kern_proc_filedesc_out(struct proc *p, } fdp = fdhold(p); PROC_UNLOCK(p); - kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK); + efbuf = malloc(sizeof(*efbuf), M_TEMP, M_WAITOK); + efbuf->fdp = NULL; + efbuf->sb = sb; + efbuf->remainder = maxlen; if (tracevp != NULL) export_fd_to_sb(tracevp, KF_TYPE_VNODE, KF_FD_TYPE_TRACE, - FREAD | FWRITE, -1, -1, 0, 0, kif, sb, &remainder); + FREAD | FWRITE, -1, -1, 0, 0, efbuf); if (textvp != NULL) export_fd_to_sb(textvp, KF_TYPE_VNODE, KF_FD_TYPE_TEXT, - FREAD, -1, -1, 0, 0, kif, sb, &remainder); + FREAD, -1, -1, 0, 0, efbuf); if (cttyvp != NULL) export_fd_to_sb(cttyvp, KF_TYPE_VNODE, KF_FD_TYPE_CTTY, - FREAD | FWRITE, -1, -1, 0, 0, kif, sb, &remainder); + FREAD | FWRITE, -1, -1, 0, 0, efbuf); error = 0; if (fdp == NULL) goto fail; + efbuf->fdp = fdp; FILEDESC_SLOCK(fdp); /* working directory */ if (fdp->fd_cdir != NULL) { vref(fdp->fd_cdir); data = fdp->fd_cdir; - FILEDESC_SUNLOCK(fdp); export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_CWD, - FREAD, -1, -1, 0, 0, kif, sb, &remainder); - FILEDESC_SLOCK(fdp); + FREAD, -1, -1, 0, 0, efbuf); } /* root directory */ if (fdp->fd_rdir != NULL) { vref(fdp->fd_rdir); data = fdp->fd_rdir; - FILEDESC_SUNLOCK(fdp); export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_ROOT, - FREAD, -1, -1, 0, 0, kif, sb, &remainder); - FILEDESC_SLOCK(fdp); + FREAD, -1, -1, 0, 0, efbuf); } /* jail directory */ if (fdp->fd_jdir != NULL) { vref(fdp->fd_jdir); data = fdp->fd_jdir; - FILEDESC_SUNLOCK(fdp); export_fd_to_sb(data, KF_TYPE_VNODE, KF_FD_TYPE_JAIL, - FREAD, -1, -1, 0, 0, kif, sb, &remainder); - FILEDESC_SLOCK(fdp); + FREAD, -1, -1, 0, 0, efbuf); } for (i = 0; i < fdp->fd_nfiles; i++) { if ((fp = fdp->fd_ofiles[i]) == NULL) @@ -3531,20 +3547,15 @@ kern_proc_filedesc_out(struct proc *p, * re-validate and re-evaluate its properties when * the loop continues. */ - if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) - FILEDESC_SUNLOCK(fdp); error = export_fd_to_sb(data, type, i, fflags, refcnt, - offset, fd_is_cap, fd_cap_rights, kif, sb, &remainder); - if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) - FILEDESC_SLOCK(fdp); + offset, fd_is_cap, fd_cap_rights, efbuf); if (error) break; } FILEDESC_SUNLOCK(fdp); + fddrop(fdp); fail: - if (fdp != NULL) - fddrop(fdp); - free(kif, M_TEMP); + free(efbuf, M_TEMP); return (error); } From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 19:39:19 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D36C655C; Fri, 5 Jul 2013 19:39:19 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A95271F63; Fri, 5 Jul 2013 19:39:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65JdJLU052333; Fri, 5 Jul 2013 19:39:19 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JdJKG052332; Fri, 5 Jul 2013 19:39:19 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201307051939.r65JdJKG052332@svn.freebsd.org> From: Ed Maste Date: Fri, 5 Jul 2013 19:39: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: r252830 - stable/9/share/mk 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.14 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, 05 Jul 2013 19:39:19 -0000 Author: emaste Date: Fri Jul 5 19:39:19 2013 New Revision: 252830 URL: http://svnweb.freebsd.org/changeset/base/252830 Log: Undo accidental MFC of GPL_DTC in r252827 Modified: stable/9/share/mk/bsd.own.mk Modified: stable/9/share/mk/bsd.own.mk ============================================================================== --- stable/9/share/mk/bsd.own.mk Fri Jul 5 19:38:57 2013 (r252829) +++ stable/9/share/mk/bsd.own.mk Fri Jul 5 19:39:19 2013 (r252830) @@ -444,7 +444,6 @@ __DEFAULT_NO_OPTIONS = \ CLANG_IS_CC \ CTF \ DEBUG_FILES \ - GPL_DTC \ HESIOD \ ICONV \ IDEA \ From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 19:43:33 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A67E86FD; Fri, 5 Jul 2013 19:43:33 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7D2121F8A; Fri, 5 Jul 2013 19:43:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65JhX4V054470; Fri, 5 Jul 2013 19:43:33 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JhXbd054469; Fri, 5 Jul 2013 19:43:33 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307051943.r65JhXbd054469@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 19:43: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: r252831 - 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.14 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, 05 Jul 2013 19:43:33 -0000 Author: andre Date: Fri Jul 5 19:43:33 2013 New Revision: 252831 URL: http://svnweb.freebsd.org/changeset/base/252831 Log: MFC r241724: Remove splimp() comment from sysinit table and attribute SI_SUB_PROTO_BEGIN and SI_SUB_PROTO_END to VNET related initializations. Modified: stable/9/sys/sys/kernel.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/sys/kernel.h ============================================================================== --- stable/9/sys/sys/kernel.h Fri Jul 5 19:39:19 2013 (r252830) +++ stable/9/sys/sys/kernel.h Fri Jul 5 19:43:33 2013 (r252831) @@ -84,12 +84,6 @@ extern volatile int ticks; * The SI_SUB_SWAP values represent a value used by * the BSD 4.4Lite but not by FreeBSD; it is maintained in dependent * order to support porting. - * - * The SI_SUB_PROTO_BEGIN and SI_SUB_PROTO_END bracket a range of - * initializations to take place at splimp(). This is a historical - * wart that should be removed -- probably running everything at - * splimp() until the first init that doesn't want it is the correct - * fix. They are currently present to ensure historical behavior. */ enum sysinit_sub_id { SI_SUB_DUMMY = 0x0000000, /* not executed; for linker*/ @@ -147,12 +141,12 @@ enum sysinit_sub_id { SI_SUB_P1003_1B = 0x6E00000, /* P1003.1B realtime */ SI_SUB_PSEUDO = 0x7000000, /* pseudo devices*/ SI_SUB_EXEC = 0x7400000, /* execve() handlers */ - SI_SUB_PROTO_BEGIN = 0x8000000, /* XXX: set splimp (kludge)*/ + SI_SUB_PROTO_BEGIN = 0x8000000, /* VNET initialization */ SI_SUB_PROTO_IF = 0x8400000, /* interfaces*/ SI_SUB_PROTO_DOMAININIT = 0x8600000, /* domain registration system */ SI_SUB_PROTO_DOMAIN = 0x8800000, /* domains (address families?)*/ SI_SUB_PROTO_IFATTACHDOMAIN = 0x8800001, /* domain dependent data init*/ - SI_SUB_PROTO_END = 0x8ffffff, /* XXX: set splx (kludge)*/ + SI_SUB_PROTO_END = 0x8ffffff, /* VNET helper functions */ SI_SUB_KPROF = 0x9000000, /* kernel profiling*/ SI_SUB_KICK_SCHEDULER = 0xa000000, /* start the timeout events*/ SI_SUB_INT_CONFIG_HOOKS = 0xa800000, /* Interrupts enabled config */ From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 19:45:16 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B23C491C; Fri, 5 Jul 2013 19:45:16 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3F9D1F9E; Fri, 5 Jul 2013 19:45:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65JjGYH054918; Fri, 5 Jul 2013 19:45:16 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65JjG6Y054917; Fri, 5 Jul 2013 19:45:16 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201307051945.r65JjG6Y054917@svn.freebsd.org> From: Ed Maste Date: Fri, 5 Jul 2013 19:45: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: r252832 - stable/9/share/man/man5 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.14 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, 05 Jul 2013 19:45:16 -0000 Author: emaste Date: Fri Jul 5 19:45:16 2013 New Revision: 252832 URL: http://svnweb.freebsd.org/changeset/base/252832 Log: Regenerate after r252827 Modified: stable/9/share/man/man5/src.conf.5 Modified: stable/9/share/man/man5/src.conf.5 ============================================================================== --- stable/9/share/man/man5/src.conf.5 Fri Jul 5 19:43:33 2013 (r252831) +++ stable/9/share/man/man5/src.conf.5 Fri Jul 5 19:45:16 2013 (r252832) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: stable/9/tools/build/options/makeman 236430 2012-06-02 02:26:37Z gjb +.\" from FreeBSD: stable/9/tools/build/options/makeman 252812 2013-07-05 17:57:25Z emaste .\" $FreeBSD$ -.Dd March 1, 2013 +.Dd July 5, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -372,6 +372,14 @@ When set, it also enforces the following .It .Va WITHOUT_GROFF .El +.It Va WITH_DEBUG_FILES +.\" from FreeBSD: stable/9/tools/build/options/WITH_DEBUG_FILES 252827 2013-07-05 19:35:51Z emaste +Set to strip debug info into a separate file for each executable binary +and shared library. +The debug files will be placed in a subdirectory of +.Pa /usr/lib/debug +and are located automatically by +.Xr gdb 1 . .It Va WITHOUT_DICT .\" from FreeBSD: stable/9/tools/build/options/WITHOUT_DICT 156932 2006-03-21 07:50:50Z ru Set to not build the Webster dictionary files. From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 20:11:28 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CC20210D; Fri, 5 Jul 2013 20:11:28 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AD7A01098; Fri, 5 Jul 2013 20:11:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65KBSAh063758; Fri, 5 Jul 2013 20:11:28 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65KBRCG063754; Fri, 5 Jul 2013 20:11:27 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307052011.r65KBRCG063754@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 20:11: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: r252835 - stable/9/sys/netinet 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.14 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, 05 Jul 2013 20:11:28 -0000 Author: andre Date: Fri Jul 5 20:11:27 2013 New Revision: 252835 URL: http://svnweb.freebsd.org/changeset/base/252835 Log: MFC r226433: Update the comment and description of tcp_sendspace and tcp_recvspace to better reflect their purpose. MFC r226437: VNET virtualize tcp_sendspace/tcp_recvspace and change the type to INT. A long is not necessary as the TCP window is limited to 2**30. A larger initial window isn't useful. MFC r226448: Move the tcp_sendspace and tcp_recvspace sysctl's from the middle of tcp_usrreq.c to the top of tcp_output.c and tcp_input.c respectively next to the socket buffer autosizing controls. MFC r227034: Restore sysctl names for tcp_sendspace/tcp_recvspace. They seem to be changed unintentionally in r226437, and there were no any mentions of renaming in commit log message. Reported by: Anton Yuzhaninov Modified: stable/9/sys/netinet/tcp_input.c stable/9/sys/netinet/tcp_output.c stable/9/sys/netinet/tcp_usrreq.c stable/9/sys/netinet/tcp_var.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 20:01:07 2013 (r252834) +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 20:11:27 2013 (r252835) @@ -194,6 +194,11 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_insecure_rst), 0, "Follow the old (insecure) criteria for accepting RST packets"); +VNET_DEFINE(int, tcp_recvspace) = 1024*64 +#define V_tcp_recvspace VNET(tcp_recvspace) +SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_RW, + &VNET_NAME(tcp_recvspace), 0, "Initial receive socket buffer size"); + VNET_DEFINE(int, tcp_do_autorcvbuf) = 1; #define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLFLAG_RW, @@ -3590,7 +3595,7 @@ tcp_mss(struct tcpcb *tp, int offer) */ so = inp->inp_socket; SOCKBUF_LOCK(&so->so_snd); - if ((so->so_snd.sb_hiwat == tcp_sendspace) && metrics.rmx_sendpipe) + if ((so->so_snd.sb_hiwat == V_tcp_sendspace) && metrics.rmx_sendpipe) bufsize = metrics.rmx_sendpipe; else bufsize = so->so_snd.sb_hiwat; @@ -3607,7 +3612,7 @@ tcp_mss(struct tcpcb *tp, int offer) tp->t_maxseg = mss; SOCKBUF_LOCK(&so->so_rcv); - if ((so->so_rcv.sb_hiwat == tcp_recvspace) && metrics.rmx_recvpipe) + if ((so->so_rcv.sb_hiwat == V_tcp_recvspace) && metrics.rmx_recvpipe) bufsize = metrics.rmx_recvpipe; else bufsize = so->so_rcv.sb_hiwat; Modified: stable/9/sys/netinet/tcp_output.c ============================================================================== --- stable/9/sys/netinet/tcp_output.c Fri Jul 5 20:01:07 2013 (r252834) +++ stable/9/sys/netinet/tcp_output.c Fri Jul 5 20:11:27 2013 (r252835) @@ -98,6 +98,11 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_do_tso), 0, "Enable TCP Segmentation Offload"); +VNET_DEFINE(int, tcp_sendspace) = 1024*32; +#define V_tcp_sendspace VNET(tcp_sendspace) +SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_SENDSPACE, sendspace, CTLFLAG_RW, + &VNET_NAME(tcp_sendspace), 0, "Initial send socket buffer size"); + VNET_DEFINE(int, tcp_do_autosndbuf) = 1; #define V_tcp_do_autosndbuf VNET(tcp_do_autosndbuf) SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, sendbuf_auto, CTLFLAG_RW, Modified: stable/9/sys/netinet/tcp_usrreq.c ============================================================================== --- stable/9/sys/netinet/tcp_usrreq.c Fri Jul 5 20:01:07 2013 (r252834) +++ stable/9/sys/netinet/tcp_usrreq.c Fri Jul 5 20:11:27 2013 (r252835) @@ -1597,18 +1597,6 @@ unlock_and_done: #undef INP_WLOCK_RECHECK /* - * tcp_sendspace and tcp_recvspace are the default send and receive window - * sizes, respectively. These are obsolescent (this information should - * be set by the route). - */ -u_long tcp_sendspace = 1024*32; -SYSCTL_ULONG(_net_inet_tcp, TCPCTL_SENDSPACE, sendspace, CTLFLAG_RW, - &tcp_sendspace , 0, "Maximum outgoing TCP datagram size"); -u_long tcp_recvspace = 1024*64; -SYSCTL_ULONG(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_RW, - &tcp_recvspace , 0, "Maximum incoming TCP datagram size"); - -/* * Attach TCP protocol to socket, allocating * internet protocol control block, tcp control block, * bufer space, and entering LISTEN state if to accept connections. @@ -1621,7 +1609,7 @@ tcp_attach(struct socket *so) int error; if (so->so_snd.sb_hiwat == 0 || so->so_rcv.sb_hiwat == 0) { - error = soreserve(so, tcp_sendspace, tcp_recvspace); + error = soreserve(so, V_tcp_sendspace, V_tcp_recvspace); if (error) return (error); } Modified: stable/9/sys/netinet/tcp_var.h ============================================================================== --- stable/9/sys/netinet/tcp_var.h Fri Jul 5 20:01:07 2013 (r252834) +++ stable/9/sys/netinet/tcp_var.h Fri Jul 5 20:11:27 2013 (r252835) @@ -623,6 +623,8 @@ VNET_DECLARE(int, tcp_minmss); VNET_DECLARE(int, tcp_delack_enabled); VNET_DECLARE(int, tcp_do_rfc3390); VNET_DECLARE(int, tcp_do_initcwnd10); +VNET_DECLARE(int, tcp_sendspace); +VNET_DECLARE(int, tcp_recvspace); VNET_DECLARE(int, path_mtu_discovery); VNET_DECLARE(int, tcp_do_rfc3465); VNET_DECLARE(int, tcp_abc_l_var); @@ -634,6 +636,8 @@ VNET_DECLARE(int, tcp_abc_l_var); #define V_tcp_delack_enabled VNET(tcp_delack_enabled) #define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) #define V_tcp_do_initcwnd10 VNET(tcp_do_initcwnd10) +#define V_tcp_sendspace VNET(tcp_sendspace) +#define V_tcp_recvspace VNET(tcp_recvspace) #define V_path_mtu_discovery VNET(path_mtu_discovery) #define V_tcp_do_rfc3465 VNET(tcp_do_rfc3465) #define V_tcp_abc_l_var VNET(tcp_abc_l_var) @@ -731,8 +735,6 @@ void tcp_hc_updatemtu(struct in_conninf void tcp_hc_update(struct in_conninfo *, struct hc_metrics_lite *); extern struct pr_usrreqs tcp_usrreqs; -extern u_long tcp_sendspace; -extern u_long tcp_recvspace; tcp_seq tcp_new_isn(struct tcpcb *); void tcp_sack_doack(struct tcpcb *, struct tcpopt *, tcp_seq); From owner-svn-src-stable@FreeBSD.ORG Fri Jul 5 21:33:33 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 63619CF7; Fri, 5 Jul 2013 21:33:33 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 449F21613; Fri, 5 Jul 2013 21:33:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65LXXZe089927; Fri, 5 Jul 2013 21:33:33 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65LXXfD089926; Fri, 5 Jul 2013 21:33:33 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201307052133.r65LXXfD089926@svn.freebsd.org> From: Andre Oppermann Date: Fri, 5 Jul 2013 21:33: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: r252843 - 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.14 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, 05 Jul 2013 21:33:33 -0000 Author: andre Date: Fri Jul 5 21:33:32 2013 New Revision: 252843 URL: http://svnweb.freebsd.org/changeset/base/252843 Log: MFC r241703: Remove double-wrapping of #ifdef ZERO_COPY_SOCKETS within zero copy specialized sosend_copyin() helper function. MFC r241704: Remove unnecessary includes from sosend_copyin() and fix a couple of style issues. Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Fri Jul 5 21:32:54 2013 (r252842) +++ stable/9/sys/kern/uipc_socket.c Fri Jul 5 21:33:32 2013 (r252843) @@ -893,12 +893,6 @@ struct so_zerocopy_stats{ int found_ifp; }; struct so_zerocopy_stats so_zerocp_stats = {0,0,0}; -#include -#include -#include -#include -#include -#include /* * sosend_copyin() is only used if zero copy sockets are enabled. Otherwise @@ -923,9 +917,7 @@ sosend_copyin(struct uio *uio, struct mb long len; ssize_t resid; int error; -#ifdef ZERO_COPY_SOCKETS int cow_send; -#endif *retmp = top = NULL; mp = ⊤ @@ -933,11 +925,8 @@ sosend_copyin(struct uio *uio, struct mb resid = uio->uio_resid; error = 0; do { -#ifdef ZERO_COPY_SOCKETS cow_send = 0; -#endif /* ZERO_COPY_SOCKETS */ if (resid >= MINCLSIZE) { -#ifdef ZERO_COPY_SOCKETS if (top == NULL) { m = m_gethdr(M_WAITOK, MT_DATA); m->m_pkthdr.len = 0; @@ -945,9 +934,9 @@ sosend_copyin(struct uio *uio, struct mb } else m = m_get(M_WAITOK, MT_DATA); if (so_zero_copy_send && - resid>=PAGE_SIZE && - *space>=PAGE_SIZE && - uio->uio_iov->iov_len>=PAGE_SIZE) { + resid >= PAGE_SIZE && + *space >= PAGE_SIZE && + uio->uio_iov->iov_len >= PAGE_SIZE) { so_zerocp_stats.size_ok++; so_zerocp_stats.align_ok++; cow_send = socow_setup(m, uio); @@ -957,15 +946,6 @@ sosend_copyin(struct uio *uio, struct mb m_clget(m, M_WAITOK); len = min(min(MCLBYTES, resid), *space); } -#else /* ZERO_COPY_SOCKETS */ - if (top == NULL) { - m = m_getcl(M_WAIT, MT_DATA, M_PKTHDR); - m->m_pkthdr.len = 0; - m->m_pkthdr.rcvif = NULL; - } else - m = m_getcl(M_WAIT, MT_DATA, 0); - len = min(min(MCLBYTES, resid), *space); -#endif /* ZERO_COPY_SOCKETS */ } else { if (top == NULL) { m = m_gethdr(M_WAIT, MT_DATA); @@ -990,12 +970,10 @@ sosend_copyin(struct uio *uio, struct mb } *space -= len; -#ifdef ZERO_COPY_SOCKETS if (cow_send) error = 0; else -#endif /* ZERO_COPY_SOCKETS */ - error = uiomove(mtod(m, void *), (int)len, uio); + error = uiomove(mtod(m, void *), (int)len, uio); resid = uio->uio_resid; m->m_len = len; *mp = m; @@ -1013,7 +991,7 @@ out: *retmp = top; return (error); } -#endif /*ZERO_COPY_SOCKETS*/ +#endif /* ZERO_COPY_SOCKETS */ #define SBLOCKWAIT(f) (((f) & MSG_DONTWAIT) ? 0 : SBL_WAIT) From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 02:49:57 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 865ECCF2; Sat, 6 Jul 2013 02:49:57 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5DEC21093; Sat, 6 Jul 2013 02:49:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r662nv9I082277; Sat, 6 Jul 2013 02:49:57 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r662nvHp082274; Sat, 6 Jul 2013 02:49:57 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307060249.r662nvHp082274@svn.freebsd.org> From: Mark Johnston Date: Sat, 6 Jul 2013 02:49: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: r252858 - in stable/9/sys/cddl/dev: dtrace/amd64 sdt 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.14 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, 06 Jul 2013 02:49:57 -0000 Author: markj Date: Sat Jul 6 02:49:56 2013 New Revision: 252858 URL: http://svnweb.freebsd.org/changeset/base/252858 Log: MFC r251238: SDT probes can directly pass up to five arguments as arguments to dtrace_probe(). Arguments beyond these five must be obtained in an architecture-specific way; this can be done through the getargval provider method, and through dtrace_getarg() if getargval isn't overridden. This change fixes two off-by-one bugs in the way these arguments are fetched in FreeBSD's DTrace implementation. First, the SDT provider must set the aframes parameter to 1 when creating a probe. The aframes parameter controls the number of frames that dtrace_getarg() will step over in order to find the frame containing the extra arguments. On FreeBSD, dtrace_getarg() is called in SDT probe context via dtrace_probe()->dtrace_dif_emulate()->dtrace_dif_variable->dtrace_getarg() so aframes must be 3 since the arguments are in dtrace_probe()'s frame; it was previously being called with a value of 2 instead. illumos uses a different aframes value for SDT probes, but this is because illumos SDT probes fire by triggering the #UD fault handler rather than calling dtrace_probe() directly. The second bug has to do with the way arguments are grabbed out dtrace_probe()'s frame on amd64. The code currently jumps over the first stack argument and retrieves the rest of them using a pointer into the stack. This works on i386 because all of dtrace_probe()'s arguments will be on the stack and the first argument is the probe ID, which should be ignored. However, it is incorrect to ignore the first stack argument on amd64, so we correct the pointer used to access the arguments. Modified: stable/9/sys/cddl/dev/dtrace/amd64/dtrace_isa.c stable/9/sys/cddl/dev/sdt/sdt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/dtrace/amd64/dtrace_isa.c ============================================================================== --- stable/9/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Sat Jul 6 01:46:58 2013 (r252857) +++ stable/9/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Sat Jul 6 02:49:56 2013 (r252858) @@ -398,7 +398,7 @@ dtrace_getarg(int arg, int aframes) } arg -= (inreg + 1); - stack = (uintptr_t *)&fp[1]; + stack = (uintptr_t *)fp + 2; load: DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); Modified: stable/9/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/9/sys/cddl/dev/sdt/sdt.c Sat Jul 6 01:46:58 2013 (r252857) +++ stable/9/sys/cddl/dev/sdt/sdt.c Sat Jul 6 02:49:56 2013 (r252858) @@ -134,7 +134,7 @@ sdt_probe_callback(struct sdt_probe *pro return (0); (void) dtrace_probe_create(prov->id, probe->mod, probe->func, - probe->name, 0, probe); + probe->name, 1, probe); return (0); } From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 02:50:23 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A8C3CE1D; Sat, 6 Jul 2013 02:50:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7F8081098; Sat, 6 Jul 2013 02:50:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r662oNTw082462; Sat, 6 Jul 2013 02:50:23 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r662oNjG082460; Sat, 6 Jul 2013 02:50:23 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307060250.r662oNjG082460@svn.freebsd.org> From: Mark Johnston Date: Sat, 6 Jul 2013 02:50:23 +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: r252859 - in stable/8/sys/cddl/dev: dtrace/amd64 sdt 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.14 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, 06 Jul 2013 02:50:23 -0000 Author: markj Date: Sat Jul 6 02:50:22 2013 New Revision: 252859 URL: http://svnweb.freebsd.org/changeset/base/252859 Log: MFC r251238: SDT probes can directly pass up to five arguments as arguments to dtrace_probe(). Arguments beyond these five must be obtained in an architecture-specific way; this can be done through the getargval provider method, and through dtrace_getarg() if getargval isn't overridden. This change fixes two off-by-one bugs in the way these arguments are fetched in FreeBSD's DTrace implementation. First, the SDT provider must set the aframes parameter to 1 when creating a probe. The aframes parameter controls the number of frames that dtrace_getarg() will step over in order to find the frame containing the extra arguments. On FreeBSD, dtrace_getarg() is called in SDT probe context via dtrace_probe()->dtrace_dif_emulate()->dtrace_dif_variable->dtrace_getarg() so aframes must be 3 since the arguments are in dtrace_probe()'s frame; it was previously being called with a value of 2 instead. illumos uses a different aframes value for SDT probes, but this is because illumos SDT probes fire by triggering the #UD fault handler rather than calling dtrace_probe() directly. The second bug has to do with the way arguments are grabbed out dtrace_probe()'s frame on amd64. The code currently jumps over the first stack argument and retrieves the rest of them using a pointer into the stack. This works on i386 because all of dtrace_probe()'s arguments will be on the stack and the first argument is the probe ID, which should be ignored. However, it is incorrect to ignore the first stack argument on amd64, so we correct the pointer used to access the arguments. Modified: stable/8/sys/cddl/dev/dtrace/amd64/dtrace_isa.c stable/8/sys/cddl/dev/sdt/sdt.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/dev/dtrace/amd64/dtrace_isa.c ============================================================================== --- stable/8/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Sat Jul 6 02:49:56 2013 (r252858) +++ stable/8/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Sat Jul 6 02:50:22 2013 (r252859) @@ -398,7 +398,7 @@ dtrace_getarg(int arg, int aframes) } arg -= (inreg + 1); - stack = (uintptr_t *)&fp[1]; + stack = (uintptr_t *)fp + 2; load: DTRACE_CPUFLAG_SET(CPU_DTRACE_NOFAULT); Modified: stable/8/sys/cddl/dev/sdt/sdt.c ============================================================================== --- stable/8/sys/cddl/dev/sdt/sdt.c Sat Jul 6 02:49:56 2013 (r252858) +++ stable/8/sys/cddl/dev/sdt/sdt.c Sat Jul 6 02:50:22 2013 (r252859) @@ -134,7 +134,7 @@ sdt_probe_callback(struct sdt_probe *pro return (0); (void) dtrace_probe_create(prov->id, probe->mod, probe->func, - probe->name, 0, probe); + probe->name, 1, probe); return (0); } From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 03:39:41 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5AAB775A; Sat, 6 Jul 2013 03:39:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4D1CE133A; Sat, 6 Jul 2013 03:39:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r663dfqh098341; Sat, 6 Jul 2013 03:39:41 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r663dfkM098340; Sat, 6 Jul 2013 03:39:41 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307060339.r663dfkM098340@svn.freebsd.org> From: Mark Johnston Date: Sat, 6 Jul 2013 03:39: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: r252860 - stable/9/sys/cddl/dev/dtmalloc 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.14 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, 06 Jul 2013 03:39:41 -0000 Author: markj Date: Sat Jul 6 03:39:40 2013 New Revision: 252860 URL: http://svnweb.freebsd.org/changeset/base/252860 Log: MFC r252325: The dtmalloc provider uses the short description of a malloc type as the function name of its corresponding DTrace probes. These descriptions may contain whitespace, but probe names cannot, so just replace any whitespace with underscores when creating probes. Modified: stable/9/sys/cddl/dev/dtmalloc/dtmalloc.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/dev/dtmalloc/dtmalloc.c ============================================================================== --- stable/9/sys/cddl/dev/dtmalloc/dtmalloc.c Sat Jul 6 02:50:22 2013 (r252859) +++ stable/9/sys/cddl/dev/dtmalloc/dtmalloc.c Sat Jul 6 03:39:40 2013 (r252860) @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -111,8 +112,17 @@ dtmalloc_type_cb(struct malloc_type *mtp { char name[DTRACE_FUNCNAMELEN]; struct malloc_type_internal *mtip = mtp->ks_handle; + int i; + /* + * malloc_type descriptions are allowed to contain whitespace, but + * DTrace probe identifiers are not, so replace the whitespace with + * underscores. + */ strlcpy(name, mtp->ks_shortdesc, sizeof(name)); + for (i = 0; name[i] != 0; i++) + if (isspace(name[i])) + name[i] = '_'; if (dtrace_probe_lookup(dtmalloc_id, NULL, name, "malloc") != 0) return; From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 03:40:00 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8995D887; Sat, 6 Jul 2013 03:40:00 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7735D133F; Sat, 6 Jul 2013 03:40:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r663e0LU098445; Sat, 6 Jul 2013 03:40:00 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r663e0Jh098444; Sat, 6 Jul 2013 03:40:00 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201307060340.r663e0Jh098444@svn.freebsd.org> From: Mark Johnston Date: Sat, 6 Jul 2013 03:40: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: r252861 - stable/8/sys/cddl/dev/dtmalloc 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.14 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, 06 Jul 2013 03:40:00 -0000 Author: markj Date: Sat Jul 6 03:40:00 2013 New Revision: 252861 URL: http://svnweb.freebsd.org/changeset/base/252861 Log: MFC r252325: The dtmalloc provider uses the short description of a malloc type as the function name of its corresponding DTrace probes. These descriptions may contain whitespace, but probe names cannot, so just replace any whitespace with underscores when creating probes. Modified: stable/8/sys/cddl/dev/dtmalloc/dtmalloc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) Modified: stable/8/sys/cddl/dev/dtmalloc/dtmalloc.c ============================================================================== --- stable/8/sys/cddl/dev/dtmalloc/dtmalloc.c Sat Jul 6 03:39:40 2013 (r252860) +++ stable/8/sys/cddl/dev/dtmalloc/dtmalloc.c Sat Jul 6 03:40:00 2013 (r252861) @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -111,8 +112,17 @@ dtmalloc_type_cb(struct malloc_type *mtp { char name[DTRACE_FUNCNAMELEN]; struct malloc_type_internal *mtip = mtp->ks_handle; + int i; + /* + * malloc_type descriptions are allowed to contain whitespace, but + * DTrace probe identifiers are not, so replace the whitespace with + * underscores. + */ strlcpy(name, mtp->ks_shortdesc, sizeof(name)); + for (i = 0; name[i] != 0; i++) + if (isspace(name[i])) + name[i] = '_'; if (dtrace_probe_lookup(dtmalloc_id, NULL, name, "malloc") != 0) return; From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 08:37:44 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E017B249; Sat, 6 Jul 2013 08:37:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C18991DDD; Sat, 6 Jul 2013 08:37:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668biMO085700; Sat, 6 Jul 2013 08:37:44 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668bhu0085695; Sat, 6 Jul 2013 08:37:43 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060837.r668bhu0085695@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 08:37: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: r252870 - stable/8/sys/dev/uart 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.14 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, 06 Jul 2013 08:37:45 -0000 Author: avg Date: Sat Jul 6 08:37:43 2013 New Revision: 252870 URL: http://svnweb.freebsd.org/changeset/base/252870 Log: MFC r246243: uart: add resume method and enable it for attachments on the most common x86 buses Modified: stable/8/sys/dev/uart/uart_bus.h stable/8/sys/dev/uart/uart_bus_acpi.c stable/8/sys/dev/uart/uart_bus_isa.c stable/8/sys/dev/uart/uart_bus_pci.c stable/8/sys/dev/uart/uart_core.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/uart/ (props changed) Modified: stable/8/sys/dev/uart/uart_bus.h ============================================================================== --- stable/8/sys/dev/uart/uart_bus.h Sat Jul 6 08:30:45 2013 (r252869) +++ stable/8/sys/dev/uart/uart_bus.h Sat Jul 6 08:37:43 2013 (r252870) @@ -137,6 +137,7 @@ extern char uart_driver_name[]; int uart_bus_attach(device_t dev); int uart_bus_detach(device_t dev); +int uart_bus_resume(device_t dev); serdev_intr_t *uart_bus_ihand(device_t dev, int ipend); int uart_bus_ipend(device_t dev); int uart_bus_probe(device_t dev, int regshft, int rclk, int rid, int chan); Modified: stable/8/sys/dev/uart/uart_bus_acpi.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_acpi.c Sat Jul 6 08:30:45 2013 (r252869) +++ stable/8/sys/dev/uart/uart_bus_acpi.c Sat Jul 6 08:37:43 2013 (r252870) @@ -47,6 +47,7 @@ static device_method_t uart_acpi_methods DEVMETHOD(device_probe, uart_acpi_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), { 0, 0 } }; Modified: stable/8/sys/dev/uart/uart_bus_isa.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_isa.c Sat Jul 6 08:30:45 2013 (r252869) +++ stable/8/sys/dev/uart/uart_bus_isa.c Sat Jul 6 08:37:43 2013 (r252870) @@ -50,6 +50,7 @@ static device_method_t uart_isa_methods[ DEVMETHOD(device_probe, uart_isa_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), { 0, 0 } }; Modified: stable/8/sys/dev/uart/uart_bus_pci.c ============================================================================== --- stable/8/sys/dev/uart/uart_bus_pci.c Sat Jul 6 08:30:45 2013 (r252869) +++ stable/8/sys/dev/uart/uart_bus_pci.c Sat Jul 6 08:37:43 2013 (r252870) @@ -51,6 +51,7 @@ static device_method_t uart_pci_methods[ DEVMETHOD(device_probe, uart_pci_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), DEVMETHOD_END }; Modified: stable/8/sys/dev/uart/uart_core.c ============================================================================== --- stable/8/sys/dev/uart/uart_core.c Sat Jul 6 08:30:45 2013 (r252869) +++ stable/8/sys/dev/uart/uart_core.c Sat Jul 6 08:37:43 2013 (r252870) @@ -578,3 +578,12 @@ uart_bus_detach(device_t dev) return (0); } + +int +uart_bus_resume(device_t dev) +{ + struct uart_softc *sc; + + sc = device_get_softc(dev); + return (UART_ATTACH(sc)); +} From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 08:43:10 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85E404C0; Sat, 6 Jul 2013 08:43:10 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 77C5F1DF4; Sat, 6 Jul 2013 08:43:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668hAEg088082; Sat, 6 Jul 2013 08:43:10 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668h9qe088077; Sat, 6 Jul 2013 08:43:09 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307060843.r668h9qe088077@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 08:43: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: r252871 - stable/9/sbin/swapon 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.14 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, 06 Jul 2013 08:43:10 -0000 Author: delphij Date: Sat Jul 6 08:43:09 2013 New Revision: 252871 URL: http://svnweb.freebsd.org/changeset/base/252871 Log: MFC r226712 (sobomax): Add new option -F to specify alternative location of the /etc/fstab file. MFC r226742 (ed): Build swapon with WARNS=6. Don't use a variable called stat, because it collides with stat(2). Modified: stable/9/sbin/swapon/Makefile stable/9/sbin/swapon/swapon.8 stable/9/sbin/swapon/swapon.c Directory Properties: stable/9/sbin/swapon/ (props changed) Modified: stable/9/sbin/swapon/Makefile ============================================================================== --- stable/9/sbin/swapon/Makefile Sat Jul 6 08:37:43 2013 (r252870) +++ stable/9/sbin/swapon/Makefile Sat Jul 6 08:43:09 2013 (r252871) @@ -8,7 +8,6 @@ LINKS+= ${BINDIR}/swapon ${BINDIR}/swapc MLINKS= swapon.8 swapoff.8 MLINKS+=swapon.8 swapctl.8 -WARNS?= 3 DPADD= ${LIBUTIL} LDADD= -lutil Modified: stable/9/sbin/swapon/swapon.8 ============================================================================== --- stable/9/sbin/swapon/swapon.8 Sat Jul 6 08:37:43 2013 (r252870) +++ stable/9/sbin/swapon/swapon.8 Sat Jul 6 08:43:09 2013 (r252871) @@ -35,8 +35,14 @@ .Nm swapon , swapoff , swapctl .Nd "specify devices for paging and swapping" .Sh SYNOPSIS -.Nm swapon Fl aq | Ar -.Nm swapoff Fl aq | Ar +.Nm swapon +.Oo Fl F Ar fstab +.Oc +.Fl aq | Ar +.Nm swapoff +.Oo Fl F Ar fstab +.Oc +.Fl aq | Ar .Nm swapctl .Op Fl AghklmsU .Oo @@ -99,6 +105,18 @@ must move swapped pages out of the devic lead to high system loads for a period of time, depending on how much data has been swapped out to that device. .Pp +Other options supported by both +.Nm swapon +and +.Nm swapoff +are as follows: +.Bl -tag -width indent +.It Fl F Ar fstab +Specify the +.Pa fstab +file to use. +.El +.Pp The .Nm swapctl utility exists primarily for those familiar with other Modified: stable/9/sbin/swapon/swapon.c ============================================================================== --- stable/9/sbin/swapon/swapon.c Sat Jul 6 08:37:43 2013 (r252870) +++ stable/9/sbin/swapon/swapon.c Sat Jul 6 08:43:09 2013 (r252871) @@ -67,9 +67,10 @@ main(int argc, char **argv) { struct fstab *fsp; char *ptr; - int stat; + int ret; int ch, doall; int sflag = 0, lflag = 0, hflag = 0, qflag = 0; + const char *etc_fstab; if ((ptr = strrchr(argv[0], '/')) == NULL) ptr = argv[0]; @@ -80,7 +81,8 @@ main(int argc, char **argv) orig_prog = which_prog; doall = 0; - while ((ch = getopt(argc, argv, "AadghklmqsU")) != -1) { + etc_fstab = NULL; + while ((ch = getopt(argc, argv, "AadghklmqsUF:")) != -1) { switch(ch) { case 'A': if (which_prog == SWAPCTL) { @@ -132,6 +134,9 @@ main(int argc, char **argv) usage(); } break; + case 'F': + etc_fstab = optarg; + break; case '?': default: usage(); @@ -139,7 +144,9 @@ main(int argc, char **argv) } argv += optind; - stat = 0; + ret = 0; + if (etc_fstab != NULL) + setfstab(etc_fstab); if (which_prog == SWAPON || which_prog == SWAPOFF) { if (doall) { while ((fsp = getfsent()) != NULL) { @@ -148,7 +155,7 @@ main(int argc, char **argv) if (strstr(fsp->fs_mntops, "noauto")) continue; if (swap_on_off(fsp->fs_spec, 1)) { - stat = 1; + ret = 1; } else { if (!qflag) { printf("%s: %sing %s as swap device\n", @@ -163,7 +170,7 @@ main(int argc, char **argv) usage(); for (; *argv; ++argv) { if (swap_on_off(*argv, 0)) { - stat = 1; + ret = 1; } else if (orig_prog == SWAPCTL) { printf("%s: %sing %s as swap device\n", getprogname(), which_prog == SWAPOFF ? "remov" : "add", @@ -176,7 +183,7 @@ main(int argc, char **argv) else usage(); } - exit(stat); + exit(ret); } static int @@ -210,7 +217,7 @@ usage(void) switch(orig_prog) { case SWAPON: case SWAPOFF: - fprintf(stderr, "-aq | file ...\n"); + fprintf(stderr, "[-F fstab] -aq | file ...\n"); break; case SWAPCTL: fprintf(stderr, "[-AghklmsU] [-a file ... | -d file ...]\n"); From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 08:43:31 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EDFF85EB; Sat, 6 Jul 2013 08:43:31 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E0FCB1DF9; Sat, 6 Jul 2013 08:43:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668hVCo088160; Sat, 6 Jul 2013 08:43:31 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668hVOJ088159; Sat, 6 Jul 2013 08:43:31 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060843.r668hVOJ088159@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 08:43: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: r252872 - stable/9/lib/libdwarf 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.14 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, 06 Jul 2013 08:43:32 -0000 Author: avg Date: Sat Jul 6 08:43:31 2013 New Revision: 252872 URL: http://svnweb.freebsd.org/changeset/base/252872 Log: MFC r248641: libdwarf: anonymous types are expected to have empty type names Modified: stable/9/lib/libdwarf/dwarf_die.c Directory Properties: stable/9/lib/libdwarf/ (props changed) Modified: stable/9/lib/libdwarf/dwarf_die.c ============================================================================== --- stable/9/lib/libdwarf/dwarf_die.c Sat Jul 6 08:43:09 2013 (r252871) +++ stable/9/lib/libdwarf/dwarf_die.c Sat Jul 6 08:43:31 2013 (r252872) @@ -29,8 +29,6 @@ #include #include "_libdwarf.h" -static const char *anon_name = "__anon__"; - int dwarf_die_add(Dwarf_CU cu, int level, uint64_t offset, uint64_t abnum, Dwarf_Abbrev a, Dwarf_Die *diep, Dwarf_Error *err) { @@ -57,7 +55,7 @@ dwarf_die_add(Dwarf_CU cu, int level, ui die->die_abnum = abnum; die->die_a = a; die->die_cu = cu; - die->die_name = anon_name; + die->die_name = ""; /* Initialise the list of attribute values. */ STAILQ_INIT(&die->die_attrval); From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 08:43:50 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 70414714; Sat, 6 Jul 2013 08:43:50 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 636581DFD; Sat, 6 Jul 2013 08:43:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668horC088347; Sat, 6 Jul 2013 08:43:50 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668hopZ088345; Sat, 6 Jul 2013 08:43:50 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060843.r668hopZ088345@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 08:43: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: r252873 - stable/8/lib/libdwarf 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.14 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, 06 Jul 2013 08:43:50 -0000 Author: avg Date: Sat Jul 6 08:43:49 2013 New Revision: 252873 URL: http://svnweb.freebsd.org/changeset/base/252873 Log: MFC r248641: libdwarf: anonymous types are expected to have empty type names Modified: stable/8/lib/libdwarf/dwarf_die.c Directory Properties: stable/8/lib/libdwarf/ (props changed) Modified: stable/8/lib/libdwarf/dwarf_die.c ============================================================================== --- stable/8/lib/libdwarf/dwarf_die.c Sat Jul 6 08:43:31 2013 (r252872) +++ stable/8/lib/libdwarf/dwarf_die.c Sat Jul 6 08:43:49 2013 (r252873) @@ -29,8 +29,6 @@ #include #include "_libdwarf.h" -static const char *anon_name = "__anon__"; - int dwarf_die_add(Dwarf_CU cu, int level, uint64_t offset, uint64_t abnum, Dwarf_Abbrev a, Dwarf_Die *diep, Dwarf_Error *err) { @@ -57,7 +55,7 @@ dwarf_die_add(Dwarf_CU cu, int level, ui die->die_abnum = abnum; die->die_a = a; die->die_cu = cu; - die->die_name = anon_name; + die->die_name = ""; /* Initialise the list of attribute values. */ STAILQ_INIT(&die->die_attrval); From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 08:51:57 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 55B41B4E; Sat, 6 Jul 2013 08:51:57 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 47C551E2B; Sat, 6 Jul 2013 08:51:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668pvxT091216; Sat, 6 Jul 2013 08:51:57 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668pvrI091215; Sat, 6 Jul 2013 08:51:57 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060851.r668pvrI091215@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 08:51: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: r252874 - 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.14 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, 06 Jul 2013 08:51:57 -0000 Author: avg Date: Sat Jul 6 08:51:56 2013 New Revision: 252874 URL: http://svnweb.freebsd.org/changeset/base/252874 Log: MFC r248645: post mountroot event after a real/final root is mounted Modified: stable/9/sys/kern/vfs_mountroot.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/vfs_mountroot.c ============================================================================== --- stable/9/sys/kern/vfs_mountroot.c Sat Jul 6 08:43:49 2013 (r252873) +++ stable/9/sys/kern/vfs_mountroot.c Sat Jul 6 08:51:56 2013 (r252874) @@ -199,8 +199,6 @@ set_rootvnode(void) VREF(rootvnode); FILEDESC_XUNLOCK(p->p_fd); - - EVENTHANDLER_INVOKE(mountroot); } static int @@ -994,6 +992,8 @@ vfs_mountroot(void) atomic_store_rel_int(&root_mount_complete, 1); wakeup(&root_mount_complete); mtx_unlock(&mountlist_mtx); + + EVENTHANDLER_INVOKE(mountroot); } static struct mntarg * From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 08:58:30 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id ADD33E38; Sat, 6 Jul 2013 08:58:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A00811E5E; Sat, 6 Jul 2013 08:58:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668wUvh092267; Sat, 6 Jul 2013 08:58:30 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668wUhs092266; Sat, 6 Jul 2013 08:58:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060858.r668wUhs092266@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 08:58:30 +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: r252875 - stable/9/sys/boot/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.14 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, 06 Jul 2013 08:58:30 -0000 Author: avg Date: Sat Jul 6 08:58:30 2013 New Revision: 252875 URL: http://svnweb.freebsd.org/changeset/base/252875 Log: MFC r249139: strncmp for boot code: fix an off by one error Modified: stable/9/sys/boot/common/util.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/boot/ (props changed) Modified: stable/9/sys/boot/common/util.c ============================================================================== --- stable/9/sys/boot/common/util.c Sat Jul 6 08:51:56 2013 (r252874) +++ stable/9/sys/boot/common/util.c Sat Jul 6 08:58:30 2013 (r252875) @@ -68,9 +68,9 @@ int strncmp(const char *s1, const char *s2, size_t len) { - for (; *s1 == *s2 && *s1 != '\0' && len > 0; len--, s1++, s2++) + for (; len > 0 && *s1 == *s2 && *s1 != '\0'; len--, s1++, s2++) ; - return ((unsigned char)*s1 - (unsigned char)*s2); + return (len == 0 ? 0 : (unsigned char)*s1 - (unsigned char)*s2); } void From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 08:59:27 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D082CF7A; Sat, 6 Jul 2013 08:59:27 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C28EA1E71; Sat, 6 Jul 2013 08:59:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r668xRXG092434; Sat, 6 Jul 2013 08:59:27 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r668xRkt092433; Sat, 6 Jul 2013 08:59:27 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060859.r668xRkt092433@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 08:59:27 +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: r252876 - stable/8/sys/boot/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.14 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, 06 Jul 2013 08:59:27 -0000 Author: avg Date: Sat Jul 6 08:59:27 2013 New Revision: 252876 URL: http://svnweb.freebsd.org/changeset/base/252876 Log: MFC r249139: strncmp for boot code: fix an off by one error Modified: stable/8/sys/boot/common/util.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/boot/ (props changed) Modified: stable/8/sys/boot/common/util.c ============================================================================== --- stable/8/sys/boot/common/util.c Sat Jul 6 08:58:30 2013 (r252875) +++ stable/8/sys/boot/common/util.c Sat Jul 6 08:59:27 2013 (r252876) @@ -68,9 +68,9 @@ int strncmp(const char *s1, const char *s2, size_t len) { - for (; *s1 == *s2 && *s1 != '\0' && len > 0; len--, s1++, s2++) + for (; len > 0 && *s1 == *s2 && *s1 != '\0'; len--, s1++, s2++) ; - return ((unsigned char)*s1 - (unsigned char)*s2); + return (len == 0 ? 0 : (unsigned char)*s1 - (unsigned char)*s2); } void From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 09:02:30 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D789F1A8; Sat, 6 Jul 2013 09:02:30 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CA5611E99; Sat, 6 Jul 2013 09:02:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6692UIZ094718; Sat, 6 Jul 2013 09:02:30 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6692Uvg094717; Sat, 6 Jul 2013 09:02:30 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060902.r6692Uvg094717@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 09:02:30 +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: r252877 - stable/9/etc 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.14 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, 06 Jul 2013 09:02:30 -0000 Author: avg Date: Sat Jul 6 09:02:30 2013 New Revision: 252877 URL: http://svnweb.freebsd.org/changeset/base/252877 Log: MFC r248820: rc.subr: disabling globbing while processing devfs rules Modified: stable/9/etc/rc.subr Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.subr ============================================================================== --- stable/9/etc/rc.subr Sat Jul 6 08:59:27 2013 (r252876) +++ stable/9/etc/rc.subr Sat Jul 6 09:02:30 2013 (r252877) @@ -1318,7 +1318,7 @@ make_symlink() # devfs_rulesets_from_file() { - local file _err _me + local file _err _me _opts file="$1" _me="devfs_rulesets_from_file" _err=0 @@ -1331,6 +1331,11 @@ devfs_rulesets_from_file() debug "$_me: no such file ($file)" return 0 fi + + # Disable globbing so that the rule patterns are not expanded + # by accident with matching filesystem entries. + _opts=$-; set -f + debug "reading rulesets from file ($file)" { while read line do @@ -1377,6 +1382,7 @@ devfs_rulesets_from_file() break fi done } < $file + case $_opts in *f*) ;; *) set +f ;; esac return $_err } From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 09:03:02 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B48832D3; Sat, 6 Jul 2013 09:03:02 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A74EE1E9E; Sat, 6 Jul 2013 09:03:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66932Rg094858; Sat, 6 Jul 2013 09:03:02 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66932B0094857; Sat, 6 Jul 2013 09:03:02 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201307060903.r66932B0094857@svn.freebsd.org> From: Andriy Gapon Date: Sat, 6 Jul 2013 09:03:02 +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: r252878 - stable/8/etc 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.14 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, 06 Jul 2013 09:03:02 -0000 Author: avg Date: Sat Jul 6 09:03:02 2013 New Revision: 252878 URL: http://svnweb.freebsd.org/changeset/base/252878 Log: MFC r248820: rc.subr: disabling globbing while processing devfs rules Modified: stable/8/etc/rc.subr Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.subr ============================================================================== --- stable/8/etc/rc.subr Sat Jul 6 09:02:30 2013 (r252877) +++ stable/8/etc/rc.subr Sat Jul 6 09:03:02 2013 (r252878) @@ -1322,7 +1322,7 @@ make_symlink() # devfs_rulesets_from_file() { - local file _err _me + local file _err _me _opts file="$1" _me="devfs_rulesets_from_file" _err=0 @@ -1335,6 +1335,11 @@ devfs_rulesets_from_file() debug "$_me: no such file ($file)" return 0 fi + + # Disable globbing so that the rule patterns are not expanded + # by accident with matching filesystem entries. + _opts=$-; set -f + debug "reading rulesets from file ($file)" { while read line do @@ -1381,6 +1386,7 @@ devfs_rulesets_from_file() break fi done } < $file + case $_opts in *f*) ;; *) set +f ;; esac return $_err } From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 09:04:57 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3B61F4F7; Sat, 6 Jul 2013 09:04:57 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D1A41EAE; Sat, 6 Jul 2013 09:04:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6694vgH095508; Sat, 6 Jul 2013 09:04:57 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6694tH9095494; Sat, 6 Jul 2013 09:04:55 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307060904.r6694tH9095494@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 09:04: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: r252879 - in stable/9/sys: netinet 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.14 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, 06 Jul 2013 09:04:57 -0000 Author: tuexen Date: Sat Jul 6 09:04:55 2013 New Revision: 252879 URL: http://svnweb.freebsd.org/changeset/base/252879 Log: MFC r237540: Do packet logging in a consistent way. Modified: stable/9/sys/netinet/sctp_bsd_addr.c stable/9/sys/netinet/sctp_bsd_addr.h stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_os_bsd.h stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_bsd_addr.c ============================================================================== --- stable/9/sys/netinet/sctp_bsd_addr.c Sat Jul 6 09:03:02 2013 (r252878) +++ stable/9/sys/netinet/sctp_bsd_addr.c Sat Jul 6 09:04:55 2013 (r252879) @@ -422,11 +422,12 @@ sctp_get_mbuf_for_msg(unsigned int space #ifdef SCTP_PACKET_LOGGING void -sctp_packet_log(struct mbuf *m, int length) +sctp_packet_log(struct mbuf *m) { int *lenat, thisone; void *copyto; uint32_t *tick_tock; + int length; int total_len; int grabbed_lock = 0; int value, newval, thisend, thisbegin; @@ -436,6 +437,7 @@ sctp_packet_log(struct mbuf *m, int leng * (value) -ticks of log (ticks) o -ip packet o -as logged - * where this started (thisbegin) x <--end points here */ + length = SCTP_HEADER_LEN(m); total_len = SCTP_SIZE32((length + (4 * sizeof(int)))); /* Log a packet to the buffer. */ if (total_len > SCTP_PACKET_LOG_SIZE) { Modified: stable/9/sys/netinet/sctp_bsd_addr.h ============================================================================== --- stable/9/sys/netinet/sctp_bsd_addr.h Sat Jul 6 09:03:02 2013 (r252878) +++ stable/9/sys/netinet/sctp_bsd_addr.h Sat Jul 6 09:04:55 2013 (r252879) @@ -53,7 +53,7 @@ void sctp_gather_internal_ifa_flags(stru #ifdef SCTP_PACKET_LOGGING -void sctp_packet_log(struct mbuf *m, int length); +void sctp_packet_log(struct mbuf *m); int sctp_copy_out_packet_log(uint8_t * target, int length); #endif Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:03:02 2013 (r252878) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:04:55 2013 (r252879) @@ -5930,9 +5930,9 @@ sctp_input_with_port(struct mbuf *i_pak, } } #endif -#ifdef SCTP_PACKET_LOGGING +#ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(m, mlen); + sctp_packet_log(m); #endif if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; Modified: stable/9/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/9/sys/netinet/sctp_os_bsd.h Sat Jul 6 09:03:02 2013 (r252878) +++ stable/9/sys/netinet/sctp_os_bsd.h Sat Jul 6 09:04:55 2013 (r252879) @@ -365,7 +365,7 @@ typedef struct callout sctp_os_timer_t; */ #define SCTP_HEADER_TO_CHAIN(m) (m) #define SCTP_DETACH_HEADER_FROM_CHAIN(m) -#define SCTP_HEADER_LEN(m) (m->m_pkthdr.len) +#define SCTP_HEADER_LEN(m) ((m)->m_pkthdr.len) #define SCTP_GET_HEADER_FOR_OUTPUT(o_pak) 0 #define SCTP_RELEASE_HEADER(m) #define SCTP_RELEASE_PKT(m) sctp_m_freem(m) Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sat Jul 6 09:03:02 2013 (r252878) +++ stable/9/sys/netinet/sctp_output.c Sat Jul 6 09:04:55 2013 (r252879) @@ -4114,10 +4114,6 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_m_freem(m); return (ENOMEM); } -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(m, packet_length); -#endif SCTP_ATTACH_CHAIN(o_pak, m, packet_length); if (port) { #if defined(SCTP_WITH_NO_CSUM) @@ -4138,6 +4134,10 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_STAT_INCR(sctps_sendhwcrc); #endif } +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) + sctp_packet_log(o_pak); +#endif /* send it out. table id is taken from stcb */ #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { @@ -4463,10 +4463,6 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_LTRACE_ERR_RET(inp, stcb, NULL, SCTP_FROM_SCTP_OUTPUT, ENOMEM); return (ENOMEM); } -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) - sctp_packet_log(m, packet_length); -#endif SCTP_ATTACH_CHAIN(o_pak, m, packet_length); if (port) { #if defined(SCTP_WITH_NO_CSUM) @@ -4494,6 +4490,10 @@ sctp_lowlevel_chunk_output(struct sctp_i SCTP_SOCKET_UNLOCK(so, 0); } #endif +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) + sctp_packet_log(o_pak); +#endif SCTP_IP6_OUTPUT(ret, o_pak, (struct route_in6 *)ro, &ifp, stcb, vrf_id); #if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { @@ -11068,11 +11068,6 @@ sctp_send_resp_msg(struct mbuf *m, struc } } iph_out->ip_len = len; -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { - sctp_packet_log(mout, len); - } -#endif if (port) { #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); @@ -11092,17 +11087,17 @@ sctp_send_resp_msg(struct mbuf *m, struc SCTP_STAT_INCR(sctps_sendhwcrc); #endif } +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(o_pak); + } +#endif SCTP_IP_OUTPUT(ret, o_pak, NULL, NULL, vrf_id); } #endif #ifdef INET6 if (ip6_out != NULL) { ip6_out->ip6_plen = len - sizeof(struct ip6_hdr); -#ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { - sctp_packet_log(mout, len); - } -#endif if (port) { #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_sendnocrc); @@ -11122,6 +11117,11 @@ sctp_send_resp_msg(struct mbuf *m, struc SCTP_STAT_INCR(sctps_sendhwcrc); #endif } +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(o_pak); + } +#endif SCTP_IP6_OUTPUT(ret, o_pak, NULL, NULL, NULL, vrf_id); } #endif Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:03:02 2013 (r252878) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:04:55 2013 (r252879) @@ -101,10 +101,12 @@ sctp6_input(struct mbuf **i_pak, int *of return (-1); } m = SCTP_HEADER_TO_CHAIN(*i_pak); - pkt_len = SCTP_HEADER_LEN((*i_pak)); + pkt_len = SCTP_HEADER_LEN(*i_pak); -#ifdef SCTP_PACKET_LOGGING - sctp_packet_log(m, pkt_len); +#ifdef SCTP_PACKET_LOGGING + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { + sctp_packet_log(m); + } #endif if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 09:08:17 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BC97E753; Sat, 6 Jul 2013 09:08:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 94D9C1EC8; Sat, 6 Jul 2013 09:08:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6698HEl096120; Sat, 6 Jul 2013 09:08:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r6698H3L096119; Sat, 6 Jul 2013 09:08:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307060908.r6698H3L096119@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 09:08:17 +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: r252880 - stable/9/sys/netinet 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.14 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, 06 Jul 2013 09:08:17 -0000 Author: tuexen Date: Sat Jul 6 09:08:17 2013 New Revision: 252880 URL: http://svnweb.freebsd.org/changeset/base/252880 Log: MFC r237541: Remove redundant check. Modified: stable/9/sys/netinet/sctp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:04:55 2013 (r252879) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:08:17 2013 (r252880) @@ -2392,7 +2392,7 @@ sctp_handle_cookie_echo(struct mbuf *m, uint8_t calc_sig[SCTP_SIGNATURE_SIZE], tmp_sig[SCTP_SIGNATURE_SIZE]; uint8_t *sig; uint8_t cookie_ok = 0; - unsigned int size_of_pkt, sig_offset, cookie_offset; + unsigned int sig_offset, cookie_offset; unsigned int cookie_len; struct timeval now; struct timeval time_expires; @@ -2434,7 +2434,6 @@ sctp_handle_cookie_echo(struct mbuf *m, lsin->sin_len = sizeof(*lsin); lsin->sin_port = sh->dest_port; lsin->sin_addr.s_addr = iph->ip_dst.s_addr; - size_of_pkt = SCTP_GET_IPV4_LENGTH(iph); break; } #endif @@ -2452,7 +2451,6 @@ sctp_handle_cookie_echo(struct mbuf *m, ip6 = mtod(m, struct ip6_hdr *); lsin6->sin6_port = sh->dest_port; lsin6->sin6_addr = ip6->ip6_dst; - size_of_pkt = SCTP_GET_IPV6_LENGTH(ip6) + iphlen; break; } #endif @@ -2476,11 +2474,10 @@ sctp_handle_cookie_echo(struct mbuf *m, */ return (NULL); } - if (cookie_len > size_of_pkt || - cookie_len < sizeof(struct sctp_cookie_echo_chunk) + + if (cookie_len < sizeof(struct sctp_cookie_echo_chunk) + sizeof(struct sctp_init_chunk) + sizeof(struct sctp_init_ack_chunk) + SCTP_SIGNATURE_SIZE) { - /* cookie too long! or too small */ + /* cookie too small */ return (NULL); } /* @@ -2488,11 +2485,6 @@ sctp_handle_cookie_echo(struct mbuf *m, * calculated in the sctp_hmac_m() call). */ sig_offset = offset + cookie_len - SCTP_SIGNATURE_SIZE; - if (sig_offset > size_of_pkt) { - /* packet not correct size! */ - /* XXX this may already be accounted for earlier... */ - return (NULL); - } m_sig = m_split(m, sig_offset, M_DONTWAIT); if (m_sig == NULL) { /* out of memory or ?? */ From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 09:11:39 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CAD578B5; Sat, 6 Jul 2013 09:11:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BC3B81EE7; Sat, 6 Jul 2013 09:11:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r669BdXp098358; Sat, 6 Jul 2013 09:11:39 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r669BcC6098352; Sat, 6 Jul 2013 09:11:38 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307060911.r669BcC6098352@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 09:11: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: r252881 - in stable/9/sys: netinet 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.14 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, 06 Jul 2013 09:11:39 -0000 Author: tuexen Date: Sat Jul 6 09:11:38 2013 New Revision: 252881 URL: http://svnweb.freebsd.org/changeset/base/252881 Log: MFC r237542: Pass the packet length explicitly around. Modified: stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_output.h stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sat Jul 6 09:08:17 2013 (r252880) +++ stable/9/sys/netinet/sctp_indata.c Sat Jul 6 09:11:38 2013 (r252881) @@ -2762,7 +2762,7 @@ sctp_process_data(struct mbuf **mm, int /* * we need to report rwnd overrun drops. */ - sctp_send_packet_dropped(stcb, net, *mm, iphlen, 0); + sctp_send_packet_dropped(stcb, net, *mm, length, iphlen, 0); } if (num_chunks) { /* Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:08:17 2013 (r252880) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:11:38 2013 (r252881) @@ -6011,7 +6011,7 @@ sctp_input_with_port(struct mbuf *i_pak, #endif } if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, iphlen, 1); + sctp_send_packet_dropped(stcb, net, m, mlen + iphlen, iphlen, 1); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); } else if ((inp != NULL) && (stcb == NULL)) { refcount_up = 1; Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sat Jul 6 09:08:17 2013 (r252880) +++ stable/9/sys/netinet/sctp_output.c Sat Jul 6 09:11:38 2013 (r252881) @@ -11309,21 +11309,15 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb void sctp_send_packet_dropped(struct sctp_tcb *stcb, struct sctp_nets *net, - struct mbuf *m, int iphlen, int bad_crc) + struct mbuf *m, int len, int iphlen, int bad_crc) { struct sctp_association *asoc; struct sctp_pktdrop_chunk *drp; struct sctp_tmit_chunk *chk; uint8_t *datap; - int len; int was_trunc = 0; struct ip *iph; - -#ifdef INET6 - struct ip6_hdr *ip6h; - -#endif - int fullsz = 0, extra = 0; + int fullsz = 0; long spc; int offset; struct sctp_chunkhdr *ch, chunk_buf; @@ -11353,23 +11347,8 @@ sctp_send_packet_dropped(struct sctp_tcb sctp_free_a_chunk(stcb, chk, SCTP_SO_NOT_LOCKED); return; } - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - /* IPv4 */ - len = chk->send_size = iph->ip_len; - break; -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - /* IPv6 */ - ip6h = mtod(m, struct ip6_hdr *); - len = chk->send_size = htons(ip6h->ip6_plen); - break; -#endif - default: - return; - } + len -= iphlen; + chk->send_size = len; /* Validate that we do not have an ABORT in here. */ offset = iphlen + sizeof(struct sctphdr); ch = (struct sctp_chunkhdr *)sctp_m_getptr(m, offset, @@ -11405,7 +11384,7 @@ sctp_send_packet_dropped(struct sctp_tcb /* * only send 1 mtu worth, trim off the excess on the end. */ - fullsz = len - extra; + fullsz = len; len = min(stcb->asoc.smallest_mtu, MCLBYTES) - SCTP_MAX_OVERHEAD; was_trunc = 1; } Modified: stable/9/sys/netinet/sctp_output.h ============================================================================== --- stable/9/sys/netinet/sctp_output.h Sat Jul 6 09:08:17 2013 (r252880) +++ stable/9/sys/netinet/sctp_output.h Sat Jul 6 09:11:38 2013 (r252881) @@ -162,7 +162,7 @@ void sctp_send_ecn_echo(struct sctp_tcb void sctp_send_packet_dropped(struct sctp_tcb *, struct sctp_nets *, struct mbuf *, - int, int); + int, int, int); Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:08:17 2013 (r252880) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:11:38 2013 (r252881) @@ -184,7 +184,7 @@ sctp6_input(struct mbuf **i_pak, int *of } /* in6p's ref-count increased && stcb locked */ if ((in6p) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, iphlen, 1); + sctp_send_packet_dropped(stcb, net, m, pkt_len, iphlen, 1); sctp_chunk_output((struct sctp_inpcb *)in6p, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); } else if ((in6p != NULL) && (stcb == NULL)) { refcount_up = 1; From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 09:17:56 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4812EA1A; Sat, 6 Jul 2013 09:17:56 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 39DCF1F08; Sat, 6 Jul 2013 09:17:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r669HuGa099240; Sat, 6 Jul 2013 09:17:56 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r669Hsu6099230; Sat, 6 Jul 2013 09:17:54 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307060917.r669Hsu6099230@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 09:17: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: r252882 - in stable/9/sys: netinet 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.14 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, 06 Jul 2013 09:17:56 -0000 Author: tuexen Date: Sat Jul 6 09:17:54 2013 New Revision: 252882 URL: http://svnweb.freebsd.org/changeset/base/252882 Log: MFC r237565: Whitespace cleanup. Modified: stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_sysctl.c stable/9/sys/netinet/sctp_sysctl.h stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet/sctputil.c stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet/sctp_indata.c Sat Jul 6 09:17:54 2013 (r252882) @@ -1529,7 +1529,7 @@ sctp_process_a_data_chunk(struct sctp_tc */ if (stcb->sctp_socket->so_rcv.sb_cc) { /* some to read, wake-up */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -1545,7 +1545,7 @@ sctp_process_a_data_chunk(struct sctp_tc } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3982,7 +3982,7 @@ sctp_express_handle_sack(struct sctp_tcb } /* sa_ignore NO_NULL_CHK */ if (stcb->sctp_socket) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -3991,7 +3991,7 @@ sctp_express_handle_sack(struct sctp_tcb /* sa_ignore NO_NULL_CHK */ sctp_wakeup_log(stcb, 1, SCTP_WAKESND_FROM_SACK); } -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4005,7 +4005,7 @@ sctp_express_handle_sack(struct sctp_tcb } #endif sctp_sowwakeup_locked(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } else { @@ -4734,7 +4734,7 @@ sctp_handle_sack(struct mbuf *m, int off } /* sa_ignore NO_NULL_CHK */ if ((wake_him) && (stcb->sctp_socket)) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -4742,7 +4742,7 @@ sctp_handle_sack(struct mbuf *m, int off if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_WAKE_LOGGING_ENABLE) { sctp_wakeup_log(stcb, wake_him, SCTP_WAKESND_FROM_SACK); } -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4756,7 +4756,7 @@ sctp_handle_sack(struct mbuf *m, int off } #endif sctp_sowwakeup_locked(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } else { Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:17:54 2013 (r252882) @@ -757,7 +757,7 @@ static void sctp_handle_abort(struct sctp_abort_chunk *abort, struct sctp_tcb *stcb, struct sctp_nets *net) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -807,7 +807,7 @@ sctp_handle_abort(struct sctp_abort_chun #ifdef SCTP_ASOCLOG_OF_TSNS sctp_print_out_track_log(stcb); #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -818,7 +818,7 @@ sctp_handle_abort(struct sctp_abort_chun stcb->asoc.state |= SCTP_STATE_WAS_ABORTED; (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_6); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_abort: finished\n"); @@ -860,7 +860,7 @@ sctp_handle_shutdown(struct sctp_shutdow struct sctp_association *asoc; int some_on_streamwheel; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -892,7 +892,7 @@ sctp_handle_shutdown(struct sctp_shutdow asoc->control_pdapi->pdapi_aborted = 1; asoc->control_pdapi = NULL; SCTP_INP_READ_UNLOCK(stcb->sctp_ep); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -906,7 +906,7 @@ sctp_handle_shutdown(struct sctp_shutdow } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -966,7 +966,7 @@ sctp_handle_shutdown_ack(struct sctp_shu { struct sctp_association *asoc; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -1000,7 +1000,7 @@ sctp_handle_shutdown_ack(struct sctp_shu asoc->control_pdapi->pdapi_aborted = 1; asoc->control_pdapi = NULL; SCTP_INP_READ_UNLOCK(stcb->sctp_ep); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); @@ -1013,7 +1013,7 @@ sctp_handle_shutdown_ack(struct sctp_shu } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -1037,7 +1037,7 @@ sctp_handle_shutdown_ack(struct sctp_shu } SCTP_STAT_INCR_COUNTER32(sctps_shutdown); /* free the TCB but first save off the ep */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); @@ -1046,7 +1046,7 @@ sctp_handle_shutdown_ack(struct sctp_shu #endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_10); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -1132,7 +1132,7 @@ sctp_handle_error(struct sctp_chunkhdr * struct sctp_association *asoc; int adjust; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -1195,7 +1195,7 @@ sctp_handle_error(struct sctp_chunkhdr * asoc->max_init_times) { sctp_abort_notification(stcb, 0, 0, NULL, SCTP_SO_NOT_LOCKED); /* now free the asoc */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1205,7 +1205,7 @@ sctp_handle_error(struct sctp_chunkhdr * #endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_11); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif return (-1); @@ -1580,7 +1580,7 @@ sctp_process_cookie_existing(struct mbuf (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && (inp->sctp_socket->so_qlimit == 0) ) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -1592,7 +1592,7 @@ sctp_process_cookie_existing(struct mbuf */ stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1605,7 +1605,7 @@ sctp_process_cookie_existing(struct mbuf } #endif soisconnected(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -1798,13 +1798,13 @@ sctp_process_cookie_existing(struct mbuf if (((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) && (inp->sctp_socket->so_qlimit == 0)) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1817,7 +1817,7 @@ sctp_process_cookie_existing(struct mbuf } #endif soisconnected(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -2029,7 +2029,7 @@ sctp_process_cookie_new(struct mbuf *m, struct sockaddr_in6 *sin6; #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(inp); @@ -2133,14 +2133,14 @@ sctp_process_cookie_new(struct mbuf *m, sh, op_err, use_mflowid, mflowid, vrf_id, port); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_16); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2165,13 +2165,13 @@ sctp_process_cookie_new(struct mbuf *m, retval = 0; if (retval < 0) { atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_16); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2182,13 +2182,13 @@ sctp_process_cookie_new(struct mbuf *m, init_offset + sizeof(struct sctp_init_chunk), initack_offset, sh, init_src)) { atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_17); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2211,13 +2211,13 @@ sctp_process_cookie_new(struct mbuf *m, SCTPDBG(SCTP_DEBUG_AUTH1, "COOKIE-ECHO: AUTH failed\n"); atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_18); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2274,13 +2274,13 @@ sctp_process_cookie_new(struct mbuf *m, #endif default: atomic_add_int(&stcb->asoc.refcnt, 1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); SCTP_TCB_LOCK(stcb); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_19); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif atomic_subtract_int(&stcb->asoc.refcnt, 1); @@ -2301,7 +2301,7 @@ sctp_process_cookie_new(struct mbuf *m, * a bit of protection is worth having.. */ stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); SCTP_SOCKET_LOCK(so, 1); @@ -2313,7 +2313,7 @@ sctp_process_cookie_new(struct mbuf *m, } #endif soisconnected(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } else if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && @@ -2780,7 +2780,7 @@ sctp_handle_cookie_echo(struct mbuf *m, if (so == NULL) { struct mbuf *op_err; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *pcb_so; #endif @@ -2791,7 +2791,7 @@ sctp_handle_cookie_echo(struct mbuf *m, sh, op_err, use_mflowid, mflowid, vrf_id, port); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) pcb_so = SCTP_INP_SO(*inp_p); atomic_add_int(&(*stcb)->asoc.refcnt, 1); SCTP_TCB_UNLOCK((*stcb)); @@ -2800,7 +2800,7 @@ sctp_handle_cookie_echo(struct mbuf *m, atomic_subtract_int(&(*stcb)->asoc.refcnt, 1); #endif (void)sctp_free_assoc(*inp_p, *stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_20); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(pcb_so, 1); #endif return (NULL); @@ -2890,13 +2890,13 @@ sctp_handle_cookie_echo(struct mbuf *m, * Pull it from the incomplete queue and wake the * guy */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) atomic_add_int(&(*stcb)->asoc.refcnt, 1); SCTP_TCB_UNLOCK((*stcb)); SCTP_SOCKET_LOCK(so, 1); #endif soisconnected(so); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_LOCK((*stcb)); atomic_subtract_int(&(*stcb)->asoc.refcnt, 1); SCTP_SOCKET_UNLOCK(so, 1); @@ -2952,12 +2952,12 @@ sctp_handle_cookie_ack(struct sctp_cooki sctp_ulp_notify(SCTP_NOTIFY_ASSOC_UP, stcb, 0, NULL, SCTP_SO_NOT_LOCKED); if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif stcb->sctp_ep->sctp_flags |= SCTP_PCB_FLAGS_CONNECTED; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -2968,7 +2968,7 @@ sctp_handle_cookie_ack(struct sctp_cooki if ((stcb->asoc.state & SCTP_STATE_CLOSED_SOCKET) == 0) { soisconnected(stcb->sctp_socket); } -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3196,7 +3196,7 @@ sctp_handle_shutdown_complete(struct sct { struct sctp_association *asoc; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -3231,7 +3231,7 @@ sctp_handle_shutdown_complete(struct sct /* free the TCB */ SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_shutdown_complete: calls free-asoc\n"); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -3240,7 +3240,7 @@ sctp_handle_shutdown_complete(struct sct atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(stcb->sctp_ep, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_23); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif return; @@ -4427,7 +4427,7 @@ __attribute__((noinline)) int auth_skipped = 0; int asconf_cnt = 0; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -4785,7 +4785,7 @@ process_control_chunks: } *offset = length; if (stcb) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4794,7 +4794,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_27); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -5205,7 +5205,7 @@ process_control_chunks: if ((stcb) && (stcb->asoc.total_output_queue_size)) { ; } else if (stcb) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -5214,7 +5214,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_27); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif *offset = length; @@ -5368,7 +5368,7 @@ process_control_chunks: *fwd_tsn_seen = 1; if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -5377,7 +5377,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_29); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif *offset = length; @@ -5413,7 +5413,7 @@ process_control_chunks: } if (inp->sctp_flags & SCTP_PCB_FLAGS_SOCKET_GONE) { /* We are not interested anymore */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -5422,7 +5422,7 @@ process_control_chunks: atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_INPUT + SCTP_LOC_30); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif *offset = length; Modified: stable/9/sys/netinet/sctp_output.c ============================================================================== --- stable/9/sys/netinet/sctp_output.c Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet/sctp_output.c Sat Jul 6 09:17:54 2013 (r252882) @@ -3899,7 +3899,7 @@ sctp_lowlevel_chunk_output(struct sctp_i #endif uint8_t tos_value; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so = NULL; #endif @@ -4139,14 +4139,14 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_packet_log(o_pak); #endif /* send it out. table id is taken from stcb */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { so = SCTP_INP_SO(inp); SCTP_SOCKET_UNLOCK(so, 0); } #endif SCTP_IP_OUTPUT(ret, o_pak, ro, stcb, vrf_id); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -4484,7 +4484,7 @@ sctp_lowlevel_chunk_output(struct sctp_i #endif } /* send it out. table id is taken from stcb */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { so = SCTP_INP_SO(inp); SCTP_SOCKET_UNLOCK(so, 0); @@ -4495,7 +4495,7 @@ sctp_lowlevel_chunk_output(struct sctp_i sctp_packet_log(o_pak); #endif SCTP_IP6_OUTPUT(ret, o_pak, (struct route_in6 *)ro, &ifp, stcb, vrf_id); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if ((SCTP_BASE_SYSCTL(sctp_output_unlocked)) && (so_locked)) { atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); Modified: stable/9/sys/netinet/sctp_sysctl.c ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.c Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet/sctp_sysctl.c Sat Jul 6 09:17:54 2013 (r252882) @@ -665,7 +665,7 @@ sysctl_sctp_check(SYSCTL_HANDLER_ARGS) #ifdef SCTP_DEBUG RANGECHK(SCTP_BASE_SYSCTL(sctp_debug_on), SCTPCTL_DEBUG_MIN, SCTPCTL_DEBUG_MAX); #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) RANGECHK(SCTP_BASE_SYSCTL(sctp_output_unlocked), SCTPCTL_OUTPUT_UNLOCKED_MIN, SCTPCTL_OUTPUT_UNLOCKED_MAX); #endif } @@ -1125,7 +1125,7 @@ SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUT #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SYSCTL_VNET_PROC(_net_inet_sctp, OID_AUTO, output_unlocked, CTLTYPE_UINT | CTLFLAG_RW, &SCTP_BASE_SYSCTL(sctp_output_unlocked), 0, sysctl_sctp_check, "IU", SCTPCTL_OUTPUT_UNLOCKED_DESC); Modified: stable/9/sys/netinet/sctp_sysctl.h ============================================================================== --- stable/9/sys/netinet/sctp_sysctl.h Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet/sctp_sysctl.h Sat Jul 6 09:17:54 2013 (r252882) @@ -531,7 +531,7 @@ struct sctp_sysctl { #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) #define SCTPCTL_OUTPUT_UNLOCKED_DESC "Unlock socket when sending packets down to IP." #define SCTPCTL_OUTPUT_UNLOCKED_MIN 0 #define SCTPCTL_OUTPUT_UNLOCKED_MAX 1 Modified: stable/9/sys/netinet/sctp_usrreq.c ============================================================================== --- stable/9/sys/netinet/sctp_usrreq.c Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet/sctp_usrreq.c Sat Jul 6 09:17:54 2013 (r252882) @@ -224,7 +224,7 @@ sctp_notify(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -283,7 +283,7 @@ sctp_notify(struct sctp_inpcb *inp, * with no TCB */ sctp_abort_notification(stcb, 1, 0, NULL, SCTP_SO_NOT_LOCKED); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -292,7 +292,7 @@ sctp_notify(struct sctp_inpcb *inp, atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_2); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); /* SCTP_TCB_UNLOCK(stcb); MT: I think this is not needed. */ #endif @@ -5836,7 +5836,7 @@ sctp_ctloutput(struct socket *so, struct if (INP_CHECK_SOCKAF(so, AF_INET6)) error = ip6_ctloutput(so, sopt); #endif /* INET6 */ -#if defined(INET) && defined (INET6) +#if defined(INET) && defined(INET6) else #endif #ifdef INET Modified: stable/9/sys/netinet/sctputil.c ============================================================================== --- stable/9/sys/netinet/sctputil.c Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet/sctputil.c Sat Jul 6 09:17:54 2013 (r252882) @@ -1412,7 +1412,7 @@ sctp_timeout_handler(void *t) struct sctp_nets *net; struct sctp_timer *tmr; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -1777,7 +1777,7 @@ sctp_timeout_handler(void *t) /* Can we free it yet? */ SCTP_INP_DECR_REF(inp); sctp_timer_stop(SCTP_TIMER_TYPE_ASOCKILL, inp, stcb, NULL, SCTP_FROM_SCTPUTIL + SCTP_LOC_1); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -1786,7 +1786,7 @@ sctp_timeout_handler(void *t) atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_2); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif /* @@ -2600,7 +2600,7 @@ sctp_notify_assoc_change(uint16_t state, size_t notif_len, abort_len; unsigned int i; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -2698,7 +2698,7 @@ set_error: } } /* Wake ANY sleepers */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(stcb->sctp_ep); if (!so_locked) { atomic_add_int(&stcb->asoc.refcnt, 1); @@ -2719,7 +2719,7 @@ set_error: } sorwakeup(stcb->sctp_socket); sowwakeup(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -3134,7 +3134,7 @@ sctp_notify_partial_delivery_indication( } if (stcb->sctp_ep && stcb->sctp_socket) { /* This should always be the case */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -3151,7 +3151,7 @@ sctp_notify_partial_delivery_indication( } #endif sctp_sorwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -3173,7 +3173,7 @@ sctp_notify_shutdown_event(struct sctp_t if ((stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (stcb->sctp_ep->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { /* mark socket closed for read/write and wakeup! */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -3188,7 +3188,7 @@ sctp_notify_shutdown_event(struct sctp_t } #endif socantsendmore(stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3832,7 +3832,7 @@ sctp_abort_association(struct sctp_inpcb { uint32_t vtag; -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -3851,7 +3851,7 @@ sctp_abort_association(struct sctp_inpcb vrf_id, port); if (stcb != NULL) { /* Ok, now lets free it */ -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -3865,7 +3865,7 @@ sctp_abort_association(struct sctp_inpcb SCTP_STAT_DECR_GAUGE32(sctps_currestab); } (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_4); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -3944,12 +3944,12 @@ sctp_abort_an_association(struct sctp_in #endif ) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); #endif if (stcb == NULL) { @@ -3979,7 +3979,7 @@ sctp_abort_an_association(struct sctp_in #ifdef SCTP_ASOCLOG_OF_TSNS sctp_print_out_track_log(stcb); #endif -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -3989,7 +3989,7 @@ sctp_abort_an_association(struct sctp_in } #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTPUTIL + SCTP_LOC_5); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -4477,7 +4477,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); } else { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(inp); @@ -4498,7 +4498,7 @@ sctp_add_to_readq(struct sctp_inpcb *inp } #endif sctp_sorwakeup(inp, inp->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } @@ -4631,7 +4631,7 @@ get_out: if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_ZERO_COPY_ACTIVE)) { SCTP_ZERO_COPY_EVENT(inp, inp->sctp_socket); } else { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(inp); @@ -4650,7 +4650,7 @@ get_out: } #endif sctp_sorwakeup(inp, inp->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); #endif } @@ -4907,7 +4907,7 @@ sctp_release_pr_sctp_chunk(struct sctp_t SCTP_TCB_SEND_UNLOCK(stcb); } if (do_wakeup_routine) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; so = SCTP_INP_SO(stcb->sctp_ep); @@ -4925,7 +4925,7 @@ sctp_release_pr_sctp_chunk(struct sctp_t } #endif sctp_sowwakeup(stcb->sctp_ep, stcb->sctp_socket); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) if (!so_locked) { SCTP_SOCKET_UNLOCK(so, 1); } Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:11:38 2013 (r252881) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:17:54 2013 (r252882) @@ -396,7 +396,7 @@ sctp6_notify(struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net) { -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) struct socket *so; #endif @@ -451,7 +451,7 @@ sctp6_notify(struct sctp_inpcb *inp, * with no TCB */ sctp_abort_notification(stcb, 1, 0, NULL, SCTP_SO_NOT_LOCKED); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) so = SCTP_INP_SO(inp); atomic_add_int(&stcb->asoc.refcnt, 1); SCTP_TCB_UNLOCK(stcb); @@ -460,7 +460,7 @@ sctp6_notify(struct sctp_inpcb *inp, atomic_subtract_int(&stcb->asoc.refcnt, 1); #endif (void)sctp_free_assoc(inp, stcb, SCTP_NORMAL_PROC, SCTP_FROM_SCTP_USRREQ + SCTP_LOC_2); -#if defined (__APPLE__) || defined(SCTP_SO_LOCK_TESTING) +#if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_SOCKET_UNLOCK(so, 1); /* SCTP_TCB_UNLOCK(stcb); MT: I think this is not needed. */ #endif From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 09:23:05 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5E39DC6B; Sat, 6 Jul 2013 09:23:05 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4FD151F29; Sat, 6 Jul 2013 09:23:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r669N5o9001752; Sat, 6 Jul 2013 09:23:05 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r669N5Il001750; Sat, 6 Jul 2013 09:23:05 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307060923.r669N5Il001750@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 09:23: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: r252883 - in stable/9/sys: netinet 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.14 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, 06 Jul 2013 09:23:05 -0000 Author: tuexen Date: Sat Jul 6 09:23:04 2013 New Revision: 252883 URL: http://svnweb.freebsd.org/changeset/base/252883 Log: MFC r237569: Unify sctp_input() and sctp6_input(). Modified: stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:17:54 2013 (r252882) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 09:23:04 2013 (r252883) @@ -5883,12 +5883,12 @@ sctp_input_with_port(struct mbuf *i_pak, uint8_t ecn_bits; struct ip *ip; struct sctphdr *sh; + struct sctp_chunkhdr *ch; struct sctp_inpcb *inp = NULL; - struct sctp_nets *net; struct sctp_tcb *stcb = NULL; - struct sctp_chunkhdr *ch; + struct sctp_nets *net = NULL; int refcount_up = 0; - int length, mlen, offset; + int length, offset; uint32_t mflowid; uint8_t use_mflowid; @@ -5897,19 +5897,12 @@ sctp_input_with_port(struct mbuf *i_pak, #endif + iphlen = off; if (SCTP_GET_PKT_VRFID(i_pak, vrf_id)) { SCTP_RELEASE_PKT(i_pak); return; } - mlen = SCTP_HEADER_LEN(i_pak); - iphlen = off; m = SCTP_HEADER_TO_CHAIN(i_pak); - - net = NULL; - SCTP_STAT_INCR(sctps_recvpackets); - SCTP_STAT_INCR_COUNTER64(sctps_inpackets); - - #ifdef SCTP_MBUF_LOGGING /* Log in any input mbufs */ if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { @@ -5923,8 +5916,9 @@ sctp_input_with_port(struct mbuf *i_pak, } #endif #ifdef SCTP_PACKET_LOGGING - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { sctp_packet_log(m); + } #endif if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; @@ -5933,17 +5927,11 @@ sctp_input_with_port(struct mbuf *i_pak, mflowid = 0; use_mflowid = 0; } - /* - * Must take out the iphlen, since mlen expects this (only effect lb - * case) - */ - mlen -= iphlen; - - /* - * Get IP, SCTP, and first chunk header together in first mbuf. - */ + SCTP_STAT_INCR(sctps_recvpackets); + SCTP_STAT_INCR_COUNTER64(sctps_inpackets); + /* Get IP, SCTP, and first chunk header together in the first mbuf. */ ip = mtod(m, struct ip *); - offset = iphlen + sizeof(*sh) + sizeof(*ch); + offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); if (SCTP_BUF_LEN(m) < offset) { if ((m = m_pullup(m, offset)) == 0) { SCTP_STAT_INCR(sctps_hdrops); @@ -5951,28 +5939,26 @@ sctp_input_with_port(struct mbuf *i_pak, } ip = mtod(m, struct ip *); } - /* validate mbuf chain length with IP payload length */ - if (mlen < (SCTP_GET_IPV4_LENGTH(ip) - iphlen)) { + sh = (struct sctphdr *)((caddr_t)ip + iphlen); + ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(struct sctphdr)); + offset -= sizeof(struct sctp_chunkhdr); + length = ip->ip_len + iphlen; + /* Validate mbuf chain length with IP payload length. */ + if (SCTP_HEADER_LEN(i_pak) != length) { + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(i_pak)); SCTP_STAT_INCR(sctps_hdrops); goto bad; } - sh = (struct sctphdr *)((caddr_t)ip + iphlen); - ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(*sh)); - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp_input() length:%d iphlen:%d\n", mlen, iphlen); - /* SCTP does not allow broadcasts or multicasts */ if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { goto bad; } if (SCTP_IS_IT_BROADCAST(ip->ip_dst, m)) { - /* - * We only look at broadcast if its a front state, All - * others we will not have a tcb for anyway. - */ goto bad; } - /* validate SCTP checksum */ + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp_input() length:%d iphlen:%d\n", length, iphlen); SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", m->m_pkthdr.len, @@ -5983,21 +5969,18 @@ sctp_input_with_port(struct mbuf *i_pak, #else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); - goto sctp_skip_csum_4; + goto sctp_skip_csum; } - check = sh->checksum; /* save incoming checksum */ - sh->checksum = 0; /* prepare for calc */ + check = sh->checksum; + sh->checksum = 0; calc_check = sctp_calculate_cksum(m, iphlen); sh->checksum = check; SCTP_STAT_INCR(sctps_recvswcrc); if (calc_check != check) { SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", - calc_check, check, m, mlen, iphlen); - - stcb = sctp_findassociation_addr(m, - offset - sizeof(*ch), - sh, ch, &inp, &net, - vrf_id); + calc_check, check, m, length, iphlen); + stcb = sctp_findassociation_addr(m, offset, + sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); @@ -6011,7 +5994,7 @@ sctp_input_with_port(struct mbuf *i_pak, #endif } if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, mlen + iphlen, iphlen, 1); + sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); } else if ((inp != NULL) && (stcb == NULL)) { refcount_up = 1; @@ -6020,18 +6003,14 @@ sctp_input_with_port(struct mbuf *i_pak, SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); goto bad; } -sctp_skip_csum_4: +sctp_skip_csum: #endif /* destination port of 0 is illegal, based on RFC2960. */ if (sh->dest_port == 0) { SCTP_STAT_INCR(sctps_hdrops); goto bad; } - /* - * Locate pcb and tcb for datagram sctp_findassociation_addr() wants - * IP/SCTP/first chunk header... - */ - stcb = sctp_findassociation_addr(m, offset - sizeof(*ch), + stcb = sctp_findassociation_addr(m, offset, sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { @@ -6045,27 +6024,10 @@ sctp_skip_csum_4: net->flowidset = 1; #endif } - /* inp's ref-count increased && stcb locked */ if (inp == NULL) { - struct sctp_init_chunk *init_chk, chunk_buf; - SCTP_STAT_INCR(sctps_noport); if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) goto bad; - SCTPDBG(SCTP_DEBUG_INPUT1, - "Sending a ABORT from packet entry!\n"); - if (ch->chunk_type == SCTP_INITIATION) { - /* - * we do a trick here to get the INIT tag, dig in - * and get the tag from the INIT and put it in the - * common header. - */ - init_chk = (struct sctp_init_chunk *)sctp_m_getptr(m, - iphlen + sizeof(*sh), sizeof(*init_chk), - (uint8_t *) & chunk_buf); - if (init_chk != NULL) - sh->v_tag = init_chk->init.initiate_tag; - } if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { sctp_send_shutdown_complete2(m, sh, use_mflowid, mflowid, @@ -6089,7 +6051,7 @@ sctp_skip_csum_4: refcount_up = 1; } #ifdef IPSEC - /* + /*- * I very much doubt any of the IPSEC stuff will work but I have no * idea, so I will leave it in place. */ @@ -6098,28 +6060,22 @@ sctp_skip_csum_4: SCTP_STAT_INCR(sctps_hdrops); goto bad; } -#endif /* IPSEC */ - - /* - * common chunk processing - */ - length = ip->ip_len + iphlen; - offset -= sizeof(struct sctp_chunkhdr); +#endif ecn_bits = ip->ip_tos; - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, inp, stcb, net, ecn_bits, use_mflowid, mflowid, vrf_id, port); - /* inp's ref-count reduced && stcb unlocked */ if (m) { sctp_m_freem(m); } if ((inp) && (refcount_up)) { /* reduce ref-count */ + SCTP_INP_WLOCK(inp); SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } return; bad: @@ -6128,7 +6084,9 @@ bad: } if ((inp) && (refcount_up)) { /* reduce ref-count */ + SCTP_INP_WLOCK(inp); SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } if (m) { sctp_m_freem(m); Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:17:54 2013 (r252882) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 09:23:04 2013 (r252883) @@ -69,22 +69,17 @@ int sctp6_input(struct mbuf **i_pak, int *offp, int proto) { struct mbuf *m; + int iphlen; + uint32_t vrf_id = 0; + uint8_t ecn_bits; struct ip6_hdr *ip6; struct sctphdr *sh; - struct sctp_inpcb *in6p = NULL; - struct sctp_nets *net; - int refcount_up = 0; - uint32_t vrf_id = 0; - -#ifdef IPSEC - struct inpcb *in6p_ip; - -#endif struct sctp_chunkhdr *ch; - int length, offset, iphlen; - uint8_t ecn_bits; + struct sctp_inpcb *inp = NULL; struct sctp_tcb *stcb = NULL; - int pkt_len = 0; + struct sctp_nets *net = NULL; + int refcount_up = 0; + int length, offset; uint32_t mflowid; uint8_t use_mflowid; @@ -92,17 +87,26 @@ sctp6_input(struct mbuf **i_pak, int *of uint32_t check, calc_check; #endif - int off = *offp; uint16_t port = 0; - /* get the VRF and table id's */ + iphlen = *offp; if (SCTP_GET_PKT_VRFID(*i_pak, vrf_id)) { SCTP_RELEASE_PKT(*i_pak); - return (-1); + return (IPPROTO_DONE); } m = SCTP_HEADER_TO_CHAIN(*i_pak); - pkt_len = SCTP_HEADER_LEN(*i_pak); - +#ifdef SCTP_MBUF_LOGGING + /* Log in any input mbufs */ + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_MBUF_LOGGING_ENABLE) { + struct mbuf *mat; + + for (mat = m; mat; mat = SCTP_BUF_NEXT(mat)) { + if (SCTP_BUF_IS_EXTENDED(mat)) { + sctp_log_mb(mat, SCTP_MBUF_INPUT); + } + } + } +#endif #ifdef SCTP_PACKET_LOGGING if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LAST_PACKET_TRACING) { sctp_packet_log(m); @@ -115,42 +119,38 @@ sctp6_input(struct mbuf **i_pak, int *of mflowid = 0; use_mflowid = 0; } + SCTP_STAT_INCR(sctps_recvpackets); + SCTP_STAT_INCR_COUNTER64(sctps_inpackets); + /* Get IP, SCTP, and first chunk header together in the first mbuf. */ ip6 = mtod(m, struct ip6_hdr *); - /* Ensure that (sctphdr + sctp_chunkhdr) in a row. */ - IP6_EXTHDR_GET(sh, struct sctphdr *, m, off, - (int)(sizeof(*sh) + sizeof(*ch))); + offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); + IP6_EXTHDR_GET(sh, struct sctphdr *, m, iphlen, + (int)(sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr))); if (sh == NULL) { SCTP_STAT_INCR(sctps_hdrops); return (IPPROTO_DONE); } ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(struct sctphdr)); - iphlen = off; - offset = iphlen + sizeof(*sh) + sizeof(*ch); - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp6_input() length:%d iphlen:%d\n", pkt_len, iphlen); - - -#if defined(NFAITH) && NFAITH > 0 - + offset -= sizeof(struct sctp_chunkhdr); if (faithprefix_p != NULL && (*faithprefix_p) (&ip6->ip6_dst)) { /* XXX send icmp6 host/port unreach? */ goto bad; } -#endif /* NFAITH defined and > 0 */ - SCTP_STAT_INCR(sctps_recvpackets); - SCTP_STAT_INCR_COUNTER64(sctps_inpackets); - SCTPDBG(SCTP_DEBUG_INPUT1, "V6 input gets a packet iphlen:%d pktlen:%d\n", - iphlen, pkt_len); - if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { - /* No multi-cast support in SCTP */ + length = ntohs(ip6->ip6_plen) + iphlen; + /* Validate mbuf chain length with IP payload length. */ + if (SCTP_HEADER_LEN(*i_pak) != length) { + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp6_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(*i_pak)); + SCTP_STAT_INCR(sctps_hdrops); goto bad; } - /* destination port of 0 is illegal, based on RFC2960. */ - if (sh->dest_port == 0) + if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { goto bad; - + } + SCTPDBG(SCTP_DEBUG_INPUT1, + "sctp6_input() length:%d iphlen:%d\n", length, iphlen); SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, - "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", + "sctp6_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", m->m_pkthdr.len, if_name(m->m_pkthdr.rcvif), m->m_pkthdr.csum_flags); @@ -161,15 +161,16 @@ sctp6_input(struct mbuf **i_pak, int *of SCTP_STAT_INCR(sctps_recvhwcrc); goto sctp_skip_csum; } - check = sh->checksum; /* save incoming checksum */ - sh->checksum = 0; /* prepare for calc */ + check = sh->checksum; + sh->checksum = 0; calc_check = sctp_calculate_cksum(m, iphlen); + sh->checksum = check; SCTP_STAT_INCR(sctps_recvswcrc); if (calc_check != check) { - SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p phlen:%d\n", - calc_check, check, m, iphlen); - stcb = sctp_findassociation_addr(m, offset - sizeof(*ch), - sh, ch, &in6p, &net, vrf_id); + SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", + calc_check, check, m, length, iphlen); + stcb = sctp_findassociation_addr(m, offset, + sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); @@ -182,28 +183,25 @@ sctp6_input(struct mbuf **i_pak, int *of net->flowidset = 1; #endif } - /* in6p's ref-count increased && stcb locked */ - if ((in6p) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, pkt_len, iphlen, 1); - sctp_chunk_output((struct sctp_inpcb *)in6p, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); - } else if ((in6p != NULL) && (stcb == NULL)) { + if ((inp) && (stcb)) { + sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); + } else if ((inp != NULL) && (stcb == NULL)) { refcount_up = 1; } SCTP_STAT_INCR(sctps_badsum); SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); goto bad; } - sh->checksum = calc_check; - sctp_skip_csum: #endif - net = NULL; - /* - * Locate pcb and tcb for datagram sctp_findassociation_addr() wants - * IP/SCTP/first chunk header... - */ - stcb = sctp_findassociation_addr(m, offset - sizeof(*ch), - sh, ch, &in6p, &net, vrf_id); + /* destination port of 0 is illegal, based on RFC2960. */ + if (sh->dest_port == 0) { + SCTP_STAT_INCR(sctps_hdrops); + goto bad; + } + stcb = sctp_findassociation_addr(m, offset, + sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); @@ -216,25 +214,10 @@ sctp_skip_csum: net->flowidset = 1; #endif } - /* in6p's ref-count increased */ - if (in6p == NULL) { - struct sctp_init_chunk *init_chk, chunk_buf; - + if (inp == NULL) { SCTP_STAT_INCR(sctps_noport); - if (ch->chunk_type == SCTP_INITIATION) { - /* - * we do a trick here to get the INIT tag, dig in - * and get the tag from the INIT and put it in the - * common header. - */ - init_chk = (struct sctp_init_chunk *)sctp_m_getptr(m, - iphlen + sizeof(*sh), sizeof(*init_chk), - (uint8_t *) & chunk_buf); - if (init_chk) - sh->v_tag = init_chk->init.initiate_tag; - else - sh->v_tag = 0; - } + if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) + goto bad; if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { sctp_send_shutdown_complete2(m, sh, use_mflowid, mflowid, @@ -258,55 +241,46 @@ sctp_skip_csum: refcount_up = 1; } #ifdef IPSEC - /* - * Check AH/ESP integrity. + /*- + * I very much doubt any of the IPSEC stuff will work but I have no + * idea, so I will leave it in place. */ - in6p_ip = (struct inpcb *)in6p; - if (in6p_ip && (ipsec6_in_reject(m, in6p_ip))) { -/* XXX */ + if (inp && ipsec6_in_reject(m, &inp->ip_inp.inp)) { MODULE_GLOBAL(ipsec6stat).in_polvio++; + SCTP_STAT_INCR(sctps_hdrops); goto bad; } -#endif /* IPSEC */ +#endif - /* - * CONTROL chunk processing - */ - offset -= sizeof(*ch); ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); - - /* Length now holds the total packet length payload + iphlen */ - length = ntohs(ip6->ip6_plen) + iphlen; - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, - in6p, stcb, net, ecn_bits, + inp, stcb, net, ecn_bits, use_mflowid, mflowid, vrf_id, port); - /* inp's ref-count reduced && stcb unlocked */ - /* XXX this stuff below gets moved to appropriate parts later... */ - if (m) + if (m) { sctp_m_freem(m); - if ((in6p) && refcount_up) { + } + if ((inp) && (refcount_up)) { /* reduce ref-count */ - SCTP_INP_WLOCK(in6p); - SCTP_INP_DECR_REF(in6p); - SCTP_INP_WUNLOCK(in6p); + SCTP_INP_WLOCK(inp); + SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } return (IPPROTO_DONE); - bad: if (stcb) { SCTP_TCB_UNLOCK(stcb); } - if ((in6p) && refcount_up) { + if ((inp) && (refcount_up)) { /* reduce ref-count */ - SCTP_INP_WLOCK(in6p); - SCTP_INP_DECR_REF(in6p); - SCTP_INP_WUNLOCK(in6p); + SCTP_INP_WLOCK(inp); + SCTP_INP_DECR_REF(inp); + SCTP_INP_WUNLOCK(inp); } - if (m) + if (m) { sctp_m_freem(m); + } return (IPPROTO_DONE); } From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 09:49:02 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7F24139E; Sat, 6 Jul 2013 09:49:02 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5587E1FEC; Sat, 6 Jul 2013 09:49:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r669n2K8008323; Sat, 6 Jul 2013 09:49:02 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r669n2mP008321; Sat, 6 Jul 2013 09:49:02 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307060949.r669n2mP008321@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 09:49: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: r252884 - in stable/9: share/man/man4 sys/dev/hptiop 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.14 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, 06 Jul 2013 09:49:02 -0000 Author: delphij Date: Sat Jul 6 09:49:01 2013 New Revision: 252884 URL: http://svnweb.freebsd.org/changeset/base/252884 Log: MFC r252851: Add PCI IDs for HighPoint RocketRAID 4521, 3620, 3622 and 3640 controllers. Update the hptiop(4) manual page to reflect this as well as mentioning that some cards are already end-of-life. Many thanks to Highpoint for providing this driver update. Modified: stable/9/share/man/man4/hptiop.4 stable/9/sys/dev/hptiop/hptiop.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/share/man/man4/hptiop.4 ============================================================================== --- stable/9/share/man/man4/hptiop.4 Sat Jul 6 09:23:04 2013 (r252883) +++ stable/9/share/man/man4/hptiop.4 Sat Jul 6 09:49:01 2013 (r252884) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 25, 2012 +.Dd July 5, 2013 .Dt HPTIOP 4 .Os .Sh NAME @@ -60,6 +60,8 @@ driver supports the following SAS and SA .It HighPoint RocketRAID 4522 .It +HighPoint RocketRAID 4521 +.It HighPoint RocketRAID 4520 .It HighPoint RocketRAID 4322 @@ -72,6 +74,20 @@ HighPoint RocketRAID 4311 .It HighPoint RocketRAID 4310 .It +HighPoint RocketRAID 3640 +.It +HighPoint RocketRAID 3622 +.It +HighPoint RocketRAID 3620 +.El +.Pp +The +.Nm +driver also supports the following SAS and SATA RAID controllers that +are already End-of-Life: +.Pp +.Bl -bullet -compact +.It HighPoint RocketRAID 4211 .It HighPoint RocketRAID 4210 Modified: stable/9/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/9/sys/dev/hptiop/hptiop.c Sat Jul 6 09:23:04 2013 (r252883) +++ stable/9/sys/dev/hptiop/hptiop.c Sat Jul 6 09:49:01 2013 (r252884) @@ -90,7 +90,7 @@ __FBSDID("$FreeBSD$"); #include static const char driver_name[] = "hptiop"; -static const char driver_version[] = "v1.8"; +static const char driver_version[] = "v1.9"; static devclass_t hptiop_devclass; @@ -1869,8 +1869,12 @@ static int hptiop_probe(device_t dev) switch (id) { case 0x4520: + case 0x4521: case 0x4522: sas = 1; + case 0x3620: + case 0x3622: + case 0x3640: ops = &hptiop_mvfrey_ops; break; case 0x4210: From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 11:39:37 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C1E67EB6; Sat, 6 Jul 2013 11:39:37 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B3FDB12FF; Sat, 6 Jul 2013 11:39:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66BdbJa041031; Sat, 6 Jul 2013 11:39:37 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66Bdbqc041030; Sat, 6 Jul 2013 11:39:37 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307061139.r66Bdbqc041030@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 6 Jul 2013 11:39: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: r252885 - stable/9/sys/fs/fdescfs 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.14 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, 06 Jul 2013 11:39:37 -0000 Author: jilles Date: Sat Jul 6 11:39:37 2013 New Revision: 252885 URL: http://svnweb.freebsd.org/changeset/base/252885 Log: MFC r250567: fdescfs: Supply a real value for d_type in readdir. All the fdescfs nodes (except . and ..) appear as character devices to stat(), so DT_CHR is correct. Modified: stable/9/sys/fs/fdescfs/fdesc_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- stable/9/sys/fs/fdescfs/fdesc_vnops.c Sat Jul 6 09:49:01 2013 (r252884) +++ stable/9/sys/fs/fdescfs/fdesc_vnops.c Sat Jul 6 11:39:37 2013 (r252885) @@ -538,7 +538,7 @@ fdesc_readdir(ap) break; dp->d_namlen = sprintf(dp->d_name, "%d", fcnt); dp->d_reclen = UIO_MX; - dp->d_type = DT_UNKNOWN; + dp->d_type = DT_CHR; dp->d_fileno = i + FD_DESC; break; } From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 12:56:31 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 08E50D99; Sat, 6 Jul 2013 12:56:31 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ED5F91711; Sat, 6 Jul 2013 12:56:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66CuUN3064077; Sat, 6 Jul 2013 12:56:30 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66CuUJN064076; Sat, 6 Jul 2013 12:56:30 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201307061256.r66CuUJN064076@svn.freebsd.org> From: Mateusz Guzik Date: Sat, 6 Jul 2013 12:56:30 +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: r252886 - 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.14 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, 06 Jul 2013 12:56:31 -0000 Author: mjg Date: Sat Jul 6 12:56:30 2013 New Revision: 252886 URL: http://svnweb.freebsd.org/changeset/base/252886 Log: MFC r252415, r252422: acct: reduce code duplication by using acct_disable as cleanup for failed kproc_create acct: create a special plimit object and set it for exiting processe instead of allocating new one each time All limits are set to RLIM_INFINITY which sould be ok (even though we care only about RLIMT_FSIZE in this case). Modified: stable/9/sys/kern/kern_acct.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_acct.c ============================================================================== --- stable/9/sys/kern/kern_acct.c Sat Jul 6 11:39:37 2013 (r252885) +++ stable/9/sys/kern/kern_acct.c Sat Jul 6 12:56:30 2013 (r252886) @@ -133,6 +133,7 @@ static int acct_configured; static int acct_suspended; static struct vnode *acct_vp; static struct ucred *acct_cred; +static struct plimit *acct_limit; static int acct_flags; static struct sx acct_sx; @@ -196,7 +197,7 @@ int sys_acct(struct thread *td, struct acct_args *uap) { struct nameidata nd; - int error, flags, vfslocked, replacing; + int error, flags, i, vfslocked, replacing; error = priv_check(td, PRIV_ACCT); if (error) @@ -274,6 +275,15 @@ sys_acct(struct thread *td, struct acct_ } /* + * Create our own plimit object without limits. It will be assigned + * to exiting processes. + */ + acct_limit = lim_alloc(); + for (i = 0; i < RLIM_NLIMITS; i++) + acct_limit->pl_rlimit[i].rlim_cur = + acct_limit->pl_rlimit[i].rlim_max = RLIM_INFINITY; + + /* * Save the new accounting file vnode, and schedule the new * free space watcher. */ @@ -292,13 +302,8 @@ sys_acct(struct thread *td, struct acct_ "accounting"); if (error) { vfslocked = VFS_LOCK_GIANT(acct_vp->v_mount); - (void) vn_close(acct_vp, acct_flags, acct_cred, td); + (void) acct_disable(td, 0); VFS_UNLOCK_GIANT(vfslocked); - crfree(acct_cred); - acct_configured = 0; - acct_vp = NULL; - acct_cred = NULL; - acct_flags = 0; sx_xunlock(&acct_sx); log(LOG_NOTICE, "Unable to start accounting thread\n"); return (error); @@ -323,6 +328,7 @@ acct_disable(struct thread *td, int logg sx_assert(&acct_sx, SX_XLOCKED); error = vn_close(acct_vp, acct_flags, acct_cred, td); crfree(acct_cred); + lim_free(acct_limit); acct_configured = 0; acct_vp = NULL; acct_cred = NULL; @@ -343,7 +349,7 @@ acct_process(struct thread *td) { struct acctv2 acct; struct timeval ut, st, tmp; - struct plimit *newlim, *oldlim; + struct plimit *oldlim; struct proc *p; struct rusage ru; int t, ret, vfslocked; @@ -419,7 +425,6 @@ acct_process(struct thread *td) /* (8) The boolean flags that tell how the process terminated, etc. */ acct.ac_flagx = p->p_acflag; - PROC_UNLOCK(p); /* Setup ancillary structure fields. */ acct.ac_flagx |= ANVER; @@ -428,14 +433,10 @@ acct_process(struct thread *td) acct.ac_len = acct.ac_len2 = sizeof(acct); /* - * Eliminate any file size rlimit. + * Eliminate rlimits (file size limit in particular). */ - newlim = lim_alloc(); - PROC_LOCK(p); oldlim = p->p_limit; - lim_copy(newlim, oldlim); - newlim->pl_rlimit[RLIMIT_FSIZE].rlim_cur = RLIM_INFINITY; - p->p_limit = newlim; + p->p_limit = lim_hold(acct_limit); PROC_UNLOCK(p); lim_free(oldlim); From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 14:21:22 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 99076B81; Sat, 6 Jul 2013 14:21:22 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A6741942; Sat, 6 Jul 2013 14:21:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66ELMxs090109; Sat, 6 Jul 2013 14:21:22 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66ELMAw090108; Sat, 6 Jul 2013 14:21:22 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201307061421.r66ELMAw090108@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 6 Jul 2013 14:21: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: r252887 - 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.14 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, 06 Jul 2013 14:21:22 -0000 Author: jilles Date: Sat Jul 6 14:21:22 2013 New Revision: 252887 URL: http://svnweb.freebsd.org/changeset/base/252887 Log: MFC r250102: socket: Make shutdown() wake up a blocked accept(). A blocking accept (and some other operations) waits on &so->so_timeo. Once it wakes up, it will detect the SBS_CANTRCVMORE bit. The error from accept() is [ECONNABORTED] which is not the nicest one -- the thread calling accept() needs to know out-of-band what is happening. A spurious wakeup on so->so_timeo appears harmless (sleep retried) except when lingering on close (SO_LINGER, and in that case there is no descriptor to call shutdown() on) so this should be fairly safe. A shutdown() already woke up a blocked accept() for TCP sockets, but not for Unix domain sockets. This fix is generic for all domains. This patch was sent to -hackers@ and -net@ on April 5. Modified: stable/9/sys/kern/uipc_socket.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/uipc_socket.c ============================================================================== --- stable/9/sys/kern/uipc_socket.c Sat Jul 6 12:56:30 2013 (r252886) +++ stable/9/sys/kern/uipc_socket.c Sat Jul 6 14:21:22 2013 (r252887) @@ -2339,9 +2339,11 @@ soshutdown(struct socket *so, int how) sorflush(so); if (how != SHUT_RD) { error = (*pr->pr_usrreqs->pru_shutdown)(so); + wakeup(&so->so_timeo); CURVNET_RESTORE(); return (error); } + wakeup(&so->so_timeo); CURVNET_RESTORE(); return (0); } From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 17:11:35 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7A7E638B; Sat, 6 Jul 2013 17:11:35 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6C1A71D49; Sat, 6 Jul 2013 17:11:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66HBZx6040034; Sat, 6 Jul 2013 17:11:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66HBYhl040024; Sat, 6 Jul 2013 17:11:34 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307061711.r66HBYhl040024@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 17:11:34 +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: r252889 - in stable/9/sys: netinet 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.14 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, 06 Jul 2013 17:11:35 -0000 Author: tuexen Date: Sat Jul 6 17:11:33 2013 New Revision: 252889 URL: http://svnweb.freebsd.org/changeset/base/252889 Log: MFC rr237715, r238294: Pass the src and dst address of a received packet explicitly around. Modified: stable/9/sys/netinet/sctp_asconf.c stable/9/sys/netinet/sctp_asconf.h stable/9/sys/netinet/sctp_indata.c stable/9/sys/netinet/sctp_indata.h stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_input.h stable/9/sys/netinet/sctp_os_bsd.h stable/9/sys/netinet/sctp_output.c stable/9/sys/netinet/sctp_output.h stable/9/sys/netinet/sctp_pcb.c stable/9/sys/netinet/sctp_pcb.h stable/9/sys/netinet/sctp_usrreq.c stable/9/sys/netinet/sctputil.c stable/9/sys/netinet/sctputil.h stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_asconf.c ============================================================================== --- stable/9/sys/netinet/sctp_asconf.c Sat Jul 6 16:51:30 2013 (r252888) +++ stable/9/sys/netinet/sctp_asconf.c Sat Jul 6 17:11:33 2013 (r252889) @@ -50,59 +50,8 @@ __FBSDID("$FreeBSD$"); */ -static void -sctp_asconf_get_source_ip(struct mbuf *m, struct sockaddr *sa) -{ - struct ip *iph; - -#ifdef INET - struct sockaddr_in *sin; - -#endif -#ifdef INET6 - struct sockaddr_in6 *sin6; - -#endif - - iph = mtod(m, struct ip *); - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - { - /* IPv4 source */ - sin = (struct sockaddr_in *)sa; - bzero(sin, sizeof(*sin)); - sin->sin_family = AF_INET; - sin->sin_len = sizeof(struct sockaddr_in); - sin->sin_port = 0; - sin->sin_addr.s_addr = iph->ip_src.s_addr; - break; - } -#endif -#ifdef INET6 - case (IPV6_VERSION >> 4): - { - /* IPv6 source */ - struct ip6_hdr *ip6; - - sin6 = (struct sockaddr_in6 *)sa; - bzero(sin6, sizeof(*sin6)); - sin6->sin6_family = AF_INET6; - sin6->sin6_len = sizeof(struct sockaddr_in6); - sin6->sin6_port = 0; - ip6 = mtod(m, struct ip6_hdr *); - sin6->sin6_addr = ip6->ip6_src; - break; - } -#endif /* INET6 */ - default: - break; - } - return; -} - /* - * draft-ietf-tsvwg-addip-sctp + * RFC 5061 * * An ASCONF parameter queue exists per asoc which holds the pending address * operations. Lists are updated upon receipt of ASCONF-ACK. @@ -194,12 +143,12 @@ sctp_asconf_error_response(uint32_t id, } static struct mbuf * -sctp_process_asconf_add_ip(struct mbuf *m, struct sctp_asconf_paramhdr *aph, +sctp_process_asconf_add_ip(struct sockaddr *src, struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int send_hb, int response_required) { struct sctp_nets *net; struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_source, sa_store; + struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; @@ -279,11 +228,10 @@ sctp_process_asconf_add_ip(struct mbuf * /* if 0.0.0.0/::0, add the source address instead */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { - sa = (struct sockaddr *)&sa_source; - sctp_asconf_get_source_ip(m, sa); + sa = src; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_add_ip: using source addr "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); + SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); } /* add the address */ if (bad_address) { @@ -343,11 +291,12 @@ sctp_asconf_del_remote_addrs_except(stru } static struct mbuf * -sctp_process_asconf_delete_ip(struct mbuf *m, struct sctp_asconf_paramhdr *aph, +sctp_process_asconf_delete_ip(struct sockaddr *src, + struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int response_required) { struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_source, sa_store; + struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; @@ -365,9 +314,6 @@ sctp_process_asconf_delete_ip(struct mbu #endif - /* get the source IP address for src and 0.0.0.0/::0 delete checks */ - sctp_asconf_get_source_ip(m, (struct sockaddr *)&sa_source); - aparam_length = ntohs(aph->ph.param_length); ph = (struct sctp_paramhdr *)(aph + 1); param_type = ntohs(ph->param_type); @@ -424,7 +370,7 @@ sctp_process_asconf_delete_ip(struct mbu } /* make sure the source address is not being deleted */ - if (sctp_cmpaddr(sa, (struct sockaddr *)&sa_source)) { + if (sctp_cmpaddr(sa, src)) { /* trying to delete the source address! */ SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_delete_ip: tried to delete source addr\n"); m_reply = sctp_asconf_error_response(aph->correlation_id, @@ -434,8 +380,7 @@ sctp_process_asconf_delete_ip(struct mbu } /* if deleting 0.0.0.0/::0, delete all addresses except src addr */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { - result = sctp_asconf_del_remote_addrs_except(stcb, - (struct sockaddr *)&sa_source); + result = sctp_asconf_del_remote_addrs_except(stcb, src); if (result) { /* src address did not exist? */ @@ -475,12 +420,12 @@ sctp_process_asconf_delete_ip(struct mbu } static struct mbuf * -sctp_process_asconf_set_primary(struct mbuf *m, +sctp_process_asconf_set_primary(struct sockaddr *src, struct sctp_asconf_paramhdr *aph, struct sctp_tcb *stcb, int response_required) { struct mbuf *m_reply = NULL; - struct sockaddr_storage sa_source, sa_store; + struct sockaddr_storage sa_store; struct sctp_paramhdr *ph; uint16_t param_type, param_length, aparam_length; struct sockaddr *sa; @@ -550,11 +495,10 @@ sctp_process_asconf_set_primary(struct m /* if 0.0.0.0/::0, use the source address instead */ if (zero_address && SCTP_BASE_SYSCTL(sctp_nat_friendly)) { - sa = (struct sockaddr *)&sa_source; - sctp_asconf_get_source_ip(m, sa); + sa = src; SCTPDBG(SCTP_DEBUG_ASCONF1, "process_asconf_set_primary: using source addr "); - SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, sa); + SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); } /* set the primary address */ if (sctp_set_primary_addr(stcb, sa, NULL) == 0) { @@ -626,6 +570,7 @@ sctp_process_asconf_set_primary(struct m */ void sctp_handle_asconf(struct mbuf *m, unsigned int offset, + struct sockaddr *src, struct sctp_asconf_chunk *cp, struct sctp_tcb *stcb, int first) { @@ -762,13 +707,13 @@ sctp_handle_asconf(struct mbuf *m, unsig switch (param_type) { case SCTP_ADD_IP_ADDRESS: asoc->peer_supports_asconf = 1; - m_result = sctp_process_asconf_add_ip(m, aph, stcb, + m_result = sctp_process_asconf_add_ip(src, aph, stcb, (cnt < SCTP_BASE_SYSCTL(sctp_hb_maxburst)), error); cnt++; break; case SCTP_DEL_IP_ADDRESS: asoc->peer_supports_asconf = 1; - m_result = sctp_process_asconf_delete_ip(m, aph, stcb, + m_result = sctp_process_asconf_delete_ip(src, aph, stcb, error); break; case SCTP_ERROR_CAUSE_IND: @@ -776,7 +721,7 @@ sctp_handle_asconf(struct mbuf *m, unsig break; case SCTP_SET_PRIM_ADDR: asoc->peer_supports_asconf = 1; - m_result = sctp_process_asconf_set_primary(m, aph, + m_result = sctp_process_asconf_set_primary(src, aph, stcb, error); break; case SCTP_NAT_VTAGS: @@ -856,11 +801,7 @@ send_reply: * this could happen if the source address was just newly * added */ - struct sockaddr_storage addr; - struct sockaddr *src = (struct sockaddr *)&addr; - SCTPDBG(SCTP_DEBUG_ASCONF1, "handle_asconf: looking up net for IP source address\n"); - sctp_asconf_get_source_ip(m, src); SCTPDBG(SCTP_DEBUG_ASCONF1, "Looking for IP source: "); SCTPDBG_ADDR(SCTP_DEBUG_ASCONF1, src); /* look up the from address */ Modified: stable/9/sys/netinet/sctp_asconf.h ============================================================================== --- stable/9/sys/netinet/sctp_asconf.h Sat Jul 6 16:51:30 2013 (r252888) +++ stable/9/sys/netinet/sctp_asconf.h Sat Jul 6 17:11:33 2013 (r252889) @@ -46,8 +46,8 @@ extern void sctp_asconf_cleanup(struct s extern struct mbuf *sctp_compose_asconf(struct sctp_tcb *, int *, int); extern void -sctp_handle_asconf(struct mbuf *, unsigned int, struct sctp_asconf_chunk *, - struct sctp_tcb *, int i); +sctp_handle_asconf(struct mbuf *, unsigned int, struct sockaddr *, + struct sctp_asconf_chunk *, struct sctp_tcb *, int); extern void sctp_handle_asconf_ack(struct mbuf *, int, struct sctp_asconf_ack_chunk *, Modified: stable/9/sys/netinet/sctp_indata.c ============================================================================== --- stable/9/sys/netinet/sctp_indata.c Sat Jul 6 16:51:30 2013 (r252888) +++ stable/9/sys/netinet/sctp_indata.c Sat Jul 6 17:11:33 2013 (r252889) @@ -2516,6 +2516,7 @@ doit_again: int sctp_process_data(struct mbuf **mm, int iphlen, int *offset, int length, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t * high_tsn, uint8_t use_mflowid, uint32_t mflowid, @@ -2626,8 +2627,8 @@ sctp_process_data(struct mbuf **mm, int } stcb->sctp_ep->last_abort_code = SCTP_FROM_SCTP_INDATA + SCTP_LOC_19; - sctp_abort_association(inp, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); return (2); @@ -2695,6 +2696,7 @@ sctp_process_data(struct mbuf **mm, int op_err = sctp_generate_invmanparam(SCTP_CAUSE_PROTOCOL_VIOLATION); sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); Modified: stable/9/sys/netinet/sctp_indata.h ============================================================================== --- stable/9/sys/netinet/sctp_indata.h Sat Jul 6 16:51:30 2013 (r252888) +++ stable/9/sys/netinet/sctp_indata.h Sat Jul 6 17:11:33 2013 (r252889) @@ -111,7 +111,9 @@ void sctp_update_acked(struct sctp_tcb *, struct sctp_shutdown_chunk *, int *); int -sctp_process_data(struct mbuf **, int, int *, int, struct sctphdr *, +sctp_process_data(struct mbuf **, int, int *, int, + struct sockaddr *src, struct sockaddr *dst, + struct sctphdr *, struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, uint32_t *, uint8_t, uint32_t, Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 16:51:30 2013 (r252888) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 17:11:33 2013 (r252889) @@ -80,7 +80,8 @@ sctp_stop_all_cookie_timers(struct sctp_ /* INIT handler */ static void -sctp_handle_init(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, +sctp_handle_init(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_chunk *cp, struct sctp_inpcb *inp, struct sctp_tcb *stcb, int *abort_no_unlock, uint8_t use_mflowid, uint32_t mflowid, @@ -97,7 +98,7 @@ sctp_handle_init(struct mbuf *m, int iph /* validate length */ if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_chunk)) { op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -109,7 +110,7 @@ sctp_handle_init(struct mbuf *m, int iph if (init->initiate_tag == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -119,7 +120,7 @@ sctp_handle_init(struct mbuf *m, int iph if (ntohl(init->a_rwnd) < SCTP_MIN_RWND) { /* invalid parameter... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -129,7 +130,7 @@ sctp_handle_init(struct mbuf *m, int iph if (init->num_inbound_streams == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -139,7 +140,7 @@ sctp_handle_init(struct mbuf *m, int iph if (init->num_outbound_streams == 0) { /* protocol error... send abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(inp, stcb, m, iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -149,7 +150,7 @@ sctp_handle_init(struct mbuf *m, int iph if (sctp_validate_init_auth_params(m, offset + sizeof(*cp), offset + ntohs(cp->ch.chunk_length))) { /* auth parameter(s) error... send abort */ - sctp_abort_association(inp, stcb, m, iphlen, sh, NULL, + sctp_abort_association(inp, stcb, m, iphlen, src, dst, sh, NULL, use_mflowid, mflowid, vrf_id, port); if (stcb) @@ -178,7 +179,7 @@ sctp_handle_init(struct mbuf *m, int iph * state :-) */ if (SCTP_BASE_SYSCTL(sctp_blackhole) == 0) { - sctp_send_abort(m, iphlen, sh, 0, NULL, + sctp_send_abort(m, iphlen, src, dst, sh, 0, NULL, use_mflowid, mflowid, vrf_id, port); } @@ -191,7 +192,8 @@ sctp_handle_init(struct mbuf *m, int iph sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_CONTROL_PROC, SCTP_SO_NOT_LOCKED); } else { SCTPDBG(SCTP_DEBUG_INPUT3, "sctp_handle_init: sending INIT-ACK\n"); - sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, sh, cp, + sctp_send_initiate_ack(inp, stcb, m, iphlen, offset, src, dst, + sh, cp, use_mflowid, mflowid, vrf_id, port, ((stcb == NULL) ? SCTP_HOLDS_LOCK : SCTP_NOT_LOCKED)); @@ -419,7 +421,8 @@ sctp_process_init(struct sctp_init_chunk * INIT-ACK message processing/consumption returns value < 0 on error */ static int -sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, +sctp_process_init_ack(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_no_unlock, uint8_t use_mflowid, uint32_t mflowid, @@ -454,13 +457,14 @@ sctp_process_init_ack(struct mbuf *m, in initack_limit = offset + ntohs(cp->ch.chunk_length); /* load all addresses */ if ((retval = sctp_load_addresses_from_init(stcb, m, - (offset + sizeof(struct sctp_init_chunk)), initack_limit, sh, - NULL))) { + (offset + sizeof(struct sctp_init_chunk)), initack_limit, + src, dst, NULL))) { /* Huh, we should abort */ SCTPDBG(SCTP_DEBUG_INPUT1, "Load addresses from INIT causes an abort %d\n", retval); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, NULL, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, NULL, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -536,7 +540,7 @@ sctp_process_init_ack(struct mbuf *m, in mp->resv = 0; } sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1278,7 +1282,8 @@ sctp_handle_error(struct sctp_chunkhdr * } static int -sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, struct sctphdr *sh, +sctp_handle_init_ack(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_init_ack_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net, int *abort_no_unlock, uint8_t use_mflowid, uint32_t mflowid, @@ -1298,8 +1303,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (ntohs(cp->ch.chunk_length) < sizeof(struct sctp_init_ack_chunk)) { /* Invalid length */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1310,8 +1315,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (init_ack->initiate_tag == 0) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1320,8 +1325,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (ntohl(init_ack->a_rwnd) < SCTP_MIN_RWND) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1330,8 +1335,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (init_ack->num_inbound_streams == 0) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1340,8 +1345,8 @@ sctp_handle_init_ack(struct mbuf *m, int if (init_ack->num_outbound_streams == 0) { /* protocol error... send an abort */ op_err = sctp_generate_invmanparam(SCTP_CAUSE_INVALID_PARAM); - sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, sh, - op_err, + sctp_abort_association(stcb->sctp_ep, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, net->port); *abort_no_unlock = 1; @@ -1365,7 +1370,7 @@ sctp_handle_init_ack(struct mbuf *m, int sctp_ulp_notify(SCTP_NOTIFY_INTERFACE_CONFIRMED, stcb, 0, (void *)stcb->asoc.primary_destination, SCTP_SO_NOT_LOCKED); } - if (sctp_process_init_ack(m, iphlen, offset, sh, cp, stcb, + if (sctp_process_init_ack(m, iphlen, offset, src, dst, sh, cp, stcb, net, abort_no_unlock, use_mflowid, mflowid, vrf_id) < 0) { @@ -1419,6 +1424,7 @@ sctp_handle_init_ack(struct mbuf *m, int static struct sctp_tcb * sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, @@ -1435,6 +1441,7 @@ sctp_process_cookie_new(struct mbuf *m, */ static struct sctp_tcb * sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, @@ -1477,7 +1484,7 @@ sctp_process_cookie_existing(struct mbuf ph = mtod(op_err, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_COOKIE_IN_SHUTDOWN); ph->param_length = htons(sizeof(struct sctp_paramhdr)); - sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, + sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, use_mflowid, mflowid, vrf_id, net->port); if (how_indx < sizeof(asoc->cookie_how)) @@ -1642,7 +1649,7 @@ sctp_process_cookie_existing(struct mbuf */ if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, sh, init_src)) { + initack_offset, src, dst, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 4; return (NULL); @@ -1703,7 +1710,7 @@ sctp_process_cookie_existing(struct mbuf ph = mtod(op_err, struct sctp_paramhdr *); ph->param_type = htons(SCTP_CAUSE_NAT_COLLIDING_STATE); ph->param_length = htons(sizeof(struct sctp_paramhdr)); - sctp_send_abort(m, iphlen, sh, 0, op_err, + sctp_send_abort(m, iphlen, src, dst, sh, 0, op_err, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -1786,7 +1793,7 @@ sctp_process_cookie_existing(struct mbuf } if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, sh, init_src)) { + initack_offset, src, dst, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 10; return (NULL); @@ -1867,7 +1874,8 @@ sctp_process_cookie_existing(struct mbuf * cookie_new code since we are allowing a duplicate * association. I hope this works... */ - return (sctp_process_cookie_new(m, iphlen, offset, sh, cookie, cookie_len, + return (sctp_process_cookie_new(m, iphlen, offset, src, dst, + sh, cookie, cookie_len, inp, netp, init_src, notification, auth_skipped, auth_offset, auth_len, use_mflowid, mflowid, @@ -1972,7 +1980,7 @@ sctp_process_cookie_existing(struct mbuf if (sctp_load_addresses_from_init(stcb, m, init_offset + sizeof(struct sctp_init_chunk), - initack_offset, sh, init_src)) { + initack_offset, src, dst, init_src)) { if (how_indx < sizeof(asoc->cookie_how)) asoc->cookie_how[how_indx] = 14; @@ -2003,6 +2011,7 @@ sctp_process_cookie_existing(struct mbuf */ static struct sctp_tcb * sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_state_cookie *cookie, int cookie_len, struct sctp_inpcb *inp, struct sctp_nets **netp, struct sockaddr *init_src, int *notification, @@ -2102,7 +2111,7 @@ sctp_process_cookie_new(struct mbuf *m, op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -2130,7 +2139,7 @@ sctp_process_cookie_new(struct mbuf *m, atomic_add_int(&stcb->asoc.refcnt, 1); op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(inp, (struct sctp_tcb *)NULL, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -2179,8 +2188,8 @@ sctp_process_cookie_new(struct mbuf *m, } /* load all addresses */ if (sctp_load_addresses_from_init(stcb, m, - init_offset + sizeof(struct sctp_init_chunk), initack_offset, sh, - init_src)) { + init_offset + sizeof(struct sctp_init_chunk), initack_offset, + src, dst, init_src)) { atomic_add_int(&stcb->asoc.refcnt, 1); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) SCTP_TCB_UNLOCK(stcb); @@ -2376,6 +2385,7 @@ sctp_process_cookie_new(struct mbuf *m, */ static struct mbuf * sctp_handle_cookie_echo(struct mbuf *m, int iphlen, int offset, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_cookie_echo_chunk *cp, struct sctp_inpcb **inp_p, struct sctp_tcb **stcb, struct sctp_nets **netp, int auth_skipped, uint32_t auth_offset, uint32_t auth_len, @@ -2396,9 +2406,6 @@ sctp_handle_cookie_echo(struct mbuf *m, unsigned int cookie_len; struct timeval now; struct timeval time_expires; - struct sockaddr_storage dest_store; - struct sockaddr *localep_sa = (struct sockaddr *)&dest_store; - struct ip *iph; int notification = 0; struct sctp_nets *netl; int had_a_existing_tcb = 0; @@ -2419,45 +2426,6 @@ sctp_handle_cookie_echo(struct mbuf *m, if (inp_p == NULL) { return (NULL); } - /* First get the destination address setup too. */ - iph = mtod(m, struct ip *); - switch (iph->ip_v) { -#ifdef INET - case IPVERSION: - { - /* its IPv4 */ - struct sockaddr_in *lsin; - - lsin = (struct sockaddr_in *)(localep_sa); - memset(lsin, 0, sizeof(*lsin)); - lsin->sin_family = AF_INET; - lsin->sin_len = sizeof(*lsin); - lsin->sin_port = sh->dest_port; - lsin->sin_addr.s_addr = iph->ip_dst.s_addr; - break; - } -#endif -#ifdef INET6 - case IPV6_VERSION >> 4: - { - /* its IPv6 */ - struct ip6_hdr *ip6; - struct sockaddr_in6 *lsin6; - - lsin6 = (struct sockaddr_in6 *)(localep_sa); - memset(lsin6, 0, sizeof(*lsin6)); - lsin6->sin6_family = AF_INET6; - lsin6->sin6_len = sizeof(struct sockaddr_in6); - ip6 = mtod(m, struct ip6_hdr *); - lsin6->sin6_port = sh->dest_port; - lsin6->sin6_addr = ip6->ip6_dst; - break; - } -#endif - default: - return (NULL); - } - cookie = &cp->cookie; cookie_offset = offset + sizeof(struct sctp_chunkhdr); cookie_len = ntohs(cp->ch.chunk_length); @@ -2608,7 +2576,7 @@ sctp_handle_cookie_echo(struct mbuf *m, if (tim == 0) tim = now.tv_usec - cookie->time_entered.tv_usec; scm->time_usec = htonl(tim); - sctp_send_operr_to(m, sh, cookie->peers_vtag, op_err, + sctp_send_operr_to(src, dst, sh, cookie->peers_vtag, op_err, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -2652,7 +2620,7 @@ sctp_handle_cookie_echo(struct mbuf *m, } if ((*stcb == NULL) && to) { /* Yep, lets check */ - *stcb = sctp_findassociation_ep_addr(inp_p, to, netp, localep_sa, NULL); + *stcb = sctp_findassociation_ep_addr(inp_p, to, netp, dst, NULL); if (*stcb == NULL) { /* * We should have only got back the same inp. If we @@ -2695,15 +2663,17 @@ sctp_handle_cookie_echo(struct mbuf *m, cookie_len -= SCTP_SIGNATURE_SIZE; if (*stcb == NULL) { /* this is the "normal" case... get a new TCB */ - *stcb = sctp_process_cookie_new(m, iphlen, offset, sh, cookie, - cookie_len, *inp_p, netp, to, ¬ification, + *stcb = sctp_process_cookie_new(m, iphlen, offset, src, dst, sh, + cookie, cookie_len, *inp_p, + netp, to, ¬ification, auth_skipped, auth_offset, auth_len, use_mflowid, mflowid, vrf_id, port); } else { /* this is abnormal... cookie-echo on existing TCB */ had_a_existing_tcb = 1; - *stcb = sctp_process_cookie_existing(m, iphlen, offset, sh, + *stcb = sctp_process_cookie_existing(m, iphlen, offset, + src, dst, sh, cookie, cookie_len, *inp_p, *stcb, netp, to, ¬ification, auth_skipped, auth_offset, auth_len, use_mflowid, mflowid, @@ -2788,7 +2758,7 @@ sctp_handle_cookie_echo(struct mbuf *m, SCTPDBG(SCTP_DEBUG_INPUT1, "process_cookie_new: no room for another socket!\n"); op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); sctp_abort_association(*inp_p, NULL, m, iphlen, - sh, op_err, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); #if defined(__APPLE__) || defined(SCTP_SO_LOCK_TESTING) @@ -4402,6 +4372,7 @@ __attribute__((noinline)) #endif static struct sctp_tcb * sctp_process_control(struct mbuf *m, int iphlen, int *offset, int length, + struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets **netp, int *fwd_tsn_seen, uint8_t use_mflowid, uint32_t mflowid, @@ -4518,7 +4489,9 @@ __attribute__((noinline)) if (asconf_len < sizeof(struct sctp_asconf_paramhdr)) break; stcb = sctp_findassociation_ep_asconf(m, - *offset, sh, &inp, netp, vrf_id); + *offset, + dst, + sh, &inp, netp, vrf_id); if (stcb != NULL) break; asconf_offset += SCTP_SIZE32(asconf_len); @@ -4560,7 +4533,7 @@ __attribute__((noinline)) } if (stcb == NULL) { /* no association, so it's out of the blue... */ - sctp_handle_ootb(m, iphlen, *offset, sh, inp, + sctp_handle_ootb(m, iphlen, *offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); *offset = length; @@ -4598,7 +4571,8 @@ __attribute__((noinline)) if (locked_tcb) { SCTP_TCB_UNLOCK(locked_tcb); } - sctp_handle_ootb(m, iphlen, *offset, sh, inp, + sctp_handle_ootb(m, iphlen, *offset, src, dst, + sh, inp, use_mflowid, mflowid, vrf_id, port); return (NULL); @@ -4740,8 +4714,8 @@ process_control_chunks: /* The INIT chunk must be the only chunk. */ if ((num_chunks > 1) || (length - *offset > (int)SCTP_SIZE32(chk_length))) { - sctp_abort_association(inp, stcb, m, - iphlen, sh, NULL, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, NULL, use_mflowid, mflowid, vrf_id, port); *offset = length; @@ -4752,14 +4726,14 @@ process_control_chunks: struct mbuf *op_err; op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); - sctp_abort_association(inp, stcb, m, - iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); *offset = length; return (NULL); } - sctp_handle_init(m, iphlen, *offset, sh, + sctp_handle_init(m, iphlen, *offset, src, dst, sh, (struct sctp_init_chunk *)ch, inp, stcb, &abort_no_unlock, use_mflowid, mflowid, @@ -4811,7 +4785,8 @@ process_control_chunks: return (NULL); } if ((netp) && (*netp)) { - ret = sctp_handle_init_ack(m, iphlen, *offset, sh, + ret = sctp_handle_init_ack(m, iphlen, *offset, + src, dst, sh, (struct sctp_init_ack_chunk *)ch, stcb, *netp, &abort_no_unlock, @@ -5121,8 +5096,8 @@ process_control_chunks: struct mbuf *op_err; op_err = sctp_generate_invmanparam(SCTP_CAUSE_OUT_OF_RESC); - sctp_abort_association(inp, stcb, m, - iphlen, sh, op_err, + sctp_abort_association(inp, stcb, m, iphlen, + src, dst, sh, op_err, use_mflowid, mflowid, vrf_id, port); } @@ -5149,7 +5124,9 @@ process_control_chunks: if (netp) { ret_buf = sctp_handle_cookie_echo(m, iphlen, - *offset, sh, + *offset, + src, dst, + sh, (struct sctp_cookie_echo_chunk *)ch, &inp, &stcb, netp, auth_skipped, @@ -5312,7 +5289,7 @@ process_control_chunks: __LINE__); } stcb->asoc.overall_error_count = 0; - sctp_handle_asconf(m, *offset, + sctp_handle_asconf(m, *offset, src, (struct sctp_asconf_chunk *)ch, stcb, asconf_cnt == 0); asconf_cnt++; } @@ -5608,8 +5585,9 @@ __attribute__((noinline)) * common input chunk processing (v4 and v6) */ void -sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, - int length, struct sctphdr *sh, struct sctp_chunkhdr *ch, +sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, + struct sockaddr *src, struct sockaddr *dst, + struct sctphdr *sh, struct sctp_chunkhdr *ch, struct sctp_inpcb *inp, struct sctp_tcb *stcb, struct sctp_nets *net, uint8_t ecn_bits, uint8_t use_mflowid, uint32_t mflowid, @@ -5648,7 +5626,7 @@ sctp_common_input_processing(struct mbuf * NOT respond to any packet.. its OOTB. */ SCTP_TCB_UNLOCK(stcb); - sctp_handle_ootb(m, iphlen, offset, sh, inp, + sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); goto out_now; @@ -5657,7 +5635,8 @@ sctp_common_input_processing(struct mbuf if (IS_SCTP_CONTROL(ch)) { /* process the control portion of the SCTP packet */ /* sa_ignore NO_NULL_CHK */ - stcb = sctp_process_control(m, iphlen, &offset, length, sh, ch, + stcb = sctp_process_control(m, iphlen, &offset, length, + src, dst, sh, ch, inp, stcb, &net, &fwd_tsn_seen, use_mflowid, mflowid, vrf_id, port); @@ -5695,7 +5674,7 @@ sctp_common_input_processing(struct mbuf } if (stcb == NULL) { /* out of the blue DATA chunk */ - sctp_handle_ootb(m, iphlen, offset, sh, inp, + sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); goto out_now; @@ -5765,7 +5744,7 @@ sctp_common_input_processing(struct mbuf /* * We consider OOTB any data sent during asoc setup. */ - sctp_handle_ootb(m, iphlen, offset, sh, inp, + sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); SCTP_TCB_UNLOCK(stcb); @@ -5786,7 +5765,8 @@ sctp_common_input_processing(struct mbuf break; } /* plow through the data chunks while length > offset */ - retval = sctp_process_data(mm, iphlen, &offset, length, sh, + retval = sctp_process_data(mm, iphlen, &offset, length, + src, dst, sh, inp, stcb, net, &high_tsn, use_mflowid, mflowid, vrf_id, port); @@ -5881,6 +5861,7 @@ sctp_input_with_port(struct mbuf *i_pak, int iphlen; uint32_t vrf_id = 0; uint8_t ecn_bits; + struct sockaddr_in src, dst; struct ip *ip; struct sctphdr *sh; struct sctp_chunkhdr *ch; @@ -5930,18 +5911,27 @@ sctp_input_with_port(struct mbuf *i_pak, SCTP_STAT_INCR(sctps_recvpackets); SCTP_STAT_INCR_COUNTER64(sctps_inpackets); /* Get IP, SCTP, and first chunk header together in the first mbuf. */ - ip = mtod(m, struct ip *); offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); if (SCTP_BUF_LEN(m) < offset) { - if ((m = m_pullup(m, offset)) == 0) { + if ((m = m_pullup(m, offset)) == NULL) { SCTP_STAT_INCR(sctps_hdrops); return; } - ip = mtod(m, struct ip *); } + ip = mtod(m, struct ip *); sh = (struct sctphdr *)((caddr_t)ip + iphlen); ch = (struct sctp_chunkhdr *)((caddr_t)sh + sizeof(struct sctphdr)); offset -= sizeof(struct sctp_chunkhdr); + memset(&src, 0, sizeof(struct sockaddr_in)); + src.sin_family = AF_INET; + src.sin_len = sizeof(struct sockaddr_in); + src.sin_port = sh->src_port; + src.sin_addr = ip->ip_src; + memset(&dst, 0, sizeof(struct sockaddr_in)); + dst.sin_family = AF_INET; + dst.sin_len = sizeof(struct sockaddr_in); + dst.sin_port = sh->dest_port; + dst.sin_addr = ip->ip_dst; length = ip->ip_len + iphlen; /* Validate mbuf chain length with IP payload length. */ if (SCTP_HEADER_LEN(i_pak) != length) { @@ -5951,10 +5941,10 @@ sctp_input_with_port(struct mbuf *i_pak, goto bad; } /* SCTP does not allow broadcasts or multicasts */ - if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) { + if (IN_MULTICAST(ntohl(dst.sin_addr.s_addr))) { goto bad; } - if (SCTP_IS_IT_BROADCAST(ip->ip_dst, m)) { + if (SCTP_IS_IT_BROADCAST(dst.sin_addr, m)) { goto bad; } SCTPDBG(SCTP_DEBUG_INPUT1, @@ -5980,6 +5970,8 @@ sctp_input_with_port(struct mbuf *i_pak, SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", calc_check, check, m, length, iphlen); stcb = sctp_findassociation_addr(m, offset, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { @@ -6011,6 +6003,8 @@ sctp_skip_csum: goto bad; } stcb = sctp_findassociation_addr(m, offset, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, sh, ch, &inp, &net, vrf_id); if ((net) && (port)) { if (net->port == 0) { @@ -6029,7 +6023,9 @@ sctp_skip_csum: if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) goto bad; if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - sctp_send_shutdown_complete2(m, sh, + sctp_send_shutdown_complete2((struct sockaddr *)&src, + (struct sockaddr *)&dst, + sh, use_mflowid, mflowid, vrf_id, port); goto bad; @@ -6041,7 +6037,10 @@ sctp_skip_csum: if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && (ch->chunk_type != SCTP_INIT))) { - sctp_send_abort(m, iphlen, sh, 0, NULL, + sctp_send_abort(m, iphlen, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, + sh, 0, NULL, use_mflowid, mflowid, vrf_id, port); } @@ -6064,8 +6063,10 @@ sctp_skip_csum: ecn_bits = ip->ip_tos; /* sa_ignore NO_NULL_CHK */ - sctp_common_input_processing(&m, iphlen, offset, length, sh, ch, - inp, stcb, net, ecn_bits, + sctp_common_input_processing(&m, iphlen, offset, length, + (struct sockaddr *)&src, + (struct sockaddr *)&dst, + sh, ch, inp, stcb, net, ecn_bits, use_mflowid, mflowid, vrf_id, port); if (m) { @@ -6117,15 +6118,14 @@ sctp_input(struct mbuf *m, int off) * No flow id built by lower layers fix it so we * create one. */ - ip = mtod(m, struct ip *); - offset = off + sizeof(*sh); + offset = off + sizeof(struct sctphdr); if (SCTP_BUF_LEN(m) < offset) { - if ((m = m_pullup(m, offset)) == 0) { + if ((m = m_pullup(m, offset)) == NULL) { SCTP_STAT_INCR(sctps_hdrops); return; } - ip = mtod(m, struct ip *); } + ip = mtod(m, struct ip *); sh = (struct sctphdr *)((caddr_t)ip + off); tag = htonl(sh->v_tag); flowid = tag ^ ntohs(sh->dest_port) ^ ntohs(sh->src_port); Modified: stable/9/sys/netinet/sctp_input.h ============================================================================== --- stable/9/sys/netinet/sctp_input.h Sat Jul 6 16:51:30 2013 (r252888) +++ stable/9/sys/netinet/sctp_input.h Sat Jul 6 17:11:33 2013 (r252889) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #if defined(_KERNEL) || defined(__Userspace__) void sctp_common_input_processing(struct mbuf **, int, int, int, + struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_chunkhdr *, struct sctp_inpcb *, struct sctp_tcb *, struct sctp_nets *, uint8_t, Modified: stable/9/sys/netinet/sctp_os_bsd.h ============================================================================== --- stable/9/sys/netinet/sctp_os_bsd.h Sat Jul 6 16:51:30 2013 (r252888) +++ stable/9/sys/netinet/sctp_os_bsd.h Sat Jul 6 17:11:33 2013 (r252889) @@ -177,18 +177,9 @@ MALLOC_DECLARE(SCTP_M_MCORE); } \ } while (0); \ } -#define SCTPDBG_PKT(level, iph, sh) \ -{ \ - do { \ - if (SCTP_BASE_SYSCTL(sctp_debug_on) & level) { \ - sctp_print_address_pkt(iph, sh); \ - } \ - } while (0); \ -} #else #define SCTPDBG(level, params...) #define SCTPDBG_ADDR(level, addr) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 19:21:57 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E8B23F3D; Sat, 6 Jul 2013 19:21:57 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [199.48.134.227]) by mx1.freebsd.org (Postfix) with ESMTP id AF866112D; Sat, 6 Jul 2013 19:21:57 +0000 (UTC) Received: from glenbarber.us (nucleus.glenbarber.us [IPv6:2001:470:8:1205:2:2:ff:29]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id D83C923F845; Sat, 6 Jul 2013 15:21:49 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us D83C923F845 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Sat, 6 Jul 2013 15:21:46 -0400 From: Glen Barber To: Andre Oppermann Subject: Re: svn commit: r252835 - stable/9/sys/netinet Message-ID: <20130706192146.GL20631@glenbarber.us> References: <201307052011.r65KBRCG063754@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="UK1lfQXsnwKrySH9" Content-Disposition: inline In-Reply-To: <201307052011.r65KBRCG063754@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jul 2013 19:21:58 -0000 --UK1lfQXsnwKrySH9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 05, 2013 at 08:11:27PM +0000, Andre Oppermann wrote: > Author: andre > Date: Fri Jul 5 20:11:27 2013 > New Revision: 252835 > URL: http://svnweb.freebsd.org/changeset/base/252835 >=20 > Log: > MFC r226433: > =20 > Update the comment and description of tcp_sendspace and tcp_recvspace > to better reflect their purpose. > =20 > MFC r226437: > =20 > VNET virtualize tcp_sendspace/tcp_recvspace and change the > type to INT. A long is not necessary as the TCP window is > limited to 2**30. A larger initial window isn't useful. > =20 > MFC r226448: > =20 > Move the tcp_sendspace and tcp_recvspace sysctl's from > the middle of tcp_usrreq.c to the top of tcp_output.c > and tcp_input.c respectively next to the socket buffer > autosizing controls. > =20 > MFC r227034: > =20 > Restore sysctl names for tcp_sendspace/tcp_recvspace. > =20 > They seem to be changed unintentionally in r226437, and there were no > any mentions of renaming in commit log message. > =20 > Reported by: Anton Yuzhaninov >=20 > Modified: > stable/9/sys/netinet/tcp_input.c > stable/9/sys/netinet/tcp_output.c > stable/9/sys/netinet/tcp_usrreq.c > stable/9/sys/netinet/tcp_var.h > Directory Properties: > stable/9/sys/ (props changed) >=20 > Modified: stable/9/sys/netinet/tcp_input.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 20:01:07 2013 (r252834) > +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 20:11:27 2013 (r252835) > @@ -194,6 +194,11 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, > &VNET_NAME(tcp_insecure_rst), 0, > "Follow the old (insecure) criteria for accepting RST packets"); > =20 > +VNET_DEFINE(int, tcp_recvspace) =3D 1024*64 > +#define V_tcp_recvspace VNET(tcp_recvspace) > +SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_RW, > + &VNET_NAME(tcp_recvspace), 0, "Initial receive socket buffer size"); > + > VNET_DEFINE(int, tcp_do_autorcvbuf) =3D 1; > #define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) > SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLFLAG_RW, I think this breaks the LINT build. cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=3Dc99 -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc -I. -I/src/sys -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-common -finline-limit=3D8000 --param inline-unit-growth=3D100 --param large-function-growth=3D1000 -DGPROF -falign-functions=3D16 -DGPROF4 -DGUPROF -fno-builtin -fno-omit-frame-pointer -mcmodel=3Dkernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -Werror -pg -mprofiler-epilogue /src/sys/netinet/tcp_input.c /src/sys/netinet/tcp_input.c:199: error: expected ',' or ';' before 'static' /src/sys/netinet/tcp_input.c:199: error: 'sysctl___net_inet_tcp_recvspace' undeclared here (not in a function) *** Error code 1 Stop in /obj/amd64.amd64/src/sys/LINT-VIMAGE. *** Error code 1 Glen --UK1lfQXsnwKrySH9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJR2G5KAAoJEFJPDDeguUajxQYIAJZG90GfFBuzWMU/Rx/HhgMS HG5XElZOtrc0V+RTqRc0Wib6Vk/tyfXlmCObqpv2QFRznVIdcP0xw9DuDzW0mC0U X0pnRgsx3FV4eQVYQSJRKW37BGszizrO+sNWetGMJU/aJRlnFQEkdiokOTDHyXGh IewXOZCYoD/7HCBVkHJ6iM5XGK+nQOrdhcilN4sFEkej51piOt8+Kq/JoYX0n50a Ggi2HOWwIIVBAT4xyLOVaY5x70GyipLE3in0QfYabGjZq7C63icPXjfT7lrsuBXw OTeyVpLs181oz7PhmpCDbJSYfJXGDkXQxRQMckFmcQ4FuTRcTXjK8HM2jl83mCs= =Yxda -----END PGP SIGNATURE----- --UK1lfQXsnwKrySH9-- From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 19:43:43 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 30CF295D; Sat, 6 Jul 2013 19:43:43 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 209E2121A; Sat, 6 Jul 2013 19:43:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66Jhhq8084269; Sat, 6 Jul 2013 19:43:43 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66JhhuN084268; Sat, 6 Jul 2013 19:43:43 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201307061943.r66JhhuN084268@svn.freebsd.org> From: Gavin Atkinson Date: Sat, 6 Jul 2013 19:43: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: r252891 - 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.14 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, 06 Jul 2013 19:43:43 -0000 Author: gavin Date: Sat Jul 6 19:43:42 2013 New Revision: 252891 URL: http://svnweb.freebsd.org/changeset/base/252891 Log: Merge r252337 from head: Don't try to re-insert an already present but invalid page. This could happen if a thread doing a page-in loses a ZFS range lock race to a thread writing to the same range This fixes "panic: vm_page_alloc: pindex already allocated" in http://docs.FreeBSD.org/cgi/mid.cgi?1372165971.96049.42.camel Submitted by: avg 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 Sat Jul 6 18:28:06 2013 (r252890) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Jul 6 19:43:42 2013 (r252891) @@ -343,10 +343,13 @@ page_busy(vnode_t *vp, int64_t start, in vm_page_sleep(pp, "zfsmwb"); continue; } - } else { + } else if (pp == NULL) { pp = vm_page_alloc(obj, OFF_TO_IDX(start), VM_ALLOC_SYSTEM | VM_ALLOC_IFCACHED | VM_ALLOC_NOBUSY); + } else { + ASSERT(pp != NULL && !pp->valid); + pp = NULL; } if (pp != NULL) { From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 20:10:40 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 02D0D296; Sat, 6 Jul 2013 20:10:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E84B612ED; Sat, 6 Jul 2013 20:10:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66KAdwF093212; Sat, 6 Jul 2013 20:10:39 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66KAdsR093211; Sat, 6 Jul 2013 20:10:39 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201307062010.r66KAdsR093211@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 6 Jul 2013 20:10: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: r252893 - stable/9/sys/netinet 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.14 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, 06 Jul 2013 20:10:40 -0000 Author: kib Date: Sat Jul 6 20:10:39 2013 New Revision: 252893 URL: http://svnweb.freebsd.org/changeset/base/252893 Log: MFC r226454 (by bz): Fix VNET build. Modified: stable/9/sys/netinet/tcp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/tcp_input.c ============================================================================== --- stable/9/sys/netinet/tcp_input.c Sat Jul 6 19:59:06 2013 (r252892) +++ stable/9/sys/netinet/tcp_input.c Sat Jul 6 20:10:39 2013 (r252893) @@ -194,7 +194,7 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_insecure_rst), 0, "Follow the old (insecure) criteria for accepting RST packets"); -VNET_DEFINE(int, tcp_recvspace) = 1024*64 +VNET_DEFINE(int, tcp_recvspace) = 1024*64; #define V_tcp_recvspace VNET(tcp_recvspace) SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_RW, &VNET_NAME(tcp_recvspace), 0, "Initial receive socket buffer size"); From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 20:12:35 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6559A3CD; Sat, 6 Jul 2013 20:12:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id CBD4112F9; Sat, 6 Jul 2013 20:12:34 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.7/8.14.7) with ESMTP id r66KCTS6018264; Sat, 6 Jul 2013 23:12:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.8.3 kib.kiev.ua r66KCTS6018264 Received: (from kostik@localhost) by tom.home (8.14.7/8.14.7/Submit) id r66KCTC0018263; Sat, 6 Jul 2013 23:12:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 6 Jul 2013 23:12:29 +0300 From: Konstantin Belousov To: Glen Barber Subject: Re: svn commit: r252835 - stable/9/sys/netinet Message-ID: <20130706201229.GB91021@kib.kiev.ua> References: <201307052011.r65KBRCG063754@svn.freebsd.org> <20130706192146.GL20631@glenbarber.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UXNJ9ANe8MmuJ4dV" Content-Disposition: inline In-Reply-To: <20130706192146.GL20631@glenbarber.us> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann , svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 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, 06 Jul 2013 20:12:35 -0000 --UXNJ9ANe8MmuJ4dV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Jul 06, 2013 at 03:21:46PM -0400, Glen Barber wrote: > On Fri, Jul 05, 2013 at 08:11:27PM +0000, Andre Oppermann wrote: > > Author: andre > > Date: Fri Jul 5 20:11:27 2013 > > New Revision: 252835 > > URL: http://svnweb.freebsd.org/changeset/base/252835 > >=20 > > Log: > > MFC r226433: > > =20 > > Update the comment and description of tcp_sendspace and tcp_recvspace > > to better reflect their purpose. > > =20 > > MFC r226437: > > =20 > > VNET virtualize tcp_sendspace/tcp_recvspace and change the > > type to INT. A long is not necessary as the TCP window is > > limited to 2**30. A larger initial window isn't useful. > > =20 > > MFC r226448: > > =20 > > Move the tcp_sendspace and tcp_recvspace sysctl's from > > the middle of tcp_usrreq.c to the top of tcp_output.c > > and tcp_input.c respectively next to the socket buffer > > autosizing controls. > > =20 > > MFC r227034: > > =20 > > Restore sysctl names for tcp_sendspace/tcp_recvspace. > > =20 > > They seem to be changed unintentionally in r226437, and there were no > > any mentions of renaming in commit log message. > > =20 > > Reported by: Anton Yuzhaninov > >=20 > > Modified: > > stable/9/sys/netinet/tcp_input.c > > stable/9/sys/netinet/tcp_output.c > > stable/9/sys/netinet/tcp_usrreq.c > > stable/9/sys/netinet/tcp_var.h > > Directory Properties: > > stable/9/sys/ (props changed) > >=20 > > Modified: stable/9/sys/netinet/tcp_input.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- stable/9/sys/netinet/tcp_input.c Fri Jul 5 20:01:07 2013 (r252834) > > +++ stable/9/sys/netinet/tcp_input.c Fri Jul 5 20:11:27 2013 (r252835) > > @@ -194,6 +194,11 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, > > &VNET_NAME(tcp_insecure_rst), 0, > > "Follow the old (insecure) criteria for accepting RST packets"); > > =20 > > +VNET_DEFINE(int, tcp_recvspace) =3D 1024*64 > > +#define V_tcp_recvspace VNET(tcp_recvspace) > > +SYSCTL_VNET_INT(_net_inet_tcp, TCPCTL_RECVSPACE, recvspace, CTLFLAG_RW, > > + &VNET_NAME(tcp_recvspace), 0, "Initial receive socket buffer size"= ); > > + > > VNET_DEFINE(int, tcp_do_autorcvbuf) =3D 1; > > #define V_tcp_do_autorcvbuf VNET(tcp_do_autorcvbuf) > > SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, recvbuf_auto, CTLFLAG_RW, >=20 > I think this breaks the LINT build. >=20 > cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -std=3Dc99 -Wall > -Wredundant-decls -Wnested-externs -Wstrict-prototypes > -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef > -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs > -fdiagnostics-show-option -nostdinc -I. -I/src/sys > -I/src/sys/contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include > opt_global.h -fno-common -finline-limit=3D8000 --param > inline-unit-growth=3D100 --param large-function-growth=3D1000 -DGPROF > -falign-functions=3D16 -DGPROF4 -DGUPROF -fno-builtin > -fno-omit-frame-pointer -mcmodel=3Dkernel -mno-red-zone -mno-mmx -mno-sse > -msoft-float -fno-asynchronous-unwind-tables -ffreestanding > -fstack-protector -Werror -pg -mprofiler-epilogue > /src/sys/netinet/tcp_input.c > /src/sys/netinet/tcp_input.c:199: error: expected ',' or ';' before 'stat= ic' > /src/sys/netinet/tcp_input.c:199: error: > 'sysctl___net_inet_tcp_recvspace' undeclared here (not in a function) > *** Error code 1 >=20 > Stop in /obj/amd64.amd64/src/sys/LINT-VIMAGE. > *** Error code 1 Hopefully fixed by r252893. --UXNJ9ANe8MmuJ4dV Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQIcBAEBAgAGBQJR2HotAAoJEJDCuSvBvK1B5RsP/3+4hQr5+Wa8fTyg2v1UgY3U DdzKN5utaR/xZuv2TRWOHmGhBqPLwPhkVRV1tPl5+w4pQccsjIQxoKsN/WZNGx9M H3XD2nNzaXUdWZoeAeho0XBTsp/xywTcJkrGoM9D7VLZFCUGSNEiG4y68E2V3MV2 Dm3R6fq9iq/mTAARC3jw0N2VF6XODrtOGmyKHSshBfiXOSfIfnnS2ydd6JFaTt/d wOBLPphlDDWPZK1ef6rH5QMZc38jOtT9nIK1DqReH9X/mQGzB3GZlqG/riMpcLDp ff3TUTjgkFgfT8fuQx8Ho/4INEjcPWTb5zS8OYrTLEum8Q6MRod+vwJ9911ShUl7 LRazLLmcBlRNYhAX0ji1ycvkNkXClIXR3AE2MHLWIjE0Tu8e4pSwcaJ+LqUoqcx2 rHUQUabiJtj64Rr1czqG/Q1QU+2TJJkJSPQ9wDx9p9GUxEl8HL2IQeU3LYijUCew 0w2qcLJHwFLSnCvy9w5vjxaUUqKpHkF4/6gbFqzlnrHVOPBg2Pn/AyxbwoXBWmDG TPI/nCTA5V1YXSCyl1/39G+7Z2s6OGeEHOGMoI1i1KBZRU8Dj3hcyDYjgDYieFa4 cwDVAXlp+mCx2SiSmeXXO+c0yX4XeZdEUQ1FuR8y7xw4mddl1/XKOGoW1EJyJJ/z 070mUWbClTCSv54pID5g =5X+i -----END PGP SIGNATURE----- --UXNJ9ANe8MmuJ4dV-- From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 20:35:22 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4E580A67; Sat, 6 Jul 2013 20:35:22 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3EB8B13A6; Sat, 6 Jul 2013 20:35:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66KZMLR099691; Sat, 6 Jul 2013 20:35:22 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66KZLY3099688; Sat, 6 Jul 2013 20:35:21 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307062035.r66KZLY3099688@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 20:35:21 +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: r252896 - in stable/9/sys: netinet 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.14 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, 06 Jul 2013 20:35:22 -0000 Author: tuexen Date: Sat Jul 6 20:35:21 2013 New Revision: 252896 URL: http://svnweb.freebsd.org/changeset/base/252896 Log: MFC r238003, r239091: Move common code parts to sctp_common_input_processing(). Fix a bug found by dim@: Don't use an uninitilized variable, if INVARIANTS is on and an illegal packet with destination 0 is received. Modified: stable/9/sys/netinet/sctp_input.c stable/9/sys/netinet/sctp_input.h stable/9/sys/netinet6/sctp6_usrreq.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 20:31:22 2013 (r252895) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 20:35:21 2013 (r252896) @@ -5588,26 +5588,141 @@ void sctp_common_input_processing(struct mbuf **mm, int iphlen, int offset, int length, struct sockaddr *src, struct sockaddr *dst, struct sctphdr *sh, struct sctp_chunkhdr *ch, - struct sctp_inpcb *inp, struct sctp_tcb *stcb, - struct sctp_nets *net, uint8_t ecn_bits, +#if !defined(SCTP_WITH_NO_CSUM) + uint8_t compute_crc, +#endif + uint8_t ecn_bits, uint8_t use_mflowid, uint32_t mflowid, uint32_t vrf_id, uint16_t port) { - /* - * Control chunk processing - */ uint32_t high_tsn; int fwd_tsn_seen = 0, data_processed = 0; struct mbuf *m = *mm; int un_sent; int cnt_ctrl_ready = 0; + struct sctp_inpcb *inp = NULL, *inp_decr = NULL; + struct sctp_tcb *stcb = NULL; + struct sctp_nets *net; SCTP_STAT_INCR(sctps_recvdatagrams); #ifdef SCTP_AUDITING_ENABLED sctp_audit_log(0xE0, 1); sctp_auditing(0, inp, stcb, net); #endif +#if !defined(SCTP_WITH_NO_CSUM) + if (compute_crc != 0) { + uint32_t check, calc_check; + check = sh->checksum; + sh->checksum = 0; + calc_check = sctp_calculate_cksum(m, iphlen); + sh->checksum = check; + if (calc_check != check) { + SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", + calc_check, check, m, length, iphlen); + stcb = sctp_findassociation_addr(m, offset, src, dst, + sh, ch, &inp, &net, vrf_id); + if ((net != NULL) && (port != 0)) { + if (net->port == 0) { + sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); + } + net->port = port; + } + if ((net != NULL) && (use_mflowid != 0)) { + net->flowid = mflowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } + if ((inp != NULL) && (stcb != NULL)) { + sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); + sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); + } else if ((inp != NULL) && (stcb == NULL)) { + inp_decr = inp; + } + SCTP_STAT_INCR(sctps_badsum); + SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); + goto out; + } + } +#endif + /* Destination port of 0 is illegal, based on RFC4960. */ + if (sh->dest_port == 0) { + SCTP_STAT_INCR(sctps_hdrops); + goto out; + } + stcb = sctp_findassociation_addr(m, offset, src, dst, + sh, ch, &inp, &net, vrf_id); + if ((net != NULL) && (port != 0)) { + if (net->port == 0) { + sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); + } + net->port = port; + } + if ((net != NULL) && (use_mflowid != 0)) { + net->flowid = mflowid; +#ifdef INVARIANTS + net->flowidset = 1; +#endif + } + if (inp == NULL) { + SCTP_STAT_INCR(sctps_noport); + if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) { + goto out; + } + if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { + sctp_send_shutdown_complete2(src, dst, sh, + use_mflowid, mflowid, + vrf_id, port); + goto out; + } + if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { + goto out; + } + if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { + if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || + ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && + (ch->chunk_type != SCTP_INIT))) { + sctp_send_abort(m, iphlen, src, dst, + sh, 0, NULL, + use_mflowid, mflowid, + vrf_id, port); + } + } + goto out; + } else if (stcb == NULL) { + inp_decr = inp; + } +#ifdef IPSEC + /*- + * I very much doubt any of the IPSEC stuff will work but I have no + * idea, so I will leave it in place. + */ + if (inp != NULL) { + switch (dst->sa_family) { +#ifdef INET + case AF_INET: + if (ipsec4_in_reject(m, &inp->ip_inp.inp)) { + MODULE_GLOBAL(ipsec4stat).in_polvio++; + SCTP_STAT_INCR(sctps_hdrops); + goto out; + } + break; +#endif +#ifdef INET6 + case AF_INET6: + if (ipsec6_in_reject(m, &inp->ip_inp.inp)) { + MODULE_GLOBAL(ipsec6stat).in_polvio++; + SCTP_STAT_INCR(sctps_hdrops); + goto out; + } + break; +#endif + default: + break; + } + } +#endif SCTPDBG(SCTP_DEBUG_INPUT1, "Ok, Common input processing called, m:%p iphlen:%d offset:%d length:%d stcb:%p\n", m, iphlen, offset, length, stcb); if (stcb) { @@ -5626,10 +5741,11 @@ sctp_common_input_processing(struct mbuf * NOT respond to any packet.. its OOTB. */ SCTP_TCB_UNLOCK(stcb); + stcb = NULL; sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); - goto out_now; + goto out; } } if (IS_SCTP_CONTROL(ch)) { @@ -5669,21 +5785,19 @@ sctp_common_input_processing(struct mbuf sctp_auth_is_required_chunk(SCTP_DATA, stcb->asoc.local_auth_chunks)) { /* "silently" ignore */ SCTP_STAT_INCR(sctps_recvauthmissing); - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; } if (stcb == NULL) { /* out of the blue DATA chunk */ sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); - goto out_now; + goto out; } if (stcb->asoc.my_vtag != ntohl(sh->v_tag)) { /* v_tag mismatch! */ SCTP_STAT_INCR(sctps_badvtag); - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; } } @@ -5693,7 +5807,7 @@ sctp_common_input_processing(struct mbuf * packet while processing control, or we're done with this * packet (done or skip rest of data), so we drop it... */ - goto out_now; + goto out; } /* * DATA chunk processing @@ -5747,8 +5861,7 @@ sctp_common_input_processing(struct mbuf sctp_handle_ootb(m, iphlen, offset, src, dst, sh, inp, use_mflowid, mflowid, vrf_id, port); - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; /* sa_ignore NOTREACHED */ break; case SCTP_STATE_EMPTY: /* should not happen */ @@ -5756,8 +5869,7 @@ sctp_common_input_processing(struct mbuf case SCTP_STATE_SHUTDOWN_RECEIVED: /* This is a peer error */ case SCTP_STATE_SHUTDOWN_ACK_SENT: default: - SCTP_TCB_UNLOCK(stcb); - goto out_now; + goto out; /* sa_ignore NOTREACHED */ break; case SCTP_STATE_OPEN: @@ -5775,7 +5887,8 @@ sctp_common_input_processing(struct mbuf * The association aborted, NO UNLOCK needed since * the association is destroyed. */ - goto out_now; + stcb = NULL; + goto out; } data_processed = 1; /* @@ -5832,10 +5945,20 @@ trigger_send: sctp_audit_log(0xE0, 3); sctp_auditing(2, inp, stcb, net); #endif - SCTP_TCB_UNLOCK(stcb); -out_now: +out: + if (stcb != NULL) { + SCTP_TCB_UNLOCK(stcb); + } + if (inp_decr != NULL) { + /* reduce ref-count */ + SCTP_INP_WLOCK(inp_decr); + SCTP_INP_DECR_REF(inp_decr); + SCTP_INP_WUNLOCK(inp_decr); + } #ifdef INVARIANTS - sctp_validate_no_locks(inp); + if (inp != NULL) { + sctp_validate_no_locks(inp); + } #endif return; } @@ -5865,18 +5988,14 @@ sctp_input_with_port(struct mbuf *i_pak, struct ip *ip; struct sctphdr *sh; struct sctp_chunkhdr *ch; - struct sctp_inpcb *inp = NULL; - struct sctp_tcb *stcb = NULL; - struct sctp_nets *net = NULL; - int refcount_up = 0; int length, offset; - uint32_t mflowid; - uint8_t use_mflowid; #if !defined(SCTP_WITH_NO_CSUM) - uint32_t check, calc_check; + uint8_t compute_crc; #endif + uint32_t mflowid; + uint8_t use_mflowid; iphlen = off; if (SCTP_GET_PKT_VRFID(i_pak, vrf_id)) { @@ -5901,6 +6020,11 @@ sctp_input_with_port(struct mbuf *i_pak, sctp_packet_log(m); } #endif + SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, + "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", + m->m_pkthdr.len, + if_name(m->m_pkthdr.rcvif), + m->m_pkthdr.csum_flags); if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; use_mflowid = 1; @@ -5934,161 +6058,42 @@ sctp_input_with_port(struct mbuf *i_pak, dst.sin_addr = ip->ip_dst; length = ip->ip_len + iphlen; /* Validate mbuf chain length with IP payload length. */ - if (SCTP_HEADER_LEN(i_pak) != length) { + if (SCTP_HEADER_LEN(m) != length) { SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(i_pak)); + "sctp_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(m)); SCTP_STAT_INCR(sctps_hdrops); - goto bad; + goto out; } /* SCTP does not allow broadcasts or multicasts */ if (IN_MULTICAST(ntohl(dst.sin_addr.s_addr))) { - goto bad; + goto out; } if (SCTP_IS_IT_BROADCAST(dst.sin_addr, m)) { - goto bad; + goto out; } - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp_input() length:%d iphlen:%d\n", length, iphlen); - SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, - "sctp_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", - m->m_pkthdr.len, - if_name(m->m_pkthdr.rcvif), - m->m_pkthdr.csum_flags); + ecn_bits = ip->ip_tos; #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_recvnocrc); #else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); - goto sctp_skip_csum; - } - check = sh->checksum; - sh->checksum = 0; - calc_check = sctp_calculate_cksum(m, iphlen); - sh->checksum = check; - SCTP_STAT_INCR(sctps_recvswcrc); - if (calc_check != check) { - SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", - calc_check, check, m, length, iphlen); - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); - } else if ((inp != NULL) && (stcb == NULL)) { - refcount_up = 1; - } - SCTP_STAT_INCR(sctps_badsum); - SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); - goto bad; - } -sctp_skip_csum: -#endif - /* destination port of 0 is illegal, based on RFC2960. */ - if (sh->dest_port == 0) { - SCTP_STAT_INCR(sctps_hdrops); - goto bad; - } - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if (inp == NULL) { - SCTP_STAT_INCR(sctps_noport); - if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) - goto bad; - if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - sctp_send_shutdown_complete2((struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, - use_mflowid, mflowid, - vrf_id, port); - goto bad; - } - if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { - goto bad; - } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { - if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || - ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && - (ch->chunk_type != SCTP_INIT))) { - sctp_send_abort(m, iphlen, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, 0, NULL, - use_mflowid, mflowid, - vrf_id, port); - } - } - goto bad; - } else if (stcb == NULL) { - refcount_up = 1; - } -#ifdef IPSEC - /*- - * I very much doubt any of the IPSEC stuff will work but I have no - * idea, so I will leave it in place. - */ - if (inp && ipsec4_in_reject(m, &inp->ip_inp.inp)) { - MODULE_GLOBAL(ipsec4stat).in_polvio++; - SCTP_STAT_INCR(sctps_hdrops); - goto bad; + compute_crc = 0; + } else { + SCTP_STAT_INCR(sctps_recvswcrc); + compute_crc = 1; } #endif - - ecn_bits = ip->ip_tos; - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, (struct sockaddr *)&src, (struct sockaddr *)&dst, - sh, ch, inp, stcb, net, ecn_bits, + sh, ch, +#if !defined(SCTP_WITH_NO_CSUM) + compute_crc, +#endif + ecn_bits, use_mflowid, mflowid, vrf_id, port); - if (m) { - sctp_m_freem(m); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } - return; -bad: - if (stcb) { - SCTP_TCB_UNLOCK(stcb); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } +out: if (m) { sctp_m_freem(m); } Modified: stable/9/sys/netinet/sctp_input.h ============================================================================== --- stable/9/sys/netinet/sctp_input.h Sat Jul 6 20:31:22 2013 (r252895) +++ stable/9/sys/netinet/sctp_input.h Sat Jul 6 20:35:21 2013 (r252896) @@ -41,8 +41,10 @@ void sctp_common_input_processing(struct mbuf **, int, int, int, struct sockaddr *, struct sockaddr *, struct sctphdr *, struct sctp_chunkhdr *, - struct sctp_inpcb *, struct sctp_tcb *, - struct sctp_nets *, uint8_t, +#if !defined(SCTP_WITH_NO_CSUM) + uint8_t, +#endif + uint8_t, uint8_t, uint32_t, uint32_t, uint16_t); Modified: stable/9/sys/netinet6/sctp6_usrreq.c ============================================================================== --- stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 20:31:22 2013 (r252895) +++ stable/9/sys/netinet6/sctp6_usrreq.c Sat Jul 6 20:35:21 2013 (r252896) @@ -70,24 +70,20 @@ sctp6_input(struct mbuf **i_pak, int *of { struct mbuf *m; int iphlen; - uint32_t vrf_id = 0; + uint32_t vrf_id; uint8_t ecn_bits; struct sockaddr_in6 src, dst; struct ip6_hdr *ip6; struct sctphdr *sh; struct sctp_chunkhdr *ch; - struct sctp_inpcb *inp = NULL; - struct sctp_tcb *stcb = NULL; - struct sctp_nets *net = NULL; - int refcount_up = 0; int length, offset; - uint32_t mflowid; - uint8_t use_mflowid; #if !defined(SCTP_WITH_NO_CSUM) - uint32_t check, calc_check; + uint8_t compute_crc; #endif + uint32_t mflowid; + uint8_t use_mflowid; uint16_t port = 0; iphlen = *offp; @@ -113,6 +109,11 @@ sctp6_input(struct mbuf **i_pak, int *of sctp_packet_log(m); } #endif + SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, + "sctp6_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", + m->m_pkthdr.len, + if_name(m->m_pkthdr.rcvif), + m->m_pkthdr.csum_flags); if (m->m_flags & M_FLOWID) { mflowid = m->m_pkthdr.flowid; use_mflowid = 1; @@ -123,8 +124,8 @@ sctp6_input(struct mbuf **i_pak, int *of SCTP_STAT_INCR(sctps_recvpackets); SCTP_STAT_INCR_COUNTER64(sctps_inpackets); /* Get IP, SCTP, and first chunk header together in the first mbuf. */ - ip6 = mtod(m, struct ip6_hdr *); offset = iphlen + sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr); + ip6 = mtod(m, struct ip6_hdr *); IP6_EXTHDR_GET(sh, struct sctphdr *, m, iphlen, (int)(sizeof(struct sctphdr) + sizeof(struct sctp_chunkhdr))); if (sh == NULL) { @@ -139,7 +140,7 @@ sctp6_input(struct mbuf **i_pak, int *of src.sin6_port = sh->src_port; src.sin6_addr = ip6->ip6_src; if (in6_setscope(&src.sin6_addr, m->m_pkthdr.rcvif, NULL) != 0) { - goto bad; + goto out; } memset(&dst, 0, sizeof(struct sockaddr_in6)); dst.sin6_family = AF_INET6; @@ -147,165 +148,46 @@ sctp6_input(struct mbuf **i_pak, int *of dst.sin6_port = sh->dest_port; dst.sin6_addr = ip6->ip6_dst; if (in6_setscope(&dst.sin6_addr, m->m_pkthdr.rcvif, NULL) != 0) { - goto bad; + goto out; } if (faithprefix_p != NULL && (*faithprefix_p) (&dst.sin6_addr)) { /* XXX send icmp6 host/port unreach? */ - goto bad; + goto out; } length = ntohs(ip6->ip6_plen) + iphlen; /* Validate mbuf chain length with IP payload length. */ - if (SCTP_HEADER_LEN(*i_pak) != length) { + if (SCTP_HEADER_LEN(m) != length) { SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp6_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(*i_pak)); + "sctp6_input() length:%d reported length:%d\n", length, SCTP_HEADER_LEN(m)); SCTP_STAT_INCR(sctps_hdrops); - goto bad; + goto out; } if (IN6_IS_ADDR_MULTICAST(&ip6->ip6_dst)) { - goto bad; + goto out; } - SCTPDBG(SCTP_DEBUG_INPUT1, - "sctp6_input() length:%d iphlen:%d\n", length, iphlen); - SCTPDBG(SCTP_DEBUG_CRCOFFLOAD, - "sctp6_input(): Packet of length %d received on %s with csum_flags 0x%x.\n", - m->m_pkthdr.len, - if_name(m->m_pkthdr.rcvif), - m->m_pkthdr.csum_flags); + ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); #if defined(SCTP_WITH_NO_CSUM) SCTP_STAT_INCR(sctps_recvnocrc); #else if (m->m_pkthdr.csum_flags & CSUM_SCTP_VALID) { SCTP_STAT_INCR(sctps_recvhwcrc); - goto sctp_skip_csum; - } - check = sh->checksum; - sh->checksum = 0; - calc_check = sctp_calculate_cksum(m, iphlen); - sh->checksum = check; - SCTP_STAT_INCR(sctps_recvswcrc); - if (calc_check != check) { - SCTPDBG(SCTP_DEBUG_INPUT1, "Bad CSUM on SCTP packet calc_check:%x check:%x m:%p mlen:%d iphlen:%d\n", - calc_check, check, m, length, iphlen); - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if ((inp) && (stcb)) { - sctp_send_packet_dropped(stcb, net, m, length, iphlen, 1); - sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_INPUT_ERROR, SCTP_SO_NOT_LOCKED); - } else if ((inp != NULL) && (stcb == NULL)) { - refcount_up = 1; - } - SCTP_STAT_INCR(sctps_badsum); - SCTP_STAT_INCR_COUNTER32(sctps_checksumerrors); - goto bad; - } -sctp_skip_csum: -#endif - /* destination port of 0 is illegal, based on RFC2960. */ - if (sh->dest_port == 0) { - SCTP_STAT_INCR(sctps_hdrops); - goto bad; - } - stcb = sctp_findassociation_addr(m, offset, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, ch, &inp, &net, vrf_id); - if ((net) && (port)) { - if (net->port == 0) { - sctp_pathmtu_adjustment(stcb, net->mtu - sizeof(struct udphdr)); - } - net->port = port; - } - if ((net != NULL) && (use_mflowid != 0)) { - net->flowid = mflowid; -#ifdef INVARIANTS - net->flowidset = 1; -#endif - } - if (inp == NULL) { - SCTP_STAT_INCR(sctps_noport); - if (badport_bandlim(BANDLIM_SCTP_OOTB) < 0) - goto bad; - if (ch->chunk_type == SCTP_SHUTDOWN_ACK) { - sctp_send_shutdown_complete2((struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, - use_mflowid, mflowid, - vrf_id, port); - goto bad; - } - if (ch->chunk_type == SCTP_SHUTDOWN_COMPLETE) { - goto bad; - } - if (ch->chunk_type != SCTP_ABORT_ASSOCIATION) { - if ((SCTP_BASE_SYSCTL(sctp_blackhole) == 0) || - ((SCTP_BASE_SYSCTL(sctp_blackhole) == 1) && - (ch->chunk_type != SCTP_INIT))) { - sctp_send_abort(m, iphlen, - (struct sockaddr *)&src, - (struct sockaddr *)&dst, - sh, 0, NULL, - use_mflowid, mflowid, - vrf_id, port); - } - } - goto bad; - } else if (stcb == NULL) { - refcount_up = 1; - } -#ifdef IPSEC - /*- - * I very much doubt any of the IPSEC stuff will work but I have no - * idea, so I will leave it in place. - */ - if (inp && ipsec6_in_reject(m, &inp->ip_inp.inp)) { - MODULE_GLOBAL(ipsec6stat).in_polvio++; - SCTP_STAT_INCR(sctps_hdrops); - goto bad; + compute_crc = 0; + } else { + SCTP_STAT_INCR(sctps_recvswcrc); + compute_crc = 1; } #endif - - ecn_bits = ((ntohl(ip6->ip6_flow) >> 20) & 0x000000ff); - /* sa_ignore NO_NULL_CHK */ sctp_common_input_processing(&m, iphlen, offset, length, (struct sockaddr *)&src, (struct sockaddr *)&dst, - sh, ch, inp, stcb, net, ecn_bits, + sh, ch, +#if !defined(SCTP_WITH_NO_CSUM) + compute_crc, +#endif + ecn_bits, use_mflowid, mflowid, vrf_id, port); - if (m) { - sctp_m_freem(m); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } - return (IPPROTO_DONE); -bad: - if (stcb) { - SCTP_TCB_UNLOCK(stcb); - } - if ((inp) && (refcount_up)) { - /* reduce ref-count */ - SCTP_INP_WLOCK(inp); - SCTP_INP_DECR_REF(inp); - SCTP_INP_WUNLOCK(inp); - } +out: if (m) { sctp_m_freem(m); } From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 20:39:45 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6D95BCCC; Sat, 6 Jul 2013 20:39:45 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E1DD1453; Sat, 6 Jul 2013 20:39:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66Kdjk4000292; Sat, 6 Jul 2013 20:39:45 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66KdjNw000291; Sat, 6 Jul 2013 20:39:45 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201307062039.r66KdjNw000291@svn.freebsd.org> From: Michael Tuexen Date: Sat, 6 Jul 2013 20:39:45 +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: r252897 - stable/9/sys/netinet 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.14 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, 06 Jul 2013 20:39:45 -0000 Author: tuexen Date: Sat Jul 6 20:39:44 2013 New Revision: 252897 URL: http://svnweb.freebsd.org/changeset/base/252897 Log: MFC r238087: Initialize a variable. Modified: stable/9/sys/netinet/sctp_input.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/sctp_input.c ============================================================================== --- stable/9/sys/netinet/sctp_input.c Sat Jul 6 20:35:21 2013 (r252896) +++ stable/9/sys/netinet/sctp_input.c Sat Jul 6 20:39:44 2013 (r252897) @@ -5602,7 +5602,7 @@ sctp_common_input_processing(struct mbuf int cnt_ctrl_ready = 0; struct sctp_inpcb *inp = NULL, *inp_decr = NULL; struct sctp_tcb *stcb = NULL; - struct sctp_nets *net; + struct sctp_nets *net = NULL; SCTP_STAT_INCR(sctps_recvdatagrams); #ifdef SCTP_AUDITING_ENABLED From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 21:38:56 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CC54759D; Sat, 6 Jul 2013 21:38:56 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BBE7816C1; Sat, 6 Jul 2013 21:38:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66Lcucg017940; Sat, 6 Jul 2013 21:38:56 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66LctDh017933; Sat, 6 Jul 2013 21:38:55 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201307062138.r66LctDh017933@svn.freebsd.org> From: Jack F Vogel Date: Sat, 6 Jul 2013 21:38: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: r252898 - in stable/9/sys: conf dev/ixgbe modules/ixgbe 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.14 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, 06 Jul 2013 21:38:56 -0000 Author: jfv Date: Sat Jul 6 21:38:55 2013 New Revision: 252898 URL: http://svnweb.freebsd.org/changeset/base/252898 Log: MFC ixgbe driver revisions 248901, 250108, and 251964 Added: stable/9/sys/dev/ixgbe/ixgbe_dcb.c - copied unchanged from r251964, head/sys/dev/ixgbe/ixgbe_dcb.c stable/9/sys/dev/ixgbe/ixgbe_dcb.h - copied unchanged from r251964, head/sys/dev/ixgbe/ixgbe_dcb.h stable/9/sys/dev/ixgbe/ixgbe_dcb_82598.c - copied unchanged from r251964, head/sys/dev/ixgbe/ixgbe_dcb_82598.c stable/9/sys/dev/ixgbe/ixgbe_dcb_82598.h - copied unchanged from r251964, head/sys/dev/ixgbe/ixgbe_dcb_82598.h stable/9/sys/dev/ixgbe/ixgbe_dcb_82599.c - copied unchanged from r251964, head/sys/dev/ixgbe/ixgbe_dcb_82599.c stable/9/sys/dev/ixgbe/ixgbe_dcb_82599.h - copied unchanged from r251964, head/sys/dev/ixgbe/ixgbe_dcb_82599.h Modified: stable/9/sys/conf/files stable/9/sys/dev/ixgbe/README stable/9/sys/dev/ixgbe/ixgbe.c stable/9/sys/dev/ixgbe/ixgbe.h stable/9/sys/dev/ixgbe/ixgbe_82598.c stable/9/sys/dev/ixgbe/ixgbe_82599.c stable/9/sys/dev/ixgbe/ixgbe_api.c stable/9/sys/dev/ixgbe/ixgbe_api.h stable/9/sys/dev/ixgbe/ixgbe_common.c stable/9/sys/dev/ixgbe/ixgbe_common.h stable/9/sys/dev/ixgbe/ixgbe_osdep.h stable/9/sys/dev/ixgbe/ixgbe_phy.c stable/9/sys/dev/ixgbe/ixgbe_phy.h stable/9/sys/dev/ixgbe/ixgbe_type.h stable/9/sys/dev/ixgbe/ixgbe_vf.c stable/9/sys/dev/ixgbe/ixgbe_x540.c stable/9/sys/dev/ixgbe/ixgbe_x540.h stable/9/sys/modules/ixgbe/Makefile Directory Properties: stable/9/sys/conf/ (props changed) stable/9/sys/dev/ixgbe/ (props changed) stable/9/sys/modules/ixgbe/ (props changed) Modified: stable/9/sys/conf/files ============================================================================== --- stable/9/sys/conf/files Sat Jul 6 20:39:44 2013 (r252897) +++ stable/9/sys/conf/files Sat Jul 6 21:38:55 2013 (r252898) @@ -1463,6 +1463,12 @@ dev/ixgbe/ixgbe_82599.c optional ixgbe compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_x540.c optional ixgbe inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_dcb.c optional ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_dcb_82598.c optional ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/ixgbe/ixgbe_dcb_82599.c optional ixgbe inet \ + compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/jme/if_jme.c optional jme pci dev/joy/joy.c optional joy dev/joy/joy_isa.c optional joy isa Modified: stable/9/sys/dev/ixgbe/README ============================================================================== --- stable/9/sys/dev/ixgbe/README Sat Jul 6 20:39:44 2013 (r252897) +++ stable/9/sys/dev/ixgbe/README Sat Jul 6 21:38:55 2013 (r252898) @@ -2,7 +2,7 @@ FreeBSD Driver for Intel(R) Ethernet 10 ============================================================================ /*$FreeBSD$*/ -November 12, 2010 +Jun 18, 2013 Contents @@ -18,8 +18,8 @@ Contents Overview ======== -This file describes the FreeBSD* driver for the Intel(R) Ethernet 10 Gigabit -Family of Adapters. Driver has been developed for use with FreeBSD 7.2 or later. +This file describes the FreeBSD* driver for the +Intel(R) Ethernet 10 Gigabit Family of Adapters. For questions related to hardware requirements, refer to the documentation supplied with your Intel 10GbE adapter. All hardware requirements listed @@ -42,7 +42,7 @@ optics, or is an Intel(R) Ethernet Serve Intel optics and/or the direct attach cables listed below. When 82599-based SFP+ devices are connected back to back, they should be set to -the same Speed setting via Ethtool. Results may vary if you mix speed settings. +the same Speed setting. Results may vary if you mix speed settings. Supplier Type Part Numbers @@ -70,7 +70,12 @@ Finisar DUAL RATE 1G/10G SFP+ LR (No Avago DUAL RATE 1G/10G SFP+ LR (No Bail) AFCT-701SDZ-IN1 Finistar 1000BASE-T SFP FCLF8522P2BTL Avago 1000BASE-T SFP ABCU-5710RZ - + +NOTE: As of driver version 2.5.13 it is possible to allow the operation +of unsupported modules by setting the static variable 'allow_unsupported_sfp' +to TRUE and rebuilding the driver. If problems occur please assure that they +can be reproduced with fully supported optics first. + 82599-based adapters support all passive and active limiting direct attach cables that comply with SFF-8431 v4.1 and SFF-8472 v10.4 specifications. @@ -224,14 +229,7 @@ all 10 Gigabit adapters. When there is a choice run on a 64bit OS rather than 32, it makes a significant difference in improvement. - The default scheduler SCHED_4BSD is not smart about SMP locality issues. - Significant improvement can be achieved by switching to the ULE scheduler. - - This is done by changing the entry in the config file from SCHED_4BSD to - SCHED_ULE. Note that this is only advisable on FreeBSD 7, on 6.X there have - been stability problems with ULE. - - The interface can generate high number of interrupts. To avoid running + The interface can generate a high number of interrupts. To avoid running into the limit set by the kernel, adjust hw.intr_storm_threshold setting using sysctl: @@ -242,12 +240,10 @@ all 10 Gigabit adapters. hw.intr_storm_threshold=9000 If you still see Interrupt Storm detected messages, increase the limit to a - higher number. - - Best throughput results are seen with a large MTU; use 9000 if possible. + higher number, or the detection can be disabled by setting it to 0. - The default number of descriptors is 1024, increasing this to 2K or even - 4K may improve performance in some workloads, but change carefully. + The default number of descriptors is 2048, increasing or descreasing + may improve performance in some workloads, but change carefully. Known Limitations @@ -284,7 +280,7 @@ issues download your adapter's user guid ---------------------------------------------------------- Some PCI-E x8 slots are actually configured as x4 slots. These slots have insufficient bandwidth for full 10Gbe line rate with dual port 10GbE devices. - The driver can detect this situation and will write the following message in + The driver will detect this situation and will write the following message in the system log: "PCI-Express bandwidth available for this card is not sufficient for optimal performance. For optimal performance a x8 PCI-Express slot is required." Modified: stable/9/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.c Sat Jul 6 20:39:44 2013 (r252897) +++ stable/9/sys/dev/ixgbe/ixgbe.c Sat Jul 6 21:38:55 2013 (r252898) @@ -32,6 +32,7 @@ ******************************************************************************/ /*$FreeBSD$*/ + #ifdef HAVE_KERNEL_OPTION_HEADERS #include "opt_inet.h" #include "opt_inet6.h" @@ -47,7 +48,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.5.7 - STABLE/9"; +char ixgbe_driver_version[] = "2.5.13"; /********************************************************************* * PCI Device ID Table @@ -109,8 +110,7 @@ static void ixgbe_start(struct ifnet static void ixgbe_start_locked(struct tx_ring *, struct ifnet *); #else /* ! IXGBE_LEGACY_TX */ static int ixgbe_mq_start(struct ifnet *, struct mbuf *); -static int ixgbe_mq_start_locked(struct ifnet *, - struct tx_ring *, struct mbuf *); +static int ixgbe_mq_start_locked(struct ifnet *, struct tx_ring *); static void ixgbe_qflush(struct ifnet *); static void ixgbe_deferred_mq_start(void *, int); #endif /* IXGBE_LEGACY_TX */ @@ -122,6 +122,7 @@ static void ixgbe_media_status(struc static int ixgbe_media_change(struct ifnet *); static void ixgbe_identify_hardware(struct adapter *); static int ixgbe_allocate_pci_resources(struct adapter *); +static void ixgbe_get_slot_info(struct ixgbe_hw *); static int ixgbe_allocate_msix(struct adapter *); static int ixgbe_allocate_legacy(struct adapter *); static int ixgbe_allocate_queues(struct adapter *); @@ -149,7 +150,7 @@ static void ixgbe_setup_hw_rsc(struct rx static void ixgbe_enable_intr(struct adapter *); static void ixgbe_disable_intr(struct adapter *); static void ixgbe_update_stats_counters(struct adapter *); -static bool ixgbe_txeof(struct tx_ring *); +static void ixgbe_txeof(struct tx_ring *); static bool ixgbe_rxeof(struct ix_queue *); static void ixgbe_rx_checksum(u32, struct mbuf *, u32); static void ixgbe_set_promisc(struct adapter *); @@ -206,6 +207,9 @@ static void ixgbe_atr(struct tx_ring *, static void ixgbe_reinit_fdir(void *, int); #endif +/* Missing shared code prototype */ +extern void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw); + /********************************************************************* * FreeBSD Device Interface Entry Points *********************************************************************/ @@ -291,6 +295,13 @@ static int ixgbe_rxd = PERFORM_RXD; TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); /* +** Defining this on will allow the use +** of unsupported SFP+ modules, note that +** doing so you are on your own :) +*/ +static int allow_unsupported_sfp = FALSE; + +/* ** HW RSC control: ** this feature only works with ** IPv4, and only on 82599 and later. @@ -507,6 +518,7 @@ ixgbe_attach(device_t dev) } /* Initialize the shared code */ + hw->allow_unsupported_sfp = allow_unsupported_sfp; error = ixgbe_init_shared_code(hw); if (error == IXGBE_ERR_SFP_NOT_PRESENT) { /* @@ -576,24 +588,10 @@ ixgbe_attach(device_t dev) adapter->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, ixgbe_unregister_vlan, adapter, EVENTHANDLER_PRI_FIRST); - /* Print PCIE bus type/speed/width info */ - ixgbe_get_bus_info(hw); - device_printf(dev,"PCI Express Bus: Speed %s %s\n", - ((hw->bus.speed == ixgbe_bus_speed_5000) ? "5.0Gb/s": - (hw->bus.speed == ixgbe_bus_speed_2500) ? "2.5Gb/s":"Unknown"), - (hw->bus.width == ixgbe_bus_width_pcie_x8) ? "Width x8" : - (hw->bus.width == ixgbe_bus_width_pcie_x4) ? "Width x4" : - (hw->bus.width == ixgbe_bus_width_pcie_x1) ? "Width x1" : - ("Unknown")); - - if ((hw->bus.width <= ixgbe_bus_width_pcie_x4) && - (hw->bus.speed == ixgbe_bus_speed_2500)) { - device_printf(dev, "PCI-Express bandwidth available" - " for this card\n is not sufficient for" - " optimal performance.\n"); - device_printf(dev, "For optimal performance a x8 " - "PCIE, or x4 PCIE 2 slot is required.\n"); - } + /* + ** Check PCIE slot type/speed/width + */ + ixgbe_get_slot_info(hw); /* Set an initial default flow control value */ adapter->fc = ixgbe_fc_full; @@ -797,7 +795,7 @@ ixgbe_mq_start(struct ifnet *ifp, struct struct adapter *adapter = ifp->if_softc; struct ix_queue *que; struct tx_ring *txr; - int i = 0, err = 0; + int i, err = 0; /* Which queue to use */ if ((m->m_flags & M_FLOWID) != 0) @@ -808,40 +806,37 @@ ixgbe_mq_start(struct ifnet *ifp, struct txr = &adapter->tx_rings[i]; que = &adapter->queues[i]; + err = drbr_enqueue(ifp, txr->br, m); + if (err) + return (err); if (IXGBE_TX_TRYLOCK(txr)) { - err = ixgbe_mq_start_locked(ifp, txr, m); + err = ixgbe_mq_start_locked(ifp, txr); IXGBE_TX_UNLOCK(txr); - } else { - err = drbr_enqueue(ifp, txr->br, m); + } else taskqueue_enqueue(que->tq, &txr->txq_task); - } return (err); } static int -ixgbe_mq_start_locked(struct ifnet *ifp, struct tx_ring *txr, struct mbuf *m) +ixgbe_mq_start_locked(struct ifnet *ifp, struct tx_ring *txr) { struct adapter *adapter = txr->adapter; struct mbuf *next; - int enqueued, err = 0; + int enqueued = 0, err = 0; if (((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) || - adapter->link_active == 0) { - if (m != NULL) - err = drbr_enqueue(ifp, txr->br, m); - return (err); - } - - enqueued = 0; - if (m != NULL) { - err = drbr_enqueue(ifp, txr->br, m); - if (err) { - return (err); - } - } + adapter->link_active == 0) + return (ENETDOWN); /* Process the queue */ +#if __FreeBSD_version < 901504 + next = drbr_dequeue(ifp, txr->br); + while (next != NULL) { + if ((err = ixgbe_xmit(txr, &next)) != 0) { + if (next != NULL) + err = drbr_enqueue(ifp, txr->br, next); +#else while ((next = drbr_peek(ifp, txr->br)) != NULL) { if ((err = ixgbe_xmit(txr, &next)) != 0) { if (next == NULL) { @@ -849,16 +844,20 @@ ixgbe_mq_start_locked(struct ifnet *ifp, } else { drbr_putback(ifp, txr->br, next); } +#endif break; } +#if __FreeBSD_version >= 901504 drbr_advance(ifp, txr->br); +#endif enqueued++; /* Send a copy of the frame to the BPF listener */ ETHER_BPF_MTAP(ifp, next); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) break; - if (txr->tx_avail < IXGBE_TX_OP_THRESHOLD) - ixgbe_txeof(txr); +#if __FreeBSD_version < 901504 + next = drbr_dequeue(ifp, txr->br); +#endif } if (enqueued > 0) { @@ -885,7 +884,7 @@ ixgbe_deferred_mq_start(void *arg, int p IXGBE_TX_LOCK(txr); if (!drbr_empty(ifp, txr->br)) - ixgbe_mq_start_locked(ifp, txr, NULL); + ixgbe_mq_start_locked(ifp, txr); IXGBE_TX_UNLOCK(txr); } @@ -1418,20 +1417,19 @@ ixgbe_handle_que(void *context, int pend ixgbe_txeof(txr); #ifndef IXGBE_LEGACY_TX if (!drbr_empty(ifp, txr->br)) - ixgbe_mq_start_locked(ifp, txr, NULL); + ixgbe_mq_start_locked(ifp, txr); #else if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) ixgbe_start_locked(txr, ifp); #endif IXGBE_TX_UNLOCK(txr); - if (more) { - taskqueue_enqueue(que->tq, &que->que_task); - return; - } } /* Reenable this interrupt */ - ixgbe_enable_queue(adapter, que->msix); + if (que->res != NULL) + ixgbe_enable_queue(adapter, que->msix); + else + ixgbe_enable_intr(adapter); return; } @@ -1448,9 +1446,10 @@ ixgbe_legacy_irq(void *arg) struct ix_queue *que = arg; struct adapter *adapter = que->adapter; struct ixgbe_hw *hw = &adapter->hw; + struct ifnet *ifp = adapter->ifp; struct tx_ring *txr = adapter->tx_rings; - bool more_tx, more_rx; - u32 reg_eicr, loop = MAX_LOOP; + bool more; + u32 reg_eicr; reg_eicr = IXGBE_READ_REG(hw, IXGBE_EICR); @@ -1461,17 +1460,19 @@ ixgbe_legacy_irq(void *arg) return; } - more_rx = ixgbe_rxeof(que); + more = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); - do { - more_tx = ixgbe_txeof(txr); - } while (loop-- && more_tx); + ixgbe_txeof(txr); +#ifdef IXGBE_LEGACY_TX + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + ixgbe_start_locked(txr, ifp); +#else + if (!drbr_empty(ifp, txr->br)) + ixgbe_mq_start_locked(ifp, txr); +#endif IXGBE_TX_UNLOCK(txr); - if (more_rx || more_tx) - taskqueue_enqueue(que->tq, &que->que_task); - /* Check for fan failure */ if ((hw->phy.media_type == ixgbe_media_type_copper) && (reg_eicr & IXGBE_EICR_GPI_SDP1)) { @@ -1484,7 +1485,10 @@ ixgbe_legacy_irq(void *arg) if (reg_eicr & IXGBE_EICR_LSC) taskqueue_enqueue(adapter->tq, &adapter->link_task); - ixgbe_enable_intr(adapter); + if (more) + taskqueue_enqueue(que->tq, &que->que_task); + else + ixgbe_enable_intr(adapter); return; } @@ -1499,29 +1503,26 @@ ixgbe_msix_que(void *arg) { struct ix_queue *que = arg; struct adapter *adapter = que->adapter; + struct ifnet *ifp = adapter->ifp; struct tx_ring *txr = que->txr; struct rx_ring *rxr = que->rxr; - bool more_tx, more_rx; + bool more; u32 newitr = 0; ixgbe_disable_queue(adapter, que->msix); ++que->irqs; - more_rx = ixgbe_rxeof(que); + more = ixgbe_rxeof(que); IXGBE_TX_LOCK(txr); - more_tx = ixgbe_txeof(txr); - /* - ** Make certain that if the stack - ** has anything queued the task gets - ** scheduled to handle it. - */ + ixgbe_txeof(txr); #ifdef IXGBE_LEGACY_TX - if (!IFQ_DRV_IS_EMPTY(&adapter->ifp->if_snd)) + if (!IFQ_DRV_IS_EMPTY(ifp->if_snd)) + ixgbe_start_locked(txr, ifp); #else - if (!drbr_empty(adapter->ifp, txr->br)) + if (!drbr_empty(ifp, txr->br)) + ixgbe_mq_start_locked(ifp, txr); #endif - more_tx = 1; IXGBE_TX_UNLOCK(txr); /* Do AIM now? */ @@ -1575,9 +1576,9 @@ ixgbe_msix_que(void *arg) rxr->packets = 0; no_calc: - if (more_tx || more_rx) + if (more) taskqueue_enqueue(que->tq, &que->que_task); - else /* Reenable this interrupt */ + else ixgbe_enable_queue(adapter, que->msix); return; } @@ -1639,11 +1640,11 @@ ixgbe_msix_link(void *arg) /* Check for over temp condition */ if ((hw->mac.type == ixgbe_mac_X540) && - (reg_eicr & IXGBE_EICR_GPI_SDP0)) { + (reg_eicr & IXGBE_EICR_TS)) { device_printf(adapter->dev, "\nCRITICAL: OVER TEMP!! " "PHY IS SHUT DOWN!!\n"); device_printf(adapter->dev, "System shutdown required\n"); - IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_GPI_SDP0); + IXGBE_WRITE_REG(hw, IXGBE_EICR, IXGBE_EICR_TS); } IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, IXGBE_EIMS_OTHER); @@ -1892,10 +1893,34 @@ ixgbe_set_promisc(struct adapter *adapte { u_int32_t reg_rctl; struct ifnet *ifp = adapter->ifp; + int mcnt = 0; reg_rctl = IXGBE_READ_REG(&adapter->hw, IXGBE_FCTRL); reg_rctl &= (~IXGBE_FCTRL_UPE); - reg_rctl &= (~IXGBE_FCTRL_MPE); + if (ifp->if_flags & IFF_ALLMULTI) + mcnt = MAX_NUM_MULTICAST_ADDRESSES; + else { + struct ifmultiaddr *ifma; +#if __FreeBSD_version < 800000 + IF_ADDR_LOCK(ifp); +#else + if_maddr_rlock(ifp); +#endif + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) + break; + mcnt++; + } +#if __FreeBSD_version < 800000 + IF_ADDR_UNLOCK(ifp); +#else + if_maddr_runlock(ifp); +#endif + } + if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) + reg_rctl &= (~IXGBE_FCTRL_MPE); IXGBE_WRITE_REG(&adapter->hw, IXGBE_FCTRL, reg_rctl); if (ifp->if_flags & IFF_PROMISC) { @@ -2038,7 +2063,7 @@ ixgbe_local_timer(void *arg) (paused == 0)) ++hung; else if (txr->queue_status == IXGBE_QUEUE_WORKING) - taskqueue_enqueue(que->tq, &que->que_task); + taskqueue_enqueue(que->tq, &txr->txq_task); } /* Only truely watchdog if all queues show hung */ if (hung == adapter->num_queues) @@ -2125,9 +2150,14 @@ ixgbe_stop(void *arg) ixgbe_reset_hw(hw); hw->adapter_stopped = FALSE; ixgbe_stop_adapter(hw); - /* Turn off the laser */ - if (hw->phy.multispeed_fiber) - ixgbe_disable_tx_laser(hw); + if (hw->mac.type == ixgbe_mac_82599EB) + ixgbe_stop_mac_link_on_d3_82599(hw); + /* Turn off the laser - noop with no optics */ + ixgbe_disable_tx_laser(hw); + + /* Update the stack */ + adapter->link_up = FALSE; + ixgbe_update_link_status(adapter); /* reprogram the RAR[0] in case user changed it. */ ixgbe_set_rar(&adapter->hw, 0, adapter->hw.mac.addr, 0, IXGBE_RAH_AV); @@ -2579,7 +2609,11 @@ ixgbe_setup_interface(device_t dev, stru return (-1); } if_initname(ifp, device_get_name(dev), device_get_unit(dev)); +#if __FreeBSD_version < 1000025 ifp->if_baudrate = 1000000000; +#else + if_initbaudrate(ifp, IF_Gbps(10)); +#endif ifp->if_init = ixgbe_init; ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; @@ -2590,6 +2624,8 @@ ixgbe_setup_interface(device_t dev, stru #else ifp->if_start = ixgbe_start; IFQ_SET_MAXLEN(&ifp->if_snd, adapter->num_tx_desc - 2); + ifp->if_snd.ifq_drv_maxlen = adapter->num_tx_desc - 2; + IFQ_SET_READY(&ifp->if_snd); #endif ether_ifattach(ifp, adapter->hw.mac.addr); @@ -3533,7 +3569,7 @@ ixgbe_atr(struct tx_ring *txr, struct mb * tx_buffer is put back on the free queue. * **********************************************************************/ -static bool +static void ixgbe_txeof(struct tx_ring *txr) { struct adapter *adapter = txr->adapter; @@ -3576,13 +3612,13 @@ ixgbe_txeof(struct tx_ring *txr) netmap_tx_irq(ifp, txr->me | (NETMAP_LOCKED_ENTER|NETMAP_LOCKED_EXIT)); } - return FALSE; + return; } #endif /* DEV_NETMAP */ if (txr->tx_avail == txr->num_desc) { txr->queue_status = IXGBE_QUEUE_IDLE; - return FALSE; + return; } /* Get work starting point */ @@ -3676,12 +3712,10 @@ ixgbe_txeof(struct tx_ring *txr) if ((!processed) && ((ticks - txr->watchdog_time) > IXGBE_WATCHDOG)) txr->queue_status = IXGBE_QUEUE_HUNG; - if (txr->tx_avail == txr->num_desc) { + if (txr->tx_avail == txr->num_desc) txr->queue_status = IXGBE_QUEUE_IDLE; - return (FALSE); - } - return TRUE; + return; } /********************************************************************* @@ -4363,6 +4397,7 @@ ixgbe_rxeof(struct ix_queue *que) if (netmap_rx_irq(ifp, rxr->me | NETMAP_LOCKED_ENTER, &processed)) return (FALSE); #endif /* DEV_NETMAP */ + for (i = rxr->next_to_check; count != 0;) { struct mbuf *sendmp, *mp; u32 rsc, ptype; @@ -4552,15 +4587,12 @@ next_desc: IXGBE_RX_UNLOCK(rxr); /* - ** We still have cleaning to do? - ** Schedule another interrupt if so. + ** Still have cleaning to do? */ - if ((staterr & IXGBE_RXD_STAT_DD) != 0) { - ixgbe_rearm_queues(adapter, (u64)(1 << que->msix)); + if ((staterr & IXGBE_RXD_STAT_DD) != 0) return (TRUE); - } - - return (FALSE); + else + return (FALSE); } @@ -4715,11 +4747,11 @@ ixgbe_setup_vlan_hw_support(struct adapt static void ixgbe_enable_intr(struct adapter *adapter) { - struct ixgbe_hw *hw = &adapter->hw; - struct ix_queue *que = adapter->queues; - u32 mask = (IXGBE_EIMS_ENABLE_MASK & ~IXGBE_EIMS_RTX_QUEUE); - + struct ixgbe_hw *hw = &adapter->hw; + struct ix_queue *que = adapter->queues; + u32 mask, fwsm; + mask = (IXGBE_EIMS_ENABLE_MASK & ~IXGBE_EIMS_RTX_QUEUE); /* Enable Fan Failure detection */ if (hw->device_id == IXGBE_DEV_ID_82598AT) mask |= IXGBE_EIMS_GPI_SDP1; @@ -4736,6 +4768,10 @@ ixgbe_enable_intr(struct adapter *adapte break; case ixgbe_mac_X540: mask |= IXGBE_EIMS_ECC; + /* Detect if Thermal Sensor is enabled */ + fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM); + if (fwsm & IXGBE_FWSM_TS_ENABLED) + mask |= IXGBE_EIMS_TS; #ifdef IXGBE_FDIR mask |= IXGBE_EIMS_FLOW_DIR; #endif @@ -4805,6 +4841,111 @@ ixgbe_write_pci_cfg(struct ixgbe_hw *hw, } /* +** Get the width and transaction speed of +** the slot this adapter is plugged into. +*/ +static void +ixgbe_get_slot_info(struct ixgbe_hw *hw) +{ + device_t dev = ((struct ixgbe_osdep *)hw->back)->dev; + struct ixgbe_mac_info *mac = &hw->mac; + u16 link; + u32 offset; + + /* For most devices simply call the shared code routine */ + if (hw->device_id != IXGBE_DEV_ID_82599_SFP_SF_QP) { + ixgbe_get_bus_info(hw); + goto display; + } + + /* + ** For the Quad port adapter we need to parse back + ** up the PCI tree to find the speed of the expansion + ** slot into which this adapter is plugged. A bit more work. + */ + dev = device_get_parent(device_get_parent(dev)); +#ifdef IXGBE_DEBUG + device_printf(dev, "parent pcib = %x,%x,%x\n", + pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev)); +#endif + dev = device_get_parent(device_get_parent(dev)); +#ifdef IXGBE_DEBUG + device_printf(dev, "slot pcib = %x,%x,%x\n", + pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev)); +#endif + /* Now get the PCI Express Capabilities offset */ + pci_find_cap(dev, PCIY_EXPRESS, &offset); + /* ...and read the Link Status Register */ + link = pci_read_config(dev, offset + PCIER_LINK_STA, 2); + switch (link & IXGBE_PCI_LINK_WIDTH) { + case IXGBE_PCI_LINK_WIDTH_1: + hw->bus.width = ixgbe_bus_width_pcie_x1; + break; + case IXGBE_PCI_LINK_WIDTH_2: + hw->bus.width = ixgbe_bus_width_pcie_x2; + break; + case IXGBE_PCI_LINK_WIDTH_4: + hw->bus.width = ixgbe_bus_width_pcie_x4; + break; + case IXGBE_PCI_LINK_WIDTH_8: + hw->bus.width = ixgbe_bus_width_pcie_x8; + break; + default: + hw->bus.width = ixgbe_bus_width_unknown; + break; + } + + switch (link & IXGBE_PCI_LINK_SPEED) { + case IXGBE_PCI_LINK_SPEED_2500: + hw->bus.speed = ixgbe_bus_speed_2500; + break; + case IXGBE_PCI_LINK_SPEED_5000: + hw->bus.speed = ixgbe_bus_speed_5000; + break; + case IXGBE_PCI_LINK_SPEED_8000: + hw->bus.speed = ixgbe_bus_speed_8000; + break; + default: + hw->bus.speed = ixgbe_bus_speed_unknown; + break; + } + + mac->ops.set_lan_id(hw); + +display: + device_printf(dev,"PCI Express Bus: Speed %s %s\n", + ((hw->bus.speed == ixgbe_bus_speed_8000) ? "8.0GT/s": + (hw->bus.speed == ixgbe_bus_speed_5000) ? "5.0GT/s": + (hw->bus.speed == ixgbe_bus_speed_2500) ? "2.5GT/s":"Unknown"), + (hw->bus.width == ixgbe_bus_width_pcie_x8) ? "Width x8" : + (hw->bus.width == ixgbe_bus_width_pcie_x4) ? "Width x4" : + (hw->bus.width == ixgbe_bus_width_pcie_x1) ? "Width x1" : + ("Unknown")); + + if ((hw->device_id != IXGBE_DEV_ID_82599_SFP_SF_QP) && + ((hw->bus.width <= ixgbe_bus_width_pcie_x4) && + (hw->bus.speed == ixgbe_bus_speed_2500))) { + device_printf(dev, "PCI-Express bandwidth available" + " for this card\n is not sufficient for" + " optimal performance.\n"); + device_printf(dev, "For optimal performance a x8 " + "PCIE, or x4 PCIE Gen2 slot is required.\n"); + } + if ((hw->device_id == IXGBE_DEV_ID_82599_SFP_SF_QP) && + ((hw->bus.width <= ixgbe_bus_width_pcie_x8) && + (hw->bus.speed < ixgbe_bus_speed_8000))) { + device_printf(dev, "PCI-Express bandwidth available" + " for this card\n is not sufficient for" + " optimal performance.\n"); + device_printf(dev, "For optimal performance a x8 " + "PCIE Gen3 slot is required.\n"); + } + + return; +} + + +/* ** Setup the correct IVAR register for a particular MSIX interrupt ** (yes this is all very magic and confusing :) ** - entry is the register array entry @@ -5605,6 +5746,7 @@ ixgbe_set_advertise(SYSCTL_HANDLER_ARGS) /* ** Thermal Shutdown Trigger ** - cause a Thermal Overtemp IRQ +** - this now requires firmware enabling */ static int ixgbe_set_thermal_test(SYSCTL_HANDLER_ARGS) Modified: stable/9/sys/dev/ixgbe/ixgbe.h ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe.h Sat Jul 6 20:39:44 2013 (r252897) +++ stable/9/sys/dev/ixgbe/ixgbe.h Sat Jul 6 21:38:55 2013 (r252898) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2001-2012, Intel Corporation + Copyright (c) 2001-2013, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -213,6 +213,7 @@ #define IXGBE_BULK_LATENCY 1200 #define IXGBE_LINK_ITR 2000 + /* ***************************************************************************** * vendor_info_array @@ -230,6 +231,7 @@ typedef struct _ixgbe_vendor_info_t { unsigned int index; } ixgbe_vendor_info_t; + /* This is used to get SFP+ module data */ struct ixgbe_i2c_req { u8 dev_addr; @@ -456,6 +458,7 @@ struct adapter { /* Multicast array memory */ u8 *mta; + /* Misc stats maintained by the driver */ unsigned long dropped_pkts; unsigned long mbuf_defrag_failed; @@ -467,6 +470,7 @@ struct adapter { struct ixgbe_hw_stats stats; }; + /* Precision Time Sync (IEEE 1588) defines */ #define ETHERTYPE_IEEE1588 0x88F7 #define PICOSECS_PER_TICK 20833 @@ -489,6 +493,10 @@ struct adapter { #define IXGBE_CORE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->core_mtx, MA_OWNED) #define IXGBE_TX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->tx_mtx, MA_OWNED) +/* For backward compatibility */ +#if !defined(PCIER_LINK_STA) +#define PCIER_LINK_STA PCIR_EXPRESS_LINK_STA +#endif static inline bool ixgbe_is_sfp(struct ixgbe_hw *hw) Modified: stable/9/sys/dev/ixgbe/ixgbe_82598.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe_82598.c Sat Jul 6 20:39:44 2013 (r252897) +++ stable/9/sys/dev/ixgbe/ixgbe_82598.c Sat Jul 6 21:38:55 2013 (r252898) @@ -166,6 +166,8 @@ s32 ixgbe_init_ops_82598(struct ixgbe_hw /* Manageability interface */ mac->ops.set_fw_drv_ver = NULL; + mac->ops.get_rtrup2tc = NULL; + return ret_val; } @@ -1115,10 +1117,19 @@ static s32 ixgbe_read_i2c_phy_82598(stru u16 sfp_addr = 0; u16 sfp_data = 0; u16 sfp_stat = 0; + u16 gssr; u32 i; DEBUGFUNC("ixgbe_read_i2c_phy_82598"); + if (IXGBE_READ_REG(hw, IXGBE_STATUS) & IXGBE_STATUS_LAN_ID_1) + gssr = IXGBE_GSSR_PHY1_SM; + else + gssr = IXGBE_GSSR_PHY0_SM; + + if (hw->mac.ops.acquire_swfw_sync(hw, gssr) != IXGBE_SUCCESS) + return IXGBE_ERR_SWFW_SYNC; + if (hw->phy.type == ixgbe_phy_nl) { /* * NetLogic phy SDA/SCL registers are at addresses 0xC30A to @@ -1127,17 +1138,17 @@ static s32 ixgbe_read_i2c_phy_82598(stru */ sfp_addr = (dev_addr << 8) + byte_offset; sfp_addr = (sfp_addr | IXGBE_I2C_EEPROM_READ_MASK); - hw->phy.ops.write_reg(hw, - IXGBE_MDIO_PMA_PMD_SDA_SCL_ADDR, - IXGBE_MDIO_PMA_PMD_DEV_TYPE, - sfp_addr); + hw->phy.ops.write_reg_mdi(hw, + IXGBE_MDIO_PMA_PMD_SDA_SCL_ADDR, + IXGBE_MDIO_PMA_PMD_DEV_TYPE, + sfp_addr); /* Poll status */ for (i = 0; i < 100; i++) { - hw->phy.ops.read_reg(hw, - IXGBE_MDIO_PMA_PMD_SDA_SCL_STAT, - IXGBE_MDIO_PMA_PMD_DEV_TYPE, - &sfp_stat); + hw->phy.ops.read_reg_mdi(hw, + IXGBE_MDIO_PMA_PMD_SDA_SCL_STAT, + IXGBE_MDIO_PMA_PMD_DEV_TYPE, + &sfp_stat); sfp_stat = sfp_stat & IXGBE_I2C_EEPROM_STATUS_MASK; if (sfp_stat != IXGBE_I2C_EEPROM_STATUS_IN_PROGRESS) break; @@ -1151,8 +1162,8 @@ static s32 ixgbe_read_i2c_phy_82598(stru } /* Read data */ - hw->phy.ops.read_reg(hw, IXGBE_MDIO_PMA_PMD_SDA_SCL_DATA, - IXGBE_MDIO_PMA_PMD_DEV_TYPE, &sfp_data); + hw->phy.ops.read_reg_mdi(hw, IXGBE_MDIO_PMA_PMD_SDA_SCL_DATA, + IXGBE_MDIO_PMA_PMD_DEV_TYPE, &sfp_data); *eeprom_data = (u8)(sfp_data >> 8); } else { @@ -1160,6 +1171,7 @@ static s32 ixgbe_read_i2c_phy_82598(stru } out: + hw->mac.ops.release_swfw_sync(hw, gssr); return status; } Modified: stable/9/sys/dev/ixgbe/ixgbe_82599.c ============================================================================== --- stable/9/sys/dev/ixgbe/ixgbe_82599.c Sat Jul 6 20:39:44 2013 (r252897) +++ stable/9/sys/dev/ixgbe/ixgbe_82599.c Sat Jul 6 21:38:55 2013 (r252898) @@ -77,7 +77,7 @@ void ixgbe_init_mac_link_ops_82599(struc * and MNG not enabled */ if ((mac->ops.get_media_type(hw) == ixgbe_media_type_fiber) && - !(ixgbe_mng_enabled(hw))) { + !hw->mng_fw_enabled) { mac->ops.disable_tx_laser = &ixgbe_disable_tx_laser_multispeed_fiber; mac->ops.enable_tx_laser = @@ -180,11 +180,13 @@ s32 ixgbe_setup_sfp_modules_82599(struct goto setup_sfp_out; } - hw->eeprom.ops.read(hw, ++data_offset, &data_value); + if (hw->eeprom.ops.read(hw, ++data_offset, &data_value)) + goto setup_sfp_err; while (data_value != 0xffff) { IXGBE_WRITE_REG(hw, IXGBE_CORECTL, data_value); IXGBE_WRITE_FLUSH(hw); - hw->eeprom.ops.read(hw, ++data_offset, &data_value); + if (hw->eeprom.ops.read(hw, ++data_offset, &data_value)) + goto setup_sfp_err; } /* Release the semaphore */ @@ -229,6 +231,15 @@ s32 ixgbe_setup_sfp_modules_82599(struct setup_sfp_out: return ret_val; + +setup_sfp_err: + /* Release the semaphore */ + hw->mac.ops.release_swfw_sync(hw, IXGBE_GSSR_MAC_CSR_SM); + /* Delay obtaining semaphore again to allow FW access */ + msec_delay(hw->eeprom.semaphore_delay); + ERROR_REPORT2(IXGBE_ERROR_INVALID_STATE, + "eeprom read at offset %d failed", data_offset); + return IXGBE_ERR_PHY; } /** @@ -314,6 +325,11 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw mac->ops.set_fw_drv_ver = &ixgbe_set_fw_drv_ver_generic; + mac->ops.get_rtrup2tc = &ixgbe_dcb_get_rtrup2tc_generic; + + /* Cache if MNG FW is up */ + hw->mng_fw_enabled = ixgbe_mng_enabled(hw); + return ret_val; } @@ -479,6 +495,29 @@ out: } /** + * ixgbe_stop_mac_link_on_d3_82599 - Disables link on D3 + * @hw: pointer to hardware structure + * + * Disables link during D3 power down sequence. + * + **/ +void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw) +{ + u32 autoc2_reg; + u16 ee_ctrl_2 = 0; + + DEBUGFUNC("ixgbe_stop_mac_link_on_d3_82599"); + ixgbe_read_eeprom(hw, IXGBE_EEPROM_CTRL_2, &ee_ctrl_2); + + if (!hw->mng_fw_enabled && !hw->wol_enabled && + ee_ctrl_2 & IXGBE_EEPROM_CCD_BIT) { + autoc2_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC2); + autoc2_reg |= IXGBE_AUTOC2_LINK_DISABLE_ON_D3_MASK; + IXGBE_WRITE_REG(hw, IXGBE_AUTOC2, autoc2_reg); + } +} + +/** * ixgbe_start_mac_link_82599 - Setup MAC link settings * @hw: pointer to hardware structure * @autoneg_wait_to_complete: TRUE when waiting for completion is needed @@ -1122,7 +1161,8 @@ s32 ixgbe_reset_hw_82599(struct ixgbe_hw { ixgbe_link_speed link_speed; s32 status; - u32 ctrl, i, autoc, autoc2; + u32 ctrl, i, autoc2; + u32 curr_lms; bool link_up = FALSE; DEBUGFUNC("ixgbe_reset_hw_82599"); @@ -1156,6 +1196,13 @@ s32 ixgbe_reset_hw_82599(struct ixgbe_hw if (hw->phy.reset_disable == FALSE && hw->phy.ops.reset != NULL) hw->phy.ops.reset(hw); + /* remember AUTOC from before we reset */ + if (hw->mac.cached_autoc) + curr_lms = hw->mac.cached_autoc & IXGBE_AUTOC_LMS_MASK; + else + curr_lms = IXGBE_READ_REG(hw, IXGBE_AUTOC) & + IXGBE_AUTOC_LMS_MASK; + mac_reset_top: /* * Issue global reset to the MAC. Needs to be SW reset if link is up. @@ -1204,7 +1251,7 @@ mac_reset_top: * stored off yet. Otherwise restore the stored original * values since the reset operation sets back to defaults. */ - autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); + hw->mac.cached_autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC); autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2); /* Enable link if disabled in NVM */ @@ -1215,12 +1262,24 @@ mac_reset_top: } if (hw->mac.orig_link_settings_stored == FALSE) { - hw->mac.orig_autoc = autoc; + hw->mac.orig_autoc = hw->mac.cached_autoc; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 22:34:44 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 03A24D1B; Sat, 6 Jul 2013 22:34:44 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E8FA41828; Sat, 6 Jul 2013 22:34:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66MYhqb035054; Sat, 6 Jul 2013 22:34:43 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66MYgcn035048; Sat, 6 Jul 2013 22:34:42 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201307062234.r66MYgcn035048@svn.freebsd.org> From: Jack F Vogel Date: Sat, 6 Jul 2013 22:34: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: r252899 - stable/9/sys/dev/e1000 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.14 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, 06 Jul 2013 22:34:44 -0000 Author: jfv Date: Sat Jul 6 22:34:42 2013 New Revision: 252899 URL: http://svnweb.freebsd.org/changeset/base/252899 Log: MFC e1000 driver revisions: 248906,248908,249074,249339,249509 250108,250109,250168,250413,250414 Modified: stable/9/sys/dev/e1000/README stable/9/sys/dev/e1000/if_em.c stable/9/sys/dev/e1000/if_igb.c stable/9/sys/dev/e1000/if_igb.h stable/9/sys/dev/e1000/if_lem.c Directory Properties: stable/9/sys/dev/e1000/ (props changed) Modified: stable/9/sys/dev/e1000/README ============================================================================== --- stable/9/sys/dev/e1000/README Sat Jul 6 21:38:55 2013 (r252898) +++ stable/9/sys/dev/e1000/README Sat Jul 6 22:34:42 2013 (r252899) @@ -389,7 +389,7 @@ For general information and support, go http://support.intel.com If an issue is identified, support is through email only at: -freebsdnic@mailbox.intel.com +freebsd@intel.com License Modified: stable/9/sys/dev/e1000/if_em.c ============================================================================== --- stable/9/sys/dev/e1000/if_em.c Sat Jul 6 21:38:55 2013 (r252898) +++ stable/9/sys/dev/e1000/if_em.c Sat Jul 6 22:34:42 2013 (r252899) @@ -94,7 +94,7 @@ int em_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char em_driver_version[] = "7.3.7"; +char em_driver_version[] = "7.3.8"; /********************************************************************* * PCI Device ID Table @@ -2141,12 +2141,37 @@ em_set_promisc(struct adapter *adapter) static void em_disable_promisc(struct adapter *adapter) { - u32 reg_rctl; + struct ifnet *ifp = adapter->ifp; + u32 reg_rctl; + int mcnt = 0; reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); - reg_rctl &= (~E1000_RCTL_UPE); - reg_rctl &= (~E1000_RCTL_MPE); + if (ifp->if_flags & IFF_ALLMULTI) + mcnt = MAX_NUM_MULTICAST_ADDRESSES; + else { + struct ifmultiaddr *ifma; +#if __FreeBSD_version < 800000 + IF_ADDR_LOCK(ifp); +#else + if_maddr_rlock(ifp); +#endif + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) + break; + mcnt++; + } +#if __FreeBSD_version < 800000 + IF_ADDR_UNLOCK(ifp); +#else + if_maddr_runlock(ifp); +#endif + } + /* Don't disable if in MAX groups */ + if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) + reg_rctl &= (~E1000_RCTL_MPE); reg_rctl &= (~E1000_RCTL_SBP); E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); } @@ -4295,11 +4320,12 @@ em_initialize_receive_unit(struct adapte E1000_WRITE_REG(hw, E1000_RFCTL, E1000_RFCTL_ACK_DIS); } - if (ifp->if_capenable & IFCAP_RXCSUM) { - rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); - rxcsum |= (E1000_RXCSUM_IPOFL | E1000_RXCSUM_TUOFL); - E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); - } + rxcsum = E1000_READ_REG(hw, E1000_RXCSUM); + if (ifp->if_capenable & IFCAP_RXCSUM) + rxcsum |= E1000_RXCSUM_TUOFL; + else + rxcsum &= ~E1000_RXCSUM_TUOFL; + E1000_WRITE_REG(hw, E1000_RXCSUM, rxcsum); /* ** XXX TEMPORARY WORKAROUND: on some systems with 82573 @@ -4603,31 +4629,23 @@ em_fixup_rx(struct rx_ring *rxr) static void em_receive_checksum(struct e1000_rx_desc *rx_desc, struct mbuf *mp) { + mp->m_pkthdr.csum_flags = 0; + /* Ignore Checksum bit is set */ - if (rx_desc->status & E1000_RXD_STAT_IXSM) { - mp->m_pkthdr.csum_flags = 0; + if (rx_desc->status & E1000_RXD_STAT_IXSM) return; - } - - if (rx_desc->status & E1000_RXD_STAT_IPCS) { - /* Did it pass? */ - if (!(rx_desc->errors & E1000_RXD_ERR_IPE)) { - /* IP Checksum Good */ - mp->m_pkthdr.csum_flags = CSUM_IP_CHECKED; - mp->m_pkthdr.csum_flags |= CSUM_IP_VALID; - } else { - mp->m_pkthdr.csum_flags = 0; - } - } + if (rx_desc->errors & (E1000_RXD_ERR_TCPE | E1000_RXD_ERR_IPE)) + return; - if (rx_desc->status & E1000_RXD_STAT_TCPCS) { - /* Did it pass? */ - if (!(rx_desc->errors & E1000_RXD_ERR_TCPE)) { - mp->m_pkthdr.csum_flags |= - (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); - mp->m_pkthdr.csum_data = htons(0xffff); - } + /* IP Checksum Good? */ + if (rx_desc->status & E1000_RXD_STAT_IPCS) + mp->m_pkthdr.csum_flags = (CSUM_IP_CHECKED | CSUM_IP_VALID); + + /* TCP or UDP checksum */ + if (rx_desc->status & (E1000_RXD_STAT_TCPCS | E1000_RXD_STAT_UDPCS)) { + mp->m_pkthdr.csum_flags |= (CSUM_DATA_VALID | CSUM_PSEUDO_HDR); + mp->m_pkthdr.csum_data = htons(0xffff); } } Modified: stable/9/sys/dev/e1000/if_igb.c ============================================================================== --- stable/9/sys/dev/e1000/if_igb.c Sat Jul 6 21:38:55 2013 (r252898) +++ stable/9/sys/dev/e1000/if_igb.c Sat Jul 6 22:34:42 2013 (r252899) @@ -42,7 +42,7 @@ #include #include -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX #include #endif #include @@ -100,7 +100,7 @@ int igb_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char igb_driver_version[] = "version - 2.3.9"; +char igb_driver_version[] = "version - 2.3.10"; /********************************************************************* @@ -179,7 +179,7 @@ static int igb_detach(device_t); static int igb_shutdown(device_t); static int igb_suspend(device_t); static int igb_resume(device_t); -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX static int igb_mq_start(struct ifnet *, struct mbuf *); static int igb_mq_start_locked(struct ifnet *, struct tx_ring *); static void igb_qflush(struct ifnet *); @@ -374,9 +374,9 @@ SYSCTL_INT(_hw_igb, OID_AUTO, header_spl "Enable receive mbuf header split"); /* -** This will autoconfigure based on -** the number of CPUs and max supported MSI-X messages -** if left at 0. +** This will autoconfigure based on the +** number of CPUs and max supported +** MSIX messages if left at 0. */ static int igb_num_queues = 0; TUNABLE_INT("hw.igb.num_queues", &igb_num_queues); @@ -851,7 +851,7 @@ igb_resume(device_t dev) (ifp->if_drv_flags & IFF_DRV_RUNNING) && adapter->link_active) { for (int i = 0; i < adapter->num_queues; i++, txr++) { IGB_TX_LOCK(txr); -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX /* Process the stack queue only if not depleted */ if (((txr->queue_status & IGB_QUEUE_DEPLETED) == 0) && !drbr_empty(ifp, txr->br)) @@ -869,7 +869,7 @@ igb_resume(device_t dev) } -#if __FreeBSD_version < 800000 +#ifdef IGB_LEGACY_TX /********************************************************************* * Transmit entry point @@ -947,7 +947,7 @@ igb_start(struct ifnet *ifp) return; } -#else /* __FreeBSD_version >= 800000 */ +#else /* ~IGB_LEGACY_TX */ /* ** Multiqueue Transmit Entry: @@ -1062,7 +1062,7 @@ igb_qflush(struct ifnet *ifp) } if_qflush(ifp); } -#endif /* __FreeBSD_version >= 800000 */ +#endif /* ~IGB_LEGACY_TX */ /********************************************************************* * Ioctl entry point @@ -1388,7 +1388,7 @@ igb_handle_que(void *context, int pendin IGB_TX_LOCK(txr); igb_txeof(txr); -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX /* Process the stack queue only if not depleted */ if (((txr->queue_status & IGB_QUEUE_DEPLETED) == 0) && !drbr_empty(ifp, txr->br)) @@ -1439,7 +1439,7 @@ igb_handle_link_locked(struct adapter *a if ((ifp->if_drv_flags & IFF_DRV_RUNNING) && adapter->link_active) { for (int i = 0; i < adapter->num_queues; i++, txr++) { IGB_TX_LOCK(txr); -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX /* Process the stack queue only if not depleted */ if (((txr->queue_status & IGB_QUEUE_DEPLETED) == 0) && !drbr_empty(ifp, txr->br)) @@ -1541,7 +1541,7 @@ igb_poll(struct ifnet *ifp, enum poll_cm do { more = igb_txeof(txr); } while (loop-- && more); -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX if (!drbr_empty(ifp, txr->br)) igb_mq_start_locked(ifp, txr); #else @@ -1576,7 +1576,7 @@ igb_msix_que(void *arg) IGB_TX_LOCK(txr); igb_txeof(txr); -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX /* Process the stack queue only if not depleted */ if (((txr->queue_status & IGB_QUEUE_DEPLETED) == 0) && !drbr_empty(ifp, txr->br)) @@ -2096,7 +2096,9 @@ static void igb_disable_promisc(struct adapter *adapter) { struct e1000_hw *hw = &adapter->hw; + struct ifnet *ifp = adapter->ifp; u32 reg; + int mcnt = 0; if (adapter->vf_ifp) { e1000_promisc_set_vf(hw, e1000_promisc_disabled); @@ -2104,7 +2106,31 @@ igb_disable_promisc(struct adapter *adap } reg = E1000_READ_REG(hw, E1000_RCTL); reg &= (~E1000_RCTL_UPE); - reg &= (~E1000_RCTL_MPE); + if (ifp->if_flags & IFF_ALLMULTI) + mcnt = MAX_NUM_MULTICAST_ADDRESSES; + else { + struct ifmultiaddr *ifma; +#if __FreeBSD_version < 800000 + IF_ADDR_LOCK(ifp); +#else + if_maddr_rlock(ifp); +#endif + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) + break; + mcnt++; + } +#if __FreeBSD_version < 800000 + IF_ADDR_UNLOCK(ifp); +#else + if_maddr_runlock(ifp); +#endif + } + /* Don't disable if in MAX groups */ + if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) + reg &= (~E1000_RCTL_MPE); E1000_WRITE_REG(hw, E1000_RCTL, reg); } @@ -2448,7 +2474,6 @@ igb_allocate_legacy(struct adapter *adap { device_t dev = adapter->dev; struct igb_queue *que = adapter->queues; - struct tx_ring *txr = adapter->tx_rings; int error, rid = 0; /* Turn off all interrupts */ @@ -2467,8 +2492,8 @@ igb_allocate_legacy(struct adapter *adap return (ENXIO); } -#if __FreeBSD_version >= 800000 - TASK_INIT(&txr->txq_task, 0, igb_deferred_mq_start, txr); +#ifndef IGB_LEGACY_TX + TASK_INIT(&que->txr->txq_task, 0, igb_deferred_mq_start, que->txr); #endif /* @@ -2551,7 +2576,7 @@ igb_allocate_msix(struct adapter *adapte i,igb_last_bind_cpu); igb_last_bind_cpu = CPU_NEXT(igb_last_bind_cpu); } -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX TASK_INIT(&que->txr->txq_task, 0, igb_deferred_mq_start, que->txr); #endif @@ -2777,7 +2802,7 @@ igb_free_pci_resources(struct adapter *a for (int i = 0; i < adapter->num_queues; i++, que++) { if (que->tq != NULL) { -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX taskqueue_drain(que->tq, &que->txr->txq_task); #endif taskqueue_drain(que->tq, &que->que_task); @@ -3087,7 +3112,7 @@ igb_setup_interface(device_t dev, struct ifp->if_softc = adapter; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = igb_ioctl; -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX ifp->if_transmit = igb_mq_start; ifp->if_qflush = igb_qflush; #else @@ -3331,7 +3356,7 @@ igb_allocate_queues(struct adapter *adap error = ENOMEM; goto err_tx_desc; } -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX /* Allocate a buf ring */ txr->br = buf_ring_alloc(igb_buf_ring_size, M_DEVBUF, M_WAITOK, &txr->tx_mtx); @@ -3392,7 +3417,7 @@ err_tx_desc: igb_dma_free(adapter, &txr->txdma); free(adapter->rx_rings, M_DEVBUF); rx_fail: -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX buf_ring_free(txr->br, M_DEVBUF); #endif free(adapter->tx_rings, M_DEVBUF); @@ -3650,7 +3675,7 @@ igb_free_transmit_buffers(struct tx_ring tx_buffer->map = NULL; } } -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX if (txr->br != NULL) buf_ring_free(txr->br, M_DEVBUF); #endif @@ -4854,7 +4879,7 @@ igb_rxeof(struct igb_queue *que, int cou rxr->fmp->m_pkthdr.ether_vtag = vtag; rxr->fmp->m_flags |= M_VLANTAG; } -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX rxr->fmp->m_pkthdr.flowid = que->msix; rxr->fmp->m_flags |= M_FLOWID; #endif Modified: stable/9/sys/dev/e1000/if_igb.h ============================================================================== --- stable/9/sys/dev/e1000/if_igb.h Sat Jul 6 21:38:55 2013 (r252898) +++ stable/9/sys/dev/e1000/if_igb.h Sat Jul 6 22:34:42 2013 (r252899) @@ -297,7 +297,7 @@ struct tx_ring { u32 next_to_clean; volatile u16 tx_avail; struct igb_tx_buffer *tx_buffers; -#if __FreeBSD_version >= 800000 +#ifndef IGB_LEGACY_TX struct buf_ring *br; struct task txq_task; #endif Modified: stable/9/sys/dev/e1000/if_lem.c ============================================================================== --- stable/9/sys/dev/e1000/if_lem.c Sat Jul 6 21:38:55 2013 (r252898) +++ stable/9/sys/dev/e1000/if_lem.c Sat Jul 6 22:34:42 2013 (r252899) @@ -85,7 +85,7 @@ /********************************************************************* * Legacy Em Driver version: *********************************************************************/ -char lem_driver_version[] = "1.0.5"; +char lem_driver_version[] = "1.0.6"; /********************************************************************* * PCI Device ID Table @@ -1868,12 +1868,37 @@ lem_set_promisc(struct adapter *adapter) static void lem_disable_promisc(struct adapter *adapter) { - u32 reg_rctl; + struct ifnet *ifp = adapter->ifp; + u32 reg_rctl; + int mcnt = 0; reg_rctl = E1000_READ_REG(&adapter->hw, E1000_RCTL); - reg_rctl &= (~E1000_RCTL_UPE); - reg_rctl &= (~E1000_RCTL_MPE); + if (ifp->if_flags & IFF_ALLMULTI) + mcnt = MAX_NUM_MULTICAST_ADDRESSES; + else { + struct ifmultiaddr *ifma; +#if __FreeBSD_version < 800000 + IF_ADDR_LOCK(ifp); +#else + if_maddr_rlock(ifp); +#endif + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + if (mcnt == MAX_NUM_MULTICAST_ADDRESSES) + break; + mcnt++; + } +#if __FreeBSD_version < 800000 + IF_ADDR_UNLOCK(ifp); +#else + if_maddr_runlock(ifp); +#endif + } + /* Don't disable if in MAX groups */ + if (mcnt < MAX_NUM_MULTICAST_ADDRESSES) + reg_rctl &= (~E1000_RCTL_MPE); reg_rctl &= (~E1000_RCTL_SBP); E1000_WRITE_REG(&adapter->hw, E1000_RCTL, reg_rctl); } From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 22:39:17 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BE962E87; Sat, 6 Jul 2013 22:39:17 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B0287184E; Sat, 6 Jul 2013 22:39:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66MdHtr035600; Sat, 6 Jul 2013 22:39:17 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66MdHaO035599; Sat, 6 Jul 2013 22:39:17 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307062239.r66MdHaO035599@svn.freebsd.org> From: Dimitry Andric Date: Sat, 6 Jul 2013 22:39:17 +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: r252900 - stable/9/contrib/llvm/tools/clang/lib/Basic 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.14 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, 06 Jul 2013 22:39:17 -0000 Author: dim Date: Sat Jul 6 22:39:17 2013 New Revision: 252900 URL: http://svnweb.freebsd.org/changeset/base/252900 Log: Fix minor mis-merge in contrib/llvm/tools/clang/lib/Basic/Targets.cpp, reducing the diff against the file in head. Modified: stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Modified: stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Sat Jul 6 22:34:42 2013 (r252899) +++ stable/9/contrib/llvm/tools/clang/lib/Basic/Targets.cpp Sat Jul 6 22:39:17 2013 (r252900) @@ -249,11 +249,10 @@ protected: unsigned Release = Triple.getOSMajorVersion(); if (Release == 0U) - Release = 8U; + Release = 8; - Builder.defineMacro("__FreeBSD__", llvm::Twine(Release)); - Builder.defineMacro("__FreeBSD_cc_version", - llvm::Twine(Release * 100000U + 1U)); + Builder.defineMacro("__FreeBSD__", Twine(Release)); + Builder.defineMacro("__FreeBSD_cc_version", Twine(Release * 100000U + 1U)); Builder.defineMacro("__KPRINTF_ATTRIBUTE__"); DefineStd(Builder, "unix", Opts); Builder.defineMacro("__ELF__"); From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 22:51:56 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 95875185; Sat, 6 Jul 2013 22:51:56 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8711C189D; Sat, 6 Jul 2013 22:51:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66MpuYq040336; Sat, 6 Jul 2013 22:51:56 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66Mpuhn040335; Sat, 6 Jul 2013 22:51:56 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201307062251.r66Mpuhn040335@svn.freebsd.org> From: Dimitry Andric Date: Sat, 6 Jul 2013 22:51: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: r252901 - stable/9/contrib/llvm/tools/clang/lib/Sema 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.14 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, 06 Jul 2013 22:51:56 -0000 Author: dim Date: Sat Jul 6 22:51:56 2013 New Revision: 252901 URL: http://svnweb.freebsd.org/changeset/base/252901 Log: MFC r252587: Pull in r185446 from clang trunk: Fix to PR15826 - clang hits assert in clang::ASTContext::getASTRecordLayout. Reported by: glebius Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Directory Properties: stable/9/contrib/llvm/ (props changed) stable/9/contrib/llvm/tools/clang/ (props changed) Modified: stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp ============================================================================== --- stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Sat Jul 6 22:39:17 2013 (r252900) +++ stable/9/contrib/llvm/tools/clang/lib/Sema/SemaDecl.cpp Sat Jul 6 22:51:56 2013 (r252901) @@ -10296,7 +10296,8 @@ void Sema::ActOnTagFinishDefinition(Scop Tag->setTopLevelDeclInObjCContainer(); // Notify the consumer that we've defined a tag. - Consumer.HandleTagDeclDefinition(Tag); + if (!Tag->isInvalidDecl()) + Consumer.HandleTagDeclDefinition(Tag); } void Sema::ActOnObjCContainerFinishDefinition() { From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 23:05:00 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3796B835; Sat, 6 Jul 2013 23:05:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2972E191E; Sat, 6 Jul 2013 23:05:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66N50k4043913; Sat, 6 Jul 2013 23:05:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66N4xek043897; Sat, 6 Jul 2013 23:04:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307062304.r66N4xek043897@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 23:04: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: r252902 - stable/9/sys/dev/hpt27xx 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.14 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, 06 Jul 2013 23:05:00 -0000 Author: delphij Date: Sat Jul 6 23:04:59 2013 New Revision: 252902 URL: http://svnweb.freebsd.org/changeset/base/252902 Log: MFC r252852: Update hpt27xx(4) driver to address a problem reported by FreeNAS user, where when more than one hpt27xx adapters are being used, the "unit number" stays at 0. Many thanks to HighPoint for providing this driver update. (This changeset have not included change found in 249468) Modified: stable/9/sys/dev/hpt27xx/hpt27xx_config.c stable/9/sys/dev/hpt27xx/osm_bsd.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/hpt27xx/hpt27xx_config.c ============================================================================== --- stable/9/sys/dev/hpt27xx/hpt27xx_config.c Sat Jul 6 22:51:56 2013 (r252901) +++ stable/9/sys/dev/hpt27xx/hpt27xx_config.c Sat Jul 6 23:04:59 2013 (r252902) @@ -60,7 +60,7 @@ int init_config(void) const char driver_name[] = "hpt27xx"; const char driver_name_long[] = "RocketRAID 27xx controller driver"; -const char driver_ver[] = "v1.0"; +const char driver_ver[] = "v1.1"; int osm_max_targets = 0xff; Modified: stable/9/sys/dev/hpt27xx/osm_bsd.c ============================================================================== --- stable/9/sys/dev/hpt27xx/osm_bsd.c Sat Jul 6 22:51:56 2013 (r252901) +++ stable/9/sys/dev/hpt27xx/osm_bsd.c Sat Jul 6 23:04:59 2013 (r252902) @@ -944,7 +944,6 @@ static void hpt_stop_tasks(PVBUS_EXT vbu static d_open_t hpt_open; static d_close_t hpt_close; static d_ioctl_t hpt_ioctl; -static void hpt_bus_scan_cb(struct cam_periph *periph, union ccb *ccb); static int hpt_rescan_bus(void); static struct cdevsw hpt_cdevsw = { @@ -974,7 +973,7 @@ static struct intr_config_hook hpt_ich; */ static void hpt_final_init(void *dummy) { - int i; + int i,unit_number=0; PVBUS_EXT vbus_ext; PVBUS vbus; PHBA hba; @@ -1058,12 +1057,12 @@ static void hpt_final_init(void *dummy) #if __FreeBSD_version > 700025 vbus_ext->sim = cam_sim_alloc(hpt_action, hpt_poll, driver_name, - vbus_ext, 0, &Giant, os_max_queue_comm, /*tagged*/8, devq); + vbus_ext, unit_number, &Giant, os_max_queue_comm, /*tagged*/8, devq); #else vbus_ext->sim = cam_sim_alloc(hpt_action, hpt_poll, driver_name, - vbus_ext, 0, os_max_queue_comm, /*tagged*/8, devq); + vbus_ext, unit_number, os_max_queue_comm, /*tagged*/8, devq); #endif - + unit_number++; if (!vbus_ext->sim) { os_printk("cam_sim_alloc failed"); cam_simq_free(devq); @@ -1337,44 +1336,26 @@ invalid: static int hpt_rescan_bus(void) { - struct cam_path *path; union ccb *ccb; PVBUS vbus; PVBUS_EXT vbus_ext; -#if (__FreeBSD_version >= 500000) mtx_lock(&Giant); -#endif ldm_for_each_vbus(vbus, vbus_ext) { - if (xpt_create_path(&path, xpt_periph, cam_sim_path(vbus_ext->sim), + if ((ccb = xpt_alloc_ccb()) == NULL) + { + return(ENOMEM); + } + if (xpt_create_path(&ccb->ccb_h.path, xpt_periph, cam_sim_path(vbus_ext->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) + { + xpt_free_ccb(ccb); return(EIO); - if ((ccb = malloc(sizeof(union ccb), M_TEMP, M_WAITOK)) == NULL) - return(ENOMEM); - bzero(ccb, sizeof(union ccb)); - xpt_setup_ccb(&ccb->ccb_h, path, 5); - ccb->ccb_h.func_code = XPT_SCAN_BUS; - ccb->ccb_h.cbfcnp = hpt_bus_scan_cb; - ccb->crcn.flags = CAM_FLAG_NONE; - xpt_action(ccb); + } + xpt_rescan(ccb); } - -#if (__FreeBSD_version >= 500000) mtx_unlock(&Giant); -#endif - return(0); } -static void hpt_bus_scan_cb(struct cam_periph *periph, union ccb *ccb) -{ - if (ccb->ccb_h.status != CAM_REQ_CMP) - KdPrint(("cam_scan_callback: failure status = %x",ccb->ccb_h.status)); - else - KdPrint(("Scan bus successfully!")); - - xpt_free_path(ccb->ccb_h.path); - free(ccb, M_TEMP); - return; -} From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 23:26:38 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C3313C4C; Sat, 6 Jul 2013 23:26:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A5018197E; Sat, 6 Jul 2013 23:26:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66NQcAR050198; Sat, 6 Jul 2013 23:26:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66NQaJS050189; Sat, 6 Jul 2013 23:26:36 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307062326.r66NQaJS050189@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 23:26: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: r252903 - in stable/9: share/man/man4 sys/amd64/conf sys/conf sys/dev/hpt27xx sys/dev/hptnr sys/i386/conf sys/modules sys/modules/hpt27xx sys/modules/hptnr 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.14 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, 06 Jul 2013 23:26:38 -0000 Author: delphij Date: Sat Jul 6 23:26:36 2013 New Revision: 252903 URL: http://svnweb.freebsd.org/changeset/base/252903 Log: MFC r252867: Import HighPoint DC Series Data Center HBA (DC7280 and R750) driver. This driver works for FreeBSD/i386 and FreeBSD/amd64 platforms. Many thanks to HighPoint for providing this driver. (This changeset have not included changes found in 249468 and 246713) Added: stable/9/share/man/man4/hptnr.4 - copied unchanged from r252867, head/share/man/man4/hptnr.4 stable/9/sys/dev/hpt27xx/hpt27xx_os_bsd.c - copied unchanged from r252867, head/sys/dev/hpt27xx/hpt27xx_os_bsd.c stable/9/sys/dev/hpt27xx/hpt27xx_osm_bsd.c - copied unchanged from r252902, stable/9/sys/dev/hpt27xx/osm_bsd.c stable/9/sys/dev/hptnr/ - copied from r252867, head/sys/dev/hptnr/ stable/9/sys/modules/hptnr/ - copied from r252867, head/sys/modules/hptnr/ Deleted: stable/9/sys/dev/hpt27xx/os_bsd.c stable/9/sys/dev/hpt27xx/osm_bsd.c Modified: stable/9/share/man/man4/Makefile stable/9/sys/amd64/conf/GENERIC stable/9/sys/amd64/conf/NOTES stable/9/sys/conf/WITHOUT_SOURCELESS_HOST stable/9/sys/conf/files.amd64 stable/9/sys/conf/files.i386 stable/9/sys/dev/hptnr/hptnr_osm_bsd.c stable/9/sys/i386/conf/GENERIC stable/9/sys/i386/conf/NOTES stable/9/sys/i386/conf/PAE stable/9/sys/i386/conf/XEN stable/9/sys/modules/Makefile stable/9/sys/modules/hpt27xx/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 Sat Jul 6 23:04:59 2013 (r252902) +++ stable/9/share/man/man4/Makefile Sat Jul 6 23:26:36 2013 (r252903) @@ -157,6 +157,7 @@ MAN= aac.4 \ ${_hpt27xx.4} \ ${_hptiop.4} \ ${_hptmv.4} \ + ${_hptnr.4} \ ${_hptrr.4} \ hwpmc.4 \ ichsmb.4 \ @@ -720,6 +721,7 @@ _dpms.4= dpms.4 _hpt27xx.4= hpt27xx.4 _hptiop.4= hptiop.4 _hptmv.4= hptmv.4 +_hptnr.4= hptnr.4 _hptrr.4= hptrr.4 _i8254.4= i8254.4 _ichwd.4= ichwd.4 Copied: stable/9/share/man/man4/hptnr.4 (from r252867, head/share/man/man4/hptnr.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man4/hptnr.4 Sat Jul 6 23:26:36 2013 (r252903, copy of r252867, head/share/man/man4/hptnr.4) @@ -0,0 +1,92 @@ +.\"- +.\" Copyright (c) 2013 iXsystems, Inc. +.\" 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 DEVELOPERS ``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 DEVELOPERS 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 5, 2013 +.Dt HPTNR 4 +.Os +.Sh NAME +.Nm hptnr +.Nd "HighPoint DC Series Data Center HBA card driver" +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device hptnr" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hptnr_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +driver provides support for HighPoint's DC Series Data Center HBA card. +.Sh HARDWARE +The +.Nm +driver supports the following SATA +controllers: +.Pp +.Bl -bullet -compact +.It +HighPoint's DC7280 series +.It +HighPoint's Rocket R750 series +.El +.Sh NOTES +The +.Nm +driver only works on the i386 and amd64 platforms as it requires a binary +blob object from the manufacturer which they only supply for these platforms. +The +.Nm +driver does +.Em not +work on i386 with +.Xr pae 4 +enabled. +.Sh SEE ALSO +.Xr kld 4 , +.Xr kldload 8 , +.Xr loader 8 +.Sh HISTORY +The +.Nm +device driver first appeared in +.Fx 9.2 . +.Sh AUTHORS +.An -nosplit +The +.Nm +device driver was written by +.An HighPoint Technologies, Inc. . +This manual page was written by +.An Xin LI Aq delphij@FreeBSD.org +for iXsystems, Inc. Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Sat Jul 6 23:04:59 2013 (r252902) +++ stable/9/sys/amd64/conf/GENERIC Sat Jul 6 23:26:36 2013 (r252903) @@ -134,6 +134,7 @@ device arcmsr # Areca SATA II RAID device ciss # Compaq Smart RAID 5* device dpt # DPT Smartcache III, IV - See NOTES for options device hptmv # Highpoint RocketRAID 182x +device hptnr # Highpoint DC7280, R750 device hptrr # Highpoint RocketRAID 17xx, 22xx, 23xx, 25xx device hpt27xx # Highpoint RocketRAID 27xx device iir # Intel Integrated RAID Modified: stable/9/sys/amd64/conf/NOTES ============================================================================== --- stable/9/sys/amd64/conf/NOTES Sat Jul 6 23:04:59 2013 (r252902) +++ stable/9/sys/amd64/conf/NOTES Sat Jul 6 23:26:36 2013 (r252903) @@ -419,6 +419,10 @@ device hpt27xx device hptmv # +# Highpoint DC7280 and R750. +device hptnr + +# # Highpoint RocketRAID. Supports RR172x, RR222x, RR2240, RR232x, RR2340, # RR2210, RR174x, RR2522, RR231x, RR230x. device hptrr Modified: stable/9/sys/conf/WITHOUT_SOURCELESS_HOST ============================================================================== --- stable/9/sys/conf/WITHOUT_SOURCELESS_HOST Sat Jul 6 23:04:59 2013 (r252902) +++ stable/9/sys/conf/WITHOUT_SOURCELESS_HOST Sat Jul 6 23:26:36 2013 (r252903) @@ -6,5 +6,6 @@ nodevice hpt27xx nodevice hptmv +nodevice hptnr nodevice hptrr nodevice nve Modified: stable/9/sys/conf/files.amd64 ============================================================================== --- stable/9/sys/conf/files.amd64 Sat Jul 6 23:04:59 2013 (r252902) +++ stable/9/sys/conf/files.amd64 Sat Jul 6 23:26:36 2013 (r252903) @@ -62,10 +62,17 @@ hpt27xx_lib.o optional hpt27xx \ dependency "$S/dev/hpt27xx/amd64-elf.hpt27xx_lib.o.uu" \ compile-with "uudecode < $S/dev/hpt27xx/amd64-elf.hpt27xx_lib.o.uu" \ no-implicit-rule +# hptmvraid.o optional hptmv \ dependency "$S/dev/hptmv/amd64-elf.raid.o.uu" \ compile-with "uudecode < $S/dev/hptmv/amd64-elf.raid.o.uu" \ no-implicit-rule +# +hptnr_lib.o optional hptnr \ + dependency "$S/dev/hptnr/amd64-elf.hptnr_lib.o.uu" \ + compile-with "uudecode < $S/dev/hptnr/amd64-elf.hptnr_lib.o.uu" \ + no-implicit-rule +# hptrr_lib.o optional hptrr \ dependency "$S/dev/hptrr/amd64-elf.hptrr_lib.o.uu" \ compile-with "uudecode < $S/dev/hptrr/amd64-elf.hptrr_lib.o.uu" \ @@ -191,14 +198,17 @@ dev/fdc/fdc.c optional fdc dev/fdc/fdc_acpi.c optional fdc dev/fdc/fdc_isa.c optional fdc isa dev/fdc/fdc_pccard.c optional fdc pccard -dev/hpt27xx/os_bsd.c optional hpt27xx -dev/hpt27xx/osm_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_os_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_osm_bsd.c optional hpt27xx dev/hpt27xx/hpt27xx_config.c optional hpt27xx dev/hptmv/entry.c optional hptmv dev/hptmv/mv.c optional hptmv dev/hptmv/gui_lib.c optional hptmv dev/hptmv/hptproc.c optional hptmv dev/hptmv/ioctl.c optional hptmv +dev/hptnr/hptnr_os_bsd.c optional hptnr +dev/hptnr/hptnr_osm_bsd.c optional hptnr +dev/hptnr/hptnr_config.c optional hptnr dev/hptrr/hptrr_os_bsd.c optional hptrr dev/hptrr/hptrr_osm_bsd.c optional hptrr dev/hptrr/hptrr_config.c optional hptrr Modified: stable/9/sys/conf/files.i386 ============================================================================== --- stable/9/sys/conf/files.i386 Sat Jul 6 23:04:59 2013 (r252902) +++ stable/9/sys/conf/files.i386 Sat Jul 6 23:26:36 2013 (r252903) @@ -61,11 +61,17 @@ hpt27xx_lib.o optional hpt27xx \ dependency "$S/dev/hpt27xx/i386-elf.hpt27xx_lib.o.uu" \ compile-with "uudecode < $S/dev/hpt27xx/i386-elf.hpt27xx_lib.o.uu" \ no-implicit-rule +# hptmvraid.o optional hptmv \ dependency "$S/dev/hptmv/i386-elf.raid.o.uu" \ compile-with "uudecode < $S/dev/hptmv/i386-elf.raid.o.uu" \ no-implicit-rule # +hptnr_lib.o optional hptnr \ + dependency "$S/dev/hptnr/i386-elf.hptnr_lib.o.uu" \ + compile-with "uudecode < $S/dev/hptnr/i386-elf.hptnr_lib.o.uu" \ + no-implicit-rule +# hptrr_lib.o optional hptrr \ dependency "$S/dev/hptrr/i386-elf.hptrr_lib.o.uu" \ compile-with "uudecode < $S/dev/hptrr/i386-elf.hptrr_lib.o.uu" \ @@ -179,14 +185,17 @@ dev/fe/if_fe_isa.c optional fe isa dev/glxiic/glxiic.c optional glxiic dev/glxsb/glxsb.c optional glxsb dev/glxsb/glxsb_hash.c optional glxsb -dev/hpt27xx/os_bsd.c optional hpt27xx -dev/hpt27xx/osm_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_os_bsd.c optional hpt27xx +dev/hpt27xx/hpt27xx_osm_bsd.c optional hpt27xx dev/hpt27xx/hpt27xx_config.c optional hpt27xx dev/hptmv/entry.c optional hptmv dev/hptmv/mv.c optional hptmv dev/hptmv/gui_lib.c optional hptmv dev/hptmv/hptproc.c optional hptmv dev/hptmv/ioctl.c optional hptmv +dev/hptnr/hptnr_os_bsd.c optional hptnr +dev/hptnr/hptnr_osm_bsd.c optional hptnr +dev/hptnr/hptnr_config.c optional hptnr dev/hptrr/hptrr_os_bsd.c optional hptrr dev/hptrr/hptrr_osm_bsd.c optional hptrr dev/hptrr/hptrr_config.c optional hptrr Copied: stable/9/sys/dev/hpt27xx/hpt27xx_os_bsd.c (from r252867, head/sys/dev/hpt27xx/hpt27xx_os_bsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/hpt27xx/hpt27xx_os_bsd.c Sat Jul 6 23:26:36 2013 (r252903, copy of r252867, head/sys/dev/hpt27xx/hpt27xx_os_bsd.c) @@ -0,0 +1,370 @@ +/*- + * Copyright (c) 2011 HighPoint Technologies, Inc. + * 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 + +/* hardware access */ +HPT_U8 os_inb (void *port) { return inb((unsigned)(HPT_UPTR)port); } +HPT_U16 os_inw (void *port) { return inw((unsigned)(HPT_UPTR)port); } +HPT_U32 os_inl (void *port) { return inl((unsigned)(HPT_UPTR)port); } + +void os_outb (void *port, HPT_U8 value) { outb((unsigned)(HPT_UPTR)port, (value)); } +void os_outw (void *port, HPT_U16 value) { outw((unsigned)(HPT_UPTR)port, (value)); } +void os_outl (void *port, HPT_U32 value) { outl((unsigned)(HPT_UPTR)port, (value)); } + +void os_insw (void *port, HPT_U16 *buffer, HPT_U32 count) +{ insw((unsigned)(HPT_UPTR)port, (void *)buffer, count); } + +void os_outsw(void *port, HPT_U16 *buffer, HPT_U32 count) +{ outsw((unsigned)(HPT_UPTR)port, (void *)buffer, count); } + +HPT_U32 __dummy_reg = 0; + +/* PCI configuration space */ +HPT_U8 os_pci_readb (void *osext, HPT_U8 offset) +{ + return pci_read_config(((PHBA)osext)->pcidev, offset, 1); +} + +HPT_U16 os_pci_readw (void *osext, HPT_U8 offset) +{ + return pci_read_config(((PHBA)osext)->pcidev, offset, 2); +} + +HPT_U32 os_pci_readl (void *osext, HPT_U8 offset) +{ + return pci_read_config(((PHBA)osext)->pcidev, offset, 4); +} + +void os_pci_writeb (void *osext, HPT_U8 offset, HPT_U8 value) +{ + pci_write_config(((PHBA)osext)->pcidev, offset, value, 1); +} + +void os_pci_writew (void *osext, HPT_U8 offset, HPT_U16 value) +{ + pci_write_config(((PHBA)osext)->pcidev, offset, value, 2); +} + +void os_pci_writel (void *osext, HPT_U8 offset, HPT_U32 value) +{ + pci_write_config(((PHBA)osext)->pcidev, offset, value, 4); +} + +#if __FreeBSD_version < 500043 +/* PCI space access */ +HPT_U8 pcicfg_read_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) +{ + HPT_U8 v; + pcicfgregs pciref; + + pciref.bus = bus; + pciref.slot = dev; + pciref.func = func; + + v = pci_cfgread(&pciref, reg, 1); + return v; +} +HPT_U32 pcicfg_read_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) +{ + HPT_U32 v; + pcicfgregs pciref; + + pciref.bus = bus; + pciref.slot = dev; + pciref.func = func; + + v = pci_cfgread(&pciref, reg, 4); + return v; +} +void pcicfg_write_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U8 v) +{ + pcicfgregs pciref; + + pciref.hose = -1; + pciref.bus = bus; + pciref.slot = dev; + pciref.func = func; + + pci_cfgwrite(&pciref, reg, v, 1); +} +void pcicfg_write_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U32 v) +{ + pcicfgregs pciref; + + pciref.hose = -1; + pciref.bus = bus; + pciref.slot = dev; + pciref.func = func; + + pci_cfgwrite(&pciref, reg, v, 4); +}/* PCI space access */ +#else +HPT_U8 pcicfg_read_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) +{ + return (HPT_U8)pci_cfgregread(bus, dev, func, reg, 1); +} +HPT_U32 pcicfg_read_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg) +{ + return (HPT_U32)pci_cfgregread(bus, dev, func, reg, 4); +} +void pcicfg_write_byte (HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U8 v) +{ + pci_cfgregwrite(bus, dev, func, reg, v, 1); +} +void pcicfg_write_dword(HPT_U8 bus, HPT_U8 dev, HPT_U8 func, HPT_U8 reg, HPT_U32 v) +{ + pci_cfgregwrite(bus, dev, func, reg, v, 4); +}/* PCI space access */ +#endif + +void *os_map_pci_bar( + void *osext, + int index, + HPT_U32 offset, + HPT_U32 length +) +{ + PHBA hba = (PHBA)osext; + HPT_U32 base; + + hba->pcibar[index].rid = 0x10 + index * 4; + base = pci_read_config(hba->pcidev, hba->pcibar[index].rid, 4); + + if (base & 1) { + hba->pcibar[index].type = SYS_RES_IOPORT; + hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].base = (void *)(unsigned long)(base & ~0x1); + } else { + hba->pcibar[index].type = SYS_RES_MEMORY; + hba->pcibar[index].res = bus_alloc_resource(hba->pcidev, + hba->pcibar[index].type, &hba->pcibar[index].rid, 0, ~0, length, RF_ACTIVE); + hba->pcibar[index].base = (char *)rman_get_virtual(hba->pcibar[index].res) + offset; + } + + return hba->pcibar[index].base; +} + +void os_unmap_pci_bar(void *osext, void *base) +{ + PHBA hba = (PHBA)osext; + int index; + + for (index=0; index<6; index++) { + if (hba->pcibar[index].base==base) { + bus_release_resource(hba->pcidev, hba->pcibar[index].type, + hba->pcibar[index].rid, hba->pcibar[index].res); + hba->pcibar[index].base = 0; + return; + } + } +} + +void freelist_reserve(struct freelist *list, void *osext, HPT_UINT size, HPT_UINT count) +{ + PVBUS_EXT vbus_ext = osext; + + if (vbus_ext->ext_type!=EXT_TYPE_VBUS) + vbus_ext = ((PHBA)osext)->vbus_ext; + + list->next = vbus_ext->freelist_head; + vbus_ext->freelist_head = list; + list->dma = 0; + list->size = size; + list->head = 0; +#if DBG + list->reserved_count = +#endif + list->count = count; +} + +void *freelist_get(struct freelist *list) +{ + void * result; + if (list->count) { + HPT_ASSERT(list->head); + result = list->head; + list->head = *(void **)result; + list->count--; + return result; + } + return 0; +} + +void freelist_put(struct freelist * list, void *p) +{ + HPT_ASSERT(list->dma==0); + list->count++; + *(void **)p = list->head; + list->head = p; +} + +void freelist_reserve_dma(struct freelist *list, void *osext, HPT_UINT size, HPT_UINT alignment, HPT_UINT count) +{ + PVBUS_EXT vbus_ext = osext; + + if (vbus_ext->ext_type!=EXT_TYPE_VBUS) + vbus_ext = ((PHBA)osext)->vbus_ext; + + list->next = vbus_ext->freelist_dma_head; + vbus_ext->freelist_dma_head = list; + list->dma = 1; + list->alignment = alignment; + list->size = size; + list->head = 0; +#if DBG + list->reserved_count = +#endif + list->count = count; +} + +void *freelist_get_dma(struct freelist *list, BUS_ADDRESS *busaddr) +{ + void *result; + HPT_ASSERT(list->dma); + result = freelist_get(list); + if (result) + *busaddr = *(BUS_ADDRESS *)((void **)result+1); + return result; +} + +void freelist_put_dma(struct freelist *list, void *p, BUS_ADDRESS busaddr) +{ + HPT_ASSERT(list->dma); + list->count++; + *(void **)p = list->head; + *(BUS_ADDRESS *)((void **)p+1) = busaddr; + list->head = p; +} + +HPT_U32 os_get_stamp(void) +{ + HPT_U32 stamp; + do { stamp = random(); } while (stamp==0); + return stamp; +} + +void os_stallexec(HPT_U32 microseconds) +{ + DELAY(microseconds); +} + +static void os_timer_for_ldm(void *arg) +{ + PVBUS_EXT vbus_ext = (PVBUS_EXT)arg; + ldm_on_timer((PVBUS)vbus_ext->vbus); +} + +void os_request_timer(void * osext, HPT_U32 interval) +{ + PVBUS_EXT vbus_ext = osext; + + HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS); + + untimeout(os_timer_for_ldm, vbus_ext, vbus_ext->timer); + vbus_ext->timer = timeout(os_timer_for_ldm, vbus_ext, interval * hz / 1000000); +} + +HPT_TIME os_query_time(void) +{ + return ticks * (1000000 / hz); +} + +void os_schedule_task(void *osext, OSM_TASK *task) +{ + PVBUS_EXT vbus_ext = osext; + + HPT_ASSERT(task->next==0); + + if (vbus_ext->tasks==0) + vbus_ext->tasks = task; + else { + OSM_TASK *t = vbus_ext->tasks; + while (t->next) t = t->next; + t->next = task; + } + + if (vbus_ext->worker.ta_context) + TASK_ENQUEUE(&vbus_ext->worker); +} + +int os_revalidate_device(void *osext, int id) +{ + + return 0; +} + +int os_query_remove_device(void *osext, int id) +{ + PVBUS_EXT vbus_ext = (PVBUS_EXT)osext; + struct cam_periph *periph = NULL; + struct cam_path *path; + int status,retval = 0; + + status = xpt_create_path(&path, NULL, vbus_ext->sim->path_id, id, 0); + if (status == CAM_REQ_CMP) { + if((periph = cam_periph_find(path, "da")) != NULL){ + if(periph->refcount >= 1) + retval = -1; + } + xpt_free_path(path); + } + + return retval; +} + +HPT_U8 os_get_vbus_seq(void *osext) +{ + return ((PVBUS_EXT)osext)->sim->path_id; +} + +int os_printk(char *fmt, ...) +{ + va_list args; + static char buf[512]; + + va_start(args, fmt); + vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + return printf("%s: %s\n", driver_name, buf); +} + +#if DBG +void os_check_stack(const char *location, int size){} + +void __os_dbgbreak(const char *file, int line) +{ + printf("*** break at %s:%d ***", file, line); + while (1); +} + +int hpt_dbg_level = 1; +#endif Copied: stable/9/sys/dev/hpt27xx/hpt27xx_osm_bsd.c (from r252902, stable/9/sys/dev/hpt27xx/osm_bsd.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/dev/hpt27xx/hpt27xx_osm_bsd.c Sat Jul 6 23:26:36 2013 (r252903, copy of r252902, stable/9/sys/dev/hpt27xx/osm_bsd.c) @@ -0,0 +1,1361 @@ +/*- + * Copyright (c) 2011 HighPoint Technologies, Inc. + * 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 + +static int hpt_probe(device_t dev) +{ + PCI_ID pci_id; + HIM *him; + int i; + PHBA hba; + + for (him = him_list; him; him = him->next) { + for (i=0; him->get_supported_device_id(i, &pci_id); i++) { + if (him->get_controller_count) + him->get_controller_count(&pci_id,0,0); + if ((pci_get_vendor(dev) == pci_id.vid) && + (pci_get_device(dev) == pci_id.did)){ + KdPrint(("hpt_probe: adapter at PCI %d:%d:%d, IRQ %d", + pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev), pci_get_irq(dev) + )); + device_set_desc(dev, him->name); + hba = (PHBA)device_get_softc(dev); + memset(hba, 0, sizeof(HBA)); + hba->ext_type = EXT_TYPE_HBA; + hba->ldm_adapter.him = him; + return 0; + } + } + } + + return (ENXIO); +} + +static int hpt_attach(device_t dev) +{ + PHBA hba = (PHBA)device_get_softc(dev); + HIM *him = hba->ldm_adapter.him; + PCI_ID pci_id; + HPT_UINT size; + PVBUS vbus; + PVBUS_EXT vbus_ext; + + KdPrint(("hpt_attach(%d/%d/%d)", pci_get_bus(dev), pci_get_slot(dev), pci_get_function(dev))); + +#if __FreeBSD_version >=440000 + pci_enable_busmaster(dev); +#endif + + pci_id.vid = pci_get_vendor(dev); + pci_id.did = pci_get_device(dev); + pci_id.rev = pci_get_revid(dev); + pci_id.subsys = (HPT_U32)(pci_get_subdevice(dev)) << 16 | pci_get_subvendor(dev); + + size = him->get_adapter_size(&pci_id); + hba->ldm_adapter.him_handle = malloc(size, M_DEVBUF, M_WAITOK); + if (!hba->ldm_adapter.him_handle) + return ENXIO; + + hba->pcidev = dev; + hba->pciaddr.tree = 0; + hba->pciaddr.bus = pci_get_bus(dev); + hba->pciaddr.device = pci_get_slot(dev); + hba->pciaddr.function = pci_get_function(dev); + + if (!him->create_adapter(&pci_id, hba->pciaddr, hba->ldm_adapter.him_handle, hba)) { + free(hba->ldm_adapter.him_handle, M_DEVBUF); + return -1; + } + + os_printk("adapter at PCI %d:%d:%d, IRQ %d", + hba->pciaddr.bus, hba->pciaddr.device, hba->pciaddr.function, pci_get_irq(dev)); + + if (!ldm_register_adapter(&hba->ldm_adapter)) { + size = ldm_get_vbus_size(); + vbus_ext = malloc(sizeof(VBUS_EXT) + size, M_DEVBUF, M_WAITOK); + if (!vbus_ext) { + free(hba->ldm_adapter.him_handle, M_DEVBUF); + return -1; + } + memset(vbus_ext, 0, sizeof(VBUS_EXT)); + vbus_ext->ext_type = EXT_TYPE_VBUS; + ldm_create_vbus((PVBUS)vbus_ext->vbus, vbus_ext); + ldm_register_adapter(&hba->ldm_adapter); + } + + ldm_for_each_vbus(vbus, vbus_ext) { + if (hba->ldm_adapter.vbus==vbus) { + hba->vbus_ext = vbus_ext; + hba->next = vbus_ext->hba_list; + vbus_ext->hba_list = hba; + break; + } + } + return 0; +} + +/* + * Maybe we'd better to use the bus_dmamem_alloc to alloc DMA memory, + * but there are some problems currently (alignment, etc). + */ +static __inline void *__get_free_pages(int order) +{ + /* don't use low memory - other devices may get starved */ + return contigmalloc(PAGE_SIZE<hba_list; hba; hba = hba->next) + hba->ldm_adapter.him->get_meminfo(hba->ldm_adapter.him_handle); + + ldm_get_mem_info((PVBUS)vbus_ext->vbus, 0); + + for (f=vbus_ext->freelist_head; f; f=f->next) { + KdPrint(("%s: %d*%d=%d bytes", + f->tag, f->count, f->size, f->count*f->size)); + for (i=0; icount; i++) { + p = (void **)malloc(f->size, M_DEVBUF, M_WAITOK); + if (!p) return (ENXIO); + *p = f->head; + f->head = p; + } + } + + for (f=vbus_ext->freelist_dma_head; f; f=f->next) { + int order, size, j; + + HPT_ASSERT((f->size & (f->alignment-1))==0); + + for (order=0, size=PAGE_SIZE; sizesize; order++, size<<=1) + ; + + KdPrint(("%s: %d*%d=%d bytes, order %d", + f->tag, f->count, f->size, f->count*f->size, order)); + HPT_ASSERT(f->alignment<=PAGE_SIZE); + + for (i=0; icount;) { + p = (void **)__get_free_pages(order); + if (!p) return -1; + for (j = size/f->size; j && icount; i++,j--) { + *p = f->head; + *(BUS_ADDRESS *)(p+1) = (BUS_ADDRESS)vtophys(p); + f->head = p; + p = (void **)((unsigned long)p + f->size); + } + } + } + + HPT_ASSERT(PAGE_SIZE==DMAPOOL_PAGE_SIZE); + + for (i=0; ivbus, p, (BUS_ADDRESS)vtophys(p)); + } + + return 0; +} + +static void hpt_free_mem(PVBUS_EXT vbus_ext) +{ + struct freelist *f; + void *p; + int i; + BUS_ADDRESS bus; + + for (f=vbus_ext->freelist_head; f; f=f->next) { +#if DBG + if (f->count!=f->reserved_count) { + KdPrint(("memory leak for freelist %s (%d/%d)", f->tag, f->count, f->reserved_count)); + } +#endif + while ((p=freelist_get(f))) + free(p, M_DEVBUF); + } + + for (i=0; ivbus, &bus); + HPT_ASSERT(p); + free_pages(p, 0); + } + + for (f=vbus_ext->freelist_dma_head; f; f=f->next) { + int order, size; +#if DBG + if (f->count!=f->reserved_count) { + KdPrint(("memory leak for dma freelist %s (%d/%d)", f->tag, f->count, f->reserved_count)); + } +#endif + for (order=0, size=PAGE_SIZE; sizesize; order++, size<<=1) ; + + while ((p=freelist_get_dma(f, &bus))) { + if (order) + free_pages(p, order); + else { + /* can't free immediately since other blocks in this page may still be in the list */ + if (((HPT_UPTR)p & (PAGE_SIZE-1))==0) + dmapool_put_page((PVBUS)vbus_ext->vbus, p, bus); + } + } + } + + while ((p = dmapool_get_page((PVBUS)vbus_ext->vbus, &bus))) + free_pages(p, 0); +} + +static int hpt_init_vbus(PVBUS_EXT vbus_ext) +{ + PHBA hba; + + for (hba = vbus_ext->hba_list; hba; hba = hba->next) + if (!hba->ldm_adapter.him->initialize(hba->ldm_adapter.him_handle)) { + KdPrint(("fail to initialize %p", hba)); + return -1; + } + + ldm_initialize_vbus((PVBUS)vbus_ext->vbus, &vbus_ext->hba_list->ldm_adapter); + return 0; +} + +static void hpt_flush_done(PCOMMAND pCmd) +{ + PVDEV vd = pCmd->target; + + if (mIsArray(vd->type) && vd->u.array.transform && vd!=vd->u.array.transform->target) { + vd = vd->u.array.transform->target; + HPT_ASSERT(vd); + pCmd->target = vd; + pCmd->Result = RETURN_PENDING; + vdev_queue_cmd(pCmd); + return; + } + + *(int *)pCmd->priv = 1; + wakeup(pCmd); +} + +/* + * flush a vdev (without retry). + */ +static int hpt_flush_vdev(PVBUS_EXT vbus_ext, PVDEV vd) +{ + PCOMMAND pCmd; + int result = 0, done; + HPT_UINT count; + + KdPrint(("flusing dev %p", vd)); + + hpt_lock_vbus(vbus_ext); + + if (mIsArray(vd->type) && vd->u.array.transform) + count = MAX(vd->u.array.transform->source->cmds_per_request, + vd->u.array.transform->target->cmds_per_request); + else + count = vd->cmds_per_request; + + pCmd = ldm_alloc_cmds(vd->vbus, count); + + if (!pCmd) { + hpt_unlock_vbus(vbus_ext); + return -1; + } + + pCmd->type = CMD_TYPE_FLUSH; + pCmd->flags.hard_flush = 1; + pCmd->target = vd; + pCmd->done = hpt_flush_done; + done = 0; + pCmd->priv = &done; + + ldm_queue_cmd(pCmd); + + if (!done) { + while (hpt_sleep(vbus_ext, pCmd, PPAUSE, "hptfls", HPT_OSM_TIMEOUT)) { + ldm_reset_vbus(vd->vbus); + } + } + + KdPrint(("flush result %d", pCmd->Result)); + + if (pCmd->Result!=RETURN_SUCCESS) + result = -1; + + ldm_free_cmds(pCmd); + + hpt_unlock_vbus(vbus_ext); + + return result; +} + +static void hpt_stop_tasks(PVBUS_EXT vbus_ext); +static void hpt_shutdown_vbus(PVBUS_EXT vbus_ext, int howto) +{ + PVBUS vbus = (PVBUS)vbus_ext->vbus; + PHBA hba; + int i; + + KdPrint(("hpt_shutdown_vbus")); + + /* stop all ctl tasks and disable the worker taskqueue */ + hpt_stop_tasks(vbus_ext); + vbus_ext->worker.ta_context = 0; + + /* flush devices */ + for (i=0; ihba_list; hba; hba=hba->next) + bus_teardown_intr(hba->pcidev, hba->irq_res, hba->irq_handle); + + hpt_free_mem(vbus_ext); + + while ((hba=vbus_ext->hba_list)) { + vbus_ext->hba_list = hba->next; + free(hba->ldm_adapter.him_handle, M_DEVBUF); + } + + free(vbus_ext, M_DEVBUF); + KdPrint(("hpt_shutdown_vbus done")); +} + +static void __hpt_do_tasks(PVBUS_EXT vbus_ext) +{ + OSM_TASK *tasks; + + tasks = vbus_ext->tasks; + vbus_ext->tasks = 0; + + while (tasks) { + OSM_TASK *t = tasks; + tasks = t->next; + t->next = 0; + t->func(vbus_ext->vbus, t->data); + } +} + +static void hpt_do_tasks(PVBUS_EXT vbus_ext, int pending) +{ + if(vbus_ext){ + hpt_lock_vbus(vbus_ext); + __hpt_do_tasks(vbus_ext); + hpt_unlock_vbus(vbus_ext); + } +} + +static void hpt_action(struct cam_sim *sim, union ccb *ccb); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 23:46:24 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85EA2E2A; Sat, 6 Jul 2013 23:46:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7742119DA; Sat, 6 Jul 2013 23:46:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66NkNWk055768; Sat, 6 Jul 2013 23:46:23 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66NkNQj055764; Sat, 6 Jul 2013 23:46:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307062346.r66NkNQj055764@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 23: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: r252904 - stable/9/sys/dev/arcmsr 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.14 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, 06 Jul 2013 23:46:24 -0000 Author: delphij Date: Sat Jul 6 23:46:23 2013 New Revision: 252904 URL: http://svnweb.freebsd.org/changeset/base/252904 Log: MFC r252857: Refresh vendor driver version which fixes command queue full issue with ARC-1214 and ARC-1224. Many thanks to Areca for continuing to support FreeBSD. Submitted by: 黃清隆 Modified: stable/9/sys/dev/arcmsr/arcmsr.c stable/9/sys/dev/arcmsr/arcmsr.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/arcmsr/arcmsr.c ============================================================================== --- stable/9/sys/dev/arcmsr/arcmsr.c Sat Jul 6 23:26:36 2013 (r252903) +++ stable/9/sys/dev/arcmsr/arcmsr.c Sat Jul 6 23:46:23 2013 (r252904) @@ -35,44 +35,45 @@ ******************************************************************************** ** History ** -** REV# DATE NAME DESCRIPTION -** 1.00.00.00 03/31/2004 Erich Chen First release -** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error -** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support -** clean unused function -** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, -** firmware version check -** and firmware update notify for hardware bug fix -** handling if none zero high part physical address -** of srb resource -** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy -** add iop message xfer -** with scsi pass-through command -** add new device id of sas raid adapters -** code fit for SPARC64 & PPC -** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report -** and cause g_vfs_done() read write error -** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x -** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x -** bus_dmamem_alloc() with BUS_DMA_ZERO -** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 -** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, -** prevent cam_periph_error removing all LUN devices of one Target id -** for any one LUN device failed -** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" -** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B -** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 -** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function -** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout -** 02/14/2011 Ching Huang Modified pktRequestCount -** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it -** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic -** 1.20.00.23 10/28/2011 Ching Huang Added TIMEOUT_DELAY in case of too many HDDs need to start -** 1.20.00.23 11/08/2011 Ching Huang Added report device transfer speed -** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command -** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition -** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter -** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224 +** REV# DATE NAME DESCRIPTION +** 1.00.00.00 03/31/2004 Erich Chen First release +** 1.20.00.02 11/29/2004 Erich Chen bug fix with arcmsr_bus_reset when PHY error +** 1.20.00.03 04/19/2005 Erich Chen add SATA 24 Ports adapter type support +** clean unused function +** 1.20.00.12 09/12/2005 Erich Chen bug fix with abort command handling, +** firmware version check +** and firmware update notify for hardware bug fix +** handling if none zero high part physical address +** of srb resource +** 1.20.00.13 08/18/2006 Erich Chen remove pending srb and report busy +** add iop message xfer +** with scsi pass-through command +** add new device id of sas raid adapters +** code fit for SPARC64 & PPC +** 1.20.00.14 02/05/2007 Erich Chen bug fix for incorrect ccb_h.status report +** and cause g_vfs_done() read write error +** 1.20.00.15 10/10/2007 Erich Chen support new RAID adapter type ARC120x +** 1.20.00.16 10/10/2009 Erich Chen Bug fix for RAID adapter type ARC120x +** bus_dmamem_alloc() with BUS_DMA_ZERO +** 1.20.00.17 07/15/2010 Ching Huang Added support ARC1880 +** report CAM_DEV_NOT_THERE instead of CAM_SEL_TIMEOUT when device failed, +** prevent cam_periph_error removing all LUN devices of one Target id +** for any one LUN device failed +** 1.20.00.18 10/14/2010 Ching Huang Fixed "inquiry data fails comparion at DV1 step" +** 10/25/2010 Ching Huang Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B +** 1.20.00.19 11/11/2010 Ching Huang Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0 +** 1.20.00.20 12/08/2010 Ching Huang Avoid calling atomic_set_int function +** 1.20.00.21 02/08/2011 Ching Huang Implement I/O request timeout +** 02/14/2011 Ching Huang Modified pktRequestCount +** 1.20.00.21 03/03/2011 Ching Huang if a command timeout, then wait its ccb back before free it +** 1.20.00.22 07/04/2011 Ching Huang Fixed multiple MTX panic +** 1.20.00.23 10/28/2011 Ching Huang Added TIMEOUT_DELAY in case of too many HDDs need to start +** 1.20.00.23 11/08/2011 Ching Huang Added report device transfer speed +** 1.20.00.23 01/30/2012 Ching Huang Fixed Request requeued and Retrying command +** 1.20.00.24 06/11/2012 Ching Huang Fixed return sense data condition +** 1.20.00.25 08/17/2012 Ching Huang Fixed hotplug device no function on type A adapter +** 1.20.00.26 12/14/2012 Ching Huang Added support ARC1214,1224,1264,1284 +** 1.20.00.27 05/06/2013 Ching Huang Fixed out standing cmd full on ARC-12x4 ****************************************************************************************** */ @@ -144,7 +145,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a); #endif -#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.26 2013-01-08" +#define ARCMSR_DRIVER_VERSION "Driver Version 1.20.00.27 2013-05-06" #include /* ************************************************************************** @@ -753,7 +754,7 @@ static void arcmsr_srb_complete(struct C if(stand_flag == 1) { atomic_subtract_int(&acb->srboutstandingcount, 1); if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) && ( - acb->srboutstandingcount < (acb->firm_numbers_queue -10))) { + acb->srboutstandingcount < (acb->maxOutstanding -10))) { acb->acb_flags &= ~ACB_F_CAM_DEV_QFRZN; pccb->ccb_h.status |= CAM_RELEASE_SIMQ; } @@ -1939,11 +1940,11 @@ static void arcmsr_hbc_postqueue_isr(str /* check if command done with no error*/ error = (flag_srb & ARCMSR_SRBREPLY_FLAG_ERROR_MODE1)?TRUE:FALSE; arcmsr_drain_donequeue(acb, flag_srb, error); + throttling++; if(throttling == ARCMSR_HBC_ISR_THROTTLING_LEVEL) { CHIP_REG_WRITE32(HBC_MessageUnit, 0, inbound_doorbell,ARCMSR_HBCMU_DRV2IOP_POSTQUEUE_THROTTLING); - break; + throttling = 0; } - throttling++; } /*drain reply FIFO*/ } /* @@ -2686,7 +2687,7 @@ static void arcmsr_execute_srb(void *arg arcmsr_srb_complete(srb, 0); return; } - if(acb->srboutstandingcount >= acb->firm_numbers_queue) { + if(acb->srboutstandingcount >= acb->maxOutstanding) { if((acb->acb_flags & ACB_F_CAM_DEV_QFRZN) == 0) { xpt_freeze_simq(acb->psim, 1); @@ -3430,6 +3431,10 @@ static void arcmsr_get_hba_config(struct acb->firm_sdram_size = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBA_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) + acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** @@ -3476,6 +3481,10 @@ static void arcmsr_get_hbb_config(struct acb->firm_sdram_size = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBB_RWBUFFER, 1, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_HBB_POSTQUEUE) + acb->maxOutstanding = ARCMSR_MAX_HBB_POSTQUEUE - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** @@ -3523,6 +3532,10 @@ static void arcmsr_get_hbc_config(struct acb->firm_sdram_size = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[3]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBC_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_OUTSTANDING_CMD) + acb->maxOutstanding = ARCMSR_MAX_OUTSTANDING_CMD - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** @@ -3571,6 +3584,10 @@ static void arcmsr_get_hbd_config(struct acb->firm_sdram_size = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[4]); /*firm_sdram_size, 3, 12-15*/ acb->firm_ide_channels = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[5]); /*firm_ide_channels, 4, 16-19*/ acb->firm_cfg_version = CHIP_REG_READ32(HBD_MessageUnit, 0, msgcode_rwbuffer[ARCMSR_FW_CFGVER_OFFSET]); /*firm_cfg_version, 25, */ + if(acb->firm_numbers_queue > ARCMSR_MAX_HBD_POSTQUEUE) + acb->maxOutstanding = ARCMSR_MAX_HBD_POSTQUEUE - 1; + else + acb->maxOutstanding = acb->firm_numbers_queue - 1; } /* ********************************************************************** Modified: stable/9/sys/dev/arcmsr/arcmsr.h ============================================================================== --- stable/9/sys/dev/arcmsr/arcmsr.h Sat Jul 6 23:26:36 2013 (r252903) +++ stable/9/sys/dev/arcmsr/arcmsr.h Sat Jul 6 23:46:23 2013 (r252904) @@ -1182,6 +1182,7 @@ struct AdapterControlBlock { u_int32_t pktReturnCount; u_int32_t vendor_device_id; u_int32_t adapter_bus_speed; + u_int32_t maxOutstanding; };/* HW_DEVICE_EXTENSION */ /* acb_flags */ #define ACB_F_SCSISTOPADAPTER 0x0001 From owner-svn-src-stable@FreeBSD.ORG Sat Jul 6 23:57:00 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3D18B9B; Sat, 6 Jul 2013 23:57:00 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2CCAD19F8; Sat, 6 Jul 2013 23:57:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r66Nv0Fs058648; Sat, 6 Jul 2013 23:57:00 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r66Nuxm1058634; Sat, 6 Jul 2013 23:56:59 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201307062356.r66Nuxm1058634@svn.freebsd.org> From: Xin LI Date: Sat, 6 Jul 2013 23:56: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: r252905 - in stable/9: share/man/man4 sys/dev/oce 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.14 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, 06 Jul 2013 23:57:00 -0000 Author: delphij Date: Sat Jul 6 23:56:58 2013 New Revision: 252905 URL: http://svnweb.freebsd.org/changeset/base/252905 Log: MFC r252869: Update driver with recent vendor improvements, most notably support of Skyhawk adapters. Many thanks to Emulex for their continued support of FreeBSD. Submitted by: "Duvvuru,Venkat Kumar" Modified: stable/9/share/man/man4/oce.4 stable/9/sys/dev/oce/oce_hw.c stable/9/sys/dev/oce/oce_hw.h stable/9/sys/dev/oce/oce_if.c stable/9/sys/dev/oce/oce_if.h stable/9/sys/dev/oce/oce_mbox.c stable/9/sys/dev/oce/oce_queue.c stable/9/sys/dev/oce/oce_sysctl.c stable/9/sys/dev/oce/oce_util.c Directory Properties: stable/9/share/man/man4/ (props changed) stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/share/man/man4/oce.4 ============================================================================== --- stable/9/share/man/man4/oce.4 Sat Jul 6 23:46:23 2013 (r252904) +++ stable/9/share/man/man4/oce.4 Sat Jul 6 23:56:58 2013 (r252905) @@ -1,4 +1,4 @@ -.\" Copyright (C) 2012 Emulex +.\" Copyright (C) 2013 Emulex .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without Modified: stable/9/sys/dev/oce/oce_hw.c ============================================================================== --- stable/9/sys/dev/oce/oce_hw.c Sat Jul 6 23:46:23 2013 (r252904) +++ stable/9/sys/dev/oce/oce_hw.c Sat Jul 6 23:56:58 2013 (r252905) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -53,12 +53,12 @@ oce_POST(POCE_SOFTC sc) int tmo = 60000; /* read semaphore CSR */ - post_status.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_SEMAPHORE(sc)); + post_status.dw0 = OCE_READ_CSR_MPU(sc, csr, MPU_EP_SEMAPHORE(sc)); /* if host is ready then wait for fw ready else send POST */ if (post_status.bits.stage <= POST_STAGE_AWAITING_HOST_RDY) { post_status.bits.stage = POST_STAGE_CHIP_RESET; - OCE_WRITE_REG32(sc, csr, MPU_EP_SEMAPHORE(sc), post_status.dw0); + OCE_WRITE_CSR_MPU(sc, csr, MPU_EP_SEMAPHORE(sc), post_status.dw0); } /* wait for FW ready */ @@ -68,7 +68,7 @@ oce_POST(POCE_SOFTC sc) DELAY(1000); - post_status.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_SEMAPHORE(sc)); + post_status.dw0 = OCE_READ_CSR_MPU(sc, csr, MPU_EP_SEMAPHORE(sc)); if (post_status.bits.error) { device_printf(sc->dev, "POST failed: %x\n", post_status.dw0); @@ -129,7 +129,7 @@ oce_hw_init(POCE_SOFTC sc) if (rc) goto error; - if (IS_BE(sc) && (sc->flags & OCE_FLAGS_BE3)) { + if ((IS_BE(sc) && (sc->flags & OCE_FLAGS_BE3)) || IS_SH(sc)) { rc = oce_mbox_check_native_mode(sc); if (rc) goto error; @@ -258,7 +258,7 @@ oce_hw_pci_alloc(POCE_SOFTC sc) rr = PCIR_BAR(pci_cfg_barnum); - if (IS_BE(sc)) + if (IS_BE(sc) || IS_SH(sc)) sc->devcfg_res = bus_alloc_resource_any(sc->dev, SYS_RES_MEMORY, &rr, RF_ACTIVE|RF_SHAREABLE); @@ -298,7 +298,7 @@ oce_hw_pci_alloc(POCE_SOFTC sc) sc->flags |= OCE_FLAGS_VIRTUAL_PORT; /* Lancer has one BAR (CFG) but BE3 has three (CFG, CSR, DB) */ - if (IS_BE(sc)) { + if (IS_BE(sc) || IS_SH(sc)) { /* set up CSR region */ rr = PCIR_BAR(OCE_PCI_CSR_BAR); sc->csr_res = bus_alloc_resource_any(sc->dev, @@ -387,7 +387,7 @@ oce_create_nw_interface(POCE_SOFTC sc) } /* enable capabilities controlled via driver startup parameters */ - if (sc->rss_enable) + if (is_rss_enabled(sc)) capab_en_flags |= MBX_RX_IFACE_FLAGS_RSS; else { capab_en_flags &= ~MBX_RX_IFACE_FLAGS_RSS; @@ -447,9 +447,9 @@ oce_pci_soft_reset(POCE_SOFTC sc) int rc; mpu_ep_control_t ctrl; - ctrl.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_CONTROL); + ctrl.dw0 = OCE_READ_CSR_MPU(sc, csr, MPU_EP_CONTROL); ctrl.bits.cpu_reset = 1; - OCE_WRITE_REG32(sc, csr, MPU_EP_CONTROL, ctrl.dw0); + OCE_WRITE_CSR_MPU(sc, csr, MPU_EP_CONTROL, ctrl.dw0); DELAY(50); rc=oce_POST(sc); Modified: stable/9/sys/dev/oce/oce_hw.h ============================================================================== --- stable/9/sys/dev/oce/oce_hw.h Sat Jul 6 23:46:23 2013 (r252904) +++ stable/9/sys/dev/oce/oce_hw.h Sat Jul 6 23:56:58 2013 (r252905) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -63,8 +63,7 @@ #define MPU_EP_CONTROL 0 #define MPU_EP_SEMAPHORE_BE3 0xac #define MPU_EP_SEMAPHORE_XE201 0x400 -#define MPU_EP_SEMAPHORE(sc) \ - ((IS_BE(sc)) ? MPU_EP_SEMAPHORE_BE3 : MPU_EP_SEMAPHORE_XE201) +#define MPU_EP_SEMAPHORE_SH 0x94 #define PCICFG_INTR_CTRL 0xfc #define HOSTINTR_MASK (1 << 29) #define HOSTINTR_PFUNC_SHIFT 26 @@ -1998,6 +1997,79 @@ struct mbx_lowlevel_set_loopback_mode { } rsp; } params; }; +#define MAX_RESC_DESC 256 +#define RESC_DESC_SIZE 88 +#define ACTIVE_PROFILE 2 +#define NIC_RESC_DESC_TYPE_V0 0x41 +#define NIC_RESC_DESC_TYPE_V1 0x51 +/* OPCODE_COMMON_GET_FUNCTION_CONFIG */ +struct mbx_common_get_func_config { + struct mbx_hdr hdr; + union { + struct { + uint8_t rsvd; + uint8_t type; + uint16_t rsvd1; + } req; + struct { + uint32_t desc_count; + uint8_t resources[MAX_RESC_DESC * RESC_DESC_SIZE]; + } rsp; + } params; +}; + + +/* OPCODE_COMMON_GET_PROFILE_CONFIG */ + +struct mbx_common_get_profile_config { + struct mbx_hdr hdr; + union { + struct { + uint8_t rsvd; + uint8_t type; + uint16_t rsvd1; + } req; + struct { + uint32_t desc_count; + uint8_t resources[MAX_RESC_DESC * RESC_DESC_SIZE]; + } rsp; + } params; +}; + +struct oce_nic_resc_desc { + uint8_t desc_type; + uint8_t desc_len; + uint8_t rsvd1; + uint8_t flags; + uint8_t vf_num; + uint8_t rsvd2; + uint8_t pf_num; + uint8_t rsvd3; + uint16_t unicast_mac_count; + uint8_t rsvd4[6]; + uint16_t mcc_count; + uint16_t vlan_count; + uint16_t mcast_mac_count; + uint16_t txq_count; + uint16_t rq_count; + uint16_t rssq_count; + uint16_t lro_count; + uint16_t cq_count; + uint16_t toe_conn_count; + uint16_t eq_count; + uint32_t rsvd5; + uint32_t cap_flags; + uint8_t link_param; + uint8_t rsvd6[3]; + uint32_t bw_min; + uint32_t bw_max; + uint8_t acpi_params; + uint8_t wol_param; + uint16_t rsvd7; + uint32_t rsvd8[7]; + +}; + struct flash_file_hdr { uint8_t sign[52]; Modified: stable/9/sys/dev/oce/oce_if.c ============================================================================== --- stable/9/sys/dev/oce/oce_if.c Sat Jul 6 23:46:23 2013 (r252904) +++ stable/9/sys/dev/oce/oce_if.c Sat Jul 6 23:56:58 2013 (r252905) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -96,6 +96,7 @@ static void update_queues_got(POCE_SOFTC static void process_link_state(POCE_SOFTC sc, struct oce_async_cqe_link_state *acqe); static int oce_tx_asic_stall_verify(POCE_SOFTC sc, struct mbuf *m); +static void oce_get_config(POCE_SOFTC sc); static struct mbuf *oce_insert_vlan_tag(POCE_SOFTC sc, struct mbuf *m, boolean_t *complete); /* IP specific */ @@ -146,6 +147,7 @@ static uint32_t supportedDevices[] = { (PCI_VENDOR_EMULEX << 16) | PCI_PRODUCT_BE3, (PCI_VENDOR_EMULEX << 16) | PCI_PRODUCT_XE201, (PCI_VENDOR_EMULEX << 16) | PCI_PRODUCT_XE201_VF, + (PCI_VENDOR_EMULEX << 16) | PCI_PRODUCT_SH }; @@ -189,6 +191,9 @@ oce_probe(device_t dev) case PCI_PRODUCT_XE201_VF: sc->flags |= OCE_FLAGS_XE201; break; + case PCI_PRODUCT_SH: + sc->flags |= OCE_FLAGS_SH; + break; default: return ENXIO; } @@ -213,7 +218,6 @@ oce_attach(device_t dev) if (rc) return rc; - sc->rss_enable = oce_enable_rss; sc->tx_ring_size = OCE_TX_RING_SIZE; sc->rx_ring_size = OCE_RX_RING_SIZE; sc->rq_frag_size = OCE_RQ_BUF_SIZE; @@ -228,6 +232,8 @@ oce_attach(device_t dev) if (rc) goto pci_res_free; + oce_get_config(sc); + setup_max_queues_want(sc); rc = oce_setup_intr(sc); @@ -485,17 +491,18 @@ oce_multiq_start(struct ifnet *ifp, stru int queue_index = 0; int status = 0; + if (!sc->link_status) + return ENXIO; + if ((m->m_flags & M_FLOWID) != 0) queue_index = m->m_pkthdr.flowid % sc->nwqs; - + wq = sc->wq[queue_index]; - if (TRY_LOCK(&wq->tx_lock)) { - status = oce_multiq_transmit(ifp, m, wq); - UNLOCK(&wq->tx_lock); - } else { - status = drbr_enqueue(ifp, wq->br, m); - } + LOCK(&wq->tx_lock); + status = oce_multiq_transmit(ifp, m, wq); + UNLOCK(&wq->tx_lock); + return status; } @@ -578,7 +585,7 @@ oce_setup_intr(POCE_SOFTC sc) int rc = 0, use_intx = 0; int vector = 0, req_vectors = 0; - if (sc->rss_enable) + if (is_rss_enabled(sc)) req_vectors = MAX((sc->nrqs - 1), sc->nwqs); else req_vectors = 1; @@ -777,7 +784,6 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, struct mbuf *m, *m_temp; struct oce_wq *wq = sc->wq[wq_index]; struct oce_packet_desc *pd; - uint32_t out; struct oce_nic_hdr_wqe *nichdr; struct oce_nic_frag_wqe *nicfrag; int num_wqes; @@ -815,20 +821,14 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, } } - out = wq->packets_out + 1; - if (out == OCE_WQ_PACKET_ARRAY_SIZE) - out = 0; - if (out == wq->packets_in) - return EBUSY; - - pd = &wq->pckts[wq->packets_out]; + pd = &wq->pckts[wq->pkt_desc_head]; retry: rc = bus_dmamap_load_mbuf_sg(wq->tag, pd->map, m, segs, &pd->nsegs, BUS_DMA_NOWAIT); if (rc == 0) { num_wqes = pd->nsegs + 1; - if (IS_BE(sc)) { + if (IS_BE(sc) || IS_SH(sc)) { /*Dummy required only for BE3.*/ if (num_wqes & 1) num_wqes++; @@ -837,10 +837,11 @@ retry: bus_dmamap_unload(wq->tag, pd->map); return EBUSY; } - + atomic_store_rel_int(&wq->pkt_desc_head, + (wq->pkt_desc_head + 1) % \ + OCE_WQ_PACKET_ARRAY_SIZE); bus_dmamap_sync(wq->tag, pd->map, BUS_DMASYNC_PREWRITE); pd->mbuf = m; - wq->packets_out = out; nichdr = RING_GET_PRODUCER_ITEM_VA(wq->ring, struct oce_nic_hdr_wqe); @@ -869,12 +870,12 @@ retry: nichdr->u0.s.lso = 1; nichdr->u0.s.lso_mss = m->m_pkthdr.tso_segsz; } - if (!IS_BE(sc)) + if (!IS_BE(sc) || !IS_SH(sc)) nichdr->u0.s.ipcs = 1; } RING_PUT(wq->ring, 1); - wq->ring->num_used++; + atomic_add_int(&wq->ring->num_used, 1); for (i = 0; i < pd->nsegs; i++) { nicfrag = @@ -886,7 +887,7 @@ retry: nicfrag->u0.s.frag_len = segs[i].ds_len; pd->wqe_idx = wq->ring->pidx; RING_PUT(wq->ring, 1); - wq->ring->num_used++; + atomic_add_int(&wq->ring->num_used, 1); } if (num_wqes > (pd->nsegs + 1)) { nicfrag = @@ -898,7 +899,7 @@ retry: nicfrag->u0.dw[3] = 0; pd->wqe_idx = wq->ring->pidx; RING_PUT(wq->ring, 1); - wq->ring->num_used++; + atomic_add_int(&wq->ring->num_used, 1); pd->nsegs++; } @@ -911,7 +912,7 @@ retry: bus_dmamap_sync(wq->ring->dma.tag, wq->ring->dma.map, BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); reg_value = (num_wqes << 16) | wq->wq_id; - OCE_WRITE_REG32(sc, db, PD_TXULP_DB, reg_value); + OCE_WRITE_REG32(sc, db, wq->db_offset, reg_value); } else if (rc == EFBIG) { if (retry_cnt == 0) { @@ -928,7 +929,7 @@ retry: return rc; else goto free_ret; - + return 0; free_ret: @@ -941,21 +942,14 @@ free_ret: static void oce_tx_complete(struct oce_wq *wq, uint32_t wqe_idx, uint32_t status) { - uint32_t in; struct oce_packet_desc *pd; POCE_SOFTC sc = (POCE_SOFTC) wq->parent; struct mbuf *m; - if (wq->packets_out == wq->packets_in) - device_printf(sc->dev, "WQ transmit descriptor missing\n"); - - in = wq->packets_in + 1; - if (in == OCE_WQ_PACKET_ARRAY_SIZE) - in = 0; - - pd = &wq->pckts[wq->packets_in]; - wq->packets_in = in; - wq->ring->num_used -= (pd->nsegs + 1); + pd = &wq->pckts[wq->pkt_desc_tail]; + atomic_store_rel_int(&wq->pkt_desc_tail, + (wq->pkt_desc_tail + 1) % OCE_WQ_PACKET_ARRAY_SIZE); + atomic_subtract_int(&wq->ring->num_used, pd->nsegs + 1); bus_dmamap_sync(wq->tag, pd->map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(wq->tag, pd->map); @@ -963,6 +957,7 @@ oce_tx_complete(struct oce_wq *wq, uint3 m_freem(m); pd->mbuf = NULL; + if (sc->ifp->if_drv_flags & IFF_DRV_OACTIVE) { if (wq->ring->num_used < (wq->ring->num_items / 2)) { sc->ifp->if_drv_flags &= ~(IFF_DRV_OACTIVE); @@ -1065,16 +1060,15 @@ oce_tx_task(void *arg, int npending) POCE_SOFTC sc = wq->parent; struct ifnet *ifp = sc->ifp; int rc = 0; - + #if __FreeBSD_version >= 800000 - if (TRY_LOCK(&wq->tx_lock)) { - rc = oce_multiq_transmit(ifp, NULL, wq); - if (rc) { - device_printf(sc->dev, - "TX[%d] restart failed\n", wq->queue_index); - } - UNLOCK(&wq->tx_lock); + LOCK(&wq->tx_lock); + rc = oce_multiq_transmit(ifp, NULL, wq); + if (rc) { + device_printf(sc->dev, + "TX[%d] restart failed\n", wq->queue_index); } + UNLOCK(&wq->tx_lock); #else oce_start(ifp); #endif @@ -1133,7 +1127,6 @@ oce_wq_handler(void *arg) struct oce_nic_tx_cqe *cqe; int num_cqes = 0; - LOCK(&wq->tx_lock); bus_dmamap_sync(cq->ring->dma.tag, cq->ring->dma.map, BUS_DMASYNC_POSTWRITE); cqe = RING_GET_CONSUMER_ITEM_VA(cq->ring, struct oce_nic_tx_cqe); @@ -1157,7 +1150,6 @@ oce_wq_handler(void *arg) if (num_cqes) oce_arm_cq(sc, cq->cq_id, num_cqes, FALSE); - UNLOCK(&wq->tx_lock); return 0; } @@ -1234,7 +1226,7 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i } /* Get vlan_tag value */ - if(IS_BE(sc)) + if(IS_BE(sc) || IS_SH(sc)) vtag = BSWAP_16(cqe->u0.s.vlan_tag); else vtag = cqe->u0.s.vlan_tag; @@ -1295,7 +1287,10 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i m->m_pkthdr.rcvif = sc->ifp; #if __FreeBSD_version >= 800000 - m->m_pkthdr.flowid = rq->queue_index; + if (rq->queue_index) + m->m_pkthdr.flowid = (rq->queue_index - 1); + else + m->m_pkthdr.flowid = rq->queue_index; m->m_flags |= M_FLOWID; #endif /* This deternies if vlan tag is Valid */ @@ -1402,7 +1397,7 @@ oce_cqe_portid_valid(POCE_SOFTC sc, stru struct oce_nic_rx_cqe_v1 *cqe_v1; int port_id = 0; - if (sc->be3_native && IS_BE(sc)) { + if (sc->be3_native && (IS_BE(sc) || IS_SH(sc))) { cqe_v1 = (struct oce_nic_rx_cqe_v1 *)cqe; port_id = cqe_v1->u0.s.port; if (sc->port_id != port_id) @@ -1548,7 +1543,6 @@ oce_rq_handler(void *arg) int num_cqes = 0, rq_buffers_used = 0; - LOCK(&rq->rx_lock); bus_dmamap_sync(cq->ring->dma.tag, cq->ring->dma.map, BUS_DMASYNC_POSTWRITE); cqe = RING_GET_CONSUMER_ITEM_VA(cq->ring, struct oce_nic_rx_cqe); @@ -1595,8 +1589,6 @@ oce_rq_handler(void *arg) oce_alloc_rx_bufs(rq, (rq_buffers_used - 1)); } - UNLOCK(&rq->rx_lock); - return 0; } @@ -1890,7 +1882,7 @@ oce_local_timer(void *arg) oce_tx_restart(sc, sc->wq[i]); /* calculate and set the eq delay for optimal interrupt rate */ - if (IS_BE(sc)) + if (IS_BE(sc) || IS_SH(sc)) oce_eqd_set_periodic(sc); callout_reset(&sc->timer, hz, oce_local_timer, sc); @@ -2081,38 +2073,22 @@ oce_mq_handler(void *arg) static void setup_max_queues_want(POCE_SOFTC sc) { - int max_rss = 0; - /* Check if it is FLEX machine. Is so dont use RSS */ if ((sc->function_mode & FNM_FLEX10_MODE) || (sc->function_mode & FNM_UMC_MODE) || (sc->function_mode & FNM_VNIC_MODE) || - (!sc->rss_enable) || + (!is_rss_enabled(sc)) || (sc->flags & OCE_FLAGS_BE2)) { sc->nrqs = 1; sc->nwqs = 1; - sc->rss_enable = 0; - } else { - /* For multiq, our deisgn is to have TX rings equal to - RSS rings. So that we can pair up one RSS ring and TX - to a single intr, which improves CPU cache efficiency. - */ - if (IS_BE(sc) && (!sc->be3_native)) - max_rss = OCE_LEGACY_MODE_RSS; - else - max_rss = OCE_MAX_RSS; - - sc->nrqs = MIN(OCE_NCPUS, max_rss) + 1; /* 1 for def RX */ - sc->nwqs = MIN(OCE_NCPUS, max_rss); } - } static void update_queues_got(POCE_SOFTC sc) { - if (sc->rss_enable) { + if (is_rss_enabled(sc)) { sc->nrqs = sc->intr_count + 1; sc->nwqs = sc->intr_count; } else { @@ -2197,3 +2173,31 @@ oce_tx_asic_stall_verify(POCE_SOFTC sc, } return FALSE; } + +static void +oce_get_config(POCE_SOFTC sc) +{ + int rc = 0; + uint32_t max_rss = 0; + + if ((IS_BE(sc) || IS_SH(sc)) && (!sc->be3_native)) + max_rss = OCE_LEGACY_MODE_RSS; + else + max_rss = OCE_MAX_RSS; + + if (!IS_BE(sc)) { + rc = oce_get_func_config(sc); + if (rc) { + sc->nwqs = OCE_MAX_WQ; + sc->nrssqs = max_rss; + sc->nrqs = sc->nrssqs + 1; + } + } + else { + rc = oce_get_profile_config(sc); + sc->nrssqs = max_rss; + sc->nrqs = sc->nrssqs + 1; + if (rc) + sc->nwqs = OCE_MAX_WQ; + } +} Modified: stable/9/sys/dev/oce/oce_if.h ============================================================================== --- stable/9/sys/dev/oce/oce_if.h Sat Jul 6 23:46:23 2013 (r252904) +++ stable/9/sys/dev/oce/oce_if.h Sat Jul 6 23:56:58 2013 (r252905) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -97,11 +97,21 @@ #define PCI_PRODUCT_BE3 0x0710 /* BE3 network adapter */ #define PCI_PRODUCT_XE201 0xe220 /* XE201 network adapter */ #define PCI_PRODUCT_XE201_VF 0xe228 /* XE201 with VF in Lancer */ +#define PCI_PRODUCT_SH 0x0720 /* Skyhawk network adapter */ #define IS_BE(sc) (((sc->flags & OCE_FLAGS_BE3) | \ (sc->flags & OCE_FLAGS_BE2))? 1:0) +#define IS_BE3(sc) (sc->flags & OCE_FLAGS_BE3) +#define IS_BE2(sc) (sc->flags & OCE_FLAGS_BE2) #define IS_XE201(sc) ((sc->flags & OCE_FLAGS_XE201) ? 1:0) #define HAS_A0_CHIP(sc) ((sc->flags & OCE_FLAGS_HAS_A0_CHIP) ? 1:0) +#define IS_SH(sc) ((sc->flags & OCE_FLAGS_SH) ? 1 : 0) + +#define is_be_mode_mc(sc) ((sc->function_mode & FNM_FLEX10_MODE) || \ + (sc->function_mode & FNM_UMC_MODE) || \ + (sc->function_mode & FNM_VNIC_MODE)) +#define OCE_FUNCTION_CAPS_SUPER_NIC 0x40 +#define IS_PROFILE_SUPER_NIC(sc) (sc->function_caps & OCE_FUNCTION_CAPS_SUPER_NIC) /* proportion Service Level Interface queues */ @@ -113,8 +123,9 @@ extern int mp_ncpus; /* system's total #define OCE_NCPUS mp_ncpus /* This should be powers of 2. Like 2,4,8 & 16 */ -#define OCE_MAX_RSS 4 /* TODO: 8*/ +#define OCE_MAX_RSS 8 #define OCE_LEGACY_MODE_RSS 4 /* For BE3 Legacy mode*/ +#define is_rss_enabled(sc) ((sc->function_caps & FNC_RSS) && !is_be_mode_mc(sc)) #define OCE_MIN_RQ 1 #define OCE_MIN_WQ 1 @@ -149,6 +160,7 @@ extern int mp_ncpus; /* system's total #define RSS_ENABLE_IPV6 0x4 #define RSS_ENABLE_TCP_IPV6 0x8 +#define INDIRECTION_TABLE_ENTRIES 128 /* flow control definitions */ #define OCE_FC_NONE 0x00000000 @@ -194,6 +206,9 @@ extern int mp_ncpus; /* system's total for (i = 0, wq = sc->wq[0]; i < sc->nwqs; i++, wq = sc->wq[i]) #define for_all_rq_queues(sc, rq, i) \ for (i = 0, rq = sc->rq[0]; i < sc->nrqs; i++, rq = sc->rq[i]) +#define for_all_rss_queues(sc, rq, i) \ + for (i = 0, rq = sc->rq[i + 1]; i < (sc->nrqs - 1); \ + i++, rq = sc->rq[i + 1]) #define for_all_evnt_queues(sc, eq, i) \ for (i = 0, eq = sc->eq[0]; i < sc->neqs; i++, eq = sc->eq[i]) #define for_all_cq_queues(sc, cq, i) \ @@ -671,8 +686,8 @@ struct oce_wq { struct oce_cq *cq; bus_dma_tag_t tag; struct oce_packet_desc pckts[OCE_WQ_PACKET_ARRAY_SIZE]; - uint32_t packets_in; - uint32_t packets_out; + uint32_t pkt_desc_tail; + uint32_t pkt_desc_head; uint32_t wqm_used; boolean_t resched; uint32_t wq_free; @@ -685,6 +700,7 @@ struct oce_wq { struct oce_tx_queue_stats tx_stats; struct buf_ring *br; struct task txtask; + uint32_t db_offset; }; struct rq_config { @@ -765,6 +781,7 @@ struct link_status { #define OCE_FLAGS_BE3 0x00000200 #define OCE_FLAGS_XE201 0x00000400 #define OCE_FLAGS_BE2 0x00000800 +#define OCE_FLAGS_SH 0x00001000 #define OCE_DEV_BE2_CFG_BAR 1 #define OCE_DEV_CFG_BAR 0 @@ -833,11 +850,11 @@ typedef struct oce_softc { uint32_t ncqs; uint32_t nrqs; uint32_t nwqs; + uint32_t nrssqs; uint32_t tx_ring_size; uint32_t rx_ring_size; uint32_t rq_frag_size; - uint32_t rss_enable; uint32_t if_id; /* interface ID */ uint32_t nifs; /* number of adapter interfaces, 0 or 1 */ @@ -873,37 +890,47 @@ typedef struct oce_softc { * BE3: accesses three BAR spaces (CFG, CSR, DB) * Lancer: accesses one BAR space (CFG) **************************************************/ -#define OCE_READ_REG32(sc, space, o) \ +#define OCE_READ_CSR_MPU(sc, space, o) \ ((IS_BE(sc)) ? (bus_space_read_4((sc)->space##_btag, \ - (sc)->space##_bhandle,o)) \ - : (bus_space_read_4((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o))) + (sc)->space##_bhandle,o)) \ + : (bus_space_read_4((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o))) +#define OCE_READ_REG32(sc, space, o) \ + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_read_4((sc)->space##_btag, \ + (sc)->space##_bhandle,o)) \ + : (bus_space_read_4((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o))) #define OCE_READ_REG16(sc, space, o) \ - ((IS_BE(sc)) ? (bus_space_read_2((sc)->space##_btag, \ - (sc)->space##_bhandle,o)) \ - : (bus_space_read_2((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o))) + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_read_2((sc)->space##_btag, \ + (sc)->space##_bhandle,o)) \ + : (bus_space_read_2((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o))) #define OCE_READ_REG8(sc, space, o) \ - ((IS_BE(sc)) ? (bus_space_read_1((sc)->space##_btag, \ - (sc)->space##_bhandle,o)) \ - : (bus_space_read_1((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o))) + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_read_1((sc)->space##_btag, \ + (sc)->space##_bhandle,o)) \ + : (bus_space_read_1((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o))) -#define OCE_WRITE_REG32(sc, space, o, v) \ +#define OCE_WRITE_CSR_MPU(sc, space, o, v) \ ((IS_BE(sc)) ? (bus_space_write_4((sc)->space##_btag, \ (sc)->space##_bhandle,o,v)) \ - : (bus_space_write_4((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o,v))) + : (bus_space_write_4((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o,v))) +#define OCE_WRITE_REG32(sc, space, o, v) \ + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_write_4((sc)->space##_btag, \ + (sc)->space##_bhandle,o,v)) \ + : (bus_space_write_4((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o,v))) #define OCE_WRITE_REG16(sc, space, o, v) \ - ((IS_BE(sc)) ? (bus_space_write_2((sc)->space##_btag, \ + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_write_2((sc)->space##_btag, \ (sc)->space##_bhandle,o,v)) \ - : (bus_space_write_2((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o,v))) + : (bus_space_write_2((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o,v))) #define OCE_WRITE_REG8(sc, space, o, v) \ - ((IS_BE(sc)) ? (bus_space_write_1((sc)->space##_btag, \ + ((IS_BE(sc) || IS_SH(sc)) ? (bus_space_write_1((sc)->space##_btag, \ (sc)->space##_bhandle,o,v)) \ - : (bus_space_write_1((sc)->devcfg_btag, \ - (sc)->devcfg_bhandle,o,v))) + : (bus_space_write_1((sc)->devcfg_btag, \ + (sc)->devcfg_bhandle,o,v))) /*********************************************************** @@ -1024,6 +1051,8 @@ int oce_mbox_cq_create(struct oce_cq *cq int oce_mbox_read_transrecv_data(POCE_SOFTC sc, uint32_t page_num); void oce_mbox_eqd_modify_periodic(POCE_SOFTC sc, struct oce_set_eqd *set_eqd, int num); +int oce_get_profile_config(POCE_SOFTC sc); +int oce_get_func_config(POCE_SOFTC sc); void mbx_common_req_hdr_init(struct mbx_hdr *hdr, uint8_t dom, uint8_t port, @@ -1072,6 +1101,9 @@ extern uint32_t oce_max_rsp_handled; /* #define LE_64(x) htole64(x) #define LE_32(x) htole32(x) #define LE_16(x) htole16(x) +#define HOST_64(x) le64toh(x) +#define HOST_32(x) le32toh(x) +#define HOST_16(x) le16toh(x) #define DW_SWAP(x, l) #define IS_ALIGNED(x,a) ((x % a) == 0) #define ADDR_HI(x) ((uint32_t)((uint64_t)(x) >> 32)) @@ -1104,6 +1136,16 @@ static inline uint32_t oce_highbit(uint3 return 0; } +static inline int MPU_EP_SEMAPHORE(POCE_SOFTC sc) +{ + if (IS_BE(sc)) + return MPU_EP_SEMAPHORE_BE3; + else if (IS_SH(sc)) + return MPU_EP_SEMAPHORE_SH; + else + return MPU_EP_SEMAPHORE_XE201; +} + #define TRANSCEIVER_DATA_NUM_ELE 64 #define TRANSCEIVER_DATA_SIZE 256 #define TRANSCEIVER_A0_SIZE 128 Modified: stable/9/sys/dev/oce/oce_mbox.c ============================================================================== --- stable/9/sys/dev/oce/oce_mbox.c Sat Jul 6 23:46:23 2013 (r252904) +++ stable/9/sys/dev/oce/oce_mbox.c Sat Jul 6 23:56:58 2013 (r252905) @@ -1,5 +1,5 @@ /*- - * Copyright (C) 2012 Emulex + * Copyright (C) 2013 Emulex * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -727,12 +727,14 @@ oce_rss_itbl_init(POCE_SOFTC sc, struct { int i = 0, j = 0, rc = 0; uint8_t *tbl = fwcmd->params.req.cputable; + struct oce_rq *rq = NULL; - for (j = 0; j < sc->nrqs; j++) { - if (sc->rq[j]->cfg.is_rss_queue) { - tbl[i] = sc->rq[j]->rss_cpuid; - i = i + 1; + for (j = 0; j < INDIRECTION_TABLE_ENTRIES ; j += (sc->nrqs - 1)) { + for_all_rss_queues(sc, rq, i) { + if ((j + i) >= INDIRECTION_TABLE_ENTRIES) + break; + tbl[j + i] = rq->rss_cpuid; } } if (i == 0) { @@ -766,7 +768,7 @@ oce_config_nic_rss(POCE_SOFTC sc, uint32 bzero(&mbx, sizeof(struct oce_mbx)); - if (IS_XE201(sc)) { + if (IS_XE201(sc) || IS_SH(sc)) { version = OCE_MBX_VER_V1; fwcmd->params.req.enable_rss = RSS_ENABLE_UDP_IPV4 | RSS_ENABLE_UDP_IPV6; @@ -1674,8 +1676,11 @@ oce_mbox_create_wq(struct oce_wq *wq) if (IS_XE201(sc)) { version = OCE_MBX_VER_V1; fwcmd->params.req.if_id = sc->if_id; - } else - version = OCE_MBX_VER_V0; + } else if(IS_BE(sc)) + IS_PROFILE_SUPER_NIC(sc) ? (version = OCE_MBX_VER_V2) + : (version = OCE_MBX_VER_V0); + else + version = OCE_MBX_VER_V2; mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0, MBX_SUBSYSTEM_NIC, @@ -1703,6 +1708,10 @@ oce_mbox_create_wq(struct oce_wq *wq) goto error; } wq->wq_id = LE_16(fwcmd->params.rsp.wq_id); + if (version == OCE_MBX_VER_V2) + wq->db_offset = LE_32(fwcmd->params.rsp.db_offset); + else + wq->db_offset = PD_TXULP_DB; error: return rc; @@ -1874,7 +1883,7 @@ oce_mbox_read_transrecv_data(POCE_SOFTC /* command post */ rc = oce_mbox_post(sc, &mbx, NULL); if (!rc) - rc = fwcmd->hdr.u0.rsp.status; + rc = fwcmd->hdr.u0.rsp.status; if (rc) { device_printf(sc->dev,"%s failed - cmd status: %d\n", __FUNCTION__, rc); @@ -1894,6 +1903,7 @@ oce_mbox_read_transrecv_data(POCE_SOFTC TRANSCEIVER_A2_SIZE); } error: + oce_dma_free(sc, &dma); return rc; } @@ -1935,10 +1945,193 @@ oce_mbox_eqd_modify_periodic(POCE_SOFTC rc = oce_mbox_post(sc, &mbx, NULL); if (!rc) - rc = fwcmd->hdr.u0.rsp.status; + rc = fwcmd->hdr.u0.rsp.status; if (rc) device_printf(sc->dev,"%s failed - cmd status: %d\n", __FUNCTION__, rc); } +int +oce_get_profile_config(POCE_SOFTC sc) +{ + struct oce_mbx mbx; + struct mbx_common_get_profile_config *fwcmd; + int rc = 0; + int version = 0; + struct oce_mq_sge *sgl; + OCE_DMA_MEM dma; + uint32_t desc_count = 0; + struct oce_nic_resc_desc *nic_desc = NULL; + int i; + boolean_t nic_desc_valid = FALSE; + + if (IS_BE2(sc)) + return -1; + + /* Allocate DMA mem*/ + if (oce_dma_alloc(sc, sizeof(struct mbx_common_get_profile_config), + &dma, 0)) + return ENOMEM; + + /* Initialize MODIFY_EQ_DELAY ioctl header */ + fwcmd = OCE_DMAPTR(&dma, struct mbx_common_get_profile_config); + bzero(fwcmd, sizeof(struct mbx_common_get_profile_config)); + + if (IS_BE3(sc)) + version = OCE_MBX_VER_V1; + else + version = OCE_MBX_VER_V0; + + bzero(&mbx, sizeof(struct oce_mbx)); + mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0, + MBX_SUBSYSTEM_COMMON, + OPCODE_COMMON_GET_PROFILE_CONFIG, + MBX_TIMEOUT_SEC, + sizeof(struct mbx_common_get_profile_config), + version); + /* fill rest of mbx */ + mbx.u0.s.embedded = 0; + mbx.payload_length = sizeof(struct mbx_common_get_profile_config); + mbx.u0.s.sge_count = 1; + sgl = &mbx.payload.u0.u1.sgl[0]; + sgl->pa_hi = htole32(upper_32_bits(dma.paddr)); + sgl->pa_lo = htole32((dma.paddr) & 0xFFFFFFFF); + sgl->length = htole32(mbx.payload_length); + DW_SWAP(u32ptr(&mbx), mbx.payload_length + OCE_BMBX_RHDR_SZ); + + fwcmd->params.req.type = ACTIVE_PROFILE; + + /* command post */ + rc = oce_mbox_post(sc, &mbx, NULL); + if (!rc) + rc = fwcmd->hdr.u0.rsp.status; + if (rc) { + device_printf(sc->dev,"%s failed - cmd status: %d\n", + __FUNCTION__, rc); + goto error; + } + + nic_desc = (struct oce_nic_resc_desc *) fwcmd->params.rsp.resources; + desc_count = HOST_32(fwcmd->params.rsp.desc_count); + for (i = 0; i < desc_count; i++) { + if ((nic_desc->desc_type == NIC_RESC_DESC_TYPE_V0) || + (nic_desc->desc_type == NIC_RESC_DESC_TYPE_V1)) { + nic_desc_valid = TRUE; + break; + } + nic_desc = (struct oce_nic_resc_desc *) \ + ((char *)nic_desc + nic_desc->desc_len); + } + if (!nic_desc_valid) { + rc = -1; + goto error; + } + else { + sc->nwqs = HOST_32(nic_desc->txq_count); + if (sc->nwqs) + sc->nwqs = MIN(sc->nwqs, OCE_MAX_WQ); + else + sc->nwqs = OCE_MAX_WQ; + + } +error: + oce_dma_free(sc, &dma); + return rc; + +} + +int +oce_get_func_config(POCE_SOFTC sc) +{ + struct oce_mbx mbx; + struct mbx_common_get_func_config *fwcmd; + int rc = 0; + int version = 0; + struct oce_mq_sge *sgl; + OCE_DMA_MEM dma; + uint32_t desc_count = 0; + struct oce_nic_resc_desc *nic_desc = NULL; + int i; + boolean_t nic_desc_valid = FALSE; + uint32_t max_rss = 0; + + if ((IS_BE(sc) || IS_SH(sc)) && (!sc->be3_native)) + max_rss = OCE_LEGACY_MODE_RSS; + else + max_rss = OCE_MAX_RSS; + + /* Allocate DMA mem*/ + if (oce_dma_alloc(sc, sizeof(struct mbx_common_get_func_config), + &dma, 0)) + return ENOMEM; + + /* Initialize MODIFY_EQ_DELAY ioctl header */ + fwcmd = OCE_DMAPTR(&dma, struct mbx_common_get_func_config); + bzero(fwcmd, sizeof(struct mbx_common_get_func_config)); + + if (IS_SH(sc)) + version = OCE_MBX_VER_V1; + else + version = OCE_MBX_VER_V0; + bzero(&mbx, sizeof(struct oce_mbx)); + mbx_common_req_hdr_init(&fwcmd->hdr, 0, 0, + MBX_SUBSYSTEM_COMMON, + OPCODE_COMMON_GET_FUNCTION_CONFIG, + MBX_TIMEOUT_SEC, + sizeof(struct mbx_common_get_func_config), + version); + /* fill rest of mbx */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***