From owner-svn-src-all@freebsd.org Sun Dec 6 00:20:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1200A3FB30; Sun, 6 Dec 2015 00:20:46 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF85C1A83; Sun, 6 Dec 2015 00:20:46 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB60KjmK065531; Sun, 6 Dec 2015 00:20:45 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB60KjFB065530; Sun, 6 Dec 2015 00:20:45 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201512060020.tB60KjFB065530@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Sun, 6 Dec 2015 00:20:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291877 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 00:20:47 -0000 Author: nwhitehorn Date: Sun Dec 6 00:20:45 2015 New Revision: 291877 URL: https://svnweb.freebsd.org/changeset/base/291877 Log: Adapt to new wireless scheme where base wlan interfaces do not show up in ifconfig anymore. Modified: head/usr.sbin/bsdinstall/scripts/netconfig Modified: head/usr.sbin/bsdinstall/scripts/netconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/netconfig Sat Dec 5 23:59:30 2015 (r291876) +++ head/usr.sbin/bsdinstall/scripts/netconfig Sun Dec 6 00:20:45 2015 (r291877) @@ -41,19 +41,24 @@ DIALOG_TAGS="" : ${DIALOG_ITEM_HELP=4} : ${DIALOG_ESC=255} -# Do a dirty check to see if this a wireless interface -- there should be a -# better way -is_wireless_if() { - ifconfig $1 | grep -q 'media: IEEE 802.11 Wireless' -} - for IF in `ifconfig -l`; do test "$IF" = "lo0" && continue (ifconfig -g wlan | egrep -wq $IF) && continue INTERFACES="$INTERFACES $IF" +done + +INTERFACES="$INTERFACES $(sysctl -in net.wlan.devices)" +is_wireless_if() { + for IF in $(sysctl -in net.wlan.devices); do + if [ $IF = $1 ]; then + return 0 + fi + done + return 1 +} + +for IF in $INTERFACES; do DESC=`sysctl -n dev.$(echo $IF | sed -E 's/([[:alpha:]]*)([[:digit:]]*)/\1.\2/g').%desc` - is_wireless_if $IF && echo $DESC | - grep -iqv wireless && DESC="Wireless $DESC" DIALOG_TAGS="$DIALOG_TAGS $IF \"$DESC\"" done From owner-svn-src-all@freebsd.org Sun Dec 6 00:27:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28139A3FE5A; Sun, 6 Dec 2015 00:27:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA5961FF7; Sun, 6 Dec 2015 00:27:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB60RaFx068266; Sun, 6 Dec 2015 00:27:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB60RaxT068265; Sun, 6 Dec 2015 00:27:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512060027.tB60RaxT068265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 6 Dec 2015 00:27: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: r291878 - stable/9/lib/libc/locale X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 00:27:37 -0000 Author: ngie Date: Sun Dec 6 00:27:35 2015 New Revision: 291878 URL: https://svnweb.freebsd.org/changeset/base/291878 Log: MFstable/10 r291871: MFC r291296: Link localeconv(3) to localeconv_l(3) Modified: stable/9/lib/libc/locale/Makefile.inc Directory Properties: stable/9/ (props changed) stable/9/lib/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/locale/Makefile.inc ============================================================================== --- stable/9/lib/libc/locale/Makefile.inc Sun Dec 6 00:20:45 2015 (r291877) +++ stable/9/lib/libc/locale/Makefile.inc Sun Dec 6 00:27:35 2015 (r291878) @@ -78,6 +78,7 @@ MLINKS+=iswalnum_l.3 iswalpha_l.3 iswaln iswalnum_l.3 iswspecial_l.3 iswalnum_l.3 nextwctype_l.3 \ iswalnum_l.3 towctrans_l.3 iswalnum_l.3 wctrans_l.3 MLINKS+=isxdigit.3 ishexnumber.3 +MLINKS+=localeconv.3 localeconv_l.3 MLINKS+=mbrtowc.3 mbrtoc16.3 mbrtowc.3 mbrtoc32.3 MLINKS+=mbsrtowcs.3 mbsnrtowcs.3 MLINKS+=wcrtomb.3 c16rtomb.3 wcrtomb.3 c32rtomb.3 From owner-svn-src-all@freebsd.org Sun Dec 6 02:23:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C40C1A3B6AD; Sun, 6 Dec 2015 02:23:32 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp003.me.com (mr11p00im-asmtp003.me.com [17.110.69.254]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5F411FC7; Sun, 6 Dec 2015 02:23:32 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from [192.168.1.4] (c-24-6-178-251.hsd1.ca.comcast.net [24.6.178.251]) by mr11p00im-asmtp003.me.com (Oracle Communications Messaging Server 7.0.5.35.0 64bit (built Mar 31 2015)) with ESMTPSA id <0NYW00C1LZZ00C20@mr11p00im-asmtp003.me.com>; Sun, 06 Dec 2015 02:23:26 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2015-12-06_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 kscore.is_bulkscore=0 kscore.compositescore=1 compositescore=0.9 suspectscore=0 phishscore=0 bulkscore=0 kscore.is_spamscore=0 rbsscore=0 spamscore=0 urlsuspectscore=0.9 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510090000 definitions=main-1512060044 User-Agent: Microsoft-MacOutlook/0.0.0.151105 Date: Sat, 05 Dec 2015 18:23:24 -0800 Subject: Re: svn commit: r291716 - in head: share/man/man4 sys/cam sys/cam/ata sys/cam/scsi sys/dev/md sys/geom sys/kern sys/pc98/include sys/sys usr.sbin usr.sbin/camdd From: Ravi Pokala Sender: "Pokala, Ravi" To: "Kenneth D. Merry" , Ravi Pokala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r291716 - in head: share/man/man4 sys/cam sys/cam/ata sys/cam/scsi sys/dev/md sys/geom sys/kern sys/pc98/include sys/sys usr.sbin usr.sbin/camdd References: <201512032054.tB3KsuUw037541@repo.freebsd.org> <75635FDB-E85F-4F0A-8EDC-8A29F8A095BE@panasas.com> <20151204163208.GA93141@mithlond.kdm.org> In-reply-to: <20151204163208.GA93141@mithlond.kdm.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 02:23:33 -0000 -----Original Message----- From: "Kenneth D. Merry" Date: 2015-12-04, Friday at 08:32 To: Ravi Pokala Cc: , , Subject: Re: svn commit: r291716 - in head: share/man/man4 sys/cam sys/cam/ata sys/cam/scsi sys/dev/md sys/geom sys/kern sys/pc98/include sys/sys usr.sbin usr.sbin/camdd >On Thu, Dec 03, 2015 at 23:55:14 -0800, Ravi Pokala wrote: >>(a) How does that work? That is, how does the argument get to the ioctl handler in the kernel? >> > >In sys_ioctl(), in sys/kern/sys_generic.c, the pointer argument ("data") to >the ioctl syscall is passed through into kern_ioctl() and then on down >until it gets into the passioctl() call. It is passed through even when >the declared size of the ioctl is 0, as it is for the two new ioctls: > >... > >The problem is, upon exit from the ioctl, that data is freed. With a >queueing interface, we need to keep a copy of the CCB around after the >ioctl exits. You have the same problem even after r274017, because that >just provides a small buffer on the stack. (And would only help in the >pointer case. And we don't need to copyin the pointer.) > >So, to avoid that, we don't declare an argument, but we do pass in a >pointer and do the copy the user's CCB into a CCB that is allocated inside >the pass(4) driver. Clever! I've actually written and modified ioctl handlers many times, but it was always with a declared argument (via _IOR | _IOW | IOWR), and I never had to worry about persistence after the handler exits. So, I've never had to pay much attention to what happens between the userland call and the handler getting invoked. >> (b) The CCB is large, but the CCB pointer is just a pointer; shouldn't that be passed in as the arg? >> > >It is. Here's what camdd(8) does: Yeah, I was thrown by the fact that there wasn't a declared arg; sys_ioctl() DTRT and figures it out anyway. Thanks, Ravi (rpokala@) >Ken >-- >Kenneth Merry >ken@FreeBSD.ORG From owner-svn-src-all@freebsd.org Sun Dec 6 04:48:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06E7CA41095; Sun, 6 Dec 2015 04:48:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf0-x231.google.com (mail-pf0-x231.google.com [IPv6:2607:f8b0:400e:c00::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD5001BFC; Sun, 6 Dec 2015 04:48:33 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by pfbg73 with SMTP id g73so48078041pfb.1; Sat, 05 Dec 2015 20:48:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=TA+UXAYc+Cs7zHki/fT8JLCEx/oOQyIdiOsYAyckZZw=; b=B25dOsi5MYV6XUxetRxA+g2gVrwRx1XzdpXtXHa6CrIK9KmB0XW+Rs1bRbAI2R2Pii wjYoPa4RvJaXDxA7y0YSMbeI+EuOQaCu5/IdTpXU7RtoTbPmZ5pt7iphAJjSf5u9OCAT RyPHYWkK+3O0vkT1RMk5kTQE6AIDnnx8sldj8J2KhUA2KR050rQF7iLFXUmRJxzNm4FT LHcENkOJA9RpQqYcX2E15EoQoyXtQCBriwYMvT96WkA2ztq77mKCvWyNV7aNl+um8b9I bwH+o38ROdGY61atUKbyMboovghwM8hbgFzvPD770R4+h53MjJOL5LKhQ7BN02IYN/qW wJow== X-Received: by 10.98.11.153 with SMTP id 25mr33916329pfl.102.1449377313407; Sat, 05 Dec 2015 20:48:33 -0800 (PST) Received: from ?IPv6:2601:601:800:126d:20da:f646:2948:7ae0? ([2601:601:800:126d:20da:f646:2948:7ae0]) by smtp.gmail.com with ESMTPSA id e20sm26186574pfb.1.2015.12.05.20.48.31 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 05 Dec 2015 20:48:32 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r291635 - in head: . share/mk From: NGie Cooper In-Reply-To: <201512020150.tB21oMtW076460@repo.freebsd.org> Date: Sat, 5 Dec 2015 20:48:30 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: References: <201512020150.tB21oMtW076460@repo.freebsd.org> To: Bryan Drewery X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 04:48:34 -0000 > On Dec 1, 2015, at 17:50, Bryan Drewery wrote: >=20 > Author: bdrewery > Date: Wed Dec 2 01:50:22 2015 > New Revision: 291635 > URL: https://svnweb.freebsd.org/changeset/base/291635 >=20 > Log: =E2=80=A6 > Makefile.inc1 includes a guard so that 'make all' will not use = SUBDIR_PARALLEL, > added in r289438. This is so users do not get a probably broken = build if they > run 'make all' from the top-level. Before the change in this commit, = the > workaround for 'make everything' was 'par-all' which would depend on = 'all' and > cause a proper parallel recursion. Now that will not work so a new > _PARALLEL_SUBUDIR_OK is used to allow it. Silly question =E2=80=94 was the spelling intentional (SUBUDIR, not = SUBDIR)? Thanks! -NGie= From owner-svn-src-all@freebsd.org Sun Dec 6 06:53:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AA32A3BB41; Sun, 6 Dec 2015 06:53:39 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E94F31F0C; Sun, 6 Dec 2015 06:53:38 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB66rcPD081194; Sun, 6 Dec 2015 06:53:38 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB66rcvF081193; Sun, 6 Dec 2015 06:53:38 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512060653.tB66rcvF081193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 6 Dec 2015 06:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291891 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 06:53:39 -0000 Author: ngie Date: Sun Dec 6 06:53:37 2015 New Revision: 291891 URL: https://svnweb.freebsd.org/changeset/base/291891 Log: Use .Fx instead of explicitly spelling out FreeBSD Fix several warnings reported by igor MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man7/tests.7 Modified: head/share/man/man7/tests.7 ============================================================================== --- head/share/man/man7/tests.7 Sun Dec 6 05:56:49 2015 (r291890) +++ head/share/man/man7/tests.7 Sun Dec 6 06:53:37 2015 (r291891) @@ -26,20 +26,22 @@ .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 13, 2014 +.Dd December 5, 2015 .Dt TESTS 7 .Os .Sh NAME .Nm tests -.Nd introduction to the FreeBSD Test Suite +.Nd introduction to the +.Fx +Test Suite .Sh DESCRIPTION The .Fx Test Suite provides a collection of automated tests for two major purposes. On one hand, the test suite aids .Em developers -to detect bugs and regressions when they modify the source tree. On the other -hand, it allows +to detect bugs and regressions when they modify the source tree. +On the other hand, it allows .Em end users (and, in particular, system administrators) to verify that fresh installations of the @@ -164,23 +166,26 @@ Test Suite: .Bl -tag -width "allow_sysctl_side_effects" .It allow_devfs_side_effects If defined, enables tests that may destroy and recreate semipermanent device -nodes, like disk devices. Without this variable, tests may still create and -destroy devices nodes that are normally transient, like /dev/tap* and -/dev/pts*, as long as they clean them up afterwards. However, tests that -require this variable have a relaxed cleanup requirement; they must recreate -any devices that they destroyed, but not necessarily with the same devnames. +nodes, like disk devices. +Without this variable, tests may still create and destroy devices nodes that +are normally transient, like /dev/tap* and /dev/pts*, as long as they clean +them up afterwards. +However, tests that require this variable have a relaxed cleanup requirement; +they must recreate any devices that they destroyed, but not necessarily with +the same devnames. .It allow_sysctl_side_effects Enables tests that change globally significant .Xr sysctl 8 -variables. The tests will undo any changes in their cleanup phases. +variables. +The tests will undo any changes in their cleanup phases. .It disks -Must be set to a space delimited list of disk device nodes. Tests that need -destructive access to disks must use these devices. Tests are not required to -preserve any data present on these disks. +Must be set to a space delimited list of disk device nodes. +Tests that need destructive access to disks must use these devices. +Tests are not required to preserve any data present on these disks. .It fibs -Must be set to a space delimited list of FIBs (routing tables). Tests that -need to modify a routing table may use any of these. Tests will cleanup any -new routes that they create. +Must be set to a space delimited list of FIBs (routing tables). +Tests that need to modify a routing table may use any of these. +Tests will cleanup any new routes that they create. .El .Ss What to do if something fails? If there is From owner-svn-src-all@freebsd.org Sun Dec 6 07:00:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 339A0A3BC2C; Sun, 6 Dec 2015 07:00:25 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC4B111A5; Sun, 6 Dec 2015 07:00:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB670Ow2081621; Sun, 6 Dec 2015 07:00:24 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB670OOJ081620; Sun, 6 Dec 2015 07:00:24 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512060700.tB670OOJ081620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 6 Dec 2015 07:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291892 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 07:00:25 -0000 Author: ngie Date: Sun Dec 6 07:00:23 2015 New Revision: 291892 URL: https://svnweb.freebsd.org/changeset/base/291892 Log: Remove redundant default TESTSDIR that is already defined in bsd.test.mk after r289158 MFC after: 1 week X-MFC with: r289158 Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/suite.test.mk Modified: head/share/mk/suite.test.mk ============================================================================== --- head/share/mk/suite.test.mk Sun Dec 6 06:53:37 2015 (r291891) +++ head/share/mk/suite.test.mk Sun Dec 6 07:00:23 2015 (r291892) @@ -8,10 +8,6 @@ .error suite.test.mk cannot be included directly. .endif -# Directory in which to install tests defined by the current Makefile. -# Makefiles have to override this to point to a subdirectory of TESTSBASE. -TESTSDIR?= . - # Name of the test suite these tests belong to. Should rarely be changed for # Makefiles built into the FreeBSD src tree. TESTSUITE?= FreeBSD From owner-svn-src-all@freebsd.org Sun Dec 6 07:30:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 001EBA411FE; Sun, 6 Dec 2015 07:30:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF81210E6; Sun, 6 Dec 2015 07:30:19 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB67UIfp090473; Sun, 6 Dec 2015 07:30:18 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB67UIZg090472; Sun, 6 Dec 2015 07:30:18 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512060730.tB67UIZg090472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 6 Dec 2015 07:30:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291896 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 07:30:20 -0000 Author: ngie Date: Sun Dec 6 07:30:18 2015 New Revision: 291896 URL: https://svnweb.freebsd.org/changeset/base/291896 Log: Remove unused atf.test.mk variables - ATF_BUILD_CC - ATF_BUILD_CPP - ATF_BUILD_CXX - ATF_SHELL - ATF_PREFIX MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/atf.test.mk Modified: head/share/mk/atf.test.mk ============================================================================== --- head/share/mk/atf.test.mk Sun Dec 6 07:18:23 2015 (r291895) +++ head/share/mk/atf.test.mk Sun Dec 6 07:30:18 2015 (r291896) @@ -22,29 +22,6 @@ ATF_TESTS_C?= ATF_TESTS_CXX?= ATF_TESTS_SH?= -# Path to the prefix of the installed ATF tools, if any. -# -# If atf-run and atf-report are installed from ports, we automatically define a -# realregress target below to run the tests using these tools. The tools are -# searched for in the hierarchy specified by this variable. -ATF_PREFIX?= /usr/local - -# C compiler passed to ATF tests that need to build code. -ATF_BUILD_CC?= ${DESTDIR}/usr/bin/cc -TESTS_ENV+= ATF_BUILD_CC=${ATF_BUILD_CC} - -# C preprocessor passed to ATF tests that need to build code. -ATF_BUILD_CPP?= ${DESTDIR}/usr/bin/cpp -TESTS_ENV+= ATF_BUILD_CPP=${ATF_BUILD_CPP} - -# C++ compiler passed to ATF tests that need to build code. -ATF_BUILD_CXX?= ${DESTDIR}/usr/bin/c++ -TESTS_ENV+= ATF_BUILD_CXX=${ATF_BUILD_CXX} - -# Shell interpreter used to run atf-sh(1) based tests. -ATF_SHELL?= ${DESTDIR}/bin/sh -TESTS_ENV+= ATF_SHELL=${ATF_SHELL} - .if !empty(ATF_TESTS_C) PROGS+= ${ATF_TESTS_C} _TESTS+= ${ATF_TESTS_C} From owner-svn-src-all@freebsd.org Sun Dec 6 14:07:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B09999A046; Sun, 6 Dec 2015 14:07:59 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 166721A04; Sun, 6 Dec 2015 14:07:59 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB6E7wfJ008028; Sun, 6 Dec 2015 14:07:58 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB6E7wHO008026; Sun, 6 Dec 2015 14:07:58 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201512061407.tB6E7wHO008026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Sun, 6 Dec 2015 14:07:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291902 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 14:07:59 -0000 Author: kevlo Date: Sun Dec 6 14:07:57 2015 New Revision: 291902 URL: https://svnweb.freebsd.org/changeset/base/291902 Log: - Fix Tx queues to USB endpoints mapping - Merge urtwn_r92c_dma_init() and urtwn_r88e_dma_init() into one Reviewed by: adrian, avos Differential Revision: https://reviews.freebsd.org/D4381 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnvar.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sun Dec 6 08:20:07 2015 (r291901) +++ head/sys/dev/usb/wlan/if_urtwn.c Sun Dec 6 14:07:57 2015 (r291902) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -70,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "usbdevs.h" #define USB_DEBUG_VAR urtwn_debug @@ -265,8 +267,7 @@ static void urtwn_r88e_fw_reset(struct static int urtwn_fw_loadpage(struct urtwn_softc *, int, const uint8_t *, int); static int urtwn_load_firmware(struct urtwn_softc *); -static int urtwn_r92c_dma_init(struct urtwn_softc *); -static int urtwn_r88e_dma_init(struct urtwn_softc *); +static int urtwn_dma_init(struct urtwn_softc *); static int urtwn_mac_init(struct urtwn_softc *); static void urtwn_bb_init(struct urtwn_softc *); static void urtwn_rf_init(struct urtwn_softc *); @@ -396,7 +397,7 @@ urtwn_attach(device_t self) struct usb_attach_arg *uaa = device_get_ivars(self); struct urtwn_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; - uint8_t iface_index, bands; + uint8_t bands; int error; device_set_usb_desc(self); @@ -410,9 +411,9 @@ urtwn_attach(device_t self) callout_init(&sc->sc_watchdog_ch, 0); mbufq_init(&sc->sc_snd, ifqmaxlen); - iface_index = URTWN_IFACE_INDEX; - error = usbd_transfer_setup(uaa->device, &iface_index, sc->sc_xfer, - urtwn_config, URTWN_N_TRANSFER, sc, &sc->sc_mtx); + sc->sc_iface_index = URTWN_IFACE_INDEX; + error = usbd_transfer_setup(uaa->device, &sc->sc_iface_index, + sc->sc_xfer, urtwn_config, URTWN_N_TRANSFER, sc, &sc->sc_mtx); if (error) { device_printf(self, "could not allocate USB transfers, " "err=%s\n", usbd_errstr(error)); @@ -1471,7 +1472,6 @@ urtwn_read_rom(struct urtwn_softc *sc) sc->sc_rf_write = urtwn_r92c_rf_write; sc->sc_power_on = urtwn_r92c_power_on; - sc->sc_dma_init = urtwn_r92c_dma_init; return (0); } @@ -1503,7 +1503,6 @@ urtwn_r88e_read_rom(struct urtwn_softc * sc->sc_rf_write = urtwn_r88e_rf_write; sc->sc_power_on = urtwn_r88e_power_on; - sc->sc_dma_init = urtwn_r88e_dma_init; return (0); } @@ -2811,86 +2810,103 @@ fail: return (error); } -static __inline int +static int urtwn_dma_init(struct urtwn_softc *sc) { + struct usb_endpoint *ep, *ep_end; usb_error_t usb_err; - int error; + uint32_t reg; + int hashq, hasnq, haslq, nqueues, ntx; + int error, pagecount, npubqpages, nqpages, nrempages, tx_boundary; /* Initialize LLT table. */ error = urtwn_llt_init(sc); if (error != 0) return (error); - error = sc->sc_dma_init(sc); - if (error != 0) - return (error); - - /* Set Tx/Rx transfer page size. */ - usb_err = urtwn_write_1(sc, R92C_PBP, - SM(R92C_PBP_PSRX, R92C_PBP_128) | - SM(R92C_PBP_PSTX, R92C_PBP_128)); - if (usb_err != USB_ERR_NORMAL_COMPLETION) + /* Determine the number of bulk-out pipes. */ + ntx = 0; + ep = sc->sc_udev->endpoints; + ep_end = sc->sc_udev->endpoints + sc->sc_udev->endpoints_max; + for (; ep != ep_end; ep++) { + if ((ep->edesc == NULL) || + (ep->iface_index != sc->sc_iface_index)) + continue; + if (UE_GET_DIR(ep->edesc->bEndpointAddress) == UE_DIR_OUT) + ntx++; + } + if (ntx == 0) { + device_printf(sc->sc_dev, + "%d: invalid number of Tx bulk pipes\n", ntx); return (EIO); - - return (0); -} - -static int -urtwn_r92c_dma_init(struct urtwn_softc *sc) -{ - int hashq, hasnq, haslq, nqueues, nqpages, nrempages; - usb_error_t error; - uint32_t reg; + } /* Get Tx queues to USB endpoints mapping. */ - hashq = hasnq = haslq = 0; - reg = urtwn_read_2(sc, R92C_USB_EP + 1); - DPRINTFN(2, "USB endpoints mapping 0x%x\n", reg); - if (MS(reg, R92C_USB_EP_HQ) != 0) - hashq = 1; - if (MS(reg, R92C_USB_EP_NQ) != 0) - hasnq = 1; - if (MS(reg, R92C_USB_EP_LQ) != 0) - haslq = 1; + hashq = hasnq = haslq = nqueues = 0; + switch (ntx) { + case 1: hashq = 1; break; + case 2: hashq = hasnq = 1; break; + case 3: case 4: hashq = hasnq = haslq = 1; break; + } nqueues = hashq + hasnq + haslq; if (nqueues == 0) return (EIO); - /* Get the number of pages for each queue. */ - nqpages = (R92C_TX_PAGE_COUNT - R92C_PUBQ_NPAGES) / nqueues; - /* The remaining pages are assigned to the high priority queue. */ - nrempages = (R92C_TX_PAGE_COUNT - R92C_PUBQ_NPAGES) % nqueues; + + npubqpages = nqpages = nrempages = pagecount = 0; + if (sc->chip & URTWN_CHIP_88E) + tx_boundary = R88E_TX_PAGE_BOUNDARY; + else { + pagecount = R92C_TX_PAGE_COUNT; + npubqpages = R92C_PUBQ_NPAGES; + tx_boundary = R92C_TX_PAGE_BOUNDARY; + } /* Set number of pages for normal priority queue. */ - error = urtwn_write_1(sc, R92C_RQPN_NPQ, hasnq ? nqpages : 0); - if (error != USB_ERR_NORMAL_COMPLETION) - return (EIO); - error = urtwn_write_4(sc, R92C_RQPN, - /* Set number of pages for public queue. */ - SM(R92C_RQPN_PUBQ, R92C_PUBQ_NPAGES) | - /* Set number of pages for high priority queue. */ - SM(R92C_RQPN_HPQ, hashq ? nqpages + nrempages : 0) | - /* Set number of pages for low priority queue. */ - SM(R92C_RQPN_LPQ, haslq ? nqpages : 0) | - /* Load values. */ - R92C_RQPN_LD); - if (error != USB_ERR_NORMAL_COMPLETION) - return (EIO); + if (sc->chip & URTWN_CHIP_88E) { + usb_err = urtwn_write_2(sc, R92C_RQPN_NPQ, 0xd); + if (usb_err != USB_ERR_NORMAL_COMPLETION) + return (EIO); + usb_err = urtwn_write_4(sc, R92C_RQPN, 0x808e000d); + if (usb_err != USB_ERR_NORMAL_COMPLETION) + return (EIO); + } else { + /* Get the number of pages for each queue. */ + nqpages = (pagecount - npubqpages) / nqueues; + /* + * The remaining pages are assigned to the high priority + * queue. + */ + nrempages = (pagecount - npubqpages) % nqueues; + usb_err = urtwn_write_1(sc, R92C_RQPN_NPQ, hasnq ? nqpages : 0); + if (usb_err != USB_ERR_NORMAL_COMPLETION) + return (EIO); + usb_err = urtwn_write_4(sc, R92C_RQPN, + /* Set number of pages for public queue. */ + SM(R92C_RQPN_PUBQ, npubqpages) | + /* Set number of pages for high priority queue. */ + SM(R92C_RQPN_HPQ, hashq ? nqpages + nrempages : 0) | + /* Set number of pages for low priority queue. */ + SM(R92C_RQPN_LPQ, haslq ? nqpages : 0) | + /* Load values. */ + R92C_RQPN_LD); + if (usb_err != USB_ERR_NORMAL_COMPLETION) + return (EIO); + } - error = urtwn_write_1(sc, R92C_TXPKTBUF_BCNQ_BDNY, R92C_TX_PAGE_BOUNDARY); - if (error != USB_ERR_NORMAL_COMPLETION) + usb_err = urtwn_write_1(sc, R92C_TXPKTBUF_BCNQ_BDNY, tx_boundary); + if (usb_err != USB_ERR_NORMAL_COMPLETION) return (EIO); - error = urtwn_write_1(sc, R92C_TXPKTBUF_MGQ_BDNY, R92C_TX_PAGE_BOUNDARY); - if (error != USB_ERR_NORMAL_COMPLETION) + usb_err = urtwn_write_1(sc, R92C_TXPKTBUF_MGQ_BDNY, tx_boundary); + if (usb_err != USB_ERR_NORMAL_COMPLETION) return (EIO); - error = urtwn_write_1(sc, R92C_TXPKTBUF_WMAC_LBK_BF_HD, R92C_TX_PAGE_BOUNDARY); - if (error != USB_ERR_NORMAL_COMPLETION) + usb_err = urtwn_write_1(sc, R92C_TXPKTBUF_WMAC_LBK_BF_HD, tx_boundary); + if (usb_err != USB_ERR_NORMAL_COMPLETION) return (EIO); - error = urtwn_write_1(sc, R92C_TRXFF_BNDY, R92C_TX_PAGE_BOUNDARY); - if (error != USB_ERR_NORMAL_COMPLETION) + usb_err = urtwn_write_1(sc, R92C_TRXFF_BNDY, tx_boundary); + if (usb_err != USB_ERR_NORMAL_COMPLETION) return (EIO); - error = urtwn_write_1(sc, R92C_TDECTRL + 1, R92C_TX_PAGE_BOUNDARY); - if (error != USB_ERR_NORMAL_COMPLETION) + usb_err = urtwn_write_1(sc, R92C_TDECTRL + 1, tx_boundary); + if (usb_err != USB_ERR_NORMAL_COMPLETION) return (EIO); /* Set queue to USB pipe mapping. */ @@ -2913,72 +2929,21 @@ urtwn_r92c_dma_init(struct urtwn_softc * reg |= R92C_TRXDMA_CTRL_QMAP_HQ_LQ; } else reg |= R92C_TRXDMA_CTRL_QMAP_3EP; - error = urtwn_write_2(sc, R92C_TRXDMA_CTRL, reg); - if (error != USB_ERR_NORMAL_COMPLETION) + usb_err = urtwn_write_2(sc, R92C_TRXDMA_CTRL, reg); + if (usb_err != USB_ERR_NORMAL_COMPLETION) return (EIO); /* Set Tx/Rx transfer page boundary. */ - error = urtwn_write_2(sc, R92C_TRXFF_BNDY + 2, 0x27ff); - if (error != USB_ERR_NORMAL_COMPLETION) - return (EIO); - - return (0); -} - -static int -urtwn_r88e_dma_init(struct urtwn_softc *sc) -{ - struct usb_interface *iface; - uint32_t reg; - usb_error_t error; - int nqueues; - - /* Get Tx queues to USB endpoints mapping. */ - iface = usbd_get_iface(sc->sc_udev, 0); - nqueues = iface->idesc->bNumEndpoints - 1; - if (nqueues == 0) - return (EIO); - - /* Set number of pages for normal priority queue. */ - error = urtwn_write_2(sc, R92C_RQPN_NPQ, 0x000d); - if (error != USB_ERR_NORMAL_COMPLETION) - return (EIO); - error = urtwn_write_4(sc, R92C_RQPN, 0x808e000d); - if (error != USB_ERR_NORMAL_COMPLETION) - return (EIO); - - error = urtwn_write_1(sc, R92C_TXPKTBUF_BCNQ_BDNY, R88E_TX_PAGE_BOUNDARY); - if (error != USB_ERR_NORMAL_COMPLETION) - return (EIO); - error = urtwn_write_1(sc, R92C_TXPKTBUF_MGQ_BDNY, R88E_TX_PAGE_BOUNDARY); - if (error != USB_ERR_NORMAL_COMPLETION) - return (EIO); - error = urtwn_write_1(sc, R92C_TXPKTBUF_WMAC_LBK_BF_HD, R88E_TX_PAGE_BOUNDARY); - if (error != USB_ERR_NORMAL_COMPLETION) - return (EIO); - error = urtwn_write_1(sc, R92C_TRXFF_BNDY, R88E_TX_PAGE_BOUNDARY); - if (error != USB_ERR_NORMAL_COMPLETION) - return (EIO); - error = urtwn_write_1(sc, R92C_TDECTRL + 1, R88E_TX_PAGE_BOUNDARY); - if (error != USB_ERR_NORMAL_COMPLETION) - return (EIO); - - /* Set queue to USB pipe mapping. */ - reg = urtwn_read_2(sc, R92C_TRXDMA_CTRL); - reg &= ~R92C_TRXDMA_CTRL_QMAP_M; - if (nqueues == 1) - reg |= R92C_TRXDMA_CTRL_QMAP_LQ; - else if (nqueues == 2) - reg |= R92C_TRXDMA_CTRL_QMAP_HQ_NQ; - else - reg |= R92C_TRXDMA_CTRL_QMAP_3EP; - error = urtwn_write_2(sc, R92C_TRXDMA_CTRL, reg); - if (error != USB_ERR_NORMAL_COMPLETION) + usb_err = urtwn_write_2(sc, R92C_TRXFF_BNDY + 2, + (sc->chip & URTWN_CHIP_88E) ? 0x23ff : 0x27ff); + if (usb_err != USB_ERR_NORMAL_COMPLETION) return (EIO); - /* Set Tx/Rx transfer page boundary. */ - error = urtwn_write_2(sc, R92C_TRXFF_BNDY + 2, 0x23ff); - if (error != USB_ERR_NORMAL_COMPLETION) + /* Set Tx/Rx transfer page size. */ + usb_err = urtwn_write_1(sc, R92C_PBP, + SM(R92C_PBP_PSRX, R92C_PBP_128) | + SM(R92C_PBP_PSTX, R92C_PBP_128)); + if (usb_err != USB_ERR_NORMAL_COMPLETION) return (EIO); return (0); Modified: head/sys/dev/usb/wlan/if_urtwnvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnvar.h Sun Dec 6 08:20:07 2015 (r291901) +++ head/sys/dev/usb/wlan/if_urtwnvar.h Sun Dec 6 14:07:57 2015 (r291902) @@ -139,6 +139,7 @@ struct urtwn_softc { device_t sc_dev; struct usb_device *sc_udev; + uint8_t sc_iface_index; int ac2idx[WME_NUM_AC]; u_int sc_flags; #define URTWN_FLAG_CCK_HIPWR 0x01 @@ -155,7 +156,6 @@ struct urtwn_softc { void (*sc_rf_write)(struct urtwn_softc *, int, uint8_t, uint32_t); int (*sc_power_on)(struct urtwn_softc *); - int (*sc_dma_init)(struct urtwn_softc *); uint8_t board_type; uint8_t regulatory; From owner-svn-src-all@freebsd.org Sun Dec 6 14:09:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3906999A0EE; Sun, 6 Dec 2015 14:09:33 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0779A1C18; Sun, 6 Dec 2015 14:09:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB6E9WT4008125; Sun, 6 Dec 2015 14:09:32 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB6E9VR4008123; Sun, 6 Dec 2015 14:09:31 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201512061409.tB6E9VR4008123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 6 Dec 2015 14:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291903 - head/bin/sh/tests/parameters X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 14:09:33 -0000 Author: jilles Date: Sun Dec 6 14:09:31 2015 New Revision: 291903 URL: https://svnweb.freebsd.org/changeset/base/291903 Log: sh: Add limited test for ${#@} and ${#*}. POSIX leaves the result of expanding ${#@} and ${#*} unspecified, but ensure it is numeric. Added: head/bin/sh/tests/parameters/positional9.0 (contents, props changed) Modified: head/bin/sh/tests/parameters/Makefile Modified: head/bin/sh/tests/parameters/Makefile ============================================================================== --- head/bin/sh/tests/parameters/Makefile Sun Dec 6 14:07:57 2015 (r291902) +++ head/bin/sh/tests/parameters/Makefile Sun Dec 6 14:09:31 2015 (r291903) @@ -21,6 +21,7 @@ FILES+= positional5.0 FILES+= positional6.0 FILES+= positional7.0 FILES+= positional8.0 +FILES+= positional9.0 FILES+= pwd1.0 FILES+= pwd2.0 Added: head/bin/sh/tests/parameters/positional9.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parameters/positional9.0 Sun Dec 6 14:09:31 2015 (r291903) @@ -0,0 +1,18 @@ +# $FreeBSD$ +# Although POSIX leaves the result of expanding ${#@} and ${#*} unspecified, +# make sure it is at least numeric. + +set -- bb cc ddd +set -f +lengths=${#*}${#@}"${#*}${#@}"$(echo ${#*}${#@}"${#*}${#@}") +IFS= +lengths=$lengths${#*}${#@}"${#*}${#@}"$(echo ${#*}${#@}"${#*}${#@}") +case $lengths in +*[!0-9]*) + printf 'bad: %s\n' "$lengths" + exit 3 ;; +????????????????*) ;; +*) + printf 'too short: %s\n' "$lengths" + exit 3 ;; +esac From owner-svn-src-all@freebsd.org Sun Dec 6 16:17:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82DD49A00A3; Sun, 6 Dec 2015 16:17:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BBA51F50; Sun, 6 Dec 2015 16:17:59 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB6GHwbT046795; Sun, 6 Dec 2015 16:17:58 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB6GHv9a046787; Sun, 6 Dec 2015 16:17:57 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201512061617.tB6GHv9a046787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 6 Dec 2015 16:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291904 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 16:17:59 -0000 Author: tuexen Date: Sun Dec 6 16:17:57 2015 New Revision: 291904 URL: https://svnweb.freebsd.org/changeset/base/291904 Log: Fix the allocation of outgoing streams: * When processing a cookie, use the number of streams announced in the INIT-ACK. * When sending an INIT-ACK for an existing association, use the value from the association, not from the end-point. MFC after: 1 week Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet/sctputil.h head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Dec 6 14:09:31 2015 (r291903) +++ head/sys/netinet/sctp_input.c Sun Dec 6 16:17:57 2015 (r291904) @@ -2103,6 +2103,7 @@ sctp_process_cookie_new(struct mbuf *m, */ stcb = sctp_aloc_assoc(inp, init_src, &error, ntohl(initack_cp->init.initiate_tag), vrf_id, + ntohs(initack_cp->init.num_outbound_streams), (struct thread *)NULL ); if (stcb == NULL) { Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Dec 6 14:09:31 2015 (r291903) +++ head/sys/netinet/sctp_output.c Sun Dec 6 16:17:57 2015 (r291904) @@ -3652,6 +3652,7 @@ sctp_process_cmsgs_for_init(struct sctp_ #endif stcb->asoc.strmout[i].stream_no = i; stcb->asoc.strmout[i].last_msg_incomplete = 0; + stcb->asoc.strmout[i].state = SCTP_STREAM_OPENING; stcb->asoc.ss_functions.sctp_ss_init_stream(&stcb->asoc.strmout[i], NULL); } } @@ -5841,10 +5842,10 @@ do_a_abort: his_limit = ntohs(init_chk->init.num_inbound_streams); /* choose what I want */ if (asoc != NULL) { - if (asoc->streamoutcnt > inp->sctp_ep.pre_open_stream_count) { + if (asoc->streamoutcnt > asoc->pre_open_streams) { i_want = asoc->streamoutcnt; } else { - i_want = inp->sctp_ep.pre_open_stream_count; + i_want = asoc->pre_open_streams; } } else { i_want = inp->sctp_ep.pre_open_stream_count; @@ -12601,6 +12602,7 @@ sctp_lower_sosend(struct socket *so, } #endif stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, + inp->sctp_ep.pre_open_stream_count, p ); if (stcb == NULL) { Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Dec 6 14:09:31 2015 (r291903) +++ head/sys/netinet/sctp_pcb.c Sun Dec 6 16:17:57 2015 (r291904) @@ -4160,6 +4160,7 @@ try_again: struct sctp_tcb * sctp_aloc_assoc(struct sctp_inpcb *inp, struct sockaddr *firstaddr, int *error, uint32_t override_tag, uint32_t vrf_id, + uint16_t o_streams, struct thread *p ) { @@ -4318,7 +4319,7 @@ sctp_aloc_assoc(struct sctp_inpcb *inp, /* setup back pointer's */ stcb->sctp_ep = inp; stcb->sctp_socket = inp->sctp_socket; - if ((err = sctp_init_asoc(inp, stcb, override_tag, vrf_id))) { + if ((err = sctp_init_asoc(inp, stcb, override_tag, vrf_id, o_streams))) { /* failed */ SCTP_TCB_LOCK_DESTROY(stcb); SCTP_TCB_SEND_LOCK_DESTROY(stcb); Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Sun Dec 6 14:09:31 2015 (r291903) +++ head/sys/netinet/sctp_pcb.h Sun Dec 6 16:17:57 2015 (r291904) @@ -584,7 +584,7 @@ void sctp_inpcb_free(struct sctp_inpcb * struct sctp_tcb * sctp_aloc_assoc(struct sctp_inpcb *, struct sockaddr *, - int *, uint32_t, uint32_t, struct thread *); + int *, uint32_t, uint32_t, uint16_t, struct thread *); int sctp_free_assoc(struct sctp_inpcb *, struct sctp_tcb *, int, int); Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Sun Dec 6 14:09:31 2015 (r291903) +++ head/sys/netinet/sctp_usrreq.c Sun Dec 6 16:17:57 2015 (r291904) @@ -1501,6 +1501,7 @@ sctp_do_connect_x(struct socket *so, str /* We are GOOD to go */ stcb = sctp_aloc_assoc(inp, sa, &error, 0, vrf_id, + inp->sctp_ep.pre_open_stream_count, (struct thread *)p ); if (stcb == NULL) { @@ -6929,7 +6930,7 @@ sctp_connect(struct socket *so, struct s } vrf_id = inp->def_vrf_id; /* We are GOOD to go */ - stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, p); + stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, p); if (stcb == NULL) { /* Gak! no memory */ goto out_now; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Dec 6 14:09:31 2015 (r291903) +++ head/sys/netinet/sctputil.c Sun Dec 6 16:17:57 2015 (r291904) @@ -938,7 +938,7 @@ sctp_map_assoc_state(int kernel_state) int sctp_init_asoc(struct sctp_inpcb *inp, struct sctp_tcb *stcb, - uint32_t override_tag, uint32_t vrf_id) + uint32_t override_tag, uint32_t vrf_id, uint16_t o_strms) { struct sctp_association *asoc; @@ -1100,7 +1100,7 @@ sctp_init_asoc(struct sctp_inpcb *inp, s * that we request by default. */ asoc->strm_realoutsize = asoc->streamoutcnt = asoc->pre_open_streams = - inp->sctp_ep.pre_open_stream_count; + o_strms; SCTP_MALLOC(asoc->strmout, struct sctp_stream_out *, asoc->streamoutcnt * sizeof(struct sctp_stream_out), SCTP_M_STRMO); Modified: head/sys/netinet/sctputil.h ============================================================================== --- head/sys/netinet/sctputil.h Sun Dec 6 14:09:31 2015 (r291903) +++ head/sys/netinet/sctputil.h Sun Dec 6 16:17:57 2015 (r291904) @@ -83,7 +83,7 @@ uint32_t sctp_select_initial_TSN(struct uint32_t sctp_select_a_tag(struct sctp_inpcb *, uint16_t lport, uint16_t rport, int); -int sctp_init_asoc(struct sctp_inpcb *, struct sctp_tcb *, uint32_t, uint32_t); +int sctp_init_asoc(struct sctp_inpcb *, struct sctp_tcb *, uint32_t, uint32_t, uint16_t); void sctp_fill_random_store(struct sctp_pcb *); Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Sun Dec 6 14:09:31 2015 (r291903) +++ head/sys/netinet6/sctp6_usrreq.c Sun Dec 6 16:17:57 2015 (r291904) @@ -946,7 +946,7 @@ sctp6_connect(struct socket *so, struct return (EALREADY); } /* We are GOOD to go */ - stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, p); + stcb = sctp_aloc_assoc(inp, addr, &error, 0, vrf_id, inp->sctp_ep.pre_open_stream_count, p); SCTP_ASOC_CREATE_UNLOCK(inp); if (stcb == NULL) { /* Gak! no memory */ From owner-svn-src-all@freebsd.org Sun Dec 6 17:03:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2DAF9A0B19; Sun, 6 Dec 2015 17:03:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id D0766196B; Sun, 6 Dec 2015 17:03:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id CB9D91CE3; Sun, 6 Dec 2015 17:03:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8378619F20; Sun, 6 Dec 2015 17:03:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id vN9A8wBNNNgB; Sun, 6 Dec 2015 17:03:15 +0000 (UTC) Subject: Re: svn commit: r291635 - in head: . share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 05F4719F1B To: NGie Cooper References: <201512020150.tB21oMtW076460@repo.freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56646A51.9010101@FreeBSD.org> Date: Sun, 6 Dec 2015 09:03:13 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="QmMXoqmR5UjAiBokkrHhRnCSFVnwrSA24" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 17:03:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --QmMXoqmR5UjAiBokkrHhRnCSFVnwrSA24 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 12/5/2015 8:48 PM, NGie Cooper wrote: >=20 >> On Dec 1, 2015, at 17:50, Bryan Drewery wrote: >> >> Author: bdrewery >> Date: Wed Dec 2 01:50:22 2015 >> New Revision: 291635 >> URL: https://svnweb.freebsd.org/changeset/base/291635 >> >> Log: >=20 > =E2=80=A6 >=20 >> Makefile.inc1 includes a guard so that 'make all' will not use SUBDIR= _PARALLEL, >> added in r289438. This is so users do not get a probably broken buil= d if they >> run 'make all' from the top-level. Before the change in this commit,= the >> workaround for 'make everything' was 'par-all' which would depend on = 'all' and >> cause a proper parallel recursion. Now that will not work so a new >> _PARALLEL_SUBUDIR_OK is used to allow it. >=20 > Silly question =E2=80=94 was the spelling intentional (SUBUDIR, not SUB= DIR)? Mistake, but it does not matter much. It's an internal hack. --=20 Regards, Bryan Drewery --QmMXoqmR5UjAiBokkrHhRnCSFVnwrSA24 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWZGpVAAoJEDXXcbtuRpfPEzcH/3sOEDqnTjRfLEJNSfjOLFag GcYEkxa9SPm21kY09WTo9eV6fMpzIUYha4t9z24vVCBoUOeBVMTMjyNJjzNnboSa aqnofQiMNxb+CHUYSMMrLYhZA789cSR3dPgcsbiKl/AX2Q5OzwLaXAV32oh4lu+R wBSxjoNLrltlBFTUN1GFd/WjVXqf2pXQnwnAXrkSDDg0XYwb3yZVB+6BMTQJGdIE chctpPgxCL4jxrYmMJq4hcoQpuzRp0mymzXjV4e1r2ShmzLxaCUC9YzT+vVJXMIL I6z/blHDngFLo4Abxra2IHLN2cWQ3P4UPvSsnNSib0QJVntNTGw8LOyWPmDTHks= =hblH -----END PGP SIGNATURE----- --QmMXoqmR5UjAiBokkrHhRnCSFVnwrSA24-- From owner-svn-src-all@freebsd.org Sun Dec 6 17:11:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E1BD9A0D19; Sun, 6 Dec 2015 17:11:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C8F7E1CB0; Sun, 6 Dec 2015 17:11:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB6HBNqq063979; Sun, 6 Dec 2015 17:11:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB6HBNhR063978; Sun, 6 Dec 2015 17:11:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512061711.tB6HBNhR063978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 6 Dec 2015 17:11:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291905 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 17:11:25 -0000 Author: kib Date: Sun Dec 6 17:11:23 2015 New Revision: 291905 URL: https://svnweb.freebsd.org/changeset/base/291905 Log: MFC r291446: Minor cleanup. Systematically use ANSI C functions definitions. Correct type of the flags argument to the dev_pager_putpages() function. vm_pager_free_nonreq() does not exist in stable/10, this part is not merged. Modified: stable/10/sys/vm/device_pager.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/device_pager.c ============================================================================== --- stable/10/sys/vm/device_pager.c Sun Dec 6 16:17:57 2015 (r291904) +++ stable/10/sys/vm/device_pager.c Sun Dec 6 17:11:23 2015 (r291905) @@ -60,10 +60,8 @@ static vm_object_t dev_pager_alloc(void vm_ooffset_t, struct ucred *); static void dev_pager_dealloc(vm_object_t); static int dev_pager_getpages(vm_object_t, vm_page_t *, int, int); -static void dev_pager_putpages(vm_object_t, vm_page_t *, int, - boolean_t, int *); -static boolean_t dev_pager_haspage(vm_object_t, vm_pindex_t, int *, - int *); +static void dev_pager_putpages(vm_object_t, vm_page_t *, int, int, int *); +static boolean_t dev_pager_haspage(vm_object_t, vm_pindex_t, int *, int *); static void dev_pager_free_page(vm_object_t object, vm_page_t m); /* list of device pager objects */ @@ -101,8 +99,9 @@ static struct cdev_pager_ops old_dev_pag }; static void -dev_pager_init() +dev_pager_init(void) { + TAILQ_INIT(&dev_pager_object_list); mtx_init(&dev_pager_mtx, "dev_pager list", NULL, MTX_DEF); } @@ -231,8 +230,7 @@ dev_pager_free_page(vm_object_t object, } static void -dev_pager_dealloc(object) - vm_object_t object; +dev_pager_dealloc(vm_object_t object) { vm_page_t m; @@ -362,24 +360,18 @@ old_dev_pager_fault(vm_object_t object, } static void -dev_pager_putpages(object, m, count, sync, rtvals) - vm_object_t object; - vm_page_t *m; - int count; - boolean_t sync; - int *rtvals; +dev_pager_putpages(vm_object_t object, vm_page_t *m, int count, int flags, + int *rtvals) { panic("dev_pager_putpage called"); } static boolean_t -dev_pager_haspage(object, pindex, before, after) - vm_object_t object; - vm_pindex_t pindex; - int *before; - int *after; +dev_pager_haspage(vm_object_t object, vm_pindex_t pindex, int *before, + int *after) { + if (before != NULL) *before = 0; if (after != NULL) From owner-svn-src-all@freebsd.org Sun Dec 6 17:39:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD6CB9A03AC; Sun, 6 Dec 2015 17:39:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 917B41D19; Sun, 6 Dec 2015 17:39:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB6HdDhi069903; Sun, 6 Dec 2015 17:39:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB6HdDWh069901; Sun, 6 Dec 2015 17:39:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512061739.tB6HdDWh069901@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 6 Dec 2015 17:39:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291906 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 17:39:15 -0000 Author: cem Date: Sun Dec 6 17:39:13 2015 New Revision: 291906 URL: https://svnweb.freebsd.org/changeset/base/291906 Log: pmap_invalidate_range: For very large ranges, flush the whole TLB Typical TLBs have 40-512 entries available. At some point, iterating every single page in a requested invalidation range and issuing invlpg on it is more expensive than flushing the TLB and allowing it to reload on demand. Broadwell CPUs have 1536 L2 TLB entries, so I've picked the arbitrary number 4096 entries as a hueristic at which point we flush TLB rather than invalidating every single potential page. Reviewed by: alc Feedback from: jhb, kib MFC notes: Depends on r291688 Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D4280 Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sun Dec 6 17:11:23 2015 (r291905) +++ head/sys/amd64/amd64/pmap.c Sun Dec 6 17:39:13 2015 (r291906) @@ -1421,6 +1421,9 @@ pmap_invalidate_page(pmap_t pmap, vm_off sched_unpin(); } +/* 4k PTEs -- Chosen to exceed the total size of Broadwell L2 TLB */ +#define PMAP_INVLPG_THRESHOLD (4 * 1024 * PAGE_SIZE) + void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { @@ -1428,6 +1431,11 @@ pmap_invalidate_range(pmap_t pmap, vm_of vm_offset_t addr; u_int cpuid, i; + if (eva - sva >= PMAP_INVLPG_THRESHOLD) { + pmap_invalidate_all(pmap); + return; + } + if (pmap_type_guest(pmap)) { pmap_invalidate_ept(pmap); return; Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sun Dec 6 17:11:23 2015 (r291905) +++ head/sys/i386/i386/pmap.c Sun Dec 6 17:39:13 2015 (r291906) @@ -1032,6 +1032,9 @@ pmap_invalidate_page(pmap_t pmap, vm_off sched_unpin(); } +/* 4k PTEs -- Chosen to exceed the total size of Broadwell L2 TLB */ +#define PMAP_INVLPG_THRESHOLD (4 * 1024 * PAGE_SIZE) + void pmap_invalidate_range(pmap_t pmap, vm_offset_t sva, vm_offset_t eva) { @@ -1039,6 +1042,11 @@ pmap_invalidate_range(pmap_t pmap, vm_of vm_offset_t addr; u_int cpuid; + if (eva - sva >= PMAP_INVLPG_THRESHOLD) { + pmap_invalidate_all(pmap); + return; + } + sched_pin(); if (pmap == kernel_pmap || !CPU_CMP(&pmap->pm_active, &all_cpus)) { for (addr = sva; addr < eva; addr += PAGE_SIZE) From owner-svn-src-all@freebsd.org Sun Dec 6 17:46:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB4859A05E8; Sun, 6 Dec 2015 17:46:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7F41A11D4; Sun, 6 Dec 2015 17:46:13 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB6HkC80072737; Sun, 6 Dec 2015 17:46:12 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB6HkCWb072736; Sun, 6 Dec 2015 17:46:12 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512061746.tB6HkCWb072736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Sun, 6 Dec 2015 17:46:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291907 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 17:46:13 -0000 Author: cem Date: Sun Dec 6 17:46:12 2015 New Revision: 291907 URL: https://svnweb.freebsd.org/changeset/base/291907 Log: vm_fault_hold: handle vm_page_rename failure On vm_page_rename failure, fix a missing object unlock and a double free of a page. First remove the old page, then rename into other page into first_object, then free the old page. This avoids the problem on rename failure. This is a little ugly but seems to be the most straightforward solution. Tested with: $ sysctl debug.fail_point.uma_zalloc_arg="1%return" $ kyua test -k /usr/tests/sys/Kyuafile Submitted by: Ryan Libby Reviewed by: kib Seen by: alc Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D4326 Modified: head/sys/vm/vm_fault.c Modified: head/sys/vm/vm_fault.c ============================================================================== --- head/sys/vm/vm_fault.c Sun Dec 6 17:39:13 2015 (r291906) +++ head/sys/vm/vm_fault.c Sun Dec 6 17:46:12 2015 (r291907) @@ -839,7 +839,7 @@ vnode_locked: * get rid of the unnecessary page */ vm_page_lock(fs.first_m); - vm_page_free(fs.first_m); + vm_page_remove(fs.first_m); vm_page_unlock(fs.first_m); /* * grab the page and put it into the @@ -848,9 +848,13 @@ vnode_locked: */ if (vm_page_rename(fs.m, fs.first_object, fs.first_pindex)) { + VM_OBJECT_WUNLOCK(fs.first_object); unlock_and_deallocate(&fs); goto RetryFault; } + vm_page_lock(fs.first_m); + vm_page_free(fs.first_m); + vm_page_unlock(fs.first_m); #if VM_NRESERVLEVEL > 0 /* * Rename the reservation. From owner-svn-src-all@freebsd.org Sun Dec 6 21:07:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74FBD9A073B; Sun, 6 Dec 2015 21:07:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4926814E5; Sun, 6 Dec 2015 21:07:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB6L7XIw055707; Sun, 6 Dec 2015 21:07:33 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB6L7X6h055706; Sun, 6 Dec 2015 21:07:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512062107.tB6L7X6h055706@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Sun, 6 Dec 2015 21:07:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291908 - head/sbin/newfs_msdos X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 21:07:34 -0000 Author: ngie Date: Sun Dec 6 21:07:33 2015 New Revision: 291908 URL: https://svnweb.freebsd.org/changeset/base/291908 Log: Fix leak in mkfs_msdos(..) by initializing img to NULL and free'ing at the end of the function Differential Revision: https://reviews.freebsd.org/D4405 MFC after: 1 week PR: 204943 Reviewed by: emaste, jilles Reported by: David Binderman Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/newfs_msdos/mkfs_msdos.c Modified: head/sbin/newfs_msdos/mkfs_msdos.c ============================================================================== --- head/sbin/newfs_msdos/mkfs_msdos.c Sun Dec 6 17:46:12 2015 (r291907) +++ head/sbin/newfs_msdos/mkfs_msdos.c Sun Dec 6 21:07:33 2015 (r291908) @@ -242,38 +242,41 @@ mkfs_msdos(const char *fname, const char ssize_t n; time_t now; u_int fat, bss, rds, cls, dir, lsn, x, x1, x2; - int fd, fd1; + int fd, fd1, rv; struct msdos_options o = *op; + img = NULL; + rv = -1; + if (o.block_size && o.sectors_per_cluster) { warnx("Cannot specify both block size and sectors per cluster"); - return -1; + goto done; } if (o.OEM_string && strlen(o.OEM_string) > 8) { warnx("%s: bad OEM string", o.OEM_string); - return -1; + goto done; } if (o.create_size) { if (o.no_create) { warnx("create (-C) is incompatible with -N"); - return -1; + goto done; } fd = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0644); if (fd == -1) { warnx("failed to create %s", fname); - return -1; + goto done; } if (ftruncate(fd, o.create_size)) { warnx("failed to initialize %jd bytes", (intmax_t)o.create_size); - return -1; + goto done; } } else if ((fd = open(fname, o.no_create ? O_RDONLY : O_RDWR)) == -1) { warn("%s", fname); - return -1; + goto done; } if (fstat(fd, &sb)) { warn("%s", fname); - return -1; + goto done; } if (o.create_size) { if (!S_ISREG(sb.st_mode)) @@ -284,15 +287,15 @@ mkfs_msdos(const char *fname, const char } if (!o.no_create) if (check_mounted(fname, sb.st_mode) == -1) - return -1; + goto done; if (o.offset && o.offset != lseek(fd, o.offset, SEEK_SET)) { warnx("cannot seek to %jd", (intmax_t)o.offset); - return -1; + goto done; } memset(&bpb, 0, sizeof(bpb)); if (o.floppy) { if (getstdfmt(o.floppy, &bpb) == -1) - return -1; + goto done; bpb.bpbHugeSectors = bpb.bpbSectors; bpb.bpbSectors = 0; bpb.bpbBigFATsecs = bpb.bpbFATsecs; @@ -334,17 +337,17 @@ mkfs_msdos(const char *fname, const char } if (!powerof2(bpb.bpbBytesPerSec)) { warnx("bytes/sector (%u) is not a power of 2", bpb.bpbBytesPerSec); - return -1; + goto done; } if (bpb.bpbBytesPerSec < MINBPS) { warnx("bytes/sector (%u) is too small; minimum is %u", bpb.bpbBytesPerSec, MINBPS); - return -1; + goto done; } if (o.volume_label && !oklabel(o.volume_label)) { warnx("%s: bad volume label", o.volume_label); - return -1; + goto done; } if (!(fat = o.fat_type)) { if (o.floppy) @@ -356,29 +359,29 @@ mkfs_msdos(const char *fname, const char warnx("-%c is not a legal FAT%s option", fat == 32 ? 'e' : o.info_sector ? 'i' : 'k', fat == 32 ? "32" : "12/16"); - return -1; + goto done; } if (o.floppy && fat == 32) bpb.bpbRootDirEnts = 0; if (fat != 0 && fat != 12 && fat != 16 && fat != 32) { warnx("%d: bad FAT type", fat); - return -1; + goto done; } if (o.block_size) { if (!powerof2(o.block_size)) { warnx("block size (%u) is not a power of 2", o.block_size); - return -1; + goto done; } if (o.block_size < bpb.bpbBytesPerSec) { warnx("block size (%u) is too small; minimum is %u", o.block_size, bpb.bpbBytesPerSec); - return -1; + goto done; } if (o.block_size > bpb.bpbBytesPerSec * MAXSPC) { warnx("block size (%u) is too large; maximum is %u", o.block_size, bpb.bpbBytesPerSec * MAXSPC); - return -1; + goto done; } bpb.bpbSecPerClust = o.block_size / bpb.bpbBytesPerSec; } @@ -386,7 +389,7 @@ mkfs_msdos(const char *fname, const char if (!powerof2(o.sectors_per_cluster)) { warnx("sectors/cluster (%u) is not a power of 2", o.sectors_per_cluster); - return -1; + goto done; } bpb.bpbSecPerClust = o.sectors_per_cluster; } @@ -396,7 +399,7 @@ mkfs_msdos(const char *fname, const char if (o.num_FAT > MAXNFT) { warnx("number of FATs (%u) is too large; maximum is %u", o.num_FAT, MAXNFT); - return -1; + goto done; } bpb.bpbFATs = o.num_FAT; } @@ -405,7 +408,7 @@ mkfs_msdos(const char *fname, const char if (o.media_descriptor_set) { if (o.media_descriptor < 0xf0) { warnx("illegal media descriptor (%#x)", o.media_descriptor); - return -1; + goto done; } bpb.bpbMedia = o.media_descriptor; } @@ -424,18 +427,18 @@ mkfs_msdos(const char *fname, const char snprintf(buf, sizeof(buf), "/boot/%s", bname); if (!(bname = strdup(buf))) { warn(NULL); - return -1; + goto done; } } if ((fd1 = open(bname, O_RDONLY)) == -1 || fstat(fd1, &sb)) { warn("%s", bname); - return -1; + goto done; } if (!S_ISREG(sb.st_mode) || sb.st_size % bpb.bpbBytesPerSec || sb.st_size < bpb.bpbBytesPerSec || sb.st_size > bpb.bpbBytesPerSec * MAXU16) { warnx("%s: inappropriate file type or format", bname); - return -1; + goto done; } bss = sb.st_size / bpb.bpbBytesPerSec; } @@ -470,7 +473,7 @@ mkfs_msdos(const char *fname, const char if (!bpb.bpbFSInfo) { if (x == MAXU16 || x == bpb.bpbBackup) { warnx("no room for info sector"); - return -1; + goto done; } bpb.bpbFSInfo = x; } @@ -479,12 +482,12 @@ mkfs_msdos(const char *fname, const char if (!bpb.bpbBackup) { if (x == MAXU16) { warnx("no room for backup sector"); - return -1; + goto done; } bpb.bpbBackup = x; } else if (bpb.bpbBackup != MAXU16 && bpb.bpbBackup == bpb.bpbFSInfo) { warnx("backup sector would overwrite info sector"); - return -1; + goto done; } if (bpb.bpbBackup != MAXU16 && x <= bpb.bpbBackup) x = bpb.bpbBackup + 1; @@ -495,7 +498,7 @@ mkfs_msdos(const char *fname, const char else if (bpb.bpbResSectors < x) { warnx("too few reserved sectors (need %d have %d)", x, bpb.bpbResSectors); - return -1; + goto done; } if (fat != 32 && !bpb.bpbRootDirEnts) bpb.bpbRootDirEnts = DEFRDE; @@ -515,13 +518,13 @@ mkfs_msdos(const char *fname, const char continue; if (fat != 32 && bpb.bpbBigFATsecs > MAXU16) { warnx("too many sectors/FAT for FAT12/16"); - return -1; + goto done; } x1 = bpb.bpbResSectors + rds; x = bpb.bpbBigFATsecs ? bpb.bpbBigFATsecs : 1; if (x1 + (u_int64_t)x * bpb.bpbFATs > bpb.bpbHugeSectors) { warnx("meta data exceeds file system size"); - return -1; + goto done; } x1 += x * bpb.bpbFATs; x = (u_int64_t)(bpb.bpbHugeSectors - x1) * bpb.bpbBytesPerSec * NPB / @@ -544,7 +547,7 @@ mkfs_msdos(const char *fname, const char if (cls < mincls(fat)) { warnx("%u clusters too few clusters for FAT%u, need %u", cls, fat, mincls(fat)); - return -1; + goto done; } if (cls > maxcls(fat)) { cls = maxcls(fat); @@ -575,7 +578,7 @@ mkfs_msdos(const char *fname, const char tm = localtime(&now); if (!(img = malloc(bpb.bpbBytesPerSec))) { warn(NULL); - return -1; + goto done; } dir = bpb.bpbResSectors + (bpb.bpbFATsecs ? bpb.bpbFATsecs : bpb.bpbBigFATsecs) * bpb.bpbFATs; @@ -583,7 +586,7 @@ mkfs_msdos(const char *fname, const char si_sa.sa_handler = infohandler; if (sigaction(SIGINFO, &si_sa, NULL) == -1) { warn("sigaction SIGINFO"); - return -1; + goto done; } for (lsn = 0; lsn < dir + (fat == 32 ? bpb.bpbSecPerClust : rds); lsn++) { if (got_siginfo) { @@ -601,17 +604,17 @@ mkfs_msdos(const char *fname, const char x -= bpb.bpbBackup; if (!x && lseek(fd1, o.offset, SEEK_SET)) { warn("%s", bname); - return -1; + goto done; } } if (o.bootstrap && x < bss) { if ((n = read(fd1, img, bpb.bpbBytesPerSec)) == -1) { warn("%s", bname); - return -1; + goto done; } if ((unsigned)n != bpb.bpbBytesPerSec) { warnx("%s: can't read sector %u", bname, x); - return -1; + goto done; } } else memset(img, 0, bpb.bpbBytesPerSec); @@ -701,15 +704,19 @@ mkfs_msdos(const char *fname, const char } if ((n = write(fd, img, bpb.bpbBytesPerSec)) == -1) { warn("%s", fname); - return -1; + goto done; } if ((unsigned)n != bpb.bpbBytesPerSec) { warnx("%s: can't write sector %u", fname, lsn); - return -1; + goto done; } } } - return 0; + rv = 0; +done: + free(img); + + return rv; } /* From owner-svn-src-all@freebsd.org Sun Dec 6 21:16:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CB899A09A1; Sun, 6 Dec 2015 21:16:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6449D1B5E; Sun, 6 Dec 2015 21:16:02 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB6LG19c058771; Sun, 6 Dec 2015 21:16:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB6LG1Cc058770; Sun, 6 Dec 2015 21:16:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512062116.tB6LG1Cc058770@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 6 Dec 2015 21:16:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291909 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 21:16:02 -0000 Author: emaste Date: Sun Dec 6 21:16:01 2015 New Revision: 291909 URL: https://svnweb.freebsd.org/changeset/base/291909 Log: Add definitions for ELF note types used in executables Sponsored by: The FreeBSD Foundation Modified: head/sys/sys/elf_common.h Modified: head/sys/sys/elf_common.h ============================================================================== --- head/sys/sys/elf_common.h Sun Dec 6 21:07:33 2015 (r291908) +++ head/sys/sys/elf_common.h Sun Dec 6 21:16:01 2015 (r291909) @@ -727,6 +727,11 @@ typedef struct { #define LL_DELAY_LOAD 0x10 #define LL_DELTA 0x20 +/* Values for n_type used in executables. */ +#define NT_FREEBSD_ABI_TAG 1 +#define NT_FREEBSD_NOINIT_TAG 2 +#define NT_FREEBSD_ARCH_TAG 3 + /* Values for n_type. Used in core files. */ #define NT_PRSTATUS 1 /* Process status. */ #define NT_FPREGSET 2 /* Floating point registers. */ From owner-svn-src-all@freebsd.org Sun Dec 6 21:22:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 416B19A0C1D; Sun, 6 Dec 2015 21:22:48 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6FAC1239; Sun, 6 Dec 2015 21:22:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tB6LMgBZ010253 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 6 Dec 2015 23:22:42 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tB6LMgBZ010253 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tB6LMgG7010252; Sun, 6 Dec 2015 23:22:42 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 6 Dec 2015 23:22:42 +0200 From: Konstantin Belousov To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291909 - head/sys/sys Message-ID: <20151206212242.GI2202@kib.kiev.ua> References: <201512062116.tB6LG1Cc058770@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201512062116.tB6LG1Cc058770@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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 autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Dec 2015 21:22:48 -0000 On Sun, Dec 06, 2015 at 09:16:01PM +0000, Ed Maste wrote: > Author: emaste > Date: Sun Dec 6 21:16:01 2015 > New Revision: 291909 > URL: https://svnweb.freebsd.org/changeset/base/291909 > > Log: > Add definitions for ELF note types used in executables > > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/sys/elf_common.h > > Modified: head/sys/sys/elf_common.h > ============================================================================== > --- head/sys/sys/elf_common.h Sun Dec 6 21:07:33 2015 (r291908) > +++ head/sys/sys/elf_common.h Sun Dec 6 21:16:01 2015 (r291909) > @@ -727,6 +727,11 @@ typedef struct { > #define LL_DELAY_LOAD 0x10 > #define LL_DELTA 0x20 > > +/* Values for n_type used in executables. */ > +#define NT_FREEBSD_ABI_TAG 1 > +#define NT_FREEBSD_NOINIT_TAG 2 > +#define NT_FREEBSD_ARCH_TAG 3 > + > /* Values for n_type. Used in core files. */ > #define NT_PRSTATUS 1 /* Process status. */ > #define NT_FPREGSET 2 /* Floating point registers. */ Do you plan to make a pass over the tree, switching uses of *_NOTETYPE to NT_FREEBSD_*_TAG ? See lib/csu/common/notes.h. Also, sys/kern/imgact_elf.c would benefit from use of NT_FREEBSD_ABI_TAG instead of magic '1' in brandnotes. From owner-svn-src-all@freebsd.org Mon Dec 7 02:56:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8997D9B7E67; Mon, 7 Dec 2015 02:56:09 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 585221F42; Mon, 7 Dec 2015 02:56:09 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB72u8Mo057989; Mon, 7 Dec 2015 02:56:08 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB72u8C6057988; Mon, 7 Dec 2015 02:56:08 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512070256.tB72u8C6057988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Mon, 7 Dec 2015 02:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291911 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 02:56:09 -0000 Author: smh Date: Mon Dec 7 02:56:08 2015 New Revision: 291911 URL: https://svnweb.freebsd.org/changeset/base/291911 Log: Fix panic on shutdown due to iscsi event priority iscsi's shutdown_pre_sync prio was SHUTDOWN_PRI_FIRST which caused it to run before other high priority handlers such as filesystems e.g. ZFS. This meant the iscsi sessions where removed before the ZFS geom consumer was closed, resulting in a panic from g_access calls on debug kernels due to negative acr. Instead use the same as the old iscsi_initiator SHUTDOWN_PRI_DEFAULT-1 which allows it to run before dashutdown etc but after filesystems. MFC after: 2 weeks Sponsored by: Multiplay Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Sun Dec 6 21:31:09 2015 (r291910) +++ head/sys/dev/iscsi/iscsi.c Mon Dec 7 02:56:08 2015 (r291911) @@ -2365,7 +2365,7 @@ iscsi_load(void) sc->sc_cdev->si_drv1 = sc; sc->sc_shutdown_eh = EVENTHANDLER_REGISTER(shutdown_pre_sync, - iscsi_shutdown, sc, SHUTDOWN_PRI_FIRST); + iscsi_shutdown, sc, SHUTDOWN_PRI_DEFAULT-1); return (0); } From owner-svn-src-all@freebsd.org Mon Dec 7 04:02:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 224BA7F94; Mon, 7 Dec 2015 04:02:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6D7D127A; Mon, 7 Dec 2015 04:02:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB742KFS081910; Mon, 7 Dec 2015 04:02:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB742KKZ081909; Mon, 7 Dec 2015 04:02:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512070402.tB742KKZ081909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 7 Dec 2015 04:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291912 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 04:02:21 -0000 Author: imp Date: Mon Dec 7 04:02:19 2015 New Revision: 291912 URL: https://svnweb.freebsd.org/changeset/base/291912 Log: Default serial connection to 115200. Hardly anybody uses slower these days, and those that do can use NANO_BOOT2CFG to change it. Modified: head/tools/tools/nanobsd/defaults.sh (contents, props changed) Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Mon Dec 7 02:56:08 2015 (r291911) +++ head/tools/tools/nanobsd/defaults.sh Mon Dec 7 04:02:19 2015 (r291912) @@ -134,7 +134,7 @@ NANO_BOOTLOADER="boot/boot0sio" # boot2 flags/options # default force serial console -NANO_BOOT2CFG="-h" +NANO_BOOT2CFG="-h -S115200" # Backing type of md(4) device # Can be "file" or "swap" From owner-svn-src-all@freebsd.org Mon Dec 7 04:02:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8B617FB4; Mon, 7 Dec 2015 04:02:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B438B13E2; Mon, 7 Dec 2015 04:02:32 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB742Vs3081965; Mon, 7 Dec 2015 04:02:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB742V3Z081964; Mon, 7 Dec 2015 04:02:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512070402.tB742V3Z081964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 7 Dec 2015 04:02:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291913 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 04:02:33 -0000 Author: imp Date: Mon Dec 7 04:02:31 2015 New Revision: 291913 URL: https://svnweb.freebsd.org/changeset/base/291913 Log: Generally use shorter, more idiomatic sh expressions in a bunch of places. Modified: head/tools/tools/nanobsd/defaults.sh (contents, props changed) Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Mon Dec 7 04:02:19 2015 (r291912) +++ head/tools/tools/nanobsd/defaults.sh Mon Dec 7 04:02:31 2015 (r291913) @@ -226,16 +226,18 @@ nano_make_kernel_env ( ) { } nano_global_make_env ( ) ( - [ ! -z "${NANO_ARCH}" ] && echo TARGET_ARCH="${NANO_ARCH}" || true - [ ! -z "${NANO_CPUTYPE}" ] && echo TARGET_CPUTYPE="${NANO_CPUTYPE}" || true + # global settings for the make.conf file, if set + [ -z "${NANO_ARCH}" ] || echo TARGET_ARCH="${NANO_ARCH}" + [ -z "${NANO_CPUTYPE}" ] || echo TARGET_CPUTYPE="${NANO_CPUTYPE}" ) # rm doesn't know -x prior to FreeBSD 10, so cope with a variety of build -# hosts for now. -nano_rm ( ) { +# hosts for now. This will go away when support in the base goes away. +rm ( ) { + echo "NANO RM $*" case $(uname -r) in - 7*|8*|9*) rm $* ;; - *) rm -x $* ;; + 7*|8*|9*) command rm $* ;; + *) command rm -x $* ;; esac } @@ -250,18 +252,16 @@ CR0 ( ) { } nano_cleanup ( ) ( - if [ $? -ne 0 ]; then - echo "Error encountered. Check for errors in last log file." 1>&2 - fi + [ $? -eq 0 ] || echo "Error encountered. Check for errors in last log file." 1>&2 exit $? ) clean_build ( ) ( pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})" - if ! nano_rm -rf ${MAKEOBJDIRPREFIX}/ > /dev/null 2>&1 ; then + if ! rm -rf ${MAKEOBJDIRPREFIX}/ > /dev/null 2>&1 ; then chflags -R noschg ${MAKEOBJDIRPREFIX}/ - nano_rm -r ${MAKEOBJDIRPREFIX}/ + rm -r ${MAKEOBJDIRPREFIX}/ fi ) @@ -315,17 +315,17 @@ build_kernel ( ) ( clean_world ( ) ( if [ "${NANO_OBJ}" != "${MAKEOBJDIRPREFIX}" ]; then pprint 2 "Clean and create object directory (${NANO_OBJ})" - if ! nano_rm -rf ${NANO_OBJ}/ > /dev/null 2>&1 ; then + if ! rm -rf ${NANO_OBJ}/ > /dev/null 2>&1 ; then chflags -R noschg ${NANO_OBJ} - nano_rm -r ${NANO_OBJ}/ + rm -r ${NANO_OBJ}/ fi mkdir -p "${NANO_OBJ}" "${NANO_WORLDDIR}" printenv > ${NANO_OBJ}/_.env else pprint 2 "Clean and create world directory (${NANO_WORLDDIR})" - if ! nano_rm -rf "${NANO_WORLDDIR}/" > /dev/null 2>&1 ; then + if ! rm -rf "${NANO_WORLDDIR}/" > /dev/null 2>&1 ; then chflags -R noschg "${NANO_WORLDDIR}" - nano_rm -rf "${NANO_WORLDDIR}/" + rm -rf "${NANO_WORLDDIR}/" fi mkdir -p "${NANO_WORLDDIR}" fi @@ -340,7 +340,7 @@ make_conf_install ( ) ( nano_global_make_env echo "${CONF_WORLD}" echo "${CONF_INSTALL}" - if [ ! -z "${NANO_NOPRIV_BUILD}" ]; then + if [ -n "${NANO_NOPRIV_BUILD}" ]; then echo NO_ROOT=t echo METALOG=${NANO_METALOG} fi @@ -453,7 +453,7 @@ setup_nanobsd ( ) ( cd usr/local/etc find . -print | cpio -dumpl ../../../etc/local cd .. - nano_rm -rf etc + rm -rf etc ln -s ../../etc/local etc ) fi @@ -474,7 +474,7 @@ setup_nanobsd ( ) ( echo "mount -o ro /dev/${NANO_DRIVE}${NANO_SLICE_CFG}" > conf/default/etc/remount # Put /tmp on the /var ramdisk (could be symlink already) - nano_rm -rf tmp + rm -rf tmp ln -s var/tmp tmp ) > ${NANO_OBJ}/_.dl 2>&1 @@ -490,9 +490,9 @@ setup_nanobsd_etc ( ) ( touch etc/diskless # Make root filesystem R/O by default - [ ! -z "${NANO_NOPRIV_BUILD}" ] && chmod 666 etc/defaults/rc.conf + [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 etc/defaults/rc.conf echo "root_rw_mount=NO" >> etc/defaults/rc.conf - [ ! -z "${NANO_NOPRIV_BUILD}" ] && chmod 444 etc/defaults/rc.conf + [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 444 etc/defaults/rc.conf # save config file for scripts echo "NANO_DRIVE=${NANO_DRIVE}" > etc/nanobsd.conf @@ -636,7 +636,7 @@ create_diskimage ( ) ( -y ${NANO_HEADS}` else echo "Creating md backing file..." - nano_rm -f ${IMG} + rm -f ${IMG} dd if=/dev/zero of=${IMG} seek=${NANO_MEDIASIZE} count=0 MD=`mdconfig -a -t vnode -f ${IMG} -x ${NANO_SECTS} \ -y ${NANO_HEADS}` @@ -678,7 +678,7 @@ create_diskimage ( ) ( nano_umount ${MNT} # Override the label from the first partition so we # don't confuse glabel with duplicates. - if [ ! -z ${NANO_LABEL} ]; then + if [ -n ${NANO_LABEL} ]; then tunefs -L ${NANO_LABEL}"${NANO_SLICE_ALTROOT}a" /dev/${MD}${NANO_SLICE_ALTROOT}a fi fi @@ -687,12 +687,12 @@ create_diskimage ( ) ( populate_cfg_slice /dev/${MD}${NANO_SLICE_CFG} "${NANO_CFGDIR}" ${MNT} "${NANO_SLICE_CFG}" # Create Data slice, if any. - if [ ! -z $NANO_SLICE_DATA -a $NANO_SLICE_CFG = $NANO_SLICE_DATA -a \ + if [ -n $NANO_SLICE_DATA -a $NANO_SLICE_CFG = $NANO_SLICE_DATA -a \ $NANO_DATASIZE -ne 0 ]; then pprint 2 "NANO_SLICE_DATA is the same as NANO_SLICE_CFG, fix." exit 2 fi - if [ $NANO_DATASIZE -ne 0 -a ! -z $NANO_SLICE_DATA ] ; then + if [ $NANO_DATASIZE -ne 0 -a -n $NANO_SLICE_DATA ] ; then populate_data_slice /dev/${MD}${NANO_SLICE_DATA} "${NANO_DATADIR}" ${MNT} "${NANO_SLICE_DATA}" fi @@ -853,7 +853,7 @@ cust_pkgng ( ) ( echo "FAILED: pkg bootstrapping faied" exit 2 fi - nano_rm -f ${NANO_WORLDDIR}/Pkg/pkg-* + rm -f ${NANO_WORLDDIR}/Pkg/pkg-* # Count & report how many we have to install todo=`ls ${NANO_WORLDDIR}/Pkg | /usr/bin/wc -l` @@ -882,7 +882,7 @@ cust_pkgng ( ) ( exit 2 fi done - nano_rm -rf ${NANO_WORLDDIR}/Pkg + rm -rf ${NANO_WORLDDIR}/Pkg ) ####################################################################### @@ -949,21 +949,21 @@ export_var ( ) { # Don't wawnt a subshe # Call this function to set defaults _after_ parsing options. # dont want a subshell otherwise variable setting is thrown away. set_defaults_and_export ( ) { - test -n "${NANO_OBJ}" || NANO_OBJ=/usr/obj/nanobsd.${NANO_NAME} - test -n "${MAKEOBJDIRPREFIX}" || MAKEOBJDIRPREFIX=${NANO_OBJ} - test -n "${NANO_DISKIMGDIR}" || NANO_DISKIMGDIR=${NANO_OBJ} + : ${NANO_OBJ:=/usr/obj/nanobsd.${NANO_NAME}} + : ${MAKEOBJDIRPREFIX:=${NANO_OBJ}} + : ${NANO_DISKIMGDIR=:${NANO_OBJ}} NANO_WORLDDIR=${NANO_OBJ}/_.w NANO_MAKE_CONF_BUILD=${MAKEOBJDIRPREFIX}/make.conf.build NANO_MAKE_CONF_INSTALL=${NANO_OBJ}/make.conf.install # Override user's NANO_DRIVE if they specified a NANO_LABEL - [ ! -z "${NANO_LABEL}" ] && NANO_DRIVE="ufs/${NANO_LABEL}" || true + [ -n "${NANO_LABEL}" ] && NANO_DRIVE="ufs/${NANO_LABEL}" || true # Set a default NANO_TOOLS to NANO_SRC/NANO_TOOLS if it exists. [ ! -d "${NANO_TOOLS}" ] && [ -d "${NANO_SRC}/${NANO_TOOLS}" ] && \ NANO_TOOLS="${NANO_SRC}/${NANO_TOOLS}" || true - [ ! -z "${NANO_NOPRIV_BUILD}" ] && [ -z "${NANO_METALOG}" ] && \ + [ -n "${NANO_NOPRIV_BUILD}" ] && [ -z "${NANO_METALOG}" ] && \ NANO_METALOG=${NANO_OBJ}/_.metalog || true NANO_STARTTIME=`date +%s` From owner-svn-src-all@freebsd.org Mon Dec 7 04:02:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69F207FCD; Mon, 7 Dec 2015 04:02:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DF93141A; Mon, 7 Dec 2015 04:02:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB742YNE082052; Mon, 7 Dec 2015 04:02:34 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB742YLt082051; Mon, 7 Dec 2015 04:02:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512070402.tB742YLt082051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 7 Dec 2015 04:02:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291915 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 04:02:35 -0000 Author: imp Date: Mon Dec 7 04:02:34 2015 New Revision: 291915 URL: https://svnweb.freebsd.org/changeset/base/291915 Log: imported patch dedup Modified: head/tools/tools/nanobsd/mtree-dedup.awk (contents, props changed) Modified: head/tools/tools/nanobsd/mtree-dedup.awk ============================================================================== --- head/tools/tools/nanobsd/mtree-dedup.awk Mon Dec 7 04:02:32 2015 (r291914) +++ head/tools/tools/nanobsd/mtree-dedup.awk Mon Dec 7 04:02:34 2015 (r291915) @@ -178,6 +178,8 @@ BEGIN { nv = "___NO__VALUE___"; while ((getline < "/dev/stdin") > 0) { + if ($1 ~ "^#") + continue; if ($1 == "/set") { for (i = 2; i <= NF; i++) { kv($i); @@ -192,6 +194,9 @@ BEGIN { process_line($1, $0); } + # Print the last set of defaults. This will carry + # over, I think, to makefs' defaults + print mtree_from_kvs("/set", defaults) for (x in tree) print tree[x]; } From owner-svn-src-all@freebsd.org Mon Dec 7 04:02:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 655077FB9; Mon, 7 Dec 2015 04:02:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1BFB813F0; Mon, 7 Dec 2015 04:02:34 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB742Xql082009; Mon, 7 Dec 2015 04:02:33 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB742XWD082007; Mon, 7 Dec 2015 04:02:33 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512070402.tB742XWD082007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 7 Dec 2015 04:02:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291914 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 04:02:34 -0000 Author: imp Date: Mon Dec 7 04:02:32 2015 New Revision: 291914 URL: https://svnweb.freebsd.org/changeset/base/291914 Log: Allow the .cfg files to specify the ultimate format for the images created. Modified: head/tools/tools/nanobsd/embedded/common head/tools/tools/nanobsd/embedded/qemu-i386.cfg Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Mon Dec 7 04:02:31 2015 (r291913) +++ head/tools/tools/nanobsd/embedded/common Mon Dec 7 04:02:32 2015 (r291914) @@ -312,6 +312,7 @@ create_diskimage ( ) ( pprint 3 "log: ${NANO_OBJ}/_.di" ( + set -o xtrace if [ ! -z ${NANO_NOPRIV_BUILD} ]; then extra="-F ${NANO_OBJ}/_.metalog" fi @@ -348,17 +349,19 @@ create_diskimage ( ) ( fi eval $NANO_SLICE_CFG=freebsd eval $NANO_SLICE_ROOT=freebsd + [ -z ${NANO_DISKIMAGE_FORMAT} ] || fmtarg="-f ${NANO_DISKIMAGE_FORMAT}" + [ -z ${NANO_DISKIMAGE_FORMAT} ] || fmt=".${NANO_DISKIMAGE_FORMAT}" if [ ! -z "${NANO_SLICE_FAT}" ]; then - mkimg -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \ + mkimg -a 3 ${fmtarg} -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \ -p ${s2}:=${NANO_OBJ}/_.s2 \ -p ${s3}:=${NANO_OBJ}/_.s3 \ - -o ${NANO_OBJ}/_.disk.image.${NANO_NAME} + -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} else # s1 is cfg, s2 is /, not sure how to make that # boot (marked as active) with mkimg yet - mkimg -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \ + mkimg -a 2 ${fmtarg} -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \ -p ${s2}:=${NANO_OBJ}/_.s2 \ - -o ${NANO_OBJ}/_.disk.image.${NANO_NAME} + -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} fi ) > ${NANO_OBJ}/_.di 2>&1 ) Modified: head/tools/tools/nanobsd/embedded/qemu-i386.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-i386.cfg Mon Dec 7 04:02:31 2015 (r291913) +++ head/tools/tools/nanobsd/embedded/qemu-i386.cfg Mon Dec 7 04:02:32 2015 (r291914) @@ -37,6 +37,7 @@ NANO_KERNEL=GENERIC NANO_DRIVE=ada0 NANO_NAME=qemu-i386 +NANO_DISKIMAGE_FORMAT=qcow2 export EMBED_OMIT_FAT=t . common # Pull in common definitions, keep last From owner-svn-src-all@freebsd.org Mon Dec 7 04:02:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4EFD39A0052; Mon, 7 Dec 2015 04:02:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12B5E18E7; Mon, 7 Dec 2015 04:02:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB742heg082098; Mon, 7 Dec 2015 04:02:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB742h9I082097; Mon, 7 Dec 2015 04:02:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512070402.tB742h9I082097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 7 Dec 2015 04:02:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291916 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 04:02:44 -0000 Author: imp Date: Mon Dec 7 04:02:42 2015 New Revision: 291916 URL: https://svnweb.freebsd.org/changeset/base/291916 Log: Disable /entropy by default. /var/db/entropy should be enough. # This eliminates the warning message at boot, but more work may be # needed. Modified: head/tools/tools/nanobsd/defaults.sh (contents, props changed) Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Mon Dec 7 04:02:34 2015 (r291915) +++ head/tools/tools/nanobsd/defaults.sh Mon Dec 7 04:02:42 2015 (r291916) @@ -489,9 +489,13 @@ setup_nanobsd_etc ( ) ( # create diskless marker file touch etc/diskless - # Make root filesystem R/O by default [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 666 etc/defaults/rc.conf + + # Make root filesystem R/O by default echo "root_rw_mount=NO" >> etc/defaults/rc.conf + # Disable entropy file, since / is read-only /var/db/entropy should be enough? + echo "entropy_file=NO" >> etc/defaults/rc.conf + [ -n "${NANO_NOPRIV_BUILD}" ] && chmod 444 etc/defaults/rc.conf # save config file for scripts From owner-svn-src-all@freebsd.org Mon Dec 7 04:02:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D3659A008C; Mon, 7 Dec 2015 04:02:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DFC71AE1; Mon, 7 Dec 2015 04:02:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB742qrk082145; Mon, 7 Dec 2015 04:02:52 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB742qRb082143; Mon, 7 Dec 2015 04:02:52 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512070402.tB742qRb082143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 7 Dec 2015 04:02:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291917 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 04:02:53 -0000 Author: imp Date: Mon Dec 7 04:02:52 2015 New Revision: 291917 URL: https://svnweb.freebsd.org/changeset/base/291917 Log: Fix up mtree with additional entries written to it by nanobsd. implement support for NanoBSD touching a file (and possibly recording that fact) as well as replacing a directory with a symlink. Also specify the default uname and gname for files and use that as a /set command at the top of the generated METALOG file. Modified: head/tools/tools/nanobsd/defaults.sh (contents, props changed) head/tools/tools/nanobsd/nanobsd.sh (contents, props changed) Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Mon Dec 7 04:02:42 2015 (r291916) +++ head/tools/tools/nanobsd/defaults.sh Mon Dec 7 04:02:52 2015 (r291917) @@ -157,6 +157,9 @@ NANO_SLICE_ALTROOT=s2 NANO_SLICE_CFG=s3 NANO_SLICE_DATA=s4 +# Default ownwership for nopriv build +NANO_DEF_UNAME=root +NANO_DEF_GNAME=wheel ####################################################################### # Architecture to build. Corresponds to TARGET_ARCH in a buildworld. @@ -241,6 +244,37 @@ rm ( ) { esac } +# +# Create empty files in the target tree, and record the fact. All paths +# are relative to NANO_WORLDDIR. +# +tgt_touch ( ) ( + + cd "${NANO_WORLDDIR}" + for i; do + touch $i + echo "./${i} type=file" >> ${NANO_METALOG} + done +) + +# +# Convert a directory into a symlink. Takes two arguments, the +# current directory and what it should become a symlink to. The +# directory is removed and a symlink is created. If we're doing +# a nopriv build, then append this fact to the metalog +# +tgt_dir2symlink () ( + dir=$1 + symlink=$2 + + cd "${NANO_WORLDDIR}" + rm -rf "$dir" + ln -s "$symlink" "$dir" + if [ -n $NANO_METALOG ]; then + echo "./${dir} type=link mode=0777 link=${symlink}" >> ${NANO_METALOG} + fi +) + # run in the world chroot, errors fatal CR ( ) { chroot "${NANO_WORLDDIR}" /bin/sh -exc "$*" @@ -413,6 +447,11 @@ native_xtools ( ) ( ) > ${NANO_OBJ}/_.native_xtools 2>&1 ) +# +# Run the requested set of customization scripts, run after we've +# done an installworld, installed the etc files, installed the kernel +# and tweaked them in the standard way. +# run_customize ( ) ( pprint 2 "run customize scripts" @@ -425,6 +464,10 @@ run_customize ( ) ( done ) +# +# Run any last-minute customization commands after we've had a chance to +# setup nanobsd, prune empty dirs from /usr, etc +# run_late_customize ( ) ( pprint 2 "run late customize scripts" @@ -437,6 +480,33 @@ run_late_customize ( ) ( done ) +# +# Hook called after we run all the late customize commands, but +# before we invoke the disk imager. The nopriv build uses it to +# read in the meta log, apply the changes other parts of nanobsd +# have been recording their actions. It's not anticipated that +# a user's cfg file would override this. +# +fixup_before_diskimage ( ) ( + + # Run the deduplication script that takes the matalog journal and + # combines multiple entries for the same file (see source for + # details). We take the extra step of removing the size keywords. This + # script, and many of the user scripts, copies, appeneds and otherwise + # modifies files in the build, changing their sizes. These actions are + # impossible to trap, so go ahead remove the size= keyword. For this + # narrow use, it doesn't buy us any protection and just gets in the way. + # The dedup tool's output must be sorted due to limitations in awk. + if [ -n ${NANO_METALOG} ]; then + pprint 2 "Fixing metalog" + cp ${NANO_METALOG} ${NANO_METALOG}.pre + (echo "/set uname=${NANO_DEF_UNAME} gname=${NANO_DEF_GNAME}" && + cat ${NANO_METALOG}.pre) | \ + ${NANO_TOOLS}/mtree-dedup.awk | \ + sed -e 's/ size=[0-9][0-9]*//' | sort > ${NANO_METALOG} + fi +) + setup_nanobsd ( ) ( pprint 2 "configure nanobsd setup" pprint 3 "log: ${NANO_OBJ}/_.dl" @@ -474,8 +544,7 @@ setup_nanobsd ( ) ( echo "mount -o ro /dev/${NANO_DRIVE}${NANO_SLICE_CFG}" > conf/default/etc/remount # Put /tmp on the /var ramdisk (could be symlink already) - rm -rf tmp - ln -s var/tmp tmp + tgt_dir2symlink tmp var/tmp ) > ${NANO_OBJ}/_.dl 2>&1 ) Modified: head/tools/tools/nanobsd/nanobsd.sh ============================================================================== --- head/tools/tools/nanobsd/nanobsd.sh Mon Dec 7 04:02:42 2015 (r291916) +++ head/tools/tools/nanobsd/nanobsd.sh Mon Dec 7 04:02:52 2015 (r291917) @@ -178,6 +178,7 @@ run_customize setup_nanobsd prune_usr run_late_customize +fixup_before_diskimage if $do_image ; then create_diskimage else From owner-svn-src-all@freebsd.org Mon Dec 7 04:03:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE7059A0100; Mon, 7 Dec 2015 04:03:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B007A1C6A; Mon, 7 Dec 2015 04:03:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB742xjD082193; Mon, 7 Dec 2015 04:02:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB742xia082192; Mon, 7 Dec 2015 04:02:59 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512070402.tB742xia082192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 7 Dec 2015 04:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291918 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 04:03:01 -0000 Author: imp Date: Mon Dec 7 04:02:59 2015 New Revision: 291918 URL: https://svnweb.freebsd.org/changeset/base/291918 Log: Now that we have dedup of mtree elements in nanobsd, remove the primitive attempt we made here. Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Mon Dec 7 04:02:52 2015 (r291917) +++ head/tools/tools/nanobsd/embedded/common Mon Dec 7 04:02:59 2015 (r291918) @@ -138,16 +138,6 @@ cust_install_machine_files() customize_cmd cust_install_files customize_cmd cust_install_machine_files -buildenv() -{ - cd ${NANO_SRC} - env __MAKE_CONF=${NANO_MAKE_CONF_BUILD} DESTDIR=${NANO_WORLDDIR} make buildenv -} - -NANO_MAKEFS="makefs -B big \ - -o bsize=4096,fsize=512,density=8192,optimization=space" -export NANO_MAKEFS - # NB: leave c++ enabled so devd can be built CONF_BUILD=" WITHOUT_ACPI=true @@ -184,6 +174,7 @@ WITHOUT_SENDMAIL=true WITHOUT_SHAREDOCS=true WITHOUT_SYSCONS=true WITHOUT_LIB32=true +WITHOUT_TESTS=true " CONF_INSTALL="$CONF_BUILD INSTALL_NODEBUG=t @@ -313,8 +304,8 @@ create_diskimage ( ) ( ( set -o xtrace - if [ ! -z ${NANO_NOPRIV_BUILD} ]; then - extra="-F ${NANO_OBJ}/_.metalog" + if [ -n ${NANO_NOPRIV_BUILD} ]; then + extra="-F ${NANO_METALOG}" fi for i in s1 s2 s3 s4 empty; do @@ -323,12 +314,13 @@ create_diskimage ( ) ( if [ ! -z "${NANO_SLICE_FAT}" ]; then echo Creating MSDOS partition for kernel - newfs_msdos -C ${NANO_SLICE_FAT_SIZE:-100m} -F 16 -L ${NANO_NAME} \ + newfs_msdos -C ${NANO_SLICE_FAT_SIZE:-32m} -F 16 -L ${NANO_NAME} \ ${NANO_OBJ}/_.${NANO_SLICE_FAT} fi echo Creating main partition sz=${NANO_SLICE_ROOT_SIZE:+-s ${NANO_SLICE_ROOT_SIZE}} - makefs ${extra} -B little $sz -t ffs ${NANO_OBJ}/_.${NANO_SLICE_ROOT}a "${NANO_WORLDDIR}" + makefs ${extra} -B little $sz -t ffs ${NANO_OBJ}/_.${NANO_SLICE_ROOT}a \ + "${NANO_WORLDDIR}" if [ -z "${NANO_CFGDIR}" ]; then echo "Faking cfg dir, it's empty" NANO_CFGDIR=${NANO_OBJ}/_.empty @@ -336,12 +328,14 @@ create_diskimage ( ) ( fi echo Creating cfg parittion # XXX -F cfg-mtree + makefs -B little -t ffs -s ${NANO_SLICE_CFG_SIZE:-100m} \ ${NANO_OBJ}/_.${NANO_SLICE_CFG} "${NANO_CFGDIR}" # data slice not supported since we need the part for FAT for # booting echo Slicing up the main partition into a full bsd part - mkimg -s bsd -p freebsd-ufs:=${NANO_OBJ}/_.${NANO_SLICE_ROOT}a \ + bootbsd="-b ${NANO_WORLDDIR}/boot/boot" + mkimg ${bootbsd} -s bsd -p freebsd-ufs:=${NANO_OBJ}/_.${NANO_SLICE_ROOT}a \ -o ${NANO_OBJ}/_.${NANO_SLICE_ROOT} echo Making the whole shooting match if [ ! -z $NANO_SLICE_FAT ]; then @@ -351,15 +345,19 @@ create_diskimage ( ) ( eval $NANO_SLICE_ROOT=freebsd [ -z ${NANO_DISKIMAGE_FORMAT} ] || fmtarg="-f ${NANO_DISKIMAGE_FORMAT}" [ -z ${NANO_DISKIMAGE_FORMAT} ] || fmt=".${NANO_DISKIMAGE_FORMAT}" + bootmbr="-b ${NANO_WORLDDIR}/boot/boot0sio" + # below depends on https://reviews.freebsd.org/D4403 not yet in the tree + # but there's problems: it marks all partitions as active, so you have to + # boot off parittion 3 or 2 by hand if you're playing around with this WIP if [ ! -z "${NANO_SLICE_FAT}" ]; then - mkimg -a 3 ${fmtarg} -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \ + mkimg -a 3 ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \ -p ${s2}:=${NANO_OBJ}/_.s2 \ -p ${s3}:=${NANO_OBJ}/_.s3 \ -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} else # s1 is cfg, s2 is /, not sure how to make that # boot (marked as active) with mkimg yet - mkimg -a 2 ${fmtarg} -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \ + mkimg -a 2 ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \ -p ${s2}:=${NANO_OBJ}/_.s2 \ -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} fi @@ -462,21 +460,11 @@ shrink_md_fbsize() } customize_cmd shrink_md_fbsize -if [ "${DEBUG}" = 1 ]; then - -unmute_console_logging() -{ - # /var is small. Don't fill it up with messages from console.log - # because it's a chatty log. - sed -i '' -e 's/#console.info/console.info/' \ - "${NANO_WORLDDIR}/etc/syslog.conf" -} -customize_cmd unmute_console_logging - -fi +customize_cmd cust_comconsole product_custom() { + # not quie ready to tweak these in nopriv build if [ -z ${NANO_NOPRIV_BUILD} ]; then # Last second tweaks -- generally not needed chown -R root:wheel ${NANO_WORLDDIR}/root @@ -486,85 +474,6 @@ product_custom() chown -R root:wheel ${NANO_WORLDDIR}/boot chown root:wheel ${NANO_WORLDDIR}/ chown root:wheel ${NANO_WORLDDIR}/usr - else - # Construct an mtree after our messing around with the tree - # Trim out all the uid / gid stuff, since for new files it - # is likely wrong, and for other files it doesn't matter. - mtree -p ${NANO_WORLDDIR} -c | \ - mtree -C | \ - sed -e 's/ uid=[0-9][0-9]* / /g;s/ gid=[0-9][0-9]* / /' \ - > ${NANO_OBJ}/_.mtree.post - - # Sort the metalog, and save the original. Sadly, this - # seems to expand the uname= and gname= to uid= and gid= - # which is lame and likely a bug in mtree. The man page - # is just vague enough to be infuriating as to the proper - # behavior. Happily, it removes all the // that can confound - # things. - mtree -C -S -f ${NANO_OBJ}/_.metalog > ${NANO_OBJ}/_.mtree.pre - mv ${NANO_OBJ}/_.metalog ${NANO_OBJ}/_.metalog.install - - # mtree -f -f produces a comm-like output. The first column will - # be the files we deleted, so we ignore it. The second column is - # the same in both, so we pass it through. The third column is - # listed twice, so we ignore the second one. We also trim out - # the size, because size just doesn't matter as nanobsd and - # customizations often tweak files changing their size. We also - # add 'optional' to every file in case something slipped through - # that's gone from the tree, though maybe that's a real bug. - # - # To make matters worse, currently mtree in freebsd uses the - # old 'file' keyword rather than the newer type=file. Ditto - # dir and link. Also, nlinks is output, which is lame. And - # there's a bloatload of extra flags=none, which I remove too. - # - # Even worse is that all the uid / gid stuff is also tossed - # into the scrap heap. Hope they weren't important. - # - # And somewhere along the way, flags seem to have gone missing. - # - # Oh, and we have to add back in ./ to keep makefs happy. - # - # And then we have to sort the damn hing so directories come - # before subdirectories - # - # Note: For reasons unknown, all the directories are changing - # from 755 to 775, so that's why we ignore the second line. - # We also get repeats for all the files whose size changed. - # Perhaps we should filter those going into the pre/post files - # and not here. - mtree -f ${NANO_OBJ}/_.mtree.pre -f ${NANO_OBJ}/_.mtree.post | \ - awk ' - function frob_bogus_mtree_line(old) { - line = "./" old " gid=0 uid=0" - # XXX make this a damn function - sub(/^\.\/\./, ".", line); - sub(/ file /, " type=file ", line); - sub(/ dir /, " type=dir ", line); - sub(/ link /, " type=link ", line); - sub(/ size=[0-9][0-9]*/, "", line); - sub(/ nlinks=[0-9][0-9]*/, "", line); - sub(/ flags=none*/, "", line); - return line; - } - BEGIN { - x = 0; - FS="\t"; - print "#mtree 2.0"; - } - $1 != "" {} - $2 != "" { - print frob_bogus_mtree_line($2); - } - $3 != "" { - if (x == 0) { - print frob_bogus_mtree_line($3); - x = 1; - } else { - x = 0; - } - } - ' | sort > ${NANO_OBJ}/_.metalog fi } late_customize_cmd product_custom From owner-svn-src-all@freebsd.org Mon Dec 7 04:03:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E34049A0115; Mon, 7 Dec 2015 04:03:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B48071C7F; Mon, 7 Dec 2015 04:03:02 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7431Mp082244; Mon, 7 Dec 2015 04:03:01 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7431Lu082243; Mon, 7 Dec 2015 04:03:01 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512070403.tB7431Lu082243@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 7 Dec 2015 04:03:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291919 - head/bin/ls/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 04:03:03 -0000 Author: ngie Date: Mon Dec 7 04:03:01 2015 New Revision: 291919 URL: https://svnweb.freebsd.org/changeset/base/291919 Log: Enable bin/ls testcases disabled previously because of issues with how kyua 0.11's version of report-junit was rendering non-printable characters Upgrade to kyua 0.12 to obtain a fixed version of the command Output verified with python 2.7.10's xml.dom.minidom module MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/bin/ls/tests/ls_tests.sh Modified: head/bin/ls/tests/ls_tests.sh ============================================================================== --- head/bin/ls/tests/ls_tests.sh Mon Dec 7 04:02:59 2015 (r291918) +++ head/bin/ls/tests/ls_tests.sh Mon Dec 7 04:03:01 2015 (r291919) @@ -170,8 +170,6 @@ B_flag_head() B_flag_body() { - atf_skip "kyua report-jenkins doesn't properly escape non-printable chars: https://github.com/jmmv/kyua/issues/136" - atf_check -e empty -o empty -s exit:0 touch "$(printf "y\013z")" atf_check -e empty -o match:'y\\013z' -s exit:0 ls -B } @@ -467,8 +465,6 @@ b_flag_head() b_flag_body() { - atf_skip "kyua report-jenkins doesn't properly escape non-printable chars: https://github.com/jmmv/kyua/issues/136" - atf_check -e empty -o empty -s exit:0 touch "$(printf "y\013z")" atf_check -e empty -o match:'y\\vz' -s exit:0 ls -b } @@ -747,8 +743,6 @@ q_flag_and_w_flag_head() q_flag_and_w_flag_body() { - atf_skip "kyua report-jenkins doesn't properly escape non-printable chars: https://github.com/jmmv/kyua/issues/136" - create_test_dir test_file="$(printf "y\01z")" From owner-svn-src-all@freebsd.org Mon Dec 7 04:14:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D7359A049C; Mon, 7 Dec 2015 04:14:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B3BB12ED; Mon, 7 Dec 2015 04:14:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB74ETHR085093; Mon, 7 Dec 2015 04:14:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB74ETa3085092; Mon, 7 Dec 2015 04:14:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512070414.tB74ETa3085092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 7 Dec 2015 04:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291920 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 04:14:31 -0000 Author: imp Date: Mon Dec 7 04:14:29 2015 New Revision: 291920 URL: https://svnweb.freebsd.org/changeset/base/291920 Log: Improve cam tracing a little by including the function code in the traces for xpt_action. Note up-calls (down-calls?) to the SIM as well. Differential Review: https://reviews.freebsd.org/D4382 Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Mon Dec 7 04:03:01 2015 (r291919) +++ head/sys/cam/cam_xpt.c Mon Dec 7 04:14:29 2015 (r291920) @@ -2450,7 +2450,8 @@ void xpt_action(union ccb *start_ccb) { - CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_action\n")); + CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, + ("xpt_action: func=%#x\n", start_ccb->ccb_h.func_code)); start_ccb->ccb_h.status = CAM_REQ_INPROG; (*(start_ccb->ccb_h.path->bus->xport->action))(start_ccb); @@ -2464,7 +2465,8 @@ xpt_action_default(union ccb *start_ccb) int lock; path = start_ccb->ccb_h.path; - CAM_DEBUG(path, CAM_DEBUG_TRACE, ("xpt_action_default\n")); + CAM_DEBUG(path, CAM_DEBUG_TRACE, + ("xpt_action_default: func=%#x\n", start_ccb->ccb_h.func_code)); switch (start_ccb->ccb_h.func_code) { case XPT_SCSI_IO: @@ -2618,7 +2620,11 @@ call_sim: lock = (mtx_owned(sim->mtx) == 0); if (lock) CAM_SIM_LOCK(sim); + CAM_DEBUG(path, CAM_DEBUG_TRACE, + ("sim->sim_action: func=%#x\n", start_ccb->ccb_h.func_code)); (*(sim->sim_action))(sim, start_ccb); + CAM_DEBUG(path, CAM_DEBUG_TRACE, + ("sim->sim_action: status=%#x\n", start_ccb->ccb_h.status)); if (lock) CAM_SIM_UNLOCK(sim); break; From owner-svn-src-all@freebsd.org Mon Dec 7 05:13:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97EAE9B7143; Mon, 7 Dec 2015 05:13:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 584091070; Mon, 7 Dec 2015 05:13:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB75DU0k003365; Mon, 7 Dec 2015 05:13:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB75DTT0003357; Mon, 7 Dec 2015 05:13:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512070513.tB75DTT0003357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 7 Dec 2015 05:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291921 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 05:13:31 -0000 Author: imp Date: Mon Dec 7 05:13:29 2015 New Revision: 291921 URL: https://svnweb.freebsd.org/changeset/base/291921 Log: Document the different config files. Document how to run qemu for the ones I've run. Use qcow2 for all qemu images. Modified: head/tools/tools/nanobsd/embedded/README head/tools/tools/nanobsd/embedded/qemu-amd64.cfg head/tools/tools/nanobsd/embedded/qemu-mips.cfg head/tools/tools/nanobsd/embedded/qemu-mips64.cfg head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg Modified: head/tools/tools/nanobsd/embedded/README ============================================================================== --- head/tools/tools/nanobsd/embedded/README Mon Dec 7 04:14:29 2015 (r291920) +++ head/tools/tools/nanobsd/embedded/README Mon Dec 7 05:13:29 2015 (r291921) @@ -12,3 +12,40 @@ This is a work in progress. Generally, t sudo sh ../nanobsd.sh -c foo.cfg but do be careful if things are interrupted. There may still be bugs lurking that cause your entire FreeBSD tree to disappear. + +Some features: + +Image size is minimal, we grow the last partition on first boot to +fill the media. + +Images are both as easy as possible to construct, as well as easy as +possible to expand. + +Config Short description +beaglebone.cfg Create a bootable beaglebone image +qemu-amd64.cfg Create a bootable amd64 image for qemu (W) +qemu-i386.cfg Create a bootable i386 image for qemu (W) +qemu-mips.cfg Create a bootable mips malta board image for + qemu +qemu-mips64.cfg Create a bootable mips malta board (64-bit + mode) image for qemu +qemu-powerpc.cfg Create a bootable 32-bit powerpc image for + qemu +qemu-powerpc64.cfg Create a bootable 64-bit IBM-flavor image for + qemu +qemu-sparc64.cfg Create a bootable sparc64 image for qemu +rpi.cfg Create a bootable image for Raspberry Pi B +rpi2.cfg Create a bootable image for Raspberry Pi2 +sam9260ek.cfg Create a bootable image for an Atmel SAM9260-EK + evaluation board (still needs a kenrel loaded + into dataflash or NAND, so experimental). +sam9g20ek.cfg Create a bootable image for an Atmel SAM9G20-EK + evaluation board (still needs a kenrel loaded + into dataflash or NAND, so experimental). Also + works on many after-market boards that are somewhat + compatible with the refernce board. + +QEMU command lines for serial console access + +i386: qemu-system-i386 -m 512 -hda _.disk.image.qemu-i386.qcow2 -nographic +amd64: qemu-system-amd64 -m 512 -hda _.disk.image.qemu-amd64.qcow2 -nographic Modified: head/tools/tools/nanobsd/embedded/qemu-amd64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-amd64.cfg Mon Dec 7 04:14:29 2015 (r291920) +++ head/tools/tools/nanobsd/embedded/qemu-amd64.cfg Mon Dec 7 05:13:29 2015 (r291921) @@ -37,6 +37,7 @@ NANO_KERNEL=GENERIC NANO_DRIVE=ada0 NANO_NAME=qemu-amd64 +NANO_DISKIMAGE_FORMAT=qcow2 export EMBED_OMIT_FAT=t . common # Pull in common definitions, keep last Modified: head/tools/tools/nanobsd/embedded/qemu-mips.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-mips.cfg Mon Dec 7 04:14:29 2015 (r291920) +++ head/tools/tools/nanobsd/embedded/qemu-mips.cfg Mon Dec 7 05:13:29 2015 (r291921) @@ -37,6 +37,7 @@ NANO_KERNEL=MALTA NANO_DRIVE=ada0 NANO_NAME=qemu-mips +NANO_DISKIMAGE_FORMAT=qcow2 export EMBED_OMIT_FAT=t . common # Pull in common definitions, keep last Modified: head/tools/tools/nanobsd/embedded/qemu-mips64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-mips64.cfg Mon Dec 7 04:14:29 2015 (r291920) +++ head/tools/tools/nanobsd/embedded/qemu-mips64.cfg Mon Dec 7 05:13:29 2015 (r291921) @@ -37,6 +37,7 @@ NANO_KERNEL=MALTA64 NANO_DRIVE=ada0 NANO_NAME=qemu-mips64 +NANO_DISKIMAGE_FORMAT=qcow2 export EMBED_OMIT_FAT=t . common # Pull in common definitions, keep last Modified: head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg Mon Dec 7 04:14:29 2015 (r291920) +++ head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg Mon Dec 7 05:13:29 2015 (r291921) @@ -38,6 +38,7 @@ NANO_KERNEL=GENERIC NANO_DRIVE=ada0 NANO_NAME=qemu-powerpc +NANO_DISKIMAGE_FORMAT=qcow2 export EMBED_OMIT_FAT=t . common # Pull in common definitions, keep last Modified: head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg Mon Dec 7 04:14:29 2015 (r291920) +++ head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg Mon Dec 7 05:13:29 2015 (r291921) @@ -37,6 +37,7 @@ NANO_KERNEL=GENERIC64 NANO_DRIVE=ada0 NANO_NAME=qemu-powerpc64 +NANO_DISKIMAGE_FORMAT=qcow2 export EMBED_OMIT_FAT=t . common # Pull in common definitions, keep last Modified: head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg Mon Dec 7 04:14:29 2015 (r291920) +++ head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg Mon Dec 7 05:13:29 2015 (r291921) @@ -37,6 +37,7 @@ NANO_KERNEL=GENERIC NANO_DRIVE=ada0 NANO_NAME=qemu-sparc64 +NANO_DISKIMAGE_FORMAT=qcow2 export EMBED_OMIT_FAT=t . common # Pull in common definitions, keep last From owner-svn-src-all@freebsd.org Mon Dec 7 05:59:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3613D9B78A5; Mon, 7 Dec 2015 05:59:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB36A1F97; Mon, 7 Dec 2015 05:59:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB75xPQg015405; Mon, 7 Dec 2015 05:59:25 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB75xOcV015402; Mon, 7 Dec 2015 05:59:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512070559.tB75xOcV015402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 7 Dec 2015 05:59:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291922 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 05:59:26 -0000 Author: arybchik Date: Mon Dec 7 05:59:24 2015 New Revision: 291922 URL: https://svnweb.freebsd.org/changeset/base/291922 Log: sfxge: support PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED flag Use flag on vadapter alloc when reported as a supported capability. Use the slow device reset only when the capability is missing. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4387 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Mon Dec 7 05:13:29 2015 (r291921) +++ head/sys/dev/sfxge/common/efx.h Mon Dec 7 05:59:24 2015 (r291922) @@ -1173,6 +1173,7 @@ typedef struct efx_nic_cfg_s { /* Datapath firmware vadapter/vport/vswitch support */ boolean_t enc_datapath_cap_evb; boolean_t enc_rx_disable_scatter_supported; + boolean_t enc_allow_set_mac_with_installed_filters; /* External port identifier */ uint8_t enc_external_port; } efx_nic_cfg_t; Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Mon Dec 7 05:13:29 2015 (r291921) +++ head/sys/dev/sfxge/common/hunt_nic.c Mon Dec 7 05:59:24 2015 (r291922) @@ -149,6 +149,9 @@ efx_mcdi_vadaptor_alloc( req.emr_out_length = MC_CMD_VADAPTOR_ALLOC_OUT_LEN; MCDI_IN_SET_DWORD(req, VADAPTOR_ALLOC_IN_UPSTREAM_PORT_ID, port_id); + MCDI_IN_POPULATE_DWORD_1(req, VADAPTOR_ALLOC_IN_FLAGS, + VADAPTOR_ALLOC_IN_FLAG_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED, + enp->en_nic_cfg.enc_allow_set_mac_with_installed_filters ? 1 : 0); efx_mcdi_execute(enp, &req); @@ -928,6 +931,15 @@ hunt_get_datapath_caps( encp->enc_rx_disable_scatter_supported = B_FALSE; } + /* Check if the firmware supports set mac with running filters */ + if (MCDI_CMD_DWORD_FIELD(&datapath_capabilities, + GET_CAPABILITIES_OUT_VADAPTOR_PERMIT_SET_MAC_WHEN_FILTERS_INSTALLED) + == 1) { + encp->enc_allow_set_mac_with_installed_filters = B_TRUE; + } else { + encp->enc_allow_set_mac_with_installed_filters = B_FALSE; + } + return (0); fail2: Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Mon Dec 7 05:13:29 2015 (r291921) +++ head/sys/dev/sfxge/common/siena_nic.c Mon Dec 7 05:59:24 2015 (r291922) @@ -170,6 +170,7 @@ siena_board_cfg( encp->enc_hw_tx_insert_vlan_enabled = B_FALSE; encp->enc_fw_assisted_tso_enabled = B_FALSE; + encp->enc_allow_set_mac_with_installed_filters = B_TRUE; return (0); From owner-svn-src-all@freebsd.org Mon Dec 7 06:01:16 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E35B9B793C; Mon, 7 Dec 2015 06:01:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A23B12BE; Mon, 7 Dec 2015 06:01:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB761FXq015550; Mon, 7 Dec 2015 06:01:15 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB761EJu015545; Mon, 7 Dec 2015 06:01:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512070601.tB761EJu015545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 7 Dec 2015 06:01:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291923 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 06:01:16 -0000 Author: arybchik Date: Mon Dec 7 06:01:14 2015 New Revision: 291923 URL: https://svnweb.freebsd.org/changeset/base/291923 Log: sfxge: [Sorrento] support writing of MUM firmware When writing the MUM firmware the chunk size must be equal to the erase size. Submitted by: Laurence Evans Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4388 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_nvram.c head/sys/dev/sfxge/common/hunt_nic.c head/sys/dev/sfxge/common/hunt_nvram.c head/sys/dev/sfxge/common/siena_nic.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Mon Dec 7 05:59:24 2015 (r291922) +++ head/sys/dev/sfxge/common/efx.h Mon Dec 7 06:01:14 2015 (r291923) @@ -1176,6 +1176,7 @@ typedef struct efx_nic_cfg_s { boolean_t enc_allow_set_mac_with_installed_filters; /* External port identifier */ uint8_t enc_external_port; + uint32_t enc_mcdi_max_payload_length; } efx_nic_cfg_t; #define EFX_PCI_FUNCTION_IS_PF(_encp) ((_encp)->enc_vf == 0xffff) Modified: head/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/efx_nvram.c Mon Dec 7 05:59:24 2015 (r291922) +++ head/sys/dev/sfxge/common/efx_nvram.c Mon Dec 7 06:01:14 2015 (r291923) @@ -749,6 +749,11 @@ fail1: return (rc); } +/* + * The NVRAM_WRITE MCDI command is a V1 command and so is supported by both + * Sienna and EF10 based boards. However EF10 based boards support the use + * of this command with payloads up to the maximum MCDI V2 payload length. + */ __checkReturn efx_rc_t efx_mcdi_nvram_write( __in efx_nic_t *enp, @@ -758,11 +763,18 @@ efx_mcdi_nvram_write( __in size_t size) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_NVRAM_WRITE_IN_LENMAX, - MC_CMD_NVRAM_WRITE_OUT_LEN)]; + uint8_t payload[MAX(MCDI_CTL_SDU_LEN_MAX_V1, + MCDI_CTL_SDU_LEN_MAX_V2)]; efx_rc_t rc; + size_t max_data_size; - if (size > MC_CMD_NVRAM_WRITE_IN_LENMAX) { + max_data_size = enp->en_nic_cfg.enc_mcdi_max_payload_length + - MC_CMD_NVRAM_WRITE_IN_LEN(0); + EFSYS_ASSERT3U(enp->en_nic_cfg.enc_mcdi_max_payload_length, >, 0); + EFSYS_ASSERT3U(max_data_size, <, + enp->en_nic_cfg.enc_mcdi_max_payload_length); + + if (size > max_data_size) { rc = EINVAL; goto fail1; } Modified: head/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nic.c Mon Dec 7 05:59:24 2015 (r291922) +++ head/sys/dev/sfxge/common/hunt_nic.c Mon Dec 7 06:01:14 2015 (r291923) @@ -1681,6 +1681,7 @@ hunt_nic_init( } enp->en_vport_id = EVB_PORT_ID_ASSIGNED; + enp->en_nic_cfg.enc_mcdi_max_payload_length = MCDI_CTL_SDU_LEN_MAX_V2; return (0); Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Mon Dec 7 05:59:24 2015 (r291922) +++ head/sys/dev/sfxge/common/hunt_nvram.c Mon Dec 7 06:01:14 2015 (r291923) @@ -1409,14 +1409,32 @@ hunt_nvram_partn_write( __in size_t size) { size_t chunk; + uint32_t write_size; efx_rc_t rc; + if ((rc = efx_mcdi_nvram_info(enp, partn, NULL, NULL, + NULL, &write_size)) != 0) + goto fail1; + + if (write_size != 0) { + /* + * Check that the size is a multiple of the write chunk size if + * the write chunk size is available. + */ + if (size % write_size != 0) { + rc = EINVAL; + goto fail2; + } + } else { + write_size = HUNTINGTON_NVRAM_CHUNK; + } + while (size > 0) { - chunk = MIN(size, HUNTINGTON_NVRAM_CHUNK); + chunk = MIN(size, write_size); if ((rc = efx_mcdi_nvram_write(enp, partn, offset, data, chunk)) != 0) { - goto fail1; + goto fail3; } size -= chunk; @@ -1426,6 +1444,10 @@ hunt_nvram_partn_write( return (0); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: head/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- head/sys/dev/sfxge/common/siena_nic.c Mon Dec 7 05:59:24 2015 (r291922) +++ head/sys/dev/sfxge/common/siena_nic.c Mon Dec 7 06:01:14 2015 (r291923) @@ -420,6 +420,8 @@ siena_nic_init( if ((rc = siena_phy_reconfigure(enp)) != 0) goto fail2; + enp->en_nic_cfg.enc_mcdi_max_payload_length = MCDI_CTL_SDU_LEN_MAX_V1; + return (0); fail2: From owner-svn-src-all@freebsd.org Mon Dec 7 06:04:25 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF09B9B7A8A; Mon, 7 Dec 2015 06:04:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85B49159D; Mon, 7 Dec 2015 06:04:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB764OrG018230; Mon, 7 Dec 2015 06:04:24 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB764OMt018226; Mon, 7 Dec 2015 06:04:24 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512070604.tB764OMt018226@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 7 Dec 2015 06:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291924 - in head/sys/dev/sfxge: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 06:04:25 -0000 Author: arybchik Date: Mon Dec 7 06:04:24 2015 New Revision: 291924 URL: https://svnweb.freebsd.org/changeset/base/291924 Log: sfxge: switch to TxQ creation specific flags It is better do not mix TxQ creation and receive event flags since only checksum flags are applicable to TxQ. Also it will allow to add a new TxQ creation specific flags. Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4389 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_tx.c head/sys/dev/sfxge/common/hunt_tx.c head/sys/dev/sfxge/sfxge_tx.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Mon Dec 7 06:01:14 2015 (r291923) +++ head/sys/dev/sfxge/common/efx.h Mon Dec 7 06:04:24 2015 (r291924) @@ -2028,6 +2028,9 @@ efx_tx_fini( #define EFX_TXQ_MAX_BUFS 8 /* Maximum independent of EFX_BUG35388_WORKAROUND. */ +#define EFX_TXQ_CKSUM_IPV4 0x0001 +#define EFX_TXQ_CKSUM_TCPUDP 0x0002 + extern __checkReturn efx_rc_t efx_tx_qcreate( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- head/sys/dev/sfxge/common/efx_tx.c Mon Dec 7 06:01:14 2015 (r291923) +++ head/sys/dev/sfxge/common/efx_tx.c Mon Dec 7 06:04:24 2015 (r291924) @@ -921,9 +921,9 @@ falconsiena_tx_qcreate( EFX_SET_OWORD_FIELD(oword, FRF_BZ_TX_NON_IP_DROP_DIS, 1); EFX_SET_OWORD_FIELD(oword, FRF_BZ_TX_IP_CHKSM_DIS, - (flags & EFX_CKSUM_IPV4) ? 0 : 1); + (flags & EFX_TXQ_CKSUM_IPV4) ? 0 : 1); EFX_SET_OWORD_FIELD(oword, FRF_BZ_TX_TCP_CHKSM_DIS, - (flags & EFX_CKSUM_TCPUDP) ? 0 : 1); + (flags & EFX_TXQ_CKSUM_TCPUDP) ? 0 : 1); EFX_BAR_TBL_WRITEO(enp, FR_AZ_TX_DESC_PTR_TBL, etp->et_index, &oword, B_TRUE); Modified: head/sys/dev/sfxge/common/hunt_tx.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_tx.c Mon Dec 7 06:01:14 2015 (r291923) +++ head/sys/dev/sfxge/common/hunt_tx.c Mon Dec 7 06:04:24 2015 (r291924) @@ -90,8 +90,10 @@ efx_mcdi_init_txq( MCDI_IN_POPULATE_DWORD_6(req, INIT_TXQ_IN_FLAGS, INIT_TXQ_IN_FLAG_BUFF_MODE, 0, - INIT_TXQ_IN_FLAG_IP_CSUM_DIS, (flags & EFX_CKSUM_IPV4) ? 0 : 1, - INIT_TXQ_IN_FLAG_TCP_CSUM_DIS, (flags & EFX_CKSUM_TCPUDP) ? 0 : 1, + INIT_TXQ_IN_FLAG_IP_CSUM_DIS, + (flags & EFX_TXQ_CKSUM_IPV4) ? 0 : 1, + INIT_TXQ_IN_FLAG_TCP_CSUM_DIS, + (flags & EFX_TXQ_CKSUM_TCPUDP) ? 0 : 1, INIT_TXQ_IN_FLAG_TCP_UDP_ONLY, 0, INIT_TXQ_IN_CRC_MODE, 0, INIT_TXQ_IN_FLAG_TIMESTAMP, 0); @@ -210,8 +212,10 @@ hunt_tx_qcreate( EFX_POPULATE_QWORD_4(desc, ESF_DZ_TX_DESC_IS_OPT, 1, ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM, - ESF_DZ_TX_OPTION_UDP_TCP_CSUM, (flags & EFX_CKSUM_TCPUDP) ? 1 : 0, - ESF_DZ_TX_OPTION_IP_CSUM, (flags & EFX_CKSUM_IPV4) ? 1 : 0); + ESF_DZ_TX_OPTION_UDP_TCP_CSUM, + (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0, + ESF_DZ_TX_OPTION_IP_CSUM, + (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0); EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc); hunt_tx_qpush(etp, *addedp, 0); Modified: head/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- head/sys/dev/sfxge/sfxge_tx.c Mon Dec 7 06:01:14 2015 (r291923) +++ head/sys/dev/sfxge/sfxge_tx.c Mon Dec 7 06:04:24 2015 (r291924) @@ -1439,10 +1439,10 @@ sfxge_tx_qstart(struct sfxge_softc *sc, flags = 0; break; case SFXGE_TXQ_IP_CKSUM: - flags = EFX_CKSUM_IPV4; + flags = EFX_TXQ_CKSUM_IPV4; break; case SFXGE_TXQ_IP_TCP_UDP_CKSUM: - flags = EFX_CKSUM_IPV4 | EFX_CKSUM_TCPUDP; + flags = EFX_TXQ_CKSUM_IPV4 | EFX_TXQ_CKSUM_TCPUDP; break; default: KASSERT(0, ("Impossible TX queue")); From owner-svn-src-all@freebsd.org Mon Dec 7 06:05:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF74B9B7AE0; Mon, 7 Dec 2015 06:05:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 823DC17E6; Mon, 7 Dec 2015 06:05:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB765NDU018309; Mon, 7 Dec 2015 06:05:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB765NQ5018308; Mon, 7 Dec 2015 06:05:23 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512070605.tB765NQ5018308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 7 Dec 2015 06:05:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291925 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 06:05:24 -0000 Author: arybchik Date: Mon Dec 7 06:05:23 2015 New Revision: 291925 URL: https://svnweb.freebsd.org/changeset/base/291925 Log: sfxge: fix name conflict with crc32_table from sys/crc32.h The header is not present on FreeBSD, but exists on OmniOS where sfxge common code is used as well. Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4390 Modified: head/sys/dev/sfxge/common/efx_crc32.c Modified: head/sys/dev/sfxge/common/efx_crc32.c ============================================================================== --- head/sys/dev/sfxge/common/efx_crc32.c Mon Dec 7 06:04:24 2015 (r291924) +++ head/sys/dev/sfxge/common/efx_crc32.c Mon Dec 7 06:05:23 2015 (r291925) @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD$"); * with polynomial 0x04c11db7 (bit-reversed 0xedb88320) */ -static const uint32_t crc32_table[256] = { +static const uint32_t efx_crc32_table[256] = { 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, @@ -120,7 +120,7 @@ efx_crc32_calculate( for (index = 0; index < length; index++) { uint32_t data = *(input++); - crc = (crc >> 8) ^ crc32_table[(crc ^ data) & 0xff]; + crc = (crc >> 8) ^ efx_crc32_table[(crc ^ data) & 0xff]; } return (crc); From owner-svn-src-all@freebsd.org Mon Dec 7 06:07:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE2969B7B4D; Mon, 7 Dec 2015 06:07:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B275219C5; Mon, 7 Dec 2015 06:07:02 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7671BQ018408; Mon, 7 Dec 2015 06:07:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7671x5018407; Mon, 7 Dec 2015 06:07:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512070607.tB7671x5018407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 7 Dec 2015 06:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291926 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 06:07:03 -0000 Author: arybchik Date: Mon Dec 7 06:07:01 2015 New Revision: 291926 URL: https://svnweb.freebsd.org/changeset/base/291926 Log: sfxge: fix pointer parameter/value signedness mismatch warnings TLV routines use 'uint8_t *', NVRAM code uses caddr_t. Just cast to required type to fix the warning. Required to build with -Werror=pointer-signg. Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4391 Modified: head/sys/dev/sfxge/common/hunt_nvram.c Modified: head/sys/dev/sfxge/common/hunt_nvram.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_nvram.c Mon Dec 7 06:05:23 2015 (r291925) +++ head/sys/dev/sfxge/common/hunt_nvram.c Mon Dec 7 06:07:01 2015 (r291926) @@ -497,7 +497,7 @@ efx_nvram_tlv_validate( } /* The partition header must be the first item (at offset zero) */ - if ((rc = tlv_init_cursor_from_size(&cursor, partn_data, + if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)partn_data, partn_size)) != 0) { rc = EFAULT; goto fail2; @@ -607,7 +607,7 @@ hunt_nvram_read_tlv_segment( } /* A PARTITION_HEADER tag must be the first item at the given offset */ - if ((rc = tlv_init_cursor_from_size(&cursor, seg_data, + if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)seg_data, max_seg_size)) != 0) { rc = EFAULT; goto fail3; @@ -725,7 +725,7 @@ hunt_nvram_buf_read_tlv( } /* Find requested TLV tag in segment data */ - if ((rc = tlv_init_cursor_from_size(&cursor, seg_data, + if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)seg_data, max_seg_size)) != 0) { rc = EFAULT; goto fail2; @@ -734,7 +734,7 @@ hunt_nvram_buf_read_tlv( rc = ENOENT; goto fail3; } - value = tlv_value(&cursor); + value = (caddr_t)tlv_value(&cursor); length = tlv_length(&cursor); if (length == 0) @@ -859,7 +859,7 @@ hunt_nvram_buf_segment_size( uint32_t segment_length; /* A PARTITION_HEADER tag must be the first item at the given offset */ - if ((rc = tlv_init_cursor_from_size(&cursor, seg_data, + if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)seg_data, max_seg_size)) != 0) { rc = EFAULT; goto fail1; @@ -993,7 +993,7 @@ hunt_nvram_buf_write_tlv( efx_rc_t rc; /* A PARTITION_HEADER tag must be the first item (at offset zero) */ - if ((rc = tlv_init_cursor_from_size(&cursor, seg_data, + if ((rc = tlv_init_cursor_from_size(&cursor, (uint8_t *)seg_data, max_seg_size)) != 0) { rc = EFAULT; goto fail1; @@ -1008,7 +1008,7 @@ hunt_nvram_buf_write_tlv( if ((rc = tlv_find(&cursor, tag)) == 0) { /* Modify existing TLV item */ if ((rc = tlv_modify(&cursor, tag, - tag_data, tag_size)) != 0) + (uint8_t *)tag_data, tag_size)) != 0) goto fail3; } else { /* Insert a new TLV item before the PARTITION_TRAILER */ @@ -1018,7 +1018,7 @@ hunt_nvram_buf_write_tlv( goto fail4; } if ((rc = tlv_insert(&cursor, tag, - tag_data, tag_size)) != 0) { + (uint8_t *)tag_data, tag_size)) != 0) { rc = EINVAL; goto fail5; } From owner-svn-src-all@freebsd.org Mon Dec 7 06:42:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 285A49B7118; Mon, 7 Dec 2015 06:42:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id C0C64174B; Mon, 7 Dec 2015 06:42:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id IAA28587; Mon, 07 Dec 2015 08:42:09 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1a5pUv-0009CQ-5m; Mon, 07 Dec 2015 08:42:09 +0200 Subject: Re: svn commit: r291911 - head/sys/dev/iscsi To: Steven Hartland , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201512070256.tB72u8C6057988@repo.freebsd.org> From: Andriy Gapon Message-ID: <56652A09.1030106@FreeBSD.org> Date: Mon, 7 Dec 2015 08:41:13 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201512070256.tB72u8C6057988@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 06:42:19 -0000 On 07/12/2015 04:56, Steven Hartland wrote: > Author: smh > Date: Mon Dec 7 02:56:08 2015 > New Revision: 291911 > URL: https://svnweb.freebsd.org/changeset/base/291911 > > Log: > Fix panic on shutdown due to iscsi event priority > > iscsi's shutdown_pre_sync prio was SHUTDOWN_PRI_FIRST which caused it to > run before other high priority handlers such as filesystems e.g. ZFS. > > This meant the iscsi sessions where removed before the ZFS geom consumer > was closed, resulting in a panic from g_access calls on debug kernels > due to negative acr. > > Instead use the same as the old iscsi_initiator SHUTDOWN_PRI_DEFAULT-1 > which allows it to run before dashutdown etc but after filesystems. > > MFC after: 2 weeks > Sponsored by: Multiplay > > Modified: > head/sys/dev/iscsi/iscsi.c > > Modified: head/sys/dev/iscsi/iscsi.c > ============================================================================== > --- head/sys/dev/iscsi/iscsi.c Sun Dec 6 21:31:09 2015 (r291910) > +++ head/sys/dev/iscsi/iscsi.c Mon Dec 7 02:56:08 2015 (r291911) > @@ -2365,7 +2365,7 @@ iscsi_load(void) > sc->sc_cdev->si_drv1 = sc; > > sc->sc_shutdown_eh = EVENTHANDLER_REGISTER(shutdown_pre_sync, > - iscsi_shutdown, sc, SHUTDOWN_PRI_FIRST); > + iscsi_shutdown, sc, SHUTDOWN_PRI_DEFAULT-1); > > return (0); > } It would be nice to also add a comment here explaining the priority. And spaces around '-' operator. -- Andriy Gapon From owner-svn-src-all@freebsd.org Mon Dec 7 06:59:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5EF39B724E; Mon, 7 Dec 2015 06:59:06 +0000 (UTC) (envelope-from cochard@gmail.com) Received: from mail-lb0-x22c.google.com (mail-lb0-x22c.google.com [IPv6:2a00:1450:4010:c04::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 685871BB8; Mon, 7 Dec 2015 06:59:06 +0000 (UTC) (envelope-from cochard@gmail.com) Received: by lbbkw15 with SMTP id kw15so51084107lbb.0; Sun, 06 Dec 2015 22:59:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=gCjs6P6tRQLWEXncM9PWXu6prOIKOf34ApRn8TwHyfE=; b=NivS0IGGIr2E6iKXIaMb+36+F43wkcVMkYV5RzSwd4OGudDXobKygyOKxWEmNB7Zgv kGqoZAAdw4bj6ZXSwNHJka37BHDsyQiufjV/+RKO0Rplj9WHWurqgN0ph8TmQTWrnYBa aC41i5RjFMknqLESyT0orjjdZEZHYkVJ1ixgV8Utl+wNs5ywS9+VYGRuRLiVYswx4Olx g62OP+GGDgLvjsUtb4QO5kgCPAF0pQRAbYFHPaM/dltivlFYnJE8Gft18QuTDHt7cqr3 axGc7iCnEe4slTvS+Hc9uKox2cp0Yj8NcigM3B9wAX9quyaMQZzF2JX0KIng5jPfgoVp NWbw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cochard-me.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=gCjs6P6tRQLWEXncM9PWXu6prOIKOf34ApRn8TwHyfE=; b=v/jSjS08dxpj/Hp6/C0C9sKC+vCF1HbVzGH6tr1fzz2gSTwshMQEjrbT/tXpZxIgAQ Bk9SbBAI2zU2G+jBMJqJnUV2mbPgRhMr1lnKLDdEphnj4Gi7XGB+6El4lpqVj21pxxUd iaTxej6KnhULozTviXSBjtQ+kvKaSzW7zemQ39rSe1FGxNy7xT7MKXIUDLmj9lM6BtPr El+YxLzMc5WRUrXogVpnAf9x9j8Tg2PAh6F4u361ZtVkT4pghwlleY0c/QoIoE8Q5Qmg pcgQ+XQeod7fleoKCycEv9aNU6RJMNrTIVzSC6ES3iLnq+2f3EyBYt+SHfSaAtAoaBmz tEPQ== X-Received: by 10.25.22.72 with SMTP id m69mr12957067lfi.127.1449471543353; Sun, 06 Dec 2015 22:59:03 -0800 (PST) MIME-Version: 1.0 Sender: cochard@gmail.com Received: by 10.25.197.195 with HTTP; Sun, 6 Dec 2015 22:58:44 -0800 (PST) In-Reply-To: <201512070402.tB742KKZ081909@repo.freebsd.org> References: <201512070402.tB742KKZ081909@repo.freebsd.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Mon, 7 Dec 2015 07:58:44 +0100 X-Google-Sender-Auth: T75mnM99yEetSlSvT8v-ab90Bjw Message-ID: Subject: Re: svn commit: r291912 - head/tools/tools/nanobsd To: Warner Losh Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 06:59:07 -0000 On Mon, Dec 7, 2015 at 5:02 AM, Warner Losh wrote: > Author: imp > Date: Mon Dec 7 04:02:19 2015 > New Revision: 291912 > URL: https://svnweb.freebsd.org/changeset/base/291912 > > Log: > Default serial connection to 115200. Hardly anybody uses slower these > days, and those that do can use NANO_BOOT2CFG to change it. > > =E2=80=8BHi Warner, =E2=80=8BCool change, but boot0sio still doesn't support speed greater than 9600, right ? =E2=80=8B From owner-svn-src-all@freebsd.org Mon Dec 7 07:20:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FAA19B7529; Mon, 7 Dec 2015 07:20:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2760C135D; Mon, 7 Dec 2015 07:20:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB77KoCq041211; Mon, 7 Dec 2015 07:20:50 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB77KouR041209; Mon, 7 Dec 2015 07:20:50 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512070720.tB77KouR041209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 7 Dec 2015 07:20:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291927 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 07:20:51 -0000 Author: arybchik Date: Mon Dec 7 07:20:49 2015 New Revision: 291927 URL: https://svnweb.freebsd.org/changeset/base/291927 Log: sfxge: [1/6] add common code MCDI proxy auth build option Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4417 Modified: head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx_check.h Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Mon Dec 7 06:07:01 2015 (r291926) +++ head/sys/dev/sfxge/common/efsys.h Mon Dec 7 07:20:49 2015 (r291927) @@ -246,6 +246,7 @@ sfxge_map_mbuf_fast(bus_dma_tag_t tag, b #define EFSYS_OPT_MCDI 1 #define EFSYS_OPT_MCDI_LOGGING 0 +#define EFSYS_OPT_MCDI_PROXY_AUTH 0 #define EFSYS_OPT_MAC_FALCON_GMAC 0 #define EFSYS_OPT_MAC_FALCON_XMAC 0 Modified: head/sys/dev/sfxge/common/efx_check.h ============================================================================== --- head/sys/dev/sfxge/common/efx_check.h Mon Dec 7 06:07:01 2015 (r291926) +++ head/sys/dev/sfxge/common/efx_check.h Mon Dec 7 07:20:49 2015 (r291927) @@ -153,6 +153,13 @@ # endif #endif /* EFSYS_OPT_MCDI_LOGGING */ +/* Support MCDI proxy authorization */ +#if EFSYS_OPT_MCDI_PROXY_AUTH +# if !EFSYS_OPT_MCDI +# error "MCDI_PROXY_AUTH requires MCDI" +# endif +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ + /* Support LM87 monitor */ #if EFSYS_OPT_MON_LM87 # if !EFSYS_OPT_FALCON From owner-svn-src-all@freebsd.org Mon Dec 7 07:22:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D6A639B7657; Mon, 7 Dec 2015 07:22:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0FD01796; Mon, 7 Dec 2015 07:22:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB77MLq7041934; Mon, 7 Dec 2015 07:22:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB77MLZ6041931; Mon, 7 Dec 2015 07:22:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512070722.tB77MLZ6041931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Mon, 7 Dec 2015 07:22:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291928 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 07:22:22 -0000 Author: arybchik Date: Mon Dec 7 07:22:21 2015 New Revision: 291928 URL: https://svnweb.freebsd.org/changeset/base/291928 Log: sfxge: [2/6] rework MCDI response polling Required to support MCDI proxy authorization. Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4418 Modified: head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/hunt_mcdi.c head/sys/dev/sfxge/common/siena_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Mon Dec 7 07:20:49 2015 (r291927) +++ head/sys/dev/sfxge/common/efx_mcdi.c Mon Dec 7 07:22:21 2015 (r291928) @@ -52,9 +52,9 @@ static efx_mcdi_ops_t __efx_mcdi_siena_o siena_mcdi_fini, /* emco_fini */ siena_mcdi_fw_update_supported, /* emco_fw_update_supported */ siena_mcdi_macaddr_change_supported, - /* emco_macaddr_change_supported */ + /* emco_macaddr_change_supported */ siena_mcdi_link_control_supported, - /* emco_link_control_supported */ + /* emco_link_control_supported */ }; #endif /* EFSYS_OPT_SIENA */ @@ -70,9 +70,9 @@ static efx_mcdi_ops_t __efx_mcdi_hunt_op hunt_mcdi_fini, /* emco_fini */ hunt_mcdi_fw_update_supported, /* emco_fw_update_supported */ hunt_mcdi_macaddr_change_supported, - /* emco_macaddr_change_supported */ + /* emco_macaddr_change_supported */ hunt_mcdi_link_control_supported, - /* emco_link_control_supported */ + /* emco_link_control_supported */ }; #endif /* EFSYS_OPT_HUNTINGTON */ Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Mon Dec 7 07:20:49 2015 (r291927) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Mon Dec 7 07:22:21 2015 (r291928) @@ -274,6 +274,18 @@ hunt_mcdi_request_copyout( #endif /* EFSYS_OPT_MCDI_LOGGING */ } +static __checkReturn boolean_t +hunt_mcdi_poll_response( + __in efx_nic_t *enp) +{ + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; + efsys_mem_t *esmp = emtp->emt_dma_mem; + efx_dword_t hdr; + + EFSYS_MEM_READD(esmp, 0, &hdr); + return (EFX_DWORD_FIELD(hdr, MCDI_HEADER_RESPONSE) ? B_TRUE : B_FALSE); +} + __checkReturn boolean_t hunt_mcdi_request_poll( __in efx_nic_t *enp) @@ -301,13 +313,15 @@ hunt_mcdi_request_poll( offset = 0; - /* Read the command header */ - EFSYS_MEM_READD(esmp, offset, &hdr[0]); - offset += sizeof (efx_dword_t); - if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_RESPONSE) == 0) { + /* Check if a response is available */ + if (hunt_mcdi_poll_response(enp) == B_FALSE) { EFSYS_UNLOCK(enp->en_eslp, state); return (B_FALSE); } + + /* Read the response header */ + EFSYS_MEM_READD(esmp, offset, &hdr[0]); + offset += sizeof (efx_dword_t); if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) { EFSYS_MEM_READD(esmp, offset, &hdr[1]); offset += sizeof (efx_dword_t); Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Mon Dec 7 07:20:49 2015 (r291927) +++ head/sys/dev/sfxge/common/siena_mcdi.c Mon Dec 7 07:22:21 2015 (r291928) @@ -191,6 +191,21 @@ siena_mcdi_poll_reboot( #endif } +static __checkReturn boolean_t +siena_mcdi_poll_response( + __in efx_nic_t *enp) +{ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_dword_t hdr; + unsigned int pdur; + + EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2); + pdur = SIENA_MCDI_PDU(emip); + + EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &hdr, B_FALSE); + return (EFX_DWORD_FIELD(hdr, MCDI_HEADER_RESPONSE) ? B_TRUE : B_FALSE); +} + __checkReturn boolean_t siena_mcdi_request_poll( __in efx_nic_t *enp) @@ -229,13 +244,15 @@ siena_mcdi_request_poll( EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2); pdur = SIENA_MCDI_PDU(emip); - /* Read the command header */ - EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &hdr, B_FALSE); - if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_RESPONSE) == 0) { + /* Check if a response is available */ + if (siena_mcdi_poll_response(enp) == B_FALSE) { EFSYS_UNLOCK(enp->en_eslp, state); return (B_FALSE); } + /* Read the response header */ + EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &hdr, B_FALSE); + /* Request complete */ emip->emi_pending_req = NULL; seq = (emip->emi_seq - 1) & EFX_MASK32(MCDI_HEADER_SEQ); From owner-svn-src-all@freebsd.org Mon Dec 7 09:33:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC10F9A076B for ; Mon, 7 Dec 2015 09:33:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk0-x230.google.com (mail-qk0-x230.google.com [IPv6:2607:f8b0:400d:c09::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EDE11F43 for ; Mon, 7 Dec 2015 09:33:45 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qkcb135 with SMTP id b135so20406956qkc.3 for ; Mon, 07 Dec 2015 01:33:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=QHOWuZtvSk6MI9KUueRQhGie1KEnVuLNpN11R+FTpZk=; b=O8mIcMxMpZ7vo0AfxywHjGdzeijSbITWpxI+IjXy6PGraJD5uDqru/VlAqspy+GS1q V1XQtDFA2ImSU5Szc/pZTlZ6vsYYW+KWE2f45pOLpMbGh8vgLNJ+9C44hd9GyrnzF7/Z Af97cYUBFEi2dpKy6ZO6SkpVsG0s0nuz3yvekRRuMoABni+hjdRa75ryZrmiP5WUzI1K kkicQlf282R/SSbXeGycsRAVgSyF1D0TDuXKsHNJVUlZE3CiopeZRrpy/JHmEhrlkzKi mCgtTQA/BCwJoKrv8ORcSJFtbcrQwPxdhiQJUJJuxU+X2dDTYYCDrAV2ftjfR8Na76oS 6Jqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=QHOWuZtvSk6MI9KUueRQhGie1KEnVuLNpN11R+FTpZk=; b=U4390tVXEdApwbAF3GCZm/Qq+09FwtEaoRopTJrOyTJX6n4QFLbc4IIMr3xulHOYiK eYl3XB2NYAipwtX8Oe9CcLqS6ZYGMrqwcK2Ok3ZIYiOhO0qD8nrCiMkV3dJjx34RkY9f Rud+pdAH6rR6IdHzaR0IoHO5CsyPrRl/8ZCjgJpg6cLA1HppA2gP7eTXRBeD3AlbiQ9/ Mfax6SEpjw2eAzHMAroFVTT7700CZA3kv/XT22faL9+0JpfD1zg0lVnrkjtZlbQoixCb 26kHU+87FrnjEzIa5CfXP13XvCrW0WQGUNX8HE65wwHXS5QfLO62vazJzinhT191NO12 YPmA== X-Gm-Message-State: ALoCoQnlJ5NIg0rxKrZtx7uDwGKjGL8e8bnJm1f7wR0ya3m/veVgpldRBzzKA3m5lDXidat64IXj MIME-Version: 1.0 X-Received: by 10.55.40.153 with SMTP id o25mr22016046qko.93.1449480824299; Mon, 07 Dec 2015 01:33:44 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 7 Dec 2015 01:33:44 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201512070402.tB742KKZ081909@repo.freebsd.org> Date: Mon, 7 Dec 2015 02:33:44 -0700 X-Google-Sender-Auth: cbivUW5i5IcZW91ROyaLuGp7V5g Message-ID: Subject: Re: svn commit: r291912 - head/tools/tools/nanobsd From: Warner Losh To: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Cc: Warner Losh , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 09:33:45 -0000 On Sun, Dec 6, 2015 at 11:58 PM, Olivier Cochard-Labb=C3=A9 wrote: > On Mon, Dec 7, 2015 at 5:02 AM, Warner Losh wrote: > >> Author: imp >> Date: Mon Dec 7 04:02:19 2015 >> New Revision: 291912 >> URL: https://svnweb.freebsd.org/changeset/base/291912 >> >> Log: >> Default serial connection to 115200. Hardly anybody uses slower these >> days, and those that do can use NANO_BOOT2CFG to change it. >> >> > =E2=80=8BHi Warner, > > =E2=80=8BCool change, > but boot0sio still doesn't support speed greater than 9600, right ? > =E2=80=8B > It was working at 115200 last time I tried it on real hardware. Warner From owner-svn-src-all@freebsd.org Mon Dec 7 09:51:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7DA79A0D68 for ; Mon, 7 Dec 2015 09:51:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qk0-x231.google.com (mail-qk0-x231.google.com [IPv6:2607:f8b0:400d:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57BAC1617 for ; Mon, 7 Dec 2015 09:51:27 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qkdb5 with SMTP id b5so28834283qkd.0 for ; Mon, 07 Dec 2015 01:51:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=V+LT/BTSr7hZ4n6FZY9ZhTt/MIiJhKNlTXGS2RDzXPg=; b=YymwF/BTzxBsLVIHFHb3gFY/V4TeH6XaOWqHXnIGD5sbfSW+Oek91H1gQJHByQ+1kV q82AiE5a6BYGIZjH0FPskX0R2RZ+jZ6dgbBxGGN2/CjS3jVH06KNiA+Hzh+5yplDvBKU jnWNVjEMOImZ8e7Dsay51EPiz+nbvoekuUjenjiR+figoF4eHoQETB8zw/htxmQqcNNH ZWsDtlHhWA1OemuYyLOrdeNzrPtCk43xbUbvsWbYsqzINdcrbTsCygpjt+vallsnId7e fcSXU1T3Uu7/3/LIeptw2l4nRR36tTobEmUx8wPkx/nvRLWxw5dAea4Kd7agtTAmcCTb LeYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=V+LT/BTSr7hZ4n6FZY9ZhTt/MIiJhKNlTXGS2RDzXPg=; b=WV2VmnR7woRqtgDavoVZEH5cfQ7qk0kAXAGMmzwxsCyKLbj6hcFeKnAD/+vvqiA62g A8/uV/SiH0JXaNEa3YAY+X8cubDSBE7JsKM/ENpmgKZ+RGQoe5YjLzzBvagAbf4zPw+z BlvffSUQ7RHLUYhik8CzIrDqv8E49K2AwemMQa6+HyYaCPbJWrgXtVeAZeO0nCYYJwOo FAb0jVVSN4T1HAlTCkn3DcilRbm1uTfWzziiCAHRfNf7FymZaCiVC0gFPgqifuXyvUqj G852YJfZl4LuvvaRPJNGYCG0/lizyJG/TDPVesPmXoV8OxWMhxgWtEhvBMNtLCw2+QPs y/uQ== X-Gm-Message-State: ALoCoQmxTskQFHN9XtMV5PAZjBXT1TuCg+ZAY8oWoIZBb1KTcWfbN1s9ytnGedzGOto+S/F3OWOF MIME-Version: 1.0 X-Received: by 10.55.23.170 with SMTP id 42mr34454988qkx.42.1449481886446; Mon, 07 Dec 2015 01:51:26 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 7 Dec 2015 01:51:26 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201512070402.tB742KKZ081909@repo.freebsd.org> Date: Mon, 7 Dec 2015 02:51:26 -0700 X-Google-Sender-Auth: 8wO510IqGI_hbpFibOy5vzBkkC0 Message-ID: Subject: Re: svn commit: r291912 - head/tools/tools/nanobsd From: Warner Losh To: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Cc: Warner Losh , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 09:51:27 -0000 On Mon, Dec 7, 2015 at 2:33 AM, Warner Losh wrote: > > > On Sun, Dec 6, 2015 at 11:58 PM, Olivier Cochard-Labb=C3=A9 > wrote: > >> On Mon, Dec 7, 2015 at 5:02 AM, Warner Losh wrote: >> >>> Author: imp >>> Date: Mon Dec 7 04:02:19 2015 >>> New Revision: 291912 >>> URL: https://svnweb.freebsd.org/changeset/base/291912 >>> >>> Log: >>> Default serial connection to 115200. Hardly anybody uses slower these >>> days, and those that do can use NANO_BOOT2CFG to change it. >>> >>> >> =E2=80=8BHi Warner, >> >> =E2=80=8BCool change, >> but boot0sio still doesn't support speed greater than 9600, right ? >> =E2=80=8B >> > > It was working at 115200 last time I tried it on real hardware. > But I don't see how, since it uses the BIOS directly :( From owner-svn-src-all@freebsd.org Mon Dec 7 10:24:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A91EA9B978E; Mon, 7 Dec 2015 10:24:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5BD1218AC; Mon, 7 Dec 2015 10:24:39 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7AOcqL094297; Mon, 7 Dec 2015 10:24:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7AOcjr094296; Mon, 7 Dec 2015 10:24:38 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512071024.tB7AOcjr094296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 7 Dec 2015 10:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291929 - head/tools/tools/nanobsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 10:24:39 -0000 Author: imp Date: Mon Dec 7 10:24:38 2015 New Revision: 291929 URL: https://svnweb.freebsd.org/changeset/base/291929 Log: Make sure to quote the arg after -n and -z tests. Modified: head/tools/tools/nanobsd/defaults.sh (contents, props changed) Modified: head/tools/tools/nanobsd/defaults.sh ============================================================================== --- head/tools/tools/nanobsd/defaults.sh Mon Dec 7 07:22:21 2015 (r291928) +++ head/tools/tools/nanobsd/defaults.sh Mon Dec 7 10:24:38 2015 (r291929) @@ -270,7 +270,7 @@ tgt_dir2symlink () ( cd "${NANO_WORLDDIR}" rm -rf "$dir" ln -s "$symlink" "$dir" - if [ -n $NANO_METALOG ]; then + if [ -n "$NANO_METALOG" ]; then echo "./${dir} type=link mode=0777 link=${symlink}" >> ${NANO_METALOG} fi ) @@ -497,7 +497,7 @@ fixup_before_diskimage ( ) ( # impossible to trap, so go ahead remove the size= keyword. For this # narrow use, it doesn't buy us any protection and just gets in the way. # The dedup tool's output must be sorted due to limitations in awk. - if [ -n ${NANO_METALOG} ]; then + if [ -n "${NANO_METALOG}" ]; then pprint 2 "Fixing metalog" cp ${NANO_METALOG} ${NANO_METALOG}.pre (echo "/set uname=${NANO_DEF_UNAME} gname=${NANO_DEF_GNAME}" && @@ -751,7 +751,7 @@ create_diskimage ( ) ( nano_umount ${MNT} # Override the label from the first partition so we # don't confuse glabel with duplicates. - if [ -n ${NANO_LABEL} ]; then + if [ -n "${NANO_LABEL}" ]; then tunefs -L ${NANO_LABEL}"${NANO_SLICE_ALTROOT}a" /dev/${MD}${NANO_SLICE_ALTROOT}a fi fi @@ -760,12 +760,12 @@ create_diskimage ( ) ( populate_cfg_slice /dev/${MD}${NANO_SLICE_CFG} "${NANO_CFGDIR}" ${MNT} "${NANO_SLICE_CFG}" # Create Data slice, if any. - if [ -n $NANO_SLICE_DATA -a $NANO_SLICE_CFG = $NANO_SLICE_DATA -a \ - $NANO_DATASIZE -ne 0 ]; then + if [ -n "$NANO_SLICE_DATA" -a "$NANO_SLICE_CFG" = "$NANO_SLICE_DATA" -a \ + "$NANO_DATASIZE" -ne 0 ]; then pprint 2 "NANO_SLICE_DATA is the same as NANO_SLICE_CFG, fix." exit 2 fi - if [ $NANO_DATASIZE -ne 0 -a -n $NANO_SLICE_DATA ] ; then + if [ $NANO_DATASIZE -ne 0 -a -n "$NANO_SLICE_DATA" ] ; then populate_data_slice /dev/${MD}${NANO_SLICE_DATA} "${NANO_DATADIR}" ${MNT} "${NANO_SLICE_DATA}" fi From owner-svn-src-all@freebsd.org Mon Dec 7 10:24:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4219C9B97AF; Mon, 7 Dec 2015 10:24:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C15D18E1; Mon, 7 Dec 2015 10:24:42 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7AOgdE094354; Mon, 7 Dec 2015 10:24:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7AOe11094340; Mon, 7 Dec 2015 10:24:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512071024.tB7AOe11094340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 7 Dec 2015 10:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291930 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 10:24:43 -0000 Author: imp Date: Mon Dec 7 10:24:40 2015 New Revision: 291930 URL: https://svnweb.freebsd.org/changeset/base/291930 Log: Start to split apart the different image formats that we need to make. Add support for generating powerpc64 qemu images. We can generate them, but there's something wrong booting them. This also simplifies the user config files a bit, and removes bits no longer true. Modified: head/tools/tools/nanobsd/embedded/beaglebone.cfg head/tools/tools/nanobsd/embedded/common head/tools/tools/nanobsd/embedded/qemu-amd64.cfg head/tools/tools/nanobsd/embedded/qemu-i386.cfg head/tools/tools/nanobsd/embedded/qemu-mips.cfg head/tools/tools/nanobsd/embedded/qemu-mips64.cfg head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg head/tools/tools/nanobsd/embedded/rpi.cfg head/tools/tools/nanobsd/embedded/rpi2.cfg head/tools/tools/nanobsd/embedded/sam9260ek.cfg head/tools/tools/nanobsd/embedded/sam9g20ek.cfg Modified: head/tools/tools/nanobsd/embedded/beaglebone.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/beaglebone.cfg Mon Dec 7 10:24:38 2015 (r291929) +++ head/tools/tools/nanobsd/embedded/beaglebone.cfg Mon Dec 7 10:24:40 2015 (r291930) @@ -25,12 +25,6 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# This file is heavily derived from both Sam Leffler's Avilia config, -# as well as the BSDRP project's config file. Neither of these have -# an explicit copyright/license statement, but are implicitly BSDL. This -# example has been taken from the FreeNAS project and simplified to meet -# the needs of the example. -# NANO_ARCH=armv6 NANO_KERNEL=BEAGLEBONE Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Mon Dec 7 10:24:38 2015 (r291929) +++ head/tools/tools/nanobsd/embedded/common Mon Dec 7 10:24:40 2015 (r291930) @@ -73,26 +73,6 @@ if [ -z $NANO_NAME ]; then echo "NANO_NAME not defined. Use foo.cfg instead." fi -# Slice 1: FAT for ROM loading bootstrap -# Slice 2: Config partition -# Slice 3: FreeBSD partition (sized exactly) -# Slice 4: FreeBSD partition (empty) -# on first boot, we resize slice 3 & 4 to be 1/2 of what's -# left over on the SD card after slice 1 and 2 are taken -# off the top. We also resize the 'a' partion on first boot -# to the size of the partition for the ping/pong upgrade. -if [ -z "$EMBED_OMIT_FAT" ]; then - NANO_SLICE_FAT=s1 - NANO_SLICE_CFG=s2 - NANO_SLICE_ROOT=s3 - NANO_SLICE_ALTROOT=s4 -else - NANO_SLICE_CFG=s1 - NANO_SLICE_ROOT=s2 - NANO_SLICE_ALTROOT=s3 -fi -NANO_SLICE_DATA= # Not included - NANO_SLICE_FAT_SIZE=32m NANO_SLICE_CFG_SIZE=32m @@ -296,71 +276,93 @@ add_port () { fi } -create_diskimage ( ) ( - local extra +# Creates images for all the formats that use MBR +create_diskimage_mbr ( ) ( pprint 2 "build diskimage ${NANO_NAME}" pprint 3 "log: ${NANO_OBJ}/_.di" ( + local extra i sz fmt fmtarg bootmbr bootbsd skiparg set -o xtrace - if [ -n ${NANO_NOPRIV_BUILD} ]; then - extra="-F ${NANO_METALOG}" - fi + + [ -z ${NANO_DISKIMAGE_FORMAT} ] || fmtarg="-f ${NANO_DISKIMAGE_FORMAT}" + [ -z ${NANO_DISKIMAGE_FORMAT} ] || fmt=".${NANO_DISKIMAGE_FORMAT}" + bootmbr=${NANO_BOOT_MBR:+-b ${NANO_BOOT_MBR}} + bootbsd=${NANO_BOOT_BSD:+-b ${NANO_BOOT_BSD}} + skiparg=${NANO_MBR_FIRST_SKIP:+-S ${NANO_MBR_FIRST_SKIP}} for i in s1 s2 s3 s4 empty; do rm -fr ${NANO_OBJ}/_.${i}* done - if [ ! -z "${NANO_SLICE_FAT}" ]; then + # Populate the FAT partition + if [-n "${NANO_SLICE_FAT}" ]; then echo Creating MSDOS partition for kernel - newfs_msdos -C ${NANO_SLICE_FAT_SIZE:-32m} -F 16 -L ${NANO_NAME} \ + newfs_msdos -C ${NANO_SLICE_FAT_SIZE} -F 16 -L ${NANO_NAME} \ ${NANO_OBJ}/_.${NANO_SLICE_FAT} + # Need to copy files from ${NANO_FATDIR} with mtools, or use + # makefs -t msdos once that's supported fi - echo Creating main partition + + # Populate the / partition, and place it into a slice with a + # bsd label + [ -z ${NANO_NOPRIV_BUILD} ] || extra="-F ${NANO_METALOG}" sz=${NANO_SLICE_ROOT_SIZE:+-s ${NANO_SLICE_ROOT_SIZE}} - makefs ${extra} -B little $sz -t ffs ${NANO_OBJ}/_.${NANO_SLICE_ROOT}a \ + eval "${NANO_MAKEFS_UFS}" ${extra} $sz "${NANO_OBJ}/_.${NANO_SLICE_ROOT}a" \ "${NANO_WORLDDIR}" + mkimg -s bsd ${bootbsd} -p freebsd-ufs:=${NANO_OBJ}/_.${NANO_SLICE_ROOT}a \ + -o ${NANO_OBJ}/_.${NANO_SLICE_ROOT} + + # Populate the /cfg partition, empty if none given if [ -z "${NANO_CFGDIR}" ]; then echo "Faking cfg dir, it's empty" NANO_CFGDIR=${NANO_OBJ}/_.empty mkdir ${NANO_CFGDIR} fi - echo Creating cfg parittion -# XXX -F cfg-mtree + # XXX -F cfg-mtree + eval "${NANO_MAKEFS_UFS}" -s ${NANO_SLICE_CFG_SIZE} \ + "${NANO_OBJ}/_.${NANO_SLICE_CFG}" "${NANO_CFGDIR}" - makefs -B little -t ffs -s ${NANO_SLICE_CFG_SIZE:-100m} \ - ${NANO_OBJ}/_.${NANO_SLICE_CFG} "${NANO_CFGDIR}" # data slice not supported since we need the part for FAT for # booting - echo Slicing up the main partition into a full bsd part - bootbsd="-b ${NANO_WORLDDIR}/boot/boot" - mkimg ${bootbsd} -s bsd -p freebsd-ufs:=${NANO_OBJ}/_.${NANO_SLICE_ROOT}a \ - -o ${NANO_OBJ}/_.${NANO_SLICE_ROOT} - echo Making the whole shooting match - if [ ! -z $NANO_SLICE_FAT ]; then + + # Now shuffle all the slices together into the proper layout + if [ -n "$NANO_SLICE_FAT" ]; then eval $NANO_SLICE_FAT=fat16b fi eval $NANO_SLICE_CFG=freebsd eval $NANO_SLICE_ROOT=freebsd - [ -z ${NANO_DISKIMAGE_FORMAT} ] || fmtarg="-f ${NANO_DISKIMAGE_FORMAT}" - [ -z ${NANO_DISKIMAGE_FORMAT} ] || fmt=".${NANO_DISKIMAGE_FORMAT}" - bootmbr="-b ${NANO_WORLDDIR}/boot/boot0sio" # below depends on https://reviews.freebsd.org/D4403 not yet in the tree # but there's problems: it marks all partitions as active, so you have to # boot off parittion 3 or 2 by hand if you're playing around with this WIP - if [ ! -z "${NANO_SLICE_FAT}" ]; then - mkimg -a 3 ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \ + case ${NANO_LAYOUT} in + std-embedded) + mkimg -a 3 ${skiparg} ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \ -p ${s2}:=${NANO_OBJ}/_.s2 \ -p ${s3}:=${NANO_OBJ}/_.s3 \ -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} - else + ;; + std-x86) # s1 is cfg, s2 is /, not sure how to make that # boot (marked as active) with mkimg yet mkimg -a 2 ${fmtarg} ${bootmbr} -s mbr -p ${s1}:=${NANO_OBJ}/_.s1 \ -p ${s2}:=${NANO_OBJ}/_.s2 \ -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} - fi + ;; + powerpc64-ibm) + # A lie to make the boot loader work, it boots the first BSD partition + # it finds, regardless of the active flag. + s2=fat16b + # boot image is on a special partition, ala std-embedded, but that + # partition isn't FAT with special files, but a copy of the boot + # loader itself. + mkimg ${fmtarg} -s mbr -p ppcboot:=${NANO_WORLDDIR}/boot/boot1.elf \ + -p ${s2}:=${NANO_OBJ}/_.s2 \ + -p ${s3}:=${NANO_OBJ}/_.s3 \ + -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} + ;; + esac ) > ${NANO_OBJ}/_.di 2>&1 ) @@ -372,7 +374,9 @@ die() # Automatically include the packaging port here so it is always first so it # builds the port and adds the package so we can add other packages. -#XXX Not sure this works for cross build, so punting for the moment +#XXX Doesn't work for cross build, so punting until I can integreate qemu-static +#XXX or poudere, both of which require priv'd execution. Or qemu-system, which +#XXX is super, super slow. #add_port ports-mgmt/pkg #add_port security/sudo #add_port ftp/curl @@ -384,8 +388,6 @@ if [ -n "$__a" ]; then umount $__a fi -NANO_BOOTLOADER="boot/boot0" - if [ "$DEBUG" = 1 ]; then DEBUG_BUILD=" DEBUG_FLAGS= -g @@ -422,15 +424,6 @@ $var=$val" fi done -hack_nsswitch_conf ( ) -{ - # Remove all references to NIS in the nsswitch.conf file - # Not sure this is still needed, but FreeNAS has it... - sed -i.bak -es/nis/files/g ${NANO_WORLDDIR}/etc/nsswitch.conf - rm -f ${NANO_WORLDDIR}/etc/nsswitch.conf.bak -} -customize_cmd hack_nsswitch_conf - save_build ( ) { VERSION_FILE=${NANO_WORLDDIR}/etc/version @@ -442,12 +435,6 @@ save_build ( ) } customize_cmd save_build -remove_patch_divots ( ) -{ - find ${NANO_WORLDDIR} -name \*.orig -or -name \*.rej -delete -} -customize_cmd remove_patch_divots - shrink_md_fbsize() { # We have a lot of little files on our memory disks. Let's decrease @@ -477,3 +464,130 @@ product_custom() fi } late_customize_cmd product_custom + +# +# Convenience routines to bring up many settings for standard environments +# + +# +# For each architecture, we have a standard set of settings to the extent +# it makes sense. For architectures that don't have a standard environment +# cfg files need to either define a lot of settings, provide their own disk +# imaging, or set which of the variants we support. +# + +std_aarch64 ( ) { +} + +std_amd64 ( ) { + std_i386 +} + +std_arm ( ) { +} + +std_armeb ( ) { + NANO_ENDIAN=big +} + +std_armv6 ( ) { +} + +std_i386 ( ) { + # Default values, if not overridden in .cfg file + : ${NANO_KERNEL:=GENERIC} + : ${NANO_DRIVE:=ada0} + : ${NANO_LAYOUT:=std-x86} + : ${NANO_BOOT_MBR:=${NANO_WORLDDIR}/boot/boot0sio} + : ${NANO_BOOT_BSD:=${NANO_WORLDDIR}/boot/boot} +} + +std_mips ( ) { + NANO_ENDIAN=big +} + +std_mipsel ( ) { +} + +std_mips64 ( ) { + NANO_ENDIAN=big +} + +std_mips64el ( ) { +} + +std_powerpc ( ) { + NANO_ENDIAN=big +} + +std_powerpc64 ( ) { + NANO_LAYOUT=powerpc64-ibm + NANO_ENDIAN=big +} + +std_sparc64 ( ) { + NANO_ENDIAN=big +} + +# +# QEMU settings for the standard environments +# +qemu_env ( ) { + + NANO_DISKIMAGE_FORMAT=qcow2 +} + +# other standard environments will go here + +eval std_${NANO_ARCH} + +# Slice 1: FAT for ROM loading bootstrap +# Slice 2: Config partition +# Slice 3: FreeBSD partition (sized exactly) +# Slice 4: FreeBSD partition (empty) +# on first boot, we resize slice 3 & 4 to be 1/2 of what's +# left over on the SD card after slice 1 and 2 are taken +# off the top. We also resize the 'a' partion on first boot +# to the size of the partition for the ping/pong upgrade. +# This feature needs support in the rc.d bootup script. + +: ${NANO_ENDIAN:=little} # make -V something to figure it out? +: ${NANO_LAYOUT:=std-embedded} +: ${NANO_MAKEFS_UFS:=makefs -t ffs -B ${NANO_ENDIAN}} +: ${NANO_DISK_SCHEME:=mbr} # No others really supported ATM +case ${NANO_LAYOUT} in +std-embedded) + NANO_SLICE_FAT=s1 + NANO_SLICE_CFG=s2 + NANO_SLICE_ROOT=s3 + NANO_SLICE_ALTROOT=s4 + ;; +std-x86) + NANO_SLICE_CFG=s1 + NANO_SLICE_ROOT=s2 + NANO_SLICE_ALTROOT=s3 + ;; +powerpc64-ibm) + NANO_SLICE_PPCBOOT=s1 + NANO_SLICE_CFG=s2 + NANO_SLICE_ROOT=s3 + NANO_SLICE_ALTROOT=s4 + ;; +powerpc64-apple) + echo Not yet + exit 1 + ;; +*) + echo Unknown Layout ${NANO_LAYOUT} + exit 1 + ;; +esac + +NANO_SLICE_DATA= # Not included + +# Each major disk scheme has its own routine. Generally +# this is for mbr, gpt, etc. These are generally are widely +# shared, but some specialized formats won't be shared. +create_diskimage ( ) ( + eval create_diskimage_${NANO_DISK_SCHEME} +) Modified: head/tools/tools/nanobsd/embedded/qemu-amd64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-amd64.cfg Mon Dec 7 10:24:38 2015 (r291929) +++ head/tools/tools/nanobsd/embedded/qemu-amd64.cfg Mon Dec 7 10:24:40 2015 (r291930) @@ -25,19 +25,10 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# This file is heavily derived from both Sam Leffler's Avilia config, -# as well as the BSDRP project's config file. Neither of these have -# an explicit copyright/license statement, but are implicitly BSDL. This -# example has been taken from the FreeNAS project and simplified to meet -# the needs of the example. -# NANO_ARCH=amd64 -NANO_KERNEL=GENERIC -NANO_DRIVE=ada0 NANO_NAME=qemu-amd64 -NANO_DISKIMAGE_FORMAT=qcow2 -export EMBED_OMIT_FAT=t +qemu_env . common # Pull in common definitions, keep last Modified: head/tools/tools/nanobsd/embedded/qemu-i386.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-i386.cfg Mon Dec 7 10:24:38 2015 (r291929) +++ head/tools/tools/nanobsd/embedded/qemu-i386.cfg Mon Dec 7 10:24:40 2015 (r291930) @@ -25,19 +25,10 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# This file is heavily derived from both Sam Leffler's Avilia config, -# as well as the BSDRP project's config file. Neither of these have -# an explicit copyright/license statement, but are implicitly BSDL. This -# example has been taken from the FreeNAS project and simplified to meet -# the needs of the example. -# NANO_ARCH=i386 -NANO_KERNEL=GENERIC -NANO_DRIVE=ada0 NANO_NAME=qemu-i386 -NANO_DISKIMAGE_FORMAT=qcow2 -export EMBED_OMIT_FAT=t +qemu_env . common # Pull in common definitions, keep last Modified: head/tools/tools/nanobsd/embedded/qemu-mips.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-mips.cfg Mon Dec 7 10:24:38 2015 (r291929) +++ head/tools/tools/nanobsd/embedded/qemu-mips.cfg Mon Dec 7 10:24:40 2015 (r291930) @@ -25,19 +25,12 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# This file is heavily derived from both Sam Leffler's Avilia config, -# as well as the BSDRP project's config file. Neither of these have -# an explicit copyright/license statement, but are implicitly BSDL. This -# example has been taken from the FreeNAS project and simplified to meet -# the needs of the example. -# NANO_ARCH=mips NANO_KERNEL=MALTA NANO_DRIVE=ada0 NANO_NAME=qemu-mips -NANO_DISKIMAGE_FORMAT=qcow2 -export EMBED_OMIT_FAT=t +qemu_env . common # Pull in common definitions, keep last Modified: head/tools/tools/nanobsd/embedded/qemu-mips64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-mips64.cfg Mon Dec 7 10:24:38 2015 (r291929) +++ head/tools/tools/nanobsd/embedded/qemu-mips64.cfg Mon Dec 7 10:24:40 2015 (r291930) @@ -25,19 +25,12 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# This file is heavily derived from both Sam Leffler's Avilia config, -# as well as the BSDRP project's config file. Neither of these have -# an explicit copyright/license statement, but are implicitly BSDL. This -# example has been taken from the FreeNAS project and simplified to meet -# the needs of the example. -# NANO_ARCH=mips NANO_KERNEL=MALTA64 NANO_DRIVE=ada0 NANO_NAME=qemu-mips64 -NANO_DISKIMAGE_FORMAT=qcow2 -export EMBED_OMIT_FAT=t +qemu_env . common # Pull in common definitions, keep last Modified: head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg Mon Dec 7 10:24:38 2015 (r291929) +++ head/tools/tools/nanobsd/embedded/qemu-powerpc.cfg Mon Dec 7 10:24:40 2015 (r291930) @@ -25,12 +25,6 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# This file is heavily derived from both Sam Leffler's Avilia config, -# as well as the BSDRP project's config file. Neither of these have -# an explicit copyright/license statement, but are implicitly BSDL. This -# example has been taken from the FreeNAS project and simplified to meet -# the needs of the example. -# # Open question: do we have one for MAC G4 and one for Book-E? NANO_ARCH=powerpc @@ -38,7 +32,6 @@ NANO_KERNEL=GENERIC NANO_DRIVE=ada0 NANO_NAME=qemu-powerpc -NANO_DISKIMAGE_FORMAT=qcow2 -export EMBED_OMIT_FAT=t +qemu_env . common # Pull in common definitions, keep last Modified: head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg Mon Dec 7 10:24:38 2015 (r291929) +++ head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg Mon Dec 7 10:24:40 2015 (r291930) @@ -25,19 +25,12 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# This file is heavily derived from both Sam Leffler's Avilia config, -# as well as the BSDRP project's config file. Neither of these have -# an explicit copyright/license statement, but are implicitly BSDL. This -# example has been taken from the FreeNAS project and simplified to meet -# the needs of the example. -# NANO_ARCH=powerpc64 NANO_KERNEL=GENERIC64 NANO_DRIVE=ada0 NANO_NAME=qemu-powerpc64 -NANO_DISKIMAGE_FORMAT=qcow2 -export EMBED_OMIT_FAT=t +qemu_env . common # Pull in common definitions, keep last Modified: head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg Mon Dec 7 10:24:38 2015 (r291929) +++ head/tools/tools/nanobsd/embedded/qemu-sparc64.cfg Mon Dec 7 10:24:40 2015 (r291930) @@ -25,19 +25,12 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# This file is heavily derived from both Sam Leffler's Avilia config, -# as well as the BSDRP project's config file. Neither of these have -# an explicit copyright/license statement, but are implicitly BSDL. This -# example has been taken from the FreeNAS project and simplified to meet -# the needs of the example. -# NANO_ARCH=sparc64 NANO_KERNEL=GENERIC NANO_DRIVE=ada0 NANO_NAME=qemu-sparc64 -NANO_DISKIMAGE_FORMAT=qcow2 -export EMBED_OMIT_FAT=t +qemu_env . common # Pull in common definitions, keep last Modified: head/tools/tools/nanobsd/embedded/rpi.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/rpi.cfg Mon Dec 7 10:24:38 2015 (r291929) +++ head/tools/tools/nanobsd/embedded/rpi.cfg Mon Dec 7 10:24:40 2015 (r291930) @@ -25,12 +25,6 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# This file is heavily derived from both Sam Leffler's Avilia config, -# as well as the BSDRP project's config file. Neither of these have -# an explicit copyright/license statement, but are implicitly BSDL. This -# example has been taken from the FreeNAS project and simplified to meet -# the needs of the example. -# NANO_ARCH=armv6 NANO_KERNEL=RPI-B Modified: head/tools/tools/nanobsd/embedded/rpi2.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/rpi2.cfg Mon Dec 7 10:24:38 2015 (r291929) +++ head/tools/tools/nanobsd/embedded/rpi2.cfg Mon Dec 7 10:24:40 2015 (r291930) @@ -25,12 +25,6 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# This file is heavily derived from both Sam Leffler's Avilia config, -# as well as the BSDRP project's config file. Neither of these have -# an explicit copyright/license statement, but are implicitly BSDL. This -# example has been taken from the FreeNAS project and simplified to meet -# the needs of the example. -# NANO_ARCH=armv6 NANO_KERNEL=RPI2 Modified: head/tools/tools/nanobsd/embedded/sam9260ek.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/sam9260ek.cfg Mon Dec 7 10:24:38 2015 (r291929) +++ head/tools/tools/nanobsd/embedded/sam9260ek.cfg Mon Dec 7 10:24:40 2015 (r291930) @@ -25,12 +25,6 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# This file is heavily derived from both Sam Leffler's Avilia config, -# as well as the BSDRP project's config file. Neither of these have -# an explicit copyright/license statement, but are implicitly BSDL. This -# example has been taken from the FreeNAS project and simplified to meet -# the needs of the example. -# NANO_ARCH=arm NANO_KERNEL=SAM9260EK Modified: head/tools/tools/nanobsd/embedded/sam9g20ek.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/sam9g20ek.cfg Mon Dec 7 10:24:38 2015 (r291929) +++ head/tools/tools/nanobsd/embedded/sam9g20ek.cfg Mon Dec 7 10:24:40 2015 (r291930) @@ -25,12 +25,6 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # -# This file is heavily derived from both Sam Leffler's Avilia config, -# as well as the BSDRP project's config file. Neither of these have -# an explicit copyright/license statement, but are implicitly BSDL. This -# example has been taken from the FreeNAS project and simplified to meet -# the needs of the example. -# NANO_ARCH=arm NANO_KERNEL=SAM9G20EK From owner-svn-src-all@freebsd.org Mon Dec 7 10:26:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B97759B9835 for ; Mon, 7 Dec 2015 10:26:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qg0-x22d.google.com (mail-qg0-x22d.google.com [IPv6:2607:f8b0:400d:c04::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 716251BE7 for ; Mon, 7 Dec 2015 10:26:07 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by qgec40 with SMTP id c40so139404267qge.2 for ; Mon, 07 Dec 2015 02:26:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=KvLrpK246oZb9yAoTGPbjF0VJCR5DFUDJGjkUcjzlik=; b=E2PJV0+1Dkgd01N51wxSWP1/LbD6DjxBAz84XToDu6ENuBb+WiY3g1T0mDImocdPT/ gFt4NEcTY0C+9lZlhdfhpe8IrNx4owmUNJQ4ie9OydqM4LwGfzNYAAzOqkI03Nb6fr0/ HVfk9dnmaF4SYPpeU1V5Ys0RnXAIzU9fN+IaxVJ5QDuhL98u/TnojT7soJO5i4e6OO4b 4Pe32zREDpJW56OMBEx+tNiI6KTn14NqINf+6nZAqlstR+E0Lqbsp/Le33g2ClEaAR/M JMcCPSYoWUhtxG5IT4nurSPJRap69Hkjy/7RcsTqevzZyQSNSr9PQT/d0u2a3WhaIjjr Zylg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=KvLrpK246oZb9yAoTGPbjF0VJCR5DFUDJGjkUcjzlik=; b=muPEkCqdOjIF4WvIaRancWkRDrHl8hPvU/Y2BqG2Be1iREYnXEQ8Zx4UYc6BBtCT0i OahA2i18KRYtsLngSSuqc6WI1ZR87NizGqPrPwOj6vQOBuO+8CNFZAq4/2kDI9/dpHft DPLsoEon7nyKOkVr6L7uFe9MwRj7E65WroPoKahq01Ydl9EzkhYFdOIiIqWUQW+mGWbh 2Sl+7J4b19M7VLLe0498vuf5MLaf6vNwcnLJBmqao807hCGL59dVnw9Impdw6PZX68c9 FjEKvhTI8GktdTOROiiC1tomacWxe7cfXilMgfu1pvx8OUyZHysJv7+yHf/J5aXk2MEL JSYA== X-Gm-Message-State: ALoCoQn+MtJl+CZ7IjYGG6MIrpBUPQnY3pQ1YG3UNB00rO2PY6ZrmfQeagnB19bQEx7IevXilMot MIME-Version: 1.0 X-Received: by 10.140.250.70 with SMTP id v67mr38065402qhc.43.1449483966621; Mon, 07 Dec 2015 02:26:06 -0800 (PST) Sender: wlosh@bsdimp.com Received: by 10.140.27.181 with HTTP; Mon, 7 Dec 2015 02:26:06 -0800 (PST) X-Originating-IP: [50.253.99.174] In-Reply-To: References: <201512070402.tB742KKZ081909@repo.freebsd.org> Date: Mon, 7 Dec 2015 03:26:06 -0700 X-Google-Sender-Auth: dJO4WLEMc6D5IFypBCmKiRMssk8 Message-ID: Subject: Re: svn commit: r291912 - head/tools/tools/nanobsd From: Warner Losh To: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Cc: Warner Losh , src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 10:26:07 -0000 On Mon, Dec 7, 2015 at 2:51 AM, Warner Losh wrote: > > On Mon, Dec 7, 2015 at 2:33 AM, Warner Losh wrote: > >> >> >> On Sun, Dec 6, 2015 at 11:58 PM, Olivier Cochard-Labb=C3=A9 < >> olivier@cochard.me> wrote: >> >>> On Mon, Dec 7, 2015 at 5:02 AM, Warner Losh wrote: >>> >>>> Author: imp >>>> Date: Mon Dec 7 04:02:19 2015 >>>> New Revision: 291912 >>>> URL: https://svnweb.freebsd.org/changeset/base/291912 >>>> >>>> Log: >>>> Default serial connection to 115200. Hardly anybody uses slower thes= e >>>> days, and those that do can use NANO_BOOT2CFG to change it. >>>> >>>> >>> =E2=80=8BHi Warner, >>> >>> =E2=80=8BCool change, >>> but boot0sio still doesn't support speed greater than 9600, right ? >>> =E2=80=8B >>> >> >> It was working at 115200 last time I tried it on real hardware. >> > > But I don't see how, since it uses the BIOS directly :( > Ah, I was using COMSPEED=3D0 which doesn't touch the speed setting... Warner From owner-svn-src-all@freebsd.org Mon Dec 7 10:57:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BC879B9F28; Mon, 7 Dec 2015 10:57:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A2381999; Mon, 7 Dec 2015 10:57:43 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7Avgtv003549; Mon, 7 Dec 2015 10:57:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7AvgkK003548; Mon, 7 Dec 2015 10:57:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512071057.tB7AvgkK003548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Dec 2015 10:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291931 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 10:57:43 -0000 Author: hselasky Date: Mon Dec 7 10:57:42 2015 New Revision: 291931 URL: https://svnweb.freebsd.org/changeset/base/291931 Log: The firmware no longer supports setting a port MTU of zero bytes. Set the port MTU and then query it and report if any problems instead. MFC after: 1 week Submitted by: Shahar Klein Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4408 Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 7 10:24:40 2015 (r291930) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 7 10:57:42 2015 (r291931) @@ -2005,32 +2005,15 @@ mlx5e_set_dev_port_mtu(struct ifnet *ifp struct mlx5e_priv *priv = ifp->if_softc; struct mlx5_core_dev *mdev = priv->mdev; int hw_mtu; - int min_mtu; int err; - /* - * Trying to set MTU to zero, in order - * to find out the FW's minimal MTU - */ - err = mlx5_set_port_mtu(mdev, 0); - if (err) - return (err); - err = mlx5_query_port_oper_mtu(mdev, &min_mtu); + err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(sw_mtu)); if (err) { - if_printf(ifp, "Query port minimal MTU failed\n"); + if_printf(ifp, "%s: mlx5_set_port_mtu failed setting %d, err=%d\n", + __func__, sw_mtu, err); return (err); } - - if (sw_mtu < MLX5E_HW2SW_MTU(min_mtu)) { - ifp->if_mtu = sw_mtu; - return (0); - } - - err = mlx5_set_port_mtu(mdev, MLX5E_SW2HW_MTU(sw_mtu)); - if (err) - return (err); - err = mlx5_query_port_oper_mtu(mdev, &hw_mtu); if (!err) { ifp->if_mtu = MLX5E_HW2SW_MTU(hw_mtu); From owner-svn-src-all@freebsd.org Mon Dec 7 11:04:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 553589B91BD; Mon, 7 Dec 2015 11:04:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E0681EB8; Mon, 7 Dec 2015 11:04:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7B4prs006262; Mon, 7 Dec 2015 11:04:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7B4pZm006259; Mon, 7 Dec 2015 11:04:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512071104.tB7B4pZm006259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Dec 2015 11:04:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291932 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 11:04:52 -0000 Author: hselasky Date: Mon Dec 7 11:04:50 2015 New Revision: 291932 URL: https://svnweb.freebsd.org/changeset/base/291932 Log: Add support for setting the TX moderation mode via a sysctl entry. TX completion events can be moderated in the same way like RX completion events. Expose this functionality by a sysctl variable. MFC after: 1 week Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4409 Modified: head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Mon Dec 7 10:57:42 2015 (r291931) +++ head/sys/dev/mlx5/mlx5_en/en.h Mon Dec 7 11:04:50 2015 (r291932) @@ -356,6 +356,7 @@ struct mlx5e_params { u8 default_vlan_prio; u8 num_tc; u8 rx_cq_moderation_mode; + u8 tx_cq_moderation_mode; u16 rx_cq_moderation_usec; u16 rx_cq_moderation_pkts; u16 tx_cq_moderation_usec; @@ -381,6 +382,7 @@ struct mlx5e_params { m(+1, u64 rx_coalesce_mode, "rx_coalesce_mode", "0: EQE mode 1: CQE mode") \ m(+1, u64 tx_coalesce_usecs, "tx_coalesce_usecs", "Limit in usec for joining tx packets") \ m(+1, u64 tx_coalesce_pkts, "tx_coalesce_pkts", "Maximum number of tx packets to join") \ + m(+1, u64 tx_coalesce_mode, "tx_coalesce_mode", "0: EQE mode 1: CQE mode") \ m(+1, u64 hw_lro, "hw_lro", "set to enable hw_lro") #define MLX5E_PARAMS_NUM (0 MLX5E_PARAMS(MLX5E_STATS_COUNT)) Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Dec 7 10:57:42 2015 (r291931) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon Dec 7 11:04:50 2015 (r291932) @@ -136,6 +136,11 @@ mlx5e_ethtool_handler(SYSCTL_HANDLER_ARG priv->params_ethtool.rx_coalesce_mode = 1; priv->params.rx_cq_moderation_mode = priv->params_ethtool.rx_coalesce_mode; + /* import TX mode */ + if (priv->params_ethtool.tx_coalesce_mode != 0) + priv->params_ethtool.tx_coalesce_mode = 1; + priv->params.tx_cq_moderation_mode = priv->params_ethtool.tx_coalesce_mode; + /* import RX coal time */ if (priv->params_ethtool.rx_coalesce_usecs < 1) priv->params_ethtool.rx_coalesce_usecs = 0; @@ -460,6 +465,7 @@ mlx5e_create_ethtool(struct mlx5e_priv * priv->params_ethtool.rx_coalesce_mode = priv->params.rx_cq_moderation_mode; priv->params_ethtool.rx_coalesce_usecs = priv->params.rx_cq_moderation_usec; priv->params_ethtool.rx_coalesce_pkts = priv->params.rx_cq_moderation_pkts; + priv->params_ethtool.tx_coalesce_mode = priv->params.tx_cq_moderation_mode; priv->params_ethtool.tx_coalesce_usecs = priv->params.tx_cq_moderation_usec; priv->params_ethtool.tx_coalesce_pkts = priv->params.tx_cq_moderation_pkts; priv->params_ethtool.hw_lro = priv->params.hw_lro_en; Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 7 10:57:42 2015 (r291931) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 7 11:04:50 2015 (r291932) @@ -1324,13 +1324,25 @@ static int mlx5e_open_tx_cqs(struct mlx5e_channel *c, struct mlx5e_channel_param *cparam) { + u8 tx_moderation_mode; int err; int tc; + switch (c->priv->params.tx_cq_moderation_mode) { + case 0: + tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + default: + if (MLX5_CAP_GEN(c->priv->mdev, cq_period_start_from_cqe)) + tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_CQE; + else + tx_moderation_mode = MLX5_CQ_PERIOD_MODE_START_FROM_EQE; + break; + } for (tc = 0; tc < c->num_tc; tc++) { /* open completion queue */ err = mlx5e_open_cq(c, &cparam->tx_cq, &c->sq[tc].cq, - &mlx5e_tx_cq_comp, MLX5_CQ_PERIOD_MODE_START_FROM_EQE); + &mlx5e_tx_cq_comp, tx_moderation_mode); if (err) goto err_close_tx_cqs; } From owner-svn-src-all@freebsd.org Mon Dec 7 11:12:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBDBB9B95A5; Mon, 7 Dec 2015 11:12:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AB3C11372; Mon, 7 Dec 2015 11:12:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7BC3UY007187; Mon, 7 Dec 2015 11:12:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7BC3VP007185; Mon, 7 Dec 2015 11:12:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512071112.tB7BC3VP007185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Dec 2015 11:12:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291933 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 11:12:05 -0000 Author: kib Date: Mon Dec 7 11:12:03 2015 New Revision: 291933 URL: https://svnweb.freebsd.org/changeset/base/291933 Log: MFC r290915: Do not skip a process which has inhibited thread due to the swap-out, in the OOM selection loop. Modified: stable/10/sys/vm/vm_pageout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_pageout.c ============================================================================== --- stable/10/sys/vm/vm_pageout.c Mon Dec 7 11:04:50 2015 (r291932) +++ stable/10/sys/vm/vm_pageout.c Mon Dec 7 11:12:03 2015 (r291933) @@ -1570,7 +1570,8 @@ vm_pageout_oom(int shortage) if (!TD_ON_RUNQ(td) && !TD_IS_RUNNING(td) && !TD_IS_SLEEPING(td) && - !TD_IS_SUSPENDED(td)) { + !TD_IS_SUSPENDED(td) && + !TD_IS_SWAPPED(td)) { thread_unlock(td); breakout = 1; break; From owner-svn-src-all@freebsd.org Mon Dec 7 11:14:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 597A89B97AF; Mon, 7 Dec 2015 11:14:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34EF6186B; Mon, 7 Dec 2015 11:14:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7BEvIY009353; Mon, 7 Dec 2015 11:14:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7BEvaT009352; Mon, 7 Dec 2015 11:14:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512071114.tB7BEvaT009352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Dec 2015 11:14:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291934 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 11:14:58 -0000 Author: kib Date: Mon Dec 7 11:14:57 2015 New Revision: 291934 URL: https://svnweb.freebsd.org/changeset/base/291934 Log: MFC r290917: Provide the OOM-specific vm_pageout_oom_pagecount() function which estimates the amount of reclamaible memory which could be stolen if the process is killed. Modified: stable/10/sys/vm/vm_pageout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_pageout.c ============================================================================== --- stable/10/sys/vm/vm_pageout.c Mon Dec 7 11:12:03 2015 (r291933) +++ stable/10/sys/vm/vm_pageout.c Mon Dec 7 11:14:57 2015 (r291934) @@ -1526,6 +1526,65 @@ vm_pageout_mightbe_oom(struct vm_domain atomic_subtract_int(&vm_pageout_oom_vote, 1); } +/* + * The OOM killer is the page daemon's action of last resort when + * memory allocation requests have been stalled for a prolonged period + * of time because it cannot reclaim memory. This function computes + * the approximate number of physical pages that could be reclaimed if + * the specified address space is destroyed. + * + * Private, anonymous memory owned by the address space is the + * principal resource that we expect to recover after an OOM kill. + * Since the physical pages mapped by the address space's COW entries + * are typically shared pages, they are unlikely to be released and so + * they are not counted. + * + * To get to the point where the page daemon runs the OOM killer, its + * efforts to write-back vnode-backed pages may have stalled. This + * could be caused by a memory allocation deadlock in the write path + * that might be resolved by an OOM kill. Therefore, physical pages + * belonging to vnode-backed objects are counted, because they might + * be freed without being written out first if the address space holds + * the last reference to an unlinked vnode. + * + * Similarly, physical pages belonging to OBJT_PHYS objects are + * counted because the address space might hold the last reference to + * the object. + */ +static long +vm_pageout_oom_pagecount(struct vmspace *vmspace) +{ + vm_map_t map; + vm_map_entry_t entry; + vm_object_t obj; + long res; + + map = &vmspace->vm_map; + KASSERT(!map->system_map, ("system map")); + sx_assert(&map->lock, SA_LOCKED); + res = 0; + for (entry = map->header.next; entry != &map->header; + entry = entry->next) { + if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) != 0) + continue; + obj = entry->object.vm_object; + if (obj == NULL) + continue; + if ((entry->eflags & MAP_ENTRY_NEEDS_COPY) != 0 && + obj->ref_count != 1) + continue; + switch (obj->type) { + case OBJT_DEFAULT: + case OBJT_SWAP: + case OBJT_PHYS: + case OBJT_VNODE: + res += obj->resident_page_count; + break; + } + } + return (res); +} + void vm_pageout_oom(int shortage) { @@ -1599,12 +1658,13 @@ vm_pageout_oom(int shortage) } PROC_UNLOCK(p); size = vmspace_swap_count(vm); - vm_map_unlock_read(&vm->vm_map); if (shortage == VM_OOM_MEM) - size += vmspace_resident_count(vm); + size += vm_pageout_oom_pagecount(vm); + vm_map_unlock_read(&vm->vm_map); vmspace_free(vm); + /* - * if the this process is bigger than the biggest one + * If this process is bigger than the biggest one, * remember it. */ if (size > bigsize) { From owner-svn-src-all@freebsd.org Mon Dec 7 11:21:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A75A9B9982; Mon, 7 Dec 2015 11:21:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 18C5F1C93; Mon, 7 Dec 2015 11:21:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7BLo3J010392; Mon, 7 Dec 2015 11:21:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7BLoI6010390; Mon, 7 Dec 2015 11:21:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512071121.tB7BLoI6010390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Dec 2015 11:21:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291935 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 11:21:51 -0000 Author: kib Date: Mon Dec 7 11:21:49 2015 New Revision: 291935 URL: https://svnweb.freebsd.org/changeset/base/291935 Log: MFC r290920: Raise OOM when pagedaemon is unable to produce a free page in several back-to-back passes. Modified: stable/10/sys/vm/vm_page.h stable/10/sys/vm/vm_pageout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_page.h ============================================================================== --- stable/10/sys/vm/vm_page.h Mon Dec 7 11:14:57 2015 (r291934) +++ stable/10/sys/vm/vm_page.h Mon Dec 7 11:21:49 2015 (r291935) @@ -227,6 +227,7 @@ struct vm_domain { long vmd_segs; /* bitmask of the segments */ boolean_t vmd_oom; int vmd_pass; /* local pagedaemon pass */ + int vmd_oom_seq; int vmd_last_active_scan; struct vm_page vmd_marker; /* marker for pagedaemon private use */ }; Modified: stable/10/sys/vm/vm_pageout.c ============================================================================== --- stable/10/sys/vm/vm_pageout.c Mon Dec 7 11:14:57 2015 (r291934) +++ stable/10/sys/vm/vm_pageout.c Mon Dec 7 11:21:49 2015 (r291935) @@ -121,7 +121,8 @@ static void vm_pageout(void); static void vm_pageout_init(void); static int vm_pageout_clean(vm_page_t); static void vm_pageout_scan(struct vm_domain *vmd, int pass); -static void vm_pageout_mightbe_oom(struct vm_domain *vmd, int pass); +static void vm_pageout_mightbe_oom(struct vm_domain *vmd, int page_shortage, + int starting_page_shortage); SYSINIT(pagedaemon_init, SI_SUB_KTHREAD_PAGE, SI_ORDER_FIRST, vm_pageout_init, NULL); @@ -158,6 +159,7 @@ int vm_pages_needed; /* Event on which int vm_pageout_deficit; /* Estimated number of pages deficit */ int vm_pageout_pages_needed; /* flag saying that the pageout daemon needs pages */ int vm_pageout_wakeup_thresh; +static int vm_pageout_oom_seq = 12; #if !defined(NO_SWAPPING) static int vm_pageout_req_swapout; /* XXX */ @@ -217,6 +219,10 @@ static int pageout_lock_miss; SYSCTL_INT(_vm, OID_AUTO, pageout_lock_miss, CTLFLAG_RD, &pageout_lock_miss, 0, "vget() lock misses during pageout"); +SYSCTL_INT(_vm, OID_AUTO, pageout_oom_seq, + CTLFLAG_RW, &vm_pageout_oom_seq, 0, + "back-to-back calls to oom detector to start OOM"); + #define VM_PAGEOUT_PAGE_COUNT 16 int vm_pageout_page_count = VM_PAGEOUT_PAGE_COUNT; @@ -941,7 +947,7 @@ vm_pageout_scan(struct vm_domain *vmd, i long min_scan; int act_delta, addl_page_shortage, deficit, maxscan, page_shortage; int vnodes_skipped = 0; - int maxlaunder, scan_tick, scanned; + int maxlaunder, scan_tick, scanned, starting_page_shortage; int lockmode; boolean_t queues_locked; @@ -981,6 +987,7 @@ vm_pageout_scan(struct vm_domain *vmd, i page_shortage = vm_paging_target() + deficit; } else page_shortage = deficit = 0; + starting_page_shortage = page_shortage; /* * maxlaunder limits the number of dirty pages we flush per scan. @@ -1358,6 +1365,12 @@ relock_queues: (void)speedup_syncer(); /* + * If the inactive queue scan fails repeatedly to meet its + * target, kill the largest process. + */ + vm_pageout_mightbe_oom(vmd, page_shortage, starting_page_shortage); + + /* * Compute the number of pages we want to try to move from the * active queue to the inactive queue. */ @@ -1469,15 +1482,6 @@ relock_queues: } } #endif - - /* - * If we are critically low on one of RAM or swap and low on - * the other, kill the largest process. However, we avoid - * doing this on the first pass in order to give ourselves a - * chance to flush out dirty vnode-backed pages and to allow - * active pages to be moved to the inactive queue and reclaimed. - */ - vm_pageout_mightbe_oom(vmd, pass); } static int vm_pageout_oom_vote; @@ -1488,12 +1492,17 @@ static int vm_pageout_oom_vote; * failed to reach free target is premature. */ static void -vm_pageout_mightbe_oom(struct vm_domain *vmd, int pass) +vm_pageout_mightbe_oom(struct vm_domain *vmd, int page_shortage, + int starting_page_shortage) { int old_vote; - if (pass <= 1 || !((swap_pager_avail < 64 && vm_page_count_min()) || - (swap_pager_full && vm_paging_target() > 0))) { + if (starting_page_shortage <= 0 || starting_page_shortage != + page_shortage) + vmd->vmd_oom_seq = 0; + else + vmd->vmd_oom_seq++; + if (vmd->vmd_oom_seq < vm_pageout_oom_seq) { if (vmd->vmd_oom) { vmd->vmd_oom = FALSE; atomic_subtract_int(&vm_pageout_oom_vote, 1); @@ -1501,6 +1510,12 @@ vm_pageout_mightbe_oom(struct vm_domain return; } + /* + * Do not follow the call sequence until OOM condition is + * cleared. + */ + vmd->vmd_oom_seq = 0; + if (vmd->vmd_oom) return; From owner-svn-src-all@freebsd.org Mon Dec 7 11:22:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F7329B9A14; Mon, 7 Dec 2015 11:22:42 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CDC541F51; Mon, 7 Dec 2015 11:22:41 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by wmec201 with SMTP id c201so146301869wme.1; Mon, 07 Dec 2015 03:22:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=dK5uW9XhKWWVodu5bi6GBTeEQg1DuSscKo9ukULu1KY=; b=rIrw4YU4cIXMwhdjN4iP98ZwP5jtldN4+xiZa2I3bQDkwbjoHycrv8zGgeS614cNuc nM+L/TgUGfVEPOTqqjS95ckdCesVn7foJGuJpAmw64BY7EP0dymHvS4DZkzYGQBqLIJc R1hbtvdBFKKg3S3jK7QzI4U8ySnb7lxFFUnfe1spZ+6w1EAYxXNFqT0wAzc6QjMX4KK3 eivQ1n8aS3N9fgl0YBVmzxf7b2lJnxfwwIWtWTvegqT49EZNVj2n5KOT181CTebapPyN Nwq+RTujgr6Tw3YE2sp8F52KwqqnsE6RlmAEteQQPHl3B47VXnLIcV2Sk98yYyKpJoxm JmcA== X-Received: by 10.194.63.46 with SMTP id d14mr31295787wjs.34.1449487359840; Mon, 07 Dec 2015 03:22:39 -0800 (PST) Received: from brick.home (acyr204.neoplus.adsl.tpnet.pl. [83.11.201.204]) by smtp.gmail.com with ESMTPSA id d2sm24827487wjy.16.2015.12.07.03.22.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Dec 2015 03:22:38 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Mon, 7 Dec 2015 12:22:35 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291911 - head/sys/dev/iscsi Message-ID: <20151207112235.GA12517@brick.home> Mail-Followup-To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512070256.tB72u8C6057988@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201512070256.tB72u8C6057988@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 11:22:42 -0000 On 1207T0256, Steven Hartland wrote: > Author: smh > Date: Mon Dec 7 02:56:08 2015 > New Revision: 291911 > URL: https://svnweb.freebsd.org/changeset/base/291911 > > Log: > Fix panic on shutdown due to iscsi event priority > > iscsi's shutdown_pre_sync prio was SHUTDOWN_PRI_FIRST which caused it to > run before other high priority handlers such as filesystems e.g. ZFS. > > This meant the iscsi sessions where removed before the ZFS geom consumer > was closed, resulting in a panic from g_access calls on debug kernels > due to negative acr. > > Instead use the same as the old iscsi_initiator SHUTDOWN_PRI_DEFAULT-1 > which allows it to run before dashutdown etc but after filesystems. I think this might be backwards. Have you tested the following scenario: 1. Establish the iSCSI session 2. Mount the LUN somewhere 3. Make the target not reachable (eg ifconfig down), so that the initiator tries to reconnect 4. Try to shutdown? Basically, the point of this code is to disable reconnects when there won't be any iscsid(8) instance to handle them. The iscsi_shutdown() isn't supposed to remove working iSCSI sessions. From owner-svn-src-all@freebsd.org Mon Dec 7 11:26:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74B199B9A9B for ; Mon, 7 Dec 2015 11:26:05 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B9DA110F for ; Mon, 7 Dec 2015 11:26:05 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wmww144 with SMTP id w144so136147430wmw.1 for ; Mon, 07 Dec 2015 03:26:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=mF0508qNlhv22RP6b8pyBjWdjElqwIbd4EG8JLLWsyM=; b=kGrbhQCcFRylk8Q+QhZnbgx2NzcKXFPS81iGJrN/zBKFukoQ3DsEL+y7r4fZ+myian LrmJmYPet43nOsb0/TFs+3gqxmvzn4Wtltqcpx+025axcSRLSaltWFwcdU/f+onzKGSS T28kFOzNV90K+LJdXc9p7aqz5M9iSQMDqLW3LwzvhCOx9XCz3JPwdcPtOknucNj25X/+ q8YBl3B9dMxmeg9DuAAYaN7fZ3pLtROUZiKmb2Ox4LNQBntiy/Tk68uSxiyUX8suIKaN cjIoToctiHwjaGQ62ozStUQKOG9IFho+xsbpaC1NgG5wNC0dBGXnXMUcJJtURpF1J2gL P7VA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=mF0508qNlhv22RP6b8pyBjWdjElqwIbd4EG8JLLWsyM=; b=JlR4zriwbKL1Vwm9O+Qdk8u9wMFCV/a4noQNfyAFO03AMAgiDcHvxrIGKr84248Aa2 M015Jd2sPc9UesR+q8O9udv7+9vF6AmQTHQWRbuF0W5yL99iJbWnXqN3+IUx7E54WDVT SfQ2M3NsYHJwO19rt9cJZ+RrbTLHTP3siI/ul5mguTJAejAjFzfGYm/ATW/yU+LRXap5 FVe/ywSUZveIBgHmArY3aL4Vg4q1F/t9mE1RCgsLevz4hE4TEfccppQu506lUTlJ0iIN lqc+QHURNXB+Cm5cL1iMpYarFqw7rAgWYg+1r1rSnCwufdZNNt94Dx3a5DL/9MXYD77s yRcA== X-Gm-Message-State: ALoCoQkxXKik+MnDEG/RcjCbKtPSAjqIdQ3MJ08GyLRkIMXqSxEwAGSdGVjRI/KFOZRDXGHpE0LK X-Received: by 10.194.134.102 with SMTP id pj6mr4204735wjb.23.1449487563444; Mon, 07 Dec 2015 03:26:03 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id h189sm16219147wme.1.2015.12.07.03.26.02 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Dec 2015 03:26:02 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r291911 - head/sys/dev/iscsi To: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org, "trasz@freebsd.org" References: <201512070256.tB72u8C6057988@repo.freebsd.org> <56652A09.1030106@FreeBSD.org> Message-ID: <56656CCF.8070700@freebsd.org> Date: Mon, 7 Dec 2015 11:26:07 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <56652A09.1030106@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 11:26:05 -0000 On 07/12/2015 06:41, Andriy Gapon wrote: > On 07/12/2015 04:56, Steven Hartland wrote: >> Author: smh >> Date: Mon Dec 7 02:56:08 2015 >> New Revision: 291911 >> URL: https://svnweb.freebsd.org/changeset/base/291911 >> >> Log: >> Fix panic on shutdown due to iscsi event priority >> >> iscsi's shutdown_pre_sync prio was SHUTDOWN_PRI_FIRST which caused it to >> run before other high priority handlers such as filesystems e.g. ZFS. >> >> This meant the iscsi sessions where removed before the ZFS geom consumer >> was closed, resulting in a panic from g_access calls on debug kernels >> due to negative acr. >> >> Instead use the same as the old iscsi_initiator SHUTDOWN_PRI_DEFAULT-1 >> which allows it to run before dashutdown etc but after filesystems. >> >> MFC after: 2 weeks >> Sponsored by: Multiplay >> >> Modified: >> head/sys/dev/iscsi/iscsi.c >> >> Modified: head/sys/dev/iscsi/iscsi.c >> ============================================================================== >> --- head/sys/dev/iscsi/iscsi.c Sun Dec 6 21:31:09 2015 (r291910) >> +++ head/sys/dev/iscsi/iscsi.c Mon Dec 7 02:56:08 2015 (r291911) >> @@ -2365,7 +2365,7 @@ iscsi_load(void) >> sc->sc_cdev->si_drv1 = sc; >> >> sc->sc_shutdown_eh = EVENTHANDLER_REGISTER(shutdown_pre_sync, >> - iscsi_shutdown, sc, SHUTDOWN_PRI_FIRST); >> + iscsi_shutdown, sc, SHUTDOWN_PRI_DEFAULT-1); >> >> return (0); >> } > It would be nice to also add a comment here explaining the priority. > And spaces around '-' operator. Ah, there was actually already a comment there but seems that's been removed in HEAD by r286226 which also changed the post_sync to a pre_sync so its currently really broken in HEAD and stable/10 compared to 10.2. Surprisingly this was already mentioned by mav in the review of said commit (https://reviews.freebsd.org/D3052). The style was copied from iscsi_initiator, I'll fix them both. I'm retesting this to validate down session recovery now and will update once I've confirmed that. From owner-svn-src-all@freebsd.org Mon Dec 7 11:34:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FDCD9B9CBA for ; Mon, 7 Dec 2015 11:34:00 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB0F91797 for ; Mon, 7 Dec 2015 11:33:59 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wmec201 with SMTP id c201so160893073wme.0 for ; Mon, 07 Dec 2015 03:33:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=kCLIxtXDuPhQn28amWHqFLru9aeTO7otrYbLKHDRswU=; b=erkX61bw/0onOf2QBOdUHbjnYihOhrw37UDR1Q6+cmdGIp8A4dJlP1z+VC+b84enyb s46BZjzzD40xngBEnitc4Ip0SPysNVjPa0q1/zYcJ95DVUno4A44AmM+/PopcG0b59yg cdNI9mAfZ0jI+s3m4J2NIaLYTSYprJM/cHXTxqA5VvdPMBa+oUpTOae0LXHqJngy0Fhq Eq4AuCLy35LSY2lwtfQCdkVmxWtK6G1bXovSORWjVoxvnhRbdRUIcKsZ6mFWGVG0HHEW LC1DYu8zeLsJl+o9x3EJw9JJVAtLXqoL84hY+XX3jbIKg6ua0FeaHBhXSHwTx7wimseb 0nag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=kCLIxtXDuPhQn28amWHqFLru9aeTO7otrYbLKHDRswU=; b=hwTb65+Qv9ADr6F5bs8eKJf9KOK9X9ZlBq3VumMh9wameTahBoYiTz2wbc4odNFPMq PQKJQBMrrCdOJWhsUDMwkgz59LwpaOLBLYS8CW9X5Zzl7Ipiky0KCpLV7t5Lf7Gkz00u sBBtNi1WF2nk8o9Jamigm4T4id2UMg+NQgSAVkKSO+S9TMyrQ0PUtD7FKIBnVBOUmXeE JFhveOwV2kCQkVXgEHDSJeo/C8AFe14avUHKrK8h93Dmai5mC6p2d7enaJyC5iMhFPpP N7uUJOshLpwv+E/FHgz/efFHSgxiuMWQvGTABcAueYyN4MNv8hrVz6Tki1CDquOtJHIP lWQg== X-Gm-Message-State: ALoCoQnxNoiD/4oMeBJ9iEECOCzYjJJMGYJOvcSJSh+R8VsdhyITtezp6OYcQircXW4E28tCdzaz X-Received: by 10.194.118.36 with SMTP id kj4mr8082761wjb.88.1449488038124; Mon, 07 Dec 2015 03:33:58 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id uw6sm24835440wjc.42.2015.12.07.03.33.57 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Dec 2015 03:33:57 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r291911 - head/sys/dev/iscsi To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512070256.tB72u8C6057988@repo.freebsd.org> <20151207112235.GA12517@brick.home> Message-ID: <56656EA9.6050002@freebsd.org> Date: Mon, 7 Dec 2015 11:34:01 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151207112235.GA12517@brick.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 11:34:00 -0000 On 07/12/2015 11:22, Edward Tomasz NapieraÅ‚a wrote: > On 1207T0256, Steven Hartland wrote: >> Author: smh >> Date: Mon Dec 7 02:56:08 2015 >> New Revision: 291911 >> URL: https://svnweb.freebsd.org/changeset/base/291911 >> >> Log: >> Fix panic on shutdown due to iscsi event priority >> >> iscsi's shutdown_pre_sync prio was SHUTDOWN_PRI_FIRST which caused it to >> run before other high priority handlers such as filesystems e.g. ZFS. >> >> This meant the iscsi sessions where removed before the ZFS geom consumer >> was closed, resulting in a panic from g_access calls on debug kernels >> due to negative acr. >> >> Instead use the same as the old iscsi_initiator SHUTDOWN_PRI_DEFAULT-1 >> which allows it to run before dashutdown etc but after filesystems. > I think this might be backwards. Have you tested the following scenario: > > 1. Establish the iSCSI session > 2. Mount the LUN somewhere > 3. Make the target not reachable (eg ifconfig down), so that the > initiator tries to reconnect > 4. Try to shutdown? > > Basically, the point of this code is to disable reconnects when there > won't be any iscsid(8) instance to handle them. The iscsi_shutdown() > isn't supposed to remove working iSCSI sessions. I didn't notice your change in head / stable/10 compared to releng, so I'm testing further updates now. Currently shutdown is run too early and actually doesn't actually terminate any sessions. My current theory is the issue you tried to fix in 286226 is actually caused by the iscsi_maintenance_thread preferring reconnect over terminate, so what you where seeing was the terminate never action for reconnecting sessions. I'm currently trying to validate that theory now. If I'm right then the fix should be to revert the majority of 286226 and move the processing of terminate above reconnect in iscsi_maintenance_thread. Regards Steve From owner-svn-src-all@freebsd.org Mon Dec 7 12:09:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91A069B9B27; Mon, 7 Dec 2015 12:09:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5CAFA1EF5; Mon, 7 Dec 2015 12:09:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7C94bU024621; Mon, 7 Dec 2015 12:09:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7C94hd024620; Mon, 7 Dec 2015 12:09:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512071209.tB7C94hd024620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Dec 2015 12:09:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291936 - head/sys/ufs/ufs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 12:09:05 -0000 Author: kib Date: Mon Dec 7 12:09:04 2015 New Revision: 291936 URL: https://svnweb.freebsd.org/changeset/base/291936 Log: Update ctime when atime or birthtime are updated. Cleanup setting of ctime/mtime/birthtime: do not set IN_ACCESS or IN_UPDATE, then clear them with ufs_itimes(), making transient (possibly inconsistent) change to the times, and then copy user-supplied times into the inode. Instead, directly clear IN_ACCESS or IN_UPDATE when user supplied the time, and copy the value into the inode. Minor inconsistency left is that the inode ctime is updated even when birthtime update attempt is performed on a UFS1 volume. Submitted by: bde MFC after: 2 weeks Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Mon Dec 7 11:21:49 2015 (r291935) +++ head/sys/ufs/ufs/ufs_vnops.c Mon Dec 7 12:09:04 2015 (r291936) @@ -639,19 +639,14 @@ ufs_setattr(ap) error = vn_utimes_perm(vp, vap, cred, td); if (error != 0) return (error); - if (vap->va_atime.tv_sec != VNOVAL) - ip->i_flag |= IN_ACCESS; - if (vap->va_mtime.tv_sec != VNOVAL) - ip->i_flag |= IN_CHANGE | IN_UPDATE; - if (vap->va_birthtime.tv_sec != VNOVAL && - ip->i_ump->um_fstype == UFS2) - ip->i_flag |= IN_MODIFIED; - ufs_itimes(vp); + ip->i_flag |= IN_CHANGE | IN_MODIFIED; if (vap->va_atime.tv_sec != VNOVAL) { + ip->i_flag &= ~IN_ACCESS; DIP_SET(ip, i_atime, vap->va_atime.tv_sec); DIP_SET(ip, i_atimensec, vap->va_atime.tv_nsec); } if (vap->va_mtime.tv_sec != VNOVAL) { + ip->i_flag &= ~IN_UPDATE; DIP_SET(ip, i_mtime, vap->va_mtime.tv_sec); DIP_SET(ip, i_mtimensec, vap->va_mtime.tv_nsec); } From owner-svn-src-all@freebsd.org Mon Dec 7 12:20:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C87739B9FC6; Mon, 7 Dec 2015 12:20:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DF891516; Mon, 7 Dec 2015 12:20:29 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7CKSlv027876; Mon, 7 Dec 2015 12:20:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7CKRw0027858; Mon, 7 Dec 2015 12:20:27 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512071220.tB7CKRw0027858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Dec 2015 12:20:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291937 - in head: lib/libc/aarch64/sys lib/libc/arm/sys sys/arm/arm sys/arm/include sys/arm64/arm64 sys/arm64/include sys/conf sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 12:20:29 -0000 Author: kib Date: Mon Dec 7 12:20:26 2015 New Revision: 291937 URL: https://svnweb.freebsd.org/changeset/base/291937 Log: Add support for usermode (vdso-like) gettimeofday(2) and clock_gettime(2) on ARMv7 and ARMv8 systems which have architectural generic timer hardware. It is similar how the RDTSC timer is used in userspace on x86. Fix a permission problem where generic timer access from EL0 (or userspace on v7) was not properly initialized on APs. For ARMv7, mark the stack non-executable. The shared page is added for all arms (including ARMv8 64bit), and the signal trampoline code is moved to the page. Reviewed by: andrew Discussed with: emaste, mmel Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D4209 Added: head/lib/libc/aarch64/sys/__vdso_gettc.c - copied, changed from r291936, head/lib/libc/amd64/sys/__vdso_gettc.c head/lib/libc/arm/sys/__vdso_gettc.c - copied, changed from r291936, head/lib/libc/amd64/sys/__vdso_gettc.c Modified: head/lib/libc/aarch64/sys/Makefile.inc head/lib/libc/arm/sys/Makefile.inc head/sys/arm/arm/elf_machdep.c head/sys/arm/arm/generic_timer.c head/sys/arm/arm/machdep.c head/sys/arm/include/md_var.h head/sys/arm/include/vdso.h head/sys/arm/include/vmparam.h head/sys/arm64/arm64/elf_machdep.c head/sys/arm64/arm64/machdep.c head/sys/arm64/include/md_var.h head/sys/arm64/include/vdso.h head/sys/arm64/include/vmparam.h head/sys/conf/files.arm head/sys/conf/files.arm64 head/sys/kern/imgact_elf.c Modified: head/lib/libc/aarch64/sys/Makefile.inc ============================================================================== --- head/lib/libc/aarch64/sys/Makefile.inc Mon Dec 7 12:09:04 2015 (r291936) +++ head/lib/libc/aarch64/sys/Makefile.inc Mon Dec 7 12:20:26 2015 (r291937) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCS+= trivial-vdso_tc.c +SRCS+= __vdso_gettc.c #MDASM= ptrace.S MDASM= brk.S \ Copied and modified: head/lib/libc/aarch64/sys/__vdso_gettc.c (from r291936, head/lib/libc/amd64/sys/__vdso_gettc.c) ============================================================================== --- head/lib/libc/amd64/sys/__vdso_gettc.c Mon Dec 7 12:09:04 2015 (r291936, copy source) +++ head/lib/libc/aarch64/sys/__vdso_gettc.c Mon Dec 7 12:20:26 2015 (r291937) @@ -1,5 +1,8 @@ /*- - * Copyright (c) 2012 Konstantin Belousov + * Copyright (c) 2015 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,32 +36,33 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" -static u_int -__vdso_gettc_low(const struct vdso_timehands *th) +static inline uint64_t +cp15_cntvct_get(void) { - u_int rv; + uint64_t reg; - __asm __volatile("lfence; rdtsc; shrd %%cl, %%edx, %0" - : "=a" (rv) : "c" (th->th_x86_shift) : "edx"); - return (rv); + __asm __volatile("mrs %0, cntvct_el0" : "=r" (reg)); + return (reg); } -static u_int -__vdso_rdtsc32(void) +static inline uint64_t +cp15_cntpct_get(void) { - u_int rv; + uint64_t reg; - __asm __volatile("lfence;rdtsc" : "=a" (rv) : : "edx"); - return (rv); + __asm __volatile("mrs %0, cntpct_el0" : "=r" (reg)); + return (reg); } #pragma weak __vdso_gettc u_int __vdso_gettc(const struct vdso_timehands *th) { + uint64_t val; - return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : - __vdso_rdtsc32()); + __asm __volatile("isb" : : : "memory"); + val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); + return (val); } #pragma weak __vdso_gettimekeep Modified: head/lib/libc/arm/sys/Makefile.inc ============================================================================== --- head/lib/libc/arm/sys/Makefile.inc Mon Dec 7 12:09:04 2015 (r291936) +++ head/lib/libc/arm/sys/Makefile.inc Mon Dec 7 12:20:26 2015 (r291937) @@ -1,6 +1,6 @@ # $FreeBSD$ -SRCS+= trivial-vdso_tc.c +SRCS+= __vdso_gettc.c MDASM= Ovfork.S brk.S cerror.S pipe.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S Copied and modified: head/lib/libc/arm/sys/__vdso_gettc.c (from r291936, head/lib/libc/amd64/sys/__vdso_gettc.c) ============================================================================== --- head/lib/libc/amd64/sys/__vdso_gettc.c Mon Dec 7 12:09:04 2015 (r291936, copy source) +++ head/lib/libc/arm/sys/__vdso_gettc.c Mon Dec 7 12:20:26 2015 (r291937) @@ -1,5 +1,8 @@ /*- - * Copyright (c) 2012 Konstantin Belousov + * Copyright (c) 2015 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -33,32 +36,38 @@ __FBSDID("$FreeBSD$"); #include #include "libc_private.h" -static u_int -__vdso_gettc_low(const struct vdso_timehands *th) +static inline uint64_t +cp15_cntvct_get(void) { - u_int rv; + uint64_t reg; - __asm __volatile("lfence; rdtsc; shrd %%cl, %%edx, %0" - : "=a" (rv) : "c" (th->th_x86_shift) : "edx"); - return (rv); + __asm __volatile("mrrc\tp15, 1, %Q0, %R0, c14" : "=r" (reg)); + return (reg); } -static u_int -__vdso_rdtsc32(void) +static inline uint64_t +cp15_cntpct_get(void) { - u_int rv; + uint64_t reg; - __asm __volatile("lfence;rdtsc" : "=a" (rv) : : "edx"); - return (rv); + __asm __volatile("mrrc\tp15, 0, %Q0, %R0, c14" : "=r" (reg)); + return (reg); } #pragma weak __vdso_gettc u_int __vdso_gettc(const struct vdso_timehands *th) { + uint64_t val; - return (th->th_x86_shift > 0 ? __vdso_gettc_low(th) : - __vdso_rdtsc32()); + /* + * Userspace gettimeofday() is only enabled on ARMv7 CPUs, but + * libc is compiled for ARMv6. Due to clang issues, .arch + * armv7-a directive does not work. + */ + __asm __volatile(".word\t0xf57ff06f" : : : "memory"); /* isb */ + val = th->th_physical == 0 ? cp15_cntvct_get() : cp15_cntpct_get(); + return (val); } #pragma weak __vdso_gettimekeep Modified: head/sys/arm/arm/elf_machdep.c ============================================================================== --- head/sys/arm/arm/elf_machdep.c Mon Dec 7 12:09:04 2015 (r291936) +++ head/sys/arm/arm/elf_machdep.c Mon Dec 7 12:20:26 2015 (r291937) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -73,13 +74,20 @@ struct sysentvec elf32_freebsd_sysvec = .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_ILP32, + .sv_flags = +#if __ARM_ARCH >= 6 + SV_SHP | SV_TIMEKEEP | +#endif + SV_ABI_FREEBSD | SV_ILP32, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_shared_page_base = SHAREDPAGE, + .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, .sv_thread_detach = NULL, }; +INIT_SYSENTVEC(elf32_sysvec, &elf32_freebsd_sysvec); static Elf32_Brandinfo freebsd_brand_info = { .brand = ELFOSABI_FREEBSD, Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Mon Dec 7 12:09:04 2015 (r291936) +++ head/sys/arm/arm/generic_timer.c Mon Dec 7 12:20:26 2015 (r291937) @@ -49,10 +49,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include #include #include +#include #ifdef FDT #include @@ -121,6 +124,9 @@ static struct timecounter arm_tmr_timeco #define set_el1(x, val) WRITE_SPECIALREG(x ##_el1, val) #endif +static uint32_t arm_tmr_fill_vdso_timehands(struct vdso_timehands *vdso_th, + struct timecounter *tc); + static int get_freq(void) { @@ -181,17 +187,32 @@ get_ctrl(bool physical) } static void -disable_user_access(void) +setup_user_access(void *arg __unused) { uint32_t cntkctl; cntkctl = get_el1(cntkctl); cntkctl &= ~(GT_CNTKCTL_PL0PTEN | GT_CNTKCTL_PL0VTEN | - GT_CNTKCTL_EVNTEN | GT_CNTKCTL_PL0VCTEN | GT_CNTKCTL_PL0PCTEN); + GT_CNTKCTL_EVNTEN); + if (arm_tmr_sc->physical) { + cntkctl |= GT_CNTKCTL_PL0PCTEN; + cntkctl &= ~GT_CNTKCTL_PL0VCTEN; + } else { + cntkctl |= GT_CNTKCTL_PL0VCTEN; + cntkctl &= ~GT_CNTKCTL_PL0PCTEN; + } set_el1(cntkctl, cntkctl); isb(); } +static void +tmr_setup_user_access(void *arg __unused) +{ + + smp_rendezvous(NULL, setup_user_access, NULL, NULL); +} +SYSINIT(tmr_ua, SI_SUB_SMP, SI_ORDER_SECOND, tmr_setup_user_access, NULL); + static unsigned arm_tmr_get_timecount(struct timecounter *tc) { @@ -381,7 +402,7 @@ arm_tmr_attach(device_t dev) } } - disable_user_access(); + arm_cpu_fill_vdso_timehands = arm_tmr_fill_vdso_timehands; arm_tmr_timecount.tc_frequency = sc->clkfreq; tc_init(&arm_tmr_timecount); @@ -485,3 +506,13 @@ DELAY(int usec) first = last; } } + +static uint32_t +arm_tmr_fill_vdso_timehands(struct vdso_timehands *vdso_th, + struct timecounter *tc) +{ + + vdso_th->th_physical = arm_tmr_sc->physical; + bzero(vdso_th->th_res, sizeof(vdso_th->th_res)); + return (tc == &arm_tmr_timecount); +} Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Mon Dec 7 12:09:04 2015 (r291936) +++ head/sys/arm/arm/machdep.c Mon Dec 7 12:20:26 2015 (r291937) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -271,6 +272,7 @@ sendsig(catcher, ksi, mask) struct trapframe *tf; struct sigframe *fp, frame; struct sigacts *psp; + struct sysentvec *sysent; int onstack; int sig; int code; @@ -337,7 +339,12 @@ sendsig(catcher, ksi, mask) tf->tf_r5 = (register_t)&fp->sf_uc; tf->tf_pc = (register_t)catcher; tf->tf_usr_sp = (register_t)fp; - tf->tf_usr_lr = (register_t)(PS_STRINGS - *(p->p_sysent->sv_szsigcode)); + sysent = p->p_sysent; + if (sysent->sv_sigcode_base != 0) + tf->tf_usr_lr = (register_t)sysent->sv_sigcode_base; + else + tf->tf_usr_lr = (register_t)(sysent->sv_psstrings - + *(sysent->sv_szsigcode)); /* Set the mode to enter in the signal handler */ #if __ARM_ARCH >= 7 if ((register_t)catcher & 1) @@ -1910,3 +1917,14 @@ initarm(struct arm_boot_params *abp) #endif /* !ARM_NEW_PMAP */ #endif /* FDT */ + +uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, + struct timecounter *); + +uint32_t +cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) +{ + + return (arm_cpu_fill_vdso_timehands != NULL ? + arm_cpu_fill_vdso_timehands(vdso_th, tc) : 0); +} Modified: head/sys/arm/include/md_var.h ============================================================================== --- head/sys/arm/include/md_var.h Mon Dec 7 12:09:04 2015 (r291936) +++ head/sys/arm/include/md_var.h Mon Dec 7 12:20:26 2015 (r291937) @@ -45,6 +45,11 @@ extern int (*_arm_bzero)(void *, int, in extern int _min_memcpy_size; extern int _min_bzero_size; +struct vdso_timehands; +struct timecounter; +extern uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, + struct timecounter *); + #define DST_IS_USER 0x1 #define SRC_IS_USER 0x2 #define IS_PHYSICAL 0x4 Modified: head/sys/arm/include/vdso.h ============================================================================== --- head/sys/arm/include/vdso.h Mon Dec 7 12:09:04 2015 (r291936) +++ head/sys/arm/include/vdso.h Mon Dec 7 12:20:26 2015 (r291937) @@ -29,6 +29,7 @@ #define _ARM_VDSO_H #define VDSO_TIMEHANDS_MD \ - uint32_t th_res[8]; + uint32_t th_physical; \ + uint32_t th_res[7]; #endif Modified: head/sys/arm/include/vmparam.h ============================================================================== --- head/sys/arm/include/vmparam.h Mon Dec 7 12:09:04 2015 (r291936) +++ head/sys/arm/include/vmparam.h Mon Dec 7 12:20:26 2015 (r291937) @@ -124,7 +124,8 @@ #endif #define VM_MAX_ADDRESS VM_MAXUSER_ADDRESS -#define USRSTACK VM_MAXUSER_ADDRESS +#define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) +#define USRSTACK SHAREDPAGE /* initial pagein size of beginning of executable file */ #ifndef VM_INITIAL_PAGEIN Modified: head/sys/arm64/arm64/elf_machdep.c ============================================================================== --- head/sys/arm64/arm64/elf_machdep.c Mon Dec 7 12:09:04 2015 (r291936) +++ head/sys/arm64/arm64/elf_machdep.c Mon Dec 7 12:20:26 2015 (r291937) @@ -80,12 +80,15 @@ static struct sysentvec elf64_freebsd_sy .sv_setregs = exec_setregs, .sv_fixlimit = NULL, .sv_maxssiz = NULL, - .sv_flags = SV_ABI_FREEBSD | SV_LP64, + .sv_flags = SV_SHP | SV_TIMEKEEP | SV_ABI_FREEBSD | SV_LP64, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = cpu_fetch_syscall_args, .sv_syscallnames = syscallnames, + .sv_shared_page_base = SHAREDPAGE, + .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = NULL, }; +INIT_SYSENTVEC(elf64_sysvec, &elf64_freebsd_sysvec); static Elf64_Brandinfo freebsd_brand_info = { .brand = ELFOSABI_FREEBSD, Modified: head/sys/arm64/arm64/machdep.c ============================================================================== --- head/sys/arm64/arm64/machdep.c Mon Dec 7 12:09:04 2015 (r291936) +++ head/sys/arm64/arm64/machdep.c Mon Dec 7 12:20:26 2015 (r291937) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -72,6 +73,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -505,6 +507,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, struct trapframe *tf; struct sigframe *fp, frame; struct sigacts *psp; + struct sysentvec *sysent; int code, onstack, sig; td = curthread; @@ -563,7 +566,12 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, tf->tf_elr = (register_t)catcher; tf->tf_sp = (register_t)fp; - tf->tf_lr = (register_t)(PS_STRINGS - *(p->p_sysent->sv_szsigcode)); + sysent = p->p_sysent; + if (sysent->sv_sigcode_base != 0) + tf->tf_lr = (register_t)sysent->sv_sigcode_base; + else + tf->tf_lr = (register_t)(sysent->sv_psstrings - + *(sysent->sv_szsigcode)); CTR3(KTR_SIG, "sendsig: return td=%p pc=%#x sp=%#x", td, tf->tf_elr, tf->tf_sp); @@ -875,6 +883,17 @@ initarm(struct arm64_bootparams *abp) early_boot = 0; } +uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, + struct timecounter *); + +uint32_t +cpu_fill_vdso_timehands(struct vdso_timehands *vdso_th, struct timecounter *tc) +{ + + return (arm_cpu_fill_vdso_timehands != NULL ? + arm_cpu_fill_vdso_timehands(vdso_th, tc) : 0); +} + #ifdef DDB #include Modified: head/sys/arm64/include/md_var.h ============================================================================== --- head/sys/arm64/include/md_var.h Mon Dec 7 12:09:04 2015 (r291936) +++ head/sys/arm64/include/md_var.h Mon Dec 7 12:20:26 2015 (r291937) @@ -46,4 +46,9 @@ void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); int minidumpsys(struct dumperinfo *); +struct vdso_timehands; +struct timecounter; +extern uint32_t (*arm_cpu_fill_vdso_timehands)(struct vdso_timehands *, + struct timecounter *); + #endif /* !_MACHINE_MD_VAR_H_ */ Modified: head/sys/arm64/include/vdso.h ============================================================================== --- head/sys/arm64/include/vdso.h Mon Dec 7 12:09:04 2015 (r291936) +++ head/sys/arm64/include/vdso.h Mon Dec 7 12:20:26 2015 (r291937) @@ -29,6 +29,7 @@ #define _MACHINE_VDSO_H_ #define VDSO_TIMEHANDS_MD \ - uint32_t th_res[8]; + uint32_t th_physical; \ + uint32_t th_res[7]; #endif /* !_MACHINE_VDSO_H_ */ Modified: head/sys/arm64/include/vmparam.h ============================================================================== --- head/sys/arm64/include/vmparam.h Mon Dec 7 12:09:04 2015 (r291936) +++ head/sys/arm64/include/vmparam.h Mon Dec 7 12:20:26 2015 (r291937) @@ -194,7 +194,8 @@ extern vm_paddr_t dmap_phys_base; #define VM_MAXUSER_ADDRESS (VM_MAX_USER_ADDRESS) #define KERNBASE (VM_MIN_KERNEL_ADDRESS) -#define USRSTACK (VM_MAX_USER_ADDRESS) +#define SHAREDPAGE (VM_MAXUSER_ADDRESS - PAGE_SIZE) +#define USRSTACK SHAREDPAGE /* * How many physical pages per kmem arena virtual page. Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Mon Dec 7 12:09:04 2015 (r291936) +++ head/sys/conf/files.arm Mon Dec 7 12:20:26 2015 (r291937) @@ -110,7 +110,6 @@ font.h optional sc \ no-obj no-implicit-rule before-depend \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" kern/subr_busdma_bufalloc.c standard -kern/subr_dummy_vdso_tc.c standard kern/subr_sfbuf.c standard libkern/arm/aeabi_unwind.c standard libkern/arm/divsi3.S standard Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon Dec 7 12:09:04 2015 (r291936) +++ head/sys/conf/files.arm64 Mon Dec 7 12:20:26 2015 (r291937) @@ -79,7 +79,6 @@ dev/vnic/thunder_mdio_fdt.c optional vni dev/vnic/thunder_mdio.c optional vnic dev/vnic/lmac_if.m optional vnic kern/kern_clocksource.c standard -kern/subr_dummy_vdso_tc.c standard libkern/bcmp.c standard libkern/ffs.c standard libkern/ffsl.c standard Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Mon Dec 7 12:09:04 2015 (r291936) +++ head/sys/kern/imgact_elf.c Mon Dec 7 12:20:26 2015 (r291937) @@ -80,6 +80,9 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef __arm__ +#include +#endif #define ELF_NOTE_ROUNDSIZE 4 #define OLD_EI_BRAND 8 @@ -116,7 +119,8 @@ SYSCTL_INT(_debug, OID_AUTO, __elfN(lega &elf_legacy_coredump, 0, ""); int __elfN(nxstack) = -#if defined(__amd64__) || defined(__powerpc64__) /* both 64 and 32 bit */ +#if defined(__amd64__) || defined(__powerpc64__) /* both 64 and 32 bit */ || \ + (defined(__arm__) && __ARM_ARCH >= 7) || defined(__aarch64__) 1; #else 0; From owner-svn-src-all@freebsd.org Mon Dec 7 12:38:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB7A099A4F1; Mon, 7 Dec 2015 12:38:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7A7F910D1; Mon, 7 Dec 2015 12:38:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7CcqFp033714; Mon, 7 Dec 2015 12:38:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7Ccp45033707; Mon, 7 Dec 2015 12:38:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512071238.tB7Ccp45033707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Dec 2015 12:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291938 - in head/sys: dev/mlx5/mlx5_core dev/mlx5/mlx5_en modules/mlx5 modules/mlx5en X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 12:38:53 -0000 Author: hselasky Date: Mon Dec 7 12:38:51 2015 New Revision: 291938 URL: https://svnweb.freebsd.org/changeset/base/291938 Log: Add full support for Receive Side Scaling, RSS, to the mlx5en driver. This includes binding all interrupt and worker threads according to the RSS configuration, setting up correct Toeplitz hashing keys as given by RSS and setting the correct mbuf hashtype for all received traffic. MFC after: 1 week Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4410 Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_en/en.h head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c head/sys/modules/mlx5/Makefile head/sys/modules/mlx5en/Makefile Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Dec 7 12:20:26 2015 (r291937) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Dec 7 12:38:51 2015 (r291938) @@ -31,6 +31,13 @@ #include #include "mlx5_core.h" +#include "opt_rss.h" + +#ifdef RSS +#include +#include +#endif + enum { MLX5_EQE_SIZE = sizeof(struct mlx5_eqe), MLX5_EQE_OWNER_INIT_VAL = 0x1, @@ -389,6 +396,18 @@ int mlx5_create_map_eq(struct mlx5_core_ priv->irq_info[vecidx].name, eq); if (err) goto err_eq; +#ifdef RSS + if (vecidx >= MLX5_EQ_VEC_COMP_BASE) { + u8 bucket = vecidx - MLX5_EQ_VEC_COMP_BASE; + err = bind_irq_to_cpu(priv->msix_arr[vecidx].vector, + rss_getcpu(bucket % rss_getnumbuckets())); + if (err) + goto err_irq; + } +#else + if (0) + goto err_irq; +#endif /* EQs are created in ARMED state @@ -398,6 +417,8 @@ int mlx5_create_map_eq(struct mlx5_core_ kvfree(in); return 0; +err_irq: + free_irq(priv->msix_arr[vecidx].vector, eq); err_eq: mlx5_cmd_destroy_eq(dev, eq->eqn); Modified: head/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- head/sys/dev/mlx5/mlx5_en/en.h Mon Dec 7 12:20:26 2015 (r291937) +++ head/sys/dev/mlx5/mlx5_en/en.h Mon Dec 7 12:38:51 2015 (r291938) @@ -50,6 +50,13 @@ #include #include +#include "opt_rss.h" + +#ifdef RSS +#include +#include +#endif + #include #ifdef HAVE_TURBO_LRO Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 7 12:20:26 2015 (r291937) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon Dec 7 12:38:51 2015 (r291938) @@ -931,6 +931,10 @@ mlx5e_create_sq(struct mlx5e_channel *c, void *sqc = param->sqc; void *sqc_wq = MLX5_ADDR_OF(sqc, sqc, wq); +#ifdef RSS + cpuset_t cpu_mask; + int cpu_id; +#endif int err; /* Create DMA descriptor TAG */ @@ -991,9 +995,15 @@ mlx5e_create_sq(struct mlx5e_channel *c, } TASK_INIT(&sq->sq_task, 0, mlx5e_tx_que, sq); - taskqueue_start_threads(&sq->sq_tq, 1, PI_NET, "%s tx sq", - c->ifp->if_xname); - +#ifdef RSS + cpu_id = rss_getcpu(c->ix % rss_getnumbuckets()); + CPU_SETOF(cpu_id, &cpu_mask); + taskqueue_start_threads_cpuset(&sq->sq_tq, 1, PI_NET, &cpu_mask, + "%s TX SQ%d.%d CPU%d", c->ifp->if_xname, c->ix, tc, cpu_id); +#else + taskqueue_start_threads(&sq->sq_tq, 1, PI_NET, + "%s TX SQ%d.%d", c->ifp->if_xname, c->ix, tc); +#endif snprintf(buffer, sizeof(buffer), "txstat%dtc%d", c->ix, tc); mlx5e_create_stats(&sq->stats.ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), buffer, mlx5e_sq_stats_desc, MLX5E_SQ_STATS_NUM, @@ -1768,8 +1778,14 @@ mlx5e_open_rqt(struct mlx5e_priv *priv) MLX5_SET(rqtc, rqtc, rqt_max_size, sz); for (i = 0; i < sz; i++) { - int ix = i % priv->params.num_channels; - + int ix; +#ifdef RSS + ix = rss_get_indirection_to_bucket(i); +#else + ix = i; +#endif + /* ensure we don't overflow */ + ix %= priv->params.num_channels; MLX5_SET(rqtc, rqtc, rq_num[i], priv->channel[ix]->rq.rqn); } @@ -1834,6 +1850,8 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_CAP_ETH(priv->mdev, lro_timer_supported_periods[2])); } + + /* setup parameters for hashing TIR type, if any */ switch (tt) { case MLX5E_TT_ANY: MLX5_SET(tirc, tirc, disp_type, @@ -1848,8 +1866,16 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p priv->rqtn); MLX5_SET(tirc, tirc, rx_hash_fn, MLX5_TIRC_RX_HASH_FN_HASH_TOEPLITZ); - MLX5_SET(tirc, tirc, rx_hash_symmetric, 1); hkey = (__be32 *) MLX5_ADDR_OF(tirc, tirc, rx_hash_toeplitz_key); +#ifdef RSS + /* + * The FreeBSD RSS implementation does currently not + * support symmetric Toeplitz hashes: + */ + MLX5_SET(tirc, tirc, rx_hash_symmetric, 0); + rss_getkey((uint8_t *)hkey); +#else + MLX5_SET(tirc, tirc, rx_hash_symmetric, 1); hkey[0] = cpu_to_be32(0xD181C62C); hkey[1] = cpu_to_be32(0xF7F4DB5B); hkey[2] = cpu_to_be32(0x1983A2FC); @@ -1860,6 +1886,7 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p hkey[7] = cpu_to_be32(0x593D56D9); hkey[8] = cpu_to_be32(0xF3253C06); hkey[9] = cpu_to_be32(0x2ADC1FFC); +#endif break; } @@ -1869,6 +1896,12 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_L3_PROT_TYPE_IPV4); MLX5_SET(rx_hash_field_select, hfso, l4_prot_type, MLX5_L4_PROT_TYPE_TCP); +#ifdef RSS + if (!(rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV4)) { + MLX5_SET(rx_hash_field_select, hfso, selected_fields, + MLX5_HASH_IP); + } else +#endif MLX5_SET(rx_hash_field_select, hfso, selected_fields, MLX5_HASH_ALL); break; @@ -1878,6 +1911,12 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_L3_PROT_TYPE_IPV6); MLX5_SET(rx_hash_field_select, hfso, l4_prot_type, MLX5_L4_PROT_TYPE_TCP); +#ifdef RSS + if (!(rss_gethashconfig() & RSS_HASHTYPE_RSS_TCP_IPV6)) { + MLX5_SET(rx_hash_field_select, hfso, selected_fields, + MLX5_HASH_IP); + } else +#endif MLX5_SET(rx_hash_field_select, hfso, selected_fields, MLX5_HASH_ALL); break; @@ -1887,6 +1926,12 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_L3_PROT_TYPE_IPV4); MLX5_SET(rx_hash_field_select, hfso, l4_prot_type, MLX5_L4_PROT_TYPE_UDP); +#ifdef RSS + if (!(rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV4)) { + MLX5_SET(rx_hash_field_select, hfso, selected_fields, + MLX5_HASH_IP); + } else +#endif MLX5_SET(rx_hash_field_select, hfso, selected_fields, MLX5_HASH_ALL); break; @@ -1896,6 +1941,12 @@ mlx5e_build_tir_ctx(struct mlx5e_priv *p MLX5_L3_PROT_TYPE_IPV6); MLX5_SET(rx_hash_field_select, hfso, l4_prot_type, MLX5_L4_PROT_TYPE_UDP); +#ifdef RSS + if (!(rss_gethashconfig() & RSS_HASHTYPE_RSS_UDP_IPV6)) { + MLX5_SET(rx_hash_field_select, hfso, selected_fields, + MLX5_HASH_IP); + } else +#endif MLX5_SET(rx_hash_field_select, hfso, selected_fields, MLX5_HASH_ALL); break; @@ -2052,6 +2103,13 @@ mlx5e_open_locked(struct ifnet *ifp) if (test_bit(MLX5E_STATE_OPENED, &priv->state) != 0) return (0); +#ifdef RSS + if (rss_getnumbuckets() > priv->params.num_channels) { + if_printf(ifp, "NOTE: There are more RSS buckets(%u) than " + "channels(%u) available\n", rss_getnumbuckets(), + priv->params.num_channels); + } +#endif err = mlx5e_open_tises(priv); if (err) { if_printf(ifp, "%s: mlx5e_open_tises failed, %d\n", Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Dec 7 12:20:26 2015 (r291937) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Mon Dec 7 12:38:51 2015 (r291938) @@ -192,12 +192,43 @@ mlx5e_build_rx_mbuf(struct mlx5_cqe64 *c mb->m_pkthdr.len = mb->m_len = cqe_bcnt; /* check if a Toeplitz hash was computed */ - if (cqe->rss_hash_type != 0) + if (cqe->rss_hash_type != 0) { mb->m_pkthdr.flowid = be32_to_cpu(cqe->rss_hash_result); - else +#ifdef RSS + /* decode the RSS hash type */ + switch (cqe->rss_hash_type & + (CQE_RSS_DST_HTYPE_L4 | CQE_RSS_DST_HTYPE_IP)) { + /* IPv4 */ + case (CQE_RSS_DST_HTYPE_TCP | CQE_RSS_DST_HTYPE_IPV4): + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_TCP_IPV4); + break; + case (CQE_RSS_DST_HTYPE_UDP | CQE_RSS_DST_HTYPE_IPV4): + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_UDP_IPV4); + break; + case CQE_RSS_DST_HTYPE_IPV4: + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_IPV4); + break; + /* IPv6 */ + case (CQE_RSS_DST_HTYPE_TCP | CQE_RSS_DST_HTYPE_IPV6): + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_TCP_IPV6); + break; + case (CQE_RSS_DST_HTYPE_UDP | CQE_RSS_DST_HTYPE_IPV6): + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_UDP_IPV6); + break; + case CQE_RSS_DST_HTYPE_IPV6: + M_HASHTYPE_SET(mb, M_HASHTYPE_RSS_IPV6); + break; + default: /* Other */ + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + break; + } +#else + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); +#endif + } else { mb->m_pkthdr.flowid = rq->ix; - - M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); + } mb->m_pkthdr.rcvif = ifp; if (likely(ifp->if_capenable & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) && Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Mon Dec 7 12:20:26 2015 (r291937) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_tx.c Mon Dec 7 12:38:51 2015 (r291938) @@ -85,7 +85,15 @@ mlx5e_select_queue(struct ifnet *ifp, st /* check if flowid is set */ if (M_HASHTYPE_GET(mb) != M_HASHTYPE_NONE) { - ch = (mb->m_pkthdr.flowid % 128) % ch; +#ifdef RSS + u32 temp; + + if (rss_hash2bucket(mb->m_pkthdr.flowid, + M_HASHTYPE_GET(mb), &temp) == 0) + ch = temp % ch; + else +#endif + ch = (mb->m_pkthdr.flowid % 128) % ch; } else { #if (__FreeBSD_version >= 1100000) ch = m_ether_tcpip_hash(MBUF_HASHFLAG_L3 | Modified: head/sys/modules/mlx5/Makefile ============================================================================== --- head/sys/modules/mlx5/Makefile Mon Dec 7 12:20:26 2015 (r291937) +++ head/sys/modules/mlx5/Makefile Mon Dec 7 12:38:51 2015 (r291938) @@ -24,7 +24,7 @@ mlx5_uar.c \ mlx5_vport.c \ mlx5_wq.c \ device_if.h bus_if.h vnode_if.h pci_if.h \ - opt_inet.h opt_inet6.h opt_random.h + opt_inet.h opt_inet6.h opt_random.h opt_rss.h CFLAGS+= -I${.CURDIR}/../../ofed/include CFLAGS+= -I${.CURDIR}/../../compat/linuxkpi/common/include Modified: head/sys/modules/mlx5en/Makefile ============================================================================== --- head/sys/modules/mlx5en/Makefile Mon Dec 7 12:20:26 2015 (r291937) +++ head/sys/modules/mlx5en/Makefile Mon Dec 7 12:38:51 2015 (r291938) @@ -10,7 +10,7 @@ mlx5_en_flow_table.c \ mlx5_en_rx.c \ mlx5_en_txrx.c \ device_if.h bus_if.h vnode_if.h pci_if.h \ - opt_inet.h opt_inet6.h + opt_inet.h opt_inet6.h opt_rss.h .if defined(HAVE_TURBO_LRO) CFLAGS+= -DHAVE_TURBO_LRO From owner-svn-src-all@freebsd.org Mon Dec 7 13:10:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB18999ABB2; Mon, 7 Dec 2015 13:10:38 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66728132B; Mon, 7 Dec 2015 13:10:38 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by wmec201 with SMTP id c201so150041992wme.1; Mon, 07 Dec 2015 05:10:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=aF4ROdj7UudIysdLbbmufcXnboylhkmR8/zDbSGb+Vk=; b=qxvsf7jvx9p0CVeDla1kmvcCVNkDJuJbjt/C+si9edX9yv/Lvghw2o2y2NZZKpAgcK Ezt9jx94KCaC4xaBIYbIXYHxSTMgFANkmaq8pggC/l9Eyt0dEYjECsQF5cZHIm1qDMFi 0SCgNmZ7fPFgphkRkCzhCyW00FkoGuDXmYDbz50RThjn8vqeo5GkUv3Af9iGVox2rifp /cGTL3n4fkhsPE+OY4FhEiCFb56xck0kvAsa2JI+4WtCIWJ0iAdqtQpfJJgXM8aCJ8UR vTHeVZEV+YYMEt9a7Gp2R2UavCwvmMW1baa+xil7zGCWe7nIvuu2iKNqHu77rTRWlLxC gcow== X-Received: by 10.194.222.135 with SMTP id qm7mr33101936wjc.106.1449493836942; Mon, 07 Dec 2015 05:10:36 -0800 (PST) Received: from brick.home (acyr204.neoplus.adsl.tpnet.pl. [83.11.201.204]) by smtp.gmail.com with ESMTPSA id u205sm16490788wmb.12.2015.12.07.05.10.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Dec 2015 05:10:35 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Mon, 7 Dec 2015 14:10:32 +0100 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Steven Hartland Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291911 - head/sys/dev/iscsi Message-ID: <20151207131032.GA12870@brick.home> Mail-Followup-To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512070256.tB72u8C6057988@repo.freebsd.org> <20151207112235.GA12517@brick.home> <56656EA9.6050002@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <56656EA9.6050002@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 13:10:39 -0000 On 1207T1134, Steven Hartland wrote: > > > On 07/12/2015 11:22, Edward Tomasz NapieraÅ‚a wrote: > > On 1207T0256, Steven Hartland wrote: > >> Author: smh > >> Date: Mon Dec 7 02:56:08 2015 > >> New Revision: 291911 > >> URL: https://svnweb.freebsd.org/changeset/base/291911 > >> > >> Log: > >> Fix panic on shutdown due to iscsi event priority > >> > >> iscsi's shutdown_pre_sync prio was SHUTDOWN_PRI_FIRST which caused it to > >> run before other high priority handlers such as filesystems e.g. ZFS. > >> > >> This meant the iscsi sessions where removed before the ZFS geom consumer > >> was closed, resulting in a panic from g_access calls on debug kernels > >> due to negative acr. > >> > >> Instead use the same as the old iscsi_initiator SHUTDOWN_PRI_DEFAULT-1 > >> which allows it to run before dashutdown etc but after filesystems. > > I think this might be backwards. Have you tested the following scenario: > > > > 1. Establish the iSCSI session > > 2. Mount the LUN somewhere > > 3. Make the target not reachable (eg ifconfig down), so that the > > initiator tries to reconnect > > 4. Try to shutdown? > > > > Basically, the point of this code is to disable reconnects when there > > won't be any iscsid(8) instance to handle them. The iscsi_shutdown() > > isn't supposed to remove working iSCSI sessions. > I didn't notice your change in head / stable/10 compared to releng, so > I'm testing further updates now. Well, the difference is pretty crucial here - previously, the purpose of iscsi_shutdown() was to disconnect the sessions during shutdown. Now it doesn't do that at all - established connections are kept intact, it just disables reconnections. And for this to work, it needs to happen as soon as possible during shutdown. > Currently shutdown is run too early and actually doesn't actually > terminate any sessions. What does "currently" mean in this context? > My current theory is the issue you tried to fix in 286226 is actually > caused by the iscsi_maintenance_thread preferring reconnect over > terminate, so what you where seeing was the terminate never action for > reconnecting sessions. I'm currently trying to validate that theory now. > > If I'm right then the fix should be to revert the majority of 286226 and > move the processing of terminate above reconnect in > iscsi_maintenance_thread. I don't think that would work. The reason that the sessions don't terminate (in 11-CURRENT) is that they are not supposed to - unmounting filesystems will write data to LUNs, and we don't want to break that. The only reason iscsi_shutdown() exists is to prevent hang on shutdown when there are sessions that require reconnection and there is no way for it to succeed, because of iscsid is not running. From owner-svn-src-all@freebsd.org Mon Dec 7 13:16:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58F2399AD1E; Mon, 7 Dec 2015 13:16:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2215E1883; Mon, 7 Dec 2015 13:16:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7DGn1d045690; Mon, 7 Dec 2015 13:16:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7DGmNj045683; Mon, 7 Dec 2015 13:16:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512071316.tB7DGmNj045683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Dec 2015 13:16:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291939 - in head/sys: dev/mlx5 dev/mlx5/mlx5_core modules/mlx5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 13:16:50 -0000 Author: hselasky Date: Mon Dec 7 13:16:48 2015 New Revision: 291939 URL: https://svnweb.freebsd.org/changeset/base/291939 Log: Update the mlx5 shared driver code to the latest version, which include the following list of changes: - Added eswitch ACL table management Introduce API for managing ACL table. This API include the following features: 1) vlan filter - for VST/VGT+ support. 2) spoofcheck. 3) robust functionality to allow/drop general untagged/tagged traffic. 4) support for both ingress and egress ACL types. - Added loopback filter to the vacl table. - Added multicast list set in the vPort context - Added promiscuous mode set in the vPort context - Set the vlan list in vPort context 1) Check caps if VLAN list is not longer than FW supports 2) Set MODIFY_NIC_VPORT_CONTEXT command - Changed MLX5_EEPROM_MAX_BYTES from 48 to 32 so that a single EEPROM reading cannot cross the 128-byte boundary. Previously reading the MCIA register was done in batches of 48 bytes. The third reading would then by-pass the 127th byte, which means that part of the low page and part of the high page would be read at the same time, which created a bug: 1st: 0-47 bytes 2nd: 48-95 bytes 3rd: 96-143 bytes MFC after: 1 week Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4411 Added: head/sys/dev/mlx5/eswitch_vacl.h (contents, props changed) head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c (contents, props changed) Modified: head/sys/dev/mlx5/device.h head/sys/dev/mlx5/driver.h head/sys/dev/mlx5/mlx5_core/mlx5_eq.c head/sys/dev/mlx5/mlx5_core/mlx5_vport.c head/sys/dev/mlx5/vport.h head/sys/modules/mlx5/Makefile Modified: head/sys/dev/mlx5/device.h ============================================================================== --- head/sys/dev/mlx5/device.h Mon Dec 7 12:38:51 2015 (r291938) +++ head/sys/dev/mlx5/device.h Mon Dec 7 13:16:48 2015 (r291939) @@ -1023,6 +1023,25 @@ enum { MLX5_MODIFY_ESW_VPORT_CONTEXT_FIELD_SELECT_CVLAN_INSERT = 1 << 3 }; +enum { + MLX5_UC_ADDR_CHANGE = (1 << 0), + MLX5_MC_ADDR_CHANGE = (1 << 1), + MLX5_VLAN_CHANGE = (1 << 2), + MLX5_PROMISC_CHANGE = (1 << 3), + MLX5_MTU_CHANGE = (1 << 4), +}; + +enum mlx5_list_type { + MLX5_NIC_VPORT_LIST_TYPE_UC = 0x0, + MLX5_NIC_VPORT_LIST_TYPE_MC = 0x1, + MLX5_NIC_VPORT_LIST_TYPE_VLAN = 0x2, +}; + +enum { + MLX5_ESW_VPORT_ADMIN_STATE_DOWN = 0x0, + MLX5_ESW_VPORT_ADMIN_STATE_UP = 0x1, + MLX5_ESW_VPORT_ADMIN_STATE_AUTO = 0x2, +}; /* MLX5 DEV CAPs */ /* TODO: EAT.ME */ @@ -1087,6 +1106,22 @@ enum mlx5_cap_type { MLX5_GET(flow_table_eswitch_cap, \ mdev->hca_caps_max[MLX5_CAP_ESWITCH_FLOW_TABLE], cap) +#define MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(dev, \ + flow_table_properties_esw_acl_egress.cap) + +#define MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(dev, \ + flow_table_properties_esw_acl_egress.cap) + +#define MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE(dev, \ + flow_table_properties_esw_acl_ingress.cap) + +#define MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL_MAX(mdev, cap) \ + MLX5_CAP_ESW_FLOWTABLE_MAX(dev, \ + flow_table_properties_esw_acl_ingress.cap) + #define MLX5_CAP_ESW(mdev, cap) \ MLX5_GET(e_switch_cap, \ mdev->hca_caps_cur[MLX5_CAP_ESWITCH], cap) Modified: head/sys/dev/mlx5/driver.h ============================================================================== --- head/sys/dev/mlx5/driver.h Mon Dec 7 12:38:51 2015 (r291938) +++ head/sys/dev/mlx5/driver.h Mon Dec 7 13:16:48 2015 (r291939) @@ -934,7 +934,7 @@ struct mlx5_profile { }; -#define MLX5_EEPROM_MAX_BYTES 48 +#define MLX5_EEPROM_MAX_BYTES 32 #define MLX5_EEPROM_IDENTIFIER_BYTE_MASK 0x000000ff #define MLX5_EEPROM_REVISION_ID_BYTE_MASK 0x0000ff00 #define MLX5_EEPROM_PAGE_3_VALID_BIT_MASK 0x00040000 Added: head/sys/dev/mlx5/eswitch_vacl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/eswitch_vacl.h Mon Dec 7 13:16:48 2015 (r291939) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. 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 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 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 MLX5_ESWITCH_VACL_TABLE_H +#define MLX5_ESWITCH_VACL_TABLE_H + +#include + +void *mlx5_vacl_table_create(struct mlx5_core_dev *dev, + u16 vport, bool is_egress); +void mlx5_vacl_table_cleanup(void *acl_t); +int mlx5_vacl_table_add_vlan(void *acl_t, u16 vlan); +void mlx5_vacl_table_del_vlan(void *acl_t, u16 vlan); +int mlx5_vacl_table_enable_vlan_filter(void *acl_t); +void mlx5_vacl_table_disable_vlan_filter(void *acl_t); +int mlx5_vacl_table_drop_untagged(void *acl_t); +int mlx5_vacl_table_allow_untagged(void *acl_t); +int mlx5_vacl_table_drop_unknown_vlan(void *acl_t); +int mlx5_vacl_table_allow_unknown_vlan(void *acl_t); +int mlx5_vacl_table_set_spoofchk(void *acl_t, bool spoofchk, u8 *vport_mac); + +#endif /* MLX5_ESWITCH_VACL_TABLE_H */ Modified: head/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Dec 7 12:38:51 2015 (r291938) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eq.c Mon Dec 7 13:16:48 2015 (r291939) @@ -62,7 +62,6 @@ enum { (1ull << MLX5_EVENT_TYPE_WQ_INVAL_REQ_ERROR) | \ (1ull << MLX5_EVENT_TYPE_WQ_ACCESS_ERROR) | \ (1ull << MLX5_EVENT_TYPE_PORT_CHANGE) | \ - (1ull << MLX5_EVENT_TYPE_NIC_VPORT_CHANGE) | \ (1ull << MLX5_EVENT_TYPE_SRQ_CATAS_ERROR) | \ (1ull << MLX5_EVENT_TYPE_SRQ_LAST_WQE) | \ (1ull << MLX5_EVENT_TYPE_SRQ_RQ_LIMIT)) @@ -473,6 +472,10 @@ int mlx5_start_eqs(struct mlx5_core_dev async_event_mask |= (1ull << MLX5_EVENT_TYPE_CODING_PORT_MODULE_EVENT); + if (MLX5_CAP_GEN(dev, nic_vport_change_event)) + async_event_mask |= (1ull << + MLX5_EVENT_TYPE_NIC_VPORT_CHANGE); + err = mlx5_create_map_eq(dev, &table->cmd_eq, MLX5_EQ_VEC_CMD, MLX5_NUM_CMD_EQE, 1ull << MLX5_EVENT_TYPE_CMD, "mlx5_cmd_eq", &dev->priv.uuari.uars[0]); Added: head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/mlx5/mlx5_core/mlx5_eswitch_vacl.c Mon Dec 7 13:16:48 2015 (r291939) @@ -0,0 +1,803 @@ +/*- + * Copyright (c) 2013-2015, Mellanox Technologies, Ltd. 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 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 AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include "mlx5_core.h" + +enum { + MLX5_ACL_LOOPBACK_GROUP_IDX = 0, + MLX5_ACL_UNTAGGED_GROUP_IDX = 1, + MLX5_ACL_VLAN_GROUP_IDX = 2, + MLX5_ACL_UNKNOWN_VLAN_GROUP_IDX = 3, + MLX5_ACL_DEFAULT_GROUP_IDX = 4, + MLX5_ACL_GROUPS_NUM, +}; + +struct mlx_vacl_fr { + bool applied; + u32 fi; + u16 action; +}; + +struct mlx5_vacl_table { + struct mlx5_core_dev *dev; + u16 vport; + void *ft; + int max_ft_size; + int acl_type; + + struct mlx_vacl_fr loopback_fr; + struct mlx_vacl_fr untagged_fr; + struct mlx_vacl_fr unknown_vlan_fr; + struct mlx_vacl_fr default_fr; + + bool vlan_filter_enabled; + bool vlan_filter_applied; + unsigned long *vlan_allowed_bitmap; + u32 vlan_fi_table[4096]; + + bool spoofchk_enabled; + u8 smac[ETH_ALEN]; +}; + +static int mlx5_vacl_table_allow_vlan(void *acl_t, u16 vlan) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + u32 *flow_context = NULL; + void *in_match_criteria = NULL; + void *in_match_value = NULL; + u8 *smac; + int vlan_mc_enable = MLX5_MATCH_OUTER_HEADERS; + int err = 0; + + if (!test_bit(vlan, acl_table->vlan_allowed_bitmap)) + return -EINVAL; + + flow_context = mlx5_vzalloc(MLX5_ST_SZ_BYTES(flow_context)); + if (!flow_context) { + err = -ENOMEM; + goto out; + } + + in_match_criteria = mlx5_vzalloc(MLX5_ST_SZ_BYTES(fte_match_param)); + if (!in_match_criteria) { + err = -ENOMEM; + goto out; + } + + /* Apply vlan rule */ + MLX5_SET(flow_context, flow_context, action, + MLX5_FLOW_CONTEXT_ACTION_ALLOW); + in_match_value = MLX5_ADDR_OF(flow_context, flow_context, match_value); + MLX5_SET(fte_match_param, in_match_value, outer_headers.vlan_tag, 1); + MLX5_SET(fte_match_param, in_match_value, outer_headers.first_vid, + vlan); + MLX5_SET(fte_match_param, in_match_criteria, outer_headers.vlan_tag, 1); + MLX5_SET(fte_match_param, in_match_criteria, outer_headers.first_vid, + 0xfff); + if (acl_table->spoofchk_enabled) { + smac = MLX5_ADDR_OF(fte_match_param, + in_match_value, + outer_headers.smac_47_16); + ether_addr_copy(smac, acl_table->smac); + smac = MLX5_ADDR_OF(fte_match_param, + in_match_criteria, + outer_headers.smac_47_16); + memset(smac, 0xff, ETH_ALEN); + } + err = mlx5_add_flow_table_entry(acl_table->ft, vlan_mc_enable, + in_match_criteria, flow_context, + &acl_table->vlan_fi_table[vlan]); +out: + if (flow_context) + vfree(flow_context); + if (in_match_criteria) + vfree(in_match_criteria); + return err; +} + +static int mlx5_vacl_table_apply_loopback_filter(void *acl_t, u16 new_action) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + u8 loopback_mc_enable = MLX5_MATCH_MISC_PARAMETERS; + u32 *flow_context = NULL; + void *in_match_criteria = NULL; + void *in_match_value = NULL; + void *mv_misc = NULL; + void *mc_misc = NULL; + int err = 0; + + flow_context = mlx5_vzalloc(MLX5_ST_SZ_BYTES(flow_context)); + if (!flow_context) { + err = -ENOMEM; + goto out; + } + + in_match_criteria = mlx5_vzalloc(MLX5_ST_SZ_BYTES(fte_match_param)); + if (!in_match_criteria) { + err = -ENOMEM; + goto out; + } + + if (acl_table->loopback_fr.applied) + mlx5_del_flow_table_entry(acl_table->ft, + acl_table->loopback_fr.fi); + + /* Apply new loopback rule */ + MLX5_SET(flow_context, flow_context, action, new_action); + in_match_value = MLX5_ADDR_OF(flow_context, flow_context, match_value); + mv_misc = MLX5_ADDR_OF(fte_match_param, in_match_value, + misc_parameters); + mc_misc = MLX5_ADDR_OF(fte_match_param, in_match_criteria, + misc_parameters); + MLX5_SET(fte_match_set_misc, mv_misc, source_port, acl_table->vport); + + MLX5_SET_TO_ONES(fte_match_set_misc, mc_misc, source_port); + + err = mlx5_add_flow_table_entry(acl_table->ft, loopback_mc_enable, + in_match_criteria, flow_context, + &acl_table->loopback_fr.fi); + if (err) { + acl_table->loopback_fr.applied = false; + } else { + acl_table->loopback_fr.applied = true; + acl_table->loopback_fr.action = new_action; + } + +out: + if (flow_context) + vfree(flow_context); + if (in_match_criteria) + vfree(in_match_criteria); + return err; +} + +static int mlx5_vacl_table_apply_default(void *acl_t, u16 new_action) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + u8 default_mc_enable = 0; + u32 *flow_context = NULL; + void *in_match_criteria = NULL; + int err = 0; + + if (!acl_table->spoofchk_enabled) + return -EINVAL; + + flow_context = mlx5_vzalloc(MLX5_ST_SZ_BYTES(flow_context)); + if (!flow_context) { + err = -ENOMEM; + goto out; + } + + in_match_criteria = mlx5_vzalloc(MLX5_ST_SZ_BYTES(fte_match_param)); + if (!in_match_criteria) { + err = -ENOMEM; + goto out; + } + + if (acl_table->default_fr.applied) + mlx5_del_flow_table_entry(acl_table->ft, + acl_table->default_fr.fi); + + /* Apply new default rule */ + MLX5_SET(flow_context, flow_context, action, new_action); + err = mlx5_add_flow_table_entry(acl_table->ft, default_mc_enable, + in_match_criteria, flow_context, + &acl_table->default_fr.fi); + if (err) { + acl_table->default_fr.applied = false; + } else { + acl_table->default_fr.applied = true; + acl_table->default_fr.action = new_action; + } + +out: + if (flow_context) + vfree(flow_context); + if (in_match_criteria) + vfree(in_match_criteria); + return err; +} + +static int mlx5_vacl_table_apply_untagged(void *acl_t, u16 new_action) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + u8 untagged_mc_enable = MLX5_MATCH_OUTER_HEADERS; + u8 *smac; + u32 *flow_context = NULL; + void *in_match_criteria = NULL; + void *in_match_value = NULL; + int err = 0; + + flow_context = mlx5_vzalloc(MLX5_ST_SZ_BYTES(flow_context)); + if (!flow_context) { + err = -ENOMEM; + goto out; + } + + in_match_criteria = mlx5_vzalloc(MLX5_ST_SZ_BYTES(fte_match_param)); + if (!in_match_criteria) { + err = -ENOMEM; + goto out; + } + + if (acl_table->untagged_fr.applied) + mlx5_del_flow_table_entry(acl_table->ft, + acl_table->untagged_fr.fi); + + /* Apply new untagged rule */ + MLX5_SET(flow_context, flow_context, action, new_action); + in_match_value = MLX5_ADDR_OF(flow_context, flow_context, match_value); + MLX5_SET(fte_match_param, in_match_value, outer_headers.vlan_tag, 0); + MLX5_SET(fte_match_param, in_match_criteria, outer_headers.vlan_tag, 1); + if (acl_table->spoofchk_enabled) { + smac = MLX5_ADDR_OF(fte_match_param, + in_match_value, + outer_headers.smac_47_16); + ether_addr_copy(smac, acl_table->smac); + smac = MLX5_ADDR_OF(fte_match_param, + in_match_criteria, + outer_headers.smac_47_16); + memset(smac, 0xff, ETH_ALEN); + } + err = mlx5_add_flow_table_entry(acl_table->ft, untagged_mc_enable, + in_match_criteria, flow_context, + &acl_table->untagged_fr.fi); + if (err) { + acl_table->untagged_fr.applied = false; + } else { + acl_table->untagged_fr.applied = true; + acl_table->untagged_fr.action = new_action; + } + +out: + if (flow_context) + vfree(flow_context); + if (in_match_criteria) + vfree(in_match_criteria); + return err; +} + +static int mlx5_vacl_table_apply_unknown_vlan(void *acl_t, u16 new_action) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + u8 default_mc_enable = (!acl_table->spoofchk_enabled) ? 0 : + MLX5_MATCH_OUTER_HEADERS; + u32 *flow_context = NULL; + void *in_match_criteria = NULL; + void *in_match_value = NULL; + u8 *smac; + int err = 0; + + flow_context = mlx5_vzalloc(MLX5_ST_SZ_BYTES(flow_context)); + if (!flow_context) { + err = -ENOMEM; + goto out; + } + + in_match_criteria = mlx5_vzalloc(MLX5_ST_SZ_BYTES(fte_match_param)); + if (!in_match_criteria) { + err = -ENOMEM; + goto out; + } + + if (acl_table->unknown_vlan_fr.applied) + mlx5_del_flow_table_entry(acl_table->ft, + acl_table->unknown_vlan_fr.fi); + + /* Apply new unknown vlan rule */ + MLX5_SET(flow_context, flow_context, action, new_action); + if (acl_table->spoofchk_enabled) { + in_match_value = MLX5_ADDR_OF(flow_context, flow_context, + match_value); + smac = MLX5_ADDR_OF(fte_match_param, + in_match_value, + outer_headers.smac_47_16); + ether_addr_copy(smac, acl_table->smac); + smac = MLX5_ADDR_OF(fte_match_param, + in_match_criteria, + outer_headers.smac_47_16); + memset(smac, 0xff, ETH_ALEN); + } + err = mlx5_add_flow_table_entry(acl_table->ft, default_mc_enable, + in_match_criteria, flow_context, + &acl_table->unknown_vlan_fr.fi); + if (err) { + acl_table->unknown_vlan_fr.applied = false; + } else { + acl_table->unknown_vlan_fr.applied = true; + acl_table->unknown_vlan_fr.action = new_action; + } + +out: + if (flow_context) + vfree(flow_context); + if (in_match_criteria) + vfree(in_match_criteria); + return err; +} + +static int mlx5_vacl_table_apply_vlan_filter(void *acl_t) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + int index = 0; + int err_index = 0; + int err = 0; + + if (acl_table->vlan_filter_applied) + return 0; + + for (index = find_first_bit(acl_table->vlan_allowed_bitmap, 4096); + index < 4096; + index = find_next_bit(acl_table->vlan_allowed_bitmap, + 4096, ++index)) { + err = mlx5_vacl_table_allow_vlan(acl_t, index); + if (err) + goto err_disable_vlans; + } + + acl_table->vlan_filter_applied = true; + return 0; + +err_disable_vlans: + for (err_index = find_first_bit(acl_table->vlan_allowed_bitmap, 4096); + err_index < index; + err_index = find_next_bit(acl_table->vlan_allowed_bitmap, 4096, + ++err_index)) { + mlx5_del_flow_table_entry(acl_table->ft, + acl_table->vlan_fi_table[err_index]); + } + return err; +} + +static void mlx5_vacl_table_disapply_vlan_filter(void *acl_t) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + int index = 0; + + if (!acl_table->vlan_filter_applied) + return; + + for (index = find_first_bit(acl_table->vlan_allowed_bitmap, 4096); + index < 4096; + index = find_next_bit(acl_table->vlan_allowed_bitmap, 4096, + ++index)) { + mlx5_del_flow_table_entry(acl_table->ft, + acl_table->vlan_fi_table[index]); + } + + acl_table->vlan_filter_applied = false; +} + +static void mlx5_vacl_table_disapply_all_filters(void *acl_t) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + + if (acl_table->default_fr.applied) { + mlx5_del_flow_table_entry(acl_table->ft, + acl_table->default_fr.fi); + acl_table->default_fr.applied = false; + } + if (acl_table->unknown_vlan_fr.applied) { + mlx5_del_flow_table_entry(acl_table->ft, + acl_table->unknown_vlan_fr.fi); + acl_table->unknown_vlan_fr.applied = false; + } + if (acl_table->loopback_fr.applied) { + mlx5_del_flow_table_entry(acl_table->ft, + acl_table->loopback_fr.fi); + acl_table->loopback_fr.applied = false; + } + if (acl_table->untagged_fr.applied) { + mlx5_del_flow_table_entry(acl_table->ft, + acl_table->untagged_fr.fi); + acl_table->untagged_fr.applied = false; + } + if (acl_table->vlan_filter_applied) { + mlx5_vacl_table_disapply_vlan_filter(acl_t); + acl_table->vlan_filter_applied = false; + } +} + +static int mlx5_vacl_table_apply_all_filters(void *acl_t) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + int err = 0; + + if (!acl_table->default_fr.applied && acl_table->spoofchk_enabled) { + err = mlx5_vacl_table_apply_default(acl_table, + acl_table->default_fr.action); + if (err) + goto err_disapply_all; + } + + if (!acl_table->unknown_vlan_fr.applied) { + err = mlx5_vacl_table_apply_unknown_vlan(acl_table, + acl_table->unknown_vlan_fr.action); + if (err) + goto err_disapply_all; + } + + if (!acl_table->loopback_fr.applied && + acl_table->acl_type == MLX5_FLOW_TABLE_TYPE_EGRESS_ACL) { + err = mlx5_vacl_table_apply_loopback_filter( + acl_table, + acl_table->loopback_fr.action); + if (err) + goto err_disapply_all; + } + + if (!acl_table->untagged_fr.applied) { + err = mlx5_vacl_table_apply_untagged(acl_table, + acl_table->untagged_fr.action); + if (err) + goto err_disapply_all; + } + + if (!acl_table->vlan_filter_applied && acl_table->vlan_filter_enabled) { + err = mlx5_vacl_table_apply_vlan_filter(acl_t); + if (err) + goto err_disapply_all; + } + + goto out; + +err_disapply_all: + mlx5_vacl_table_disapply_all_filters(acl_t); + +out: + return err; +} + +static void mlx5_vacl_table_destroy_ft(void *acl_t) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + + mlx5_vacl_table_disapply_all_filters(acl_t); + if (acl_table->ft) + mlx5_destroy_flow_table(acl_table->ft); + acl_table->ft = NULL; +} + +static int mlx5_vacl_table_create_ft(void *acl_t, bool spoofchk) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + int log_acl_ft_size; + int err = 0; + int groups_num = MLX5_ACL_GROUPS_NUM - 1; + int shift_idx = MLX5_ACL_UNTAGGED_GROUP_IDX; + u8 *smac; + struct mlx5_flow_table_group *g; + + if (acl_table->ft) + return -EINVAL; + + g = kcalloc(MLX5_ACL_GROUPS_NUM, sizeof(*g), GFP_KERNEL); + if (!g) + goto out; + + acl_table->spoofchk_enabled = spoofchk; + + /* + * for vlan group + */ + log_acl_ft_size = 4096; + /* + * for loopback filter rule + */ + log_acl_ft_size += 1; + /* + * for untagged rule + */ + log_acl_ft_size += 1; + /* + * for unknown vlan rule + */ + log_acl_ft_size += 1; + /* + * for default rule + */ + log_acl_ft_size += 1; + + log_acl_ft_size = order_base_2(log_acl_ft_size); + log_acl_ft_size = min_t(int, log_acl_ft_size, acl_table->max_ft_size); + + if (log_acl_ft_size < 2) + goto out; + + if (acl_table->acl_type == MLX5_FLOW_TABLE_TYPE_EGRESS_ACL) { + /* Loopback filter group */ + g[MLX5_ACL_LOOPBACK_GROUP_IDX].log_sz = 0; + g[MLX5_ACL_LOOPBACK_GROUP_IDX].match_criteria_enable = + MLX5_MATCH_MISC_PARAMETERS; + MLX5_SET_TO_ONES(fte_match_param, + g[MLX5_ACL_LOOPBACK_GROUP_IDX].match_criteria, + misc_parameters.source_port); + groups_num++; + shift_idx = MLX5_ACL_LOOPBACK_GROUP_IDX; + } + /* Untagged traffic group */ + g[MLX5_ACL_UNTAGGED_GROUP_IDX - shift_idx].log_sz = 0; + g[MLX5_ACL_UNTAGGED_GROUP_IDX - shift_idx].match_criteria_enable = + MLX5_MATCH_OUTER_HEADERS; + MLX5_SET(fte_match_param, + g[MLX5_ACL_UNTAGGED_GROUP_IDX - shift_idx].match_criteria, + outer_headers.vlan_tag, 1); + if (spoofchk) { + smac = MLX5_ADDR_OF(fte_match_param, + g[MLX5_ACL_UNTAGGED_GROUP_IDX - shift_idx] + .match_criteria, + outer_headers.smac_47_16); + memset(smac, 0xff, ETH_ALEN); + } + + /* Allowed vlans group */ + g[MLX5_ACL_VLAN_GROUP_IDX - shift_idx].log_sz = log_acl_ft_size - 1; + g[MLX5_ACL_VLAN_GROUP_IDX - shift_idx].match_criteria_enable = + MLX5_MATCH_OUTER_HEADERS; + MLX5_SET(fte_match_param, + g[MLX5_ACL_VLAN_GROUP_IDX - shift_idx].match_criteria, + outer_headers.vlan_tag, 1); + MLX5_SET(fte_match_param, + g[MLX5_ACL_VLAN_GROUP_IDX - shift_idx].match_criteria, + outer_headers.first_vid, 0xfff); + if (spoofchk) { + smac = MLX5_ADDR_OF(fte_match_param, + g[MLX5_ACL_VLAN_GROUP_IDX - shift_idx] + .match_criteria, + outer_headers.smac_47_16); + memset(smac, 0xff, ETH_ALEN); + } + + /* Unknown vlan traffic group */ + g[MLX5_ACL_UNKNOWN_VLAN_GROUP_IDX - shift_idx].log_sz = 0; + g[MLX5_ACL_UNKNOWN_VLAN_GROUP_IDX - shift_idx].match_criteria_enable = + (spoofchk ? MLX5_MATCH_OUTER_HEADERS : 0); + if (spoofchk) { + smac = MLX5_ADDR_OF( + fte_match_param, + g[MLX5_ACL_UNKNOWN_VLAN_GROUP_IDX - shift_idx] + .match_criteria, + outer_headers.smac_47_16); + memset(smac, 0xff, ETH_ALEN); + } + + /* + * Default group - for spoofchk only. + */ + g[MLX5_ACL_DEFAULT_GROUP_IDX - shift_idx].log_sz = 0; + g[MLX5_ACL_DEFAULT_GROUP_IDX - shift_idx].match_criteria_enable = 0; + + acl_table->ft = mlx5_create_flow_table(acl_table->dev, + 0, + acl_table->acl_type, + acl_table->vport, + groups_num, + g); + if (!acl_table->ft) { + err = -ENOMEM; + goto out; + } + + err = mlx5_vacl_table_apply_all_filters(acl_t); + if (err) + goto err_destroy_ft; + + goto out; + +err_destroy_ft: + mlx5_vacl_table_destroy_ft(acl_table->ft); + acl_table->ft = NULL; + +out: + kfree(g); + return err; +} + +void *mlx5_vacl_table_create(struct mlx5_core_dev *dev, + u16 vport, bool is_egress) +{ + struct mlx5_vacl_table *acl_table; + int err = 0; + + if (is_egress && !MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL(dev, ft_support)) + return NULL; + + if (!is_egress && !MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL(dev, ft_support)) + return NULL; + + acl_table = kzalloc(sizeof(*acl_table), GFP_KERNEL); + if (!acl_table) + return NULL; + + acl_table->acl_type = is_egress ? MLX5_FLOW_TABLE_TYPE_EGRESS_ACL : + MLX5_FLOW_TABLE_TYPE_INGRESS_ACL; + acl_table->max_ft_size = (is_egress ? + MLX5_CAP_ESW_FLOWTABLE_EGRESS_ACL(dev, + log_max_ft_size) : + MLX5_CAP_ESW_FLOWTABLE_INGRESS_ACL(dev, + log_max_ft_size)); + acl_table->dev = dev; + acl_table->vport = vport; + + /* + * default behavior : Allow and if spoofchk drop the default + */ + acl_table->default_fr.action = MLX5_FLOW_CONTEXT_ACTION_DROP; + acl_table->loopback_fr.action = MLX5_FLOW_CONTEXT_ACTION_DROP; + acl_table->unknown_vlan_fr.action = MLX5_FLOW_CONTEXT_ACTION_ALLOW; + acl_table->untagged_fr.action = MLX5_FLOW_CONTEXT_ACTION_ALLOW; + err = mlx5_vacl_table_create_ft(acl_table, false); + if (err) + goto err_free_acl_table; + + acl_table->vlan_allowed_bitmap = kcalloc(BITS_TO_LONGS(4096), + sizeof(uintptr_t), + GFP_KERNEL); + if (!acl_table->vlan_allowed_bitmap) + goto err_destroy_ft; + + goto out; + +err_destroy_ft: + mlx5_vacl_table_destroy_ft(acl_table->ft); + acl_table->ft = NULL; + +err_free_acl_table: + kfree(acl_table); + acl_table = NULL; + +out: + return (void *)acl_table; +} +EXPORT_SYMBOL(mlx5_vacl_table_create); + +void mlx5_vacl_table_cleanup(void *acl_t) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + + mlx5_vacl_table_destroy_ft(acl_t); + kfree(acl_table->vlan_allowed_bitmap); + kfree(acl_table); +} +EXPORT_SYMBOL(mlx5_vacl_table_cleanup); + +int mlx5_vacl_table_add_vlan(void *acl_t, u16 vlan) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + int err = 0; + + if (test_bit(vlan, acl_table->vlan_allowed_bitmap)) + return 0; + __set_bit(vlan, acl_table->vlan_allowed_bitmap); + if (!acl_table->vlan_filter_applied) + return 0; + + err = mlx5_vacl_table_allow_vlan(acl_t, vlan); + if (err) + goto err_clear_vbit; + + goto out; + +err_clear_vbit: + __clear_bit(vlan, acl_table->vlan_allowed_bitmap); + +out: + return err; +} +EXPORT_SYMBOL(mlx5_vacl_table_add_vlan); + +void mlx5_vacl_table_del_vlan(void *acl_t, u16 vlan) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + + if (!test_bit(vlan, acl_table->vlan_allowed_bitmap)) + return; + + __clear_bit(vlan, acl_table->vlan_allowed_bitmap); + + if (!acl_table->vlan_filter_applied) + return; + + mlx5_del_flow_table_entry(acl_table->ft, + acl_table->vlan_fi_table[vlan]); +} +EXPORT_SYMBOL(mlx5_vacl_table_del_vlan); + +int mlx5_vacl_table_enable_vlan_filter(void *acl_t) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + + acl_table->vlan_filter_enabled = true; + return mlx5_vacl_table_apply_vlan_filter(acl_t); +} +EXPORT_SYMBOL(mlx5_vacl_table_enable_vlan_filter); + +void mlx5_vacl_table_disable_vlan_filter(void *acl_t) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + + acl_table->vlan_filter_enabled = false; + mlx5_vacl_table_disapply_vlan_filter(acl_t); +} +EXPORT_SYMBOL(mlx5_vacl_table_disable_vlan_filter); + +int mlx5_vacl_table_drop_untagged(void *acl_t) +{ + return mlx5_vacl_table_apply_untagged(acl_t, + MLX5_FLOW_CONTEXT_ACTION_DROP); +} +EXPORT_SYMBOL(mlx5_vacl_table_drop_untagged); + +int mlx5_vacl_table_allow_untagged(void *acl_t) +{ + return mlx5_vacl_table_apply_untagged(acl_t, + MLX5_FLOW_CONTEXT_ACTION_ALLOW); +} +EXPORT_SYMBOL(mlx5_vacl_table_allow_untagged); + +int mlx5_vacl_table_drop_unknown_vlan(void *acl_t) +{ + return mlx5_vacl_table_apply_unknown_vlan(acl_t, + MLX5_FLOW_CONTEXT_ACTION_DROP); +} +EXPORT_SYMBOL(mlx5_vacl_table_drop_unknown_vlan); + +int mlx5_vacl_table_allow_unknown_vlan(void *acl_t) +{ + return mlx5_vacl_table_apply_unknown_vlan(acl_t, + MLX5_FLOW_CONTEXT_ACTION_ALLOW); +} +EXPORT_SYMBOL(mlx5_vacl_table_allow_unknown_vlan); + +int mlx5_vacl_table_set_spoofchk(void *acl_t, bool spoofchk, u8 *vport_mac) +{ + struct mlx5_vacl_table *acl_table = (struct mlx5_vacl_table *)acl_t; + int err = 0; + + if (spoofchk == acl_table->spoofchk_enabled) { + if (!spoofchk || + (spoofchk && !memcmp(acl_table->smac, vport_mac, ETH_ALEN))) + return 0; + } + + ether_addr_copy(acl_table->smac, vport_mac); + if (spoofchk != acl_table->spoofchk_enabled) { + mlx5_vacl_table_destroy_ft(acl_t); + err = mlx5_vacl_table_create_ft(acl_t, spoofchk); + } else { + mlx5_vacl_table_disapply_all_filters(acl_t); + err = mlx5_vacl_table_apply_all_filters(acl_t); + } + + return err; +} +EXPORT_SYMBOL(mlx5_vacl_table_set_spoofchk); + Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vport.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_vport.c Mon Dec 7 12:38:51 2015 (r291938) +++ head/sys/dev/mlx5/mlx5_core/mlx5_vport.c Mon Dec 7 13:16:48 2015 (r291939) @@ -328,7 +328,8 @@ int mlx5_set_nic_vport_current_mac(struc MLX5_SET(modify_nic_vport_context_in, in, field_select.addresses_list, 1); MLX5_SET(modify_nic_vport_context_in, in, - nic_vport_context.allowed_list_type, 0); + nic_vport_context.allowed_list_type, + MLX5_NIC_VPORT_LIST_TYPE_UC); MLX5_SET(modify_nic_vport_context_in, in, nic_vport_context.allowed_list_size, 1); @@ -345,6 +346,131 @@ int mlx5_set_nic_vport_current_mac(struc return err; } EXPORT_SYMBOL_GPL(mlx5_set_nic_vport_current_mac); + +int mlx5_set_nic_vport_vlan_list(struct mlx5_core_dev *dev, u32 vport, + u16 *vlan_list, int list_len) +{ + void *in, *ctx; + int i, err; + int inlen = MLX5_ST_SZ_BYTES(modify_nic_vport_context_in) + + MLX5_ST_SZ_BYTES(vlan_layout) * (int)list_len; + + int max_list_size = 1 << MLX5_CAP_GEN_MAX(dev, log_max_vlan_list); + + if (list_len > max_list_size) { + mlx5_core_warn(dev, "Requested list size (%d) > (%d) max_list_size\n", + list_len, max_list_size); + return -ENOSPC; + } + + in = mlx5_vzalloc(inlen); + if (!in) { + mlx5_core_warn(dev, "failed to allocate inbox\n"); + return -ENOMEM; + } + + MLX5_SET(modify_nic_vport_context_in, in, vport_number, vport); + if (vport) + MLX5_SET(modify_nic_vport_context_in, in, + other_vport, 1); + MLX5_SET(modify_nic_vport_context_in, in, + field_select.addresses_list, 1); + + ctx = MLX5_ADDR_OF(modify_nic_vport_context_in, in, nic_vport_context); + + MLX5_SET(nic_vport_context, ctx, allowed_list_type, + MLX5_NIC_VPORT_LIST_TYPE_VLAN); + MLX5_SET(nic_vport_context, ctx, allowed_list_size, list_len); + + for (i = 0; i < list_len; i++) { + u8 *vlan_lout = MLX5_ADDR_OF(nic_vport_context, ctx, + current_uc_mac_address[i]); + MLX5_SET(vlan_layout, vlan_lout, vlan, vlan_list[i]); + } + + err = mlx5_modify_nic_vport_context(dev, in, inlen); + + kvfree(in); + return err; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Dec 7 13:18:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E88199AD9B; Mon, 7 Dec 2015 13:18:07 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C151B1AF5; Mon, 7 Dec 2015 13:18:06 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by wmww144 with SMTP id w144so139983664wmw.1; Mon, 07 Dec 2015 05:18:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=lXd6lb94WFNgCYr8+3291gShBdpq2Au72sG2LBrYFFw=; b=X2xgmlJXQEjrFY1fLJ6ABuMvbN2SAU5HNWBDnz9NelnTED+9oyX1hPQMNBVZ9LdANT ikELyUdcoZGFoZO/5eE9KIEH7EgEdDP5g/sOJphRyBJerjyxhalYgVqM9N7sD7gBozVv uTUE77lkJPEd4iNZ3E7xcawFTmQEG3+REZ+DgYDtRmDJ+z40Si7LeRPg3puOKzEl4D9A uwjN0BwqULgyX9w9CYxUY+fUDktKccokw1S9/1PSVkZ1BnhoD13U6tu9pVr/nry7z4Ew ilVqGLkyIPulsr9nu+SUXK8hsl1TSTHA1U1IyUnd5QjqLGJhFvmUKG+9ja0m4hoIbyPF 8Elg== X-Received: by 10.28.64.7 with SMTP id n7mr21473841wma.30.1449494285352; Mon, 07 Dec 2015 05:18:05 -0800 (PST) Received: from brick.home (acyr204.neoplus.adsl.tpnet.pl. [83.11.201.204]) by smtp.gmail.com with ESMTPSA id c194sm16576691wmd.13.2015.12.07.05.18.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Dec 2015 05:18:04 -0800 (PST) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Mon, 7 Dec 2015 14:18:01 +0100 From: "trasz@freebsd.org" To: Steven Hartland Cc: Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r291911 - head/sys/dev/iscsi Message-ID: <20151207131801.GB12870@brick.home> Mail-Followup-To: Steven Hartland , Andriy Gapon , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201512070256.tB72u8C6057988@repo.freebsd.org> <56652A09.1030106@FreeBSD.org> <56656CCF.8070700@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56656CCF.8070700@freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 13:18:07 -0000 On 1207T1126, Steven Hartland wrote: > > > On 07/12/2015 06:41, Andriy Gapon wrote: > > On 07/12/2015 04:56, Steven Hartland wrote: > >> Author: smh > >> Date: Mon Dec 7 02:56:08 2015 > >> New Revision: 291911 > >> URL: https://svnweb.freebsd.org/changeset/base/291911 > >> > >> Log: > >> Fix panic on shutdown due to iscsi event priority > >> > >> iscsi's shutdown_pre_sync prio was SHUTDOWN_PRI_FIRST which caused it to > >> run before other high priority handlers such as filesystems e.g. ZFS. > >> > >> This meant the iscsi sessions where removed before the ZFS geom consumer > >> was closed, resulting in a panic from g_access calls on debug kernels > >> due to negative acr. > >> > >> Instead use the same as the old iscsi_initiator SHUTDOWN_PRI_DEFAULT-1 > >> which allows it to run before dashutdown etc but after filesystems. > >> > >> MFC after: 2 weeks > >> Sponsored by: Multiplay > >> > >> Modified: > >> head/sys/dev/iscsi/iscsi.c > >> > >> Modified: head/sys/dev/iscsi/iscsi.c > >> ============================================================================== > >> --- head/sys/dev/iscsi/iscsi.c Sun Dec 6 21:31:09 2015 (r291910) > >> +++ head/sys/dev/iscsi/iscsi.c Mon Dec 7 02:56:08 2015 (r291911) > >> @@ -2365,7 +2365,7 @@ iscsi_load(void) > >> sc->sc_cdev->si_drv1 = sc; > >> > >> sc->sc_shutdown_eh = EVENTHANDLER_REGISTER(shutdown_pre_sync, > >> - iscsi_shutdown, sc, SHUTDOWN_PRI_FIRST); > >> + iscsi_shutdown, sc, SHUTDOWN_PRI_DEFAULT-1); > >> > >> return (0); > >> } > > It would be nice to also add a comment here explaining the priority. > > And spaces around '-' operator. > Ah, there was actually already a comment there but seems that's been > removed in HEAD by r286226 which also changed the post_sync to a > pre_sync so its currently really broken in HEAD and stable/10 compared > to 10.2. Surprisingly this was already mentioned by mav in the review of > said commit (https://reviews.freebsd.org/D3052). It was removed, because it was no longer applicable to the new code. > The style was copied from iscsi_initiator, I'll fix them both. > > I'm retesting this to validate down session recovery now and will update > once I've confirmed that. I have a feeling that r291911 fixes a problem that existed in previous releases, but was fixed long ago by r286226. From owner-svn-src-all@freebsd.org Mon Dec 7 14:50:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CB729B7212 for ; Mon, 7 Dec 2015 14:50:33 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lb0-f169.google.com (mail-lb0-f169.google.com [209.85.217.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 94C1B10BF for ; Mon, 7 Dec 2015 14:50:32 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lbpu9 with SMTP id u9so26642426lbp.2 for ; Mon, 07 Dec 2015 06:50:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=akAUkTdFjJ/CPY3YBdVs1GGkzptUJrAvzM37GbJF+Vs=; b=CXYUww5k/7y2+ay73KfddWF7zxD7uSz5WBLszcVtNQzSZ5TCHTnGWXzfcrs2d/E/09 Pin1KlkNP3Z/diNSy3emyi1eN6lSzuaVjNFd2+T8h+eD8yMktZr3iC0lSrv0ZMHUA0Bb s7iYf8Xah4xL+8bQ+P97bx0A6zfjHi1GLXOCIHHX5tHPsIFEpGx5GJzic1k4y3Qczhuh TRSqrNYF5qHkrGibTsOFRITOsau1Sy8jDIbZHhjCIwUr06g9+5qSvQlmBtbktP9NYxDS H0EdTc7TnHqUt/9uBM9S6kbb0U3TS7LC2iM8J7BLFtB/YrAqB49YZAkw/OW7gfDjw56O Fx5w== X-Gm-Message-State: ALoCoQkaJtTgq570EYWCeBS7B0XrKt3I5kSNP6GBe+ghDJfrZExY4DhHcFmv5e87PV3iFOHGbOuW X-Received: by 10.112.200.163 with SMTP id jt3mr13705912lbc.68.1449499346075; Mon, 07 Dec 2015 06:42:26 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id m75sm4973319lfg.15.2015.12.07.06.42.24 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Dec 2015 06:42:25 -0800 (PST) Subject: Re: svn commit: r291936 - head/sys/ufs/ufs To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512071209.tB7C94hd024620@repo.freebsd.org> From: Andrey Chernov Message-ID: <56659AD0.2000706@freebsd.org> Date: Mon, 7 Dec 2015 17:42:24 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201512071209.tB7C94hd024620@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 14:50:33 -0000 On 07.12.2015 15:09, Konstantin Belousov wrote: > Author: kib > Date: Mon Dec 7 12:09:04 2015 > New Revision: 291936 > URL: https://svnweb.freebsd.org/changeset/base/291936 > > Log: > Update ctime when atime or birthtime are updated. Who calls ufs_itimes() and when to process IN_CHANGE flag in the new version? > - ufs_itimes(vp); > + ip->i_flag |= IN_CHANGE | IN_MODIFIED; -- http://ache.vniz.net/ From owner-svn-src-all@freebsd.org Mon Dec 7 14:57:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D65D49B7914; Mon, 7 Dec 2015 14:57:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail106.syd.optusnet.com.au (mail106.syd.optusnet.com.au [211.29.132.42]) by mx1.freebsd.org (Postfix) with ESMTP id A031B186C; Mon, 7 Dec 2015 14:57:56 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail106.syd.optusnet.com.au (Postfix) with ESMTPS id EAC5E3C8472; Tue, 8 Dec 2015 01:57:48 +1100 (AEDT) Date: Tue, 8 Dec 2015 01:57:47 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Konstantin Belousov cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291936 - head/sys/ufs/ufs In-Reply-To: <201512071209.tB7C94hd024620@repo.freebsd.org> Message-ID: <20151208011115.P7632@besplex.bde.org> References: <201512071209.tB7C94hd024620@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=OX0rTVhBeDaU2BaNTDYA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 14:57:57 -0000 On Mon, 7 Dec 2015, Konstantin Belousov wrote: > Log: > Update ctime when atime or birthtime are updated. > > Cleanup setting of ctime/mtime/birthtime: do not set IN_ACCESS or > IN_UPDATE, then clear them with ufs_itimes(), making transient > (possibly inconsistent) change to the times, and then copy > user-supplied times into the inode. Instead, directly clear IN_ACCESS > or IN_UPDATE when user supplied the time, and copy the value into the > inode. > > Minor inconsistency left is that the inode ctime is updated even when > birthtime update attempt is performed on a UFS1 volume. > > Submitted by: bde > MFC after: 2 weeks Thanks. I forgot to remind yo to make the same change in other file systems. Especially ext2fs. msdosfs already has as much as possible of this. POSIX generally requires even null changes of attributes to update the ctime, so it is not wrong to always update the ctime when the only change is for an unsupported birthtime. This also happens for other file systems that don't support birthtimes. Other file systems might also not support other timestamps. msdosfs doesn't support ctimes so it doesn't need to worry about setting them for null and ignored changes to other timestamps. It ignores attempts to set unsupported times, like ffs does for birthtimes. Some versions of msdosfs support birthtimes, but msdosfs_setattr() doesn't support them. But POSIX also requires omitted changes of attributes to update the ctime. For timestamp attributes, it even requires the security hole of updating the ctime when changing the other times fails (perhaps due to no permission to change them), and the nonsense of updating the ctime when the file doesn't exist. The security hole and the nonsense are because POSIX is missing "successful" in the usual wording "Upon successful completion" in one place. The cases with omitted changes occur mainly for utimensat(). UTIME_OMIT for both times gives 2 omitted changes and not 2 null changes. Clearly the ctime should not be changed when all changes are omitted. But POSIX requires utimensat() to mark the ctime for update on all completions. This gives the security hole but not the nonsense of acting on a nonexistent file in a way in a less unintentional way than the missing "successful". POSIX requires not doing the permissions tests for omitted changes. So 2 omitted changes normally result in success for files that would fail the permissions tests for non-omitted changes. Then the correct "Upon successful completion" wording requires marking the ctime. Some other syscalls like chown() provide another way of omitting changes: Uid (uid_t)-1 means to use the current uid of the file, etc. This is closer to a null change than an omitted change. FressBSD has a different set of bugs in this area. For utimes() and also for utimensat(), it has the undocumented behaviour of turning times with tv_sec == -1 into the equivalent of UTIME_OMIT, the standard utimes() doesn't have such a feature and standard utimensat() is only supposed to have this feature by magic values in tv_nsec. Similarly for chown(). For file times, this is the accidental result of an implementation detail. For chown(), it is more intentional. POSIX chown() has smaller wording bugs and doesn't require the security hole. Most appplications do extra work to avoid null changes. It is unclear if this is allowed. Maybe chown -R root:wheel / is require to update the ctime for all files, not just the ones it makes non-null changes to. This is negatively useful, but not disallowed. Bruce From owner-svn-src-all@freebsd.org Mon Dec 7 15:24:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C00E29B73CD for ; Mon, 7 Dec 2015 15:24:12 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com [209.85.217.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 76B9E1C0D for ; Mon, 7 Dec 2015 15:24:12 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by lbblt2 with SMTP id lt2so67341568lbb.3 for ; Mon, 07 Dec 2015 07:24:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=FdNuVhwFrWX45JoYmzsSx43hznYUUD+UUrTZfVQsaDg=; b=aUu1d7ONF7bRH4w5eLfplxfjACWrcQOQcDza+J0H/o51Vm7gy45hWJq7Lv2Yvf8Hhz Hql69p6AGJJeFpAZsGdQuokMHFb/mn55UlasaVv0ezNzX9ATzqo4vNUdlBInSgI/hytH rhCg2GuAaEKE7SE4BI98nPVv6AUYu1UUICTe+/OVEVB4r9dIlIG1yG8HngP0IvHqiNIe Dfaz3MS6j2nh57Qtg3C6otfeQ/D1SZ4oTNB2Fz8yeAZCAniakiHX+g1YCZKVjwPq/kJ1 Zcm0r5SLSZuZyxxlNs9DsLMRP/I3JMeDfCo1KYoAg9HzMgX3rkQtW0k8BxkTw8rwDuhN 1bLg== X-Gm-Message-State: ALoCoQluSW+YH51/36UsKC5sH12FtgV08qXoMt26VDLS6sBitQ+PfpqT1azuuR6rY9QDq4sFAMd0 X-Received: by 10.25.89.70 with SMTP id n67mr14647240lfb.160.1449500076267; Mon, 07 Dec 2015 06:54:36 -0800 (PST) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id dz7sm4932226lbc.21.2015.12.07.06.54.35 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Dec 2015 06:54:35 -0800 (PST) Subject: Re: svn commit: r291936 - head/sys/ufs/ufs To: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512071209.tB7C94hd024620@repo.freebsd.org> <56659AD0.2000706@freebsd.org> From: Andrey Chernov Message-ID: <56659DAA.1060000@freebsd.org> Date: Mon, 7 Dec 2015 17:54:34 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <56659AD0.2000706@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 15:24:12 -0000 On 07.12.2015 17:42, Andrey Chernov wrote: > On 07.12.2015 15:09, Konstantin Belousov wrote: >> Author: kib >> Date: Mon Dec 7 12:09:04 2015 >> New Revision: 291936 >> URL: https://svnweb.freebsd.org/changeset/base/291936 >> >> Log: >> Update ctime when atime or birthtime are updated. > > Who calls ufs_itimes() and when to process IN_CHANGE flag in the new > version? > >> - ufs_itimes(vp); >> + ip->i_flag |= IN_CHANGE | IN_MODIFIED; > New version also forces IN_MODIFIED flag old one tends to avoid (only for birthtime, and only for non-suspended systems in ufs_itimes()). -- http://ache.vniz.net/ From owner-svn-src-all@freebsd.org Mon Dec 7 15:28:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD3599B76C4 for ; Mon, 7 Dec 2015 15:28:05 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5051C1D1F for ; Mon, 7 Dec 2015 15:28:05 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wmec201 with SMTP id c201so170930347wme.0 for ; Mon, 07 Dec 2015 07:28:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=ruCahpWNeT/30ldHW0DygOqYR7ji8+QwDMjYf9xMEs8=; b=mmLexwTd7Zxc5ZCBLsBKs0jOYoJMGTZkJ8IcxV1nXZM7xmNL6Anji5IYAE1prCR1W0 Qh+Oz7mTYKWXe4xifTfCshmaYhKb9iNz0pW5nkPkrHTlVTbb5tjPRp+fV1kIGOhksiUA XF57YchmeGgMbYruefgPDTNosjJ0j7YnG7aMerQg6gBRCWY+y7HaTnLLlcn2FUsdYu1X Laay1W5GWZLXbIEYTjUF5GEt94PwqJeDbypWePlJlFptxNOY77mhPoXzJvqEuEI40n2r W3IZOBScdPCqX/ugFGdHIdozMScY/Ney/dUJWkV5K6YP3ehCdwqBCtIlKwswaN5ZzuKT h3mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=ruCahpWNeT/30ldHW0DygOqYR7ji8+QwDMjYf9xMEs8=; b=g9JHKRH31BGScgdQNAUk10were1SrNJh26O9pZ9JF2ycB79/AMS/urYuMe7ZUL30AI jgbD4hgO4CWBvou84tW/9ad2fiyki6FmTpiqjLJDhk+fjd80eVSnwbTXNm0CaQq/Noxv 6J23+RcykczelWOPo51NJKP+lbYOsnCq9+4yhKyxqRL/GkA40U5lnrl6dBm5FNsaTRaj RFC1BQgzU9YJlmzE90+lvkHyZNFoKzfvAF6NmY8ltXKSL5Q56R//Va0GJxgJioJltw+x sgqJkjkvEL/amXTu2XwtLO3JcQLwn7yj7tTt5iK6MFcPD45U62JPuSkcrTUDLDi6JTmO aJog== X-Gm-Message-State: ALoCoQlI7kv4boAB3Upkt3I1sPHcNhR1jvIrRsH/4QFRJzdN4DqfvWzpis8q19phCqUz4D18e6OY X-Received: by 10.194.84.4 with SMTP id u4mr39817652wjy.149.1449502082992; Mon, 07 Dec 2015 07:28:02 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id q74sm22238472wmd.0.2015.12.07.07.28.01 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Dec 2015 07:28:01 -0800 (PST) Subject: Re: svn commit: r291911 - head/sys/dev/iscsi To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512070256.tB72u8C6057988@repo.freebsd.org> <20151207112235.GA12517@brick.home> <56656EA9.6050002@freebsd.org> <20151207131032.GA12870@brick.home> From: Steven Hartland Message-ID: <5665A586.4030304@multiplay.co.uk> Date: Mon, 7 Dec 2015 15:28:06 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151207131032.GA12870@brick.home> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 15:28:05 -0000 On 07/12/2015 13:10, Edward Tomasz NapieraÅ‚a wrote: > isn't supposed to remove working iSCSI sessions. >> I didn't notice your change in head / stable/10 compared to releng, so >> I'm testing further updates now. > Well, the difference is pretty crucial here - previously, the purpose of > iscsi_shutdown() was to disconnect the sessions during shutdown. Now it > doesn't do that at all - established connections are kept intact, it just > disables reconnections. And for this to work, it needs to happen as soon > as possible during shutdown. More information on why this needs to happen as soon as possible would be appreciated. > >> Currently shutdown is run too early and actually doesn't actually >> terminate any sessions. > What does "currently" mean in this context? HEAD / stable/10. > >> My current theory is the issue you tried to fix in 286226 is actually >> caused by the iscsi_maintenance_thread preferring reconnect over >> terminate, so what you where seeing was the terminate never action for >> reconnecting sessions. I'm currently trying to validate that theory now. >> >> If I'm right then the fix should be to revert the majority of 286226 and >> move the processing of terminate above reconnect in >> iscsi_maintenance_thread. > I don't think that would work. The reason that the sessions don't > terminate (in 11-CURRENT) is that they are not supposed to - unmounting > filesystems will write data to LUNs, and we don't want to break that. Agreed, which is why I believe it needs to do so after filesystem shutdown, not before, which is what was happening prior to r286226. > The only reason iscsi_shutdown() exists is to prevent hang on shutdown > when there are sessions that require reconnection and there is no way > for it to succeed, because of iscsid is not running. It should also really cleanup and disconnect from the SAN, which it currently doesn't. I've reproduced the hang you described on shutdown. It should be noted that if there are outstanding writes we still see a hang even with r286226. I've posted a review https://reviews.freebsd.org/D4429, which I believe achieves your goal as well as ensuring the sessions are closed before reboot, so if we can take discussion there that would be great. Hopefully it won't take to long to conclude, if however it does I'll backout r291911 as on its own doesn't help. Thanks for everyone's feedback, so far, its always appreciated :) Regards Steve From owner-svn-src-all@freebsd.org Mon Dec 7 15:36:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A66BF9B7F51; Mon, 7 Dec 2015 15:36:23 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail104.syd.optusnet.com.au (mail104.syd.optusnet.com.au [211.29.132.246]) by mx1.freebsd.org (Postfix) with ESMTP id 702E8139C; Mon, 7 Dec 2015 15:36:22 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail104.syd.optusnet.com.au (Postfix) with ESMTPS id 7419D425D7A; Tue, 8 Dec 2015 02:36:14 +1100 (AEDT) Date: Tue, 8 Dec 2015 02:36:13 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andrey Chernov cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291936 - head/sys/ufs/ufs In-Reply-To: <56659DAA.1060000@freebsd.org> Message-ID: <20151208015835.R7743@besplex.bde.org> References: <201512071209.tB7C94hd024620@repo.freebsd.org> <56659AD0.2000706@freebsd.org> <56659DAA.1060000@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=h08S0WsfbbBYEloxp-gA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 15:36:23 -0000 On Mon, 7 Dec 2015, Andrey Chernov wrote: > On 07.12.2015 17:42, Andrey Chernov wrote: >> On 07.12.2015 15:09, Konstantin Belousov wrote: >>> Author: kib >>> Date: Mon Dec 7 12:09:04 2015 >>> New Revision: 291936 >>> URL: https://svnweb.freebsd.org/changeset/base/291936 >>> >>> Log: >>> Update ctime when atime or birthtime are updated. >> >> Who calls ufs_itimes() and when to process IN_CHANGE flag in the new >> version? UFS_UPDATE() is called next and it call ufs_itimes(). Converting IN_CHANGE from a mark to a time could be delayed safely, but the other changes should be written soon. We use a delayed write, so they are not actually written very soon, and this could be optimized a little. Setting IN_LAZYACCESS might work as a hack (just some flag that the syncer checks and calls UFS_UPDATE() to clear). Only do this for unimportant attributes like times. For ids, I would go the other way and tell UFS_UPDATE() to do an async update. It currently only supports a waitfor boolean flag which selects bwrite() if set and normally bdwrite() if clear unless under load when it selects bawrite() if clear. >>> - ufs_itimes(vp); >>> + ip->i_flag |= IN_CHANGE | IN_MODIFIED; >> > > New version also forces IN_MODIFIED flag old one tends to avoid (only > for birthtime, and only for non-suspended systems in ufs_itimes()). That was mostly obfuscation in the old version: - for settings of the atime only, we modified the atime (possibly with a null change) but don't set IN_MODIFIED. ufs_itimes() fixeed this up by translating IN_ACCESS to a modification of the atime and a setting of IN_MODIFIED. This is depends on not being in the suspended case. Then we overwrote the modification with the final one before writing - for settings of the mtime only, ufs_itimes() fixes up IN_MODIFIED in the same way except this is obviously not affected by the suspended flag - for settings of the birthtime only, ufs_itimes() had no effect unless some update marks were already set, so we had to set IN_MODIFIED directly. The suspended case makes the side effects of ufs_itimes() even harder to understand, except it doesn't actually occur for calls from VOP_SETATTR(), since setattr is like write() -- it arranges for exclusive access and not suspended. Bruce From owner-svn-src-all@freebsd.org Mon Dec 7 16:08:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 910EB9A05E8; Mon, 7 Dec 2015 16:08:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6DB891B58; Mon, 7 Dec 2015 16:08:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7G8AGL095379; Mon, 7 Dec 2015 16:08:10 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7G89BZ095366; Mon, 7 Dec 2015 16:08:09 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512071608.tB7G89BZ095366@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 7 Dec 2015 16:08:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291941 - in head: lib/libpam/modules/pam_ssh secure/lib/libssh secure/libexec/sftp-server secure/libexec/ssh-keysign secure/libexec/ssh-pkcs11-helper secure/usr.bin/scp secure/usr.bin/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 16:08:11 -0000 Author: bdrewery Date: Mon Dec 7 16:08:09 2015 New Revision: 291941 URL: https://svnweb.freebsd.org/changeset/base/291941 Log: Replace unneeded manual dependency on header by adding it to SRCS. bsd.lib.mk and bsd.prog.mk already depend all objs on headers in SRCS if there is not yet a depend file. The headers in SRCS are never built or installed. After 'make depend' the header was already added as a proper dependency on the objects where needed. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libpam/modules/pam_ssh/Makefile head/secure/lib/libssh/Makefile head/secure/libexec/sftp-server/Makefile head/secure/libexec/ssh-keysign/Makefile head/secure/libexec/ssh-pkcs11-helper/Makefile head/secure/usr.bin/scp/Makefile head/secure/usr.bin/sftp/Makefile head/secure/usr.bin/ssh-add/Makefile head/secure/usr.bin/ssh-agent/Makefile head/secure/usr.bin/ssh-keygen/Makefile head/secure/usr.bin/ssh-keyscan/Makefile head/secure/usr.bin/ssh/Makefile head/secure/usr.sbin/sshd/Makefile Modified: head/lib/libpam/modules/pam_ssh/Makefile ============================================================================== --- head/lib/libpam/modules/pam_ssh/Makefile Mon Dec 7 13:30:52 2015 (r291940) +++ head/lib/libpam/modules/pam_ssh/Makefile Mon Dec 7 16:08:09 2015 (r291941) @@ -12,11 +12,10 @@ SRCS+= roaming_dummy.c WARNS?= 3 CFLAGS+= -I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h LIBADD= ssh .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: head/secure/lib/libssh/Makefile ============================================================================== --- head/secure/lib/libssh/Makefile Mon Dec 7 13:30:52 2015 (r291940) +++ head/secure/lib/libssh/Makefile Mon Dec 7 16:08:09 2015 (r291941) @@ -38,9 +38,11 @@ LIBADD+= ldns .endif CFLAGS+= -I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h +SRCS+= krb5_config.h .endif NO_LINT= @@ -50,8 +52,3 @@ LIBADD+= crypto crypt z .include .PATH: ${SSHDIR} ${SSHDIR}/openbsd-compat - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h -.if ${MK_KERBEROS_SUPPORT} != "no" -${OBJS} ${POBJS} ${SOBJS}: krb5_config.h -.endif Modified: head/secure/libexec/sftp-server/Makefile ============================================================================== --- head/secure/libexec/sftp-server/Makefile Mon Dec 7 13:30:52 2015 (r291940) +++ head/secure/libexec/sftp-server/Makefile Mon Dec 7 16:08:09 2015 (r291941) @@ -6,6 +6,7 @@ PROG= sftp-server SRCS= sftp-server.c sftp-common.c sftp-server-main.c MAN= sftp-server.8 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if !defined(NO_SHARED) # required when linking with a dynamic libssh @@ -23,5 +24,3 @@ CFLAGS+= -DHAVE_LDNS=1 .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: head/secure/libexec/ssh-keysign/Makefile ============================================================================== --- head/secure/libexec/ssh-keysign/Makefile Mon Dec 7 13:30:52 2015 (r291940) +++ head/secure/libexec/ssh-keysign/Makefile Mon Dec 7 16:08:09 2015 (r291941) @@ -6,6 +6,7 @@ PROG= ssh-keysign SRCS= ssh-keysign.c roaming_dummy.c readconf.c MAN= ssh-keysign.8 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h BINMODE=4555 LIBADD= ssh @@ -21,5 +22,3 @@ LIBADD+= crypto .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: head/secure/libexec/ssh-pkcs11-helper/Makefile ============================================================================== --- head/secure/libexec/ssh-pkcs11-helper/Makefile Mon Dec 7 13:30:52 2015 (r291940) +++ head/secure/libexec/ssh-pkcs11-helper/Makefile Mon Dec 7 16:08:09 2015 (r291941) @@ -6,6 +6,7 @@ PROG= ssh-pkcs11-helper SRCS= ssh-pkcs11.c ssh-pkcs11-helper.c MAN= ssh-pkcs11-helper.8 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if !defined(NO_SHARED) # required when linking with a dynamic libssh @@ -25,5 +26,3 @@ LIBADD+= crypto .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: head/secure/usr.bin/scp/Makefile ============================================================================== --- head/secure/usr.bin/scp/Makefile Mon Dec 7 13:30:52 2015 (r291940) +++ head/secure/usr.bin/scp/Makefile Mon Dec 7 16:08:09 2015 (r291941) @@ -5,6 +5,7 @@ PROG= scp SRCS= scp.c CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if !defined(NO_SHARED) # required when linking with a dynamic libssh @@ -22,5 +23,3 @@ CFLAGS+= -DHAVE_LDNS=1 .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: head/secure/usr.bin/sftp/Makefile ============================================================================== --- head/secure/usr.bin/sftp/Makefile Mon Dec 7 13:30:52 2015 (r291940) +++ head/secure/usr.bin/sftp/Makefile Mon Dec 7 16:08:09 2015 (r291941) @@ -5,6 +5,7 @@ PROG= sftp SRCS= sftp.c sftp-client.c sftp-common.c sftp-glob.c progressmeter.c CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if !defined(NO_SHARED) # required when linking with a dynamic libssh @@ -22,5 +23,3 @@ CFLAGS+= -DHAVE_LDNS=1 .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: head/secure/usr.bin/ssh-add/Makefile ============================================================================== --- head/secure/usr.bin/ssh-add/Makefile Mon Dec 7 13:30:52 2015 (r291940) +++ head/secure/usr.bin/ssh-add/Makefile Mon Dec 7 16:08:09 2015 (r291941) @@ -5,6 +5,7 @@ PROG= ssh-add SRCS+= ssh-add.c CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if !defined(NO_SHARED) # required when linking with a dynamic libssh @@ -22,5 +23,3 @@ CFLAGS+= -DHAVE_LDNS=1 .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: head/secure/usr.bin/ssh-agent/Makefile ============================================================================== --- head/secure/usr.bin/ssh-agent/Makefile Mon Dec 7 13:30:52 2015 (r291940) +++ head/secure/usr.bin/ssh-agent/Makefile Mon Dec 7 16:08:09 2015 (r291941) @@ -5,6 +5,7 @@ PROG= ssh-agent SRCS= ssh-agent.c CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if !defined(NO_SHARED) # required when linking with a dynamic libssh @@ -24,5 +25,3 @@ LIBADD+= crypto .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: head/secure/usr.bin/ssh-keygen/Makefile ============================================================================== --- head/secure/usr.bin/ssh-keygen/Makefile Mon Dec 7 13:30:52 2015 (r291940) +++ head/secure/usr.bin/ssh-keygen/Makefile Mon Dec 7 16:08:09 2015 (r291941) @@ -5,6 +5,7 @@ PROG= ssh-keygen SRCS= ssh-keygen.c CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h .if !defined(NO_SHARED) # required when linking with a dynamic libssh @@ -22,5 +23,3 @@ LIBADD+= crypto .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: head/secure/usr.bin/ssh-keyscan/Makefile ============================================================================== --- head/secure/usr.bin/ssh-keyscan/Makefile Mon Dec 7 13:30:52 2015 (r291940) +++ head/secure/usr.bin/ssh-keyscan/Makefile Mon Dec 7 16:08:09 2015 (r291941) @@ -5,6 +5,7 @@ PROG= ssh-keyscan SRCS= ssh-keyscan.c roaming_dummy.c CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h LIBADD= ssh @@ -17,5 +18,3 @@ CFLAGS+= -DHAVE_LDNS=1 .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h Modified: head/secure/usr.bin/ssh/Makefile ============================================================================== --- head/secure/usr.bin/ssh/Makefile Mon Dec 7 13:30:52 2015 (r291940) +++ head/secure/usr.bin/ssh/Makefile Mon Dec 7 16:08:09 2015 (r291941) @@ -3,7 +3,6 @@ .include PROG= ssh -CFLAGS+=-I${SSHDIR} -include ssh_namespace.h LINKS= ${BINDIR}/ssh ${BINDIR}/slogin MAN= ssh.1 ssh_config.5 MLINKS= ssh.1 slogin.1 @@ -15,6 +14,9 @@ SRCS= ssh.c readconf.c clientloop.c ssht # gss-genr.c really belongs in libssh; see src/secure/lib/libssh/Makefile SRCS+= gss-genr.c +CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h + LIBADD= ssh .if ${MK_LDNS} != "no" @@ -23,6 +25,7 @@ CFLAGS+= -DHAVE_LDNS=1 .if ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h +SRCS+= krb5_config.h LIBADD+= gssapi .endif @@ -35,8 +38,3 @@ CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h -.if ${MK_KERBEROS_SUPPORT} != "no" -${OBJS} ${POBJS} ${SOBJS}: krb5_config.h -.endif Modified: head/secure/usr.sbin/sshd/Makefile ============================================================================== --- head/secure/usr.sbin/sshd/Makefile Mon Dec 7 13:30:52 2015 (r291940) +++ head/secure/usr.sbin/sshd/Makefile Mon Dec 7 16:08:09 2015 (r291941) @@ -24,6 +24,7 @@ SRCS+= gss-genr.c MAN= sshd.8 sshd_config.5 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h +SRCS+= ssh_namespace.h # pam should always happen before ssh here for static linking LIBADD= pam ssh util wrap @@ -41,6 +42,7 @@ LIBADD+= bsm .if ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h +SRCS+= krb5_config.h LIBADD+= gssapi_krb5 gssapi krb5 .endif @@ -53,8 +55,3 @@ CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin .include .PATH: ${SSHDIR} - -${OBJS} ${POBJS} ${SOBJS}: ssh_namespace.h -.if ${MK_KERBEROS_SUPPORT} != "no" -${OBJS} ${POBJS} ${SOBJS}: krb5_config.h -.endif From owner-svn-src-all@freebsd.org Mon Dec 7 16:08:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 429B49A0604; Mon, 7 Dec 2015 16:08:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 135421B73; Mon, 7 Dec 2015 16:08:15 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7G8EWi095426; Mon, 7 Dec 2015 16:08:14 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7G8ER0095424; Mon, 7 Dec 2015 16:08:14 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512071608.tB7G8ER0095424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 7 Dec 2015 16:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291942 - in head: bin/freebsd-version usr.bin/xo/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 16:08:15 -0000 Author: bdrewery Date: Mon Dec 7 16:08:13 2015 New Revision: 291942 URL: https://svnweb.freebsd.org/changeset/base/291942 Log: Add missing CLEANFILES. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/bin/freebsd-version/Makefile head/usr.bin/xo/tests/Makefile Modified: head/bin/freebsd-version/Makefile ============================================================================== --- head/bin/freebsd-version/Makefile Mon Dec 7 16:08:09 2015 (r291941) +++ head/bin/freebsd-version/Makefile Mon Dec 7 16:08:13 2015 (r291942) @@ -2,7 +2,7 @@ SCRIPTS = freebsd-version MAN = freebsd-version.1 -CLEANFILES = freebsd-version.sh +CLEANFILES = freebsd-version freebsd-version.sh NEWVERS = ${.CURDIR}/../../sys/conf/newvers.sh freebsd-version.sh: ${.CURDIR}/freebsd-version.sh.in ${NEWVERS} Modified: head/usr.bin/xo/tests/Makefile ============================================================================== --- head/usr.bin/xo/tests/Makefile Mon Dec 7 16:08:09 2015 (r291941) +++ head/usr.bin/xo/tests/Makefile Mon Dec 7 16:08:13 2015 (r291942) @@ -32,6 +32,7 @@ FILES+= xo_01.XP.err FILES+= xo_01.XP.out SCRIPTS+= xo_01 +CLEANFILES+= xo_01 LIBADD+= xo From owner-svn-src-all@freebsd.org Mon Dec 7 16:08:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69FD29A061F; Mon, 7 Dec 2015 16:08:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FC921C67; Mon, 7 Dec 2015 16:08:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7G8HM7095473; Mon, 7 Dec 2015 16:08:17 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7G8H6v095472; Mon, 7 Dec 2015 16:08:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512071608.tB7G8H6v095472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 7 Dec 2015 16:08:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291943 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 16:08:18 -0000 Author: bdrewery Date: Mon Dec 7 16:08:16 2015 New Revision: 291943 URL: https://svnweb.freebsd.org/changeset/base/291943 Log: FAST_DEPEND: Only try to use dependencies from C/C++ SRCS as mkdep did. Rather than try to guess at all of the OBJS variables just use SRCS using the same patterns that mkdep does. This also fixes a mistake where dependencies were being generated with FAST_DEPEND when they were not for mkdep. This happens when OBJS!=SRCS as is the case in gnu/lib/csu where SRCS has 1 file and OBJS has several other files that does not even contain the 1 SRCS file. Generally in these cases the OBJS have custom dependencies defined in their Makefile. If we generate dependencies for those and then load a .depend file, then .IMPSRC may contain duplicate sources and lead to errors such as: cc: error: cannot specify -o when generating multiple output files MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Dec 7 16:08:13 2015 (r291942) +++ head/share/mk/bsd.dep.mk Mon Dec 7 16:08:16 2015 (r291943) @@ -66,7 +66,10 @@ DEPEND_FILTER= C,/,_,g DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} DEPEND_CFLAGS+= -MT${.TARGET} CFLAGS+= ${DEPEND_CFLAGS} -DEPENDOBJS+= ${OBJS} ${POBJS} ${SOBJS} +DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} +.if !empty(DEPENDSRCS) +DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} +.endif .for __obj in ${DEPENDOBJS:O:u} .if ${.MAKEFLAGS:M-V} == "" .sinclude "${DEPENDFILE}.${__obj:${DEPEND_FILTER}}" From owner-svn-src-all@freebsd.org Mon Dec 7 16:08:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5ED849A064A; Mon, 7 Dec 2015 16:08:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16CD21D78; Mon, 7 Dec 2015 16:08:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7G8Kia095518; Mon, 7 Dec 2015 16:08:20 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7G8KgJ095517; Mon, 7 Dec 2015 16:08:20 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512071608.tB7G8KgJ095517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 7 Dec 2015 16:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291944 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 16:08:21 -0000 Author: bdrewery Date: Mon Dec 7 16:08:19 2015 New Revision: 291944 URL: https://svnweb.freebsd.org/changeset/base/291944 Log: FAST_DEPEND: Move handling code below yacc/lex/dtrace code that modified SRCS. This fixes some of those newly added SRCS not having their depend files included. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Dec 7 16:08:16 2015 (r291943) +++ head/share/mk/bsd.dep.mk Mon Dec 7 16:08:19 2015 (r291944) @@ -57,26 +57,6 @@ _MKDEPCC+= ${DEPFLAGS} MKDEPCMD?= CC='${_MKDEPCC}' mkdep DEPENDFILE?= .depend DEPENDFILES= ${DEPENDFILE} -.if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == "" -DEPENDFILES+= ${DEPENDFILE}.* -DEPEND_MP?= -MP -# Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to -# avoid collisions. -DEPEND_FILTER= C,/,_,g -DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} -DEPEND_CFLAGS+= -MT${.TARGET} -CFLAGS+= ${DEPEND_CFLAGS} -DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} -.if !empty(DEPENDSRCS) -DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} -.endif -.for __obj in ${DEPENDOBJS:O:u} -.if ${.MAKEFLAGS:M-V} == "" -.sinclude "${DEPENDFILE}.${__obj:${DEPEND_FILTER}}" -.endif -DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj:${DEPEND_FILTER}} -.endfor -.endif # ${MK_FAST_DEPEND} == "yes" # Keep `tags' here, before SRCS are mangled below for `depend'. .if !target(tags) && defined(SRCS) && !defined(NO_TAGS) @@ -168,7 +148,29 @@ ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$/ .endfor beforedepend: ${DHDRS} beforebuild: ${DHDRS} + + +.if ${MK_FAST_DEPEND} == "yes" && ${.MAKE.MODE:Unormal:Mmeta*} == "" +DEPENDFILES+= ${DEPENDFILE}.* +DEPEND_MP?= -MP +# Handle OBJS=../somefile.o hacks. Just replace '/' rather than use :T to +# avoid collisions. +DEPEND_FILTER= C,/,_,g +DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} +DEPEND_CFLAGS+= -MT${.TARGET} +CFLAGS+= ${DEPEND_CFLAGS} +DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} +.if !empty(DEPENDSRCS) +DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} +.endif +.for __obj in ${DEPENDOBJS:O:u} +.if ${.MAKEFLAGS:M-V} == "" +.sinclude "${DEPENDFILE}.${__obj:${DEPEND_FILTER}}" .endif +DEPENDFILES_OBJS+= ${DEPENDFILE}.${__obj:${DEPEND_FILTER}} +.endfor +.endif # ${MK_FAST_DEPEND} == "yes" +.endif # defined(SRCS) .if ${MK_DIRDEPS_BUILD} == "yes" .include From owner-svn-src-all@freebsd.org Mon Dec 7 16:08:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADB9F9A06A8; Mon, 7 Dec 2015 16:08:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 36EA11E6E; Mon, 7 Dec 2015 16:08:24 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7G8NYN095566; Mon, 7 Dec 2015 16:08:23 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7G8Npk095564; Mon, 7 Dec 2015 16:08:23 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512071608.tB7G8Npk095564@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 7 Dec 2015 16:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291945 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 16:08:24 -0000 Author: bdrewery Date: Mon Dec 7 16:08:22 2015 New Revision: 291945 URL: https://svnweb.freebsd.org/changeset/base/291945 Log: FAST_DEPEND: Only pass -MF if we care about the object being compiled. This will save time generating dependency files that we didn't expect due to cases where SRCS!=OBJS or for building custom targetted objects in Makefiles that do not end up in the DEPENDOBJS list. This uses a bmake trick to modify CFLAGS based on ${.TARGET}. A .PARSEDIR check is done for the sake of MFC safety. MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.lib.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Mon Dec 7 16:08:19 2015 (r291944) +++ head/share/mk/bsd.dep.mk Mon Dec 7 16:08:22 2015 (r291945) @@ -158,7 +158,14 @@ DEPEND_MP?= -MP DEPEND_FILTER= C,/,_,g DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} DEPEND_CFLAGS+= -MT${.TARGET} +.if defined(.PARSEDIR) +# Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS +# as those are the only ones we will include. +DEPEND_CFLAGS_CONDITION= !empty(DEPENDOBJS:M${.TARGET:${DEPEND_FILTER}}) +CFLAGS+= ${${DEPEND_CFLAGS_CONDITION}:?${DEPEND_CFLAGS}:} +.else CFLAGS+= ${DEPEND_CFLAGS} +.endif DEPENDSRCS= ${SRCS:M*.[cSC]} ${SRCS:M*.cxx} ${SRCS:M*.cpp} ${SRCS:M*.cc} .if !empty(DEPENDSRCS) DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Mon Dec 7 16:08:19 2015 (r291944) +++ head/share/mk/bsd.lib.mk Mon Dec 7 16:08:22 2015 (r291945) @@ -182,6 +182,7 @@ lib${LIB_PRIVATE}${LIB}.a: ${OBJS} ${STA .if ${MK_PROFILE} != "no" && defined(LIB) && !empty(LIB) _LIBS+= lib${LIB_PRIVATE}${LIB}_p.a POBJS+= ${OBJS:.o=.po} ${STATICOBJS:.o=.po} +DEPENDOBJS+= ${POBJS} CLEANFILES+= ${POBJS} lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} @@ -194,6 +195,7 @@ lib${LIB_PRIVATE}${LIB}_p.a: ${POBJS} .if defined(SHLIB_NAME) || \ defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) SOBJS+= ${OBJS:.o=.So} +DEPENDOBJS+= ${SOBJS} CLEANFILES+= ${SOBJS} .endif From owner-svn-src-all@freebsd.org Mon Dec 7 16:08:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 833C79A06B6; Mon, 7 Dec 2015 16:08:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2EE5B1FAF; Mon, 7 Dec 2015 16:08:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7G8QBh095612; Mon, 7 Dec 2015 16:08:26 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7G8Qqo095611; Mon, 7 Dec 2015 16:08:26 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512071608.tB7G8Qqo095611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 7 Dec 2015 16:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291946 - head/targets/pseudo/gcc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 16:08:27 -0000 Author: bdrewery Date: Mon Dec 7 16:08:26 2015 New Revision: 291946 URL: https://svnweb.freebsd.org/changeset/base/291946 Log: Garbage collect removed directories. Sponsored by: EMC / Isilon Storage Division Modified: head/targets/pseudo/gcc/Makefile.depend Modified: head/targets/pseudo/gcc/Makefile.depend ============================================================================== --- head/targets/pseudo/gcc/Makefile.depend Mon Dec 7 16:08:22 2015 (r291945) +++ head/targets/pseudo/gcc/Makefile.depend Mon Dec 7 16:08:26 2015 (r291946) @@ -11,11 +11,9 @@ DIRDEPS = \ gnu/usr.bin/cc/cc \ gnu/usr.bin/cc/cc1 \ gnu/usr.bin/cc/include \ - gnu/usr.bin/cc/doc \ gnu/usr.bin/cc/cpp \ gnu/usr.bin/cc/cc1plus \ gnu/usr.bin/cc/c++ \ - gnu/usr.bin/cc/c++filt \ gnu/usr.bin/cc/gcov \ From owner-svn-src-all@freebsd.org Mon Dec 7 16:27:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1E119B9DB9; Mon, 7 Dec 2015 16:27:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD0831382; Mon, 7 Dec 2015 16:27:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7GRBf3001387; Mon, 7 Dec 2015 16:27:11 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7GRBIQ001386; Mon, 7 Dec 2015 16:27:11 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512071627.tB7GRBIQ001386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 7 Dec 2015 16:27:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291947 - head/sys/i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 16:27:13 -0000 Author: jhb Date: Mon Dec 7 16:27:11 2015 New Revision: 291947 URL: https://svnweb.freebsd.org/changeset/base/291947 Log: Set %esp correctly in the extended TSS. The pcb is saved at the top of the kernel stack on x86 platforms. The initial kenrel stack pointer is set in the TSS so that the trapframe from user -> kernel transitions begins directly below the pcb and grows down. The XSAVE changes moved the FPU save area out of the pcb and into a variable-sized area after the pcb. This required updating the expressions to calculate the initial stack pointer from 'stacktop - sizeof(pcb)' to 'stacktop - sizeof(pcb) + FPU save area size'. The i386_set_ioperm() system call allows user applications to access individual I/O ports via the I/O port permission bitmap in the TSS. On FreeBSD this requires allocating a custom per-process TSS instead of using the shared per-CPU TSS. The expression to initialize the initial kernel stack pointer in the per-process TSS created for i386_set_ioperm() was not properly updated after the XSAVE changes. Processes that used i386_set_ioperm() would trash the trapframe during subsequent context switches resulting in panics from memory corruption. This changes fixes the kernel stack pointer calculation for the per-process TSS. Reviewed by: kib, n_hibma Reported by: n_hibma MFC after: 1 week Modified: head/sys/i386/i386/sys_machdep.c Modified: head/sys/i386/i386/sys_machdep.c ============================================================================== --- head/sys/i386/i386/sys_machdep.c Mon Dec 7 16:08:26 2015 (r291946) +++ head/sys/i386/i386/sys_machdep.c Mon Dec 7 16:27:11 2015 (r291947) @@ -275,8 +275,7 @@ i386_extend_pcb(struct thread *td) ext = (struct pcb_ext *)kmem_malloc(kernel_arena, ctob(IOPAGES+1), M_WAITOK | M_ZERO); /* -16 is so we can convert a trapframe into vm86trapframe inplace */ - ext->ext_tss.tss_esp0 = td->td_kstack + ctob(td->td_kstack_pages) - - sizeof(struct pcb) - 16; + ext->ext_tss.tss_esp0 = (vm_offset_t)td->td_pcb - 16; ext->ext_tss.tss_ss0 = GSEL(GDATA_SEL, SEL_KPL); /* * The last byte of the i/o map must be followed by an 0xff byte. From owner-svn-src-all@freebsd.org Mon Dec 7 17:24:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BDE09C13CE; Mon, 7 Dec 2015 17:24:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3DCF5155F; Mon, 7 Dec 2015 17:24:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7HOt0i018541; Mon, 7 Dec 2015 17:24:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7HOt4x018540; Mon, 7 Dec 2015 17:24:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512071724.tB7HOt4x018540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Dec 2015 17:24:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291948 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 17:24:56 -0000 Author: kib Date: Mon Dec 7 17:24:55 2015 New Revision: 291948 URL: https://svnweb.freebsd.org/changeset/base/291948 Log: Use ANSI C definition. MFC after: 1 week Modified: head/sys/amd64/amd64/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Mon Dec 7 16:27:11 2015 (r291947) +++ head/sys/amd64/amd64/machdep.c Mon Dec 7 17:24:55 2015 (r291948) @@ -798,12 +798,7 @@ struct soft_segment_descriptor gdt_segs[ }; void -setidt(idx, func, typ, dpl, ist) - int idx; - inthand_t *func; - int typ; - int dpl; - int ist; +setidt(int idx, inthand_t *func, int typ, int dpl, int ist) { struct gate_descriptor *ip; From owner-svn-src-all@freebsd.org Mon Dec 7 17:41:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD8339B736D; Mon, 7 Dec 2015 17:41:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD9591319; Mon, 7 Dec 2015 17:41:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7HfKnU021900; Mon, 7 Dec 2015 17:41:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7HfKCX021893; Mon, 7 Dec 2015 17:41:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512071741.tB7HfKCX021893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 7 Dec 2015 17:41:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291949 - in head/sys: amd64/include i386/i386 i386/include x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 17:41:22 -0000 Author: kib Date: Mon Dec 7 17:41:20 2015 New Revision: 291949 URL: https://svnweb.freebsd.org/changeset/base/291949 Log: Merge common parts of i386 and amd64 md_var.h and smp.h into new headers x86/include x86_var.h and x86_smp.h. Reviewed by: emaste, jhb Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D4358 Added: head/sys/x86/include/x86_smp.h - copied, changed from r291948, head/sys/i386/include/smp.h head/sys/x86/include/x86_var.h - copied, changed from r291948, head/sys/i386/include/md_var.h Modified: head/sys/amd64/include/md_var.h head/sys/amd64/include/smp.h head/sys/i386/i386/mp_machdep.c head/sys/i386/include/md_var.h head/sys/i386/include/smp.h Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Mon Dec 7 17:24:55 2015 (r291948) +++ head/sys/amd64/include/md_var.h Mon Dec 7 17:41:20 2015 (r291949) @@ -32,69 +32,18 @@ #ifndef _MACHINE_MD_VAR_H_ #define _MACHINE_MD_VAR_H_ -/* - * Miscellaneous machine-dependent declarations. - */ - -extern long Maxmem; -extern u_int basemem; -extern int busdma_swi_pending; -extern u_int cpu_exthigh; -extern u_int cpu_feature; -extern u_int cpu_feature2; -extern u_int amd_feature; -extern u_int amd_feature2; -extern u_int amd_pminfo; -extern u_int via_feature_rng; -extern u_int via_feature_xcrypt; -extern u_int cpu_clflush_line_size; -extern u_int cpu_stdext_feature; -extern u_int cpu_stdext_feature2; -extern u_int cpu_fxsr; -extern u_int cpu_high; -extern u_int cpu_id; -extern u_int cpu_max_ext_state_size; -extern u_int cpu_mxcsr_mask; -extern u_int cpu_procinfo; -extern u_int cpu_procinfo2; -extern char cpu_vendor[]; -extern u_int cpu_vendor_id; -extern u_int cpu_mon_mwait_flags; -extern u_int cpu_mon_min_size; -extern u_int cpu_mon_max_size; -extern u_int cpu_maxphyaddr; +#include + extern char ctx_switch_xsave[]; -extern u_int hv_high; -extern char hv_vendor[]; -extern char kstack[]; -extern char sigcode[]; -extern int szsigcode; -extern uint64_t *vm_page_dump; -extern int vm_page_dump_size; -extern int workaround_erratum383; -extern int _udatasel; -extern int _ucodesel; -extern int _ucode32sel; -extern int _ufssel; -extern int _ugssel; -extern int use_xsave; -extern uint64_t xsave_mask; +extern uint64_t *vm_page_dump; +/* XXX */ typedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss); -struct pcb; + struct savefpu; -struct thread; -struct reg; -struct fpreg; -struct dbreg; -struct dumperinfo; -void *alloc_fpusave(int flags); +void amd64_db_resume_dbreg(void); void amd64_syscall(struct thread *td, int traced); -void busdma_swi(void); -bool cpu_mwait_usable(void); -void cpu_probe_amdc1e(void); -void cpu_setregs(void); void doreti_iret(void) __asm(__STRING(doreti_iret)); void doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault)); void ld_ds(void) __asm(__STRING(ld_ds)); @@ -109,26 +58,10 @@ void fs_load_fault(void) __asm(__STRING( void gs_load_fault(void) __asm(__STRING(gs_load_fault)); void fsbase_load_fault(void) __asm(__STRING(fsbase_load_fault)); void gsbase_load_fault(void) __asm(__STRING(gsbase_load_fault)); -void dump_add_page(vm_paddr_t); -void dump_drop_page(vm_paddr_t); -void identify_cpu(void); -void initializecpu(void); -void initializecpucache(void); -bool intel_fix_cpuid(void); -void fillw(int /*u_short*/ pat, void *base, size_t cnt); void fpstate_drop(struct thread *td); -int is_physical_memory(vm_paddr_t addr); -int isa_nmi(int cd); -void panicifcpuunsupported(void); -void pagecopy(void *from, void *to); void pagezero(void *addr); -void printcpuinfo(void); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist); -int user_dbreg_trap(void); -int minidumpsys(struct dumperinfo *); struct savefpu *get_pcb_user_save_td(struct thread *td); struct savefpu *get_pcb_user_save_pcb(struct pcb *pcb); -struct pcb *get_pcb_td(struct thread *td); -void amd64_db_resume_dbreg(void); #endif /* !_MACHINE_MD_VAR_H_ */ Modified: head/sys/amd64/include/smp.h ============================================================================== --- head/sys/amd64/include/smp.h Mon Dec 7 17:24:55 2015 (r291948) +++ head/sys/amd64/include/smp.h Mon Dec 7 17:41:20 2015 (r291949) @@ -19,106 +19,25 @@ #ifndef LOCORE -#include -#include -#include -#include -#include +#include -struct pmap; +extern int pmap_pcid_enabled; +extern int invpcid_works; /* global symbols in mpboot.S */ extern char mptramp_start[]; extern char mptramp_end[]; extern u_int32_t mptramp_pagetables; -/* global data in mp_machdep.c */ -extern int mp_naps; -extern int boot_cpu_id; -extern struct pcb stoppcbs[]; -extern int cpu_apic_ids[]; -extern void *dpcpu; -extern char *bootSTK; -extern int bootAP; -extern void *bootstacks[]; -extern volatile u_int cpu_ipi_pending[]; -extern volatile int aps_ready; -extern struct mtx ap_boot_mtx; -extern int cpu_logical; -extern int cpu_cores; -extern int pmap_pcid_enabled; -extern int invpcid_works; -extern u_int xhits_gbl[]; -extern u_int xhits_pg[]; -extern u_int xhits_rng[]; -extern u_int ipi_global; -extern u_int ipi_page; -extern u_int ipi_range; -extern u_int ipi_range_size; -extern struct pmap *smp_tlb_pmap; - -extern volatile int smp_tlb_wait; - -struct cpu_info { - int cpu_present:1; - int cpu_bsp:1; - int cpu_disabled:1; - int cpu_hyperthread:1; -}; -extern struct cpu_info cpu_info[]; - -#ifdef COUNT_IPIS -extern u_long *ipi_invltlb_counts[MAXCPU]; -extern u_long *ipi_invlrng_counts[MAXCPU]; -extern u_long *ipi_invlpg_counts[MAXCPU]; -extern u_long *ipi_invlcache_counts[MAXCPU]; -extern u_long *ipi_rendezvous_counts[MAXCPU]; -#endif - /* IPI handlers */ inthand_t - IDTVEC(invltlb), /* TLB shootdowns - global */ IDTVEC(invltlb_pcid), /* TLB shootdowns - global, pcid */ IDTVEC(invltlb_invpcid),/* TLB shootdowns - global, invpcid */ - IDTVEC(invlpg), /* TLB shootdowns - 1 page */ - IDTVEC(invlrng), /* TLB shootdowns - page range */ - IDTVEC(invlcache), /* Write back and invalidate cache */ - IDTVEC(ipi_intr_bitmap_handler), /* Bitmap based IPIs */ - IDTVEC(cpustop), /* CPU stops & waits to be restarted */ - IDTVEC(cpususpend), /* CPU suspends & waits to be resumed */ - IDTVEC(justreturn), /* interrupt CPU with minimum overhead */ - IDTVEC(rendezvous); /* handle CPU rendezvous */ - -/* functions in mp_machdep.c */ -void assign_cpu_ids(void); -void cpu_add(u_int apic_id, char boot_cpu); -void cpustop_handler(void); -void cpususpend_handler(void); -void init_secondary_tail(void); -void invltlb_handler(void); + IDTVEC(justreturn); /* interrupt CPU with minimum overhead */ + void invltlb_pcid_handler(void); void invltlb_invpcid_handler(void); -void invlpg_handler(void); -void invlrng_handler(void); -void invlcache_handler(void); -void init_secondary(void); -void ipi_startup(int apic_id, int vector); -void ipi_all_but_self(u_int ipi); -void ipi_bitmap_handler(struct trapframe frame); -void ipi_cpu(int cpu, u_int ipi); -int ipi_nmi_handler(void); -void ipi_selected(cpuset_t cpus, u_int ipi); -u_int mp_bootaddress(u_int); -void set_interrupt_apic_ids(void); -void smp_cache_flush(void); -void smp_masked_invlpg(cpuset_t mask, vm_offset_t addr); -void smp_masked_invlpg_range(cpuset_t mask, vm_offset_t startva, - vm_offset_t endva); -void smp_masked_invltlb(cpuset_t mask, struct pmap *pmap); int native_start_all_aps(void); -void mem_range_AP_init(void); -void topo_probe(void); -void ipi_send_cpu(int cpu, u_int ipi); #endif /* !LOCORE */ #endif /* SMP */ Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Mon Dec 7 17:24:55 2015 (r291948) +++ head/sys/i386/i386/mp_machdep.c Mon Dec 7 17:41:20 2015 (r291949) @@ -301,10 +301,6 @@ init_secondary(void) init_secondary_tail(); } -/******************************************************************* - * local functions and data - */ - /* * start each AP in our list */ Modified: head/sys/i386/include/md_var.h ============================================================================== --- head/sys/i386/include/md_var.h Mon Dec 7 17:24:55 2015 (r291948) +++ head/sys/i386/include/md_var.h Mon Dec 7 17:41:20 2015 (r291949) @@ -32,46 +32,12 @@ #ifndef _MACHINE_MD_VAR_H_ #define _MACHINE_MD_VAR_H_ -/* - * Miscellaneous machine-dependent declarations. - */ +#include -extern long Maxmem; -extern u_int basemem; /* PA of original top of base memory */ -extern int busdma_swi_pending; -extern u_int cpu_exthigh; -extern u_int cpu_feature; -extern u_int cpu_feature2; -extern u_int amd_feature; -extern u_int amd_feature2; -extern u_int amd_pminfo; -extern u_int via_feature_rng; -extern u_int via_feature_xcrypt; -extern u_int cpu_clflush_line_size; -extern u_int cpu_stdext_feature; -extern u_int cpu_stdext_feature2; -extern u_int cpu_fxsr; -extern u_int cpu_high; -extern u_int cpu_id; -extern u_int cpu_max_ext_state_size; -extern u_int cpu_mxcsr_mask; -extern u_int cpu_procinfo; -extern u_int cpu_procinfo2; -extern char cpu_vendor[]; -extern u_int cpu_vendor_id; -extern u_int cpu_mon_mwait_flags; -extern u_int cpu_mon_min_size; -extern u_int cpu_mon_max_size; -extern u_int cpu_maxphyaddr; extern u_int cyrix_did; #if defined(I586_CPU) && !defined(NO_F00F_HACK) extern int has_f00f_bug; #endif -extern u_int hv_high; -extern char hv_vendor[]; -extern char kstack[]; -extern char sigcode[]; -extern int szsigcode; #ifdef COMPAT_FREEBSD4 extern int szfreebsd4_sigcode; #endif @@ -79,29 +45,12 @@ extern int szfreebsd4_sigcode; extern int szosigcode; #endif extern uint32_t *vm_page_dump; -extern int vm_page_dump_size; -extern int workaround_erratum383; -extern int _udatasel; -extern int _ucodesel; -extern int use_xsave; -extern uint64_t xsave_mask; typedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss); -struct pcb; -union savefpu; -struct thread; -struct reg; -struct fpreg; -struct dbreg; -struct dumperinfo; struct segment_descriptor; +union savefpu; -void *alloc_fpusave(int flags); void bcopyb(const void *from, void *to, size_t len); -void busdma_swi(void); -bool cpu_mwait_usable(void); -void cpu_probe_amdc1e(void); -void cpu_setregs(void); void cpu_switch_load_gs(void) __asm(__STRING(cpu_switch_load_gs)); void doreti_iret(void) __asm(__STRING(doreti_iret)); void doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault)); @@ -111,26 +60,14 @@ void doreti_popl_es(void) __asm(__STRING void doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault)); void doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs)); void doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault)); -void dump_add_page(vm_paddr_t); -void dump_drop_page(vm_paddr_t); void finishidentcpu(void); -void fillw(int /*u_short*/ pat, void *base, size_t cnt); void fill_based_sd(struct segment_descriptor *sdp, uint32_t base); -void initializecpu(void); -void initializecpucache(void); -bool intel_fix_cpuid(void); void i686_pagezero(void *addr); void sse2_pagezero(void *addr); void init_AMD_Elan_sc520(void); -int is_physical_memory(vm_paddr_t addr); -int isa_nmi(int cd); vm_paddr_t kvtop(void *addr); -void panicifcpuunsupported(void); void ppro_reenable_apic(void); -void printcpuinfo(void); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); -int user_dbreg_trap(void); -int minidumpsys(struct dumperinfo *); union savefpu *get_pcb_user_save_td(struct thread *td); union savefpu *get_pcb_user_save_pcb(struct pcb *pcb); struct pcb *get_pcb_td(struct thread *td); Modified: head/sys/i386/include/smp.h ============================================================================== --- head/sys/i386/include/smp.h Mon Dec 7 17:24:55 2015 (r291948) +++ head/sys/i386/include/smp.h Mon Dec 7 17:41:20 2015 (r291949) @@ -19,6 +19,8 @@ #ifndef LOCORE +#include + #include #include #include @@ -26,88 +28,10 @@ #include /* global data in mpboot.s */ -extern int bootMP_size; +extern int bootMP_size; /* functions in mpboot.s */ -void bootMP(void); - -/* global data in mp_machdep.c */ -extern int mp_naps; -extern int boot_cpu_id; -extern struct pcb stoppcbs[]; -extern int cpu_apic_ids[]; -extern int bootAP; -extern void *dpcpu; -extern char *bootSTK; -extern void *bootstacks[]; -extern volatile u_int cpu_ipi_pending[]; -extern volatile int aps_ready; -extern struct mtx ap_boot_mtx; -extern int cpu_logical; -extern int cpu_cores; -extern volatile int smp_tlb_wait; -extern u_int xhits_gbl[]; -extern u_int xhits_pg[]; -extern u_int xhits_rng[]; -extern u_int ipi_global; -extern u_int ipi_page; -extern u_int ipi_range; -extern u_int ipi_range_size; - -struct cpu_info { - int cpu_present:1; - int cpu_bsp:1; - int cpu_disabled:1; - int cpu_hyperthread:1; -}; -extern struct cpu_info cpu_info[]; - -#ifdef COUNT_IPIS -extern u_long *ipi_invltlb_counts[MAXCPU]; -extern u_long *ipi_invlrng_counts[MAXCPU]; -extern u_long *ipi_invlpg_counts[MAXCPU]; -extern u_long *ipi_invlcache_counts[MAXCPU]; -extern u_long *ipi_rendezvous_counts[MAXCPU]; -#endif - -/* IPI handlers */ -inthand_t - IDTVEC(invltlb), /* TLB shootdowns - global */ - IDTVEC(invlpg), /* TLB shootdowns - 1 page */ - IDTVEC(invlrng), /* TLB shootdowns - page range */ - IDTVEC(invlcache), /* Write back and invalidate cache */ - IDTVEC(ipi_intr_bitmap_handler), /* Bitmap based IPIs */ - IDTVEC(cpustop), /* CPU stops & waits to be restarted */ - IDTVEC(cpususpend), /* CPU suspends & waits to be resumed */ - IDTVEC(rendezvous); /* handle CPU rendezvous */ - -/* functions in mp_machdep.c */ -void assign_cpu_ids(void); -void cpu_add(u_int apic_id, char boot_cpu); -void cpustop_handler(void); -void cpususpend_handler(void); -void init_secondary_tail(void); -void invltlb_handler(void); -void invlpg_handler(void); -void invlrng_handler(void); -void invlcache_handler(void); -void init_secondary(void); -void ipi_startup(int apic_id, int vector); -void ipi_all_but_self(u_int ipi); -void ipi_bitmap_handler(struct trapframe frame); -void ipi_cpu(int cpu, u_int ipi); -int ipi_nmi_handler(void); -void ipi_selected(cpuset_t cpus, u_int ipi); -u_int mp_bootaddress(u_int); -void set_interrupt_apic_ids(void); -void smp_cache_flush(void); -void smp_masked_invlpg(cpuset_t mask, vm_offset_t addr); -void smp_masked_invlpg_range(cpuset_t mask, vm_offset_t startva, - vm_offset_t endva); -void smp_masked_invltlb(cpuset_t mask, struct pmap *pmap); -void mem_range_AP_init(void); -void topo_probe(void); -void ipi_send_cpu(int cpu, u_int ipi); +void bootMP(void); #endif /* !LOCORE */ #endif /* SMP */ Copied and modified: head/sys/x86/include/x86_smp.h (from r291948, head/sys/i386/include/smp.h) ============================================================================== --- head/sys/i386/include/smp.h Mon Dec 7 17:24:55 2015 (r291948, copy source) +++ head/sys/x86/include/x86_smp.h Mon Dec 7 17:41:20 2015 (r291949) @@ -10,14 +10,8 @@ * */ -#ifndef _MACHINE_SMP_H_ -#define _MACHINE_SMP_H_ - -#ifdef _KERNEL - -#ifdef SMP - -#ifndef LOCORE +#ifndef _X86_X86_SMP_H_ +#define _X86_X86_SMP_H_ #include #include @@ -25,17 +19,13 @@ #include #include -/* global data in mpboot.s */ -extern int bootMP_size; +struct pmap; -/* functions in mpboot.s */ -void bootMP(void); - -/* global data in mp_machdep.c */ -extern int mp_naps; -extern int boot_cpu_id; -extern struct pcb stoppcbs[]; -extern int cpu_apic_ids[]; +/* global data in mp_x86.c */ +extern int mp_naps; +extern int boot_cpu_id; +extern struct pcb stoppcbs[]; +extern int cpu_apic_ids[]; extern int bootAP; extern void *dpcpu; extern char *bootSTK; @@ -46,6 +36,7 @@ extern struct mtx ap_boot_mtx; extern int cpu_logical; extern int cpu_cores; extern volatile int smp_tlb_wait; +extern struct pmap *smp_tlb_pmap; extern u_int xhits_gbl[]; extern u_int xhits_pg[]; extern u_int xhits_rng[]; @@ -81,7 +72,7 @@ inthand_t IDTVEC(cpususpend), /* CPU suspends & waits to be resumed */ IDTVEC(rendezvous); /* handle CPU rendezvous */ -/* functions in mp_machdep.c */ +/* functions in x86_mp.c */ void assign_cpu_ids(void); void cpu_add(u_int apic_id, char boot_cpu); void cpustop_handler(void); @@ -109,8 +100,4 @@ void mem_range_AP_init(void); void topo_probe(void); void ipi_send_cpu(int cpu, u_int ipi); -#endif /* !LOCORE */ -#endif /* SMP */ - -#endif /* _KERNEL */ -#endif /* _MACHINE_SMP_H_ */ +#endif Copied and modified: head/sys/x86/include/x86_var.h (from r291948, head/sys/i386/include/md_var.h) ============================================================================== --- head/sys/i386/include/md_var.h Mon Dec 7 17:24:55 2015 (r291948, copy source) +++ head/sys/x86/include/x86_var.h Mon Dec 7 17:41:20 2015 (r291949) @@ -29,15 +29,15 @@ * $FreeBSD$ */ -#ifndef _MACHINE_MD_VAR_H_ -#define _MACHINE_MD_VAR_H_ +#ifndef _X86_X86_VAR_H_ +#define _X86_X86_VAR_H_ /* * Miscellaneous machine-dependent declarations. */ extern long Maxmem; -extern u_int basemem; /* PA of original top of base memory */ +extern u_int basemem; extern int busdma_swi_pending; extern u_int cpu_exthigh; extern u_int cpu_feature; @@ -63,76 +63,48 @@ extern u_int cpu_mon_mwait_flags; extern u_int cpu_mon_min_size; extern u_int cpu_mon_max_size; extern u_int cpu_maxphyaddr; -extern u_int cyrix_did; -#if defined(I586_CPU) && !defined(NO_F00F_HACK) -extern int has_f00f_bug; -#endif +extern char ctx_switch_xsave[]; extern u_int hv_high; extern char hv_vendor[]; extern char kstack[]; extern char sigcode[]; extern int szsigcode; -#ifdef COMPAT_FREEBSD4 -extern int szfreebsd4_sigcode; -#endif -#ifdef COMPAT_43 -extern int szosigcode; -#endif -extern uint32_t *vm_page_dump; extern int vm_page_dump_size; extern int workaround_erratum383; extern int _udatasel; extern int _ucodesel; +extern int _ucode32sel; +extern int _ufssel; +extern int _ugssel; extern int use_xsave; extern uint64_t xsave_mask; -typedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss); struct pcb; -union savefpu; struct thread; struct reg; struct fpreg; struct dbreg; struct dumperinfo; -struct segment_descriptor; void *alloc_fpusave(int flags); -void bcopyb(const void *from, void *to, size_t len); void busdma_swi(void); bool cpu_mwait_usable(void); void cpu_probe_amdc1e(void); void cpu_setregs(void); -void cpu_switch_load_gs(void) __asm(__STRING(cpu_switch_load_gs)); -void doreti_iret(void) __asm(__STRING(doreti_iret)); -void doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault)); -void doreti_popl_ds(void) __asm(__STRING(doreti_popl_ds)); -void doreti_popl_ds_fault(void) __asm(__STRING(doreti_popl_ds_fault)); -void doreti_popl_es(void) __asm(__STRING(doreti_popl_es)); -void doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault)); -void doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs)); -void doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault)); void dump_add_page(vm_paddr_t); void dump_drop_page(vm_paddr_t); -void finishidentcpu(void); -void fillw(int /*u_short*/ pat, void *base, size_t cnt); -void fill_based_sd(struct segment_descriptor *sdp, uint32_t base); +void identify_cpu(void); void initializecpu(void); void initializecpucache(void); bool intel_fix_cpuid(void); -void i686_pagezero(void *addr); -void sse2_pagezero(void *addr); -void init_AMD_Elan_sc520(void); +void fillw(int /*u_short*/ pat, void *base, size_t cnt); int is_physical_memory(vm_paddr_t addr); int isa_nmi(int cd); -vm_paddr_t kvtop(void *addr); void panicifcpuunsupported(void); -void ppro_reenable_apic(void); +void pagecopy(void *from, void *to); void printcpuinfo(void); -void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); -int user_dbreg_trap(void); +int user_dbreg_trap(void); int minidumpsys(struct dumperinfo *); -union savefpu *get_pcb_user_save_td(struct thread *td); -union savefpu *get_pcb_user_save_pcb(struct pcb *pcb); struct pcb *get_pcb_td(struct thread *td); -#endif /* !_MACHINE_MD_VAR_H_ */ +#endif From owner-svn-src-all@freebsd.org Mon Dec 7 17:59:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEBB09B947C; Mon, 7 Dec 2015 17:59:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF3D61FD0; Mon, 7 Dec 2015 17:59:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 64C69B97F; Mon, 7 Dec 2015 12:59:54 -0500 (EST) From: John Baldwin To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291921 - head/tools/tools/nanobsd/embedded Date: Mon, 07 Dec 2015 09:35:43 -0800 Message-ID: <3114680.LdsLFRmK1j@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201512070513.tB75DTT0003357@repo.freebsd.org> References: <201512070513.tB75DTT0003357@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 07 Dec 2015 12:59:54 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 17:59:56 -0000 On Monday, December 07, 2015 05:13:29 AM Warner Losh wrote: > Author: imp > Date: Mon Dec 7 05:13:29 2015 > New Revision: 291921 > URL: https://svnweb.freebsd.org/changeset/base/291921 > > Log: > Document the different config files. > Document how to run qemu for the ones I've run. > Use qcow2 for all qemu images. See also: https://wiki.freebsd.org/QemuRecipes Note that I have been able to run powerpc64 under qemu, but powerpc and sparc64 do not boot. -- John Baldwin From owner-svn-src-all@freebsd.org Mon Dec 7 18:13:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8FFD9C14B7 for ; Mon, 7 Dec 2015 18:13:42 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA9E41BDD for ; Mon, 7 Dec 2015 18:13:42 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 7 Dec 2015 18:14:10 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tB7IDXg9002831; Mon, 7 Dec 2015 11:13:34 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1449512013.1358.6.camel@freebsd.org> Subject: Re: svn commit: r291929 - head/tools/tools/nanobsd From: Ian Lepore To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 07 Dec 2015 11:13:33 -0700 In-Reply-To: <201512071024.tB7AOcjr094296@repo.freebsd.org> References: <201512071024.tB7AOcjr094296@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 18:13:42 -0000 On Mon, 2015-12-07 at 10:24 +0000, Warner Losh wrote: > Author: imp > Date: Mon Dec 7 10:24:38 2015 > New Revision: 291929 > URL: https://svnweb.freebsd.org/changeset/base/291929 > > Log: > Make sure to quote the arg after -n and -z tests. > While I am generally a quoting fanatic and would much rather overquote than underquote in shell scripts, fyi it's not actually needed for the -n and -z tests. test(1) and shells seem to be smart enough to see the ']' (which is just an arg to test, not shell language syntax) and know there isn't a string in front of it. -- Ian From owner-svn-src-all@freebsd.org Mon Dec 7 18:39:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1DE69B7D00; Mon, 7 Dec 2015 18:39:39 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F1301DF8; Mon, 7 Dec 2015 18:39:39 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7IdcJD039993; Mon, 7 Dec 2015 18:39:38 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7IdcUD039992; Mon, 7 Dec 2015 18:39:38 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512071839.tB7IdcUD039992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 7 Dec 2015 18:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291950 - head/share/examples/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 18:39:39 -0000 Author: brueffer Date: Mon Dec 7 18:39:38 2015 New Revision: 291950 URL: https://svnweb.freebsd.org/changeset/base/291950 Log: Fix a typo in the CPUTYPE list. PR: 205099 Submitted by: xxjack12xx@gmail.com MFC after: 1 week Modified: head/share/examples/etc/make.conf Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Mon Dec 7 17:41:20 2015 (r291949) +++ head/share/examples/etc/make.conf Mon Dec 7 18:39:38 2015 (r291950) @@ -32,7 +32,7 @@ # Intel x86 architecture: # (AMD CPUs) amdfam10, opteron-sse3, athlon64-sse3, k8-sse3, # opteron, athlon64, athlon-fx, k8, athlon-mp, -# athlen-xp, athlon-4, athlon-tbird, athlon, k7, +# athlon-xp, athlon-4, athlon-tbird, athlon, k7, # geode, k6-3, k6-2, k6 # (Intel CPUs) core2, core, nocona, pentium4m, pentium4, prescott, # pentium3m, pentium3, pentium-m, pentium2, From owner-svn-src-all@freebsd.org Mon Dec 7 18:43:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 463FD9B924A; Mon, 7 Dec 2015 18:43:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 14FB6182E; Mon, 7 Dec 2015 18:43:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7IhSFY042961; Mon, 7 Dec 2015 18:43:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7IhSgV042960; Mon, 7 Dec 2015 18:43:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512071843.tB7IhSgV042960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 7 Dec 2015 18:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291951 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 18:43:29 -0000 Author: emaste Date: Mon Dec 7 18:43:27 2015 New Revision: 291951 URL: https://svnweb.freebsd.org/changeset/base/291951 Log: Replace magic value ELF note type with NT_FREEBSD_ABI_TAG As of r291909 elf_common.h provides a definition. Suggested by: kib Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/imgact_elf.c Modified: head/sys/kern/imgact_elf.c ============================================================================== --- head/sys/kern/imgact_elf.c Mon Dec 7 18:39:38 2015 (r291950) +++ head/sys/kern/imgact_elf.c Mon Dec 7 18:43:27 2015 (r291951) @@ -148,7 +148,7 @@ static const char FREEBSD_ABI_VENDOR[] = Elf_Brandnote __elfN(freebsd_brandnote) = { .hdr.n_namesz = sizeof(FREEBSD_ABI_VENDOR), .hdr.n_descsz = sizeof(int32_t), - .hdr.n_type = 1, + .hdr.n_type = NT_FREEBSD_ABI_TAG, .vendor = FREEBSD_ABI_VENDOR, .flags = BN_TRANSLATE_OSREL, .trans_osrel = __elfN(freebsd_trans_osrel) From owner-svn-src-all@freebsd.org Mon Dec 7 18:45:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FB729B9482; Mon, 7 Dec 2015 18:45:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3EDD11A40; Mon, 7 Dec 2015 18:45:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7Ijt5g043096; Mon, 7 Dec 2015 18:45:55 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7IjtY3043095; Mon, 7 Dec 2015 18:45:55 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512071845.tB7IjtY3043095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 7 Dec 2015 18:45:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291952 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 18:45:56 -0000 Author: bdrewery Date: Mon Dec 7 18:45:55 2015 New Revision: 291952 URL: https://svnweb.freebsd.org/changeset/base/291952 Log: Fix spelling of internal hack. Reported by: ngie Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Mon Dec 7 18:43:27 2015 (r291951) +++ head/Makefile.inc1 Mon Dec 7 18:45:55 2015 (r291952) @@ -666,7 +666,7 @@ everything: @echo "--------------------------------------------------------------" @echo ">>> stage 4.4: building everything" @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; _PARALLEL_SUBUDIR_OK=1 ${WMAKE} all + ${_+_}cd ${.CURDIR}; _PARALLEL_SUBDIR_OK=1 ${WMAKE} all .if defined(LIB32TMP) build32: .PHONY @echo @@ -2008,14 +2008,14 @@ _prebuild_libs: ${_prebuild_libs:S/$/__L _generic_libs: ${_generic_libs:S/$/__L/} # Enable SUBDIR_PARALLEL when not calling 'make all', unless called from -# 'everything' with _PARALLEL_SUBUDIR_OK set. This is because it is unlikely +# 'everything' with _PARALLEL_SUBDIR_OK set. This is because it is unlikely # that running 'make all' from the top-level, especially with a SUBDIR_OVERRIDE # or LOCAL_DIRS set, will have a reliable build if SUBDIRs are built in # parallel. This is safe for the world stage of buildworld though since it has # already built libraries in a proper order and installed includes into # WORLDTMP. Special handling is done for SUBDIR ordering for 'install*' to # avoid trashing a system if it crashes mid-install. -.if !make(all) || defined(_PARALLEL_SUBUDIR_OK) +.if !make(all) || defined(_PARALLEL_SUBDIR_OK) SUBDIR_PARALLEL= .endif From owner-svn-src-all@freebsd.org Mon Dec 7 18:48:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BFB369B972D; Mon, 7 Dec 2015 18:48:03 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91CEE1CD1; Mon, 7 Dec 2015 18:48:03 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by iofh3 with SMTP id h3so191324756iof.3; Mon, 07 Dec 2015 10:48:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=I12JHOlOnAPFQq73G5pegKX3LBAyHzkVxzawrhDdMpo=; b=AtPcxrmq66AlZTgKOx64dtRVxbQ9hXElmkG8V7Y4PV8NqjFyGLt1QB9GUvcQbnGMck AkexoUrkVAkiuItkOsq9mUZ/ugEcrE2wd67DzpBUlfulQKBx1n+dRgmBhNzAmey8o7Zb lB9rfivfgldI8fw+CM6iaQknbocCLVgM8m5I433wsJwfCeogALS+69o4fBh4G4WwQJox QLtV+/0r3OZEMBs4vSSNM2ydWusBsGTpiEBctBlBW4efDZPhPcUAFQ++jrcnMwkBAS8u OaxdDzTWV2YKnISSRkTE7BlociuRUZb5DUUnqomUU8Gwwgf7RCZaPbxR82A+pGOuUuhP lHiQ== X-Received: by 10.107.166.15 with SMTP id p15mr24576563ioe.38.1449514083054; Mon, 07 Dec 2015 10:48:03 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.169.85 with HTTP; Mon, 7 Dec 2015 10:47:43 -0800 (PST) In-Reply-To: <1449512013.1358.6.camel@freebsd.org> References: <201512071024.tB7AOcjr094296@repo.freebsd.org> <1449512013.1358.6.camel@freebsd.org> From: Ed Maste Date: Mon, 7 Dec 2015 13:47:43 -0500 X-Google-Sender-Auth: MNXYKRSIvso1XDKwX6OcFTiGp7E Message-ID: Subject: Re: svn commit: r291929 - head/tools/tools/nanobsd To: Ian Lepore Cc: Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 18:48:03 -0000 On 7 December 2015 at 13:13, Ian Lepore wrote: > > While I am generally a quoting fanatic and would much rather overquote > than underquote in shell scripts, fyi it's not actually needed for the > -n and -z tests. test(1) and shells seem to be smart enough to see the > ']' (which is just an arg to test, not shell language syntax) and know > there isn't a string in front of it. With sh(1) I see: $ [ -n ] && echo true true $ [ -z ] && echo true true From owner-svn-src-all@freebsd.org Mon Dec 7 18:55:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC2809B9E76; Mon, 7 Dec 2015 18:55:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD9FF1241; Mon, 7 Dec 2015 18:55:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7ItXO4046157; Mon, 7 Dec 2015 18:55:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7ItXMb046156; Mon, 7 Dec 2015 18:55:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512071855.tB7ItXMb046156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 7 Dec 2015 18:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291953 - head/sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 18:55:35 -0000 Author: hselasky Date: Mon Dec 7 18:55:33 2015 New Revision: 291953 URL: https://svnweb.freebsd.org/changeset/base/291953 Log: When setting up VLANs on a Raspberry Pi ethernet port, the MTU drops from 1500 to 1496 bytes. The MTU should remain at 1500, extending the frame size as per IEEE 802.3. Adding IFCAP_VLAN_MTU to the if_capabilities field in the smsc driver solves the problem. The datasheet for the LAN9512 chip, section 3.2.3 states that the chip supports the extended frame. Submitted by: rpp@ci.com.au MFC after: 1 week PR: 205050 Modified: head/sys/dev/usb/net/if_smsc.c Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Mon Dec 7 18:45:55 2015 (r291952) +++ head/sys/dev/usb/net/if_smsc.c Mon Dec 7 18:55:33 2015 (r291953) @@ -1707,7 +1707,7 @@ smsc_attach_post_sub(struct usb_ether *u /* The chip supports TCP/UDP checksum offloading on TX and RX paths, however * currently only RX checksum is supported in the driver (see top of file). */ - ifp->if_capabilities |= IFCAP_RXCSUM; + ifp->if_capabilities |= IFCAP_RXCSUM | IFCAP_VLAN_MTU; ifp->if_hwassist = 0; /* TX checksuming is disabled (for now?) From owner-svn-src-all@freebsd.org Mon Dec 7 19:03:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC3A79C164E; Mon, 7 Dec 2015 19:03:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-oi0-x235.google.com (mail-oi0-x235.google.com [IPv6:2607:f8b0:4003:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79644196B; Mon, 7 Dec 2015 19:03:52 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by oige206 with SMTP id e206so103092166oig.2; Mon, 07 Dec 2015 11:03:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=gYDG1aJxX8AF5sPgfImBTwOHgECEA2uH38zHd2VCPds=; b=hgcnC9x5dW81Z0PkSPYRX86Lv75iN7DOCGsafzIsIoqNv+I+nmianLbb3BxOPc4e4d YbIKVXA3lje9FiqwLfkc03qrEO2XXaX9vasU2LAe8OGC+164SC5VdeOsSMNnWXf7Vobj zgcq3hHejSqSDJXRCxTEMF+h5dBgfd3IMWQfIcB19cxk/thI17RrebpoSN+JcGHmouM+ TMgcnjuVo7QdaMoyCYmPL+FfgIMhhEiltOcFIf/4k0MbiNWHy9dcbF4MSmGdOb2eLBfh gXRfz5F6/S/d+0dc+42oSZ2VuS4NRuyDzZURBjQwzEqBvGWzXYzHiJdjHA2Wy+km5QFN vJyQ== X-Received: by 10.202.212.68 with SMTP id l65mr20894574oig.54.1449515031684; Mon, 07 Dec 2015 11:03:51 -0800 (PST) Received: from [22.34.141.136] ([172.56.8.223]) by smtp.gmail.com with ESMTPSA id y9sm12165804obg.4.2015.12.07.11.03.49 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Dec 2015 11:03:50 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r291952 - head From: Garrett Cooper X-Mailer: iPhone Mail (13B143) In-Reply-To: <201512071845.tB7IjtY3043095@repo.freebsd.org> Date: Mon, 7 Dec 2015 11:03:48 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <1848A966-B381-4EB2-ADE6-7A67BEE0922C@gmail.com> References: <201512071845.tB7IjtY3043095@repo.freebsd.org> To: Bryan Drewery X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 19:03:52 -0000 > On Dec 7, 2015, at 10:45, Bryan Drewery wrote: > > Author: bdrewery > Date: Mon Dec 7 18:45:55 2015 > New Revision: 291952 > URL: https://svnweb.freebsd.org/changeset/base/291952 > > Log: > Fix spelling of internal hack. > > Reported by: ngie Thanks :)! From owner-svn-src-all@freebsd.org Mon Dec 7 19:07:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 708F29C19CD; Mon, 7 Dec 2015 19:07:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-oi0-x22d.google.com (mail-oi0-x22d.google.com [IPv6:2607:f8b0:4003:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D7EA1B81; Mon, 7 Dec 2015 19:07:44 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by oiww189 with SMTP id w189so103237838oiw.3; Mon, 07 Dec 2015 11:07:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=wVeQXL+jkJLZujSJBSSKFHgKHOG4QtrLccDbC4Enu80=; b=Mmzea0TSh93mYpQx71YdeDnZ80+axgypZ21WKMbCV1O3CglkUAgKORmRmUbzg1a6rV jNayTuc24I+2A5tAfhV71qw0AhJz255Sr038wk3VAhISO7cMl6Gs5nyEmbAfaKBiUp10 z7jHteixQ7nRXjAXGA4e5E/v84aqF/DgsYJoA8XCg7bSwgkQPEbLVNJfAFmVMoyPPpI2 C3rl21tGRqtsoUii/2KTK+CRIZ/E/Emi8ImtFRg04aOQDMd5GBy0N/KJQHyPKrZ0g9AL 1odVFOWBWbiwcIeyxjsljIxEhL5BhwKlvOD3KYmhEnHKqyht8b4fXxUj+aLR/dKe17N5 nXqQ== X-Received: by 10.202.45.206 with SMTP id t197mr21093277oit.110.1449515263565; Mon, 07 Dec 2015 11:07:43 -0800 (PST) Received: from [22.34.141.136] ([172.56.8.223]) by smtp.gmail.com with ESMTPSA id a77sm12276284oic.8.2015.12.07.11.07.42 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 07 Dec 2015 11:07:42 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r291929 - head/tools/tools/nanobsd From: Garrett Cooper X-Mailer: iPhone Mail (13B143) In-Reply-To: <1449512013.1358.6.camel@freebsd.org> Date: Mon, 7 Dec 2015 11:07:40 -0800 Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5FA6DD6B-C70B-4E5A-BD04-5897B02E5FC8@gmail.com> References: <201512071024.tB7AOcjr094296@repo.freebsd.org> <1449512013.1358.6.camel@freebsd.org> To: Ian Lepore X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 19:07:44 -0000 > On Dec 7, 2015, at 10:13, Ian Lepore wrote: >=20 >> On Mon, 2015-12-07 at 10:24 +0000, Warner Losh wrote: >> Author: imp >> Date: Mon Dec 7 10:24:38 2015 >> New Revision: 291929 >> URL: https://svnweb.freebsd.org/changeset/base/291929 >>=20 >> Log: >> Make sure to quote the arg after -n and -z tests. >=20 > While I am generally a quoting fanatic and would much rather overquote > than underquote in shell scripts, fyi it's not actually needed for the=20 > -n and -z tests. test(1) and shells seem to be smart enough to see the > ']' (which is just an arg to test, not shell language syntax) and know > there isn't a string in front of it. Warner's commit was good. There's a more bulletproof way to do this to make i= t more portable (in most cases, not all), but it would be overkill: [ "x$x" !=3D x ] Also, his commit protects against variables with spaces in them doing unexpe= cted things with test(1). Thanks, -NGie= From owner-svn-src-all@freebsd.org Mon Dec 7 19:08:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 183149C1AAC; Mon, 7 Dec 2015 19:08:35 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DE3EA1CF7; Mon, 7 Dec 2015 19:08:34 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7J8YT0049288; Mon, 7 Dec 2015 19:08:34 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7J8YIj049287; Mon, 7 Dec 2015 19:08:34 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512071908.tB7J8YIj049287@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 7 Dec 2015 19:08:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291954 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 19:08:35 -0000 Author: brueffer Date: Mon Dec 7 19:08:33 2015 New Revision: 291954 URL: https://svnweb.freebsd.org/changeset/base/291954 Log: Add an MLINK for m_collapse. PR: 204205 Submitted by: avos MFC after: 1 week Modified: head/share/man/man9/Makefile Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Dec 7 18:55:33 2015 (r291953) +++ head/share/man/man9/Makefile Mon Dec 7 19:08:33 2015 (r291954) @@ -1053,6 +1053,7 @@ MLINKS+=\ mbuf.9 m_cat.9 \ mbuf.9 MCHTYPE.9 \ mbuf.9 MCLGET.9 \ + mbuf.9 m_collapse.9 \ mbuf.9 m_copyback.9 \ mbuf.9 m_copydata.9 \ mbuf.9 m_copym.9 \ From owner-svn-src-all@freebsd.org Mon Dec 7 19:12:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74D739D205B; Mon, 7 Dec 2015 19:12:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45BF91258; Mon, 7 Dec 2015 19:12:37 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by iofh3 with SMTP id h3so121695iof.3; Mon, 07 Dec 2015 11:12:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=pNx9LmdLu5V2yOEqEuGnqdUnu/T/Uc0JFWGCRqWYFs8=; b=u7oD6Y4qwMCbwsFd6ZZZqvxeI7EA/BNUiMjRnvJUnboFblwvzFbM46K1WAhxA8Ez32 sBIMTm5HtTZCIirA64Kwj0D0eVJmTuZGPGxPyZlQ84ZnEhc7HYGPug/Y6YFu4lG6bYMb x+6udw+91U9XU8j1WkqAK0a6vS26rrhPTNBw4FSVeuPM0vFFB8CfsnhZ+ACzOQWYBDbO LfJQ7p7yp2JUmm5nlZL31eY5Q+X8IKSqQchvGbQ4KWXHYeQ8r9yyvBxUyoAqmpBPYVnI 60CQxTRSPmFXAyrPUJyOcMQX9ReRTxxlh1VZNC34Q/3T/bL0ste5RfIrh8c3xc9sgUQt TOEg== X-Received: by 10.107.159.199 with SMTP id i190mr25245460ioe.29.1449515556735; Mon, 07 Dec 2015 11:12:36 -0800 (PST) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.169.85 with HTTP; Mon, 7 Dec 2015 11:12:17 -0800 (PST) In-Reply-To: <5FA6DD6B-C70B-4E5A-BD04-5897B02E5FC8@gmail.com> References: <201512071024.tB7AOcjr094296@repo.freebsd.org> <1449512013.1358.6.camel@freebsd.org> <5FA6DD6B-C70B-4E5A-BD04-5897B02E5FC8@gmail.com> From: Ed Maste Date: Mon, 7 Dec 2015 14:12:17 -0500 X-Google-Sender-Auth: SM_RKjMYEQXy6CA7QhGmNl6Kayc Message-ID: Subject: Re: svn commit: r291929 - head/tools/tools/nanobsd To: Garrett Cooper Cc: Ian Lepore , Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 19:12:37 -0000 On 7 December 2015 at 14:07, Garrett Cooper wrote: > > Warner's commit was good. There's a more bulletproof way to do this to make it more portable (in most cases, not all), but it would be overkill: > > [ "x$x" != x ] That construct is to support ancient shells that haven't been relevant for a very long time. It's not necessary today and only serves to confuse the reader. From owner-svn-src-all@freebsd.org Mon Dec 7 19:15:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 097DB9D23FD; Mon, 7 Dec 2015 19:15:54 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B40E615EC; Mon, 7 Dec 2015 19:15:53 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7JFqOO052196; Mon, 7 Dec 2015 19:15:52 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7JFqgM052194; Mon, 7 Dec 2015 19:15:52 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512071915.tB7JFqgM052194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 7 Dec 2015 19:15:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291955 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 19:15:54 -0000 Author: emaste Date: Mon Dec 7 19:15:52 2015 New Revision: 291955 URL: https://svnweb.freebsd.org/changeset/base/291955 Log: Build and install userland .debug files by default Debug data files are now built by default with 'make buildworld' and installed with 'make installworld'. This facilitates debugging but requires more disk space both during the build and for the installed world. Debug files may be disabled by setting WITHOUT_DEBUG_FILES=yes in src.conf(5). Reviewed by: bdrewery, eadler, vangyzen Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4018 Modified: head/UPDATING head/share/mk/bsd.opts.mk Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Dec 7 19:08:33 2015 (r291954) +++ head/UPDATING Mon Dec 7 19:15:52 2015 (r291955) @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20151207: + Debug data files are now built by default with 'make buildworld' and + installed with 'make installworld'. This facilitates debugging but + requires more disk space both during the build and for the installed + world. Debug files may be disabled by setting WITHOUT_DEBUG_FILES=yes + in src.conf(5). + 20151130: r291527 changed the internal interface between the nfsd.ko and nfscommon.ko modules. As such, they must both be upgraded to-gether. Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Mon Dec 7 19:08:33 2015 (r291954) +++ head/share/mk/bsd.opts.mk Mon Dec 7 19:15:52 2015 (r291955) @@ -50,6 +50,7 @@ ____: __DEFAULT_YES_OPTIONS = \ ASSERT_DEBUG \ + DEBUG_FILES \ DOCCOMPRESS \ INCLUDES \ INSTALLLIB \ @@ -69,7 +70,6 @@ __DEFAULT_NO_OPTIONS = \ CCACHE_BUILD \ FAST_DEPEND \ CTF \ - DEBUG_FILES \ INSTALL_AS_USER \ STALE_STAGED From owner-svn-src-all@freebsd.org Mon Dec 7 19:17:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 830029D25CC for ; Mon, 7 Dec 2015 19:17:48 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from erouter6.ore.mailhop.org (erouter6.ore.mailhop.org [54.187.213.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 664261881 for ; Mon, 7 Dec 2015 19:17:47 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound3.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Mon, 7 Dec 2015 19:16:25 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tB7JHdkK002950; Mon, 7 Dec 2015 12:17:39 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1449515859.1358.11.camel@freebsd.org> Subject: Re: svn commit: r291929 - head/tools/tools/nanobsd From: Ian Lepore To: Garrett Cooper Cc: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Mon, 07 Dec 2015 12:17:39 -0700 In-Reply-To: <5FA6DD6B-C70B-4E5A-BD04-5897B02E5FC8@gmail.com> References: <201512071024.tB7AOcjr094296@repo.freebsd.org> <1449512013.1358.6.camel@freebsd.org> <5FA6DD6B-C70B-4E5A-BD04-5897B02E5FC8@gmail.com> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 19:17:48 -0000 On Mon, 2015-12-07 at 11:07 -0800, Garrett Cooper wrote: > > On Dec 7, 2015, at 10:13, Ian Lepore wrote: > > > > > On Mon, 2015-12-07 at 10:24 +0000, Warner Losh wrote: > > > Author: imp > > > Date: Mon Dec 7 10:24:38 2015 > > > New Revision: 291929 > > > URL: https://svnweb.freebsd.org/changeset/base/291929 > > > > > > Log: > > > Make sure to quote the arg after -n and -z tests. > > > > While I am generally a quoting fanatic and would much rather > > overquote > > than underquote in shell scripts, fyi it's not actually needed for > > the > > -n and -z tests. test(1) and shells seem to be smart enough to see > > the > > ']' (which is just an arg to test, not shell language syntax) and > > know > > there isn't a string in front of it. > > Warner's commit was good. There's a more bulletproof way to do this > to make it more portable (in most cases, not all), but it would be > overkill: > > [ "x$x" != x ] > > Also, his commit protects against variables with spaces in them doing > unexpected things with test(1). > > Thanks, > -NGie Arrrgggghhhh! No no no no, a thousand times NO. There is NO EXCUSE for that ugly unnecessary xfoo stuff. Quoting properly supplies all the bulletproofing needed for string comparisons. It does look like I was wrong about all shells/test implementations handling the closing bracket for -n and -z as an empty-string indicator though, so quoting is a good solution for that. (Quoting is a good solution for everything, it drives me nuts that I can't use spaces in directory and filenames because so many unix scripts fall on their faces with parameter passing and other tricky quoting situations). -- Ian From owner-svn-src-all@freebsd.org Mon Dec 7 19:19:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2AC39D28ED; Mon, 7 Dec 2015 19:19:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF4C31C35; Mon, 7 Dec 2015 19:19:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7JJp4s052484; Mon, 7 Dec 2015 19:19:51 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7JJpDg052483; Mon, 7 Dec 2015 19:19:51 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201512071919.tB7JJpDg052483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 7 Dec 2015 19:19:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291956 - in stable: 10/release/doc/share/xml 9/release/doc/share/xml X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 19:19:53 -0000 Author: gjb Date: Mon Dec 7 19:19:51 2015 New Revision: 291956 URL: https://svnweb.freebsd.org/changeset/base/291956 Log: Document SA-15:26 Sponsored by: The FreeBSD Foundation Modified: stable/10/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/9/release/doc/share/xml/security.xml Modified: stable/10/release/doc/share/xml/security.xml ============================================================================== --- stable/10/release/doc/share/xml/security.xml Mon Dec 7 19:15:52 2015 (r291955) +++ stable/10/release/doc/share/xml/security.xml Mon Dec 7 19:19:51 2015 (r291956) @@ -46,6 +46,13 @@ 26 October 2015 Multiple vulnerabilities + + + FreeBSD-SA-15:26.openssl + 5 December 2015 + Multiple vulnerabilities + From owner-svn-src-all@freebsd.org Mon Dec 7 19:19:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 335449D28F3; Mon, 7 Dec 2015 19:19:53 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 006EF1C36; Mon, 7 Dec 2015 19:19:52 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7JJqLC052490; Mon, 7 Dec 2015 19:19:52 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7JJq0J052489; Mon, 7 Dec 2015 19:19:52 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201512071919.tB7JJq0J052489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 7 Dec 2015 19:19:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r291956 - in stable: 10/release/doc/share/xml 9/release/doc/share/xml X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 19:19:53 -0000 Author: gjb Date: Mon Dec 7 19:19:51 2015 New Revision: 291956 URL: https://svnweb.freebsd.org/changeset/base/291956 Log: Document SA-15:26 Sponsored by: The FreeBSD Foundation Modified: stable/9/release/doc/share/xml/security.xml Changes in other areas also in this revision: Modified: stable/10/release/doc/share/xml/security.xml Modified: stable/9/release/doc/share/xml/security.xml ============================================================================== --- stable/9/release/doc/share/xml/security.xml Mon Dec 7 19:15:52 2015 (r291955) +++ stable/9/release/doc/share/xml/security.xml Mon Dec 7 19:19:51 2015 (r291956) @@ -245,6 +245,13 @@ 26 October 2015 Multiple vulnerabilities + + + FreeBSD-SA-15:26.openssl + 5 December 2015 + Multiple vulnerabilities + From owner-svn-src-all@freebsd.org Mon Dec 7 19:21:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 301139D2BBE; Mon, 7 Dec 2015 19:21:10 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2F951F3E; Mon, 7 Dec 2015 19:21:09 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7JL91w052593; Mon, 7 Dec 2015 19:21:09 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7JL99b052592; Mon, 7 Dec 2015 19:21:09 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512071921.tB7JL99b052592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Mon, 7 Dec 2015 19:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291957 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 19:21:10 -0000 Author: brueffer Date: Mon Dec 7 19:21:08 2015 New Revision: 291957 URL: https://svnweb.freebsd.org/changeset/base/291957 Log: Fix a comment typo in the code example. PR: 203497 Submitted by: chadf@triularity.org MFC after: 1 week Modified: head/share/man/man9/g_bio.9 Modified: head/share/man/man9/g_bio.9 ============================================================================== --- head/share/man/man9/g_bio.9 Mon Dec 7 19:19:51 2015 (r291956) +++ head/share/man/man9/g_bio.9 Mon Dec 7 19:21:08 2015 (r291957) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 1, 2006 +.Dd December 7, 2015 .Dt G_BIO 9 .Os .Sh NAME @@ -253,7 +253,7 @@ example_start(struct bio *bp) /* Ok, schedule it down. */ /* * The consumer can be obtained from - * LIST_FIRST(&bp->bio_to->geom->consumers) as well, + * LIST_FIRST(&bp->bio_to->geom->consumer) as well, * if there is only one in our geom. */ g_io_request(cbp, sc->ex_consumer); From owner-svn-src-all@freebsd.org Mon Dec 7 19:32:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CFFE9B96A5 for ; Mon, 7 Dec 2015 19:32:08 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x235.google.com (mail-wm0-x235.google.com [IPv6:2a00:1450:400c:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B534518CD for ; Mon, 7 Dec 2015 19:32:07 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wmww144 with SMTP id w144so154211500wmw.1 for ; Mon, 07 Dec 2015 11:32:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=e7O1VZ0PdbKi96+JQ6rsm6JYCESaO/hsR1RJYjHkYSQ=; b=o8bTNCZ8oKvTxkiVyTEb5gfhEyoWPQZLuBatskQU+7nNyNfOUhDq+mHI3aCNzqjkTG zVlc2GpHHkjpqimA9or/z2VrC8r07h/xubvWudNyqMp4BkN/PY1vl/W2q9pI2YBOQ8vM cKHXwAAh6nHcxT1vLQ1UAGZxcvyp4CtqsUuvEBXeqP72aLXM99q6tclFa+ouQD2GqyM0 ti1l5VDv22dNZuD/ryiEnhdvdrjaqrSEFukTCafeaB3113GwDyodTj+U+NVu3Srvnzh1 XcLpDBPFdEwzpYSrGwX+GISPyiENqW2uHiAb2u+IHv0bVI3OQlSboxxQtSY4wXkSvw/y FtHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=e7O1VZ0PdbKi96+JQ6rsm6JYCESaO/hsR1RJYjHkYSQ=; b=e0sdVdzzvMh/9reUsofgJrH/vD1Ujf+dA99zWPi4hDi+Sh7rcHcbG9gmwC9RkkM79S VOQMUVDDjO8FQEltlTxiT0tzQbUYqgOg6+0htEp0BXpEgqopK6QDoZiOU0KjP2UnXGTX 3DlEK3iYNxZPgBAfjJ+BlnwcWgWfEDyMu2WkeLzE1E615mCfO5lhv3IP/+yWUTkFQNuk KTSGhCaLEjTQUgcd3HgaeTJNPZ4rR/4juTcH3mK5URge9kMlXMGftqv+yJujqs2q/Tnb X5obcZRDbQsjutTbo3DUoLGSYKMy5c6UrEFcW4UCDht8kPRB3+ahdT8h5QzMf1+AJLXO YVJw== X-Gm-Message-State: ALoCoQkFK7nkBRu06QK/GuMNtRu/irIZKpsz0ggrtKcHFuDIQCJO6DdObX3a5k5+yMXGh4/U0p9B MIME-Version: 1.0 X-Received: by 10.194.202.163 with SMTP id kj3mr33478330wjc.93.1449516725346; Mon, 07 Dec 2015 11:32:05 -0800 (PST) Received: by 10.194.85.167 with HTTP; Mon, 7 Dec 2015 11:32:05 -0800 (PST) In-Reply-To: <201512061746.tB6HkCWb072736@repo.freebsd.org> References: <201512061746.tB6HkCWb072736@repo.freebsd.org> Date: Mon, 7 Dec 2015 20:32:05 +0100 Message-ID: Subject: Re: svn commit: r291907 - head/sys/vm From: Oliver Pinter To: "Conrad E. Meyer" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 19:32:08 -0000 On 12/6/15, Conrad E. Meyer wrote: > Author: cem > Date: Sun Dec 6 17:46:12 2015 > New Revision: 291907 > URL: https://svnweb.freebsd.org/changeset/base/291907 > > Log: > vm_fault_hold: handle vm_page_rename failure > > On vm_page_rename failure, fix a missing object unlock and a double free > of > a page. > > First remove the old page, then rename into other page into first_object, > then free the old page. This avoids the problem on rename failure. This > is > a little ugly but seems to be the most straightforward solution. > > Tested with: > $ sysctl debug.fail_point.uma_zalloc_arg="1%return" > $ kyua test -k /usr/tests/sys/Kyuafile > > Submitted by: Ryan Libby > Reviewed by: kib > Seen by: alc > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D4326 > > Modified: > head/sys/vm/vm_fault.c > > Modified: head/sys/vm/vm_fault.c > Hi Conrad! You have any plan to MFC this commit? From owner-svn-src-all@freebsd.org Mon Dec 7 20:20:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B02759B90B3; Mon, 7 Dec 2015 20:20:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-lf0-x22b.google.com (mail-lf0-x22b.google.com [IPv6:2a00:1450:4010:c07::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E9411249; Mon, 7 Dec 2015 20:20:46 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by lffu14 with SMTP id u14so149515250lff.1; Mon, 07 Dec 2015 12:20:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=MTa5xHPGX343pOOY9XQQfksDW3xoCFcIKFt4BDSOjdE=; b=z9Lk1MpB9rrzoYlRgXLb8ypxFwGc2IYD0w3z+QRjB3NRAbgp09BFJ1Pjt+lpUAGmwp 4OAM9XTk7WtriQeIstgo6P9pqOY1TIQ9iX/pXyLrusjvmA9bLW/eTzrbSAj3VfUI7Es0 5DI6RiZkkJuADzVWjm1Ye4Fyaptl1c1XWnITnk+yHPTtHE4cQpSnbCRmp10GYGKAZHKb yYJ2ANE1JznoAzzkYjo4gyLHH6M7p8isIKltnn17M27L7lVuwyNJmpB/J3ulZghLxszA L7ctbKuUjwRhkNj6RzVZc2+dWN6NTlfpKzE6jz7S/6DjLbM7rHYn0kPb/Q7g9FTzFvs7 dqIA== MIME-Version: 1.0 X-Received: by 10.25.126.5 with SMTP id z5mr15154138lfc.112.1449519644273; Mon, 07 Dec 2015 12:20:44 -0800 (PST) Received: by 10.112.219.9 with HTTP; Mon, 7 Dec 2015 12:20:44 -0800 (PST) In-Reply-To: <1449515859.1358.11.camel@freebsd.org> References: <201512071024.tB7AOcjr094296@repo.freebsd.org> <1449512013.1358.6.camel@freebsd.org> <5FA6DD6B-C70B-4E5A-BD04-5897B02E5FC8@gmail.com> <1449515859.1358.11.camel@freebsd.org> Date: Mon, 7 Dec 2015 12:20:44 -0800 Message-ID: Subject: Re: svn commit: r291929 - head/tools/tools/nanobsd From: NGie Cooper To: Ian Lepore Cc: Warner Losh , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 20:20:46 -0000 On Mon, Dec 7, 2015 at 11:17 AM, Ian Lepore wrote: ... > Arrrgggghhhh! No no no no, a thousand times NO. > > There is NO EXCUSE for that ugly unnecessary xfoo stuff. Quoting > properly supplies all the bulletproofing needed for string comparisons. The xfoo stuff protected against... foo="-lt this variable starts with something that you don't expect" # *wink* *nudge*" ... but as emaste@ said, this is for shells that are not really relevant anymore (SunOS :)?). Thanks, -NGie From owner-svn-src-all@freebsd.org Mon Dec 7 20:21:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E971F9B9129; Mon, 7 Dec 2015 20:21:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B6F8A1437; Mon, 7 Dec 2015 20:21:13 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7KLCfs071900; Mon, 7 Dec 2015 20:21:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7KLC3f071899; Mon, 7 Dec 2015 20:21:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512072021.tB7KLC3f071899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 7 Dec 2015 20:21:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291958 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 20:21:14 -0000 Author: emaste Date: Mon Dec 7 20:21:12 2015 New Revision: 291958 URL: https://svnweb.freebsd.org/changeset/base/291958 Log: elfcopy: exclude extension when converting from binary When converting from binary to ELF, elfcopy creates symbols _binary__start_, _binary__end, and _binary__size. For compatibility with GNU objcopy (and to produce sensible symbol names) the extension must be stripped off. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4238 Modified: head/contrib/elftoolchain/elfcopy/binary.c Modified: head/contrib/elftoolchain/elfcopy/binary.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/binary.c Mon Dec 7 19:21:08 2015 (r291957) +++ head/contrib/elftoolchain/elfcopy/binary.c Mon Dec 7 20:21:12 2015 (r291958) @@ -37,6 +37,16 @@ ELFTC_VCSID("$Id: binary.c 3174 2015-03-27 17:13:41Z emaste $"); +static int +basename_length(const char *filename) +{ + char *p; + + if ((p = strchr(filename, '.')) != NULL) + return (p - filename); + return (strlen(filename)); +} + /* * Convert ELF object to `binary'. Sections with SHF_ALLOC flag set * are copied to the result binary. The relative offsets for each section @@ -211,7 +221,8 @@ create_elf_from_binary(struct elfcopy *e shtab->sz += gelf_fsize(ecp->eout, ELF_T_SHDR, 2, EV_CURRENT); #define _GEN_SYMNAME(S) do { \ - snprintf(name, sizeof(name), "%s%s%s", "_binary_", ifn, S); \ + snprintf(name, sizeof(name), "%s%.*s%s", "_binary_", \ + basename_length(ifn), ifn, S); \ } while (0) /* From owner-svn-src-all@freebsd.org Mon Dec 7 20:48:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6A169C1B67; Mon, 7 Dec 2015 20:48:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A1EB41162; Mon, 7 Dec 2015 20:48:29 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7KmSXS078508; Mon, 7 Dec 2015 20:48:28 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7KmSTZ078507; Mon, 7 Dec 2015 20:48:28 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512072048.tB7KmSTZ078507@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 7 Dec 2015 20:48:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291959 - head/bin/ls X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 20:48:30 -0000 Author: bapt Date: Mon Dec 7 20:48:28 2015 New Revision: 291959 URL: https://svnweb.freebsd.org/changeset/base/291959 Log: Fix ls -l alignement with new locales Latest update of locales introduced abbreviated month that follows the regionale rules meaning that they can be of variable length instead of being arbitrary truncated to top 3 characters. To fix alignement, ls now computes the visible length of the abbreviated month, pads the shorter month with spaces in order to make sure everything is properly aligned Reviewed by: ache, ed, jilles Differential Revision: https://reviews.freebsd.org/D4239 Modified: head/bin/ls/print.c Modified: head/bin/ls/print.c ============================================================================== --- head/bin/ls/print.c Mon Dec 7 20:21:12 2015 (r291958) +++ head/bin/ls/print.c Mon Dec 7 20:48:28 2015 (r291959) @@ -47,12 +47,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include #include +#include #ifdef COLORLS #include #include @@ -105,6 +107,9 @@ static struct { } colors[C_NUMCOLORS]; #endif +static size_t padding_for_month[12]; +static size_t month_max_size = 0; + void printscol(const DISPLAY *dp) { @@ -138,6 +143,70 @@ printname(const char *field, const char return rc; } +static const char * +get_abmon(int mon) +{ + + switch (mon) { + case 0: return (nl_langinfo(ABMON_1)); + case 1: return (nl_langinfo(ABMON_2)); + case 2: return (nl_langinfo(ABMON_3)); + case 3: return (nl_langinfo(ABMON_4)); + case 4: return (nl_langinfo(ABMON_5)); + case 5: return (nl_langinfo(ABMON_6)); + case 6: return (nl_langinfo(ABMON_7)); + case 7: return (nl_langinfo(ABMON_8)); + case 8: return (nl_langinfo(ABMON_9)); + case 9: return (nl_langinfo(ABMON_10)); + case 10: return (nl_langinfo(ABMON_11)); + case 11: return (nl_langinfo(ABMON_12)); + } + + /* should never happen */ + abort(); +} + +static size_t +mbswidth(const char *month) +{ + wchar_t wc; + size_t width, donelen, clen, w; + + width = donelen = 0; + while ((clen = mbrtowc(&wc, month + donelen, MB_LEN_MAX, NULL)) != 0) { + if (clen == (size_t)-1 || clen == (size_t)-2) + return (-1); + donelen += clen; + if ((w = wcwidth(wc)) == (size_t)-1) + return (-1); + width += w; + } + + return (width); +} + +static void +compute_abbreviated_month_size(void) +{ + int i; + size_t width; + size_t months_width[12]; + + for (i = 0; i < 12; i++) { + width = mbswidth(get_abmon(i)); + if (width == (size_t)-1) { + month_max_size = -1; + return; + } + months_width[i] = width; + if (width > month_max_size) + month_max_size = width; + } + + for (i = 0; i < 12; i++) + padding_for_month[i] = month_max_size - months_width[i]; +} + /* * print name in current style */ @@ -425,6 +494,31 @@ printdev(size_t width, dev_t dev) xo_emit("{:device/%#*jx} ", (u_int)width, (uintmax_t)dev); } +static size_t +ls_strftime(char *str, size_t len, const char *fmt, const struct tm *tm) +{ + char *posb, nfmt[BUFSIZ]; + const char *format = fmt; + size_t ret; + + if ((posb = strstr(fmt, "%b")) != NULL) { + if (month_max_size == 0) { + compute_abbreviated_month_size(); + } + if (month_max_size > 0) { + snprintf(nfmt, sizeof(nfmt), "%.*s%s%*s%s", + (int)(posb - fmt), fmt, + get_abmon(tm->tm_mon), + (int)padding_for_month[tm->tm_mon], + "", + posb + 2); + format = nfmt; + } + } + ret = strftime(str, len, format, tm); + return (ret); +} + static void printtime(const char *field, time_t ftime) { @@ -451,7 +545,7 @@ printtime(const char *field, time_t ftim else /* mmm dd yyyy || dd mmm yyyy */ format = d_first ? "%e %b %Y" : "%b %e %Y"; - strftime(longstring, sizeof(longstring), format, localtime(&ftime)); + ls_strftime(longstring, sizeof(longstring), format, localtime(&ftime)); snprintf(fmt, sizeof(fmt), "{d:%s/%%hs} ", field); xo_attr("value", "%ld", (long) ftime); From owner-svn-src-all@freebsd.org Mon Dec 7 21:04:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 601C99D38C2; Mon, 7 Dec 2015 21:04:28 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31813110C; Mon, 7 Dec 2015 21:04:28 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7L4Rla084397; Mon, 7 Dec 2015 21:04:27 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7L4RWX084396; Mon, 7 Dec 2015 21:04:27 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201512072104.tB7L4RWX084396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Mon, 7 Dec 2015 21:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291960 - head/sys/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 21:04:28 -0000 Author: ken Date: Mon Dec 7 21:04:27 2015 New Revision: 291960 URL: https://svnweb.freebsd.org/changeset/base/291960 Log: The ccb_xflags enumeration was removed from FreeBSD/head in r259397 (it contained the CAM_EXTLUN_VALID bit) and I added the same type name with a different set of values back in r291716. The old ccb_xflags enumeration still exists in FreeBSD stable/10. Shift all of the new values by one bit to avoid compatibility issues when merged to stable/10. MFC after: 3 days Sponsored by: Spectra Logic Modified: head/sys/cam/cam_ccb.h Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Mon Dec 7 20:48:28 2015 (r291959) +++ head/sys/cam/cam_ccb.h Mon Dec 7 21:04:27 2015 (r291960) @@ -110,9 +110,9 @@ typedef enum { } ccb_flags; typedef enum { - CAM_USER_DATA_ADDR = 0x00000001,/* Userspace data pointers */ - CAM_SG_FORMAT_IOVEC = 0x00000002,/* iovec instead of busdma S/G*/ - CAM_UNMAPPED_BUF = 0x00000004 /* use unmapped I/O */ + CAM_USER_DATA_ADDR = 0x00000002,/* Userspace data pointers */ + CAM_SG_FORMAT_IOVEC = 0x00000004,/* iovec instead of busdma S/G*/ + CAM_UNMAPPED_BUF = 0x00000008 /* use unmapped I/O */ } ccb_xflags; /* XPT Opcodes for xpt_action */ From owner-svn-src-all@freebsd.org Mon Dec 7 21:33:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F166F9B7264; Mon, 7 Dec 2015 21:33:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C14A211D1; Mon, 7 Dec 2015 21:33:16 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7LXGCd093315; Mon, 7 Dec 2015 21:33:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7LXFBE093307; Mon, 7 Dec 2015 21:33:15 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201512072133.tB7LXFBE093307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 7 Dec 2015 21:33:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291961 - in head: share/man/man9 sys/arm/arm sys/cddl/contrib/opensolaris/uts/intel/dtrace sys/cddl/contrib/opensolaris/uts/powerpc/dtrace sys/kern sys/mips/mips sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 21:33:17 -0000 Author: markj Date: Mon Dec 7 21:33:15 2015 New Revision: 291961 URL: https://svnweb.freebsd.org/changeset/base/291961 Log: Add helper functions proc_readmem() and proc_writemem(). These helper functions can be used to read in or write a buffer from or to an arbitrary process' address space. Without them, this can only be done using proc_rwmem(), which requires the caller to fill out a uio. This is onerous and results in code duplication; the new functions provide a simpler interface which is sufficient for most existing callers of proc_rwmem(). This change also adds a manual page for proc_rwmem() and the new functions. Reviewed by: jhb, kib Differential Revision: https://reviews.freebsd.org/D4245 Modified: head/share/man/man9/Makefile head/sys/arm/arm/machdep.c head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c head/sys/kern/kern_proc.c head/sys/kern/sys_process.c head/sys/mips/mips/pm_machdep.c head/sys/sys/ptrace.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Mon Dec 7 21:04:27 2015 (r291960) +++ head/share/man/man9/Makefile Mon Dec 7 21:33:15 2015 (r291961) @@ -239,6 +239,7 @@ MAN= accept_filter.9 \ printf.9 \ prison_check.9 \ priv.9 \ + proc_rwmem.9 \ pseudofs.9 \ psignal.9 \ random.9 \ @@ -1340,6 +1341,8 @@ MLINKS+=printf.9 log.9 \ printf.9 uprintf.9 MLINKS+=priv.9 priv_check.9 \ priv.9 priv_check_cred.9 +MLINKS+=proc_rwmem.9 proc_readmem.9 \ + proc_rwmem.9 proc_writemem.9 MLINKS+=psignal.9 gsignal.9 \ psignal.9 pgsignal.9 \ psignal.9 tdsignal.9 Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Mon Dec 7 21:04:27 2015 (r291960) +++ head/sys/arm/arm/machdep.c Mon Dec 7 21:33:15 2015 (r291961) @@ -598,41 +598,21 @@ set_dbregs(struct thread *td, struct dbr static int -ptrace_read_int(struct thread *td, vm_offset_t addr, u_int32_t *v) +ptrace_read_int(struct thread *td, vm_offset_t addr, uint32_t *v) { - struct iovec iov; - struct uio uio; - PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); - iov.iov_base = (caddr_t) v; - iov.iov_len = sizeof(u_int32_t); - uio.uio_iov = &iov; - uio.uio_iovcnt = 1; - uio.uio_offset = (off_t)addr; - uio.uio_resid = sizeof(u_int32_t); - uio.uio_segflg = UIO_SYSSPACE; - uio.uio_rw = UIO_READ; - uio.uio_td = td; - return proc_rwmem(td->td_proc, &uio); + if (proc_readmem(td, td->td_proc, addr, v, sizeof(*v)) != sizeof(*v)) + return (ENOMEM); + return (0); } static int -ptrace_write_int(struct thread *td, vm_offset_t addr, u_int32_t v) +ptrace_write_int(struct thread *td, vm_offset_t addr, uint32_t v) { - struct iovec iov; - struct uio uio; - PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); - iov.iov_base = (caddr_t) &v; - iov.iov_len = sizeof(u_int32_t); - uio.uio_iov = &iov; - uio.uio_iovcnt = 1; - uio.uio_offset = (off_t)addr; - uio.uio_resid = sizeof(u_int32_t); - uio.uio_segflg = UIO_SYSSPACE; - uio.uio_rw = UIO_WRITE; - uio.uio_td = td; - return proc_rwmem(td->td_proc, &uio); + if (proc_writemem(td, td->td_proc, addr, &v, sizeof(v)) != sizeof(v)) + return (ENOMEM); + return (0); } static u_int Modified: head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Dec 7 21:04:27 2015 (r291960) +++ head/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c Mon Dec 7 21:33:15 2015 (r291961) @@ -60,43 +60,31 @@ #include static int -proc_ops(int op, proc_t *p, void *kaddr, off_t uaddr, size_t len) +uread(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) { - struct iovec iov; - struct uio uio; + ssize_t n; - iov.iov_base = kaddr; - iov.iov_len = len; - uio.uio_offset = uaddr; - uio.uio_iov = &iov; - uio.uio_resid = len; - uio.uio_iovcnt = 1; - uio.uio_segflg = UIO_SYSSPACE; - uio.uio_td = curthread; - uio.uio_rw = op; PHOLD(p); - if (proc_rwmem(p, &uio) != 0) { - PRELE(p); - return (-1); - } + n = proc_readmem(curthread, p, uaddr, kaddr, len); PRELE(p); - + if (n != len) + return (ENOMEM); return (0); } static int -uread(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) -{ - - return (proc_ops(UIO_READ, p, kaddr, uaddr, len)); -} - -static int uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) { + ssize_t n; - return (proc_ops(UIO_WRITE, p, kaddr, uaddr, len)); + PHOLD(p); + n = proc_writemem(curthread, p, uaddr, kaddr, len); + PRELE(p); + if (n != len) + return (ENOMEM); + return (0); } + #endif /* illumos */ #ifdef __i386__ #define r_rax r_eax Modified: head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Mon Dec 7 21:04:27 2015 (r291960) +++ head/sys/cddl/contrib/opensolaris/uts/powerpc/dtrace/fasttrap_isa.c Mon Dec 7 21:33:15 2015 (r291961) @@ -43,44 +43,30 @@ #define OP_RA(x) (((x) & 0x001F0000) >> 16) #define OP_RB(x) (((x) & 0x0000F100) >> 11) - static int -proc_ops(int op, proc_t *p, void *kaddr, off_t uaddr, size_t len) +uread(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) { - struct iovec iov; - struct uio uio; + ssize_t n; - iov.iov_base = kaddr; - iov.iov_len = len; - uio.uio_offset = uaddr; - uio.uio_iov = &iov; - uio.uio_resid = len; - uio.uio_iovcnt = 1; - uio.uio_segflg = UIO_SYSSPACE; - uio.uio_td = curthread; - uio.uio_rw = op; PHOLD(p); - if (proc_rwmem(p, &uio) != 0) { - PRELE(p); - return (-1); - } + n = proc_readmem(curthread, p, uaddr, kaddr, len); PRELE(p); - + if (n <= 0 || n < len) + return (ENOMEM); return (0); } static int -uread(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) -{ - - return (proc_ops(UIO_READ, p, kaddr, uaddr, len)); -} - -static int uwrite(proc_t *p, void *kaddr, size_t len, uintptr_t uaddr) { + ssize_t n; - return (proc_ops(UIO_WRITE, p, kaddr, uaddr, len)); + PHOLD(p); + n = proc_writemem(curthread, p, uaddr, kaddr, len); + PRELE(p); + if (n <= 0 || n < len) + return (ENOMEM); + return (0); } int Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Mon Dec 7 21:04:27 2015 (r291960) +++ head/sys/kern/kern_proc.c Mon Dec 7 21:33:15 2015 (r291961) @@ -1526,50 +1526,20 @@ pargs_drop(struct pargs *pa) } static int -proc_read_mem(struct thread *td, struct proc *p, vm_offset_t offset, void* buf, - size_t len) -{ - struct iovec iov; - struct uio uio; - - iov.iov_base = (caddr_t)buf; - iov.iov_len = len; - uio.uio_iov = &iov; - uio.uio_iovcnt = 1; - uio.uio_offset = offset; - uio.uio_resid = (ssize_t)len; - uio.uio_segflg = UIO_SYSSPACE; - uio.uio_rw = UIO_READ; - uio.uio_td = td; - - return (proc_rwmem(p, &uio)); -} - -static int proc_read_string(struct thread *td, struct proc *p, const char *sptr, char *buf, size_t len) { - size_t i; - int error; + ssize_t n; - error = proc_read_mem(td, p, (vm_offset_t)sptr, buf, len); /* - * Reading the chunk may validly return EFAULT if the string is shorter - * than the chunk and is aligned at the end of the page, assuming the - * next page is not mapped. So if EFAULT is returned do a fallback to - * one byte read loop. + * This may return a short read if the string is shorter than the chunk + * and is aligned at the end of the page, and the following page is not + * mapped. */ - if (error == EFAULT) { - for (i = 0; i < len; i++, buf++, sptr++) { - error = proc_read_mem(td, p, (vm_offset_t)sptr, buf, 1); - if (error != 0) - return (error); - if (*buf == '\0') - break; - } - error = 0; - } - return (error); + n = proc_readmem(td, p, (vm_offset_t)sptr, buf, len); + if (n <= 0) + return (ENOMEM); + return (0); } #define PROC_AUXV_MAX 256 /* Safety limit on auxv size. */ @@ -1593,10 +1563,10 @@ get_proc_vector32(struct thread *td, str size_t vsize, size; int i, error; - error = proc_read_mem(td, p, (vm_offset_t)(p->p_sysent->sv_psstrings), - &pss, sizeof(pss)); - if (error != 0) - return (error); + error = 0; + if (proc_readmem(td, p, (vm_offset_t)p->p_sysent->sv_psstrings, &pss, + sizeof(pss)) != sizeof(pss)) + return (ENOMEM); switch (type) { case PROC_ARG: vptr = (vm_offset_t)PTRIN(pss.ps_argvstr); @@ -1618,9 +1588,9 @@ get_proc_vector32(struct thread *td, str if (vptr % 4 != 0) return (ENOEXEC); for (ptr = vptr, i = 0; i < PROC_AUXV_MAX; i++) { - error = proc_read_mem(td, p, ptr, &aux, sizeof(aux)); - if (error != 0) - return (error); + if (proc_readmem(td, p, ptr, &aux, sizeof(aux)) != + sizeof(aux)) + return (ENOMEM); if (aux.a_type == AT_NULL) break; ptr += sizeof(aux); @@ -1635,9 +1605,10 @@ get_proc_vector32(struct thread *td, str return (EINVAL); } proc_vector32 = malloc(size, M_TEMP, M_WAITOK); - error = proc_read_mem(td, p, vptr, proc_vector32, size); - if (error != 0) + if (proc_readmem(td, p, vptr, proc_vector32, size) != size) { + error = ENOMEM; goto done; + } if (type == PROC_AUX) { *proc_vectorp = (char **)proc_vector32; *vsizep = vsize; @@ -1663,16 +1634,15 @@ get_proc_vector(struct thread *td, struc vm_offset_t vptr, ptr; char **proc_vector; size_t vsize, size; - int error, i; + int i; #ifdef COMPAT_FREEBSD32 if (SV_PROC_FLAG(p, SV_ILP32) != 0) return (get_proc_vector32(td, p, proc_vectorp, vsizep, type)); #endif - error = proc_read_mem(td, p, (vm_offset_t)(p->p_sysent->sv_psstrings), - &pss, sizeof(pss)); - if (error != 0) - return (error); + if (proc_readmem(td, p, (vm_offset_t)p->p_sysent->sv_psstrings, &pss, + sizeof(pss)) != sizeof(pss)) + return (ENOMEM); switch (type) { case PROC_ARG: vptr = (vm_offset_t)pss.ps_argvstr; @@ -1709,9 +1679,9 @@ get_proc_vector(struct thread *td, struc * to the allocated proc_vector. */ for (ptr = vptr, i = 0; i < PROC_AUXV_MAX; i++) { - error = proc_read_mem(td, p, ptr, &aux, sizeof(aux)); - if (error != 0) - return (error); + if (proc_readmem(td, p, ptr, &aux, sizeof(aux)) != + sizeof(aux)) + return (ENOMEM); if (aux.a_type == AT_NULL) break; ptr += sizeof(aux); @@ -1732,12 +1702,9 @@ get_proc_vector(struct thread *td, struc return (EINVAL); /* In case we are built without INVARIANTS. */ } proc_vector = malloc(size, M_TEMP, M_WAITOK); - if (proc_vector == NULL) - return (ENOMEM); - error = proc_read_mem(td, p, vptr, proc_vector, size); - if (error != 0) { + if (proc_readmem(td, p, vptr, proc_vector, size) != size) { free(proc_vector, M_TEMP); - return (error); + return (ENOMEM); } *proc_vectorp = proc_vector; *vsizep = vsize; Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Mon Dec 7 21:04:27 2015 (r291960) +++ head/sys/kern/sys_process.c Mon Dec 7 21:33:15 2015 (r291961) @@ -252,6 +252,7 @@ proc_rwmem(struct proc *p, struct uio *u * from exiting out from under us until this operation completes. */ PROC_ASSERT_HELD(p); + PROC_LOCK_ASSERT(p, MA_NOTOWNED); /* * The map we want... @@ -327,6 +328,49 @@ proc_rwmem(struct proc *p, struct uio *u return (error); } +static ssize_t +proc_iop(struct thread *td, struct proc *p, vm_offset_t va, void *buf, + size_t len, enum uio_rw rw) +{ + struct iovec iov; + struct uio uio; + ssize_t slen; + int error; + + MPASS(len < SSIZE_MAX); + slen = (ssize_t)len; + + iov.iov_base = (caddr_t)buf; + iov.iov_len = len; + uio.uio_iov = &iov; + uio.uio_iovcnt = 1; + uio.uio_offset = va; + uio.uio_resid = slen; + uio.uio_segflg = UIO_SYSSPACE; + uio.uio_rw = rw; + uio.uio_td = td; + error = proc_rwmem(p, &uio); + if (uio.uio_resid == slen) + return (-1); + return (slen - uio.uio_resid); +} + +ssize_t +proc_readmem(struct thread *td, struct proc *p, vm_offset_t va, void *buf, + size_t len) +{ + + return (proc_iop(td, p, va, buf, len, UIO_READ)); +} + +ssize_t +proc_writemem(struct thread *td, struct proc *p, vm_offset_t va, void *buf, + size_t len) +{ + + return (proc_iop(td, p, va, buf, len, UIO_WRITE)); +} + static int ptrace_vm_entry(struct thread *td, struct proc *p, struct ptrace_vm_entry *pve) { @@ -644,7 +688,7 @@ kern_ptrace(struct thread *td, int req, struct thread *td2 = NULL, *td3; struct ptrace_io_desc *piod = NULL; struct ptrace_lwpinfo *pl; - int error, write, tmp, num; + int error, num, tmp; int proctree_locked = 0; lwpid_t tid = 0, *buf; #ifdef COMPAT_FREEBSD32 @@ -674,7 +718,6 @@ kern_ptrace(struct thread *td, int req, break; } - write = 0; if (req == PT_TRACE_ME) { p = td->td_proc; PROC_LOCK(p); @@ -1033,46 +1076,28 @@ kern_ptrace(struct thread *td, int req, case PT_WRITE_I: case PT_WRITE_D: td2->td_dbgflags |= TDB_USERWR; - write = 1; - /* FALLTHROUGH */ + PROC_UNLOCK(p); + error = 0; + if (proc_writemem(td, p, (off_t)(uintptr_t)addr, &data, + sizeof(int)) != sizeof(int)) + error = ENOMEM; + else + CTR3(KTR_PTRACE, "PT_WRITE: pid %d: %p <= %#x", + p->p_pid, addr, data); + PROC_LOCK(p); + break; + case PT_READ_I: case PT_READ_D: PROC_UNLOCK(p); - tmp = 0; - /* write = 0 set above */ - iov.iov_base = write ? (caddr_t)&data : (caddr_t)&tmp; - iov.iov_len = sizeof(int); - uio.uio_iov = &iov; - uio.uio_iovcnt = 1; - uio.uio_offset = (off_t)(uintptr_t)addr; - uio.uio_resid = sizeof(int); - uio.uio_segflg = UIO_SYSSPACE; /* i.e.: the uap */ - uio.uio_rw = write ? UIO_WRITE : UIO_READ; - uio.uio_td = td; - error = proc_rwmem(p, &uio); - if (uio.uio_resid != 0) { - /* - * XXX proc_rwmem() doesn't currently return ENOSPC, - * so I think write() can bogusly return 0. - * XXX what happens for short writes? We don't want - * to write partial data. - * XXX proc_rwmem() returns EPERM for other invalid - * addresses. Convert this to EINVAL. Does this - * clobber returns of EPERM for other reasons? - */ - if (error == 0 || error == ENOSPC || error == EPERM) - error = EINVAL; /* EOF */ - } - if (!write) - td->td_retval[0] = tmp; - if (error == 0) { - if (write) - CTR3(KTR_PTRACE, "PT_WRITE: pid %d: %p <= %#x", - p->p_pid, addr, data); - else - CTR3(KTR_PTRACE, "PT_READ: pid %d: %p >= %#x", - p->p_pid, addr, tmp); - } + error = tmp = 0; + if (proc_readmem(td, p, (off_t)(uintptr_t)addr, &tmp, + sizeof(int)) != sizeof(int)) + error = ENOMEM; + else + CTR3(KTR_PTRACE, "PT_READ: pid %d: %p >= %#x", + p->p_pid, addr, tmp); + td->td_retval[0] = tmp; PROC_LOCK(p); break; Modified: head/sys/mips/mips/pm_machdep.c ============================================================================== --- head/sys/mips/mips/pm_machdep.c Mon Dec 7 21:04:27 2015 (r291960) +++ head/sys/mips/mips/pm_machdep.c Mon Dec 7 21:33:15 2015 (r291961) @@ -214,39 +214,19 @@ ptrace_set_pc(struct thread *td, unsigne static int ptrace_read_int(struct thread *td, off_t addr, int *v) { - struct iovec iov; - struct uio uio; - PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); - iov.iov_base = (caddr_t) v; - iov.iov_len = sizeof(int); - uio.uio_iov = &iov; - uio.uio_iovcnt = 1; - uio.uio_offset = (off_t)addr; - uio.uio_resid = sizeof(int); - uio.uio_segflg = UIO_SYSSPACE; - uio.uio_rw = UIO_READ; - uio.uio_td = td; - return proc_rwmem(td->td_proc, &uio); + if (proc_readmem(td, td->td_proc, addr, v, sizeof(*v)) != sizeof(*v)) + return (ENOMEM); + return (0); } static int ptrace_write_int(struct thread *td, off_t addr, int v) { - struct iovec iov; - struct uio uio; - PROC_LOCK_ASSERT(td->td_proc, MA_NOTOWNED); - iov.iov_base = (caddr_t) &v; - iov.iov_len = sizeof(int); - uio.uio_iov = &iov; - uio.uio_iovcnt = 1; - uio.uio_offset = (off_t)addr; - uio.uio_resid = sizeof(int); - uio.uio_segflg = UIO_SYSSPACE; - uio.uio_rw = UIO_WRITE; - uio.uio_td = td; - return proc_rwmem(td->td_proc, &uio); + if (proc_writemem(td, td->td_proc, addr, &v, sizeof(v)) != sizeof(v)) + return (ENOMEM); + return (0); } int Modified: head/sys/sys/ptrace.h ============================================================================== --- head/sys/sys/ptrace.h Mon Dec 7 21:04:27 2015 (r291960) +++ head/sys/sys/ptrace.h Mon Dec 7 21:33:15 2015 (r291961) @@ -166,6 +166,10 @@ int proc_read_dbregs(struct thread *_td, int proc_write_dbregs(struct thread *_td, struct dbreg *_dbreg); int proc_sstep(struct thread *_td); int proc_rwmem(struct proc *_p, struct uio *_uio); +ssize_t proc_readmem(struct thread *_td, struct proc *_p, vm_offset_t _va, + void *_buf, size_t _len); +ssize_t proc_writemem(struct thread *_td, struct proc *_p, vm_offset_t _va, + void *_buf, size_t _len); #ifdef COMPAT_FREEBSD32 struct reg32; struct fpreg32; From owner-svn-src-all@freebsd.org Mon Dec 7 21:44:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A1EE9B7E2A; Mon, 7 Dec 2015 21:44:07 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E772C1B18; Mon, 7 Dec 2015 21:44:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7Li61L096424; Mon, 7 Dec 2015 21:44:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7Li5Qq096421; Mon, 7 Dec 2015 21:44:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201512072144.tB7Li5Qq096421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 7 Dec 2015 21:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291962 - in head: cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/dev/dtrace X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 21:44:07 -0000 Author: markj Date: Mon Dec 7 21:44:05 2015 New Revision: 291962 URL: https://svnweb.freebsd.org/changeset/base/291962 Log: Modify DTRACEHIOC_ADDDOF to copy the DOF section from the target process. r281257 added support for lazyload mode by allowing dtrace(1) to register a DOF section on behalf of a traced process. This was implemented by having libdtrace copy the DOF section into a heap-allocated buffer and passing its address to the ioctl handler. However, DTrace uses the DOF section address as a lookup key in certain cases, so the ioctl handler should be given the target process' DOF section address instead. This change modifies the ADDDOF handler to copy the DOF section in from the target process, rather than from dtrace(1). Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/dev/dtrace/dtrace_ioctl.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c Mon Dec 7 21:33:15 2015 (r291961) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_pid.c Mon Dec 7 21:44:05 2015 (r291962) @@ -571,12 +571,6 @@ dt_pid_usdt_mapping(void *data, const pr prsyminfo_t sip; dof_helper_t dh; GElf_Half e_type; -#ifdef __FreeBSD__ - dof_hdr_t hdr; - size_t sz; - uint64_t dofmax; - void *dof; -#endif const char *mname; const char *syms[] = { "___SUNW_dof", "__SUNW_dof" }; int i, fd = -1; @@ -606,61 +600,25 @@ dt_pid_usdt_mapping(void *data, const pr continue; } -#ifdef __FreeBSD__ + dh.dofhp_dof = sym.st_value; dh.dofhp_addr = (e_type == ET_EXEC) ? 0 : pmp->pr_vaddr; - if (Pread(P, &hdr, sizeof (hdr), sym.st_value) != - sizeof (hdr)) { - dt_dprintf("read of DOF header failed\n"); - continue; - } - - sz = sizeof(dofmax); - if (sysctlbyname("kern.dtrace.dof_maxsize", &dofmax, &sz, - NULL, 0) != 0) { - dt_dprintf("failed to read dof_maxsize: %s\n", - strerror(errno)); - continue; - } - if (dofmax < hdr.dofh_loadsz) { - dt_dprintf("DOF load size exceeds maximum\n"); - continue; - } - - if ((dof = malloc(hdr.dofh_loadsz)) == NULL) - return (-1); - - if (Pread(P, dof, hdr.dofh_loadsz, sym.st_value) != - hdr.dofh_loadsz) { - free(dof); - dt_dprintf("read of DOF section failed\n"); - continue; - } - - dh.dofhp_dof = (uintptr_t)dof; - dh.dofhp_pid = proc_getpid(P); dt_pid_objname(dh.dofhp_mod, sizeof (dh.dofhp_mod), sip.prs_lmid, mname); +#ifdef __FreeBSD__ + dh.dofhp_pid = proc_getpid(P); + if (fd == -1 && (fd = open("/dev/dtrace/helper", O_RDWR, 0)) < 0) { dt_dprintf("open of helper device failed: %s\n", strerror(errno)); - free(dof); return (-1); /* errno is set for us */ } if (ioctl(fd, DTRACEHIOC_ADDDOF, &dh, sizeof (dh)) < 0) dt_dprintf("DOF was rejected for %s\n", dh.dofhp_mod); - - free(dof); #else - dh.dofhp_dof = sym.st_value; - dh.dofhp_addr = (e_type == ET_EXEC) ? 0 : pmp->pr_vaddr; - - dt_pid_objname(dh.dofhp_mod, sizeof (dh.dofhp_mod), - sip.prs_lmid, mname); - if (fd == -1 && (fd = pr_open(P, "/dev/dtrace/helper", O_RDWR, 0)) < 0) { dt_dprintf("pr_open of helper device failed: %s\n", Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Dec 7 21:33:15 2015 (r291961) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Dec 7 21:44:05 2015 (r291962) @@ -120,13 +120,17 @@ #include #include #include -#include #include #include +#include #include #include +#include + #include + #include + #include "dtrace_cddl.h" #include "dtrace_debug.c" #endif @@ -13030,9 +13034,60 @@ dtrace_dof_copyin(uintptr_t uarg, int *e return (dof); } -#ifndef illumos +#ifdef __FreeBSD__ +static dof_hdr_t * +dtrace_dof_copyin_proc(struct proc *p, uintptr_t uarg, int *errp) +{ + dof_hdr_t hdr, *dof; + struct thread *td; + size_t loadsz; + + ASSERT(!MUTEX_HELD(&dtrace_lock)); + + td = curthread; + + /* + * First, we're going to copyin() the sizeof (dof_hdr_t). + */ + if (proc_readmem(td, p, uarg, &hdr, sizeof(hdr)) != sizeof(hdr)) { + dtrace_dof_error(NULL, "failed to copyin DOF header"); + *errp = EFAULT; + return (NULL); + } + + /* + * Now we'll allocate the entire DOF and copy it in -- provided + * that the length isn't outrageous. + */ + if (hdr.dofh_loadsz >= dtrace_dof_maxsize) { + dtrace_dof_error(&hdr, "load size exceeds maximum"); + *errp = E2BIG; + return (NULL); + } + loadsz = (size_t)hdr.dofh_loadsz; + + if (loadsz < sizeof (hdr)) { + dtrace_dof_error(&hdr, "invalid load size"); + *errp = EINVAL; + return (NULL); + } + + dof = kmem_alloc(loadsz, KM_SLEEP); + + if (proc_readmem(td, p, uarg, dof, loadsz) != loadsz || + dof->dofh_loadsz != loadsz) { + kmem_free(dof, hdr.dofh_loadsz); + *errp = EFAULT; + return (NULL); + } + + return (dof); +} + static __inline uchar_t -dtrace_dof_char(char c) { +dtrace_dof_char(char c) +{ + switch (c) { case '0': case '1': @@ -13063,7 +13118,7 @@ dtrace_dof_char(char c) { /* Should not reach here. */ return (0); } -#endif +#endif /* __FreeBSD__ */ static dof_hdr_t * dtrace_dof_property(const char *name) @@ -15967,31 +16022,23 @@ dtrace_helper_provider_validate(dof_hdr_ } static int +#ifdef __FreeBSD__ +dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp, struct proc *p) +#else dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp) +#endif { dtrace_helpers_t *help; dtrace_vstate_t *vstate; dtrace_enabling_t *enab = NULL; +#ifndef __FreeBSD__ proc_t *p = curproc; +#endif int i, gen, rv, nhelpers = 0, nprovs = 0, destroy = 1; uintptr_t daddr = (uintptr_t)dof; ASSERT(MUTEX_HELD(&dtrace_lock)); -#ifdef __FreeBSD__ - if (dhp->dofhp_pid != p->p_pid) { - if ((p = pfind(dhp->dofhp_pid)) == NULL) - return (-1); - if (!P_SHOULDSTOP(p) || - (p->p_flag & P_TRACED) == 0 || - p->p_pptr->p_pid != curproc->p_pid) { - PROC_UNLOCK(p); - return (-1); - } - PROC_UNLOCK(p); - } -#endif - if ((help = p->p_dtrace_helpers) == NULL) help = dtrace_helpers_create(p); Modified: head/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- head/sys/cddl/dev/dtrace/dtrace_ioctl.c Mon Dec 7 21:33:15 2015 (r291961) +++ head/sys/cddl/dev/dtrace/dtrace_ioctl.c Mon Dec 7 21:44:05 2015 (r291962) @@ -32,25 +32,47 @@ static int dtrace_ioctl_helper(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread *td) { - dof_helper_t *dhp = NULL; - dof_hdr_t *dof = NULL; + struct proc *p; + dof_helper_t *dhp; + dof_hdr_t *dof; int rval; + dhp = NULL; + dof = NULL; + rval = 0; switch (cmd) { case DTRACEHIOC_ADDDOF: dhp = (dof_helper_t *)addr; - /* XXX all because dofhp_dof is 64 bit */ - addr = (caddr_t)(vm_offset_t)dhp->dofhp_dof; + addr = (caddr_t)(uintptr_t)dhp->dofhp_dof; /* FALLTHROUGH */ case DTRACEHIOC_ADD: - dof = dtrace_dof_copyin((intptr_t)addr, &rval); + p = curproc; + if (p->p_pid == dhp->dofhp_pid) { + dof = dtrace_dof_copyin((uintptr_t)addr, &rval); + } else { + p = pfind(dhp->dofhp_pid); + if (p == NULL) + return (EINVAL); + if (!P_SHOULDSTOP(p) || + (p->p_flag & P_TRACED|P_WEXIT) == 0 || + p->p_pptr != curproc) { + PROC_UNLOCK(p); + return (EINVAL); + } + _PHOLD(p); + PROC_UNLOCK(p); + dof = dtrace_dof_copyin_proc(p, (uintptr_t)addr, &rval); + } - if (dof == NULL) - return (rval); + if (dof == NULL) { + if (p != curproc) + PRELE(p); + break; + } mutex_enter(&dtrace_lock); - if ((rval = dtrace_helper_slurp((dof_hdr_t *)dof, dhp)) != -1) { - if (dhp) { + if ((rval = dtrace_helper_slurp(dof, dhp, p)) != -1) { + if (dhp != NULL) { dhp->dofhp_gen = rval; copyout(dhp, addr, sizeof(*dhp)); } @@ -59,19 +81,19 @@ dtrace_ioctl_helper(struct cdev *dev, u_ rval = EINVAL; } mutex_exit(&dtrace_lock); - - return (rval); + if (p != curproc) + PRELE(p); + break; case DTRACEHIOC_REMOVE: mutex_enter(&dtrace_lock); - rval = dtrace_helper_destroygen(NULL, (int)*addr); + rval = dtrace_helper_destroygen(NULL, *(int *)(uintptr_t)addr); mutex_exit(&dtrace_lock); - - return (rval); + break; default: + rval = ENOTTY; break; } - - return (ENOTTY); + return (rval); } /* ARGSUSED */ From owner-svn-src-all@freebsd.org Mon Dec 7 21:49:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7CB99B9339; Mon, 7 Dec 2015 21:49:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 854431D77; Mon, 7 Dec 2015 21:49:34 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7LnX76096667; Mon, 7 Dec 2015 21:49:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7LnXF0096662; Mon, 7 Dec 2015 21:49:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201512072149.tB7LnXF0096662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 7 Dec 2015 21:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291963 - in head: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/contrib/opensolaris/uts/common/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 21:49:35 -0000 Author: markj Date: Mon Dec 7 21:49:32 2015 New Revision: 291963 URL: https://svnweb.freebsd.org/changeset/base/291963 Log: MFV r289003: 6271 dtrace caused excessive fork time Author: Bryan Cantrill Reviewed by: Adam Leventhal Reviewed by: Dan McDonald Reviewed by: Richard Lowe Approved by: Gordon Ross illumos/illumos-gate@7bd3c1d12d0c764e1517c3aca62c634409356764 Added: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh - copied, changed from r289003, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh.out - copied unchanged from r289003, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh.out Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Directory Properties: head/cddl/contrib/opensolaris/ (props changed) head/sys/cddl/contrib/opensolaris/ (props changed) Copied and modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh (from r289003, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh) ============================================================================== --- vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh Thu Oct 8 04:29:39 2015 (r289003, copy source) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh Mon Dec 7 21:49:32 2015 (r291963) @@ -59,14 +59,14 @@ provider doogle { }; EOF - gcc -m32 -c $oogle.c + cc -c $oogle.c if [ $? -ne 0 ]; then print -u2 "failed to compile $oogle.c" exit 1 fi - $dtrace -G -32 -s $oogle.d $oogle.o -o $oogle.d.o + $dtrace -G -s $oogle.d $oogle.o -o $oogle.d.o if [ $? -ne 0 ]; then print -u2 "failed to process $oogle.d" @@ -79,7 +79,7 @@ done echo "}" >> test.c -gcc -m32 -o test test.c $objs +cc -o test test.c $objs if [ $? -ne 0 ]; then print -u2 "failed to compile test.c" @@ -95,5 +95,5 @@ if [ $? -ne 0 ]; then fi cd / -/usr/bin/rm -rf $DIR +rm -rf $DIR exit 0 Copied: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh.out (from r289003, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh.out Mon Dec 7 21:49:32 2015 (r291963, copy of r289003, vendor/illumos/dist/cmd/dtrace/test/tst/common/usdt/tst.sameprovmulti.ksh.out) @@ -0,0 +1,4 @@ +bagnoogle 1 +cockoogle 1 +stalloogle 1 + Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Dec 7 21:44:05 2015 (r291962) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Mon Dec 7 21:49:32 2015 (r291963) @@ -15749,8 +15749,8 @@ dtrace_helper_provider_add(dof_helper_t * Check to make sure this isn't a duplicate. */ for (i = 0; i < help->dthps_nprovs; i++) { - if (dofhp->dofhp_dof == - help->dthps_provs[i]->dthp_prov.dofhp_dof) + if (dofhp->dofhp_addr == + help->dthps_provs[i]->dthp_prov.dofhp_addr) return (EALREADY); } @@ -16110,7 +16110,14 @@ dtrace_helper_slurp(dof_hdr_t *dof, dof_ dtrace_enabling_destroy(enab); if (dhp != NULL && nprovs > 0) { + /* + * Now that this is in-kernel, we change the sense of the + * members: dofhp_dof denotes the in-kernel copy of the DOF + * and dofhp_addr denotes the address at user-level. + */ + dhp->dofhp_addr = dhp->dofhp_dof; dhp->dofhp_dof = (uint64_t)(uintptr_t)dof; + if (dtrace_helper_provider_add(dhp, help, gen) == 0) { mutex_exit(&dtrace_lock); dtrace_helper_provider_register(p, help, dhp); Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Dec 7 21:44:05 2015 (r291962) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c Mon Dec 7 21:49:32 2015 (r291963) @@ -2117,6 +2117,18 @@ fasttrap_meta_provide(void *arg, dtrace_ return (provider); } +/* + * We know a few things about our context here: we know that the probe being + * created doesn't already exist (DTrace won't load DOF at the same address + * twice, even if explicitly told to do so) and we know that we are + * single-threaded with respect to the meta provider machinery. Knowing that + * this is a new probe and that there is no way for us to race with another + * operation on this provider allows us an important optimization: we need not + * lookup a probe before adding it. Saving this lookup is important because + * this code is in the fork path for processes with USDT probes, and lookups + * here are potentially very expensive because of long hash conflicts on + * module, function and name (DTrace doesn't hash on provider name). + */ /*ARGSUSED*/ static void fasttrap_meta_create_probe(void *arg, void *parg, @@ -2153,19 +2165,6 @@ fasttrap_meta_create_probe(void *arg, vo return; } - /* - * Grab the creation lock to ensure consistency between calls to - * dtrace_probe_lookup() and dtrace_probe_create() in the face of - * other threads creating probes. - */ - mutex_enter(&provider->ftp_cmtx); - - if (dtrace_probe_lookup(provider->ftp_provid, dhpb->dthpb_mod, - dhpb->dthpb_func, dhpb->dthpb_name) != 0) { - mutex_exit(&provider->ftp_cmtx); - return; - } - ntps = dhpb->dthpb_noffs + dhpb->dthpb_nenoffs; ASSERT(ntps > 0); @@ -2173,7 +2172,6 @@ fasttrap_meta_create_probe(void *arg, vo if (fasttrap_total > fasttrap_max) { atomic_add_32(&fasttrap_total, -ntps); - mutex_exit(&provider->ftp_cmtx); return; } @@ -2237,8 +2235,6 @@ fasttrap_meta_create_probe(void *arg, vo */ pp->ftp_id = dtrace_probe_create(provider->ftp_provid, dhpb->dthpb_mod, dhpb->dthpb_func, dhpb->dthpb_name, FASTTRAP_OFFSET_AFRAMES, pp); - - mutex_exit(&provider->ftp_cmtx); } /*ARGSUSED*/ Modified: head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Mon Dec 7 21:44:05 2015 (r291962) +++ head/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Mon Dec 7 21:49:32 2015 (r291963) @@ -2205,12 +2205,18 @@ extern void dtrace_probe(dtrace_id_t, ui * * 1.2.4 Caller's context * - * dtms_create_probe() is called from either ioctl() or module load context. - * The DTrace framework is locked in such a way that meta providers may not - * register or unregister. This means that the meta provider cannot call - * dtrace_meta_register() or dtrace_meta_unregister(). However, the context is - * such that the provider may (and is expected to) call provider-related - * DTrace provider APIs including dtrace_probe_create(). + * dtms_create_probe() is called from either ioctl() or module load context + * in the context of a newly-created provider (that is, a provider that + * is a result of a call to dtms_provide_pid()). The DTrace framework is + * locked in such a way that meta providers may not register or unregister, + * such that no other thread can call into a meta provider operation and that + * atomicity is assured with respect to meta provider operations across + * dtms_provide_pid() and subsequent calls to dtms_create_probe(). + * The context is thus effectively single-threaded with respect to the meta + * provider, and that the meta provider cannot call dtrace_meta_register() + * or dtrace_meta_unregister(). However, the context is such that the + * provider may (and is expected to) call provider-related DTrace provider + * APIs including dtrace_probe_create(). * * 1.3 void *dtms_provide_pid(void *arg, dtrace_meta_provider_t *mprov, * pid_t pid) From owner-svn-src-all@freebsd.org Mon Dec 7 21:51:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F99E9B9688; Mon, 7 Dec 2015 21:51:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D120108C; Mon, 7 Dec 2015 21:51:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7LpoFO097527; Mon, 7 Dec 2015 21:51:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7Lpoeg097526; Mon, 7 Dec 2015 21:51:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201512072151.tB7Lpoeg097526@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 7 Dec 2015 21:51:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291964 - head/cddl/usr.sbin/dtrace/tests/common/usdt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 21:51:51 -0000 Author: markj Date: Mon Dec 7 21:51:50 2015 New Revision: 291964 URL: https://svnweb.freebsd.org/changeset/base/291964 Log: Update DTrace test suite makefiles after r291963. Modified: head/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile Modified: head/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile Mon Dec 7 21:49:32 2015 (r291963) +++ head/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile Mon Dec 7 21:51:50 2015 (r291964) @@ -46,6 +46,8 @@ TESTFILES= \ tst.onlyenabled.ksh \ tst.reap.ksh \ tst.reeval.ksh \ + tst.sameprovmulti.ksh \ + tst.sameprovmulti.ksh.out \ tst.static.ksh \ tst.static.ksh.out \ tst.static2.ksh \ From owner-svn-src-all@freebsd.org Mon Dec 7 21:57:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9554D9B9B87; Mon, 7 Dec 2015 21:57:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 62C531359; Mon, 7 Dec 2015 21:57:37 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7LvaWr099719; Mon, 7 Dec 2015 21:57:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7LvaCC099718; Mon, 7 Dec 2015 21:57:36 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201512072157.tB7LvaCC099718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 7 Dec 2015 21:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291965 - head/cddl/usr.sbin/dtrace/tests/common/proc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 21:57:37 -0000 Author: markj Date: Mon Dec 7 21:57:36 2015 New Revision: 291965 URL: https://svnweb.freebsd.org/changeset/base/291965 Log: Fix a discrepancy in r291738. The script that generates these makefiles was changed to modify LIBADD rather than LDADD/DPADD, but the makefile itself was also changed in a slightly different way. Modified: head/cddl/usr.sbin/dtrace/tests/common/proc/Makefile Modified: head/cddl/usr.sbin/dtrace/tests/common/proc/Makefile ============================================================================== --- head/cddl/usr.sbin/dtrace/tests/common/proc/Makefile Mon Dec 7 21:51:50 2015 (r291964) +++ head/cddl/usr.sbin/dtrace/tests/common/proc/Makefile Mon Dec 7 21:57:36 2015 (r291965) @@ -24,6 +24,6 @@ CFILES= \ tst.sigwait.c \ -LIBADD.tst.sigwait.exe=rt +LIBADD.tst.sigwait.exe+= rt .include "../../dtrace.test.mk" From owner-svn-src-all@freebsd.org Mon Dec 7 21:59:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC6A49B9D39; Mon, 7 Dec 2015 21:59:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8982F158A; Mon, 7 Dec 2015 21:59:11 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7LxAOB099810; Mon, 7 Dec 2015 21:59:10 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7LxAcJ099809; Mon, 7 Dec 2015 21:59:10 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201512072159.tB7LxAcJ099809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 7 Dec 2015 21:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291966 - head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 21:59:11 -0000 Author: markj Date: Mon Dec 7 21:59:10 2015 New Revision: 291966 URL: https://svnweb.freebsd.org/changeset/base/291966 Log: Add a trailing newline to the expected output for tst.walltimestamp.ksh. MFC after: 1 week Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh.out Modified: head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh.out ============================================================================== --- head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh.out Mon Dec 7 21:57:36 2015 (r291965) +++ head/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/printa/tst.walltimestamp.ksh.out Mon Dec 7 21:59:10 2015 (r291966) @@ -1,2 +1,3 @@ Sun, 25 Jan 2004 13:00:00 PST 2004 Jan 25 13:00:00 + From owner-svn-src-all@freebsd.org Mon Dec 7 22:00:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FCE69B9E4E; Mon, 7 Dec 2015 22:00:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DB4E17D6; Mon, 7 Dec 2015 22:00:14 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7M0DU8099921; Mon, 7 Dec 2015 22:00:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7M0DYt099920; Mon, 7 Dec 2015 22:00:13 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201512072200.tB7M0DYt099920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 7 Dec 2015 22:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291967 - head/share/man/man7 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 22:00:14 -0000 Author: markj Date: Mon Dec 7 22:00:13 2015 New Revision: 291967 URL: https://svnweb.freebsd.org/changeset/base/291967 Log: Fix a couple misspellings of "environment." MFC after: 3 days Modified: head/share/man/man7/release.7 Modified: head/share/man/man7/release.7 ============================================================================== --- head/share/man/man7/release.7 Mon Dec 7 21:59:10 2015 (r291966) +++ head/share/man/man7/release.7 Mon Dec 7 22:00:13 2015 (r291967) @@ -369,7 +369,7 @@ variables are relevant only to virtual m Set to a non-null value to build virtual machine disk images as part of the release build. .Va WITH_VMIMAGES -may also be specified as an envirionment variable passed to +may also be specified as an environment variable passed to .Xr make 1 . .Pp The option requires @@ -528,7 +528,7 @@ The target requires the .Va WITH_VMIMAGES .Xr make 1 -envirionment variable to be set to a non-null value. +environment variable to be set to a non-null value. .It Cm vm-cloudware Builds .Fx From owner-svn-src-all@freebsd.org Mon Dec 7 22:08:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5409C9C1533; Mon, 7 Dec 2015 22:08:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3036A1CBC; Mon, 7 Dec 2015 22:08:13 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7M8Cq6002786; Mon, 7 Dec 2015 22:08:12 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7M8CbZ002785; Mon, 7 Dec 2015 22:08:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201512072208.tB7M8CbZ002785@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 7 Dec 2015 22:08:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291968 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 22:08:13 -0000 Author: markj Date: Mon Dec 7 22:08:12 2015 New Revision: 291968 URL: https://svnweb.freebsd.org/changeset/base/291968 Log: Actually add the proc_rwmem(9) man page, missed in r291961. Added: head/share/man/man9/proc_rwmem.9 (contents, props changed) Added: head/share/man/man9/proc_rwmem.9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man9/proc_rwmem.9 Mon Dec 7 22:08:12 2015 (r291968) @@ -0,0 +1,104 @@ +.\" +.\" Copyright (c) 2015 Mark Johnston +.\" +.\" 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 December 7, 2015 +.Dt PROC_RWMEM 9 +.Os +.Sh NAME +.Nm proc_rwmem , +.Nm proc_readmem , +.Nm proc_writemem +.Nd read from or write to a process address space +.Sh SYNOPSIS +.In sys/types.h +.In sys/ptrace.h +.Ft int +.Fn proc_rwmem "struct proc *p" "struct uio *uio" +.Ft ssize_t +.Fn proc_readmem "struct thread *td" "struct proc *p" "vm_offset_t va" "void *buf" "size_t len" +.Ft ssize_t +.Fn proc_writemem "struct thread *td" "struct proc *p" "vm_offset_t va" "void *buf" "size_t len" +.Sh DESCRIPTION +These functions are used to read to or write from the address space of the +process +.Fa p . +The +.Fn proc_rwmem +function requires the caller to specify the I/O parameters using a +.Vt "struct uio" , +described in +.Xr uio 9 . +The +.Fn proc_readmem +and +.Fn proc_writemem +functions provide a simpler, less general interface which allows the caller to +read into or write the kernel buffer +.Fa buf +of size +.Fa len +from or to the memory at offset +.Fa va +in the address space of +.Fa p . +The operation is performed on behalf of thread +.Fa td , +which will most often be the current thread. +.Pp +These functions may sleep and thus may not be called with any non-sleepable +locks held. +The process +.Fa p +must be held by the caller using +.Xr PHOLD 9 . +.Sh RETURN VALUES +The +.Fn proc_rwmem +function returns +.Dv 0 +on success. +.Dv EFAULT +is returned if the specified user address is invalid, and +.Dv ENOMEM +is returned if the target pages could not be faulted in due to a resource +shortage. +.Pp +The +.Fn proc_readmem +and +.Fn proc_writemem +functions return the number of bytes read or written, respectively. +This may be smaller than the number of bytes requested, for example if the +request spans multiple pages in the process address space and one of them after +the first is not mapped. +Otherwise, -1 is returned. +.Sh SEE ALSO +.Xr copyin 9 , +.Xr locking 9 , +.Xr PHOLD 9 , +.Xr uio 9 +.Sh AUTHORS +This manual page was written by +.An Mark Johnston Aq Mt markj@FreeBSD.org . From owner-svn-src-all@freebsd.org Mon Dec 7 22:51:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C785B9C1A46; Mon, 7 Dec 2015 22:51:28 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 900501594; Mon, 7 Dec 2015 22:51:28 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7MpR4S016691; Mon, 7 Dec 2015 22:51:27 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7MpPwf016661; Mon, 7 Dec 2015 22:51:25 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201512072251.tB7MpPwf016661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 7 Dec 2015 22:51:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r291970 - in vendor/NetBSD/bmake/dist: . mk unit-tests X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 22:51:28 -0000 Author: sjg Date: Mon Dec 7 22:51:25 2015 New Revision: 291970 URL: https://svnweb.freebsd.org/changeset/base/291970 Log: Import bmake-20151201 Modified: vendor/NetBSD/bmake/dist/ChangeLog vendor/NetBSD/bmake/dist/Makefile vendor/NetBSD/bmake/dist/boot-strap vendor/NetBSD/bmake/dist/cond.c vendor/NetBSD/bmake/dist/config.h.in vendor/NetBSD/bmake/dist/configure vendor/NetBSD/bmake/dist/configure.in vendor/NetBSD/bmake/dist/main.c vendor/NetBSD/bmake/dist/meta.c vendor/NetBSD/bmake/dist/mk/ChangeLog vendor/NetBSD/bmake/dist/mk/host-target.mk vendor/NetBSD/bmake/dist/mk/init.mk vendor/NetBSD/bmake/dist/mk/install-mk vendor/NetBSD/bmake/dist/mk/lib.mk vendor/NetBSD/bmake/dist/mk/meta.autodep.mk vendor/NetBSD/bmake/dist/mk/meta.stage.mk vendor/NetBSD/bmake/dist/mk/meta.subdir.mk vendor/NetBSD/bmake/dist/mk/meta.sys.mk vendor/NetBSD/bmake/dist/mk/own.mk vendor/NetBSD/bmake/dist/mk/sys.mk vendor/NetBSD/bmake/dist/os.sh vendor/NetBSD/bmake/dist/parse.c vendor/NetBSD/bmake/dist/unit-tests/Makefile.in vendor/NetBSD/bmake/dist/unit-tests/cond2.mk vendor/NetBSD/bmake/dist/unit-tests/doterror.exp vendor/NetBSD/bmake/dist/unit-tests/modts.mk vendor/NetBSD/bmake/dist/var.c Modified: vendor/NetBSD/bmake/dist/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/ChangeLog Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/ChangeLog Mon Dec 7 22:51:25 2015 (r291970) @@ -1,3 +1,35 @@ +2015-12-01 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151201 + Merge with NetBSD make, pick up + o cond.c: CondCvtArg: avoid access beyond end of empty buffer. + o meta.c: meta_oodate: use lstat(2) for checking link target + in case it is a symlink. + o var.c: avoid calling brk_string and Var_Export1 with empty + strings. + +2015-11-26 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151126 + Merge with NetBSD make, pick up + o parse.c: ParseTrackInput don't access beyond + end of old value. + +2015-10-22 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151022 + + * Add support for BSD/OS which lacks inttypes.h + and really needs sys/param.h for sys/sysctl.h + also 'type' is not a shell builtin. + + * var.c: eliminate uint32_t and need for inttypes.h + + * main.c: PrintOnError flush stdout before run .ERROR + + * parse.c: cope with _SC_PAGESIZE not being defined. + + 2015-10-20 Simon J. Gerraty * Makefile (MAKE_VERSION): 20151020 Modified: vendor/NetBSD/bmake/dist/Makefile ============================================================================== --- vendor/NetBSD/bmake/dist/Makefile Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/Makefile Mon Dec 7 22:51:25 2015 (r291970) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.44 2015/10/20 21:41:40 sjg Exp $ +# $Id: Makefile,v 1.48 2015/12/02 00:36:42 sjg Exp $ # Base version on src date -MAKE_VERSION= 20151020 +MAKE_VERSION= 20151201 PROG= bmake Modified: vendor/NetBSD/bmake/dist/boot-strap ============================================================================== --- vendor/NetBSD/bmake/dist/boot-strap Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/boot-strap Mon Dec 7 22:51:25 2015 (r291970) @@ -111,7 +111,7 @@ # Simon J. Gerraty # RCSid: -# $Id: boot-strap,v 1.45 2014/04/05 22:56:54 sjg Exp $ +# $Id: boot-strap,v 1.48 2015/10/25 05:20:48 sjg Exp $ # # @(#) Copyright (c) 2001 Simon J. Gerraty # @@ -395,8 +395,15 @@ Bmake() { ) } +# there is actually a shell where type is not a builtin +# if type is missing, which(1) had better exists! +if (type cat) > /dev/null 2>&1; then +which() { + type "$@" | sed 's,[()],,g;s,^[^/][^/]*,,;q' +} +fi # make sure test below uses the same diff that configure did -TOOL_DIFF=`type diff | sed 's,[()],,g;s,^[^/][^/]*,,;q'` +TOOL_DIFF=`which diff` export TOOL_DIFF op_configure() { Modified: vendor/NetBSD/bmake/dist/cond.c ============================================================================== --- vendor/NetBSD/bmake/dist/cond.c Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/cond.c Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.69 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: cond.c,v 1.71 2015/12/02 00:28:24 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: cond.c,v 1.69 2015/10/11 04:51:24 sjg Exp $"; +static char rcsid[] = "$NetBSD: cond.c,v 1.71 2015/12/02 00:28:24 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: cond.c,v 1.69 2015/10/11 04:51:24 sjg Exp $"); +__RCSID("$NetBSD: cond.c,v 1.71 2015/12/02 00:28:24 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -490,6 +490,10 @@ CondCvtArg(char *str, double *value) double d_val; errno = 0; + if (!*str) { + *value = (double)0; + return TRUE; + } l_val = strtoul(str, &eptr, str[1] == 'x' ? 16 : 10); ech = *eptr; if (ech == 0 && errno != ERANGE) { Modified: vendor/NetBSD/bmake/dist/config.h.in ============================================================================== --- vendor/NetBSD/bmake/dist/config.h.in Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/config.h.in Mon Dec 7 22:51:25 2015 (r291970) @@ -59,6 +59,12 @@ /* Define to 1 if you have the `killpg' function. */ #undef HAVE_KILLPG +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBGEN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -158,6 +164,9 @@ */ #undef HAVE_SYS_NDIR_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H @@ -304,6 +313,11 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + /* C99 function name */ #undef __func__ @@ -319,5 +333,9 @@ /* Define to `unsigned int' if does not define. */ #undef size_t +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef uint32_t + /* Define as `fork' if `vfork' does not work. */ #undef vfork Modified: vendor/NetBSD/bmake/dist/configure ============================================================================== Binary file (source and/or target). No diff available. Modified: vendor/NetBSD/bmake/dist/configure.in ============================================================================== --- vendor/NetBSD/bmake/dist/configure.in Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/configure.in Mon Dec 7 22:51:25 2015 (r291970) @@ -1,11 +1,11 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.54 2015/10/10 04:17:10 sjg Exp $ +dnl $Id: configure.in,v 1.56 2015/10/25 05:20:48 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl AC_PREREQ(2.50) -AC_INIT([bmake], [20151009], [sjg@NetBSD.org]) +AC_INIT([bmake], [20151022], [sjg@NetBSD.org]) AC_CONFIG_HEADERS(config.h) dnl make srcdir absolute @@ -101,10 +101,19 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_DIRENT dnl Keep this list sorted +AC_CHECK_HEADERS(sys/param.h) +dnl On BSDi at least we really need sys/param.h for sys/sysctl.h +AC_CHECK_HEADERS([sys/sysctl.h], [], [], +[#ifdef HAVE_SYS_PARAM_H +# include +# endif +]) + AC_CHECK_HEADERS( \ ar.h \ err.h \ fcntl.h \ + libgen.h \ limits.h \ paths.h \ poll.h \ @@ -113,7 +122,6 @@ AC_CHECK_HEADERS( \ sys/mman.h \ sys/select.h \ sys/socket.h \ - sys/sysctl.h \ sys/time.h \ sys/uio.h \ unistd.h \ @@ -143,6 +151,7 @@ AC_C_CONST AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T +AC_TYPE_UINT32_T AC_DECL_SYS_SIGLIST AC_HEADER_TIME AC_STRUCT_TM Modified: vendor/NetBSD/bmake/dist/main.c ============================================================================== --- vendor/NetBSD/bmake/dist/main.c Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/main.c Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.234 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: main.c,v 1.235 2015/10/25 05:24:44 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.234 2015/10/11 04:51:24 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.235 2015/10/25 05:24:44 sjg Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.234 2015/10/11 04:51:24 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.235 2015/10/25 05:24:44 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -1902,6 +1902,8 @@ PrintOnError(GNode *gn, const char *s) printf("%s", cp); free(cp); } + fflush(stdout); + /* * Finally, see if there is a .ERROR target, and run it if so. */ Modified: vendor/NetBSD/bmake/dist/meta.c ============================================================================== --- vendor/NetBSD/bmake/dist/meta.c Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/meta.c Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.40 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.41 2015/11/30 23:37:56 sjg Exp $ */ /* * Implement 'meta' mode. @@ -38,7 +38,11 @@ #include #include #include +#ifdef HAVE_LIBGEN_H #include +#elif !defined(HAVE_DIRNAME) +char * dirname(char *); +#endif #include #if !defined(HAVE_CONFIG_H) || defined(HAVE_ERR_H) #include @@ -1183,7 +1187,8 @@ meta_oodate(GNode *gn, Boolean oodate) if ((strstr("tmp", p))) break; - if (stat(p, &fs) < 0) { + if ((link_src != NULL && lstat(p, &fs) < 0) || + (link_src == NULL && stat(p, &fs) < 0)) { Lst_AtEnd(missingFiles, bmake_strdup(p)); } break; Modified: vendor/NetBSD/bmake/dist/mk/ChangeLog ============================================================================== --- vendor/NetBSD/bmake/dist/mk/ChangeLog Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/mk/ChangeLog Mon Dec 7 22:51:25 2015 (r291970) @@ -1,3 +1,29 @@ +2015-11-14 Simon J. Gerraty + + * install-mk (MK_VERSION): 20151111 + + * meta.sys.mk: include sys.dependfile.mk + + * sys.mk (OPTIONS_DEFAULT_NO): use options.mk + to set MK_AUTO_OBJ and MK_DIRDEPS_BUILD + include local.sys.env.mk early + include local.sys.mk later + + * own.mk (OPTIONS_DEFAULT_NO): AUTO_OBJ etc moved to sys.mk + +2015-11-13 Simon J. Gerraty + + * meta.sys.mk (META_COOKIE_TOUCH): + add ${META_COOKIE_TOUCH} to the end of scripts to touch cookie + + * meta.stage.mk: stage_libs should ignore SYMLINKS. + +2015-10-23 Simon J. Gerraty + + * install-mk (MK_VERSION): 20151022 + + * sys.mk: BSD/OS does not have 'type' as a shell builtin. + 2015-10-20 Simon J. Gerraty * install-mk (MK_VERSION): 20151020 @@ -460,7 +486,7 @@ needed. * gendirdeps.mk: only produce unqualified deps if no .MAKE.DEPENDFILE_PREFERENCE ends in .${MACHINE} - * meta.subdir.mk: apply SUBDIREPS_FILTER + * meta.subdir.mk: apply SUBDIRDEPS_FILTER 2012-04-20 Simon J. Gerraty Modified: vendor/NetBSD/bmake/dist/mk/host-target.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/host-target.mk Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/mk/host-target.mk Mon Dec 7 22:51:25 2015 (r291970) @@ -1,5 +1,5 @@ # RCSid: -# $Id: host-target.mk,v 1.9 2015/09/10 18:42:57 sjg Exp $ +# $Id: host-target.mk,v 1.11 2015/10/25 00:07:20 sjg Exp $ # Host platform information; may be overridden .if !defined(_HOST_OSNAME) @@ -21,7 +21,7 @@ _HOST_ARCH := ${_HOST_MACHINE} .else _HOST_ARCH != uname -p 2> /dev/null || uname -m # uname -p may produce garbage on linux -.if ${_HOST_ARCH:[\#]} > 1 +.if ${_HOST_ARCH:[\#]} > 1 || ${_HOST_ARCH:Nunknown} == "" _HOST_ARCH := ${_HOST_MACHINE} .endif .endif @@ -33,10 +33,10 @@ HOST_MACHINE := ${_HOST_MACHINE} .endif HOST_OSMAJOR := ${_HOST_OSREL:C/[^0-9].*//} -HOST_OSTYPE := ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH} +HOST_OSTYPE := ${_HOST_OSNAME:S,/,,g}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH} HOST_OS := ${_HOST_OSNAME} host_os := ${_HOST_OSNAME:tl} -HOST_TARGET := ${host_os}${HOST_OSMAJOR}-${_HOST_ARCH} +HOST_TARGET := ${host_os:S,/,,g}${HOST_OSMAJOR}-${_HOST_ARCH} # tr is insanely non-portable, accommodate the lowest common denominator TR ?= tr Modified: vendor/NetBSD/bmake/dist/mk/init.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/init.mk Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/mk/init.mk Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -# $Id: init.mk,v 1.9 2013/07/18 05:46:24 sjg Exp $ +# $Id: init.mk,v 1.10 2015/12/07 04:28:31 sjg Exp $ # # @(#) Copyright (c) 2002, Simon J. Gerraty # @@ -47,4 +47,8 @@ PROFFLAGS?= -DGPROF -DPROF _SKIP_BUILD = not building at level 0 .endif +.if !empty(_SKIP_BUILD) +all: .PHONY +.warning ${_SKIP_BUILD} +.endif .endif Modified: vendor/NetBSD/bmake/dist/mk/install-mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/install-mk Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/mk/install-mk Mon Dec 7 22:51:25 2015 (r291970) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.115 2015/10/20 22:04:53 sjg Exp $ +# $Id: install-mk,v 1.117 2015/11/14 18:09:57 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20151020 +MK_VERSION=20151111 OWNER= GROUP= MODE=444 Modified: vendor/NetBSD/bmake/dist/mk/lib.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/lib.mk Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/mk/lib.mk Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -# $Id: lib.mk,v 1.51 2014/05/23 01:30:36 sjg Exp $ +# $Id: lib.mk,v 1.52 2015/11/14 18:09:57 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -254,7 +254,7 @@ DLLIB ?= -ldl # is a waste of time, this tells meta.autodep.mk to just pick one # (typically .So) # yes, 42 is a random number. -.if ${MK_META_MODE} == "yes" && ${SRCS:Uno:[\#]} > 42 +.if ${MK_DIRDEPS_BUILD} == "yes" && ${SRCS:Uno:[\#]} > 42 OPTIMIZE_OBJECT_META_FILES ?= yes .endif Modified: vendor/NetBSD/bmake/dist/mk/meta.autodep.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta.autodep.mk Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/mk/meta.autodep.mk Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -# $Id: meta.autodep.mk,v 1.37 2015/06/16 06:29:17 sjg Exp $ +# $Id: meta.autodep.mk,v 1.39 2015/12/07 04:35:32 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -50,6 +50,9 @@ UPDATE_DEPENDFILE = NO .endif _CURDIR ?= ${.CURDIR} +_OBJDIR ?= ${.OBJDIR} +_OBJTOP ?= ${OBJTOP} +_OBJROOT ?= ${OBJROOT:U${_OBJTOP}} _DEPENDFILE := ${_CURDIR}/${.MAKE.DEPENDFILE:T} .if ${.MAKE.LEVEL} == 0 @@ -190,7 +193,7 @@ gendirdeps: ${_DEPENDFILE} # anything which matches ${_OBJROOT}* but not ${_OBJTOP}* # needs to be qualified in DIRDEPS # The pseudo machine "host" is used for HOST_TARGET -DIRDEPS = \ +DIRDEPS += \ ${DPADD:M${_OBJTOP}*:H:C,${_OBJTOP}[^/]*/,,:N.:O:u} \ ${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} Modified: vendor/NetBSD/bmake/dist/mk/meta.stage.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta.stage.mk Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/mk/meta.stage.mk Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -# $Id: meta.stage.mk,v 1.40 2015/10/04 17:36:54 sjg Exp $ +# $Id: meta.stage.mk,v 1.41 2015/11/13 17:34:04 sjg Exp $ # # @(#) Copyright (c) 2011, Simon J. Gerraty # @@ -155,7 +155,7 @@ stage_libs: .dirdep @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} \ ${SHLIB_LINKS:@t@${STAGE_LIBS:T:M$t.*} $t@} .elif !empty(SHLIB_LINK) && !empty(SHLIB_NAME) - @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} ${SHLIB_NAME} ${SHLIB_LINK} ${SYMLINKS:T} + @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} ${SHLIB_NAME} ${SHLIB_LINK} .endif .endif @touch $@ Modified: vendor/NetBSD/bmake/dist/mk/meta.subdir.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta.subdir.mk Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/mk/meta.subdir.mk Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -# $Id: meta.subdir.mk,v 1.10 2012/07/03 05:26:46 sjg Exp $ +# $Id: meta.subdir.mk,v 1.11 2015/11/24 22:26:51 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -62,7 +62,7 @@ _subdeps != cd ${.CURDIR} && \ DIRDEPS = .else # clean up if needed -DIRDEPS := ${DIRDEPS:S,^./,,:S,/./,/,g:${SUBDIREPS_FILTER:Uu}} +DIRDEPS := ${DIRDEPS:S,^./,,:S,/./,/,g:${SUBDIRDEPS_FILTER:Uu}} .endif # we just dealt with it, if we leave it defined, # dirdeps.mk will compute some interesting combinations. Modified: vendor/NetBSD/bmake/dist/mk/meta.sys.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/meta.sys.mk Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/mk/meta.sys.mk Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -# $Id: meta.sys.mk,v 1.22 2015/06/16 06:31:05 sjg Exp $ +# $Id: meta.sys.mk,v 1.26 2015/11/14 21:16:13 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -51,17 +51,6 @@ META_MODE += silent=yes .endif .endif -# make defaults .MAKE.DEPENDFILE to .depend -# that won't work for us. -.if ${.MAKE.DEPENDFILE} == ".depend" -.undef .MAKE.DEPENDFILE -.endif - -# if you don't cross build for multiple MACHINEs concurrently, then -# .MAKE.DEPENDFILE = Makefile.depend -# probably makes sense - you can set that in local.sys.mk -.MAKE.DEPENDFILE ?= Makefile.depend.${MACHINE} - # we use the pseudo machine "host" for the build host. # this should be taken care of before we get here .if ${OBJTOP:Ua} == ${HOST_OBJTOP:Ub} @@ -109,10 +98,27 @@ _metaError: .NOMETA .NOTMAIN .endif +META_COOKIE_TOUCH= +# some targets need to be .PHONY in non-meta mode +META_NOPHONY= .PHONY # Are we, after all, in meta mode? .if ${.MAKE.MODE:Mmeta*} != "" MKDEP_MK = meta.autodep.mk +.if ${.MAKE.MAKEFILES:M*sys.dependfile.mk} == "" +# this does all the smarts of setting .MAKE.DEPENDFILE +.-include +# check if we got anything sane +.if ${.MAKE.DEPENDFILE} == ".depend" +.undef .MAKE.DEPENDFILE +.endif +.MAKE.DEPENDFILE ?= Makefile.depend +.endif + +# we can afford to use cookies to prevent some targets +# re-running needlessly +META_COOKIE_TOUCH= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}} +META_NOPHONY= .if ${UPDATE_DEPENDFILE:Uyes:tl} != "no" .if ${.MAKEFLAGS:Uno:M-k} != "" # make this more obvious Modified: vendor/NetBSD/bmake/dist/mk/own.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/own.mk Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/mk/own.mk Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -# $Id: own.mk,v 1.29 2015/09/08 06:15:31 sjg Exp $ +# $Id: own.mk,v 1.30 2015/11/14 18:09:57 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -89,12 +89,10 @@ OPTIONS_DEFAULT_NO+= DPADD_MK # process options OPTIONS_DEFAULT_NO+= \ - AUTO_OBJ \ INSTALL_AS_USER \ GPROF \ LIBTOOL \ LINT \ - META_MODE \ OPTIONS_DEFAULT_YES+= \ ARCHIVE \ Modified: vendor/NetBSD/bmake/dist/mk/sys.mk ============================================================================== --- vendor/NetBSD/bmake/dist/mk/sys.mk Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/mk/sys.mk Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -# $Id: sys.mk,v 1.36 2014/05/11 00:30:19 sjg Exp $ +# $Id: sys.mk,v 1.41 2015/11/14 20:20:34 sjg Exp $ # # @(#) Copyright (c) 2003-2009, Simon J. Gerraty # @@ -75,8 +75,12 @@ M_L_TARGETS = ${M_ListToMatch:S,V,_TARGE M_ListToSkip= O:u:ts::S,:,:N,g:S,^,N, # type should be a builtin in any sh since about 1980, +# but sadly there are exceptions! +.if ${.MAKE.OS:Unknown:NBSD/OS} == "" +_type_sh = which +.endif # AUTOCONF := ${autoconf:L:${M_whence}} -M_type = @x@(type $$x 2> /dev/null); echo;@:sh:[0]:N* found*:[@]:C,[()],,g +M_type = @x@(${_type_sh:Utype} $$x) 2> /dev/null; echo;@:sh:[0]:N* found*:[@]:C,[()],,g M_whence = ${M_type}:M/*:[1] # convert a path to a valid shell variable @@ -102,6 +106,9 @@ _TARGETS := ${.TARGETS} # we need HOST_TARGET etc below. .include +# early customizations +.-include + # find the OS specifics .if defined(SYS_OS_MK) .include <${SYS_OS_MK}> @@ -126,11 +133,30 @@ SYS_OS_MK := ${_sys_mk} .export SYS_OS_MK .endif -# allow customization without editing. -.-include +# some options we need to know early +OPTIONS_DEFAULT_NO += \ + DIRDEPS_BUILD \ + DIRDEPS_CACHE \ + META_MODE + +OPTIONS_DEFAULT_DEPENDENT += \ + AUTO_OBJ/DIRDEPS_BUILD \ + STAGING/DIRDEPS_BUILD \ + +.-include "options.mk" + +.if ${MK_DIRDEPS_BUILD:Uno} == "yes" +MK_META_MODE = yes +.-include +.elif ${MK_META_MODE:Uno} == "yes" +.MAKE.MODE = meta verbose +.endif +# make sure we have a harmless value +.MAKE.MODE ?= normal # if you want objdirs make them automatic -.if ${MKOBJDIRS:Uno} == "auto" +# and do it early before we compute .PATH +.if ${MK_AUTO_OBJ:Uno} == "yes" || ${MKOBJDIRS:Uno} == "auto" .include .endif @@ -178,17 +204,8 @@ Mkdirs= Mkdirs() { \ .cc.cpp-out: @${COMPILE.cc:N-c} -E ${.IMPSRC} | grep -v '^[ ]*$$' -# we don't include own.mk but user can expect -DWITH_META_MODE to work -.if defined(WITHOUT_META_MODE) -USE_META= no -.elif defined(WITH_META_MODE) -USE_META= yes -.endif -.if ${USE_META:Uno} == "yes" -.-include -.endif -# make sure we have a harmless value -.MAKE.MODE ?= normal +# late customizations +.-include # if .CURDIR is matched by any entry in DEBUG_MAKE_DIRS we # will apply DEBUG_MAKE_FLAGS, now. Modified: vendor/NetBSD/bmake/dist/os.sh ============================================================================== --- vendor/NetBSD/bmake/dist/os.sh Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/os.sh Mon Dec 7 22:51:25 2015 (r291970) @@ -17,7 +17,7 @@ # Simon J. Gerraty # RCSid: -# $Id: os.sh,v 1.47 2015/09/10 05:53:10 sjg Exp $ +# $Id: os.sh,v 1.49 2015/10/25 00:05:40 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -44,7 +44,7 @@ MACHINE_ARCH=`uname -p 2>/dev/null || ec # there is at least one case of `uname -p` outputting # a bunch of usless drivel case "$MACHINE_ARCH" in -*[!A-Za-z0-9_-]*) MACHINE_ARCH="$MACHINE";; +unknown|*[!A-Za-z0-9_-]*) MACHINE_ARCH="$MACHINE";; esac # we need this here, and it is not always available... @@ -213,7 +213,7 @@ LN=${LN:-ln} TR=${TR:-tr} # Some people like have /share/$HOST_TARGET/bin etc. -HOST_TARGET=`echo ${OS}${OSMAJOR}-$HOST_ARCH | toLower` +HOST_TARGET=`echo ${OS}${OSMAJOR}-$HOST_ARCH | tr -d / | toLower` export HOST_TARGET case `echo -n .` in -n*) N=; C="\c";; *) N=-n; C=;; esac Modified: vendor/NetBSD/bmake/dist/parse.c ============================================================================== --- vendor/NetBSD/bmake/dist/parse.c Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/parse.c Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.205 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: parse.c,v 1.206 2015/11/26 00:23:04 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.205 2015/10/11 04:51:24 sjg Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.206 2015/11/26 00:23:04 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.205 2015/10/11 04:51:24 sjg Exp $"); +__RCSID("$NetBSD: parse.c,v 1.206 2015/11/26 00:23:04 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -508,7 +508,11 @@ loadfile(const char *path, int fd) #ifdef HAVE_MMAP if (load_getsize(fd, &lf->len) == SUCCESS) { /* found a size, try mmap */ +#ifdef _SC_PAGESIZE pagesize = sysconf(_SC_PAGESIZE); +#else + pagesize = 0; +#endif if (pagesize <= 0) { pagesize = 0x1000; } @@ -2390,15 +2394,19 @@ static void ParseTrackInput(const char *name) { char *old; + char *ep; char *fp = NULL; size_t name_len = strlen(name); old = Var_Value(MAKE_MAKEFILES, VAR_GLOBAL, &fp); if (old) { + ep = old + strlen(old) - name_len; /* does it contain name? */ for (; old != NULL; old = strchr(old, ' ')) { if (*old == ' ') old++; + if (old >= ep) + break; /* cannot contain name */ if (memcmp(old, name, name_len) == 0 && (old[name_len] == 0 || old[name_len] == ' ')) goto cleanup; Modified: vendor/NetBSD/bmake/dist/unit-tests/Makefile.in ============================================================================== --- vendor/NetBSD/bmake/dist/unit-tests/Makefile.in Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/unit-tests/Makefile.in Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.47 2015/05/05 21:58:06 sjg Exp $ +# $Id: Makefile.in,v 1.48 2015/12/07 04:06:29 sjg Exp $ # # $NetBSD: Makefile,v 1.52 2015/05/05 21:51:09 sjg Exp $ # @@ -128,7 +128,7 @@ SED_CMDS.varshell = -e 's,^[a-z]*sh: ,,' test: ${OUTFILES} .PHONY @failed= ; \ for test in ${TESTNAMES}; do \ - ${TOOL_DIFF} -u ${UNIT_TESTS}/$${test}.exp $${test}.out \ + ${TOOL_DIFF} ${DIFF_FLAGS} ${UNIT_TESTS}/$${test}.exp $${test}.out \ || failed="$${failed}$${failed:+ }$${test}" ; \ done ; \ if [ -n "$${failed}" ]; then \ Modified: vendor/NetBSD/bmake/dist/unit-tests/cond2.mk ============================================================================== --- vendor/NetBSD/bmake/dist/unit-tests/cond2.mk Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/unit-tests/cond2.mk Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -# $Id: cond2.mk,v 1.1.1.1 2015/05/05 21:53:13 sjg Exp $ +# $Id: cond2.mk,v 1.1.1.2 2015/12/02 00:34:27 sjg Exp $ TEST_UNAME_S= NetBSD @@ -21,5 +21,9 @@ Y!= echo TEST_NOT_SET is empty or not de Y= oops .endif +.if defined(.NDEF) && ${.NDEF} > 0 +Z= yes +.endif + all: @echo $@ Modified: vendor/NetBSD/bmake/dist/unit-tests/doterror.exp ============================================================================== --- vendor/NetBSD/bmake/dist/unit-tests/doterror.exp Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/unit-tests/doterror.exp Mon Dec 7 22:51:25 2015 (r291970) @@ -1,9 +1,9 @@ At first, I am happy and now: sad -.ERROR: Looks like 'sad' is upset. *** Error code 1 Stop. make: stopped in unit-tests +.ERROR: Looks like 'sad' is upset. exit status 1 Modified: vendor/NetBSD/bmake/dist/unit-tests/modts.mk ============================================================================== --- vendor/NetBSD/bmake/dist/unit-tests/modts.mk Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/unit-tests/modts.mk Mon Dec 7 22:51:25 2015 (r291970) @@ -12,9 +12,9 @@ all: mod-ts # Use print or printf iff they are builtin. # XXX note that this causes problems, when make decides # there is no need to use a shell, so avoid where possible. -.if ${type print 2> /dev/null || echo:L:sh:Mbuiltin} != "" +.if ${(type print) 2> /dev/null || echo:L:sh:Mbuiltin} != "" PRINT= print -r -- -.elif ${type printf 2> /dev/null || echo:L:sh:Mbuiltin} != "" +.elif ${(type printf) 2> /dev/null || echo:L:sh:Mbuiltin} != "" PRINT= printf '%s\n' .else PRINT= echo Modified: vendor/NetBSD/bmake/dist/var.c ============================================================================== --- vendor/NetBSD/bmake/dist/var.c Mon Dec 7 22:13:07 2015 (r291969) +++ vendor/NetBSD/bmake/dist/var.c Mon Dec 7 22:51:25 2015 (r291970) @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.199 2015/10/20 21:30:57 sjg Exp $ */ +/* $NetBSD: var.c,v 1.200 2015/12/01 07:26:08 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.199 2015/10/20 21:30:57 sjg Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.200 2015/12/01 07:26:08 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.199 2015/10/20 21:30:57 sjg Exp $"); +__RCSID("$NetBSD: var.c,v 1.200 2015/12/01 07:26:08 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -129,7 +129,6 @@ __RCSID("$NetBSD: var.c,v 1.199 2015/10/ #include #endif #include -#include #include #include #include @@ -702,13 +701,15 @@ Var_ExportVars(void) int i; val = Var_Subst(NULL, tmp, VAR_GLOBAL, FALSE, TRUE); - av = brk_string(val, &ac, FALSE, &as); - for (i = 0; i < ac; i++) { - Var_Export1(av[i], 0); + if (*val) { + av = brk_string(val, &ac, FALSE, &as); + for (i = 0; i < ac; i++) { + Var_Export1(av[i], 0); + } + free(as); + free(av); } free(val); - free(as); - free(av); } } @@ -740,35 +741,37 @@ Var_Export(char *str, int isExport) track = VAR_EXPORT_PARENT; } val = Var_Subst(NULL, str, VAR_GLOBAL, FALSE, TRUE); - av = brk_string(val, &ac, FALSE, &as); - for (i = 0; i < ac; i++) { - name = av[i]; - if (!name[1]) { - /* - * A single char. - * If it is one of the vars that should only appear in - * local context, skip it, else we can get Var_Subst - * into a loop. - */ - switch (name[0]) { - case '@': - case '%': - case '*': - case '!': - continue; + if (*val) { + av = brk_string(val, &ac, FALSE, &as); + for (i = 0; i < ac; i++) { + name = av[i]; + if (!name[1]) { + /* + * A single char. + * If it is one of the vars that should only appear in + * local context, skip it, else we can get Var_Subst + * into a loop. + */ + switch (name[0]) { + case '@': + case '%': + case '*': + case '!': + continue; + } } - } - if (Var_Export1(name, track)) { - if (VAR_EXPORTED_ALL != var_exportedVars) - var_exportedVars = VAR_EXPORTED_YES; - if (isExport && track) { - Var_Append(MAKE_EXPORTED, name, VAR_GLOBAL); + if (Var_Export1(name, track)) { + if (VAR_EXPORTED_ALL != var_exportedVars) + var_exportedVars = VAR_EXPORTED_YES; + if (isExport && track) { + Var_Append(MAKE_EXPORTED, name, VAR_GLOBAL); + } } } + free(as); + free(av); } free(val); - free(as); - free(av); } @@ -2305,7 +2308,7 @@ VarHash(char *str) Buffer buf; size_t len, len2; unsigned char *ustr = (unsigned char *)str; - uint32_t h, k, c1, c2; + unsigned int h, k, c1, c2; h = 0x971e137bU; c1 = 0x95543787U; From owner-svn-src-all@freebsd.org Mon Dec 7 22:51:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A88D79C1AD1; Mon, 7 Dec 2015 22:51:53 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5C8101814; Mon, 7 Dec 2015 22:51:53 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7MpqSQ017380; Mon, 7 Dec 2015 22:51:52 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7Mpq1L017379; Mon, 7 Dec 2015 22:51:52 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201512072251.tB7Mpq1L017379@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Mon, 7 Dec 2015 22:51:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r291971 - vendor/NetBSD/bmake/20151201 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 22:51:53 -0000 Author: sjg Date: Mon Dec 7 22:51:52 2015 New Revision: 291971 URL: https://svnweb.freebsd.org/changeset/base/291971 Log: Tag bmake/20151201 Added: vendor/NetBSD/bmake/20151201/ - copied from r291970, vendor/NetBSD/bmake/dist/ From owner-svn-src-all@freebsd.org Mon Dec 7 23:53:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 768239D3478; Mon, 7 Dec 2015 23:53:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4EB821C8D; Mon, 7 Dec 2015 23:53:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB7Nr3AZ035206; Mon, 7 Dec 2015 23:53:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB7Nr2IU035191; Mon, 7 Dec 2015 23:53:02 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512072353.tB7Nr2IU035191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 7 Dec 2015 23:53:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291972 - in head: kerberos5/lib/libgssapi_krb5 kerberos5/lib/libgssapi_ntlm kerberos5/lib/libhdb kerberos5/lib/libheimntlm kerberos5/lib/libkadm5clnt kerberos5/lib/libkadm5srv kerberos... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Dec 2015 23:53:04 -0000 Author: bdrewery Date: Mon Dec 7 23:53:01 2015 New Revision: 291972 URL: https://svnweb.freebsd.org/changeset/base/291972 Log: DIRDEPS_BUILD: Update dependencies. Sponsored by: EMC / Isilon Storage Division Modified: head/kerberos5/lib/libgssapi_krb5/Makefile.depend head/kerberos5/lib/libgssapi_ntlm/Makefile.depend head/kerberos5/lib/libhdb/Makefile.depend head/kerberos5/lib/libheimntlm/Makefile.depend head/kerberos5/lib/libkadm5clnt/Makefile.depend head/kerberos5/lib/libkadm5srv/Makefile.depend head/kerberos5/lib/libkafs5/Makefile.depend head/kerberos5/lib/libkdc/Makefile.depend head/lib/lib80211/Makefile.depend head/lib/libpam/modules/pam_krb5/Makefile.depend head/lib/libpam/modules/pam_ksu/Makefile.depend head/sys/boot/userboot/test/Makefile.depend head/usr.bin/clang/lldb/Makefile.depend head/usr.sbin/ofwdump/Makefile.depend Modified: head/kerberos5/lib/libgssapi_krb5/Makefile.depend ============================================================================== --- head/kerberos5/lib/libgssapi_krb5/Makefile.depend Mon Dec 7 22:51:52 2015 (r291971) +++ head/kerberos5/lib/libgssapi_krb5/Makefile.depend Mon Dec 7 23:53:01 2015 (r291972) @@ -18,7 +18,6 @@ DIRDEPS = \ lib/libcom_err \ lib/libcompiler_rt \ lib/libgssapi \ - lib/libthr \ secure/lib/libcrypto \ Modified: head/kerberos5/lib/libgssapi_ntlm/Makefile.depend ============================================================================== --- head/kerberos5/lib/libgssapi_ntlm/Makefile.depend Mon Dec 7 22:51:52 2015 (r291971) +++ head/kerberos5/lib/libgssapi_ntlm/Makefile.depend Mon Dec 7 23:53:01 2015 (r291972) @@ -15,7 +15,6 @@ DIRDEPS = \ lib/libc \ lib/libcompiler_rt \ lib/libgssapi \ - lib/libthr \ secure/lib/libcrypto \ Modified: head/kerberos5/lib/libhdb/Makefile.depend ============================================================================== --- head/kerberos5/lib/libhdb/Makefile.depend Mon Dec 7 22:51:52 2015 (r291971) +++ head/kerberos5/lib/libhdb/Makefile.depend Mon Dec 7 23:53:01 2015 (r291972) @@ -18,7 +18,6 @@ DIRDEPS = \ lib/libcom_err \ lib/libcompiler_rt \ lib/libsqlite3 \ - lib/libthr \ secure/lib/libcrypto \ Modified: head/kerberos5/lib/libheimntlm/Makefile.depend ============================================================================== --- head/kerberos5/lib/libheimntlm/Makefile.depend Mon Dec 7 22:51:52 2015 (r291971) +++ head/kerberos5/lib/libheimntlm/Makefile.depend Mon Dec 7 23:53:01 2015 (r291972) @@ -14,7 +14,6 @@ DIRDEPS = \ lib/libc \ lib/libcom_err \ lib/libcompiler_rt \ - lib/libthr \ secure/lib/libcrypto \ Modified: head/kerberos5/lib/libkadm5clnt/Makefile.depend ============================================================================== --- head/kerberos5/lib/libkadm5clnt/Makefile.depend Mon Dec 7 22:51:52 2015 (r291971) +++ head/kerberos5/lib/libkadm5clnt/Makefile.depend Mon Dec 7 23:53:01 2015 (r291972) @@ -15,7 +15,6 @@ DIRDEPS = \ lib/libc \ lib/libcom_err \ lib/libcompiler_rt \ - lib/libthr \ .include Modified: head/kerberos5/lib/libkadm5srv/Makefile.depend ============================================================================== --- head/kerberos5/lib/libkadm5srv/Makefile.depend Mon Dec 7 22:51:52 2015 (r291971) +++ head/kerberos5/lib/libkadm5srv/Makefile.depend Mon Dec 7 23:53:01 2015 (r291972) @@ -15,7 +15,6 @@ DIRDEPS = \ lib/libc \ lib/libcom_err \ lib/libcompiler_rt \ - lib/libthr \ .include Modified: head/kerberos5/lib/libkafs5/Makefile.depend ============================================================================== --- head/kerberos5/lib/libkafs5/Makefile.depend Mon Dec 7 22:51:52 2015 (r291971) +++ head/kerberos5/lib/libkafs5/Makefile.depend Mon Dec 7 23:53:01 2015 (r291972) @@ -13,7 +13,6 @@ DIRDEPS = \ lib/${CSU_DIR} \ lib/libc \ lib/libcompiler_rt \ - lib/libthr \ secure/lib/libcrypto \ Modified: head/kerberos5/lib/libkdc/Makefile.depend ============================================================================== --- head/kerberos5/lib/libkdc/Makefile.depend Mon Dec 7 22:51:52 2015 (r291971) +++ head/kerberos5/lib/libkdc/Makefile.depend Mon Dec 7 23:53:01 2015 (r291972) @@ -19,7 +19,6 @@ DIRDEPS = \ lib/libc \ lib/libcom_err \ lib/libcompiler_rt \ - lib/libthr \ lib/libutil \ secure/lib/libcrypto \ Modified: head/lib/lib80211/Makefile.depend ============================================================================== --- head/lib/lib80211/Makefile.depend Mon Dec 7 22:51:52 2015 (r291971) +++ head/lib/lib80211/Makefile.depend Mon Dec 7 23:53:01 2015 (r291972) @@ -10,6 +10,7 @@ DIRDEPS = \ lib/libc \ lib/libcompiler_rt \ lib/libexpat \ + lib/libsbuf \ .include Modified: head/lib/libpam/modules/pam_krb5/Makefile.depend ============================================================================== --- head/lib/libpam/modules/pam_krb5/Makefile.depend Mon Dec 7 22:51:52 2015 (r291971) +++ head/lib/libpam/modules/pam_krb5/Makefile.depend Mon Dec 7 23:53:01 2015 (r291972) @@ -13,7 +13,6 @@ DIRDEPS = \ lib/libcom_err \ lib/libcompiler_rt \ lib/libpam/libpam \ - lib/libthr \ .include Modified: head/lib/libpam/modules/pam_ksu/Makefile.depend ============================================================================== --- head/lib/libpam/modules/pam_ksu/Makefile.depend Mon Dec 7 22:51:52 2015 (r291971) +++ head/lib/libpam/modules/pam_ksu/Makefile.depend Mon Dec 7 23:53:01 2015 (r291972) @@ -12,7 +12,6 @@ DIRDEPS = \ lib/libc \ lib/libcompiler_rt \ lib/libpam/libpam \ - lib/libthr \ .include Modified: head/sys/boot/userboot/test/Makefile.depend ============================================================================== --- head/sys/boot/userboot/test/Makefile.depend Mon Dec 7 22:51:52 2015 (r291971) +++ head/sys/boot/userboot/test/Makefile.depend Mon Dec 7 23:53:01 2015 (r291972) @@ -8,6 +8,7 @@ DIRDEPS = \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ + lib/libc_nonshared \ lib/libcompiler_rt \ Modified: head/usr.bin/clang/lldb/Makefile.depend ============================================================================== --- head/usr.bin/clang/lldb/Makefile.depend Mon Dec 7 22:51:52 2015 (r291971) +++ head/usr.bin/clang/lldb/Makefile.depend Mon Dec 7 23:53:01 2015 (r291972) @@ -143,6 +143,7 @@ DIRDEPS = \ lib/libthr \ lib/libz \ lib/msun \ + lib/ncurses/ncurses \ lib/ncurses/ncursesw \ lib/ncurses/panel \ Modified: head/usr.sbin/ofwdump/Makefile.depend ============================================================================== --- head/usr.sbin/ofwdump/Makefile.depend Mon Dec 7 22:51:52 2015 (r291971) +++ head/usr.sbin/ofwdump/Makefile.depend Mon Dec 7 23:53:01 2015 (r291972) @@ -2,11 +2,14 @@ # Autogenerated - do NOT edit! DIRDEPS = \ + gnu/lib/csu \ gnu/lib/libgcc \ include \ include/xlocale \ lib/${CSU_DIR} \ lib/libc \ + lib/libc_nonshared \ + lib/libcompiler_rt \ .include From owner-svn-src-all@freebsd.org Tue Dec 8 00:22:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FE9D9B7D6A; Tue, 8 Dec 2015 00:22:26 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 175021AA0; Tue, 8 Dec 2015 00:22:25 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB80MOeR043728; Tue, 8 Dec 2015 00:22:24 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB80MO8S043727; Tue, 8 Dec 2015 00:22:24 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512080022.tB80MO8S043727@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 8 Dec 2015 00:22:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291973 - head/targets/pseudo/universe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 00:22:26 -0000 Author: bdrewery Date: Tue Dec 8 00:22:24 2015 New Revision: 291973 URL: https://svnweb.freebsd.org/changeset/base/291973 Log: local.meta.sys.mk already defines TARGET_ARCHES_arm Modified: head/targets/pseudo/universe/Makefile Modified: head/targets/pseudo/universe/Makefile ============================================================================== --- head/targets/pseudo/universe/Makefile Mon Dec 7 23:53:01 2015 (r291972) +++ head/targets/pseudo/universe/Makefile Tue Dec 8 00:22:24 2015 (r291973) @@ -36,8 +36,6 @@ UNIVERSE_TARGET_RELDIR?= targets/pseudo/ # the list of machines TARGET_MACHINE_LIST = i386 amd64 -# some machines have more than one arch -TARGET_ARCHES_arm?= arm armeb armv6 armv6hf # avoid ../Makefile.inc defining this all: From owner-svn-src-all@freebsd.org Tue Dec 8 00:24:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EA2F9B908D; Tue, 8 Dec 2015 00:24:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0DF31C9B; Tue, 8 Dec 2015 00:24:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB80Ofir043838; Tue, 8 Dec 2015 00:24:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB80OfB4043837; Tue, 8 Dec 2015 00:24:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512080024.tB80OfB4043837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 8 Dec 2015 00:24:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291974 - stable/10/gnu/usr.bin/binutils/ld X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 00:24:43 -0000 Author: bdrewery Date: Tue Dec 8 00:24:41 2015 New Revision: 291974 URL: https://svnweb.freebsd.org/changeset/base/291974 Log: MFC r291226: Fix ld not respecting --sysroot. Relnotes: yes Modified: stable/10/gnu/usr.bin/binutils/ld/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/gnu/usr.bin/binutils/ld/Makefile ============================================================================== --- stable/10/gnu/usr.bin/binutils/ld/Makefile Tue Dec 8 00:22:24 2015 (r291973) +++ stable/10/gnu/usr.bin/binutils/ld/Makefile Tue Dec 8 00:24:41 2015 (r291974) @@ -54,7 +54,7 @@ FILES= ${LDSCRIPTS:S|^|ldscripts/|} FILESDIR= ${SCRIPTDIR} HOST= ${TARGET_TUPLE} -LIBSEARCHPATH= \"${TOOLS_PREFIX}/lib\":\"${TOOLS_PREFIX}/usr/lib\" +LIBSEARCHPATH= \"=/lib\":\"=/usr/lib\" .for ext in ${ELF_SCR_EXT} LDSCRIPTS+= ${NATIVE_EMULATION}.${ext} ldscripts/${NATIVE_EMULATION}.${ext}: e${NATIVE_EMULATION}.c From owner-svn-src-all@freebsd.org Tue Dec 8 00:25:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80BA09B912E; Tue, 8 Dec 2015 00:25:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50E9C1E35; Tue, 8 Dec 2015 00:25:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB80P0E4043898; Tue, 8 Dec 2015 00:25:00 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB80P0kg043897; Tue, 8 Dec 2015 00:25:00 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512080025.tB80P0kg043897@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 8 Dec 2015 00: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: r291975 - stable/9/gnu/usr.bin/binutils/ld X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 00:25:01 -0000 Author: bdrewery Date: Tue Dec 8 00:25:00 2015 New Revision: 291975 URL: https://svnweb.freebsd.org/changeset/base/291975 Log: MFC r291226: Fix ld not respecting --sysroot. Relnotes: yes Modified: stable/9/gnu/usr.bin/binutils/ld/Makefile Directory Properties: stable/9/gnu/usr.bin/binutils/ (props changed) Modified: stable/9/gnu/usr.bin/binutils/ld/Makefile ============================================================================== --- stable/9/gnu/usr.bin/binutils/ld/Makefile Tue Dec 8 00:24:41 2015 (r291974) +++ stable/9/gnu/usr.bin/binutils/ld/Makefile Tue Dec 8 00:25:00 2015 (r291975) @@ -49,7 +49,7 @@ FILES= ${LDSCRIPTS:S|^|ldscripts/|} FILESDIR= ${SCRIPTDIR} HOST= ${TARGET_TUPLE} -LIBSEARCHPATH= \"${TOOLS_PREFIX}/lib\":\"${TOOLS_PREFIX}/usr/lib\" +LIBSEARCHPATH= \"=/lib\":\"=/usr/lib\" .for ext in ${ELF_SCR_EXT} LDSCRIPTS+= ${NATIVE_EMULATION}.${ext} ldscripts/${NATIVE_EMULATION}.${ext}: e${NATIVE_EMULATION}.c From owner-svn-src-all@freebsd.org Tue Dec 8 00:27:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6CD99B943D; Tue, 8 Dec 2015 00:27:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 82C5A1081; Tue, 8 Dec 2015 00:27:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB80RZxD044017; Tue, 8 Dec 2015 00:27:35 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB80RZ8M044014; Tue, 8 Dec 2015 00:27:35 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512080027.tB80RZ8M044014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 8 Dec 2015 00:27:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291976 - stable/10 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 00:27:36 -0000 Author: bdrewery Date: Tue Dec 8 00:27:35 2015 New Revision: 291976 URL: https://svnweb.freebsd.org/changeset/base/291976 Log: MFC r291605: Fix errors being ignored in many phases of the build since the bmake integration. Modified: stable/10/Makefile stable/10/Makefile.inc1 stable/10/UPDATING Directory Properties: stable/10/ (props changed) Modified: stable/10/Makefile ============================================================================== --- stable/10/Makefile Tue Dec 8 00:25:00 2015 (r291975) +++ stable/10/Makefile Tue Dec 8 00:27:35 2015 (r291976) @@ -366,21 +366,21 @@ make bmake: .PHONY @echo ">>> Building an up-to-date make(1)" @echo "--------------------------------------------------------------" ${_+_}@cd ${.CURDIR}/usr.bin/${.TARGET}; \ - ${MMAKE} obj && \ - ${MMAKE} depend && \ - ${MMAKE} all && \ + ${MMAKE} obj; \ + ${MMAKE} depend; \ + ${MMAKE} all; \ ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= tinderbox toolchains kernel-toolchains: upgrade_checks tinderbox: - @cd ${.CURDIR} && ${SUB_MAKE} DOING_TINDERBOX=YES universe + @cd ${.CURDIR}; ${SUB_MAKE} DOING_TINDERBOX=YES universe toolchains: - @cd ${.CURDIR} && ${SUB_MAKE} UNIVERSE_TARGET=toolchain universe + @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=toolchain universe kernel-toolchains: - @cd ${.CURDIR} && ${SUB_MAKE} UNIVERSE_TARGET=kernel-toolchain universe + @cd ${.CURDIR}; ${SUB_MAKE} UNIVERSE_TARGET=kernel-toolchain universe # # universe @@ -467,7 +467,7 @@ universe_${target}_kernels: universe_${t (echo "${target} 'make LINT' failed," \ "check _.${target}.makeLINT for details"| ${MAKEFAIL})) .endif - @cd ${.CURDIR} && ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ + @cd ${.CURDIR}; ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ universe_kernels .endif @echo ">> ${target} completed on `LC_ALL=C date`" Modified: stable/10/Makefile.inc1 ============================================================================== --- stable/10/Makefile.inc1 Tue Dec 8 00:25:00 2015 (r291975) +++ stable/10/Makefile.inc1 Tue Dec 8 00:27:35 2015 (r291976) @@ -1167,7 +1167,7 @@ doxygen: .PHONY echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \ exit 1; \ fi - ${_+_}cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all + ${_+_}cd ${.CURDIR}/tools/kerneldoc/subsys; ${MAKE} obj all # # update @@ -1187,7 +1187,7 @@ update: @echo "--------------------------------------------------------------" @echo ">>> Updating ${.CURDIR} using Subversion" @echo "--------------------------------------------------------------" - @(cd ${.CURDIR} && ${SVN} update ${SVNFLAGS}) + @(cd ${.CURDIR}; ${SVN} update ${SVNFLAGS}) .endif # @@ -1211,11 +1211,11 @@ legacy: .endif .for _tool in tools/build ${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \ - cd ${.CURDIR}/${_tool} && \ - ${MAKE} DIRPRFX=${_tool}/ obj && \ - ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes && \ - ${MAKE} DIRPRFX=${_tool}/ depend && \ - ${MAKE} DIRPRFX=${_tool}/ all && \ + cd ${.CURDIR}/${_tool}; \ + ${MAKE} DIRPRFX=${_tool}/ obj; \ + ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes; \ + ${MAKE} DIRPRFX=${_tool}/ depend; \ + ${MAKE} DIRPRFX=${_tool}/ all; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install .endfor @@ -1379,10 +1379,10 @@ bootstrap-tools: .PHONY ${_vtfontcvt} ${_bt}-${_tool}: .PHONY .MAKE ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_tool} && \ - ${MAKE} DIRPRFX=${_tool}/ obj && \ - ${MAKE} DIRPRFX=${_tool}/ depend && \ - ${MAKE} DIRPRFX=${_tool}/ all && \ + cd ${.CURDIR}/${_tool}; \ + ${MAKE} DIRPRFX=${_tool}/ obj; \ + ${MAKE} DIRPRFX=${_tool}/ depend; \ + ${MAKE} DIRPRFX=${_tool}/ all; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install bootstrap-tools: ${_bt}-${_tool} @@ -1418,16 +1418,16 @@ build-tools: .MAKE usr.bin/mkcsmapper_static \ usr.bin/vi/catalog ${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \ - cd ${.CURDIR}/${_tool} && \ - ${MAKE} DIRPRFX=${_tool}/ obj && \ + cd ${.CURDIR}/${_tool}; \ + ${MAKE} DIRPRFX=${_tool}/ obj; \ ${MAKE} DIRPRFX=${_tool}/ build-tools .endfor .for _tool in \ ${_gcc_tools} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \ - cd ${.CURDIR}/${_tool} && \ - ${MAKE} DIRPRFX=${_tool}/ obj && \ - ${MAKE} DIRPRFX=${_tool}/ depend && \ + cd ${.CURDIR}/${_tool}; \ + ${MAKE} DIRPRFX=${_tool}/ obj; \ + ${MAKE} DIRPRFX=${_tool}/ depend; \ ${MAKE} DIRPRFX=${_tool}/ all .endfor @@ -1491,10 +1491,10 @@ cross-tools: .MAKE .PHONY ${_crunchide} \ ${_kgzip} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_tool} && \ - ${MAKE} DIRPRFX=${_tool}/ obj && \ - ${MAKE} DIRPRFX=${_tool}/ depend && \ - ${MAKE} DIRPRFX=${_tool}/ all && \ + cd ${.CURDIR}/${_tool}; \ + ${MAKE} DIRPRFX=${_tool}/ obj; \ + ${MAKE} DIRPRFX=${_tool}/ depend; \ + ${MAKE} DIRPRFX=${_tool}/ all; \ ${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install .endfor @@ -1579,10 +1579,10 @@ native-xtools: .PHONY usr.bin/yacc \ usr.sbin/chown ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_tool} && \ - ${NXBMAKE} DIRPRFX=${_tool}/ obj && \ - ${NXBMAKE} DIRPRFX=${_tool}/ depend && \ - ${NXBMAKE} DIRPRFX=${_tool}/ all && \ + cd ${.CURDIR}/${_tool}; \ + ${NXBMAKE} DIRPRFX=${_tool}/ obj; \ + ${NXBMAKE} DIRPRFX=${_tool}/ depend; \ + ${NXBMAKE} DIRPRFX=${_tool}/ all; \ ${NXBMAKE} DIRPRFX=${_tool}/ DESTDIR=${OBJTREE}/nxb-bin install .endfor @@ -1590,7 +1590,7 @@ native-xtools: .PHONY # hierarchy - ensure that all the needed directories are present # hierarchy hier: .MAKE .PHONY - ${_+_}cd ${.CURDIR}/etc && ${HMAKE} distrib-dirs + ${_+_}cd ${.CURDIR}/etc; ${HMAKE} distrib-dirs # # libraries - build all libraries, and install them under ${DESTDIR}. @@ -1600,10 +1600,10 @@ hierarchy hier: .MAKE .PHONY # ${.CURDIR}/tools/make_libdeps.sh script. # libraries: .MAKE .PHONY - ${_+_}cd ${.CURDIR} && \ - ${MAKE} -f Makefile.inc1 _prereq_libs && \ - ${MAKE} -f Makefile.inc1 _startup_libs && \ - ${MAKE} -f Makefile.inc1 _prebuild_libs && \ + ${_+_}cd ${.CURDIR}; \ + ${MAKE} -f Makefile.inc1 _prereq_libs; \ + ${MAKE} -f Makefile.inc1 _startup_libs; \ + ${MAKE} -f Makefile.inc1 _prebuild_libs; \ ${MAKE} -f Makefile.inc1 _generic_libs # @@ -1805,11 +1805,11 @@ gnu/lib/libdialog__L: lib/msun__L lib/nc ${_lib}__PL: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_lib} && \ - ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ obj && \ - ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ depend && \ + cd ${.CURDIR}/${_lib}; \ + ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ obj; \ + ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ depend; \ ${MAKE} -DNO_TESTS -DNO_PROFILE -DNO_PIC \ - DIRPRFX=${_lib}/ all && \ + DIRPRFX=${_lib}/ all; \ ${MAKE} -DNO_TESTS -DNO_PROFILE -DNO_PIC \ DIRPRFX=${_lib}/ install .endif @@ -1819,10 +1819,10 @@ ${_lib}__PL: .PHONY .MAKE ${_lib}__L: .PHONY .MAKE .if exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_lib} && \ - ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ obj && \ - ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ depend && \ - ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ all && \ + cd ${.CURDIR}/${_lib}; \ + ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ obj; \ + ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ depend; \ + ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ all; \ ${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ install .endif .endfor @@ -1832,11 +1832,11 @@ ${_lib}__L: .PHONY .MAKE # modules. lib/libpam__L: .PHONY .MAKE ${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \ - cd ${.CURDIR}/lib/libpam && \ - ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ obj && \ - ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ depend && \ + cd ${.CURDIR}/lib/libpam; \ + ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ obj; \ + ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ depend; \ ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ \ - -D_NO_LIBPAM_SO_YET all && \ + -D_NO_LIBPAM_SO_YET all; \ ${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ \ -D_NO_LIBPAM_SO_YET install @@ -2108,10 +2108,10 @@ _xb-bootstrap-tools: .PHONY .for _tool in \ ${_clang_tblgen} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ - cd ${.CURDIR}/${_tool} && \ - ${CDMAKE} DIRPRFX=${_tool}/ obj && \ - ${CDMAKE} DIRPRFX=${_tool}/ depend && \ - ${CDMAKE} DIRPRFX=${_tool}/ all && \ + cd ${.CURDIR}/${_tool}; \ + ${CDMAKE} DIRPRFX=${_tool}/ obj; \ + ${CDMAKE} DIRPRFX=${_tool}/ depend; \ + ${CDMAKE} DIRPRFX=${_tool}/ all; \ ${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install .endfor @@ -2127,9 +2127,9 @@ _xb-cross-tools: .PHONY ${_clang} \ ${_cc} ${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \ - cd ${.CURDIR}/${_tool} && \ - ${CDMAKE} DIRPRFX=${_tool}/ obj && \ - ${CDMAKE} DIRPRFX=${_tool}/ depend && \ + cd ${.CURDIR}/${_tool}; \ + ${CDMAKE} DIRPRFX=${_tool}/ obj; \ + ${CDMAKE} DIRPRFX=${_tool}/ depend; \ ${CDMAKE} DIRPRFX=${_tool}/ all .endfor Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Tue Dec 8 00:25:00 2015 (r291975) +++ stable/10/UPDATING Tue Dec 8 00:27:35 2015 (r291976) @@ -400,14 +400,6 @@ older version of current is a bit fragil keep 64-bits counters. Thus all tools, that work with networking statistics, must be rebuilt (netstat(1), bsnmpd(1), etc.) -20130629: - Fix targets that run multiple make's to use && rather than ; - so that subsequent steps depend on success of previous. - - NOTE: if building 'universe' with -j* on stable/8 or stable/9 - it would be better to start the build using bmake, to avoid - overloading the machine. - 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 From owner-svn-src-all@freebsd.org Tue Dec 8 01:09:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 377EC9D392C; Tue, 8 Dec 2015 01:09:45 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-qk0-f179.google.com (mail-qk0-f179.google.com [209.85.220.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F36351825; Tue, 8 Dec 2015 01:09:44 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by qkdb5 with SMTP id b5so7916948qkd.0; Mon, 07 Dec 2015 17:09:43 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=Ad/PG6Dca9/x0B+smzRumh6CjYwFzcDkrBOszYhPg3s=; b=SWSFJsXPDMXA9RIvODIuyR4BiHX+txaoD773Wm5+hC+GwkfFpG9SwNQlpVf2ldxmXY /VKsz4UVDNDtklAW27bIxwJZkXwqNxlKLBt95OsEuTrGb/LfXELCTFzGHZd31buvNK1G 1mb7L0/E4majFgNrYMeGiPY3nyv/T2nd1TMDnwgtXInn/vhODrZaUuAYBT7AyUIJDK3u cOwqTLPLr8RUImwvMi9FZ1NdEeu4/HmQZKL/E/NKdRGMfK/PAFG9G9agOgvGBMO5wqYp mjXNPgsiI92BpormWEFwHjnajWOZfH6dPj/++hN/nJe578xU3NJzR5rkzMIts+hVaZAn t+Og== X-Received: by 10.55.75.216 with SMTP id y207mr768692qka.19.1449533753140; Mon, 07 Dec 2015 16:15:53 -0800 (PST) Received: from mail-qk0-f181.google.com (mail-qk0-f181.google.com. [209.85.220.181]) by smtp.gmail.com with ESMTPSA id v83sm299581qhc.14.2015.12.07.16.15.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Dec 2015 16:15:53 -0800 (PST) Received: by qkdp187 with SMTP id p187so6257373qkd.1; Mon, 07 Dec 2015 16:15:52 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.13.212.17 with SMTP id w17mr340602ywd.237.1449533752694; Mon, 07 Dec 2015 16:15:52 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.17.2 with HTTP; Mon, 7 Dec 2015 16:15:52 -0800 (PST) In-Reply-To: References: <201512061746.tB6HkCWb072736@repo.freebsd.org> Date: Mon, 7 Dec 2015 16:15:52 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r291907 - head/sys/vm From: Conrad Meyer To: Oliver Pinter Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 01:09:45 -0000 On Mon, Dec 7, 2015 at 11:32 AM, Oliver Pinter wrote: > On 12/6/15, Conrad E. Meyer wrote: >> Author: cem >> Date: Sun Dec 6 17:46:12 2015 >> New Revision: 291907 >> URL: https://svnweb.freebsd.org/changeset/base/291907 >> >> Log: >> vm_fault_hold: handle vm_page_rename failure > > Hi Conrad! > > You have any plan to MFC this commit? No. From owner-svn-src-all@freebsd.org Tue Dec 8 01:16:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 529EF9D303B; Tue, 8 Dec 2015 01:16:55 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FEE01F4B; Tue, 8 Dec 2015 01:16:55 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB81GsoB058634; Tue, 8 Dec 2015 01:16:54 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB81GsrU058633; Tue, 8 Dec 2015 01:16:54 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201512080116.tB81GsrU058633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Tue, 8 Dec 2015 01:16:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291977 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 01:16:55 -0000 Author: maxim Date: Tue Dec 8 01:16:53 2015 New Revision: 291977 URL: https://svnweb.freebsd.org/changeset/base/291977 Log: o DragonFly 4.4.1 release added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Tue Dec 8 00:27:35 2015 (r291976) +++ head/share/misc/bsd-family-tree Tue Dec 8 01:16:53 2015 (r291977) @@ -335,6 +335,7 @@ FreeBSD 5.2 | | | 10.2 | | | | | OS X NetBSD 7.0 | | | 10.11 | OpenBSD 5.8 | + | | | | DragonFly 4.4.1 | | | | | FreeBSD 11 -current | NetBSD -current OpenBSD -current DragonFly -current | | | | | @@ -681,6 +682,7 @@ FreeBSD 10.2 2015-08-13 [FBD] NetBSD 7.0 2015-09-25 [NBD] OS X 10.11 2015-09-30 [APL] OpenBSD 5.8 2015-10-18 [OBD] +DragonFly 4.4.1 2015-12-07 [DFB] Bibliography ------------------------ From owner-svn-src-all@freebsd.org Tue Dec 8 01:29:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75F209D39C2; Tue, 8 Dec 2015 01:29:11 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4071918A4; Tue, 8 Dec 2015 01:29:11 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB81TAn8061634; Tue, 8 Dec 2015 01:29:10 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB81T70a061602; Tue, 8 Dec 2015 01:29:07 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201512080129.tB81T70a061602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Tue, 8 Dec 2015 01:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291978 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 01:29:11 -0000 Author: sjg Date: Tue Dec 8 01:29:07 2015 New Revision: 291978 URL: https://svnweb.freebsd.org/changeset/base/291978 Log: Merge bmake-20151201 Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/Makefile head/contrib/bmake/boot-strap head/contrib/bmake/cond.c head/contrib/bmake/config.h.in head/contrib/bmake/configure head/contrib/bmake/configure.in head/contrib/bmake/main.c head/contrib/bmake/meta.c head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/host-target.mk head/contrib/bmake/mk/init.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/mk/lib.mk head/contrib/bmake/mk/meta.autodep.mk head/contrib/bmake/mk/meta.stage.mk head/contrib/bmake/mk/meta.subdir.mk head/contrib/bmake/mk/meta.sys.mk head/contrib/bmake/mk/own.mk head/contrib/bmake/mk/sys.mk head/contrib/bmake/os.sh head/contrib/bmake/parse.c head/contrib/bmake/unit-tests/Makefile.in head/contrib/bmake/unit-tests/cond2.mk head/contrib/bmake/unit-tests/doterror.exp head/contrib/bmake/unit-tests/modts.mk head/contrib/bmake/var.c head/usr.bin/bmake/Makefile head/usr.bin/bmake/config.h head/usr.bin/bmake/unit-tests/Makefile Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/ChangeLog Tue Dec 8 01:29:07 2015 (r291978) @@ -1,3 +1,35 @@ +2015-12-01 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151201 + Merge with NetBSD make, pick up + o cond.c: CondCvtArg: avoid access beyond end of empty buffer. + o meta.c: meta_oodate: use lstat(2) for checking link target + in case it is a symlink. + o var.c: avoid calling brk_string and Var_Export1 with empty + strings. + +2015-11-26 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151126 + Merge with NetBSD make, pick up + o parse.c: ParseTrackInput don't access beyond + end of old value. + +2015-10-22 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151022 + + * Add support for BSD/OS which lacks inttypes.h + and really needs sys/param.h for sys/sysctl.h + also 'type' is not a shell builtin. + + * var.c: eliminate uint32_t and need for inttypes.h + + * main.c: PrintOnError flush stdout before run .ERROR + + * parse.c: cope with _SC_PAGESIZE not being defined. + + 2015-10-20 Simon J. Gerraty * Makefile (MAKE_VERSION): 20151020 Modified: head/contrib/bmake/Makefile ============================================================================== --- head/contrib/bmake/Makefile Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/Makefile Tue Dec 8 01:29:07 2015 (r291978) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.44 2015/10/20 21:41:40 sjg Exp $ +# $Id: Makefile,v 1.48 2015/12/02 00:36:42 sjg Exp $ # Base version on src date -MAKE_VERSION= 20151020 +MAKE_VERSION= 20151201 PROG= bmake Modified: head/contrib/bmake/boot-strap ============================================================================== --- head/contrib/bmake/boot-strap Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/boot-strap Tue Dec 8 01:29:07 2015 (r291978) @@ -111,7 +111,7 @@ # Simon J. Gerraty # RCSid: -# $Id: boot-strap,v 1.45 2014/04/05 22:56:54 sjg Exp $ +# $Id: boot-strap,v 1.48 2015/10/25 05:20:48 sjg Exp $ # # @(#) Copyright (c) 2001 Simon J. Gerraty # @@ -395,8 +395,15 @@ Bmake() { ) } +# there is actually a shell where type is not a builtin +# if type is missing, which(1) had better exists! +if (type cat) > /dev/null 2>&1; then +which() { + type "$@" | sed 's,[()],,g;s,^[^/][^/]*,,;q' +} +fi # make sure test below uses the same diff that configure did -TOOL_DIFF=`type diff | sed 's,[()],,g;s,^[^/][^/]*,,;q'` +TOOL_DIFF=`which diff` export TOOL_DIFF op_configure() { Modified: head/contrib/bmake/cond.c ============================================================================== --- head/contrib/bmake/cond.c Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/cond.c Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -/* $NetBSD: cond.c,v 1.69 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: cond.c,v 1.71 2015/12/02 00:28:24 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990 The Regents of the University of California. @@ -70,14 +70,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: cond.c,v 1.69 2015/10/11 04:51:24 sjg Exp $"; +static char rcsid[] = "$NetBSD: cond.c,v 1.71 2015/12/02 00:28:24 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: cond.c,v 1.69 2015/10/11 04:51:24 sjg Exp $"); +__RCSID("$NetBSD: cond.c,v 1.71 2015/12/02 00:28:24 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -490,6 +490,10 @@ CondCvtArg(char *str, double *value) double d_val; errno = 0; + if (!*str) { + *value = (double)0; + return TRUE; + } l_val = strtoul(str, &eptr, str[1] == 'x' ? 16 : 10); ech = *eptr; if (ech == 0 && errno != ERANGE) { Modified: head/contrib/bmake/config.h.in ============================================================================== --- head/contrib/bmake/config.h.in Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/config.h.in Tue Dec 8 01:29:07 2015 (r291978) @@ -59,6 +59,12 @@ /* Define to 1 if you have the `killpg' function. */ #undef HAVE_KILLPG +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBGEN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIMITS_H + /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H @@ -158,6 +164,9 @@ */ #undef HAVE_SYS_NDIR_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_H @@ -304,6 +313,11 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + /* C99 function name */ #undef __func__ @@ -319,5 +333,9 @@ /* Define to `unsigned int' if does not define. */ #undef size_t +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef uint32_t + /* Define as `fork' if `vfork' does not work. */ #undef vfork Modified: head/contrib/bmake/configure ============================================================================== Binary file (source and/or target). No diff available. Modified: head/contrib/bmake/configure.in ============================================================================== --- head/contrib/bmake/configure.in Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/configure.in Tue Dec 8 01:29:07 2015 (r291978) @@ -1,11 +1,11 @@ dnl dnl RCSid: -dnl $Id: configure.in,v 1.54 2015/10/10 04:17:10 sjg Exp $ +dnl $Id: configure.in,v 1.56 2015/10/25 05:20:48 sjg Exp $ dnl dnl Process this file with autoconf to produce a configure script dnl AC_PREREQ(2.50) -AC_INIT([bmake], [20151009], [sjg@NetBSD.org]) +AC_INIT([bmake], [20151022], [sjg@NetBSD.org]) AC_CONFIG_HEADERS(config.h) dnl make srcdir absolute @@ -101,10 +101,19 @@ AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_DIRENT dnl Keep this list sorted +AC_CHECK_HEADERS(sys/param.h) +dnl On BSDi at least we really need sys/param.h for sys/sysctl.h +AC_CHECK_HEADERS([sys/sysctl.h], [], [], +[#ifdef HAVE_SYS_PARAM_H +# include +# endif +]) + AC_CHECK_HEADERS( \ ar.h \ err.h \ fcntl.h \ + libgen.h \ limits.h \ paths.h \ poll.h \ @@ -113,7 +122,6 @@ AC_CHECK_HEADERS( \ sys/mman.h \ sys/select.h \ sys/socket.h \ - sys/sysctl.h \ sys/time.h \ sys/uio.h \ unistd.h \ @@ -143,6 +151,7 @@ AC_C_CONST AC_TYPE_OFF_T AC_TYPE_PID_T AC_TYPE_SIZE_T +AC_TYPE_UINT32_T AC_DECL_SYS_SIGLIST AC_HEADER_TIME AC_STRUCT_TM Modified: head/contrib/bmake/main.c ============================================================================== --- head/contrib/bmake/main.c Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/main.c Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.234 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: main.c,v 1.235 2015/10/25 05:24:44 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.234 2015/10/11 04:51:24 sjg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.235 2015/10/25 05:24:44 sjg Exp $"; #else #include #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19 #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.234 2015/10/11 04:51:24 sjg Exp $"); +__RCSID("$NetBSD: main.c,v 1.235 2015/10/25 05:24:44 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -1902,6 +1902,8 @@ PrintOnError(GNode *gn, const char *s) printf("%s", cp); free(cp); } + fflush(stdout); + /* * Finally, see if there is a .ERROR target, and run it if so. */ Modified: head/contrib/bmake/meta.c ============================================================================== --- head/contrib/bmake/meta.c Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/meta.c Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.40 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: meta.c,v 1.41 2015/11/30 23:37:56 sjg Exp $ */ /* * Implement 'meta' mode. @@ -38,7 +38,11 @@ #include #include #include +#ifdef HAVE_LIBGEN_H #include +#elif !defined(HAVE_DIRNAME) +char * dirname(char *); +#endif #include #if !defined(HAVE_CONFIG_H) || defined(HAVE_ERR_H) #include @@ -1183,7 +1187,8 @@ meta_oodate(GNode *gn, Boolean oodate) if ((strstr("tmp", p))) break; - if (stat(p, &fs) < 0) { + if ((link_src != NULL && lstat(p, &fs) < 0) || + (link_src == NULL && stat(p, &fs) < 0)) { Lst_AtEnd(missingFiles, bmake_strdup(p)); } break; Modified: head/contrib/bmake/mk/ChangeLog ============================================================================== --- head/contrib/bmake/mk/ChangeLog Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/mk/ChangeLog Tue Dec 8 01:29:07 2015 (r291978) @@ -1,3 +1,29 @@ +2015-11-14 Simon J. Gerraty + + * install-mk (MK_VERSION): 20151111 + + * meta.sys.mk: include sys.dependfile.mk + + * sys.mk (OPTIONS_DEFAULT_NO): use options.mk + to set MK_AUTO_OBJ and MK_DIRDEPS_BUILD + include local.sys.env.mk early + include local.sys.mk later + + * own.mk (OPTIONS_DEFAULT_NO): AUTO_OBJ etc moved to sys.mk + +2015-11-13 Simon J. Gerraty + + * meta.sys.mk (META_COOKIE_TOUCH): + add ${META_COOKIE_TOUCH} to the end of scripts to touch cookie + + * meta.stage.mk: stage_libs should ignore SYMLINKS. + +2015-10-23 Simon J. Gerraty + + * install-mk (MK_VERSION): 20151022 + + * sys.mk: BSD/OS does not have 'type' as a shell builtin. + 2015-10-20 Simon J. Gerraty * install-mk (MK_VERSION): 20151020 @@ -460,7 +486,7 @@ needed. * gendirdeps.mk: only produce unqualified deps if no .MAKE.DEPENDFILE_PREFERENCE ends in .${MACHINE} - * meta.subdir.mk: apply SUBDIREPS_FILTER + * meta.subdir.mk: apply SUBDIRDEPS_FILTER 2012-04-20 Simon J. Gerraty Modified: head/contrib/bmake/mk/host-target.mk ============================================================================== --- head/contrib/bmake/mk/host-target.mk Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/mk/host-target.mk Tue Dec 8 01:29:07 2015 (r291978) @@ -1,5 +1,5 @@ # RCSid: -# $Id: host-target.mk,v 1.9 2015/09/10 18:42:57 sjg Exp $ +# $Id: host-target.mk,v 1.11 2015/10/25 00:07:20 sjg Exp $ # Host platform information; may be overridden .if !defined(_HOST_OSNAME) @@ -21,7 +21,7 @@ _HOST_ARCH := ${_HOST_MACHINE} .else _HOST_ARCH != uname -p 2> /dev/null || uname -m # uname -p may produce garbage on linux -.if ${_HOST_ARCH:[\#]} > 1 +.if ${_HOST_ARCH:[\#]} > 1 || ${_HOST_ARCH:Nunknown} == "" _HOST_ARCH := ${_HOST_MACHINE} .endif .endif @@ -33,10 +33,10 @@ HOST_MACHINE := ${_HOST_MACHINE} .endif HOST_OSMAJOR := ${_HOST_OSREL:C/[^0-9].*//} -HOST_OSTYPE := ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH} +HOST_OSTYPE := ${_HOST_OSNAME:S,/,,g}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH} HOST_OS := ${_HOST_OSNAME} host_os := ${_HOST_OSNAME:tl} -HOST_TARGET := ${host_os}${HOST_OSMAJOR}-${_HOST_ARCH} +HOST_TARGET := ${host_os:S,/,,g}${HOST_OSMAJOR}-${_HOST_ARCH} # tr is insanely non-portable, accommodate the lowest common denominator TR ?= tr Modified: head/contrib/bmake/mk/init.mk ============================================================================== --- head/contrib/bmake/mk/init.mk Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/mk/init.mk Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -# $Id: init.mk,v 1.9 2013/07/18 05:46:24 sjg Exp $ +# $Id: init.mk,v 1.10 2015/12/07 04:28:31 sjg Exp $ # # @(#) Copyright (c) 2002, Simon J. Gerraty # @@ -47,4 +47,8 @@ PROFFLAGS?= -DGPROF -DPROF _SKIP_BUILD = not building at level 0 .endif +.if !empty(_SKIP_BUILD) +all: .PHONY +.warning ${_SKIP_BUILD} +.endif .endif Modified: head/contrib/bmake/mk/install-mk ============================================================================== --- head/contrib/bmake/mk/install-mk Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/mk/install-mk Tue Dec 8 01:29:07 2015 (r291978) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.115 2015/10/20 22:04:53 sjg Exp $ +# $Id: install-mk,v 1.117 2015/11/14 18:09:57 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20151020 +MK_VERSION=20151111 OWNER= GROUP= MODE=444 Modified: head/contrib/bmake/mk/lib.mk ============================================================================== --- head/contrib/bmake/mk/lib.mk Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/mk/lib.mk Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -# $Id: lib.mk,v 1.51 2014/05/23 01:30:36 sjg Exp $ +# $Id: lib.mk,v 1.52 2015/11/14 18:09:57 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -254,7 +254,7 @@ DLLIB ?= -ldl # is a waste of time, this tells meta.autodep.mk to just pick one # (typically .So) # yes, 42 is a random number. -.if ${MK_META_MODE} == "yes" && ${SRCS:Uno:[\#]} > 42 +.if ${MK_DIRDEPS_BUILD} == "yes" && ${SRCS:Uno:[\#]} > 42 OPTIMIZE_OBJECT_META_FILES ?= yes .endif Modified: head/contrib/bmake/mk/meta.autodep.mk ============================================================================== --- head/contrib/bmake/mk/meta.autodep.mk Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/mk/meta.autodep.mk Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -# $Id: meta.autodep.mk,v 1.37 2015/06/16 06:29:17 sjg Exp $ +# $Id: meta.autodep.mk,v 1.39 2015/12/07 04:35:32 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -50,6 +50,9 @@ UPDATE_DEPENDFILE = NO .endif _CURDIR ?= ${.CURDIR} +_OBJDIR ?= ${.OBJDIR} +_OBJTOP ?= ${OBJTOP} +_OBJROOT ?= ${OBJROOT:U${_OBJTOP}} _DEPENDFILE := ${_CURDIR}/${.MAKE.DEPENDFILE:T} .if ${.MAKE.LEVEL} == 0 @@ -190,7 +193,7 @@ gendirdeps: ${_DEPENDFILE} # anything which matches ${_OBJROOT}* but not ${_OBJTOP}* # needs to be qualified in DIRDEPS # The pseudo machine "host" is used for HOST_TARGET -DIRDEPS = \ +DIRDEPS += \ ${DPADD:M${_OBJTOP}*:H:C,${_OBJTOP}[^/]*/,,:N.:O:u} \ ${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} Modified: head/contrib/bmake/mk/meta.stage.mk ============================================================================== --- head/contrib/bmake/mk/meta.stage.mk Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/mk/meta.stage.mk Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -# $Id: meta.stage.mk,v 1.40 2015/10/04 17:36:54 sjg Exp $ +# $Id: meta.stage.mk,v 1.41 2015/11/13 17:34:04 sjg Exp $ # # @(#) Copyright (c) 2011, Simon J. Gerraty # @@ -155,7 +155,7 @@ stage_libs: .dirdep @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} \ ${SHLIB_LINKS:@t@${STAGE_LIBS:T:M$t.*} $t@} .elif !empty(SHLIB_LINK) && !empty(SHLIB_NAME) - @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} ${SHLIB_NAME} ${SHLIB_LINK} ${SYMLINKS:T} + @${STAGE_LINKS_SCRIPT}; StageLinks -s ${STAGE_LIBDIR:${STAGE_DIR_FILTER}} ${SHLIB_NAME} ${SHLIB_LINK} .endif .endif @touch $@ Modified: head/contrib/bmake/mk/meta.subdir.mk ============================================================================== --- head/contrib/bmake/mk/meta.subdir.mk Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/mk/meta.subdir.mk Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -# $Id: meta.subdir.mk,v 1.10 2012/07/03 05:26:46 sjg Exp $ +# $Id: meta.subdir.mk,v 1.11 2015/11/24 22:26:51 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -62,7 +62,7 @@ _subdeps != cd ${.CURDIR} && \ DIRDEPS = .else # clean up if needed -DIRDEPS := ${DIRDEPS:S,^./,,:S,/./,/,g:${SUBDIREPS_FILTER:Uu}} +DIRDEPS := ${DIRDEPS:S,^./,,:S,/./,/,g:${SUBDIRDEPS_FILTER:Uu}} .endif # we just dealt with it, if we leave it defined, # dirdeps.mk will compute some interesting combinations. Modified: head/contrib/bmake/mk/meta.sys.mk ============================================================================== --- head/contrib/bmake/mk/meta.sys.mk Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/mk/meta.sys.mk Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -# $Id: meta.sys.mk,v 1.22 2015/06/16 06:31:05 sjg Exp $ +# $Id: meta.sys.mk,v 1.26 2015/11/14 21:16:13 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -51,17 +51,6 @@ META_MODE += silent=yes .endif .endif -# make defaults .MAKE.DEPENDFILE to .depend -# that won't work for us. -.if ${.MAKE.DEPENDFILE} == ".depend" -.undef .MAKE.DEPENDFILE -.endif - -# if you don't cross build for multiple MACHINEs concurrently, then -# .MAKE.DEPENDFILE = Makefile.depend -# probably makes sense - you can set that in local.sys.mk -.MAKE.DEPENDFILE ?= Makefile.depend.${MACHINE} - # we use the pseudo machine "host" for the build host. # this should be taken care of before we get here .if ${OBJTOP:Ua} == ${HOST_OBJTOP:Ub} @@ -109,10 +98,27 @@ _metaError: .NOMETA .NOTMAIN .endif +META_COOKIE_TOUCH= +# some targets need to be .PHONY in non-meta mode +META_NOPHONY= .PHONY # Are we, after all, in meta mode? .if ${.MAKE.MODE:Mmeta*} != "" MKDEP_MK = meta.autodep.mk +.if ${.MAKE.MAKEFILES:M*sys.dependfile.mk} == "" +# this does all the smarts of setting .MAKE.DEPENDFILE +.-include +# check if we got anything sane +.if ${.MAKE.DEPENDFILE} == ".depend" +.undef .MAKE.DEPENDFILE +.endif +.MAKE.DEPENDFILE ?= Makefile.depend +.endif + +# we can afford to use cookies to prevent some targets +# re-running needlessly +META_COOKIE_TOUCH= touch ${COOKIE.${.TARGET}:U${.OBJDIR}/${.TARGET}} +META_NOPHONY= .if ${UPDATE_DEPENDFILE:Uyes:tl} != "no" .if ${.MAKEFLAGS:Uno:M-k} != "" # make this more obvious Modified: head/contrib/bmake/mk/own.mk ============================================================================== --- head/contrib/bmake/mk/own.mk Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/mk/own.mk Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -# $Id: own.mk,v 1.29 2015/09/08 06:15:31 sjg Exp $ +# $Id: own.mk,v 1.30 2015/11/14 18:09:57 sjg Exp $ .if !target(__${.PARSEFILE}__) __${.PARSEFILE}__: @@ -89,12 +89,10 @@ OPTIONS_DEFAULT_NO+= DPADD_MK # process options OPTIONS_DEFAULT_NO+= \ - AUTO_OBJ \ INSTALL_AS_USER \ GPROF \ LIBTOOL \ LINT \ - META_MODE \ OPTIONS_DEFAULT_YES+= \ ARCHIVE \ Modified: head/contrib/bmake/mk/sys.mk ============================================================================== --- head/contrib/bmake/mk/sys.mk Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/mk/sys.mk Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -# $Id: sys.mk,v 1.36 2014/05/11 00:30:19 sjg Exp $ +# $Id: sys.mk,v 1.41 2015/11/14 20:20:34 sjg Exp $ # # @(#) Copyright (c) 2003-2009, Simon J. Gerraty # @@ -75,8 +75,12 @@ M_L_TARGETS = ${M_ListToMatch:S,V,_TARGE M_ListToSkip= O:u:ts::S,:,:N,g:S,^,N, # type should be a builtin in any sh since about 1980, +# but sadly there are exceptions! +.if ${.MAKE.OS:Unknown:NBSD/OS} == "" +_type_sh = which +.endif # AUTOCONF := ${autoconf:L:${M_whence}} -M_type = @x@(type $$x 2> /dev/null); echo;@:sh:[0]:N* found*:[@]:C,[()],,g +M_type = @x@(${_type_sh:Utype} $$x) 2> /dev/null; echo;@:sh:[0]:N* found*:[@]:C,[()],,g M_whence = ${M_type}:M/*:[1] # convert a path to a valid shell variable @@ -102,6 +106,9 @@ _TARGETS := ${.TARGETS} # we need HOST_TARGET etc below. .include +# early customizations +.-include + # find the OS specifics .if defined(SYS_OS_MK) .include <${SYS_OS_MK}> @@ -126,11 +133,30 @@ SYS_OS_MK := ${_sys_mk} .export SYS_OS_MK .endif -# allow customization without editing. -.-include +# some options we need to know early +OPTIONS_DEFAULT_NO += \ + DIRDEPS_BUILD \ + DIRDEPS_CACHE \ + META_MODE + +OPTIONS_DEFAULT_DEPENDENT += \ + AUTO_OBJ/DIRDEPS_BUILD \ + STAGING/DIRDEPS_BUILD \ + +.-include "options.mk" + +.if ${MK_DIRDEPS_BUILD:Uno} == "yes" +MK_META_MODE = yes +.-include +.elif ${MK_META_MODE:Uno} == "yes" +.MAKE.MODE = meta verbose +.endif +# make sure we have a harmless value +.MAKE.MODE ?= normal # if you want objdirs make them automatic -.if ${MKOBJDIRS:Uno} == "auto" +# and do it early before we compute .PATH +.if ${MK_AUTO_OBJ:Uno} == "yes" || ${MKOBJDIRS:Uno} == "auto" .include .endif @@ -178,17 +204,8 @@ Mkdirs= Mkdirs() { \ .cc.cpp-out: @${COMPILE.cc:N-c} -E ${.IMPSRC} | grep -v '^[ ]*$$' -# we don't include own.mk but user can expect -DWITH_META_MODE to work -.if defined(WITHOUT_META_MODE) -USE_META= no -.elif defined(WITH_META_MODE) -USE_META= yes -.endif -.if ${USE_META:Uno} == "yes" -.-include -.endif -# make sure we have a harmless value -.MAKE.MODE ?= normal +# late customizations +.-include # if .CURDIR is matched by any entry in DEBUG_MAKE_DIRS we # will apply DEBUG_MAKE_FLAGS, now. Modified: head/contrib/bmake/os.sh ============================================================================== --- head/contrib/bmake/os.sh Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/os.sh Tue Dec 8 01:29:07 2015 (r291978) @@ -17,7 +17,7 @@ # Simon J. Gerraty # RCSid: -# $Id: os.sh,v 1.47 2015/09/10 05:53:10 sjg Exp $ +# $Id: os.sh,v 1.49 2015/10/25 00:05:40 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -44,7 +44,7 @@ MACHINE_ARCH=`uname -p 2>/dev/null || ec # there is at least one case of `uname -p` outputting # a bunch of usless drivel case "$MACHINE_ARCH" in -*[!A-Za-z0-9_-]*) MACHINE_ARCH="$MACHINE";; +unknown|*[!A-Za-z0-9_-]*) MACHINE_ARCH="$MACHINE";; esac # we need this here, and it is not always available... @@ -213,7 +213,7 @@ LN=${LN:-ln} TR=${TR:-tr} # Some people like have /share/$HOST_TARGET/bin etc. -HOST_TARGET=`echo ${OS}${OSMAJOR}-$HOST_ARCH | toLower` +HOST_TARGET=`echo ${OS}${OSMAJOR}-$HOST_ARCH | tr -d / | toLower` export HOST_TARGET case `echo -n .` in -n*) N=; C="\c";; *) N=-n; C=;; esac Modified: head/contrib/bmake/parse.c ============================================================================== --- head/contrib/bmake/parse.c Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/parse.c Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.205 2015/10/11 04:51:24 sjg Exp $ */ +/* $NetBSD: parse.c,v 1.206 2015/11/26 00:23:04 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.205 2015/10/11 04:51:24 sjg Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.206 2015/11/26 00:23:04 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.205 2015/10/11 04:51:24 sjg Exp $"); +__RCSID("$NetBSD: parse.c,v 1.206 2015/11/26 00:23:04 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -508,7 +508,11 @@ loadfile(const char *path, int fd) #ifdef HAVE_MMAP if (load_getsize(fd, &lf->len) == SUCCESS) { /* found a size, try mmap */ +#ifdef _SC_PAGESIZE pagesize = sysconf(_SC_PAGESIZE); +#else + pagesize = 0; +#endif if (pagesize <= 0) { pagesize = 0x1000; } Modified: head/contrib/bmake/unit-tests/Makefile.in ============================================================================== --- head/contrib/bmake/unit-tests/Makefile.in Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/unit-tests/Makefile.in Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.47 2015/05/05 21:58:06 sjg Exp $ +# $Id: Makefile.in,v 1.48 2015/12/07 04:06:29 sjg Exp $ # # $NetBSD: Makefile,v 1.52 2015/05/05 21:51:09 sjg Exp $ # @@ -128,7 +128,7 @@ SED_CMDS.varshell = -e 's,^[a-z]*sh: ,,' test: ${OUTFILES} .PHONY @failed= ; \ for test in ${TESTNAMES}; do \ - ${TOOL_DIFF} -u ${UNIT_TESTS}/$${test}.exp $${test}.out \ + ${TOOL_DIFF} ${DIFF_FLAGS} ${UNIT_TESTS}/$${test}.exp $${test}.out \ || failed="$${failed}$${failed:+ }$${test}" ; \ done ; \ if [ -n "$${failed}" ]; then \ Modified: head/contrib/bmake/unit-tests/cond2.mk ============================================================================== --- head/contrib/bmake/unit-tests/cond2.mk Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/unit-tests/cond2.mk Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -# $Id: cond2.mk,v 1.1.1.1 2015/05/05 21:53:13 sjg Exp $ +# $Id: cond2.mk,v 1.1.1.2 2015/12/02 00:34:27 sjg Exp $ TEST_UNAME_S= NetBSD @@ -21,5 +21,9 @@ Y!= echo TEST_NOT_SET is empty or not de Y= oops .endif +.if defined(.NDEF) && ${.NDEF} > 0 +Z= yes +.endif + all: @echo $@ Modified: head/contrib/bmake/unit-tests/doterror.exp ============================================================================== --- head/contrib/bmake/unit-tests/doterror.exp Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/unit-tests/doterror.exp Tue Dec 8 01:29:07 2015 (r291978) @@ -1,9 +1,9 @@ At first, I am happy and now: sad -.ERROR: Looks like 'sad' is upset. *** Error code 1 Stop. make: stopped in unit-tests +.ERROR: Looks like 'sad' is upset. exit status 1 Modified: head/contrib/bmake/unit-tests/modts.mk ============================================================================== --- head/contrib/bmake/unit-tests/modts.mk Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/unit-tests/modts.mk Tue Dec 8 01:29:07 2015 (r291978) @@ -12,9 +12,9 @@ all: mod-ts # Use print or printf iff they are builtin. # XXX note that this causes problems, when make decides # there is no need to use a shell, so avoid where possible. -.if ${type print 2> /dev/null || echo:L:sh:Mbuiltin} != "" +.if ${(type print) 2> /dev/null || echo:L:sh:Mbuiltin} != "" PRINT= print -r -- -.elif ${type printf 2> /dev/null || echo:L:sh:Mbuiltin} != "" +.elif ${(type printf) 2> /dev/null || echo:L:sh:Mbuiltin} != "" PRINT= printf '%s\n' .else PRINT= echo Modified: head/contrib/bmake/var.c ============================================================================== --- head/contrib/bmake/var.c Tue Dec 8 01:16:53 2015 (r291977) +++ head/contrib/bmake/var.c Tue Dec 8 01:29:07 2015 (r291978) @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.199 2015/10/20 21:30:57 sjg Exp $ */ +/* $NetBSD: var.c,v 1.200 2015/12/01 07:26:08 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.199 2015/10/20 21:30:57 sjg Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.200 2015/12/01 07:26:08 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.199 2015/10/20 21:30:57 sjg Exp $"); +__RCSID("$NetBSD: var.c,v 1.200 2015/12/01 07:26:08 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -129,7 +129,6 @@ __RCSID("$NetBSD: var.c,v 1.199 2015/10/ #include #endif #include -#include #include #include #include @@ -702,13 +701,15 @@ Var_ExportVars(void) int i; val = Var_Subst(NULL, tmp, VAR_GLOBAL, FALSE, TRUE); - av = brk_string(val, &ac, FALSE, &as); - for (i = 0; i < ac; i++) { - Var_Export1(av[i], 0); + if (*val) { + av = brk_string(val, &ac, FALSE, &as); + for (i = 0; i < ac; i++) { + Var_Export1(av[i], 0); + } + free(as); + free(av); } free(val); - free(as); - free(av); } } @@ -740,35 +741,37 @@ Var_Export(char *str, int isExport) track = VAR_EXPORT_PARENT; } val = Var_Subst(NULL, str, VAR_GLOBAL, FALSE, TRUE); - av = brk_string(val, &ac, FALSE, &as); - for (i = 0; i < ac; i++) { - name = av[i]; - if (!name[1]) { - /* - * A single char. - * If it is one of the vars that should only appear in - * local context, skip it, else we can get Var_Subst - * into a loop. - */ - switch (name[0]) { - case '@': - case '%': - case '*': - case '!': - continue; + if (*val) { + av = brk_string(val, &ac, FALSE, &as); + for (i = 0; i < ac; i++) { + name = av[i]; + if (!name[1]) { + /* + * A single char. + * If it is one of the vars that should only appear in + * local context, skip it, else we can get Var_Subst + * into a loop. + */ + switch (name[0]) { + case '@': + case '%': + case '*': + case '!': + continue; + } } - } - if (Var_Export1(name, track)) { - if (VAR_EXPORTED_ALL != var_exportedVars) - var_exportedVars = VAR_EXPORTED_YES; - if (isExport && track) { - Var_Append(MAKE_EXPORTED, name, VAR_GLOBAL); + if (Var_Export1(name, track)) { + if (VAR_EXPORTED_ALL != var_exportedVars) + var_exportedVars = VAR_EXPORTED_YES; + if (isExport && track) { + Var_Append(MAKE_EXPORTED, name, VAR_GLOBAL); + } } } + free(as); + free(av); } free(val); - free(as); - free(av); } @@ -2306,7 +2309,7 @@ VarHash(char *str) Buffer buf; size_t len, len2; unsigned char *ustr = (unsigned char *)str; - uint32_t h, k, c1, c2; + unsigned int h, k, c1, c2; h = 0x971e137bU; c1 = 0x95543787U; Modified: head/usr.bin/bmake/Makefile ============================================================================== --- head/usr.bin/bmake/Makefile Tue Dec 8 01:16:53 2015 (r291977) +++ head/usr.bin/bmake/Makefile Tue Dec 8 01:29:07 2015 (r291978) @@ -14,10 +14,10 @@ CFLAGS+= -I${.CURDIR} CLEANDIRS+= FreeBSD CLEANFILES+= bootstrap -# $Id: Makefile,v 1.44 2015/10/20 21:41:40 sjg Exp $ +# $Id: Makefile,v 1.48 2015/12/02 00:36:42 sjg Exp $ # Base version on src date -MAKE_VERSION= 20151020 +MAKE_VERSION= 20151201 PROG?= ${.CURDIR:T} Modified: head/usr.bin/bmake/config.h ============================================================================== --- head/usr.bin/bmake/config.h Tue Dec 8 01:16:53 2015 (r291977) +++ head/usr.bin/bmake/config.h Tue Dec 8 01:29:07 2015 (r291978) @@ -61,6 +61,12 @@ /* Define to 1 if you have the `killpg' function. */ #define HAVE_KILLPG 1 +/* Define to 1 if you have the header file. */ +#define HAVE_LIBGEN_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIMITS_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_MEMORY_H 1 @@ -160,6 +166,9 @@ */ /* #undef HAVE_SYS_NDIR_H */ +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + /* Define to 1 if you have the header file. */ #define HAVE_SYS_SELECT_H 1 @@ -236,7 +245,7 @@ #define PACKAGE_NAME "bmake" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "bmake 20140214" +#define PACKAGE_STRING "bmake 20151022" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "bmake" @@ -245,7 +254,7 @@ #define PACKAGE_URL "" /* Define to the version of this package. */ -#define PACKAGE_VERSION "20140214" +#define PACKAGE_VERSION "20151022" /* Define as the return type of signal handlers (`int' or `void'). */ #define RETSIGTYPE void @@ -306,6 +315,11 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ /* #undef _POSIX_SOURCE */ +/* Define for Solaris 2.5.1 so the uint32_t typedef from , + , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ +/* #undef _UINT32_T */ + /* C99 function name */ /* #undef __func__ */ @@ -321,5 +335,9 @@ /* Define to `unsigned int' if does not define. */ /* #undef size_t */ +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +/* #undef uint32_t */ + /* Define as `fork' if `vfork' does not work. */ /* #undef vfork */ Modified: head/usr.bin/bmake/unit-tests/Makefile ============================================================================== --- head/usr.bin/bmake/unit-tests/Makefile Tue Dec 8 01:16:53 2015 (r291977) +++ head/usr.bin/bmake/unit-tests/Makefile Tue Dec 8 01:29:07 2015 (r291978) @@ -5,7 +5,7 @@ SRCTOP?= ${.CURDIR:H:H:H} -# $Id: Makefile.in,v 1.47 2015/05/05 21:58:06 sjg Exp $ +# $Id: Makefile.in,v 1.48 2015/12/07 04:06:29 sjg Exp $ # # $NetBSD: Makefile,v 1.52 2015/05/05 21:51:09 sjg Exp $ # @@ -135,7 +135,7 @@ SED_CMDS.varshell = -e 's,^[a-z]*sh: ,,' test: ${OUTFILES} .PHONY @failed= ; \ for test in ${TESTNAMES}; do \ - ${TOOL_DIFF} -u ${UNIT_TESTS}/$${test}.exp $${test}.out \ + ${TOOL_DIFF} ${DIFF_FLAGS} ${UNIT_TESTS}/$${test}.exp $${test}.out \ || failed="$${failed}$${failed:+ }$${test}" ; \ done ; \ if [ -n "$${failed}" ]; then \ From owner-svn-src-all@freebsd.org Tue Dec 8 04:40:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 54D9A9D37DC; Tue, 8 Dec 2015 04:40:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25D8C1A85; Tue, 8 Dec 2015 04:40:04 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB84e3YI017253; Tue, 8 Dec 2015 04:40:03 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB84e3hd017252; Tue, 8 Dec 2015 04:40:03 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512080440.tB84e3hd017252@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 8 Dec 2015 04:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291979 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 04:40:04 -0000 Author: ngie Date: Tue Dec 8 04:40:03 2015 New Revision: 291979 URL: https://svnweb.freebsd.org/changeset/base/291979 Log: Unbreak compiling getnetgrent.c with -DDEBUG after r236402 by adding a missing "}" MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/gen/getnetgrent.c Modified: head/lib/libc/gen/getnetgrent.c ============================================================================== --- head/lib/libc/gen/getnetgrent.c Tue Dec 8 01:29:07 2015 (r291978) +++ head/lib/libc/gen/getnetgrent.c Tue Dec 8 04:40:03 2015 (r291979) @@ -512,6 +512,7 @@ parse_netgrp(const char *group) ng[NG_DOM] == NULL ? "" : ",", ng[NG_DOM] == NULL ? "" : ng[NG_DOM], lp->l_groupname); + } #endif } else { spos = strsep(&pos, ", \t"); From owner-svn-src-all@freebsd.org Tue Dec 8 04:45:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 556889D3DB0; Tue, 8 Dec 2015 04:45:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 25F3A1FF8; Tue, 8 Dec 2015 04:45:46 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB84jjwc019911; Tue, 8 Dec 2015 04:45:45 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB84jjrU019909; Tue, 8 Dec 2015 04:45:45 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512080445.tB84jjrU019909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 8 Dec 2015 04:45:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291980 - head/lib/libc/tests/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 04:45:46 -0000 Author: ngie Date: Tue Dec 8 04:45:44 2015 New Revision: 291980 URL: https://svnweb.freebsd.org/changeset/base/291980 Log: Add missing va_ends for corresponding va_starts to clean up variable arguments initialized in _test_fmt(..) MFC after: 3 days Reported by: cppcheck Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/stdio/printbasic_test.c head/lib/libc/tests/stdio/printfloat_test.c Modified: head/lib/libc/tests/stdio/printbasic_test.c ============================================================================== --- head/lib/libc/tests/stdio/printbasic_test.c Tue Dec 8 04:40:03 2015 (r291979) +++ head/lib/libc/tests/stdio/printbasic_test.c Tue Dec 8 04:45:44 2015 (r291980) @@ -94,6 +94,8 @@ _testfmt(const char *result, const char "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]\n", wfmt, argstr, ws, wresult); } + va_end(ap); + va_end(ap2); } ATF_TC_WITHOUT_HEAD(int_within_limits); Modified: head/lib/libc/tests/stdio/printfloat_test.c ============================================================================== --- head/lib/libc/tests/stdio/printfloat_test.c Tue Dec 8 04:40:03 2015 (r291979) +++ head/lib/libc/tests/stdio/printfloat_test.c Tue Dec 8 04:45:44 2015 (r291980) @@ -86,6 +86,8 @@ _testfmt(const char *result, const char "wprintf(\"%ls\", %s) ==> [%ls], expected [%ls]\n", wfmt, argstr, ws, wresult); } + va_end(ap); + va_end(ap2); } ATF_TC_WITHOUT_HEAD(float_within_limits); From owner-svn-src-all@freebsd.org Tue Dec 8 04:51:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C92B19C1237; Tue, 8 Dec 2015 04:51:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CBAF12EB; Tue, 8 Dec 2015 04:51:22 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB84pLXx020128; Tue, 8 Dec 2015 04:51:21 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB84pLbX020127; Tue, 8 Dec 2015 04:51:21 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512080451.tB84pLbX020127@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 8 Dec 2015 04:51:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291981 - head/lib/libc/tests/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 04:51:22 -0000 Author: ngie Date: Tue Dec 8 04:51:21 2015 New Revision: 291981 URL: https://svnweb.freebsd.org/changeset/base/291981 Log: Delete bogus freeing of uninitialized data MFC after: 3 days Reported by: cppcheck Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/tests/stdio/getdelim_test.c Modified: head/lib/libc/tests/stdio/getdelim_test.c ============================================================================== --- head/lib/libc/tests/stdio/getdelim_test.c Tue Dec 8 04:45:44 2015 (r291980) +++ head/lib/libc/tests/stdio/getdelim_test.c Tue Dec 8 04:51:21 2015 (r291981) @@ -207,7 +207,6 @@ ATF_TC_BODY(empty_NULL_buffer, tc) /* Make sure NULL *linep and zero *linecapp are handled. */ fp = mkfilebuf(); - free(line); line = NULL; linecap = 42; ATF_REQUIRE(getline(&line, &linecap, fp) == sizeof(apothegm) - 1); From owner-svn-src-all@freebsd.org Tue Dec 8 05:17:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FF609D3B74; Tue, 8 Dec 2015 05:17:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 123D1138B; Tue, 8 Dec 2015 05:17:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB85HMWB028572; Tue, 8 Dec 2015 05:17:22 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB85HMPj028571; Tue, 8 Dec 2015 05:17:22 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512080517.tB85HMPj028571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 8 Dec 2015 05:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291982 - head/tools/regression/mac/mac_portacl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 05:17:23 -0000 Author: ngie Date: Tue Dec 8 05:17:22 2015 New Revision: 291982 URL: https://svnweb.freebsd.org/changeset/base/291982 Log: Skip the MAC portacl tests if MAC_PORTACL support is missing instead of marking them failed MFC after: 1 week Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/mac/mac_portacl/misc.sh Modified: head/tools/regression/mac/mac_portacl/misc.sh ============================================================================== --- head/tools/regression/mac/mac_portacl/misc.sh Tue Dec 8 04:51:21 2015 (r291981) +++ head/tools/regression/mac/mac_portacl/misc.sh Tue Dec 8 05:17:22 2015 (r291982) @@ -3,8 +3,7 @@ sysctl security.mac.portacl >/dev/null 2>&1 if [ $? -ne 0 ]; then - echo "1..1" - echo "not ok 1 # MAC_PORTACL is unavailable." + echo "1..0 # SKIP MAC_PORTACL is unavailable." exit 0 fi From owner-svn-src-all@freebsd.org Tue Dec 8 05:24:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C28E19D30FD; Tue, 8 Dec 2015 05:24:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 93A171946; Tue, 8 Dec 2015 05:24:07 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB85O6Fr031510; Tue, 8 Dec 2015 05:24:06 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB85O6kc031509; Tue, 8 Dec 2015 05:24:06 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512080524.tB85O6kc031509@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 8 Dec 2015 05:24:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291983 - head/tools/regression/tls/ttls2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 05:24:07 -0000 Author: ngie Date: Tue Dec 8 05:24:06 2015 New Revision: 291983 URL: https://svnweb.freebsd.org/changeset/base/291983 Log: Fix compilation warnings by adding unistd.h #include and missing return statements MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/tls/ttls2/ttls2.c Modified: head/tools/regression/tls/ttls2/ttls2.c ============================================================================== --- head/tools/regression/tls/ttls2/ttls2.c Tue Dec 8 05:17:22 2015 (r291982) +++ head/tools/regression/tls/ttls2/ttls2.c Tue Dec 8 05:24:06 2015 (r291983) @@ -1,7 +1,8 @@ /* $FreeBSD$ */ -#include #include +#include +#include int __thread i; @@ -13,6 +14,7 @@ foo1(void *arg) printf("thread %p, i = %d\n", pthread_self(), i); sleep(1); } + return (NULL); } void * @@ -23,9 +25,11 @@ foo2(void *arg) printf("thread %p, i = %d\n", pthread_self(), i); sleep(1); } + return (NULL); } -int main(int argc, char** argv) +int +main(int argc, char** argv) { pthread_t t1, t2; @@ -33,4 +37,6 @@ int main(int argc, char** argv) pthread_create(&t2, 0, foo2, 0); pthread_join(t1, 0); pthread_join(t2, 0); + + return (0); } From owner-svn-src-all@freebsd.org Tue Dec 8 05:27:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11A109D3373; Tue, 8 Dec 2015 05:27:24 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D96801BBF; Tue, 8 Dec 2015 05:27:23 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB85RN7t031822; Tue, 8 Dec 2015 05:27:23 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB85RNAW031821; Tue, 8 Dec 2015 05:27:23 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512080527.tB85RNAW031821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 8 Dec 2015 05:27:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291984 - head/tools/regression/tls/ttls4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 05:27:24 -0000 Author: ngie Date: Tue Dec 8 05:27:22 2015 New Revision: 291984 URL: https://svnweb.freebsd.org/changeset/base/291984 Log: Add missing stdlib.h header Apply some minor style(9) fixes MFC after: 3 days Sponsored by: EMC / Isilon Storage Division Modified: head/tools/regression/tls/ttls4/ttls4.c Modified: head/tools/regression/tls/ttls4/ttls4.c ============================================================================== --- head/tools/regression/tls/ttls4/ttls4.c Tue Dec 8 05:24:06 2015 (r291983) +++ head/tools/regression/tls/ttls4/ttls4.c Tue Dec 8 05:27:22 2015 (r291984) @@ -9,11 +9,13 @@ #include #include +#include #include int __thread n; -void *f1(void *arg) +void +*f1(void *arg) { if (n != 0) { printf("bug, n == %d \n", n); @@ -23,7 +25,8 @@ void *f1(void *arg) return (0); } -int main() +int +main(void) { pthread_t td; int i; From owner-svn-src-all@freebsd.org Tue Dec 8 06:25:54 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 400989D3219; Tue, 8 Dec 2015 06:25:54 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D0C7180A; Tue, 8 Dec 2015 06:25:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB86PrCf052160; Tue, 8 Dec 2015 06:25:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB86Pq70052153; Tue, 8 Dec 2015 06:25:52 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512080625.tB86Pq70052153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Tue, 8 Dec 2015 06:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291985 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 06:25:54 -0000 Author: arybchik Date: Tue Dec 8 06:25:52 2015 New Revision: 291985 URL: https://svnweb.freebsd.org/changeset/base/291985 Log: sfxge: [3/6] rework MCDI response handling Required for MCDI proxy authorization support. Submitted by: Andy Moreton Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4420 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_mcdi.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_mcdi.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Tue Dec 8 05:27:22 2015 (r291984) +++ head/sys/dev/sfxge/common/efx_impl.h Tue Dec 8 06:25:52 2015 (r291985) @@ -463,6 +463,7 @@ typedef struct efx_mcdi_ops_s { efx_rc_t (*emco_fw_update_supported)(efx_nic_t *, boolean_t *); efx_rc_t (*emco_macaddr_change_supported)(efx_nic_t *, boolean_t *); efx_rc_t (*emco_link_control_supported)(efx_nic_t *, boolean_t *); + void (*emco_read_response)(efx_nic_t *, void *, size_t, size_t); } efx_mcdi_ops_t; typedef struct efx_mcdi_s { Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Tue Dec 8 05:27:22 2015 (r291984) +++ head/sys/dev/sfxge/common/efx_mcdi.c Tue Dec 8 06:25:52 2015 (r291985) @@ -55,6 +55,7 @@ static efx_mcdi_ops_t __efx_mcdi_siena_o /* emco_macaddr_change_supported */ siena_mcdi_link_control_supported, /* emco_link_control_supported */ + siena_mcdi_read_response, /* emco_read_response */ }; #endif /* EFSYS_OPT_SIENA */ @@ -73,6 +74,7 @@ static efx_mcdi_ops_t __efx_mcdi_hunt_op /* emco_macaddr_change_supported */ hunt_mcdi_link_control_supported, /* emco_link_control_supported */ + hunt_mcdi_read_response, /* emco_read_response */ }; #endif /* EFSYS_OPT_HUNTINGTON */ Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Tue Dec 8 05:27:22 2015 (r291984) +++ head/sys/dev/sfxge/common/hunt_impl.h Tue Dec 8 06:25:52 2015 (r291985) @@ -263,6 +263,13 @@ hunt_mcdi_request_copyin( __in boolean_t ev_cpl, __in boolean_t new_epoch); +extern void +hunt_mcdi_read_response( + __in efx_nic_t *enp, + __out void *bufferp, + __in size_t offset, + __in size_t length); + extern __checkReturn boolean_t hunt_mcdi_request_poll( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Tue Dec 8 05:27:22 2015 (r291984) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Tue Dec 8 06:25:52 2015 (r291985) @@ -229,47 +229,41 @@ hunt_mcdi_request_copyout( __in efx_nic_t *enp, __in efx_mcdi_req_t *emrp) { +#if EFSYS_OPT_MCDI_LOGGING const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; - efsys_mem_t *esmp = emtp->emt_dma_mem; - unsigned int pos; - unsigned int offset; +#endif /* EFSYS_OPT_MCDI_LOGGING */ efx_dword_t hdr[2]; - efx_dword_t data; + unsigned int hdr_len; size_t bytes; if (emrp->emr_out_buf == NULL) return; /* Read the command header to detect MCDI response format */ - EFSYS_MEM_READD(esmp, 0, &hdr[0]); + hdr_len = sizeof (hdr[0]); + hunt_mcdi_read_response(enp, &hdr[0], 0, hdr_len); if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) { - offset = 2 * sizeof (efx_dword_t); - /* * Read the actual payload length. The length given in the event * is only correct for responses with the V1 format. */ - EFSYS_MEM_READD(esmp, sizeof (efx_dword_t), &hdr[1]); + hunt_mcdi_read_response(enp, &hdr[1], hdr_len, sizeof (hdr[1])); + hdr_len += sizeof (hdr[1]); + emrp->emr_out_length_used = EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_ACTUAL_LEN); - } else { - offset = sizeof (efx_dword_t); } /* Copy payload out into caller supplied buffer */ bytes = MIN(emrp->emr_out_length_used, emrp->emr_out_length); - for (pos = 0; pos < bytes; pos += sizeof (efx_dword_t)) { - EFSYS_MEM_READD(esmp, offset + pos, &data); - memcpy(MCDI_OUT(*emrp, efx_dword_t, pos), &data, - MIN(sizeof (data), bytes - pos)); - } + hunt_mcdi_read_response(enp, emrp->emr_out_buf, hdr_len, bytes); #if EFSYS_OPT_MCDI_LOGGING if (emtp->emt_logger != NULL) { emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_RESPONSE, - &hdr, offset, - emrp->emr_out_buf, emrp->emr_out_length_used); + &hdr, hdr_len, + emrp->emr_out_buf, bytes); } #endif /* EFSYS_OPT_MCDI_LOGGING */ } @@ -286,19 +280,39 @@ hunt_mcdi_poll_response( return (EFX_DWORD_FIELD(hdr, MCDI_HEADER_RESPONSE) ? B_TRUE : B_FALSE); } + void +hunt_mcdi_read_response( + __in efx_nic_t *enp, + __out void *bufferp, + __in size_t offset, + __in size_t length) +{ + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; + efsys_mem_t *esmp = emtp->emt_dma_mem; + unsigned int pos; + efx_dword_t data; + + for (pos = 0; pos < length; pos += sizeof (efx_dword_t)) { + EFSYS_MEM_READD(esmp, offset + pos, &data); + memcpy((uint8_t *)bufferp + pos, &data, + MIN(sizeof (data), length - pos)); + } +} + __checkReturn boolean_t hunt_mcdi_request_poll( __in efx_nic_t *enp) { - efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); +#if EFSYS_OPT_MCDI_LOGGING const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; - efsys_mem_t *esmp = emtp->emt_dma_mem; +#endif /* EFSYS_OPT_MCDI_LOGGING */ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_mcdi_req_t *emrp; efx_dword_t hdr[2]; + unsigned int hdr_len; + unsigned int data_len; unsigned int seq; unsigned int cmd; - unsigned int length; - size_t offset; int state; efx_rc_t rc; @@ -311,8 +325,6 @@ hunt_mcdi_request_poll( EFSYS_ASSERT(!emip->emi_ev_cpl); emrp = emip->emi_pending_req; - offset = 0; - /* Check if a response is available */ if (hunt_mcdi_poll_response(enp) == B_FALSE) { EFSYS_UNLOCK(enp->en_eslp, state); @@ -320,17 +332,19 @@ hunt_mcdi_request_poll( } /* Read the response header */ - EFSYS_MEM_READD(esmp, offset, &hdr[0]); - offset += sizeof (efx_dword_t); + hdr_len = sizeof (hdr[0]); + hunt_mcdi_read_response(enp, &hdr[0], 0, hdr_len); + if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) { - EFSYS_MEM_READD(esmp, offset, &hdr[1]); - offset += sizeof (efx_dword_t); + hunt_mcdi_read_response(enp, &hdr[1], hdr_len, sizeof (hdr[1])); + hdr_len += sizeof (hdr[1]); cmd = EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_EXTENDED_CMD); - length = EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_ACTUAL_LEN); + data_len = + EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_ACTUAL_LEN); } else { cmd = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE); - length = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_DATALEN); + data_len = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_DATALEN); } /* Request complete */ @@ -338,7 +352,7 @@ hunt_mcdi_request_poll( seq = (emip->emi_seq - 1) & EFX_MASK32(MCDI_HEADER_SEQ); /* Check for synchronous reboot */ - if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_ERROR) != 0 && length == 0) { + if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_ERROR) != 0 && data_len == 0) { /* The MC has rebooted since the request was sent. */ EFSYS_SPIN(EFX_MCDI_STATUS_SLEEP_US); hunt_mcdi_poll_reboot(enp); @@ -362,34 +376,37 @@ hunt_mcdi_request_poll( } if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_ERROR)) { efx_dword_t err[2]; - int errcode; - int argnum; + unsigned int err_len = MIN(data_len, sizeof (err)); + int err_code = MC_CMD_ERR_EPROTO; + int err_arg = 0; /* Read error code (and arg num for MCDI v2 commands) */ - EFSYS_MEM_READD(esmp, offset + MC_CMD_ERR_CODE_OFST, &err[0]); - errcode = EFX_DWORD_FIELD(err[0], EFX_DWORD_0); + hunt_mcdi_read_response(enp, &err[0], hdr_len, err_len); + + if (err_len >= MC_CMD_ERR_CODE_OFST + sizeof (efx_dword_t)) + err_code = EFX_DWORD_FIELD(err[0], EFX_DWORD_0); - EFSYS_MEM_READD(esmp, offset + MC_CMD_ERR_ARG_OFST, &err[1]); - argnum = EFX_DWORD_FIELD(err[1], EFX_DWORD_0); + if (err_len >= MC_CMD_ERR_ARG_OFST + sizeof (efx_dword_t)) + err_arg = EFX_DWORD_FIELD(err[1], EFX_DWORD_0); #if EFSYS_OPT_MCDI_LOGGING if (emtp->emt_logger != NULL) { emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_RESPONSE, - &hdr, offset, - &err, sizeof (err)); + &hdr, hdr_len, + &err, err_len); } #endif /* EFSYS_OPT_MCDI_LOGGING */ - rc = efx_mcdi_request_errcode(errcode); + rc = efx_mcdi_request_errcode(err_code); if (!emrp->emr_quiet) { EFSYS_PROBE3(mcdi_err_arg, int, emrp->emr_cmd, - int, errcode, int, argnum); + int, err_code, int, err_arg); } goto fail3; } else { - emrp->emr_out_length_used = length; + emrp->emr_out_length_used = data_len; emrp->emr_rc = 0; hunt_mcdi_request_copyout(enp, emrp); } Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Tue Dec 8 05:27:22 2015 (r291984) +++ head/sys/dev/sfxge/common/siena_impl.h Tue Dec 8 06:25:52 2015 (r291985) @@ -121,6 +121,13 @@ siena_mcdi_request_copyin( __in boolean_t ev_cpl, __in boolean_t new_epoch); +extern void +siena_mcdi_read_response( + __in efx_nic_t *enp, + __out void *bufferp, + __in size_t offset, + __in size_t length); + extern __checkReturn boolean_t siena_mcdi_request_poll( __in efx_nic_t *enp); Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Tue Dec 8 05:27:22 2015 (r291984) +++ head/sys/dev/sfxge/common/siena_mcdi.c Tue Dec 8 06:25:52 2015 (r291985) @@ -123,33 +123,22 @@ siena_mcdi_request_copyout( const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; efx_dword_t hdr; #endif - efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - unsigned int pos; - unsigned int pdur; - efx_dword_t data; - - pdur = SIENA_MCDI_PDU(emip); + size_t bytes = MIN(emrp->emr_out_length_used, emrp->emr_out_length); /* Copy payload out if caller supplied buffer */ if (emrp->emr_out_buf != NULL) { - size_t bytes = MIN(emrp->emr_out_length_used, - emrp->emr_out_length); - for (pos = 0; pos < bytes; pos += sizeof (efx_dword_t)) { - EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, - pdur + 1 + (pos >> 2), &data, B_FALSE); - memcpy(MCDI_OUT(*emrp, efx_dword_t, pos), &data, - MIN(sizeof (data), bytes - pos)); - } + siena_mcdi_read_response(enp, emrp->emr_out_buf, + sizeof (efx_dword_t), bytes); } #if EFSYS_OPT_MCDI_LOGGING if (emtp->emt_logger != NULL) { - EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &hdr, B_FALSE); + siena_mcdi_read_response(enp, &hdr, 0, sizeof (hdr)); emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_RESPONSE, &hdr, sizeof (hdr), - emrp->emr_out_buf, emrp->emr_out_length_used); + emrp->emr_out_buf, bytes); } #endif /* EFSYS_OPT_MCDI_LOGGING */ } @@ -206,6 +195,29 @@ siena_mcdi_poll_response( return (EFX_DWORD_FIELD(hdr, MCDI_HEADER_RESPONSE) ? B_TRUE : B_FALSE); } + void +siena_mcdi_read_response( + __in efx_nic_t *enp, + __out void *bufferp, + __in size_t offset, + __in size_t length) +{ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + unsigned int pdur; + unsigned int pos; + efx_dword_t data; + + EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2); + pdur = SIENA_MCDI_PDU(emip); + + for (pos = 0; pos < length; pos += sizeof (efx_dword_t)) { + EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, + pdur + ((offset + pos) >> 2), &data, B_FALSE); + memcpy((uint8_t *)bufferp + pos, &data, + MIN(sizeof (data), length - pos)); + } +} + __checkReturn boolean_t siena_mcdi_request_poll( __in efx_nic_t *enp) @@ -216,9 +228,9 @@ siena_mcdi_request_poll( efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_mcdi_req_t *emrp; efx_dword_t hdr; - unsigned int pdur; + unsigned int hdr_len; + unsigned int data_len; unsigned int seq; - unsigned int length; int state; efx_rc_t rc; @@ -241,9 +253,6 @@ siena_mcdi_request_poll( } } - EFSYS_ASSERT(emip->emi_port == 1 || emip->emi_port == 2); - pdur = SIENA_MCDI_PDU(emip); - /* Check if a response is available */ if (siena_mcdi_poll_response(enp) == B_FALSE) { EFSYS_UNLOCK(enp->en_eslp, state); @@ -251,7 +260,8 @@ siena_mcdi_request_poll( } /* Read the response header */ - EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, pdur, &hdr, B_FALSE); + hdr_len = sizeof (hdr); + siena_mcdi_read_response(enp, &hdr, 0, hdr_len); /* Request complete */ emip->emi_pending_req = NULL; @@ -278,35 +288,36 @@ siena_mcdi_request_poll( goto fail3; } - length = EFX_DWORD_FIELD(hdr, MCDI_HEADER_DATALEN); + data_len = EFX_DWORD_FIELD(hdr, MCDI_HEADER_DATALEN); if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_ERROR)) { - efx_dword_t errdword; - int errcode; + efx_dword_t err; + int err_code = MC_CMD_ERR_EPROTO; + unsigned int err_len = MIN(data_len, sizeof (err)); - EFSYS_ASSERT3U(length, ==, 4); - EFX_BAR_TBL_READD(enp, FR_CZ_MC_TREG_SMEM, - pdur + 1 + (MC_CMD_ERR_CODE_OFST >> 2), - &errdword, B_FALSE); - errcode = EFX_DWORD_FIELD(errdword, EFX_DWORD_0); + /* Read error code */ + siena_mcdi_read_response(enp, &err, hdr_len, err_len); + + if (err_len >= MC_CMD_ERR_CODE_OFST + sizeof (efx_dword_t)) + err_code = EFX_DWORD_FIELD(err, EFX_DWORD_0); #if EFSYS_OPT_MCDI_LOGGING if (emtp->emt_logger != NULL) { emtp->emt_logger(emtp->emt_context, EFX_LOG_MCDI_RESPONSE, - &hdr, sizeof (hdr), - &errdword, sizeof (errdword)); + &hdr, hdr_len, + &err, err_len); } #endif /* EFSYS_OPT_MCDI_LOGGING */ - rc = efx_mcdi_request_errcode(errcode); + rc = efx_mcdi_request_errcode(err_code); if (!emrp->emr_quiet) { EFSYS_PROBE2(mcdi_err, int, emrp->emr_cmd, - int, errcode); + int, err_code); } goto fail4; } else { - emrp->emr_out_length_used = length; + emrp->emr_out_length_used = data_len; emrp->emr_rc = 0; siena_mcdi_request_copyout(enp, emrp); } From owner-svn-src-all@freebsd.org Tue Dec 8 07:26:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E437B9D4345; Tue, 8 Dec 2015 07:26:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9A37D1EED; Tue, 8 Dec 2015 07:26:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB87QGPI072450; Tue, 8 Dec 2015 07:26:16 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB87QGOb072449; Tue, 8 Dec 2015 07:26:16 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201512080726.tB87QGOb072449@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 8 Dec 2015 07:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291986 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 07:26:18 -0000 Author: ae Date: Tue Dec 8 07:26:16 2015 New Revision: 291986 URL: https://svnweb.freebsd.org/changeset/base/291986 Log: MFC r291578: mld_v2_dispatch_general_query() is used by mld_fasttimo_vnet() to send a reply to the MLDv2 General Query. In case when router has a lot of multicast groups, the reply can take several packets due to MTU limitation. Also we have a limit MLD_MAX_RESPONSE_BURST == 4, that limits the number of packets we send in one shot. Then we recalculate the timer value and schedule the remaining packets for sending. The problem is that when we call mld_v2_dispatch_general_query() to send remaining packets, we queue new reply in the same mbuf queue. And when number of packets is bigger than MLD_MAX_RESPONSE_BURST, we get endless reply of MLDv2 reports. To fix this, add the check for remaining packets in the queue. PR: 204831 Modified: stable/10/sys/netinet6/mld6.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet6/mld6.c ============================================================================== --- stable/10/sys/netinet6/mld6.c Tue Dec 8 06:25:52 2015 (r291985) +++ stable/10/sys/netinet6/mld6.c Tue Dec 8 07:26:16 2015 (r291986) @@ -2989,6 +2989,15 @@ mld_v2_dispatch_general_query(struct mld KASSERT(mli->mli_version == MLD_VERSION_2, ("%s: called when version %d", __func__, mli->mli_version)); + /* + * Check that there are some packets queued. If so, send them first. + * For large number of groups the reply to general query can take + * many packets, we should finish sending them before starting of + * queuing the new reply. + */ + if (mli->mli_gq.ifq_head != NULL) { + goto send; + ifp = mli->mli_ifp; IF_ADDR_RLOCK(ifp); @@ -3024,6 +3033,7 @@ mld_v2_dispatch_general_query(struct mld } IF_ADDR_RUNLOCK(ifp); +send: mld_dispatch_queue(&mli->mli_gq, MLD_MAX_RESPONSE_BURST); /* From owner-svn-src-all@freebsd.org Tue Dec 8 07:31:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BE3D9D4753; Tue, 8 Dec 2015 07:31:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 39A6414B8; Tue, 8 Dec 2015 07:31:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB87VQmJ073556; Tue, 8 Dec 2015 07:31:26 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB87VQ53073555; Tue, 8 Dec 2015 07:31:26 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201512080731.tB87VQ53073555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 8 Dec 2015 07:31:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291987 - stable/10/sys/netinet6 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 07:31:27 -0000 Author: ae Date: Tue Dec 8 07:31:26 2015 New Revision: 291987 URL: https://svnweb.freebsd.org/changeset/base/291987 Log: Fix typo in r291986. (this is derect commit to stable/10) Modified: stable/10/sys/netinet6/mld6.c Modified: stable/10/sys/netinet6/mld6.c ============================================================================== --- stable/10/sys/netinet6/mld6.c Tue Dec 8 07:26:16 2015 (r291986) +++ stable/10/sys/netinet6/mld6.c Tue Dec 8 07:31:26 2015 (r291987) @@ -2995,7 +2995,7 @@ mld_v2_dispatch_general_query(struct mld * many packets, we should finish sending them before starting of * queuing the new reply. */ - if (mli->mli_gq.ifq_head != NULL) { + if (mli->mli_gq.ifq_head != NULL) goto send; ifp = mli->mli_ifp; From owner-svn-src-all@freebsd.org Tue Dec 8 07:36:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F7CA9D4AA4; Tue, 8 Dec 2015 07:36:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1908919EC; Tue, 8 Dec 2015 07:36:27 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB87aQOq075855; Tue, 8 Dec 2015 07:36:26 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB87aQub075854; Tue, 8 Dec 2015 07:36:26 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201512080736.tB87aQub075854@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 8 Dec 2015 07:36: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: r291988 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 07:36:27 -0000 Author: ae Date: Tue Dec 8 07:36:26 2015 New Revision: 291988 URL: https://svnweb.freebsd.org/changeset/base/291988 Log: MFC r291578: mld_v2_dispatch_general_query() is used by mld_fasttimo_vnet() to send a reply to the MLDv2 General Query. In case when router has a lot of multicast groups, the reply can take several packets due to MTU limitation. Also we have a limit MLD_MAX_RESPONSE_BURST == 4, that limits the number of packets we send in one shot. Then we recalculate the timer value and schedule the remaining packets for sending. The problem is that when we call mld_v2_dispatch_general_query() to send remaining packets, we queue new reply in the same mbuf queue. And when number of packets is bigger than MLD_MAX_RESPONSE_BURST, we get endless reply of MLDv2 reports. To fix this, add the check for remaining packets in the queue. PR: 204831 Modified: stable/9/sys/netinet6/mld6.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet6/mld6.c ============================================================================== --- stable/9/sys/netinet6/mld6.c Tue Dec 8 07:31:26 2015 (r291987) +++ stable/9/sys/netinet6/mld6.c Tue Dec 8 07:36:26 2015 (r291988) @@ -2989,6 +2989,15 @@ mld_v2_dispatch_general_query(struct mld KASSERT(mli->mli_version == MLD_VERSION_2, ("%s: called when version %d", __func__, mli->mli_version)); + /* + * Check that there are some packets queued. If so, send them first. + * For large number of groups the reply to general query can take + * many packets, we should finish sending them before starting of + * queuing the new reply. + */ + if (mli->mli_gq.ifq_head != NULL) + goto send; + ifp = mli->mli_ifp; IF_ADDR_RLOCK(ifp); @@ -3024,6 +3033,7 @@ mld_v2_dispatch_general_query(struct mld } IF_ADDR_RUNLOCK(ifp); +send: mld_dispatch_queue(&mli->mli_gq, MLD_MAX_RESPONSE_BURST); /* From owner-svn-src-all@freebsd.org Tue Dec 8 07:39:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC3FD9D4D0F; Tue, 8 Dec 2015 07:39:40 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C0311BF5; Tue, 8 Dec 2015 07:39:40 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB87dd8T076183; Tue, 8 Dec 2015 07:39:39 GMT (envelope-from uqs@FreeBSD.org) Received: (from uqs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB87dd9f076182; Tue, 8 Dec 2015 07:39:39 GMT (envelope-from uqs@FreeBSD.org) Message-Id: <201512080739.tB87dd9f076182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: uqs set sender to uqs@FreeBSD.org using -f From: Ulrich Spoerlein Date: Tue, 8 Dec 2015 07:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291989 - head/sys/modules/cam X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 07:39:40 -0000 Author: uqs Date: Tue Dec 8 07:39:39 2015 New Revision: 291989 URL: https://svnweb.freebsd.org/changeset/base/291989 Log: Fix make depend Modified: head/sys/modules/cam/Makefile Modified: head/sys/modules/cam/Makefile ============================================================================== --- head/sys/modules/cam/Makefile Tue Dec 8 07:36:26 2015 (r291988) +++ head/sys/modules/cam/Makefile Tue Dec 8 07:39:39 2015 (r291989) @@ -11,6 +11,7 @@ SRCS= opt_cam.h SRCS+= opt_ada.h SRCS+= opt_scsi.h SRCS+= opt_cd.h +SRCS+= opt_kdtrace.h SRCS+= opt_pt.h SRCS+= opt_sa.h SRCS+= opt_ses.h From owner-svn-src-all@freebsd.org Tue Dec 8 07:43:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81C1E9D304F; Tue, 8 Dec 2015 07:43:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A1D5107E; Tue, 8 Dec 2015 07:43:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB87hCJU079079; Tue, 8 Dec 2015 07:43:12 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB87hCVK079078; Tue, 8 Dec 2015 07:43:12 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201512080743.tB87hCVK079078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 8 Dec 2015 07:43:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r291990 - stable/10/sys/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 07:43:13 -0000 Author: ae Date: Tue Dec 8 07:43:12 2015 New Revision: 291990 URL: https://svnweb.freebsd.org/changeset/base/291990 Log: MFC r291579: In the same way fix the problem described in r291578 for IGMPv3. In case when router has a lot of multicast groups, the reply can take several packets due to MTU limitation. Also we have a limit IGMP_MAX_RESPONSE_BURST == 4, that limits the number of packets we send in one shot. Then we recalculate the timer value and schedule the remaining packets for sending. The problem is that when we call igmp_v3_dispatch_general_query() to send remaining packets, we queue new reply in the same mbuf queue. And when number of packets is bigger than IGMP_MAX_RESPONSE_BURST, we get endless reply of IGMPv3 reports. To fix this, add the check for remaining packets in the queue. Modified: stable/10/sys/netinet/igmp.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/igmp.c ============================================================================== --- stable/10/sys/netinet/igmp.c Tue Dec 8 07:39:39 2015 (r291989) +++ stable/10/sys/netinet/igmp.c Tue Dec 8 07:43:12 2015 (r291990) @@ -3327,6 +3327,15 @@ igmp_v3_dispatch_general_query(struct ig KASSERT(igi->igi_version == IGMP_VERSION_3, ("%s: called when version %d", __func__, igi->igi_version)); + /* + * Check that there are some packets queued. If so, send them first. + * For large number of groups the reply to general query can take + * many packets, we should finish sending them before starting of + * queuing the new reply. + */ + if (igi->igi_gq.ifq_head != NULL) + goto send; + ifp = igi->igi_ifp; IF_ADDR_RLOCK(ifp); @@ -3362,6 +3371,7 @@ igmp_v3_dispatch_general_query(struct ig } IF_ADDR_RUNLOCK(ifp); +send: loop = (igi->igi_flags & IGIF_LOOPBACK) ? 1 : 0; igmp_dispatch_queue(&igi->igi_gq, IGMP_MAX_RESPONSE_BURST, loop); From owner-svn-src-all@freebsd.org Tue Dec 8 07:47:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B2869D326A; Tue, 8 Dec 2015 07:47:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2FFAC128B; Tue, 8 Dec 2015 07:47:02 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB87l1NI079487; Tue, 8 Dec 2015 07:47:01 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB87l1qR079486; Tue, 8 Dec 2015 07:47:01 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201512080747.tB87l1qR079486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 8 Dec 2015 07:47:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r291991 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 07:47:02 -0000 Author: ae Date: Tue Dec 8 07:47:01 2015 New Revision: 291991 URL: https://svnweb.freebsd.org/changeset/base/291991 Log: MFC r291579: In the same way fix the problem described in r291578 for IGMPv3. In case when router has a lot of multicast groups, the reply can take several packets due to MTU limitation. Also we have a limit IGMP_MAX_RESPONSE_BURST == 4, that limits the number of packets we send in one shot. Then we recalculate the timer value and schedule the remaining packets for sending. The problem is that when we call igmp_v3_dispatch_general_query() to send remaining packets, we queue new reply in the same mbuf queue. And when number of packets is bigger than IGMP_MAX_RESPONSE_BURST, we get endless reply of IGMPv3 reports. To fix this, add the check for remaining packets in the queue. Modified: stable/9/sys/netinet/igmp.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/netinet/igmp.c ============================================================================== --- stable/9/sys/netinet/igmp.c Tue Dec 8 07:43:12 2015 (r291990) +++ stable/9/sys/netinet/igmp.c Tue Dec 8 07:47:01 2015 (r291991) @@ -3326,6 +3326,15 @@ igmp_v3_dispatch_general_query(struct ig KASSERT(igi->igi_version == IGMP_VERSION_3, ("%s: called when version %d", __func__, igi->igi_version)); + /* + * Check that there are some packets queued. If so, send them first. + * For large number of groups the reply to general query can take + * many packets, we should finish sending them before starting of + * queuing the new reply. + */ + if (igi->igi_gq.ifq_head != NULL) + goto send; + ifp = igi->igi_ifp; IF_ADDR_RLOCK(ifp); @@ -3361,6 +3370,7 @@ igmp_v3_dispatch_general_query(struct ig } IF_ADDR_RUNLOCK(ifp); +send: loop = (igi->igi_flags & IGIF_LOOPBACK) ? 1 : 0; igmp_dispatch_queue(&igi->igi_gq, IGMP_MAX_RESPONSE_BURST, loop); From owner-svn-src-all@freebsd.org Tue Dec 8 10:50:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 829299D36D7; Tue, 8 Dec 2015 10:50:05 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46F5D1793; Tue, 8 Dec 2015 10:50:05 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB8Ao4uK042989; Tue, 8 Dec 2015 10:50:04 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB8Ao3XG042975; Tue, 8 Dec 2015 10:50:03 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201512081050.tB8Ao3XG042975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Tue, 8 Dec 2015 10:50:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291993 - in head/sys: conf net netinet netinet6 netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 10:50:05 -0000 Author: melifaro Date: Tue Dec 8 10:50:03 2015 New Revision: 291993 URL: https://svnweb.freebsd.org/changeset/base/291993 Log: Merge helper fib* functions used for basic lookups. Vast majority of rtalloc(9) users require only basic info from route table (e.g. "does the rtentry interface match with the interface I have?". "what is the MTU?", "Give me the IPv4 source address to use", etc..). Instead of hand-rolling lookups, checking if rtentry is up, valid, dealing with IPv6 mtu, finding "address" ifp (almost never done right), provide easy-to-use API hiding all the complexity and returning the needed info into small on-stack structure. This change also helps hiding route subsystem internals (locking, direct rtentry accesses). Additionaly, using this API improves lookup performance since rtentry is not locked. (This is safe, since all the rtentry changes happens under both radix WLOCK and rtentry WLOCK). Sponsored by: Yandex LLC Added: head/sys/netinet/in_fib.c (contents, props changed) head/sys/netinet/in_fib.h (contents, props changed) head/sys/netinet6/in6_fib.c (contents, props changed) head/sys/netinet6/in6_fib.h (contents, props changed) Modified: head/sys/conf/files head/sys/net/route.h head/sys/netinet/in_gif.c head/sys/netinet/ip_options.c head/sys/netinet6/in6_gif.c head/sys/netinet6/scope6.c head/sys/netinet6/scope6_var.h head/sys/netpfil/ipfw/ip_fw2.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Dec 8 08:31:00 2015 (r291992) +++ head/sys/conf/files Tue Dec 8 10:50:03 2015 (r291993) @@ -3643,6 +3643,7 @@ netinet/in.c optional inet netinet/in_debug.c optional inet ddb netinet/in_kdtrace.c optional inet | inet6 netinet/ip_carp.c optional inet carp | inet6 carp +netinet/in_fib.c optional inet netinet/in_gif.c optional gif inet | netgraph_gif inet netinet/ip_gre.c optional gre inet netinet/ip_id.c optional inet @@ -3709,6 +3710,7 @@ netinet6/frag6.c optional inet6 netinet6/icmp6.c optional inet6 netinet6/in6.c optional inet6 netinet6/in6_cksum.c optional inet6 +netinet6/in6_fib.c optional inet6 netinet6/in6_gif.c optional gif inet6 | netgraph_gif inet6 netinet6/in6_ifattach.c optional inet6 netinet6/in6_mcast.c optional inet6 Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Tue Dec 8 08:31:00 2015 (r291992) +++ head/sys/net/route.h Tue Dec 8 10:50:03 2015 (r291993) @@ -171,6 +171,37 @@ struct rtentry { RTF_REJECT | RTF_STATIC | RTF_STICKY) /* + * fib_ nexthop API flags. + */ + +/* Consumer-visible nexthop info flags */ +#define NHF_REJECT 0x0010 /* RTF_REJECT */ +#define NHF_BLACKHOLE 0x0020 /* RTF_BLACKHOLE */ +#define NHF_REDIRECT 0x0040 /* RTF_DYNAMIC|RTF_MODIFIED */ +#define NHF_DEFAULT 0x0080 /* Default route */ +#define NHF_BROADCAST 0x0100 /* RTF_BROADCAST */ +#define NHF_GATEWAY 0x0200 /* RTF_GATEWAY */ + +/* Nexthop request flags */ +#define NHR_IFAIF 0x01 /* Return ifa_ifp interface */ +#define NHR_REF 0x02 /* For future use */ + +/* rte<>nhop translation */ +static inline uint16_t +fib_rte_to_nh_flags(int rt_flags) +{ + uint16_t res; + + res = (rt_flags & RTF_REJECT) ? NHF_REJECT : 0; + res |= (rt_flags & RTF_BLACKHOLE) ? NHF_BLACKHOLE : 0; + res |= (rt_flags & (RTF_DYNAMIC|RTF_MODIFIED)) ? NHF_REDIRECT : 0; + res |= (rt_flags & RTF_BROADCAST) ? NHF_BROADCAST : 0; + res |= (rt_flags & RTF_GATEWAY) ? NHF_GATEWAY : 0; + + return (res); +} + +/* * Routing statistics. */ struct rtstat { Added: head/sys/netinet/in_fib.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/in_fib.c Tue Dec 8 10:50:03 2015 (r291993) @@ -0,0 +1,222 @@ +/*- + * Copyright (c) 2015 + * Alexander V. Chernikov + * + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_route.h" +#include "opt_mpath.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#ifdef RADIX_MPATH +#include +#endif + +#include +#include +#include + +#ifdef INET +static void fib4_rte_to_nh_basic(struct rtentry *rte, struct in_addr dst, + uint32_t flags, struct nhop4_basic *pnh4); +static void fib4_rte_to_nh_extended(struct rtentry *rte, struct in_addr dst, + uint32_t flags, struct nhop4_extended *pnh4); + +#define RNTORT(p) ((struct rtentry *)(p)) + +static void +fib4_rte_to_nh_basic(struct rtentry *rte, struct in_addr dst, + uint32_t flags, struct nhop4_basic *pnh4) +{ + struct sockaddr_in *gw; + + if ((flags & NHR_IFAIF) != 0) + pnh4->nh_ifp = rte->rt_ifa->ifa_ifp; + else + pnh4->nh_ifp = rte->rt_ifp; + pnh4->nh_mtu = min(rte->rt_mtu, rte->rt_ifp->if_mtu); + if (rte->rt_flags & RTF_GATEWAY) { + gw = (struct sockaddr_in *)rte->rt_gateway; + pnh4->nh_addr = gw->sin_addr; + } else + pnh4->nh_addr = dst; + /* Set flags */ + pnh4->nh_flags = fib_rte_to_nh_flags(rte->rt_flags); + gw = (struct sockaddr_in *)rt_key(rte); + if (gw->sin_addr.s_addr == 0) + pnh4->nh_flags |= NHF_DEFAULT; + /* TODO: Handle RTF_BROADCAST here */ +} + +static void +fib4_rte_to_nh_extended(struct rtentry *rte, struct in_addr dst, + uint32_t flags, struct nhop4_extended *pnh4) +{ + struct sockaddr_in *gw; + struct in_ifaddr *ia; + + pnh4->nh_ifp = rte->rt_ifa->ifa_ifp; + pnh4->nh_mtu = min(rte->rt_mtu, rte->rt_ifp->if_mtu); + if (rte->rt_flags & RTF_GATEWAY) { + gw = (struct sockaddr_in *)rte->rt_gateway; + pnh4->nh_addr = gw->sin_addr; + } else + pnh4->nh_addr = dst; + /* Set flags */ + pnh4->nh_flags = fib_rte_to_nh_flags(rte->rt_flags); + gw = (struct sockaddr_in *)rt_key(rte); + if (gw->sin_addr.s_addr == 0) + pnh4->nh_flags |= NHF_DEFAULT; + /* XXX: Set RTF_BROADCAST if GW address is broadcast */ + + ia = ifatoia(rte->rt_ifa); + pnh4->nh_src = IA_SIN(ia)->sin_addr; +} + +/* + * Performs IPv4 route table lookup on @dst. Returns 0 on success. + * Stores nexthop info provided @pnh4 structure. + * Note that + * - nh_ifp cannot be safely dereferenced + * - nh_ifp represents logical transmit interface (rt_ifp) (e.g. if + * looking up address on interface "ix0" pointer to "lo0" interface + * will be returned instead of "ix0") + * - nh_ifp represents "address" interface if NHR_IFAIF flag is passed + * - howewer mtu from "transmit" interface will be returned. + */ +int +fib4_lookup_nh_basic(uint32_t fibnum, struct in_addr dst, uint32_t flags, + uint32_t flowid, struct nhop4_basic *pnh4) +{ + struct radix_node_head *rh; + struct radix_node *rn; + struct sockaddr_in sin; + struct rtentry *rte; + + KASSERT((fibnum < rt_numfibs), ("fib4_lookup_nh_basic: bad fibnum")); + rh = rt_tables_get_rnh(fibnum, AF_INET); + if (rh == NULL) + return (ENOENT); + + /* Prepare lookup key */ + memset(&sin, 0, sizeof(sin)); + sin.sin_len = sizeof(struct sockaddr_in); + sin.sin_addr = dst; + + RADIX_NODE_HEAD_RLOCK(rh); + rn = rh->rnh_matchaddr((void *)&sin, rh); + if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) { + rte = RNTORT(rn); + /* Ensure route & ifp is UP */ + if (RT_LINK_IS_UP(rte->rt_ifp)) { + fib4_rte_to_nh_basic(rte, dst, flags, pnh4); + RADIX_NODE_HEAD_RUNLOCK(rh); + + return (0); + } + } + RADIX_NODE_HEAD_RUNLOCK(rh); + + return (ENOENT); +} + +/* + * Performs IPv4 route table lookup on @dst. Returns 0 on success. + * Stores extende nexthop info provided @pnh4 structure. + * Note that + * - nh_ifp cannot be safely dereferenced unless NHR_REF is specified. + * - in that case you need to call fib4_free_nh_ext() + * - nh_ifp represents logical transmit interface (rt_ifp) (e.g. if + * looking up address of interface "ix0" pointer to "lo0" interface + * will be returned instead of "ix0") + * - nh_ifp represents "address" interface if NHR_IFAIF flag is passed + * - howewer mtu from "transmit" interface will be returned. + */ +int +fib4_lookup_nh_ext(uint32_t fibnum, struct in_addr dst, uint32_t flowid, + uint32_t flags, struct nhop4_extended *pnh4) +{ + struct radix_node_head *rh; + struct radix_node *rn; + struct sockaddr_in sin; + struct rtentry *rte; + + KASSERT((fibnum < rt_numfibs), ("fib4_lookup_nh_ext: bad fibnum")); + rh = rt_tables_get_rnh(fibnum, AF_INET); + if (rh == NULL) + return (ENOENT); + + /* Prepare lookup key */ + memset(&sin, 0, sizeof(sin)); + sin.sin_len = sizeof(struct sockaddr_in); + sin.sin_addr = dst; + + RADIX_NODE_HEAD_RLOCK(rh); + rn = rh->rnh_matchaddr((void *)&sin, rh); + if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) { + rte = RNTORT(rn); + /* Ensure route & ifp is UP */ + if (RT_LINK_IS_UP(rte->rt_ifp)) { + fib4_rte_to_nh_extended(rte, dst, flags, pnh4); + if ((flags & NHR_REF) != 0) { + /* TODO: lwref on egress ifp's ? */ + } + RADIX_NODE_HEAD_RUNLOCK(rh); + + return (0); + } + } + RADIX_NODE_HEAD_RUNLOCK(rh); + + return (ENOENT); +} + +void +fib4_free_nh_ext(uint32_t fibnum, struct nhop4_extended *pnh4) +{ + +} + +#endif Added: head/sys/netinet/in_fib.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/in_fib.h Tue Dec 8 10:50:03 2015 (r291993) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2015 + * Alexander V. Chernikov + * + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETINET_IN_FIB_H_ +#define _NETINET_IN_FIB_H_ + +/* Basic nexthop info used for uRPF/mtu checks */ +struct nhop4_basic { + struct ifnet *nh_ifp; /* Logical egress interface */ + uint16_t nh_mtu; /* nexthop mtu */ + uint16_t nh_flags; /* nhop flags */ + struct in_addr nh_addr; /* GW/DST IPv4 address */ +}; + +/* Extended nexthop info used for control protocols */ +struct nhop4_extended { + struct ifnet *nh_ifp; /* Logical egress interface */ + uint16_t nh_mtu; /* nexthop mtu */ + uint16_t nh_flags; /* nhop flags */ + uint8_t spare[4]; + struct in_addr nh_addr; /* GW/DST IPv4 address */ + struct in_addr nh_src; /* default source IPv4 address */ + uint64_t spare2[2]; +}; + +int fib4_lookup_nh_basic(uint32_t fibnum, struct in_addr dst, uint32_t flags, + uint32_t flowid, struct nhop4_basic *pnh4); +int fib4_lookup_nh_ext(uint32_t fibnum, struct in_addr dst, uint32_t flags, + uint32_t flowid, struct nhop4_extended *pnh4); +void fib4_free_nh_ext(uint32_t fibnum, struct nhop4_extended *pnh4); + +#endif + Modified: head/sys/netinet/in_gif.c ============================================================================== --- head/sys/netinet/in_gif.c Tue Dec 8 08:31:00 2015 (r291992) +++ head/sys/netinet/in_gif.c Tue Dec 8 10:50:03 2015 (r291993) @@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #ifdef INET6 #include @@ -188,22 +189,16 @@ in_gif_encapcheck(const struct mbuf *m, /* ingress filters on outer source */ if ((GIF2IFP(sc)->if_flags & IFF_LINK2) == 0) { - struct sockaddr_in sin; - struct rtentry *rt; + struct nhop4_basic nh4; + struct in_addr dst; - bzero(&sin, sizeof(sin)); - sin.sin_family = AF_INET; - sin.sin_len = sizeof(struct sockaddr_in); - sin.sin_addr = ip->ip_src; - /* XXX MRT check for the interface we would use on output */ - rt = in_rtalloc1((struct sockaddr *)&sin, 0, - 0UL, sc->gif_fibnum); - if (rt == NULL || rt->rt_ifp != m->m_pkthdr.rcvif) { - if (rt != NULL) - RTFREE_LOCKED(rt); + dst = ip->ip_src; + + if (fib4_lookup_nh_basic(sc->gif_fibnum, dst, 0, 0, &nh4) != 0) + return (0); + + if (nh4.nh_ifp != m->m_pkthdr.rcvif) return (0); - } - RTFREE_LOCKED(rt); } return (ret); } Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Tue Dec 8 08:31:00 2015 (r291992) +++ head/sys/netinet/ip_options.c Tue Dec 8 10:50:03 2015 (r291993) @@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -104,6 +105,7 @@ ip_dooptions(struct mbuf *m, int pass) int opt, optlen, cnt, off, code, type = ICMP_PARAMPROB, forward = 0; struct in_addr *sin, dst; uint32_t ntime; + struct nhop4_extended nh_ext; struct sockaddr_in ipaddr = { sizeof(ipaddr), AF_INET }; /* Ignore or reject packets with IP options. */ @@ -227,6 +229,9 @@ dropit: (void)memcpy(&ipaddr.sin_addr, cp + off, sizeof(ipaddr.sin_addr)); + type = ICMP_UNREACH; + code = ICMP_UNREACH_SRCFAIL; + if (opt == IPOPT_SSRR) { #define INA struct in_ifaddr * #define SA struct sockaddr * @@ -235,18 +240,23 @@ dropit: if (ia == NULL) ia = (INA)ifa_ifwithnet((SA)&ipaddr, 0, RT_ALL_FIBS); - } else -/* XXX MRT 0 for routing */ - ia = ip_rtaddr(ipaddr.sin_addr, M_GETFIB(m)); - if (ia == NULL) { - type = ICMP_UNREACH; - code = ICMP_UNREACH_SRCFAIL; - goto bad; + if (ia == NULL) + goto bad; + + memcpy(cp + off, &(IA_SIN(ia)->sin_addr), + sizeof(struct in_addr)); + ifa_free(&ia->ia_ifa); + } else { + /* XXX MRT 0 for routing */ + if (fib4_lookup_nh_ext(M_GETFIB(m), + ipaddr.sin_addr, 0, 0, &nh_ext) != 0) + goto bad; + + memcpy(cp + off, &nh_ext.nh_src, + sizeof(struct in_addr)); } + ip->ip_dst = ipaddr.sin_addr; - (void)memcpy(cp + off, &(IA_SIN(ia)->sin_addr), - sizeof(struct in_addr)); - ifa_free(&ia->ia_ifa); cp[IPOPT_OFFSET] += sizeof(struct in_addr); /* * Let ip_intr's mcast routing check handle mcast pkts Added: head/sys/netinet6/in6_fib.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet6/in6_fib.c Tue Dec 8 10:50:03 2015 (r291993) @@ -0,0 +1,264 @@ +/*- + * Copyright (c) 2015 + * Alexander V. Chernikov + * + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_inet6.h" +#include "opt_route.h" +#include "opt_mpath.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#ifdef RADIX_MPATH +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#ifdef INET6 +static void fib6_rte_to_nh_extended(struct rtentry *rte, + const struct in6_addr *dst, uint32_t flags, struct nhop6_extended *pnh6); +static void fib6_rte_to_nh_basic(struct rtentry *rte, const struct in6_addr *dst, + uint32_t flags, struct nhop6_basic *pnh6); +static struct ifnet *fib6_get_ifaifp(struct rtentry *rte); +#define RNTORT(p) ((struct rtentry *)(p)) + +/* + * Gets real interface for the @rte. + * Returns rt_ifp for !IFF_LOOPBACK routers. + * Extracts "real" address interface from interface address + * loopback routes. + */ +static struct ifnet * +fib6_get_ifaifp(struct rtentry *rte) +{ + struct ifnet *ifp; + struct sockaddr_dl *sdl; + + ifp = rte->rt_ifp; + if ((ifp->if_flags & IFF_LOOPBACK) && + rte->rt_gateway->sa_family == AF_LINK) { + sdl = (struct sockaddr_dl *)rte->rt_gateway; + return (ifnet_byindex(sdl->sdl_index)); + } + + return (ifp); +} + +static void +fib6_rte_to_nh_basic(struct rtentry *rte, const struct in6_addr *dst, + uint32_t flags, struct nhop6_basic *pnh6) +{ + struct sockaddr_in6 *gw; + + /* Do explicit nexthop zero unless we're copying it */ + memset(pnh6, 0, sizeof(*pnh6)); + + if ((flags & NHR_IFAIF) != 0) + pnh6->nh_ifp = fib6_get_ifaifp(rte); + else + pnh6->nh_ifp = rte->rt_ifp; + + pnh6->nh_mtu = min(rte->rt_mtu, IN6_LINKMTU(rte->rt_ifp)); + if (rte->rt_flags & RTF_GATEWAY) { + gw = (struct sockaddr_in6 *)rte->rt_gateway; + pnh6->nh_addr = gw->sin6_addr; + in6_clearscope(&pnh6->nh_addr); + } else + pnh6->nh_addr = *dst; + /* Set flags */ + pnh6->nh_flags = fib_rte_to_nh_flags(rte->rt_flags); + gw = (struct sockaddr_in6 *)rt_key(rte); + if (IN6_IS_ADDR_UNSPECIFIED(&gw->sin6_addr)) + pnh6->nh_flags |= NHF_DEFAULT; +} + +static void +fib6_rte_to_nh_extended(struct rtentry *rte, const struct in6_addr *dst, + uint32_t flags, struct nhop6_extended *pnh6) +{ + struct sockaddr_in6 *gw; + + /* Do explicit nexthop zero unless we're copying it */ + memset(pnh6, 0, sizeof(*pnh6)); + + if ((flags & NHR_IFAIF) != 0) + pnh6->nh_ifp = fib6_get_ifaifp(rte); + else + pnh6->nh_ifp = rte->rt_ifp; + + pnh6->nh_mtu = min(rte->rt_mtu, IN6_LINKMTU(rte->rt_ifp)); + if (rte->rt_flags & RTF_GATEWAY) { + gw = (struct sockaddr_in6 *)rte->rt_gateway; + pnh6->nh_addr = gw->sin6_addr; + in6_clearscope(&pnh6->nh_addr); + } else + pnh6->nh_addr = *dst; + /* Set flags */ + pnh6->nh_flags = fib_rte_to_nh_flags(rte->rt_flags); + gw = (struct sockaddr_in6 *)rt_key(rte); + if (IN6_IS_ADDR_UNSPECIFIED(&gw->sin6_addr)) + pnh6->nh_flags |= NHF_DEFAULT; +} + +/* + * Performs IPv6 route table lookup on @dst. Returns 0 on success. + * Stores basic nexthop info into provided @pnh6 structure. + * Note that + * - nh_ifp represents logical transmit interface (rt_ifp) by default + * - nh_ifp represents "address" interface if NHR_IFAIF flag is passed + * - mtu from logical transmit interface will be returned. + * - nh_ifp cannot be safely dereferenced + * - nh_ifp represents rt_ifp (e.g. if looking up address on + * interface "ix0" pointer to "ix0" interface will be returned instead + * of "lo0") + * - howewer mtu from "transmit" interface will be returned. + */ +int +fib6_lookup_nh_basic(uint32_t fibnum, const struct in6_addr *dst, uint32_t scopeid, + uint32_t flags, uint32_t flowid, struct nhop6_basic *pnh6) +{ + struct radix_node_head *rh; + struct radix_node *rn; + struct sockaddr_in6 sin6; + struct rtentry *rte; + + KASSERT((fibnum < rt_numfibs), ("fib6_lookup_nh_basic: bad fibnum")); + rh = rt_tables_get_rnh(fibnum, AF_INET6); + if (rh == NULL) + return (ENOENT); + + /* Prepare lookup key */ + memset(&sin6, 0, sizeof(sin6)); + sin6.sin6_addr = *dst; + /* Assume scopeid is valid and embed it directly */ + if (IN6_IS_SCOPE_LINKLOCAL(dst)) + sin6.sin6_addr.s6_addr16[1] = htons(scopeid & 0xffff); + + RADIX_NODE_HEAD_RLOCK(rh); + rn = rh->rnh_matchaddr((void *)&sin6, rh); + if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) { + rte = RNTORT(rn); + /* Ensure route & ifp is UP */ + if (RT_LINK_IS_UP(rte->rt_ifp)) { + fib6_rte_to_nh_basic(rte, dst, flags, pnh6); + RADIX_NODE_HEAD_RUNLOCK(rh); + return (0); + } + } + RADIX_NODE_HEAD_RUNLOCK(rh); + + return (ENOENT); +} + +/* + * Performs IPv6 route table lookup on @dst. Returns 0 on success. + * Stores extended nexthop info into provided @pnh6 structure. + * Note that + * - nh_ifp cannot be safely dereferenced unless NHR_REF is specified. + * - in that case you need to call fib6_free_nh_ext() + * - nh_ifp represents logical transmit interface (rt_ifp) by default + * - nh_ifp represents "address" interface if NHR_IFAIF flag is passed + * - mtu from logical transmit interface will be returned. + */ +int +fib6_lookup_nh_ext(uint32_t fibnum, const struct in6_addr *dst,uint32_t scopeid, + uint32_t flags, uint32_t flowid, struct nhop6_extended *pnh6) +{ + struct radix_node_head *rh; + struct radix_node *rn; + struct sockaddr_in6 sin6; + struct rtentry *rte; + + KASSERT((fibnum < rt_numfibs), ("fib6_lookup_nh_ext: bad fibnum")); + rh = rt_tables_get_rnh(fibnum, AF_INET6); + if (rh == NULL) + return (ENOENT); + + /* Prepare lookup key */ + memset(&sin6, 0, sizeof(sin6)); + sin6.sin6_len = sizeof(struct sockaddr_in6); + sin6.sin6_addr = *dst; + /* Assume scopeid is valid and embed it directly */ + if (IN6_IS_SCOPE_LINKLOCAL(dst)) + sin6.sin6_addr.s6_addr16[1] = htons(scopeid & 0xffff); + + RADIX_NODE_HEAD_RLOCK(rh); + rn = rh->rnh_matchaddr((void *)&sin6, rh); + if (rn != NULL && ((rn->rn_flags & RNF_ROOT) == 0)) { + rte = RNTORT(rn); + /* Ensure route & ifp is UP */ + if (RT_LINK_IS_UP(rte->rt_ifp)) { + fib6_rte_to_nh_extended(rte, dst, flags, pnh6); + if ((flags & NHR_REF) != 0) { + /* TODO: Do lwref on egress ifp's */ + } + RADIX_NODE_HEAD_RUNLOCK(rh); + + return (0); + } + } + RADIX_NODE_HEAD_RUNLOCK(rh); + + return (ENOENT); +} + +void +fib6_free_nh_ext(uint32_t fibnum, struct nhop6_extended *pnh6) +{ + +} + +#endif + Added: head/sys/netinet6/in6_fib.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet6/in6_fib.h Tue Dec 8 10:50:03 2015 (r291993) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2015 + * Alexander V. Chernikov + * + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _NETINET6_IN6_FIB_H_ +#define _NETINET6_IN6_FIB_H_ + +/* Basic nexthop info used for uRPF/mtu checks */ +struct nhop6_basic { + struct ifnet *nh_ifp; /* Logical egress interface */ + uint16_t nh_mtu; /* nexthop mtu */ + uint16_t nh_flags; /* nhop flags */ + uint8_t spare[4]; + struct in6_addr nh_addr; /* GW/DST IPv4 address */ +}; + +/* Does not differ from nhop6_basic */ +struct nhop6_extended { + struct ifnet *nh_ifp; /* Logical egress interface */ + uint16_t nh_mtu; /* nexthop mtu */ + uint16_t nh_flags; /* nhop flags */ + uint8_t spare[4]; + struct in6_addr nh_addr; /* GW/DST IPv6 address */ + uint64_t spare2[2]; +}; + +int fib6_lookup_nh_basic(uint32_t fibnum, const struct in6_addr *dst, + uint32_t scopeid, uint32_t flags, uint32_t flowid,struct nhop6_basic *pnh6); +int fib6_lookup_nh_ext(uint32_t fibnum, const struct in6_addr *dst, + uint32_t scopeid, uint32_t flags, uint32_t flowid, + struct nhop6_extended *pnh6); +void fib6_free_nh_ext(uint32_t fibnum, struct nhop6_extended *pnh6); +#endif + Modified: head/sys/netinet6/in6_gif.c ============================================================================== --- head/sys/netinet6/in6_gif.c Tue Dec 8 08:31:00 2015 (r291992) +++ head/sys/netinet6/in6_gif.c Tue Dec 8 10:50:03 2015 (r291993) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef INET6 #include +#include #endif #include @@ -203,23 +204,15 @@ in6_gif_encapcheck(const struct mbuf *m, /* ingress filters on outer source */ if ((GIF2IFP(sc)->if_flags & IFF_LINK2) == 0) { - struct sockaddr_in6 sin6; - struct rtentry *rt; + struct nhop6_basic nh6; + struct in6_addr *dst; - bzero(&sin6, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(struct sockaddr_in6); - sin6.sin6_addr = ip6->ip6_src; - sin6.sin6_scope_id = 0; /* XXX */ - - rt = in6_rtalloc1((struct sockaddr *)&sin6, 0, 0UL, - sc->gif_fibnum); - if (rt == NULL || rt->rt_ifp != m->m_pkthdr.rcvif) { - if (rt != NULL) - RTFREE_LOCKED(rt); + /* XXX empty scope id */ + if (fib6_lookup_nh_basic(sc->gif_fibnum, dst, 0, 0, 0, &nh6)!=0) + return (0); + + if (nh6.nh_ifp != m->m_pkthdr.rcvif) return (0); - } - RTFREE_LOCKED(rt); } return (ret); } Modified: head/sys/netinet6/scope6.c ============================================================================== --- head/sys/netinet6/scope6.c Tue Dec 8 08:31:00 2015 (r291992) +++ head/sys/netinet6/scope6.c Tue Dec 8 10:50:03 2015 (r291993) @@ -487,6 +487,22 @@ in6_getscopezone(const struct ifnet *ifp } /* + * Extracts scope from adddress @dst, stores cleared address + * inside @dst and zone inside @scopeid + */ +void +in6_splitscope(const struct in6_addr *src, struct in6_addr *dst, + uint32_t *scopeid) +{ + uint32_t zoneid; + + *dst = *src; + zoneid = ntohs(in6_getscope(dst)); + in6_clearscope(dst); + *scopeid = zoneid; +} + +/* * This function is for checking sockaddr_in6 structure passed * from the application level (usually). * Modified: head/sys/netinet6/scope6_var.h ============================================================================== --- head/sys/netinet6/scope6_var.h Tue Dec 8 08:31:00 2015 (r291992) +++ head/sys/netinet6/scope6_var.h Tue Dec 8 10:50:03 2015 (r291993) @@ -63,6 +63,7 @@ int in6_setscope(struct in6_addr *, stru int in6_clearscope(struct in6_addr *); uint16_t in6_getscope(struct in6_addr *); uint32_t in6_getscopezone(const struct ifnet *, int); +void in6_splitscope(const struct in6_addr *, struct in6_addr *, uint32_t *); struct ifnet* in6_getlinkifnet(uint32_t); #endif /* _KERNEL */ Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Tue Dec 8 08:31:00 2015 (r291992) +++ head/sys/netpfil/ipfw/ip_fw2.c Tue Dec 8 10:50:03 2015 (r291993) @@ -84,7 +84,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include #ifdef INET6 +#include #include #include #include @@ -437,19 +439,10 @@ verify_path(struct in_addr src, struct i #if defined(USERSPACE) || !defined(__FreeBSD__) return 0; #else - struct route ro; - struct sockaddr_in *dst; + struct nhop4_basic nh4; - bzero(&ro, sizeof(ro)); - - dst = (struct sockaddr_in *)&(ro.ro_dst); - dst->sin_family = AF_INET; - dst->sin_len = sizeof(*dst); - dst->sin_addr = src; - in_rtalloc_ign(&ro, 0, fib); - - if (ro.ro_rt == NULL) - return 0; + if (fib4_lookup_nh_basic(fib, src, NHR_IFAIF, 0, &nh4) != 0) + return (0); /* * If ifp is provided, check for equality with rtentry. @@ -458,26 +451,18 @@ verify_path(struct in_addr src, struct i * routing entry (via lo0) for our own address * may exist, so we need to handle routing assymetry. */ - if (ifp != NULL && ro.ro_rt->rt_ifa->ifa_ifp != ifp) { - RTFREE(ro.ro_rt); - return 0; - } + if (ifp != NULL && ifp != nh4.nh_ifp) + return (0); /* if no ifp provided, check if rtentry is not default route */ - if (ifp == NULL && - satosin(rt_key(ro.ro_rt))->sin_addr.s_addr == INADDR_ANY) { - RTFREE(ro.ro_rt); - return 0; - } + if (ifp == NULL && (nh4.nh_flags & NHF_DEFAULT) != 0) + return (0); /* or if this is a blackhole/reject route */ - if (ifp == NULL && ro.ro_rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) { - RTFREE(ro.ro_rt); - return 0; - } + if (ifp == NULL && (nh4.nh_flags & (NHF_REJECT|NHF_BLACKHOLE)) != 0) + return (0); /* found valid route */ - RTFREE(ro.ro_rt); return 1; #endif /* __FreeBSD__ */ } @@ -537,49 +522,28 @@ ipfw_localip6(struct in6_addr *in6) static int verify_path6(struct in6_addr *src, struct ifnet *ifp, u_int fib) { - struct route_in6 ro; - struct sockaddr_in6 *dst; - - bzero(&ro, sizeof(ro)); + struct nhop6_basic nh6; - dst = (struct sockaddr_in6 * )&(ro.ro_dst); - dst->sin6_family = AF_INET6; - dst->sin6_len = sizeof(*dst); - dst->sin6_addr = *src; + if (IN6_IS_SCOPE_LINKLOCAL(src)) + return (1); - in6_rtalloc_ign(&ro, 0, fib); - if (ro.ro_rt == NULL) - return 0; + if (fib6_lookup_nh_basic(fib, src, 0, NHR_IFAIF, 0, &nh6) != 0) + return (0); - /* - * if ifp is provided, check for equality with rtentry - * We should use rt->rt_ifa->ifa_ifp, instead of rt->rt_ifp, - * to support the case of sending packets to an address of our own. - * (where the former interface is the first argument of if_simloop() - * (=ifp), the latter is lo0) - */ - if (ifp != NULL && ro.ro_rt->rt_ifa->ifa_ifp != ifp) { - RTFREE(ro.ro_rt); - return 0; - } + /* If ifp is provided, check for equality with route table. */ + if (ifp != NULL && ifp != nh6.nh_ifp) + return (0); /* if no ifp provided, check if rtentry is not default route */ - if (ifp == NULL && - IN6_IS_ADDR_UNSPECIFIED(&satosin6(rt_key(ro.ro_rt))->sin6_addr)) { - RTFREE(ro.ro_rt); - return 0; - } + if (ifp == NULL && (nh6.nh_flags & NHF_DEFAULT) != 0) + return (0); /* or if this is a blackhole/reject route */ - if (ifp == NULL && ro.ro_rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) { - RTFREE(ro.ro_rt); - return 0; - } + if (ifp == NULL && (nh6.nh_flags & (NHF_REJECT|NHF_BLACKHOLE)) != 0) + return (0); /* found valid route */ - RTFREE(ro.ro_rt); return 1; - } static int From owner-svn-src-all@freebsd.org Tue Dec 8 16:09:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9B7E9D3E0C; Tue, 8 Dec 2015 16:09:49 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A69141339; Tue, 8 Dec 2015 16:09:49 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB8G9mZq053071; Tue, 8 Dec 2015 16:09:48 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB8G9mfd053070; Tue, 8 Dec 2015 16:09:48 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <201512081609.tB8G9mfd053070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 8 Dec 2015 16:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291994 - head/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 16:09:49 -0000 Author: vangyzen Date: Tue Dec 8 16:09:48 2015 New Revision: 291994 URL: https://svnweb.freebsd.org/changeset/base/291994 Log: resolver: fix the build of some ports, broken by r289315 r289315 required time_t and struct timespec to be defined before including . This broke the build of net-mgmt/sx, at least. Include in resolv.h to fix this with minimal pollution. Reported by: Raphael Kubo da Costa MFC after: 3 days Sponsored by: Dell Inc. Modified: head/include/resolv.h Modified: head/include/resolv.h ============================================================================== --- head/include/resolv.h Tue Dec 8 10:50:03 2015 (r291993) +++ head/include/resolv.h Tue Dec 8 16:09:48 2015 (r291994) @@ -57,6 +57,7 @@ #include #include #include +#include #include #include From owner-svn-src-all@freebsd.org Tue Dec 8 16:12:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F06D09D4117; Tue, 8 Dec 2015 16:12:08 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id D9BAB1878; Tue, 8 Dec 2015 16:12:08 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id D670F56489; Tue, 8 Dec 2015 10:12:01 -0600 (CST) Subject: Re: svn commit: r289315 - in head: include lib/libc/resolv share/man/man5 To: Raphael Kubo da Costa References: <201510141426.t9EEQiWX079418__45653.4197823659$1444832818$gmane$org@repo.freebsd.org> <86r3j06d0v.fsf@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eric van Gyzen Message-ID: <5667014E.1040209@FreeBSD.org> Date: Tue, 8 Dec 2015 10:11:58 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <86r3j06d0v.fsf@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 16:12:09 -0000 On 12/05/2015 11:06, Raphael Kubo da Costa wrote: > Eric van Gyzen writes: > >> Author: vangyzen >> Date: Wed Oct 14 14:26:44 2015 >> New Revision: 289315 >> URL: https://svnweb.freebsd.org/changeset/base/289315 >> >> Log: >> resolver: automatically reload /etc/resolv.conf >> >> [...] >> >> Modified: head/include/resolv.h >> ============================================================================== >> --- head/include/resolv.h Wed Oct 14 12:46:05 2015 (r289314) >> +++ head/include/resolv.h Wed Oct 14 14:26:44 2015 (r289315) >> >> [...] >> >> @@ -188,6 +189,8 @@ struct __res_state { >> } _ext; >> } _u; >> u_char *_rnd; /*%< PRIVATE: random state */ >> + struct timespec conf_mtim; /*%< mod time of loaded resolv.conf */ >> + time_t conf_stat; /*%< time of last stat(resolv.conf) */ >> }; > With this change, including the headers listed in resolver(3), > sys/types.h, netinet/in.h, arpa/nameser.h and resolv.h is not enough, as > resolv.h now depends on sys/time.h. This has broken at least one port, > net-mgmt/sx. It includes those 4 headers to find if the resolver library > is in libc. The test program fails like this: > > In file included from conftest.c:31: > /usr/include/resolv.h:192:18: error: field has incomplete type 'struct timespec' > struct timespec conf_mtim; /*%< mod time of loaded resolv.conf */ > ^ > /usr/include/resolv.h:192:9: note: forward declaration of 'struct timespec' > struct timespec conf_mtim; /*%< mod time of loaded resolv.conf */ > ^ Thanks for the detailed report, Raphael. It's fixed in head r291994. Eric From owner-svn-src-all@freebsd.org Tue Dec 8 17:09:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51C979D4EEE; Tue, 8 Dec 2015 17:09:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0F8F018C4; Tue, 8 Dec 2015 17:09:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB8H9IdA076157; Tue, 8 Dec 2015 17:09:18 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB8H9H95076153; Tue, 8 Dec 2015 17:09:17 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512081709.tB8H9H95076153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 8 Dec 2015 17:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291995 - in head: . share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 17:09:19 -0000 Author: bdrewery Date: Tue Dec 8 17:09:17 2015 New Revision: 291995 URL: https://svnweb.freebsd.org/changeset/base/291995 Log: Fix some makeman issues. - Don't bother looking up REVISION/BRANCH/etc from release/, or the CPUTYPE check, as these are not used for makeman and wastes time. The also invokes auto.obj.mk after I reverted auto.obj.mk ignoring -V in r291312. - Don't modify CC or PATH when WITH_CCACHE_BUILD or WITH_META_MODE is enabled as it leads to bsd.compiler.mk errors. Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile.inc1 head/share/mk/bsd.compiler.mk head/share/mk/local.meta.sys.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Dec 8 16:09:48 2015 (r291994) +++ head/Makefile.inc1 Tue Dec 8 17:09:17 2015 (r291995) @@ -163,7 +163,7 @@ OSRELDATE= 0 .endif # Set VERSION for CTFMERGE to use via the default CTFFLAGS=-L VERSION. -.if !defined(VERSION) +.if !defined(VERSION) && !make(showconfig) REVISION!= ${MAKE} -C ${SRCDIR}/release -V REVISION BRANCH!= ${MAKE} -C ${SRCDIR}/release -V BRANCH SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \ @@ -195,11 +195,14 @@ _TARGET_CPUTYPE=${TARGET_CPUTYPE} .else _TARGET_CPUTYPE=dummy .endif +# Skip for showconfig as it is just wasted time and may invoke auto.obj.mk. +.if !make(showconfig) _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \ -f /dev/null -m ${.CURDIR}/share/mk -V CPUTYPE .if ${_CPUTYPE} != ${_TARGET_CPUTYPE} .error CPUTYPE global should be set with ?=. .endif +.endif .if make(buildworld) BUILD_ARCH!= uname -p .if ${MACHINE_ARCH} != ${BUILD_ARCH} Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Tue Dec 8 16:09:48 2015 (r291994) +++ head/share/mk/bsd.compiler.mk Tue Dec 8 17:09:17 2015 (r291995) @@ -30,6 +30,7 @@ ____: # Handle ccache after CC is determined, but not if CC/CXX are already # overridden with a manual setup. .if ${MK_CCACHE_BUILD:Uno} == "yes" && \ + !make(showconfig) && \ (${CC:M*ccache/world/*} == "" || ${CXX:M*ccache/world/*} == "") # CC is always prepended with the ccache wrapper rather than modifying # PATH since it is more clear that ccache is used and avoids wasting time Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Tue Dec 8 16:09:48 2015 (r291994) +++ head/share/mk/local.meta.sys.mk Tue Dec 8 17:09:17 2015 (r291995) @@ -215,6 +215,7 @@ TOOLSDIR?= ${STAGE_HOST_OBJTOP} .endif # Don't use the bootstrap tools logic on itself. .if ${.TARGETS:Mbootstrap-tools} == "" && \ + !make(showconfig) && \ !defined(BOOTSTRAPPING_TOOLS) && !empty(TOOLSDIR) && ${.MAKE.LEVEL} == 0 .for dir in /sbin /bin /usr/sbin /usr/bin PATH:= ${TOOLSDIR}${dir}:${PATH} From owner-svn-src-all@freebsd.org Tue Dec 8 17:40:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51E359D4BA1; Tue, 8 Dec 2015 17:40:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2057A1A7F; Tue, 8 Dec 2015 17:40:44 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB8HehiP086173; Tue, 8 Dec 2015 17:40:43 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB8Heh0v086172; Tue, 8 Dec 2015 17:40:43 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512081740.tB8Heh0v086172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 8 Dec 2015 17:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291996 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 17:40:44 -0000 Author: emaste Date: Tue Dec 8 17:40:42 2015 New Revision: 291996 URL: https://svnweb.freebsd.org/changeset/base/291996 Log: Update after r291955, build/install userland debug by default Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Tue Dec 8 17:09:17 2015 (r291995) +++ head/share/man/man5/src.conf.5 Tue Dec 8 17:40:42 2015 (r291996) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 291414 2015-11-28 00:41:37Z ume .\" $FreeBSD$ -.Dd November 28, 2015 +.Dd December 8, 2015 .Dt SRC.CONF 5 .Os .Sh NAME @@ -452,14 +452,10 @@ When set, it also enforces the following .It .Va WITHOUT_GROFF .El -.It Va WITH_DEBUG_FILES -.\" from FreeBSD: head/tools/build/options/WITH_DEBUG_FILES 251512 2013-06-07 21:40:02Z 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_DEBUG_FILES +.\" from FreeBSD: head/tools/build/options/WITHOUT_DEBUG_FILES 290059 2015-10-27 20:49:56Z emaste +Set to avoid building or installing standalone debug files for each +executable binary and shared library. .It Va WITHOUT_DICT .\" from FreeBSD: head/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-all@freebsd.org Tue Dec 8 17:56:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DD049D4B53; Tue, 8 Dec 2015 17:56:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 40CA81143; Tue, 8 Dec 2015 17:56:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB8HueUt092373; Tue, 8 Dec 2015 17:56:40 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB8HueNP092372; Tue, 8 Dec 2015 17:56:40 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512081756.tB8HueNP092372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 8 Dec 2015 17:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291997 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 17:56:41 -0000 Author: bdrewery Date: Tue Dec 8 17:56:40 2015 New Revision: 291997 URL: https://svnweb.freebsd.org/changeset/base/291997 Log: META MODE: Define a STAGE_TARGET_OBJTOP and export it alone with STAGE_OBJTOP and STAGE_HOST_OBJTOP. These will always be overridden in sub-makes when building in-tree, but are exported for the benefit of hooking in external builds, such as ports. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.meta.sys.mk Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Tue Dec 8 17:40:42 2015 (r291996) +++ head/share/mk/local.meta.sys.mk Tue Dec 8 17:56:40 2015 (r291997) @@ -148,7 +148,11 @@ STAGE_MACHINE:= ${TARGET_OBJ_SPEC} .endif STAGE_OBJTOP:= ${STAGE_ROOT}/${STAGE_MACHINE} STAGE_COMMON_OBJTOP:= ${STAGE_ROOT}/common +STAGE_TARGET_OBJTOP:= ${STAGE_ROOT}/${TARGET_OBJ_SPEC} STAGE_HOST_OBJTOP:= ${STAGE_ROOT}/${HOST_TARGET} +# These are exported for hooking in out-of-tree builds. They will always +# be overridden in sub-makes above when building in-tree. +.export STAGE_OBJTOP STAGE_TARGET_OBJTOP STAGE_HOST_OBJTOP # Use tools/install.sh which can avoid the need for xinstall for simple cases. INSTALL?= sh ${SRCTOP}/tools/install.sh From owner-svn-src-all@freebsd.org Tue Dec 8 18:38:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 822039D4E5E; Tue, 8 Dec 2015 18:38:34 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54307106D; Tue, 8 Dec 2015 18:38:34 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB8IcXVG005735; Tue, 8 Dec 2015 18:38:33 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB8IcX2u005734; Tue, 8 Dec 2015 18:38:33 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512081838.tB8IcX2u005734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Tue, 8 Dec 2015 18:38:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291998 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 18:38:34 -0000 Author: smh Date: Tue Dec 8 18:38:33 2015 New Revision: 291998 URL: https://svnweb.freebsd.org/changeset/base/291998 Log: Don't use 0 for pointer comparison Use NULL instead of 0 for comparison with panicstr. MFC after: 1 week Sponsored by: Multiplay Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Tue Dec 8 17:56:40 2015 (r291997) +++ head/sys/kern/vfs_bio.c Tue Dec 8 18:38:33 2015 (r291998) @@ -1280,7 +1280,7 @@ bufshutdown(int show_busybufs) /* * Unmount filesystems */ - if (panicstr == 0) + if (panicstr == NULL) vfs_unmountall(); } swapoff_all(); From owner-svn-src-all@freebsd.org Tue Dec 8 19:19:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB8B39D4BA2; Tue, 8 Dec 2015 19:19:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A91D4133A; Tue, 8 Dec 2015 19:19:27 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB8JJQHq017666; Tue, 8 Dec 2015 19:19:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB8JJQv7017665; Tue, 8 Dec 2015 19:19:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512081919.tB8JJQv7017665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 8 Dec 2015 19:19:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291999 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 19:19:28 -0000 Author: emaste Date: Tue Dec 8 19:19:26 2015 New Revision: 291999 URL: https://svnweb.freebsd.org/changeset/base/291999 Log: Add comment explaining aarch64's BROKEN_OPTIONS In-tree bintuils and GCC do not support aarch64 or other recent architectures. Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Tue Dec 8 18:38:33 2015 (r291998) +++ head/share/mk/src.opts.mk Tue Dec 8 19:19:26 2015 (r291999) @@ -228,6 +228,7 @@ __DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CL __DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC .endif +# In-tree binutils/gcc are older versions without modern architecture support. .if ${__T} == "aarch64" BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB __DEFAULT_YES_OPTIONS+=ELFCOPY_AS_OBJCOPY From owner-svn-src-all@freebsd.org Tue Dec 8 19:33:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52D6B9D57FC; Tue, 8 Dec 2015 19:33:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D6A6175E; Tue, 8 Dec 2015 19:33:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB8JWxqT023663; Tue, 8 Dec 2015 19:32:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB8JWwBq023655; Tue, 8 Dec 2015 19:32:58 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512081932.tB8JWwBq023655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 8 Dec 2015 19:32:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292000 - in head/lib/csu: aarch64 amd64 arm i386 mips powerpc powerpc64 sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 19:33:00 -0000 Author: emaste Date: Tue Dec 8 19:32:58 2015 New Revision: 292000 URL: https://svnweb.freebsd.org/changeset/base/292000 Log: Remove historical GNUC test The requirement is for a GCC-compatible compiler and not necessarily GCC itself. However, we currently expect any compiler used for building the whole of FreeBSD to be GCC-compatible and many things will break if not; there's no longer a need to have an explicit test for this in csu. Sponsored by: The FreeBSD Foundation Modified: head/lib/csu/aarch64/crt1.c head/lib/csu/amd64/crt1.c head/lib/csu/arm/crt1.c head/lib/csu/i386/crt1_c.c head/lib/csu/mips/crt1.c head/lib/csu/powerpc/crt1.c head/lib/csu/powerpc64/crt1.c head/lib/csu/sparc64/crt1.c Modified: head/lib/csu/aarch64/crt1.c ============================================================================== --- head/lib/csu/aarch64/crt1.c Tue Dec 8 19:19:26 2015 (r291999) +++ head/lib/csu/aarch64/crt1.c Tue Dec 8 19:32:58 2015 (r292000) @@ -32,12 +32,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: head/lib/csu/amd64/crt1.c ============================================================================== --- head/lib/csu/amd64/crt1.c Tue Dec 8 19:19:26 2015 (r291999) +++ head/lib/csu/amd64/crt1.c Tue Dec 8 19:32:58 2015 (r292000) @@ -27,12 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: head/lib/csu/arm/crt1.c ============================================================================== --- head/lib/csu/arm/crt1.c Tue Dec 8 19:19:26 2015 (r291999) +++ head/lib/csu/arm/crt1.c Tue Dec 8 19:32:58 2015 (r292000) @@ -42,12 +42,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: head/lib/csu/i386/crt1_c.c ============================================================================== --- head/lib/csu/i386/crt1_c.c Tue Dec 8 19:19:26 2015 (r291999) +++ head/lib/csu/i386/crt1_c.c Tue Dec 8 19:32:58 2015 (r292000) @@ -29,12 +29,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: head/lib/csu/mips/crt1.c ============================================================================== --- head/lib/csu/mips/crt1.c Tue Dec 8 19:19:26 2015 (r291999) +++ head/lib/csu/mips/crt1.c Tue Dec 8 19:32:58 2015 (r292000) @@ -36,10 +36,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif - #include #include "libc_private.h" #include "crtbrand.c" Modified: head/lib/csu/powerpc/crt1.c ============================================================================== --- head/lib/csu/powerpc/crt1.c Tue Dec 8 19:19:26 2015 (r291999) +++ head/lib/csu/powerpc/crt1.c Tue Dec 8 19:32:58 2015 (r292000) @@ -42,12 +42,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: head/lib/csu/powerpc64/crt1.c ============================================================================== --- head/lib/csu/powerpc64/crt1.c Tue Dec 8 19:19:26 2015 (r291999) +++ head/lib/csu/powerpc64/crt1.c Tue Dec 8 19:32:58 2015 (r292000) @@ -42,12 +42,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" Modified: head/lib/csu/sparc64/crt1.c ============================================================================== --- head/lib/csu/sparc64/crt1.c Tue Dec 8 19:19:26 2015 (r291999) +++ head/lib/csu/sparc64/crt1.c Tue Dec 8 19:32:58 2015 (r292000) @@ -33,12 +33,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef lint -#ifndef __GNUC__ -#error "GCC is needed to compile this file" -#endif -#endif /* lint */ - #include #include "libc_private.h" From owner-svn-src-all@freebsd.org Tue Dec 8 20:05:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 474819D32E4; Tue, 8 Dec 2015 20:05:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 180E1174B; Tue, 8 Dec 2015 20:05:28 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB8K5RRH033571; Tue, 8 Dec 2015 20:05:27 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB8K5R02033570; Tue, 8 Dec 2015 20:05:27 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512082005.tB8K5R02033570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 8 Dec 2015 20:05:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292001 - head/sys/modules/ahci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 20:05:28 -0000 Author: andrew Date: Tue Dec 8 20:05:27 2015 New Revision: 292001 URL: https://svnweb.freebsd.org/changeset/base/292001 Log: ahci_generic.c needs ofw_bus_if.h, add it to the module. Modified: head/sys/modules/ahci/Makefile Modified: head/sys/modules/ahci/Makefile ============================================================================== --- head/sys/modules/ahci/Makefile Tue Dec 8 19:32:58 2015 (r292000) +++ head/sys/modules/ahci/Makefile Tue Dec 8 20:05:27 2015 (r292001) @@ -6,7 +6,7 @@ KMOD= ahci SRCS= ahci.c ahci_pci.c ahciem.c ahci.h device_if.h bus_if.h pci_if.h opt_cam.h .if ${MACHINE_CPUARCH} == "aarch64" -SRCS+= ahci_generic.c +SRCS+= ahci_generic.c ofw_bus_if.h .endif .include From owner-svn-src-all@freebsd.org Tue Dec 8 20:20:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0C179D4032; Tue, 8 Dec 2015 20:20:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E5C01304; Tue, 8 Dec 2015 20:20:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB8KKebx038067; Tue, 8 Dec 2015 20:20:40 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB8KKexd038066; Tue, 8 Dec 2015 20:20:40 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512082020.tB8KKexd038066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 8 Dec 2015 20:20:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292002 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 20:20:41 -0000 Author: bdrewery Date: Tue Dec 8 20:20:40 2015 New Revision: 292002 URL: https://svnweb.freebsd.org/changeset/base/292002 Log: CCACHE_BUILD: Only export CCACHE_PATH= if it was already set with a value. Older ccache don't work with an empty CCACHE_PATH value. They will error with: ccache: FATAL: Could not find compiler "cc" in PATH make: "/mnt/bdrewery/git/onefs/src/share/mk/bsd.compiler.mk" line 134: Unable to determine compiler type for /usr/local/bin/ccache cc. Consider setting COMPILER_TYPE. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.compiler.mk Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Tue Dec 8 20:05:27 2015 (r292001) +++ head/share/mk/bsd.compiler.mk Tue Dec 8 20:20:40 2015 (r292002) @@ -64,8 +64,10 @@ CCACHE_COMPILERCHECK?= mtime # Remove ccache from the PATH to prevent double calls and wasted CPP/LD time. PATH:= ${PATH:C,:?${CCACHE_WRAPPER_PATH}(/world)?(:$)?,,g} # Ensure no bogus CCACHE_PATH leaks in which might avoid the in-tree compiler. +.if !empty(CCACHE_PATH) CCACHE_PATH= .export CCACHE_PATH +.endif # Override various toolchain vars. .for var in CC CXX HOST_CC HOST_CXX .if defined(${var}) && ${${var}:M${CCACHE_BIN}} == "" From owner-svn-src-all@freebsd.org Tue Dec 8 21:21:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2E0E9D4DE3; Tue, 8 Dec 2015 21:21:49 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 919741287; Tue, 8 Dec 2015 21:21:49 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB8LLmv4059936; Tue, 8 Dec 2015 21:21:48 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB8LLmDL059933; Tue, 8 Dec 2015 21:21:48 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201512082121.tB8LLmDL059933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Tue, 8 Dec 2015 21:21:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292003 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 21:21:50 -0000 Author: hiren Date: Tue Dec 8 21:21:48 2015 New Revision: 292003 URL: https://svnweb.freebsd.org/changeset/base/292003 Log: One of the ways to detect loss is to count duplicate acks coming back from the other end till it reaches predetermined threshold which is 3 for us right now. Once that happens, we trigger fast-retransmit to do loss recovery. Main problem with the current implementation is that we don't honor SACK information well to detect whether an incoming ack is a dupack or not. RFC6675 has latest recommendations for that. According to it, dupack is a segment that arrives carrying a SACK block that identifies previously unknown information between snd_una and snd_max even if it carries new data, changes the advertised window, or moves the cumulative acknowledgment point. With the prevalence of Selective ACK (SACK) these days, improper handling can lead to delayed loss recovery. With the fix, new behavior looks like following: 0) th_ack < snd_una --> ignore Old acks are ignored. 1) th_ack == snd_una, !sack_changed --> ignore Acks with SACK enabled but without any new SACK info in them are ignored. 2) th_ack == snd_una, window == old_window --> increment Increment on a good dupack. 3) th_ack == snd_una, window != old_window, sack_changed --> increment When SACK enabled, it's okay to have advertized window changed if the ack has new SACK info. 4) th_ack > snd_una --> reset to 0 Reset to 0 when left edge moves. 5) th_ack > snd_una, sack_changed --> increment Increment if left edge moves but there is new SACK info. Here, sack_changed is the indicator that incoming ack has previously unknown SACK info in it. Note: This fix is not fully compliant to RFC6675. That may require a few changes to current implementation in order to keep per-sackhole dupack counter and change to the way we mark/handle sack holes. PR: 203663 Reviewed by: jtl MFC after: 3 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D4225 Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_sack.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Dec 8 20:20:40 2015 (r292002) +++ head/sys/netinet/tcp_input.c Tue Dec 8 21:21:48 2015 (r292003) @@ -1481,7 +1481,7 @@ tcp_do_segment(struct mbuf *m, struct tc struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos, int ti_locked) { - int thflags, acked, ourfinisacked, needoutput = 0; + int thflags, acked, ourfinisacked, needoutput = 0, sack_changed; int rstreason, todrop, win; u_long tiwin; char *s; @@ -1501,6 +1501,7 @@ tcp_do_segment(struct mbuf *m, struct tc thflags = th->th_flags; inc = &tp->t_inpcb->inp_inc; tp->sackhint.last_sack_ack = 0; + sack_changed = 0; /* * If this is either a state-changing packet or current state isn't @@ -2424,7 +2425,7 @@ tcp_do_segment(struct mbuf *m, struct tc if ((tp->t_flags & TF_SACK_PERMIT) && ((to.to_flags & TOF_SACK) || !TAILQ_EMPTY(&tp->snd_holes))) - tcp_sack_doack(tp, &to, th->th_ack); + sack_changed = tcp_sack_doack(tp, &to, th->th_ack); else /* * Reset the value so that previous (valid) value @@ -2436,7 +2437,9 @@ tcp_do_segment(struct mbuf *m, struct tc hhook_run_tcp_est_in(tp, th, &to); if (SEQ_LEQ(th->th_ack, tp->snd_una)) { - if (tlen == 0 && tiwin == tp->snd_wnd) { + if (tlen == 0 && + (tiwin == tp->snd_wnd || + (tp->t_flags & TF_SACK_PERMIT))) { /* * If this is the first time we've seen a * FIN from the remote, this is not a @@ -2478,8 +2481,20 @@ tcp_do_segment(struct mbuf *m, struct tc * When using TCP ECN, notify the peer that * we reduced the cwnd. */ - if (!tcp_timer_active(tp, TT_REXMT) || - th->th_ack != tp->snd_una) + /* + * Following 2 kinds of acks should not affect + * dupack counting: + * 1) Old acks + * 2) Acks with SACK but without any new SACK + * information in them. These could result from + * any anomaly in the network like a switch + * duplicating packets or a possible DoS attack. + */ + if (th->th_ack != tp->snd_una || + ((tp->t_flags & TF_SACK_PERMIT) && + !sack_changed)) + break; + else if (!tcp_timer_active(tp, TT_REXMT)) tp->t_dupacks = 0; else if (++tp->t_dupacks > tcprexmtthresh || IN_FASTRECOVERY(tp->t_flags)) { @@ -2608,9 +2623,20 @@ tcp_do_segment(struct mbuf *m, struct tc tp->snd_cwnd = oldcwnd; goto drop; } - } else - tp->t_dupacks = 0; + } break; + } else { + /* + * This ack is advancing the left edge, reset the + * counter. + */ + tp->t_dupacks = 0; + /* + * If this ack also has new SACK info, increment the + * counter as per rfc6675. + */ + if ((tp->t_flags & TF_SACK_PERMIT) && sack_changed) + tp->t_dupacks++; } KASSERT(SEQ_GT(th->th_ack, tp->snd_una), @@ -2629,7 +2655,6 @@ tcp_do_segment(struct mbuf *m, struct tc } else cc_post_recovery(tp, th); } - tp->t_dupacks = 0; /* * If we reach this point, ACK is not a duplicate, * i.e., it ACKs something we sent. Modified: head/sys/netinet/tcp_sack.c ============================================================================== --- head/sys/netinet/tcp_sack.c Tue Dec 8 20:20:40 2015 (r292002) +++ head/sys/netinet/tcp_sack.c Tue Dec 8 21:21:48 2015 (r292003) @@ -345,17 +345,22 @@ tcp_sackhole_remove(struct tcpcb *tp, st * Process cumulative ACK and the TCP SACK option to update the scoreboard. * tp->snd_holes is an ordered list of holes (oldest to newest, in terms of * the sequence space). + * Returns 1 if incoming ACK has previously unknown SACK information, + * 0 otherwise. Note: We treat (snd_una, th_ack) as a sack block so any changes + * to that (i.e. left edge moving) would also be considered a change in SACK + * information which is slightly different than rfc6675. */ -void +int tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) { struct sackhole *cur, *temp; struct sackblk sack, sack_blocks[TCP_MAX_SACK + 1], *sblkp; - int i, j, num_sack_blks; + int i, j, num_sack_blks, sack_changed; INP_WLOCK_ASSERT(tp->t_inpcb); num_sack_blks = 0; + sack_changed = 0; /* * If SND.UNA will be advanced by SEG.ACK, and if SACK holes exist, * treat [SND.UNA, SEG.ACK) as if it is a SACK block. @@ -392,7 +397,7 @@ tcp_sack_doack(struct tcpcb *tp, struct * received. */ if (num_sack_blks == 0) - return; + return (sack_changed); /* * Sort the SACK blocks so we can update the scoreboard with just one @@ -443,6 +448,7 @@ tcp_sack_doack(struct tcpcb *tp, struct tp->snd_fack = sblkp->end; /* Go to the previous sack block. */ sblkp--; + sack_changed = 1; } else { /* * We failed to add a new hole based on the current @@ -459,9 +465,11 @@ tcp_sack_doack(struct tcpcb *tp, struct SEQ_LT(tp->snd_fack, sblkp->end)) tp->snd_fack = sblkp->end; } - } else if (SEQ_LT(tp->snd_fack, sblkp->end)) + } else if (SEQ_LT(tp->snd_fack, sblkp->end)) { /* fack is advanced. */ tp->snd_fack = sblkp->end; + sack_changed = 1; + } /* We must have at least one SACK hole in scoreboard. */ KASSERT(!TAILQ_EMPTY(&tp->snd_holes), ("SACK scoreboard must not be empty")); @@ -490,6 +498,7 @@ tcp_sack_doack(struct tcpcb *tp, struct tp->sackhint.sack_bytes_rexmit -= (cur->rxmit - cur->start); KASSERT(tp->sackhint.sack_bytes_rexmit >= 0, ("sackhint bytes rtx >= 0")); + sack_changed = 1; if (SEQ_LEQ(sblkp->start, cur->start)) { /* Data acks at least the beginning of hole. */ if (SEQ_GEQ(sblkp->end, cur->end)) { @@ -545,6 +554,7 @@ tcp_sack_doack(struct tcpcb *tp, struct else sblkp--; } + return (sack_changed); } /* Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Dec 8 20:20:40 2015 (r292002) +++ head/sys/netinet/tcp_var.h Tue Dec 8 21:21:48 2015 (r292003) @@ -741,7 +741,7 @@ void tcp_hc_update(struct in_conninfo * extern struct pr_usrreqs tcp_usrreqs; tcp_seq tcp_new_isn(struct tcpcb *); -void tcp_sack_doack(struct tcpcb *, struct tcpopt *, tcp_seq); +int tcp_sack_doack(struct tcpcb *, struct tcpopt *, tcp_seq); void tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_laststart, tcp_seq rcv_lastend); void tcp_clean_sackreport(struct tcpcb *tp); void tcp_sack_adjust(struct tcpcb *tp); From owner-svn-src-all@freebsd.org Tue Dec 8 22:47:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EFC69D5C76; Tue, 8 Dec 2015 22:47:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 512ED115B; Tue, 8 Dec 2015 22:47:55 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB8Mls1q089833; Tue, 8 Dec 2015 22:47:54 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB8MlsCA089831; Tue, 8 Dec 2015 22:47:54 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512082247.tB8MlsCA089831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Tue, 8 Dec 2015 22:47:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292004 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 22:47:55 -0000 Author: ngie Date: Tue Dec 8 22:47:54 2015 New Revision: 292004 URL: https://svnweb.freebsd.org/changeset/base/292004 Log: Fix compilation when -DDEBUG is defined by adding inttypes.h #include for intmax_t MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D4434 Reported by: cppcheck Reviewed by: jhb Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/stdio/open_memstream.c head/lib/libc/stdio/open_wmemstream.c Modified: head/lib/libc/stdio/open_memstream.c ============================================================================== --- head/lib/libc/stdio/open_memstream.c Tue Dec 8 21:21:48 2015 (r292003) +++ head/lib/libc/stdio/open_memstream.c Tue Dec 8 22:47:54 2015 (r292004) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#ifdef DEBUG +#include +#endif #include #include #include Modified: head/lib/libc/stdio/open_wmemstream.c ============================================================================== --- head/lib/libc/stdio/open_wmemstream.c Tue Dec 8 21:21:48 2015 (r292003) +++ head/lib/libc/stdio/open_wmemstream.c Tue Dec 8 22:47:54 2015 (r292004) @@ -31,6 +31,9 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#ifdef DEBUG +#include +#endif #include #include #include From owner-svn-src-all@freebsd.org Wed Dec 9 01:24:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23EE39B7942; Wed, 9 Dec 2015 01:24:36 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB0001218; Wed, 9 Dec 2015 01:24:35 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB91OZ1T048828; Wed, 9 Dec 2015 01:24:35 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB91OZSU048827; Wed, 9 Dec 2015 01:24:35 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512090124.tB91OZSU048827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 9 Dec 2015 01:24:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292005 - head/sbin/swapon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 01:24:36 -0000 Author: ngie Date: Wed Dec 9 01:24:34 2015 New Revision: 292005 URL: https://svnweb.freebsd.org/changeset/base/292005 Log: Call va_end on ap when vsnprintf fails in run_cmd(..) to clean up the variable state MFC after: 1 week Reported by: cppcheck Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/swapon/swapon.c Modified: head/sbin/swapon/swapon.c ============================================================================== --- head/sbin/swapon/swapon.c Tue Dec 8 22:47:54 2015 (r292004) +++ head/sbin/swapon/swapon.c Wed Dec 9 01:24:34 2015 (r292005) @@ -642,6 +642,7 @@ run_cmd(int *ofd, const char *cmdline, . rv = vasprintf(&cmd, cmdline, ap); if (rv == -1) { warn("%s", __func__); + va_end(ap); return (rv); } va_end(ap); From owner-svn-src-all@freebsd.org Wed Dec 9 02:19:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4FE759D5557; Wed, 9 Dec 2015 02:19:05 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "asuka.mahoroba.org", Issuer "ca.mahoroba.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F2D371B2A; Wed, 9 Dec 2015 02:19:04 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from asuka.mahoroba.org (ume@ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) (user=ume mech=CRAM-MD5 bits=0) by mail.mahoroba.org (8.15.2/8.15.2) with ESMTPSA/inet6 id tB92IsYI033379 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Wed, 9 Dec 2015 11:18:58 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Wed, 09 Dec 2015 11:18:54 +0900 Message-ID: From: Hajimu UMEMOTO To: Eric van Gyzen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291994 - head/include In-Reply-To: <201512081609.tB8G9mfd053070@repo.freebsd.org> References: <201512081609.tB8G9mfd053070@repo.freebsd.org> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) Emacs/24.5 Mule/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 10.2-STABLE X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Wed, 09 Dec 2015 11:18:58 +0900 (JST) X-Virus-Scanned: clamav-milter 0.98.7 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-3.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on asuka.mahoroba.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 02:19:05 -0000 Hi, >>>>> On Tue, 8 Dec 2015 16:09:48 +0000 (UTC) >>>>> Eric van Gyzen said: vangyzen> Author: vangyzen vangyzen> Date: Tue Dec 8 16:09:48 2015 vangyzen> New Revision: 291994 vangyzen> URL: https://svnweb.freebsd.org/changeset/base/291994 vangyzen> Log: vangyzen> resolver: fix the build of some ports, broken by r289315 vangyzen> vangyzen> r289315 required time_t and struct timespec to be defined before vangyzen> including . This broke the build of net-mgmt/sx, at least. vangyzen> vangyzen> Include in resolv.h to fix this with minimal pollution. vangyzen> vangyzen> Reported by: Raphael Kubo da Costa vangyzen> MFC after: 3 days vangyzen> Sponsored by: Dell Inc. It seems wrong. We should not have pollution from timespec.h, here. You should consider moving them into __res_state_ext like NetBSD does. Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@FreeBSD.org http://www.mahoroba.org/~ume/ From owner-svn-src-all@freebsd.org Wed Dec 9 06:14:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8915C9D44D6; Wed, 9 Dec 2015 06:14:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4298A189A; Wed, 9 Dec 2015 06:14:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB96Emb8051742; Wed, 9 Dec 2015 06:14:48 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB96Emxo051738; Wed, 9 Dec 2015 06:14:48 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512090614.tB96Emxo051738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 9 Dec 2015 06:14:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292007 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 06:14:49 -0000 Author: arybchik Date: Wed Dec 9 06:14:47 2015 New Revision: 292007 URL: https://svnweb.freebsd.org/changeset/base/292007 Log: sfxge: [4/6] rework MCDI response polling Required for MCDI proxy authorization support. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4435 Modified: head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/hunt_mcdi.c head/sys/dev/sfxge/common/siena_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Wed Dec 9 05:35:46 2015 (r292006) +++ head/sys/dev/sfxge/common/efx_mcdi.c Wed Dec 9 06:14:47 2015 (r292007) @@ -228,6 +228,114 @@ efx_mcdi_request_start( emcop->emco_request_copyin(enp, emrp, seq, ev_cpl, new_epoch); } + + void +efx_mcdi_read_response_header( + __in efx_nic_t *enp, + __inout efx_mcdi_req_t *emrp) +{ +#if EFSYS_OPT_MCDI_LOGGING + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; +#endif /* EFSYS_OPT_MCDI_LOGGING */ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + efx_dword_t hdr[2]; + unsigned int hdr_len; + unsigned int data_len; + unsigned int seq; + unsigned int cmd; + unsigned int error; + efx_rc_t rc; + + EFSYS_ASSERT(emrp != NULL); + + emcop->emco_read_response(enp, &hdr[0], 0, sizeof (hdr[0])); + hdr_len = sizeof (hdr[0]); + + cmd = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE); + seq = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_SEQ); + error = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_ERROR); + + if (cmd != MC_CMD_V2_EXTN) { + data_len = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_DATALEN); + } else { + emcop->emco_read_response(enp, &hdr[1], hdr_len, + sizeof (hdr[1])); + hdr_len += sizeof (hdr[1]); + + cmd = EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_EXTENDED_CMD); + data_len = + EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_ACTUAL_LEN); + } + + if (error && (data_len == 0)) { + /* The MC has rebooted since the request was sent. */ + EFSYS_SPIN(EFX_MCDI_STATUS_SLEEP_US); + emcop->emco_poll_reboot(enp); + rc = EIO; + goto fail1; + } + if ((cmd != emrp->emr_cmd) || + (seq != ((emip->emi_seq - 1) & EFX_MASK32(MCDI_HEADER_SEQ)))) { + /* Response is for a different request */ + rc = EIO; + goto fail2; + } + if (error) { + efx_dword_t err[2]; + unsigned int err_len = MIN(data_len, sizeof (err)); + int err_code = MC_CMD_ERR_EPROTO; + int err_arg = 0; + + /* Read error code (and arg num for MCDI v2 commands) */ + emcop->emco_read_response(enp, &err, hdr_len, err_len); + + if (err_len >= (MC_CMD_ERR_CODE_OFST + sizeof (efx_dword_t))) + err_code = EFX_DWORD_FIELD(err[0], EFX_DWORD_0); +#ifdef WITH_MCDI_V2 + if (err_len >= (MC_CMD_ERR_ARG_OFST + sizeof (efx_dword_t))) + err_arg = EFX_DWORD_FIELD(err[1], EFX_DWORD_0); +#endif + emrp->emr_err_code = err_code; + emrp->emr_err_arg = err_arg; + +#if EFSYS_OPT_MCDI_LOGGING + if (emtp->emt_logger != NULL) { + emtp->emt_logger(emtp->emt_context, + EFX_LOG_MCDI_RESPONSE, + &hdr, hdr_len, + &err, err_len); + } +#endif /* EFSYS_OPT_MCDI_LOGGING */ + + if (!emrp->emr_quiet) { + EFSYS_PROBE3(mcdi_err_arg, int, emrp->emr_cmd, + int, err_code, int, err_arg); + } + + rc = efx_mcdi_request_errcode(err_code); + goto fail3; + } + + emrp->emr_rc = 0; + emrp->emr_out_length_used = data_len; + return; + +fail3: + if (!emrp->emr_quiet) + EFSYS_PROBE(fail3); +fail2: + if (!emrp->emr_quiet) + EFSYS_PROBE(fail2); +fail1: + if (!emrp->emr_quiet) + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + emrp->emr_rc = rc; + emrp->emr_out_length_used = 0; +} + + __checkReturn boolean_t efx_mcdi_request_poll( __in efx_nic_t *enp) Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Wed Dec 9 05:35:46 2015 (r292006) +++ head/sys/dev/sfxge/common/efx_mcdi.h Wed Dec 9 06:14:47 2015 (r292007) @@ -59,6 +59,9 @@ struct efx_mcdi_req_s { uint8_t *emr_out_buf; size_t emr_out_length; size_t emr_out_length_used; + /* Internals: low level transport details */ + unsigned int emr_err_code; + unsigned int emr_err_arg; }; typedef struct efx_mcdi_iface_s { @@ -82,6 +85,11 @@ efx_mcdi_execute_quiet( __in efx_nic_t *enp, __inout efx_mcdi_req_t *emrp); + extern void +efx_mcdi_read_response_header( + __in efx_nic_t *enp, + __inout efx_mcdi_req_t *emrp); + extern void efx_mcdi_ev_cpl( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Wed Dec 9 05:35:46 2015 (r292006) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Wed Dec 9 06:14:47 2015 (r292007) @@ -308,11 +308,6 @@ hunt_mcdi_request_poll( #endif /* EFSYS_OPT_MCDI_LOGGING */ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_mcdi_req_t *emrp; - efx_dword_t hdr[2]; - unsigned int hdr_len; - unsigned int data_len; - unsigned int seq; - unsigned int cmd; int state; efx_rc_t rc; @@ -332,101 +327,26 @@ hunt_mcdi_request_poll( } /* Read the response header */ - hdr_len = sizeof (hdr[0]); - hunt_mcdi_read_response(enp, &hdr[0], 0, hdr_len); - - if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE) == MC_CMD_V2_EXTN) { - hunt_mcdi_read_response(enp, &hdr[1], hdr_len, sizeof (hdr[1])); - hdr_len += sizeof (hdr[1]); - - cmd = EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_EXTENDED_CMD); - data_len = - EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_ACTUAL_LEN); - } else { - cmd = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE); - data_len = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_DATALEN); - } + efx_mcdi_read_response_header(enp, emrp); /* Request complete */ emip->emi_pending_req = NULL; - seq = (emip->emi_seq - 1) & EFX_MASK32(MCDI_HEADER_SEQ); - - /* Check for synchronous reboot */ - if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_ERROR) != 0 && data_len == 0) { - /* The MC has rebooted since the request was sent. */ - EFSYS_SPIN(EFX_MCDI_STATUS_SLEEP_US); - hunt_mcdi_poll_reboot(enp); - - EFSYS_UNLOCK(enp->en_eslp, state); - rc = EIO; - goto fail1; - } /* Ensure stale MCDI requests fail after an MC reboot. */ emip->emi_new_epoch = B_FALSE; EFSYS_UNLOCK(enp->en_eslp, state); - /* Check that the returned data is consistent */ - if (cmd != emrp->emr_cmd || - EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_SEQ) != seq) { - /* Response is for a different request */ - rc = EIO; - goto fail2; - } - if (EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_ERROR)) { - efx_dword_t err[2]; - unsigned int err_len = MIN(data_len, sizeof (err)); - int err_code = MC_CMD_ERR_EPROTO; - int err_arg = 0; - - /* Read error code (and arg num for MCDI v2 commands) */ - hunt_mcdi_read_response(enp, &err[0], hdr_len, err_len); - - if (err_len >= MC_CMD_ERR_CODE_OFST + sizeof (efx_dword_t)) - err_code = EFX_DWORD_FIELD(err[0], EFX_DWORD_0); - - if (err_len >= MC_CMD_ERR_ARG_OFST + sizeof (efx_dword_t)) - err_arg = EFX_DWORD_FIELD(err[1], EFX_DWORD_0); - -#if EFSYS_OPT_MCDI_LOGGING - if (emtp->emt_logger != NULL) { - emtp->emt_logger(emtp->emt_context, - EFX_LOG_MCDI_RESPONSE, - &hdr, hdr_len, - &err, err_len); - } -#endif /* EFSYS_OPT_MCDI_LOGGING */ - - rc = efx_mcdi_request_errcode(err_code); - if (!emrp->emr_quiet) { - EFSYS_PROBE3(mcdi_err_arg, int, emrp->emr_cmd, - int, err_code, int, err_arg); - } - goto fail3; - - } else { - emrp->emr_out_length_used = data_len; - emrp->emr_rc = 0; - hunt_mcdi_request_copyout(enp, emrp); - } + if ((rc = emrp->emr_rc) != 0) + goto fail1; + hunt_mcdi_request_copyout(enp, emrp); goto out; -fail3: - if (!emrp->emr_quiet) - EFSYS_PROBE(fail3); -fail2: - if (!emrp->emr_quiet) - EFSYS_PROBE(fail2); fail1: if (!emrp->emr_quiet) EFSYS_PROBE1(fail1, efx_rc_t, rc); - /* Fill out error state */ - emrp->emr_rc = rc; - emrp->emr_out_length_used = 0; - /* Reboot/Assertion */ if (rc == EIO || rc == EINTR) efx_mcdi_raise_exception(enp, emrp, rc); Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Wed Dec 9 05:35:46 2015 (r292006) +++ head/sys/dev/sfxge/common/siena_mcdi.c Wed Dec 9 06:14:47 2015 (r292007) @@ -222,15 +222,8 @@ siena_mcdi_read_response( siena_mcdi_request_poll( __in efx_nic_t *enp) { -#if EFSYS_OPT_MCDI_LOGGING - const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; -#endif efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_mcdi_req_t *emrp; - efx_dword_t hdr; - unsigned int hdr_len; - unsigned int data_len; - unsigned int seq; int state; efx_rc_t rc; @@ -260,76 +253,19 @@ siena_mcdi_request_poll( } /* Read the response header */ - hdr_len = sizeof (hdr); - siena_mcdi_read_response(enp, &hdr, 0, hdr_len); + efx_mcdi_read_response_header(enp, emrp); /* Request complete */ emip->emi_pending_req = NULL; - seq = (emip->emi_seq - 1) & EFX_MASK32(MCDI_HEADER_SEQ); - - /* Check for synchronous reboot */ - if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_ERROR) != 0 && - EFX_DWORD_FIELD(hdr, MCDI_HEADER_DATALEN) == 0) { - /* Consume status word */ - EFSYS_SPIN(EFX_MCDI_STATUS_SLEEP_US); - siena_mcdi_poll_reboot(enp); - EFSYS_UNLOCK(enp->en_eslp, state); - rc = EIO; - goto fail2; - } EFSYS_UNLOCK(enp->en_eslp, state); - /* Check that the returned data is consistent */ - if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_CODE) != emrp->emr_cmd || - EFX_DWORD_FIELD(hdr, MCDI_HEADER_SEQ) != seq) { - /* Response is for a different request */ - rc = EIO; - goto fail3; - } - - data_len = EFX_DWORD_FIELD(hdr, MCDI_HEADER_DATALEN); - if (EFX_DWORD_FIELD(hdr, MCDI_HEADER_ERROR)) { - efx_dword_t err; - int err_code = MC_CMD_ERR_EPROTO; - unsigned int err_len = MIN(data_len, sizeof (err)); - - /* Read error code */ - siena_mcdi_read_response(enp, &err, hdr_len, err_len); - - if (err_len >= MC_CMD_ERR_CODE_OFST + sizeof (efx_dword_t)) - err_code = EFX_DWORD_FIELD(err, EFX_DWORD_0); - -#if EFSYS_OPT_MCDI_LOGGING - if (emtp->emt_logger != NULL) { - emtp->emt_logger(emtp->emt_context, - EFX_LOG_MCDI_RESPONSE, - &hdr, hdr_len, - &err, err_len); - } -#endif /* EFSYS_OPT_MCDI_LOGGING */ - - rc = efx_mcdi_request_errcode(err_code); - if (!emrp->emr_quiet) { - EFSYS_PROBE2(mcdi_err, int, emrp->emr_cmd, - int, err_code); - } - goto fail4; - - } else { - emrp->emr_out_length_used = data_len; - emrp->emr_rc = 0; - siena_mcdi_request_copyout(enp, emrp); - } + if ((rc = emrp->emr_rc) != 0) + goto fail2; + siena_mcdi_request_copyout(enp, emrp); goto out; -fail4: - if (!emrp->emr_quiet) - EFSYS_PROBE(fail4); -fail3: - if (!emrp->emr_quiet) - EFSYS_PROBE(fail3); fail2: if (!emrp->emr_quiet) EFSYS_PROBE(fail2); @@ -337,10 +273,6 @@ fail1: if (!emrp->emr_quiet) EFSYS_PROBE1(fail1, efx_rc_t, rc); - /* Fill out error state */ - emrp->emr_rc = rc; - emrp->emr_out_length_used = 0; - /* Reboot/Assertion */ if (rc == EIO || rc == EINTR) efx_mcdi_raise_exception(enp, emrp, rc); From owner-svn-src-all@freebsd.org Wed Dec 9 06:24:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 492EA9D4B9E; Wed, 9 Dec 2015 06:24:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23DA41D60; Wed, 9 Dec 2015 06:24:24 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB96ONKe055033; Wed, 9 Dec 2015 06:24:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB96OMfH055028; Wed, 9 Dec 2015 06:24:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512090624.tB96OMfH055028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 9 Dec 2015 06:24:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292008 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 06:24:24 -0000 Author: arybchik Date: Wed Dec 9 06:24:22 2015 New Revision: 292008 URL: https://svnweb.freebsd.org/changeset/base/292008 Log: sfxge: use MAC spoofing TX and MAC change privileges Update of common code to provide a query on the MAC_SPOOFING_TX and CHANGE_MAC privileges instead of the deprecated MAC_SPOOFING privilege. Submitted by: Richard Houldsworth Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4436 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_mcdi.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Wed Dec 9 06:14:47 2015 (r292007) +++ head/sys/dev/sfxge/common/efx_impl.h Wed Dec 9 06:24:22 2015 (r292008) @@ -463,6 +463,7 @@ typedef struct efx_mcdi_ops_s { efx_rc_t (*emco_fw_update_supported)(efx_nic_t *, boolean_t *); efx_rc_t (*emco_macaddr_change_supported)(efx_nic_t *, boolean_t *); efx_rc_t (*emco_link_control_supported)(efx_nic_t *, boolean_t *); + efx_rc_t (*emco_mac_spoofing_supported)(efx_nic_t *, boolean_t *); void (*emco_read_response)(efx_nic_t *, void *, size_t, size_t); } efx_mcdi_ops_t; Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Wed Dec 9 06:14:47 2015 (r292007) +++ head/sys/dev/sfxge/common/efx_mcdi.c Wed Dec 9 06:24:22 2015 (r292008) @@ -55,6 +55,7 @@ static efx_mcdi_ops_t __efx_mcdi_siena_o /* emco_macaddr_change_supported */ siena_mcdi_link_control_supported, /* emco_link_control_supported */ + NULL, /* emco_mac_spoofing_supported */ siena_mcdi_read_response, /* emco_read_response */ }; @@ -74,6 +75,8 @@ static efx_mcdi_ops_t __efx_mcdi_hunt_op /* emco_macaddr_change_supported */ hunt_mcdi_link_control_supported, /* emco_link_control_supported */ + hunt_mcdi_mac_spoofing_supported, + /* emco_mac_spoofing_supported */ hunt_mcdi_read_response, /* emco_read_response */ }; @@ -1307,6 +1310,31 @@ fail1: return (rc); } + __checkReturn efx_rc_t +efx_mcdi_mac_spoofing_supported( + __in efx_nic_t *enp, + __out boolean_t *supportedp) +{ + efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + efx_rc_t rc; + + if (emcop != NULL && emcop->emco_mac_spoofing_supported != NULL) { + if ((rc = emcop->emco_mac_spoofing_supported(enp, supportedp)) + != 0) + goto fail1; + } else { + /* Earlier devices always supported MAC spoofing */ + *supportedp = B_TRUE; + } + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + #if EFSYS_OPT_BIST #if EFSYS_OPT_HUNTINGTON Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Wed Dec 9 06:14:47 2015 (r292007) +++ head/sys/dev/sfxge/common/efx_mcdi.h Wed Dec 9 06:24:22 2015 (r292008) @@ -164,6 +164,12 @@ efx_mcdi_link_control_supported( __in efx_nic_t *enp, __out boolean_t *supportedp); +extern __checkReturn efx_rc_t +efx_mcdi_mac_spoofing_supported( + __in efx_nic_t *enp, + __out boolean_t *supportedp); + + #if EFSYS_OPT_BIST #if EFSYS_OPT_HUNTINGTON extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Wed Dec 9 06:14:47 2015 (r292007) +++ head/sys/dev/sfxge/common/hunt_impl.h Wed Dec 9 06:24:22 2015 (r292008) @@ -298,6 +298,12 @@ hunt_mcdi_link_control_supported( __in efx_nic_t *enp, __out boolean_t *supportedp); +extern __checkReturn efx_rc_t +hunt_mcdi_mac_spoofing_supported( + __in efx_nic_t *enp, + __out boolean_t *supportedp); + + #endif /* EFSYS_OPT_MCDI */ /* NVRAM */ Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Wed Dec 9 06:14:47 2015 (r292007) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Wed Dec 9 06:24:22 2015 (r292008) @@ -435,9 +435,12 @@ hunt_mcdi_macaddr_change_supported( /* * Use privilege mask state at MCDI attach. * Admin privilege must be used prior to introduction of - * specific flag (at v4.6). + * mac spoofing privilege (at v4.6), which is used up to + * introduction of change mac spoofing privilege (at v4.7) */ *supportedp = + ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_CHANGE_MAC) == + MC_CMD_PRIVILEGE_MASK_IN_GRP_CHANGE_MAC) || ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) == MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) || ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) == @@ -447,6 +450,34 @@ hunt_mcdi_macaddr_change_supported( } __checkReturn efx_rc_t +hunt_mcdi_mac_spoofing_supported( + __in efx_nic_t *enp, + __out boolean_t *supportedp) +{ + efx_nic_cfg_t *encp = &(enp->en_nic_cfg); + uint32_t privilege_mask = encp->enc_privilege_mask; + + EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); + + /* + * Use privilege mask state at MCDI attach. + * Admin privilege must be used prior to introduction of + * mac spoofing privilege (at v4.6), which is used up to + * introduction of mac spoofing TX privilege (at v4.7) + */ + *supportedp = + ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING_TX) == + MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING_TX) || + ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) == + MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) || + ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) == + MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN); + + return (0); +} + + + __checkReturn efx_rc_t hunt_mcdi_link_control_supported( __in efx_nic_t *enp, __out boolean_t *supportedp) From owner-svn-src-all@freebsd.org Wed Dec 9 06:53:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED0B29D429F; Wed, 9 Dec 2015 06:53:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF91E1B65; Wed, 9 Dec 2015 06:53:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB96rhYi065289; Wed, 9 Dec 2015 06:53:43 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB96rhGm065288; Wed, 9 Dec 2015 06:53:43 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512090653.tB96rhGm065288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 9 Dec 2015 06:53:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292009 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 06:53:45 -0000 Author: arybchik Date: Wed Dec 9 06:53:43 2015 New Revision: 292009 URL: https://svnweb.freebsd.org/changeset/base/292009 Log: sfxge: cleanup: fix (unused) EFX_OR_BYTE macro Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_types.h Modified: head/sys/dev/sfxge/common/efx_types.h ============================================================================== --- head/sys/dev/sfxge/common/efx_types.h Wed Dec 9 06:24:22 2015 (r292008) +++ head/sys/dev/sfxge/common/efx_types.h Wed Dec 9 06:53:43 2015 (r292009) @@ -1584,7 +1584,7 @@ extern int fix_lint; #define EFX_OR_BYTE(_byte1, _byte2) \ do { \ - (_byte1).eb_u8[0] &= (_byte2).eb_u8[0]; \ + (_byte1).eb_u8[0] |= (_byte2).eb_u8[0]; \ _NOTE(CONSTANTCONDITION) \ } while (B_FALSE) From owner-svn-src-all@freebsd.org Wed Dec 9 06:59:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F23D9D46A7; Wed, 9 Dec 2015 06:59:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0EF181E69; Wed, 9 Dec 2015 06:59:05 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB96x5lN065958; Wed, 9 Dec 2015 06:59:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB96x5mU065957; Wed, 9 Dec 2015 06:59:05 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512090659.tB96x5mU065957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Wed, 9 Dec 2015 06:59:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292010 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 06:59:06 -0000 Author: arybchik Date: Wed Dec 9 06:59:04 2015 New Revision: 292010 URL: https://svnweb.freebsd.org/changeset/base/292010 Log: sfxge: cleanup: removed unused variable Submitted by: Artem V. Andreev Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/hunt_mcdi.c Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Wed Dec 9 06:53:43 2015 (r292009) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Wed Dec 9 06:59:04 2015 (r292010) @@ -303,9 +303,6 @@ hunt_mcdi_read_response( hunt_mcdi_request_poll( __in efx_nic_t *enp) { -#if EFSYS_OPT_MCDI_LOGGING - const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; -#endif /* EFSYS_OPT_MCDI_LOGGING */ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_mcdi_req_t *emrp; int state; From owner-svn-src-all@freebsd.org Wed Dec 9 07:24:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12C749D5B00; Wed, 9 Dec 2015 07:24:06 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id D2DB71FD7; Wed, 9 Dec 2015 07:24:05 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id B5925784246; Wed, 9 Dec 2015 18:23:56 +1100 (AEDT) Date: Wed, 9 Dec 2015 18:23:55 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292004 - head/lib/libc/stdio In-Reply-To: <201512082247.tB8MlsCA089831@repo.freebsd.org> Message-ID: <20151209181941.U828@besplex.bde.org> References: <201512082247.tB8MlsCA089831@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=yCG875MZJiR4Ts98eJ8A:9 a=CjuIK1q_8ugA:10 a=BlQZbRTH8HgA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 07:24:06 -0000 On Tue, 8 Dec 2015, Garrett Cooper wrote: > Author: ngie > ... > > Log: > Fix compilation when -DDEBUG is defined by adding inttypes.h #include > for intmax_t Wrong include. intmax_t is declared in . declares much more and is usually only needed for functions like strtoimax(). also declares PRI* and SCN*, but those are only needed in the garbage. Bruce From owner-svn-src-all@freebsd.org Wed Dec 9 07:41:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED83C9D45EC; Wed, 9 Dec 2015 07:41:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 99BCF185C; Wed, 9 Dec 2015 07:41:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 73149D661D3; Wed, 9 Dec 2015 18:19:16 +1100 (AEDT) Date: Wed, 9 Dec 2015 18:19:16 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hajimu UMEMOTO cc: Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291994 - head/include In-Reply-To: Message-ID: <20151209173008.A828@besplex.bde.org> References: <201512081609.tB8G9mfd053070@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=cK4dyQqN c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=83ALluLP3N0ylTbsE7QA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 07:41:49 -0000 On Wed, 9 Dec 2015, Hajimu UMEMOTO wrote: > Hi, > >>>>>> On Tue, 8 Dec 2015 16:09:48 +0000 (UTC) >>>>>> Eric van Gyzen said: > ... > vangyzen> Log: > vangyzen> resolver: fix the build of some ports, broken by r289315 > vangyzen> > vangyzen> r289315 required time_t and struct timespec to be defined before > vangyzen> including . This broke the build of net-mgmt/sx, at least. > vangyzen> > vangyzen> Include in resolv.h to fix this with minimal pollution. > ... > It seems wrong. We should not have pollution from timespec.h, here. > You should consider moving them into __res_state_ext like NetBSD does. resolv.h already had massinve namespace pollution and style bugs in its includes. One more include of a header that is relatively clean since it is tiny and was designed for minimising namespace pollution makes little difference. Old namespace pollution and style bugs: X #include This includes the kitchen sink via nested includes (not as many as in the kernel). Almost none of its namespace is documented. Even the names that it is supposed to define are mostly undocumented, so no one knows what these are. X #include This was already included recursively at least ones. style(9) explicitly forbids including this again. X #include This was already included recursively approximitately times. Include guards actually prevent it being parsed more than the first time. This is the only included header that is supposed to have no namespace pollution. style(9) has less to say about this. It makes more sense to include it first, and that is the correct style (for __FBSDID) in .c files. Headers with no pollution usually need to include it directly. Others should depend on primary headers like including it. X #include X #include X #include Further pollution. sys/timespec.h adds to this just: Y #include Example of a correct use of sys/cdefs.h. It is to get the definition of __BSD_VISIBLE. However, use of that is bogus. Y #include sys/_timespec was originally correctly designed have no namespace pollution. It declared a struct __timespec and use __time_t in it, since timespec and time_t would be namespace pollution in some cases. It should be included in places like where __timespec etc. would be pollution. sys/timespec.h was originally correctly designed turn __timespec into timespec and __time_t into timespec (except it also defines the bogus conversion macros -- see below). It should be included in the very few places where __timespec would not be pollution in any supported version, and for traditional pollution in places like time.h. Using these little headers is delicate and usually does nothing except increase compilation times by including both of them nested. Having 2 for just struct timespec was a bit much, and has been turned into nonsense. Someone changed __timespec to timespec and __time_t to time.h in _timespec.h, and removed the careful anti-pollution ifdefs in , with the justification that timespec is now standard in POSIX. But it isn't standard in old versions of POSIX. So this change mainly broke and turned _timespec.h's existence into nonsense. It didn't break much else since not much else was careful about this. POSIX now requires timespec to be declared in many headers and allows but doesn't require it to be declared (as pollution) in many others. Y Y #if __BSD_VISIBLE Y #define TIMEVAL_TO_TIMESPEC(tv, ts) \ Y do { \ Y (ts)->tv_sec = (tv)->tv_sec; \ Y (ts)->tv_nsec = (tv)->tv_usec * 1000; \ Y } while (0) Y #define TIMESPEC_TO_TIMEVAL(tv, ts) \ Y do { \ Y (tv)->tv_sec = (ts)->tv_sec; \ Y (tv)->tv_usec = (ts)->tv_nsec / 1000; \ Y } while (0) Y Y #endif /* __BSD_VISIBLE */ These macros are bogus. They are bad enough in the kernel. Of course they are not documented in any man page. sys/timespec.h was original clean except for defining these. Y Y /* Y * Structure defined by POSIX.1b to be like a itimerval, but with Y * timespecs. Used in the timer_*() system calls. Y */ Y struct itimerspec { Y struct timespec it_interval; Y struct timespec it_value; Y }; This pollution was added later. It turns timespec.h into half-nonsense. timespec.h was supposed to match its name and declare only struct timespec. The pollution here implements the POSIX requirement that struct itimerspec is declared in . and have much worse namespace and organization problems than resolv.h. There is also sys/_timeval.h which does for timevals what sys/timespec.h should do for timespecs. It is relatively simple and clean. In fact, it has always been almost as perfect as possible except for its name -- it is unnecessary and confusing for it to be named with an underscore, especially when the corresponding file for timespecs is not named with an underscore. Bruce From owner-svn-src-all@freebsd.org Wed Dec 9 07:56:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8FD59D5243; Wed, 9 Dec 2015 07:56:41 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C1301018; Wed, 9 Dec 2015 07:56:41 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB97ueDi084340; Wed, 9 Dec 2015 07:56:40 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB97uevp084339; Wed, 9 Dec 2015 07:56:40 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201512090756.tB97uevp084339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Wed, 9 Dec 2015 07:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292011 - head/sys/netinet/cc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 07:56:41 -0000 Author: hiren Date: Wed Dec 9 07:56:40 2015 New Revision: 292011 URL: https://svnweb.freebsd.org/changeset/base/292011 Log: Add an option to use rfc6675 based pipe/inflight bytes calculation in cubic. Reviewed by: gnn MFC after: 3 weeks Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D4205 Modified: head/sys/netinet/cc/cc_cubic.c Modified: head/sys/netinet/cc/cc_cubic.c ============================================================================== --- head/sys/netinet/cc/cc_cubic.c Wed Dec 9 06:59:04 2015 (r292010) +++ head/sys/netinet/cc/cc_cubic.c Wed Dec 9 07:56:40 2015 (r292011) @@ -299,8 +299,10 @@ static void cubic_post_recovery(struct cc_var *ccv) { struct cubic *cubic_data; + int pipe; cubic_data = ccv->cc_data; + pipe = 0; /* Fast convergence heuristic. */ if (cubic_data->max_cwnd < cubic_data->prev_max_cwnd) @@ -315,10 +317,13 @@ cubic_post_recovery(struct cc_var *ccv) * * XXXLAS: Find a way to do this without needing curack */ - if (SEQ_GT(ccv->curack + CCV(ccv, snd_ssthresh), - CCV(ccv, snd_max))) - CCV(ccv, snd_cwnd) = CCV(ccv, snd_max) - ccv->curack + - CCV(ccv, t_maxseg); + if (V_tcp_do_rfc6675_pipe) + pipe = tcp_compute_pipe(ccv->ccvc.tcp); + else + pipe = CCV(ccv, snd_max) - ccv->curack; + + if (pipe < CCV(ccv, snd_ssthresh)) + CCV(ccv, snd_cwnd) = pipe + CCV(ccv, t_maxseg); else /* Update cwnd based on beta and adjusted max_cwnd. */ CCV(ccv, snd_cwnd) = max(1, ((CUBIC_BETA * From owner-svn-src-all@freebsd.org Wed Dec 9 08:19:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FA559C1547; Wed, 9 Dec 2015 08:19:43 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-oi0-x229.google.com (mail-oi0-x229.google.com [IPv6:2607:f8b0:4003:c06::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E160E1DB8; Wed, 9 Dec 2015 08:19:42 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by oiww189 with SMTP id w189so22911812oiw.3; Wed, 09 Dec 2015 00:19:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Y4Ko5+AOXquKIMhzLV5Dqa/bjKKxY3lrlDNXEOBxFco=; b=KS07oZR+aLnpUnVbM/MLj4aJet2ZRc6sx+NZhVUnjnsKtpbAsNNBv0hPKwo4AvLlqz VSjntN8N5dcR0UsI8ubivYv4Y+kVLzuUJOkF7KCELDwe0V8/IBSfJKT7pps6Nb5bNn+R HSuxIHL9KbVQyY+n102TLZGDQn8/aiqpW9bg56L1OVgBbADwodDM4ZbCEuWOtZbdUDPz K6Rk34iTzsaAubXH9h6cVq6MEy17eopOUMPjm25jHO3+gMCN88oMKQ9bu19Ia0kZvBGF KiiEhMk9NI6G+9OQwBOQhLtcV47LJqqrdnPoLVrR6r/fPRIARPY1vNZXErDWcVCfuKgt fmew== X-Received: by 10.202.214.131 with SMTP id n125mr2766094oig.104.1449649182214; Wed, 09 Dec 2015 00:19:42 -0800 (PST) Received: from [100.83.241.107] ([172.56.7.104]) by smtp.gmail.com with ESMTPSA id s7sm3152709obk.17.2015.12.09.00.19.40 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Dec 2015 00:19:40 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r292004 - head/lib/libc/stdio From: Garrett Cooper X-Mailer: iPhone Mail (13B143) In-Reply-To: <20151209181941.U828@besplex.bde.org> Date: Wed, 9 Dec 2015 00:19:39 -0800 Cc: Garrett Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: 7bit Message-Id: <4643B6B1-FF2F-4D76-B2E8-9DDF3E81E844@gmail.com> References: <201512082247.tB8MlsCA089831@repo.freebsd.org> <20151209181941.U828@besplex.bde.org> To: Bruce Evans X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 08:19:43 -0000 > On Dec 8, 2015, at 23:23, Bruce Evans wrote: > >> On Tue, 8 Dec 2015, Garrett Cooper wrote: >> >> Author: ngie >> ... >> >> Log: >> Fix compilation when -DDEBUG is defined by adding inttypes.h #include >> for intmax_t > > Wrong include. intmax_t is declared in . declares > much more and is usually only needed for functions like strtoimax(). > also declares PRI* and SCN*, but those are only needed in > the garbage. Whups... You're right >.<.. From owner-svn-src-all@freebsd.org Wed Dec 9 08:53:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A6E09D4300; Wed, 9 Dec 2015 08:53:43 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE1051170; Wed, 9 Dec 2015 08:53:42 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB98rfC5001497; Wed, 9 Dec 2015 08:53:41 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB98rfJU001496; Wed, 9 Dec 2015 08:53:41 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201512090853.tB98rfJU001496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Wed, 9 Dec 2015 08:53:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292012 - head/sys/netinet/cc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 08:53:43 -0000 Author: hiren Date: Wed Dec 9 08:53:41 2015 New Revision: 292012 URL: https://svnweb.freebsd.org/changeset/base/292012 Log: Add an option to use rfc6675 based pipe/inflight bytes calculation in newreno. MFC after: 3 weeks Sponsored by: Limelight Networks Modified: head/sys/netinet/cc/cc_newreno.c Modified: head/sys/netinet/cc/cc_newreno.c ============================================================================== --- head/sys/netinet/cc/cc_newreno.c Wed Dec 9 07:56:40 2015 (r292011) +++ head/sys/netinet/cc/cc_newreno.c Wed Dec 9 08:53:41 2015 (r292012) @@ -214,6 +214,9 @@ newreno_cong_signal(struct cc_var *ccv, static void newreno_post_recovery(struct cc_var *ccv) { + int pipe; + pipe = 0; + if (IN_FASTRECOVERY(CCV(ccv, t_flags))) { /* * Fast recovery will conclude after returning from this @@ -224,10 +227,13 @@ newreno_post_recovery(struct cc_var *ccv * * XXXLAS: Find a way to do this without needing curack */ - if (SEQ_GT(ccv->curack + CCV(ccv, snd_ssthresh), - CCV(ccv, snd_max))) - CCV(ccv, snd_cwnd) = CCV(ccv, snd_max) - - ccv->curack + CCV(ccv, t_maxseg); + if (V_tcp_do_rfc6675_pipe) + pipe = tcp_compute_pipe(ccv->ccvc.tcp); + else + pipe = CCV(ccv, snd_max) - ccv->curack; + + if (pipe < CCV(ccv, snd_ssthresh)) + CCV(ccv, snd_cwnd) = pipe + CCV(ccv, t_maxseg); else CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); } From owner-svn-src-all@freebsd.org Wed Dec 9 09:14:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F2D59D55D4; Wed, 9 Dec 2015 09:14:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1FFE21D68; Wed, 9 Dec 2015 09:14:59 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB99Ew4V007364; Wed, 9 Dec 2015 09:14:58 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB99EwAs007362; Wed, 9 Dec 2015 09:14:58 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512090914.tB99EwAs007362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Wed, 9 Dec 2015 09:14:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292013 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 09:14:59 -0000 Author: ngie Date: Wed Dec 9 09:14:57 2015 New Revision: 292013 URL: https://svnweb.freebsd.org/changeset/base/292013 Log: Use stdint.h instead of inttypes.h as the latter pollutes namespace more MFC after: 3 days X-MFC with: r292004 Submitted by: bde Sponsored by: EMC / Isilon Storage Division Modified: head/lib/libc/stdio/open_memstream.c head/lib/libc/stdio/open_wmemstream.c Modified: head/lib/libc/stdio/open_memstream.c ============================================================================== --- head/lib/libc/stdio/open_memstream.c Wed Dec 9 08:53:41 2015 (r292012) +++ head/lib/libc/stdio/open_memstream.c Wed Dec 9 09:14:57 2015 (r292013) @@ -31,10 +31,10 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #ifdef DEBUG -#include +#include #endif -#include #include #include #include Modified: head/lib/libc/stdio/open_wmemstream.c ============================================================================== --- head/lib/libc/stdio/open_wmemstream.c Wed Dec 9 08:53:41 2015 (r292012) +++ head/lib/libc/stdio/open_wmemstream.c Wed Dec 9 09:14:57 2015 (r292013) @@ -31,10 +31,10 @@ __FBSDID("$FreeBSD$"); #include "namespace.h" #include #include +#include #ifdef DEBUG -#include +#include #endif -#include #include #include #include From owner-svn-src-all@freebsd.org Wed Dec 9 09:29:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3099C9D4091; Wed, 9 Dec 2015 09:29:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0C24613D7; Wed, 9 Dec 2015 09:29:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB99TdjA010385; Wed, 9 Dec 2015 09:29:39 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB99Tc0E010380; Wed, 9 Dec 2015 09:29:38 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201512090929.tB99Tc0E010380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 9 Dec 2015 09:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292014 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 09:29:40 -0000 Author: avos Date: Wed Dec 9 09:29:38 2015 New Revision: 292014 URL: https://svnweb.freebsd.org/changeset/base/292014 Log: urtwn: add WME support Tested with: - RTL8188CUS, HOSTAP mode. - RTL8188EU, STA mode. Reviewed by: kevlo Approved by: adrian (mentor) Differential Revision: https://reviews.freebsd.org/D4020 Modified: head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_urtwnreg.h head/sys/dev/usb/wlan/if_urtwnvar.h Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Wed Dec 9 09:14:57 2015 (r292013) +++ head/sys/dev/usb/wlan/if_urtwn.c Wed Dec 9 09:29:38 2015 (r292014) @@ -291,6 +291,7 @@ static void urtwn_set_gain(struct urtwn static void urtwn_scan_start(struct ieee80211com *); static void urtwn_scan_end(struct ieee80211com *); static void urtwn_set_channel(struct ieee80211com *); +static int urtwn_wme_update(struct ieee80211com *); static void urtwn_set_promisc(struct urtwn_softc *); static void urtwn_update_promisc(struct ieee80211com *); static void urtwn_update_mcast(struct ieee80211com *); @@ -376,6 +377,16 @@ static const struct usb_config urtwn_con }, }; +static const struct wme_to_queue { + uint16_t reg; + uint8_t qid; +} wme2queue[WME_NUM_AC] = { + { R92C_EDCA_BE_PARAM, URTWN_BULK_TX_BE}, + { R92C_EDCA_BK_PARAM, URTWN_BULK_TX_BK}, + { R92C_EDCA_VI_PARAM, URTWN_BULK_TX_VI}, + { R92C_EDCA_VO_PARAM, URTWN_BULK_TX_VO} +}; + static int urtwn_match(device_t self) { @@ -473,6 +484,7 @@ urtwn_attach(device_t self) | IEEE80211_C_SHSLOT /* short slot time supported */ | IEEE80211_C_BGSCAN /* capable of bg scanning */ | IEEE80211_C_WPA /* 802.11i */ + | IEEE80211_C_WME /* 802.11e */ ; bands = 0; @@ -489,6 +501,7 @@ urtwn_attach(device_t self) ic->ic_parent = urtwn_parent; ic->ic_vap_create = urtwn_vap_create; ic->ic_vap_delete = urtwn_vap_delete; + ic->ic_wme.wme_update = urtwn_wme_update; ic->ic_update_promisc = urtwn_update_promisc; ic->ic_update_mcast = urtwn_update_mcast; @@ -2158,8 +2171,8 @@ urtwn_tx_data(struct urtwn_softc *sc, st struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = ni->ni_vap; struct r92c_tx_desc *txd; - uint8_t macid, raid, ridx, subtype, type, qsel; - int ismcast; + uint8_t macid, raid, ridx, subtype, type, tid, qsel; + int hasqos, ismcast; URTWN_ASSERT_LOCKED(sc); @@ -2169,8 +2182,16 @@ urtwn_tx_data(struct urtwn_softc *sc, st wh = mtod(m, struct ieee80211_frame *); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; + hasqos = IEEE80211_QOS_HAS_SEQ(wh); ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); + /* Select TX ring for this frame. */ + if (hasqos) { + tid = ((const struct ieee80211_qosframe *)wh)->i_qos[0]; + tid &= IEEE80211_QOS_TID; + } else + tid = 0; + if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { k = ieee80211_crypto_encap(ni, m); if (k == NULL) { @@ -2199,7 +2220,7 @@ urtwn_tx_data(struct urtwn_softc *sc, st macid = URTWN_MACID_BSS; if (type == IEEE80211_FC0_TYPE_DATA) { - qsel = R92C_TXDW1_QSEL_BE; + qsel = tid % URTWN_MAX_TID; if (!(m->m_flags & M_EAPOL)) { if (ic->ic_curmode != IEEE80211_MODE_11B) { @@ -2255,7 +2276,7 @@ urtwn_tx_data(struct urtwn_softc *sc, st (m->m_flags & M_EAPOL)) txd->txdw4 |= htole32(R92C_TXDW4_DRVRATE); - if (!IEEE80211_QOS_HAS_SEQ(wh)) { + if (!hasqos) { /* Use HW sequence numbering for non-QoS frames. */ if (sc->chip & URTWN_CHIP_88E) txd->txdseq = htole16(R88E_TXDSEQ_HWSEQ_EN); @@ -2292,12 +2313,6 @@ urtwn_tx_start(struct urtwn_softc *sc, s struct r92c_tx_desc *txd; uint16_t ac, sum; int i, xferlen; - struct usb_xfer *urtwn_pipes[WME_NUM_AC] = { - sc->sc_xfer[URTWN_BULK_TX_BE], - sc->sc_xfer[URTWN_BULK_TX_BK], - sc->sc_xfer[URTWN_BULK_TX_VI], - sc->sc_xfer[URTWN_BULK_TX_VO] - }; URTWN_ASSERT_LOCKED(sc); @@ -2309,7 +2324,7 @@ urtwn_tx_start(struct urtwn_softc *sc, s xfer = sc->sc_xfer[URTWN_BULK_TX_VO]; break; default: - xfer = urtwn_pipes[ac]; + xfer = sc->sc_xfer[wme2queue[ac].qid]; break; } @@ -3598,6 +3613,43 @@ urtwn_set_channel(struct ieee80211com *i URTWN_UNLOCK(sc); } +static int +urtwn_wme_update(struct ieee80211com *ic) +{ + const struct wmeParams *wmep = + ic->ic_wme.wme_chanParams.cap_wmeParams; + struct urtwn_softc *sc = ic->ic_softc; + uint8_t aifs, acm, slottime; + int ac; + + acm = 0; + slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? + IEEE80211_DUR_SHSLOT : IEEE80211_DUR_SLOT; + + URTWN_LOCK(sc); + for (ac = WME_AC_BE; ac < WME_NUM_AC; ac++) { + /* AIFS[AC] = AIFSN[AC] * aSlotTime + aSIFSTime. */ + aifs = wmep[ac].wmep_aifsn * slottime + IEEE80211_DUR_SIFS; + urtwn_write_4(sc, wme2queue[ac].reg, + SM(R92C_EDCA_PARAM_TXOP, wmep[ac].wmep_txopLimit) | + SM(R92C_EDCA_PARAM_ECWMIN, wmep[ac].wmep_logcwmin) | + SM(R92C_EDCA_PARAM_ECWMAX, wmep[ac].wmep_logcwmax) | + SM(R92C_EDCA_PARAM_AIFS, aifs)); + if (ac != WME_AC_BE) + acm |= wmep[ac].wmep_acm << ac; + } + + if (acm != 0) + acm |= R92C_ACMHWCTRL_EN; + urtwn_write_1(sc, R92C_ACMHWCTRL, + (urtwn_read_1(sc, R92C_ACMHWCTRL) & ~R92C_ACMHWCTRL_ACM_MASK) | + acm); + + URTWN_UNLOCK(sc); + + return 0; +} + static void urtwn_set_promisc(struct urtwn_softc *sc) { Modified: head/sys/dev/usb/wlan/if_urtwnreg.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnreg.h Wed Dec 9 09:14:57 2015 (r292013) +++ head/sys/dev/usb/wlan/if_urtwnreg.h Wed Dec 9 09:29:38 2015 (r292014) @@ -503,6 +503,13 @@ #define R92C_DUAL_TSF_RST0 0x01 #define R92C_DUAL_TSF_RST1 0x02 +/* Bits for R92C_ACMHWCTRL. */ +#define R92C_ACMHWCTRL_EN 0x01 +#define R92C_ACMHWCTRL_BE 0x02 +#define R92C_ACMHWCTRL_VI 0x04 +#define R92C_ACMHWCTRL_VO 0x08 +#define R92C_ACMHWCTRL_ACM_MASK 0x0f + /* Bits for R92C_APSD_CTRL. */ #define R92C_APSD_CTRL_OFF 0x40 #define R92C_APSD_CTRL_OFF_STATUS 0x80 Modified: head/sys/dev/usb/wlan/if_urtwnvar.h ============================================================================== --- head/sys/dev/usb/wlan/if_urtwnvar.h Wed Dec 9 09:14:57 2015 (r292013) +++ head/sys/dev/usb/wlan/if_urtwnvar.h Wed Dec 9 09:29:38 2015 (r292014) @@ -140,7 +140,6 @@ struct urtwn_softc { struct usb_device *sc_udev; uint8_t sc_iface_index; - int ac2idx[WME_NUM_AC]; u_int sc_flags; #define URTWN_FLAG_CCK_HIPWR 0x01 #define URTWN_DETACHED 0x02 From owner-svn-src-all@freebsd.org Wed Dec 9 10:01:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8737A9D5A7C; Wed, 9 Dec 2015 10:01:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id 503061968; Wed, 9 Dec 2015 10:01:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 1CD49D67C43; Wed, 9 Dec 2015 21:01:46 +1100 (AEDT) Date: Wed, 9 Dec 2015 21:01:45 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Garrett Cooper cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292013 - head/lib/libc/stdio In-Reply-To: <201512090914.tB99EwAs007362@repo.freebsd.org> Message-ID: <20151209203618.T1380@besplex.bde.org> References: <201512090914.tB99EwAs007362@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=djVK2TH9jLp6Hl4seLUA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 10:01:49 -0000 On Wed, 9 Dec 2015, Garrett Cooper wrote: > Log: > ... > Use stdint.h instead of inttypes.h as the latter pollutes namespace more > ... > Modified: head/lib/libc/stdio/open_memstream.c > ============================================================================== > --- head/lib/libc/stdio/open_memstream.c Wed Dec 9 08:53:41 2015 (r292012) > +++ head/lib/libc/stdio/open_memstream.c Wed Dec 9 09:14:57 2015 (r292013) > @@ -31,10 +31,10 @@ __FBSDID("$FreeBSD$"); > #include "namespace.h" > #include > #include > +#include > #ifdef DEBUG > -#include > +#include > #endif > -#include > #include > #include > #include Thanks. It wou;d be noice to fix some other cases of excessive includes. There aren't many for newer headers like stdint.h and inttypes.h. Bruce From owner-svn-src-all@freebsd.org Wed Dec 9 11:14:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED3449D50E2; Wed, 9 Dec 2015 11:14:29 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BF35A1FB8; Wed, 9 Dec 2015 11:14:29 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9BETVM042468; Wed, 9 Dec 2015 11:14:29 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9BER6u042457; Wed, 9 Dec 2015 11:14:27 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201512091114.tB9BER6u042457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 9 Dec 2015 11:14:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292015 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 11:14:30 -0000 Author: melifaro Date: Wed Dec 9 11:14:27 2015 New Revision: 292015 URL: https://svnweb.freebsd.org/changeset/base/292015 Log: Make in_arpinput(), inp_lookup_mcast_ifp(), icmp_reflect(), ip_dooptions(), icmp6_redirect_input(), in6_lltable_rtcheck(), in6p_lookup_mcast_ifp() and in6_selecthlim() use new routing api. Eliminate now-unused ip_rtaddr(). Fix lookup key fib6_lookup_nh_basic() which was lost diring merge. Make fib6_lookup_nh_basic() and fib6_lookup_nh_extended() always return IPv6 destination address with embedded scope. Currently rw_gateway has it scope embedded, do the same for non-gatewayed destinations. Sponsored by: Yandex LLC Modified: head/sys/netinet/if_ether.c head/sys/netinet/in_mcast.c head/sys/netinet/ip_icmp.c head/sys/netinet/ip_input.c head/sys/netinet/ip_options.c head/sys/netinet/ip_var.h head/sys/netinet6/icmp6.c head/sys/netinet6/in6.c head/sys/netinet6/in6_fib.c head/sys/netinet6/in6_mcast.c head/sys/netinet6/in6_src.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Wed Dec 9 09:29:38 2015 (r292014) +++ head/sys/netinet/if_ether.c Wed Dec 9 11:14:27 2015 (r292015) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -671,7 +672,6 @@ in_arpinput(struct mbuf *m) struct arphdr *ah; struct ifnet *ifp = m->m_pkthdr.rcvif; struct llentry *la = NULL, *la_tmp; - struct rtentry *rt; struct ifaddr *ifa; struct in_ifaddr *ia; struct sockaddr sa; @@ -682,6 +682,8 @@ in_arpinput(struct mbuf *m) int carped; struct sockaddr_in sin; struct sockaddr *dst; + struct nhop4_basic nh4; + sin.sin_len = sizeof(struct sockaddr_in); sin.sin_family = AF_INET; sin.sin_addr.s_addr = 0; @@ -921,10 +923,8 @@ reply: if (!V_arp_proxyall) goto drop; - sin.sin_addr = itaddr; /* XXX MRT use table 0 for arp reply */ - rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); - if (!rt) + if (fib4_lookup_nh_basic(0, itaddr, 0, 0, &nh4) != 0) goto drop; /* @@ -932,11 +932,8 @@ reply: * as this one came out of, or we'll get into a fight * over who claims what Ether address. */ - if (!rt->rt_ifp || rt->rt_ifp == ifp) { - RTFREE_LOCKED(rt); + if (nh4.nh_ifp == ifp) goto drop; - } - RTFREE_LOCKED(rt); (void)memcpy(ar_tha(ah), ar_sha(ah), ah->ar_hln); (void)memcpy(ar_sha(ah), enaddr, ah->ar_hln); @@ -947,21 +944,16 @@ reply: * avoids ARP chaos if an interface is connected to the * wrong network. */ - sin.sin_addr = isaddr; /* XXX MRT use table 0 for arp checks */ - rt = in_rtalloc1((struct sockaddr *)&sin, 0, 0UL, 0); - if (!rt) + if (fib4_lookup_nh_basic(0, isaddr, 0, 0, &nh4) != 0) goto drop; - if (rt->rt_ifp != ifp) { + if (nh4.nh_ifp != ifp) { ARP_LOG(LOG_INFO, "proxy: ignoring request" - " from %s via %s, expecting %s\n", - inet_ntoa(isaddr), ifp->if_xname, - rt->rt_ifp->if_xname); - RTFREE_LOCKED(rt); + " from %s via %s\n", + inet_ntoa(isaddr), ifp->if_xname); goto drop; } - RTFREE_LOCKED(rt); #ifdef DEBUG_PROXY printf("arp: proxying for %s\n", inet_ntoa(itaddr)); Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Wed Dec 9 09:29:38 2015 (r292014) +++ head/sys/netinet/in_mcast.c Wed Dec 9 11:14:27 2015 (r292015) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1883,6 +1884,8 @@ inp_lookup_mcast_ifp(const struct inpcb { struct rm_priotracker in_ifa_tracker; struct ifnet *ifp; + struct nhop4_basic nh4; + uint32_t fibnum; KASSERT(gsin->sin_family == AF_INET, ("%s: not AF_INET", __func__)); KASSERT(IN_MULTICAST(ntohl(gsin->sin_addr.s_addr)), @@ -1892,16 +1895,10 @@ inp_lookup_mcast_ifp(const struct inpcb if (!in_nullhost(ina)) { INADDR_TO_IFP(ina, ifp); } else { - struct route ro; - - ro.ro_rt = NULL; - memcpy(&ro.ro_dst, gsin, sizeof(struct sockaddr_in)); - in_rtalloc_ign(&ro, 0, inp ? inp->inp_inc.inc_fibnum : 0); - if (ro.ro_rt != NULL) { - ifp = ro.ro_rt->rt_ifp; - KASSERT(ifp != NULL, ("%s: null ifp", __func__)); - RTFREE(ro.ro_rt); - } else { + fibnum = inp ? inp->inp_inc.inc_fibnum : 0; + if (fib4_lookup_nh_basic(fibnum, gsin->sin_addr, 0, 0, &nh4)==0) + ifp = nh4.nh_ifp; + else { struct in_ifaddr *ia; struct ifnet *mifp; Modified: head/sys/netinet/ip_icmp.c ============================================================================== --- head/sys/netinet/ip_icmp.c Wed Dec 9 09:29:38 2015 (r292014) +++ head/sys/netinet/ip_icmp.c Wed Dec 9 11:14:27 2015 (r292015) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -655,6 +656,7 @@ icmp_reflect(struct mbuf *m) struct ifnet *ifp; struct in_ifaddr *ia; struct in_addr t; + struct nhop4_extended nh_ext; struct mbuf *opts = 0; int optlen = (ip->ip_hl << 2) - sizeof(struct ip); @@ -748,14 +750,12 @@ icmp_reflect(struct mbuf *m) * When we don't have a route back to the packet source, stop here * and drop the packet. */ - ia = ip_rtaddr(ip->ip_dst, M_GETFIB(m)); - if (ia == NULL) { + if (fib4_lookup_nh_ext(M_GETFIB(m), ip->ip_dst, 0, 0, &nh_ext) != 0) { m_freem(m); ICMPSTAT_INC(icps_noroute); goto done; } - t = IA_SIN(ia)->sin_addr; - ifa_free(&ia->ia_ifa); + t = nh_ext.nh_src; match: #ifdef MAC mac_netinet_icmp_replyinplace(m); Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Wed Dec 9 09:29:38 2015 (r292014) +++ head/sys/netinet/ip_input.c Wed Dec 9 11:14:27 2015 (r292015) @@ -878,33 +878,6 @@ ipproto_unregister(short ipproto) return (0); } -/* - * Given address of next destination (final or next hop), return (referenced) - * internet address info of interface to be used to get there. - */ -struct in_ifaddr * -ip_rtaddr(struct in_addr dst, u_int fibnum) -{ - struct route sro; - struct sockaddr_in *sin; - struct in_ifaddr *ia; - - bzero(&sro, sizeof(sro)); - sin = (struct sockaddr_in *)&sro.ro_dst; - sin->sin_family = AF_INET; - sin->sin_len = sizeof(*sin); - sin->sin_addr = dst; - in_rtalloc_ign(&sro, 0, fibnum); - - if (sro.ro_rt == NULL) - return (NULL); - - ia = ifatoia(sro.ro_rt->rt_ifa); - ifa_ref(&ia->ia_ifa); - RTFREE(sro.ro_rt); - return (ia); -} - u_char inetctlerrmap[PRC_NCMDS] = { 0, 0, 0, 0, 0, EMSGSIZE, EHOSTDOWN, EHOSTUNREACH, Modified: head/sys/netinet/ip_options.c ============================================================================== --- head/sys/netinet/ip_options.c Wed Dec 9 09:29:38 2015 (r292014) +++ head/sys/netinet/ip_options.c Wed Dec 9 11:14:27 2015 (r292015) @@ -290,15 +290,19 @@ dropit: * destination, use the incoming interface (should be * same). */ - if ((ia = (INA)ifa_ifwithaddr((SA)&ipaddr)) == NULL && - (ia = ip_rtaddr(ipaddr.sin_addr, M_GETFIB(m))) == NULL) { + if ((ia = (INA)ifa_ifwithaddr((SA)&ipaddr)) != NULL) { + memcpy(cp + off, &(IA_SIN(ia)->sin_addr), + sizeof(struct in_addr)); + ifa_free(&ia->ia_ifa); + } else if (fib4_lookup_nh_ext(M_GETFIB(m), + ipaddr.sin_addr, 0, 0, &nh_ext) == 0) { + memcpy(cp + off, &nh_ext.nh_src, + sizeof(struct in_addr)); + } else { type = ICMP_UNREACH; code = ICMP_UNREACH_HOST; goto bad; } - (void)memcpy(cp + off, &(IA_SIN(ia)->sin_addr), - sizeof(struct in_addr)); - ifa_free(&ia->ia_ifa); cp[IPOPT_OFFSET] += sizeof(struct in_addr); break; Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Wed Dec 9 09:29:38 2015 (r292014) +++ head/sys/netinet/ip_var.h Wed Dec 9 11:14:27 2015 (r292015) @@ -222,8 +222,6 @@ int ipproto_register(short); int ipproto_unregister(short); struct mbuf * ip_reass(struct mbuf *); -struct in_ifaddr * - ip_rtaddr(struct in_addr, u_int fibnum); void ip_savecontrol(struct inpcb *, struct mbuf **, struct ip *, struct mbuf *); void ip_slowtimo(void); Modified: head/sys/netinet6/icmp6.c ============================================================================== --- head/sys/netinet6/icmp6.c Wed Dec 9 09:29:38 2015 (r292014) +++ head/sys/netinet6/icmp6.c Wed Dec 9 11:14:27 2015 (r292015) @@ -100,6 +100,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -2289,7 +2290,6 @@ icmp6_redirect_input(struct mbuf *m, int int icmp6len = ntohs(ip6->ip6_plen); char *lladdr = NULL; int lladdrlen = 0; - struct rtentry *rt = NULL; int is_router; int is_onlink; struct in6_addr src6 = ip6->ip6_src; @@ -2344,18 +2344,13 @@ icmp6_redirect_input(struct mbuf *m, int } { /* ip6->ip6_src must be equal to gw for icmp6->icmp6_reddst */ - struct sockaddr_in6 sin6; - struct in6_addr *gw6; - - bzero(&sin6, sizeof(sin6)); - sin6.sin6_family = AF_INET6; - sin6.sin6_len = sizeof(struct sockaddr_in6); - bcopy(&reddst6, &sin6.sin6_addr, sizeof(reddst6)); - rt = in6_rtalloc1((struct sockaddr *)&sin6, 0, 0UL, RT_DEFAULT_FIB); - if (rt) { - if (rt->rt_gateway == NULL || - rt->rt_gateway->sa_family != AF_INET6) { - RTFREE_LOCKED(rt); + struct nhop6_basic nh6; + struct in6_addr kdst; + uint32_t scopeid; + + in6_splitscope(&reddst6, &kdst, &scopeid); + if (fib6_lookup_nh_basic(RT_DEFAULT_FIB, &kdst, scopeid, 0, 0,&nh6)==0){ + if ((nh6.nh_flags & NHF_GATEWAY) == 0) { nd6log((LOG_ERR, "ICMP6 redirect rejected; no route " "with inet6 gateway found for redirect dst: %s\n", @@ -2363,14 +2358,12 @@ icmp6_redirect_input(struct mbuf *m, int goto bad; } - gw6 = &(((struct sockaddr_in6 *)rt->rt_gateway)->sin6_addr); - if (bcmp(&src6, gw6, sizeof(struct in6_addr)) != 0) { - RTFREE_LOCKED(rt); + if (IN6_ARE_ADDR_EQUAL(&src6, &nh6.nh_addr) == 0) { nd6log((LOG_ERR, "ICMP6 redirect rejected; " "not equal to gw-for-src=%s (must be same): " "%s\n", - ip6_sprintf(ip6buf, gw6), + ip6_sprintf(ip6buf, &nh6.nh_addr), icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); goto bad; } @@ -2381,8 +2374,6 @@ icmp6_redirect_input(struct mbuf *m, int icmp6_redirect_diag(&src6, &reddst6, &redtgt6))); goto bad; } - RTFREE_LOCKED(rt); - rt = NULL; } if (IN6_IS_ADDR_MULTICAST(&reddst6)) { nd6log((LOG_ERR, Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Wed Dec 9 09:29:38 2015 (r292014) +++ head/sys/netinet6/in6.c Wed Dec 9 11:14:27 2015 (r292015) @@ -107,6 +107,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include VNET_DECLARE(int, icmp6_nodeinfo_oldmcprefix); @@ -2144,17 +2145,22 @@ in6_lltable_rtcheck(struct ifnet *ifp, u_int flags, const struct sockaddr *l3addr) { - struct rtentry *rt; + const struct sockaddr_in6 *sin6; + struct nhop6_basic nh6; + struct in6_addr dst; + uint32_t scopeid; + int error; char ip6buf[INET6_ADDRSTRLEN]; KASSERT(l3addr->sa_family == AF_INET6, ("sin_family %d", l3addr->sa_family)); /* Our local addresses are always only installed on the default FIB. */ - /* XXX rtalloc1 should take a const param */ - rt = in6_rtalloc1(__DECONST(struct sockaddr *, l3addr), 0, 0, - RT_DEFAULT_FIB); - if (rt == NULL || (rt->rt_flags & RTF_GATEWAY) || rt->rt_ifp != ifp) { + + sin6 = (const struct sockaddr_in6 *)l3addr; + in6_splitscope(&sin6->sin6_addr, &dst, &scopeid); + error = fib6_lookup_nh_basic(RT_DEFAULT_FIB, &dst, scopeid, 0, 0, &nh6); + if (error != 0 || (nh6.nh_flags & NHF_GATEWAY) || nh6.nh_ifp != ifp) { struct ifaddr *ifa; /* * Create an ND6 cache for an IPv6 neighbor @@ -2163,17 +2169,12 @@ in6_lltable_rtcheck(struct ifnet *ifp, ifa = ifaof_ifpforaddr(l3addr, ifp); if (ifa != NULL) { ifa_free(ifa); - if (rt != NULL) - RTFREE_LOCKED(rt); return 0; } log(LOG_INFO, "IPv6 address: \"%s\" is not on the network\n", - ip6_sprintf(ip6buf, &((const struct sockaddr_in6 *)l3addr)->sin6_addr)); - if (rt != NULL) - RTFREE_LOCKED(rt); + ip6_sprintf(ip6buf, &sin6->sin6_addr)); return EINVAL; } - RTFREE_LOCKED(rt); return 0; } Modified: head/sys/netinet6/in6_fib.c ============================================================================== --- head/sys/netinet6/in6_fib.c Wed Dec 9 09:29:38 2015 (r292014) +++ head/sys/netinet6/in6_fib.c Wed Dec 9 11:14:27 2015 (r292015) @@ -164,6 +164,7 @@ fib6_rte_to_nh_extended(struct rtentry * * interface "ix0" pointer to "ix0" interface will be returned instead * of "lo0") * - howewer mtu from "transmit" interface will be returned. + * - scope will be embedded in nh_addr */ int fib6_lookup_nh_basic(uint32_t fibnum, const struct in6_addr *dst, uint32_t scopeid, @@ -182,6 +183,7 @@ fib6_lookup_nh_basic(uint32_t fibnum, co /* Prepare lookup key */ memset(&sin6, 0, sizeof(sin6)); sin6.sin6_addr = *dst; + sin6.sin6_len = sizeof(struct sockaddr_in6); /* Assume scopeid is valid and embed it directly */ if (IN6_IS_SCOPE_LINKLOCAL(dst)) sin6.sin6_addr.s6_addr16[1] = htons(scopeid & 0xffff); @@ -192,7 +194,7 @@ fib6_lookup_nh_basic(uint32_t fibnum, co rte = RNTORT(rn); /* Ensure route & ifp is UP */ if (RT_LINK_IS_UP(rte->rt_ifp)) { - fib6_rte_to_nh_basic(rte, dst, flags, pnh6); + fib6_rte_to_nh_basic(rte, &sin6.sin6_addr, flags, pnh6); RADIX_NODE_HEAD_RUNLOCK(rh); return (0); } @@ -211,6 +213,7 @@ fib6_lookup_nh_basic(uint32_t fibnum, co * - nh_ifp represents logical transmit interface (rt_ifp) by default * - nh_ifp represents "address" interface if NHR_IFAIF flag is passed * - mtu from logical transmit interface will be returned. + * - scope will be embedded in nh_addr */ int fib6_lookup_nh_ext(uint32_t fibnum, const struct in6_addr *dst,uint32_t scopeid, @@ -240,7 +243,8 @@ fib6_lookup_nh_ext(uint32_t fibnum, cons rte = RNTORT(rn); /* Ensure route & ifp is UP */ if (RT_LINK_IS_UP(rte->rt_ifp)) { - fib6_rte_to_nh_extended(rte, dst, flags, pnh6); + fib6_rte_to_nh_extended(rte, &sin6.sin6_addr, flags, + pnh6); if ((flags & NHR_REF) != 0) { /* TODO: Do lwref on egress ifp's */ } Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Wed Dec 9 09:29:38 2015 (r292014) +++ head/sys/netinet6/in6_mcast.c Wed Dec 9 11:14:27 2015 (r292015) @@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1772,26 +1773,22 @@ static struct ifnet * in6p_lookup_mcast_ifp(const struct inpcb *in6p, const struct sockaddr_in6 *gsin6) { - struct route_in6 ro6; - struct ifnet *ifp; + struct nhop6_basic nh6; + struct in6_addr dst; + uint32_t scopeid; + uint32_t fibnum; KASSERT(in6p->inp_vflag & INP_IPV6, ("%s: not INP_IPV6 inpcb", __func__)); KASSERT(gsin6->sin6_family == AF_INET6, ("%s: not AF_INET6 group", __func__)); - ifp = NULL; - memset(&ro6, 0, sizeof(struct route_in6)); - memcpy(&ro6.ro_dst, gsin6, sizeof(struct sockaddr_in6)); - rtalloc_ign_fib((struct route *)&ro6, 0, - in6p ? in6p->inp_inc.inc_fibnum : RT_DEFAULT_FIB); - if (ro6.ro_rt != NULL) { - ifp = ro6.ro_rt->rt_ifp; - KASSERT(ifp != NULL, ("%s: null ifp", __func__)); - RTFREE(ro6.ro_rt); - } + in6_splitscope(&gsin6->sin6_addr, &dst, &scopeid); + fibnum = in6p ? in6p->inp_inc.inc_fibnum : RT_DEFAULT_FIB; + if (fib6_lookup_nh_basic(fibnum, &dst, scopeid, 0, 0, &nh6) != 0) + return (NULL); - return (ifp); + return (nh6.nh_ifp); } /* Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Wed Dec 9 09:29:38 2015 (r292014) +++ head/sys/netinet6/in6_src.c Wed Dec 9 11:14:27 2015 (r292015) @@ -105,6 +105,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -860,19 +861,16 @@ in6_selecthlim(struct inpcb *in6p, struc else if (ifp) return (ND_IFINFO(ifp)->chlim); else if (in6p && !IN6_IS_ADDR_UNSPECIFIED(&in6p->in6p_faddr)) { - struct route_in6 ro6; - struct ifnet *lifp; - - bzero(&ro6, sizeof(ro6)); - ro6.ro_dst.sin6_family = AF_INET6; - ro6.ro_dst.sin6_len = sizeof(struct sockaddr_in6); - ro6.ro_dst.sin6_addr = in6p->in6p_faddr; - in6_rtalloc(&ro6, in6p->inp_inc.inc_fibnum); - if (ro6.ro_rt) { - lifp = ro6.ro_rt->rt_ifp; - RTFREE(ro6.ro_rt); - if (lifp) - return (ND_IFINFO(lifp)->chlim); + struct nhop6_basic nh6; + struct in6_addr dst; + uint32_t fibnum, scopeid; + int hlim; + + fibnum = in6p->inp_inc.inc_fibnum; + in6_splitscope(&in6p->in6p_faddr, &dst, &scopeid); + if (fib6_lookup_nh_basic(fibnum, &dst, scopeid, 0, 0, &nh6)==0){ + hlim = ND_IFINFO(nh6.nh_ifp)->chlim; + return (hlim); } } return (V_ip6_defhlim); From owner-svn-src-all@freebsd.org Wed Dec 9 12:16:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCC739D4062; Wed, 9 Dec 2015 12:16:28 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71E871181; Wed, 9 Dec 2015 12:16:28 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9CGRQn060603; Wed, 9 Dec 2015 12:16:27 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9CGLSu060545; Wed, 9 Dec 2015 12:16:21 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512091216.tB9CGLSu060545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Wed, 9 Dec 2015 12:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292016 - in vendor/openbsm/dist: . bin bin/audit bin/auditd bin/auditdistd bin/auditfilterd bin/auditreduce bin/praudit bsm compat etc libauditd libbsm man modules modules/auditfilter_... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 12:16:28 -0000 Author: brueffer Date: Wed Dec 9 12:16:21 2015 New Revision: 292016 URL: https://svnweb.freebsd.org/changeset/base/292016 Log: Vendor import of OpenBSM 1.2-alpha4. Added: vendor/openbsm/dist/.travis.yml (contents, props changed) vendor/openbsm/dist/libbsm/au_notify.3 (contents, props changed) Modified: vendor/openbsm/dist/INSTALL vendor/openbsm/dist/LICENSE vendor/openbsm/dist/Makefile.am vendor/openbsm/dist/Makefile.in vendor/openbsm/dist/NEWS vendor/openbsm/dist/README vendor/openbsm/dist/TODO vendor/openbsm/dist/VERSION vendor/openbsm/dist/autogen.sh vendor/openbsm/dist/bin/Makefile.am vendor/openbsm/dist/bin/audit/Makefile.am vendor/openbsm/dist/bin/audit/audit.8 vendor/openbsm/dist/bin/audit/audit.c vendor/openbsm/dist/bin/auditd/Makefile.am vendor/openbsm/dist/bin/auditd/audit_triggers.defs vendor/openbsm/dist/bin/auditd/audit_warn.c vendor/openbsm/dist/bin/auditd/auditd.8 vendor/openbsm/dist/bin/auditd/auditd.c vendor/openbsm/dist/bin/auditd/auditd.h vendor/openbsm/dist/bin/auditd/auditd_control.defs vendor/openbsm/dist/bin/auditd/auditd_darwin.c vendor/openbsm/dist/bin/auditd/auditd_fbsd.c vendor/openbsm/dist/bin/auditdistd/Makefile.am vendor/openbsm/dist/bin/auditdistd/auditdistd.8 vendor/openbsm/dist/bin/auditdistd/auditdistd.c vendor/openbsm/dist/bin/auditdistd/auditdistd.conf.5 vendor/openbsm/dist/bin/auditdistd/auditdistd.h vendor/openbsm/dist/bin/auditdistd/faccessat.h vendor/openbsm/dist/bin/auditdistd/fstatat.h vendor/openbsm/dist/bin/auditdistd/openat.h vendor/openbsm/dist/bin/auditdistd/parse.y vendor/openbsm/dist/bin/auditdistd/pjdlog.c vendor/openbsm/dist/bin/auditdistd/pjdlog.h vendor/openbsm/dist/bin/auditdistd/proto.c vendor/openbsm/dist/bin/auditdistd/proto.h vendor/openbsm/dist/bin/auditdistd/proto_common.c vendor/openbsm/dist/bin/auditdistd/proto_impl.h vendor/openbsm/dist/bin/auditdistd/proto_socketpair.c vendor/openbsm/dist/bin/auditdistd/proto_tcp.c vendor/openbsm/dist/bin/auditdistd/proto_tls.c vendor/openbsm/dist/bin/auditdistd/proto_uds.c vendor/openbsm/dist/bin/auditdistd/receiver.c vendor/openbsm/dist/bin/auditdistd/renameat.h vendor/openbsm/dist/bin/auditdistd/sandbox.c vendor/openbsm/dist/bin/auditdistd/sandbox.h vendor/openbsm/dist/bin/auditdistd/sender.c vendor/openbsm/dist/bin/auditdistd/sigtimedwait.h vendor/openbsm/dist/bin/auditdistd/strndup.h vendor/openbsm/dist/bin/auditdistd/subr.c vendor/openbsm/dist/bin/auditdistd/subr.h vendor/openbsm/dist/bin/auditdistd/synch.h vendor/openbsm/dist/bin/auditdistd/token.l vendor/openbsm/dist/bin/auditdistd/trail.c vendor/openbsm/dist/bin/auditdistd/trail.h vendor/openbsm/dist/bin/auditdistd/unlinkat.h vendor/openbsm/dist/bin/auditfilterd/Makefile.am vendor/openbsm/dist/bin/auditfilterd/auditfilterd.8 vendor/openbsm/dist/bin/auditfilterd/auditfilterd.c vendor/openbsm/dist/bin/auditfilterd/auditfilterd.h vendor/openbsm/dist/bin/auditfilterd/auditfilterd_conf.c vendor/openbsm/dist/bin/auditreduce/Makefile.am vendor/openbsm/dist/bin/auditreduce/auditreduce.1 vendor/openbsm/dist/bin/auditreduce/auditreduce.c vendor/openbsm/dist/bin/auditreduce/auditreduce.h vendor/openbsm/dist/bin/praudit/Makefile.am vendor/openbsm/dist/bin/praudit/praudit.1 vendor/openbsm/dist/bin/praudit/praudit.c vendor/openbsm/dist/bsm/Makefile.am vendor/openbsm/dist/bsm/audit_filter.h vendor/openbsm/dist/bsm/audit_uevents.h vendor/openbsm/dist/bsm/auditd_lib.h vendor/openbsm/dist/bsm/libbsm.h vendor/openbsm/dist/compat/clock_gettime.h vendor/openbsm/dist/compat/closefrom.h vendor/openbsm/dist/compat/compat.h vendor/openbsm/dist/compat/endian.h vendor/openbsm/dist/compat/endian_enc.h vendor/openbsm/dist/compat/flopen.h vendor/openbsm/dist/compat/pidfile.h vendor/openbsm/dist/compat/queue.h vendor/openbsm/dist/compat/strlcat.h vendor/openbsm/dist/compat/strlcpy.h vendor/openbsm/dist/configure vendor/openbsm/dist/configure.ac vendor/openbsm/dist/etc/audit_class vendor/openbsm/dist/etc/audit_control vendor/openbsm/dist/etc/audit_event vendor/openbsm/dist/etc/audit_filter vendor/openbsm/dist/etc/audit_user vendor/openbsm/dist/etc/audit_warn vendor/openbsm/dist/libauditd/Makefile.am vendor/openbsm/dist/libauditd/auditd_lib.c vendor/openbsm/dist/libauditd/libauditd.3 vendor/openbsm/dist/libbsm/Makefile.am vendor/openbsm/dist/libbsm/Makefile.in vendor/openbsm/dist/libbsm/au_class.3 vendor/openbsm/dist/libbsm/au_control.3 vendor/openbsm/dist/libbsm/au_domain.3 vendor/openbsm/dist/libbsm/au_errno.3 vendor/openbsm/dist/libbsm/au_event.3 vendor/openbsm/dist/libbsm/au_fcntl_cmd.3 vendor/openbsm/dist/libbsm/au_free_token.3 vendor/openbsm/dist/libbsm/au_io.3 vendor/openbsm/dist/libbsm/au_mask.3 vendor/openbsm/dist/libbsm/au_open.3 vendor/openbsm/dist/libbsm/au_socket_type.3 vendor/openbsm/dist/libbsm/au_token.3 vendor/openbsm/dist/libbsm/au_user.3 vendor/openbsm/dist/libbsm/audit_submit.3 vendor/openbsm/dist/libbsm/bsm_audit.c vendor/openbsm/dist/libbsm/bsm_class.c vendor/openbsm/dist/libbsm/bsm_control.c vendor/openbsm/dist/libbsm/bsm_domain.c vendor/openbsm/dist/libbsm/bsm_errno.c vendor/openbsm/dist/libbsm/bsm_event.c vendor/openbsm/dist/libbsm/bsm_fcntl.c vendor/openbsm/dist/libbsm/bsm_flags.c vendor/openbsm/dist/libbsm/bsm_io.c vendor/openbsm/dist/libbsm/bsm_mask.c vendor/openbsm/dist/libbsm/bsm_notify.c vendor/openbsm/dist/libbsm/bsm_socket_type.c vendor/openbsm/dist/libbsm/bsm_token.c vendor/openbsm/dist/libbsm/bsm_user.c vendor/openbsm/dist/libbsm/bsm_wrappers.c vendor/openbsm/dist/libbsm/libbsm.3 vendor/openbsm/dist/man/Makefile.am vendor/openbsm/dist/man/Makefile.in vendor/openbsm/dist/man/audit.2 vendor/openbsm/dist/man/audit.log.5 vendor/openbsm/dist/man/audit_class.5 vendor/openbsm/dist/man/audit_control.5 vendor/openbsm/dist/man/audit_event.5 vendor/openbsm/dist/man/audit_user.5 vendor/openbsm/dist/man/audit_warn.5 vendor/openbsm/dist/man/auditctl.2 vendor/openbsm/dist/man/auditon.2 vendor/openbsm/dist/man/getaudit.2 vendor/openbsm/dist/man/getauid.2 vendor/openbsm/dist/man/setaudit.2 vendor/openbsm/dist/man/setauid.2 vendor/openbsm/dist/modules/Makefile.am vendor/openbsm/dist/modules/auditfilter_noop/Makefile.am vendor/openbsm/dist/modules/auditfilter_noop/auditfilter_noop.c vendor/openbsm/dist/sys/Makefile.am vendor/openbsm/dist/sys/bsm/Makefile.am vendor/openbsm/dist/sys/bsm/audit.h vendor/openbsm/dist/sys/bsm/audit_domain.h vendor/openbsm/dist/sys/bsm/audit_errno.h vendor/openbsm/dist/sys/bsm/audit_fcntl.h vendor/openbsm/dist/sys/bsm/audit_internal.h vendor/openbsm/dist/sys/bsm/audit_kevents.h vendor/openbsm/dist/sys/bsm/audit_record.h vendor/openbsm/dist/sys/bsm/audit_socket_type.h vendor/openbsm/dist/test/Makefile.am vendor/openbsm/dist/test/bsm/Makefile.am vendor/openbsm/dist/test/bsm/generate.c vendor/openbsm/dist/tools/Makefile.am vendor/openbsm/dist/tools/audump.c Added: vendor/openbsm/dist/.travis.yml ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/openbsm/dist/.travis.yml Wed Dec 9 12:16:21 2015 (r292016) @@ -0,0 +1,18 @@ +language: c + +compiler: + - clang + - gcc + +os: + - linux + - osx + +before_install: + - if [ $TRAVIS_OS_NAME == "linux" ]; then + sudo apt-get -qq update; + sudo apt-get -qq install byacc flex; + elif [ $TRAVIS_OS_NAME == "osx" ]; then + brew update; + brew install byacc flex; + fi Modified: vendor/openbsm/dist/INSTALL ============================================================================== --- vendor/openbsm/dist/INSTALL Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/INSTALL Wed Dec 9 12:16:21 2015 (r292016) @@ -3,7 +3,7 @@ OpenBSM Build and Installation Instructi OpenBSM is currently built using autoconf and automake, which should allow for building on a range of operating systems, including FreeBSD, Mac OS X, and Linux. Some components are built only if appropriate kernel audit -suppport is found. Typical builds will be performed using: +support is found. Typical builds will be performed using: ./configure make @@ -31,7 +31,7 @@ not configurable. You may wish to specify that the OpenBSM components not be installed in the base system, rather in a specific directory. This may be done using the --prefix argument to configure. If installing to a specific directory, -remember to update your library path so that running tools from that +remember to update your library path so that when running tools from that directory the correct libbsm is used: ./configure --prefix=/home/rwatson/openbsm Modified: vendor/openbsm/dist/LICENSE ============================================================================== --- vendor/openbsm/dist/LICENSE Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/LICENSE Wed Dec 9 12:16:21 2015 (r292016) @@ -34,5 +34,3 @@ as a whole: The TrustedBSD Project would appreciate the contribution of fixes and enhancements under an identical license in order to avoid potentially confusing license proliferation. - -$P4: //depot/projects/trustedbsd/openbsm/LICENSE#6 $ Modified: vendor/openbsm/dist/Makefile.am ============================================================================== --- vendor/openbsm/dist/Makefile.am Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/Makefile.am Wed Dec 9 12:16:21 2015 (r292016) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/Makefile.am#5 $ -## - SUBDIRS = \ bsm Modified: vendor/openbsm/dist/Makefile.in ============================================================================== --- vendor/openbsm/dist/Makefile.in Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/Makefile.in Wed Dec 9 12:16:21 2015 (r292016) @@ -59,9 +59,9 @@ DIST_COMMON = README $(am__configure_dep $(top_srcdir)/config/config.sub \ $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \ $(top_srcdir)/config/missing $(top_srcdir)/configure INSTALL \ - NEWS TODO config/config.guess config/config.sub config/depcomp \ - config/install-sh config/ltmain.sh config/missing \ - config/ylwrap + NEWS TODO config/compile config/config.guess config/config.sub \ + config/depcomp config/install-sh config/ltmain.sh \ + config/missing config/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ Modified: vendor/openbsm/dist/NEWS ============================================================================== --- vendor/openbsm/dist/NEWS Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/NEWS Wed Dec 9 12:16:21 2015 (r292016) @@ -1,5 +1,16 @@ OpenBSM Version History +OpenBSM 1.2 alpha 4 + +- Fix praudit to emit correct XML. +- Fix auditdistd bugs related to IPv6 support, locking, and a kqueue-related + descriptor leak. +- Add audit event definitions for Capsicum-related syscalls, as well as + AUE_BINDAT and AUE_CONNECTAT. +- Manpage symlinks for all libbsm functions are installed again after the + move to autotools in OpenBSM 1.0 Alpha 5. +- A variety of minor documentation cleanups. + OpenBSM 1.2 alpha 3 - Various minor tweaks to the auditdistd build to make it fit the FreeBSD @@ -494,5 +505,3 @@ OpenBSM 1.0 alpha 1 - auditd(8), audit(8) added to the OpenBSM distribution. auditd extended to support reloading of kernel event table. - Allow comments in /etc/security configuration files. - -$P4: //depot/projects/trustedbsd/openbsm/NEWS#55 $ Modified: vendor/openbsm/dist/README ============================================================================== --- vendor/openbsm/dist/README Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/README Wed Dec 9 12:16:21 2015 (r292016) @@ -1,4 +1,4 @@ -OpenBSM 1.2a2 +OpenBSM Introduction @@ -10,7 +10,7 @@ of several organizations. OpenBSM includes several command line tools, including auditreduce(8) and praudit(8) for reducing and printing audit trails, as well as the libbsm(3) library to manage configuration files, generate audit records, and parse and -print audit trils. +print audit trails. Coupled with a kernel audit implementation, OpenBSM can be used to maintain system audit streams, and is a foundation for a full audit-enabled system. @@ -64,5 +64,3 @@ Information on OpenBSM may be found on t Information on TrustedBSD may be found on the TrustedBSD home page: http://www.TrustedBSD.org/ - -$P4: //depot/projects/trustedbsd/openbsm/README#41 $ Modified: vendor/openbsm/dist/TODO ============================================================================== --- vendor/openbsm/dist/TODO Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/TODO Wed Dec 9 12:16:21 2015 (r292016) @@ -7,8 +7,6 @@ OpenBSM TODO - Document contents of libbsm "public" data structures in libbsm man pages. - The audit.log.5 man page is incomplete, as it does not describe all token types. -- With the move to autoconf/automake, man page symlinks are no longer - installed. This needs to be fixed. - It might be desirable to be able to provide EOPNOTSUPP system call stubs on systems that don't have the necessary audit system calls; that would allow the full libbsm and tool set to build, just not run. @@ -23,5 +21,3 @@ OpenBSM TODO not available on the local OS platform. - Support for client certificates in auditdistd, to include certificate chain validation. - -$P4: //depot/projects/trustedbsd/openbsm/TODO#14 $ Modified: vendor/openbsm/dist/VERSION ============================================================================== --- vendor/openbsm/dist/VERSION Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/VERSION Wed Dec 9 12:16:21 2015 (r292016) @@ -1 +1 @@ -OPENBSM_1_2_alpha3 +OPENBSM_1_2_alpha4 Modified: vendor/openbsm/dist/autogen.sh ============================================================================== --- vendor/openbsm/dist/autogen.sh Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/autogen.sh Wed Dec 9 12:16:21 2015 (r292016) @@ -1,7 +1,4 @@ #!/bin/sh -# -# $P4: //depot/projects/trustedbsd/openbsm/autogen.sh#2 $ -# libtoolize --copy --force aclocal Modified: vendor/openbsm/dist/bin/Makefile.am ============================================================================== --- vendor/openbsm/dist/bin/Makefile.am Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/Makefile.am Wed Dec 9 12:16:21 2015 (r292016) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/Makefile.am#4 $ -## - SUBDIRS = \ auditdistd \ auditfilterd \ Modified: vendor/openbsm/dist/bin/audit/Makefile.am ============================================================================== --- vendor/openbsm/dist/bin/audit/Makefile.am Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/audit/Makefile.am Wed Dec 9 12:16:21 2015 (r292016) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/audit/Makefile.am#7 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: vendor/openbsm/dist/bin/audit/audit.8 ============================================================================== --- vendor/openbsm/dist/bin/audit/audit.8 Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/audit/audit.8 Wed Dec 9 12:16:21 2015 (r292016) @@ -25,9 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/audit/audit.8#16 $ -.\" -.Dd January 29, 2009 +.Dd July 25, 2015 .Dt AUDIT 8 .Os .Sh NAME @@ -88,7 +86,7 @@ Audit policy file used to configure the .Xr audit 4 , .Xr audit_control 5 , .Xr auditd 8 , -.Xr launchd 8 +.Xr launchd 8 (Mac OS X) .Sh HISTORY The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc.\& in 2004. Modified: vendor/openbsm/dist/bin/audit/audit.c ============================================================================== --- vendor/openbsm/dist/bin/audit/audit.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/audit/audit.c Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/audit/audit.c#15 $ */ /* * Program to trigger the audit daemon with a message that is either: Modified: vendor/openbsm/dist/bin/auditd/Makefile.am ============================================================================== --- vendor/openbsm/dist/bin/auditd/Makefile.am Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditd/Makefile.am Wed Dec 9 12:16:21 2015 (r292016) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/Makefile.am#6 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: vendor/openbsm/dist/bin/auditd/audit_triggers.defs ============================================================================== --- vendor/openbsm/dist/bin/auditd/audit_triggers.defs Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditd/audit_triggers.defs Wed Dec 9 12:16:21 2015 (r292016) @@ -1,5 +1 @@ -/* - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/audit_triggers.defs#1 $ - */ - #include Modified: vendor/openbsm/dist/bin/auditd/audit_warn.c ============================================================================== --- vendor/openbsm/dist/bin/auditd/audit_warn.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditd/audit_warn.c Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/audit_warn.c#11 $ */ #include Modified: vendor/openbsm/dist/bin/auditd/auditd.8 ============================================================================== --- vendor/openbsm/dist/bin/auditd/auditd.8 Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditd/auditd.8 Wed Dec 9 12:16:21 2015 (r292016) @@ -25,9 +25,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.8#19 $ -.\" -.Dd December 11, 2008 +.Dd July 25, 2015 .Dt AUDITD 8 .Os .Sh NAME @@ -123,7 +121,7 @@ and are no longer available as arguments .Xr audit_warn 5 , .Xr audit 8 , .Xr auditdistd 8 , -.Xr launchd 8 +.Xr launchd 8 (Mac OS X) .Sh HISTORY The OpenBSM implementation was created by McAfee Research, the security division of McAfee Inc., under contract to Apple Computer Inc.\& in 2004. Modified: vendor/openbsm/dist/bin/auditd/auditd.c ============================================================================== --- vendor/openbsm/dist/bin/auditd/auditd.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditd/auditd.c Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.c#50 $ */ #include Modified: vendor/openbsm/dist/bin/auditd/auditd.h ============================================================================== --- vendor/openbsm/dist/bin/auditd/auditd.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditd/auditd.h Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd.h#13 $ */ #ifndef _AUDITD_H_ Modified: vendor/openbsm/dist/bin/auditd/auditd_control.defs ============================================================================== --- vendor/openbsm/dist/bin/auditd/auditd_control.defs Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditd/auditd_control.defs Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_control.defs#2 $ */ /* Modified: vendor/openbsm/dist/bin/auditd/auditd_darwin.c ============================================================================== --- vendor/openbsm/dist/bin/auditd/auditd_darwin.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditd/auditd_darwin.c Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_darwin.c#5 $ */ #include Modified: vendor/openbsm/dist/bin/auditd/auditd_fbsd.c ============================================================================== --- vendor/openbsm/dist/bin/auditd/auditd_fbsd.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditd/auditd_fbsd.c Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditd/auditd_fbsd.c#4 $ */ #include Modified: vendor/openbsm/dist/bin/auditdistd/Makefile.am ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/Makefile.am Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/Makefile.am Wed Dec 9 12:16:21 2015 (r292016) @@ -1,7 +1,3 @@ -## -## $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/Makefile.am#1 $ -## - if USE_NATIVE_INCLUDES INCLUDES = -I$(top_builddir) -I$(top_srcdir) else Modified: vendor/openbsm/dist/bin/auditdistd/auditdistd.8 ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/auditdistd.8 Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/auditdistd.8 Wed Dec 9 12:16:21 2015 (r292016) @@ -41,7 +41,7 @@ .Sh DESCRIPTION The .Nm -daemon is responsible for distributing audit trail files over TCP/IP network in +daemon is responsible for distributing audit trail files over a TCP/IP network in a secure and reliable way. .Pp The @@ -49,7 +49,7 @@ The daemon can be started with the following command line arguments: .Bl -tag -width ".Fl P Ar pidfile" .It Fl c Ar config -Specify alternative location of the configuration file. +Specify an alternative location of the configuration file. The default location is .Pa /etc/security/auditdistd.conf . Note: the configuration file may contain passwords. @@ -74,7 +74,7 @@ usage message. Start in a launchd-friendly mode, ie. do not use .Xr daemon 3 . .It Fl P Ar pidfile -Specify alternative location of a file where main process PID will be +Specify an alternative location of a file where main process PID will be stored. The default location is .Pa /var/run/auditdistd.pid . Modified: vendor/openbsm/dist/bin/auditdistd/auditdistd.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/auditdistd.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/auditdistd.c Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/auditdistd.c#3 $ */ #include Modified: vendor/openbsm/dist/bin/auditdistd/auditdistd.conf.5 ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/auditdistd.conf.5 Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/auditdistd.conf.5 Wed Dec 9 12:16:21 2015 (r292016) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 22, 2011 +.Dd July 1, 2015 .Dt AUDITDISTD.CONF 5 .Os .Sh NAME @@ -37,19 +37,21 @@ daemon. .Sh DESCRIPTION Note: the configuration file may contain passwords. -Care should be taken to configure proper permissions on this file -.Li ( eg. 0600 ) . +Care should be taken to configure proper permissions for this file +.Li ( e.g., 0600 ) . .Pp -Every line starting with # is treated as comment and ignored. +Every line starting with +.Li # +gets treated as a comment and is ignored. .Sh CONFIGURATION FILE SYNTAX -General syntax of the +The general syntax of the .Nm -file is following: -.Bd -literal -offset +file is as follows: +.Bd -literal ## Global section. # Our name. -# The default is first part of the hostname. +# The default is the first part of the hostname. name "" # Connection timeout. @@ -71,11 +73,11 @@ sender { # The default is /var/audit/dist. directory "" .\" -.\" # Checksum algorithm for data send over the wire. +.\" # Checksum algorithm for data sent over the wire. .\" # The default is none. .\" checksum "" .\" -.\" # Compression algorithm for data send over the wire. +.\" # Compression algorithm for data sent over the wire. .\" # The default is none. .\" compression "" @@ -86,7 +88,7 @@ sender { # Optional. source "" - # Address of auditdistd receiver. + # Address of the auditdistd receiver. # No default. Obligatory. remote "" @@ -95,7 +97,7 @@ sender { directory "" # Fingerprint of the receiver's public key when using TLS - # for connection. + # for connections. # Example fingerprint: # SHA256=8F:0A:FC:8A:3D:09:80:AF:D9:AA:38:CC:8A:86:53:E6:8F:B6:1C:55:30:14:D7:F9:AA:8B:3E:73:CD:F5:76:2B fingerprint "" @@ -103,37 +105,37 @@ sender { # Password used to authenticate in front of the receiver. password "" .\" -.\" # Checksum algorithm for data send over the wire. +.\" # Checksum algorithm for data sent over the wire. .\" # The default is none. .\" checksum "" .\" -.\" # Compression algorithm for data send over the wire. +.\" # Compression algorithm for data sent over the wire. .\" # The default is none. .\" compression "" } - # Currently local audit trail files can be send only to one remote + # Currently local audit trail files can be sent only to one remote # auditdistd receiver, but this can change in the future. } receiver { ## Receiver section. - # Address to listen on. Multiple listen addresses might be specified. + # Address to listen on. Multiple listen addresses may be specified. # The defaults are "tcp4://0.0.0.0:7878" and "tcp6://[::]:7878". listen "" # Base directory. - # If directory in host section is no absolute, it will be concatenated - # with this base directory. + # If the directory in the host section is not absolute, it will be + # concatenated with this base directory. # The default is "/var/audit/remote". directory "" - # Path to receiver's certificate file. + # Path to the receiver's certificate file. # The default is "/etc/security/auditdistd.cert.pem". certfile "" - # Path to receiver's private key file. + # Path to the receiver's private key file. # The default is "/etc/security/auditdistd.key.pem". keyfile "" @@ -158,7 +160,7 @@ receiver { .Ed .Pp Most of the various available configuration parameters are optional. -If parameter is not defined in the particular section, it will be +If a parameter is not defined in the particular section, it will be inherited from the parent section if possible. For example, if the .Ic source @@ -172,14 +174,14 @@ In case the section does not define the .Ic source parameter at all, the default value will be used. -.Sh CONFIGURATION FILE DESCRIPTION +.Sh CONFIGURATION OPTION DESCRIPTION The following statements are available: .Bl -tag -width ".Ic xxxx" .It Ic name Aq name .Pp This host's name. -It is send to the receiver, so it can properly recognize us if there are -more than one sender coming from the same IP address. +It is sent to the receiver, so it can properly recognize us if there are +multiple senders coming from the same IP address. .It Ic timeout Aq seconds .Pp Connection timeout in seconds. @@ -198,17 +200,17 @@ The default value is Local address to bind to before connecting to the remote .Nm auditdistd daemon. -Format is the same as for the +The format is the same as for the .Ic listen statement. .It Ic directory Aq path .Pp -Directory where to look for audit trail files in case of sender mode or -directory where to store received audit trail files. +The directory where to look for audit trail files in case of sender mode, or +the directory where to store received audit trail files. The provided path has to be an absolute path. -The only exception is when directory is provided in the +The only exception is when the directory is provided in the .Ic receiver -section, then path provided in the +section; then the path provided in the .Ic host subsections can be relative to the directory in the .Ic receiver @@ -229,13 +231,13 @@ subsections in the .Ic receiver section where .Aq name -is host's name. +is the host's name. .\".It Ic checksum Aq algorithm .\".Pp .\"Checksum algorithm should be one of the following: .\".Bl -tag -width ".Ic sha256" .\".It Ic none -.\"No checksum will be calculated for the data being send over the network. +.\"No checksum will be calculated for the data being sent over the network. .\"This is the default setting. .\".It Ic crc32 .\"CRC32 checksum will be calculated. @@ -247,30 +249,30 @@ is host's name. .\"Compression algorithm should be one of the following: .\".Bl -tag -width ".Ic none" .\".It Ic none -.\"Data send over the network will not be compressed. +.\"Data sent over the network will not be compressed. .\"This is the default setting. .\".It Ic lzf .\"The .\".Nm LZF .\"algorithm by .\".An Marc Alexander Lehmann -.\"will be used to compress the data send over the network. +.\"will be used to compress the data sent over the network. .\".Nm LZF -.\"is very fast, general purpose compression algorithm. +.\"is a very fast, general purpose compression algorithm. .\".El .It Ic remote Aq addr .Pp Address of the remote .Nm auditdistd daemon. -Format is the same as for the +The format is the same as for the .Ic listen statement. -When operating in the +When operating in .Ic sender mode this address will be used to connect to the .Ic receiver . -When operating in the +When operating in .Ic receiver mode only connections from this address will be accepted. .It Ic listen Aq addr @@ -296,21 +298,22 @@ By default listens on .Pa tcp4://0.0.0.0:7878 and -.Pa tcp6://[::]:7878 -if kernel supports IPv4 and IPv6 respectively. +.Pa tcp6://[::]:7878 , +if the kernel supports IPv4 and IPv6 respectively. .It Ic keyfile Aq path .Pp -Path to a file that contains private key for TLS communication. +Path to a file that contains the private key for TLS communication. .It Ic certfile Aq path .Pp -Path to a file that contains certificate for TLS communication. +Path to a file that contains the certificate for TLS communication. .It Ic fingerprint Aq algo=hash .Pp -Finger print of the receiver's public key. -Currently only SHA256 algorithm is supported. -Certificate public key's fingerprint ready to be pasted into auditdistd +Fingerprint of the receiver's public key. +Currently only the SHA256 algorithm is supported. +The certificate public key's fingerprint ready to be pasted into the +.Nm auditdistd configuration file can be obtained by running: -.Bd -literal -offset +.Bd -literal # openssl x509 -in /etc/security/auditdistd.cert.pem -noout -fingerprint -sha256 | awk -F '[ =]' '{printf("%s=%s\\n", $1, $3)}' .Ed .It Ic password Aq password @@ -352,10 +355,10 @@ receiver { .Ed .Sh SEE ALSO .Xr audit 4 , -.Xr auditdistd 8 . +.Xr auditdistd 8 .Sh AUTHORS The .Nm auditdistd -was developed by +daemon was developed by .An Pawel Jakub Dawidek Aq pawel@dawidek.net under sponsorship of the FreeBSD Foundation. Modified: vendor/openbsm/dist/bin/auditdistd/auditdistd.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/auditdistd.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/auditdistd.h Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/auditdistd.h#2 $ */ #ifndef _AUDITDISTD_H_ Modified: vendor/openbsm/dist/bin/auditdistd/faccessat.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/faccessat.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/faccessat.h Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/faccessat.h#1 $ */ #ifndef _FACCESSAT_H_ Modified: vendor/openbsm/dist/bin/auditdistd/fstatat.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/fstatat.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/fstatat.h Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/fstatat.h#1 $ */ #ifndef _FSTATAT_H_ Modified: vendor/openbsm/dist/bin/auditdistd/openat.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/openat.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/openat.h Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/openat.h#1 $ */ #ifndef _OPENAT_H_ Modified: vendor/openbsm/dist/bin/auditdistd/parse.y ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/parse.y Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/parse.y Wed Dec 9 12:16:21 2015 (r292016) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/parse.y#5 $ */ #include Modified: vendor/openbsm/dist/bin/auditdistd/pjdlog.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/pjdlog.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/pjdlog.c Wed Dec 9 12:16:21 2015 (r292016) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/pjdlog.c#1 $ */ #include Modified: vendor/openbsm/dist/bin/auditdistd/pjdlog.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/pjdlog.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/pjdlog.h Wed Dec 9 12:16:21 2015 (r292016) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/pjdlog.h#1 $ */ #ifndef _PJDLOG_H_ Modified: vendor/openbsm/dist/bin/auditdistd/proto.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/proto.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/proto.c Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto.c#1 $ */ #include Modified: vendor/openbsm/dist/bin/auditdistd/proto.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/proto.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/proto.h Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto.h#1 $ */ #ifndef _PROTO_H_ Modified: vendor/openbsm/dist/bin/auditdistd/proto_common.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/proto_common.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/proto_common.c Wed Dec 9 12:16:21 2015 (r292016) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_common.c#1 $ */ #include Modified: vendor/openbsm/dist/bin/auditdistd/proto_impl.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/proto_impl.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/proto_impl.h Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_impl.h#1 $ */ #ifndef _PROTO_IMPL_H_ Modified: vendor/openbsm/dist/bin/auditdistd/proto_socketpair.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/proto_socketpair.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/proto_socketpair.c Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_socketpair.c#1 $ */ #include Modified: vendor/openbsm/dist/bin/auditdistd/proto_tcp.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/proto_tcp.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/proto_tcp.c Wed Dec 9 12:16:21 2015 (r292016) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_tcp.c#2 $ */ #include Modified: vendor/openbsm/dist/bin/auditdistd/proto_tls.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/proto_tls.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/proto_tls.c Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_tls.c#2 $ */ #include Modified: vendor/openbsm/dist/bin/auditdistd/proto_uds.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/proto_uds.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/proto_uds.c Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/proto_uds.c#2 $ */ /* UDS - UNIX Domain Socket */ Modified: vendor/openbsm/dist/bin/auditdistd/receiver.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/receiver.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/receiver.c Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/receiver.c#3 $ */ #include Modified: vendor/openbsm/dist/bin/auditdistd/renameat.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/renameat.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/renameat.h Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/renameat.h#1 $ */ #ifndef _RENAMEAT_H_ Modified: vendor/openbsm/dist/bin/auditdistd/sandbox.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/sandbox.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/sandbox.c Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sandbox.c#3 $ */ #include Modified: vendor/openbsm/dist/bin/auditdistd/sandbox.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/sandbox.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/sandbox.h Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sandbox.h#1 $ */ #ifndef _SANDBOX_H_ Modified: vendor/openbsm/dist/bin/auditdistd/sender.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/sender.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/sender.c Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sender.c#3 $ */ #include @@ -394,6 +392,7 @@ read_thread_wait(void) mtx_lock(&adist_remote_mtx); if (adhost->adh_reset) { +reset: adhost->adh_reset = false; if (trail_filefd(adist_trail) != -1) trail_close(adist_trail); @@ -408,6 +407,14 @@ read_thread_wait(void) while (trail_filefd(adist_trail) == -1) { newfile = true; wait_for_dir(); + /* + * We may have been disconnected and reconnected in the + * meantime, check if reset is set. + */ + mtx_lock(&adist_remote_mtx); + if (adhost->adh_reset) + goto reset; + mtx_unlock(&adist_remote_mtx); if (trail_filefd(adist_trail) == -1) trail_next(adist_trail); } @@ -634,7 +641,7 @@ recv_thread(void *arg __unused) * we can use that. */ if (TAILQ_EMPTY(&adist_recv_list)) { - rw_unlock(&adist_remote_lock); + mtx_unlock(&adist_recv_list_lock); continue; } mtx_unlock(&adist_recv_list_lock); Modified: vendor/openbsm/dist/bin/auditdistd/sigtimedwait.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/sigtimedwait.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/sigtimedwait.h Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/sigtimedwait.h#2 $ */ #ifndef _SIGTIMEDWAIT_H_ Modified: vendor/openbsm/dist/bin/auditdistd/strndup.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/strndup.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/strndup.h Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/strndup.h#1 $ */ #ifndef _STRNDUP_H_ Modified: vendor/openbsm/dist/bin/auditdistd/subr.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/subr.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/subr.c Wed Dec 9 12:16:21 2015 (r292016) @@ -22,8 +22,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/subr.c#3 $ */ #include @@ -228,6 +226,11 @@ wait_for_file_init(int fd) PJDLOG_ASSERT(fd != -1); #ifdef HAVE_KQUEUE + if (wait_for_file_kq != -1) { + close(wait_for_file_kq); + wait_for_file_kq = -1; + } + kq = kqueue(); if (kq == -1) { pjdlog_errno(LOG_WARNING, "kqueue() failed"); Modified: vendor/openbsm/dist/bin/auditdistd/subr.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/subr.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/subr.h Wed Dec 9 12:16:21 2015 (r292016) @@ -22,8 +22,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/subr.h#1 $ */ #ifndef _AUDITDISTD_SUBR_H_ Modified: vendor/openbsm/dist/bin/auditdistd/synch.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/synch.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/synch.h Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/synch.h#3 $ */ #ifndef _SYNCH_H_ Modified: vendor/openbsm/dist/bin/auditdistd/token.l ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/token.l Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/token.l Wed Dec 9 12:16:21 2015 (r292016) @@ -26,8 +26,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/token.l#2 $ */ #include @@ -74,7 +72,7 @@ sender { DP; return SENDER; } source { DP; return SOURCE; } timeout { DP; return TIMEOUT; } [0-9]+ { DP; yylval.num = atoi(yytext); return NUM; } -\"[a-zA-Z0-9_/ !@#\$%\^\&\*\(\)\+\=\|\;\?\,\.\-\:]*\" { DP; yylval.str = strndup(yytext + 1, strlen(yytext) - 2); return STR; } +\"[a-zA-Z0-9_/ !@#\$%\^\&\*\(\)\+\=\|\;\?\,\.\[\]\-\:]*\" { DP; yylval.str = strndup(yytext + 1, strlen(yytext) - 2); return STR; } \{ { DP; depth++; return OB; } \} { DP; depth--; return CB; } #.*$ /* ignore comments */; Modified: vendor/openbsm/dist/bin/auditdistd/trail.c ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/trail.c Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/trail.c Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/trail.c#3 $ */ #include Modified: vendor/openbsm/dist/bin/auditdistd/trail.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/trail.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/trail.h Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/trail.h#1 $ */ #ifndef _AUDITDISTD_TRAIL_H_ Modified: vendor/openbsm/dist/bin/auditdistd/unlinkat.h ============================================================================== --- vendor/openbsm/dist/bin/auditdistd/unlinkat.h Wed Dec 9 11:14:27 2015 (r292015) +++ vendor/openbsm/dist/bin/auditdistd/unlinkat.h Wed Dec 9 12:16:21 2015 (r292016) @@ -25,8 +25,6 @@ * 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. - * - * $P4: //depot/projects/trustedbsd/openbsm/bin/auditdistd/unlinkat.h#1 $ */ #ifndef _UNLINKAT_H_ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 9 12:25:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5E1F9D475D; Wed, 9 Dec 2015 12:25:04 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6A4BE17AE; Wed, 9 Dec 2015 12:25:04 +0000 (UTC) (envelope-from brueffer@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9CP3SB063420; Wed, 9 Dec 2015 12:25:03 GMT (envelope-from brueffer@FreeBSD.org) Received: (from brueffer@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9CP3PQ063419; Wed, 9 Dec 2015 12:25:03 GMT (envelope-from brueffer@FreeBSD.org) Message-Id: <201512091225.tB9CP3PQ063419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brueffer set sender to brueffer@FreeBSD.org using -f From: Christian Brueffer Date: Wed, 9 Dec 2015 12:25:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292017 - vendor/openbsm/1.2-ALPHA-4 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 12:25:04 -0000 Author: brueffer Date: Wed Dec 9 12:25:03 2015 New Revision: 292017 URL: https://svnweb.freebsd.org/changeset/base/292017 Log: Tag OpenBSM 1.2-alpha4. Added: vendor/openbsm/1.2-ALPHA-4/ - copied from r292016, vendor/openbsm/dist/ From owner-svn-src-all@freebsd.org Wed Dec 9 16:43:24 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3EFE9D5321; Wed, 9 Dec 2015 16:43:24 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from mail.mahoroba.org (ent.mahoroba.org [IPv6:2001:2f0:104:8010::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "asuka.mahoroba.org", Issuer "ca.mahoroba.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 560E31B5A; Wed, 9 Dec 2015 16:43:24 +0000 (UTC) (envelope-from ume@mahoroba.org) Received: from vsuiko.mahoroba.org (vsuiko.mahoroba.org [IPv6:2001:2f0:104:8010:a00:27ff:feb0:c2e]) (user=ume mech=DIGEST-MD5 bits=0) by mail.mahoroba.org (8.15.2/8.15.2) with ESMTPSA/inet6 id tB9GhDjj085364 (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Thu, 10 Dec 2015 01:43:17 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Thu, 10 Dec 2015 01:43:12 +0900 Message-ID: From: Hajimu UMEMOTO To: Bruce Evans Cc: Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291994 - head/include In-Reply-To: <20151209173008.A828@besplex.bde.org> References: <201512081609.tB8G9mfd053070@repo.freebsd.org> <20151209173008.A828@besplex.bde.org> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) Emacs/24.5 Mule/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 10.2-STABLE X-PGP-Key: http://www.mahoroba.org/~ume/publickey.asc X-PGP-Fingerprint: 1F00 0B9E 2164 70FC 6DC5 BF5F 04E9 F086 BF90 71FE MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Thu, 10 Dec 2015 01:43:18 +0900 (JST) X-Virus-Scanned: clamav-milter 0.98.7 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-3.5 required=5.0 tests=ALL_TRUSTED,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on asuka.mahoroba.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 16:43:24 -0000 Hi, >>>>> On Wed, 9 Dec 2015 18:19:16 +1100 (EST) >>>>> Bruce Evans said: brde> resolv.h already had massinve namespace pollution and style bugs in brde> its includes. One more include of a header that is relatively clean brde> since it is tiny and was designed for minimising namespace pollution brde> makes little difference. I understood. Thank you for your detailed explanation. However, I realized that r289315 changed the size of struct __res_state. It broke binary backward compatibility. I think we still need to revert its change in struct __res_state and move them into struct __res_state_ext. Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@FreeBSD.org http://www.mahoroba.org/~ume/ From owner-svn-src-all@freebsd.org Wed Dec 9 17:01:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 452A09D618C; Wed, 9 Dec 2015 17:01:38 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [IPv6:2607:fc50:1000:7400:216:3eff:fe72:314f]) by mx1.freebsd.org (Postfix) with ESMTP id 2EBC917B7; Wed, 9 Dec 2015 17:01:38 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from sweettea.beer.town (unknown [76.164.8.130]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 53E1956489; Wed, 9 Dec 2015 11:01:37 -0600 (CST) Subject: Re: svn commit: r291994 - head/include To: Hajimu UMEMOTO , Bruce Evans References: <201512081609.tB8G9mfd053070@repo.freebsd.org> <20151209173008.A828@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Eric van Gyzen Message-ID: <56685E6D.5020403@FreeBSD.org> Date: Wed, 9 Dec 2015 11:01:33 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 17:01:38 -0000 On 12/09/2015 10:43, Hajimu UMEMOTO wrote: > Hi, > >>>>>> On Wed, 9 Dec 2015 18:19:16 +1100 (EST) >>>>>> Bruce Evans said: > > brde> resolv.h already had massinve namespace pollution and style bugs in > brde> its includes. One more include of a header that is relatively clean > brde> since it is tiny and was designed for minimising namespace pollution > brde> makes little difference. > > I understood. Thank you for your detailed explanation. > However, I realized that r289315 changed the size of struct > __res_state. It broke binary backward compatibility. I think we > still need to revert its change in struct __res_state and move them > into struct __res_state_ext. Thank you both for your input. I agree with moving the fields. https://reviews.freebsd.org/D4472 Eric From owner-svn-src-all@freebsd.org Wed Dec 9 18:07:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98C269D5EFA; Wed, 9 Dec 2015 18:07:27 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 737E61736; Wed, 9 Dec 2015 18:07:27 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9I7QwF069316; Wed, 9 Dec 2015 18:07:26 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9I7QEt069315; Wed, 9 Dec 2015 18:07:26 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201512091807.tB9I7QEt069315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 9 Dec 2015 18:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292019 - head/usr.sbin/iostat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 18:07:27 -0000 Author: asomers Date: Wed Dec 9 18:07:26 2015 New Revision: 292019 URL: https://svnweb.freebsd.org/changeset/base/292019 Log: When iostat(8) receives SIGINT while running with "-w" or "-c", it will now print statistics one more time before exiting. Also, it now implements the wait using setitimer instead of sleep, so the waits will be more consistent when the system is heavily loaded. MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4473 Modified: head/usr.sbin/iostat/iostat.c Modified: head/usr.sbin/iostat/iostat.c ============================================================================== --- head/usr.sbin/iostat/iostat.c Wed Dec 9 13:45:51 2015 (r292018) +++ head/usr.sbin/iostat/iostat.c Wed Dec 9 18:07:26 2015 (r292019) @@ -110,6 +110,7 @@ #include #include #include +#include #include #include #include @@ -135,6 +136,8 @@ struct device_selection *dev_select; int maxshowdevs; volatile sig_atomic_t headercount; volatile sig_atomic_t wresized; /* Tty resized, when non-zero. */ +volatile sig_atomic_t alarm_rang; +volatile sig_atomic_t return_requested; unsigned short wrows; /* Current number of tty rows. */ int dflag = 0, Iflag = 0, Cflag = 0, Tflag = 0, oflag = 0, Kflag = 0; int xflag = 0, zflag = 0; @@ -143,6 +146,8 @@ int xflag = 0, zflag = 0; static void usage(void); static void needhdr(int signo); static void needresize(int signo); +static void needreturn(int signo); +static void alarm_clock(int signo); static void doresize(void); static void phdr(void); static void devstats(int perf_select, long double etime, int havelast); @@ -172,6 +177,7 @@ main(int argc, char **argv) int count = 0, waittime = 0; char *memf = NULL, *nlistf = NULL; struct devstat_match *matches; + struct itimerval alarmspec; int num_matches = 0; char errbuf[_POSIX2_LINE_MAX]; kvm_t *kd = NULL; @@ -442,10 +448,28 @@ main(int argc, char **argv) wrows = IOSTAT_DEFAULT_ROWS; } + /* + * Register a SIGINT handler so that we can print out final statistics + * when we get that signal + */ + (void)signal(SIGINT, needreturn); + + /* + * Register a SIGALRM handler to implement sleeps if the user uses the + * -c or -w options + */ + (void)signal(SIGALRM, alarm_clock); + alarmspec.it_interval.tv_sec = waittime / 1000; + alarmspec.it_interval.tv_usec = 1000 * (waittime % 1000); + alarmspec.it_value.tv_sec = waittime / 1000; + alarmspec.it_value.tv_usec = 1000 * (waittime % 1000); + setitimer(ITIMER_REAL, &alarmspec, NULL); + for (headercount = 1;;) { struct devinfo *tmp_dinfo; long tmp; long double etime; + sigset_t sigmask, oldsigmask; if (Tflag > 0) { if ((readvar(kd, "kern.tty_nin", X_TTY_NIN, &cur.tk_nin, @@ -599,10 +623,23 @@ main(int argc, char **argv) } fflush(stdout); - if (count >= 0 && --count <= 0) + if ((count >= 0 && --count <= 0) || return_requested) break; - usleep(waittime * 1000); + /* + * Use sigsuspend to safely sleep until either signal is + * received + */ + alarm_rang = 0; + sigemptyset(&sigmask); + sigaddset(&sigmask, SIGINT); + sigaddset(&sigmask, SIGALRM); + sigprocmask(SIG_BLOCK, &sigmask, &oldsigmask); + while (! (alarm_rang || return_requested) ) { + sigsuspend(&oldsigmask); + } + sigprocmask(SIG_UNBLOCK, &sigmask, NULL); + havelast = 1; } @@ -633,6 +670,24 @@ needresize(int signo) } /* + * Record the alarm so the main loop can break its sleep + */ +void +alarm_clock(int signo) +{ + alarm_rang = 1; +} + +/* + * Request that the main loop exit soon + */ +void +needreturn(int signo) +{ + return_requested = 1; +} + +/* * Update the global `wrows' count of terminal rows. */ void From owner-svn-src-all@freebsd.org Wed Dec 9 18:55:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D81B29D5232; Wed, 9 Dec 2015 18:55:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92B1110D3; Wed, 9 Dec 2015 18:55:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9ItPGf083859; Wed, 9 Dec 2015 18:55:25 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9ItPfW083858; Wed, 9 Dec 2015 18:55:25 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201512091855.tB9ItPfW083858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Wed, 9 Dec 2015 18:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292020 - head/sbin/devd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 18:55:26 -0000 Author: asomers Date: Wed Dec 9 18:55:25 2015 New Revision: 292020 URL: https://svnweb.freebsd.org/changeset/base/292020 Log: Increase devd's client socket buffer size to 256KB. This is not as large as it looks, because we'll hit the sockbuf's mbuf limit long before hitting its data limit. A 256KB data limit allows creating a ZFS pool on about 450 drives without overflowing the client socket buffers. MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4476 Modified: head/sbin/devd/devd.cc Modified: head/sbin/devd/devd.cc ============================================================================== --- head/sbin/devd/devd.cc Wed Dec 9 18:07:26 2015 (r292019) +++ head/sbin/devd/devd.cc Wed Dec 9 18:55:25 2015 (r292020) @@ -108,15 +108,26 @@ __FBSDID("$FreeBSD$"); /* * Since the client socket is nonblocking, we must increase its send buffer to * handle brief event storms. On FreeBSD, AF_UNIX sockets don't have a receive - * buffer, so the client can't increate the buffersize by itself. + * buffer, so the client can't increase the buffersize by itself. * * For example, when creating a ZFS pool, devd emits one 165 character - * resource.fs.zfs.statechange message for each vdev in the pool. A 64k - * buffer has enough space for almost 400 drives, which would be very large but - * not impossibly large pool. A 128k buffer has enough space for 794 drives, - * which is more than can fit in a rack with modern technology. + * resource.fs.zfs.statechange message for each vdev in the pool. The kernel + * allocates a 4608B mbuf for each message. Modern technology places a limit of + * roughly 450 drives/rack, and it's unlikely that a zpool will ever be larger + * than that. + * + * 450 drives * 165 bytes / drive = 74250B of data in the sockbuf + * 450 drives * 4608B / drive = 2073600B of mbufs in the sockbuf + * + * We can't directly set the sockbuf's mbuf limit, but we can do it indirectly. + * The kernel sets it to the minimum of a hard-coded maximum value and sbcc * + * kern.ipc.sockbuf_waste_factor, where sbcc is the socket buffer size set by + * the user. The default value of kern.ipc.sockbuf_waste_factor is 8. If we + * set the bufsize to 256k and use the kern.ipc.sockbuf_waste_factor, then the + * kernel will set the mbuf limit to 2MB, which is just large enough for 450 + * drives. It also happens to be the same as the hardcoded maximum value. */ -#define CLIENT_BUFSIZE 131072 +#define CLIENT_BUFSIZE 262144 using namespace std; From owner-svn-src-all@freebsd.org Wed Dec 9 19:19:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 765169D610B; Wed, 9 Dec 2015 19:19:37 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 445EF1FB1; Wed, 9 Dec 2015 19:19:37 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9JJaYA089834; Wed, 9 Dec 2015 19:19:36 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9JJa3V089833; Wed, 9 Dec 2015 19:19:36 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201512091919.tB9JJa3V089833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Wed, 9 Dec 2015 19:19:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292021 - head/lib/libopenbsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 19:19:37 -0000 Author: rodrigc Date: Wed Dec 9 19:19:36 2015 New Revision: 292021 URL: https://svnweb.freebsd.org/changeset/base/292021 Log: Merge from OpenBSD: revision 1.11 date: 2015/11/27 01:57:59; author: mmcc; state: Exp; lines: +2 -3 Remove three NULL-checks before free(). ok millert@ Modified: head/lib/libopenbsd/imsg.c Modified: head/lib/libopenbsd/imsg.c ============================================================================== --- head/lib/libopenbsd/imsg.c Wed Dec 9 18:55:25 2015 (r292020) +++ head/lib/libopenbsd/imsg.c Wed Dec 9 19:19:36 2015 (r292021) @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.10 2015/07/19 07:18:59 nicm Exp $ */ +/* $OpenBSD: imsg.c,v 1.11 2015/11/27 01:57:59 mmcc Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -120,8 +120,7 @@ again: } fail: - if (ifd) - free(ifd); + free(ifd); return (n); } From owner-svn-src-all@freebsd.org Wed Dec 9 19:21:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5526C9D62CB; Wed, 9 Dec 2015 19:21:02 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 11C331171; Wed, 9 Dec 2015 19:21:01 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9JL0UM090557; Wed, 9 Dec 2015 19:21:00 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9JL0D3090556; Wed, 9 Dec 2015 19:21:00 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201512091921.tB9JL0D3090556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Wed, 9 Dec 2015 19:21:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292022 - head/lib/libopenbsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 19:21:02 -0000 Author: rodrigc Date: Wed Dec 9 19:21:00 2015 New Revision: 292022 URL: https://svnweb.freebsd.org/changeset/base/292022 Log: Merge from OpenBSD: revision 1.12 date: 2015/12/05 13:06:52; author: claudio; state: Exp; lines: +4 -6 Do not loop on EAGAIN in imsg_read(). Better to return the error to the caller and let him do another poll loop. This fixes spinning relayd processes seen on busy TLS relays. OK benno@ henning@ Modified: head/lib/libopenbsd/imsg.c Modified: head/lib/libopenbsd/imsg.c ============================================================================== --- head/lib/libopenbsd/imsg.c Wed Dec 9 19:19:36 2015 (r292021) +++ head/lib/libopenbsd/imsg.c Wed Dec 9 19:21:00 2015 (r292022) @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.11 2015/11/27 01:57:59 mmcc Exp $ */ +/* $OpenBSD: imsg.c,v 1.12 2015/12/05 13:06:52 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -82,11 +82,9 @@ again: } if ((n = recvmsg(ibuf->fd, &msg, 0)) == -1) { - if (errno == EMSGSIZE) - goto fail; - if (errno != EINTR && errno != EAGAIN) - goto fail; - goto again; + if (errno == EINTR) + goto again; + goto fail; } ibuf->r.wpos += n; From owner-svn-src-all@freebsd.org Wed Dec 9 19:22:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDE749D63F3; Wed, 9 Dec 2015 19:22:21 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BBD16152D; Wed, 9 Dec 2015 19:22:21 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9JMK7V092599; Wed, 9 Dec 2015 19:22:20 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9JMK3t092598; Wed, 9 Dec 2015 19:22:20 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201512091922.tB9JMK3t092598@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Wed, 9 Dec 2015 19:22:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292023 - head/lib/libopenbsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 19:22:22 -0000 Author: rodrigc Date: Wed Dec 9 19:22:20 2015 New Revision: 292023 URL: https://svnweb.freebsd.org/changeset/base/292023 Log: Merge from OpenBSD: revision 1.13 date: 2015/12/09 11:54:12; author: tb; state: Exp; lines: +2 -2 Add a cast to silence a compiler warning by clang on FreeBSD. From Craig Rodrigues. ok tedu@ Modified: head/lib/libopenbsd/imsg.c Modified: head/lib/libopenbsd/imsg.c ============================================================================== --- head/lib/libopenbsd/imsg.c Wed Dec 9 19:21:00 2015 (r292022) +++ head/lib/libopenbsd/imsg.c Wed Dec 9 19:22:20 2015 (r292023) @@ -1,4 +1,4 @@ -/* $OpenBSD: imsg.c,v 1.12 2015/12/05 13:06:52 claudio Exp $ */ +/* $OpenBSD: imsg.c,v 1.13 2015/12/09 11:54:12 tb Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -74,7 +74,7 @@ imsg_read(struct imsgbuf *ibuf) again: if (getdtablecount() + imsg_fd_overhead + - (CMSG_SPACE(sizeof(int))-CMSG_SPACE(0))/sizeof(int) + (int)((CMSG_SPACE(sizeof(int))-CMSG_SPACE(0))/sizeof(int)) >= getdtablesize()) { errno = EAGAIN; free(ifd); From owner-svn-src-all@freebsd.org Wed Dec 9 19:25:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 314BF9D6652; Wed, 9 Dec 2015 19:25:47 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03A9C18D5; Wed, 9 Dec 2015 19:25:46 +0000 (UTC) (envelope-from rodrigc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9JPkig092796; Wed, 9 Dec 2015 19:25:46 GMT (envelope-from rodrigc@FreeBSD.org) Received: (from rodrigc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9JPknE092795; Wed, 9 Dec 2015 19:25:46 GMT (envelope-from rodrigc@FreeBSD.org) Message-Id: <201512091925.tB9JPknE092795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rodrigc set sender to rodrigc@FreeBSD.org using -f From: Craig Rodrigues Date: Wed, 9 Dec 2015 19:25:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292024 - head/lib/libopenbsd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 19:25:47 -0000 Author: rodrigc Date: Wed Dec 9 19:25:45 2015 New Revision: 292024 URL: https://svnweb.freebsd.org/changeset/base/292024 Log: Remove NO_WERROR, after fix from r292023. Modified: head/lib/libopenbsd/Makefile Modified: head/lib/libopenbsd/Makefile ============================================================================== --- head/lib/libopenbsd/Makefile Wed Dec 9 19:22:20 2015 (r292023) +++ head/lib/libopenbsd/Makefile Wed Dec 9 19:25:45 2015 (r292024) @@ -11,5 +11,4 @@ CFLAGS+= -I${.CURDIR} WARNS= 3 -NO_WERROR= .include From owner-svn-src-all@freebsd.org Wed Dec 9 21:34:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 177009D6F95; Wed, 9 Dec 2015 21:34:05 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A47E31AC3; Wed, 9 Dec 2015 21:34:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9LY3XQ031579; Wed, 9 Dec 2015 21:34:03 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9LY3YM031577; Wed, 9 Dec 2015 21:34:03 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512092134.tB9LY3YM031577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 9 Dec 2015 21:34:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292025 - in stable/10/usr.sbin/pw: . tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 21:34:05 -0000 Author: bapt Date: Wed Dec 9 21:34:03 2015 New Revision: 292025 URL: https://svnweb.freebsd.org/changeset/base/292025 Log: MFC: r291657 Fix handling of numeric-only names with pw lock Add a regression test about it PR: 204968 Modified: stable/10/usr.sbin/pw/pw_user.c stable/10/usr.sbin/pw/tests/pw_lock.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pw/pw_user.c ============================================================================== --- stable/10/usr.sbin/pw/pw_user.c Wed Dec 9 19:25:45 2015 (r292024) +++ stable/10/usr.sbin/pw/pw_user.c Wed Dec 9 21:34:03 2015 (r292025) @@ -272,7 +272,7 @@ pw_userlock(char *arg1, int mode) char *passtmp = NULL; char *name; bool locked = false; - uid_t id; + uid_t id = (uid_t)-1; if (geteuid() != 0) errx(EX_NOPERM, "you must be root"); @@ -280,16 +280,19 @@ pw_userlock(char *arg1, int mode) if (arg1 == NULL) errx(EX_DATAERR, "username or id required"); - if (arg1[strspn(arg1, "0123456789")] == '\0') { - id = pw_checkid(arg1, UID_MAX); - name = NULL; - } else - name = arg1; - - pwd = (name != NULL) ? GETPWNAM(pw_checkname(name, 0)) : GETPWUID(id); + name = arg1; + if (arg1[strspn(name, "0123456789")] == '\0') + id = pw_checkid(name, UID_MAX); + + pwd = GETPWNAM(pw_checkname(name, 0)); + if (pwd == NULL && id != (uid_t)-1) { + pwd = GETPWUID(id); + if (pwd != NULL) + name = pwd->pw_name; + } if (pwd == NULL) { - if (name == NULL) - errx(EX_NOUSER, "no such uid `%ju'", (uintmax_t) id); + if (id == (uid_t)-1) + errx(EX_NOUSER, "no such name or uid `%ju'", (uintmax_t) id); errx(EX_NOUSER, "no such user `%s'", name); } Modified: stable/10/usr.sbin/pw/tests/pw_lock.sh ============================================================================== --- stable/10/usr.sbin/pw/tests/pw_lock.sh Wed Dec 9 19:25:45 2015 (r292024) +++ stable/10/usr.sbin/pw/tests/pw_lock.sh Wed Dec 9 21:34:03 2015 (r292025) @@ -16,7 +16,27 @@ user_locking_body() { grep "^test:\*:1001:" $HOME/master.passwd } +atf_test_case numeric_locking cleanup +numeric_locking_body() { + populate_etc_skel + ${PW} useradd test || atf_fail "Creating test user" + ${PW} lock 1001 || atf_fail "Locking the user" + atf_check -s exit:0 -o match:"^test:\*LOCKED\*\*:1001:" \ + grep "^test:\*LOCKED\*\*:1001:" $HOME/master.passwd + ${PW} unlock 1001 || atf_fail "Unlocking the user" + atf_check -s exit:0 -o match:"^test:\*:1001:" \ + grep "^test:\*:1001:" $HOME/master.passwd + # Now numeric names + ${PW} useradd -n 1001 || atf_fail "Creating test user" + ${PW} lock 1001 || atf_fail "Locking the user" + atf_check -s exit:0 -o match:"^1001:\*LOCKED\*\*:1002:" \ + grep "^1001:\*LOCKED\*\*:1002:" $HOME/master.passwd + ${PW} unlock 1001 || atf_fail "Unlocking the user" + atf_check -s exit:0 -o match:"^1001:\*:1002:" \ + grep "^1001:\*:1002:" $HOME/master.passwd +} atf_init_test_cases() { atf_add_test_case user_locking + atf_add_test_case numeric_locking } From owner-svn-src-all@freebsd.org Wed Dec 9 21:38:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E3289D52FE; Wed, 9 Dec 2015 21:38:28 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E13AE1DD4; Wed, 9 Dec 2015 21:38:27 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9LcQwT031822; Wed, 9 Dec 2015 21:38:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9LcQOE031821; Wed, 9 Dec 2015 21:38:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512092138.tB9LcQOE031821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 9 Dec 2015 21:38:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292026 - stable/10/usr.sbin/pw X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 21:38:28 -0000 Author: bapt Date: Wed Dec 9 21:38:26 2015 New Revision: 292026 URL: https://svnweb.freebsd.org/changeset/base/292026 Log: MFC: r291658 pw_checkname since the beginning is too strict on GECOS field, relax it a bit so gecos can be used to store multibytes data. This was unseen before FreeBSD 10.2 as this validation function was motly unused since FreeBSD 10.2 the usage of this function has been generalized to improve Reported by: des Modified: stable/10/usr.sbin/pw/pw_user.c Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/pw/pw_user.c ============================================================================== --- stable/10/usr.sbin/pw/pw_user.c Wed Dec 9 21:34:03 2015 (r292025) +++ stable/10/usr.sbin/pw/pw_user.c Wed Dec 9 21:38:26 2015 (r292026) @@ -640,7 +640,8 @@ pw_checkname(char *name, int gecos) } if (!reject) { while (*ch) { - if (strchr(badchars, *ch) != NULL || *ch < ' ' || + if (strchr(badchars, *ch) != NULL || + (!gecos && *ch < ' ') || *ch == 127) { reject = 1; break; From owner-svn-src-all@freebsd.org Wed Dec 9 21:49:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81CE99D5ACC; Wed, 9 Dec 2015 21:49:32 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46F8B12DD; Wed, 9 Dec 2015 21:49:32 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9LnVmH034872; Wed, 9 Dec 2015 21:49:31 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9LnVJX034871; Wed, 9 Dec 2015 21:49:31 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201512092149.tB9LnVJX034871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 9 Dec 2015 21:49:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292027 - head/usr.sbin/pmcstudy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 21:49:32 -0000 Author: rrs Date: Wed Dec 9 21:49:31 2015 New Revision: 292027 URL: https://svnweb.freebsd.org/changeset/base/292027 Log: Proper support of Broadwell tool by the pmc_study based on the Intel Itune guide for 5th generation processors. There is at least one formula missing in that guide, which I extrapolated and put a ? by in the help. Sponsored by: Netflix Inc Modified: head/usr.sbin/pmcstudy/pmcstudy.c Modified: head/usr.sbin/pmcstudy/pmcstudy.c ============================================================================== --- head/usr.sbin/pmcstudy/pmcstudy.c Wed Dec 9 21:38:26 2015 (r292026) +++ head/usr.sbin/pmcstudy/pmcstudy.c Wed Dec 9 21:49:31 2015 (r292027) @@ -443,7 +443,6 @@ explain_name_has(const char *name) printf("If the value printed is %s we may have the ability to improve performance\n", mythresh); } - static struct counters * find_counter(struct counters *base, const char *name) { @@ -590,6 +589,47 @@ br_mispredictib(struct counters *cpu, in } static int +br_mispredict_broad(struct counters *cpu, int pos) +{ + struct counters *brctr; + struct counters *unhalt; + struct counters *clear; + struct counters *uops; + struct counters *uops_ret; + struct counters *recv; + int ret; + double br, cl, uo, uo_r, re, con, un, res; + + con = 4.0; + + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + brctr = find_counter(cpu, "BR_MISP_RETIRED.ALL_BRANCHES"); + clear = find_counter(cpu, "MACHINE_CLEARS.CYCLES"); + uops = find_counter(cpu, "UOPS_ISSUED.ANY"); + uops_ret = find_counter(cpu, "UOPS_RETIRED.RETIRE_SLOTS"); + recv = find_counter(cpu, "INT_MISC.RECOVERY_CYCLES"); + + if (pos != -1) { + un = unhalt->vals[pos] * 1.0; + br = brctr->vals[pos] * 1.0; + cl = clear->vals[pos] * 1.0; + uo = uops->vals[pos] * 1.0; + uo_r = uops_ret->vals[pos] * 1.0; + re = recv->vals[pos] * 1.0; + } else { + un = unhalt->sum * 1.0; + br = brctr->sum * 1.0; + cl = clear->sum * 1.0; + uo = uops->sum * 1.0; + uo_r = uops_ret->sum * 1.0; + re = recv->sum * 1.0; + } + res = br / (br + cl) * (uo - uo_r + con * re) / (un * con); + ret = printf("%1.3f", res); + return(ret); +} + +static int splitloadib(struct counters *cpu, int pos) { int ret; @@ -717,6 +757,35 @@ contested_has(struct counters *cpu, int return(ret); } +static int +contestedbroad(struct counters *cpu, int pos) +{ + /* 6 - (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84) / CPU_CLK_UNHALTED.THREAD_P (thresh >.05) */ + int ret; + struct counters *mem; + struct counters *mem2; + struct counters *unhalt; + double con, un, memd, memtoo, res; + + con = 84.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + mem = find_counter(cpu, "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM"); + mem2 = find_counter(cpu,"MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS"); + + if (pos != -1) { + memd = mem->vals[pos] * 1.0; + memtoo = mem2->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + } else { + memd = mem->sum * 1.0; + memtoo = mem2->sum * 1.0; + un = unhalt->sum * 1.0; + } + res = ((memd * con) + memtoo)/un; + ret = printf("%1.3f", res); + return(ret); +} + static int blockstoreforward(struct counters *cpu, int pos) @@ -898,6 +967,33 @@ cache2has(struct counters *cpu, int pos) } static int +cache2broad(struct counters *cpu, int pos) +{ + /* + * (29 * MEM_LOAD_UOPS_RETIRED.LLC_HIT / CPU_CLK_UNHALTED.THREAD_P (thresh >.2) + */ + int ret; + struct counters *mem; + struct counters *unhalt; + double con, un, me, res; + + con = 36.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + mem = find_counter(cpu, "MEM_LOAD_UOPS_RETIRED.L3_HIT"); + if (pos != -1) { + me = mem->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + } else { + me = mem->sum * 1.0; + un = unhalt->sum * 1.0; + } + res = (con * me)/un; + ret = printf("%1.3f", res); + return(ret); +} + + +static int cache1(struct counters *cpu, int pos) { /* 9 - (MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS * 180) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) */ @@ -947,6 +1043,31 @@ cache1ib(struct counters *cpu, int pos) static int +cache1broad(struct counters *cpu, int pos) +{ + /* 9 - (MEM_LOAD_UOPS_L3_MISS_RETIRED.LCOAL_DRAM * 180) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) */ + int ret; + struct counters *mem; + struct counters *unhalt; + double con, un, me, res; + + con = 180.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + mem = find_counter(cpu, "MEM_LOAD_UOPS_RETIRED.L3_MISS"); + if (pos != -1) { + me = mem->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + } else { + me = mem->sum * 1.0; + un = unhalt->sum * 1.0; + } + res = (me * con)/un; + ret = printf("%1.3f", res); + return(ret); +} + + +static int dtlb_missload(struct counters *cpu, int pos) { /* 10 - ((DTLB_LOAD_MISSES.STLB_HIT * 7) + DTLB_LOAD_MISSES.WALK_DURATION) / CPU_CLK_UNHALTED.THREAD_P (t >=.1) */ @@ -1026,6 +1147,35 @@ itlb_miss(struct counters *cpu, int pos) return(ret); } + +static int +itlb_miss_broad(struct counters *cpu, int pos) +{ + /* (7 * ITLB_MISSES.STLB_HIT_4K + ITLB_MISSES.WALK_DURATION) / CPU_CLK_UNTHREAD_P */ + int ret; + struct counters *itlb; + struct counters *unhalt; + struct counters *four_k; + double un, d1, res, k; + + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + itlb = find_counter(cpu, "ITLB_MISSES.WALK_DURATION"); + four_k = find_counter(cpu, "ITLB_MISSES.STLB_HIT_4K"); + if (pos != -1) { + d1 = itlb->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + k = four_k->vals[pos] * 1.0; + } else { + d1 = itlb->sum * 1.0; + un = unhalt->sum * 1.0; + k = four_k->sum * 1.0; + } + res = (7.0 * k + d1)/un; + ret = printf("%1.3f", res); + return(ret); +} + + static int icache_miss(struct counters *cpu, int pos) { @@ -1163,6 +1313,39 @@ clears(struct counters *cpu, int pos) } static int +clears_broad(struct counters *cpu, int pos) +{ + int ret; + struct counters *clr1, *clr2, *clr3, *cyc; + struct counters *unhalt; + double con, un, cl1, cl2, cl3, cy, res; + + con = 100.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + clr1 = find_counter(cpu, "MACHINE_CLEARS.MEMORY_ORDERING"); + clr2 = find_counter(cpu, "MACHINE_CLEARS.SMC"); + clr3 = find_counter(cpu, "MACHINE_CLEARS.MASKMOV"); + cyc = find_counter(cpu, "MACHINE_CLEARS.CYCLES"); + if (pos != -1) { + cl1 = clr1->vals[pos] * 1.0; + cl2 = clr2->vals[pos] * 1.0; + cl3 = clr3->vals[pos] * 1.0; + cy = cyc->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + } else { + cl1 = clr1->sum * 1.0; + cl2 = clr2->sum * 1.0; + cl3 = clr3->sum * 1.0; + cy = cyc->sum * 1.0; + un = unhalt->sum * 1.0; + } + /* Formula not listed but extrapulated to add the cy ?? */ + res = ((cl1 + cl2 + cl3 + cy) * con)/un; + ret = printf("%1.3f", res); + return(ret); +} + +static int microassist(struct counters *cpu, int pos) { /* 14 - IDQ.MS_CYCLES / CPU_CLK_UNHALTED.THREAD_P (thresh > .05) */ @@ -1186,6 +1369,36 @@ microassist(struct counters *cpu, int po return(ret); } +static int +microassist_broad(struct counters *cpu, int pos) +{ + int ret; + struct counters *idq; + struct counters *unhalt; + struct counters *uopiss; + struct counters *uopret; + double un, id, res, con, uoi, uor; + + con = 4.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + idq = find_counter(cpu, "IDQ.MS_UOPS"); + uopiss = find_counter(cpu, "UOPS_ISSUED.ANY"); + uopret = find_counter(cpu, "UOPS_RETIRED.RETIRE_SLOTS"); + if (pos != -1) { + id = idq->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + uoi = uopiss->vals[pos] * 1.0; + uor = uopret->vals[pos] * 1.0; + } else { + id = idq->sum * 1.0; + un = unhalt->sum * 1.0; + uoi = uopiss->sum * 1.0; + uor = uopret->sum * 1.0; + } + res = (uor/uoi) * (id/(un * con)); + ret = printf("%1.3f", res); + return(ret); +} static int aliasing(struct counters *cpu, int pos) @@ -1212,6 +1425,31 @@ aliasing(struct counters *cpu, int pos) } static int +aliasing_broad(struct counters *cpu, int pos) +{ + /* 15 - (LD_BLOCKS_PARTIAL.ADDRESS_ALIAS * 5) / CPU_CLK_UNHALTED.THREAD_P (thresh > .1) */ + int ret; + struct counters *ld; + struct counters *unhalt; + double un, lds, con, res; + + con = 7.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + ld = find_counter(cpu, "LD_BLOCKS_PARTIAL.ADDRESS_ALIAS"); + if (pos != -1) { + lds = ld->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + } else { + lds = ld->sum * 1.0; + un = unhalt->sum * 1.0; + } + res = (lds * con)/un; + ret = printf("%1.3f", res); + return(ret); +} + + +static int fpassists(struct counters *cpu, int pos) { /* 16 - FP_ASSIST.ANY/INST_RETIRED.ANY_P */ @@ -1530,6 +1768,131 @@ static struct cpu_entry haswell[HASWELL_ static void +explain_name_broad(const char *name) +{ + const char *mythresh; + if (strcmp(name, "eff1") == 0) { + printf("Examine (UOPS_RETIRED.RETIRE_SLOTS)/(4 *CPU_CLK_UNHALTED.THREAD_P)\n"); + mythresh = "thresh < .75"; + } else if (strcmp(name, "eff2") == 0) { + printf("Examine CPU_CLK_UNHALTED.THREAD_P/INST_RETIRED.ANY_P\n"); + mythresh = "thresh > 1.0"; + } else if (strcmp(name, "itlbmiss") == 0) { + printf("Examine (7 * ITLB_MISSES_STLB_HIT_4K + ITLB_MISSES.WALK_DURATION)/ CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh > .05"; + } else if (strcmp(name, "icachemiss") == 0) { + printf("Examine ( 36.0 * CACHE.MISSES)/ CPU_CLK_UNHALTED.THREAD_P ??? may not be right \n"); + mythresh = "thresh > .05"; + } else if (strcmp(name, "lcpstall") == 0) { + printf("Examine ILD_STALL.LCP/CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh > .05"; + } else if (strcmp(name, "cache1") == 0) { + printf("Examine (MEM_LOAD_UOPS_LLC_MISS_RETIRED.LOCAL_DRAM * 180) / CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh >= .1"; + } else if (strcmp(name, "cache2") == 0) { + printf("Examine (36.0 * MEM_LOAD_UOPS_RETIRED.L3_HIT / CPU_CLK_UNHALTED.THREAD_P)\n"); + mythresh = "thresh >= .2"; + } else if (strcmp(name, "contested") == 0) { + printf("Examine ((MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84) + MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS)/ CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh >= .05"; + } else if (strcmp(name, "datashare") == 0) { + printf("Examine (MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT * 72)/CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh > .05"; + } else if (strcmp(name, "blockstorefwd") == 0) { + printf("Examine (LD_BLOCKS_STORE_FORWARD * 13) / CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh >= .05"; + } else if (strcmp(name, "aliasing_4k") == 0) { + printf("Examine (LD_BLOCKS_PARTIAL.ADDRESS_ALIAS * 7) / CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh >= .1"; + } else if (strcmp(name, "dtlbmissload") == 0) { + printf("Examine (((DTLB_LOAD_MISSES.STLB_HIT * 7) + DTLB_LOAD_MISSES.WALK_DURATION)\n"); + printf(" / CPU_CLK_UNHALTED.THREAD_P)\n"); + mythresh = "thresh >= .1"; + + } else if (strcmp(name, "br_miss") == 0) { + printf("Examine BR_MISP_RETIRED.ALL_BRANCHS_PS / (BR_MISP_RETIED.ALL_BRANCHES_PS + MACHINE_CLEARS.COUNT) *\n"); + printf(" (UOPS_ISSUEDF.ANY - UOPS_RETIRED.RETIRE_SLOTS + 4 * INT_MISC.RECOVERY_CYCLES) /\n"); + printf("CPU_CLK_UNHALTED.THREAD * 4)\n"); + mythresh = "thresh >= .2"; + } else if (strcmp(name, "clears") == 0) { + printf("Examine ((MACHINE_CLEARS.MEMORY_ORDERING + \n"); + printf(" MACHINE_CLEARS.SMC + \n"); + printf(" MACHINE_CLEARS.MASKMOV ) * 100 ) / CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "thresh >= .02"; + } else if (strcmp(name, "fpassist") == 0) { + printf("Examine FP_ASSIST.ANY/INST_RETIRED.ANY_P\n"); + mythresh = "look for a excessive value"; + } else if (strcmp(name, "otherassistavx") == 0) { + printf("Examine (OTHER_ASSISTS.AVX_TO_SSE * 75)/CPU_CLK_UNHALTED.THREAD_P\n"); + mythresh = "look for a excessive value"; + } else if (strcmp(name, "microassist") == 0) { + printf("Examine (UOPS_RETIRED.RETIRE_SLOTS/UOPS_ISSUED.ANY) * (IDQ.MS_CYCLES / (4 * CPU_CLK_UNHALTED.THREAD_P)\n"); + printf("***We use IDQ.MS_UOPS,cmask=1 to get cycles\n"); + mythresh = "thresh >= .05"; + } else { + printf("Unknown name:%s\n", name); + mythresh = "unknown entry"; + } + printf("If the value printed is %s we may have the ability to improve performance\n", mythresh); +} + + +#define BROADWELL_COUNT 17 +static struct cpu_entry broadwell[BROADWELL_COUNT] = { +/*1*/ { "eff1", "thresh < .75", + "pmcstat -s UOPS_RETIRED.RETIRE_SLOTS -s CPU_CLK_UNHALTED.THREAD_P -w 1", + efficiency1 }, +/*2*/ { "eff2", "thresh > 1.0", + "pmcstat -s INST_RETIRED.ANY_P -s CPU_CLK_UNHALTED.THREAD_P -w 1", + efficiency2 }, +/*3*/ { "itlbmiss", "thresh > .05", + "pmcstat -s ITLB_MISSES.WALK_DURATION -s CPU_CLK_UNHALTED.THREAD_P -s ITLB_MISSES.STLB_HIT_4K -w 1", + itlb_miss_broad }, +/*4*/ { "icachemiss", "thresh > .05", + "pmcstat -s ICACHE.MISSES --s CPU_CLK_UNHALTED.THREAD_P -w 1", + icache_miss_has }, +/*5*/ { "lcpstall", "thresh > .05", + "pmcstat -s ILD_STALL.LCP -s CPU_CLK_UNHALTED.THREAD_P -w 1", + lcp_stall }, +/*6*/ { "cache1", "thresh >= .1", + "pmcstat -s MEM_LOAD_UOPS_RETIRED.L3_MISS -s CPU_CLK_UNHALTED.THREAD_P -w 1", + cache1broad }, +/*7*/ { "cache2", "thresh >= .2", + "pmcstat -s MEM_LOAD_UOPS_RETIRED.L3_HIT -s CPU_CLK_UNHALTED.THREAD_P -w 1", + cache2broad }, +/*8*/ { "contested", "thresh >= .05", + "pmcstat -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM -s CPU_CLK_UNHALTED.THREAD_P -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS -w 1", + contestedbroad }, +/*9*/ { "datashare", "thresh >= .05", + "pmcstat -s MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT -s CPU_CLK_UNHALTED.THREAD_P -w 1", + datasharing_has }, +/*10*/ { "blockstorefwd", "thresh >= .05", + "pmcstat -s LD_BLOCKS_STORE_FORWARD -s CPU_CLK_UNHALTED.THREAD_P -w 1", + blockstoreforward }, +/*11*/ { "aliasing_4k", "thresh >= .1", + "pmcstat -s LD_BLOCKS_PARTIAL.ADDRESS_ALIAS -s CPU_CLK_UNHALTED.THREAD_P -w 1", + aliasing_broad }, +/*12*/ { "dtlbmissload", "thresh >= .1", + "pmcstat -s DTLB_LOAD_MISSES.STLB_HIT -s DTLB_LOAD_MISSES.WALK_DURATION -s CPU_CLK_UNHALTED.THREAD_P -w 1", + dtlb_missload }, +/*13*/ { "br_miss", "thresh >= .2", + "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s BR_MISP_RETIRED.ALL_BRANCHES -s MACHINE_CLEARS.CYCLES -s UOPS_ISSUED.ANY -s UOPS_RETIRED.RETIRE_SLOTS -s INT_MISC.RECOVERY_CYCLES -w 1", + br_mispredict_broad }, +/*14*/ { "clears", "thresh >= .02", + "pmcstat -s MACHINE_CLEARS.CYCLES -s MACHINE_CLEARS.MEMORY_ORDERING -s MACHINE_CLEARS.SMC -s MACHINE_CLEARS.MASKMOV -s CPU_CLK_UNHALTED.THREAD_P -w 1", + clears_broad }, +/*15*/ { "fpassist", "look for a excessive value", + "pmcstat -s FP_ASSIST.ANY -s INST_RETIRED.ANY_P -w 1", + fpassists }, +/*16*/ { "otherassistavx", "look for a excessive value", + "pmcstat -s OTHER_ASSISTS.AVX_TO_SSE -s CPU_CLK_UNHALTED.THREAD_P -w 1", + otherassistavx }, +/*17*/ { "microassist", "thresh >= .2", + "pmcstat -s IDQ.MS_UOPS,cmask=1 -s CPU_CLK_UNHALTED.THREAD_P -s UOPS_ISSUED.ANY -s UOPS_RETIRED.RETIRE_SLOTS -w 1", + microassist_broad }, +}; + +static void set_sandybridge(void) { strcpy(the_cpu.cputype, "SandyBridge PMC"); @@ -1558,6 +1921,15 @@ set_haswell(void) } static void +set_broadwell(void) +{ + strcpy(the_cpu.cputype, "HASWELL PMC"); + the_cpu.number = BROADWELL_COUNT; + the_cpu.ents = broadwell; + the_cpu.explain = explain_name_broad; +} + +static void set_expression(char *name) { int found = 0, i; @@ -1577,10 +1949,6 @@ set_expression(char *name) } } - - - - static int validate_expression(char *name) { @@ -1813,7 +2181,7 @@ process_file(char *filename) /* Nothing we can do */ printf("Nothing to do -- no counters built\n"); if (filename) { - fclose(io); + fclose(io); } else { my_pclose(io, pid_of_command); } @@ -1992,6 +2360,23 @@ get_cpuid_set(void) printf("Intel HASWELL\n"); set_haswell(); break; + + case 0x4e: + case 0x5e: + printf("Intel SKY-LAKE\n"); + goto not_supported; + break; + case 0x3D: + case 0x47: + printf("Intel BROADWELL\n"); + set_broadwell(); + break; + case 0x4f: + case 0x56: + printf("Intel BROADWEL (Xeon)L\n"); + set_broadwell(); + break; + case 0x4D: /* Per Intel document 330061-001 01/2014. */ printf("Intel ATOM_SILVERMONT\n"); From owner-svn-src-all@freebsd.org Wed Dec 9 21:50:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B54A9D5B86; Wed, 9 Dec 2015 21:50:07 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FC0A14A0; Wed, 9 Dec 2015 21:50:07 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9Lo6E8034960; Wed, 9 Dec 2015 21:50:06 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9Lo6NA034959; Wed, 9 Dec 2015 21:50:06 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201512092150.tB9Lo6NA034959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 9 Dec 2015 21:50:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292028 - head/usr.sbin/pmcstudy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 21:50:07 -0000 Author: rrs Date: Wed Dec 9 21:50:06 2015 New Revision: 292028 URL: https://svnweb.freebsd.org/changeset/base/292028 Log: White space changes. Modified: head/usr.sbin/pmcstudy/pmcstudy.c Modified: head/usr.sbin/pmcstudy/pmcstudy.c ============================================================================== --- head/usr.sbin/pmcstudy/pmcstudy.c Wed Dec 9 21:49:31 2015 (r292027) +++ head/usr.sbin/pmcstudy/pmcstudy.c Wed Dec 9 21:50:06 2015 (r292028) @@ -45,20 +45,20 @@ static int verbose = 0; extern char **environ; extern struct expression *master_exp; -struct expression *master_exp=NULL; +struct expression *master_exp = NULL; #define PMC_INITIAL_ALLOC 512 extern char **valid_pmcs; char **valid_pmcs = NULL; extern int valid_pmc_cnt; -int valid_pmc_cnt=0; +int valid_pmc_cnt = 0; extern int pmc_allocated_cnt; -int pmc_allocated_cnt=0; +int pmc_allocated_cnt = 0; /* * The following two varients on popen and pclose with * the cavet that they get you the PID so that you - * can supply it to pclose so it can send a SIGTERM + * can supply it to pclose so it can send a SIGTERM * to the process. */ static FILE * @@ -75,7 +75,7 @@ my_popen(const char *command, const char if ((strcmp(dir, "r") != 0) && (strcmp(dir, "w") != 0)) { errno = EINVAL; - return(NULL); + return (NULL); } if (pipe(pdesin) < 0) return (NULL); @@ -94,14 +94,14 @@ my_popen(const char *command, const char argv[3] = NULL; switch (pid = fork()) { - case -1: /* Error. */ + case -1: /* Error. */ (void)close(pdesin[0]); (void)close(pdesin[1]); (void)close(pdesout[0]); (void)close(pdesout[1]); return (NULL); /* NOTREACHED */ - case 0: /* Child. */ + case 0: /* Child. */ /* Close out un-used sides */ (void)close(pdesin[1]); (void)close(pdesout[0]); @@ -129,8 +129,8 @@ my_popen(const char *command, const char (void)close(pdesin[0]); (void)close(pdesout[0]); (void)close(pdesout[1]); - return(io_out); - } else { + return (io_out); + } else { /* Prepare the input stream */ io_in = fdopen(pdesout[0], "r"); (void)close(pdesout[1]); @@ -146,7 +146,7 @@ my_popen(const char *command, const char * if already `pclosed', or waitpid returns an error. */ static void -my_pclose(FILE *io, pid_t the_pid) +my_pclose(FILE * io, pid_t the_pid) { int pstat; pid_t pid; @@ -164,33 +164,33 @@ my_pclose(FILE *io, pid_t the_pid) struct counters { struct counters *next_cpu; - char counter_name[MAX_NLEN]; /* Name of counter */ - int cpu; /* CPU we are on */ - int pos; /* Index we are filling to. */ + char counter_name[MAX_NLEN]; /* Name of counter */ + int cpu; /* CPU we are on */ + int pos; /* Index we are filling to. */ uint64_t vals[MAX_COUNTER_SLOTS]; /* Last 64 entries */ - uint64_t sum; /* Summary of entries */ + uint64_t sum; /* Summary of entries */ }; extern struct counters *glob_cpu[MAX_CPU]; struct counters *glob_cpu[MAX_CPU]; extern struct counters *cnts; -struct counters *cnts=NULL; +struct counters *cnts = NULL; extern int ncnts; -int ncnts=0; +int ncnts = 0; -extern int (*expression)(struct counters *, int); -int (*expression)(struct counters *, int); +extern int (*expression) (struct counters *, int); +int (*expression) (struct counters *, int); -static const char *threshold=NULL; +static const char *threshold = NULL; static const char *command; struct cpu_entry { const char *name; const char *thresh; const char *command; - int (*func)(struct counters *, int); + int (*func) (struct counters *, int); }; @@ -198,7 +198,7 @@ struct cpu_type { char cputype[32]; int number; struct cpu_entry *ents; - void (*explain)(const char *name); + void (*explain) (const char *name); }; extern struct cpu_type the_cpu; struct cpu_type the_cpu; @@ -207,6 +207,7 @@ static void explain_name_sb(const char *name) { const char *mythresh; + if (strcmp(name, "allocstall1") == 0) { printf("Examine PARTIAL_RAT_STALLS.SLOW_LEA_WINDOW / CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh > .05"; @@ -278,7 +279,7 @@ explain_name_sb(const char *name) } else { printf("Unknown name:%s\n", name); mythresh = "unknown entry"; - } + } printf("If the value printed is %s we may have the ability to improve performance\n", mythresh); } @@ -286,6 +287,7 @@ static void explain_name_ib(const char *name) { const char *mythresh; + if (strcmp(name, "br_miss") == 0) { printf("Examine ((BR_MISP_RETIRED.ALL_BRANCHES /(BR_MISP_RETIRED.ALL_BRANCHES +\n"); printf(" MACHINE_CLEAR.COUNT) * ((UOPS_ISSUED.ANY - UOPS_RETIRED.RETIRE_SLOTS + 4 * INT_MISC.RECOVERY_CYCLES)\n"); @@ -305,7 +307,7 @@ explain_name_ib(const char *name) mythresh = "thresh >= .2"; } else if (strcmp(name, "itlbmiss") == 0) { printf("Examine ITLB_MISSES.WALK_DURATION / CPU_CLK_UNHALTED.THREAD_P\n"); - mythresh = "thresh > .05"; + mythresh = "thresh > .05"; } else if (strcmp(name, "icachemiss") == 0) { printf("Examine (ICACHE.IFETCH_STALL - ITLB_MISSES.WALK_DURATION)/ CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh > .05"; @@ -360,7 +362,7 @@ explain_name_ib(const char *name) } else { printf("Unknown name:%s\n", name); mythresh = "unknown entry"; - } + } printf("If the value printed is %s we may have the ability to improve performance\n", mythresh); } @@ -369,6 +371,7 @@ static void explain_name_has(const char *name) { const char *mythresh; + if (strcmp(name, "eff1") == 0) { printf("Examine (UOPS_RETIRED.RETIRE_SLOTS)/(4 *CPU_CLK_UNHALTED.THREAD_P)\n"); mythresh = "thresh < .75"; @@ -377,7 +380,7 @@ explain_name_has(const char *name) mythresh = "thresh > 1.0"; } else if (strcmp(name, "itlbmiss") == 0) { printf("Examine ITLB_MISSES.WALK_DURATION / CPU_CLK_UNHALTED.THREAD_P\n"); - mythresh = "thresh > .05"; + mythresh = "thresh > .05"; } else if (strcmp(name, "icachemiss") == 0) { printf("Examine (36 * ICACHE.MISSES)/ CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh > .05"; @@ -439,7 +442,7 @@ explain_name_has(const char *name) } else { printf("Unknown name:%s\n", name); mythresh = "unknown entry"; - } + } printf("If the value printed is %s we may have the ability to improve performance\n", mythresh); } @@ -451,16 +454,16 @@ find_counter(struct counters *base, cons at = base; len = strlen(name); - while(at) { + while (at) { if (strncmp(at->counter_name, name, len) == 0) { - return(at); + return (at); } at = at->next_cpu; } printf("Can't find counter %s\n", name); printf("We have:\n"); at = base; - while(at) { + while (at) { printf("- %s\n", at->counter_name); at = at->next_cpu; } @@ -475,6 +478,7 @@ allocstall1(struct counters *cpu, int po struct counters *partial; struct counters *unhalt; double un, par, res; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); partial = find_counter(cpu, "PARTIAL_RAT_STALLS.SLOW_LEA_WINDOW"); if (pos != -1) { @@ -484,9 +488,9 @@ allocstall1(struct counters *cpu, int po par = partial->sum * 1.0; un = unhalt->sum * 1.0; } - res = par/un; + res = par / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int @@ -497,6 +501,7 @@ allocstall2(struct counters *cpu, int po struct counters *partial; struct counters *unhalt; double un, par, res; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); partial = find_counter(cpu, "PARTIAL_RAT_STALLS.FLAGS_MERGE_UOP"); if (pos != -1) { @@ -506,9 +511,9 @@ allocstall2(struct counters *cpu, int po par = partial->sum * 1.0; un = unhalt->sum * 1.0; } - res = par/un; + res = par / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int @@ -517,12 +522,14 @@ br_mispredict(struct counters *cpu, int struct counters *brctr; struct counters *unhalt; int ret; + /* 3 - (20 * BR_MISP_RETIRED.ALL_BRANCHES)/CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) */ double br, un, con, res; + con = 20.0; - + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); - brctr = find_counter(cpu, "BR_MISP_RETIRED.ALL_BRANCHES"); + brctr = find_counter(cpu, "BR_MISP_RETIRED.ALL_BRANCHES"); if (pos != -1) { br = brctr->vals[pos] * 1.0; un = unhalt->vals[pos] * 1.0; @@ -530,9 +537,9 @@ br_mispredict(struct counters *cpu, int br = brctr->sum * 1.0; un = unhalt->sum * 1.0; } - res = (con * br)/un; - ret = printf("%1.3f", res); - return(ret); + res = (con * br) / un; + ret = printf("%1.3f", res); + return (ret); } static int @@ -542,22 +549,25 @@ br_mispredictib(struct counters *cpu, in struct counters *unhalt; struct counters *clear, *clear2, *clear3; struct counters *uops; - struct counters *recv; + struct counters *recv; struct counters *iss; + /* "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s BR_MISP_RETIRED.ALL_BRANCHES -s MACHINE_CLEARS.MEMORY_ORDERING -s MACHINE_CLEARS.SMC -s MACHINE_CLEARS.MASKMOV -s UOPS_ISSUED.ANY -s UOPS_RETIRED.RETIRE_SLOTS -s INT_MISC.RECOVERY_CYCLES -w 1",*/ int ret; - /* - * (BR_MISP_RETIRED.ALL_BRANCHES / - * (BR_MISP_RETIRED.ALL_BRANCHES + - * MACHINE_CLEAR.COUNT) * - * ((UOPS_ISSUED.ANY - UOPS_RETIRED.RETIRE_SLOTS + 4 * INT_MISC.RECOVERY_CYCLES) / (4 * CPU_CLK_UNHALTED.THREAD))) - * + + /* + * (BR_MISP_RETIRED.ALL_BRANCHES / (BR_MISP_RETIRED.ALL_BRANCHES + + * MACHINE_CLEAR.COUNT) * ((UOPS_ISSUED.ANY - + * UOPS_RETIRED.RETIRE_SLOTS + 4 * INT_MISC.RECOVERY_CYCLES) / (4 * + * CPU_CLK_UNHALTED.THREAD))) + * */ double br, cl, cl2, cl3, uo, re, un, con, res, is; + con = 4.0; - + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); - brctr = find_counter(cpu, "BR_MISP_RETIRED.ALL_BRANCHES"); + brctr = find_counter(cpu, "BR_MISP_RETIRED.ALL_BRANCHES"); clear = find_counter(cpu, "MACHINE_CLEARS.MEMORY_ORDERING"); clear2 = find_counter(cpu, "MACHINE_CLEARS.SMC"); clear3 = find_counter(cpu, "MACHINE_CLEARS.MASKMOV"); @@ -583,9 +593,9 @@ br_mispredictib(struct counters *cpu, in is = iss->sum * 1.0; un = unhalt->sum * 1.0; } - res = (br/(br + cl + cl2 + cl3) * ((is - uo + con * re) / (con * un))); - ret = printf("%1.3f", res); - return(ret); + res = (br / (br + cl + cl2 + cl3) * ((is - uo + con * re) / (con * un))); + ret = printf("%1.3f", res); + return (ret); } static int @@ -601,9 +611,9 @@ br_mispredict_broad(struct counters *cpu double br, cl, uo, uo_r, re, con, un, res; con = 4.0; - + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); - brctr = find_counter(cpu, "BR_MISP_RETIRED.ALL_BRANCHES"); + brctr = find_counter(cpu, "BR_MISP_RETIRED.ALL_BRANCHES"); clear = find_counter(cpu, "MACHINE_CLEARS.CYCLES"); uops = find_counter(cpu, "UOPS_ISSUED.ANY"); uops_ret = find_counter(cpu, "UOPS_RETIRED.RETIRE_SLOTS"); @@ -625,8 +635,8 @@ br_mispredict_broad(struct counters *cpu re = recv->sum * 1.0; } res = br / (br + cl) * (uo - uo_r + con * re) / (un * con); - ret = printf("%1.3f", res); - return(ret); + ret = printf("%1.3f", res); + return (ret); } static int @@ -637,9 +647,12 @@ splitloadib(struct counters *cpu, int po struct counters *l1d, *ldblock; struct counters *unhalt; double un, memd, res, l1, ldb; - /* - * ((L1D_PEND_MISS.PENDING / MEM_LOAD_UOPS_RETIRED.L1_MISS) * LD_BLOCKS.NO_SR) / CPU_CLK_UNHALTED.THREAD_P - * "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s L1D_PEND_MISS.PENDING -s MEM_LOAD_UOPS_RETIRED.L1_MISS -s LD_BLOCKS.NO_SR -w 1", + + /* + * ((L1D_PEND_MISS.PENDING / MEM_LOAD_UOPS_RETIRED.L1_MISS) * + * LD_BLOCKS.NO_SR) / CPU_CLK_UNHALTED.THREAD_P "pmcstat -s + * CPU_CLK_UNHALTED.THREAD_P -s L1D_PEND_MISS.PENDING -s + * MEM_LOAD_UOPS_RETIRED.L1_MISS -s LD_BLOCKS.NO_SR -w 1", */ unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); @@ -657,9 +670,9 @@ splitloadib(struct counters *cpu, int po ldb = ldblock->sum * 1.0; un = unhalt->sum * 1.0; } - res = ((l1 / memd) * ldb)/un; + res = ((l1 / memd) * ldb) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int @@ -669,6 +682,7 @@ splitload(struct counters *cpu, int pos) struct counters *mem; struct counters *unhalt; double con, un, memd, res; + /* 4 - (MEM_UOP_RETIRED.SPLIT_LOADS * 5) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .1)*/ con = 5.0; @@ -681,19 +695,23 @@ splitload(struct counters *cpu, int pos) memd = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (memd * con)/un; + res = (memd * con) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int splitstore(struct counters *cpu, int pos) { - /* 5 - MEM_UOP_RETIRED.SPLIT_STORES / MEM_UOP_RETIRED.ALL_STORES (thresh > 0.01) */ + /* + * 5 - MEM_UOP_RETIRED.SPLIT_STORES / MEM_UOP_RETIRED.ALL_STORES + * (thresh > 0.01) + */ int ret; struct counters *mem_split; struct counters *mem_stores; double memsplit, memstore, res; + mem_split = find_counter(cpu, "MEM_UOP_RETIRED.SPLIT_STORES"); mem_stores = find_counter(cpu, "MEM_UOP_RETIRED.ALL_STORES"); if (pos != -1) { @@ -703,16 +721,19 @@ splitstore(struct counters *cpu, int pos memsplit = mem_split->sum * 1.0; memstore = mem_stores->sum * 1.0; } - res = memsplit/memstore; + res = memsplit / memstore; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int contested(struct counters *cpu, int pos) { - /* 6 - (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 60) / CPU_CLK_UNHALTED.THREAD_P (thresh >.05) */ + /* + * 6 - (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 60) / + * CPU_CLK_UNHALTED.THREAD_P (thresh >.05) + */ int ret; struct counters *mem; struct counters *unhalt; @@ -728,15 +749,18 @@ contested(struct counters *cpu, int pos) memd = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (memd * con)/un; + res = (memd * con) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int contested_has(struct counters *cpu, int pos) { - /* 6 - (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84) / CPU_CLK_UNHALTED.THREAD_P (thresh >.05) */ + /* + * 6 - (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84) / + * CPU_CLK_UNHALTED.THREAD_P (thresh >.05) + */ int ret; struct counters *mem; struct counters *unhalt; @@ -752,15 +776,18 @@ contested_has(struct counters *cpu, int memd = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (memd * con)/un; + res = (memd * con) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int contestedbroad(struct counters *cpu, int pos) { - /* 6 - (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84) / CPU_CLK_UNHALTED.THREAD_P (thresh >.05) */ + /* + * 6 - (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84) / + * CPU_CLK_UNHALTED.THREAD_P (thresh >.05) + */ int ret; struct counters *mem; struct counters *mem2; @@ -770,7 +797,7 @@ contestedbroad(struct counters *cpu, int con = 84.0; unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); mem = find_counter(cpu, "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM"); - mem2 = find_counter(cpu,"MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS"); + mem2 = find_counter(cpu, "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS"); if (pos != -1) { memd = mem->vals[pos] * 1.0; @@ -781,16 +808,19 @@ contestedbroad(struct counters *cpu, int memtoo = mem2->sum * 1.0; un = unhalt->sum * 1.0; } - res = ((memd * con) + memtoo)/un; + res = ((memd * con) + memtoo) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int blockstoreforward(struct counters *cpu, int pos) { - /* 7 - (LD_BLOCKS_STORE_FORWARD * 13) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .05)*/ + /* + * 7 - (LD_BLOCKS_STORE_FORWARD * 13) / CPU_CLK_UNHALTED.THREAD_P + * (thresh >= .05) + */ int ret; struct counters *ldb; struct counters *unhalt; @@ -806,17 +836,19 @@ blockstoreforward(struct counters *cpu, ld = ldb->sum * 1.0; un = unhalt->sum * 1.0; } - res = (ld * con)/un; + res = (ld * con) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int cache2(struct counters *cpu, int pos) { - /* ** Suspect *** - * 8 - ((MEM_LOAD_RETIRED.L3_HIT * 26) + (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT * 43) + - * (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 60)) / CPU_CLK_UNHALTED.THREAD_P (thresh >.2) + /* + * ** Suspect *** 8 - ((MEM_LOAD_RETIRED.L3_HIT * 26) + + * (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT * 43) + + * (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 60)) / + * CPU_CLK_UNHALTED.THREAD_P (thresh >.2) */ int ret; struct counters *mem1, *mem2, *mem3; @@ -842,16 +874,17 @@ cache2(struct counters *cpu, int pos) me_3 = mem3->sum * 1.0; un = unhalt->sum * 1.0; } - res = ((me_1 * con1) + (me_2 * con2) + (me_3 * con3))/un; + res = ((me_1 * con1) + (me_2 * con2) + (me_3 * con3)) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int datasharing(struct counters *cpu, int pos) { - /* - * (MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT * 43)/ CPU_CLK_UNHALTED.THREAD_P (thresh >.2) + /* + * (MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT * 43)/ + * CPU_CLK_UNHALTED.THREAD_P (thresh >.2) */ int ret; struct counters *mem; @@ -868,9 +901,9 @@ datasharing(struct counters *cpu, int po me = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (me * con)/un; + res = (me * con) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } @@ -878,8 +911,9 @@ datasharing(struct counters *cpu, int po static int datasharing_has(struct counters *cpu, int pos) { - /* - * (MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT * 43)/ CPU_CLK_UNHALTED.THREAD_P (thresh >.2) + /* + * (MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT * 43)/ + * CPU_CLK_UNHALTED.THREAD_P (thresh >.2) */ int ret; struct counters *mem; @@ -896,9 +930,9 @@ datasharing_has(struct counters *cpu, in me = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (me * con)/un; + res = (me * con) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } @@ -906,8 +940,9 @@ datasharing_has(struct counters *cpu, in static int cache2ib(struct counters *cpu, int pos) { - /* - * (29 * MEM_LOAD_UOPS_RETIRED.LLC_HIT / CPU_CLK_UNHALTED.THREAD_P (thresh >.2) + /* + * (29 * MEM_LOAD_UOPS_RETIRED.LLC_HIT / CPU_CLK_UNHALTED.THREAD_P + * (thresh >.2) */ int ret; struct counters *mem; @@ -924,9 +959,9 @@ cache2ib(struct counters *cpu, int pos) me = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (con * me)/un; + res = (con * me) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int @@ -934,9 +969,9 @@ cache2has(struct counters *cpu, int pos) { /* * Examine ((MEM_LOAD_UOPS_RETIRED.LLC_HIT * 36) + \ - * (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT * 72) + - * (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84)) - * / CPU_CLK_UNHALTED.THREAD_P + * (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT * 72) + + * (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84)) / + * CPU_CLK_UNHALTED.THREAD_P */ int ret; struct counters *mem1, *mem2, *mem3; @@ -961,16 +996,17 @@ cache2has(struct counters *cpu, int pos) me3 = mem3->sum * 1.0; un = unhalt->sum * 1.0; } - res = ((me1 * con1) + (me2 * con2) + (me3 * con3))/un; + res = ((me1 * con1) + (me2 * con2) + (me3 * con3)) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int cache2broad(struct counters *cpu, int pos) { - /* - * (29 * MEM_LOAD_UOPS_RETIRED.LLC_HIT / CPU_CLK_UNHALTED.THREAD_P (thresh >.2) + /* + * (29 * MEM_LOAD_UOPS_RETIRED.LLC_HIT / CPU_CLK_UNHALTED.THREAD_P + * (thresh >.2) */ int ret; struct counters *mem; @@ -987,16 +1023,19 @@ cache2broad(struct counters *cpu, int po me = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (con * me)/un; + res = (con * me) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int cache1(struct counters *cpu, int pos) { - /* 9 - (MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS * 180) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) */ + /* + * 9 - (MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS * 180) / + * CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) + */ int ret; struct counters *mem; struct counters *unhalt; @@ -1012,15 +1051,18 @@ cache1(struct counters *cpu, int pos) me = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (me * con)/un; + res = (me * con) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int cache1ib(struct counters *cpu, int pos) { - /* 9 - (MEM_LOAD_UOPS_L3_MISS_RETIRED.LCOAL_DRAM * 180) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) */ + /* + * 9 - (MEM_LOAD_UOPS_L3_MISS_RETIRED.LCOAL_DRAM * 180) / + * CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) + */ int ret; struct counters *mem; struct counters *unhalt; @@ -1036,16 +1078,19 @@ cache1ib(struct counters *cpu, int pos) me = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (me * con)/un; + res = (me * con) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int cache1broad(struct counters *cpu, int pos) { - /* 9 - (MEM_LOAD_UOPS_L3_MISS_RETIRED.LCOAL_DRAM * 180) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) */ + /* + * 9 - (MEM_LOAD_UOPS_L3_MISS_RETIRED.LCOAL_DRAM * 180) / + * CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) + */ int ret; struct counters *mem; struct counters *unhalt; @@ -1061,16 +1106,20 @@ cache1broad(struct counters *cpu, int po me = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (me * con)/un; + res = (me * con) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int dtlb_missload(struct counters *cpu, int pos) { - /* 10 - ((DTLB_LOAD_MISSES.STLB_HIT * 7) + DTLB_LOAD_MISSES.WALK_DURATION) / CPU_CLK_UNHALTED.THREAD_P (t >=.1) */ + /* + * 10 - ((DTLB_LOAD_MISSES.STLB_HIT * 7) + + * DTLB_LOAD_MISSES.WALK_DURATION) / CPU_CLK_UNHALTED.THREAD_P (t + * >=.1) + */ int ret; struct counters *dtlb_m, *dtlb_d; struct counters *unhalt; @@ -1089,39 +1138,40 @@ dtlb_missload(struct counters *cpu, int d2 = dtlb_d->sum * 1.0; un = unhalt->sum * 1.0; } - res = ((d1 * con) + d2)/un; + res = ((d1 * con) + d2) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int dtlb_missstore(struct counters *cpu, int pos) { - /* - * ((DTLB_STORE_MISSES.STLB_HIT * 7) + DTLB_STORE_MISSES.WALK_DURATION) / - * CPU_CLK_UNHALTED.THREAD_P (t >= .1) - */ - int ret; - struct counters *dtsb_m, *dtsb_d; - struct counters *unhalt; - double con, un, d1, d2, res; - - con = 7.0; - unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); - dtsb_m = find_counter(cpu, "DTLB_STORE_MISSES.STLB_HIT"); - dtsb_d = find_counter(cpu, "DTLB_STORE_MISSES.WALK_DURATION"); - if (pos != -1) { - d1 = dtsb_m->vals[pos] * 1.0; - d2 = dtsb_d->vals[pos] * 1.0; - un = unhalt->vals[pos] * 1.0; - } else { - d1 = dtsb_m->sum * 1.0; - d2 = dtsb_d->sum * 1.0; - un = unhalt->sum * 1.0; - } - res = ((d1 * con) + d2)/un; - ret = printf("%1.3f", res); - return(ret); + /* + * ((DTLB_STORE_MISSES.STLB_HIT * 7) + + * DTLB_STORE_MISSES.WALK_DURATION) / CPU_CLK_UNHALTED.THREAD_P (t + * >= .1) + */ + int ret; + struct counters *dtsb_m, *dtsb_d; + struct counters *unhalt; + double con, un, d1, d2, res; + + con = 7.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + dtsb_m = find_counter(cpu, "DTLB_STORE_MISSES.STLB_HIT"); + dtsb_d = find_counter(cpu, "DTLB_STORE_MISSES.WALK_DURATION"); + if (pos != -1) { + d1 = dtsb_m->vals[pos] * 1.0; + d2 = dtsb_d->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + } else { + d1 = dtsb_m->sum * 1.0; + d2 = dtsb_d->sum * 1.0; + un = unhalt->sum * 1.0; + } + res = ((d1 * con) + d2) / un; + ret = printf("%1.3f", res); + return (ret); } static int @@ -1142,16 +1192,19 @@ itlb_miss(struct counters *cpu, int pos) d1 = itlb->sum * 1.0; un = unhalt->sum * 1.0; } - res = d1/un; + res = d1 / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int itlb_miss_broad(struct counters *cpu, int pos) { - /* (7 * ITLB_MISSES.STLB_HIT_4K + ITLB_MISSES.WALK_DURATION) / CPU_CLK_UNTHREAD_P */ + /* + * (7 * ITLB_MISSES.STLB_HIT_4K + ITLB_MISSES.WALK_DURATION) / + * CPU_CLK_UNTHREAD_P + */ int ret; struct counters *itlb; struct counters *unhalt; @@ -1170,16 +1223,19 @@ itlb_miss_broad(struct counters *cpu, in un = unhalt->sum * 1.0; k = four_k->sum * 1.0; } - res = (7.0 * k + d1)/un; + res = (7.0 * k + d1) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int icache_miss(struct counters *cpu, int pos) { - /* (ICACHE.IFETCH_STALL - ITLB_MISSES.WALK_DURATION) / CPU_CLK_UNHALTED.THREAD_P IB */ + /* + * (ICACHE.IFETCH_STALL - ITLB_MISSES.WALK_DURATION) / + * CPU_CLK_UNHALTED.THREAD_P IB + */ int ret; struct counters *itlb, *icache; @@ -1198,9 +1254,9 @@ icache_miss(struct counters *cpu, int po ic = icache->sum * 1.0; un = unhalt->sum * 1.0; } - res = (ic-d1)/un; + res = (ic - d1) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } @@ -1224,16 +1280,16 @@ icache_miss_has(struct counters *cpu, in ic = icache->sum * 1.0; un = unhalt->sum * 1.0; } - res = (con * ic)/un; + res = (con * ic) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int lcp_stall(struct counters *cpu, int pos) { - /* ILD_STALL.LCP/CPU_CLK_UNHALTED.THREAD_P IB */ + /* ILD_STALL.LCP/CPU_CLK_UNHALTED.THREAD_P IB */ int ret; struct counters *ild; struct counters *unhalt; @@ -1248,9 +1304,9 @@ lcp_stall(struct counters *cpu, int pos) d1 = ild->sum * 1.0; un = unhalt->sum * 1.0; } - res = d1/un; + res = d1 / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } @@ -1258,7 +1314,10 @@ lcp_stall(struct counters *cpu, int pos) static int frontendstall(struct counters *cpu, int pos) { - /* 12 - IDQ_UOPS_NOT_DELIVERED.CORE / (CPU_CLK_UNHALTED.THREAD_P * 4) (thresh >= .15) */ + /* + * 12 - IDQ_UOPS_NOT_DELIVERED.CORE / (CPU_CLK_UNHALTED.THREAD_P * + * 4) (thresh >= .15) + */ int ret; struct counters *idq; struct counters *unhalt; @@ -1274,17 +1333,20 @@ frontendstall(struct counters *cpu, int id = idq->sum * 1.0; un = unhalt->sum * 1.0; } - res = id/(un * con); + res = id / (un * con); ret = printf("%1.3f", res); - return(ret); + return (ret); } static int clears(struct counters *cpu, int pos) { - /* 13 - ((MACHINE_CLEARS.MEMORY_ORDERING + MACHINE_CLEARS.SMC + MACHINE_CLEARS.MASKMOV ) * 100 ) - * / CPU_CLK_UNHALTED.THREAD_P (thresh >= .02)*/ - + /* + * 13 - ((MACHINE_CLEARS.MEMORY_ORDERING + MACHINE_CLEARS.SMC + + * MACHINE_CLEARS.MASKMOV ) * 100 ) / CPU_CLK_UNHALTED.THREAD_P + * (thresh >= .02) + */ + int ret; struct counters *clr1, *clr2, *clr3; struct counters *unhalt; @@ -1295,7 +1357,7 @@ clears(struct counters *cpu, int pos) clr1 = find_counter(cpu, "MACHINE_CLEARS.MEMORY_ORDERING"); clr2 = find_counter(cpu, "MACHINE_CLEARS.SMC"); clr3 = find_counter(cpu, "MACHINE_CLEARS.MASKMOV"); - + if (pos != -1) { cl1 = clr1->vals[pos] * 1.0; cl2 = clr2->vals[pos] * 1.0; @@ -1307,9 +1369,9 @@ clears(struct counters *cpu, int pos) cl3 = clr3->sum * 1.0; un = unhalt->sum * 1.0; } - res = ((cl1 + cl2 + cl3) * con)/un; + res = ((cl1 + cl2 + cl3) * con) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int @@ -1340,9 +1402,9 @@ clears_broad(struct counters *cpu, int p un = unhalt->sum * 1.0; } /* Formula not listed but extrapulated to add the cy ?? */ - res = ((cl1 + cl2 + cl3 + cy) * con)/un; + res = ((cl1 + cl2 + cl3 + cy) * con) / un; ret = printf("%1.3f", res); - return(ret); + return (ret); } static int @@ -1364,9 +1426,9 @@ microassist(struct counters *cpu, int po id = idq->sum * 1.0; un = unhalt->sum * 1.0; } - res = id/(un * con); + res = id / (un * con); ret = printf("%1.3f", res); - return(ret); + return (ret); } static int @@ -1395,16 +1457,19 @@ microassist_broad(struct counters *cpu, uoi = uopiss->sum * 1.0; uor = uopret->sum * 1.0; } - res = (uor/uoi) * (id/(un * con)); + res = (uor / uoi) * (id / (un * con)); ret = printf("%1.3f", res); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Dec 9 21:54:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 624C69D5F1C; Wed, 9 Dec 2015 21:54:34 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34B231A58; Wed, 9 Dec 2015 21:54:34 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9LsX4V037593; Wed, 9 Dec 2015 21:54:33 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9LsXUo037592; Wed, 9 Dec 2015 21:54:33 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201512092154.tB9LsXUo037592@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 9 Dec 2015 21:54:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292029 - head/usr.sbin/pmcstudy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 21:54:34 -0000 Author: rrs Date: Wed Dec 9 21:54:33 2015 New Revision: 292029 URL: https://svnweb.freebsd.org/changeset/base/292029 Log: Update the manual page to include Broadwell. Modified: head/usr.sbin/pmcstudy/pmcstudy.8 Modified: head/usr.sbin/pmcstudy/pmcstudy.8 ============================================================================== --- head/usr.sbin/pmcstudy/pmcstudy.8 Wed Dec 9 21:50:06 2015 (r292028) +++ head/usr.sbin/pmcstudy/pmcstudy.8 Wed Dec 9 21:54:33 2015 (r292029) @@ -59,8 +59,8 @@ PMCs and then run various formulas on th These formulas can be found in Intel documentation "Using Intel Vtune amplifier xe on NNN Generation Intel Core Processors". The NNN is either -2nd, 3rd or 4th generation i.e., Sandy Bridge, Ivy Bridge and Haswell. -Currently the program only works on these three Intel processor types. +2nd, 3rd, 4th or 5th generation i.e., Sandy Bridge, Ivy Bridge, Haswell and Broadwell. +Currently the program only works on these four Intel processor types. .Sh OPTIONS The following options are available: .Bl -tag -width indent From owner-svn-src-all@freebsd.org Wed Dec 9 22:09:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 815939D4A89; Wed, 9 Dec 2015 22:09:34 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 530BB1FDE; Wed, 9 Dec 2015 22:09:34 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9M9X3W041145; Wed, 9 Dec 2015 22:09:33 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9M9XPm041144; Wed, 9 Dec 2015 22:09:33 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <201512092209.tB9M9XPm041144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Wed, 9 Dec 2015 22:09:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292030 - head/sys/netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 22:09:34 -0000 Author: melifaro Date: Wed Dec 9 22:09:33 2015 New Revision: 292030 URL: https://svnweb.freebsd.org/changeset/base/292030 Log: Use correct lookup key for gif route lookups. This fixes r291993 change. Modified: head/sys/netinet6/in6_gif.c Modified: head/sys/netinet6/in6_gif.c ============================================================================== --- head/sys/netinet6/in6_gif.c Wed Dec 9 21:54:33 2015 (r292029) +++ head/sys/netinet6/in6_gif.c Wed Dec 9 22:09:33 2015 (r292030) @@ -205,10 +205,10 @@ in6_gif_encapcheck(const struct mbuf *m, /* ingress filters on outer source */ if ((GIF2IFP(sc)->if_flags & IFF_LINK2) == 0) { struct nhop6_basic nh6; - struct in6_addr *dst; /* XXX empty scope id */ - if (fib6_lookup_nh_basic(sc->gif_fibnum, dst, 0, 0, 0, &nh6)!=0) + if (fib6_lookup_nh_basic(sc->gif_fibnum, &ip6->ip6_src, 0, 0, 0, + &nh6) != 0) return (0); if (nh6.nh_ifp != m->m_pkthdr.rcvif) From owner-svn-src-all@freebsd.org Wed Dec 9 22:45:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D99519D6388; Wed, 9 Dec 2015 22:45:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8807D13B3; Wed, 9 Dec 2015 22:45:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9MjqWp052874; Wed, 9 Dec 2015 22:45:52 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9Mjp5l052870; Wed, 9 Dec 2015 22:45:51 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512092245.tB9Mjp5l052870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 9 Dec 2015 22:45:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292031 - in head: share/man/man4 sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 22:45:53 -0000 Author: cem Date: Wed Dec 9 22:45:51 2015 New Revision: 292031 URL: https://svnweb.freebsd.org/changeset/base/292031 Log: ioat(4): Add ioat_copy_8k_aligned KPI The hardware supports descriptors with two non-contiguous pages. This allows issuing one descriptor for an 8k copy from/to non-contiguous but otherwise page-aligned memory. Sponsored by: EMC / Isilon Storage Division Modified: head/share/man/man4/ioat.4 head/sys/dev/ioat/ioat.c head/sys/dev/ioat/ioat.h head/sys/dev/ioat/ioat_internal.h Modified: head/share/man/man4/ioat.4 ============================================================================== --- head/share/man/man4/ioat.4 Wed Dec 9 22:09:33 2015 (r292030) +++ head/share/man/man4/ioat.4 Wed Dec 9 22:45:51 2015 (r292031) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 31, 2015 +.Dd December 9, 2015 .Dt IOAT 4 .Os .Sh NAME @@ -78,6 +78,17 @@ In .Fa "uint32_t flags" .Fc .Ft struct bus_dmadesc * +.Fo ioat_copy_8k_aligned +.Fa "bus_dmaengine_t dmaengine" +.Fa "bus_addr_t dst1" +.Fa "bus_addr_t dst2" +.Fa "bus_addr_t src1" +.Fa "bus_addr_t src2" +.Fa "bus_dmaengine_callback_t callback_fn" +.Fa "void *callback_arg" +.Fa "uint32_t flags" +.Fc +.Ft struct bus_dmadesc * .Fo ioat_blockfill .Fa "bus_dmaengine_t dmaengine" .Fa "bus_addr_t dst" @@ -150,7 +161,7 @@ Then, they will submit one or more opera .Fn ioat_copy , or .Fn ioat_null . -After queueing one or more individual DMA operations, they will +After queuing one or more individual DMA operations, they will .Fn ioat_release the .Ar bus_dmaengine_t Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Wed Dec 9 22:09:33 2015 (r292030) +++ head/sys/dev/ioat/ioat.c Wed Dec 9 22:45:51 2015 (r292031) @@ -833,6 +833,51 @@ ioat_copy(bus_dmaengine_t dmaengine, bus } struct bus_dmadesc * +ioat_copy_8k_aligned(bus_dmaengine_t dmaengine, bus_addr_t dst1, + bus_addr_t dst2, bus_addr_t src1, bus_addr_t src2, + bus_dmaengine_callback_t callback_fn, void *callback_arg, uint32_t flags) +{ + struct ioat_dma_hw_descriptor *hw_desc; + struct ioat_descriptor *desc; + struct ioat_softc *ioat; + + CTR0(KTR_IOAT, __func__); + ioat = to_ioat_softc(dmaengine); + + if (((src1 | src2 | dst1 | dst2) & (0xffffull << 48)) != 0) { + ioat_log_message(0, "%s: High 16 bits of src/dst invalid\n", + __func__); + return (NULL); + } + if (((src1 | src2 | dst1 | dst2) & PAGE_MASK) != 0) { + ioat_log_message(0, "%s: Addresses must be page-aligned\n", + __func__); + return (NULL); + } + + desc = ioat_op_generic(ioat, IOAT_OP_COPY, 2 * PAGE_SIZE, src1, dst1, + callback_fn, callback_arg, flags); + if (desc == NULL) + return (NULL); + + hw_desc = desc->u.dma; + if (src2 != src1 + PAGE_SIZE) { + hw_desc->u.control.src_page_break = 1; + hw_desc->next_src_addr = src2; + } + if (dst2 != dst1 + PAGE_SIZE) { + hw_desc->u.control.dest_page_break = 1; + hw_desc->next_dest_addr = dst2; + } + + if (g_ioat_debug_level >= 3) + dump_descriptor(hw_desc); + + ioat_submit_single(ioat); + return (&desc->bus_dmadesc); +} + +struct bus_dmadesc * ioat_blockfill(bus_dmaengine_t dmaengine, bus_addr_t dst, uint64_t fillpattern, bus_size_t len, bus_dmaengine_callback_t callback_fn, void *callback_arg, uint32_t flags) Modified: head/sys/dev/ioat/ioat.h ============================================================================== --- head/sys/dev/ioat/ioat.h Wed Dec 9 22:09:33 2015 (r292030) +++ head/sys/dev/ioat/ioat.h Wed Dec 9 22:45:51 2015 (r292031) @@ -84,6 +84,19 @@ struct bus_dmadesc *ioat_copy(bus_dmaeng void *callback_arg, uint32_t flags); /* + * Issue a copy data operation, with constraints: + * - src1, src2, dst1, dst2 are all page-aligned addresses + * - The quantity to copy is exactly 2 pages; + * - src1 -> dst1, src2 -> dst2 + * + * Why use this instead of normal _copy()? You can copy two non-contiguous + * pages (src, dst, or both) with one descriptor. + */ +struct bus_dmadesc *ioat_copy_8k_aligned(bus_dmaengine_t dmaengine, + bus_addr_t dst1, bus_addr_t dst2, bus_addr_t src1, bus_addr_t src2, + bus_dmaengine_callback_t callback_fn, void *callback_arg, uint32_t flags); + +/* * Issues a null operation. This issues the operation to the hardware, but the * hardware doesn't do anything with it. */ Modified: head/sys/dev/ioat/ioat_internal.h ============================================================================== --- head/sys/dev/ioat/ioat_internal.h Wed Dec 9 22:09:33 2015 (r292030) +++ head/sys/dev/ioat/ioat_internal.h Wed Dec 9 22:45:51 2015 (r292031) @@ -175,8 +175,8 @@ struct ioat_dma_hw_descriptor { uint64_t src_addr; uint64_t dest_addr; uint64_t next; - uint64_t reserved; - uint64_t reserved2; + uint64_t next_src_addr; + uint64_t next_dest_addr; uint64_t user1; uint64_t user2; }; From owner-svn-src-all@freebsd.org Wed Dec 9 22:46:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB15D9D63C9; Wed, 9 Dec 2015 22:46:02 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 777181586; Wed, 9 Dec 2015 22:46:02 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9Mk1He052926; Wed, 9 Dec 2015 22:46:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9Mk1r4052925; Wed, 9 Dec 2015 22:46:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512092246.tB9Mk1r4052925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 9 Dec 2015 22:46:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292032 - head/sys/dev/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 22:46:02 -0000 Author: cem Date: Wed Dec 9 22:46:00 2015 New Revision: 292032 URL: https://svnweb.freebsd.org/changeset/base/292032 Log: ioat(4): Add Broadwell-EP PCI IDs Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat.c Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Wed Dec 9 22:45:51 2015 (r292031) +++ head/sys/dev/ioat/ioat.c Wed Dec 9 22:46:00 2015 (r292032) @@ -219,6 +219,17 @@ static struct _pcsid { 0x6f528086, "BDXDE IOAT Ch2" }, { 0x6f538086, "BDXDE IOAT Ch3" }, + { 0x6f208086, "BDX IOAT Ch0" }, + { 0x6f218086, "BDX IOAT Ch1" }, + { 0x6f228086, "BDX IOAT Ch2" }, + { 0x6f238086, "BDX IOAT Ch3" }, + { 0x6f248086, "BDX IOAT Ch4" }, + { 0x6f258086, "BDX IOAT Ch5" }, + { 0x6f268086, "BDX IOAT Ch6" }, + { 0x6f278086, "BDX IOAT Ch7" }, + { 0x6f2e8086, "BDX IOAT Ch0 (RAID)" }, + { 0x6f2f8086, "BDX IOAT Ch1 (RAID)" }, + { 0x00000000, NULL } }; From owner-svn-src-all@freebsd.org Wed Dec 9 22:46:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B3D79D6488; Wed, 9 Dec 2015 22:46:42 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1977B17DF; Wed, 9 Dec 2015 22:46:42 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9MkfkS052993; Wed, 9 Dec 2015 22:46:41 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9Mkfjo052992; Wed, 9 Dec 2015 22:46:41 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201512092246.tB9Mkfjo052992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 9 Dec 2015 22:46:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292033 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 22:46:42 -0000 Author: rrs Date: Wed Dec 9 22:46:40 2015 New Revision: 292033 URL: https://svnweb.freebsd.org/changeset/base/292033 Log: Fix the tunable in logging so that if its pre-11 we have the proper line so the tunable is present. Sponsored by: Netflix Inc. Modified: head/sys/dev/hwpmc/hwpmc_logging.c Modified: head/sys/dev/hwpmc/hwpmc_logging.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_logging.c Wed Dec 9 22:46:00 2015 (r292032) +++ head/sys/dev/hwpmc/hwpmc_logging.c Wed Dec 9 22:46:40 2015 (r292033) @@ -70,6 +70,9 @@ SYSCTL_DECL(_kern_hwpmc); */ static int pmclog_buffer_size = PMC_LOG_BUFFER_SIZE; +#if (__FreeBSD_version < 1100000) +TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "logbuffersize", &pmclog_buffer_size); +#endif SYSCTL_INT(_kern_hwpmc, OID_AUTO, logbuffersize, CTLFLAG_RDTUN, &pmclog_buffer_size, 0, "size of log buffers in kilobytes"); @@ -78,6 +81,9 @@ SYSCTL_INT(_kern_hwpmc, OID_AUTO, logbuf */ static int pmc_nlogbuffers = PMC_NLOGBUFFERS; +#if (__FreeBSD_version < 1100000) +TUNABLE_INT(PMC_SYSCTL_NAME_PREFIX "nbuffers", &pmc_nlogbuffers); +#endif SYSCTL_INT(_kern_hwpmc, OID_AUTO, nbuffers, CTLFLAG_RDTUN, &pmc_nlogbuffers, 0, "number of global log buffers"); From owner-svn-src-all@freebsd.org Wed Dec 9 22:52:39 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0CFDE9D680B; Wed, 9 Dec 2015 22:52:39 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D10351C52; Wed, 9 Dec 2015 22:52:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9MqbXj055701; Wed, 9 Dec 2015 22:52:37 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9MqbYw055700; Wed, 9 Dec 2015 22:52:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512092252.tB9MqbYw055700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Wed, 9 Dec 2015 22:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292034 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 22:52:39 -0000 Author: mav Date: Wed Dec 9 22:52:37 2015 New Revision: 292034 URL: https://svnweb.freebsd.org/changeset/base/292034 Log: Add PCI ID for 16G QLogic chips in FCoE mode. I haven't tested FCoE really yet, but the driver attaches fine. Modified: head/sys/dev/isp/isp_pci.c Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Wed Dec 9 22:46:40 2015 (r292033) +++ head/sys/dev/isp/isp_pci.c Wed Dec 9 22:52:37 2015 (r292034) @@ -294,6 +294,10 @@ static struct ispmdvec mdvec_2600 = { #define PCI_PRODUCT_QLOGIC_ISP2031 0x2031 #endif +#ifndef PCI_PRODUCT_QLOGIC_ISP8031 +#define PCI_PRODUCT_QLOGIC_ISP8031 0x8031 +#endif + #define PCI_QLOGIC_ISP5432 \ ((PCI_PRODUCT_QLOGIC_ISP5432 << 16) | PCI_VENDOR_QLOGIC) @@ -348,6 +352,9 @@ static struct ispmdvec mdvec_2600 = { #define PCI_QLOGIC_ISP2031 \ ((PCI_PRODUCT_QLOGIC_ISP2031 << 16) | PCI_VENDOR_QLOGIC) +#define PCI_QLOGIC_ISP8031 \ + ((PCI_PRODUCT_QLOGIC_ISP8031 << 16) | PCI_VENDOR_QLOGIC) + /* * Odd case for some AMI raid cards... We need to *not* attach to this. */ @@ -458,6 +465,9 @@ isp_pci_probe(device_t dev) case PCI_QLOGIC_ISP2031: device_set_desc(dev, "Qlogic ISP 2031 PCI FC-AL Adapter"); break; + case PCI_QLOGIC_ISP8031: + device_set_desc(dev, "Qlogic ISP 8031 PCI FCoE Adapter"); + break; default: return (ENXIO); } @@ -800,6 +810,7 @@ isp_pci_attach(device_t dev) pcs->pci_poff[MBOX_BLOCK >> _BLK_REG_SHFT] = PCI_MBOX_REGS2400_OFF; break; case PCI_QLOGIC_ISP2031: + case PCI_QLOGIC_ISP8031: did = 0x2600; isp->isp_nchan += isp_nvports; isp->isp_mdvec = &mdvec_2600; From owner-svn-src-all@freebsd.org Wed Dec 9 23:02:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7875A9D6EBA; Wed, 9 Dec 2015 23:02:21 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 459C61354; Wed, 9 Dec 2015 23:02:21 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tB9N2Kb2058567; Wed, 9 Dec 2015 23:02:20 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tB9N2KIG058566; Wed, 9 Dec 2015 23:02:20 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201512092302.tB9N2KIG058566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Wed, 9 Dec 2015 23:02:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292035 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Dec 2015 23:02:21 -0000 Author: rrs Date: Wed Dec 9 23:02:20 2015 New Revision: 292035 URL: https://svnweb.freebsd.org/changeset/base/292035 Log: Add a couple of spots I tend to look at and Michael for SCTP as well :-) Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Wed Dec 9 22:52:37 2015 (r292034) +++ head/MAINTAINERS Wed Dec 9 23:02:20 2015 (r292035) @@ -70,6 +70,9 @@ sys/dev/ixgbe erj Pre-commit phabricator sys/dev/ixl erj Pre-commit phabricator review requested. sys/netinet/ip_carp.c glebius Pre-commit review recommended. sys/netpfil/pf kp,glebius Pre-commit review recommended. +sctp rrs,tuexen Pre-commit review requested (changes need to be backported to github). +pmcstudy(8) rrs Pre-commit review requested. +callout_*(9) rrs Pre-commit review requested -- becareful its tricksy code :o. usr.sbin/pkg pkg@ Please coordinate behavior or flag changes with pkg team. lpr gad Pre-commit review requested, particularly for lpd/recvjob.c and lpd/printjob.c. From owner-svn-src-all@freebsd.org Thu Dec 10 00:07:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05F1B9D6007; Thu, 10 Dec 2015 00:07:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0ED91D2F; Thu, 10 Dec 2015 00:07:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA075WA077266; Thu, 10 Dec 2015 00:07:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA07597077264; Thu, 10 Dec 2015 00:07:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512100007.tBA07597077264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 10 Dec 2015 00:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292036 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 00:07:07 -0000 Author: bdrewery Date: Thu Dec 10 00:07:05 2015 New Revision: 292036 URL: https://svnweb.freebsd.org/changeset/base/292036 Log: Sort the LIB list. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Wed Dec 9 23:02:20 2015 (r292035) +++ head/share/mk/bsd.libnames.mk Thu Dec 10 00:07:05 2015 (r292036) @@ -27,22 +27,22 @@ LIBBSDXML?= ${DESTDIR}${LIBDIR}/libbsdxm LIBBSM?= ${DESTDIR}${LIBDIR}/libbsm.a LIBBSNMP?= ${DESTDIR}${LIBDIR}/libbsnmp.a LIBBZ2?= ${DESTDIR}${LIBDIR}/libbz2.a -LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a -LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libc++.a LIBC?= ${DESTDIR}${LIBDIR}/libc.a -LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a LIBCALENDAR?= ${DESTDIR}${LIBDIR}/libcalendar.a LIBCAM?= ${DESTDIR}${LIBDIR}/libcam.a LIBCAPSICUM?= ${DESTDIR}${LIBDIR}/libcapsicum.a LIBCASPER?= ${DESTDIR}${LIBDIR}/libcasper.a -LIBCOM_ERR?= ${DESTDIR}${LIBDIR}/libcom_err.a LIBCOMPAT?= ${DESTDIR}${LIBDIR}/libcompat.a LIBCOMPILER_RT?=${DESTDIR}${LIBDIR}/libcompiler_rt.a +LIBCOM_ERR?= ${DESTDIR}${LIBDIR}/libcom_err.a +LIBCPLUSPLUS?= ${DESTDIR}${LIBDIR}/libc++.a LIBCRYPT?= ${DESTDIR}${LIBDIR}/libcrypt.a LIBCRYPTO?= ${DESTDIR}${LIBDIR}/libcrypto.a LIBCTF?= ${DESTDIR}${LIBDIR}/libctf.a LIBCURSES?= ${DESTDIR}${LIBDIR}/libcurses.a LIBCUSE?= ${DESTDIR}${LIBDIR}/libcuse.a +LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a +LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a LIBDEVCTL?= ${DESTDIR}${LIBDIR}/libdevctl.a LIBDEVINFO?= ${DESTDIR}${LIBDIR}/libdevinfo.a LIBDEVSTAT?= ${DESTDIR}${LIBDIR}/libdevstat.a @@ -59,9 +59,9 @@ LIBFIGPAR?= ${DESTDIR}${LIBDIR}/libfigpa LIBFL?= "don't use LIBFL, use LIBL" LIBFORM?= ${DESTDIR}${LIBDIR}/libform.a LIBG2C?= ${DESTDIR}${LIBDIR}/libg2c.a -LIBGPIO?= ${DESTDIR}${LIBDIR}/libgpio.a LIBGEOM?= ${DESTDIR}${LIBDIR}/libgeom.a LIBGNUREGEX?= ${DESTDIR}${LIBDIR}/libgnuregex.a +LIBGPIO?= ${DESTDIR}${LIBDIR}/libgpio.a LIBGSSAPI?= ${DESTDIR}${LIBDIR}/libgssapi.a LIBGSSAPI_KRB5?= ${DESTDIR}${LIBDIR}/libgssapi_krb5.a LIBHDB?= ${DESTDIR}${LIBDIR}/libhdb.a @@ -109,8 +109,8 @@ LIBPROCSTAT?= ${DESTDIR}${LIBDIR}/libpro LIBPTHREAD?= ${DESTDIR}${LIBDIR}/libpthread.a LIBRADIUS?= ${DESTDIR}${LIBDIR}/libradius.a LIBROKEN?= ${DESTDIR}${LIBDIR}/libroken.a -LIBRPCSVC?= ${DESTDIR}${LIBDIR}/librpcsvc.a LIBRPCSEC_GSS?= ${DESTDIR}${LIBDIR}/librpcsec_gss.a +LIBRPCSVC?= ${DESTDIR}${LIBDIR}/librpcsvc.a LIBRT?= ${DESTDIR}${LIBDIR}/librt.a LIBRTLD_DB?= ${DESTDIR}${LIBDIR}/librtld_db.a LIBSBUF?= ${DESTDIR}${LIBDIR}/libsbuf.a @@ -128,18 +128,18 @@ LIBTERMLIB?= "don't use LIBTERMLIB, use LIBTINFO?= "don't use LIBTINFO, use LIBNCURSES" LIBUFS?= ${DESTDIR}${LIBDIR}/libufs.a LIBUGIDFW?= ${DESTDIR}${LIBDIR}/libugidfw.a +LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a LIBUMEM?= ${DESTDIR}${LIBDIR}/libumem.a -LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a LIBUSB?= ${DESTDIR}${LIBDIR}/libusb.a -LIBULOG?= ${DESTDIR}${LIBDIR}/libulog.a +LIBUSBHID?= ${DESTDIR}${LIBDIR}/libusbhid.a LIBUTIL?= ${DESTDIR}${LIBDIR}/libutil.a LIBUUTIL?= ${DESTDIR}${LIBDIR}/libuutil.a LIBVGL?= ${DESTDIR}${LIBDIR}/libvgl.a LIBVMMAPI?= ${DESTDIR}${LIBDIR}/libvmmapi.a LIBWIND?= ${DESTDIR}${LIBDIR}/libwind.a LIBWRAP?= ${DESTDIR}${LIBDIR}/libwrap.a -LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a LIBXO?= ${DESTDIR}${LIBDIR}/libxo.a +LIBXPG4?= ${DESTDIR}${LIBDIR}/libxpg4.a LIBY?= ${DESTDIR}${LIBDIR}/liby.a LIBYPCLNT?= ${DESTDIR}${LIBDIR}/libypclnt.a LIBZ?= ${DESTDIR}${LIBDIR}/libz.a Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Wed Dec 9 23:02:20 2015 (r292035) +++ head/share/mk/src.libnames.mk Thu Dec 10 00:07:05 2015 (r292036) @@ -453,8 +453,6 @@ LIBMENUDIR= ${OBJTOP}/lib/ncurses/menu LIBMENULIBWDIR= ${OBJTOP}/lib/ncurses/menuw LIBNCURSESDIR= ${OBJTOP}/lib/ncurses/ncurses LIBNCURSESWDIR= ${OBJTOP}/lib/ncurses/ncursesw -LIBTERMCAPDIR= ${LIBNCURSESDIR} -LIBTERMCAPWDIR= ${LIBNCURSESWDIR} LIBPANELDIR= ${OBJTOP}/lib/ncurses/panel LIBPANELWDIR= ${OBJTOP}/lib/ncurses/panelw LIBCRYPTODIR= ${OBJTOP}/secure/lib/libcrypto @@ -464,6 +462,9 @@ LIBTEKENDIR= ${OBJTOP}/sys/teken/libteke LIBEGACYDIR= ${OBJTOP}/tools/build LIBLNDIR= ${OBJTOP}/usr.bin/lex/lib +LIBTERMCAPDIR= ${LIBNCURSESDIR} +LIBTERMCAPWDIR= ${LIBNCURSESWDIR} + # Default other library directories to lib/libNAME. .for lib in ${_LIBRARIES} LIB${lib:tu}DIR?= ${OBJTOP}/lib/lib${lib} From owner-svn-src-all@freebsd.org Thu Dec 10 00:07:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8A6B9D6049; Thu, 10 Dec 2015 00:07:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 973851E6F; Thu, 10 Dec 2015 00:07:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA07D4g077332; Thu, 10 Dec 2015 00:07:13 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA07BuC077312; Thu, 10 Dec 2015 00:07:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512100007.tBA07BuC077312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 10 Dec 2015 00:07:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292037 - in head: contrib/ofed/usr.bin/ibaddr contrib/ofed/usr.bin/ibnetdiscover contrib/ofed/usr.bin/ibping contrib/ofed/usr.bin/ibportstate contrib/ofed/usr.bin/ibroute contrib/ofed/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 00:07:15 -0000 Author: bdrewery Date: Thu Dec 10 00:07:11 2015 New Revision: 292037 URL: https://svnweb.freebsd.org/changeset/base/292037 Log: Convert contrib/ofed libraries to LIBADD. Sponsored by: EMC / Isilon Storage Division Modified: head/contrib/ofed/usr.bin/ibaddr/Makefile head/contrib/ofed/usr.bin/ibnetdiscover/Makefile head/contrib/ofed/usr.bin/ibping/Makefile head/contrib/ofed/usr.bin/ibportstate/Makefile head/contrib/ofed/usr.bin/ibroute/Makefile head/contrib/ofed/usr.bin/ibsendtrap/Makefile head/contrib/ofed/usr.bin/ibstat/Makefile head/contrib/ofed/usr.bin/ibsysstat/Makefile head/contrib/ofed/usr.bin/ibtracert/Makefile head/contrib/ofed/usr.bin/opensm/Makefile head/contrib/ofed/usr.bin/osmtest/Makefile head/contrib/ofed/usr.bin/perfquery/Makefile head/contrib/ofed/usr.bin/saquery/Makefile head/contrib/ofed/usr.bin/sminfo/Makefile head/contrib/ofed/usr.bin/smpdump/Makefile head/contrib/ofed/usr.bin/smpquery/Makefile head/contrib/ofed/usr.bin/vendstat/Makefile head/share/mk/bsd.libnames.mk head/share/mk/src.libnames.mk Modified: head/contrib/ofed/usr.bin/ibaddr/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/ibaddr/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/ibaddr/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,7 +5,7 @@ PROG= ibaddr SRCS= ibaddr.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= ibaddr.8 Modified: head/contrib/ofed/usr.bin/ibnetdiscover/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/ibnetdiscover/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/ibnetdiscover/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,8 +5,8 @@ PROG= ibnetdiscover SRCS= ibnetdiscover.c grouping.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad -losmcomp -CFLAGS+= -pthread -I${DIAGPATH}/include +LIBADD= ibumad ibcommon ibmad osmcomp pthread +CFLAGS+= -I${DIAGPATH}/include MAN= ibnetdiscover.8 WARNS?= 1 Modified: head/contrib/ofed/usr.bin/ibping/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/ibping/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/ibping/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,7 +5,7 @@ PROG= ibping SRCS= ibping.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= ibping.8 Modified: head/contrib/ofed/usr.bin/ibportstate/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/ibportstate/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/ibportstate/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,7 +5,7 @@ PROG= ibportstate SRCS= ibportstate.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= ibportstate.8 Modified: head/contrib/ofed/usr.bin/ibroute/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/ibroute/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/ibroute/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,8 +5,8 @@ PROG= ibroute SRCS= ibroute.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad -losmcomp -CFLAGS+= -pthread -I${DIAGPATH}/include +LIBADD= ibumad ibcommon ibmad osmcomp pthread +CFLAGS+= -I${DIAGPATH}/include MAN= ibroute.8 WARNS?= 1 Modified: head/contrib/ofed/usr.bin/ibsendtrap/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/ibsendtrap/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/ibsendtrap/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,7 +5,7 @@ PROG= ibsendtrap SRCS= ibsendtrap.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= Modified: head/contrib/ofed/usr.bin/ibstat/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/ibstat/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/ibstat/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,7 +5,7 @@ PROG= ibstat SRCS= ibstat.c -LDADD= -libumad -libcommon +LIBADD= ibumad ibcommon CFLAGS+= -I${DIAGPATH}/include MAN= ibstat.8 Modified: head/contrib/ofed/usr.bin/ibsysstat/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/ibsysstat/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/ibsysstat/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,7 +5,7 @@ PROG= ibsysstat SRCS= ibsysstat.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= ibsysstat.8 Modified: head/contrib/ofed/usr.bin/ibtracert/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/ibtracert/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/ibtracert/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,8 +5,8 @@ PROG= ibtracert SRCS= ibtracert.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad -losmcomp -CFLAGS+= -pthread -I${DIAGPATH}/include +LIBADD= ibumad ibcommon ibmad osmcomp pthread +CFLAGS+= -I${DIAGPATH}/include MAN= ibtracert.8 WARNS?= 1 Modified: head/contrib/ofed/usr.bin/opensm/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/opensm/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/opensm/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -29,8 +29,7 @@ SRCS+= osm_vl_arb_rcv.c st.c osm_perfmgr SRCS+= osm_dump.c osm_ucast_cache.c osm_qos_parser_y.y osm_qos_parser_l.l SRCS+= osm_qos_policy.c -LDADD= -lopensm -losmvendor -losmcomp -libmad -libumad -libcommon -CFLAGS+= -pthread +LIBADD= opensm osmvendor osmcomp ibmad ibumad ibcommon pthread CFLAGS+= -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP MAN= opensm.8 Modified: head/contrib/ofed/usr.bin/osmtest/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/osmtest/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/osmtest/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -16,14 +16,7 @@ SRCS= main.c \ osmt_slvl_vl_arb.c \ osmtest.c -LDADD= -libcommon \ - -libmad \ - -libumad \ - -losmvendor \ - -losmcomp \ - -lopensm \ - -LIBADD+= pthread +LIBADD= ibcommon ibmad ibumad osmvendor osmcomp opensm pthread CFLAGS= -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP \ -I${OPENSM}/osmtest/include Modified: head/contrib/ofed/usr.bin/perfquery/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/perfquery/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/perfquery/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,7 +5,7 @@ PROG= perfquery SRCS= perfquery.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= perfquery.8 Modified: head/contrib/ofed/usr.bin/saquery/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/saquery/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/saquery/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,10 +5,9 @@ PROG= saquery SRCS= saquery.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad -losmcomp -losmvendor -lopensm +LIBADD= ibumad ibcommon ibmad osmcomp osmvendor opensm pthread CFLAGS+= -I${DIAGPATH}/include CFLAGS+= -DOSM_VENDOR_INTF_OPENIB -DVENDOR_RMPP_SUPPORT -DDUAL_SIDED_RMPP -CFLAGS+= -pthread MAN= saquery.8 WARNS?= 1 Modified: head/contrib/ofed/usr.bin/sminfo/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/sminfo/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/sminfo/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,7 +5,7 @@ PROG= sminfo SRCS= sminfo.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= sminfo.8 Modified: head/contrib/ofed/usr.bin/smpdump/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/smpdump/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/smpdump/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,7 +5,7 @@ PROG= smpdump SRCS= smpdump.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= smpdump.8 Modified: head/contrib/ofed/usr.bin/smpquery/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/smpquery/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/smpquery/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,8 +5,8 @@ PROG= smpquery SRCS= smpquery.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad -losmcomp -CFLAGS+= -pthread -I${DIAGPATH}/include +LIBADD= ibumad ibcommon ibmad osmcomp pthread +CFLAGS+= -I${DIAGPATH}/include MAN= smpquery.8 WARNS?= 1 Modified: head/contrib/ofed/usr.bin/vendstat/Makefile ============================================================================== --- head/contrib/ofed/usr.bin/vendstat/Makefile Thu Dec 10 00:07:05 2015 (r292036) +++ head/contrib/ofed/usr.bin/vendstat/Makefile Thu Dec 10 00:07:11 2015 (r292037) @@ -5,7 +5,7 @@ PROG= vendstat SRCS= vendstat.c ibdiag_common.c -LDADD= -libumad -libcommon -libmad +LIBADD= ibumad ibcommon ibmad CFLAGS+= -I${DIAGPATH}/include MAN= vendstat.8 Modified: head/share/mk/bsd.libnames.mk ============================================================================== --- head/share/mk/bsd.libnames.mk Thu Dec 10 00:07:05 2015 (r292036) +++ head/share/mk/bsd.libnames.mk Thu Dec 10 00:07:11 2015 (r292037) @@ -41,6 +41,7 @@ LIBCRYPTO?= ${DESTDIR}${LIBDIR}/libcrypt LIBCTF?= ${DESTDIR}${LIBDIR}/libctf.a LIBCURSES?= ${DESTDIR}${LIBDIR}/libcurses.a LIBCUSE?= ${DESTDIR}${LIBDIR}/libcuse.a +LIBCXGB4?= ${DESTDIR}${LIBDIR}/libcxgb4.a LIBCXXRT?= ${DESTDIR}${LIBDIR}/libcxxrt.a LIBC_PIC?= ${DESTDIR}${LIBDIR}/libc_pic.a LIBDEVCTL?= ${DESTDIR}${LIBDIR}/libdevctl.a @@ -69,6 +70,12 @@ LIBHEIMBASE?= ${DESTDIR}${LIBDIR}/libhei LIBHEIMNTLM?= ${DESTDIR}${LIBDIR}/libheimntlm.a LIBHEIMSQLITE?= ${DESTDIR}${LIBDIR}/libheimsqlite.a LIBHX509?= ${DESTDIR}${LIBDIR}/libhx509.a +LIBIBCM?= ${DESTDIR}${LIBDIR}/libibcm.a +LIBIBCOMMON?= ${DESTDIR}${LIBDIR}/libibcommon.a +LIBIBMAD?= ${DESTDIR}${LIBDIR}/libibmad.a +LIBIBSDP?= ${DESTDIR}${LIBDIR}/libibsdp.a +LIBIBUMAD?= ${DESTDIR}${LIBDIR}/libibumad.a +LIBIBVERBS?= ${DESTDIR}${LIBDIR}/libibverbs.a LIBIPSEC?= ${DESTDIR}${LIBDIR}/libipsec.a LIBJAIL?= ${DESTDIR}${LIBDIR}/libjail.a LIBKADM5CLNT?= ${DESTDIR}${LIBDIR}/libkadm5clnt.a @@ -88,8 +95,10 @@ LIBMD?= ${DESTDIR}${LIBDIR}/libmd.a LIBMEMSTAT?= ${DESTDIR}${LIBDIR}/libmemstat.a LIBMENU?= ${DESTDIR}${LIBDIR}/libmenu.a LIBMILTER?= ${DESTDIR}${LIBDIR}/libmilter.a +LIBMLX4?= ${DESTDIR}${LIBDIR}/libmlx4.a LIBMP?= ${DESTDIR}${LIBDIR}/libmp.a LIBMT?= ${DESTDIR}${LIBDIR}/libmt.a +LIBMTHCA?= ${DESTDIR}${LIBDIR}/libmthca.a LIBNANDFS?= ${DESTDIR}${LIBDIR}/libnandfs.a LIBNCURSES?= ${DESTDIR}${LIBDIR}/libncurses.a LIBNCURSESW?= ${DESTDIR}${LIBDIR}/libncursesw.a @@ -97,7 +106,10 @@ LIBNETGRAPH?= ${DESTDIR}${LIBDIR}/libnet LIBNGATM?= ${DESTDIR}${LIBDIR}/libngatm.a LIBNV?= ${DESTDIR}${LIBDIR}/libnv.a LIBNVPAIR?= ${DESTDIR}${LIBDIR}/libnvpair.a +LIBOPENSM?= ${DESTDIR}${LIBDIR}/libopensm.a LIBOPIE?= ${DESTDIR}${LIBDIR}/libopie.a +LIBOSMCOMP?= ${DESTDIR}${LIBDIR}/libosmcomp.a +LIBOSMVENDOR?= ${DESTDIR}${LIBDIR}/libosmvendor.a LIBPAM?= ${DESTDIR}${LIBDIR}/libpam.a LIBPANEL?= ${DESTDIR}${LIBDIR}/libpanel.a LIBPANELW?= ${DESTDIR}${LIBDIR}/libpanelw.a @@ -108,6 +120,7 @@ LIBPROC?= ${DESTDIR}${LIBDIR}/libproc.a LIBPROCSTAT?= ${DESTDIR}${LIBDIR}/libprocstat.a LIBPTHREAD?= ${DESTDIR}${LIBDIR}/libpthread.a LIBRADIUS?= ${DESTDIR}${LIBDIR}/libradius.a +LIBRDMACM?= ${DESTDIR}${LIBDIR}/librdmacm.a LIBROKEN?= ${DESTDIR}${LIBDIR}/libroken.a LIBRPCSEC_GSS?= ${DESTDIR}${LIBDIR}/librpcsec_gss.a LIBRPCSVC?= ${DESTDIR}${LIBDIR}/librpcsvc.a Modified: head/share/mk/src.libnames.mk ============================================================================== --- head/share/mk/src.libnames.mk Thu Dec 10 00:07:05 2015 (r292036) +++ head/share/mk/src.libnames.mk Thu Dec 10 00:07:11 2015 (r292037) @@ -169,6 +169,23 @@ _LIBRARIES= \ zfs \ zpool \ +.if ${MK_OFED} != "no" +_LIBRARIES+= \ + cxgb4 \ + ibcm \ + ibcommon \ + ibmad \ + ibsdp \ + ibumad \ + ibverbs \ + mlx4 \ + mthca \ + opensm \ + osmcomp \ + osmvendor \ + rdmacm \ + +.endif # Each library's LIBADD needs to be duplicated here for static linkage of # 2nd+ order consumers. Auto-generating this would be better. @@ -416,6 +433,19 @@ LIBUUTILDIR= ${OBJTOP}/cddl/lib/libuutil LIBZFSDIR= ${OBJTOP}/cddl/lib/libzfs LIBZFS_COREDIR= ${OBJTOP}/cddl/lib/libzfs_core LIBZPOOLDIR= ${OBJTOP}/cddl/lib/libzpool +LIBCXGB4DIR= ${OBJTOP}/contrib/ofed/usr.lib/libcxgb4 +LIBIBCMDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibcm +LIBIBCOMMONDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibcommon +LIBIBMADDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibmad +LIBIBUMADDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibumad +LIBIBVERBSDIR= ${OBJTOP}/contrib/ofed/usr.lib/libibverbs +LIBMLX4DIR= ${OBJTOP}/contrib/ofed/usr.lib/libmlx4 +LIBMTHCADIR= ${OBJTOP}/contrib/ofed/usr.lib/libmthca +LIBOPENSMDIR= ${OBJTOP}/contrib/ofed/usr.lib/libopensm +LIBOSMCOMPDIR= ${OBJTOP}/contrib/ofed/usr.lib/libosmcomp +LIBOSMVENDORDIR= ${OBJTOP}/contrib/ofed/usr.lib/libosmvendor +LIBRDMACMDIR= ${OBJTOP}/contrib/ofed/usr.lib/librdmacm +LIBIBSDPDIR= ${OBJTOP}/contrib/ofed/usr.lib/libsdp LIBDIALOGDIR= ${OBJTOP}/gnu/lib/libdialog LIBGCOVDIR= ${OBJTOP}/gnu/lib/libgcov LIBGOMPDIR= ${OBJTOP}/gnu/lib/libgomp From owner-svn-src-all@freebsd.org Thu Dec 10 00:16:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6BF8A9D660C; Thu, 10 Dec 2015 00:16:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 259BA14A7; Thu, 10 Dec 2015 00:16:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA0G2Io080435; Thu, 10 Dec 2015 00:16:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA0G2PU080434; Thu, 10 Dec 2015 00:16:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201512100016.tBA0G2PU080434@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 10 Dec 2015 00:16:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292038 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 00:16:04 -0000 Author: jhb Date: Thu Dec 10 00:16:02 2015 New Revision: 292038 URL: https://svnweb.freebsd.org/changeset/base/292038 Log: Fix a copy and paste bug when this page was first written by copying from BUS_BIND_INTR.9. MFC after: 1 week Modified: head/share/man/man9/BUS_DESCRIBE_INTR.9 Modified: head/share/man/man9/BUS_DESCRIBE_INTR.9 ============================================================================== --- head/share/man/man9/BUS_DESCRIBE_INTR.9 Thu Dec 10 00:07:11 2015 (r292037) +++ head/share/man/man9/BUS_DESCRIBE_INTR.9 Thu Dec 10 00:16:02 2015 (r292038) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 14, 2009 +.Dd December 9, 2015 .Dt BUS_DESCRIBE_INTR 9 .Os .Sh NAME @@ -38,7 +38,7 @@ .In sys/param.h .In sys/bus.h .Ft int -.Fo BUS_BIND_INTR +.Fo BUS_DESCRIBE_INTR .Fa "device_t dev" "device_t child" "struct resource *irq" "void *cookie" .Fa "const char *descr" .Fc From owner-svn-src-all@freebsd.org Thu Dec 10 01:05:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A3E69D4D13; Thu, 10 Dec 2015 01:05:44 +0000 (UTC) (envelope-from yongmincho82@gmail.com) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com [IPv6:2607:f8b0:400e:c03::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 522D11D82; Thu, 10 Dec 2015 01:05:44 +0000 (UTC) (envelope-from yongmincho82@gmail.com) Received: by pacwq6 with SMTP id wq6so38109419pac.1; Wed, 09 Dec 2015 17:05:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=BqFgXNuxL2B+WNVoz9f0GhSRORGsYXIqJMCZXT1aEcA=; b=Fik/qFi9VGpv+jJpDlvX89cu2tRBV29lP9PkzrJUkp1udreC2SkSJQYuq2To2SqXw8 c8LG64/SyEw2dC9tBHE3pcOT5+lZ2oqJG/ZF+tqtFwBoLehtNNtokkapQlgdkvInxlCM aMF/KXTuYLKrYWtym7urtkMzP2Yt9QWrWn8f8B4vulqzOAOGuc7zyltBwkVeaEtny0gG l4K6kGd6MLEd84A+fggrizzAL6PMFFShoUTrUW8SKjEHLum/Y0V1RNuEMxzgkh2F7GFj KOFx//Nzi08WU5b1YPX3bDmqXMyZxDZ1//CvdYc+Z65J9uIK6/04ZQkKCD9CgBH7zjKx 5aUA== X-Received: by 10.66.142.201 with SMTP id ry9mr12692087pab.89.1449709543782; Wed, 09 Dec 2015 17:05:43 -0800 (PST) Received: from yongmincho-All-Series ([106.247.248.2]) by smtp.gmail.com with ESMTPSA id fc8sm14461821pab.21.2015.12.09.17.05.41 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 09 Dec 2015 17:05:43 -0800 (PST) Date: Thu, 10 Dec 2015 10:05:52 +0900 From: Yongmin Cho To: Hiren Panchasara Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292003 - head/sys/netinet Message-ID: <20151210010551.GA11213@yongmincho-All-Series> References: <201512082121.tB8LLmDL059933@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201512082121.tB8LLmDL059933@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 01:05:44 -0000 I've been wating for this issue is solved. I will try to test this implementation. thanks. On Tue, Dec 08, 2015 at 09:21:48PM +0000, Hiren Panchasara wrote: > Author: hiren > Date: Tue Dec 8 21:21:48 2015 > New Revision: 292003 > URL: https://svnweb.freebsd.org/changeset/base/292003 > > Log: > One of the ways to detect loss is to count duplicate acks coming back from the > other end till it reaches predetermined threshold which is 3 for us right now. > Once that happens, we trigger fast-retransmit to do loss recovery. > > Main problem with the current implementation is that we don't honor SACK > information well to detect whether an incoming ack is a dupack or not. RFC6675 > has latest recommendations for that. According to it, dupack is a segment that > arrives carrying a SACK block that identifies previously unknown information > between snd_una and snd_max even if it carries new data, changes the advertised > window, or moves the cumulative acknowledgment point. > > With the prevalence of Selective ACK (SACK) these days, improper handling can > lead to delayed loss recovery. > > With the fix, new behavior looks like following: > > 0) th_ack < snd_una --> ignore > Old acks are ignored. > 1) th_ack == snd_una, !sack_changed --> ignore > Acks with SACK enabled but without any new SACK info in them are ignored. > 2) th_ack == snd_una, window == old_window --> increment > Increment on a good dupack. > 3) th_ack == snd_una, window != old_window, sack_changed --> increment > When SACK enabled, it's okay to have advertized window changed if the ack has > new SACK info. > 4) th_ack > snd_una --> reset to 0 > Reset to 0 when left edge moves. > 5) th_ack > snd_una, sack_changed --> increment > Increment if left edge moves but there is new SACK info. > > Here, sack_changed is the indicator that incoming ack has previously unknown > SACK info in it. > > Note: This fix is not fully compliant to RFC6675. That may require a few > changes to current implementation in order to keep per-sackhole dupack counter > and change to the way we mark/handle sack holes. > > PR: 203663 > Reviewed by: jtl > MFC after: 3 weeks > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D4225 > > Modified: > head/sys/netinet/tcp_input.c > head/sys/netinet/tcp_sack.c > head/sys/netinet/tcp_var.h > > Modified: head/sys/netinet/tcp_input.c > ============================================================================== > --- head/sys/netinet/tcp_input.c Tue Dec 8 20:20:40 2015 (r292002) > +++ head/sys/netinet/tcp_input.c Tue Dec 8 21:21:48 2015 (r292003) > @@ -1481,7 +1481,7 @@ tcp_do_segment(struct mbuf *m, struct tc > struct tcpcb *tp, int drop_hdrlen, int tlen, uint8_t iptos, > int ti_locked) > { > - int thflags, acked, ourfinisacked, needoutput = 0; > + int thflags, acked, ourfinisacked, needoutput = 0, sack_changed; > int rstreason, todrop, win; > u_long tiwin; > char *s; > @@ -1501,6 +1501,7 @@ tcp_do_segment(struct mbuf *m, struct tc > thflags = th->th_flags; > inc = &tp->t_inpcb->inp_inc; > tp->sackhint.last_sack_ack = 0; > + sack_changed = 0; > > /* > * If this is either a state-changing packet or current state isn't > @@ -2424,7 +2425,7 @@ tcp_do_segment(struct mbuf *m, struct tc > if ((tp->t_flags & TF_SACK_PERMIT) && > ((to.to_flags & TOF_SACK) || > !TAILQ_EMPTY(&tp->snd_holes))) > - tcp_sack_doack(tp, &to, th->th_ack); > + sack_changed = tcp_sack_doack(tp, &to, th->th_ack); > else > /* > * Reset the value so that previous (valid) value > @@ -2436,7 +2437,9 @@ tcp_do_segment(struct mbuf *m, struct tc > hhook_run_tcp_est_in(tp, th, &to); > > if (SEQ_LEQ(th->th_ack, tp->snd_una)) { > - if (tlen == 0 && tiwin == tp->snd_wnd) { > + if (tlen == 0 && > + (tiwin == tp->snd_wnd || > + (tp->t_flags & TF_SACK_PERMIT))) { > /* > * If this is the first time we've seen a > * FIN from the remote, this is not a > @@ -2478,8 +2481,20 @@ tcp_do_segment(struct mbuf *m, struct tc > * When using TCP ECN, notify the peer that > * we reduced the cwnd. > */ > - if (!tcp_timer_active(tp, TT_REXMT) || > - th->th_ack != tp->snd_una) > + /* > + * Following 2 kinds of acks should not affect > + * dupack counting: > + * 1) Old acks > + * 2) Acks with SACK but without any new SACK > + * information in them. These could result from > + * any anomaly in the network like a switch > + * duplicating packets or a possible DoS attack. > + */ > + if (th->th_ack != tp->snd_una || > + ((tp->t_flags & TF_SACK_PERMIT) && > + !sack_changed)) > + break; > + else if (!tcp_timer_active(tp, TT_REXMT)) > tp->t_dupacks = 0; > else if (++tp->t_dupacks > tcprexmtthresh || > IN_FASTRECOVERY(tp->t_flags)) { > @@ -2608,9 +2623,20 @@ tcp_do_segment(struct mbuf *m, struct tc > tp->snd_cwnd = oldcwnd; > goto drop; > } > - } else > - tp->t_dupacks = 0; > + } > break; > + } else { > + /* > + * This ack is advancing the left edge, reset the > + * counter. > + */ > + tp->t_dupacks = 0; > + /* > + * If this ack also has new SACK info, increment the > + * counter as per rfc6675. > + */ > + if ((tp->t_flags & TF_SACK_PERMIT) && sack_changed) > + tp->t_dupacks++; > } > > KASSERT(SEQ_GT(th->th_ack, tp->snd_una), > @@ -2629,7 +2655,6 @@ tcp_do_segment(struct mbuf *m, struct tc > } else > cc_post_recovery(tp, th); > } > - tp->t_dupacks = 0; > /* > * If we reach this point, ACK is not a duplicate, > * i.e., it ACKs something we sent. > > Modified: head/sys/netinet/tcp_sack.c > ============================================================================== > --- head/sys/netinet/tcp_sack.c Tue Dec 8 20:20:40 2015 (r292002) > +++ head/sys/netinet/tcp_sack.c Tue Dec 8 21:21:48 2015 (r292003) > @@ -345,17 +345,22 @@ tcp_sackhole_remove(struct tcpcb *tp, st > * Process cumulative ACK and the TCP SACK option to update the scoreboard. > * tp->snd_holes is an ordered list of holes (oldest to newest, in terms of > * the sequence space). > + * Returns 1 if incoming ACK has previously unknown SACK information, > + * 0 otherwise. Note: We treat (snd_una, th_ack) as a sack block so any changes > + * to that (i.e. left edge moving) would also be considered a change in SACK > + * information which is slightly different than rfc6675. > */ > -void > +int > tcp_sack_doack(struct tcpcb *tp, struct tcpopt *to, tcp_seq th_ack) > { > struct sackhole *cur, *temp; > struct sackblk sack, sack_blocks[TCP_MAX_SACK + 1], *sblkp; > - int i, j, num_sack_blks; > + int i, j, num_sack_blks, sack_changed; > > INP_WLOCK_ASSERT(tp->t_inpcb); > > num_sack_blks = 0; > + sack_changed = 0; > /* > * If SND.UNA will be advanced by SEG.ACK, and if SACK holes exist, > * treat [SND.UNA, SEG.ACK) as if it is a SACK block. > @@ -392,7 +397,7 @@ tcp_sack_doack(struct tcpcb *tp, struct > * received. > */ > if (num_sack_blks == 0) > - return; > + return (sack_changed); > > /* > * Sort the SACK blocks so we can update the scoreboard with just one > @@ -443,6 +448,7 @@ tcp_sack_doack(struct tcpcb *tp, struct > tp->snd_fack = sblkp->end; > /* Go to the previous sack block. */ > sblkp--; > + sack_changed = 1; > } else { > /* > * We failed to add a new hole based on the current > @@ -459,9 +465,11 @@ tcp_sack_doack(struct tcpcb *tp, struct > SEQ_LT(tp->snd_fack, sblkp->end)) > tp->snd_fack = sblkp->end; > } > - } else if (SEQ_LT(tp->snd_fack, sblkp->end)) > + } else if (SEQ_LT(tp->snd_fack, sblkp->end)) { > /* fack is advanced. */ > tp->snd_fack = sblkp->end; > + sack_changed = 1; > + } > /* We must have at least one SACK hole in scoreboard. */ > KASSERT(!TAILQ_EMPTY(&tp->snd_holes), > ("SACK scoreboard must not be empty")); > @@ -490,6 +498,7 @@ tcp_sack_doack(struct tcpcb *tp, struct > tp->sackhint.sack_bytes_rexmit -= (cur->rxmit - cur->start); > KASSERT(tp->sackhint.sack_bytes_rexmit >= 0, > ("sackhint bytes rtx >= 0")); > + sack_changed = 1; > if (SEQ_LEQ(sblkp->start, cur->start)) { > /* Data acks at least the beginning of hole. */ > if (SEQ_GEQ(sblkp->end, cur->end)) { > @@ -545,6 +554,7 @@ tcp_sack_doack(struct tcpcb *tp, struct > else > sblkp--; > } > + return (sack_changed); > } > > /* > > Modified: head/sys/netinet/tcp_var.h > ============================================================================== > --- head/sys/netinet/tcp_var.h Tue Dec 8 20:20:40 2015 (r292002) > +++ head/sys/netinet/tcp_var.h Tue Dec 8 21:21:48 2015 (r292003) > @@ -741,7 +741,7 @@ void tcp_hc_update(struct in_conninfo * > extern struct pr_usrreqs tcp_usrreqs; > tcp_seq tcp_new_isn(struct tcpcb *); > > -void tcp_sack_doack(struct tcpcb *, struct tcpopt *, tcp_seq); > +int tcp_sack_doack(struct tcpcb *, struct tcpopt *, tcp_seq); > void tcp_update_sack_list(struct tcpcb *tp, tcp_seq rcv_laststart, tcp_seq rcv_lastend); > void tcp_clean_sackreport(struct tcpcb *tp); > void tcp_sack_adjust(struct tcpcb *tp); > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Thu Dec 10 01:16:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 604709D54C5; Thu, 10 Dec 2015 01:16:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 28677134C; Thu, 10 Dec 2015 01:16:23 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA1GMWu098092; Thu, 10 Dec 2015 01:16:22 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA1GMI7098091; Thu, 10 Dec 2015 01:16:22 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512100116.tBA1GMI7098091@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 10 Dec 2015 01:16:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292039 - head/usr.bin/clang/lldb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 01:16:23 -0000 Author: bdrewery Date: Thu Dec 10 01:16:22 2015 New Revision: 292039 URL: https://svnweb.freebsd.org/changeset/base/292039 Log: Use LIBADD for pthread. Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/clang/lldb/Makefile Modified: head/usr.bin/clang/lldb/Makefile ============================================================================== --- head/usr.bin/clang/lldb/Makefile Thu Dec 10 00:16:02 2015 (r292038) +++ head/usr.bin/clang/lldb/Makefile Thu Dec 10 01:16:22 2015 (r292039) @@ -161,6 +161,6 @@ LIBDEPS=\ llvmcore \ llvmsupport -.include "../clang.prog.mk" +LIBADD+= pthread -LDADD+= -lpthread +.include "../clang.prog.mk" From owner-svn-src-all@freebsd.org Thu Dec 10 01:17:31 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3A4B9D55B2; Thu, 10 Dec 2015 01:17:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C49DB164F; Thu, 10 Dec 2015 01:17:31 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA1HUVG098191; Thu, 10 Dec 2015 01:17:30 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA1HUoO098190; Thu, 10 Dec 2015 01:17:30 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512100117.tBA1HUoO098190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 10 Dec 2015 01:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292041 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 01:17:32 -0000 Author: mav Date: Thu Dec 10 01:17:30 2015 New Revision: 292041 URL: https://svnweb.freebsd.org/changeset/base/292041 Log: Guess NVRAM address for 16Gbps Qlogic cards. I have feeling this approach is wrong, but it works for me so far and it is better then nothing. Modified: head/sys/dev/isp/isp.c Modified: head/sys/dev/isp/isp.c ============================================================================== --- head/sys/dev/isp/isp.c Thu Dec 10 01:16:48 2015 (r292040) +++ head/sys/dev/isp/isp.c Thu Dec 10 01:17:30 2015 (r292041) @@ -7920,7 +7920,9 @@ isp_rd_2400_nvram(ispsoftc_t *isp, uint3 uint32_t base = 0x7ffe0000; uint32_t tmp = 0; - if (IS_25XX(isp)) { + if (IS_26XX(isp)) { + base = 0x7fe7c000; /* XXX: Observation, may be wrong. */ + } else if (IS_25XX(isp)) { base = 0x7ff00000 | 0x48000; } ISP_WRITE(isp, BIU2400_FLASH_ADDR, base | addr); From owner-svn-src-all@freebsd.org Thu Dec 10 01:41:06 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3E5F9D672F; Thu, 10 Dec 2015 01:41:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A0C7A1006; Thu, 10 Dec 2015 01:41:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA1f5sA006692; Thu, 10 Dec 2015 01:41:05 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA1f5AF006691; Thu, 10 Dec 2015 01:41:05 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201512100141.tBA1f5AF006691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 10 Dec 2015 01:41:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292042 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 01:41:06 -0000 Author: mav Date: Thu Dec 10 01:41:05 2015 New Revision: 292042 URL: https://svnweb.freebsd.org/changeset/base/292042 Log: Update list of card names. Modified: head/share/man/man4/isp.4 Modified: head/share/man/man4/isp.4 ============================================================================== --- head/share/man/man4/isp.4 Thu Dec 10 01:17:30 2015 (r292041) +++ head/share/man/man4/isp.4 Thu Dec 10 01:41:05 2015 (r292042) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2015 +.Dd December 9, 2015 .Dt ISP 4 .Os .Sh NAME @@ -107,10 +107,12 @@ Optical 2Gb Fibre Channel PCIe cards. Dell branded version of the QLogic 2312. .It Qlogic 2422 Optical 4Gb Fibre Channel PCI cards. -.It Qlogic 2432 +.It Qlogic 246x (aka 2432) Optical 4Gb Fibre Channel PCIe cards. -.It Qlogic 2532 +.It Qlogic 256x (aka 2532) Optical 8Gb Fibre Channel PCIe cards. +.It Qlogic 267x/836x (aka 2031/8031) +Optical 16Gb FC/FCoE PCIe cards. .El .Sh CONFIGURATION OPTIONS Target mode support for Fibre Channel adapters may be enabled with the @@ -127,12 +129,6 @@ They are: .It Va hint.isp.0.fwload_disable A hint value to disable loading of firmware .Xr ispfw 4 . -.It Va hint.isp.0.prefer_memmap -A hint value to use PCI memory space instead of I/O space -access for. -.It Va hint.isp.0.prefer_iomap -A hint value to use PCI I/O space instead of Memory space -access for. .It Va hint.isp.0.ignore_nvram A hint value to ignore board NVRAM settings for. Otherwise use NVRAM settings. From owner-svn-src-all@freebsd.org Thu Dec 10 01:52:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 651459D6EE1; Thu, 10 Dec 2015 01:52:30 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D2631847; Thu, 10 Dec 2015 01:52:30 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA1qTgH009720; Thu, 10 Dec 2015 01:52:29 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA1qTRL009718; Thu, 10 Dec 2015 01:52:29 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201512100152.tBA1qTRL009718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 10 Dec 2015 01:52:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292043 - head/usr.sbin/pmcstudy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 01:52:30 -0000 Author: rrs Date: Thu Dec 10 01:52:29 2015 New Revision: 292043 URL: https://svnweb.freebsd.org/changeset/base/292043 Log: Fix several typos and bugs within pmcstudy. Also highlight the one SB test that is failing (and is likely a problem in the actual PMC defintions). Add to this also the -A option to run all canned tests. Sponsored by: Netflix Inc. Modified: head/usr.sbin/pmcstudy/pmcstudy.8 head/usr.sbin/pmcstudy/pmcstudy.c Modified: head/usr.sbin/pmcstudy/pmcstudy.8 ============================================================================== --- head/usr.sbin/pmcstudy/pmcstudy.8 Thu Dec 10 01:41:05 2015 (r292042) +++ head/usr.sbin/pmcstudy/pmcstudy.8 Thu Dec 10 01:52:29 2015 (r292043) @@ -32,7 +32,7 @@ .Nd Perform various studies on a system's overall PMCs. .Sh SYNOPSIS .Nm -.Oo Fl i Ar inputfile | Fl T | Fl v | Fl m Ar max | Fl e exp | Fl Ar E | Fl h | fl H Oc +.Oo Fl i Ar inputfile | Fl A | Fl T | Fl v | Fl m Ar max | Fl e exp | Fl Ar E | Fl h | fl H Oc .Nm .Fl i Ar inputfile .Nm @@ -128,6 +128,8 @@ test like "UOPS_RETIRED.RETIRE_SLOTS / (4 * CPU_CLK_UNHALTED.THREAD_P)". .It Fl L This option will list all known PMCs and their abbreviation (%NNN). +.It Fl A +Run all canned tests. .El .Sh SEE ALSO .Xr pmc 3 , Modified: head/usr.sbin/pmcstudy/pmcstudy.c ============================================================================== --- head/usr.sbin/pmcstudy/pmcstudy.c Thu Dec 10 01:41:05 2015 (r292042) +++ head/usr.sbin/pmcstudy/pmcstudy.c Thu Dec 10 01:52:29 2015 (r292043) @@ -38,6 +38,9 @@ #include "eval_expr.h" __FBSDID("$FreeBSD$"); +static int max_pmc_counters = 1; +static int run_all = 0; + #define MAX_COUNTER_SLOTS 1024 #define MAX_NLEN 64 #define MAX_CPU 64 @@ -45,20 +48,20 @@ static int verbose = 0; extern char **environ; extern struct expression *master_exp; -struct expression *master_exp = NULL; +struct expression *master_exp=NULL; #define PMC_INITIAL_ALLOC 512 extern char **valid_pmcs; char **valid_pmcs = NULL; extern int valid_pmc_cnt; -int valid_pmc_cnt = 0; +int valid_pmc_cnt=0; extern int pmc_allocated_cnt; -int pmc_allocated_cnt = 0; +int pmc_allocated_cnt=0; /* * The following two varients on popen and pclose with * the cavet that they get you the PID so that you - * can supply it to pclose so it can send a SIGTERM + * can supply it to pclose so it can send a SIGTERM * to the process. */ static FILE * @@ -75,7 +78,7 @@ my_popen(const char *command, const char if ((strcmp(dir, "r") != 0) && (strcmp(dir, "w") != 0)) { errno = EINVAL; - return (NULL); + return(NULL); } if (pipe(pdesin) < 0) return (NULL); @@ -94,14 +97,14 @@ my_popen(const char *command, const char argv[3] = NULL; switch (pid = fork()) { - case -1: /* Error. */ + case -1: /* Error. */ (void)close(pdesin[0]); (void)close(pdesin[1]); (void)close(pdesout[0]); (void)close(pdesout[1]); return (NULL); /* NOTREACHED */ - case 0: /* Child. */ + case 0: /* Child. */ /* Close out un-used sides */ (void)close(pdesin[1]); (void)close(pdesout[0]); @@ -129,8 +132,8 @@ my_popen(const char *command, const char (void)close(pdesin[0]); (void)close(pdesout[0]); (void)close(pdesout[1]); - return (io_out); - } else { + return(io_out); + } else { /* Prepare the input stream */ io_in = fdopen(pdesout[0], "r"); (void)close(pdesout[1]); @@ -146,7 +149,7 @@ my_popen(const char *command, const char * if already `pclosed', or waitpid returns an error. */ static void -my_pclose(FILE * io, pid_t the_pid) +my_pclose(FILE *io, pid_t the_pid) { int pstat; pid_t pid; @@ -164,41 +167,41 @@ my_pclose(FILE * io, pid_t the_pid) struct counters { struct counters *next_cpu; - char counter_name[MAX_NLEN]; /* Name of counter */ - int cpu; /* CPU we are on */ - int pos; /* Index we are filling to. */ + char counter_name[MAX_NLEN]; /* Name of counter */ + int cpu; /* CPU we are on */ + int pos; /* Index we are filling to. */ uint64_t vals[MAX_COUNTER_SLOTS]; /* Last 64 entries */ - uint64_t sum; /* Summary of entries */ + uint64_t sum; /* Summary of entries */ }; extern struct counters *glob_cpu[MAX_CPU]; struct counters *glob_cpu[MAX_CPU]; extern struct counters *cnts; -struct counters *cnts = NULL; +struct counters *cnts=NULL; extern int ncnts; -int ncnts = 0; +int ncnts=0; -extern int (*expression) (struct counters *, int); -int (*expression) (struct counters *, int); +extern int (*expression)(struct counters *, int); +int (*expression)(struct counters *, int); -static const char *threshold = NULL; +static const char *threshold=NULL; static const char *command; struct cpu_entry { const char *name; const char *thresh; const char *command; - int (*func) (struct counters *, int); + int (*func)(struct counters *, int); + int counters_required; }; - struct cpu_type { char cputype[32]; int number; struct cpu_entry *ents; - void (*explain) (const char *name); + void (*explain)(const char *name); }; extern struct cpu_type the_cpu; struct cpu_type the_cpu; @@ -207,7 +210,6 @@ static void explain_name_sb(const char *name) { const char *mythresh; - if (strcmp(name, "allocstall1") == 0) { printf("Examine PARTIAL_RAT_STALLS.SLOW_LEA_WINDOW / CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh > .05"; @@ -218,10 +220,10 @@ explain_name_sb(const char *name) printf("Examine (20 * BR_MISP_RETIRED.ALL_BRANCHES)/CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh >= .2"; } else if (strcmp(name, "splitload") == 0) { - printf("Examine MEM_UOP_RETIRED.SPLIT_LOADS * 5) / CPU_CLK_UNHALTED.THREAD_P\n"); + printf("Examine MEM_UOPS_RETIRED.SPLIT_LOADS * 5) / CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh >= .1"; } else if (strcmp(name, "splitstore") == 0) { - printf("Examine MEM_UOP_RETIRED.SPLIT_STORES / MEM_UOP_RETIRED.ALL_STORES\n"); + printf("Examine MEM_UOPS_RETIRED.SPLIT_STORES / MEM_UOPS_RETIRED.ALL_STORES\n"); mythresh = "thresh >= .01"; } else if (strcmp(name, "contested") == 0) { printf("Examine (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 60) / CPU_CLK_UNHALTED.THREAD_P\n"); @@ -279,7 +281,7 @@ explain_name_sb(const char *name) } else { printf("Unknown name:%s\n", name); mythresh = "unknown entry"; - } + } printf("If the value printed is %s we may have the ability to improve performance\n", mythresh); } @@ -287,7 +289,6 @@ static void explain_name_ib(const char *name) { const char *mythresh; - if (strcmp(name, "br_miss") == 0) { printf("Examine ((BR_MISP_RETIRED.ALL_BRANCHES /(BR_MISP_RETIRED.ALL_BRANCHES +\n"); printf(" MACHINE_CLEAR.COUNT) * ((UOPS_ISSUED.ANY - UOPS_RETIRED.RETIRE_SLOTS + 4 * INT_MISC.RECOVERY_CYCLES)\n"); @@ -307,7 +308,7 @@ explain_name_ib(const char *name) mythresh = "thresh >= .2"; } else if (strcmp(name, "itlbmiss") == 0) { printf("Examine ITLB_MISSES.WALK_DURATION / CPU_CLK_UNHALTED.THREAD_P\n"); - mythresh = "thresh > .05"; + mythresh = "thresh > .05"; } else if (strcmp(name, "icachemiss") == 0) { printf("Examine (ICACHE.IFETCH_STALL - ITLB_MISSES.WALK_DURATION)/ CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh > .05"; @@ -325,7 +326,7 @@ explain_name_ib(const char *name) printf(" LD_BLOCKS.NO_SR)/CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh >= .1"; } else if (strcmp(name, "splitstore") == 0) { - printf("Examine MEM_UOP_RETIRED.SPLIT_STORES / MEM_UOP_RETIRED.ALL_STORES\n"); + printf("Examine MEM_UOPS_RETIRED.SPLIT_STORES / MEM_UOPS_RETIRED.ALL_STORES\n"); mythresh = "thresh >= .01"; } else if (strcmp(name, "aliasing_4k") == 0) { printf("Examine (LD_BLOCKS_PARTIAL.ADDRESS_ALIAS * 5) / CPU_CLK_UNHALTED.THREAD_P\n"); @@ -362,7 +363,7 @@ explain_name_ib(const char *name) } else { printf("Unknown name:%s\n", name); mythresh = "unknown entry"; - } + } printf("If the value printed is %s we may have the ability to improve performance\n", mythresh); } @@ -371,7 +372,6 @@ static void explain_name_has(const char *name) { const char *mythresh; - if (strcmp(name, "eff1") == 0) { printf("Examine (UOPS_RETIRED.RETIRE_SLOTS)/(4 *CPU_CLK_UNHALTED.THREAD_P)\n"); mythresh = "thresh < .75"; @@ -380,7 +380,7 @@ explain_name_has(const char *name) mythresh = "thresh > 1.0"; } else if (strcmp(name, "itlbmiss") == 0) { printf("Examine ITLB_MISSES.WALK_DURATION / CPU_CLK_UNHALTED.THREAD_P\n"); - mythresh = "thresh > .05"; + mythresh = "thresh > .05"; } else if (strcmp(name, "icachemiss") == 0) { printf("Examine (36 * ICACHE.MISSES)/ CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh > .05"; @@ -406,10 +406,10 @@ explain_name_has(const char *name) printf("Examine (LD_BLOCKS_STORE_FORWARD * 13) / CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh >= .05"; } else if (strcmp(name, "splitload") == 0) { - printf("Examine (MEM_UOP_RETIRED.SPLIT_LOADS * 5) / CPU_CLK_UNHALTED.THREAD_P\n"); + printf("Examine (MEM_UOPS_RETIRED.SPLIT_LOADS * 5) / CPU_CLK_UNHALTED.THREAD_P\n"); mythresh = "thresh >= .1"; } else if (strcmp(name, "splitstore") == 0) { - printf("Examine MEM_UOP_RETIRED.SPLIT_STORES / MEM_UOP_RETIRED.ALL_STORES\n"); + printf("Examine MEM_UOPS_RETIRED.SPLIT_STORES / MEM_UOPS_RETIRED.ALL_STORES\n"); mythresh = "thresh >= .01"; } else if (strcmp(name, "aliasing_4k") == 0) { printf("Examine (LD_BLOCKS_PARTIAL.ADDRESS_ALIAS * 5) / CPU_CLK_UNHALTED.THREAD_P\n"); @@ -442,10 +442,12 @@ explain_name_has(const char *name) } else { printf("Unknown name:%s\n", name); mythresh = "unknown entry"; - } + } printf("If the value printed is %s we may have the ability to improve performance\n", mythresh); } + + static struct counters * find_counter(struct counters *base, const char *name) { @@ -454,16 +456,16 @@ find_counter(struct counters *base, cons at = base; len = strlen(name); - while (at) { + while(at) { if (strncmp(at->counter_name, name, len) == 0) { - return (at); + return(at); } at = at->next_cpu; } printf("Can't find counter %s\n", name); printf("We have:\n"); at = base; - while (at) { + while(at) { printf("- %s\n", at->counter_name); at = at->next_cpu; } @@ -478,7 +480,6 @@ allocstall1(struct counters *cpu, int po struct counters *partial; struct counters *unhalt; double un, par, res; - unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); partial = find_counter(cpu, "PARTIAL_RAT_STALLS.SLOW_LEA_WINDOW"); if (pos != -1) { @@ -488,9 +489,9 @@ allocstall1(struct counters *cpu, int po par = partial->sum * 1.0; un = unhalt->sum * 1.0; } - res = par / un; + res = par/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int @@ -501,7 +502,6 @@ allocstall2(struct counters *cpu, int po struct counters *partial; struct counters *unhalt; double un, par, res; - unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); partial = find_counter(cpu, "PARTIAL_RAT_STALLS.FLAGS_MERGE_UOP"); if (pos != -1) { @@ -511,9 +511,9 @@ allocstall2(struct counters *cpu, int po par = partial->sum * 1.0; un = unhalt->sum * 1.0; } - res = par / un; + res = par/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int @@ -522,14 +522,12 @@ br_mispredict(struct counters *cpu, int struct counters *brctr; struct counters *unhalt; int ret; - /* 3 - (20 * BR_MISP_RETIRED.ALL_BRANCHES)/CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) */ double br, un, con, res; - con = 20.0; - + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); - brctr = find_counter(cpu, "BR_MISP_RETIRED.ALL_BRANCHES"); + brctr = find_counter(cpu, "BR_MISP_RETIRED.ALL_BRANCHES"); if (pos != -1) { br = brctr->vals[pos] * 1.0; un = unhalt->vals[pos] * 1.0; @@ -537,9 +535,9 @@ br_mispredict(struct counters *cpu, int br = brctr->sum * 1.0; un = unhalt->sum * 1.0; } - res = (con * br) / un; - ret = printf("%1.3f", res); - return (ret); + res = (con * br)/un; + ret = printf("%1.3f", res); + return(ret); } static int @@ -549,25 +547,22 @@ br_mispredictib(struct counters *cpu, in struct counters *unhalt; struct counters *clear, *clear2, *clear3; struct counters *uops; - struct counters *recv; + struct counters *recv; struct counters *iss; - /* "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s BR_MISP_RETIRED.ALL_BRANCHES -s MACHINE_CLEARS.MEMORY_ORDERING -s MACHINE_CLEARS.SMC -s MACHINE_CLEARS.MASKMOV -s UOPS_ISSUED.ANY -s UOPS_RETIRED.RETIRE_SLOTS -s INT_MISC.RECOVERY_CYCLES -w 1",*/ int ret; - - /* - * (BR_MISP_RETIRED.ALL_BRANCHES / (BR_MISP_RETIRED.ALL_BRANCHES + - * MACHINE_CLEAR.COUNT) * ((UOPS_ISSUED.ANY - - * UOPS_RETIRED.RETIRE_SLOTS + 4 * INT_MISC.RECOVERY_CYCLES) / (4 * - * CPU_CLK_UNHALTED.THREAD))) - * + /* + * (BR_MISP_RETIRED.ALL_BRANCHES / + * (BR_MISP_RETIRED.ALL_BRANCHES + + * MACHINE_CLEAR.COUNT) * + * ((UOPS_ISSUED.ANY - UOPS_RETIRED.RETIRE_SLOTS + 4 * INT_MISC.RECOVERY_CYCLES) / (4 * CPU_CLK_UNHALTED.THREAD))) + * */ double br, cl, cl2, cl3, uo, re, un, con, res, is; - con = 4.0; - + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); - brctr = find_counter(cpu, "BR_MISP_RETIRED.ALL_BRANCHES"); + brctr = find_counter(cpu, "BR_MISP_RETIRED.ALL_BRANCHES"); clear = find_counter(cpu, "MACHINE_CLEARS.MEMORY_ORDERING"); clear2 = find_counter(cpu, "MACHINE_CLEARS.SMC"); clear3 = find_counter(cpu, "MACHINE_CLEARS.MASKMOV"); @@ -593,11 +588,12 @@ br_mispredictib(struct counters *cpu, in is = iss->sum * 1.0; un = unhalt->sum * 1.0; } - res = (br / (br + cl + cl2 + cl3) * ((is - uo + con * re) / (con * un))); - ret = printf("%1.3f", res); - return (ret); + res = (br/(br + cl + cl2 + cl3) * ((is - uo + con * re) / (con * un))); + ret = printf("%1.3f", res); + return(ret); } + static int br_mispredict_broad(struct counters *cpu, int pos) { @@ -611,9 +607,9 @@ br_mispredict_broad(struct counters *cpu double br, cl, uo, uo_r, re, con, un, res; con = 4.0; - + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); - brctr = find_counter(cpu, "BR_MISP_RETIRED.ALL_BRANCHES"); + brctr = find_counter(cpu, "BR_MISP_RETIRED.ALL_BRANCHES"); clear = find_counter(cpu, "MACHINE_CLEARS.CYCLES"); uops = find_counter(cpu, "UOPS_ISSUED.ANY"); uops_ret = find_counter(cpu, "UOPS_RETIRED.RETIRE_SLOTS"); @@ -635,8 +631,8 @@ br_mispredict_broad(struct counters *cpu re = recv->sum * 1.0; } res = br / (br + cl) * (uo - uo_r + con * re) / (un * con); - ret = printf("%1.3f", res); - return (ret); + ret = printf("%1.3f", res); + return(ret); } static int @@ -647,12 +643,9 @@ splitloadib(struct counters *cpu, int po struct counters *l1d, *ldblock; struct counters *unhalt; double un, memd, res, l1, ldb; - - /* - * ((L1D_PEND_MISS.PENDING / MEM_LOAD_UOPS_RETIRED.L1_MISS) * - * LD_BLOCKS.NO_SR) / CPU_CLK_UNHALTED.THREAD_P "pmcstat -s - * CPU_CLK_UNHALTED.THREAD_P -s L1D_PEND_MISS.PENDING -s - * MEM_LOAD_UOPS_RETIRED.L1_MISS -s LD_BLOCKS.NO_SR -w 1", + /* + * ((L1D_PEND_MISS.PENDING / MEM_LOAD_UOPS_RETIRED.L1_MISS) * LD_BLOCKS.NO_SR) / CPU_CLK_UNHALTED.THREAD_P + * "pmcstat -s CPU_CLK_UNHALTED.THREAD_P -s L1D_PEND_MISS.PENDING -s MEM_LOAD_UOPS_RETIRED.L1_MISS -s LD_BLOCKS.NO_SR -w 1", */ unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); @@ -670,11 +663,12 @@ splitloadib(struct counters *cpu, int po ldb = ldblock->sum * 1.0; un = unhalt->sum * 1.0; } - res = ((l1 / memd) * ldb) / un; + res = ((l1 / memd) * ldb)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } + static int splitload(struct counters *cpu, int pos) { @@ -682,7 +676,31 @@ splitload(struct counters *cpu, int pos) struct counters *mem; struct counters *unhalt; double con, un, memd, res; +/* 4 - (MEM_UOPS_RETIRED.SPLIT_LOADS * 5) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .1)*/ + + con = 5.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + mem = find_counter(cpu, "MEM_UOPS_RETIRED.SPLIT_LOADS"); + if (pos != -1) { + memd = mem->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + } else { + memd = mem->sum * 1.0; + un = unhalt->sum * 1.0; + } + res = (memd * con)/un; + ret = printf("%1.3f", res); + return(ret); +} + +static int +splitload_sb(struct counters *cpu, int pos) +{ + int ret; + struct counters *mem; + struct counters *unhalt; + double con, un, memd, res; /* 4 - (MEM_UOP_RETIRED.SPLIT_LOADS * 5) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .1)*/ con = 5.0; @@ -695,23 +713,20 @@ splitload(struct counters *cpu, int pos) memd = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (memd * con) / un; + res = (memd * con)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } + static int -splitstore(struct counters *cpu, int pos) +splitstore_sb(struct counters *cpu, int pos) { - /* - * 5 - MEM_UOP_RETIRED.SPLIT_STORES / MEM_UOP_RETIRED.ALL_STORES - * (thresh > 0.01) - */ + /* 5 - MEM_UOP_RETIRED.SPLIT_STORES / MEM_UOP_RETIRED.ALL_STORES (thresh > 0.01) */ int ret; struct counters *mem_split; struct counters *mem_stores; double memsplit, memstore, res; - mem_split = find_counter(cpu, "MEM_UOP_RETIRED.SPLIT_STORES"); mem_stores = find_counter(cpu, "MEM_UOP_RETIRED.ALL_STORES"); if (pos != -1) { @@ -721,19 +736,40 @@ splitstore(struct counters *cpu, int pos memsplit = mem_split->sum * 1.0; memstore = mem_stores->sum * 1.0; } - res = memsplit / memstore; + res = memsplit/memstore; + ret = printf("%1.3f", res); + return(ret); +} + + + +static int +splitstore(struct counters *cpu, int pos) +{ + /* 5 - MEM_UOPS_RETIRED.SPLIT_STORES / MEM_UOPS_RETIRED.ALL_STORES (thresh > 0.01) */ + int ret; + struct counters *mem_split; + struct counters *mem_stores; + double memsplit, memstore, res; + mem_split = find_counter(cpu, "MEM_UOPS_RETIRED.SPLIT_STORES"); + mem_stores = find_counter(cpu, "MEM_UOPS_RETIRED.ALL_STORES"); + if (pos != -1) { + memsplit = mem_split->vals[pos] * 1.0; + memstore = mem_stores->vals[pos] * 1.0; + } else { + memsplit = mem_split->sum * 1.0; + memstore = mem_stores->sum * 1.0; + } + res = memsplit/memstore; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int contested(struct counters *cpu, int pos) { - /* - * 6 - (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 60) / - * CPU_CLK_UNHALTED.THREAD_P (thresh >.05) - */ + /* 6 - (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 60) / CPU_CLK_UNHALTED.THREAD_P (thresh >.05) */ int ret; struct counters *mem; struct counters *unhalt; @@ -749,18 +785,15 @@ contested(struct counters *cpu, int pos) memd = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (memd * con) / un; + res = (memd * con)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int contested_has(struct counters *cpu, int pos) { - /* - * 6 - (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84) / - * CPU_CLK_UNHALTED.THREAD_P (thresh >.05) - */ + /* 6 - (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84) / CPU_CLK_UNHALTED.THREAD_P (thresh >.05) */ int ret; struct counters *mem; struct counters *unhalt; @@ -776,18 +809,15 @@ contested_has(struct counters *cpu, int memd = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (memd * con) / un; + res = (memd * con)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int contestedbroad(struct counters *cpu, int pos) { - /* - * 6 - (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84) / - * CPU_CLK_UNHALTED.THREAD_P (thresh >.05) - */ + /* 6 - (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84) / CPU_CLK_UNHALTED.THREAD_P (thresh >.05) */ int ret; struct counters *mem; struct counters *mem2; @@ -797,7 +827,7 @@ contestedbroad(struct counters *cpu, int con = 84.0; unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); mem = find_counter(cpu, "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM"); - mem2 = find_counter(cpu, "MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS"); + mem2 = find_counter(cpu,"MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_MISS"); if (pos != -1) { memd = mem->vals[pos] * 1.0; @@ -808,19 +838,16 @@ contestedbroad(struct counters *cpu, int memtoo = mem2->sum * 1.0; un = unhalt->sum * 1.0; } - res = ((memd * con) + memtoo) / un; + res = ((memd * con) + memtoo)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int blockstoreforward(struct counters *cpu, int pos) { - /* - * 7 - (LD_BLOCKS_STORE_FORWARD * 13) / CPU_CLK_UNHALTED.THREAD_P - * (thresh >= .05) - */ + /* 7 - (LD_BLOCKS_STORE_FORWARD * 13) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .05)*/ int ret; struct counters *ldb; struct counters *unhalt; @@ -836,19 +863,17 @@ blockstoreforward(struct counters *cpu, ld = ldb->sum * 1.0; un = unhalt->sum * 1.0; } - res = (ld * con) / un; + res = (ld * con)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int cache2(struct counters *cpu, int pos) { - /* - * ** Suspect *** 8 - ((MEM_LOAD_RETIRED.L3_HIT * 26) + - * (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT * 43) + - * (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 60)) / - * CPU_CLK_UNHALTED.THREAD_P (thresh >.2) + /* ** Suspect *** + * 8 - ((MEM_LOAD_RETIRED.L3_HIT * 26) + (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT * 43) + + * (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 60)) / CPU_CLK_UNHALTED.THREAD_P (thresh >.2) */ int ret; struct counters *mem1, *mem2, *mem3; @@ -874,17 +899,16 @@ cache2(struct counters *cpu, int pos) me_3 = mem3->sum * 1.0; un = unhalt->sum * 1.0; } - res = ((me_1 * con1) + (me_2 * con2) + (me_3 * con3)) / un; + res = ((me_1 * con1) + (me_2 * con2) + (me_3 * con3))/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int datasharing(struct counters *cpu, int pos) { - /* - * (MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT * 43)/ - * CPU_CLK_UNHALTED.THREAD_P (thresh >.2) + /* + * (MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT * 43)/ CPU_CLK_UNHALTED.THREAD_P (thresh >.2) */ int ret; struct counters *mem; @@ -901,9 +925,9 @@ datasharing(struct counters *cpu, int po me = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (me * con) / un; + res = (me * con)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } @@ -911,9 +935,8 @@ datasharing(struct counters *cpu, int po static int datasharing_has(struct counters *cpu, int pos) { - /* - * (MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT * 43)/ - * CPU_CLK_UNHALTED.THREAD_P (thresh >.2) + /* + * (MEM_LOAD_UOPS_L3_HIT_RETIRED.XSNP_HIT * 43)/ CPU_CLK_UNHALTED.THREAD_P (thresh >.2) */ int ret; struct counters *mem; @@ -930,9 +953,9 @@ datasharing_has(struct counters *cpu, in me = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (me * con) / un; + res = (me * con)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } @@ -940,9 +963,8 @@ datasharing_has(struct counters *cpu, in static int cache2ib(struct counters *cpu, int pos) { - /* - * (29 * MEM_LOAD_UOPS_RETIRED.LLC_HIT / CPU_CLK_UNHALTED.THREAD_P - * (thresh >.2) + /* + * (29 * MEM_LOAD_UOPS_RETIRED.LLC_HIT / CPU_CLK_UNHALTED.THREAD_P (thresh >.2) */ int ret; struct counters *mem; @@ -959,9 +981,9 @@ cache2ib(struct counters *cpu, int pos) me = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (con * me) / un; + res = (con * me)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int @@ -969,9 +991,9 @@ cache2has(struct counters *cpu, int pos) { /* * Examine ((MEM_LOAD_UOPS_RETIRED.LLC_HIT * 36) + \ - * (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT * 72) + - * (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84)) / - * CPU_CLK_UNHALTED.THREAD_P + * (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HIT * 72) + + * (MEM_LOAD_UOPS_LLC_HIT_RETIRED.XSNP_HITM * 84)) + * / CPU_CLK_UNHALTED.THREAD_P */ int ret; struct counters *mem1, *mem2, *mem3; @@ -996,17 +1018,17 @@ cache2has(struct counters *cpu, int pos) me3 = mem3->sum * 1.0; un = unhalt->sum * 1.0; } - res = ((me1 * con1) + (me2 * con2) + (me3 * con3)) / un; + res = ((me1 * con1) + (me2 * con2) + (me3 * con3))/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } + static int cache2broad(struct counters *cpu, int pos) { - /* - * (29 * MEM_LOAD_UOPS_RETIRED.LLC_HIT / CPU_CLK_UNHALTED.THREAD_P - * (thresh >.2) + /* + * (29 * MEM_LOAD_UOPS_RETIRED.LLC_HIT / CPU_CLK_UNHALTED.THREAD_P (thresh >.2) */ int ret; struct counters *mem; @@ -1023,19 +1045,16 @@ cache2broad(struct counters *cpu, int po me = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (con * me) / un; + res = (con * me)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int cache1(struct counters *cpu, int pos) { - /* - * 9 - (MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS * 180) / - * CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) - */ + /* 9 - (MEM_LOAD_UOPS_MISC_RETIRED.LLC_MISS * 180) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) */ int ret; struct counters *mem; struct counters *unhalt; @@ -1051,18 +1070,15 @@ cache1(struct counters *cpu, int pos) me = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (me * con) / un; + res = (me * con)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int cache1ib(struct counters *cpu, int pos) { - /* - * 9 - (MEM_LOAD_UOPS_L3_MISS_RETIRED.LCOAL_DRAM * 180) / - * CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) - */ + /* 9 - (MEM_LOAD_UOPS_L3_MISS_RETIRED.LCOAL_DRAM * 180) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) */ int ret; struct counters *mem; struct counters *unhalt; @@ -1078,19 +1094,16 @@ cache1ib(struct counters *cpu, int pos) me = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (me * con) / un; + res = (me * con)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int cache1broad(struct counters *cpu, int pos) { - /* - * 9 - (MEM_LOAD_UOPS_L3_MISS_RETIRED.LCOAL_DRAM * 180) / - * CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) - */ + /* 9 - (MEM_LOAD_UOPS_L3_MISS_RETIRED.LCOAL_DRAM * 180) / CPU_CLK_UNHALTED.THREAD_P (thresh >= .2) */ int ret; struct counters *mem; struct counters *unhalt; @@ -1106,20 +1119,16 @@ cache1broad(struct counters *cpu, int po me = mem->sum * 1.0; un = unhalt->sum * 1.0; } - res = (me * con) / un; + res = (me * con)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int dtlb_missload(struct counters *cpu, int pos) { - /* - * 10 - ((DTLB_LOAD_MISSES.STLB_HIT * 7) + - * DTLB_LOAD_MISSES.WALK_DURATION) / CPU_CLK_UNHALTED.THREAD_P (t - * >=.1) - */ + /* 10 - ((DTLB_LOAD_MISSES.STLB_HIT * 7) + DTLB_LOAD_MISSES.WALK_DURATION) / CPU_CLK_UNHALTED.THREAD_P (t >=.1) */ int ret; struct counters *dtlb_m, *dtlb_d; struct counters *unhalt; @@ -1138,40 +1147,39 @@ dtlb_missload(struct counters *cpu, int d2 = dtlb_d->sum * 1.0; un = unhalt->sum * 1.0; } - res = ((d1 * con) + d2) / un; + res = ((d1 * con) + d2)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int dtlb_missstore(struct counters *cpu, int pos) { - /* - * ((DTLB_STORE_MISSES.STLB_HIT * 7) + - * DTLB_STORE_MISSES.WALK_DURATION) / CPU_CLK_UNHALTED.THREAD_P (t - * >= .1) - */ - int ret; - struct counters *dtsb_m, *dtsb_d; - struct counters *unhalt; - double con, un, d1, d2, res; - - con = 7.0; - unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); - dtsb_m = find_counter(cpu, "DTLB_STORE_MISSES.STLB_HIT"); - dtsb_d = find_counter(cpu, "DTLB_STORE_MISSES.WALK_DURATION"); - if (pos != -1) { - d1 = dtsb_m->vals[pos] * 1.0; - d2 = dtsb_d->vals[pos] * 1.0; - un = unhalt->vals[pos] * 1.0; - } else { - d1 = dtsb_m->sum * 1.0; - d2 = dtsb_d->sum * 1.0; - un = unhalt->sum * 1.0; - } - res = ((d1 * con) + d2) / un; - ret = printf("%1.3f", res); - return (ret); + /* + * ((DTLB_STORE_MISSES.STLB_HIT * 7) + DTLB_STORE_MISSES.WALK_DURATION) / + * CPU_CLK_UNHALTED.THREAD_P (t >= .1) + */ + int ret; + struct counters *dtsb_m, *dtsb_d; + struct counters *unhalt; + double con, un, d1, d2, res; + + con = 7.0; + unhalt = find_counter(cpu, "CPU_CLK_UNHALTED.THREAD_P"); + dtsb_m = find_counter(cpu, "DTLB_STORE_MISSES.STLB_HIT"); + dtsb_d = find_counter(cpu, "DTLB_STORE_MISSES.WALK_DURATION"); + if (pos != -1) { + d1 = dtsb_m->vals[pos] * 1.0; + d2 = dtsb_d->vals[pos] * 1.0; + un = unhalt->vals[pos] * 1.0; + } else { + d1 = dtsb_m->sum * 1.0; + d2 = dtsb_d->sum * 1.0; + un = unhalt->sum * 1.0; + } + res = ((d1 * con) + d2)/un; + ret = printf("%1.3f", res); + return(ret); } static int @@ -1192,19 +1200,16 @@ itlb_miss(struct counters *cpu, int pos) d1 = itlb->sum * 1.0; un = unhalt->sum * 1.0; } - res = d1 / un; + res = d1/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int itlb_miss_broad(struct counters *cpu, int pos) { - /* - * (7 * ITLB_MISSES.STLB_HIT_4K + ITLB_MISSES.WALK_DURATION) / - * CPU_CLK_UNTHREAD_P - */ + /* (7 * ITLB_MISSES.STLB_HIT_4K + ITLB_MISSES.WALK_DURATION) / CPU_CLK_UNTHREAD_P */ int ret; struct counters *itlb; struct counters *unhalt; @@ -1223,19 +1228,16 @@ itlb_miss_broad(struct counters *cpu, in un = unhalt->sum * 1.0; k = four_k->sum * 1.0; } - res = (7.0 * k + d1) / un; + res = (7.0 * k + d1)/un; ret = printf("%1.3f", res); - return (ret); + return(ret); } static int icache_miss(struct counters *cpu, int pos) { - /* - * (ICACHE.IFETCH_STALL - ITLB_MISSES.WALK_DURATION) / - * CPU_CLK_UNHALTED.THREAD_P IB - */ + /* (ICACHE.IFETCH_STALL - ITLB_MISSES.WALK_DURATION) / CPU_CLK_UNHALTED.THREAD_P IB */ int ret; struct counters *itlb, *icache; @@ -1254,9 +1256,9 @@ icache_miss(struct counters *cpu, int po ic = icache->sum * 1.0; un = unhalt->sum * 1.0; } - res = (ic - d1) / un; + res = (ic-d1)/un; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Thu Dec 10 02:05:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0EC299D5834; Thu, 10 Dec 2015 02:05:37 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D9E591D6A; Thu, 10 Dec 2015 02:05:36 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA25ZDF012816; Thu, 10 Dec 2015 02:05:35 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA25Z8P012812; Thu, 10 Dec 2015 02:05:35 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512100205.tBA25Z8P012812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 10 Dec 2015 02:05:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292044 - in head: sys/dev/ioat tools/tools/ioat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 02:05:37 -0000 Author: cem Date: Thu Dec 10 02:05:35 2015 New Revision: 292044 URL: https://svnweb.freebsd.org/changeset/base/292044 Log: ioat(4): Add ioatcontrol(8) testing for copy_8k Add -E ("Eight k") and -m ("Memcpy") modes to the ioatcontrol(8) tool. Prompted by: rpokala Sponsored by: EMC / Isilon Storage Division Modified: head/sys/dev/ioat/ioat_test.c head/sys/dev/ioat/ioat_test.h head/tools/tools/ioat/ioatcontrol.8 head/tools/tools/ioat/ioatcontrol.c Modified: head/sys/dev/ioat/ioat_test.c ============================================================================== --- head/sys/dev/ioat/ioat_test.c Thu Dec 10 01:52:29 2015 (r292043) +++ head/sys/dev/ioat/ioat_test.c Thu Dec 10 02:05:35 2015 (r292044) @@ -84,11 +84,17 @@ static inline void _ioat_test_log(int ve static void ioat_test_transaction_destroy(struct test_transaction *tx) { + struct ioat_test *test; int i; + test = tx->test; + for (i = 0; i < IOAT_MAX_BUFS; i++) { if (tx->buf[i] != NULL) { - contigfree(tx->buf[i], tx->length, M_IOAT_TEST); + if (test->testkind == IOAT_TEST_DMA_8K) + free(tx->buf[i], M_IOAT_TEST); + else + contigfree(tx->buf[i], tx->length, M_IOAT_TEST); tx->buf[i] = NULL; } } @@ -97,8 +103,8 @@ ioat_test_transaction_destroy(struct tes } static struct -test_transaction *ioat_test_transaction_create(unsigned num_buffers, - uint32_t buffer_size) +test_transaction *ioat_test_transaction_create(struct ioat_test *test, + unsigned num_buffers) { struct test_transaction *tx; unsigned i; @@ -107,11 +113,16 @@ test_transaction *ioat_test_transaction_ if (tx == NULL) return (NULL); - tx->length = buffer_size; + tx->length = test->buffer_size; for (i = 0; i < num_buffers; i++) { - tx->buf[i] = contigmalloc(buffer_size, M_IOAT_TEST, M_NOWAIT, - 0, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); + if (test->testkind == IOAT_TEST_DMA_8K) + tx->buf[i] = malloc(test->buffer_size, M_IOAT_TEST, + M_NOWAIT); + else + tx->buf[i] = contigmalloc(test->buffer_size, + M_IOAT_TEST, M_NOWAIT, 0, BUS_SPACE_MAXADDR, + PAGE_SIZE, 0); if (tx->buf[i] == NULL) { ioat_test_transaction_destroy(tx); @@ -197,8 +208,7 @@ ioat_test_prealloc_memory(struct ioat_te struct test_transaction *tx; for (i = 0; i < test->transactions; i++) { - tx = ioat_test_transaction_create(test->chain_depth * 2, - test->buffer_size); + tx = ioat_test_transaction_create(test, test->chain_depth * 2); if (tx == NULL) { ioat_test_log(0, "tx == NULL - memory exhausted\n"); test->status[IOAT_TEST_NO_MEMORY]++; @@ -258,8 +268,16 @@ ioat_test_submit_1_tx(struct ioat_test * TAILQ_INSERT_HEAD(&test->pend_q, tx, entry); IT_UNLOCK(); - ioat_acquire(dma); + if (test->testkind != IOAT_TEST_MEMCPY) + ioat_acquire(dma); for (i = 0; i < tx->depth; i++) { + if (test->testkind == IOAT_TEST_MEMCPY) { + memcpy(tx->buf[2 * i + 1], tx->buf[2 * i], tx->length); + if (i == tx->depth - 1) + ioat_dma_test_callback(tx, 0); + continue; + } + src = vtophys((vm_offset_t)tx->buf[2*i]); dest = vtophys((vm_offset_t)tx->buf[2*i+1]); @@ -286,10 +304,20 @@ ioat_test_submit_1_tx(struct ioat_test * fillpattern = *(uint64_t *)tx->buf[2*i]; desc = ioat_blockfill(dma, dest, fillpattern, tx->length, cb, tx, flags); + } else if (test->testkind == IOAT_TEST_DMA_8K) { + bus_addr_t src2, dst2; + + src2 = vtophys((vm_offset_t)tx->buf[2*i] + PAGE_SIZE); + dst2 = vtophys((vm_offset_t)tx->buf[2*i+1] + PAGE_SIZE); + + desc = ioat_copy_8k_aligned(dma, dest, dst2, src, src2, + cb, tx, flags); } if (desc == NULL) break; } + if (test->testkind == IOAT_TEST_MEMCPY) + return; ioat_release(dma); /* @@ -317,6 +345,13 @@ ioat_dma_test(void *arg) test = arg; memset(__DEVOLATILE(void *, test->status), 0, sizeof(test->status)); + if (test->testkind == IOAT_TEST_DMA_8K && + test->buffer_size != 2 * PAGE_SIZE) { + ioat_test_log(0, "Asked for 8k test and buffer size isn't 8k\n"); + test->status[IOAT_TEST_INVALID_INPUT]++; + return; + } + if (test->buffer_size > 1024 * 1024) { ioat_test_log(0, "Buffer size too large >1MB\n"); test->status[IOAT_TEST_NO_MEMORY]++; Modified: head/sys/dev/ioat/ioat_test.h ============================================================================== --- head/sys/dev/ioat/ioat_test.h Thu Dec 10 01:52:29 2015 (r292043) +++ head/sys/dev/ioat/ioat_test.h Thu Dec 10 02:05:35 2015 (r292044) @@ -42,6 +42,8 @@ enum ioat_test_kind { IOAT_TEST_FILL = 0, IOAT_TEST_DMA, IOAT_TEST_RAW_DMA, + IOAT_TEST_DMA_8K, + IOAT_TEST_MEMCPY, IOAT_NUM_TESTKINDS }; Modified: head/tools/tools/ioat/ioatcontrol.8 ============================================================================== --- head/tools/tools/ioat/ioatcontrol.8 Thu Dec 10 01:52:29 2015 (r292043) +++ head/tools/tools/ioat/ioatcontrol.8 Thu Dec 10 02:05:35 2015 (r292044) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 28, 2015 +.Dd December 9, 2015 .Dt IOATCONTROL 8 .Os .Sh NAME @@ -33,7 +33,9 @@ .Xr ioat 4 .Sh SYNOPSIS .Nm +.Op Fl E .Op Fl f +.Op Fl m .Op Fl V .Ar channel_number .Ar num_txns @@ -55,10 +57,14 @@ allows one to issue some number of test driver on a specific hardware channel. The arguments are as follows: .Bl -tag -width Ds +.It Fl E +Test non-contiguous 8k copy. .It Fl f Test block fill (by default, .Nm tests copy) +.It Fl m +Test memcpy instead of DMA. .It Fl V Verify copies/fills for accuracy .El Modified: head/tools/tools/ioat/ioatcontrol.c ============================================================================== --- head/tools/tools/ioat/ioatcontrol.c Thu Dec 10 01:52:29 2015 (r292043) +++ head/tools/tools/ioat/ioatcontrol.c Thu Dec 10 02:05:35 2015 (r292044) @@ -48,7 +48,7 @@ static void usage(void) { - printf("Usage: %s [-fV] [ " + printf("Usage: %s [-E|-f|-m] [-V] [ " "[ [duration]]]\n", getprogname()); printf(" %s -r [-vV] []\n", getprogname()); @@ -97,15 +97,29 @@ main(int argc, char **argv) { struct ioat_test t; int fd, ch; - bool fflag, rflag; + bool fflag, rflag, Eflag, mflag; + unsigned modeflags; - while ((ch = getopt(argc, argv, "rfvVw")) != -1) { + fflag = rflag = Eflag = mflag = false; + modeflags = 0; + + while ((ch = getopt(argc, argv, "EfmrvVw")) != -1) { switch (ch) { + case 'E': + Eflag = true; + modeflags++; + break; case 'f': fflag = true; + modeflags++; + break; + case 'm': + mflag = true; + modeflags++; break; case 'r': rflag = true; + modeflags++; break; case 'v': t.raw_is_virtual = true; @@ -126,8 +140,8 @@ main(int argc, char **argv) if (argc < 2) usage(); - if (rflag && fflag) { - printf("Invalid: -r and -f\n"); + if (modeflags > 1) { + printf("Invalid: Cannot use >1 mode flag (-E, -f, -m, or -r)\n"); usage(); } @@ -139,6 +153,11 @@ main(int argc, char **argv) if (fflag) t.testkind = IOAT_TEST_FILL; + else if (Eflag) { + t.testkind = IOAT_TEST_DMA_8K; + t.buffer_size = 8 * 1024; + } else if (mflag) + t.testkind = IOAT_TEST_MEMCPY; t.channel_index = atoi(argv[0]); if (t.channel_index > 8) { From owner-svn-src-all@freebsd.org Thu Dec 10 02:11:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7A3F9D5C6D; Thu, 10 Dec 2015 02:11:43 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9201310F7; Thu, 10 Dec 2015 02:11:43 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA2BgP9015560; Thu, 10 Dec 2015 02:11:42 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA2BgrG015558; Thu, 10 Dec 2015 02:11:42 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201512100211.tBA2BgrG015558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Thu, 10 Dec 2015 02:11:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292045 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 02:11:43 -0000 Author: araujo Date: Thu Dec 10 02:11:42 2015 New Revision: 292045 URL: https://svnweb.freebsd.org/changeset/base/292045 Log: Add -t option to display field types. PR: bin/203918 Submitted by: ota Reviewed by: cem Approved by: bapt (mentor) Differential Revision: https://reviews.freebsd.org/D4451 Modified: head/sbin/sysctl/sysctl.8 head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.8 ============================================================================== --- head/sbin/sysctl/sysctl.8 Thu Dec 10 02:05:35 2015 (r292044) +++ head/sbin/sysctl/sysctl.8 Thu Dec 10 02:11:42 2015 (r292045) @@ -28,7 +28,7 @@ .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 12, 2015 +.Dd December 10, 2015 .Dt SYSCTL 8 .Os .Sh NAME @@ -36,13 +36,13 @@ .Nd get or set kernel state .Sh SYNOPSIS .Nm -.Op Fl bdehiNnoRTqx +.Op Fl bdehiNnoRTtqx .Op Fl B Ar bufsize .Op Fl f Ar filename .Ar name Ns Op = Ns Ar value .Ar ... .Nm -.Op Fl bdehNnoRTqx +.Op Fl bdehNnoRTtqx .Op Fl B Ar bufsize .Fl a .Sh DESCRIPTION @@ -140,6 +140,8 @@ Suppress some warnings generated by to standard error. .It Fl T Display only variables that are settable via loader (CTLFLAG_TUN). +.It Fl t +Print the type of the variable. .It Fl W Display only writable variables that are not statistical. Useful for determining the set of runtime tunable sysctls. Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Thu Dec 10 02:05:35 2015 (r292044) +++ head/sbin/sysctl/sysctl.c Thu Dec 10 02:11:42 2015 (r292045) @@ -72,7 +72,7 @@ static const char rcsid[] = static const char *conffile; static int aflag, bflag, Bflag, dflag, eflag, hflag, iflag; -static int Nflag, nflag, oflag, qflag, Tflag, Wflag, xflag; +static int Nflag, nflag, oflag, qflag, tflag, Tflag, Wflag, xflag; static int oidfmt(int *, int, char *, u_int *); static int parsefile(const char *); @@ -120,6 +120,9 @@ static const char *ctl_typename[CTLTYPE+ [CTLTYPE_S16] = "int16_t", [CTLTYPE_S32] = "int32_t", [CTLTYPE_S64] = "int64_t", + [CTLTYPE_NODE] = "node", + [CTLTYPE_STRING] = "string", + [CTLTYPE_OPAQUE] = "opaque", }; static void @@ -127,8 +130,8 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n", - "usage: sysctl [-bdehiNnoqTWx] [ -B ] [-f filename] name[=value] ...", - " sysctl [-bdehNnoqTWx] [ -B ] -a"); + "usage: sysctl [-bdehiNnoqTtWx] [ -B ] [-f filename] name[=value] ...", + " sysctl [-bdehNnoqTtWx] [ -B ] -a"); exit(1); } @@ -142,7 +145,7 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabB:def:hiNnoqTwWxX")) != -1) { + while ((ch = getopt(argc, argv, "AabB:def:hiNnoqtTwWxX")) != -1) { switch (ch) { case 'A': /* compatibility */ @@ -184,6 +187,9 @@ main(int argc, char **argv) case 'q': qflag = 1; break; + case 't': + tflag = 1; + break; case 'T': Tflag = 1; break; @@ -856,7 +862,7 @@ show_var(int *oid, int nlen) { u_char buf[BUFSIZ], *val, *oval, *p; char name[BUFSIZ], fmt[BUFSIZ]; - const char *sep, *sep1; + const char *sep, *sep1, *prntype; int qoid[CTL_MAXNAME+2]; uintmax_t umv; intmax_t mv; @@ -902,12 +908,23 @@ show_var(int *oid, int nlen) else sep = ": "; - if (dflag) { /* just print description */ + ctltype = (kind & CTLTYPE); + if (tflag || dflag) { + if (!nflag) + printf("%s%s", name, sep); + if (ctl_typename[ctltype] != NULL) + prntype = ctl_typename[ctltype]; + else + prntype = "unknown"; + if (tflag && dflag) + printf("%s%s", prntype, sep); + else if (tflag) { + printf("%s", prntype); + return (0); + } qoid[1] = 5; j = sizeof(buf); i = sysctl(qoid, nlen + 2, buf, &j, 0, 0); - if (!nflag) - printf("%s%s", name, sep); printf("%s", buf); return (0); } @@ -925,7 +942,6 @@ show_var(int *oid, int nlen) warnx("malloc failed"); return (1); } - ctltype = (kind & CTLTYPE); len = j; i = sysctl(oid, nlen, val, &len, 0, 0); if (i != 0 || (len == 0 && ctltype != CTLTYPE_STRING)) { From owner-svn-src-all@freebsd.org Thu Dec 10 02:33:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A5609D6D0C for ; Thu, 10 Dec 2015 02:33:53 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A8D21F92 for ; Thu, 10 Dec 2015 02:33:52 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by wmec201 with SMTP id c201so6077142wme.1 for ; Wed, 09 Dec 2015 18:33:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=tdh2dhfroNo/x8zY9OSDBlFSBUVayb+FaJfxm7ANCAs=; b=cdx1Xv135H8lNiIGPrvjPM4vWraQ6dxoC4uzx4i9YTrbTfYGTLHb+yuaODWVOvHDgL o63AmWRpI9lMSxBejsMyHS/FUCgw+hhtYr9kRn9c9TgyobVZUru0oB2m91q4o/9mLTzd JRTHr9C7J86k//8b0e3zmTY88h1gQmSi6Ld6w1YF4tPzblnuVujyJGsUUcvVHi6LSnGA zSUs3DxSwqSmjeQ4I3l9qHQsmmCn1N1Jkl8etDZujW9rnwVS9tZKuQ/a8RTzlLLC0bWH ZNygYSF4cKRRszJMooBljRqT80kF+G2J5wnT9J9WCTJUAQNXPkCfEFy9qQII8keBr/Qb DUFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=tdh2dhfroNo/x8zY9OSDBlFSBUVayb+FaJfxm7ANCAs=; b=mRV+veNpQewsjbCkDnvVYBGL1rc3nJjCHbZeHr9VvyI85MBNJ1m33yP2vc5EJ6Lc3G v0Jd+rQ8aTpmYHp5u1yCcOX1xQN89m+BsZ+VZKq7ShELEV1N+gf1ZuWj2Yomz/P6OhtZ Bf2oDc5pxs3Atwe2gRMILyJ8mK9YR9keFabugCi0PM4WEPD5OS56jDWiRYRoh+HyLXVS ZFqXTxMUxYQrphF2okbns8VHqfEoC1+9EgFrDypWNTGWs5A5nQEttGpd7hNNO/QjTvBK DPJOfmiSgwRr/lV9h9WOYc1wwL2RI0v0CAchouWTU9zw2BJ55Ax51wCJbf5dDDkTznqg drgA== X-Gm-Message-State: ALoCoQmQ0vXgVUtZy1mKqxRLRZvbFI2ZUQbxb1RtL3Gnm/sod1SlLeBqWIkoWSC28UAXx7yOUs+TpJ6DOFwbtzeyAaozooY0Mg== X-Received: by 10.28.23.136 with SMTP id 130mr40928975wmx.94.1449714830469; Wed, 09 Dec 2015 18:33:50 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id q74sm1472603wmd.0.2015.12.09.18.33.49 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 09 Dec 2015 18:33:49 -0800 (PST) Subject: Re: svn commit: r292045 - head/sbin/sysctl To: Marcelo Araujo , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512100211.tBA2BgrG015558@repo.freebsd.org> From: Steven Hartland Message-ID: <5668E495.7050003@multiplay.co.uk> Date: Thu, 10 Dec 2015 02:33:57 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201512100211.tBA2BgrG015558@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 02:33:53 -0000 Nice Marcelo, I always thought it was odd there was no way to easily get this info :) On 10/12/2015 02:11, Marcelo Araujo wrote: > Author: araujo > Date: Thu Dec 10 02:11:42 2015 > New Revision: 292045 > URL: https://svnweb.freebsd.org/changeset/base/292045 > > Log: > Add -t option to display field types. > > PR: bin/203918 > Submitted by: ota > Reviewed by: cem > Approved by: bapt (mentor) > Differential Revision: https://reviews.freebsd.org/D4451 > > Modified: > head/sbin/sysctl/sysctl.8 > head/sbin/sysctl/sysctl.c > > Modified: head/sbin/sysctl/sysctl.8 > ============================================================================== > --- head/sbin/sysctl/sysctl.8 Thu Dec 10 02:05:35 2015 (r292044) > +++ head/sbin/sysctl/sysctl.8 Thu Dec 10 02:11:42 2015 (r292045) > @@ -28,7 +28,7 @@ > .\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93 > .\" $FreeBSD$ > .\" > -.Dd February 12, 2015 > +.Dd December 10, 2015 > .Dt SYSCTL 8 > .Os > .Sh NAME > @@ -36,13 +36,13 @@ > .Nd get or set kernel state > .Sh SYNOPSIS > .Nm > -.Op Fl bdehiNnoRTqx > +.Op Fl bdehiNnoRTtqx > .Op Fl B Ar bufsize > .Op Fl f Ar filename > .Ar name Ns Op = Ns Ar value > .Ar ... > .Nm > -.Op Fl bdehNnoRTqx > +.Op Fl bdehNnoRTtqx > .Op Fl B Ar bufsize > .Fl a > .Sh DESCRIPTION > @@ -140,6 +140,8 @@ Suppress some warnings generated by > to standard error. > .It Fl T > Display only variables that are settable via loader (CTLFLAG_TUN). > +.It Fl t > +Print the type of the variable. > .It Fl W > Display only writable variables that are not statistical. > Useful for determining the set of runtime tunable sysctls. > > Modified: head/sbin/sysctl/sysctl.c > ============================================================================== > --- head/sbin/sysctl/sysctl.c Thu Dec 10 02:05:35 2015 (r292044) > +++ head/sbin/sysctl/sysctl.c Thu Dec 10 02:11:42 2015 (r292045) > @@ -72,7 +72,7 @@ static const char rcsid[] = > static const char *conffile; > > static int aflag, bflag, Bflag, dflag, eflag, hflag, iflag; > -static int Nflag, nflag, oflag, qflag, Tflag, Wflag, xflag; > +static int Nflag, nflag, oflag, qflag, tflag, Tflag, Wflag, xflag; > > static int oidfmt(int *, int, char *, u_int *); > static int parsefile(const char *); > @@ -120,6 +120,9 @@ static const char *ctl_typename[CTLTYPE+ > [CTLTYPE_S16] = "int16_t", > [CTLTYPE_S32] = "int32_t", > [CTLTYPE_S64] = "int64_t", > + [CTLTYPE_NODE] = "node", > + [CTLTYPE_STRING] = "string", > + [CTLTYPE_OPAQUE] = "opaque", > }; > > static void > @@ -127,8 +130,8 @@ usage(void) > { > > (void)fprintf(stderr, "%s\n%s\n", > - "usage: sysctl [-bdehiNnoqTWx] [ -B ] [-f filename] name[=value] ...", > - " sysctl [-bdehNnoqTWx] [ -B ] -a"); > + "usage: sysctl [-bdehiNnoqTtWx] [ -B ] [-f filename] name[=value] ...", > + " sysctl [-bdehNnoqTtWx] [ -B ] -a"); > exit(1); > } > > @@ -142,7 +145,7 @@ main(int argc, char **argv) > setbuf(stdout,0); > setbuf(stderr,0); > > - while ((ch = getopt(argc, argv, "AabB:def:hiNnoqTwWxX")) != -1) { > + while ((ch = getopt(argc, argv, "AabB:def:hiNnoqtTwWxX")) != -1) { > switch (ch) { > case 'A': > /* compatibility */ > @@ -184,6 +187,9 @@ main(int argc, char **argv) > case 'q': > qflag = 1; > break; > + case 't': > + tflag = 1; > + break; > case 'T': > Tflag = 1; > break; > @@ -856,7 +862,7 @@ show_var(int *oid, int nlen) > { > u_char buf[BUFSIZ], *val, *oval, *p; > char name[BUFSIZ], fmt[BUFSIZ]; > - const char *sep, *sep1; > + const char *sep, *sep1, *prntype; > int qoid[CTL_MAXNAME+2]; > uintmax_t umv; > intmax_t mv; > @@ -902,12 +908,23 @@ show_var(int *oid, int nlen) > else > sep = ": "; > > - if (dflag) { /* just print description */ > + ctltype = (kind & CTLTYPE); > + if (tflag || dflag) { > + if (!nflag) > + printf("%s%s", name, sep); > + if (ctl_typename[ctltype] != NULL) > + prntype = ctl_typename[ctltype]; > + else > + prntype = "unknown"; > + if (tflag && dflag) > + printf("%s%s", prntype, sep); > + else if (tflag) { > + printf("%s", prntype); > + return (0); > + } > qoid[1] = 5; > j = sizeof(buf); > i = sysctl(qoid, nlen + 2, buf, &j, 0, 0); > - if (!nflag) > - printf("%s%s", name, sep); > printf("%s", buf); > return (0); > } > @@ -925,7 +942,6 @@ show_var(int *oid, int nlen) > warnx("malloc failed"); > return (1); > } > - ctltype = (kind & CTLTYPE); > len = j; > i = sysctl(oid, nlen, val, &len, 0, 0); > if (i != 0 || (len == 0 && ctltype != CTLTYPE_STRING)) { > From owner-svn-src-all@freebsd.org Thu Dec 10 03:20:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CCA39D6EDE; Thu, 10 Dec 2015 03:20:12 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0AB2319CD; Thu, 10 Dec 2015 03:20:11 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA3KBm2034262; Thu, 10 Dec 2015 03:20:11 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA3KB1I034261; Thu, 10 Dec 2015 03:20:11 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201512100320.tBA3KB1I034261@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Thu, 10 Dec 2015 03:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292046 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 03:20:12 -0000 Author: hiren Date: Thu Dec 10 03:20:10 2015 New Revision: 292046 URL: https://svnweb.freebsd.org/changeset/base/292046 Log: r290122 added 4 bytes and removed 8 in struct sackhint. Add a pad entry of 4 bytes to restore the size. Spotted by: rrs Reviewed by: rrs X-MFC with: r290122 Sponsored by: Limelight Networks Modified: head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Thu Dec 10 02:11:42 2015 (r292045) +++ head/sys/netinet/tcp_var.h Thu Dec 10 03:20:10 2015 (r292046) @@ -78,6 +78,7 @@ struct sackhint { * Total sacked bytes reported by the * receiver via sack option */ + uint32_t _pad1[1]; /* TBD */ uint64_t _pad[1]; /* TBD */ }; From owner-svn-src-all@freebsd.org Thu Dec 10 05:17:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74F359D63FD; Thu, 10 Dec 2015 05:17:05 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2AEF61290; Thu, 10 Dec 2015 05:17:05 +0000 (UTC) (envelope-from stas@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA5H4br069395; Thu, 10 Dec 2015 05:17:04 GMT (envelope-from stas@FreeBSD.org) Received: (from stas@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA5H4xP069394; Thu, 10 Dec 2015 05:17:04 GMT (envelope-from stas@FreeBSD.org) Message-Id: <201512100517.tBA5H4xP069394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stas set sender to stas@FreeBSD.org using -f From: Stanislav Sedov Date: Thu, 10 Dec 2015 05:17:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292047 - head/lib/libc/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 05:17:05 -0000 Author: stas Date: Thu Dec 10 05:17:04 2015 New Revision: 292047 URL: https://svnweb.freebsd.org/changeset/base/292047 Log: RPC: populate local address for rendezvous transporter. When accepting a connection on underlying tcp socket rpc vc transporter fails to populate local address. This change rectifies this problem by modifying rendezvous_request() to fill out the xptr structure member with appropriate information. Submitted by: Alex Burlyga MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D4206 Modified: head/lib/libc/rpc/svc_vc.c Modified: head/lib/libc/rpc/svc_vc.c ============================================================================== --- head/lib/libc/rpc/svc_vc.c Thu Dec 10 03:20:10 2015 (r292046) +++ head/lib/libc/rpc/svc_vc.c Thu Dec 10 05:17:04 2015 (r292047) @@ -281,8 +281,8 @@ rendezvous_request(SVCXPRT *xprt, struct int sock, flags; struct cf_rendezvous *r; struct cf_conn *cd; - struct sockaddr_storage addr; - socklen_t len; + struct sockaddr_storage addr, sslocal; + socklen_t len, slen; struct __rpc_sockinfo si; SVCXPRT *newxprt; fd_set cleanfds; @@ -347,6 +347,20 @@ again: __xdrrec_setnonblock(&cd->xdrs, cd->maxrec); } else cd->nonblock = FALSE; + slen = sizeof(struct sockaddr_storage); + if(_getsockname(sock, (struct sockaddr *)(void *)&sslocal, &slen) < 0) { + warnx("svc_vc_create: could not retrieve local addr"); + newxprt->xp_ltaddr.maxlen = newxprt->xp_ltaddr.len = 0; + } else { + newxprt->xp_ltaddr.maxlen = newxprt->xp_ltaddr.len = sslocal.ss_len; + newxprt->xp_ltaddr.buf = mem_alloc((size_t)sslocal.ss_len); + if (newxprt->xp_ltaddr.buf == NULL) { + warnx("svc_vc_create: no mem for local addr"); + newxprt->xp_ltaddr.maxlen = newxprt->xp_ltaddr.len = 0; + } else { + memcpy(newxprt->xp_ltaddr.buf, &sslocal, (size_t)sslocal.ss_len); + } + } gettimeofday(&cd->last_recv_time, NULL); From owner-svn-src-all@freebsd.org Thu Dec 10 07:04:37 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA8E49D6A2D; Thu, 10 Dec 2015 07:04:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BA8D91DE7; Thu, 10 Dec 2015 07:04:37 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA74ahm001834; Thu, 10 Dec 2015 07:04:36 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA74aTO001833; Thu, 10 Dec 2015 07:04:36 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512100704.tBA74aTO001833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 10 Dec 2015 07:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292048 - head/sbin/geom/class/multipath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 07:04:38 -0000 Author: ngie Date: Thu Dec 10 07:04:36 2015 New Revision: 292048 URL: https://svnweb.freebsd.org/changeset/base/292048 Log: Don't leak rsector/sector in mp_label(..) Use calloc instead of malloc + memset(.., 0, ..) when allocating sector Differential Revision: https://reviews.freebsd.org/D4450 MFC after: 1 week Reported by: cppcheck Reviewed by: mav Sponsored by: EMC / Isilon Storage Division Modified: head/sbin/geom/class/multipath/geom_multipath.c Modified: head/sbin/geom/class/multipath/geom_multipath.c ============================================================================== --- head/sbin/geom/class/multipath/geom_multipath.c Thu Dec 10 05:17:04 2015 (r292047) +++ head/sbin/geom/class/multipath/geom_multipath.c Thu Dec 10 07:04:36 2015 (r292048) @@ -221,17 +221,15 @@ mp_label(struct gctl_req *req) /* * Allocate a sector to write as metadata. */ - sector = malloc(secsize); + sector = calloc(1, secsize); if (sector == NULL) { gctl_error(req, "unable to allocate metadata buffer"); return; } - memset(sector, 0, secsize); rsector = malloc(secsize); if (rsector == NULL) { - free(sector); gctl_error(req, "unable to allocate metadata buffer"); - return; + goto done; } /* @@ -246,7 +244,7 @@ mp_label(struct gctl_req *req) error = g_metadata_store(name, sector, secsize); if (error != 0) { gctl_error(req, "cannot store metadata on %s: %s.", name, strerror(error)); - return; + goto done; } /* @@ -274,6 +272,9 @@ mp_label(struct gctl_req *req) name2, name); } } +done: + free(rsector); + free(sector); } From owner-svn-src-all@freebsd.org Thu Dec 10 07:11:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFDD89D6EDE; Thu, 10 Dec 2015 07:11:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 800C31198; Thu, 10 Dec 2015 07:11:47 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA7Bkko005015; Thu, 10 Dec 2015 07:11:46 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA7BkKT005014; Thu, 10 Dec 2015 07:11:46 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201512100711.tBA7BkKT005014@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Thu, 10 Dec 2015 07:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292049 - stable/10/bin/ls/tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 07:11:47 -0000 Author: ngie Date: Thu Dec 10 07:11:46 2015 New Revision: 292049 URL: https://svnweb.freebsd.org/changeset/base/292049 Log: MFC r291919: Enable bin/ls testcases disabled previously because of issues with how kyua 0.11's version of report-junit was rendering non-printable characters Upgrade to kyua 0.12 to obtain a fixed version of the command Output verified with python 2.7.10's xml.dom.minidom module Sponsored by: EMC / Isilon Storage Division Modified: stable/10/bin/ls/tests/ls_tests.sh Directory Properties: stable/10/ (props changed) Modified: stable/10/bin/ls/tests/ls_tests.sh ============================================================================== --- stable/10/bin/ls/tests/ls_tests.sh Thu Dec 10 07:04:36 2015 (r292048) +++ stable/10/bin/ls/tests/ls_tests.sh Thu Dec 10 07:11:46 2015 (r292049) @@ -170,8 +170,6 @@ B_flag_head() B_flag_body() { - atf_skip "kyua report-jenkins doesn't properly escape non-printable chars: https://github.com/jmmv/kyua/issues/136" - atf_check -e empty -o empty -s exit:0 touch "$(printf "y\013z")" atf_check -e empty -o match:'y\\013z' -s exit:0 ls -B } @@ -467,8 +465,6 @@ b_flag_head() b_flag_body() { - atf_skip "kyua report-jenkins doesn't properly escape non-printable chars: https://github.com/jmmv/kyua/issues/136" - atf_check -e empty -o empty -s exit:0 touch "$(printf "y\013z")" atf_check -e empty -o match:'y\\vz' -s exit:0 ls -b } @@ -747,8 +743,6 @@ q_flag_and_w_flag_head() q_flag_and_w_flag_body() { - atf_skip "kyua report-jenkins doesn't properly escape non-printable chars: https://github.com/jmmv/kyua/issues/136" - create_test_dir test_file="$(printf "y\01z")" From owner-svn-src-all@freebsd.org Thu Dec 10 07:15:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A36D59D512B; Thu, 10 Dec 2015 07:15:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A3DE15F4; Thu, 10 Dec 2015 07:15:10 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA7F9Gx005383; Thu, 10 Dec 2015 07:15:09 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA7F9iT005382; Thu, 10 Dec 2015 07:15:09 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512100715.tBA7F9iT005382@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 10 Dec 2015 07:15:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292050 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 07:15:10 -0000 Author: arybchik Date: Thu Dec 10 07:15:09 2015 New Revision: 292050 URL: https://svnweb.freebsd.org/changeset/base/292050 Log: sfxge: [5/6] rework event completion error handling Required for MCDI proxy authorization support. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4453 Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Thu Dec 10 07:11:46 2015 (r292049) +++ head/sys/dev/sfxge/common/efx_mcdi.c Thu Dec 10 07:15:09 2015 (r292050) @@ -543,6 +543,7 @@ efx_mcdi_ev_cpl( efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + efx_nic_cfg_t *encp = &enp->en_nic_cfg; efx_mcdi_req_t *emrp; int state; @@ -567,20 +568,21 @@ efx_mcdi_ev_cpl( emip->emi_pending_req = NULL; EFSYS_UNLOCK(enp->en_eslp, state); - /* - * Fill out the remaining hdr fields, and copyout the payload - * if the user supplied an output buffer. - */ - if (errcode != 0) { - if (!emrp->emr_quiet) { - EFSYS_PROBE2(mcdi_err, int, emrp->emr_cmd, - int, errcode); - } - emrp->emr_out_length_used = 0; - emrp->emr_rc = efx_mcdi_request_errcode(errcode); + if (encp->enc_mcdi_max_payload_length > MCDI_CTL_SDU_LEN_MAX_V1) { + /* MCDIv2 response details do not fit into an event. */ + efx_mcdi_read_response_header(enp, emrp); } else { - emrp->emr_out_length_used = outlen; - emrp->emr_rc = 0; + if (errcode != 0) { + if (!emrp->emr_quiet) { + EFSYS_PROBE2(mcdi_err, int, emrp->emr_cmd, + int, errcode); + } + emrp->emr_out_length_used = 0; + emrp->emr_rc = efx_mcdi_request_errcode(errcode); + } else { + emrp->emr_out_length_used = outlen; + emrp->emr_rc = 0; + } } emcop->emco_request_copyout(enp, emrp); From owner-svn-src-all@freebsd.org Thu Dec 10 07:16:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9ADE9D523D; Thu, 10 Dec 2015 07:16:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B252E1852; Thu, 10 Dec 2015 07:16:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA7GLKi005473; Thu, 10 Dec 2015 07:16:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA7GLLl005469; Thu, 10 Dec 2015 07:16:21 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512100716.tBA7GLLl005469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 10 Dec 2015 07:16:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292051 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 07:16:36 -0000 Author: arybchik Date: Thu Dec 10 07:16:21 2015 New Revision: 292051 URL: https://svnweb.freebsd.org/changeset/base/292051 Log: sfxge: [6/6] support for MCDI proxy authorization in common code Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4454 Modified: head/sys/dev/sfxge/common/efx.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/hunt_ev.c Modified: head/sys/dev/sfxge/common/efx.h ============================================================================== --- head/sys/dev/sfxge/common/efx.h Thu Dec 10 07:15:09 2015 (r292050) +++ head/sys/dev/sfxge/common/efx.h Thu Dec 10 07:16:21 2015 (r292051) @@ -218,6 +218,9 @@ typedef struct efx_mcdi_transport_s { void (*emt_logger)(void *, efx_log_msg_t, void *, size_t, void *, size_t); #endif /* EFSYS_OPT_MCDI_LOGGING */ +#if EFSYS_OPT_MCDI_PROXY_AUTH + void (*emt_ev_proxy_response)(void *, uint32_t, efx_rc_t); +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ } efx_mcdi_transport_t; extern __checkReturn efx_rc_t Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Thu Dec 10 07:15:09 2015 (r292050) +++ head/sys/dev/sfxge/common/efx_mcdi.c Thu Dec 10 07:16:21 2015 (r292051) @@ -302,6 +302,21 @@ efx_mcdi_read_response_header( emrp->emr_err_code = err_code; emrp->emr_err_arg = err_arg; +#if EFSYS_OPT_MCDI_PROXY_AUTH + if ((err_code == MC_CMD_ERR_PROXY_PENDING) && + (err_len == sizeof (err))) { + /* + * The MCDI request would normally fail with EPERM, but + * firmware has forwarded it to an authorization agent + * attached to a privileged PF. + * + * Save the authorization request handle. The client + * must wait for a PROXY_RESPONSE event, or timeout. + */ + emrp->emr_proxy_handle = err_arg; + } +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ + #if EFSYS_OPT_MCDI_LOGGING if (emtp->emt_logger != NULL) { emtp->emt_logger(emtp->emt_context, @@ -322,6 +337,9 @@ efx_mcdi_read_response_header( emrp->emr_rc = 0; emrp->emr_out_length_used = data_len; +#if EFSYS_OPT_MCDI_PROXY_AUTH + emrp->emr_proxy_handle = 0; +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ return; fail3: @@ -463,6 +481,9 @@ efx_mcdi_request_errcode( case MC_CMD_ERR_MAC_EXIST: return (EEXIST); + case MC_CMD_ERR_PROXY_PENDING: + return (EAGAIN); + default: EFSYS_PROBE1(mc_pcol_error, int, err); return (EIO); @@ -584,11 +605,70 @@ efx_mcdi_ev_cpl( emrp->emr_rc = 0; } } - emcop->emco_request_copyout(enp, emrp); + if (errcode == 0) { + emcop->emco_request_copyout(enp, emrp); + } emtp->emt_ev_cpl(emtp->emt_context); } +#if EFSYS_OPT_MCDI_PROXY_AUTH + + __checkReturn efx_rc_t +efx_mcdi_get_proxy_handle( + __in efx_nic_t *enp, + __in efx_mcdi_req_t *emrp, + __out uint32_t *handlep) +{ + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_rc_t rc; + + /* + * Return proxy handle from MCDI request that returned with error + * MC_MCD_ERR_PROXY_PENDING. This handle is used to wait for a matching + * PROXY_RESPONSE event. + */ + if ((emrp == NULL) || (handlep == NULL)) { + rc = EINVAL; + goto fail1; + } + if ((emrp->emr_rc != 0) && + (emrp->emr_err_code == MC_CMD_ERR_PROXY_PENDING)) { + *handlep = emrp->emr_proxy_handle; + rc = 0; + } else { + *handlep = 0; + rc = ENOENT; + } + return (rc); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + return (rc); +} + + void +efx_mcdi_ev_proxy_response( + __in efx_nic_t *enp, + __in unsigned int handle, + __in unsigned int status) +{ + const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; + efx_rc_t rc; + + /* + * Handle results of an authorization request for a privileged MCDI + * command. If authorization was granted then we must re-issue the + * original MCDI request. If authorization failed or timed out, + * then the original MCDI request should be completed with the + * result code from this event. + */ + rc = (status == 0) ? 0 : efx_mcdi_request_errcode(status); + + emtp->emt_ev_proxy_response(emtp->emt_context, handle, rc); +} +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ + void efx_mcdi_ev_death( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Thu Dec 10 07:15:09 2015 (r292050) +++ head/sys/dev/sfxge/common/efx_mcdi.h Thu Dec 10 07:16:21 2015 (r292051) @@ -62,6 +62,9 @@ struct efx_mcdi_req_s { /* Internals: low level transport details */ unsigned int emr_err_code; unsigned int emr_err_arg; +#if EFSYS_OPT_MCDI_PROXY_AUTH + uint32_t emr_proxy_handle; +#endif }; typedef struct efx_mcdi_iface_s { @@ -97,6 +100,20 @@ efx_mcdi_ev_cpl( __in unsigned int outlen, __in int errcode); +#if EFSYS_OPT_MCDI_PROXY_AUTH + __checkReturn efx_rc_t +efx_mcdi_get_proxy_handle( + __in efx_nic_t *enp, + __in efx_mcdi_req_t *emrp, + __out uint32_t *handlep); + +extern void +efx_mcdi_ev_proxy_response( + __in efx_nic_t *enp, + __in unsigned int handle, + __in unsigned int status); +#endif + extern void efx_mcdi_ev_death( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/hunt_ev.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_ev.c Thu Dec 10 07:15:09 2015 (r292050) +++ head/sys/dev/sfxge/common/hunt_ev.c Thu Dec 10 07:16:21 2015 (r292051) @@ -829,6 +829,20 @@ hunt_ev_mcdi( MCDI_EV_FIELD(eqp, CMDDONE_ERRNO)); break; +#if EFSYS_OPT_MCDI_PROXY_AUTH + case MCDI_EVENT_CODE_PROXY_RESPONSE: + /* + * This event notifies a function that an authorization request + * has been processed. If the request was authorized then the + * function can now re-send the original MCDI request. + * See SF-113652-SW "SR-IOV Proxied Network Access Control". + */ + efx_mcdi_ev_proxy_response(enp, + MCDI_EV_FIELD(eqp, PROXY_RESPONSE_HANDLE), + MCDI_EV_FIELD(eqp, PROXY_RESPONSE_RC)); + break; +#endif /* EFSYS_OPT_MCDI_PROXY_AUTH */ + case MCDI_EVENT_CODE_LINKCHANGE: { efx_link_mode_t link_mode; From owner-svn-src-all@freebsd.org Thu Dec 10 07:17:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F20AB9D53CA; Thu, 10 Dec 2015 07:17:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CAB701A63; Thu, 10 Dec 2015 07:17:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA7HkxB005568; Thu, 10 Dec 2015 07:17:46 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA7HkoH005566; Thu, 10 Dec 2015 07:17:46 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512100717.tBA7HkoH005566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 10 Dec 2015 07:17:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292052 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 07:17:48 -0000 Author: arybchik Date: Thu Dec 10 07:17:46 2015 New Revision: 292052 URL: https://svnweb.freebsd.org/changeset/base/292052 Log: sfxge: simplify privilege checks with macro Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4455 Modified: head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/hunt_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Thu Dec 10 07:16:21 2015 (r292051) +++ head/sys/dev/sfxge/common/efx_mcdi.h Thu Dec 10 07:17:46 2015 (r292052) @@ -386,6 +386,11 @@ efx_mcdi_get_loopback_modes( #define MCDI_CMD_DWORD_FIELD(_edp, _field) \ EFX_DWORD_FIELD(*_edp, MC_CMD_ ## _field) +#define EFX_MCDI_HAVE_PRIVILEGE(mask, priv) \ + (((mask) & \ + (MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv)) == \ + (MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv)) + #ifdef __cplusplus } #endif Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Thu Dec 10 07:16:21 2015 (r292051) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Thu Dec 10 07:17:46 2015 (r292052) @@ -412,9 +412,8 @@ hunt_mcdi_fw_update_supported( * Admin privilege must be used prior to introduction of * specific flag. */ - *supportedp = (encp->enc_privilege_mask & - MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) - == MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN; + *supportedp = + EFX_MCDI_HAVE_PRIVILEGE(encp->enc_privilege_mask, ADMIN); return (0); } @@ -436,12 +435,9 @@ hunt_mcdi_macaddr_change_supported( * introduction of change mac spoofing privilege (at v4.7) */ *supportedp = - ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_CHANGE_MAC) == - MC_CMD_PRIVILEGE_MASK_IN_GRP_CHANGE_MAC) || - ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) == - MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) || - ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) == - MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN); + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, CHANGE_MAC) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); return (0); } @@ -463,12 +459,9 @@ hunt_mcdi_mac_spoofing_supported( * introduction of mac spoofing TX privilege (at v4.7) */ *supportedp = - ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING_TX) == - MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING_TX) || - ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) == - MC_CMD_PRIVILEGE_MASK_IN_GRP_MAC_SPOOFING) || - ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) == - MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN); + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING_TX) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); return (0); } @@ -490,10 +483,8 @@ hunt_mcdi_link_control_supported( * specific flag. */ *supportedp = - ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK) == - MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK) || - ((privilege_mask & MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN) == - MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN); + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, LINK) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); return (0); } From owner-svn-src-all@freebsd.org Thu Dec 10 07:35:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 040E79D60C8; Thu, 10 Dec 2015 07:35:40 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4E4D130D; Thu, 10 Dec 2015 07:35:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA7ZcPc011387; Thu, 10 Dec 2015 07:35:38 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA7ZcsU011386; Thu, 10 Dec 2015 07:35:38 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512100735.tBA7ZcsU011386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 10 Dec 2015 07:35:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292053 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 07:35:40 -0000 Author: arybchik Date: Thu Dec 10 07:35:38 2015 New Revision: 292053 URL: https://svnweb.freebsd.org/changeset/base/292053 Log: sfxge: cleanup: fix header Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/efx_mcdi.h Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Thu Dec 10 07:17:46 2015 (r292052) +++ head/sys/dev/sfxge/common/efx_mcdi.h Thu Dec 10 07:35:38 2015 (r292053) @@ -101,7 +101,7 @@ efx_mcdi_ev_cpl( __in int errcode); #if EFSYS_OPT_MCDI_PROXY_AUTH - __checkReturn efx_rc_t +extern __checkReturn efx_rc_t efx_mcdi_get_proxy_handle( __in efx_nic_t *enp, __in efx_mcdi_req_t *emrp, From owner-svn-src-all@freebsd.org Thu Dec 10 07:42:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D650F9D658F; Thu, 10 Dec 2015 07:42:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A40C519C4; Thu, 10 Dec 2015 07:42:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA7gvc2014387; Thu, 10 Dec 2015 07:42:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA7gv6l014380; Thu, 10 Dec 2015 07:42:57 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512100742.tBA7gv6l014380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Thu, 10 Dec 2015 07:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292055 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 07:42:59 -0000 Author: arybchik Date: Thu Dec 10 07:42:56 2015 New Revision: 292055 URL: https://svnweb.freebsd.org/changeset/base/292055 Log: sfxge: consolidate privilege check functions To reduce code duplication in common code, consolidate similar privilege check functions. Submitted by: Richard Houldsworth Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D4480 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/efx_mcdi.h head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_mcdi.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_mcdi.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Thu Dec 10 07:38:56 2015 (r292054) +++ head/sys/dev/sfxge/common/efx_impl.h Thu Dec 10 07:42:56 2015 (r292055) @@ -460,10 +460,7 @@ typedef struct efx_mcdi_ops_s { void (*emco_request_copyout)(efx_nic_t *, efx_mcdi_req_t *); efx_rc_t (*emco_poll_reboot)(efx_nic_t *); void (*emco_fini)(efx_nic_t *); - efx_rc_t (*emco_fw_update_supported)(efx_nic_t *, boolean_t *); - efx_rc_t (*emco_macaddr_change_supported)(efx_nic_t *, boolean_t *); - efx_rc_t (*emco_link_control_supported)(efx_nic_t *, boolean_t *); - efx_rc_t (*emco_mac_spoofing_supported)(efx_nic_t *, boolean_t *); + efx_rc_t (*emco_feature_supported)(efx_nic_t *, efx_mcdi_feature_id_t, boolean_t *); void (*emco_read_response)(efx_nic_t *, void *, size_t, size_t); } efx_mcdi_ops_t; Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Thu Dec 10 07:38:56 2015 (r292054) +++ head/sys/dev/sfxge/common/efx_mcdi.c Thu Dec 10 07:42:56 2015 (r292055) @@ -50,12 +50,7 @@ static efx_mcdi_ops_t __efx_mcdi_siena_o siena_mcdi_request_copyout, /* emco_request_copyout */ siena_mcdi_poll_reboot, /* emco_poll_reboot */ siena_mcdi_fini, /* emco_fini */ - siena_mcdi_fw_update_supported, /* emco_fw_update_supported */ - siena_mcdi_macaddr_change_supported, - /* emco_macaddr_change_supported */ - siena_mcdi_link_control_supported, - /* emco_link_control_supported */ - NULL, /* emco_mac_spoofing_supported */ + siena_mcdi_feature_supported, /* emco_feature_supported */ siena_mcdi_read_response, /* emco_read_response */ }; @@ -70,13 +65,7 @@ static efx_mcdi_ops_t __efx_mcdi_hunt_op hunt_mcdi_request_copyout, /* emco_request_copyout */ hunt_mcdi_poll_reboot, /* emco_poll_reboot */ hunt_mcdi_fini, /* emco_fini */ - hunt_mcdi_fw_update_supported, /* emco_fw_update_supported */ - hunt_mcdi_macaddr_change_supported, - /* emco_macaddr_change_supported */ - hunt_mcdi_link_control_supported, - /* emco_link_control_supported */ - hunt_mcdi_mac_spoofing_supported, - /* emco_mac_spoofing_supported */ + hunt_mcdi_feature_supported, /* emco_feature_supported */ hunt_mcdi_read_response, /* emco_read_response */ }; @@ -1316,7 +1305,6 @@ fail1: return (rc); } - __checkReturn efx_rc_t efx_mcdi_firmware_update_supported( __in efx_nic_t *enp, @@ -1325,9 +1313,9 @@ efx_mcdi_firmware_update_supported( efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; efx_rc_t rc; - if (emcop != NULL && emcop->emco_fw_update_supported != NULL) { - if ((rc = emcop->emco_fw_update_supported(enp, supportedp)) - != 0) + if (emcop != NULL) { + if ((rc = emcop->emco_feature_supported(enp, + EFX_MCDI_FEATURE_FW_UPDATE, supportedp)) != 0) goto fail1; } else { /* Earlier devices always supported updates */ @@ -1350,9 +1338,9 @@ efx_mcdi_macaddr_change_supported( efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; efx_rc_t rc; - if (emcop != NULL && emcop->emco_macaddr_change_supported != NULL) { - if ((rc = emcop->emco_macaddr_change_supported(enp, supportedp)) - != 0) + if (emcop != NULL) { + if ((rc = emcop->emco_feature_supported(enp, + EFX_MCDI_FEATURE_MACADDR_CHANGE, supportedp)) != 0) goto fail1; } else { /* Earlier devices always supported MAC changes */ @@ -1375,9 +1363,9 @@ efx_mcdi_link_control_supported( efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; efx_rc_t rc; - if (emcop != NULL && emcop->emco_link_control_supported != NULL) { - if ((rc = emcop->emco_link_control_supported(enp, supportedp)) - != 0) + if (emcop != NULL) { + if ((rc = emcop->emco_feature_supported(enp, + EFX_MCDI_FEATURE_LINK_CONTROL, supportedp)) != 0) goto fail1; } else { /* Earlier devices always supported link control */ @@ -1400,9 +1388,9 @@ efx_mcdi_mac_spoofing_supported( efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; efx_rc_t rc; - if (emcop != NULL && emcop->emco_mac_spoofing_supported != NULL) { - if ((rc = emcop->emco_mac_spoofing_supported(enp, supportedp)) - != 0) + if (emcop != NULL) { + if ((rc = emcop->emco_feature_supported(enp, + EFX_MCDI_FEATURE_MAC_SPOOFING, supportedp)) != 0) goto fail1; } else { /* Earlier devices always supported MAC spoofing */ Modified: head/sys/dev/sfxge/common/efx_mcdi.h ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.h Thu Dec 10 07:38:56 2015 (r292054) +++ head/sys/dev/sfxge/common/efx_mcdi.h Thu Dec 10 07:42:56 2015 (r292055) @@ -386,11 +386,18 @@ efx_mcdi_get_loopback_modes( #define MCDI_CMD_DWORD_FIELD(_edp, _field) \ EFX_DWORD_FIELD(*_edp, MC_CMD_ ## _field) -#define EFX_MCDI_HAVE_PRIVILEGE(mask, priv) \ - (((mask) & \ - (MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv)) == \ +#define EFX_MCDI_HAVE_PRIVILEGE(mask, priv) \ + (((mask) & (MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv)) == \ (MC_CMD_PRIVILEGE_MASK_IN_GRP_ ## priv)) +typedef enum efx_mcdi_feature_id_e { + EFX_MCDI_FEATURE_FW_UPDATE = 0, + EFX_MCDI_FEATURE_LINK_CONTROL, + EFX_MCDI_FEATURE_MACADDR_CHANGE, + EFX_MCDI_FEATURE_MAC_SPOOFING, + EFX_MCDI_FEATURE_NIDS +} efx_mcdi_feature_id_t; + #ifdef __cplusplus } #endif Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Thu Dec 10 07:38:56 2015 (r292054) +++ head/sys/dev/sfxge/common/hunt_impl.h Thu Dec 10 07:42:56 2015 (r292055) @@ -284,26 +284,11 @@ hunt_mcdi_poll_reboot( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -hunt_mcdi_fw_update_supported( +hunt_mcdi_feature_supported( __in efx_nic_t *enp, + __in efx_mcdi_feature_id_t id, __out boolean_t *supportedp); -extern __checkReturn efx_rc_t -hunt_mcdi_macaddr_change_supported( - __in efx_nic_t *enp, - __out boolean_t *supportedp); - -extern __checkReturn efx_rc_t -hunt_mcdi_link_control_supported( - __in efx_nic_t *enp, - __out boolean_t *supportedp); - -extern __checkReturn efx_rc_t -hunt_mcdi_mac_spoofing_supported( - __in efx_nic_t *enp, - __out boolean_t *supportedp); - - #endif /* EFSYS_OPT_MCDI */ /* NVRAM */ @@ -722,7 +707,7 @@ hunt_tx_qstats_update( #define HUNT_MIN_PIO_ALLOC_SIZE (HUNT_PIOBUF_SIZE / 32) -#define HUNT_LEGACY_PF_PRIVILEGE_MASK \ +#define HUNT_LEGACY_PF_PRIVILEGE_MASK \ (MC_CMD_PRIVILEGE_MASK_IN_GRP_ADMIN | \ MC_CMD_PRIVILEGE_MASK_IN_GRP_LINK | \ MC_CMD_PRIVILEGE_MASK_IN_GRP_ONLOAD | \ @@ -735,7 +720,7 @@ hunt_tx_qstats_update( MC_CMD_PRIVILEGE_MASK_IN_GRP_ALL_MULTICAST | \ MC_CMD_PRIVILEGE_MASK_IN_GRP_PROMISCUOUS) -#define HUNT_LEGACY_VF_PRIVILEGE_MASK 0 +#define HUNT_LEGACY_VF_PRIVILEGE_MASK 0 typedef uint32_t efx_piobuf_handle_t; Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Thu Dec 10 07:38:56 2015 (r292054) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Thu Dec 10 07:42:56 2015 (r292055) @@ -399,94 +399,73 @@ fail1: } __checkReturn efx_rc_t -hunt_mcdi_fw_update_supported( - __in efx_nic_t *enp, - __out boolean_t *supportedp) -{ - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - - EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); - - /* - * Use privilege mask state at MCDI attach. - * Admin privilege must be used prior to introduction of - * specific flag. - */ - *supportedp = - EFX_MCDI_HAVE_PRIVILEGE(encp->enc_privilege_mask, ADMIN); - - return (0); -} - - __checkReturn efx_rc_t -hunt_mcdi_macaddr_change_supported( +hunt_mcdi_feature_supported( __in efx_nic_t *enp, + __in efx_mcdi_feature_id_t id, __out boolean_t *supportedp) { efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint32_t privilege_mask = encp->enc_privilege_mask; + efx_rc_t rc; EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); /* * Use privilege mask state at MCDI attach. - * Admin privilege must be used prior to introduction of - * mac spoofing privilege (at v4.6), which is used up to - * introduction of change mac spoofing privilege (at v4.7) */ - *supportedp = - EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, CHANGE_MAC) || - EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING) || - EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); - return (0); -} - - __checkReturn efx_rc_t -hunt_mcdi_mac_spoofing_supported( - __in efx_nic_t *enp, - __out boolean_t *supportedp) -{ - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - uint32_t privilege_mask = encp->enc_privilege_mask; - - EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); - - /* - * Use privilege mask state at MCDI attach. - * Admin privilege must be used prior to introduction of - * mac spoofing privilege (at v4.6), which is used up to - * introduction of mac spoofing TX privilege (at v4.7) - */ - *supportedp = - EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING_TX) || - EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING) || - EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); + switch (id) { + case EFX_MCDI_FEATURE_FW_UPDATE: + /* + * Admin privilege must be used prior to introduction of + * specific flag. + */ + *supportedp = + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); + break; + case EFX_MCDI_FEATURE_LINK_CONTROL: + /* + * Admin privilege used prior to introduction of + * specific flag. + */ + *supportedp = + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, LINK) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); + break; + case EFX_MCDI_FEATURE_MACADDR_CHANGE: + /* + * Admin privilege must be used prior to introduction of + * mac spoofing privilege (at v4.6), which is used up to + * introduction of change mac spoofing privilege (at v4.7) + */ + *supportedp = + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, CHANGE_MAC) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); + break; + case EFX_MCDI_FEATURE_MAC_SPOOFING: + /* + * Admin privilege must be used prior to introduction of + * mac spoofing privilege (at v4.6), which is used up to + * introduction of mac spoofing TX privilege (at v4.7) + */ + *supportedp = + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING_TX) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, MAC_SPOOFING) || + EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); + break; + default: + rc = ENOTSUP; + goto fail1; + break; + } return (0); -} - - - __checkReturn efx_rc_t -hunt_mcdi_link_control_supported( - __in efx_nic_t *enp, - __out boolean_t *supportedp) -{ - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); - uint32_t privilege_mask = encp->enc_privilege_mask; - EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); - /* - * Use privilege mask state at MCDI attach. - * Admin privilege used prior to introduction of - * specific flag. - */ - *supportedp = - EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, LINK) || - EFX_MCDI_HAVE_PRIVILEGE(privilege_mask, ADMIN); - - return (0); + return (rc); } #endif /* EFSYS_OPT_MCDI */ Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Thu Dec 10 07:38:56 2015 (r292054) +++ head/sys/dev/sfxge/common/siena_impl.h Thu Dec 10 07:42:56 2015 (r292055) @@ -146,18 +146,9 @@ siena_mcdi_fini( __in efx_nic_t *enp); extern __checkReturn efx_rc_t -siena_mcdi_fw_update_supported( - __in efx_nic_t *enp, - __out boolean_t *supportedp); - -extern __checkReturn efx_rc_t -siena_mcdi_macaddr_change_supported( - __in efx_nic_t *enp, - __out boolean_t *supportedp); - -extern __checkReturn efx_rc_t -siena_mcdi_link_control_supported( +siena_mcdi_feature_supported( __in efx_nic_t *enp, + __in efx_mcdi_feature_id_t id, __out boolean_t *supportedp); #endif /* EFSYS_OPT_MCDI */ Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Thu Dec 10 07:38:56 2015 (r292054) +++ head/sys/dev/sfxge/common/siena_mcdi.c Thu Dec 10 07:42:56 2015 (r292055) @@ -329,39 +329,34 @@ siena_mcdi_fini( } __checkReturn efx_rc_t -siena_mcdi_fw_update_supported( +siena_mcdi_feature_supported( __in efx_nic_t *enp, + __in efx_mcdi_feature_id_t id, __out boolean_t *supportedp) { - EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA); - - *supportedp = B_TRUE; - - return (0); -} + efx_rc_t rc; - __checkReturn efx_rc_t -siena_mcdi_macaddr_change_supported( - __in efx_nic_t *enp, - __out boolean_t *supportedp) -{ EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA); - *supportedp = B_TRUE; + switch (id) { + case EFX_MCDI_FEATURE_FW_UPDATE: + case EFX_MCDI_FEATURE_LINK_CONTROL: + case EFX_MCDI_FEATURE_MACADDR_CHANGE: + case EFX_MCDI_FEATURE_MAC_SPOOFING: + *supportedp = B_TRUE; + break; + default: + rc = ENOTSUP; + goto fail1; + break; + } return (0); -} - - __checkReturn efx_rc_t -siena_mcdi_link_control_supported( - __in efx_nic_t *enp, - __out boolean_t *supportedp) -{ - EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA); - *supportedp = B_TRUE; +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); - return (0); + return (rc); } #endif /* EFSYS_OPT_SIENA && EFSYS_OPT_MCDI */ From owner-svn-src-all@freebsd.org Thu Dec 10 07:45:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A62819D67A7; Thu, 10 Dec 2015 07:45:59 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 74AE61CE4; Thu, 10 Dec 2015 07:45:59 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBA7jwPs014567; Thu, 10 Dec 2015 07:45:58 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBA7jw6U014566; Thu, 10 Dec 2015 07:45:58 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201512100745.tBA7jw6U014566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Thu, 10 Dec 2015 07:45:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292056 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 07:45:59 -0000 Author: kevlo Date: Thu Dec 10 07:45:58 2015 New Revision: 292056 URL: https://svnweb.freebsd.org/changeset/base/292056 Log: All 2-endpoints configs have high and normal pariority queues. Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Thu Dec 10 07:42:56 2015 (r292055) +++ head/sys/dev/usb/wlan/if_urtwn.c Thu Dec 10 07:45:58 2015 (r292056) @@ -2935,13 +2935,11 @@ urtwn_dma_init(struct urtwn_softc *sc) else reg |= R92C_TRXDMA_CTRL_QMAP_LQ; } else if (nqueues == 2) { - /* All 2-endpoints configs have a high priority queue. */ - if (!hashq) - return (EIO); - if (hasnq) - reg |= R92C_TRXDMA_CTRL_QMAP_HQ_NQ; - else - reg |= R92C_TRXDMA_CTRL_QMAP_HQ_LQ; + /* + * All 2-endpoints configs have high and normal + * priority queues. + */ + reg |= R92C_TRXDMA_CTRL_QMAP_HQ_NQ; } else reg |= R92C_TRXDMA_CTRL_QMAP_3EP; usb_err = urtwn_write_2(sc, R92C_TRXDMA_CTRL, reg); From owner-svn-src-all@freebsd.org Thu Dec 10 07:46:18 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 245039D67EF; Thu, 10 Dec 2015 07:46:18 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id E179F1FEE; Thu, 10 Dec 2015 07:46:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c211-30-166-197.carlnfd1.nsw.optusnet.com.au (c211-30-166-197.carlnfd1.nsw.optusnet.com.au [211.30.166.197]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id DA93C783252; Thu, 10 Dec 2015 18:46:07 +1100 (AEDT) Date: Thu, 10 Dec 2015 18:46:07 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hajimu UMEMOTO cc: Bruce Evans , Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r291994 - head/include In-Reply-To: Message-ID: <20151210183005.M1400@besplex.bde.org> References: <201512081609.tB8G9mfd053070@repo.freebsd.org> <20151209173008.A828@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=PfoC/XVd c=1 sm=1 tr=0 a=KA6XNC2GZCFrdESI5ZmdjQ==:117 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=kj9zAlcOel0A:10 a=P-yb_PvwX1cQtvFIzuYA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 07:46:18 -0000 On Thu, 10 Dec 2015, Hajimu UMEMOTO wrote: >>>>>> On Wed, 9 Dec 2015 18:19:16 +1100 (EST) >>>>>> Bruce Evans said: > > brde> resolv.h already had massinve namespace pollution and style bugs in > brde> its includes. One more include of a header that is relatively clean > brde> since it is tiny and was designed for minimising namespace pollution > brde> makes little difference. > > I understood. Thank you for your detailed explanation. > However, I realized that r289315 changed the size of struct > __res_state. It broke binary backward compatibility. I think we > still need to revert its change in struct __res_state and move them > into struct __res_state_ext. I see. Most of the pollution in resolv.h dates from 1993, so is hard to fix now. It was not in 4.4BSD. In 4.4BSD, was a prerequisite, and undocumented APIs like fp_query() that used FILE were named with leading underscores. The ABI changes in __res_state are mostly newer than than 1993. Bruce From owner-svn-src-all@freebsd.org Thu Dec 10 10:35:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFFDB9D6CFD; Thu, 10 Dec 2015 10:35:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B06DD1640; Thu, 10 Dec 2015 10:35:08 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBAAZ733064955; Thu, 10 Dec 2015 10:35:07 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBAAZ7fj064953; Thu, 10 Dec 2015 10:35:07 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201512101035.tBAAZ7fj064953@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 10 Dec 2015 10:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292057 - in head/sys: boot/common geom/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 10:35:09 -0000 Author: ae Date: Thu Dec 10 10:35:07 2015 New Revision: 292057 URL: https://svnweb.freebsd.org/changeset/base/292057 Log: Make detection of GPT a bit more reliable. When we are detecting a partition table and didn't find PMBR, try to read backup GPT header from the last sector and if it is correct, assume that we have GPT. Reviewed by: rpokala MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D4282 Modified: head/sys/boot/common/part.c head/sys/geom/part/g_part_gpt.c Modified: head/sys/boot/common/part.c ============================================================================== --- head/sys/boot/common/part.c Thu Dec 10 07:45:58 2015 (r292056) +++ head/sys/boot/common/part.c Thu Dec 10 10:35:07 2015 (r292057) @@ -301,12 +301,12 @@ ptable_gptread(struct ptable *table, voi } } } - DEBUG("GPT detected"); if (pri == 0 && sec == 0) { /* Both primary and backup tables are invalid. */ table->type = PTABLE_NONE; goto out; } + DEBUG("GPT detected"); size = MIN(hdr.hdr_entries * hdr.hdr_entsz, MAXTBLSZ * table->sectorsize); for (i = 0; i < size / hdr.hdr_entsz; i++) { @@ -635,6 +635,11 @@ ptable_open(void *dev, off_t sectors, ui if (buf[DOSMAGICOFFSET] != 0x55 || buf[DOSMAGICOFFSET + 1] != 0xaa) { DEBUG("magic sequence not found"); +#if defined(LOADER_GPT_SUPPORT) + /* There is no PMBR, check that we have backup GPT */ + table->type = PTABLE_GPT; + table = ptable_gptread(table, dev, dread); +#endif goto out; } /* Check that we have PMBR. Also do some validation. */ Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Thu Dec 10 07:45:58 2015 (r292056) +++ head/sys/geom/part/g_part_gpt.c Thu Dec 10 10:35:07 2015 (r292057) @@ -823,22 +823,23 @@ g_part_gpt_probe(struct g_part_table *ta return (error); res = le16dec(buf + DOSMAGICOFFSET); pri = G_PART_PROBE_PRI_LOW; - for (index = 0; index < NDOSPART; index++) { - if (buf[DOSPARTOFF + DOSPARTSIZE * index + 4] == 0xee) - pri = G_PART_PROBE_PRI_HIGH; - } - g_free(buf); - if (res != DOSMAGIC) - return (ENXIO); + if (res == DOSMAGIC) { + for (index = 0; index < NDOSPART; index++) { + if (buf[DOSPARTOFF + DOSPARTSIZE * index + 4] == 0xee) + pri = G_PART_PROBE_PRI_HIGH; + } + g_free(buf); - /* Check that there's a primary header. */ - buf = g_read_data(cp, pp->sectorsize, pp->sectorsize, &error); - if (buf == NULL) - return (error); - res = memcmp(buf, GPT_HDR_SIG, 8); - g_free(buf); - if (res == 0) - return (pri); + /* Check that there's a primary header. */ + buf = g_read_data(cp, pp->sectorsize, pp->sectorsize, &error); + if (buf == NULL) + return (error); + res = memcmp(buf, GPT_HDR_SIG, 8); + g_free(buf); + if (res == 0) + return (pri); + } else + g_free(buf); /* No primary? Check that there's a secondary. */ buf = g_read_data(cp, pp->mediasize - pp->sectorsize, pp->sectorsize, From owner-svn-src-all@freebsd.org Thu Dec 10 10:37:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 214E79D6F12; Thu, 10 Dec 2015 10:37:14 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E3F0E1A61; Thu, 10 Dec 2015 10:37:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBAAbDf2065139; Thu, 10 Dec 2015 10:37:13 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBAAbDMq065138; Thu, 10 Dec 2015 10:37:13 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201512101037.tBAAbDMq065138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 10 Dec 2015 10:37:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292058 - head/sbin/geom/class/part X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 10:37:14 -0000 Author: ae Date: Thu Dec 10 10:37:12 2015 New Revision: 292058 URL: https://svnweb.freebsd.org/changeset/base/292058 Log: Remove a note about damaged PMBR. Now GPT will be detected automatically with such corruption. MFC after: 1 month Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Thu Dec 10 10:35:07 2015 (r292057) +++ head/sbin/geom/class/part/gpart.8 Thu Dec 10 10:37:12 2015 (r292058) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 14, 2015 +.Dd December 10, 2015 .Dt GPART 8 .Os .Sh NAME @@ -1107,15 +1107,6 @@ and .Cm recover are the only operations allowed on corrupt tables. .Pp -If the first sector of a provider is corrupt, the kernel can not detect GPT -even if the partition table itself is not corrupt. -The protective MBR can be rewritten using the -.Xr dd 1 -command, to restore the ability to detect the GPT. -The copy of the protective MBR is usually located in the -.Pa /boot/pmbr -file. -.Pp If one GPT header appears to be corrupt but the other copy remains intact, the kernel will log the following: .Bd -literal -offset indent @@ -1330,7 +1321,6 @@ and /sbin/gpart backup ada0 | /sbin/gpart restore -F ada1 ada2 .Ed .Sh SEE ALSO -.Xr dd 1 , .Xr geom 4 , .Xr boot0cfg 8 , .Xr geom 8 , From owner-svn-src-all@freebsd.org Thu Dec 10 11:11:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 563429D6C33; Thu, 10 Dec 2015 11:11:45 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 246C51E0A; Thu, 10 Dec 2015 11:11:45 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBABBinM074804; Thu, 10 Dec 2015 11:11:44 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBABBirV074803; Thu, 10 Dec 2015 11:11:44 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512101111.tBABBirV074803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Thu, 10 Dec 2015 11:11:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292059 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 11:11:45 -0000 Author: ume Date: Thu Dec 10 11:11:44 2015 New Revision: 292059 URL: https://svnweb.freebsd.org/changeset/base/292059 Log: The calls to RES_SET_H_ERRNO() macro on error paths wind up dereferencing an uninitialized res. PR: 202142 Submitted by: Sean Boudreau MFC after: 1 week Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Thu Dec 10 10:37:12 2015 (r292058) +++ head/lib/libc/net/getaddrinfo.c Thu Dec 10 11:11:44 2015 (r292059) @@ -2208,6 +2208,8 @@ _dns_getaddrinfo(void *rv, void *cb_data memset(&sentinel, 0, sizeof(sentinel)); cur = &sentinel; + res = __res_state(); + buf = malloc(sizeof(*buf)); if (!buf) { RES_SET_H_ERRNO(res, NETDB_INTERNAL); @@ -2254,7 +2256,6 @@ _dns_getaddrinfo(void *rv, void *cb_data return NS_UNAVAIL; } - res = __res_state(); if ((res->options & RES_INIT) == 0 && res_ninit(res) == -1) { RES_SET_H_ERRNO(res, NETDB_INTERNAL); free(buf); From owner-svn-src-all@freebsd.org Thu Dec 10 11:49:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 599FE9D55CE; Thu, 10 Dec 2015 11:49:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 120081FD3; Thu, 10 Dec 2015 11:49:34 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBABnX3d086063; Thu, 10 Dec 2015 11:49:33 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBABnWI2086060; Thu, 10 Dec 2015 11:49:32 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201512101149.tBABnWI2086060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 10 Dec 2015 11:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292060 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 11:49:34 -0000 Author: tuexen Date: Thu Dec 10 11:49:32 2015 New Revision: 292060 URL: https://svnweb.freebsd.org/changeset/base/292060 Log: Retire sctp_validate_no_locks(). This routine checks that there are no locks held for an inp, without having any lock on the inp. This breaks if the inp goes away when it is called. This happens on stress tests on a RPi B+. MFC after: 3 days Modified: head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.h Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Thu Dec 10 11:11:44 2015 (r292059) +++ head/sys/netinet/sctp_input.c Thu Dec 10 11:49:32 2015 (r292060) @@ -5641,30 +5641,6 @@ next_chunk: } -#ifdef INVARIANTS -#ifdef __GNUC__ -__attribute__((noinline)) -#endif - void - sctp_validate_no_locks(struct sctp_inpcb *inp) -{ - struct sctp_tcb *lstcb; - - LIST_FOREACH(lstcb, &inp->sctp_asoc_list, sctp_tcblist) { - if (mtx_owned(&lstcb->tcb_mtx)) { - panic("Own lock on stcb at return from input"); - } - } - if (mtx_owned(&inp->inp_create_mtx)) { - panic("Own create lock on inp"); - } - if (mtx_owned(&inp->inp_mtx)) { - panic("Own inp lock on inp"); - } -} - -#endif - /* * common input chunk processing (v4 and v6) */ @@ -6048,11 +6024,6 @@ out: SCTP_INP_DECR_REF(inp_decr); SCTP_INP_WUNLOCK(inp_decr); } -#ifdef INVARIANTS - if (inp != NULL) { - sctp_validate_no_locks(inp); - } -#endif return; } Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Thu Dec 10 11:11:44 2015 (r292059) +++ head/sys/netinet/sctp_output.c Thu Dec 10 11:49:32 2015 (r292060) @@ -13538,13 +13538,6 @@ out_unlocked: } } #endif -#ifdef INVARIANTS - if (inp) { - sctp_validate_no_locks(inp); - } else { - SCTP_PRINTF("Warning - inp is NULL so cant validate locks\n"); - } -#endif if (top) { sctp_m_freem(top); } Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Thu Dec 10 11:11:44 2015 (r292059) +++ head/sys/netinet/sctp_pcb.h Thu Dec 10 11:49:32 2015 (r292060) @@ -654,11 +654,5 @@ void #endif -#ifdef INVARIANTS -void - sctp_validate_no_locks(struct sctp_inpcb *inp); - -#endif - #endif /* _KERNEL */ #endif /* !__sctp_pcb_h__ */ From owner-svn-src-all@freebsd.org Thu Dec 10 12:12:49 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28E5B9D6D1F; Thu, 10 Dec 2015 12:12:49 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EB7841ED4; Thu, 10 Dec 2015 12:12:48 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBACCmCP094502; Thu, 10 Dec 2015 12:12:48 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBACCm70094501; Thu, 10 Dec 2015 12:12:48 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <201512101212.tBACCm70094501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 10 Dec 2015 12:12:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292061 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 12:12:49 -0000 Author: grehan Date: Thu Dec 10 12:12:47 2015 New Revision: 292061 URL: https://svnweb.freebsd.org/changeset/base/292061 Log: vmm is still maintained. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Thu Dec 10 11:49:32 2015 (r292060) +++ head/MAINTAINERS Thu Dec 10 12:12:47 2015 (r292061) @@ -77,6 +77,7 @@ usr.sbin/pkg pkg@ Please coordinate beha lpr gad Pre-commit review requested, particularly for lpd/recvjob.c and lpd/printjob.c. nis(8), yp(8) araujo Pre-commit review requested. +vmm(4) neel,grehan Pre-commit review requested. ---- OLD ---- libc/posix1e rwatson Pre-commit review requested. POSIX.1e ACLs rwatson Pre-commit review requested. @@ -156,4 +157,4 @@ cmx daniel@roe.ch Pre-commit review pre filemon obrien Pre-commit review preferred. sysdoc trhodes Pre-commit review preferred. nanobsd imp Pre-commit review requested for coordination. -vmm(4) neel,grehan Pre-commit review requested. + From owner-svn-src-all@freebsd.org Thu Dec 10 13:19:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78DDE9D6A7F; Thu, 10 Dec 2015 13:19:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5525012CB; Thu, 10 Dec 2015 13:19:32 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBADJVLR013135; Thu, 10 Dec 2015 13:19:31 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBADJVBN013130; Thu, 10 Dec 2015 13:19:31 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512101319.tBADJVBN013130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 10 Dec 2015 13:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292062 - in head/sys/arm64: arm64 cavium include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 13:19:32 -0000 Author: andrew Date: Thu Dec 10 13:19:30 2015 New Revision: 292062 URL: https://svnweb.freebsd.org/changeset/base/292062 Log: Reduce the numbers of levels of indirection in arm64 pcib drivers by making the MSI & MSI-X handler functions be directly callable from the driver methods. Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/intr_machdep.c head/sys/arm64/cavium/thunder_pcie.c head/sys/arm64/cavium/thunder_pcie_common.c head/sys/arm64/cavium/thunder_pcie_pem.c head/sys/arm64/include/intr.h Modified: head/sys/arm64/arm64/intr_machdep.c ============================================================================== --- head/sys/arm64/arm64/intr_machdep.c Thu Dec 10 12:12:47 2015 (r292061) +++ head/sys/arm64/arm64/intr_machdep.c Thu Dec 10 13:19:30 2015 (r292062) @@ -217,46 +217,46 @@ arm_register_msi_pic(device_t dev) } int -arm_alloc_msi(device_t pci_dev, int count, int *irqs) +arm_alloc_msi(device_t pci, device_t child, int count, int maxcount, int *irqs) { - return PIC_ALLOC_MSI(msi_pic, pci_dev, count, irqs); + return (PIC_ALLOC_MSI(msi_pic, child, count, irqs)); } int -arm_release_msi(device_t pci_dev, int count, int *irqs) +arm_release_msi(device_t pci, device_t child, int count, int *irqs) { - return PIC_RELEASE_MSI(msi_pic, pci_dev, count, irqs); + return (PIC_RELEASE_MSI(msi_pic, child, count, irqs)); } int -arm_map_msi(device_t pci_dev, int irq, uint64_t *addr, uint32_t *data) +arm_map_msi(device_t pci, device_t child, int irq, uint64_t *addr, uint32_t *data) { - return PIC_MAP_MSI(msi_pic, pci_dev, irq, addr, data); + return (PIC_MAP_MSI(msi_pic, child, irq, addr, data)); } int -arm_alloc_msix(device_t pci_dev, int *irq) +arm_alloc_msix(device_t pci, device_t child, int *irq) { - return PIC_ALLOC_MSIX(msi_pic, pci_dev, irq); + return (PIC_ALLOC_MSIX(msi_pic, child, irq)); } int -arm_release_msix(device_t pci_dev, int irq) +arm_release_msix(device_t pci, device_t child, int irq) { - return PIC_RELEASE_MSIX(msi_pic, pci_dev, irq); + return (PIC_RELEASE_MSIX(msi_pic, child, irq)); } int -arm_map_msix(device_t pci_dev, int irq, uint64_t *addr, uint32_t *data) +arm_map_msix(device_t pci, device_t child, int irq, uint64_t *addr, uint32_t *data) { - return PIC_MAP_MSIX(msi_pic, pci_dev, irq, addr, data); + return (PIC_MAP_MSIX(msi_pic, child, irq, addr, data)); } /* Modified: head/sys/arm64/cavium/thunder_pcie.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie.c Thu Dec 10 12:12:47 2015 (r292061) +++ head/sys/arm64/cavium/thunder_pcie.c Thu Dec 10 13:19:30 2015 (r292062) @@ -571,11 +571,12 @@ static device_method_t thunder_pcie_meth DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - DEVMETHOD(pcib_map_msi, thunder_common_map_msi), - DEVMETHOD(pcib_alloc_msix, thunder_common_alloc_msix), - DEVMETHOD(pcib_release_msix, thunder_common_release_msix), - DEVMETHOD(pcib_alloc_msi, thunder_common_alloc_msi), - DEVMETHOD(pcib_release_msi, thunder_common_release_msi), + + DEVMETHOD(pcib_map_msi, arm_map_msi), + DEVMETHOD(pcib_alloc_msix, arm_alloc_msix), + DEVMETHOD(pcib_release_msix, arm_release_msix), + DEVMETHOD(pcib_alloc_msi, arm_alloc_msi), + DEVMETHOD(pcib_release_msi, arm_release_msi), DEVMETHOD_END }; Modified: head/sys/arm64/cavium/thunder_pcie_common.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_common.c Thu Dec 10 12:12:47 2015 (r292061) +++ head/sys/arm64/cavium/thunder_pcie_common.c Thu Dec 10 13:19:30 2015 (r292062) @@ -42,54 +42,6 @@ __FBSDID("$FreeBSD$"); #include "thunder_pcie_common.h" - -int -thunder_common_map_msi(device_t pcib, device_t child, int irq, - uint64_t *addr, uint32_t *data) -{ - int error; - - error = arm_map_msix(child, irq, addr, data); - return (error); -} - -int -thunder_common_alloc_msix(device_t pcib, device_t child, int *irq) -{ - int error; - - error = arm_alloc_msix(child, irq); - return (error); -} - -int -thunder_common_release_msix(device_t pcib, device_t child, int irq) -{ - int error; - - error = arm_release_msix(child, irq); - return (error); -} - -int -thunder_common_alloc_msi(device_t pcib, device_t child, int count, int maxcount, - int *irqs) -{ - int error; - - error = arm_alloc_msi(child, count, irqs); - return (error); -} - -int -thunder_common_release_msi(device_t pcib, device_t child, int count, int *irqs) -{ - int error; - - error = arm_release_msi(child, count, irqs); - return (error); -} - uint32_t range_addr_is_pci(struct pcie_range *ranges, uint64_t addr, uint64_t size) { Modified: head/sys/arm64/cavium/thunder_pcie_pem.c ============================================================================== --- head/sys/arm64/cavium/thunder_pcie_pem.c Thu Dec 10 12:12:47 2015 (r292061) +++ head/sys/arm64/cavium/thunder_pcie_pem.c Thu Dec 10 13:19:30 2015 (r292062) @@ -165,11 +165,12 @@ static device_method_t thunder_pem_metho DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), - DEVMETHOD(pcib_map_msi, thunder_common_map_msi), - DEVMETHOD(pcib_alloc_msix, thunder_common_alloc_msix), - DEVMETHOD(pcib_release_msix, thunder_common_release_msix), - DEVMETHOD(pcib_alloc_msi, thunder_common_alloc_msi), - DEVMETHOD(pcib_release_msi, thunder_common_release_msi), + + DEVMETHOD(pcib_map_msi, arm_map_msi), + DEVMETHOD(pcib_alloc_msix, arm_alloc_msix), + DEVMETHOD(pcib_release_msix, arm_release_msix), + DEVMETHOD(pcib_alloc_msi, arm_alloc_msi), + DEVMETHOD(pcib_release_msi, arm_release_msi), DEVMETHOD_END }; Modified: head/sys/arm64/include/intr.h ============================================================================== --- head/sys/arm64/include/intr.h Thu Dec 10 12:12:47 2015 (r292061) +++ head/sys/arm64/include/intr.h Thu Dec 10 13:19:30 2015 (r292062) @@ -36,12 +36,12 @@ int arm_enable_intr(void); void arm_mask_irq(u_int); void arm_register_root_pic(device_t, u_int); void arm_register_msi_pic(device_t); -int arm_alloc_msi(device_t, int, int *); -int arm_release_msi(device_t, int, int *); -int arm_alloc_msix(device_t, int *); -int arm_release_msix(device_t, int); -int arm_map_msi(device_t, int, uint64_t *, uint32_t *); -int arm_map_msix(device_t, int, uint64_t *, uint32_t *); +int arm_alloc_msi(device_t, device_t, int, int, int *); +int arm_release_msi(device_t, device_t, int, int *); +int arm_alloc_msix(device_t, device_t, int *); +int arm_release_msix(device_t, device_t, int); +int arm_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); +int arm_map_msix(device_t, device_t, int, uint64_t *, uint32_t *); int arm_setup_intr(const char *, driver_filter_t *, driver_intr_t, void *, u_int, enum intr_type, void **); int arm_teardown_intr(void *); From owner-svn-src-all@freebsd.org Thu Dec 10 15:10:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33D459D6E90; Thu, 10 Dec 2015 15:10:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 16E7F1ED5; Thu, 10 Dec 2015 15:10:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1ED54B986; Thu, 10 Dec 2015 10:10:50 -0500 (EST) From: John Baldwin To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292057 - in head/sys: boot/common geom/part Date: Thu, 10 Dec 2015 07:07:41 -0800 Message-ID: <3064443.9SoIZWyLLV@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201512101035.tBAAZ7fj064953@repo.freebsd.org> References: <201512101035.tBAAZ7fj064953@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 10 Dec 2015 10:10:50 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 15:10:51 -0000 On Thursday, December 10, 2015 10:35:07 AM Andrey V. Elsukov wrote: > Author: ae > Date: Thu Dec 10 10:35:07 2015 > New Revision: 292057 > URL: https://svnweb.freebsd.org/changeset/base/292057 > > Log: > Make detection of GPT a bit more reliable. > > When we are detecting a partition table and didn't find PMBR, try to > read backup GPT header from the last sector and if it is correct, > assume that we have GPT. One thing that your commit message did not make clear: Does this only detect as valid if no other partition scheme claims the disk? That is, if I overwrite a previously GPT-partitioned disk with a different scheme (e.g. MBR), will that disk now probe as GPT instead of the new scheme? If so, this is broken and needs to be reverted. If this somehow does a "low" priority probe and only kicks in if no other scheme claims the disk, then this is ok, but you should probably have said so in the commit message. -- John Baldwin From owner-svn-src-all@freebsd.org Thu Dec 10 15:51:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F0959D5BC4; Thu, 10 Dec 2015 15:51:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4C4C91E2C; Thu, 10 Dec 2015 15:51:04 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBAFp348058800; Thu, 10 Dec 2015 15:51:03 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBAFp3fL058529; Thu, 10 Dec 2015 15:51:03 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512101551.tBAFp3fL058529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 10 Dec 2015 15:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292063 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 15:51:04 -0000 Author: andrew Date: Thu Dec 10 15:51:02 2015 New Revision: 292063 URL: https://svnweb.freebsd.org/changeset/base/292063 Log: Remove pic_map_msix from ARM64, it is unneeded as all mappings happen through pic_map_msi (without the x). Sponsored by: ABT Systems Ltd Modified: head/sys/arm64/arm64/gic_v3_its.c head/sys/arm64/arm64/gic_v3_var.h head/sys/arm64/arm64/intr_machdep.c head/sys/arm64/arm64/pic_if.m Modified: head/sys/arm64/arm64/gic_v3_its.c ============================================================================== --- head/sys/arm64/arm64/gic_v3_its.c Thu Dec 10 13:19:30 2015 (r292062) +++ head/sys/arm64/arm64/gic_v3_its.c Thu Dec 10 15:51:02 2015 (r292063) @@ -74,10 +74,9 @@ static device_method_t gic_v3_its_method */ /* MSI-X */ DEVMETHOD(pic_alloc_msix, gic_v3_its_alloc_msix), - DEVMETHOD(pic_map_msix, gic_v3_its_map_msix), /* MSI */ DEVMETHOD(pic_alloc_msi, gic_v3_its_alloc_msi), - DEVMETHOD(pic_map_msi, gic_v3_its_map_msix), + DEVMETHOD(pic_map_msi, gic_v3_its_map_msi), /* End */ DEVMETHOD_END @@ -1658,7 +1657,7 @@ gic_v3_its_alloc_msi(device_t dev, devic } int -gic_v3_its_map_msix(device_t dev, device_t pci_dev, int irq, uint64_t *addr, +gic_v3_its_map_msi(device_t dev, device_t pci_dev, int irq, uint64_t *addr, uint32_t *data) { struct gic_v3_its_softc *sc; Modified: head/sys/arm64/arm64/gic_v3_var.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_var.h Thu Dec 10 13:19:30 2015 (r292062) +++ head/sys/arm64/arm64/gic_v3_var.h Thu Dec 10 15:51:02 2015 (r292063) @@ -253,7 +253,7 @@ int gic_v3_its_detach(device_t); int gic_v3_its_alloc_msix(device_t, device_t, int *); int gic_v3_its_alloc_msi(device_t, device_t, int, int *); -int gic_v3_its_map_msix(device_t, device_t, int, uint64_t *, uint32_t *); +int gic_v3_its_map_msi(device_t, device_t, int, uint64_t *, uint32_t *); int its_init_cpu(struct gic_v3_its_softc *); Modified: head/sys/arm64/arm64/intr_machdep.c ============================================================================== --- head/sys/arm64/arm64/intr_machdep.c Thu Dec 10 13:19:30 2015 (r292062) +++ head/sys/arm64/arm64/intr_machdep.c Thu Dec 10 15:51:02 2015 (r292063) @@ -252,13 +252,6 @@ arm_release_msix(device_t pci, device_t } -int -arm_map_msix(device_t pci, device_t child, int irq, uint64_t *addr, uint32_t *data) -{ - - return (PIC_MAP_MSIX(msi_pic, child, irq, addr, data)); -} - /* * Finalize interrupts bring-up (should be called from configure_final()). * Enables all interrupts registered by bus_setup_intr() during boot Modified: head/sys/arm64/arm64/pic_if.m ============================================================================== --- head/sys/arm64/arm64/pic_if.m Thu Dec 10 13:19:30 2015 (r292062) +++ head/sys/arm64/arm64/pic_if.m Thu Dec 10 15:51:02 2015 (r292063) @@ -158,14 +158,6 @@ METHOD int map_msi { uint32_t *data; }; -METHOD int map_msix { - device_t dev; - device_t pci_dev; - int irq; - uint64_t *addr; - uint32_t *data; -}; - METHOD int release_msi { device_t dev; device_t pci_dev; From owner-svn-src-all@freebsd.org Thu Dec 10 16:40:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 208889D7F85; Thu, 10 Dec 2015 16:40:40 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0B301BDB; Thu, 10 Dec 2015 16:40:39 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBAGecbk072854; Thu, 10 Dec 2015 16:40:38 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBAGec5X072851; Thu, 10 Dec 2015 16:40:38 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512101640.tBAGec5X072851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 10 Dec 2015 16:40:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292064 - head/sys/arm64/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 16:40:40 -0000 Author: andrew Date: Thu Dec 10 16:40:38 2015 New Revision: 292064 URL: https://svnweb.freebsd.org/changeset/base/292064 Log: Add support for the GICv2M extension to the GICv2 interrupt controller. This is (oddly) specified in the ARM Server Base System Architecture. It extends the GICv2 to support MSI and MSI-X interrupts, however only the latter are currently supported. Only the FDT attachment is currently supported, however the attachment and core driver are split to help adding ACPI support in the future. Obtained from: ABT Systems Ltd Relnotes: yes Sponsored by: SoftIron Inc Modified: head/sys/arm64/arm64/gic.c head/sys/arm64/arm64/gic.h head/sys/arm64/arm64/gic_fdt.c Modified: head/sys/arm64/arm64/gic.c ============================================================================== --- head/sys/arm64/arm64/gic.c Thu Dec 10 15:51:02 2015 (r292063) +++ head/sys/arm64/arm64/gic.c Thu Dec 10 16:40:38 2015 (r292064) @@ -47,10 +47,14 @@ __FBSDID("$FreeBSD$"); #include #include #include + #include #include #include +#include +#include + #include #include "pic_if.h" @@ -153,7 +157,7 @@ gic_init_secondary(device_t dev) } #endif -static int +int arm_gic_attach(device_t dev) { struct arm_gic_softc *sc; @@ -344,3 +348,116 @@ static device_method_t arm_gic_methods[] DEFINE_CLASS_0(gic, arm_gic_driver, arm_gic_methods, sizeof(struct arm_gic_softc)); + +#define GICV2M_MSI_TYPER 0x008 +#define MSI_TYPER_SPI_BASE(x) (((x) >> 16) & 0x3ff) +#define MSI_TYPER_SPI_COUNT(x) (((x) >> 0) & 0x3ff) +#define GICv2M_MSI_SETSPI_NS 0x040 +#define GICV2M_MSI_IIDR 0xFCC + +struct gicv2m_softc { + struct resource *sc_mem; + struct mtx sc_mutex; + u_int sc_spi_start; + u_int sc_spi_count; + u_int sc_spi_offset; +}; + +static int +gicv2m_probe(device_t dev) +{ + + device_set_desc(dev, "ARM Generic Interrupt Controller MSI/MSIX"); + return (BUS_PROBE_DEFAULT); +} + +static int +gicv2m_attach(device_t dev) +{ + struct gicv2m_softc *sc; + uint32_t typer; + int rid; + + sc = device_get_softc(dev); + + rid = 0; + sc->sc_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); + if (sc->sc_mem == NULL) { + device_printf(dev, "Unable to allocate resources\n"); + return (ENXIO); + } + + typer = bus_read_4(sc->sc_mem, GICV2M_MSI_TYPER); + sc->sc_spi_start = MSI_TYPER_SPI_BASE(typer); + sc->sc_spi_count = MSI_TYPER_SPI_COUNT(typer); + + device_printf(dev, "using spi %u to %u\n", sc->sc_spi_start, + sc->sc_spi_start + sc->sc_spi_count - 1); + + mtx_init(&sc->sc_mutex, "GICv2m lock", "", MTX_DEF); + + arm_register_msi_pic(dev); + + return (0); +} + +static int +gicv2m_alloc_msix(device_t dev, device_t pci_dev, int *pirq) +{ + struct arm_gic_softc *psc; + struct gicv2m_softc *sc; + uint32_t reg; + int irq; + + psc = device_get_softc(device_get_parent(dev)); + sc = device_get_softc(dev); + + mtx_lock(&sc->sc_mutex); + /* Find an unused interrupt */ + KASSERT(sc->sc_spi_offset < sc->sc_spi_count, ("No free SPIs")); + + irq = sc->sc_spi_start + sc->sc_spi_offset; + sc->sc_spi_offset++; + + /* Interrupts need to be edge triggered, set this */ + reg = gic_d_read_4(psc, GICD_ICFGR(irq >> 4)); + reg |= (GICD_ICFGR_TRIG_EDGE | GICD_ICFGR_POL_HIGH) << + ((irq & 0xf) * 2); + gic_d_write_4(psc, GICD_ICFGR(irq >> 4), reg); + + *pirq = irq; + mtx_unlock(&sc->sc_mutex); + + return (0); +} + +static int +gicv2m_map_msi(device_t dev, device_t pci_dev, int irq, uint64_t *addr, + uint32_t *data) +{ + struct gicv2m_softc *sc = device_get_softc(dev); + + *addr = vtophys(rman_get_virtual(sc->sc_mem)) + 0x40; + *data = irq; + + return (0); +} + +static device_method_t arm_gicv2m_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, gicv2m_probe), + DEVMETHOD(device_attach, gicv2m_attach), + + /* MSI-X */ + DEVMETHOD(pic_alloc_msix, gicv2m_alloc_msix), + DEVMETHOD(pic_map_msi, gicv2m_map_msi), + + { 0, 0 } +}; + +static devclass_t arm_gicv2m_devclass; + +DEFINE_CLASS_0(gicv2m, arm_gicv2m_driver, arm_gicv2m_methods, + sizeof(struct gicv2m_softc)); +EARLY_DRIVER_MODULE(gicv2m, gic, arm_gicv2m_driver, arm_gicv2m_devclass, + 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_MIDDLE); Modified: head/sys/arm64/arm64/gic.h ============================================================================== --- head/sys/arm64/arm64/gic.h Thu Dec 10 15:51:02 2015 (r292063) +++ head/sys/arm64/arm64/gic.h Thu Dec 10 16:40:38 2015 (r292064) @@ -51,4 +51,6 @@ struct arm_gic_softc { uint32_t nirqs; }; +int arm_gic_attach(device_t); + #endif Modified: head/sys/arm64/arm64/gic_fdt.c ============================================================================== --- head/sys/arm64/arm64/gic_fdt.c Thu Dec 10 15:51:02 2015 (r292063) +++ head/sys/arm64/arm64/gic_fdt.c Thu Dec 10 16:40:38 2015 (r292064) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -56,6 +57,68 @@ static struct ofw_compat_data compat_dat {NULL, false} }; +struct gic_range { + uint64_t bus; + uint64_t host; + uint64_t size; +}; + +struct arm_gic_fdt_softc { + struct arm_gic_softc sc_gic; + pcell_t sc_host_cells; + pcell_t sc_addr_cells; + pcell_t sc_size_cells; + struct gic_range *sc_ranges; + int sc_nranges; +}; + +struct gic_devinfo { + struct ofw_bus_devinfo obdinfo; + struct resource_list rl; +}; + +static int +gic_fill_ranges(phandle_t node, struct arm_gic_fdt_softc *sc) +{ + cell_t *base_ranges; + ssize_t nbase_ranges; + int i, j, k; + + nbase_ranges = OF_getproplen(node, "ranges"); + if (nbase_ranges < 0) + return (-1); + sc->sc_nranges = nbase_ranges / sizeof(cell_t) / + (sc->sc_addr_cells + sc->sc_host_cells + sc->sc_size_cells); + if (sc->sc_nranges == 0) + return (0); + + sc->sc_ranges = malloc(sc->sc_nranges * sizeof(sc->sc_ranges[0]), + M_DEVBUF, M_WAITOK); + base_ranges = malloc(nbase_ranges, M_DEVBUF, M_WAITOK); + OF_getencprop(node, "ranges", base_ranges, nbase_ranges); + + for (i = 0, j = 0; i < sc->sc_nranges; i++) { + sc->sc_ranges[i].bus = 0; + for (k = 0; k < sc->sc_addr_cells; k++) { + sc->sc_ranges[i].bus <<= 32; + sc->sc_ranges[i].bus |= base_ranges[j++]; + } + sc->sc_ranges[i].host = 0; + for (k = 0; k < sc->sc_host_cells; k++) { + sc->sc_ranges[i].host <<= 32; + sc->sc_ranges[i].host |= base_ranges[j++]; + } + sc->sc_ranges[i].size = 0; + for (k = 0; k < sc->sc_size_cells; k++) { + sc->sc_ranges[i].size <<= 32; + sc->sc_ranges[i].size |= base_ranges[j++]; + } + } + + free(base_ranges, M_DEVBUF); + return (sc->sc_nranges); +} + static int arm_gic_fdt_probe(device_t dev) { @@ -70,15 +133,156 @@ arm_gic_fdt_probe(device_t dev) return (BUS_PROBE_DEFAULT); } +static int +arm_gic_fdt_attach(device_t dev) +{ + struct arm_gic_fdt_softc *sc = device_get_softc(dev); + phandle_t root, child; + struct gic_devinfo *dinfo; + device_t cdev; + int err; + + err = arm_gic_attach(dev); + if (err != 0) + return (err); + + root = ofw_bus_get_node(dev); + + sc->sc_host_cells = 1; + OF_getencprop(OF_parent(root), "#address-cells", &sc->sc_host_cells, + sizeof(sc->sc_host_cells)); + sc->sc_addr_cells = 2; + OF_getencprop(root, "#address-cells", &sc->sc_addr_cells, + sizeof(sc->sc_addr_cells)); + sc->sc_size_cells = 2; + OF_getencprop(root, "#size-cells", &sc->sc_size_cells, + sizeof(sc->sc_size_cells)); + + if (gic_fill_ranges(root, sc) < 0) { + device_printf(dev, "could not get ranges\n"); + return (ENXIO); + } + + for (child = OF_child(root); child != 0; child = OF_peer(child)) { + dinfo = malloc(sizeof(*dinfo), M_DEVBUF, M_WAITOK | M_ZERO); + + if (ofw_bus_gen_setup_devinfo(&dinfo->obdinfo, child) != 0) { + free(dinfo, M_DEVBUF); + continue; + } + + resource_list_init(&dinfo->rl); + ofw_bus_reg_to_rl(dev, child, sc->sc_addr_cells, + sc->sc_size_cells, &dinfo->rl); + + cdev = device_add_child(dev, NULL, -1); + if (cdev == NULL) { + device_printf(dev, "<%s>: device_add_child failed\n", + dinfo->obdinfo.obd_name); + resource_list_free(&dinfo->rl); + ofw_bus_gen_destroy_devinfo(&dinfo->obdinfo); + free(dinfo, M_DEVBUF); + continue; + } + device_set_ivars(cdev, dinfo); + } + + bus_generic_probe(dev); + return (bus_generic_attach(dev)); +} + +static struct resource * +arm_gic_fdt_alloc_resource(device_t bus, device_t child, int type, int *rid, + u_long start, u_long end, u_long count, u_int flags) +{ + struct arm_gic_fdt_softc *sc = device_get_softc(bus); + struct gic_devinfo *di; + struct resource_list_entry *rle; + int j; + + KASSERT(type == SYS_RES_MEMORY, ("Invalid resoure type %x", type)); + + /* + * Request for the default allocation with a given rid: use resource + * list stored in the local device info. + */ + if ((start == 0UL) && (end == ~0UL)) { + if ((di = device_get_ivars(child)) == NULL) + return (NULL); + + if (type == SYS_RES_IOPORT) + type = SYS_RES_MEMORY; + + rle = resource_list_find(&di->rl, type, *rid); + if (rle == NULL) { + if (bootverbose) + device_printf(bus, "no default resources for " + "rid = %d, type = %d\n", *rid, type); + return (NULL); + } + start = rle->start; + end = rle->end; + count = rle->count; + } + + /* Remap through ranges property */ + for (j = 0; j < sc->sc_nranges; j++) { + if (start >= sc->sc_ranges[j].bus && end < + sc->sc_ranges[j].bus + sc->sc_ranges[j].size) { + start -= sc->sc_ranges[j].bus; + start += sc->sc_ranges[j].host; + end -= sc->sc_ranges[j].bus; + end += sc->sc_ranges[j].host; + break; + } + } + if (j == sc->sc_nranges && sc->sc_nranges != 0) { + if (bootverbose) + device_printf(bus, "Could not map resource " + "%#lx-%#lx\n", start, end); + + return (NULL); + } + + return (bus_generic_alloc_resource(bus, child, type, rid, start, end, + count, flags)); +} + +static const struct ofw_bus_devinfo * +arm_gic_fdt_ofw_get_devinfo(device_t bus __unused, device_t child) +{ + struct gic_devinfo *di; + + di = device_get_ivars(child); + + return (&di->obdinfo); +} + + static device_method_t arm_gic_fdt_methods[] = { /* Device interface */ DEVMETHOD(device_probe, arm_gic_fdt_probe), + DEVMETHOD(device_attach, arm_gic_fdt_attach), + + /* Bus interface */ + DEVMETHOD(bus_add_child, bus_generic_add_child), + DEVMETHOD(bus_alloc_resource, arm_gic_fdt_alloc_resource), + DEVMETHOD(bus_release_resource, bus_generic_release_resource), + DEVMETHOD(bus_activate_resource,bus_generic_activate_resource), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_devinfo, arm_gic_fdt_ofw_get_devinfo), + DEVMETHOD(ofw_bus_get_compat, ofw_bus_gen_get_compat), + DEVMETHOD(ofw_bus_get_model, ofw_bus_gen_get_model), + DEVMETHOD(ofw_bus_get_name, ofw_bus_gen_get_name), + DEVMETHOD(ofw_bus_get_node, ofw_bus_gen_get_node), + DEVMETHOD(ofw_bus_get_type, ofw_bus_gen_get_type), DEVMETHOD_END }; DEFINE_CLASS_1(gic, arm_gic_fdt_driver, arm_gic_fdt_methods, - sizeof(struct arm_gic_softc), arm_gic_driver); + sizeof(struct arm_gic_fdt_softc), arm_gic_driver); static devclass_t arm_gic_fdt_devclass; From owner-svn-src-all@freebsd.org Thu Dec 10 16:44:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2A619D53CF; Thu, 10 Dec 2015 16:44:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 910451FEE; Thu, 10 Dec 2015 16:44:41 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBAGie7m075158; Thu, 10 Dec 2015 16:44:40 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBAGie3W075157; Thu, 10 Dec 2015 16:44:40 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512101644.tBAGie3W075157@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 10 Dec 2015 16:44:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292065 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 16:44:42 -0000 Author: imp Date: Thu Dec 10 16:44:40 2015 New Revision: 292065 URL: https://svnweb.freebsd.org/changeset/base/292065 Log: Move nanobsd up since I'm overhauling it Sort the new section alphabetically. Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Thu Dec 10 16:40:38 2015 (r292064) +++ head/MAINTAINERS Thu Dec 10 16:44:40 2015 (r292065) @@ -26,57 +26,58 @@ sub-system. subsystem login notes ----------------------------- -opencrypto jmg Pre-commit review requested. Documentation Required. -kqueue jmg Pre-commit review requested. Documentation Required. -share/mk imp, bapt, bdrewery, emaste, sjg Make is hard. +atf freebsd-testing,jmmv,ngie Pre-commit review requested. ath(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org -net80211 adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org -iwn(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org -iwm(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org -otus(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org -dev/usb/wlan adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org -openssl benl,jkim Pre-commit review requested. -release/release.sh gjb,re Pre-commit review and regression tests - requested. -sh(1) jilles Pre-commit review requested. This also applies - to kill(1), printf(1) and test(1) which are - compiled in as builtins. -isci(4) jimharris Pre-commit review requested. -nvme(4) jimharris Pre-commit review requested. -nvd(4) jimharris Pre-commit review requested. -nvmecontrol(8) jimharris Pre-commit review requested. -libfetch des Pre-commit review requested. -fetch des Pre-commit review requested. -libpam des Pre-commit review requested. -openssh des Pre-commit review requested. -pseudofs des Pre-commit review requested. -procfs des Pre-commit review requested. -linprocfs des Pre-commit review requested. +callout_*(9) rrs Pre-commit review requested -- becareful its tricksy code :o. contrib/compiler-rt dim Pre-commit review preferred. contrib/libc++ dim Pre-commit review preferred. contrib/libcxxrt dim Pre-commit review preferred. contrib/llvm dim Pre-commit review preferred. contrib/llvm/tools/lldb emaste Pre-commit review preferred. -atf freebsd-testing,jmmv,ngie Pre-commit review requested. contrib/netbsd-tests freebsd-testing,ngie Pre-commit review requested. contrib/pjdfstest freebsd-testing,ngie,pjd Pre-commit review requested. +dev/usb/wlan adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org +fetch des Pre-commit review requested. +isci(4) jimharris Pre-commit review requested. +iwm(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org +iwn(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org +kqueue jmg Pre-commit review requested. Documentation Required. +libfetch des Pre-commit review requested. +libpam des Pre-commit review requested. +linprocfs des Pre-commit review requested. +lpr gad Pre-commit review requested, particularly for + lpd/recvjob.c and lpd/printjob.c. +nanobsd imp Pre-commit phabricator review requested. +net80211 adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org +nis(8), yp(8) araujo Pre-commit review requested. +nvd(4) jimharris Pre-commit review requested. +nvme(4) jimharris Pre-commit review requested. +nvmecontrol(8) jimharris Pre-commit review requested. +opencrypto jmg Pre-commit review requested. Documentation Required. +openssh des Pre-commit review requested. +openssl benl,jkim Pre-commit review requested. +otus(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org +pmcstudy(8) rrs Pre-commit review requested. +procfs des Pre-commit review requested. +pseudofs des Pre-commit review requested. +release/release.sh gjb,re Pre-commit review and regression tests + requested. +sctp rrs,tuexen Pre-commit review requested (changes need to be backported to github). +sh(1) jilles Pre-commit review requested. This also applies + to kill(1), printf(1) and test(1) which are + compiled in as builtins. +share/mk imp, bapt, bdrewery, emaste, sjg Make is hard. share/mk/*.test.mk freebsd-testing,ngie (same list as share/mk too) Pre-commit review requested. -tests freebsd-testing,ngie Pre-commit review requested. -sys/dev/usb hselasky If in doubt, ask. -sys/dev/sound/usb hselasky If in doubt, ask. sys/compat/linuxkpi hselasky If in doubt, ask. sys/dev/e1000 erj Pre-commit phabricator review requested. sys/dev/ixgbe erj Pre-commit phabricator review requested. sys/dev/ixl erj Pre-commit phabricator review requested. +sys/dev/sound/usb hselasky If in doubt, ask. +sys/dev/usb hselasky If in doubt, ask. sys/netinet/ip_carp.c glebius Pre-commit review recommended. sys/netpfil/pf kp,glebius Pre-commit review recommended. -sctp rrs,tuexen Pre-commit review requested (changes need to be backported to github). -pmcstudy(8) rrs Pre-commit review requested. -callout_*(9) rrs Pre-commit review requested -- becareful its tricksy code :o. +tests freebsd-testing,ngie Pre-commit review requested. usr.sbin/pkg pkg@ Please coordinate behavior or flag changes with pkg team. -lpr gad Pre-commit review requested, particularly for - lpd/recvjob.c and lpd/printjob.c. -nis(8), yp(8) araujo Pre-commit review requested. vmm(4) neel,grehan Pre-commit review requested. ---- OLD ---- libc/posix1e rwatson Pre-commit review requested. @@ -156,5 +157,4 @@ sbin/routed bms Pre-commit review; notif cmx daniel@roe.ch Pre-commit review preferred. filemon obrien Pre-commit review preferred. sysdoc trhodes Pre-commit review preferred. -nanobsd imp Pre-commit review requested for coordination. From owner-svn-src-all@freebsd.org Thu Dec 10 17:05:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 207949D63B9 for ; Thu, 10 Dec 2015 17:05:56 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00AC21C6B for ; Thu, 10 Dec 2015 17:05:55 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 10 Dec 2015 17:05:54 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tBAH5liw009754; Thu, 10 Dec 2015 10:05:47 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1449767147.1358.62.camel@freebsd.org> Subject: Re: svn commit: r292058 - head/sbin/geom/class/part From: Ian Lepore To: "Andrey V. Elsukov" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 10 Dec 2015 10:05:47 -0700 In-Reply-To: <201512101037.tBAAbDMq065138@repo.freebsd.org> References: <201512101037.tBAAbDMq065138@repo.freebsd.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 17:05:56 -0000 On Thu, 2015-12-10 at 10:37 +0000, Andrey V. Elsukov wrote: > Author: ae > Date: Thu Dec 10 10:37:12 2015 > New Revision: 292058 > URL: https://svnweb.freebsd.org/changeset/base/292058 > > Log: > Remove a note about damaged PMBR. Now GPT will be detected > automatically > with such corruption. > > MFC after: 1 month Will all of these changes add up to it being impossible to make a device NOT be recognized as gpt once it has had gpt on it? It's typical to dd some zeroes to the start of a volume to clean out old info, but if geom is going to aggressively ressurect a purposely -nuked GPT based on the backup info (which is hard to find and dd over by hand) this is going to add up to a lot of frustration for those of us who have to frequently work with regenerating sdcard and CF images. -- Ian From owner-svn-src-all@freebsd.org Thu Dec 10 17:38:10 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 280439D7899; Thu, 10 Dec 2015 17:38:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08CF71C9D; Thu, 10 Dec 2015 17:38:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 46386B986; Thu, 10 Dec 2015 12:38:07 -0500 (EST) From: John Baldwin To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292064 - head/sys/arm64/arm64 Date: Thu, 10 Dec 2015 09:34:34 -0800 Message-ID: <2223711.lepPF7yQe2@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201512101640.tBAGec5X072851@repo.freebsd.org> References: <201512101640.tBAGec5X072851@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 10 Dec 2015 12:38:07 -0500 (EST) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 17:38:10 -0000 On Thursday, December 10, 2015 04:40:38 PM Andrew Turner wrote: > Author: andrew > Date: Thu Dec 10 16:40:38 2015 > New Revision: 292064 > URL: https://svnweb.freebsd.org/changeset/base/292064 > > Log: > Add support for the GICv2M extension to the GICv2 interrupt controller. > This is (oddly) specified in the ARM Server Base System Architecture. It > extends the GICv2 to support MSI and MSI-X interrupts, however only the > latter are currently supported. MSI and MSI-X only different in the config registers used to configure them in the PCI function. The on-wire format of the PCI transaction is identical, so from a PIC's perspective there should be no difference. They are all just MSI messages. This is why both MSI and MSI-X interrupt resources use the same PCIB_MAP_MSI() method to map a given IRQ to an (address, data) tuple. -- John Baldwin From owner-svn-src-all@freebsd.org Thu Dec 10 17:39:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 602D59D7927; Thu, 10 Dec 2015 17:39:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx2.freebsd.org", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F2171E0D; Thu, 10 Dec 2015 17:39:04 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 289186B48F; Thu, 10 Dec 2015 17:39:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Subject: Re: svn commit: r292057 - in head/sys: boot/common geom/part To: John Baldwin References: <201512101035.tBAAZ7fj064953@repo.freebsd.org> <3064443.9SoIZWyLLV@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: "Andrey V. Elsukov" Message-ID: <5669B8A1.5000306@FreeBSD.org> Date: Thu, 10 Dec 2015 20:38:41 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <3064443.9SoIZWyLLV@ralph.baldwin.cx> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2OgRfbmmlkI60TT3n5USCoSBI37a9hwFu" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 17:39:04 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2OgRfbmmlkI60TT3n5USCoSBI37a9hwFu Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 10.12.15 18:07, John Baldwin wrote: > On Thursday, December 10, 2015 10:35:07 AM Andrey V. Elsukov wrote: >> Author: ae >> Date: Thu Dec 10 10:35:07 2015 >> New Revision: 292057 >> URL: https://svnweb.freebsd.org/changeset/base/292057 >> >> Log: >> Make detection of GPT a bit more reliable. >> =20 >> When we are detecting a partition table and didn't find PMBR, try to= >> read backup GPT header from the last sector and if it is correct, >> assume that we have GPT. >=20 > One thing that your commit message did not make clear: >=20 > Does this only detect as valid if no other partition scheme claims the > disk? That is, if I overwrite a previously GPT-partitioned disk with a= > different scheme (e.g. MBR), will that disk now probe as GPT instead of= > the new scheme? If so, this is broken and needs to be reverted. If th= is > somehow does a "low" priority probe and only kicks in if no other schem= e > claims the disk, then this is ok, but you should probably have said so = in > the commit message. Hi, GEOM_PART uses different priorities between schemes when does probing. In your case MBR will have greater priority and MBR will be detected in result. As it worked before. This change only affects the case, when there is no MBR signature at all, but we have valid backup GPT header. --=20 WBR, Andrey V. Elsukov --2OgRfbmmlkI60TT3n5USCoSBI37a9hwFu Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWabihAAoJEAHF6gQQyKF6ESYH/Rpkk9bzVeL5/HhEKhOR9Ko+ WxQRo3wDxOHORZxuRMq2tOeigHFsWr0XLniFio9J42VUSqBXR18Drx+3+eWelTHJ ICLnR5cLwpJNPlErkdsesZCgRZe4QIsbo+0luNs62wLORuHtvPUl4nEi9TvuhQUT w3R16ShTMuQ9D5CuIdFdAAx/TyCnCIzt37NZt8sVrfb6JH5lNQk3yTPqwJ128p2L XieIl+EgWx10XdfRykgKumIa1XzHzkkgeELr2FGp2qrHJLFEvERZiFlkzCK55qx/ rsNEbRyCYmxHegcu3rLH/DijdvD7BykyuVGLWLqn7xXjc1fg53Rto7J++aas18k= =kX3A -----END PGP SIGNATURE----- --2OgRfbmmlkI60TT3n5USCoSBI37a9hwFu-- From owner-svn-src-all@freebsd.org Thu Dec 10 17:42:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF0569D7BDD; Thu, 10 Dec 2015 17:42:19 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx2.freebsd.org", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DECD31195; Thu, 10 Dec 2015 17:42:19 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 2F4796B773; Thu, 10 Dec 2015 17:42:17 +0000 (UTC) (envelope-from ae@FreeBSD.org) Subject: Re: svn commit: r292058 - head/sbin/geom/class/part To: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512101037.tBAAbDMq065138@repo.freebsd.org> <1449767147.1358.62.camel@freebsd.org> From: "Andrey V. Elsukov" Message-ID: <5669B969.5020605@FreeBSD.org> Date: Thu, 10 Dec 2015 20:42:01 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1449767147.1358.62.camel@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="L69AkuRfL2B09hcGp98CXHjBGIL44xe4R" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 17:42:20 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --L69AkuRfL2B09hcGp98CXHjBGIL44xe4R Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 10.12.15 20:05, Ian Lepore wrote: > On Thu, 2015-12-10 at 10:37 +0000, Andrey V. Elsukov wrote: >> Author: ae >> Date: Thu Dec 10 10:37:12 2015 >> New Revision: 292058 >> URL: https://svnweb.freebsd.org/changeset/base/292058 >> >> Log: >> Remove a note about damaged PMBR. Now GPT will be detected >> automatically >> with such corruption. >> =20 >> MFC after: 1 month >=20 > Will all of these changes add up to it being impossible to make a > device NOT be recognized as gpt once it has had gpt on it? > It's typical to dd some zeroes to the start of a volume to clean out > old info, but if geom is going to aggressively ressurect a purposely > -nuked GPT based on the backup info (which is hard to find and dd over > by hand) this is going to add up to a lot of frustration for those of > us who have to frequently work with regenerating sdcard and CF images. If you want to make device to not be recognized as GPT, you should use 'gpart destroy -F ' this will destroy first two sectors where PMBR and primary GPT header are located, also it will destroy the last sector with backup GPT. --=20 WBR, Andrey V. Elsukov --L69AkuRfL2B09hcGp98CXHjBGIL44xe4R Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWablpAAoJEAHF6gQQyKF6J14H/jx2Fj383zx2WTvSHVWfVHIq l+z3+C3dH90nw3K7m7SJ3/GJ1J4iZl57zQJAldVDofGQ6LNld2Kb7K1zvZeTIUxj CeBR5WLvZuO1lqjIpSIn8bhirDXND3eSFOvsZG3yzoSijbvgx/5IIHaBN3mYL8y7 YsLsU2AjspRBKeLTFr3sfiJe7EOBL5heAoHPtKaAr5zIiTPdZ18Wb39XkvDE2uqd g3BNGVNjQI+zn2QdRYmN0KKA77SRI8/BJviIVfZS3D0RhMYiiXHhabmudrjv+uOg DfxCg0zx6KG5j1iBnCx83Towr0Ow8a71m4/9k7B4jPSKFNVCpw9mfhwn4xwlO5E= =Zt6M -----END PGP SIGNATURE----- --L69AkuRfL2B09hcGp98CXHjBGIL44xe4R-- From owner-svn-src-all@freebsd.org Thu Dec 10 20:57:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B53CD9D5883; Thu, 10 Dec 2015 20:57:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A59051F4A; Thu, 10 Dec 2015 20:57:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 9E9B61762; Thu, 10 Dec 2015 20:57:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 58A6C178CC; Thu, 10 Dec 2015 20:57:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 6AO-waDscT8g; Thu, 10 Dec 2015 20:57:30 +0000 (UTC) Subject: Re: svn commit: r291955 - in head: . share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 6A255178C4 To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512071915.tB7JFqgM052194@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <5669E737.3060105@FreeBSD.org> Date: Thu, 10 Dec 2015 12:57:27 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201512071915.tB7JFqgM052194@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 20:57:33 -0000 On 12/7/15 11:15 AM, Ed Maste wrote: > Author: emaste > Date: Mon Dec 7 19:15:52 2015 > New Revision: 291955 > URL: https://svnweb.freebsd.org/changeset/base/291955 > > Log: > Build and install userland .debug files by default > > Debug data files are now built by default with 'make buildworld' and > installed with 'make installworld'. This facilitates debugging but > requires more disk space both during the build and for the installed > world. Debug files may be disabled by setting WITHOUT_DEBUG_FILES=yes > in src.conf(5). > > Reviewed by: bdrewery, eadler, vangyzen > Relnotes: Yes > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D4018 > > Modified: > head/UPDATING > head/share/mk/bsd.opts.mk > > Modified: head/UPDATING > ============================================================================== > --- head/UPDATING Mon Dec 7 19:08:33 2015 (r291954) > +++ head/UPDATING Mon Dec 7 19:15:52 2015 (r291955) > @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) > > +20151207: > + Debug data files are now built by default with 'make buildworld' and > + installed with 'make installworld'. This facilitates debugging but > + requires more disk space both during the build and for the installed > + world. Debug files may be disabled by setting WITHOUT_DEBUG_FILES=yes > + in src.conf(5). > + > 20151130: > r291527 changed the internal interface between the nfsd.ko and > nfscommon.ko modules. As such, they must both be upgraded to-gether. > > Modified: head/share/mk/bsd.opts.mk > ============================================================================== > --- head/share/mk/bsd.opts.mk Mon Dec 7 19:08:33 2015 (r291954) > +++ head/share/mk/bsd.opts.mk Mon Dec 7 19:15:52 2015 (r291955) > @@ -50,6 +50,7 @@ ____: > > __DEFAULT_YES_OPTIONS = \ > ASSERT_DEBUG \ > + DEBUG_FILES \ > DOCCOMPRESS \ > INCLUDES \ > INSTALLLIB \ > @@ -69,7 +70,6 @@ __DEFAULT_NO_OPTIONS = \ > CCACHE_BUILD \ > FAST_DEPEND \ > CTF \ > - DEBUG_FILES \ > INSTALL_AS_USER \ > STALE_STAGED > > I just noticed. This will cause ports that use /usr/share/mk to now generate .debug files and have plist errors. I'm thinking of the right way to handle this. I want to handle symbols in ports differently than DEBUG_FILES, so I think I will force MK_DEBUG_FILES=no for ports builds. I have pending work to complete to bring symbols support to all of ports, not just those using /usr/share/mk. -- Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Thu Dec 10 21:10:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 670B19D634C; Thu, 10 Dec 2015 21:10:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 4B042184B; Thu, 10 Dec 2015 21:10:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 445ED1B96; Thu, 10 Dec 2015 21:10:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id F3ABC1795D; Thu, 10 Dec 2015 21:10:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id 3wIPivtGliO3; Thu, 10 Dec 2015 21:10:38 +0000 (UTC) Subject: Re: svn commit: r291955 - in head: . share/mk DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 7C48617955 To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201512071915.tB7JFqgM052194@repo.freebsd.org> <5669E737.3060105@FreeBSD.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <5669EA4B.8060805@FreeBSD.org> Date: Thu, 10 Dec 2015 13:10:35 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <5669E737.3060105@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 21:10:41 -0000 On 12/10/15 12:57 PM, Bryan Drewery wrote: > On 12/7/15 11:15 AM, Ed Maste wrote: >> Author: emaste >> Date: Mon Dec 7 19:15:52 2015 >> New Revision: 291955 >> URL: https://svnweb.freebsd.org/changeset/base/291955 >> >> Log: >> Build and install userland .debug files by default >> >> Debug data files are now built by default with 'make buildworld' and >> installed with 'make installworld'. This facilitates debugging but >> requires more disk space both during the build and for the installed >> world. Debug files may be disabled by setting WITHOUT_DEBUG_FILES=yes >> in src.conf(5). >> >> Reviewed by: bdrewery, eadler, vangyzen >> Relnotes: Yes >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D4018 >> >> Modified: >> head/UPDATING >> head/share/mk/bsd.opts.mk >> >> Modified: head/UPDATING >> ============================================================================== >> --- head/UPDATING Mon Dec 7 19:08:33 2015 (r291954) >> +++ head/UPDATING Mon Dec 7 19:15:52 2015 (r291955) >> @@ -31,6 +31,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 >> disable the most expensive debugging functionality run >> "ln -s 'abort:false,junk:false' /etc/malloc.conf".) >> >> +20151207: >> + Debug data files are now built by default with 'make buildworld' and >> + installed with 'make installworld'. This facilitates debugging but >> + requires more disk space both during the build and for the installed >> + world. Debug files may be disabled by setting WITHOUT_DEBUG_FILES=yes >> + in src.conf(5). >> + >> 20151130: >> r291527 changed the internal interface between the nfsd.ko and >> nfscommon.ko modules. As such, they must both be upgraded to-gether. >> >> Modified: head/share/mk/bsd.opts.mk >> ============================================================================== >> --- head/share/mk/bsd.opts.mk Mon Dec 7 19:08:33 2015 (r291954) >> +++ head/share/mk/bsd.opts.mk Mon Dec 7 19:15:52 2015 (r291955) >> @@ -50,6 +50,7 @@ ____: >> >> __DEFAULT_YES_OPTIONS = \ >> ASSERT_DEBUG \ >> + DEBUG_FILES \ >> DOCCOMPRESS \ >> INCLUDES \ >> INSTALLLIB \ >> @@ -69,7 +70,6 @@ __DEFAULT_NO_OPTIONS = \ >> CCACHE_BUILD \ >> FAST_DEPEND \ >> CTF \ >> - DEBUG_FILES \ >> INSTALL_AS_USER \ >> STALE_STAGED >> >> > > I just noticed. This will cause ports that use /usr/share/mk to now > generate .debug files and have plist errors. > > I'm thinking of the right way to handle this. I want to handle symbols > in ports differently than DEBUG_FILES, so I think I will force > MK_DEBUG_FILES=no for ports builds. I have pending work to complete to > bring symbols support to all of ports, not just those using /usr/share/mk. > Fixed in ports here: https://svnweb.freebsd.org/changeset/ports/403467 textproc/tinyxml is an example port where 'make check-plist' was failing. -- Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Thu Dec 10 21:18:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F5509D68FE for ; Thu, 10 Dec 2015 21:18:21 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 365441D2B for ; Thu, 10 Dec 2015 21:18:21 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22c.google.com with SMTP id u63so41079753wmu.0 for ; Thu, 10 Dec 2015 13:18:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xzGXRRTifm57X20kKa2frzGmMlxeMqfopAvtAt0WQXk=; b=va4heJ/lXhSEajKiV5H2MLIw0BgDw8ViHUlIvwsSrDsKnaHBUADf39SlrLuOe4QZTz dENi7px08Znp1unuWT3mtn96D5YftPqJbYjuoWqbNzTqKqU0wmmInM658HxQCBmpmycW IVERj36ehP45g94W0w3FQs7FK1WrEX+nfZLCpLH9LGhM6Nd+gnqErMhprL7+2r9SNNwk xqWflEbEpz+8eDrzpWN0VyUfg7qPTZv8Mk4CzhP7FhYuthQb1k72PF/29ZEMGsQ2a89z 8ma/FGfcRQVubUL4g1AWcl2xBIJ6q/StZpBvvYZfsK7vqFz9++/uScbxKM/ZdK6Ni2lV Fi8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=xzGXRRTifm57X20kKa2frzGmMlxeMqfopAvtAt0WQXk=; b=FIqIVV6xVruTA/R8dBgN9p+WdpxPnYBhHtvzrQj7Cm1IIt9Ay6fYjvELGDS71/hmad PW+g8T/JwasWW7yCnzvqwgEgoG0M79HJPfhb0QoSMkpEiusId1axnzUGPrqgHmbH6pmU hJoICnPbx8W7XFtfME2gTc2RtsoXfjQ4yakxeXktSYbnKqGe7OqS+xQXAIzVauMp3w2N Wir5ag3DBCB0+EAVLMQerMewpBLXNEsJRF/G5rAnnzvgq0Gyt2l7/O8do4+AWIawbwLg GvDaIcvo2KzdG0BovE6HNk50OAFdSTF0DqlNovVJjb15jv+X4rfb7MDCJKTT5YXy3OK0 SZ5g== X-Gm-Message-State: ALoCoQlIEKgk9FevKWyWuKdwWE32QDO+OyvVDamghs+0dR8yI7/iBUuDBG8WLehOoalZ97SkVBRRjFgnobKrmi/kFrVhSAyyUYXCi8KnVEEQcfOanuodEHs= MIME-Version: 1.0 X-Received: by 10.194.223.39 with SMTP id qr7mr14832072wjc.63.1449782299658; Thu, 10 Dec 2015 13:18:19 -0800 (PST) Received: by 10.194.85.167 with HTTP; Thu, 10 Dec 2015 13:18:19 -0800 (PST) In-Reply-To: <201511230709.tAN79Z4L062228@repo.freebsd.org> References: <201511230709.tAN79Z4L062228@repo.freebsd.org> Date: Thu, 10 Dec 2015 22:18:19 +0100 Message-ID: Subject: Re: svn commit: r291171 - in head/sys: amd64/amd64 compat/ia32 i386/i386 kern sys From: Oliver Pinter To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 21:18:21 -0000 On Mon, Nov 23, 2015 at 8:09 AM, Konstantin Belousov wrote: > Author: kib > Date: Mon Nov 23 07:09:35 2015 > New Revision: 291171 > URL: https://svnweb.freebsd.org/changeset/base/291171 > > Log: > Split kerne timekeep ABI structure vdso_sv_tk out of the struct > sysentvec. This allows the timekeep data to be shared between similar > ABIs which cannot share sysentvec. > > Make the timekeep_push_vdso() tick callback to the timekeep structures > instead of sysentvecs. If several sysentvec share the vdso_sv_tk > structure, we would update the userspace data several times on each > tick, without the change. > > Only allocate vdso_sv_tk in the exec_sysvec_init() sysinit when > sysentvec is marked with the new SV_TIMEKEEP flag. This saves > allocation and update of unneeded vdso_sv_tk for ABIs which do not > provide userspace gettimeofday yet, which are PowerPCs arches right > now. > > Make vdso_sv_tk allocator public, namely split out and export > alloc_sv_tk() and alloc_sv_tk_compat32(). ABIs which share timekeep > data now can allocate it manually and share as appropriate. > > Requested by: nwhitehorn > Tested by: nwhitehorn, pho > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks Hello Konstantin! Do you plan to MFC back this changes to 10-STABLE in these days? > > Modified: > head/sys/amd64/amd64/elf_machdep.c > head/sys/compat/ia32/ia32_sysvec.c > head/sys/i386/i386/elf_machdep.c > head/sys/kern/kern_sharedpage.c > head/sys/sys/sysent.h > head/sys/sys/vdso.h > From owner-svn-src-all@freebsd.org Thu Dec 10 21:33:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B12CE9D75D9; Thu, 10 Dec 2015 21:33:30 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 309601BA7; Thu, 10 Dec 2015 21:33:29 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tBALXOuV018360 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Thu, 10 Dec 2015 23:33:24 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tBALXOuV018360 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tBALXOss018359; Thu, 10 Dec 2015 23:33:24 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 10 Dec 2015 23:33:24 +0200 From: Konstantin Belousov To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r291171 - in head/sys: amd64/amd64 compat/ia32 i386/i386 kern sys Message-ID: <20151210213324.GF82577@kib.kiev.ua> References: <201511230709.tAN79Z4L062228@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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 autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 21:33:30 -0000 On Thu, Dec 10, 2015 at 10:18:19PM +0100, Oliver Pinter wrote: > On Mon, Nov 23, 2015 at 8:09 AM, Konstantin Belousov wrote: > > Author: kib > > Date: Mon Nov 23 07:09:35 2015 > > New Revision: 291171 > > URL: https://svnweb.freebsd.org/changeset/base/291171 > > > > Log: > > Split kerne timekeep ABI structure vdso_sv_tk out of the struct > > sysentvec. This allows the timekeep data to be shared between similar > > ABIs which cannot share sysentvec. > > > > Make the timekeep_push_vdso() tick callback to the timekeep structures > > instead of sysentvecs. If several sysentvec share the vdso_sv_tk > > structure, we would update the userspace data several times on each > > tick, without the change. > > > > Only allocate vdso_sv_tk in the exec_sysvec_init() sysinit when > > sysentvec is marked with the new SV_TIMEKEEP flag. This saves > > allocation and update of unneeded vdso_sv_tk for ABIs which do not > > provide userspace gettimeofday yet, which are PowerPCs arches right > > now. > > > > Make vdso_sv_tk allocator public, namely split out and export > > alloc_sv_tk() and alloc_sv_tk_compat32(). ABIs which share timekeep > > data now can allocate it manually and share as appropriate. > > > > Requested by: nwhitehorn > > Tested by: nwhitehorn, pho > > Sponsored by: The FreeBSD Foundation > > MFC after: 2 weeks > > Hello Konstantin! > > Do you plan to MFC back this changes to 10-STABLE in these days? I decided to not merge the change. From owner-svn-src-all@freebsd.org Thu Dec 10 21:46:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC7299D7EB0; Thu, 10 Dec 2015 21:46:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8B4961156; Thu, 10 Dec 2015 21:46:22 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBALkLaQ062382; Thu, 10 Dec 2015 21:46:21 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBALkLwN062381; Thu, 10 Dec 2015 21:46:21 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201512102146.tBALkLwN062381@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 10 Dec 2015 21:46:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292066 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 21:46:22 -0000 Author: asomers Date: Thu Dec 10 21:46:21 2015 New Revision: 292066 URL: https://svnweb.freebsd.org/changeset/base/292066 Log: During vdev_geom_open, require that the vdev guids match the device's label except during split, add, or create operations. This fixes a bug where the wrong disk could be returned, and higher layers of ZFS would immediately eject it again. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c: o When opening by GUID, require both the pool and vdev GUIDs to match. While it is highly unlikely for two vdevs to have the same vdev GUIDs, the ZFS storage pool allocator only guarantees they are unique within a pool. o Modify the open behavior to: - If we are opening a vdev that hasn't previously been opened, open by path without checking GUIDs. - Otherwise, open by path and verify GUIDs. - If that fails, search all geom providers for a device with matching GUIDs. - If that fails, return ENOENT. Submitted by: gibbs, asomers Reviewed by: smh MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D4486 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Dec 10 16:44:40 2015 (r292065) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Dec 10 21:46:21 2015 (r292066) @@ -206,14 +206,12 @@ vdev_geom_detach(void *arg, int flag __u } } -static uint64_t -nvlist_get_guid(nvlist_t *list) +static void +nvlist_get_guids(nvlist_t *list, uint64_t *pguid, uint64_t *vguid) { - uint64_t value; - value = 0; - nvlist_lookup_uint64(list, ZPOOL_CONFIG_GUID, &value); - return (value); + nvlist_lookup_uint64(list, ZPOOL_CONFIG_GUID, vguid); + nvlist_lookup_uint64(list, ZPOOL_CONFIG_POOL_GUID, pguid); } static int @@ -268,7 +266,7 @@ vdev_geom_read_config(struct g_consumer size_t buflen; uint64_t psize; off_t offset, size; - uint64_t guid, state, txg; + uint64_t state, txg; int error, l, len; g_topology_assert_not(); @@ -282,7 +280,6 @@ vdev_geom_read_config(struct g_consumer size = sizeof(*label) + pp->sectorsize - ((sizeof(*label) - 1) % pp->sectorsize) - 1; - guid = 0; label = kmem_alloc(size, KM_SLEEP); buflen = sizeof(label->vl_vdev_phys.vp_nvlist); @@ -477,30 +474,29 @@ vdev_geom_read_pool_label(const char *na return (*count > 0 ? 0 : ENOENT); } -static uint64_t -vdev_geom_read_guid(struct g_consumer *cp) +static void +vdev_geom_read_guids(struct g_consumer *cp, uint64_t *pguid, uint64_t *vguid) { nvlist_t *config; - uint64_t guid; g_topology_assert_not(); - guid = 0; + *pguid = 0; + *vguid = 0; if (vdev_geom_read_config(cp, &config) == 0) { - guid = nvlist_get_guid(config); + nvlist_get_guids(config, pguid, vguid); nvlist_free(config); } - return (guid); } static struct g_consumer * -vdev_geom_attach_by_guid(uint64_t guid) +vdev_geom_attach_by_guids(uint64_t pool_guid, uint64_t vdev_guid) { struct g_class *mp; struct g_geom *gp, *zgp; struct g_provider *pp; struct g_consumer *cp, *zcp; - uint64_t pguid; + uint64_t pguid, vguid; g_topology_assert(); @@ -520,15 +516,15 @@ vdev_geom_attach_by_guid(uint64_t guid) if (vdev_geom_attach_taster(zcp, pp) != 0) continue; g_topology_unlock(); - pguid = vdev_geom_read_guid(zcp); + vdev_geom_read_guids(zcp, &pguid, &vguid); g_topology_lock(); vdev_geom_detach_taster(zcp); - if (pguid != guid) + if (pguid != pool_guid || vguid != vdev_guid) continue; cp = vdev_geom_attach(pp); if (cp == NULL) { - printf("ZFS WARNING: Unable to attach to %s.\n", - pp->name); + ZFS_LOG(1, "ZFS WARNING: Unable to " + "attach to %s.\n", pp->name); continue; } break; @@ -546,7 +542,7 @@ end: } static struct g_consumer * -vdev_geom_open_by_guid(vdev_t *vd) +vdev_geom_open_by_guids(vdev_t *vd) { struct g_consumer *cp; char *buf; @@ -555,7 +551,7 @@ vdev_geom_open_by_guid(vdev_t *vd) g_topology_assert(); ZFS_LOG(1, "Searching by guid [%ju].", (uintmax_t)vd->vdev_guid); - cp = vdev_geom_attach_by_guid(vd->vdev_guid); + cp = vdev_geom_attach_by_guids(spa_guid(vd->vdev_spa), vd->vdev_guid); if (cp != NULL) { len = strlen(cp->provider->name) + strlen("/dev/") + 1; buf = kmem_alloc(len, KM_SLEEP); @@ -564,10 +560,12 @@ vdev_geom_open_by_guid(vdev_t *vd) spa_strfree(vd->vdev_path); vd->vdev_path = buf; - ZFS_LOG(1, "Attach by guid [%ju] succeeded, provider %s.", + ZFS_LOG(1, "Attach by guid [%ju:%ju] succeeded, provider %s.", + (uintmax_t)spa_guid(vd->vdev_spa), (uintmax_t)vd->vdev_guid, vd->vdev_path); } else { - ZFS_LOG(1, "Search by guid [%ju] failed.", + ZFS_LOG(1, "Search by guid [%ju:%ju] failed.", + (uintmax_t)spa_guid(vd->vdev_spa), (uintmax_t)vd->vdev_guid); } @@ -579,7 +577,7 @@ vdev_geom_open_by_path(vdev_t *vd, int c { struct g_provider *pp; struct g_consumer *cp; - uint64_t guid; + uint64_t pguid, vguid; g_topology_assert(); @@ -591,14 +589,17 @@ vdev_geom_open_by_path(vdev_t *vd, int c if (cp != NULL && check_guid && ISP2(pp->sectorsize) && pp->sectorsize <= VDEV_PAD_SIZE) { g_topology_unlock(); - guid = vdev_geom_read_guid(cp); + vdev_geom_read_guids(cp, &pguid, &vguid); g_topology_lock(); - if (guid != vd->vdev_guid) { + if (pguid != spa_guid(vd->vdev_spa) || + vguid != vd->vdev_guid) { vdev_geom_detach(cp, 0); cp = NULL; ZFS_LOG(1, "guid mismatch for provider %s: " - "%ju != %ju.", vd->vdev_path, - (uintmax_t)vd->vdev_guid, (uintmax_t)guid); + "%ju:%ju != %ju:%ju.", vd->vdev_path, + (uintmax_t)spa_guid(vd->vdev_spa), + (uintmax_t)vd->vdev_guid, + (uintmax_t)pguid, (uintmax_t)vguid); } else { ZFS_LOG(1, "guid match for provider %s.", vd->vdev_path); @@ -632,23 +633,38 @@ vdev_geom_open(vdev_t *vd, uint64_t *psi g_topology_lock(); error = 0; - /* - * If we're creating or splitting a pool, just find the GEOM provider - * by its name and ignore GUID mismatches. - */ - if (vd->vdev_spa->spa_load_state == SPA_LOAD_NONE || - vd->vdev_spa->spa_splitting_newspa == B_TRUE) + if (vd->vdev_spa->spa_splitting_newspa || + (vd->vdev_prevstate == VDEV_STATE_UNKNOWN && + vd->vdev_spa->spa_load_state == SPA_LOAD_NONE)) { + /* + * We are dealing with a vdev that hasn't been previously + * opened (since boot), and we are not loading an + * existing pool configuration. This looks like a + * vdev add operation to a new or existing pool. + * Assume the user knows what he/she is doing and find + * GEOM provider by its name, ignoring GUID mismatches. + * + * XXPOLICY: It would be safer to only allow a device + * that is unlabeled or labeled but missing + * GUID information to be opened in this fashion, + * unless we are doing a split, in which case we + * should allow any guid. + */ cp = vdev_geom_open_by_path(vd, 0); - else { + } else { + /* + * Try using the recorded path for this device, but only + * accept it if its label data contains the expected GUIDs. + */ cp = vdev_geom_open_by_path(vd, 1); if (cp == NULL) { /* * The device at vd->vdev_path doesn't have the - * expected guid. The disks might have merely + * expected GUIDs. The disks might have merely * moved around so try all other GEOM providers - * to find one with the right guid. + * to find one with the right GUIDs. */ - cp = vdev_geom_open_by_guid(vd); + cp = vdev_geom_open_by_guids(vd); } } From owner-svn-src-all@freebsd.org Thu Dec 10 21:48:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D5289D6035 for ; Thu, 10 Dec 2015 21:48:14 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C9774137C for ; Thu, 10 Dec 2015 21:48:13 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by wmnn186 with SMTP id n186so5156250wmn.0 for ; Thu, 10 Dec 2015 13:48:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=uCq4ela8R4pFOvqfCbYr2OBUBtcK2gk0BMQo1Qk3oNw=; b=IjfTKkIw0xq8KvNHDFph0SG0JmHafZQrxt36KT2D3u3/tR0bWgG7w6tNtQMSn6jTyl 58Ogd9FEPdHNdvtFIOMGkaSLn5cLMgMfgiJers+NU4aZTmvD4A/EHhznHjdqS+b+Xe9v llAp79EAXLguTBQeKk5d9P3FeqgzElTDKX+uKdLyDun6Z99lgStz608elxmLTFF9khgw Fqav7tuViJs9nGHnK2RdphEj4nQNQ5frMcvao18ULa3XMsPOm0kQRi6yTOCwMh5AlWXg 83o6olxpCFaxC5w+rOV33dxdlcj5ygPeNcLQNY1yKW1rPL8nr5y08Ux+x9i19dnjLW3x AOeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=uCq4ela8R4pFOvqfCbYr2OBUBtcK2gk0BMQo1Qk3oNw=; b=muSrer2jXS7SjAyLWVFm/y8dmc2/XBUuaktLRTAtzeU4jjfCC0vZtRVrjFI8kdK9k5 cvD9Iy80OPOctj0hxxk1Ku/bLteFGkaV2LjLdz7tSE3stmcOPUrkkzNNTCF35elkmh5a o0ZH6mq3pKg8A5fYfVRXR0RMy75EK7kAkHg0x/u5FhgYLn4eS7bi+zugTy7tfoDwTT70 l4fUR7Dz5vwCZBbwejdVm+CMSNb5Im/P4zFZr7QgwkHjGqocPUYjcg5x6q3GXCqNk+Fy XX7KuKjSG98ONhc5AJ20oU2R9Y9K4P6p76OPjTXs6Zrl4cScrUE/RDLAYgcYzXGNzr2W +hfQ== X-Gm-Message-State: ALoCoQl1unO2WYDzMG9x4Rd+ycWXo45V1sl/TgFUP7PkPEPm9sXIgsT5pIqrhX8l1Aie1TS3h0s5REg5ujRP0bjZowYele/uaQbbS3yXszHOQ+xjpShGmdY= MIME-Version: 1.0 X-Received: by 10.28.87.84 with SMTP id l81mr1550523wmb.22.1449784091458; Thu, 10 Dec 2015 13:48:11 -0800 (PST) Received: by 10.194.85.167 with HTTP; Thu, 10 Dec 2015 13:48:11 -0800 (PST) In-Reply-To: <20151210213324.GF82577@kib.kiev.ua> References: <201511230709.tAN79Z4L062228@repo.freebsd.org> <20151210213324.GF82577@kib.kiev.ua> Date: Thu, 10 Dec 2015 22:48:11 +0100 Message-ID: Subject: Re: svn commit: r291171 - in head/sys: amd64/amd64 compat/ia32 i386/i386 kern sys From: Oliver Pinter To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 21:48:14 -0000 On Thursday, December 10, 2015, Konstantin Belousov wrote: > On Thu, Dec 10, 2015 at 10:18:19PM +0100, Oliver Pinter wrote: > > On Mon, Nov 23, 2015 at 8:09 AM, Konstantin Belousov > wrote: > > > Author: kib > > > Date: Mon Nov 23 07:09:35 2015 > > > New Revision: 291171 > > > URL: https://svnweb.freebsd.org/changeset/base/291171 > > > > > > Log: > > > Split kerne timekeep ABI structure vdso_sv_tk out of the struct > > > sysentvec. This allows the timekeep data to be shared between > similar > > > ABIs which cannot share sysentvec. > > > > > > Make the timekeep_push_vdso() tick callback to the timekeep > structures > > > instead of sysentvecs. If several sysentvec share the vdso_sv_tk > > > structure, we would update the userspace data several times on each > > > tick, without the change. > > > > > > Only allocate vdso_sv_tk in the exec_sysvec_init() sysinit when > > > sysentvec is marked with the new SV_TIMEKEEP flag. This saves > > > allocation and update of unneeded vdso_sv_tk for ABIs which do not > > > provide userspace gettimeofday yet, which are PowerPCs arches right > > > now. > > > > > > Make vdso_sv_tk allocator public, namely split out and export > > > alloc_sv_tk() and alloc_sv_tk_compat32(). ABIs which share timekeep > > > data now can allocate it manually and share as appropriate. > > > > > > Requested by: nwhitehorn > > > Tested by: nwhitehorn, pho > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 2 weeks > > > > Hello Konstantin! > > > > Do you plan to MFC back this changes to 10-STABLE in these days? > > I decided to not merge the change. > And if I'm not wrong, the rationale behind this decision is the type stability of struct sysvec / sysent. From owner-svn-src-all@freebsd.org Thu Dec 10 22:57:28 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 780909D765A; Thu, 10 Dec 2015 22:57:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30C4619E0; Thu, 10 Dec 2015 22:57:28 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBAMvRxv083368; Thu, 10 Dec 2015 22:57:27 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBAMvR8H083367; Thu, 10 Dec 2015 22:57:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201512102257.tBAMvR8H083367@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 10 Dec 2015 22:57:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292067 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 22:57:28 -0000 Author: cem Date: Thu Dec 10 22:57:27 2015 New Revision: 292067 URL: https://svnweb.freebsd.org/changeset/base/292067 Log: vm_page_replace: remove redundant radix lookup Remove redundant lookup of the old page from vm_page_replace. Verification that the old page exists is already done by vm_radix_replace. Submitted by: Ryan Libby Reviewed by: alc, kib Sponsored by: EMC / Isilon Storage Division Follow-up to: https://reviews.freebsd.org/D4326 Differential Revision: https://reviews.freebsd.org/D4471 Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Dec 10 21:46:21 2015 (r292066) +++ head/sys/vm/vm_page.c Thu Dec 10 22:57:27 2015 (r292067) @@ -1324,22 +1324,17 @@ vm_page_prev(vm_page_t m) vm_page_t vm_page_replace(vm_page_t mnew, vm_object_t object, vm_pindex_t pindex) { - vm_page_t mold, mpred; + vm_page_t mold; VM_OBJECT_ASSERT_WLOCKED(object); + KASSERT(mnew->object == NULL, + ("vm_page_replace: page already in object")); /* * This function mostly follows vm_page_insert() and * vm_page_remove() without the radix, object count and vnode * dance. Double check such functions for more comments. */ - mpred = vm_radix_lookup(&object->rtree, pindex); - KASSERT(mpred != NULL, - ("vm_page_replace: replacing page not present with pindex")); - mpred = TAILQ_PREV(mpred, respgs, listq); - if (mpred != NULL) - KASSERT(mpred->pindex < pindex, - ("vm_page_insert_after: mpred doesn't precede pindex")); mnew->object = object; mnew->pindex = pindex; @@ -1347,17 +1342,17 @@ vm_page_replace(vm_page_t mnew, vm_objec KASSERT(mold->queue == PQ_NONE, ("vm_page_replace: mold is on a paging queue")); - /* Detach the old page from the resident tailq. */ + /* Keep the resident page list in sorted order. */ + TAILQ_INSERT_AFTER(&object->memq, mold, mnew, listq); TAILQ_REMOVE(&object->memq, mold, listq); mold->object = NULL; vm_page_xunbusy(mold); - /* Insert the new page in the resident tailq. */ - if (mpred != NULL) - TAILQ_INSERT_AFTER(&object->memq, mpred, mnew, listq); - else - TAILQ_INSERT_HEAD(&object->memq, mnew, listq); + /* + * The object's resident_page_count does not change because we have + * swapped one page for another, but OBJ_MIGHTBEDIRTY. + */ if (pmap_page_is_write_mapped(mnew)) vm_object_set_writeable_dirty(object); return (mold); From owner-svn-src-all@freebsd.org Thu Dec 10 23:44:36 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F47B9D78E3; Thu, 10 Dec 2015 23:44:36 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 014A11162; Thu, 10 Dec 2015 23:44:35 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBANiZM6097837; Thu, 10 Dec 2015 23:44:35 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBANiYmA097827; Thu, 10 Dec 2015 23:44:34 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201512102344.tBANiYmA097827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 10 Dec 2015 23:44:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292068 - in stable/10: contrib/bmake contrib/bmake/PSD.doc contrib/bmake/lst.lib contrib/bmake/mk contrib/bmake/unit-tests usr.bin/bmake usr.bin/bmake/unit-tests X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Dec 2015 23:44:36 -0000 Author: sjg Date: Thu Dec 10 23:44:34 2015 New Revision: 292068 URL: https://svnweb.freebsd.org/changeset/base/292068 Log: Merge bmake-20151201 Added: stable/10/contrib/bmake/metachar.c - copied unchanged from r289842, head/contrib/bmake/metachar.c stable/10/contrib/bmake/metachar.h - copied unchanged from r289842, head/contrib/bmake/metachar.h stable/10/contrib/bmake/mk/cython.mk - copied unchanged from r281812, head/contrib/bmake/mk/cython.mk stable/10/contrib/bmake/mk/manifest.mk - copied unchanged from r281812, head/contrib/bmake/mk/manifest.mk stable/10/contrib/bmake/mk/mkopt.sh - copied, changed from r281812, head/contrib/bmake/mk/mkopt.sh stable/10/contrib/bmake/mk/whats.mk - copied unchanged from r281812, head/contrib/bmake/mk/whats.mk stable/10/contrib/bmake/unit-tests/comment.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/comment.exp stable/10/contrib/bmake/unit-tests/comment.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/comment.mk stable/10/contrib/bmake/unit-tests/cond1.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/cond1.exp stable/10/contrib/bmake/unit-tests/cond1.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/cond1.mk stable/10/contrib/bmake/unit-tests/cond2.exp - copied unchanged from r282740, head/contrib/bmake/unit-tests/cond2.exp stable/10/contrib/bmake/unit-tests/cond2.mk - copied, changed from r282740, head/contrib/bmake/unit-tests/cond2.mk stable/10/contrib/bmake/unit-tests/doterror.exp - copied, changed from r281812, head/contrib/bmake/unit-tests/doterror.exp stable/10/contrib/bmake/unit-tests/doterror.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/doterror.mk stable/10/contrib/bmake/unit-tests/dotwait.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/dotwait.exp stable/10/contrib/bmake/unit-tests/dotwait.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/dotwait.mk stable/10/contrib/bmake/unit-tests/error.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/error.exp stable/10/contrib/bmake/unit-tests/error.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/error.mk stable/10/contrib/bmake/unit-tests/escape.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/escape.exp stable/10/contrib/bmake/unit-tests/escape.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/escape.mk stable/10/contrib/bmake/unit-tests/export-all.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/export-all.exp stable/10/contrib/bmake/unit-tests/export-all.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/export-all.mk stable/10/contrib/bmake/unit-tests/export-env.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/export-env.exp stable/10/contrib/bmake/unit-tests/export-env.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/export-env.mk stable/10/contrib/bmake/unit-tests/export.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/export.exp stable/10/contrib/bmake/unit-tests/export.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/export.mk stable/10/contrib/bmake/unit-tests/forloop.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/forloop.exp stable/10/contrib/bmake/unit-tests/forloop.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/forloop.mk stable/10/contrib/bmake/unit-tests/forsubst.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/forsubst.exp stable/10/contrib/bmake/unit-tests/forsubst.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/forsubst.mk stable/10/contrib/bmake/unit-tests/hash.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/hash.exp stable/10/contrib/bmake/unit-tests/hash.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/hash.mk stable/10/contrib/bmake/unit-tests/impsrc.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/impsrc.exp stable/10/contrib/bmake/unit-tests/impsrc.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/impsrc.mk stable/10/contrib/bmake/unit-tests/misc.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/misc.exp stable/10/contrib/bmake/unit-tests/misc.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/misc.mk stable/10/contrib/bmake/unit-tests/moderrs.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/moderrs.exp stable/10/contrib/bmake/unit-tests/moderrs.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/moderrs.mk stable/10/contrib/bmake/unit-tests/modmatch.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/modmatch.exp stable/10/contrib/bmake/unit-tests/modmatch.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/modmatch.mk stable/10/contrib/bmake/unit-tests/modmisc.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/modmisc.exp stable/10/contrib/bmake/unit-tests/modmisc.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/modmisc.mk stable/10/contrib/bmake/unit-tests/modorder.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/modorder.exp stable/10/contrib/bmake/unit-tests/modorder.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/modorder.mk stable/10/contrib/bmake/unit-tests/modts.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/modts.exp stable/10/contrib/bmake/unit-tests/modts.mk - copied, changed from r281812, head/contrib/bmake/unit-tests/modts.mk stable/10/contrib/bmake/unit-tests/modword.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/modword.exp stable/10/contrib/bmake/unit-tests/modword.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/modword.mk stable/10/contrib/bmake/unit-tests/order.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/order.exp stable/10/contrib/bmake/unit-tests/order.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/order.mk stable/10/contrib/bmake/unit-tests/phony-end.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/phony-end.exp stable/10/contrib/bmake/unit-tests/phony-end.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/phony-end.mk stable/10/contrib/bmake/unit-tests/posix.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/posix.exp stable/10/contrib/bmake/unit-tests/posix.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/posix.mk stable/10/contrib/bmake/unit-tests/posix1.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/posix1.exp stable/10/contrib/bmake/unit-tests/posix1.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/posix1.mk stable/10/contrib/bmake/unit-tests/qequals.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/qequals.exp stable/10/contrib/bmake/unit-tests/qequals.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/qequals.mk stable/10/contrib/bmake/unit-tests/suffixes.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/suffixes.exp stable/10/contrib/bmake/unit-tests/suffixes.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/suffixes.mk stable/10/contrib/bmake/unit-tests/sunshcmd.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/sunshcmd.exp stable/10/contrib/bmake/unit-tests/sunshcmd.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/sunshcmd.mk stable/10/contrib/bmake/unit-tests/sysv.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/sysv.exp stable/10/contrib/bmake/unit-tests/sysv.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/sysv.mk stable/10/contrib/bmake/unit-tests/ternary.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/ternary.exp stable/10/contrib/bmake/unit-tests/ternary.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/ternary.mk stable/10/contrib/bmake/unit-tests/unexport-env.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/unexport-env.exp stable/10/contrib/bmake/unit-tests/unexport-env.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/unexport-env.mk stable/10/contrib/bmake/unit-tests/unexport.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/unexport.exp stable/10/contrib/bmake/unit-tests/unexport.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/unexport.mk stable/10/contrib/bmake/unit-tests/varcmd.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/varcmd.exp stable/10/contrib/bmake/unit-tests/varcmd.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/varcmd.mk stable/10/contrib/bmake/unit-tests/varmisc.exp - copied, changed from r281812, head/contrib/bmake/unit-tests/varmisc.exp stable/10/contrib/bmake/unit-tests/varmisc.mk - copied, changed from r281812, head/contrib/bmake/unit-tests/varmisc.mk stable/10/contrib/bmake/unit-tests/varshell.exp - copied unchanged from r281812, head/contrib/bmake/unit-tests/varshell.exp stable/10/contrib/bmake/unit-tests/varshell.mk - copied unchanged from r281812, head/contrib/bmake/unit-tests/varshell.mk Deleted: stable/10/contrib/bmake/unit-tests/comment stable/10/contrib/bmake/unit-tests/cond1 stable/10/contrib/bmake/unit-tests/doterror stable/10/contrib/bmake/unit-tests/dotwait stable/10/contrib/bmake/unit-tests/error stable/10/contrib/bmake/unit-tests/export stable/10/contrib/bmake/unit-tests/export-all stable/10/contrib/bmake/unit-tests/export-env stable/10/contrib/bmake/unit-tests/forloop stable/10/contrib/bmake/unit-tests/forsubst stable/10/contrib/bmake/unit-tests/hash stable/10/contrib/bmake/unit-tests/misc stable/10/contrib/bmake/unit-tests/moderrs stable/10/contrib/bmake/unit-tests/modmatch stable/10/contrib/bmake/unit-tests/modmisc stable/10/contrib/bmake/unit-tests/modorder stable/10/contrib/bmake/unit-tests/modts stable/10/contrib/bmake/unit-tests/modword stable/10/contrib/bmake/unit-tests/order stable/10/contrib/bmake/unit-tests/phony-end stable/10/contrib/bmake/unit-tests/posix stable/10/contrib/bmake/unit-tests/qequals stable/10/contrib/bmake/unit-tests/sunshcmd stable/10/contrib/bmake/unit-tests/sysv stable/10/contrib/bmake/unit-tests/ternary stable/10/contrib/bmake/unit-tests/test.exp stable/10/contrib/bmake/unit-tests/unexport stable/10/contrib/bmake/unit-tests/unexport-env stable/10/contrib/bmake/unit-tests/varcmd Modified: stable/10/contrib/bmake/ChangeLog stable/10/contrib/bmake/FILES stable/10/contrib/bmake/Makefile stable/10/contrib/bmake/PSD.doc/Makefile stable/10/contrib/bmake/PSD.doc/tutorial.ms stable/10/contrib/bmake/arch.c stable/10/contrib/bmake/bmake.1 stable/10/contrib/bmake/bmake.cat1 stable/10/contrib/bmake/boot-strap stable/10/contrib/bmake/compat.c stable/10/contrib/bmake/cond.c stable/10/contrib/bmake/config.h.in stable/10/contrib/bmake/configure stable/10/contrib/bmake/configure.in stable/10/contrib/bmake/for.c stable/10/contrib/bmake/job.c stable/10/contrib/bmake/lst.h stable/10/contrib/bmake/lst.lib/lstInt.h stable/10/contrib/bmake/lst.lib/lstRemove.c stable/10/contrib/bmake/machine.sh stable/10/contrib/bmake/main.c stable/10/contrib/bmake/make-bootstrap.sh.in stable/10/contrib/bmake/make.1 stable/10/contrib/bmake/make.c stable/10/contrib/bmake/make.h stable/10/contrib/bmake/meta.c stable/10/contrib/bmake/mk/ChangeLog stable/10/contrib/bmake/mk/FILES stable/10/contrib/bmake/mk/auto.dep.mk stable/10/contrib/bmake/mk/auto.obj.mk stable/10/contrib/bmake/mk/autodep.mk stable/10/contrib/bmake/mk/dep.mk stable/10/contrib/bmake/mk/dirdeps.mk stable/10/contrib/bmake/mk/doc.mk stable/10/contrib/bmake/mk/gendirdeps.mk stable/10/contrib/bmake/mk/host-target.mk stable/10/contrib/bmake/mk/init.mk stable/10/contrib/bmake/mk/install-mk stable/10/contrib/bmake/mk/lib.mk stable/10/contrib/bmake/mk/links.mk stable/10/contrib/bmake/mk/meta.autodep.mk stable/10/contrib/bmake/mk/meta.stage.mk stable/10/contrib/bmake/mk/meta.subdir.mk stable/10/contrib/bmake/mk/meta.sys.mk stable/10/contrib/bmake/mk/meta2deps.py stable/10/contrib/bmake/mk/meta2deps.sh stable/10/contrib/bmake/mk/mk-files.txt stable/10/contrib/bmake/mk/own.mk stable/10/contrib/bmake/mk/rst2htm.mk stable/10/contrib/bmake/mk/sys.dependfile.mk stable/10/contrib/bmake/mk/sys.mk stable/10/contrib/bmake/nonints.h stable/10/contrib/bmake/os.sh stable/10/contrib/bmake/parse.c stable/10/contrib/bmake/suff.c stable/10/contrib/bmake/targ.c stable/10/contrib/bmake/unit-tests/Makefile.in stable/10/contrib/bmake/var.c stable/10/usr.bin/bmake/Makefile stable/10/usr.bin/bmake/config.h stable/10/usr.bin/bmake/unit-tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/bmake/ChangeLog ============================================================================== --- stable/10/contrib/bmake/ChangeLog Thu Dec 10 22:57:27 2015 (r292067) +++ stable/10/contrib/bmake/ChangeLog Thu Dec 10 23:44:34 2015 (r292068) @@ -1,8 +1,164 @@ +2015-12-01 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151201 + Merge with NetBSD make, pick up + o cond.c: CondCvtArg: avoid access beyond end of empty buffer. + o meta.c: meta_oodate: use lstat(2) for checking link target + in case it is a symlink. + o var.c: avoid calling brk_string and Var_Export1 with empty + strings. + +2015-11-26 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151126 + Merge with NetBSD make, pick up + o parse.c: ParseTrackInput don't access beyond + end of old value. + +2015-10-22 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151022 + + * Add support for BSD/OS which lacks inttypes.h + and really needs sys/param.h for sys/sysctl.h + also 'type' is not a shell builtin. + + * var.c: eliminate uint32_t and need for inttypes.h + + * main.c: PrintOnError flush stdout before run .ERROR + + * parse.c: cope with _SC_PAGESIZE not being defined. + + +2015-10-20 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151020 + Merge with NetBSD make, pick up + o var.c: fix uninitialized var + +2015-10-12 Simon J. Gerraty + + * var.c: the conditional expressions used with ':?' can be + expensive, if already discarding do not evaluate or expand + anything. + +2015-10-10 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151010 + Merge with NetBSD make, pick up + o Add Boolean wantit flag to Var_Subst and Var_Parse + when FALSE we know we are discarding the result and can + skip operations like Cmd_Exec. + +2015-10-09 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20151009 + Merge with NetBSD make, pick up + o var.c: don't check for NULL before free() + o meta.c: meta_oodate, do not hard code ignore of makeDependfile + +2015-09-10 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20150910 + Merge with NetBSD make, pick up + o main.c: with -w print Enter/Leaving messages for objdir too + if necessary. + o centralize shell metachar handling + + * FILES: add metachar.[ch] + +2015-06-06 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20150606 + Merge with NetBSD make, pick up + o make.1: document .OBJDIR target + +2015-05-05 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20150505 + Merge with NetBSD make, pick up + o cond.c: be strict about lhs of comparison when evaluating .if + but less so when called from variable expansion. + o unit-tests/cond2.mk: test various error conditions + +2015-05-04 Simon J. Gerraty + + * machine.sh (MACHINE): Add Bitrig + patch from joerg@netbsd.org + +2015-04-18 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20150418 + Merge with NetBSD make, pick up + o job.c: use memmove() rather than memcpy() + + * unit-tests/varshell.mk: SunOS cannot handle the TERMINATED_BY_SIGNAL + case, so skip it. + +2015-04-11 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20150411 + bump version - only mk/ changes. + +2015-04-10 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20150410 + Merge with NetBSD make, pick up + o document different handling of '-' in jobs mode vs compat + o fix jobs mode so that '-' only applies to whole job + when shell lacks hasErrCtl + o meta.c: use separate vars to track lcwd and latestdir (read) + per process + +2015-04-01 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20150401 + Merge with NetBSD make, pick up + o meta.c: close meta file in child + + * Makefile: use BINDIR.bmake if set. + Same for MANDIR and SHAREDIR + Handy for testing release candidates + in various environments. + +2015-03-26 Simon J. Gerraty + + * move initialization of savederr to block where it is used + to avoid spurious warning from gcc5 + +2014-11-11 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20141111 + just a cooler number + +2014-11-05 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20141105 + Merge with NetBSD make, pick up + o revert major overhaul of suffix handling + and POSIX compliance - too much breakage + and impossible to make backwards compatible. + o we still have the new unit test structure which is ok. + o meta.c ensure "-- filemon" is at start of line. + +2014-09-17 Simon J. Gerraty + + * configure.in: test that result of getconf PATH_MAX is numeric + and discard if not. Apparently needed for Hurd. + +2014-08-30 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20140830 + Merge with NetBSD make, pick up + o major overhaul of suffix handling + o improved POSIX compliance + o overhauled unit-tests + 2014-06-20 Simon J. Gerraty * Makefile (MAKE_VERSION): 20140620 Merge with NetBSD make, pick up - o var.c return varNoError rather than var_Error for ::= modidiers. + o var.c return varNoError rather than var_Error for ::= modifiers. 2014-05-22 Simon J. Gerraty Modified: stable/10/contrib/bmake/FILES ============================================================================== --- stable/10/contrib/bmake/FILES Thu Dec 10 22:57:27 2015 (r292067) +++ stable/10/contrib/bmake/FILES Thu Dec 10 23:44:34 2015 (r292068) @@ -71,6 +71,8 @@ make_malloc.h makefile.in meta.c meta.h +metachar.c +metachar.h missing/sys/cdefs.h mkdeps.sh nonints.h @@ -92,35 +94,76 @@ targ.c trace.c trace.h unit-tests/Makefile.in -unit-tests/comment -unit-tests/cond1 -unit-tests/doterror -unit-tests/dotwait -unit-tests/error -unit-tests/export -unit-tests/export-all -unit-tests/export-env -unit-tests/forloop -unit-tests/forsubst -unit-tests/hash -unit-tests/misc -unit-tests/moderrs -unit-tests/modmatch -unit-tests/modmisc -unit-tests/modorder -unit-tests/modts -unit-tests/modword -unit-tests/order -unit-tests/phony-end -unit-tests/posix -unit-tests/qequals -unit-tests/sunshcmd -unit-tests/sysv -unit-tests/ternary -unit-tests/test.exp -unit-tests/unexport -unit-tests/unexport-env -unit-tests/varcmd +unit-tests/comment.exp +unit-tests/comment.mk +unit-tests/cond1.exp +unit-tests/cond1.mk +unit-tests/cond2.exp +unit-tests/cond2.mk +unit-tests/doterror.exp +unit-tests/doterror.mk +unit-tests/dotwait.exp +unit-tests/dotwait.mk +unit-tests/error.exp +unit-tests/error.mk +unit-tests/escape.exp +unit-tests/escape.mk +unit-tests/export-all.exp +unit-tests/export-all.mk +unit-tests/export-env.exp +unit-tests/export-env.mk +unit-tests/export.exp +unit-tests/export.mk +unit-tests/forloop.exp +unit-tests/forloop.mk +unit-tests/forsubst.exp +unit-tests/forsubst.mk +unit-tests/hash.exp +unit-tests/hash.mk +unit-tests/impsrc.exp +unit-tests/impsrc.mk +unit-tests/misc.exp +unit-tests/misc.mk +unit-tests/moderrs.exp +unit-tests/moderrs.mk +unit-tests/modmatch.exp +unit-tests/modmatch.mk +unit-tests/modmisc.exp +unit-tests/modmisc.mk +unit-tests/modorder.exp +unit-tests/modorder.mk +unit-tests/modts.exp +unit-tests/modts.mk +unit-tests/modword.exp +unit-tests/modword.mk +unit-tests/order.exp +unit-tests/order.mk +unit-tests/phony-end.exp +unit-tests/phony-end.mk +unit-tests/posix.exp +unit-tests/posix.mk +unit-tests/posix1.exp +unit-tests/posix1.mk +unit-tests/qequals.exp +unit-tests/qequals.mk +unit-tests/suffixes.exp +unit-tests/suffixes.mk +unit-tests/sunshcmd.exp +unit-tests/sunshcmd.mk +unit-tests/sysv.exp +unit-tests/sysv.mk +unit-tests/ternary.exp +unit-tests/ternary.mk +unit-tests/unexport-env.exp +unit-tests/unexport-env.mk +unit-tests/unexport.exp +unit-tests/unexport.mk +unit-tests/varcmd.exp +unit-tests/varcmd.mk +unit-tests/varmisc.exp +unit-tests/varmisc.mk +unit-tests/varshell.exp +unit-tests/varshell.mk util.c var.c wait.h Modified: stable/10/contrib/bmake/Makefile ============================================================================== --- stable/10/contrib/bmake/Makefile Thu Dec 10 22:57:27 2015 (r292067) +++ stable/10/contrib/bmake/Makefile Thu Dec 10 23:44:34 2015 (r292068) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.27 2014/06/20 14:51:54 sjg Exp $ +# $Id: Makefile,v 1.48 2015/12/02 00:36:42 sjg Exp $ # Base version on src date -MAKE_VERSION= 20140620 +MAKE_VERSION= 20151201 PROG= bmake @@ -18,6 +18,7 @@ SRCS= \ make.c \ make_malloc.c \ meta.c \ + metachar.c \ parse.c \ str.c \ strlist.c \ @@ -94,7 +95,7 @@ SUBDIR+= unit-tests # we skip a lot of this when building as part of FreeBSD etc. # list of OS's which are derrived from BSD4.4 -BSD44_LIST= NetBSD FreeBSD OpenBSD DragonFly +BSD44_LIST= NetBSD FreeBSD OpenBSD DragonFly MirBSD Bitrig # we are... OS!= uname -s # are we 4.4BSD ? @@ -180,9 +181,9 @@ COPTS.parse.c += -Wno-format-nonliteral COPTS.var.c += -Wno-format-nonliteral # Force these -SHAREDIR= ${prefix}/share -BINDIR= ${prefix}/bin -MANDIR= ${SHAREDIR}/man +SHAREDIR= ${SHAREDIR.bmake:U${prefix}/share} +BINDIR= ${BINDIR.bmake:U${prefix}/bin} +MANDIR= ${MANDIR.bmake:U${SHAREDIR}/man} .if !exists(.depend) ${OBJS}: config.h Modified: stable/10/contrib/bmake/PSD.doc/Makefile ============================================================================== --- stable/10/contrib/bmake/PSD.doc/Makefile Thu Dec 10 22:57:27 2015 (r292067) +++ stable/10/contrib/bmake/PSD.doc/Makefile Thu Dec 10 23:44:34 2015 (r292068) @@ -1,8 +1,10 @@ -# $NetBSD: Makefile,v 1.2 1995/06/14 15:20:23 christos Exp $ +# $NetBSD: Makefile,v 1.4 2014/07/05 19:22:43 dholland Exp $ # @(#)Makefile 8.1 (Berkeley) 8/14/93 -DIR= psd/12.make +SECTION=reference/ref1 +ARTICLE=make SRCS= tutorial.ms MACROS= -ms +EXTRAHTMLFILES=make1.png make2.png .include Modified: stable/10/contrib/bmake/PSD.doc/tutorial.ms ============================================================================== --- stable/10/contrib/bmake/PSD.doc/tutorial.ms Thu Dec 10 22:57:27 2015 (r292067) +++ stable/10/contrib/bmake/PSD.doc/tutorial.ms Thu Dec 10 23:44:34 2015 (r292068) @@ -1,4 +1,4 @@ -.\" $NetBSD: tutorial.ms,v 1.11 2011/08/18 15:19:30 sjg Exp $ +.\" $NetBSD: tutorial.ms,v 1.12 2014/09/30 21:33:14 christos Exp $ .\" Copyright (c) 1988, 1989, 1993 .\" The Regents of the University of California. All rights reserved. .\" @@ -67,6 +67,16 @@ .\" .EH 'PSD:12-%''PMake \*- A Tutorial' .OH 'PMake \*- A Tutorial''PSD:12-%' +.\" Ix is an indexing macro similar to .IX but I've disabled it for now +.\" Since that would require 2 passes and I am not in the mood for that. +.de Ix +.. +.\" Rd is section (region) define and Rm is region mention? Again disable for +.\" now. +.de Rd +.. +.de Rm +.. .\" xH is a macro to provide numbered headers that are automatically stuffed .\" into a table-of-contents, properly indented, etc. If the first argument .\" is numeric, it is taken as the depth for numbering (as for .NH), else Modified: stable/10/contrib/bmake/arch.c ============================================================================== --- stable/10/contrib/bmake/arch.c Thu Dec 10 22:57:27 2015 (r292067) +++ stable/10/contrib/bmake/arch.c Thu Dec 10 23:44:34 2015 (r292068) @@ -1,4 +1,4 @@ -/* $NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $ */ +/* $NetBSD: arch.c,v 1.64 2015/10/11 04:51:24 sjg Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $"; +static char rcsid[] = "$NetBSD: arch.c,v 1.64 2015/10/11 04:51:24 sjg Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94"; #else -__RCSID("$NetBSD: arch.c,v 1.63 2012/06/12 19:21:50 joerg Exp $"); +__RCSID("$NetBSD: arch.c,v 1.64 2015/10/11 04:51:24 sjg Exp $"); #endif #endif /* not lint */ #endif @@ -310,7 +310,7 @@ Arch_ParseArchive(char **linePtr, Lst no void *freeIt; char *result; - result = Var_Parse(cp, ctxt, TRUE, &length, &freeIt); + result = Var_Parse(cp, ctxt, TRUE, TRUE, &length, &freeIt); if (freeIt) free(freeIt); if (result == var_Error) { @@ -325,7 +325,7 @@ Arch_ParseArchive(char **linePtr, Lst no *cp++ = '\0'; if (subLibName) { - libName = Var_Subst(NULL, libName, ctxt, TRUE); + libName = Var_Subst(NULL, libName, ctxt, TRUE, TRUE); } @@ -351,7 +351,7 @@ Arch_ParseArchive(char **linePtr, Lst no void *freeIt; char *result; - result = Var_Parse(cp, ctxt, TRUE, &length, &freeIt); + result = Var_Parse(cp, ctxt, TRUE, TRUE, &length, &freeIt); if (freeIt) free(freeIt); if (result == var_Error) { @@ -404,7 +404,7 @@ Arch_ParseArchive(char **linePtr, Lst no char *oldMemName = memName; size_t sz; - memName = Var_Subst(NULL, memName, ctxt, TRUE); + memName = Var_Subst(NULL, memName, ctxt, TRUE, TRUE); /* * Now form an archive spec and recurse to deal with nested Modified: stable/10/contrib/bmake/bmake.1 ============================================================================== --- stable/10/contrib/bmake/bmake.1 Thu Dec 10 22:57:27 2015 (r292067) +++ stable/10/contrib/bmake/bmake.1 Thu Dec 10 23:44:34 2015 (r292068) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.229 2014/01/19 10:23:29 apb Exp $ +.\" $NetBSD: make.1,v 1.249 2015/06/05 07:33:40 wiz Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" from: @(#)make.1 8.4 (Berkeley) 3/19/94 .\" -.Dd February 14, 2014 +.Dd June 4, 2015 .Dt MAKE 1 .Os .Sh NAME @@ -209,8 +209,6 @@ Force the option to print raw values of variables. .It Ar v Print debugging information about variable assignment. -.It Ar w -Print entering and leaving directory messages, pre and post processing. .It Ar x Run shell commands with .Fl x @@ -352,6 +350,8 @@ contains a then the value will be expanded before printing. .It Fl W Treat any warnings during makefile parsing as errors. +.It Fl w +Print entering and leaving directory messages, pre and post processing. .It Fl X Don't export variables passed on the command line to the environment individually. @@ -441,17 +441,29 @@ The value need not necessarily be used to describe existing files. Expansion is in directory order, not alphabetically as done in the shell. .Sh SHELL COMMANDS -Each target may have associated with it a series of shell commands, normally +Each target may have associated with it one or more lines of shell +commands, normally used to create the target. -Each of the commands in this script +Each of the lines in this script .Em must be preceded by a tab. -While any target may appear on a dependency line, only one of these -dependencies may be followed by a creation script, unless the +(For historical reasons, spaces are not accepted.) +While targets can appear in many dependency lines if desired, by +default only one of these rules may be followed by a creation +script. +If the .Ql Ic \&:: -operator is used. +operator is used, however, all rules may include scripts and the +scripts are executed in the order found. .Pp -If the first characters of the command line are any combination of +Each line is treated as a separate shell command, unless the end of +line is escaped with a backslash +.Pq Ql \e +in which case that line and the next are combined. +.\" The escaped newline is retained and passed to the shell, which +.\" normally ignores it. +.\" However, the tab at the beginning of the following line is removed. +If the first characters of the command are any combination of .Ql Ic @ , .Ql Ic + , or @@ -469,6 +481,7 @@ This is similar to the effect of the .MA except that the effect can be limited to a single line of a script. A .Ql Ic \- +in compatibility mode causes any non-zero exit status of the command line to be ignored. .Pp When @@ -477,22 +490,21 @@ is run in jobs mode with .Fl j Ar max_jobs , the entire script for the target is fed to a single instance of the shell. -.Pp In compatibility (non-jobs) mode, each command is run in a separate process. If the command contains any shell meta characters .Pq Ql #=|^(){};&<>*?[]:$`\e\en -it will be passed to the shell, otherwise +it will be passed to the shell; otherwise .Nm will attempt direct execution. -.Pp -Since -.Nm -will -.Xr chdir 2 -to -.Ql Va .OBJDIR -before executing any targets, each child process -starts with that as its current working directory. +If a line starts with +.Ql Ic \- +and the shell has ErrCtl enabled then failure of the command line +will be ignored as in compatibility mode. +Otherwise +.Ql Ic \- +affects the entire job; +the script will stop at the first command line that fails, +but the target will not be deemed to have failed. .Pp Makefiles should be written so that the mode of .Nm @@ -500,20 +512,32 @@ operation does not change their behavior For example, any command which needs to use .Dq cd or -.Dq chdir , -without side-effect should be put in parenthesis: +.Dq chdir +without potentially changing the directory for subsequent commands +should be put in parentheses so it executes in a subshell. +To force the use of one shell, escape the line breaks so as to make +the whole script one command. +For example: .Bd -literal -offset indent - avoid-chdir-side-effects: @echo Building $@ in `pwd` - @(cd ${.CURDIR} && ${.MAKE} $@) + @(cd ${.CURDIR} && ${MAKE} $@) @echo Back in `pwd` ensure-one-shell-regardless-of-mode: - @echo Building $@ in `pwd`; \\ - (cd ${.CURDIR} && ${.MAKE} $@); \\ + @echo Building $@ in `pwd`; \e + (cd ${.CURDIR} && ${MAKE} $@); \e echo Back in `pwd` .Ed +.Pp +Since +.Nm +will +.Xr chdir 2 +to +.Ql Va .OBJDIR +before executing any targets, each child process +starts with that as its current working directory. .Sh VARIABLE ASSIGNMENTS Variables in make are much like variables in the shell, and, by tradition, consist of all upper-case letters. @@ -624,13 +648,19 @@ Variables defined in the makefile or in Variables defined as part of the command line. .It Local variables Variables that are defined specific to a certain target. +.El +.Pp +Local variables are all built in and their values vary magically from +target to target. +It is not currently possible to define new local variables. The seven local variables are as follows: -.Bl -tag -width ".ARCHIVE" +.Bl -tag -width ".ARCHIVE" -offset indent .It Va .ALLSRC The list of all sources for this target; also known as .Ql Va \&\*[Gt] . .It Va .ARCHIVE -The name of the archive file. +The name of the archive file; also known as +.Ql Va \&! . .It Va .IMPSRC In suffix-transformation rules, the name/path of the source from which the target is to be transformed (the @@ -639,7 +669,8 @@ source); also known as .Ql Va \&\*[Lt] . It is not defined in explicit rules. .It Va .MEMBER -The name of the archive member. +The name of the archive member; also known as +.Ql Va % . .It Va .OODATE The list of sources for this target that were deemed out-of-date; also known as @@ -648,31 +679,41 @@ known as The file prefix of the target, containing only the file portion, no suffix or preceding directory components; also known as .Ql Va * . +The suffix must be one of the known suffixes declared with +.Ic .SUFFIXES +or it will not be recognized. .It Va .TARGET The name of the target; also known as .Ql Va @ . .El .Pp The shorter forms -.Ql Va @ , +.Ql ( Va \*[Gt] , +.Ql Va \&! , +.Ql Va \*[Lt] , +.Ql Va % , .Ql Va \&? , -.Ql Va \&\*[Lt] , -.Ql Va \&\*[Gt] , +.Ql Va * , and -.Ql Va * +.Ql Va @ ) are permitted for backward -compatibility with historical makefiles and are not recommended. -The six variables -.Ql Va "@F" , -.Ql Va "@D" , -.Ql Va "\*[Lt]F" , -.Ql Va "\*[Lt]D" , -.Ql Va "*F" , +compatibility with historical makefiles and legacy POSIX make and are +not recommended. +.Pp +Variants of these variables with the punctuation followed immediately by +.Ql D +or +.Ql F , +e.g. +.Ql Va $(@D) , +are legacy forms equivalent to using the +.Ql :H and -.Ql Va "*D" -are permitted for compatibility with +.Ql :T +modifiers. +These forms are accepted for compatibility with .At V -makefiles and are not recommended. +makefiles and POSIX but are not recommended. .Pp Four of the local variables may be used in sources on dependency lines because they expand to the proper value for each target on the line. @@ -682,7 +723,6 @@ These variables are .Ql Va .ARCHIVE , and .Ql Va .MEMBER . -.El .Ss Additional built-in variables In addition, .Nm @@ -953,14 +993,15 @@ This is especially useful with .Ql Ev MAKEOBJDIR . .Pp .Ql Va .OBJDIR -may be modified in the makefile as a global variable. +may be modified in the makefile via the special target +.Ql Ic .OBJDIR . In all cases, .Nm will .Xr chdir 2 -to +to the specified directory if it exists, and set .Ql Va .OBJDIR -and set +and .Ql Ev PWD to that directory before executing any targets. . @@ -1961,6 +2002,15 @@ Disable parallel mode. Synonym for .Ic .NOTPARALLEL , for compatibility with other pmake variants. +.It Ic .OBJDIR +The source is a new value for +.Ql Va .OBJDIR . +If it exists, +.Nm +will +.Xr chdir 2 +to it and update the value of +.Ql Va .OBJDIR . .It Ic .ORDER The named targets are made in sequence. This ordering does not add targets to the list of targets to be made. @@ -2119,19 +2169,87 @@ system makefile system makefile directory .El .Sh COMPATIBILITY -The basic make syntax is compatible between different versions of make, +The basic make syntax is compatible between different versions of make; however the special variables, variable modifiers and conditionals are not. -.Pp -The way that parallel makes are scheduled changed in -NetBSD 4.0 -so that .ORDER and .WAIT apply recursively to the dependent nodes. -The algorithms used may change again in the future. +.Ss Older versions +An incomplete list of changes in older versions of +.Nm : .Pp The way that .for loop variables are substituted changed after NetBSD 5.0 so that they still appear to be variable expansions. In particular this stops them being treated as syntax, and removes some obscure problems using them in .if statements. +.Pp +The way that parallel makes are scheduled changed in +NetBSD 4.0 +so that .ORDER and .WAIT apply recursively to the dependent nodes. +The algorithms used may change again in the future. +.Ss Other make dialects +Other make dialects (GNU make, SVR4 make, POSIX make, etc.) do not +support most of the features of +.Nm +as described in this manual. +Most notably: +.Bl -bullet -offset indent +.It +The +.Ic .WAIT +and +.Ic .ORDER +declarations and most functionality pertaining to parallelization. +(GNU make supports parallelization but lacks these features needed to +control it effectively.) +.It +Directives, including for loops and conditionals and most of the +forms of include files. +(GNU make has its own incompatible and less powerful syntax for +conditionals.) +.It +All built-in variables that begin with a dot. +.It +Most of the special sources and targets that begin with a dot, +with the notable exception of +.Ic .PHONY , +.Ic .PRECIOUS , +and +.Ic .SUFFIXES . +.It +Variable modifiers, except for the +.Dl :old=new +string substitution, which does not portably support globbing with +.Ql % +and historically only works on declared suffixes. +.It +The +.Ic $> +variable even in its short form; most makes support this functionality +but its name varies. +.El +.Pp +Some features are somewhat more portable, such as assignment with +.Ic += , +.Ic ?= , +and +.Ic != . +The +.Ic .PATH +functionality is based on an older feature +.Ic VPATH +found in GNU make and many versions of SVR4 make; however, +historically its behavior is too ill-defined (and too buggy) to rely +upon. +.Pp +The +.Ic $@ +and +.Ic $< +variables are more or less universally portable, as is the +.Ic $(MAKE) +variable. +Basic use of suffix rules (for files only in the current directory, +not trying to chain transformations together, etc.) is also reasonably +portable. .Sh SEE ALSO .Xr mkdep 1 .Sh HISTORY Modified: stable/10/contrib/bmake/bmake.cat1 ============================================================================== --- stable/10/contrib/bmake/bmake.cat1 Thu Dec 10 22:57:27 2015 (r292067) +++ stable/10/contrib/bmake/bmake.cat1 Thu Dec 10 23:44:34 2015 (r292068) @@ -122,9 +122,6 @@ DDEESSCCRRIIPPTTIIOONN _v Print debugging information about variable assignment. - _w Print entering and leaving directory messages, pre and - post processing. - _x Run shell commands with --xx so the actual commands are printed as they are executed. @@ -221,6 +218,9 @@ DDEESSCCRRIIPPTTIIOONN --WW Treat any warnings during makefile parsing as errors. + --ww Print entering and leaving directory messages, pre and post pro- + cessing. + --XX Don't export variables passed on the command line to the environ- ment individually. Variables passed on the command line are still exported via the _M_A_K_E_F_L_A_G_S environment variable. This @@ -273,46 +273,55 @@ FFIILLEE DDEEPPEENNDDEENNCC done in the shell. SSHHEELLLL CCOOMMMMAANNDDSS - Each target may have associated with it a series of shell commands, nor- - mally used to create the target. Each of the commands in this script - _m_u_s_t be preceded by a tab. While any target may appear on a dependency - line, only one of these dependencies may be followed by a creation - script, unless the `::::' operator is used. - - If the first characters of the command line are any combination of `@@', - `++', or `--', the command is treated specially. A `@@' causes the command - not to be echoed before it is executed. A `++' causes the command to be - executed even when --nn is given. This is similar to the effect of the - .MAKE special source, except that the effect can be limited to a single - line of a script. A `--' causes any non-zero exit status of the command - line to be ignored. + Each target may have associated with it one or more lines of shell com- + mands, normally used to create the target. Each of the lines in this + script _m_u_s_t be preceded by a tab. (For historical reasons, spaces are + not accepted.) While targets can appear in many dependency lines if + desired, by default only one of these rules may be followed by a creation + script. If the `::::' operator is used, however, all rules may include + scripts and the scripts are executed in the order found. + + Each line is treated as a separate shell command, unless the end of line + is escaped with a backslash (`\') in which case that line and the next + are combined. If the first characters of the command are any combination + of `@@', `++', or `--', the command is treated specially. A `@@' causes the + command not to be echoed before it is executed. A `++' causes the command + to be executed even when --nn is given. This is similar to the effect of + the .MAKE special source, except that the effect can be limited to a sin- + gle line of a script. A `--' in compatibility mode causes any non-zero + exit status of the command line to be ignored. When bbmmaakkee is run in jobs mode with --jj _m_a_x___j_o_b_s, the entire script for - the target is fed to a single instance of the shell. - - In compatibility (non-jobs) mode, each command is run in a separate - process. If the command contains any shell meta characters - (`#=|^(){};&<>*?[]:$`\\n') it will be passed to the shell, otherwise - bbmmaakkee will attempt direct execution. - - Since bbmmaakkee will chdir(2) to `_._O_B_J_D_I_R' before executing any targets, each - child process starts with that as its current working directory. + the target is fed to a single instance of the shell. In compatibility + (non-jobs) mode, each command is run in a separate process. If the com- + mand contains any shell meta characters (`#=|^(){};&<>*?[]:$`\\n') it + will be passed to the shell; otherwise bbmmaakkee will attempt direct execu- + tion. If a line starts with `--' and the shell has ErrCtl enabled then + failure of the command line will be ignored as in compatibility mode. + Otherwise `--' affects the entire job; the script will stop at the first + command line that fails, but the target will not be deemed to have + failed. Makefiles should be written so that the mode of bbmmaakkee operation does not change their behavior. For example, any command which needs to use - ``cd'' or ``chdir'', without side-effect should be put in parenthesis: - + ``cd'' or ``chdir'' without potentially changing the directory for subse- + quent commands should be put in parentheses so it executes in a subshell. + To force the use of one shell, escape the line breaks so as to make the + whole script one command. For example: avoid-chdir-side-effects: @echo Building $@ in `pwd` - @(cd ${.CURDIR} && ${.MAKE} $@) + @(cd ${.CURDIR} && ${MAKE} $@) @echo Back in `pwd` ensure-one-shell-regardless-of-mode: @echo Building $@ in `pwd`; \ - (cd ${.CURDIR} && ${.MAKE} $@); \ + (cd ${.CURDIR} && ${MAKE} $@); \ echo Back in `pwd` + Since bbmmaakkee will chdir(2) to `_._O_B_J_D_I_R' before executing any targets, each + child process starts with that as its current working directory. + VVAARRIIAABBLLEE AASSSSIIGGNNMMEENNTTSS Variables in make are much like variables in the shell, and, by tradi- tion, consist of all upper-case letters. @@ -402,40 +411,47 @@ VVAARRIIAABBLLEE AASSSSIIGG Variables defined as part of the command line. Local variables - Variables that are defined specific to a certain target. The - seven local variables are as follows: + Variables that are defined specific to a certain target. + + Local variables are all built in and their values vary magically from + target to target. It is not currently possible to define new local vari- + ables. The seven local variables are as follows: - _._A_L_L_S_R_C The list of all sources for this target; also known as - `_>'. + _._A_L_L_S_R_C The list of all sources for this target; also known as + `_>'. - _._A_R_C_H_I_V_E The name of the archive file. + _._A_R_C_H_I_V_E The name of the archive file; also known as `_!'. - _._I_M_P_S_R_C In suffix-transformation rules, the name/path of the - source from which the target is to be transformed (the - ``implied'' source); also known as `_<'. It is not - defined in explicit rules. + _._I_M_P_S_R_C In suffix-transformation rules, the name/path of the + source from which the target is to be transformed (the + ``implied'' source); also known as `_<'. It is not + defined in explicit rules. - _._M_E_M_B_E_R The name of the archive member. + _._M_E_M_B_E_R The name of the archive member; also known as `_%'. - _._O_O_D_A_T_E The list of sources for this target that were deemed - out-of-date; also known as `_?'. + _._O_O_D_A_T_E The list of sources for this target that were deemed out- + of-date; also known as `_?'. - _._P_R_E_F_I_X The file prefix of the target, containing only the file - portion, no suffix or preceding directory components; - also known as `_*'. + _._P_R_E_F_I_X The file prefix of the target, containing only the file + portion, no suffix or preceding directory components; + also known as `_*'. The suffix must be one of the known + suffixes declared with ..SSUUFFFFIIXXEESS or it will not be recog- + nized. - _._T_A_R_G_E_T The name of the target; also known as `_@'. + _._T_A_R_G_E_T The name of the target; also known as `_@'. - The shorter forms `_@', `_?', `_<', `_>', and `_*' are permitted for - backward compatibility with historical makefiles and are not rec- - ommended. The six variables `_@_F', `_@_D', `_<_F', `_<_D', `_*_F', and - `_*_D' are permitted for compatibility with AT&T System V UNIX - makefiles and are not recommended. + The shorter forms (`_>', `_!', `_<', `_%', `_?', `_*', and `_@') are permitted + for backward compatibility with historical makefiles and legacy POSIX + make and are not recommended. - Four of the local variables may be used in sources on dependency - lines because they expand to the proper value for each target on - the line. These variables are `_._T_A_R_G_E_T', `_._P_R_E_F_I_X', `_._A_R_C_H_I_V_E', - and `_._M_E_M_B_E_R'. + Variants of these variables with the punctuation followed immediately by + `D' or `F', e.g. `_$_(_@_D_)', are legacy forms equivalent to using the `:H' + and `:T' modifiers. These forms are accepted for compatibility with AT&T + System V UNIX makefiles and POSIX but are not recommended. + + Four of the local variables may be used in sources on dependency lines + because they expand to the proper value for each target on the line. + These variables are `_._T_A_R_G_E_T', `_._P_R_E_F_I_X', `_._A_R_C_H_I_V_E', and `_._M_E_M_B_E_R'. AAddddiittiioonnaall bbuuiilltt--iinn vvaarriiaabblleess In addition, bbmmaakkee sets or knows about the following variables: @@ -631,10 +647,10 @@ VVAARRIIAABBLLEE AASSSSIIGG may be used. This is especially useful with `MAKEOBJDIR'. - `_._O_B_J_D_I_R' may be modified in the makefile as a global - variable. In all cases, bbmmaakkee will chdir(2) to `_._O_B_J_D_I_R' - and set `PWD' to that directory before executing any tar- - gets. + `_._O_B_J_D_I_R' may be modified in the makefile via the special + target `..OOBBJJDDIIRR'. In all cases, bbmmaakkee will chdir(2) to + the specified directory if it exists, and set `_._O_B_J_D_I_R' + and `PWD' to that directory before executing any targets. _._P_A_R_S_E_D_I_R A path to the directory of the current `_M_a_k_e_f_i_l_e' being parsed. @@ -1255,6 +1271,9 @@ SSPPEECCIIAALL TTAARRGGEETT Synonym for ..NNOOTTPPAARRAALLLLEELL, for compatibility with other pmake variants. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 11 00:04:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A179E9D69A4; Fri, 11 Dec 2015 00:04:14 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7573F1C94; Fri, 11 Dec 2015 00:04:14 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB04DFp003743; Fri, 11 Dec 2015 00:04:13 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB04D8p003742; Fri, 11 Dec 2015 00:04:13 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201512110004.tBB04D8p003742@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 11 Dec 2015 00:04:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292069 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 00:04:14 -0000 Author: asomers Date: Fri Dec 11 00:04:13 2015 New Revision: 292069 URL: https://svnweb.freebsd.org/changeset/base/292069 Log: Change an important error message from ZFS_LOG to printf Submitted by: gibbs MFC after: 4 weeks Sponsored by: Spectra Logic Corp Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Thu Dec 10 23:44:34 2015 (r292068) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Fri Dec 11 00:04:13 2015 (r292069) @@ -523,7 +523,7 @@ vdev_geom_attach_by_guids(uint64_t pool_ continue; cp = vdev_geom_attach(pp); if (cp == NULL) { - ZFS_LOG(1, "ZFS WARNING: Unable to " + printf("ZFS WARNING: Unable to " "attach to %s.\n", pp->name); continue; } From owner-svn-src-all@freebsd.org Fri Dec 11 01:21:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41B0B9D6C36; Fri, 11 Dec 2015 01:21:33 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0843B1886; Fri, 11 Dec 2015 01:21:32 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB1LWwU026056; Fri, 11 Dec 2015 01:21:32 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB1LWu3026055; Fri, 11 Dec 2015 01:21:32 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201512110121.tBB1LWu3026055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Fri, 11 Dec 2015 01:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292070 - head/sys/dev/hwpmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 01:21:33 -0000 Author: rrs Date: Fri Dec 11 01:21:32 2015 New Revision: 292070 URL: https://svnweb.freebsd.org/changeset/base/292070 Log: More fixes in the various intel processors, fixing missing IAP_F_FM's as well as incorrect umask specifications for some of the new Broadwell/Skylake PMC's. Also silvermont had a *lot* of missing IAP_F_FM. Sponsored by: Netflix Inc. Modified: head/sys/dev/hwpmc/hwpmc_core.c Modified: head/sys/dev/hwpmc/hwpmc_core.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_core.c Fri Dec 11 00:04:13 2015 (r292069) +++ head/sys/dev/hwpmc/hwpmc_core.c Fri Dec 11 01:21:32 2015 (r292070) @@ -634,20 +634,20 @@ static struct iap_event_descr iap_events IAPDESCR(03H_10H, 0x03, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_SB | IAP_F_SBX | IAP_F_CAS), IAPDESCR(03H_20H, 0x03, 0x20, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), - IAPDESCR(03H_40H, 0x03, 0x40, IAP_F_CAS), - IAPDESCR(03H_80H, 0x03, 0x80, IAP_F_CAS), + IAPDESCR(03H_40H, 0x03, 0x40, IAP_F_FM | IAP_F_CAS), + IAPDESCR(03H_80H, 0x03, 0x80, IAP_F_FM | IAP_F_CAS), IAPDESCR(04H_00H, 0x04, 0x00, IAP_F_FM | IAP_F_CC | IAP_F_CAS), IAPDESCR(04H_01H, 0x04, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O | IAP_F_CAS), IAPDESCR(04H_02H, 0x04, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), - IAPDESCR(04H_04H, 0x04, 0x04, IAP_F_CAS), + IAPDESCR(04H_04H, 0x04, 0x04, IAP_F_FM | IAP_F_CAS), IAPDESCR(04H_07H, 0x04, 0x07, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(04H_08H, 0x04, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_CAS), - IAPDESCR(04H_10H, 0x04, 0x10, IAP_F_CAS), - IAPDESCR(04H_20H, 0x04, 0x20, IAP_F_CAS), - IAPDESCR(04H_40H, 0x04, 0x40, IAP_F_CAS), - IAPDESCR(04H_80H, 0x04, 0x80, IAP_F_CAS), + IAPDESCR(04H_10H, 0x04, 0x10, IAP_F_FM | IAP_F_CAS), + IAPDESCR(04H_20H, 0x04, 0x20, IAP_F_FM | IAP_F_CAS), + IAPDESCR(04H_40H, 0x04, 0x40, IAP_F_FM | IAP_F_CAS), + IAPDESCR(04H_80H, 0x04, 0x80, IAP_F_FM | IAP_F_CAS), IAPDESCR(05H_00H, 0x05, 0x00, IAP_F_FM | IAP_F_CC), IAPDESCR(05H_01H, 0x05, 0x01, IAP_F_FM | IAP_F_I7O | IAP_F_SB | IAP_F_IB | @@ -690,7 +690,7 @@ static struct iap_event_descr iap_events IAPDESCR(08H_08H, 0x08, 0x08, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(08H_09H, 0x08, 0x09, IAP_F_FM | IAP_F_CA), IAPDESCR(08H_0EH, 0x08, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), - IAPDESCR(08H_10H, 0x08, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | + IAPDESCR(08H_10H, 0x08, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), IAPDESCR(08H_20H, 0x08, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), @@ -700,7 +700,7 @@ static struct iap_event_descr iap_events IAPDESCR(08H_81H, 0x08, 0x81, IAP_F_FM | IAP_F_IB | IAP_F_IBX), IAPDESCR(08H_82H, 0x08, 0x82, IAP_F_FM | IAP_F_IB | IAP_F_IBX), IAPDESCR(08H_84H, 0x08, 0x84, IAP_F_FM | IAP_F_IB | IAP_F_IBX), - IAPDESCR(08H_88H, 0x08, 0x88, IAP_F_IB | IAP_F_IBX), + IAPDESCR(08H_88H, 0x08, 0x88, IAP_F_FM | IAP_F_IB | IAP_F_IBX), IAPDESCR(09H_01H, 0x09, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O), IAPDESCR(09H_02H, 0x09, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7O), @@ -719,7 +719,7 @@ static struct iap_event_descr iap_events IAPDESCR(0DH_03H, 0x0D, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_SBX | IAP_F_HW | IAP_F_IB | IAP_F_IBX | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), IAPDESCR(0DH_40H, 0x0D, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(0DH_80H, 0x0D, 0x00, IAP_F_FM | IAP_F_SL), + IAPDESCR(0DH_80H, 0x0D, 0x80, IAP_F_FM | IAP_F_SL), IAPDESCR(0EH_01H, 0x0E, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | @@ -830,8 +830,8 @@ static struct iap_event_descr iap_events IAPDESCR(24H_30H, 0x24, 0x30, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), - IAPDESCR(24H_38H, 0x24, 0x00, IAP_F_FM | IAP_F_SL), - IAPDESCR(24H_3FH, 0x24, 0x00, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), + IAPDESCR(24H_38H, 0x24, 0x38, IAP_F_FM | IAP_F_SL), + IAPDESCR(24H_3FH, 0x24, 0x3F, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), IAPDESCR(24H_40H, 0x24, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), IAPDESCR(24H_41H, 0x24, 0x41, IAP_F_FM | IAP_F_HW | IAP_F_HWX | @@ -845,7 +845,7 @@ static struct iap_event_descr iap_events IAPDESCR(24H_AAH, 0x24, 0xAA, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(24H_C0H, 0x24, 0xC0, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), - IAPDESCR(24H_D8H, 0x24, 0x00, IAP_F_FM | IAP_F_SL), + IAPDESCR(24H_D8H, 0x24, 0xD8, IAP_F_FM | IAP_F_SL), IAPDESCR(24H_E1H, 0x24, 0xE1, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), IAPDESCR(24H_E2H, 0x24, 0xE2, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | @@ -853,7 +853,7 @@ static struct iap_event_descr iap_events IAPDESCR(24H_E4H, 0x24, 0xE4, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), IAPDESCR(24H_E7H, 0x24, 0xE7, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), - IAPDESCR(24H_EFH, 0x24, 0x00, IAP_F_FM | IAP_F_SL), + IAPDESCR(24H_EFH, 0x24, 0xEF, IAP_F_FM | IAP_F_SL), IAPDESCR(24H_F8H, 0x24, 0xF8, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), IAPDESCR(24H_FFH, 0x24, 0xFF, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_HW | @@ -923,8 +923,8 @@ static struct iap_event_descr iap_events IAPDESCR(30H, 0x30, IAP_M_CORE | IAP_M_MESI | IAP_M_PREFETCH, IAP_F_ALLCPUSCORE2), - IAPDESCR(30H_00H, 0x30, 0x00, IAP_F_CAS), - IAPDESCR(31H_00H, 0x31, 0x00, IAP_F_CAS), + IAPDESCR(30H_00H, 0x30, 0x00, IAP_F_FM | IAP_F_CAS), + IAPDESCR(31H_00H, 0x31, 0x00, IAP_F_FM | IAP_F_CAS), IAPDESCR(32H, 0x32, IAP_M_CORE | IAP_M_MESI | IAP_M_PREFETCH, IAP_F_CC), IAPDESCR(32H, 0x32, IAP_M_CORE, IAP_F_CA | IAP_F_CC2), @@ -993,7 +993,7 @@ static struct iap_event_descr iap_events IAPDESCR(49H_04H, 0x49, 0x04, IAP_F_FM | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(49H_0EH, 0x49, 0x0E, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), - IAPDESCR(49H_10H, 0x49, 0x1, IAP_F_FM | IAP_F_I7 | IAP_F_WM | + IAPDESCR(49H_10H, 0x49, 0x10, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), IAPDESCR(49H_20H, 0x49, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_HW | IAP_F_HWX | @@ -1052,7 +1052,7 @@ static struct iap_event_descr iap_events IAPDESCR(58H_08H, 0x58, 0x08, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), - IAPDESCR(59H_20H, 0x59, 0x1, IAP_F_SB | IAP_F_SBX), + IAPDESCR(59H_20H, 0x59, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(59H_40H, 0x59, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_SBX), IAPDESCR(59H_80H, 0x59, 0x80, IAP_F_FM | IAP_F_SB | IAP_F_SBX), @@ -1069,22 +1069,22 @@ static struct iap_event_descr iap_events IAPDESCR(5EH_01H, 0x5E, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(5FH_01H, 0x5F, 0x01, IAP_F_FM | IAP_F_IB ), /* IB not in manual */ - IAPDESCR(5FH_04H, 0x5F, 0x04, IAP_F_IBX | IAP_F_IB), + IAPDESCR(5FH_01H, 0x5F, 0x01, IAP_F_FM | IAP_F_IB ), /* IB not in manual */ + IAPDESCR(5FH_04H, 0x5F, 0x04, IAP_F_FM | IAP_F_IBX | IAP_F_IB), IAPDESCR(60H, 0x60, IAP_M_AGENT | IAP_M_CORE, IAP_F_ALLCPUSCORE2), IAPDESCR(60H_01H, 0x60, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(60H_02H, 0x60, 0x01, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_IB | + IAPDESCR(60H_02H, 0x60, 0x02, IAP_F_FM | IAP_F_WM | IAP_F_I7O | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(60H_04H, 0x60, 0x01, IAP_F_FM |IAP_F_I7O | + IAPDESCR(60H_04H, 0x60, 0x04, IAP_F_FM |IAP_F_I7O | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(60H_08H, 0x60, 0x01, IAP_F_FM |IAP_F_I7O | + IAPDESCR(60H_08H, 0x60, 0x08, IAP_F_FM |IAP_F_I7O | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(60H_10H, 0x7, 0x00, IAP_F_SL), + IAPDESCR(60H_10H, 0x60, 0x10, IAP_F_FM | IAP_F_SL), IAPDESCR(61H, 0x61, IAP_M_AGENT, IAP_F_CA | IAP_F_CC2), @@ -1114,7 +1114,6 @@ static struct iap_event_descr iap_events IAPDESCR(67H, 0x67, IAP_M_AGENT | IAP_M_CORE, IAP_F_CA | IAP_F_CC2), IAPDESCR(67H, 0x67, IAP_M_AGENT, IAP_F_CC), - IAPDESCR(68H, 0x68, IAP_M_AGENT | IAP_M_CORE, IAP_F_ALLCPUSCORE2), IAPDESCR(69H, 0x69, IAP_M_AGENT | IAP_M_CORE, IAP_F_ALLCPUSCORE2), IAPDESCR(6AH, 0x6A, IAP_M_AGENT | IAP_M_CORE, IAP_F_ALLCPUSCORE2), @@ -1144,22 +1143,22 @@ static struct iap_event_descr iap_events IAPDESCR(79H_02H, 0x79, 0x02, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), - IAPDESCR(79H_04H, 0x79, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAPDESCR(79H_04H, 0x79, 0x04, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(79H_08H, 0x79, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAPDESCR(79H_08H, 0x79, 0x08, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SL | IAP_F_BW | IAP_F_BWX), - IAPDESCR(79H_10H, 0x79, 0x1, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAPDESCR(79H_10H, 0x79, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(79H_18H, 0x79, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | + IAPDESCR(79H_18H, 0x79, 0x18, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(79H_20H, 0x79, 0x1, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAPDESCR(79H_20H, 0x79, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(79H_24H, 0x79, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | + IAPDESCR(79H_24H, 0x79, 0x24, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(79H_30H, 0x79, 0x1, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAPDESCR(79H_30H, 0x79, 0x30, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), IAPDESCR(79H_3CH, 0x79, 0x3C, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | @@ -1243,7 +1242,7 @@ static struct iap_event_descr iap_events IAPDESCR(88H_41H, 0x88, 0x41, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(88H_7FH, 0x88, 0x7F, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(88H_80H, 0x88, 0x0, IAP_F_FM | IAP_F_BW | IAP_F_BWX), + IAPDESCR(88H_80H, 0x88, 0x80, IAP_F_FM | IAP_F_BW | IAP_F_BWX), IAPDESCR(88H_81H, 0x88, 0x81, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(88H_82H, 0x88, 0x82, IAP_F_FM | IAP_F_SB | IAP_F_IB | @@ -1272,7 +1271,7 @@ static struct iap_event_descr iap_events IAPDESCR(89H_41H, 0x89, 0x41, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(89H_7FH, 0x89, 0x7F, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(89H_80H, 0x89, 0x0, IAP_F_FM | IAP_F_BW | IAP_F_BWX), + IAPDESCR(89H_80H, 0x89, 0x80, IAP_F_FM | IAP_F_BW | IAP_F_BWX), IAPDESCR(89H_81H, 0x89, 0x81, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), IAPDESCR(89H_82H, 0x89, 0x82, IAP_F_FM | IAP_F_SB | IAP_F_IB | @@ -1358,25 +1357,25 @@ static struct iap_event_descr iap_events IAPDESCR(A2H_80H, 0xA2, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(A3H_01H, 0xA3, 0x02, IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_HW | + IAPDESCR(A3H_01H, 0xA3, 0x01, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_HW | IAP_F_HWX | IAP_F_SL), - IAPDESCR(A3H_02H, 0xA3, 0x02, IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_HW | + IAPDESCR(A3H_02H, 0xA3, 0x02, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_HW | IAP_F_HWX | IAP_F_SL), IAPDESCR(A3H_04H, 0xA3, 0x04, IAP_F_FM | IAP_F_SBX | IAP_F_IBX | IAP_F_IB | IAP_F_SL), IAPDESCR(A3H_05H, 0xA3, 0x05, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_SL), IAPDESCR(A3H_06H, 0xA3, 0x06, IAP_F_FM | IAP_F_SL), - IAPDESCR(A3H_08H, 0xA3, 0x08, IAP_F_IBX | IAP_F_HW | IAP_F_IB | IAP_F_HWX | + IAPDESCR(A3H_08H, 0xA3, 0x08, IAP_F_FM | IAP_F_IBX | IAP_F_HW | IAP_F_IB | IAP_F_HWX | IAP_F_SL), IAPDESCR(A3H_0CH, 0xA3, 0x0C, IAP_F_FM | IAP_F_HW | IAP_F_HW | IAP_F_SL), IAPDESCR(A3H_10H, 0xA3, 0x10, IAP_F_FM | IAP_F_SL), IAPDESCR(A3H_14H, 0xA3, 0x14, IAP_F_FM | IAP_F_SL), IAPDESCR(A6H_01H, 0xA6, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SL), - IAPDESCR(A6H_02H, 0xA3, 0x0, IAP_F_FM | IAP_F_SL), - IAPDESCR(A6H_04H, 0xA3, 0x0, IAP_F_FM | IAP_F_SL), - IAPDESCR(A6H_08H, 0xA3, 0x0, IAP_F_FM | IAP_F_SL), - IAPDESCR(A6H_10H, 0xA3, 0x0, IAP_F_FM | IAP_F_SL), - IAPDESCR(A6H_40H, 0xA3, 0x0, IAP_F_FM | IAP_F_SL), + IAPDESCR(A6H_02H, 0xA3, 0x02, IAP_F_FM | IAP_F_SL), + IAPDESCR(A6H_04H, 0xA3, 0x04, IAP_F_FM | IAP_F_SL), + IAPDESCR(A6H_08H, 0xA3, 0x08, IAP_F_FM | IAP_F_SL), + IAPDESCR(A6H_10H, 0xA3, 0x10, IAP_F_FM | IAP_F_SL), + IAPDESCR(A6H_40H, 0xA3, 0x40, IAP_F_FM | IAP_F_SL), IAPDESCR(A7H_01H, 0xA7, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM ), IAPDESCR(A8H_01H, 0xA8, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_IBX | @@ -1459,7 +1458,7 @@ static struct iap_event_descr iap_events IAPDESCR(B4H_04H, 0xB4, 0x04, IAP_F_FM | IAP_F_WM), IAPDESCR(B6H_01H, 0xB6, 0x01, IAP_F_FM | IAP_F_SB | IAP_F_SBX), - IAPDESCR(B6H_04H, 0xB6, 0x04, IAP_F_CAS), + IAPDESCR(B6H_04H, 0xB6, 0x04, IAP_F_FM | IAP_F_CAS), IAPDESCR(B7H_01H, 0xB7, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | @@ -1496,7 +1495,7 @@ static struct iap_event_descr iap_events IAPDESCR(C0H_00H, 0xC0, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(C0H_01H, 0xC0, 0x0a, IAP_F_CA | IAP_F_CC2 | + IAPDESCR(C0H_01H, 0xC0, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), IAPDESCR(C0H_02H, 0xC0, 0x02, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | @@ -1514,9 +1513,9 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), IAPDESCR(C1H_20H, 0xC1, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX), - IAPDESCR(C1H_3FH, 0xC1, 0x00, IAP_F_FM | IAP_F_SL), + IAPDESCR(C1H_3FH, 0xC1, 0x3F, IAP_F_FM | IAP_F_SL), IAPDESCR(C1H_40H, 0xC1, 0x40, IAP_F_FM | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), - IAPDESCR(C1H_80H, 0xC1, 0x80, IAP_F_IB | IAP_F_IBX), + IAPDESCR(C1H_80H, 0xC1, 0x80, IAP_F_FM |IAP_F_IB | IAP_F_IBX), IAPDESCR(C1H_FEH, 0xC1, 0xFE, IAP_F_FM | IAP_F_CA | IAP_F_CC2), IAPDESCR(C2H_00H, 0xC2, 0x00, IAP_F_FM | IAP_F_CC), @@ -1542,7 +1541,7 @@ static struct iap_event_descr iap_events IAPDESCR(C3H_04H, 0xC3, 0x04, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_CAS | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(C3H_08H, 0xC3, 0x08, IAP_F_CAS), + IAPDESCR(C3H_08H, 0xC3, 0x08, IAP_F_FM | IAP_F_CAS), IAPDESCR(C3H_10H, 0xC3, 0x10, IAP_F_FM | IAP_F_I7O), IAPDESCR(C3H_20H, 0xC3, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), @@ -1570,14 +1569,14 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), IAPDESCR(C4H_40H, 0xC4, 0x40, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(C4H_7EH, 0xC4, 0x7E, IAP_F_CAS), - IAPDESCR(C4H_BFH, 0xC4, 0xBF, IAP_F_CAS), - IAPDESCR(C4H_EBH, 0xC4, 0xEB, IAP_F_CAS), - IAPDESCR(C4H_F7H, 0xC4, 0xF7, IAP_F_CAS), - IAPDESCR(C4H_F9H, 0xC4, 0xF9, IAP_F_CAS), - IAPDESCR(C4H_FBH, 0xC4, 0xFB, IAP_F_CAS), - IAPDESCR(C4H_FDH, 0xC4, 0xFD, IAP_F_CAS), - IAPDESCR(C4H_FEH, 0xC4, 0xFE, IAP_F_CAS), + IAPDESCR(C4H_7EH, 0xC4, 0x7E, IAP_F_FM | IAP_F_CAS), + IAPDESCR(C4H_BFH, 0xC4, 0xBF, IAP_F_FM | IAP_F_CAS), + IAPDESCR(C4H_EBH, 0xC4, 0xEB, IAP_F_FM | IAP_F_CAS), + IAPDESCR(C4H_F7H, 0xC4, 0xF7, IAP_F_FM | IAP_F_CAS), + IAPDESCR(C4H_F9H, 0xC4, 0xF9, IAP_F_FM | IAP_F_CAS), + IAPDESCR(C4H_FBH, 0xC4, 0xFB, IAP_F_FM | IAP_F_CAS), + IAPDESCR(C4H_FDH, 0xC4, 0xFD, IAP_F_FM | IAP_F_CAS), + IAPDESCR(C4H_FEH, 0xC4, 0xFE, IAP_F_FM | IAP_F_CAS), IAPDESCR(C5H_00H, 0xC5, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2 | IAP_F_I7 | IAP_F_WM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | @@ -1593,14 +1592,14 @@ static struct iap_event_descr iap_events IAP_F_SBX | IAP_F_IBX), IAPDESCR(C5H_20H, 0xC5, 0x20, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_SL), - IAPDESCR(C5H_7EH, 0xC5, 0x7E, IAP_F_CAS), - IAPDESCR(C5H_BFH, 0xC5, 0xBF, IAP_F_CAS), - IAPDESCR(C5H_EBH, 0xC5, 0xEB, IAP_F_CAS), - IAPDESCR(C5H_F7H, 0xC5, 0xF7, IAP_F_CAS), - IAPDESCR(C5H_F9H, 0xC5, 0xF9, IAP_F_CAS), - IAPDESCR(C5H_FBH, 0xC5, 0xFB, IAP_F_CAS), - IAPDESCR(C5H_FDH, 0xC5, 0xFD, IAP_F_CAS), - IAPDESCR(C5H_FEH, 0xC5, 0xFE, IAP_F_CAS), + IAPDESCR(C5H_7EH, 0xC5, 0x7E, IAP_F_FM | IAP_F_CAS), + IAPDESCR(C5H_BFH, 0xC5, 0xBF, IAP_F_FM | IAP_F_CAS), + IAPDESCR(C5H_EBH, 0xC5, 0xEB, IAP_F_FM | IAP_F_CAS), + IAPDESCR(C5H_F7H, 0xC5, 0xF7, IAP_F_FM | IAP_F_CAS), + IAPDESCR(C5H_F9H, 0xC5, 0xF9, IAP_F_FM | IAP_F_CAS), + IAPDESCR(C5H_FBH, 0xC5, 0xFB, IAP_F_FM | IAP_F_CAS), + IAPDESCR(C5H_FDH, 0xC5, 0xFD, IAP_F_FM | IAP_F_CAS), + IAPDESCR(C5H_FEH, 0xC5, 0xFE, IAP_F_FM | IAP_F_CAS), IAPDESCR(C6H_00H, 0xC6, 0x00, IAP_F_FM | IAP_F_CC), /* For SL C6_01 needs EV_SEL? 0x11, 0x12, 0x13, 0x14, 0x15? */ @@ -1619,7 +1618,7 @@ static struct iap_event_descr iap_events IAPDESCR(C7H_10H, 0xC7, 0x10, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_SL), IAPDESCR(C7H_1FH, 0xC7, 0x1F, IAP_F_FM | IAP_F_CA | IAP_F_CC2), - IAPDESCR(C7H_20H, 0xC7, 0x0, IAP_F_FM | IAP_F_SL), + IAPDESCR(C7H_20H, 0xC7, 0x20, IAP_F_FM | IAP_F_SL), IAPDESCR(C8H_00H, 0xC8, 0x00, IAP_F_FM | IAP_F_ALLCPUSCORE2), IAPDESCR(C8H_20H, 0xC8, 0x20, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -1639,11 +1638,11 @@ static struct iap_event_descr iap_events IAP_F_BW | IAP_F_BWX), IAPDESCR(CAH_10H, 0xCA, 0x10, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), - IAPDESCR(CAH_1EH, 0xCA, 0x1, IAP_F_FM | IAP_F_SB | IAP_F_IB | + IAPDESCR(CAH_1EH, 0xCA, 0x1E, IAP_F_FM | IAP_F_SB | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX | IAP_F_SL), - IAPDESCR(CAH_20H, 0xCA, 0x0, IAP_F_FM | IAP_F_CAS | IAP_F_BW | IAP_F_BWX), - IAPDESCR(CAH_3FH, 0xCA, 0x3F, IAP_F_CAS), - IAPDESCR(CAH_50H, 0xCA, 0x50, IAP_F_CAS), + IAPDESCR(CAH_20H, 0xCA, 0x20, IAP_F_FM | IAP_F_CAS | IAP_F_BW | IAP_F_BWX), + IAPDESCR(CAH_3FH, 0xCA, 0x3F, IAP_F_FM | IAP_F_CAS), + IAPDESCR(CAH_50H, 0xCA, 0x50, IAP_F_FM | IAP_F_CAS), IAPDESCR(CBH_01H, 0xCB, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM | IAP_F_CAS | IAP_F_SL), @@ -1655,7 +1654,7 @@ static struct iap_event_descr iap_events IAP_F_I7 | IAP_F_WM), IAPDESCR(CBH_10H, 0xCB, 0x10, IAP_F_FM | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM), - IAPDESCR(CBH_1FH, 0xCB, 0x1F, IAP_F_CAS), + IAPDESCR(CBH_1FH, 0xCB, 0x1F, IAP_F_FM | IAP_F_CAS), IAPDESCR(CBH_40H, 0xCB, 0x40, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(CBH_80H, 0xCB, 0x80, IAP_F_FM | IAP_F_I7 | IAP_F_WM), @@ -1734,11 +1733,11 @@ static struct iap_event_descr iap_events IAPDESCR(D3H_01H, 0xD3, 0x01, IAP_F_FM | IAP_F_IB | IAP_F_SBX | IAP_F_IBX | IAP_F_HW | IAP_F_HWX | IAP_F_BW | IAP_F_BWX), - IAPDESCR(D3H_03H, 0xD3, 0x03, IAP_F_IBX), + IAPDESCR(D3H_03H, 0xD3, 0x03, IAP_F_FM | IAP_F_IBX), IAPDESCR(D3H_04H, 0xD3, 0x04, IAP_F_FM | IAP_F_SBX | IAP_F_IBX), /* Not defined for IBX */ - IAPDESCR(D3H_0CH, 0xD3, 0x0C, IAP_F_IBX), - IAPDESCR(D3H_10H, 0xD3, 0x10, IAP_F_IBX ), - IAPDESCR(D3H_20H, 0xD3, 0x20, IAP_F_IBX ), + IAPDESCR(D3H_0CH, 0xD3, 0x0C, IAP_F_FM | IAP_F_IBX), + IAPDESCR(D3H_10H, 0xD3, 0x10, IAP_F_FM | IAP_F_IBX ), + IAPDESCR(D3H_20H, 0xD3, 0x20, IAP_F_FM | IAP_F_IBX ), IAPDESCR(D4H_01H, 0xD4, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_CC2 | IAP_F_I7 | IAP_F_WM), @@ -1797,12 +1796,12 @@ static struct iap_event_descr iap_events IAPDESCR(E6H_01H, 0xE6, 0x01, IAP_F_FM | IAP_F_CA | IAP_F_I7 | IAP_F_WM | IAP_F_SBX | IAP_F_CAS | IAP_F_SL), IAPDESCR(E6H_02H, 0xE6, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), - IAPDESCR(E6H_08H, 0xE6, 0x08, IAP_F_CAS), - IAPDESCR(E6H_10H, 0xE6, 0x10, IAP_F_CAS), + IAPDESCR(E6H_08H, 0xE6, 0x08, IAP_F_FM | IAP_F_CAS), + IAPDESCR(E6H_10H, 0xE6, 0x10, IAP_F_FM | IAP_F_CAS), IAPDESCR(E6H_1FH, 0xE6, 0x1F, IAP_F_FM | IAP_F_IB | IAP_F_IBX | IAP_F_HW | IAP_F_HWX), - IAPDESCR(E7H_01H, 0xE7, 0x01, IAP_F_CAS), + IAPDESCR(E7H_01H, 0xE7, 0x01, IAP_F_FM | IAP_F_CAS), IAPDESCR(E8H_01H, 0xE8, 0x01, IAP_F_FM | IAP_F_I7 | IAP_F_WM), IAPDESCR(E8H_02H, 0xE8, 0x02, IAP_F_FM | IAP_F_I7 | IAP_F_WM), From owner-svn-src-all@freebsd.org Fri Dec 11 01:23:19 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 956639D6DE0; Fri, 11 Dec 2015 01:23:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 54E641AF1; Fri, 11 Dec 2015 01:23:19 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB1NIsH027990; Fri, 11 Dec 2015 01:23:18 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB1NI5M027987; Fri, 11 Dec 2015 01:23:18 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201512110123.tBB1NI5M027987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 11 Dec 2015 01:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292071 - in head/sys/powerpc: booke include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 01:23:19 -0000 Author: jhibbits Date: Fri Dec 11 01:23:18 2015 New Revision: 292071 URL: https://svnweb.freebsd.org/changeset/base/292071 Log: Add more interrupts handled for booke. e500mc, e5500, and e6500 all use the normal FPU, with the same behavior as AIM hardware. e6500 also supports Altivec, so, although we don't yet have e6500 hardware to test on, add these IVORs as well. Theoretically, since it boots the same as a e5500, it should work, single-threaded, single-core, with full altivec support as of this commit. With this commit, and some other patches to be committed shortly FreeBSD now boots on the P5020, single-core, all the way to user space, and should boot just fine on e500mc. Relnotes: Yes (e500mc, e5500 support) Sponsored by: Alex Perez/Inertial Computing Modified: head/sys/powerpc/booke/booke_machdep.c head/sys/powerpc/booke/trap_subr.S head/sys/powerpc/include/trap.h Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Fri Dec 11 01:21:32 2015 (r292070) +++ head/sys/powerpc/booke/booke_machdep.c Fri Dec 11 01:23:18 2015 (r292071) @@ -142,7 +142,7 @@ __FBSDID("$FreeBSD$"); #include #include -#ifdef MPC85XX +#if defined(MPC85XX) || defined(QORIQ_DPAA) #include #endif @@ -183,6 +183,7 @@ extern void *int_data_storage; extern void *int_instr_storage; extern void *int_external_input; extern void *int_alignment; +extern void *int_fpu; extern void *int_program; extern void *int_syscall; extern void *int_decrementer; @@ -191,6 +192,8 @@ extern void *int_watchdog; extern void *int_data_tlb_error; extern void *int_inst_tlb_error; extern void *int_debug; +extern void *int_vec; +extern void *int_vecast; #ifdef HWPMC_HOOKS extern void *int_performance_counter; #endif @@ -234,6 +237,15 @@ ivor_setup(void) #ifdef HWPMC_HOOKS SET_TRAP(SPR_IVOR35, int_performance_counter); #endif + switch ((mfpvr() >> 16) & 0xffff) { + case FSL_E6500: + SET_TRAP(SPR_IVOR32, int_vec); + SET_TRAP(SPR_IVOR33, int_vecast); + /* FALLTHROUGH */ + case FSL_E500mc: + case FSL_E5500: + SET_TRAP(SPR_IVOR7, int_fpu); + } } static int Modified: head/sys/powerpc/booke/trap_subr.S ============================================================================== --- head/sys/powerpc/booke/trap_subr.S Fri Dec 11 01:21:32 2015 (r292070) +++ head/sys/powerpc/booke/trap_subr.S Fri Dec 11 01:23:18 2015 (r292071) @@ -393,12 +393,19 @@ .globl CNAME(interrupt_vector_base) .align 5 interrupt_vector_base: +/***************************************************************************** + * Catch-all handler to handle uninstalled IVORs + ****************************************************************************/ +INTERRUPT(int_unknown) + STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) + FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_RSVD) + b trap_common /***************************************************************************** * Critical input interrupt ****************************************************************************/ INTERRUPT(int_critical_input) - STANDARD_PROLOG(SPR_SPRG2, PC_BOOKE_CRITSAVE, SPR_CSRR0, SPR_CSRR1) + STANDARD_CRIT_PROLOG(SPR_SPRG2, PC_BOOKE_CRITSAVE, SPR_CSRR0, SPR_CSRR1) FRAME_SETUP(SPR_SPRG2, PC_BOOKE_CRITSAVE, EXC_CRIT) addi %r3, %r1, 8 bl CNAME(powerpc_interrupt) @@ -459,6 +466,12 @@ INTERRUPT(int_program) b trap_common +INTERRUPT(int_fpu) + STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) + FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_FPU) + b trap_common + + /***************************************************************************** * System call ****************************************************************************/ @@ -497,6 +510,24 @@ INTERRUPT(int_watchdog) b trap_common +/***************************************************************************** + * Altivec Unavailable interrupt + ****************************************************************************/ +INTERRUPT(int_vec) + STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) + FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_VEC) + b trap_common + + +/***************************************************************************** + * Watchdog interrupt + ****************************************************************************/ +INTERRUPT(int_vecast) + STANDARD_PROLOG(SPR_SPRG1, PC_TEMPSAVE, SPR_SRR0, SPR_SRR1) + FRAME_SETUP(SPR_SPRG1, PC_TEMPSAVE, EXC_VECAST_E) + b trap_common + + #ifdef HWPMC_HOOKS /***************************************************************************** * PMC Interrupt Modified: head/sys/powerpc/include/trap.h ============================================================================== --- head/sys/powerpc/include/trap.h Fri Dec 11 01:21:32 2015 (r292070) +++ head/sys/powerpc/include/trap.h Fri Dec 11 01:23:18 2015 (r292071) @@ -86,6 +86,7 @@ #define EXC_ITMISS 0x1200 /* Instruction TLB Miss */ #define EXC_APU 0x1300 /* Auxiliary Processing Unit */ #define EXC_DEBUG 0x2f10 /* Debug trap */ +#define EXC_VECAST_E 0x2f20 /* Altivec Assist (Book-E) */ #define EXC_LAST 0x2f00 /* Last possible exception vector */ From owner-svn-src-all@freebsd.org Fri Dec 11 01:30:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72E7C9D7465; Fri, 11 Dec 2015 01:30:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 460C21DE0; Fri, 11 Dec 2015 01:30:21 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB1UKCZ028280; Fri, 11 Dec 2015 01:30:20 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB1UK1t028279; Fri, 11 Dec 2015 01:30:20 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201512110130.tBB1UK1t028279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 11 Dec 2015 01:30:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292072 - head/sys/powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 01:30:21 -0000 Author: jhibbits Date: Fri Dec 11 01:30:20 2015 New Revision: 292072 URL: https://svnweb.freebsd.org/changeset/base/292072 Log: Follow up to r292071. Actually handle the Altivec Assist for book-e. Modified: head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Fri Dec 11 01:23:18 2015 (r292071) +++ head/sys/powerpc/powerpc/trap.c Fri Dec 11 01:30:20 2015 (r292072) @@ -252,6 +252,7 @@ trap(struct trapframe *frame) enable_fpu(td); break; + case EXC_VECAST_E: case EXC_VECAST_G4: case EXC_VECAST_G5: /* From owner-svn-src-all@freebsd.org Fri Dec 11 01:34:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E5489D77CA; Fri, 11 Dec 2015 01:34:14 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3D55F11B7; Fri, 11 Dec 2015 01:34:14 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB1YD3E030888; Fri, 11 Dec 2015 01:34:13 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB1YDpf030887; Fri, 11 Dec 2015 01:34:13 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201512110134.tBB1YDpf030887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 11 Dec 2015 01:34:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292073 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 01:34:14 -0000 Author: jhibbits Date: Fri Dec 11 01:34:13 2015 New Revision: 292073 URL: https://svnweb.freebsd.org/changeset/base/292073 Log: No need to reset tlb1 here, it gets reset again after BSS is cleared in powerpc_init(). Also fix a comment typo (0x45 == E, not e) Modified: head/sys/powerpc/booke/booke_machdep.c Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Fri Dec 11 01:30:20 2015 (r292072) +++ head/sys/powerpc/booke/booke_machdep.c Fri Dec 11 01:34:13 2015 (r292073) @@ -296,7 +296,7 @@ booke_init(uint32_t arg1, uint32_t arg2) * relatively small number, such as 64K. arg2 is the * physical address of the argv vector. * - ePAPR loaders pass an FDT blob in r3 (arg1) and the magic hex - * string 0x45504150 ('ePAP') in r6 (which has been lost by now). + * string 0x45504150 ('EPAP') in r6 (which has been lost by now). * r4 (arg2) is supposed to be set to zero, but is not always. */ @@ -314,9 +314,6 @@ booke_init(uint32_t arg1, uint32_t arg2) else /* U-Boot */ mdp = NULL; - /* Reset TLB1 to get rid of temporary mappings */ - tlb1_init(); - ret = powerpc_init(dtbp, 0, 0, mdp); /* Enable L1 caches */ From owner-svn-src-all@freebsd.org Fri Dec 11 02:06:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FC2B9D6FB0; Fri, 11 Dec 2015 02:06:05 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A47F1FE3; Fri, 11 Dec 2015 02:06:05 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB264Im039490; Fri, 11 Dec 2015 02:06:04 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB264Ad039486; Fri, 11 Dec 2015 02:06:04 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512110206.tBB264Ad039486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 11 Dec 2015 02:06:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292074 - in head/sys/dev: nvd nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 02:06:05 -0000 Author: smh Date: Fri Dec 11 02:06:03 2015 New Revision: 292074 URL: https://svnweb.freebsd.org/changeset/base/292074 Log: Limit stripesize reported from nvd(4) to 4K Intel NVMe controllers have a slow path for I/Os that span a 128KB stripe boundary but ZFS limits ashift, which is derived from d_stripesize, to 13 (8KB) so we limit the stripesize reported to geom(8) to 4KB. This may result in a small number of additional I/Os to require splitting in nvme(4), however the NVMe I/O path is very efficient so these additional I/Os will cause very minimal (if any) difference in performance or CPU utilisation. This can be controller by the new sysctl kern.nvme.max_optimal_sectorsize. MFC after: 1 week Sponsored by: Multiplay Differential Revision: https://reviews.freebsd.org/D4446 Modified: head/sys/dev/nvd/nvd.c head/sys/dev/nvme/nvme.h head/sys/dev/nvme/nvme_ns.c head/sys/dev/nvme/nvme_sysctl.c Modified: head/sys/dev/nvd/nvd.c ============================================================================== --- head/sys/dev/nvd/nvd.c Fri Dec 11 01:34:13 2015 (r292073) +++ head/sys/dev/nvd/nvd.c Fri Dec 11 02:06:03 2015 (r292074) @@ -279,7 +279,7 @@ nvd_new_disk(struct nvme_namespace *ns, disk->d_sectorsize = nvme_ns_get_sector_size(ns); disk->d_mediasize = (off_t)nvme_ns_get_size(ns); disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns); - disk->d_stripesize = nvme_ns_get_stripesize(ns); + disk->d_stripesize = nvme_ns_get_optimal_sector_size(ns); if (TAILQ_EMPTY(&disk_head)) disk->d_unit = 0; Modified: head/sys/dev/nvme/nvme.h ============================================================================== --- head/sys/dev/nvme/nvme.h Fri Dec 11 01:34:13 2015 (r292073) +++ head/sys/dev/nvme/nvme.h Fri Dec 11 02:06:03 2015 (r292074) @@ -870,6 +870,7 @@ const char * nvme_ns_get_serial_number(s const char * nvme_ns_get_model_number(struct nvme_namespace *ns); const struct nvme_namespace_data * nvme_ns_get_data(struct nvme_namespace *ns); +uint32_t nvme_ns_get_optimal_sector_size(struct nvme_namespace *ns); uint32_t nvme_ns_get_stripesize(struct nvme_namespace *ns); int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp, Modified: head/sys/dev/nvme/nvme_ns.c ============================================================================== --- head/sys/dev/nvme/nvme_ns.c Fri Dec 11 01:34:13 2015 (r292073) +++ head/sys/dev/nvme/nvme_ns.c Fri Dec 11 02:06:03 2015 (r292074) @@ -45,6 +45,8 @@ __FBSDID("$FreeBSD$"); #include "nvme_private.h" +extern int nvme_max_optimal_sectorsize; + static void nvme_bio_child_inbed(struct bio *parent, int bio_error); static void nvme_bio_child_done(void *arg, const struct nvme_completion *cpl); @@ -217,6 +219,22 @@ nvme_ns_get_stripesize(struct nvme_names return (ns->stripesize); } +uint32_t +nvme_ns_get_optimal_sector_size(struct nvme_namespace *ns) +{ + uint32_t stripesize; + + stripesize = nvme_ns_get_stripesize(ns); + + if (stripesize == 0) + return nvme_ns_get_sector_size(ns); + + if (nvme_max_optimal_sectorsize == 0) + return (stripesize); + + return (MIN(stripesize, nvme_max_optimal_sectorsize)); +} + static void nvme_ns_bio_done(void *arg, const struct nvme_completion *status) { Modified: head/sys/dev/nvme/nvme_sysctl.c ============================================================================== --- head/sys/dev/nvme/nvme_sysctl.c Fri Dec 11 01:34:13 2015 (r292073) +++ head/sys/dev/nvme/nvme_sysctl.c Fri Dec 11 02:06:03 2015 (r292074) @@ -33,6 +33,22 @@ __FBSDID("$FreeBSD$"); #include "nvme_private.h" +SYSCTL_NODE(_kern, OID_AUTO, nvme, CTLFLAG_RD, 0, "NVM Express"); +/* + * Intel NVMe controllers have a slow path for I/Os that span a 128KB + * stripe boundary but ZFS limits ashift, which is derived from + * d_stripesize, to 13 (8KB) so we limit the stripesize reported to + * geom(8) to 4KB by default. + * + * This may result in a small number of additional I/Os to require + * splitting in nvme(4), however the NVMe I/O path is very efficient + * so these additional I/Os will cause very minimal (if any) difference + * in performance or CPU utilisation. + */ +int nvme_max_optimal_sectorsize = 1<<12; +SYSCTL_INT(_kern_nvme, OID_AUTO, max_optimal_sectorsize, CTLFLAG_RWTUN, + &nvme_max_optimal_sectorsize, 0, "The maximum optimal sectorsize reported"); + /* * CTLTYPE_S64 and sysctl_handle_64 were added in r217616. Define these * explicitly here for older kernels that don't include the r217616 From owner-svn-src-all@freebsd.org Fri Dec 11 05:15:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE7239D7E8A; Fri, 11 Dec 2015 05:15:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8E9D31615; Fri, 11 Dec 2015 05:15:14 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB5FDm4007549; Fri, 11 Dec 2015 05:15:13 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB5FDXo007547; Fri, 11 Dec 2015 05:15:13 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512110515.tBB5FDXo007547@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 11 Dec 2015 05:15:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292075 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 05:15:15 -0000 Author: imp Date: Fri Dec 11 05:15:13 2015 New Revision: 292075 URL: https://svnweb.freebsd.org/changeset/base/292075 Log: o Resolve the real path to NANO_OBJ so everything that depends on it doesn't have lots of ../../foo in it. o Tweak the powerpc64 variant a bit. This gets us closer to working with qemu-system-poewrpc64, but we aren't quite there yet. Modified: head/tools/tools/nanobsd/embedded/common head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Fri Dec 11 02:06:03 2015 (r292074) +++ head/tools/tools/nanobsd/embedded/common Fri Dec 11 05:15:13 2015 (r292075) @@ -86,7 +86,7 @@ NANO_CFG_BASE=$(pwd) NANO_CFG_BASE=$(realpath ${NANO_CFG_BASE}/..) NANO_SRC=$(realpath ${NANO_CFG_BASE}/../../..) #### XXX share obj -NANO_OBJ=${NANO_SRC}/../$NANO_NAME/obj +NANO_OBJ=$(realpath ${NANO_SRC}/../$NANO_NAME/obj) # Where cust_pkg() finds packages to install #XXX: Is this the right place? #NANO_PORTS=$(realpath ${NANO_SRC}/../ports) @@ -296,7 +296,7 @@ create_diskimage_mbr ( ) ( rm -fr ${NANO_OBJ}/_.${i}* done - # Populate the FAT partition + # Populate the FAT partition, if needed if [-n "${NANO_SLICE_FAT}" ]; then echo Creating MSDOS partition for kernel newfs_msdos -C ${NANO_SLICE_FAT_SIZE} -F 16 -L ${NANO_NAME} \ @@ -305,6 +305,11 @@ create_diskimage_mbr ( ) ( # makefs -t msdos once that's supported fi + # Populate the Powerpc boot image, if needed + if [ "${NANO_LAYOUT}" = powerpc64-ibm ]; then + dd if=${NANO_WORLDDIR}/boot/boot1.elf of=${NANO_OBJ}/_.s1 bs=800k count=1 conv=sync + fi + # Populate the / partition, and place it into a slice with a # bsd label [ -z ${NANO_NOPRIV_BUILD} ] || extra="-F ${NANO_METALOG}" @@ -357,9 +362,9 @@ create_diskimage_mbr ( ) ( # boot image is on a special partition, ala std-embedded, but that # partition isn't FAT with special files, but a copy of the boot # loader itself. - mkimg ${fmtarg} -s mbr -p ppcboot:=${NANO_WORLDDIR}/boot/boot1.elf \ + mkimg -a 1 ${fmtarg} -s mbr -p ppcboot:=${NANO_OBJ}/_.s1 \ -p ${s2}:=${NANO_OBJ}/_.s2 \ - -p ${s3}:=${NANO_OBJ}/_.s3 \ + -p ${s3}:=${NANO_OBJ}/_.s3a \ -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} ;; esac Modified: head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg ============================================================================== --- head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg Fri Dec 11 02:06:03 2015 (r292074) +++ head/tools/tools/nanobsd/embedded/qemu-powerpc64.cfg Fri Dec 11 05:15:13 2015 (r292075) @@ -31,6 +31,6 @@ NANO_KERNEL=GENERIC64 NANO_DRIVE=ada0 NANO_NAME=qemu-powerpc64 -qemu_env +NANO_DISKIMAGE_FORMAT=qcow2 . common # Pull in common definitions, keep last From owner-svn-src-all@freebsd.org Fri Dec 11 05:26:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2618E9D6743; Fri, 11 Dec 2015 05:26:48 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0B3C1DA6; Fri, 11 Dec 2015 05:26:47 +0000 (UTC) (envelope-from gshapiro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB5QkIG011692; Fri, 11 Dec 2015 05:26:46 GMT (envelope-from gshapiro@FreeBSD.org) Received: (from gshapiro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB5Qkdl011691; Fri, 11 Dec 2015 05:26:46 GMT (envelope-from gshapiro@FreeBSD.org) Message-Id: <201512110526.tBB5Qkdl011691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gshapiro set sender to gshapiro@FreeBSD.org using -f From: Gregory Neil Shapiro Date: Fri, 11 Dec 2015 05:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292076 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 05:26:48 -0000 Author: gshapiro Date: Fri Dec 11 05:26:46 2015 New Revision: 292076 URL: https://svnweb.freebsd.org/changeset/base/292076 Log: Retain maintership over sendmail pieces so I can keep upstream in sync Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Fri Dec 11 05:15:13 2015 (r292075) +++ head/MAINTAINERS Fri Dec 11 05:26:46 2015 (r292076) @@ -37,6 +37,8 @@ contrib/llvm/tools/lldb emaste Pre-commi contrib/netbsd-tests freebsd-testing,ngie Pre-commit review requested. contrib/pjdfstest freebsd-testing,ngie,pjd Pre-commit review requested. dev/usb/wlan adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org +etc/mail gshapiro Pre-commit review requested. Keep in sync with -STABLE. +etc/sendmail gshapiro Pre-commit review requested. Keep in sync with -STABLE. fetch des Pre-commit review requested. isci(4) jimharris Pre-commit review requested. iwm(4) adrian Pre-commit review requested, send to freebsd-wireless@freebsd.org @@ -63,6 +65,7 @@ pseudofs des Pre-commit review requested release/release.sh gjb,re Pre-commit review and regression tests requested. sctp rrs,tuexen Pre-commit review requested (changes need to be backported to github). +sendmail gshapiro Pre-commit review requested. sh(1) jilles Pre-commit review requested. This also applies to kill(1), printf(1) and test(1) which are compiled in as builtins. @@ -104,11 +107,6 @@ cd(4) ken Pre-commit review requested. pass(4) ken Pre-commit review requested. ch(4) ken Pre-commit review requested. em(4) jfv Pre-commit review requested. -sendmail gshapiro Pre-commit review requested. -etc/mail gshapiro Pre-commit review requested. - Keep in sync with -STABLE. -etc/sendmail gshapiro Pre-commit review requested. - Keep in sync with -STABLE. nvi peter Try not to break it. libz peter Try not to break it. groff ru Recommends pre-commit review. From owner-svn-src-all@freebsd.org Fri Dec 11 05:27:55 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31A099D681D; Fri, 11 Dec 2015 05:27:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0D5A31F19; Fri, 11 Dec 2015 05:27:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB5RsBd011879; Fri, 11 Dec 2015 05:27:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB5Rs8u011875; Fri, 11 Dec 2015 05:27:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512110527.tBB5Rs8u011875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 11 Dec 2015 05:27:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292077 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 05:27:55 -0000 Author: imp Date: Fri Dec 11 05:27:53 2015 New Revision: 292077 URL: https://svnweb.freebsd.org/changeset/base/292077 Log: Create the MDT_PNP_INFO metadata record to communicate PNP info about modules. External agents may use this data to automatically load those modules. Differential Review: https://reviews.freebsd.org/D3461 Modified: head/sys/kern/kern_linker.c head/sys/sys/module.h Modified: head/sys/kern/kern_linker.c ============================================================================== --- head/sys/kern/kern_linker.c Fri Dec 11 05:26:46 2015 (r292076) +++ head/sys/kern/kern_linker.c Fri Dec 11 05:27:53 2015 (r292077) @@ -1409,7 +1409,7 @@ linker_addmodules(linker_file_t lf, stru if (mp->md_type != MDT_VERSION) continue; modname = mp->md_cval; - ver = ((struct mod_version *)mp->md_data)->mv_version; + ver = ((const struct mod_version *)mp->md_data)->mv_version; if (modlist_lookup(modname, ver) != NULL) { printf("module %s already present!\n", modname); /* XXX what can we do? this is a build error. :-( */ @@ -1530,7 +1530,7 @@ restart: if (mp->md_type != MDT_VERSION) continue; modname = mp->md_cval; - nver = ((struct mod_version *) + nver = ((const struct mod_version *) mp->md_data)->mv_version; if (modlist_lookup(modname, nver) != NULL) { @@ -2056,7 +2056,7 @@ linker_load_dependencies(linker_file_t l if (mp->md_type != MDT_VERSION) continue; modname = mp->md_cval; - ver = ((struct mod_version *)mp->md_data)->mv_version; + ver = ((const struct mod_version *)mp->md_data)->mv_version; mod = modlist_lookup(modname, ver); if (mod != NULL) { printf("interface %s.%d already present in the KLD" Modified: head/sys/sys/module.h ============================================================================== --- head/sys/sys/module.h Fri Dec 11 05:26:46 2015 (r292076) +++ head/sys/sys/module.h Fri Dec 11 05:27:53 2015 (r292077) @@ -89,10 +89,19 @@ struct mod_version { struct mod_metadata { int md_version; /* structure version MDTV_* */ int md_type; /* type of entry MDT_* */ - void *md_data; /* specific data */ + const void *md_data; /* specific data */ const char *md_cval; /* common string label */ }; +struct mod_pnp_match_info +{ + const char *descr; /* Description of the table */ + const char *bus; /* Name of the bus for this table */ + const void *table; /* Pointer to pnp table */ + int entry_len; /* Length of each entry in the table (may be */ + /* logner than descr descriebs). */ + int num_entry; /* Number of entries in the table */ +}; #ifdef _KERNEL #include @@ -155,6 +164,44 @@ struct mod_metadata { MODULE_METADATA(_##module##_version, MDT_VERSION, \ &_##module##_version, #module) +/** + * Generic macros to create pnp info hints that modules may export + * to allow external tools to parse their intenral device tables + * to make an informed guess about what driver(s) to load. + */ +#define MODULE_PNP_INFO(d, b, unique, t, l, n) \ + static const struct mod_pnp_match_info _module_pnp_##b##_##unique = { \ + .descr = d, \ + .bus = #b, \ + .table = t, \ + .entry_len = l, \ + .num_entry = n \ + }; \ + MODULE_METADATA(_md_##b##_pnpinfo_##unique, MDT_PNP_INFO, \ + &_module_pnp_##b##_##unique, #b); +/** + * descr is a string that describes each entry in the table. The general + * form is (TYPE:pnp_name[/pnp_name];)* + * where TYPE is one of the following: + * U8 uint8_t element + * V8 like U8 and 0xff means match any + * G16 uint16_t element, any value >= matches + * L16 uint16_t element, any value <= matches + * M16 uint16_t element, mask of which of the following fields to use. + * U16 uint16_t element + * V16 like U16 and 0xffff means match any + * U32 uint32_t element + * V32 like U32 and 0xffffffff means match any + * W32 Two 16-bit values with first pnp_name in LSW and second in MSW. + * Z pointer to a string to match exactly + * D like Z, but is the string passed to device_set_descr() + * P A pointer that should be ignored + * E EISA PNP Identifier (in binary, but bus publishes string) + * K Key for whole table. pnp_name=value. must be last, if present. + * + * The pnp_name "#" is reserved for other fields that should be ignored. + */ + extern struct sx modules_sx; #define MOD_XLOCK sx_xlock(&modules_sx) From owner-svn-src-all@freebsd.org Fri Dec 11 05:27:56 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B1A39D6829; Fri, 11 Dec 2015 05:27:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 641601F1B; Fri, 11 Dec 2015 05:27:56 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB5RtmA011924; Fri, 11 Dec 2015 05:27:55 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB5RtmA011923; Fri, 11 Dec 2015 05:27:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512110527.tBB5RtmA011923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 11 Dec 2015 05:27:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292078 - head/usr.sbin/kldxref X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 05:27:56 -0000 Author: imp Date: Fri Dec 11 05:27:55 2015 New Revision: 292078 URL: https://svnweb.freebsd.org/changeset/base/292078 Log: Augment kldxref to find the new MODULE_PNP_INFO records now in modules, simplify them into a more normal form and write them to linker.hints. Differential Review: https://reviews.freebsd.org/D3461 Modified: head/usr.sbin/kldxref/kldxref.c Modified: head/usr.sbin/kldxref/kldxref.c ============================================================================== --- head/usr.sbin/kldxref/kldxref.c Fri Dec 11 05:27:53 2015 (r292077) +++ head/usr.sbin/kldxref/kldxref.c Fri Dec 11 05:27:55 2015 (r292078) @@ -34,6 +34,7 @@ #include #include +#include #include #include #include @@ -53,7 +54,7 @@ #include "ef.h" -#define MAXRECSIZE 8192 +#define MAXRECSIZE (64 << 10) /* 64k */ #define check(val) if ((error = (val)) != 0) break static int dflag; /* do not create a hint file, only write on stdout */ @@ -134,14 +135,244 @@ record_string(const char *str) return record_buf(str, len); } +/* From sys/isa/pnp.c */ +static char * +pnp_eisaformat(uint32_t id) +{ + uint8_t *data; + static char idbuf[8]; + const char hextoascii[] = "0123456789abcdef"; + + id = htole32(id); + data = (uint8_t *)&id; + idbuf[0] = '@' + ((data[0] & 0x7c) >> 2); + idbuf[1] = '@' + (((data[0] & 0x3) << 3) + ((data[1] & 0xe0) >> 5)); + idbuf[2] = '@' + (data[1] & 0x1f); + idbuf[3] = hextoascii[(data[2] >> 4)]; + idbuf[4] = hextoascii[(data[2] & 0xf)]; + idbuf[5] = hextoascii[(data[3] >> 4)]; + idbuf[6] = hextoascii[(data[3] & 0xf)]; + idbuf[7] = 0; + return(idbuf); +} + +struct pnp_elt +{ + int pe_kind; /* What kind of entry */ +#define TYPE_SZ_MASK 0x0f +#define TYPE_FLAGGED 0x10 /* all f's is a wildcard */ +#define TYPE_INT 0x20 /* Is a number */ +#define TYPE_PAIRED 0x40 +#define TYPE_LE 0x80 /* Matches <= this value */ +#define TYPE_GE 0x100 /* Matches >= this value */ +#define TYPE_MASK 0x200 /* Specifies a mask to follow */ +#define TYPE_U8 (1 | TYPE_INT) +#define TYPE_V8 (1 | TYPE_INT | TYPE_FLAGGED) +#define TYPE_G16 (2 | TYPE_INT | TYPE_GE) +#define TYPE_L16 (2 | TYPE_INT | TYPE_LE) +#define TYPE_M16 (2 | TYPE_INT | TYPE_MASK) +#define TYPE_U16 (2 | TYPE_INT) +#define TYPE_V16 (2 | TYPE_INT | TYPE_FLAGGED) +#define TYPE_U32 (4 | TYPE_INT) +#define TYPE_V32 (4 | TYPE_INT | TYPE_FLAGGED) +#define TYPE_W32 (4 | TYPE_INT | TYPE_PAIRED) +#define TYPE_D 7 +#define TYPE_Z 8 +#define TYPE_P 9 +#define TYPE_E 10 +#define TYPE_T 11 + int pe_offset; /* Offset within the element */ + char * pe_key; /* pnp key name */ + TAILQ_ENTRY(pnp_elt) next; /* Link */ +}; +typedef TAILQ_HEAD(pnp_head, pnp_elt) pnp_list; + +/* + * this function finds the data from the pnp table, as described by the + * the description and creates a new output (new_desc). This output table + * is a form that's easier for the agent that's automatically loading the + * modules. + * + * The format output is the simplified string from this routine in the + * same basic format as the pnp string, as documented in sys/module.h. + * First a string describing the format is output, the a count of the + * number of records, then each record. The format string also describes + * the length of each entry (though it isn't a fixed length when strings + * are present). + * + * type Output Meaning + * I uint32_t Integer equality comparison + * J uint32_t Pair of uint16_t fields converted to native + byte order. The two fields both must match. + * G uint32_t Greater than or equal to + * L uint32_t Less than or equal to + * M uint32_t Mask of which fields to test. Fields that + take up space increment the count. This + field must be first, and resets the count. + * D string Description of the device this pnp info is for + * Z string pnp string must match this + * T nothing T fields set pnp values that must be true for + * the entire table. + * Values are packed the same way that other values are packed in this file. + * Strings and int32_t's start on a 32-bit boundary and are padded with 0 + * bytes. Objects that are smaller than uint32_t are converted, without + * sign extension to uint32_t to simplify parsing downstream. + */ +static int +parse_pnp_list(const char *desc, char **new_desc, pnp_list *list) +{ + const char *walker = desc, *ep = desc + strlen(desc); + const char *colon, *semi; + struct pnp_elt *elt; + char *nd; + char type[8], key[32]; + int off; + + off = 0; + nd = *new_desc = malloc(strlen(desc) + 1); + if (verbose > 1) + printf("Converting %s into a list\n", desc); + while (walker < ep) { + colon = strchr(walker, ':'); + semi = strchr(walker, ';'); + if (semi != NULL && semi < colon) + goto err; + if (colon - walker > sizeof(type)) + goto err; + strncpy(type, walker, colon - walker); + type[colon - walker] = '\0'; + if (semi) { + if (semi - colon >= sizeof(key)) + goto err; + strncpy(key, colon + 1, semi - colon - 1); + key[semi - colon - 1] = '\0'; + walker = semi + 1; + } else { + if (strlen(colon + 1) >= sizeof(key)) + goto err; + strcpy(key, colon + 1); + walker = ep; + } + if (verbose > 1) + printf("Found type %s for name %s\n", type, key); + /* Skip pointer place holders */ + if (strcmp(type, "P") == 0) { + off += sizeof(void *); + continue; + } + + /* + * Add a node of the appropriate type + */ + elt = malloc(sizeof(struct pnp_elt) + strlen(key) + 1); + TAILQ_INSERT_TAIL(list, elt, next); + elt->pe_key = (char *)(elt + 1); + elt->pe_offset = off; + if (strcmp(type, "U8") == 0) + elt->pe_kind = TYPE_U8; + else if (strcmp(type, "V8") == 0) + elt->pe_kind = TYPE_V8; + else if (strcmp(type, "G16") == 0) + elt->pe_kind = TYPE_G16; + else if (strcmp(type, "L16") == 0) + elt->pe_kind = TYPE_L16; + else if (strcmp(type, "M16") == 0) + elt->pe_kind = TYPE_M16; + else if (strcmp(type, "U16") == 0) + elt->pe_kind = TYPE_U16; + else if (strcmp(type, "V16") == 0) + elt->pe_kind = TYPE_V16; + else if (strcmp(type, "U32") == 0) + elt->pe_kind = TYPE_U32; + else if (strcmp(type, "V32") == 0) + elt->pe_kind = TYPE_V32; + else if (strcmp(type, "W32") == 0) + elt->pe_kind = TYPE_W32; + else if (strcmp(type, "D") == 0) /* description char * */ + elt->pe_kind = TYPE_D; + else if (strcmp(type, "Z") == 0) /* char * to match */ + elt->pe_kind = TYPE_Z; + else if (strcmp(type, "P") == 0) /* Pointer -- ignored */ + elt->pe_kind = TYPE_P; + else if (strcmp(type, "E") == 0) /* EISA PNP ID, as uint32_t */ + elt->pe_kind = TYPE_E; + else if (strcmp(type, "T") == 0) + elt->pe_kind = TYPE_T; + else + goto err; + /* + * Maybe the rounding here needs to be more nuanced and/or somehow + * architecture specific. Fortunately, most tables in the system + * have sane ordering of types. + */ + if (elt->pe_kind & TYPE_INT) { + elt->pe_offset = roundup2(elt->pe_offset, elt->pe_kind & TYPE_SZ_MASK); + off = elt->pe_offset + (elt->pe_kind & TYPE_SZ_MASK); + } else if (elt->pe_kind == TYPE_E) { + /* Type E stored as Int, displays as string */ + elt->pe_offset = roundup2(elt->pe_offset, sizeof(uint32_t)); + off = elt->pe_offset + sizeof(uint32_t); + } else if (elt->pe_kind == TYPE_T) { + /* doesn't actually consume space in the table */ + off = elt->pe_offset; + } else { + elt->pe_offset = roundup2(elt->pe_offset, sizeof(void *)); + off = elt->pe_offset + sizeof(void *); + } + if (elt->pe_kind & TYPE_PAIRED) { + char *word, *ctx; + + for (word = strtok_r(key, "/", &ctx); + word; word = strtok_r(NULL, "/", &ctx)) { + sprintf(nd, "%c:%s;", elt->pe_kind & TYPE_FLAGGED ? 'J' : 'I', + word); + nd += strlen(nd); + } + + } + else { + if (elt->pe_kind & TYPE_FLAGGED) + *nd++ = 'J'; + else if (elt->pe_kind & TYPE_GE) + *nd++ = 'G'; + else if (elt->pe_kind & TYPE_LE) + *nd++ = 'L'; + else if (elt->pe_kind & TYPE_MASK) + *nd++ = 'M'; + else if (elt->pe_kind & TYPE_INT) + *nd++ = 'I'; + else if (elt->pe_kind == TYPE_D) + *nd++ = 'D'; + else if (elt->pe_kind == TYPE_Z || elt->pe_kind == TYPE_E) + *nd++ = 'Z'; + else if (elt->pe_kind == TYPE_T) + *nd++ = 'T'; + else + errx(1, "Impossible type %x\n", elt->pe_kind); + *nd++ = ':'; + strcpy(nd, key); + nd += strlen(nd); + *nd++ = ';'; + } + } + *nd++ = '\0'; + return 0; +err: + errx(1, "Parse error of description string %s", desc); +} + static int parse_entry(struct mod_metadata *md, const char *cval, struct elf_file *ef, const char *kldname) { struct mod_depend mdp; struct mod_version mdv; + struct mod_pnp_match_info pnp; + char descr[1024]; Elf_Off data = (Elf_Off)md->md_data; - int error = 0; + int error = 0, i, len; + char *walker; + void *table; record_start(); switch (md->md_type) { @@ -173,9 +404,119 @@ parse_entry(struct mod_metadata *md, con } break; case MDT_PNP_INFO: + check(EF_SEG_READ_REL(ef, data, sizeof(pnp), &pnp)); + check(EF_SEG_READ(ef, (Elf_Off)pnp.descr, sizeof(descr), descr)); + descr[sizeof(descr) - 1] = '\0'; if (dflag) { - printf(" pnp info for bus %s\n", cval); + printf(" pnp info for bus %s format %s %d entries of %d bytes\n", + cval, descr, pnp.num_entry, pnp.entry_len); + } else { + pnp_list list; + struct pnp_elt *elt, *elt_tmp; + char *new_descr; + + if (verbose > 1) + printf(" pnp info for bus %s format %s %d entries of %d bytes\n", + cval, descr, pnp.num_entry, pnp.entry_len); + /* + * Parse descr to weed out the chaff and to create a list + * of offsets to output. + */ + TAILQ_INIT(&list); + parse_pnp_list(descr, &new_descr, &list); + record_int(MDT_PNP_INFO); + record_string(cval); + record_string(new_descr); + record_int(pnp.num_entry); + len = pnp.num_entry * pnp.entry_len; + walker = table = malloc(len); + check(EF_SEG_READ_REL(ef, (Elf_Off)pnp.table, len, table)); + + /* + * Walk the list and output things. We've collapsed all the + * variant forms of the table down to just ints and strings. + */ + for (i = 0; i < pnp.num_entry; i++) { + TAILQ_FOREACH(elt, &list, next) { + uint8_t v1; + uint16_t v2; + uint32_t v4; + int value; + char buffer[1024]; + + if (elt->pe_kind == TYPE_W32) { + memcpy(&v4, walker + elt->pe_offset, sizeof(v4)); + value = v4 & 0xffff; + record_int(value); + if (verbose > 1) + printf("W32:%#x", value); + value = (v4 >> 16) & 0xffff; + record_int(value); + if (verbose > 1) + printf(":%#x;", value); + } else if (elt->pe_kind & TYPE_INT) { + switch (elt->pe_kind & TYPE_SZ_MASK) { + case 1: + memcpy(&v1, walker + elt->pe_offset, sizeof(v1)); + if ((elt->pe_kind & TYPE_FLAGGED) && v1 == 0xff) + value = -1; + else + value = v1; + break; + case 2: + memcpy(&v2, walker + elt->pe_offset, sizeof(v2)); + if ((elt->pe_kind & TYPE_FLAGGED) && v2 == 0xffff) + value = -1; + else + value = v2; + break; + case 4: + memcpy(&v4, walker + elt->pe_offset, sizeof(v4)); + if ((elt->pe_kind & TYPE_FLAGGED) && v4 == 0xffffffff) + value = -1; + else + value = v4; + break; + default: + errx(1, "Invalid size somehow %#x", elt->pe_kind); + } + if (verbose > 1) + printf("I:%#x;", value); + record_int(value); + } else if (elt->pe_kind == TYPE_T) { + /* Do nothing */ + } else { /* E, Z or D -- P already filtered */ + if (elt->pe_kind == TYPE_E) { + memcpy(&v4, walker + elt->pe_offset, sizeof(v4)); + strcpy(buffer, pnp_eisaformat(v4)); + } else { + char *ptr; + + ptr = *(char **)(walker + elt->pe_offset); + buffer[0] = '\0'; + if (ptr != 0) { + EF_SEG_READ(ef, (Elf_Off)ptr, + sizeof(buffer), buffer); + buffer[sizeof(buffer) - 1] = '\0'; + } + } + if (verbose > 1) + printf("%c:%s;", elt->pe_kind == TYPE_E ? 'E' : (elt->pe_kind == TYPE_Z ? 'Z' : 'D'), buffer); + record_string(buffer); + } + } + if (verbose > 1) + printf("\n"); + walker += pnp.entry_len; + } + /* Now free it */ + TAILQ_FOREACH_SAFE(elt, &list, next, elt_tmp) { + TAILQ_REMOVE(&list, elt, next); + free(elt); + } + free(table); } + break; default: warnx("unknown metadata record %d in file %s", md->md_type, kldname); } From owner-svn-src-all@freebsd.org Fri Dec 11 05:27:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C612B9D6850; Fri, 11 Dec 2015 05:27:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8DBA61F67; Fri, 11 Dec 2015 05:27:59 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB5RwAK011992; Fri, 11 Dec 2015 05:27:58 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB5Ruiv011968; Fri, 11 Dec 2015 05:27:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512110527.tBB5Ruiv011968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 11 Dec 2015 05:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292079 - in head/sys: dev/aic dev/an dev/ata dev/cmx dev/cs dev/ed dev/ep dev/ex dev/fdc dev/fe dev/ncv dev/nsp dev/pccard dev/sn dev/snc dev/stg dev/uart dev/wi dev/xe netgraph/blueto... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 05:27:59 -0000 Author: imp Date: Fri Dec 11 05:27:56 2015 New Revision: 292079 URL: https://svnweb.freebsd.org/changeset/base/292079 Log: Create a generic PCCARD_PNP_INFO from the MODULE_PNP_INFO building block. Use it in all the PNP drivers to export either the current PNP table. For uart, create a custom table and export it using MODULE_PNP_INFO since it's the only one that matches on function number. Differential Review: https://reviews.freebsd.org/D3461 Modified: head/sys/dev/aic/aic_pccard.c head/sys/dev/an/if_an_pccard.c head/sys/dev/ata/ata-card.c head/sys/dev/cmx/cmx_pccard.c head/sys/dev/cs/if_cs_pccard.c head/sys/dev/ed/if_ed_pccard.c head/sys/dev/ep/if_ep_pccard.c head/sys/dev/ex/if_ex_pccard.c head/sys/dev/fdc/fdc_pccard.c head/sys/dev/fe/if_fe_pccard.c head/sys/dev/ncv/ncr53c500_pccard.c head/sys/dev/nsp/nsp_pccard.c head/sys/dev/pccard/pccardvar.h head/sys/dev/sn/if_sn_pccard.c head/sys/dev/snc/if_snc_pccard.c head/sys/dev/stg/tmc18c30_pccard.c head/sys/dev/uart/uart_bus_pccard.c head/sys/dev/wi/if_wi_pccard.c head/sys/dev/xe/if_xe_pccard.c head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Modified: head/sys/dev/aic/aic_pccard.c ============================================================================== --- head/sys/dev/aic/aic_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/aic/aic_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -196,3 +196,4 @@ extern devclass_t aic_devclass; MODULE_DEPEND(aic, cam, 1,1,1); DRIVER_MODULE(aic, pccard, aic_pccard_driver, aic_devclass, 0, 0); +PCCARD_PNP_INFO(aic_pccard_products); Modified: head/sys/dev/an/if_an_pccard.c ============================================================================== --- head/sys/dev/an/if_an_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/an/if_an_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -108,6 +108,7 @@ static const struct pccard_product an_pc PCMCIA_CARD(XIRCOM, CWE1130), { NULL } }; +PCCARD_PNP_INFO(an_pccard_products); static int an_pccard_probe(device_t dev) Modified: head/sys/dev/ata/ata-card.c ============================================================================== --- head/sys/dev/ata/ata-card.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/ata/ata-card.c Fri Dec 11 05:27:56 2015 (r292079) @@ -183,3 +183,4 @@ static driver_t ata_pccard_driver = { DRIVER_MODULE(ata, pccard, ata_pccard_driver, ata_devclass, NULL, NULL); MODULE_DEPEND(ata, ata, 1, 1, 1); +PCCARD_PNP_INFO(ata_pccard_products); Modified: head/sys/dev/cmx/cmx_pccard.c ============================================================================== --- head/sys/dev/cmx/cmx_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/cmx/cmx_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -112,4 +112,4 @@ static driver_t cmx_pccard_driver = { }; DRIVER_MODULE(cmx, pccard, cmx_pccard_driver, cmx_devclass, 0, 0); - +PCCARD_PNP_INFO(cmx_pccard_products); Modified: head/sys/dev/cs/if_cs_pccard.c ============================================================================== --- head/sys/dev/cs/if_cs_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/cs/if_cs_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -56,6 +56,7 @@ static const struct pccard_product cs_pc PCMCIA_CARD(IBM, ETHERJET), { NULL } }; + static int cs_pccard_probe(device_t dev) { @@ -115,3 +116,4 @@ extern devclass_t cs_devclass; DRIVER_MODULE(cs, pccard, cs_pccard_driver, cs_devclass, 0, 0); MODULE_DEPEND(cs, ether, 1, 1, 1); +PCCARD_PNP_INFO(cs_pccard_products); Modified: head/sys/dev/ed/if_ed_pccard.c ============================================================================== --- head/sys/dev/ed/if_ed_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/ed/if_ed_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -1248,3 +1248,4 @@ DRIVER_MODULE(ed, pccard, ed_pccard_driv DRIVER_MODULE(miibus, ed, miibus_driver, miibus_devclass, 0, NULL); MODULE_DEPEND(ed, miibus, 1, 1, 1); MODULE_DEPEND(ed, ether, 1, 1, 1); +PCCARD_PNP_INFO(ed_pccard_products); Modified: head/sys/dev/ep/if_ep_pccard.c ============================================================================== --- head/sys/dev/ep/if_ep_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/ep/if_ep_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -235,3 +235,4 @@ static driver_t ep_pccard_driver = { extern devclass_t ep_devclass; DRIVER_MODULE(ep, pccard, ep_pccard_driver, ep_devclass, 0, 0); +PCCARD_PNP_INFO(ep_pccard_products); Modified: head/sys/dev/ex/if_ex_pccard.c ============================================================================== --- head/sys/dev/ex/if_ex_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/ex/if_ex_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -228,3 +228,4 @@ static driver_t ex_pccard_driver = { DRIVER_MODULE(ex, pccard, ex_pccard_driver, ex_devclass, 0, 0); MODULE_DEPEND(ex, pccard, 1, 1, 1); +PCCARD_PNP_INFO(ex_pccard_products); Modified: head/sys/dev/fdc/fdc_pccard.c ============================================================================== --- head/sys/dev/fdc/fdc_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/fdc/fdc_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -139,3 +139,4 @@ static driver_t fdc_pccard_driver = { }; DRIVER_MODULE(fdc, pccard, fdc_pccard_driver, fdc_devclass, 0, 0); +PCCARD_PNP_INFO(fdc_pccard_products); Modified: head/sys/dev/fe/if_fe_pccard.c ============================================================================== --- head/sys/dev/fe/if_fe_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/fe/if_fe_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -145,6 +145,7 @@ static driver_t fe_pccard_driver = { DRIVER_MODULE(fe, pccard, fe_pccard_driver, fe_devclass, 0, 0); MODULE_DEPEND(fe, pccard, 1, 1, 1); +PCCARD_PNP_INFO(fe_pccard_products); static int fe_probe_mbh(device_t, const struct fe_pccard_product *); static int fe_probe_tdk(device_t, const struct fe_pccard_product *); Modified: head/sys/dev/ncv/ncr53c500_pccard.c ============================================================================== --- head/sys/dev/ncv/ncr53c500_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/ncv/ncr53c500_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -293,6 +293,7 @@ static devclass_t ncv_devclass; MODULE_DEPEND(ncv, scsi_low, 1, 1, 1); DRIVER_MODULE(ncv, pccard, ncv_pccard_driver, ncv_devclass, 0, 0); +PCCARD_PNP_INFO(ncv_pccard_products); static void ncv_card_unload(device_t devi) Modified: head/sys/dev/nsp/nsp_pccard.c ============================================================================== --- head/sys/dev/nsp/nsp_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/nsp/nsp_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -233,6 +233,7 @@ static devclass_t nsp_devclass; MODULE_DEPEND(nsp, scsi_low, 1, 1, 1); DRIVER_MODULE(nsp, pccard, nsp_pccard_driver, nsp_devclass, 0, 0); +PCCARD_PNP_INFO(nsp_pccard_products); static void nsp_card_unload(device_t devi) Modified: head/sys/dev/pccard/pccardvar.h ============================================================================== --- head/sys/dev/pccard/pccardvar.h Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/pccard/pccardvar.h Fri Dec 11 05:27:56 2015 (r292079) @@ -85,6 +85,16 @@ struct pccard_product { const char *pp_cis[4]; }; +/** + * Note: There's no cis3 or cis4 reported for NOMATCH / pnpinfo events for pccard + * It's unclear if we actually need that for automatic loading or not. These stirngs + * are informative, according to the standard, but I have a dim memory of using these + * strings to match things, though I can't find the example right now. + */ +#define PCCARD_PNP_DESCR "D:human;V32:manufacturer;V32:product;Z:cisvendor;Z:cisproduct;" +#define PCCARD_PNP_INFO(t) \ + MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0])); \ + typedef int (*pccard_product_match_fn) (device_t dev, const struct pccard_product *ent, int vpfmatch); Modified: head/sys/dev/sn/if_sn_pccard.c ============================================================================== --- head/sys/dev/sn/if_sn_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/sn/if_sn_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -327,3 +327,4 @@ extern devclass_t sn_devclass; DRIVER_MODULE(sn, pccard, sn_pccard_driver, sn_devclass, 0, 0); MODULE_DEPEND(sn, ether, 1, 1, 1); +PCCARD_PNP_INFO(sn_pccard_products); Modified: head/sys/dev/snc/if_snc_pccard.c ============================================================================== --- head/sys/dev/snc/if_snc_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/snc/if_snc_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -92,6 +92,7 @@ static driver_t snc_pccard_driver = { DRIVER_MODULE(snc, pccard, snc_pccard_driver, snc_devclass, 0, 0); MODULE_DEPEND(snc, ether, 1, 1, 1); +PCCARD_PNP_INFO(snc_pccard_products); /* * snc_pccard_detach - detach this instance from the device. Modified: head/sys/dev/stg/tmc18c30_pccard.c ============================================================================== --- head/sys/dev/stg/tmc18c30_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/stg/tmc18c30_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -136,3 +136,4 @@ static driver_t stg_pccard_driver = { DRIVER_MODULE(stg, pccard, stg_pccard_driver, stg_devclass, 0, 0); MODULE_DEPEND(stg, scsi_low, 1, 1, 1); +PCCARD_PNP_INFO(stg_pccard_products); Modified: head/sys/dev/uart/uart_bus_pccard.c ============================================================================== --- head/sys/dev/uart/uart_bus_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/uart/uart_bus_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -55,6 +55,8 @@ static device_method_t uart_pccard_metho { 0, 0 } }; +static uint32_t uart_pccard_function = PCCARD_FUNCTION_SERIAL; + static driver_t uart_pccard_driver = { uart_driver_name, uart_pccard_methods, @@ -76,7 +78,7 @@ uart_pccard_probe(device_t dev) * some serial cards are better serviced by other drivers, so * allow other drivers to claim it, if they want. */ - if (fcn == PCCARD_FUNCTION_SERIAL) + if (fcn == uart_pccard_function) return (BUS_PROBE_GENERIC); return (ENXIO); @@ -98,3 +100,5 @@ uart_pccard_attach(device_t dev) } DRIVER_MODULE(uart, pccard, uart_pccard_driver, uart_devclass, 0, 0); +MODULE_PNP_INFO("U32:function_type;", pccard, uart, &uart_pccard_function, + sizeof(uart_pccard_function), 1); Modified: head/sys/dev/wi/if_wi_pccard.c ============================================================================== --- head/sys/dev/wi/if_wi_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/wi/if_wi_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -153,6 +153,7 @@ static const struct pccard_product wi_pc PCMCIA_CARD(TDK, LAK_CD011WL), { NULL } }; +PCCARD_PNP_INFO(wi_pccard_products); static int wi_pccard_probe(device_t dev) Modified: head/sys/dev/xe/if_xe_pccard.c ============================================================================== --- head/sys/dev/xe/if_xe_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/dev/xe/if_xe_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -386,3 +386,4 @@ static driver_t xe_pccard_driver = { devclass_t xe_devclass; DRIVER_MODULE(xe, pccard, xe_pccard_driver, xe_devclass, 0, 0); +PCCARD_PNP_INFO(xe_pccard_products); Modified: head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Fri Dec 11 05:27:55 2015 (r292078) +++ head/sys/netgraph/bluetooth/drivers/bt3c/ng_bt3c_pccard.c Fri Dec 11 05:27:56 2015 (r292079) @@ -584,14 +584,14 @@ out: * PC Card (PCMCIA) probe routine */ +static struct pccard_product const bt3c_pccard_products[] = { + PCMCIA_CARD(3COM, 3CRWB609), + { NULL, } +}; + static int bt3c_pccard_probe(device_t dev) { - static struct pccard_product const bt3c_pccard_products[] = { - PCMCIA_CARD(3COM, 3CRWB609), - { NULL, } - }; - struct pccard_product const *pp = NULL; pp = pccard_product_lookup(dev, bt3c_pccard_products, @@ -1222,4 +1222,4 @@ bt3c_modevent(module_t mod, int event, v DRIVER_MODULE(bt3c, pccard, bt3c_pccard_driver, bt3c_devclass, bt3c_modevent,0); MODULE_VERSION(ng_bt3c, NG_BLUETOOTH_VERSION); MODULE_DEPEND(ng_bt3c, netgraph, NG_ABI_VERSION, NG_ABI_VERSION,NG_ABI_VERSION); - +PCCARD_PNP_INFO(bt3c_pccard_products); From owner-svn-src-all@freebsd.org Fri Dec 11 05:28:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E9159D68BC; Fri, 11 Dec 2015 05:28:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E543D1251; Fri, 11 Dec 2015 05:28:07 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB5S7Yr012111; Fri, 11 Dec 2015 05:28:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB5S1rW012042; Fri, 11 Dec 2015 05:28:01 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512110528.tBB5S1rW012042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 11 Dec 2015 05:28:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292080 - in head/sys: dev/sound/usb dev/usb dev/usb/input dev/usb/misc dev/usb/net dev/usb/serial dev/usb/storage dev/usb/wlan netgraph/bluetooth/drivers/ubt netgraph/bluetooth/drivers... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 05:28:08 -0000 Author: imp Date: Fri Dec 11 05:28:00 2015 New Revision: 292080 URL: https://svnweb.freebsd.org/changeset/base/292080 Log: Create a USB_PNP_INFO and use it to export the existing PNP tables. Some drivers needed some slight re-arrangement of declarations to accommodate this. Change the USB pnp tables slightly to allow better compatibility with the system by moving linux driver info from start of each entry to the end. All other PNP tables in the system have the per-device flags and such at the end of the elements rather that at the beginning. Differential Review: https://reviews.freebsd.org/D3458 Modified: head/sys/dev/sound/usb/uaudio.c head/sys/dev/usb/input/atp.c head/sys/dev/usb/input/uep.c head/sys/dev/usb/input/uhid.c head/sys/dev/usb/input/ukbd.c head/sys/dev/usb/input/ums.c head/sys/dev/usb/input/wsp.c head/sys/dev/usb/misc/udbp.c head/sys/dev/usb/misc/ufm.c head/sys/dev/usb/misc/ugold.c head/sys/dev/usb/misc/uled.c head/sys/dev/usb/net/if_aue.c head/sys/dev/usb/net/if_axe.c head/sys/dev/usb/net/if_axge.c head/sys/dev/usb/net/if_cdce.c head/sys/dev/usb/net/if_cue.c head/sys/dev/usb/net/if_ipheth.c head/sys/dev/usb/net/if_kue.c head/sys/dev/usb/net/if_mos.c head/sys/dev/usb/net/if_rue.c head/sys/dev/usb/net/if_smsc.c head/sys/dev/usb/net/if_udav.c head/sys/dev/usb/net/if_urndis.c head/sys/dev/usb/net/if_usie.c head/sys/dev/usb/net/uhso.c head/sys/dev/usb/serial/u3g.c head/sys/dev/usb/serial/uark.c head/sys/dev/usb/serial/ubsa.c head/sys/dev/usb/serial/uchcom.c head/sys/dev/usb/serial/ucycom.c head/sys/dev/usb/serial/ufoma.c head/sys/dev/usb/serial/uftdi.c head/sys/dev/usb/serial/ugensa.c head/sys/dev/usb/serial/uipaq.c head/sys/dev/usb/serial/ulpt.c head/sys/dev/usb/serial/umcs.c head/sys/dev/usb/serial/umct.c head/sys/dev/usb/serial/umodem.c head/sys/dev/usb/serial/umoscom.c head/sys/dev/usb/serial/uplcom.c head/sys/dev/usb/serial/uslcom.c head/sys/dev/usb/serial/uvisor.c head/sys/dev/usb/serial/uvscom.c head/sys/dev/usb/storage/umass.c head/sys/dev/usb/storage/urio.c head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usbdi.h head/sys/dev/usb/wlan/if_rsu.c head/sys/dev/usb/wlan/if_rum.c head/sys/dev/usb/wlan/if_run.c head/sys/dev/usb/wlan/if_uath.c head/sys/dev/usb/wlan/if_upgt.c head/sys/dev/usb/wlan/if_ural.c head/sys/dev/usb/wlan/if_urtw.c head/sys/dev/usb/wlan/if_urtwn.c head/sys/dev/usb/wlan/if_zyd.c head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c head/sys/netgraph/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/sound/usb/uaudio.c Fri Dec 11 05:28:00 2015 (r292080) @@ -6118,3 +6118,4 @@ DRIVER_MODULE_ORDERED(uaudio, uhub, uaud MODULE_DEPEND(uaudio, usb, 1, 1, 1); MODULE_DEPEND(uaudio, sound, SOUND_MINVER, SOUND_PREFVER, SOUND_MAXVER); MODULE_VERSION(uaudio, 1); +USB_PNP_HOST_INFO(uaudio_devs); Modified: head/sys/dev/usb/input/atp.c ============================================================================== --- head/sys/dev/usb/input/atp.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/input/atp.c Fri Dec 11 05:28:00 2015 (r292080) @@ -2630,3 +2630,5 @@ static driver_t atp_driver = { DRIVER_MODULE(atp, uhub, atp_driver, atp_devclass, NULL, 0); MODULE_DEPEND(atp, usb, 1, 1, 1); MODULE_VERSION(atp, 1); +USB_PNP_HOST_INFO(fg_devs); +USB_PNP_HOST_INFO(wsp_devs); Modified: head/sys/dev/usb/input/uep.c ============================================================================== --- head/sys/dev/usb/input/uep.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/input/uep.c Fri Dec 11 05:28:00 2015 (r292080) @@ -441,3 +441,4 @@ static driver_t uep_driver = { DRIVER_MODULE(uep, uhub, uep_driver, uep_devclass, NULL, NULL); MODULE_DEPEND(uep, usb, 1, 1, 1); MODULE_VERSION(uep, 1); +USB_PNP_HOST_INFO(uep_devs); Modified: head/sys/dev/usb/input/uhid.c ============================================================================== --- head/sys/dev/usb/input/uhid.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/input/uhid.c Fri Dec 11 05:28:00 2015 (r292080) @@ -878,3 +878,4 @@ static driver_t uhid_driver = { DRIVER_MODULE(uhid, uhub, uhid_driver, uhid_devclass, NULL, 0); MODULE_DEPEND(uhid, usb, 1, 1, 1); MODULE_VERSION(uhid, 1); +USB_PNP_HOST_INFO(uhid_devs); Modified: head/sys/dev/usb/input/ukbd.c ============================================================================== --- head/sys/dev/usb/input/ukbd.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/input/ukbd.c Fri Dec 11 05:28:00 2015 (r292080) @@ -2178,3 +2178,4 @@ static driver_t ukbd_driver = { DRIVER_MODULE(ukbd, uhub, ukbd_driver, ukbd_devclass, ukbd_driver_load, 0); MODULE_DEPEND(ukbd, usb, 1, 1, 1); MODULE_VERSION(ukbd, 1); +USB_PNP_HOST_INFO(ukbd_devs); Modified: head/sys/dev/usb/input/ums.c ============================================================================== --- head/sys/dev/usb/input/ums.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/input/ums.c Fri Dec 11 05:28:00 2015 (r292080) @@ -1052,3 +1052,4 @@ static driver_t ums_driver = { DRIVER_MODULE(ums, uhub, ums_driver, ums_devclass, NULL, 0); MODULE_DEPEND(ums, usb, 1, 1, 1); MODULE_VERSION(ums, 1); +USB_PNP_HOST_INFO(ums_devs); Modified: head/sys/dev/usb/input/wsp.c ============================================================================== --- head/sys/dev/usb/input/wsp.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/input/wsp.c Fri Dec 11 05:28:00 2015 (r292080) @@ -1395,3 +1395,4 @@ static devclass_t wsp_devclass; DRIVER_MODULE(wsp, uhub, wsp_driver, wsp_devclass, NULL, 0); MODULE_DEPEND(wsp, usb, 1, 1, 1); MODULE_VERSION(wsp, 1); +USB_PNP_HOST_INFO(wsp_devs); Modified: head/sys/dev/usb/misc/udbp.c ============================================================================== --- head/sys/dev/usb/misc/udbp.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/misc/udbp.c Fri Dec 11 05:28:00 2015 (r292080) @@ -258,10 +258,20 @@ static driver_t udbp_driver = { .size = sizeof(struct udbp_softc), }; +static const STRUCT_USB_HOST_ID udbp_devs[] = { + {USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_TURBOCONNECT, 0)}, + {USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_GADGETZERO, 0)}, + {USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2301, 0)}, + {USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2302, 0)}, + {USB_VPI(USB_VENDOR_ANCHOR, USB_PRODUCT_ANCHOR_EZLINK, 0)}, + {USB_VPI(USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL620USB, 0)}, +}; + DRIVER_MODULE(udbp, uhub, udbp_driver, udbp_devclass, udbp_modload, 0); MODULE_DEPEND(udbp, netgraph, NG_ABI_VERSION, NG_ABI_VERSION, NG_ABI_VERSION); MODULE_DEPEND(udbp, usb, 1, 1, 1); MODULE_VERSION(udbp, 1); +USB_PNP_HOST_INFO(udbp_devs); static int udbp_modload(module_t mod, int event, void *data) @@ -289,15 +299,6 @@ udbp_modload(module_t mod, int event, vo return (error); } -static const STRUCT_USB_HOST_ID udbp_devs[] = { - {USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_TURBOCONNECT, 0)}, - {USB_VPI(USB_VENDOR_NETCHIP, USB_PRODUCT_NETCHIP_GADGETZERO, 0)}, - {USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2301, 0)}, - {USB_VPI(USB_VENDOR_PROLIFIC, USB_PRODUCT_PROLIFIC_PL2302, 0)}, - {USB_VPI(USB_VENDOR_ANCHOR, USB_PRODUCT_ANCHOR_EZLINK, 0)}, - {USB_VPI(USB_VENDOR_GENESYS, USB_PRODUCT_GENESYS_GL620USB, 0)}, -}; - static int udbp_probe(device_t dev) { Modified: head/sys/dev/usb/misc/ufm.c ============================================================================== --- head/sys/dev/usb/misc/ufm.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/misc/ufm.c Fri Dec 11 05:28:00 2015 (r292080) @@ -115,14 +115,15 @@ static driver_t ufm_driver = { .size = sizeof(struct ufm_softc), }; -DRIVER_MODULE(ufm, uhub, ufm_driver, ufm_devclass, NULL, 0); -MODULE_DEPEND(ufm, usb, 1, 1, 1); -MODULE_VERSION(ufm, 1); - static const STRUCT_USB_HOST_ID ufm_devs[] = { {USB_VPI(USB_VENDOR_CYPRESS, USB_PRODUCT_CYPRESS_FMRADIO, 0)}, }; +DRIVER_MODULE(ufm, uhub, ufm_driver, ufm_devclass, NULL, 0); +MODULE_DEPEND(ufm, usb, 1, 1, 1); +MODULE_VERSION(ufm, 1); +USB_PNP_HOST_INFO(ufm_devs); + static int ufm_probe(device_t dev) { Modified: head/sys/dev/usb/misc/ugold.c ============================================================================== --- head/sys/dev/usb/misc/ugold.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/misc/ugold.c Fri Dec 11 05:28:00 2015 (r292080) @@ -136,9 +136,14 @@ static driver_t ugold_driver = { .size = sizeof(struct ugold_softc), }; +static const STRUCT_USB_HOST_ID ugold_devs[] = { + {USB_VPI(USB_VENDOR_CHICONY2, USB_PRODUCT_CHICONY2_TEMPER, 0)}, +}; + DRIVER_MODULE(ugold, uhub, ugold_driver, ugold_devclass, NULL, NULL); MODULE_DEPEND(ugold, usb, 1, 1, 1); MODULE_VERSION(ugold, 1); +USB_PNP_HOST_INFO(ugold_devs); static const struct usb_config ugold_config[UGOLD_N_TRANSFER] = { @@ -153,10 +158,6 @@ static const struct usb_config ugold_con }, }; -static const STRUCT_USB_HOST_ID ugold_devs[] = { - {USB_VPI(USB_VENDOR_CHICONY2, USB_PRODUCT_CHICONY2_TEMPER, 0)}, -}; - static void ugold_timeout(void *arg) { Modified: head/sys/dev/usb/misc/uled.c ============================================================================== --- head/sys/dev/usb/misc/uled.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/misc/uled.c Fri Dec 11 05:28:00 2015 (r292080) @@ -107,14 +107,15 @@ static driver_t uled_driver = { .size = sizeof(struct uled_softc), }; -DRIVER_MODULE(uled, uhub, uled_driver, uled_devclass, NULL, NULL); -MODULE_DEPEND(uled, usb, 1, 1, 1); -MODULE_VERSION(uled, 1); - static const STRUCT_USB_HOST_ID uled_devs[] = { {USB_VPI(USB_VENDOR_DREAMLINK, USB_PRODUCT_DREAMLINK_DL100B, 0)}, }; +DRIVER_MODULE(uled, uhub, uled_driver, uled_devclass, NULL, NULL); +MODULE_DEPEND(uled, usb, 1, 1, 1); +MODULE_VERSION(uled, 1); +USB_PNP_HOST_INFO(uled_devs); + static int uled_probe(device_t dev) { Modified: head/sys/dev/usb/net/if_aue.c ============================================================================== --- head/sys/dev/usb/net/if_aue.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/net/if_aue.c Fri Dec 11 05:28:00 2015 (r292080) @@ -279,6 +279,7 @@ MODULE_DEPEND(aue, usb, 1, 1, 1); MODULE_DEPEND(aue, ether, 1, 1, 1); MODULE_DEPEND(aue, miibus, 1, 1, 1); MODULE_VERSION(aue, 1); +USB_PNP_HOST_INFO(aue_devs); static const struct usb_ether_methods aue_ue_methods = { .ue_attach_post = aue_attach_post, Modified: head/sys/dev/usb/net/if_axe.c ============================================================================== --- head/sys/dev/usb/net/if_axe.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/net/if_axe.c Fri Dec 11 05:28:00 2015 (r292080) @@ -278,6 +278,7 @@ MODULE_DEPEND(axe, usb, 1, 1, 1); MODULE_DEPEND(axe, ether, 1, 1, 1); MODULE_DEPEND(axe, miibus, 1, 1, 1); MODULE_VERSION(axe, 1); +USB_PNP_HOST_INFO(axe_devs); static const struct usb_ether_methods axe_ue_methods = { .ue_attach_post = axe_attach_post, Modified: head/sys/dev/usb/net/if_axge.c ============================================================================== --- head/sys/dev/usb/net/if_axge.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/net/if_axge.c Fri Dec 11 05:28:00 2015 (r292080) @@ -190,6 +190,7 @@ MODULE_DEPEND(axge, usb, 1, 1, 1); MODULE_DEPEND(axge, ether, 1, 1, 1); MODULE_DEPEND(axge, miibus, 1, 1, 1); MODULE_VERSION(axge, 1); +USB_PNP_HOST_INFO(axge_devs); static const struct usb_ether_methods axge_ue_methods = { .ue_attach_post = axge_attach_post, Modified: head/sys/dev/usb/net/if_cdce.c ============================================================================== --- head/sys/dev/usb/net/if_cdce.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/net/if_cdce.c Fri Dec 11 05:28:00 2015 (r292080) @@ -256,21 +256,6 @@ static eventhandler_tag cdce_etag; static int cdce_driver_loaded(struct module *, int, void *); -DRIVER_MODULE(cdce, uhub, cdce_driver, cdce_devclass, cdce_driver_loaded, 0); -MODULE_VERSION(cdce, 1); -MODULE_DEPEND(cdce, uether, 1, 1, 1); -MODULE_DEPEND(cdce, usb, 1, 1, 1); -MODULE_DEPEND(cdce, ether, 1, 1, 1); - -static const struct usb_ether_methods cdce_ue_methods = { - .ue_attach_post = cdce_attach_post, - .ue_start = cdce_start, - .ue_init = cdce_init, - .ue_stop = cdce_stop, - .ue_setmulti = cdce_setmulti, - .ue_setpromisc = cdce_setpromisc, -}; - static const STRUCT_USB_HOST_ID cdce_switch_devs[] = { {USB_VPI(USB_VENDOR_HUAWEI, USB_PRODUCT_HUAWEI_E3272_INIT, MSC_EJECT_HUAWEI2)}, }; @@ -307,6 +292,24 @@ static const STRUCT_USB_DUAL_ID cdce_dua {USB_IF_CSI(UICLASS_CDC, UISUBCLASS_NETWORK_CONTROL_MODEL, 0)}, }; +DRIVER_MODULE(cdce, uhub, cdce_driver, cdce_devclass, cdce_driver_loaded, 0); +MODULE_VERSION(cdce, 1); +MODULE_DEPEND(cdce, uether, 1, 1, 1); +MODULE_DEPEND(cdce, usb, 1, 1, 1); +MODULE_DEPEND(cdce, ether, 1, 1, 1); +USB_PNP_DEVICE_INFO(cdce_switch_devs); +USB_PNP_HOST_INFO(cdce_host_devs); +USB_PNP_DUAL_INFO(cdce_dual_devs); + +static const struct usb_ether_methods cdce_ue_methods = { + .ue_attach_post = cdce_attach_post, + .ue_start = cdce_start, + .ue_init = cdce_init, + .ue_stop = cdce_stop, + .ue_setmulti = cdce_setmulti, + .ue_setpromisc = cdce_setpromisc, +}; + #if CDCE_HAVE_NCM /*------------------------------------------------------------------------* * cdce_ncm_init Modified: head/sys/dev/usb/net/if_cue.c ============================================================================== --- head/sys/dev/usb/net/if_cue.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/net/if_cue.c Fri Dec 11 05:28:00 2015 (r292080) @@ -177,6 +177,7 @@ MODULE_DEPEND(cue, uether, 1, 1, 1); MODULE_DEPEND(cue, usb, 1, 1, 1); MODULE_DEPEND(cue, ether, 1, 1, 1); MODULE_VERSION(cue, 1); +USB_PNP_HOST_INFO(cue_devs); static const struct usb_ether_methods cue_ue_methods = { .ue_attach_post = cue_attach_post, Modified: head/sys/dev/usb/net/if_ipheth.c ============================================================================== --- head/sys/dev/usb/net/if_ipheth.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/net/if_ipheth.c Fri Dec 11 05:28:00 2015 (r292080) @@ -131,27 +131,6 @@ static driver_t ipheth_driver = { static devclass_t ipheth_devclass; -DRIVER_MODULE(ipheth, uhub, ipheth_driver, ipheth_devclass, NULL, 0); -MODULE_VERSION(ipheth, 1); -MODULE_DEPEND(ipheth, uether, 1, 1, 1); -MODULE_DEPEND(ipheth, usb, 1, 1, 1); -MODULE_DEPEND(ipheth, ether, 1, 1, 1); - -static const struct usb_ether_methods ipheth_ue_methods = { - .ue_attach_post = ipheth_attach_post, - .ue_start = ipheth_start, - .ue_init = ipheth_init, - .ue_tick = ipheth_tick, - .ue_stop = ipheth_stop, - .ue_setmulti = ipheth_setmulti, - .ue_setpromisc = ipheth_setpromisc, -}; - -#define IPHETH_ID(v,p,c,sc,pt) \ - USB_VENDOR(v), USB_PRODUCT(p), \ - USB_IFACE_CLASS(c), USB_IFACE_SUBCLASS(sc), \ - USB_IFACE_PROTOCOL(pt) - static const STRUCT_USB_HOST_ID ipheth_devs[] = { #if 0 {IPHETH_ID(USB_VENDOR_APPLE, USB_PRODUCT_APPLE_IPHONE, @@ -181,6 +160,28 @@ static const STRUCT_USB_HOST_ID ipheth_d #endif }; +DRIVER_MODULE(ipheth, uhub, ipheth_driver, ipheth_devclass, NULL, 0); +MODULE_VERSION(ipheth, 1); +MODULE_DEPEND(ipheth, uether, 1, 1, 1); +MODULE_DEPEND(ipheth, usb, 1, 1, 1); +MODULE_DEPEND(ipheth, ether, 1, 1, 1); +USB_PNP_HOST_INFO(ipheth_devs); + +static const struct usb_ether_methods ipheth_ue_methods = { + .ue_attach_post = ipheth_attach_post, + .ue_start = ipheth_start, + .ue_init = ipheth_init, + .ue_tick = ipheth_tick, + .ue_stop = ipheth_stop, + .ue_setmulti = ipheth_setmulti, + .ue_setpromisc = ipheth_setpromisc, +}; + +#define IPHETH_ID(v,p,c,sc,pt) \ + USB_VENDOR(v), USB_PRODUCT(p), \ + USB_IFACE_CLASS(c), USB_IFACE_SUBCLASS(sc), \ + USB_IFACE_PROTOCOL(pt) + static int ipheth_get_mac_addr(struct ipheth_softc *sc) { Modified: head/sys/dev/usb/net/if_kue.c ============================================================================== --- head/sys/dev/usb/net/if_kue.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/net/if_kue.c Fri Dec 11 05:28:00 2015 (r292080) @@ -219,6 +219,7 @@ MODULE_DEPEND(kue, uether, 1, 1, 1); MODULE_DEPEND(kue, usb, 1, 1, 1); MODULE_DEPEND(kue, ether, 1, 1, 1); MODULE_VERSION(kue, 1); +USB_PNP_HOST_INFO(kue_devs); static const struct usb_ether_methods kue_ue_methods = { .ue_attach_post = kue_attach_post, Modified: head/sys/dev/usb/net/if_mos.c ============================================================================== --- head/sys/dev/usb/net/if_mos.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/net/if_mos.c Fri Dec 11 05:28:00 2015 (r292080) @@ -247,6 +247,7 @@ MODULE_DEPEND(mos, uether, 1, 1, 1); MODULE_DEPEND(mos, usb, 1, 1, 1); MODULE_DEPEND(mos, ether, 1, 1, 1); MODULE_DEPEND(mos, miibus, 1, 1, 1); +USB_PNP_HOST_INFO(mos_devs); static const struct usb_ether_methods mos_ue_methods = { .ue_attach_post = mos_attach_post, Modified: head/sys/dev/usb/net/if_rue.c ============================================================================== --- head/sys/dev/usb/net/if_rue.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/net/if_rue.c Fri Dec 11 05:28:00 2015 (r292080) @@ -214,6 +214,7 @@ MODULE_DEPEND(rue, usb, 1, 1, 1); MODULE_DEPEND(rue, ether, 1, 1, 1); MODULE_DEPEND(rue, miibus, 1, 1, 1); MODULE_VERSION(rue, 1); +USB_PNP_HOST_INFO(rue_devs); static const struct usb_ether_methods rue_ue_methods = { .ue_attach_post = rue_attach_post, Modified: head/sys/dev/usb/net/if_smsc.c ============================================================================== --- head/sys/dev/usb/net/if_smsc.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/net/if_smsc.c Fri Dec 11 05:28:00 2015 (r292080) @@ -1858,3 +1858,4 @@ MODULE_DEPEND(smsc, usb, 1, 1, 1); MODULE_DEPEND(smsc, ether, 1, 1, 1); MODULE_DEPEND(smsc, miibus, 1, 1, 1); MODULE_VERSION(smsc, 1); +USB_PNP_HOST_INFO(smsc_devs); Modified: head/sys/dev/usb/net/if_udav.c ============================================================================== --- head/sys/dev/usb/net/if_udav.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/net/if_udav.c Fri Dec 11 05:28:00 2015 (r292080) @@ -165,6 +165,21 @@ static driver_t udav_driver = { static devclass_t udav_devclass; +static const STRUCT_USB_HOST_ID udav_devs[] = { + /* ShanTou DM9601 USB NIC */ + {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_DM9601, 0)}, + /* ShanTou ST268 USB NIC */ + {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ST268, 0)}, + /* Corega USB-TXC */ + {USB_VPI(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_FETHER_USB_TXC, 0)}, + /* ShanTou AMD8515 USB NIC */ + {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)}, + /* Kontron AG USB Ethernet */ + {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)}, + {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, + UDAV_FLAG_NO_PHY)}, +}; + DRIVER_MODULE(udav, uhub, udav_driver, udav_devclass, NULL, 0); DRIVER_MODULE(miibus, udav, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(udav, uether, 1, 1, 1); @@ -172,6 +187,7 @@ MODULE_DEPEND(udav, usb, 1, 1, 1); MODULE_DEPEND(udav, ether, 1, 1, 1); MODULE_DEPEND(udav, miibus, 1, 1, 1); MODULE_VERSION(udav, 1); +USB_PNP_HOST_INFO(udav_devs); static const struct usb_ether_methods udav_ue_methods = { .ue_attach_post = udav_attach_post, @@ -208,21 +224,6 @@ SYSCTL_INT(_hw_usb_udav, OID_AUTO, debug #define UDAV_CLRBIT(sc, reg, x) \ udav_csr_write1(sc, reg, udav_csr_read1(sc, reg) & ~(x)) -static const STRUCT_USB_HOST_ID udav_devs[] = { - /* ShanTou DM9601 USB NIC */ - {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_DM9601, 0)}, - /* ShanTou ST268 USB NIC */ - {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ST268, 0)}, - /* Corega USB-TXC */ - {USB_VPI(USB_VENDOR_COREGA, USB_PRODUCT_COREGA_FETHER_USB_TXC, 0)}, - /* ShanTou AMD8515 USB NIC */ - {USB_VPI(USB_VENDOR_SHANTOU, USB_PRODUCT_SHANTOU_ADM8515, 0)}, - /* Kontron AG USB Ethernet */ - {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_DM9601, 0)}, - {USB_VPI(USB_VENDOR_KONTRON, USB_PRODUCT_KONTRON_JP1082, - UDAV_FLAG_NO_PHY)}, -}; - static void udav_attach_post(struct usb_ether *ue) { Modified: head/sys/dev/usb/net/if_urndis.c ============================================================================== --- head/sys/dev/usb/net/if_urndis.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/net/if_urndis.c Fri Dec 11 05:28:00 2015 (r292080) @@ -161,21 +161,6 @@ static driver_t urndis_driver = { static devclass_t urndis_devclass; -DRIVER_MODULE(urndis, uhub, urndis_driver, urndis_devclass, NULL, NULL); -MODULE_VERSION(urndis, 1); -MODULE_DEPEND(urndis, uether, 1, 1, 1); -MODULE_DEPEND(urndis, usb, 1, 1, 1); -MODULE_DEPEND(urndis, ether, 1, 1, 1); - -static const struct usb_ether_methods urndis_ue_methods = { - .ue_attach_post = urndis_attach_post, - .ue_start = urndis_start, - .ue_init = urndis_init, - .ue_stop = urndis_stop, - .ue_setmulti = urndis_setmulti, - .ue_setpromisc = urndis_setpromisc, -}; - static const STRUCT_USB_HOST_ID urndis_host_devs[] = { /* Generic RNDIS class match */ {USB_IFACE_CLASS(UICLASS_CDC), @@ -191,6 +176,22 @@ static const STRUCT_USB_HOST_ID urndis_h USB_IFACE_PROTOCOL(0xff)}, }; +DRIVER_MODULE(urndis, uhub, urndis_driver, urndis_devclass, NULL, NULL); +MODULE_VERSION(urndis, 1); +MODULE_DEPEND(urndis, uether, 1, 1, 1); +MODULE_DEPEND(urndis, usb, 1, 1, 1); +MODULE_DEPEND(urndis, ether, 1, 1, 1); +USB_PNP_HOST_INFO(urndis_host_devs); + +static const struct usb_ether_methods urndis_ue_methods = { + .ue_attach_post = urndis_attach_post, + .ue_start = urndis_start, + .ue_init = urndis_init, + .ue_stop = urndis_stop, + .ue_setmulti = urndis_setmulti, + .ue_setpromisc = urndis_setpromisc, +}; + static int urndis_probe(device_t dev) { Modified: head/sys/dev/usb/net/if_usie.c ============================================================================== --- head/sys/dev/usb/net/if_usie.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/net/if_usie.c Fri Dec 11 05:28:00 2015 (r292080) @@ -212,6 +212,7 @@ DRIVER_MODULE(usie, uhub, usie_driver, u MODULE_DEPEND(usie, ucom, 1, 1, 1); MODULE_DEPEND(usie, usb, 1, 1, 1); MODULE_VERSION(usie, 1); +USB_PNP_HOST_INFO(usie_devs); static const struct ucom_callback usie_uc_callback = { .ucom_cfg_get_status = &usie_uc_cfg_get_status, Modified: head/sys/dev/usb/net/uhso.c ============================================================================== --- head/sys/dev/usb/net/uhso.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/net/uhso.c Fri Dec 11 05:28:00 2015 (r292080) @@ -497,6 +497,7 @@ DRIVER_MODULE(uhso, uhub, uhso_driver, u MODULE_DEPEND(uhso, ucom, 1, 1, 1); MODULE_DEPEND(uhso, usb, 1, 1, 1); MODULE_VERSION(uhso, 1); +USB_PNP_HOST_INFO(uhso_devs); static struct ucom_callback uhso_ucom_callback = { .ucom_cfg_get_status = &uhso_ucom_cfg_get_status, Modified: head/sys/dev/usb/serial/u3g.c ============================================================================== --- head/sys/dev/usb/serial/u3g.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/u3g.c Fri Dec 11 05:28:00 2015 (r292080) @@ -198,11 +198,6 @@ static driver_t u3g_driver = { .size = sizeof(struct u3g_softc), }; -DRIVER_MODULE(u3g, uhub, u3g_driver, u3g_devclass, u3g_driver_loaded, 0); -MODULE_DEPEND(u3g, ucom, 1, 1, 1); -MODULE_DEPEND(u3g, usb, 1, 1, 1); -MODULE_VERSION(u3g, 1); - static const STRUCT_USB_HOST_ID u3g_devs[] = { #define U3G_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } U3G_DEV(ACERP, H10, 0), @@ -587,6 +582,12 @@ static const STRUCT_USB_HOST_ID u3g_devs #undef U3G_DEV }; +DRIVER_MODULE(u3g, uhub, u3g_driver, u3g_devclass, u3g_driver_loaded, 0); +MODULE_DEPEND(u3g, ucom, 1, 1, 1); +MODULE_DEPEND(u3g, usb, 1, 1, 1); +MODULE_VERSION(u3g, 1); +USB_PNP_HOST_INFO(u3g_devs); + static int u3g_sierra_init(struct usb_device *udev) { Modified: head/sys/dev/usb/serial/uark.c ============================================================================== --- head/sys/dev/usb/serial/uark.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/uark.c Fri Dec 11 05:28:00 2015 (r292080) @@ -168,14 +168,15 @@ static driver_t uark_driver = { .size = sizeof(struct uark_softc), }; +static const STRUCT_USB_HOST_ID uark_devs[] = { + {USB_VPI(USB_VENDOR_ARKMICRO, USB_PRODUCT_ARKMICRO_ARK3116, 0)}, +}; + DRIVER_MODULE(uark, uhub, uark_driver, uark_devclass, NULL, 0); MODULE_DEPEND(uark, ucom, 1, 1, 1); MODULE_DEPEND(uark, usb, 1, 1, 1); MODULE_VERSION(uark, 1); - -static const STRUCT_USB_HOST_ID uark_devs[] = { - {USB_VPI(USB_VENDOR_ARKMICRO, USB_PRODUCT_ARKMICRO_ARK3116, 0)}, -}; +USB_PNP_HOST_INFO(uark_devs); static int uark_probe(device_t dev) Modified: head/sys/dev/usb/serial/ubsa.c ============================================================================== --- head/sys/dev/usb/serial/ubsa.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/ubsa.c Fri Dec 11 05:28:00 2015 (r292080) @@ -273,6 +273,7 @@ DRIVER_MODULE(ubsa, uhub, ubsa_driver, u MODULE_DEPEND(ubsa, ucom, 1, 1, 1); MODULE_DEPEND(ubsa, usb, 1, 1, 1); MODULE_VERSION(ubsa, 1); +USB_PNP_HOST_INFO(ubsa_devs); static int ubsa_probe(device_t dev) Modified: head/sys/dev/usb/serial/uchcom.c ============================================================================== --- head/sys/dev/usb/serial/uchcom.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/uchcom.c Fri Dec 11 05:28:00 2015 (r292080) @@ -874,3 +874,4 @@ DRIVER_MODULE(uchcom, uhub, uchcom_drive MODULE_DEPEND(uchcom, ucom, 1, 1, 1); MODULE_DEPEND(uchcom, usb, 1, 1, 1); MODULE_VERSION(uchcom, 1); +USB_PNP_HOST_INFO(uchcom_devs); Modified: head/sys/dev/usb/serial/ucycom.c ============================================================================== --- head/sys/dev/usb/serial/ucycom.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/ucycom.c Fri Dec 11 05:28:00 2015 (r292080) @@ -174,11 +174,6 @@ static driver_t ucycom_driver = { .size = sizeof(struct ucycom_softc), }; -DRIVER_MODULE(ucycom, uhub, ucycom_driver, ucycom_devclass, NULL, 0); -MODULE_DEPEND(ucycom, ucom, 1, 1, 1); -MODULE_DEPEND(ucycom, usb, 1, 1, 1); -MODULE_VERSION(ucycom, 1); - /* * Supported devices */ @@ -186,6 +181,12 @@ static const STRUCT_USB_HOST_ID ucycom_d {USB_VPI(USB_VENDOR_DELORME, USB_PRODUCT_DELORME_EARTHMATE, MODEL_CY7C64013)}, }; +DRIVER_MODULE(ucycom, uhub, ucycom_driver, ucycom_devclass, NULL, 0); +MODULE_DEPEND(ucycom, ucom, 1, 1, 1); +MODULE_DEPEND(ucycom, usb, 1, 1, 1); +MODULE_VERSION(ucycom, 1); +USB_PNP_HOST_INFO(ucycom_devs); + #define UCYCOM_DEFAULT_RATE 4800 #define UCYCOM_DEFAULT_CFG 0x03 /* N-8-1 */ Modified: head/sys/dev/usb/serial/ufoma.c ============================================================================== --- head/sys/dev/usb/serial/ufoma.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/ufoma.c Fri Dec 11 05:28:00 2015 (r292080) @@ -317,16 +317,17 @@ static driver_t ufoma_driver = { .size = sizeof(struct ufoma_softc), }; -DRIVER_MODULE(ufoma, uhub, ufoma_driver, ufoma_devclass, NULL, 0); -MODULE_DEPEND(ufoma, ucom, 1, 1, 1); -MODULE_DEPEND(ufoma, usb, 1, 1, 1); -MODULE_VERSION(ufoma, 1); - static const STRUCT_USB_HOST_ID ufoma_devs[] = { {USB_IFACE_CLASS(UICLASS_CDC), USB_IFACE_SUBCLASS(UISUBCLASS_MCPC),}, }; +DRIVER_MODULE(ufoma, uhub, ufoma_driver, ufoma_devclass, NULL, 0); +MODULE_DEPEND(ufoma, ucom, 1, 1, 1); +MODULE_DEPEND(ufoma, usb, 1, 1, 1); +MODULE_VERSION(ufoma, 1); +USB_PNP_HOST_INFO(ufoma_devs); + static int ufoma_probe(device_t dev) { Modified: head/sys/dev/usb/serial/uftdi.c ============================================================================== --- head/sys/dev/usb/serial/uftdi.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/uftdi.c Fri Dec 11 05:28:00 2015 (r292080) @@ -265,11 +265,6 @@ static driver_t uftdi_driver = { .size = sizeof(struct uftdi_softc), }; -DRIVER_MODULE(uftdi, uhub, uftdi_driver, uftdi_devclass, NULL, NULL); -MODULE_DEPEND(uftdi, ucom, 1, 1, 1); -MODULE_DEPEND(uftdi, usb, 1, 1, 1); -MODULE_VERSION(uftdi, 1); - static const STRUCT_USB_HOST_ID uftdi_devs[] = { #define UFTDI_DEV(v, p, i) \ { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } @@ -914,6 +909,12 @@ static const STRUCT_USB_HOST_ID uftdi_de #undef UFTDI_DEV }; +DRIVER_MODULE(uftdi, uhub, uftdi_driver, uftdi_devclass, NULL, NULL); +MODULE_DEPEND(uftdi, ucom, 1, 1, 1); +MODULE_DEPEND(uftdi, usb, 1, 1, 1); +MODULE_VERSION(uftdi, 1); +USB_PNP_HOST_INFO(uftdi_devs); + /* * Jtag product name strings table. Some products have one or more interfaces * dedicated to jtag or gpio, but use a product ID that's the same as other Modified: head/sys/dev/usb/serial/ugensa.c ============================================================================== --- head/sys/dev/usb/serial/ugensa.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/ugensa.c Fri Dec 11 05:28:00 2015 (r292080) @@ -152,11 +152,6 @@ static driver_t ugensa_driver = { .size = sizeof(struct ugensa_softc), }; -DRIVER_MODULE(ugensa, uhub, ugensa_driver, ugensa_devclass, NULL, 0); -MODULE_DEPEND(ugensa, ucom, 1, 1, 1); -MODULE_DEPEND(ugensa, usb, 1, 1, 1); -MODULE_VERSION(ugensa, 1); - static const STRUCT_USB_HOST_ID ugensa_devs[] = { {USB_VPI(USB_VENDOR_AIRPRIME, USB_PRODUCT_AIRPRIME_PC5220, 0)}, {USB_VPI(USB_VENDOR_CMOTECH, USB_PRODUCT_CMOTECH_CDMA_MODEM1, 0)}, @@ -165,6 +160,12 @@ static const STRUCT_USB_HOST_ID ugensa_d {USB_VPI(USB_VENDOR_NOVATEL2, USB_PRODUCT_NOVATEL2_FLEXPACKGPS, 0)}, }; +DRIVER_MODULE(ugensa, uhub, ugensa_driver, ugensa_devclass, NULL, 0); +MODULE_DEPEND(ugensa, ucom, 1, 1, 1); +MODULE_DEPEND(ugensa, usb, 1, 1, 1); +MODULE_VERSION(ugensa, 1); +USB_PNP_HOST_INFO(ugensa_devs); + static int ugensa_probe(device_t dev) { Modified: head/sys/dev/usb/serial/uipaq.c ============================================================================== --- head/sys/dev/usb/serial/uipaq.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/uipaq.c Fri Dec 11 05:28:00 2015 (r292080) @@ -1088,6 +1088,7 @@ DRIVER_MODULE(uipaq, uhub, uipaq_driver, MODULE_DEPEND(uipaq, ucom, 1, 1, 1); MODULE_DEPEND(uipaq, usb, 1, 1, 1); MODULE_VERSION(uipaq, 1); +USB_PNP_HOST_INFO(uipaq_devs); static int uipaq_probe(device_t dev) Modified: head/sys/dev/usb/serial/ulpt.c ============================================================================== --- head/sys/dev/usb/serial/ulpt.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/ulpt.c Fri Dec 11 05:28:00 2015 (r292080) @@ -759,3 +759,4 @@ static driver_t ulpt_driver = { DRIVER_MODULE(ulpt, uhub, ulpt_driver, ulpt_devclass, NULL, 0); MODULE_DEPEND(ulpt, usb, 1, 1, 1); MODULE_VERSION(ulpt, 1); +USB_PNP_HOST_INFO(ulpt_devs); Modified: head/sys/dev/usb/serial/umcs.c ============================================================================== --- head/sys/dev/usb/serial/umcs.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/umcs.c Fri Dec 11 05:28:00 2015 (r292080) @@ -278,6 +278,7 @@ DRIVER_MODULE(umcs7840, uhub, umcs7840_d MODULE_DEPEND(umcs7840, ucom, 1, 1, 1); MODULE_DEPEND(umcs7840, usb, 1, 1, 1); MODULE_VERSION(umcs7840, UMCS7840_MODVER); +USB_PNP_HOST_INFO(umcs7840_devs); static int umcs7840_probe(device_t dev) Modified: head/sys/dev/usb/serial/umct.c ============================================================================== --- head/sys/dev/usb/serial/umct.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/umct.c Fri Dec 11 05:28:00 2015 (r292080) @@ -221,6 +221,7 @@ DRIVER_MODULE(umct, uhub, umct_driver, u MODULE_DEPEND(umct, ucom, 1, 1, 1); MODULE_DEPEND(umct, usb, 1, 1, 1); MODULE_VERSION(umct, 1); +USB_PNP_HOST_INFO(umct_devs); static int umct_probe(device_t dev) Modified: head/sys/dev/usb/serial/umodem.c ============================================================================== --- head/sys/dev/usb/serial/umodem.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/umodem.c Fri Dec 11 05:28:00 2015 (r292080) @@ -298,6 +298,8 @@ DRIVER_MODULE(umodem, uhub, umodem_drive MODULE_DEPEND(umodem, ucom, 1, 1, 1); MODULE_DEPEND(umodem, usb, 1, 1, 1); MODULE_VERSION(umodem, UMODEM_MODVER); +USB_PNP_DUAL_INFO(umodem_dual_devs); +USB_PNP_HOST_INFO(umodem_host_devs); static int umodem_probe(device_t dev) Modified: head/sys/dev/usb/serial/umoscom.c ============================================================================== --- head/sys/dev/usb/serial/umoscom.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/umoscom.c Fri Dec 11 05:28:00 2015 (r292080) @@ -278,14 +278,15 @@ static driver_t umoscom_driver = { .size = sizeof(struct umoscom_softc), }; +static const STRUCT_USB_HOST_ID umoscom_devs[] = { + {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7703, 0)} +}; + DRIVER_MODULE(umoscom, uhub, umoscom_driver, umoscom_devclass, NULL, 0); MODULE_DEPEND(umoscom, ucom, 1, 1, 1); MODULE_DEPEND(umoscom, usb, 1, 1, 1); MODULE_VERSION(umoscom, 1); - -static const STRUCT_USB_HOST_ID umoscom_devs[] = { - {USB_VPI(USB_VENDOR_MOSCHIP, USB_PRODUCT_MOSCHIP_MCS7703, 0)} -}; +USB_PNP_HOST_INFO(umoscom_devs); static int umoscom_probe(device_t dev) Modified: head/sys/dev/usb/serial/uplcom.c ============================================================================== --- head/sys/dev/usb/serial/uplcom.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/uplcom.c Fri Dec 11 05:28:00 2015 (r292080) @@ -326,6 +326,7 @@ DRIVER_MODULE(uplcom, uhub, uplcom_drive MODULE_DEPEND(uplcom, ucom, 1, 1, 1); MODULE_DEPEND(uplcom, usb, 1, 1, 1); MODULE_VERSION(uplcom, UPLCOM_MODVER); +USB_PNP_HOST_INFO(uplcom_devs); static int uplcom_probe(device_t dev) Modified: head/sys/dev/usb/serial/uslcom.c ============================================================================== --- head/sys/dev/usb/serial/uslcom.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/uslcom.c Fri Dec 11 05:28:00 2015 (r292080) @@ -382,6 +382,7 @@ DRIVER_MODULE(uslcom, uhub, uslcom_drive MODULE_DEPEND(uslcom, ucom, 1, 1, 1); MODULE_DEPEND(uslcom, usb, 1, 1, 1); MODULE_VERSION(uslcom, 1); +USB_PNP_HOST_INFO(uslcom_devs); static void uslcom_watchdog(void *arg) Modified: head/sys/dev/usb/serial/uvisor.c ============================================================================== --- head/sys/dev/usb/serial/uvisor.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/uvisor.c Fri Dec 11 05:28:00 2015 (r292080) @@ -251,11 +251,6 @@ static driver_t uvisor_driver = { .size = sizeof(struct uvisor_softc), }; -DRIVER_MODULE(uvisor, uhub, uvisor_driver, uvisor_devclass, NULL, 0); -MODULE_DEPEND(uvisor, ucom, 1, 1, 1); -MODULE_DEPEND(uvisor, usb, 1, 1, 1); -MODULE_VERSION(uvisor, 1); - static const STRUCT_USB_HOST_ID uvisor_devs[] = { #define UVISOR_DEV(v,p,i) { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) } UVISOR_DEV(ACEECA, MEZ1000, UVISOR_FLAG_PALM4), @@ -288,6 +283,12 @@ static const STRUCT_USB_HOST_ID uvisor_d #undef UVISOR_DEV }; +DRIVER_MODULE(uvisor, uhub, uvisor_driver, uvisor_devclass, NULL, 0); +MODULE_DEPEND(uvisor, ucom, 1, 1, 1); +MODULE_DEPEND(uvisor, usb, 1, 1, 1); +MODULE_VERSION(uvisor, 1); +USB_PNP_HOST_INFO(uvisor_devs); + static int uvisor_probe(device_t dev) { Modified: head/sys/dev/usb/serial/uvscom.c ============================================================================== --- head/sys/dev/usb/serial/uvscom.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/serial/uvscom.c Fri Dec 11 05:28:00 2015 (r292080) @@ -268,6 +268,7 @@ DRIVER_MODULE(uvscom, uhub, uvscom_drive MODULE_DEPEND(uvscom, ucom, 1, 1, 1); MODULE_DEPEND(uvscom, usb, 1, 1, 1); MODULE_VERSION(uvscom, UVSCOM_MODVER); +USB_PNP_HOST_INFO(uvscom_devs); static int uvscom_probe(device_t dev) Modified: head/sys/dev/usb/storage/umass.c ============================================================================== --- head/sys/dev/usb/storage/umass.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/storage/umass.c Fri Dec 11 05:28:00 2015 (r292080) @@ -706,20 +706,21 @@ static driver_t umass_driver = { .size = sizeof(struct umass_softc), }; +static const STRUCT_USB_HOST_ID __used umass_devs[] = { + /* generic mass storage class */ + {USB_IFACE_CLASS(UICLASS_MASS),}, +}; + DRIVER_MODULE(umass, uhub, umass_driver, umass_devclass, NULL, 0); MODULE_DEPEND(umass, usb, 1, 1, 1); MODULE_DEPEND(umass, cam, 1, 1, 1); MODULE_VERSION(umass, 1); +USB_PNP_HOST_INFO(umass_devs); /* * USB device probe/attach/detach */ -static const STRUCT_USB_HOST_ID __used umass_devs[] = { - /* generic mass storage class */ - {USB_IFACE_CLASS(UICLASS_MASS),}, -}; - static uint16_t umass_get_proto(struct usb_interface *iface) { Modified: head/sys/dev/usb/storage/urio.c ============================================================================== --- head/sys/dev/usb/storage/urio.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/storage/urio.c Fri Dec 11 05:28:00 2015 (r292080) @@ -195,16 +195,17 @@ static driver_t urio_driver = { .size = sizeof(struct urio_softc), }; -DRIVER_MODULE(urio, uhub, urio_driver, urio_devclass, NULL, 0); -MODULE_DEPEND(urio, usb, 1, 1, 1); -MODULE_VERSION(urio, 1); - static const STRUCT_USB_HOST_ID urio_devs[] = { {USB_VPI(USB_VENDOR_DIAMOND, USB_PRODUCT_DIAMOND_RIO500USB, 0)}, {USB_VPI(USB_VENDOR_DIAMOND2, USB_PRODUCT_DIAMOND2_RIO600USB, 0)}, {USB_VPI(USB_VENDOR_DIAMOND2, USB_PRODUCT_DIAMOND2_RIO800USB, 0)}, }; +DRIVER_MODULE(urio, uhub, urio_driver, urio_devclass, NULL, 0); +MODULE_DEPEND(urio, usb, 1, 1, 1); +MODULE_VERSION(urio, 1); +USB_PNP_HOST_INFO(urio_devs); + static int urio_probe(device_t dev) { Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/usb_hub.c Fri Dec 11 05:28:00 2015 (r292080) @@ -1731,6 +1731,7 @@ uhub_child_pnpinfo_string(device_t paren if (iface && iface->idesc) { snprintf(buf, buflen, "vendor=0x%04x product=0x%04x " "devclass=0x%02x devsubclass=0x%02x " + "devproto=0x%02x " "sernum=\"%s\" " "release=0x%04x " "mode=%s " @@ -1740,6 +1741,7 @@ uhub_child_pnpinfo_string(device_t paren UGETW(res.udev->ddesc.idProduct), res.udev->ddesc.bDeviceClass, res.udev->ddesc.bDeviceSubClass, + res.udev->ddesc.bDeviceProtocol, usb_get_serial(res.udev), UGETW(res.udev->ddesc.bcdDevice), (res.udev->flags.usb_mode == USB_MODE_HOST) ? "host" : "device", Modified: head/sys/dev/usb/usbdi.h ============================================================================== --- head/sys/dev/usb/usbdi.h Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/usbdi.h Fri Dec 11 05:28:00 2015 (r292080) @@ -266,8 +266,38 @@ struct usb_config { */ struct usb_device_id { - /* Hook for driver specific information */ - unsigned long driver_info; + /* Select which fields to match against */ +#if _BYTE_ORDER == _LITTLE_ENDIAN + uint16_t + match_flag_vendor:1, + match_flag_product:1, + match_flag_dev_lo:1, + match_flag_dev_hi:1, + + match_flag_dev_class:1, + match_flag_dev_subclass:1, + match_flag_dev_protocol:1, + match_flag_int_class:1, + + match_flag_int_subclass:1, + match_flag_int_protocol:1, + match_flag_unused:6; +#else + uint16_t + match_flag_unused:6, + match_flag_int_protocol:1, + match_flag_int_subclass:1, + + match_flag_int_class:1, + match_flag_dev_protocol:1, + match_flag_dev_subclass:1, + match_flag_dev_class:1, + + match_flag_dev_hi:1, + match_flag_dev_lo:1, + match_flag_product:1, + match_flag_vendor:1; +#endif /* Used for product specific matches; the BCD range is inclusive */ uint16_t idVendor; @@ -285,21 +315,13 @@ struct usb_device_id { uint8_t bInterfaceSubClass; uint8_t bInterfaceProtocol; - /* Select which fields to match against */ - uint8_t match_flag_vendor:1; - uint8_t match_flag_product:1; - uint8_t match_flag_dev_lo:1; - uint8_t match_flag_dev_hi:1; - - uint8_t match_flag_dev_class:1; - uint8_t match_flag_dev_subclass:1; - uint8_t match_flag_dev_protocol:1; - uint8_t match_flag_int_class:1; - - uint8_t match_flag_int_subclass:1; - uint8_t match_flag_int_protocol:1; - uint8_t match_flag_unused:6; + /* Hook for driver specific information */ + unsigned long driver_info; +/* + * XXX can't currently participate in auto driver loading + * XXX making it a union with the match_flag_* above messes up init + */ #if USB_HAVE_COMPAT_LINUX /* which fields to match against */ uint16_t match_flags; @@ -316,6 +338,21 @@ struct usb_device_id { #endif } __aligned(32); +#define USB_STD_PNP_INFO "M16:mask;U16:vendor;U16:product;L16:product;G16:product;" \ + "U8:devclass;U8:devsubclass;U8:devprotocol;" \ + "U8:intclass;U8:intsubclass;U8:intprotocol;" +#define USB_STD_PNP_HOST_INFO USB_STD_PNP_INFO "T:mode=host;" +#define USB_STD_PNP_DEVICE_INFO USB_STD_PNP_INFO "T:mode=device;" +#define USB_PNP_HOST_INFO(table) \ + MODULE_PNP_INFO(USB_STD_PNP_HOST_INFO, usb, table, table, sizeof(table[0]), \ + sizeof(table) / sizeof(table[0])) +#define USB_PNP_DEVICE_INFO(table) \ + MODULE_PNP_INFO(USB_STD_PNP_DEVICE_INFO, usb, table, table, sizeof(table[0]), \ + sizeof(table) / sizeof(table[0])) +#define USB_PNP_DUAL_INFO(table) \ + MODULE_PNP_INFO(USB_STD_PNP_INFO, usb, table, table, sizeof(table[0]), \ + sizeof(table) / sizeof(table[0])) + /* check that the size of the structure above is correct */ extern char usb_device_id_assert[(sizeof(struct usb_device_id) == 32) ? 1 : -1]; Modified: head/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- head/sys/dev/usb/wlan/if_rsu.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/wlan/if_rsu.c Fri Dec 11 05:28:00 2015 (r292080) @@ -249,6 +249,7 @@ MODULE_DEPEND(rsu, wlan, 1, 1, 1); MODULE_DEPEND(rsu, usb, 1, 1, 1); MODULE_DEPEND(rsu, firmware, 1, 1, 1); MODULE_VERSION(rsu, 1); +USB_PNP_HOST_INFO(rsu_devs); static uint8_t rsu_wme_ac_xfer_map[4] = { [WME_AC_BE] = RSU_BULK_TX_BE_BK, Modified: head/sys/dev/usb/wlan/if_rum.c ============================================================================== --- head/sys/dev/usb/wlan/if_rum.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/wlan/if_rum.c Fri Dec 11 05:28:00 2015 (r292080) @@ -3016,3 +3016,4 @@ DRIVER_MODULE(rum, uhub, rum_driver, rum MODULE_DEPEND(rum, wlan, 1, 1, 1); MODULE_DEPEND(rum, usb, 1, 1, 1); MODULE_VERSION(rum, 1); +USB_PNP_HOST_INFO(rum_devs); Modified: head/sys/dev/usb/wlan/if_run.c ============================================================================== --- head/sys/dev/usb/wlan/if_run.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/wlan/if_run.c Fri Dec 11 05:28:00 2015 (r292080) @@ -6236,3 +6236,4 @@ MODULE_DEPEND(run, wlan, 1, 1, 1); MODULE_DEPEND(run, usb, 1, 1, 1); MODULE_DEPEND(run, firmware, 1, 1, 1); MODULE_VERSION(run, 1); +USB_PNP_HOST_INFO(run_devs); Modified: head/sys/dev/usb/wlan/if_uath.c ============================================================================== --- head/sys/dev/usb/wlan/if_uath.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/wlan/if_uath.c Fri Dec 11 05:28:00 2015 (r292080) @@ -2794,3 +2794,4 @@ DRIVER_MODULE(uath, uhub, uath_driver, u MODULE_DEPEND(uath, wlan, 1, 1, 1); MODULE_DEPEND(uath, usb, 1, 1, 1); MODULE_VERSION(uath, 1); +USB_PNP_HOST_INFO(uath_devs); Modified: head/sys/dev/usb/wlan/if_upgt.c ============================================================================== --- head/sys/dev/usb/wlan/if_upgt.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/wlan/if_upgt.c Fri Dec 11 05:28:00 2015 (r292080) @@ -2347,3 +2347,4 @@ MODULE_VERSION(if_upgt, 1); MODULE_DEPEND(if_upgt, usb, 1, 1, 1); MODULE_DEPEND(if_upgt, wlan, 1, 1, 1); MODULE_DEPEND(if_upgt, upgtfw_fw, 1, 1, 1); +USB_PNP_HOST_INFO(upgt_devs); Modified: head/sys/dev/usb/wlan/if_ural.c ============================================================================== --- head/sys/dev/usb/wlan/if_ural.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/wlan/if_ural.c Fri Dec 11 05:28:00 2015 (r292080) @@ -401,6 +401,7 @@ DRIVER_MODULE(ural, uhub, ural_driver, u MODULE_DEPEND(ural, usb, 1, 1, 1); MODULE_DEPEND(ural, wlan, 1, 1, 1); MODULE_VERSION(ural, 1); +USB_PNP_HOST_INFO(ural_devs); static int ural_match(device_t self) Modified: head/sys/dev/usb/wlan/if_urtw.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtw.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/wlan/if_urtw.c Fri Dec 11 05:28:00 2015 (r292080) @@ -4382,3 +4382,4 @@ DRIVER_MODULE(urtw, uhub, urtw_driver, u MODULE_DEPEND(urtw, wlan, 1, 1, 1); MODULE_DEPEND(urtw, usb, 1, 1, 1); MODULE_VERSION(urtw, 1); +USB_PNP_HOST_INFO(urtw_devs); Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/wlan/if_urtwn.c Fri Dec 11 05:28:00 2015 (r292080) @@ -4156,3 +4156,4 @@ MODULE_DEPEND(urtwn, usb, 1, 1, 1); MODULE_DEPEND(urtwn, wlan, 1, 1, 1); MODULE_DEPEND(urtwn, firmware, 1, 1, 1); MODULE_VERSION(urtwn, 1); +USB_PNP_HOST_INFO(urtwn_devs); Modified: head/sys/dev/usb/wlan/if_zyd.c ============================================================================== --- head/sys/dev/usb/wlan/if_zyd.c Fri Dec 11 05:27:56 2015 (r292079) +++ head/sys/dev/usb/wlan/if_zyd.c Fri Dec 11 05:28:00 2015 (r292080) @@ -2893,3 +2893,4 @@ DRIVER_MODULE(zyd, uhub, zyd_driver, zyd MODULE_DEPEND(zyd, usb, 1, 1, 1); MODULE_DEPEND(zyd, wlan, 1, 1, 1); MODULE_VERSION(zyd, 1); +USB_PNP_HOST_INFO(zyd_devs); Modified: head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c ============================================================================== --- head/sys/netgraph/bluetooth/drivers/ubt/ng_ubt.c Fri Dec 11 05:27:56 2015 (r292079) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 11 05:28:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C3C69D68C7; Fri, 11 Dec 2015 05:28:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 30DAE12D0; Fri, 11 Dec 2015 05:28:09 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB5S86w012157; Fri, 11 Dec 2015 05:28:08 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB5S8pP012155; Fri, 11 Dec 2015 05:28:08 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512110528.tBB5S8pP012155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 11 Dec 2015 05:28:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292081 - head/sys/dev/ed X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 05:28:09 -0000 Author: imp Date: Fri Dec 11 05:28:07 2015 New Revision: 292081 URL: https://svnweb.freebsd.org/changeset/base/292081 Log: Add PNP info for ISA and PCI to the ed driver to prove design. Differential Review: https://reviews.freebsd.org/D3458 Modified: head/sys/dev/ed/if_ed_isa.c head/sys/dev/ed/if_ed_pci.c Modified: head/sys/dev/ed/if_ed_isa.c ============================================================================== --- head/sys/dev/ed/if_ed_isa.c Fri Dec 11 05:28:00 2015 (r292080) +++ head/sys/dev/ed/if_ed_isa.c Fri Dec 11 05:28:07 2015 (r292081) @@ -201,3 +201,6 @@ static driver_t ed_isa_driver = { DRIVER_MODULE(ed, isa, ed_isa_driver, ed_devclass, 0, 0); MODULE_DEPEND(ed, isa, 1, 1, 1); MODULE_DEPEND(ed, ether, 1, 1, 1); +MODULE_PNP_INFO("E:pnpid;", isa, ed, ed_ids, sizeof(ed_ids[0]), + sizeof(ed_ids) / sizeof(ed_ids[0]) - 1); + Modified: head/sys/dev/ed/if_ed_pci.c ============================================================================== --- head/sys/dev/ed/if_ed_pci.c Fri Dec 11 05:28:00 2015 (r292080) +++ head/sys/dev/ed/if_ed_pci.c Fri Dec 11 05:28:07 2015 (r292081) @@ -143,3 +143,6 @@ static driver_t ed_pci_driver = { DRIVER_MODULE(ed, pci, ed_pci_driver, ed_devclass, 0, 0); MODULE_DEPEND(ed, pci, 1, 1, 1); MODULE_DEPEND(ed, ether, 1, 1, 1); +MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ed, pci_ids, sizeof(pci_ids[0]), + sizeof(pci_ids) / sizeof(pci_ids[0]) - 1); + From owner-svn-src-all@freebsd.org Fri Dec 11 05:39:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F0C49D7620; Fri, 11 Dec 2015 05:39:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3A0DB1A05; Fri, 11 Dec 2015 05:39:43 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB5dgYb017884; Fri, 11 Dec 2015 05:39:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB5dgj8017881; Fri, 11 Dec 2015 05:39:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512110539.tBB5dgj8017881@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 11 Dec 2015 05:39:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292082 - head/usr.bin/mkimg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 05:39:43 -0000 Author: imp Date: Fri Dec 11 05:39:42 2015 New Revision: 292082 URL: https://svnweb.freebsd.org/changeset/base/292082 Log: Add ppcboot FAT type. Needed to create a bootable powerpc image. Differential Review: https://reviews.freebsd.org/D4407 Modified: head/usr.bin/mkimg/mbr.c head/usr.bin/mkimg/scheme.c head/usr.bin/mkimg/scheme.h Modified: head/usr.bin/mkimg/mbr.c ============================================================================== --- head/usr.bin/mkimg/mbr.c Fri Dec 11 05:28:07 2015 (r292081) +++ head/usr.bin/mkimg/mbr.c Fri Dec 11 05:39:42 2015 (r292082) @@ -45,6 +45,9 @@ __FBSDID("$FreeBSD$"); #ifndef DOSPTYP_FAT32 #define DOSPTYP_FAT32 0x0b #endif +#ifndef DOSPTYP_PPCBOOT +#define DOSPTYP_PPCBOOT 0x41 +#endif #ifndef DOSPTYP_EFI #define DOSPTYP_EFI 0xef #endif @@ -56,6 +59,7 @@ static struct mkimg_alias mbr_aliases[] { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) }, { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) }, { ALIAS_NTFS, ALIAS_INT2TYPE(DOSPTYP_NTFS) }, + { ALIAS_PPCBOOT, ALIAS_INT2TYPE(DOSPTYP_PPCBOOT) }, { ALIAS_NONE, 0 } /* Keep last! */ }; Modified: head/usr.bin/mkimg/scheme.c ============================================================================== --- head/usr.bin/mkimg/scheme.c Fri Dec 11 05:28:07 2015 (r292081) +++ head/usr.bin/mkimg/scheme.c Fri Dec 11 05:39:42 2015 (r292082) @@ -61,6 +61,7 @@ static struct { { "freebsd-zfs", ALIAS_FREEBSD_ZFS }, { "mbr", ALIAS_MBR }, { "ntfs", ALIAS_NTFS }, + { "prepboot", ALIAS_PPCBOOT }, { NULL, ALIAS_NONE } /* Keep last! */ }; Modified: head/usr.bin/mkimg/scheme.h ============================================================================== --- head/usr.bin/mkimg/scheme.h Fri Dec 11 05:28:07 2015 (r292081) +++ head/usr.bin/mkimg/scheme.h Fri Dec 11 05:39:42 2015 (r292082) @@ -47,6 +47,7 @@ enum alias { ALIAS_FREEBSD_ZFS, ALIAS_MBR, ALIAS_NTFS, + ALIAS_PPCBOOT, /* end */ ALIAS_COUNT /* Keep last! */ }; From owner-svn-src-all@freebsd.org Fri Dec 11 05:39:46 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89E0E9D764D; Fri, 11 Dec 2015 05:39:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46E721A31; Fri, 11 Dec 2015 05:39:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB5djNu018021; Fri, 11 Dec 2015 05:39:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB5djO2018020; Fri, 11 Dec 2015 05:39:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512110539.tBB5djO2018020@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 11 Dec 2015 05:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292085 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 05:39:46 -0000 Author: imp Date: Fri Dec 11 05:39:45 2015 New Revision: 292085 URL: https://svnweb.freebsd.org/changeset/base/292085 Log: Handle CPUTYPE=armv[4567]* better. gcc expects those to be either -march=foo or -mcpu=generic-foo. Catch the armvX* case and pass the right args for it. Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Fri Dec 11 05:39:44 2015 (r292084) +++ head/share/mk/bsd.cpu.mk Fri Dec 11 05:39:45 2015 (r292085) @@ -110,7 +110,12 @@ _CPUCFLAGS = -march=armv5te -D__XSCALE__ _CPUCFLAGS = -march=${CPUTYPE} -DARM_ARCH_6=1 . elif ${CPUTYPE} == "cortexa" _CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 -mfpu=vfp -. else +. elif ${CPUTYPE:Marmv[4567]*} != "" +# Handle all the armvX types that FreeBSD runs: +# armv4, armv4t, armv5, armv5te, armv6, armv6t2, armv7, armv7-a, armv7ve +# they require -march=. All the others require -mcpu=. +_CPUCFLAGS = -march=${CPUTYPE} +. else # Common values for FreeBSD # arm: # arm920t, arm926ej-s, marvell-pj4, fa526, fa626, @@ -120,7 +125,7 @@ _CPUCFLAGS = -march=armv7 -DARM_ARCH_6=1 # cortex-a9, cortex-a12, cortex-a15, cortex-a17, cortex-a53, cortex-a57, # cortex-a72, exynos-m1 _CPUCFLAGS = -mcpu=${CPUTYPE} -. endif +. endif . elif ${MACHINE_ARCH} == "powerpc" . if ${CPUTYPE} == "e500" _CPUCFLAGS = -Wa,-me500 -msoft-float From owner-svn-src-all@freebsd.org Fri Dec 11 05:39:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7714C9D7628; Fri, 11 Dec 2015 05:39:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 47FE21A06; Fri, 11 Dec 2015 05:39:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB5dhau017930; Fri, 11 Dec 2015 05:39:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB5dhnf017929; Fri, 11 Dec 2015 05:39:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512110539.tBB5dhnf017929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 11 Dec 2015 05:39:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292083 - head/tools/tools/nanobsd/embedded X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 05:39:44 -0000 Author: imp Date: Fri Dec 11 05:39:43 2015 New Revision: 292083 URL: https://svnweb.freebsd.org/changeset/base/292083 Log: Update for final version of mkimg changes. Modified: head/tools/tools/nanobsd/embedded/common Modified: head/tools/tools/nanobsd/embedded/common ============================================================================== --- head/tools/tools/nanobsd/embedded/common Fri Dec 11 05:39:42 2015 (r292082) +++ head/tools/tools/nanobsd/embedded/common Fri Dec 11 05:39:43 2015 (r292083) @@ -362,7 +362,7 @@ create_diskimage_mbr ( ) ( # boot image is on a special partition, ala std-embedded, but that # partition isn't FAT with special files, but a copy of the boot # loader itself. - mkimg -a 1 ${fmtarg} -s mbr -p ppcboot:=${NANO_OBJ}/_.s1 \ + mkimg -a 1 ${fmtarg} -s mbr -p prepboot:=${NANO_OBJ}/_.s1 \ -p ${s2}:=${NANO_OBJ}/_.s2 \ -p ${s3}:=${NANO_OBJ}/_.s3a \ -o ${NANO_OBJ}/_.disk.image.${NANO_NAME}${fmt} From owner-svn-src-all@freebsd.org Fri Dec 11 05:39:45 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F7F99D7643; Fri, 11 Dec 2015 05:39:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D25D1A07; Fri, 11 Dec 2015 05:39:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB5diwO017976; Fri, 11 Dec 2015 05:39:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB5ditl017974; Fri, 11 Dec 2015 05:39:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512110539.tBB5ditl017974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 11 Dec 2015 05:39:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292084 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 05:39:45 -0000 Author: imp Date: Fri Dec 11 05:39:44 2015 New Revision: 292084 URL: https://svnweb.freebsd.org/changeset/base/292084 Log: Move the inclusion of bsd.cpu.mk from sys.mk to bsd.opts.mk. However, for historical behavior that ports depends on, include it if we're inside the ports tree. Differential Review: https://reviews.freebsd.org/D4383 Ports Exp run: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=205021 Modified: head/share/mk/bsd.opts.mk head/share/mk/sys.mk Modified: head/share/mk/bsd.opts.mk ============================================================================== --- head/share/mk/bsd.opts.mk Fri Dec 11 05:39:43 2015 (r292083) +++ head/share/mk/bsd.opts.mk Fri Dec 11 05:39:44 2015 (r292084) @@ -104,6 +104,8 @@ MK_${var}:=no MK_STALE_STAGED= no .endif +.include + .endif # !_WITHOUT_SRCCONF .endif Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Fri Dec 11 05:39:43 2015 (r292083) +++ head/share/mk/sys.mk Fri Dec 11 05:39:44 2015 (r292084) @@ -406,6 +406,15 @@ __MAKE_SHELL?=/bin/sh path=${__MAKE_SHELL} .endif +# Hack for ports compatibility. Historically, ports makefiles have +# assumed hey can examine MACHINE_CPU without including anything +# because this was automatically included in sys.mk. For /usr/src, +# this file has moved to being included from bsd.opts.mk. Until all +# the ports files are modernized, and a reasonable transitition +# period has passed, include it while we're in a ports tree here +# to preserve historic behavior. +.if exists(${.CURDIR}/../../Mk/bsd.port.mk) .include +.endif .endif # ! Posix From owner-svn-src-all@freebsd.org Fri Dec 11 06:20:32 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A222D9D63E4; Fri, 11 Dec 2015 06:20:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71ECF1F66; Fri, 11 Dec 2015 06:20:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB6KVxq033646; Fri, 11 Dec 2015 06:20:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB6KVnk033645; Fri, 11 Dec 2015 06:20:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512110620.tBB6KVnk033645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 11 Dec 2015 06:20:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292086 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 06:20:32 -0000 Author: arybchik Date: Fri Dec 11 06:20:31 2015 New Revision: 292086 URL: https://svnweb.freebsd.org/changeset/base/292086 Log: sfxge: add tunable for maximum start attetmps after reset Reviewed by: gnn Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Differential Revision: https://reviews.freebsd.org/D2610 Modified: head/sys/dev/sfxge/sfxge.c Modified: head/sys/dev/sfxge/sfxge.c ============================================================================== --- head/sys/dev/sfxge/sfxge.c Fri Dec 11 05:39:45 2015 (r292085) +++ head/sys/dev/sfxge/sfxge.c Fri Dec 11 06:20:31 2015 (r292086) @@ -95,6 +95,13 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_ring, &sfxge_tx_ring_entries, 0, "Maximum number of descriptors in a transmit ring"); +#define SFXGE_PARAM_RESTART_ATTEMPTS SFXGE_PARAM(restart_attempts) +static int sfxge_restart_attempts = 3; +TUNABLE_INT(SFXGE_PARAM_RESTART_ATTEMPTS, &sfxge_restart_attempts); +SYSCTL_INT(_hw_sfxge, OID_AUTO, restart_attempts, CTLFLAG_RDTUN, + &sfxge_restart_attempts, 0, + "Maximum number of attempts to bring interface up after reset"); + #if EFSYS_OPT_MCDI_LOGGING #define SFXGE_PARAM_MCDI_LOGGING SFXGE_PARAM(mcdi_logging) static int sfxge_mcdi_logging = 0; @@ -994,7 +1001,7 @@ sfxge_reset(void *arg, int npending) sfxge_stop(sc); efx_nic_reset(sc->enp); - for (attempt = 0; attempt < 3; ++attempt) { + for (attempt = 0; attempt < sfxge_restart_attempts; ++attempt) { if ((rc = sfxge_start(sc)) == 0) goto done; From owner-svn-src-all@freebsd.org Fri Dec 11 06:23:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31A7A9D6675; Fri, 11 Dec 2015 06:23:00 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E73BF133A; Fri, 11 Dec 2015 06:22:59 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB6MxdT036474; Fri, 11 Dec 2015 06:22:59 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB6Mw8d036471; Fri, 11 Dec 2015 06:22:58 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201512110622.tBB6Mw8d036471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Fri, 11 Dec 2015 06:22:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292087 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 06:23:00 -0000 Author: hiren Date: Fri Dec 11 06:22:58 2015 New Revision: 292087 URL: https://svnweb.freebsd.org/changeset/base/292087 Log: Clean up unused bandwidth entry in the TCP hostcache. Submitted by: Jason Wolfe (j at nitrology dot com) Reviewed by: rrs, hiren Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D4154 Modified: head/sys/netinet/tcp_hostcache.c head/sys/netinet/tcp_hostcache.h head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_hostcache.c ============================================================================== --- head/sys/netinet/tcp_hostcache.c Fri Dec 11 06:20:31 2015 (r292086) +++ head/sys/netinet/tcp_hostcache.c Fri Dec 11 06:22:58 2015 (r292087) @@ -32,8 +32,8 @@ * table to a dedicated structure indexed by the remote IP address. It keeps * information on the measured TCP parameters of past TCP sessions to allow * better initial start values to be used with later connections to/from the - * same source. Depending on the network parameters (delay, bandwidth, max - * MTU, congestion window) between local and remote sites, this can lead to + * same source. Depending on the network parameters (delay, max MTU, + * congestion window) between local and remote sites, this can lead to * significant speed-ups for new TCP connections after the first one. * * Due to the tcp_hostcache, all TCP-specific metrics information in the @@ -440,7 +440,6 @@ tcp_hc_get(struct in_conninfo *inc, stru hc_metrics_lite->rmx_ssthresh = hc_entry->rmx_ssthresh; hc_metrics_lite->rmx_rtt = hc_entry->rmx_rtt; hc_metrics_lite->rmx_rttvar = hc_entry->rmx_rttvar; - hc_metrics_lite->rmx_bandwidth = hc_entry->rmx_bandwidth; hc_metrics_lite->rmx_cwnd = hc_entry->rmx_cwnd; hc_metrics_lite->rmx_sendpipe = hc_entry->rmx_sendpipe; hc_metrics_lite->rmx_recvpipe = hc_entry->rmx_recvpipe; @@ -555,14 +554,6 @@ tcp_hc_update(struct in_conninfo *inc, s (hc_entry->rmx_ssthresh + hcml->rmx_ssthresh) / 2; TCPSTAT_INC(tcps_cachedssthresh); } - if (hcml->rmx_bandwidth != 0) { - if (hc_entry->rmx_bandwidth == 0) - hc_entry->rmx_bandwidth = hcml->rmx_bandwidth; - else - hc_entry->rmx_bandwidth = - (hc_entry->rmx_bandwidth + hcml->rmx_bandwidth) / 2; - /* TCPSTAT_INC(tcps_cachedbandwidth); */ - } if (hcml->rmx_cwnd != 0) { if (hc_entry->rmx_cwnd == 0) hc_entry->rmx_cwnd = hcml->rmx_cwnd; @@ -612,7 +603,7 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) SBUF_INCLUDENUL); sbuf_printf(&sb, - "\nIP address MTU SSTRESH RTT RTTVAR BANDWIDTH " + "\nIP address MTU SSTRESH RTT RTTVAR " " CWND SENDPIPE RECVPIPE HITS UPD EXP\n"); #define msec(u) (((u) + 500) / 1000) @@ -621,8 +612,8 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) TAILQ_FOREACH(hc_entry, &V_tcp_hostcache.hashbase[i].hch_bucket, rmx_q) { sbuf_printf(&sb, - "%-15s %5lu %8lu %6lums %6lums %9lu %8lu %8lu %8lu " - "%4lu %4lu %4i\n", + "%-15s %5lu %8lu %6lums %6lums %8lu %8lu %8lu %4lu " + "%4lu %4i\n", hc_entry->ip4.s_addr ? inet_ntoa(hc_entry->ip4) : #ifdef INET6 ip6_sprintf(ip6buf, &hc_entry->ip6), @@ -635,7 +626,6 @@ sysctl_tcp_hc_list(SYSCTL_HANDLER_ARGS) (RTM_RTTUNIT / (hz * TCP_RTT_SCALE))), msec(hc_entry->rmx_rttvar * (RTM_RTTUNIT / (hz * TCP_RTTVAR_SCALE))), - hc_entry->rmx_bandwidth * 8, hc_entry->rmx_cwnd, hc_entry->rmx_sendpipe, hc_entry->rmx_recvpipe, Modified: head/sys/netinet/tcp_hostcache.h ============================================================================== --- head/sys/netinet/tcp_hostcache.h Fri Dec 11 06:20:31 2015 (r292086) +++ head/sys/netinet/tcp_hostcache.h Fri Dec 11 06:22:58 2015 (r292087) @@ -57,7 +57,6 @@ struct hc_metrics { u_long rmx_ssthresh; /* outbound gateway buffer limit */ u_long rmx_rtt; /* estimated round trip time */ u_long rmx_rttvar; /* estimated rtt variance */ - u_long rmx_bandwidth; /* estimated bandwidth */ u_long rmx_cwnd; /* congestion window */ u_long rmx_sendpipe; /* outbound delay-bandwidth product */ u_long rmx_recvpipe; /* inbound delay-bandwidth product */ Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Fri Dec 11 06:20:31 2015 (r292086) +++ head/sys/netinet/tcp_var.h Fri Dec 11 06:22:58 2015 (r292087) @@ -335,7 +335,6 @@ struct hc_metrics_lite { /* must stay in u_long rmx_ssthresh; /* outbound gateway buffer limit */ u_long rmx_rtt; /* estimated round trip time */ u_long rmx_rttvar; /* estimated rtt variance */ - u_long rmx_bandwidth; /* estimated bandwidth */ u_long rmx_cwnd; /* congestion window */ u_long rmx_sendpipe; /* outbound delay-bandwidth product */ u_long rmx_recvpipe; /* inbound delay-bandwidth product */ From owner-svn-src-all@freebsd.org Fri Dec 11 06:28:17 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 035959D6B32; Fri, 11 Dec 2015 06:28:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B72BC1976; Fri, 11 Dec 2015 06:28:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB6SFUA037587; Fri, 11 Dec 2015 06:28:15 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB6SFTm037586; Fri, 11 Dec 2015 06:28:15 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512110628.tBB6SFTm037586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 11 Dec 2015 06:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292088 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 06:28:17 -0000 Author: arybchik Date: Fri Dec 11 06:28:15 2015 New Revision: 292088 URL: https://svnweb.freebsd.org/changeset/base/292088 Log: sfxge: simplify MCDI methods It is a part of MCDI rework to share more code among NIC families. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4481 Modified: head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 11 06:22:58 2015 (r292087) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 11 06:28:15 2015 (r292088) @@ -176,6 +176,51 @@ efx_mcdi_new_epoch( EFSYS_UNLOCK(enp->en_eslp, state); } +static void +efx_mcdi_request_copyin( + __in efx_nic_t *enp, + __in efx_mcdi_req_t *emrp, + __in unsigned int seq, + __in boolean_t ev_cpl, + __in boolean_t new_epoch) +{ + efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + + emcop->emco_request_copyin(enp, emrp, seq, ev_cpl, new_epoch); +} + +static void __unused +efx_mcdi_request_copyout( + __in efx_nic_t *enp, + __in efx_mcdi_req_t *emrp) +{ + efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + + emcop->emco_request_copyout(enp, emrp); +} + +static efx_rc_t +efx_mcdi_poll_reboot( + __in efx_nic_t *enp) +{ + efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + efx_rc_t rc; + + rc = emcop->emco_poll_reboot(enp); + return (rc); +} + +static void +efx_mcdi_read_response( + __in efx_nic_t *enp, + __out void *bufferp, + __in size_t offset, + __in size_t length) +{ + efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + + emcop->emco_read_response(enp, bufferp, offset, length); +} void efx_mcdi_request_start( @@ -184,7 +229,6 @@ efx_mcdi_request_start( __in boolean_t ev_cpl) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; unsigned int seq; boolean_t new_epoch; int state; @@ -193,9 +237,6 @@ efx_mcdi_request_start( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI); - if (emcop == NULL || emcop->emco_request_copyin == NULL) - return; - /* * efx_mcdi_request_start() is naturally serialised against both * efx_mcdi_request_poll() and efx_mcdi_ev_cpl()/efx_mcdi_ev_death(), @@ -217,7 +258,7 @@ efx_mcdi_request_start( new_epoch = emip->emi_new_epoch; EFSYS_UNLOCK(enp->en_eslp, state); - emcop->emco_request_copyin(enp, emrp, seq, ev_cpl, new_epoch); + efx_mcdi_request_copyin(enp, emrp, seq, ev_cpl, new_epoch); } @@ -230,7 +271,6 @@ efx_mcdi_read_response_header( const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; #endif /* EFSYS_OPT_MCDI_LOGGING */ efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; efx_dword_t hdr[2]; unsigned int hdr_len; unsigned int data_len; @@ -241,7 +281,7 @@ efx_mcdi_read_response_header( EFSYS_ASSERT(emrp != NULL); - emcop->emco_read_response(enp, &hdr[0], 0, sizeof (hdr[0])); + efx_mcdi_read_response(enp, &hdr[0], 0, sizeof (hdr[0])); hdr_len = sizeof (hdr[0]); cmd = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_CODE); @@ -251,8 +291,7 @@ efx_mcdi_read_response_header( if (cmd != MC_CMD_V2_EXTN) { data_len = EFX_DWORD_FIELD(hdr[0], MCDI_HEADER_DATALEN); } else { - emcop->emco_read_response(enp, &hdr[1], hdr_len, - sizeof (hdr[1])); + efx_mcdi_read_response(enp, &hdr[1], hdr_len, sizeof (hdr[1])); hdr_len += sizeof (hdr[1]); cmd = EFX_DWORD_FIELD(hdr[1], MC_CMD_V2_EXTN_IN_EXTENDED_CMD); @@ -263,7 +302,7 @@ efx_mcdi_read_response_header( if (error && (data_len == 0)) { /* The MC has rebooted since the request was sent. */ EFSYS_SPIN(EFX_MCDI_STATUS_SLEEP_US); - emcop->emco_poll_reboot(enp); + efx_mcdi_poll_reboot(enp); rc = EIO; goto fail1; } @@ -280,7 +319,7 @@ efx_mcdi_read_response_header( int err_arg = 0; /* Read error code (and arg num for MCDI v2 commands) */ - emcop->emco_read_response(enp, &err, hdr_len, err_len); + efx_mcdi_read_response(enp, &err, hdr_len, err_len); if (err_len >= (MC_CMD_ERR_CODE_OFST + sizeof (efx_dword_t))) err_code = EFX_DWORD_FIELD(err[0], EFX_DWORD_0); @@ -505,16 +544,6 @@ efx_mcdi_raise_exception( emtp->emt_exception(emtp->emt_context, exception); } -static efx_rc_t -efx_mcdi_poll_reboot( - __in efx_nic_t *enp) -{ - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; - - return (emcop->emco_poll_reboot(enp)); -} - - void efx_mcdi_execute( __in efx_nic_t *enp, From owner-svn-src-all@freebsd.org Fri Dec 11 06:41:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A68749D5750; Fri, 11 Dec 2015 06:41:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 642A81006; Fri, 11 Dec 2015 06:41:03 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB6f2iQ041869; Fri, 11 Dec 2015 06:41:02 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB6f1Fe041861; Fri, 11 Dec 2015 06:41:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512110641.tBB6f1Fe041861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 11 Dec 2015 06:41:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292089 - stable/10/sys/dev/sfxge X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 06:41:03 -0000 Author: arybchik Date: Fri Dec 11 06:41:01 2015 New Revision: 292089 URL: https://svnweb.freebsd.org/changeset/base/292089 Log: sfxge: implement interface statistics shown by netstat PR: 202907 Submitted by: Boris Misenov Reviewed by: gnn, philip Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D4317 Modified: stable/10/sys/dev/sfxge/sfxge.c stable/10/sys/dev/sfxge/sfxge.h stable/10/sys/dev/sfxge/sfxge_port.c stable/10/sys/dev/sfxge/sfxge_tx.c stable/10/sys/dev/sfxge/sfxge_tx.h stable/10/sys/dev/sfxge/sfxge_version.h Modified: stable/10/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.c Fri Dec 11 06:28:15 2015 (r292088) +++ stable/10/sys/dev/sfxge/sfxge.c Fri Dec 11 06:41:01 2015 (r292089) @@ -69,10 +69,10 @@ __FBSDID("$FreeBSD$"); IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6 | \ IFCAP_TSO4 | IFCAP_TSO6 | \ IFCAP_JUMBO_MTU | \ - IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE) + IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE | IFCAP_HWSTATS) #define SFXGE_CAP_ENABLE SFXGE_CAP #define SFXGE_CAP_FIXED (IFCAP_VLAN_MTU | \ - IFCAP_JUMBO_MTU | IFCAP_LINKSTATE) + IFCAP_JUMBO_MTU | IFCAP_LINKSTATE | IFCAP_HWSTATS) MALLOC_DEFINE(M_SFXGE, "sfxge", "Solarflare 10GigE driver"); @@ -94,6 +94,14 @@ SYSCTL_INT(_hw_sfxge, OID_AUTO, tx_ring, &sfxge_tx_ring_entries, 0, "Maximum number of descriptors in a transmit ring"); +#define SFXGE_PARAM_STATS_UPDATE_PERIOD SFXGE_PARAM(stats_update_period) +static int sfxge_stats_update_period = SFXGE_CALLOUT_TICKS; +TUNABLE_INT(SFXGE_PARAM_STATS_UPDATE_PERIOD, + &sfxge_stats_update_period); +SYSCTL_INT(_hw_sfxge, OID_AUTO, stats_update_period, CTLFLAG_RDTUN, + &sfxge_stats_update_period, 0, + "netstat interface statistics update period in ticks"); + static void sfxge_reset(void *arg, int npending); @@ -506,10 +514,24 @@ sfxge_if_ioctl(struct ifnet *ifp, unsign } static void +sfxge_tick(void *arg) +{ + struct sfxge_softc *sc = arg; + + sfxge_port_update_stats(sc); + sfxge_tx_update_stats(sc); + + callout_reset(&sc->tick_callout, sfxge_stats_update_period, + sfxge_tick, sc); +} + +static void sfxge_ifnet_fini(struct ifnet *ifp) { struct sfxge_softc *sc = ifp->if_softc; + callout_drain(&sc->tick_callout); + SFXGE_ADAPTER_LOCK(sc); sfxge_stop(sc); SFXGE_ADAPTER_UNLOCK(sc); @@ -555,10 +577,15 @@ sfxge_ifnet_init(struct ifnet *ifp, stru ifp->if_transmit = sfxge_if_transmit; ifp->if_qflush = sfxge_if_qflush; + callout_init(&sc->tick_callout, B_TRUE); + DBGPRINT(sc->dev, "ifmedia_init"); if ((rc = sfxge_port_ifmedia_init(sc)) != 0) goto fail; + callout_reset(&sc->tick_callout, sfxge_stats_update_period, + sfxge_tick, sc); + return (0); fail: Modified: stable/10/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge.h Fri Dec 11 06:28:15 2015 (r292088) +++ stable/10/sys/dev/sfxge/sfxge.h Fri Dec 11 06:41:01 2015 (r292089) @@ -121,6 +121,8 @@ enum sfxge_evq_state { #define SFXGE_EV_BATCH 16384 +#define SFXGE_CALLOUT_TICKS 100 + struct sfxge_evq { /* Structure members below are sorted by usage order */ struct sfxge_softc *sc; @@ -274,6 +276,8 @@ struct sfxge_softc { size_t rx_buffer_align; uma_zone_t rx_buffer_zone; + struct callout tick_callout; + unsigned int evq_max; unsigned int evq_count; unsigned int rxq_count; @@ -349,6 +353,7 @@ extern void sfxge_mac_link_update(struct efx_link_mode_t mode); extern int sfxge_mac_filter_set(struct sfxge_softc *sc); extern int sfxge_port_ifmedia_init(struct sfxge_softc *sc); +extern void sfxge_port_update_stats(struct sfxge_softc *sc); #define SFXGE_MAX_MTU (9 * 1024) Modified: stable/10/sys/dev/sfxge/sfxge_port.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_port.c Fri Dec 11 06:28:15 2015 (r292088) +++ stable/10/sys/dev/sfxge/sfxge_port.c Fri Dec 11 06:41:01 2015 (r292089) @@ -87,6 +87,41 @@ out: return (rc); } +void +sfxge_port_update_stats(struct sfxge_softc *sc) +{ + struct ifnet *ifp; + uint64_t *mac_stats; + + SFXGE_PORT_LOCK(&sc->port); + + /* Ignore error and use old values */ + (void)sfxge_mac_stat_update(sc); + + ifp = sc->ifnet; + mac_stats = (uint64_t *)sc->port.mac_stats.decode_buf; + + ifp->if_ipackets = mac_stats[EFX_MAC_RX_PKTS]; + ifp->if_ierrors = mac_stats[EFX_MAC_RX_ERRORS]; + ifp->if_opackets = mac_stats[EFX_MAC_TX_PKTS]; + ifp->if_oerrors = mac_stats[EFX_MAC_TX_ERRORS]; + ifp->if_collisions = + mac_stats[EFX_MAC_TX_SGL_COL_PKTS] + + mac_stats[EFX_MAC_TX_MULT_COL_PKTS] + + mac_stats[EFX_MAC_TX_EX_COL_PKTS] + + mac_stats[EFX_MAC_TX_LATE_COL_PKTS]; + ifp->if_ibytes = mac_stats[EFX_MAC_RX_OCTETS]; + ifp->if_obytes = mac_stats[EFX_MAC_TX_OCTETS]; + /* if_imcasts is maintained in net/if_ethersubr.c */ + ifp->if_omcasts = + mac_stats[EFX_MAC_TX_MULTICST_PKTS] + + mac_stats[EFX_MAC_TX_BRDCST_PKTS]; + /* if_iqdrops is maintained in net/if_ethersubr.c */ + /* if_noproto is maintained in net/if_ethersubr.c */ + + SFXGE_PORT_UNLOCK(&sc->port); +} + static int sfxge_mac_stat_handler(SYSCTL_HANDLER_ARGS) { Modified: stable/10/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.c Fri Dec 11 06:28:15 2015 (r292088) +++ stable/10/sys/dev/sfxge/sfxge_tx.c Fri Dec 11 06:41:01 2015 (r292089) @@ -1683,6 +1683,35 @@ sfxge_tx_stat_init(struct sfxge_softc *s } } +static uint64_t +sfxge_tx_get_drops(struct sfxge_softc *sc) +{ + unsigned int index; + uint64_t drops = 0; + struct sfxge_txq *txq; + + /* Sum across all TX queues */ + for (index = 0; index < sc->txq_count; index++) { + txq = sc->txq[index]; + /* + * In theory, txq->put_overflow and txq->netdown_drops + * should use atomic operation and other should be + * obtained under txq lock, but it is just statistics. + */ + drops += txq->drops + txq->get_overflow + + txq->get_non_tcp_overflow + + txq->put_overflow + txq->netdown_drops + + txq->tso_pdrop_too_many + txq->tso_pdrop_no_rsrc; + } + return (drops); +} + +void +sfxge_tx_update_stats(struct sfxge_softc *sc) +{ + sc->ifnet->if_oerrors += sfxge_tx_get_drops(sc); +} + void sfxge_tx_fini(struct sfxge_softc *sc) { Modified: stable/10/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_tx.h Fri Dec 11 06:28:15 2015 (r292088) +++ stable/10/sys/dev/sfxge/sfxge_tx.h Fri Dec 11 06:41:01 2015 (r292089) @@ -220,6 +220,7 @@ struct sfxge_txq { struct sfxge_evq; +extern void sfxge_tx_update_stats(struct sfxge_softc *sc); extern int sfxge_tx_init(struct sfxge_softc *sc); extern void sfxge_tx_fini(struct sfxge_softc *sc); Modified: stable/10/sys/dev/sfxge/sfxge_version.h ============================================================================== --- stable/10/sys/dev/sfxge/sfxge_version.h Fri Dec 11 06:28:15 2015 (r292088) +++ stable/10/sys/dev/sfxge/sfxge_version.h Fri Dec 11 06:41:01 2015 (r292089) @@ -36,6 +36,6 @@ #ifndef _SFXGE_VERSION_H #define _SFXGE_VERSION_H -#define SFXGE_VERSION_STRING "v4.5.2.1000" +#define SFXGE_VERSION_STRING "v4.5.3.1002" #endif /* _SFXGE_DRIVER_VERSION_H */ From owner-svn-src-all@freebsd.org Fri Dec 11 07:20:35 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B681F9D6463; Fri, 11 Dec 2015 07:20:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 764D81046; Fri, 11 Dec 2015 07:20:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB7KYtv053484; Fri, 11 Dec 2015 07:20:34 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB7KX98053478; Fri, 11 Dec 2015 07:20:33 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201512110720.tBB7KX98053478@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 11 Dec 2015 07:20:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292090 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 07:20:35 -0000 Author: arybchik Date: Fri Dec 11 07:20:33 2015 New Revision: 292090 URL: https://svnweb.freebsd.org/changeset/base/292090 Log: sfxge: unify MCDI response polling Submitted by: Andy Moreton Reviewed by: philip Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D4496 Modified: head/sys/dev/sfxge/common/efx_impl.h head/sys/dev/sfxge/common/efx_mcdi.c head/sys/dev/sfxge/common/hunt_impl.h head/sys/dev/sfxge/common/hunt_mcdi.c head/sys/dev/sfxge/common/siena_impl.h head/sys/dev/sfxge/common/siena_mcdi.c Modified: head/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- head/sys/dev/sfxge/common/efx_impl.h Fri Dec 11 06:41:01 2015 (r292089) +++ head/sys/dev/sfxge/common/efx_impl.h Fri Dec 11 07:20:33 2015 (r292090) @@ -456,12 +456,12 @@ typedef struct efx_mcdi_ops_s { efx_rc_t (*emco_init)(efx_nic_t *, const efx_mcdi_transport_t *); void (*emco_request_copyin)(efx_nic_t *, efx_mcdi_req_t *, unsigned int, boolean_t, boolean_t); - boolean_t (*emco_request_poll)(efx_nic_t *); void (*emco_request_copyout)(efx_nic_t *, efx_mcdi_req_t *); efx_rc_t (*emco_poll_reboot)(efx_nic_t *); + boolean_t (*emco_poll_response)(efx_nic_t *); + void (*emco_read_response)(efx_nic_t *, void *, size_t, size_t); void (*emco_fini)(efx_nic_t *); efx_rc_t (*emco_feature_supported)(efx_nic_t *, efx_mcdi_feature_id_t, boolean_t *); - void (*emco_read_response)(efx_nic_t *, void *, size_t, size_t); } efx_mcdi_ops_t; typedef struct efx_mcdi_s { Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 11 06:41:01 2015 (r292089) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 11 07:20:33 2015 (r292090) @@ -46,12 +46,12 @@ __FBSDID("$FreeBSD$"); static efx_mcdi_ops_t __efx_mcdi_siena_ops = { siena_mcdi_init, /* emco_init */ siena_mcdi_request_copyin, /* emco_request_copyin */ - siena_mcdi_request_poll, /* emco_request_poll */ siena_mcdi_request_copyout, /* emco_request_copyout */ siena_mcdi_poll_reboot, /* emco_poll_reboot */ + siena_mcdi_poll_response, /* emco_poll_response */ + siena_mcdi_read_response, /* emco_read_response */ siena_mcdi_fini, /* emco_fini */ siena_mcdi_feature_supported, /* emco_feature_supported */ - siena_mcdi_read_response, /* emco_read_response */ }; #endif /* EFSYS_OPT_SIENA */ @@ -61,12 +61,12 @@ static efx_mcdi_ops_t __efx_mcdi_siena_o static efx_mcdi_ops_t __efx_mcdi_hunt_ops = { hunt_mcdi_init, /* emco_init */ hunt_mcdi_request_copyin, /* emco_request_copyin */ - hunt_mcdi_request_poll, /* emco_request_poll */ hunt_mcdi_request_copyout, /* emco_request_copyout */ hunt_mcdi_poll_reboot, /* emco_poll_reboot */ + hunt_mcdi_poll_response, /* emco_poll_response */ + hunt_mcdi_read_response, /* emco_read_response */ hunt_mcdi_fini, /* emco_fini */ hunt_mcdi_feature_supported, /* emco_feature_supported */ - hunt_mcdi_read_response, /* emco_read_response */ }; #endif /* EFSYS_OPT_HUNTINGTON */ @@ -189,7 +189,7 @@ efx_mcdi_request_copyin( emcop->emco_request_copyin(enp, emrp, seq, ev_cpl, new_epoch); } -static void __unused +static void efx_mcdi_request_copyout( __in efx_nic_t *enp, __in efx_mcdi_req_t *emrp) @@ -210,6 +210,17 @@ efx_mcdi_poll_reboot( return (rc); } +static boolean_t +efx_mcdi_poll_response( + __in efx_nic_t *enp) +{ + efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; + boolean_t available; + + available = emcop->emco_poll_response(enp); + return (available); +} + static void efx_mcdi_read_response( __in efx_nic_t *enp, @@ -389,19 +400,63 @@ fail1: efx_mcdi_request_poll( __in efx_nic_t *enp) { - efx_mcdi_ops_t *emcop = enp->en_mcdi.em_emcop; - boolean_t completed; + efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); + efx_mcdi_req_t *emrp; + int state; + efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI); - completed = B_FALSE; + /* Serialise against post-watchdog efx_mcdi_ev* */ + EFSYS_LOCK(enp->en_eslp, state); + + EFSYS_ASSERT(emip->emi_pending_req != NULL); + EFSYS_ASSERT(!emip->emi_ev_cpl); + emrp = emip->emi_pending_req; + + /* Check for reboot atomically w.r.t efx_mcdi_request_start */ + if (emip->emi_poll_cnt++ == 0) { + if ((rc = efx_mcdi_poll_reboot(enp)) != 0) { + emip->emi_pending_req = NULL; + EFSYS_UNLOCK(enp->en_eslp, state); + goto fail1; + } + } + + /* Check if a response is available */ + if (efx_mcdi_poll_response(enp) == B_FALSE) { + EFSYS_UNLOCK(enp->en_eslp, state); + return (B_FALSE); + } + + /* Read the response header */ + efx_mcdi_read_response_header(enp, emrp); + + /* Request complete */ + emip->emi_pending_req = NULL; + + EFSYS_UNLOCK(enp->en_eslp, state); + + if ((rc = emrp->emr_rc) != 0) + goto fail2; + + efx_mcdi_request_copyout(enp, emrp); + return (B_TRUE); + +fail2: + if (!emrp->emr_quiet) + EFSYS_PROBE(fail2); +fail1: + if (!emrp->emr_quiet) + EFSYS_PROBE1(fail1, efx_rc_t, rc); - if (emcop != NULL && emcop->emco_request_poll != NULL) - completed = emcop->emco_request_poll(enp); + /* Reboot/Assertion */ + if (rc == EIO || rc == EINTR) + efx_mcdi_raise_exception(enp, emrp, rc); - return (completed); + return (B_TRUE); } __checkReturn boolean_t Modified: head/sys/dev/sfxge/common/hunt_impl.h ============================================================================== --- head/sys/dev/sfxge/common/hunt_impl.h Fri Dec 11 06:41:01 2015 (r292089) +++ head/sys/dev/sfxge/common/hunt_impl.h Fri Dec 11 07:20:33 2015 (r292090) @@ -263,6 +263,10 @@ hunt_mcdi_request_copyin( __in boolean_t ev_cpl, __in boolean_t new_epoch); +extern __checkReturn boolean_t +hunt_mcdi_poll_response( + __in efx_nic_t *enp); + extern void hunt_mcdi_read_response( __in efx_nic_t *enp, @@ -270,10 +274,6 @@ hunt_mcdi_read_response( __in size_t offset, __in size_t length); -extern __checkReturn boolean_t -hunt_mcdi_request_poll( - __in efx_nic_t *enp); - extern void hunt_mcdi_request_copyout( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/hunt_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/hunt_mcdi.c Fri Dec 11 06:41:01 2015 (r292089) +++ head/sys/dev/sfxge/common/hunt_mcdi.c Fri Dec 11 07:20:33 2015 (r292090) @@ -268,7 +268,7 @@ hunt_mcdi_request_copyout( #endif /* EFSYS_OPT_MCDI_LOGGING */ } -static __checkReturn boolean_t + __checkReturn boolean_t hunt_mcdi_poll_response( __in efx_nic_t *enp) { @@ -299,59 +299,6 @@ hunt_mcdi_read_response( } } - __checkReturn boolean_t -hunt_mcdi_request_poll( - __in efx_nic_t *enp) -{ - efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - efx_mcdi_req_t *emrp; - int state; - efx_rc_t rc; - - EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_HUNTINGTON); - - /* Serialise against post-watchdog efx_mcdi_ev* */ - EFSYS_LOCK(enp->en_eslp, state); - - EFSYS_ASSERT(emip->emi_pending_req != NULL); - EFSYS_ASSERT(!emip->emi_ev_cpl); - emrp = emip->emi_pending_req; - - /* Check if a response is available */ - if (hunt_mcdi_poll_response(enp) == B_FALSE) { - EFSYS_UNLOCK(enp->en_eslp, state); - return (B_FALSE); - } - - /* Read the response header */ - efx_mcdi_read_response_header(enp, emrp); - - /* Request complete */ - emip->emi_pending_req = NULL; - - /* Ensure stale MCDI requests fail after an MC reboot. */ - emip->emi_new_epoch = B_FALSE; - - EFSYS_UNLOCK(enp->en_eslp, state); - - if ((rc = emrp->emr_rc) != 0) - goto fail1; - - hunt_mcdi_request_copyout(enp, emrp); - goto out; - -fail1: - if (!emrp->emr_quiet) - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - /* Reboot/Assertion */ - if (rc == EIO || rc == EINTR) - efx_mcdi_raise_exception(enp, emrp, rc); - -out: - return (B_TRUE); -} - efx_rc_t hunt_mcdi_poll_reboot( __in efx_nic_t *enp) Modified: head/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- head/sys/dev/sfxge/common/siena_impl.h Fri Dec 11 06:41:01 2015 (r292089) +++ head/sys/dev/sfxge/common/siena_impl.h Fri Dec 11 07:20:33 2015 (r292090) @@ -121,6 +121,10 @@ siena_mcdi_request_copyin( __in boolean_t ev_cpl, __in boolean_t new_epoch); +extern __checkReturn boolean_t +siena_mcdi_poll_response( + __in efx_nic_t *enp); + extern void siena_mcdi_read_response( __in efx_nic_t *enp, @@ -128,10 +132,6 @@ siena_mcdi_read_response( __in size_t offset, __in size_t length); -extern __checkReturn boolean_t -siena_mcdi_request_poll( - __in efx_nic_t *enp); - extern void siena_mcdi_request_copyout( __in efx_nic_t *enp, Modified: head/sys/dev/sfxge/common/siena_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/siena_mcdi.c Fri Dec 11 06:41:01 2015 (r292089) +++ head/sys/dev/sfxge/common/siena_mcdi.c Fri Dec 11 07:20:33 2015 (r292090) @@ -180,7 +180,7 @@ siena_mcdi_poll_reboot( #endif } -static __checkReturn boolean_t +extern __checkReturn boolean_t siena_mcdi_poll_response( __in efx_nic_t *enp) { @@ -218,69 +218,6 @@ siena_mcdi_read_response( } } - __checkReturn boolean_t -siena_mcdi_request_poll( - __in efx_nic_t *enp) -{ - efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - efx_mcdi_req_t *emrp; - int state; - efx_rc_t rc; - - EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA); - - /* Serialise against post-watchdog efx_mcdi_ev* */ - EFSYS_LOCK(enp->en_eslp, state); - - EFSYS_ASSERT(emip->emi_pending_req != NULL); - EFSYS_ASSERT(!emip->emi_ev_cpl); - emrp = emip->emi_pending_req; - - /* Check for reboot atomically w.r.t efx_mcdi_request_start */ - if (emip->emi_poll_cnt++ == 0) { - if ((rc = siena_mcdi_poll_reboot(enp)) != 0) { - emip->emi_pending_req = NULL; - EFSYS_UNLOCK(enp->en_eslp, state); - - goto fail1; - } - } - - /* Check if a response is available */ - if (siena_mcdi_poll_response(enp) == B_FALSE) { - EFSYS_UNLOCK(enp->en_eslp, state); - return (B_FALSE); - } - - /* Read the response header */ - efx_mcdi_read_response_header(enp, emrp); - - /* Request complete */ - emip->emi_pending_req = NULL; - - EFSYS_UNLOCK(enp->en_eslp, state); - - if ((rc = emrp->emr_rc) != 0) - goto fail2; - - siena_mcdi_request_copyout(enp, emrp); - goto out; - -fail2: - if (!emrp->emr_quiet) - EFSYS_PROBE(fail2); -fail1: - if (!emrp->emr_quiet) - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - /* Reboot/Assertion */ - if (rc == EIO || rc == EINTR) - efx_mcdi_raise_exception(enp, emrp, rc); - -out: - return (B_TRUE); -} - __checkReturn efx_rc_t siena_mcdi_init( __in efx_nic_t *enp, From owner-svn-src-all@freebsd.org Fri Dec 11 07:24:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5AE2D9D68B5; Fri, 11 Dec 2015 07:24:26 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2D9951647; Fri, 11 Dec 2015 07:24:26 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBB7OPiv056107; Fri, 11 Dec 2015 07:24:25 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBB7OPgw056106; Fri, 11 Dec 2015 07:24:25 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201512110724.tBB7OPgw056106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 11 Dec 2015 07:24:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292091 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 07:24:26 -0000 Author: araujo Date: Fri Dec 11 07:24:25 2015 New Revision: 292091 URL: https://svnweb.freebsd.org/changeset/base/292091 Log: Fix minor typos introduced on r292084. Approved by: rodrigc (mentor) Differential Revision: https://reviews.freebsd.org/D4495 Modified: head/share/mk/sys.mk Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Fri Dec 11 07:20:33 2015 (r292090) +++ head/share/mk/sys.mk Fri Dec 11 07:24:25 2015 (r292091) @@ -407,10 +407,10 @@ __MAKE_SHELL?=/bin/sh .endif # Hack for ports compatibility. Historically, ports makefiles have -# assumed hey can examine MACHINE_CPU without including anything +# assumed they can examine MACHINE_CPU without including anything # because this was automatically included in sys.mk. For /usr/src, # this file has moved to being included from bsd.opts.mk. Until all -# the ports files are modernized, and a reasonable transitition +# the ports files are modernized, and a reasonable transition # period has passed, include it while we're in a ports tree here # to preserve historic behavior. .if exists(${.CURDIR}/../../Mk/bsd.port.mk) From owner-svn-src-all@freebsd.org Fri Dec 11 10:58:27 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7288E9D7685; Fri, 11 Dec 2015 10:58:27 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3FF3912EA; Fri, 11 Dec 2015 10:58:27 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBAwQwN020939; Fri, 11 Dec 2015 10:58:26 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBAwQKe020938; Fri, 11 Dec 2015 10:58:26 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512111058.tBBAwQKe020938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 11 Dec 2015 10:58:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292092 - head/usr.sbin/sesutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 10:58:27 -0000 Author: bapt Date: Fri Dec 11 10:58:26 2015 New Revision: 292092 URL: https://svnweb.freebsd.org/changeset/base/292092 Log: sesutil: fix map not printing the status of the LED device in an array Sponsored by: Gandi.net Modified: head/usr.sbin/sesutil/eltsub.c Modified: head/usr.sbin/sesutil/eltsub.c ============================================================================== --- head/usr.sbin/sesutil/eltsub.c Fri Dec 11 07:24:25 2015 (r292091) +++ head/usr.sbin/sesutil/eltsub.c Fri Dec 11 10:58:26 2015 (r292092) @@ -185,10 +185,10 @@ stat2ascii(int eletype, u_char *cstat) (cstat[0] & 0x40) ? ", Prd.Fail" : "", (cstat[0] & 0x20) ? ", Disabled" : "", (cstat[0] & 0x10) ? ", Swapped" : "", - (eletype == ELMTYP_DEVICE && (cstat[2] & 0x02)) ? - ", LED=Locate" : "", - (eletype == ELMTYP_DEVICE && (cstat[3] & 0x20)) ? - ", LED=Fault" : "", + ((eletype == ELMTYP_DEVICE || eletype == ELMTYP_ARRAY_DEV) + && (cstat[2] & 0x02)) ? ", LED=Locate" : "", + ((eletype == ELMTYP_DEVICE || eletype == ELMTYP_ARRAY_DEV) + && (cstat[3] & 0x20)) ? ", LED=Fault" : "", cstat[0], cstat[1], cstat[2], cstat[3]); return (ebuf); } From owner-svn-src-all@freebsd.org Fri Dec 11 11:08:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 500129D7D8F; Fri, 11 Dec 2015 11:08:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F75E19ED; Fri, 11 Dec 2015 11:08:02 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBB81TE023862; Fri, 11 Dec 2015 11:08:01 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBB815N023861; Fri, 11 Dec 2015 11:08:01 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512111108.tBBB815N023861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 11 Dec 2015 11:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292093 - head/usr.sbin/sesutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 11:08:02 -0000 Author: bapt Date: Fri Dec 11 11:08:00 2015 New Revision: 292093 URL: https://svnweb.freebsd.org/changeset/base/292093 Log: sesutils, pass the correct element type when printing the status of a given element of the ses. Sponsored by: Gandi.net Modified: head/usr.sbin/sesutil/sesutil.c Modified: head/usr.sbin/sesutil/sesutil.c ============================================================================== --- head/usr.sbin/sesutil/sesutil.c Fri Dec 11 10:58:26 2015 (r292092) +++ head/usr.sbin/sesutil/sesutil.c Fri Dec 11 11:08:00 2015 (r292093) @@ -392,7 +392,7 @@ objmap(int argc, char **argv __unused) printf("\tElement %u, Type: %s\n", e_ptr[j].elm_idx, geteltnm(e_ptr[j].elm_type)); printf("\t\tStatus: %s\n", - stat2ascii(e_ptr[i].elm_type, e_status.cstat)); + stat2ascii(e_ptr[j].elm_type, e_status.cstat)); if (e_desc.elm_desc_len > 0) { printf("\t\tDescription: %s\n", e_desc.elm_desc_str); From owner-svn-src-all@freebsd.org Fri Dec 11 12:16:07 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 038FB9D53D9; Fri, 11 Dec 2015 12:16:07 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C58E810AC; Fri, 11 Dec 2015 12:16:06 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBCG5sU044331; Fri, 11 Dec 2015 12:16:05 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBCG5BI044327; Fri, 11 Dec 2015 12:16:05 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512111216.tBBCG5BI044327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 11 Dec 2015 12:16:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292094 - stable/10/sys/dev/ixl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 12:16:07 -0000 Author: smh Date: Fri Dec 11 12:16:05 2015 New Revision: 292094 URL: https://svnweb.freebsd.org/changeset/base/292094 Log: MFC r277084,r277088,r277130,r277143,r277151,r277262 r277084: Intel I40E updates ixl v1.3.0 and ixlv 1.2.0 featuring RSS r277088, r277130, r277143, r277151 & r277262: Misc RSS fixes The main change is the addition of RSS, which is not supported in stable/10, however these commits also include other bug fixes. In order to bring those fixes in and facilitate easier merge of future updates the RSS changes are maintained but left disabled by the removal of the opt_rss.h include. Sponsored by: Multiplay Modified: stable/10/sys/dev/ixl/if_ixl.c stable/10/sys/dev/ixl/if_ixlv.c stable/10/sys/dev/ixl/ixl.h stable/10/sys/dev/ixl/ixl_txrx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixl/if_ixl.c ============================================================================== --- stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 11:08:00 2015 (r292093) +++ stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 12:16:05 2015 (r292094) @@ -37,10 +37,14 @@ #include "ixl.h" #include "ixl_pf.h" +#ifdef RSS +#include +#endif + /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.2.8"; +char ixl_driver_version[] = "1.3.1"; /********************************************************************* * PCI Device ID Table @@ -174,7 +178,7 @@ static void ixl_stat_update48(struct i40 static void ixl_stat_update32(struct i40e_hw *, u32, bool, u64 *, u64 *); -#ifdef IXL_DEBUG +#ifdef IXL_DEBUG_SYSCTL static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); @@ -427,7 +431,7 @@ ixl_attach(device_t dev) OID_AUTO, "dynamic_tx_itr", CTLFLAG_RW, &ixl_dynamic_tx_itr, 0, "Dynamic TX ITR"); -#ifdef IXL_DEBUG +#ifdef IXL_DEBUG_SYSCTL SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "link_status", CTLTYPE_STRING | CTLFLAG_RD, @@ -662,8 +666,9 @@ ixl_attach(device_t dev) /* Reset port's advertised speeds */ if (!i40e_is_40G_device(hw->device_id)) { - pf->advertised_speed = 0x7; - ixl_set_advertised_speeds(pf, 0x7); + pf->advertised_speed = + (hw->device_id == I40E_DEV_ID_10G_BASE_T) ? 0x7 : 0x6; + ixl_set_advertised_speeds(pf, pf->advertised_speed); } /* Register for VLAN events */ @@ -1407,6 +1412,12 @@ ixl_media_status(struct ifnet * ifp, str case I40E_PHY_TYPE_10GBASE_SFPP_CU: ifmr->ifm_active |= IFM_10G_TWINAX; break; + case I40E_PHY_TYPE_10GBASE_KR: + /* + ** this is not technically correct + ** but FreeBSD does not have the media + ** type defined yet, so its a compromise. + */ case I40E_PHY_TYPE_10GBASE_SR: ifmr->ifm_active |= IFM_10G_SR; break; @@ -1721,8 +1732,10 @@ ixl_local_timer(void *arg) vsi->active_queues |= ((u64)1 << que->me); } if (que->busy >= IXL_MAX_TX_BUSY) { +#ifdef IXL_DEBUG device_printf(dev,"Warning queue %d " "appears to be hung!\n", i); +#endif que->busy = IXL_QUEUE_HUNG; ++hung; } @@ -1765,6 +1778,15 @@ ixl_update_link_status(struct ixl_pf *pf "Full Duplex", ixl_fc_string[fc]); } vsi->link_active = TRUE; + /* + ** Warn user if link speed on NPAR enabled + ** partition is not at least 10GB + */ + if (hw->func_caps.npar_enable && + (hw->phy.link_info.link_speed == I40E_LINK_SPEED_1GB || + hw->phy.link_info.link_speed == I40E_LINK_SPEED_100MB)) + device_printf(dev, "The partition detected link" + "speed that is less than 10Gbps\n"); if_link_state_change(ifp, LINK_STATE_UP); } } else { /* Link down */ @@ -1901,6 +1923,7 @@ ixl_assign_vsi_msix(struct ixl_pf *pf) /* Now set up the stations */ for (int i = 0; i < vsi->num_queues; i++, vector++, que++) { + int cpu_id = i; rid = vector + 1; txr = &que->txr; que->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, @@ -1921,14 +1944,23 @@ ixl_assign_vsi_msix(struct ixl_pf *pf) } bus_describe_intr(dev, que->res, que->tag, "q%d", i); /* Bind the vector to a CPU */ - bus_bind_intr(dev, que->res, i); +#ifdef RSS + cpu_id = rss_getcpu(i % rss_getnumbuckets()); +#endif + bus_bind_intr(dev, que->res, cpu_id); que->msix = vector; TASK_INIT(&que->tx_task, 0, ixl_deferred_mq_start, que); TASK_INIT(&que->task, 0, ixl_handle_que, que); que->tq = taskqueue_create_fast("ixl_que", M_NOWAIT, taskqueue_thread_enqueue, &que->tq); - taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que", - device_get_nameunit(pf->dev)); +#ifdef RSS + taskqueue_start_threads_pinned(&que->tq, 1, PI_NET, + cpu_id, "%s (bucket %d)", + device_get_nameunit(dev), cpu_id); +#else + taskqueue_start_threads(&que->tq, 1, PI_NET, + "%s que", device_get_nameunit(dev)); +#endif } return (0); @@ -1995,6 +2027,12 @@ ixl_init_msix(struct ixl_pf *pf) if ((ixl_max_queues != 0) && (ixl_max_queues <= queues)) queues = ixl_max_queues; +#ifdef RSS + /* If we're doing RSS, clamp at the number of RSS buckets */ + if (queues > rss_getnumbuckets()) + queues = rss_getnumbuckets(); +#endif + /* ** Want one vector (RX/TX pair) per queue ** plus an additional for the admin queue. @@ -2015,6 +2053,25 @@ ixl_init_msix(struct ixl_pf *pf) "Using MSIX interrupts with %d vectors\n", vectors); pf->msix = vectors; pf->vsi.num_queues = queues; +#ifdef RSS + /* + * If we're doing RSS, the number of queues needs to + * match the number of RSS buckets that are configured. + * + * + If there's more queues than RSS buckets, we'll end + * up with queues that get no traffic. + * + * + If there's more RSS buckets than queues, we'll end + * up having multiple RSS buckets map to the same queue, + * so there'll be some contention. + */ + if (queues != rss_getnumbuckets()) { + device_printf(dev, + "%s: queues (%d) != RSS buckets (%d)" + "; performance will be impacted.\n", + __func__, queues, rss_getnumbuckets()); + } +#endif return (vectors); } msi: @@ -2383,7 +2440,8 @@ ixl_setup_interface(device_t dev, struct if (aq_error == I40E_ERR_UNKNOWN_PHY) { /* Need delay to detect fiber correctly */ i40e_msec_delay(200); - aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, TRUE, &abilities_resp, NULL); + aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, + TRUE, &abilities_resp, NULL); if (aq_error == I40E_ERR_UNKNOWN_PHY) device_printf(dev, "Unknown PHY type detected!\n"); else @@ -3043,7 +3101,6 @@ ixl_add_sysctls_eth_stats(struct sysctl_ "Multicast Packets Transmitted"}, {ð_stats->tx_broadcast, "bcast_pkts_txd", "Broadcast Packets Transmitted"}, - {ð_stats->tx_discards, "tx_discards", "Discarded TX packets"}, // end {0,0,0} }; @@ -3126,19 +3183,45 @@ static void ixl_config_rss(struct ixl_vs struct ixl_pf *pf = (struct ixl_pf *)vsi->back; struct i40e_hw *hw = vsi->hw; u32 lut = 0; - u64 set_hena, hena; - int i, j; + u64 set_hena = 0, hena; + int i, j, que_id; +#ifdef RSS + u32 rss_hash_config; + u32 rss_seed[IXL_KEYSZ]; +#else + u32 rss_seed[IXL_KEYSZ] = {0x41b01687, + 0x183cfd8c, 0xce880440, 0x580cbc3c, + 0x35897377, 0x328b25e1, 0x4fa98922, + 0xb7d90c14, 0xd5bad70d, 0xcd15a2c1}; +#endif - static const u32 seed[I40E_PFQF_HKEY_MAX_INDEX + 1] = {0x41b01687, - 0x183cfd8c, 0xce880440, 0x580cbc3c, 0x35897377, - 0x328b25e1, 0x4fa98922, 0xb7d90c14, 0xd5bad70d, - 0xcd15a2c1, 0xe8580225, 0x4a1e9d11, 0xfe5731be}; +#ifdef RSS + /* Fetch the configured RSS key */ + rss_getkey((uint8_t *) &rss_seed); +#endif /* Fill out hash function seed */ - for (i = 0; i <= I40E_PFQF_HKEY_MAX_INDEX; i++) - wr32(hw, I40E_PFQF_HKEY(i), seed[i]); + for (i = 0; i < IXL_KEYSZ; i++) + wr32(hw, I40E_PFQF_HKEY(i), rss_seed[i]); /* Enable PCTYPES for RSS: */ +#ifdef RSS + rss_hash_config = rss_gethashconfig(); + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV4) + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER); + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV4) + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP); + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4) + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP); + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6) + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER); + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6_EX) + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6); + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV6) + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP); + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6) + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_UDP); +#else set_hena = ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP) | ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP) | @@ -3151,7 +3234,7 @@ static void ixl_config_rss(struct ixl_vs ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER) | ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6) | ((u64)1 << I40E_FILTER_PCTYPE_L2_PAYLOAD); - +#endif hena = (u64)rd32(hw, I40E_PFQF_HENA(0)) | ((u64)rd32(hw, I40E_PFQF_HENA(1)) << 32); hena |= set_hena; @@ -3162,8 +3245,19 @@ static void ixl_config_rss(struct ixl_vs for (i = j = 0; i < pf->hw.func_caps.rss_table_size; i++, j++) { if (j == vsi->num_queues) j = 0; +#ifdef RSS + /* + * Fetch the RSS bucket id for the given indirection entry. + * Cap it at the number of configured buckets (which is + * num_queues.) + */ + que_id = rss_get_indirection_to_bucket(i); + que_id = que_id % vsi->num_queues; +#else + que_id = j; +#endif /* lut = 4-byte sliding window of 4 lut entries */ - lut = (lut << 8) | (j & + lut = (lut << 8) | (que_id & ((0x1 << pf->hw.func_caps.rss_table_entry_width) - 1)); /* On i = 3, we have 4 entries in lut; write to the register */ if ((i & 3) == 3) @@ -3401,7 +3495,7 @@ ixl_add_hw_filters(struct ixl_vsi *vsi, a = malloc(sizeof(struct i40e_aqc_add_macvlan_element_data) * cnt, M_DEVBUF, M_NOWAIT | M_ZERO); if (a == NULL) { - device_printf(dev, "add hw filter failed to get memory\n"); + device_printf(dev, "add_hw_filters failed to get memory\n"); return; } @@ -3426,8 +3520,8 @@ ixl_add_hw_filters(struct ixl_vsi *vsi, if (j > 0) { err = i40e_aq_add_macvlan(hw, vsi->seid, a, j, NULL); if (err) - device_printf(dev, "aq_add_macvlan failure %d\n", - hw->aq.asq_last_status); + device_printf(dev, "aq_add_macvlan err %d, aq_error %d\n", + err, hw->aq.asq_last_status); else vsi->hw_filters_add += j; } @@ -3476,6 +3570,7 @@ ixl_del_hw_filters(struct ixl_vsi *vsi, err = i40e_aq_remove_macvlan(hw, vsi->seid, d, j, NULL); /* NOTE: returns ENOENT every time but seems to work fine, so we'll ignore that specific error. */ + // TODO: Does this still occur on current firmwares? if (err && hw->aq.asq_last_status != I40E_AQ_RC_ENOENT) { int sc = 0; for (int i = 0; i < j; i++) @@ -3828,29 +3923,6 @@ ixl_update_stats_counters(struct ixl_pf pf->stat_offsets_loaded, &osd->link_xoff_tx, &nsd->link_xoff_tx); - /* Priority flow control stats */ -#if 0 - for (int i = 0; i < 8; i++) { - ixl_stat_update32(hw, I40E_GLPRT_PXONRXC(hw->port, i), - pf->stat_offsets_loaded, - &osd->priority_xon_rx[i], - &nsd->priority_xon_rx[i]); - ixl_stat_update32(hw, I40E_GLPRT_PXONTXC(hw->port, i), - pf->stat_offsets_loaded, - &osd->priority_xon_tx[i], - &nsd->priority_xon_tx[i]); - ixl_stat_update32(hw, I40E_GLPRT_PXOFFTXC(hw->port, i), - pf->stat_offsets_loaded, - &osd->priority_xoff_tx[i], - &nsd->priority_xoff_tx[i]); - ixl_stat_update32(hw, - I40E_GLPRT_RXON2OFFCNT(hw->port, i), - pf->stat_offsets_loaded, - &osd->priority_xon_2_xoff[i], - &nsd->priority_xon_2_xoff[i]); - } -#endif - /* Packet size stats rx */ ixl_stat_update48(hw, I40E_GLPRT_PRC64H(hw->port), I40E_GLPRT_PRC64L(hw->port), @@ -4377,6 +4449,15 @@ ixl_set_advertised_speeds(struct ixl_pf return (EAGAIN); } + /* + ** This seems a bit heavy handed, but we + ** need to get a reinit on some devices + */ + IXL_PF_LOCK(pf); + ixl_stop(pf); + ixl_init_locked(pf); + IXL_PF_UNLOCK(pf); + return (0); } @@ -4521,7 +4602,7 @@ ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS) } -#ifdef IXL_DEBUG +#ifdef IXL_DEBUG_SYSCTL static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS) { @@ -4630,6 +4711,16 @@ ixl_sysctl_sw_filter_list(SYSCTL_HANDLER #define IXL_SW_RES_SIZE 0x14 static int +ixl_res_alloc_cmp(const void *a, const void *b) +{ + const struct i40e_aqc_switch_resource_alloc_element_resp *one, *two; + one = (struct i40e_aqc_switch_resource_alloc_element_resp *)a; + two = (struct i40e_aqc_switch_resource_alloc_element_resp *)b; + + return ((int)one->resource_type - (int)two->resource_type); +} + +static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS) { struct ixl_pf *pf = (struct ixl_pf *)arg1; @@ -4647,6 +4738,7 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A return (ENOMEM); } + bzero(resp, sizeof(resp)); error = i40e_aq_get_switch_resource_alloc(hw, &num_entries, resp, IXL_SW_RES_SIZE, @@ -4657,9 +4749,14 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A sbuf_delete(buf); return error; } - device_printf(dev, "Num_entries: %d\n", num_entries); + + /* Sort entries by type for display */ + qsort(resp, num_entries, + sizeof(struct i40e_aqc_switch_resource_alloc_element_resp), + &ixl_res_alloc_cmp); sbuf_cat(buf, "\n"); + sbuf_printf(buf, "# of entries: %d\n", num_entries); sbuf_printf(buf, "Type | Guaranteed | Total | Used | Un-allocated\n" " | (this) | (all) | (this) | (all) \n"); @@ -4847,5 +4944,5 @@ ixl_sysctl_dump_txd(SYSCTL_HANDLER_ARGS) sbuf_delete(buf); return error; } -#endif +#endif /* IXL_DEBUG_SYSCTL */ Modified: stable/10/sys/dev/ixl/if_ixlv.c ============================================================================== --- stable/10/sys/dev/ixl/if_ixlv.c Fri Dec 11 11:08:00 2015 (r292093) +++ stable/10/sys/dev/ixl/if_ixlv.c Fri Dec 11 12:16:05 2015 (r292094) @@ -37,10 +37,14 @@ #include "ixl.h" #include "ixlv.h" +#ifdef RSS +#include +#endif + /********************************************************************* * Driver version *********************************************************************/ -char ixlv_driver_version[] = "1.1.18"; +char ixlv_driver_version[] = "1.2.1"; /********************************************************************* * PCI Device ID Table @@ -1161,7 +1165,11 @@ ixlv_init_msix(struct ixlv_sc *sc) /* Override with hardcoded value if sane */ if ((ixlv_max_queues != 0) && (ixlv_max_queues <= queues)) queues = ixlv_max_queues; - +#ifdef RSS + /* If we're doing RSS, clamp at the number of RSS buckets */ + if (queues > rss_getnumbuckets()) + queues = rss_getnumbuckets(); +#endif /* Enforce the VF max value */ if (queues > IXLV_MAX_QUEUES) queues = IXLV_MAX_QUEUES; @@ -1181,6 +1189,26 @@ ixlv_init_msix(struct ixlv_sc *sc) goto fail; } +#ifdef RSS + /* + * If we're doing RSS, the number of queues needs to + * match the number of RSS buckets that are configured. + * + * + If there's more queues than RSS buckets, we'll end + * up with queues that get no traffic. + * + * + If there's more RSS buckets than queues, we'll end + * up having multiple RSS buckets map to the same queue, + * so there'll be some contention. + */ + if (queues != rss_getnumbuckets()) { + device_printf(dev, + "%s: queues (%d) != RSS buckets (%d)" + "; performance will be impacted.\n", + __func__, queues, rss_getnumbuckets()); + } +#endif + if (pci_alloc_msix(dev, &vectors) == 0) { device_printf(sc->dev, "Using MSIX interrupts with %d vectors\n", vectors); @@ -1352,6 +1380,7 @@ ixlv_assign_msix(struct ixlv_sc *sc) int error, rid, vector = 1; for (int i = 0; i < vsi->num_queues; i++, vector++, que++) { + int cpu_id = i; rid = vector + 1; txr = &que->txr; que->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, @@ -1372,15 +1401,25 @@ ixlv_assign_msix(struct ixlv_sc *sc) } bus_describe_intr(dev, que->res, que->tag, "que %d", i); /* Bind the vector to a CPU */ - bus_bind_intr(dev, que->res, i); +#ifdef RSS + cpu_id = rss_getcpu(i % rss_getnumbuckets()); +#endif + bus_bind_intr(dev, que->res, cpu_id); que->msix = vector; vsi->que_mask |= (u64)(1 << que->msix); TASK_INIT(&que->tx_task, 0, ixl_deferred_mq_start, que); TASK_INIT(&que->task, 0, ixlv_handle_que, que); que->tq = taskqueue_create_fast("ixlv_que", M_NOWAIT, taskqueue_thread_enqueue, &que->tq); - taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que", - device_get_nameunit(sc->dev)); +#ifdef RSS + taskqueue_start_threads_pinned(&que->tq, 1, PI_NET, + cpu_id, "%s (bucket %d)", + device_get_nameunit(dev), cpu_id); +#else + taskqueue_start_threads(&que->tq, 1, PI_NET, + "%s que", device_get_nameunit(dev)); +#endif + } return (0); @@ -2521,16 +2560,18 @@ ixlv_config_rss(struct ixlv_sc *sc) struct i40e_hw *hw = &sc->hw; struct ixl_vsi *vsi = &sc->vsi; u32 lut = 0; - u64 set_hena, hena; - int i, j; - - /* set up random bits */ - static const u32 seed[I40E_VFQF_HKEY_MAX_INDEX + 1] = { - 0x794221b4, 0xbca0c5ab, 0x6cd5ebd9, 0x1ada6127, - 0x983b3aa1, 0x1c4e71eb, 0x7f6328b2, 0xfcdc0da0, - 0xc135cafa, 0x7a6f7e2d, 0xe7102d28, 0x163cd12e, - 0x4954b126 }; - + u64 set_hena = 0, hena; + int i, j, que_id; +#ifdef RSS + u32 rss_hash_config; + u32 rss_seed[IXL_KEYSZ]; +#else + u32 rss_seed[IXL_KEYSZ] = {0x41b01687, + 0x183cfd8c, 0xce880440, 0x580cbc3c, + 0x35897377, 0x328b25e1, 0x4fa98922, + 0xb7d90c14, 0xd5bad70d, 0xcd15a2c1}; +#endif + /* Don't set up RSS if using a single queue */ if (vsi->num_queues == 1) { wr32(hw, I40E_VFQF_HENA(0), 0); @@ -2539,11 +2580,32 @@ ixlv_config_rss(struct ixlv_sc *sc) return; } +#ifdef RSS + /* Fetch the configured RSS key */ + rss_getkey((uint8_t *) &rss_seed); +#endif /* Fill out hash function seed */ - for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++) - wr32(hw, I40E_VFQF_HKEY(i), seed[i]); + for (i = 0; i <= IXL_KEYSZ; i++) + wr32(hw, I40E_VFQF_HKEY(i), rss_seed[i]); /* Enable PCTYPES for RSS: */ +#ifdef RSS + rss_hash_config = rss_gethashconfig(); + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV4) + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER); + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV4) + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP); + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4) + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP); + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6) + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER); + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6_EX) + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6); + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV6) + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP); + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6) + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_UDP); +#else set_hena = ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP) | ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP) | @@ -2556,7 +2618,7 @@ ixlv_config_rss(struct ixlv_sc *sc) ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER) | ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6) | ((u64)1 << I40E_FILTER_PCTYPE_L2_PAYLOAD); - +#endif hena = (u64)rd32(hw, I40E_VFQF_HENA(0)) | ((u64)rd32(hw, I40E_VFQF_HENA(1)) << 32); hena |= set_hena; @@ -2564,16 +2626,26 @@ ixlv_config_rss(struct ixlv_sc *sc) wr32(hw, I40E_VFQF_HENA(1), (u32)(hena >> 32)); /* Populate the LUT with max no. of queues in round robin fashion */ - for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; j++) { + for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++, j++) { if (j == vsi->num_queues) j = 0; +#ifdef RSS + /* + * Fetch the RSS bucket id for the given indirection entry. + * Cap it at the number of configured buckets (which is + * num_queues.) + */ + que_id = rss_get_indirection_to_bucket(i); + que_id = que_id % vsi->num_queues; +#else + que_id = j; +#endif /* lut = 4-byte sliding window of 4 lut entries */ - lut = (lut << 8) | (j & 0xF); + lut = (lut << 8) | (que_id & 0xF); /* On i = 3, we have 4 entries in lut; write to the register */ - if ((j & 3) == 3) { + if ((i & 3) == 3) { wr32(hw, I40E_VFQF_HLUT(i), lut); DDPRINTF(sc->dev, "HLUT(%2d): %#010x", i, lut); - i++; } } ixl_flush(hw); Modified: stable/10/sys/dev/ixl/ixl.h ============================================================================== --- stable/10/sys/dev/ixl/ixl.h Fri Dec 11 11:08:00 2015 (r292093) +++ stable/10/sys/dev/ixl/ixl.h Fri Dec 11 12:16:05 2015 (r292094) @@ -93,7 +93,7 @@ #include "i40e_type.h" #include "i40e_prototype.h" -#ifdef IXL_DEBUG +#if defined(IXL_DEBUG) || defined(IXL_DEBUG_SYSCTL) #include #define MAC_FORMAT "%02x:%02x:%02x:%02x:%02x:%02x" @@ -101,7 +101,13 @@ (mac_addr)[0], (mac_addr)[1], (mac_addr)[2], (mac_addr)[3], \ (mac_addr)[4], (mac_addr)[5] #define ON_OFF_STR(is_set) ((is_set) ? "On" : "Off") +#endif /* IXL_DEBUG || IXL_DEBUG_SYSCTL */ +#ifdef IXL_DEBUG +/* Enable debug sysctls */ +#ifndef IXL_DEBUG_SYSCTL +#define IXL_DEBUG_SYSCTL 1 +#endif #define _DBG_PRINTF(S, ...) printf("%s: " S "\n", __func__, ##__VA_ARGS__) #define _DEV_DBG_PRINTF(dev, S, ...) device_printf(dev, "%s: " S "\n", __func__, ##__VA_ARGS__) @@ -128,7 +134,7 @@ #define HW_DEBUGOUT(...) if (DEBUG_HW) _DBG_PRINTF(__VA_ARGS__) -#else +#else /* no IXL_DEBUG */ #define DEBUG_INIT 0 #define DEBUG_IOCTL 0 #define DEBUG_HW 0 @@ -144,7 +150,7 @@ #define IOCTL_DBG_IF2(...) #define IOCTL_DBG_IF(...) #define HW_DEBUGOUT(...) -#endif +#endif /* IXL_DEBUG */ /* Tunables */ @@ -214,6 +220,7 @@ #define IXL_MAX_TSO_SEGS 66 #define IXL_SPARSE_CHAIN 6 #define IXL_QUEUE_HUNG 0x80000000 +#define IXL_KEYSZ 10 /* ERJ: hardware can support ~1.5k filters between all functions */ #define IXL_MAX_FILTERS 256 Modified: stable/10/sys/dev/ixl/ixl_txrx.c ============================================================================== --- stable/10/sys/dev/ixl/ixl_txrx.c Fri Dec 11 11:08:00 2015 (r292093) +++ stable/10/sys/dev/ixl/ixl_txrx.c Fri Dec 11 12:16:05 2015 (r292094) @@ -42,6 +42,10 @@ #include "opt_inet6.h" #include "ixl.h" +#ifdef RSS +#include +#endif + /* Local Prototypes */ static void ixl_rx_checksum(struct mbuf *, u32, u32, u8); static void ixl_refresh_mbufs(struct ixl_queue *, int); @@ -65,14 +69,33 @@ ixl_mq_start(struct ifnet *ifp, struct m struct ixl_queue *que; struct tx_ring *txr; int err, i; +#ifdef RSS + u32 bucket_id; +#endif - /* check if flowid is set */ - if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) - i = m->m_pkthdr.flowid % vsi->num_queues; - else + /* + ** Which queue to use: + ** + ** When doing RSS, map it to the same outbound + ** queue as the incoming flow would be mapped to. + ** If everything is setup correctly, it should be + ** the same bucket that the current CPU we're on is. + */ + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { +#ifdef RSS + if (rss_hash2bucket(m->m_pkthdr.flowid, + M_HASHTYPE_GET(m), &bucket_id) == 0) { + i = bucket_id % vsi->num_queues; + } else +#endif + i = m->m_pkthdr.flowid % vsi->num_queues; + } else i = curcpu % vsi->num_queues; - - /* Check for a hung queue and pick alternative */ + /* + ** This may not be perfect, but until something + ** better comes along it will keep from scheduling + ** on stalled queues. + */ if (((1 << i) & vsi->active_queues) == 0) i = ffsl(vsi->active_queues); @@ -1089,8 +1112,8 @@ int ixl_init_rx_ring(struct ixl_queue *que) { struct rx_ring *rxr = &que->rxr; -#if defined(INET6) || defined(INET) struct ixl_vsi *vsi = que->vsi; +#if defined(INET6) || defined(INET) struct ifnet *ifp = vsi->ifp; struct lro_ctrl *lro = &rxr->lro; #endif @@ -1345,6 +1368,63 @@ ixl_rx_discard(struct rx_ring *rxr, int return; } +#ifdef RSS +/* +** ixl_ptype_to_hash: parse the packet type +** to determine the appropriate hash. +*/ +static inline int +ixl_ptype_to_hash(u8 ptype) +{ + struct i40e_rx_ptype_decoded decoded; + u8 ex = 0; + + decoded = decode_rx_desc_ptype(ptype); + ex = decoded.outer_frag; + + if (!decoded.known) + return M_HASHTYPE_OPAQUE; + + if (decoded.outer_ip == I40E_RX_PTYPE_OUTER_L2) + return M_HASHTYPE_OPAQUE; + + /* Note: anything that gets to this point is IP */ + if (decoded.outer_ip_ver == I40E_RX_PTYPE_OUTER_IPV6) { + switch (decoded.inner_prot) { + case I40E_RX_PTYPE_INNER_PROT_TCP: + if (ex) + return M_HASHTYPE_RSS_TCP_IPV6_EX; + else + return M_HASHTYPE_RSS_TCP_IPV6; + case I40E_RX_PTYPE_INNER_PROT_UDP: + if (ex) + return M_HASHTYPE_RSS_UDP_IPV6_EX; + else + return M_HASHTYPE_RSS_UDP_IPV6; + default: + if (ex) + return M_HASHTYPE_RSS_IPV6_EX; + else + return M_HASHTYPE_RSS_IPV6; + } + } + if (decoded.outer_ip_ver == I40E_RX_PTYPE_OUTER_IPV4) { + switch (decoded.inner_prot) { + case I40E_RX_PTYPE_INNER_PROT_TCP: + return M_HASHTYPE_RSS_TCP_IPV4; + case I40E_RX_PTYPE_INNER_PROT_UDP: + if (ex) + return M_HASHTYPE_RSS_UDP_IPV4_EX; + else + return M_HASHTYPE_RSS_UDP_IPV4; + default: + return M_HASHTYPE_RSS_IPV4; + } + } + /* We should never get here!! */ + return M_HASHTYPE_OPAQUE; +} +#endif /* RSS */ /********************************************************************* * @@ -1542,8 +1622,14 @@ ixl_rxeof(struct ixl_queue *que, int cou rxr->bytes += sendmp->m_pkthdr.len; if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) ixl_rx_checksum(sendmp, status, error, ptype); +#ifdef RSS + sendmp->m_pkthdr.flowid = + le32toh(cur->wb.qword0.hi_dword.rss); + M_HASHTYPE_SET(sendmp, ixl_ptype_to_hash(ptype)); +#else sendmp->m_pkthdr.flowid = que->msix; M_HASHTYPE_SET(sendmp, M_HASHTYPE_OPAQUE); +#endif } next_desc: bus_dmamap_sync(rxr->dma.tag, rxr->dma.map, From owner-svn-src-all@freebsd.org Fri Dec 11 12:20:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6B3E9D58AC; Fri, 11 Dec 2015 12:20:59 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AA5DB14A1; Fri, 11 Dec 2015 12:20:59 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBCKwS4046507; Fri, 11 Dec 2015 12:20:58 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBCKw3N046498; Fri, 11 Dec 2015 12:20:58 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512111220.tBBCKw3N046498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 11 Dec 2015 12:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292095 - stable/10/sys/dev/ixl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 12:21:00 -0000 Author: smh Date: Fri Dec 11 12:20:58 2015 New Revision: 292095 URL: https://svnweb.freebsd.org/changeset/base/292095 Log: MFC r279033: Bring the XL710 drivers up to the SW3 Sponsored by: Multiplay Modified: stable/10/sys/dev/ixl/i40e_adminq.c stable/10/sys/dev/ixl/i40e_adminq_cmd.h stable/10/sys/dev/ixl/i40e_common.c stable/10/sys/dev/ixl/i40e_lan_hmc.c stable/10/sys/dev/ixl/i40e_prototype.h stable/10/sys/dev/ixl/i40e_type.h stable/10/sys/dev/ixl/if_ixl.c stable/10/sys/dev/ixl/if_ixlv.c stable/10/sys/dev/ixl/ixl.h stable/10/sys/dev/ixl/ixl_pf.h stable/10/sys/dev/ixl/ixl_txrx.c stable/10/sys/dev/ixl/ixlvc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixl/i40e_adminq.c ============================================================================== --- stable/10/sys/dev/ixl/i40e_adminq.c Fri Dec 11 12:16:05 2015 (r292094) +++ stable/10/sys/dev/ixl/i40e_adminq.c Fri Dec 11 12:20:58 2015 (r292095) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -614,7 +614,8 @@ enum i40e_status_code i40e_init_adminq(s goto init_adminq_free_arq; /* get the NVM version info */ - i40e_read_nvm_word(hw, I40E_SR_NVM_IMAGE_VERSION, &hw->nvm.version); + i40e_read_nvm_word(hw, I40E_SR_NVM_DEV_STARTER_VERSION, + &hw->nvm.version); i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_LO, &eetrack_lo); i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_HI, &eetrack_hi); hw->nvm.eetrack = (eetrack_hi << 16) | eetrack_lo; Modified: stable/10/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- stable/10/sys/dev/ixl/i40e_adminq_cmd.h Fri Dec 11 12:16:05 2015 (r292094) +++ stable/10/sys/dev/ixl/i40e_adminq_cmd.h Fri Dec 11 12:20:58 2015 (r292095) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -42,7 +42,7 @@ */ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR 0x0002 +#define I40E_FW_API_VERSION_MINOR 0x0004 struct i40e_aq_desc { __le16 flags; @@ -140,12 +140,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_list_func_capabilities = 0x000A, i40e_aqc_opc_list_dev_capabilities = 0x000B, - i40e_aqc_opc_set_cppm_configuration = 0x0103, - i40e_aqc_opc_set_arp_proxy_entry = 0x0104, - i40e_aqc_opc_set_ns_proxy_entry = 0x0105, - /* LAA */ - i40e_aqc_opc_mng_laa = 0x0106, /* AQ obsolete */ i40e_aqc_opc_mac_address_read = 0x0107, i40e_aqc_opc_mac_address_write = 0x0108, @@ -270,7 +265,6 @@ enum i40e_admin_queue_opc { /* Tunnel commands */ i40e_aqc_opc_add_udp_tunnel = 0x0B00, i40e_aqc_opc_del_udp_tunnel = 0x0B01, - i40e_aqc_opc_tunnel_key_structure = 0x0B10, /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, @@ -282,8 +276,6 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_oem_ocbb_initialize = 0xFE03, /* debug commands */ - i40e_aqc_opc_debug_get_deviceid = 0xFF00, - i40e_aqc_opc_debug_set_mode = 0xFF01, i40e_aqc_opc_debug_read_reg = 0xFF03, i40e_aqc_opc_debug_write_reg = 0xFF04, i40e_aqc_opc_debug_modify_reg = 0xFF07, @@ -517,7 +509,8 @@ struct i40e_aqc_mac_address_read { #define I40E_AQC_SAN_ADDR_VALID 0x20 #define I40E_AQC_PORT_ADDR_VALID 0x40 #define I40E_AQC_WOL_ADDR_VALID 0x80 -#define I40E_AQC_ADDR_VALID_MASK 0xf0 +#define I40E_AQC_MC_MAG_EN_VALID 0x100 +#define I40E_AQC_ADDR_VALID_MASK 0x1F0 u8 reserved[6]; __le32 addr_high; __le32 addr_low; @@ -540,7 +533,9 @@ struct i40e_aqc_mac_address_write { #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x0000 #define I40E_AQC_WRITE_TYPE_LAA_WOL 0x4000 #define I40E_AQC_WRITE_TYPE_PORT 0x8000 -#define I40E_AQC_WRITE_TYPE_MASK 0xc000 +#define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG 0xC000 +#define I40E_AQC_WRITE_TYPE_MASK 0xC000 + __le16 mac_sah; __le32 mac_sal; u8 reserved[8]; @@ -1076,6 +1071,7 @@ struct i40e_aqc_set_vsi_promiscuous_mode __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF __le16 vlan_tag; +#define I40E_AQC_SET_VSI_VLAN_MASK 0x0FFF #define I40E_AQC_SET_VSI_VLAN_VALID 0x8000 u8 reserved[8]; }; @@ -2070,6 +2066,12 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_star #define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT) #define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8 #define I40E_AQC_CEE_APP_STATUS_MASK (0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT) +#define I40E_AQC_CEE_FCOE_STATUS_SHIFT 0x8 +#define I40E_AQC_CEE_FCOE_STATUS_MASK (0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT) +#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT 0xA +#define I40E_AQC_CEE_ISCSI_STATUS_MASK (0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT) +#define I40E_AQC_CEE_FIP_STATUS_SHIFT 0x10 +#define I40E_AQC_CEE_FIP_STATUS_MASK (0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT) struct i40e_aqc_get_cee_dcb_cfg_v1_resp { u8 reserved1; u8 oper_num_tc; Modified: stable/10/sys/dev/ixl/i40e_common.c ============================================================================== --- stable/10/sys/dev/ixl/i40e_common.c Fri Dec 11 12:16:05 2015 (r292094) +++ stable/10/sys/dev/ixl/i40e_common.c Fri Dec 11 12:20:58 2015 (r292095) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -37,6 +37,7 @@ #include "i40e_prototype.h" #include "i40e_virtchnl.h" + /** * i40e_set_mac_type - Sets MAC type * @hw: pointer to the HW structure @@ -61,6 +62,7 @@ enum i40e_status_code i40e_set_mac_type( case I40E_DEV_ID_QSFP_B: case I40E_DEV_ID_QSFP_C: case I40E_DEV_ID_10G_BASE_T: + case I40E_DEV_ID_20G_KR2: hw->mac.type = I40E_MAC_XL710; break; case I40E_DEV_ID_VF: @@ -840,12 +842,15 @@ static enum i40e_media_type i40e_get_med case I40E_PHY_TYPE_10GBASE_CR1: case I40E_PHY_TYPE_40GBASE_CR4: case I40E_PHY_TYPE_10GBASE_SFPP_CU: + case I40E_PHY_TYPE_40GBASE_AOC: + case I40E_PHY_TYPE_10GBASE_AOC: media = I40E_MEDIA_TYPE_DA; break; case I40E_PHY_TYPE_1000BASE_KX: case I40E_PHY_TYPE_10GBASE_KX4: case I40E_PHY_TYPE_10GBASE_KR: case I40E_PHY_TYPE_40GBASE_KR4: + case I40E_PHY_TYPE_20GBASE_KR2: media = I40E_MEDIA_TYPE_BACKPLANE; break; case I40E_PHY_TYPE_SGMII: @@ -1508,6 +1513,10 @@ enum i40e_status_code i40e_aq_get_link_i else hw_link_info->lse_enable = FALSE; + if ((hw->aq.fw_maj_ver < 4 || (hw->aq.fw_maj_ver == 4 && + hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE) + hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU; + /* save link status information */ if (link) i40e_memcpy(link, hw_link_info, sizeof(*hw_link_info), @@ -2807,12 +2816,13 @@ i40e_aq_erase_nvm_exit: #define I40E_DEV_FUNC_CAP_MSIX_VF 0x44 #define I40E_DEV_FUNC_CAP_FLOW_DIRECTOR 0x45 #define I40E_DEV_FUNC_CAP_IEEE_1588 0x46 -#define I40E_DEV_FUNC_CAP_MFP_MODE_1 0xF1 +#define I40E_DEV_FUNC_CAP_FLEX10 0xF1 #define I40E_DEV_FUNC_CAP_CEM 0xF2 #define I40E_DEV_FUNC_CAP_IWARP 0x51 #define I40E_DEV_FUNC_CAP_LED 0x61 #define I40E_DEV_FUNC_CAP_SDP 0x62 #define I40E_DEV_FUNC_CAP_MDIO 0x63 +#define I40E_DEV_FUNC_CAP_WR_CSR_PROT 0x64 /** * i40e_parse_discover_capabilities @@ -2830,6 +2840,7 @@ static void i40e_parse_discover_capabili struct i40e_aqc_list_capabilities_element_resp *cap; u32 valid_functions, num_functions; u32 number, logical_id, phys_id; + u8 major_rev; struct i40e_hw_capabilities *p; u32 i = 0; u16 id; @@ -2848,6 +2859,7 @@ static void i40e_parse_discover_capabili number = LE32_TO_CPU(cap->number); logical_id = LE32_TO_CPU(cap->logical_id); phys_id = LE32_TO_CPU(cap->phys_id); + major_rev = cap->major_rev; switch (id) { case I40E_DEV_FUNC_CAP_SWITCH_MODE: @@ -2922,9 +2934,21 @@ static void i40e_parse_discover_capabili case I40E_DEV_FUNC_CAP_MSIX_VF: p->num_msix_vectors_vf = number; break; - case I40E_DEV_FUNC_CAP_MFP_MODE_1: - if (number == 1) - p->mfp_mode_1 = TRUE; + case I40E_DEV_FUNC_CAP_FLEX10: + if (major_rev == 1) { + if (number == 1) { + p->flex10_enable = TRUE; + p->flex10_capable = TRUE; + } + } else { + /* Capability revision >= 2 */ + if (number & 1) + p->flex10_enable = TRUE; + if (number & 2) + p->flex10_capable = TRUE; + } + p->flex10_mode = logical_id; + p->flex10_status = phys_id; break; case I40E_DEV_FUNC_CAP_CEM: if (number == 1) @@ -2957,11 +2981,18 @@ static void i40e_parse_discover_capabili p->fd_filters_guaranteed = number; p->fd_filters_best_effort = logical_id; break; + case I40E_DEV_FUNC_CAP_WR_CSR_PROT: + p->wr_csr_prot = (u64)number; + p->wr_csr_prot |= (u64)logical_id << 32; + break; default: break; } } + if (p->fcoe) + i40e_debug(hw, I40E_DEBUG_ALL, "device is FCoE capable\n"); + /* Always disable FCoE if compiled without the I40E_FCOE_ENA flag */ p->fcoe = FALSE; @@ -4917,6 +4948,63 @@ void i40e_set_pci_config_data(struct i40 } /** + * i40e_aq_debug_dump + * @hw: pointer to the hardware structure + * @cluster_id: specific cluster to dump + * @table_id: table id within cluster + * @start_index: index of line in the block to read + * @buff_size: dump buffer size + * @buff: dump buffer + * @ret_buff_size: actual buffer size returned + * @ret_next_table: next block to read + * @ret_next_index: next index to read + * + * Dump internal FW/HW data for debug purposes. + * + **/ +enum i40e_status_code i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id, + u8 table_id, u32 start_index, u16 buff_size, + void *buff, u16 *ret_buff_size, + u8 *ret_next_table, u32 *ret_next_index, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_debug_dump_internals *cmd = + (struct i40e_aqc_debug_dump_internals *)&desc.params.raw; + struct i40e_aqc_debug_dump_internals *resp = + (struct i40e_aqc_debug_dump_internals *)&desc.params.raw; + enum i40e_status_code status; + + if (buff_size == 0 || !buff) + return I40E_ERR_PARAM; + + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_debug_dump_internals); + /* Indirect Command */ + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); + if (buff_size > I40E_AQ_LARGE_BUF) + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB); + + cmd->cluster_id = cluster_id; + cmd->table_id = table_id; + cmd->idx = CPU_TO_LE32(start_index); + + desc.datalen = CPU_TO_LE16(buff_size); + + status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); + if (!status) { + if (ret_buff_size != NULL) + *ret_buff_size = LE16_TO_CPU(desc.datalen); + if (ret_next_table != NULL) + *ret_next_table = resp->table_id; + if (ret_next_index != NULL) + *ret_next_index = LE32_TO_CPU(resp->idx); + } + + return status; +} + +/** * i40e_read_bw_from_alt_ram * @hw: pointer to the hardware structure * @max_bw: pointer for max_bw read Modified: stable/10/sys/dev/ixl/i40e_lan_hmc.c ============================================================================== --- stable/10/sys/dev/ixl/i40e_lan_hmc.c Fri Dec 11 12:16:05 2015 (r292094) +++ stable/10/sys/dev/ixl/i40e_lan_hmc.c Fri Dec 11 12:20:58 2015 (r292095) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -1218,7 +1218,7 @@ static enum i40e_status_code i40e_set_hm /** * i40e_hmc_get_object_va - retrieves an object's virtual address - * @hmc_info: pointer to i40e_hmc_info struct + * @hw: pointer to the hw structure * @object_base: pointer to u64 to get the va * @rsrc_type: the hmc resource type * @obj_idx: hmc object index @@ -1227,12 +1227,13 @@ static enum i40e_status_code i40e_set_hm * base pointer. This function is used for LAN Queue contexts. **/ static -enum i40e_status_code i40e_hmc_get_object_va(struct i40e_hmc_info *hmc_info, +enum i40e_status_code i40e_hmc_get_object_va(struct i40e_hw *hw, u8 **object_base, enum i40e_hmc_lan_rsrc_type rsrc_type, u32 obj_idx) { u32 obj_offset_in_sd, obj_offset_in_pd; + struct i40e_hmc_info *hmc_info = &hw->hmc; struct i40e_hmc_sd_entry *sd_entry; struct i40e_hmc_pd_entry *pd_entry; u32 pd_idx, pd_lmt, rel_pd_idx; @@ -1304,8 +1305,7 @@ enum i40e_status_code i40e_get_lan_tx_qu enum i40e_status_code err; u8 *context_bytes; - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, - I40E_HMC_LAN_TX, queue); + err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_TX, queue); if (err < 0) return err; @@ -1324,8 +1324,7 @@ enum i40e_status_code i40e_clear_lan_tx_ enum i40e_status_code err; u8 *context_bytes; - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, - I40E_HMC_LAN_TX, queue); + err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_TX, queue); if (err < 0) return err; @@ -1345,8 +1344,7 @@ enum i40e_status_code i40e_set_lan_tx_qu enum i40e_status_code err; u8 *context_bytes; - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, - I40E_HMC_LAN_TX, queue); + err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_TX, queue); if (err < 0) return err; @@ -1367,8 +1365,7 @@ enum i40e_status_code i40e_get_lan_rx_qu enum i40e_status_code err; u8 *context_bytes; - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, - I40E_HMC_LAN_RX, queue); + err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_RX, queue); if (err < 0) return err; @@ -1387,8 +1384,7 @@ enum i40e_status_code i40e_clear_lan_rx_ enum i40e_status_code err; u8 *context_bytes; - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, - I40E_HMC_LAN_RX, queue); + err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_RX, queue); if (err < 0) return err; @@ -1408,8 +1404,7 @@ enum i40e_status_code i40e_set_lan_rx_qu enum i40e_status_code err; u8 *context_bytes; - err = i40e_hmc_get_object_va(&hw->hmc, &context_bytes, - I40E_HMC_LAN_RX, queue); + err = i40e_hmc_get_object_va(hw, &context_bytes, I40E_HMC_LAN_RX, queue); if (err < 0) return err; Modified: stable/10/sys/dev/ixl/i40e_prototype.h ============================================================================== --- stable/10/sys/dev/ixl/i40e_prototype.h Fri Dec 11 12:16:05 2015 (r292094) +++ stable/10/sys/dev/ixl/i40e_prototype.h Fri Dec 11 12:20:58 2015 (r292095) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -445,4 +445,9 @@ enum i40e_status_code i40e_aq_add_rem_co u16 vsi_seid, u16 queue, bool is_add, struct i40e_control_filter_stats *stats, struct i40e_asq_cmd_details *cmd_details); +enum i40e_status_code i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id, + u8 table_id, u32 start_index, u16 buff_size, + void *buff, u16 *ret_buff_size, + u8 *ret_next_table, u32 *ret_next_index, + struct i40e_asq_cmd_details *cmd_details); #endif /* _I40E_PROTOTYPE_H_ */ Modified: stable/10/sys/dev/ixl/i40e_type.h ============================================================================== --- stable/10/sys/dev/ixl/i40e_type.h Fri Dec 11 12:16:05 2015 (r292094) +++ stable/10/sys/dev/ixl/i40e_type.h Fri Dec 11 12:20:58 2015 (r292095) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -57,6 +57,7 @@ #define I40E_DEV_ID_QSFP_B 0x1584 #define I40E_DEV_ID_QSFP_C 0x1585 #define I40E_DEV_ID_10G_BASE_T 0x1586 +#define I40E_DEV_ID_20G_KR2 0x1587 #define I40E_DEV_ID_VF 0x154C #define I40E_DEV_ID_VF_HV 0x1571 @@ -286,7 +287,17 @@ struct i40e_hw_capabilities { bool dcb; bool fcoe; bool iscsi; /* Indicates iSCSI enabled */ - bool mfp_mode_1; + bool flex10_enable; + bool flex10_capable; + u32 flex10_mode; +#define I40E_FLEX10_MODE_UNKNOWN 0x0 +#define I40E_FLEX10_MODE_DCC 0x1 +#define I40E_FLEX10_MODE_DCI 0x2 + + u32 flex10_status; +#define I40E_FLEX10_STATUS_DCC_ERROR 0x1 +#define I40E_FLEX10_STATUS_VC_MODE 0x2 + bool mgmt_cem; bool ieee_1588; bool iwarp; @@ -315,6 +326,7 @@ struct i40e_hw_capabilities { u8 rx_buf_chain_len; u32 enabled_tcmap; u32 maxtc; + u64 wr_csr_prot; }; struct i40e_mac_info { @@ -560,7 +572,11 @@ struct i40e_hw { /* debug mask */ u32 debug_mask; }; -#define i40e_is_vf(_hw) ((_hw)->mac.type == I40E_MAC_VF) + +static INLINE bool i40e_is_vf(struct i40e_hw *hw) +{ + return hw->mac.type == I40E_MAC_VF; +} struct i40e_driver_version { u8 major_version; @@ -1258,6 +1274,9 @@ struct i40e_hw_port_stats { /* flow director stats */ u64 fd_atr_match; u64 fd_sb_match; + u64 fd_atr_tunnel_match; + u32 fd_atr_status; + u32 fd_sb_status; /* EEE LPI */ u32 tx_lpi_status; u32 rx_lpi_status; Modified: stable/10/sys/dev/ixl/if_ixl.c ============================================================================== --- stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 12:16:05 2015 (r292094) +++ stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 12:20:58 2015 (r292095) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -32,8 +32,11 @@ ******************************************************************************/ /*$FreeBSD$*/ +#ifndef IXL_STANDALONE_BUILD #include "opt_inet.h" #include "opt_inet6.h" +#endif + #include "ixl.h" #include "ixl_pf.h" @@ -44,7 +47,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.3.1"; +char ixl_driver_version[] = "1.3.6"; /********************************************************************* * PCI Device ID Table @@ -98,7 +101,7 @@ static void ixl_update_link_status(s static int ixl_allocate_pci_resources(struct ixl_pf *); static u16 ixl_get_bus_info(struct i40e_hw *, device_t); static int ixl_setup_stations(struct ixl_pf *); -static int ixl_setup_vsi(struct ixl_vsi *); +static int ixl_switch_config(struct ixl_pf *); static int ixl_initialize_vsi(struct ixl_vsi *); static int ixl_assign_vsi_msix(struct ixl_pf *); static int ixl_assign_vsi_legacy(struct ixl_pf *); @@ -498,48 +501,6 @@ ixl_attach(device_t dev) goto err_out; } - /* For now always do an initial CORE reset on first device */ - { - static int ixl_dev_count; - static int ixl_dev_track[32]; - u32 my_dev; - int i, found = FALSE; - u16 bus = pci_get_bus(dev); - - mtx_lock(&ixl_reset_mtx); - my_dev = (bus << 8) | hw->bus.device; - - for (i = 0; i < ixl_dev_count; i++) { - if (ixl_dev_track[i] == my_dev) - found = TRUE; - } - - if (!found) { - u32 reg; - - ixl_dev_track[ixl_dev_count] = my_dev; - ixl_dev_count++; - - INIT_DEBUGOUT("Initial CORE RESET\n"); - wr32(hw, I40E_GLGEN_RTRIG, I40E_GLGEN_RTRIG_CORER_MASK); - ixl_flush(hw); - i = 50; - do { - i40e_msec_delay(50); - reg = rd32(hw, I40E_GLGEN_RSTAT); - if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK)) - break; - } while (i--); - - /* paranoia */ - wr32(hw, I40E_PF_ATQLEN, 0); - wr32(hw, I40E_PF_ATQBAL, 0); - wr32(hw, I40E_PF_ATQBAH, 0); - i40e_clear_pxe_mode(hw); - } - mtx_unlock(&ixl_reset_mtx); - } - /* Set admin queue parameters */ hw->aq.num_arq_entries = IXL_AQ_LEN; hw->aq.num_asq_entries = IXL_AQ_LEN; @@ -629,13 +590,15 @@ ixl_attach(device_t dev) if (error) goto err_late; - i40e_msec_delay(75); - error = i40e_aq_set_link_restart_an(hw, TRUE, NULL); - if (error) { - device_printf(dev, "link restart failed, aq_err=%d\n", - pf->hw.aq.asq_last_status); + if (((hw->aq.fw_maj_ver == 4) && (hw->aq.fw_min_ver < 33)) || + (hw->aq.fw_maj_ver < 4)) { + i40e_msec_delay(75); + error = i40e_aq_set_link_restart_an(hw, TRUE, NULL); + if (error) + device_printf(dev, "link restart failed, aq_err=%d\n", + pf->hw.aq.asq_last_status); } - + /* Determine link state */ vsi->link_up = ixl_config_link(hw); @@ -655,6 +618,18 @@ ixl_attach(device_t dev) goto err_late; } + error = ixl_switch_config(pf); + if (error) { + device_printf(dev, "Initial switch config failed: %d\n", error); + goto err_mac_hmc; + } + + /* Limit phy interrupts to link and modules failure */ + error = i40e_aq_set_phy_int_mask(hw, + I40E_AQ_EVENT_LINK_UPDOWN | I40E_AQ_EVENT_MODULE_QUAL_FAIL, NULL); + if (error) + device_printf(dev, "set phy mask failed: %d\n", error); + /* Get the bus configuration and set the shared code */ bus = ixl_get_bus_info(hw, dev); i40e_set_pci_config_data(hw, bus); @@ -664,13 +639,6 @@ ixl_attach(device_t dev) ixl_update_stats_counters(pf); ixl_add_hw_stats(pf); - /* Reset port's advertised speeds */ - if (!i40e_is_40G_device(hw->device_id)) { - pf->advertised_speed = - (hw->device_id == I40E_DEV_ID_10G_BASE_T) ? 0x7 : 0x6; - ixl_set_advertised_speeds(pf, pf->advertised_speed); - } - /* Register for VLAN events */ vsi->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, ixl_register_vlan, vsi, EVENTHANDLER_PRI_FIRST); @@ -722,9 +690,12 @@ ixl_detach(device_t dev) return (EBUSY); } - IXL_PF_LOCK(pf); - ixl_stop(pf); - IXL_PF_UNLOCK(pf); + ether_ifdetach(vsi->ifp); + if (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING) { + IXL_PF_LOCK(pf); + ixl_stop(pf); + IXL_PF_UNLOCK(pf); + } for (int i = 0; i < vsi->num_queues; i++, que++) { if (que->tq) { @@ -752,7 +723,6 @@ ixl_detach(device_t dev) if (vsi->vlan_detach != NULL) EVENTHANDLER_DEREGISTER(vlan_unconfig, vsi->vlan_detach); - ether_ifdetach(vsi->ifp); callout_drain(&pf->timer); @@ -1121,11 +1091,8 @@ ixl_init_locked(struct ixl_pf *pf) /* Set up RSS */ ixl_config_rss(vsi); - /* Setup the VSI */ - ixl_setup_vsi(vsi); - /* - ** Prepare the rings, hmc contexts, etc... + ** Prepare the VSI: rings, hmc contexts, etc... */ if (ixl_initialize_vsi(vsi)) { device_printf(dev, "initialize vsi failed!!\n"); @@ -1408,16 +1375,14 @@ ixl_media_status(struct ifnet * ifp, str ifmr->ifm_active |= IFM_1000_LX; break; /* 10 G */ + case I40E_PHY_TYPE_10GBASE_CR1: case I40E_PHY_TYPE_10GBASE_CR1_CU: case I40E_PHY_TYPE_10GBASE_SFPP_CU: + /* Using this until a real KR media type */ + case I40E_PHY_TYPE_10GBASE_KR: + case I40E_PHY_TYPE_10GBASE_KX4: ifmr->ifm_active |= IFM_10G_TWINAX; break; - case I40E_PHY_TYPE_10GBASE_KR: - /* - ** this is not technically correct - ** but FreeBSD does not have the media - ** type defined yet, so its a compromise. - */ case I40E_PHY_TYPE_10GBASE_SR: ifmr->ifm_active |= IFM_10G_SR; break; @@ -1438,6 +1403,16 @@ ixl_media_status(struct ifnet * ifp, str case I40E_PHY_TYPE_40GBASE_LR4: ifmr->ifm_active |= IFM_40G_LR4; break; + /* + ** Set these to CR4 because OS does not + ** have types available yet. + */ + case I40E_PHY_TYPE_40GBASE_KR4: + case I40E_PHY_TYPE_XLAUI: + case I40E_PHY_TYPE_XLPPI: + case I40E_PHY_TYPE_40GBASE_AOC: + ifmr->ifm_active |= IFM_40G_CR4; + break; default: ifmr->ifm_active |= IFM_UNKNOWN; break; @@ -1764,18 +1739,17 @@ ixl_update_link_status(struct ixl_pf *pf struct i40e_hw *hw = &pf->hw; struct ifnet *ifp = vsi->ifp; device_t dev = pf->dev; - enum i40e_fc_mode fc; if (vsi->link_up){ if (vsi->link_active == FALSE) { i40e_aq_get_link_info(hw, TRUE, NULL, NULL); + pf->fc = hw->fc.current_mode; if (bootverbose) { - fc = hw->fc.current_mode; device_printf(dev,"Link is up %d Gbps %s," " Flow Control: %s\n", ((vsi->link_speed == I40E_LINK_SPEED_40GB)? 40:10), - "Full Duplex", ixl_fc_string[fc]); + "Full Duplex", ixl_fc_string[pf->fc]); } vsi->link_active = TRUE; /* @@ -2340,8 +2314,15 @@ ixl_add_ifmedia(struct ixl_vsi *vsi, u32 ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_T, 0, NULL); if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU) || + phy_type & (1 << I40E_PHY_TYPE_10GBASE_KX4) || + phy_type & (1 << I40E_PHY_TYPE_10GBASE_KR) || + phy_type & (1 << I40E_PHY_TYPE_10GBASE_AOC) || + phy_type & (1 << I40E_PHY_TYPE_XAUI) || + phy_type & (1 << I40E_PHY_TYPE_XFI) || + phy_type & (1 << I40E_PHY_TYPE_SFI) || phy_type & (1 << I40E_PHY_TYPE_10GBASE_SFPP_CU)) ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_TWINAX, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_SR)) ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_SR, 0, NULL); if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_LR)) @@ -2349,9 +2330,15 @@ ixl_add_ifmedia(struct ixl_vsi *vsi, u32 if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_T)) ifmedia_add(&vsi->media, IFM_ETHER | IFM_10G_T, 0, NULL); - if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4_CU) || - phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4)) + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4) || + phy_type & (1 << I40E_PHY_TYPE_40GBASE_CR4_CU) || + phy_type & (1 << I40E_PHY_TYPE_40GBASE_AOC) || + phy_type & (1 << I40E_PHY_TYPE_XLAUI) || + phy_type & (1 << I40E_PHY_TYPE_XLPPI) || + /* KR4 uses CR4 until the OS has the real media type */ + phy_type & (1 << I40E_PHY_TYPE_40GBASE_KR4)) ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_CR4, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_SR4)) ifmedia_add(&vsi->media, IFM_ETHER | IFM_40G_SR4, 0, NULL); if (phy_type & (1 << I40E_PHY_TYPE_40GBASE_LR4)) @@ -2369,7 +2356,7 @@ ixl_setup_interface(device_t dev, struct struct ifnet *ifp; struct i40e_hw *hw = vsi->hw; struct ixl_queue *que = vsi->queues; - struct i40e_aq_get_phy_abilities_resp abilities_resp; + struct i40e_aq_get_phy_abilities_resp abilities; enum i40e_status_code aq_error = 0; INIT_DEBUGOUT("ixl_setup_interface: begin"); @@ -2436,21 +2423,25 @@ ixl_setup_interface(device_t dev, struct ifmedia_init(&vsi->media, IFM_IMASK, ixl_media_change, ixl_media_status); - aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, TRUE, &abilities_resp, NULL); + aq_error = i40e_aq_get_phy_capabilities(hw, + FALSE, TRUE, &abilities, NULL); + /* May need delay to detect fiber correctly */ if (aq_error == I40E_ERR_UNKNOWN_PHY) { - /* Need delay to detect fiber correctly */ i40e_msec_delay(200); aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, - TRUE, &abilities_resp, NULL); + TRUE, &abilities, NULL); + } + if (aq_error) { if (aq_error == I40E_ERR_UNKNOWN_PHY) device_printf(dev, "Unknown PHY type detected!\n"); else - ixl_add_ifmedia(vsi, abilities_resp.phy_type); - } else if (aq_error) { - device_printf(dev, "Error getting supported media types, err %d," - " AQ error %d\n", aq_error, hw->aq.asq_last_status); - } else - ixl_add_ifmedia(vsi, abilities_resp.phy_type); + device_printf(dev, + "Error getting supported media types, err %d," + " AQ error %d\n", aq_error, hw->aq.asq_last_status); + return (0); + } + + ixl_add_ifmedia(vsi, abilities.phy_type); /* Use autoselect media by default */ ifmedia_add(&vsi->media, IFM_ETHER | IFM_AUTO, 0, NULL); @@ -2476,20 +2467,23 @@ ixl_config_link(struct i40e_hw *hw) /********************************************************************* * - * Initialize this VSI + * Get Firmware Switch configuration + * - this will need to be more robust when more complex + * switch configurations are enabled. * **********************************************************************/ static int -ixl_setup_vsi(struct ixl_vsi *vsi) +ixl_switch_config(struct ixl_pf *pf) { - struct i40e_hw *hw = vsi->hw; + struct i40e_hw *hw = &pf->hw; + struct ixl_vsi *vsi = &pf->vsi; device_t dev = vsi->dev; struct i40e_aqc_get_switch_config_resp *sw_config; - struct i40e_vsi_context ctxt; u8 aq_buf[I40E_AQ_LARGE_BUF]; int ret = I40E_SUCCESS; u16 next = 0; + memset(&aq_buf, 0, sizeof(aq_buf)); sw_config = (struct i40e_aqc_get_switch_config_resp *)aq_buf; ret = i40e_aq_get_switch_config(hw, sw_config, sizeof(aq_buf), &next, NULL); @@ -2506,16 +2500,34 @@ ixl_setup_vsi(struct ixl_vsi *vsi) sw_config->element[0].uplink_seid, sw_config->element[0].downlink_seid); #endif - /* Save off this important value */ + /* Simplified due to a single VSI at the moment */ vsi->seid = sw_config->element[0].seid; + return (ret); +} + +/********************************************************************* + * + * Initialize the VSI: this handles contexts, which means things + * like the number of descriptors, buffer size, + * plus we init the rings thru this function. + * + **********************************************************************/ +static int +ixl_initialize_vsi(struct ixl_vsi *vsi) +{ + struct ixl_queue *que = vsi->queues; + device_t dev = vsi->dev; + struct i40e_hw *hw = vsi->hw; + struct i40e_vsi_context ctxt; + int err = 0; memset(&ctxt, 0, sizeof(ctxt)); ctxt.seid = vsi->seid; ctxt.pf_num = hw->pf_id; - ret = i40e_aq_get_vsi_params(hw, &ctxt, NULL); - if (ret) { - device_printf(dev,"get vsi params failed %x!!\n", ret); - return (ret); + err = i40e_aq_get_vsi_params(hw, &ctxt, NULL); + if (err) { + device_printf(dev,"get vsi params failed %x!!\n", err); + return (err); } #ifdef IXL_DEBUG printf("get_vsi_params: seid: %d, uplinkseid: %d, vsi_number: %d, " @@ -2552,29 +2564,12 @@ ixl_setup_vsi(struct ixl_vsi *vsi) vsi->hw_filters_add = 0; vsi->hw_filters_del = 0; - ret = i40e_aq_update_vsi_params(hw, &ctxt, NULL); - if (ret) + err = i40e_aq_update_vsi_params(hw, &ctxt, NULL); + if (err) { device_printf(dev,"update vsi params failed %x!!\n", hw->aq.asq_last_status); - return (ret); -} - - -/********************************************************************* - * - * Initialize the VSI: this handles contexts, which means things - * like the number of descriptors, buffer size, - * plus we init the rings thru this function. - * - **********************************************************************/ -static int -ixl_initialize_vsi(struct ixl_vsi *vsi) -{ - struct ixl_queue *que = vsi->queues; - device_t dev = vsi->dev; - struct i40e_hw *hw = vsi->hw; - int err = 0; - + return (err); + } for (int i = 0; i < vsi->num_queues; i++, que++) { struct tx_ring *txr = &que->txr; @@ -3215,7 +3210,7 @@ static void ixl_config_rss(struct ixl_vs set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP); if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6) set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER); - if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6_EX) + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6_EX) set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6); if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV6) set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP); @@ -3520,8 +3515,8 @@ ixl_add_hw_filters(struct ixl_vsi *vsi, if (j > 0) { err = i40e_aq_add_macvlan(hw, vsi->seid, a, j, NULL); if (err) - device_printf(dev, "aq_add_macvlan err %d, aq_error %d\n", - err, hw->aq.asq_last_status); + device_printf(dev, "aq_add_macvlan err %d, " + "aq_error %d\n", err, hw->aq.asq_last_status); else vsi->hw_filters_add += j; } @@ -4306,24 +4301,15 @@ ixl_set_flowcntl(SYSCTL_HANDLER_ARGS) struct ixl_pf *pf = (struct ixl_pf *)arg1; struct i40e_hw *hw = &pf->hw; device_t dev = pf->dev; - int requested_fc = 0, error = 0; + int error = 0; enum i40e_status_code aq_error = 0; u8 fc_aq_err = 0; - aq_error = i40e_aq_get_link_info(hw, TRUE, NULL, NULL); - if (aq_error) { - device_printf(dev, - "%s: Error retrieving link info from aq, %d\n", - __func__, aq_error); - return (EAGAIN); - } - - /* Read in new mode */ - requested_fc = hw->fc.current_mode; - error = sysctl_handle_int(oidp, &requested_fc, 0, req); + /* Get request */ + error = sysctl_handle_int(oidp, &pf->fc, 0, req); if ((error) || (req->newptr == NULL)) return (error); - if (requested_fc < 0 || requested_fc > 3) { + if (pf->fc < 0 || pf->fc > 3) { device_printf(dev, "Invalid fc mode; valid modes are 0 through 3\n"); return (EINVAL); @@ -4341,7 +4327,7 @@ ixl_set_flowcntl(SYSCTL_HANDLER_ARGS) } /* Set fc ability for port */ - hw->fc.requested_mode = requested_fc; + hw->fc.requested_mode = pf->fc; aq_error = i40e_set_fc(hw, &fc_aq_err, TRUE); if (aq_error) { device_printf(dev, @@ -4350,14 +4336,6 @@ ixl_set_flowcntl(SYSCTL_HANDLER_ARGS) return (EAGAIN); } - if (hw->fc.current_mode != hw->fc.requested_mode) { - device_printf(dev, "%s: FC set failure:\n", __func__); - device_printf(dev, "%s: Current: %s / Requested: %s\n", - __func__, - ixl_fc_string[hw->fc.current_mode], - ixl_fc_string[hw->fc.requested_mode]); - } - return (0); } @@ -4416,9 +4394,11 @@ ixl_set_advertised_speeds(struct ixl_pf enum i40e_status_code aq_error = 0; /* Get current capability information */ - aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, FALSE, &abilities, NULL); + aq_error = i40e_aq_get_phy_capabilities(hw, + FALSE, FALSE, &abilities, NULL); if (aq_error) { - device_printf(dev, "%s: Error getting phy capabilities %d," + device_printf(dev, + "%s: Error getting phy capabilities %d," " aq error: %d\n", __func__, aq_error, hw->aq.asq_last_status); return (EAGAIN); @@ -4443,7 +4423,8 @@ ixl_set_advertised_speeds(struct ixl_pf /* Do aq command & restart link */ aq_error = i40e_aq_set_phy_config(hw, &config, NULL); if (aq_error) { - device_printf(dev, "%s: Error setting new phy config %d," + device_printf(dev, + "%s: Error setting new phy config %d," " aq error: %d\n", __func__, aq_error, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 11 12:22:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B17D89D5B46 for ; Fri, 11 Dec 2015 12:22:40 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: from mail-wm0-x231.google.com (mail-wm0-x231.google.com [IPv6:2a00:1450:400c:c09::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 24C6B1948 for ; Fri, 11 Dec 2015 12:22:39 +0000 (UTC) (envelope-from steven.hartland@multiplay.co.uk) Received: by wmec201 with SMTP id c201so67649672wme.1 for ; Fri, 11 Dec 2015 04:22:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=wwejl9suL0kDnLkZU3npGI99INANAQAUD61UiIGFw1k=; b=jI6OFbxViDJDWQ2bm5mqlneONAb4tyfaG2qCmgGTUyeWVbO6rfcfUm3hBYixhDdpwH rUp83HxccowgKBGRkKXqMv4uOuImtH9OGTGxT9BHhXT1dKygu+bZo0xp2DIXJKW8N8TT JS6rtP8lF6pVXlPYxJPan584NhlsEGitJqGMwn76UcyVeINJFqMhtZ4bEUy0Qd6vssKw KLnMhcOzc8Zj5cJbEelQ7QUrAIlH+AXAGNuiaxJoDM86xoEIpWUKxMsNmdUsXjFtHjEB OsSI9/xgRvg9kiodqsfv5eXoVUCqDLkHWlmyCDFXb0djbR3qRGLFScHGu29MboM00lk7 ehMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=wwejl9suL0kDnLkZU3npGI99INANAQAUD61UiIGFw1k=; b=L9CXt6xWdwFKzHHA1gx9zULc2LnygknRel2PVcSDmoeoQNxE5hIFLnRBNwszG3OyG9 42bdL6FyMBVZnUvs78Lviaqcd7jg7JqF/xqLBWhKTqXyFJWUl+XJ3Krg1qasRIa/NV9f 8HsxwaE2Sx6U+MhjNztVRMnxJ78SmSnSSz23/5S1GOA/BUyirgaTMsREvbZC5FZCoedU AP9ZXwRo9fHesnVBDxzZ9DY2gpQUCbbhNa9ii1WoWW1N4TfrQ5sO9eOkyJlOrUrgxeYt EgagskmZ0r1OVXXhHRRSEj2OJBMy38OTZrjqejy54QvoMM2Gi3b04xsNsNI5M87smLxd XrEw== X-Gm-Message-State: ALoCoQnVSWTn8pV6nFKd1hTgLH0E0QzfqbsDPzruC02FlR1F/Pr9lWaIT8XT9LoXHotY6uMETQfamwJZdCeyRhv5U5GmJcLX9g== X-Received: by 10.28.222.4 with SMTP id v4mr5751547wmg.67.1449836558253; Fri, 11 Dec 2015 04:22:38 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id a63sm3172711wmc.5.2015.12.11.04.22.36 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 Dec 2015 04:22:37 -0800 (PST) Subject: Re: svn commit: r292094 - stable/10/sys/dev/ixl To: Steven Hartland , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org References: <201512111216.tBBCG5BI044327@repo.freebsd.org> From: Steven Hartland Message-ID: <566AC00D.4090200@multiplay.co.uk> Date: Fri, 11 Dec 2015 12:22:37 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201512111216.tBBCG5BI044327@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 12:22:40 -0000 This should have referenced https://reviews.freebsd.org/D4265 On 11/12/2015 12:16, Steven Hartland wrote: > Author: smh > Date: Fri Dec 11 12:16:05 2015 > New Revision: 292094 > URL: https://svnweb.freebsd.org/changeset/base/292094 > > Log: > MFC r277084,r277088,r277130,r277143,r277151,r277262 > > r277084: Intel I40E updates ixl v1.3.0 and ixlv 1.2.0 featuring RSS > r277088, r277130, r277143, r277151 & r277262: Misc RSS fixes > > The main change is the addition of RSS, which is not supported in stable/10, > however these commits also include other bug fixes. In order to bring those > fixes in and facilitate easier merge of future updates the RSS changes are > maintained but left disabled by the removal of the opt_rss.h include. > > Sponsored by: Multiplay > > Modified: > stable/10/sys/dev/ixl/if_ixl.c > stable/10/sys/dev/ixl/if_ixlv.c > stable/10/sys/dev/ixl/ixl.h > stable/10/sys/dev/ixl/ixl_txrx.c > Directory Properties: > stable/10/ (props changed) > > Modified: stable/10/sys/dev/ixl/if_ixl.c > ============================================================================== > --- stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 11:08:00 2015 (r292093) > +++ stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 12:16:05 2015 (r292094) > @@ -37,10 +37,14 @@ > #include "ixl.h" > #include "ixl_pf.h" > > +#ifdef RSS > +#include > +#endif > + > /********************************************************************* > * Driver version > *********************************************************************/ > -char ixl_driver_version[] = "1.2.8"; > +char ixl_driver_version[] = "1.3.1"; > > /********************************************************************* > * PCI Device ID Table > @@ -174,7 +178,7 @@ static void ixl_stat_update48(struct i40 > static void ixl_stat_update32(struct i40e_hw *, u32, bool, > u64 *, u64 *); > > -#ifdef IXL_DEBUG > +#ifdef IXL_DEBUG_SYSCTL > static int ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS); > static int ixl_sysctl_phy_abilities(SYSCTL_HANDLER_ARGS); > static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); > @@ -427,7 +431,7 @@ ixl_attach(device_t dev) > OID_AUTO, "dynamic_tx_itr", CTLFLAG_RW, > &ixl_dynamic_tx_itr, 0, "Dynamic TX ITR"); > > -#ifdef IXL_DEBUG > +#ifdef IXL_DEBUG_SYSCTL > SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), > SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), > OID_AUTO, "link_status", CTLTYPE_STRING | CTLFLAG_RD, > @@ -662,8 +666,9 @@ ixl_attach(device_t dev) > > /* Reset port's advertised speeds */ > if (!i40e_is_40G_device(hw->device_id)) { > - pf->advertised_speed = 0x7; > - ixl_set_advertised_speeds(pf, 0x7); > + pf->advertised_speed = > + (hw->device_id == I40E_DEV_ID_10G_BASE_T) ? 0x7 : 0x6; > + ixl_set_advertised_speeds(pf, pf->advertised_speed); > } > > /* Register for VLAN events */ > @@ -1407,6 +1412,12 @@ ixl_media_status(struct ifnet * ifp, str > case I40E_PHY_TYPE_10GBASE_SFPP_CU: > ifmr->ifm_active |= IFM_10G_TWINAX; > break; > + case I40E_PHY_TYPE_10GBASE_KR: > + /* > + ** this is not technically correct > + ** but FreeBSD does not have the media > + ** type defined yet, so its a compromise. > + */ > case I40E_PHY_TYPE_10GBASE_SR: > ifmr->ifm_active |= IFM_10G_SR; > break; > @@ -1721,8 +1732,10 @@ ixl_local_timer(void *arg) > vsi->active_queues |= ((u64)1 << que->me); > } > if (que->busy >= IXL_MAX_TX_BUSY) { > +#ifdef IXL_DEBUG > device_printf(dev,"Warning queue %d " > "appears to be hung!\n", i); > +#endif > que->busy = IXL_QUEUE_HUNG; > ++hung; > } > @@ -1765,6 +1778,15 @@ ixl_update_link_status(struct ixl_pf *pf > "Full Duplex", ixl_fc_string[fc]); > } > vsi->link_active = TRUE; > + /* > + ** Warn user if link speed on NPAR enabled > + ** partition is not at least 10GB > + */ > + if (hw->func_caps.npar_enable && > + (hw->phy.link_info.link_speed == I40E_LINK_SPEED_1GB || > + hw->phy.link_info.link_speed == I40E_LINK_SPEED_100MB)) > + device_printf(dev, "The partition detected link" > + "speed that is less than 10Gbps\n"); > if_link_state_change(ifp, LINK_STATE_UP); > } > } else { /* Link down */ > @@ -1901,6 +1923,7 @@ ixl_assign_vsi_msix(struct ixl_pf *pf) > > /* Now set up the stations */ > for (int i = 0; i < vsi->num_queues; i++, vector++, que++) { > + int cpu_id = i; > rid = vector + 1; > txr = &que->txr; > que->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, > @@ -1921,14 +1944,23 @@ ixl_assign_vsi_msix(struct ixl_pf *pf) > } > bus_describe_intr(dev, que->res, que->tag, "q%d", i); > /* Bind the vector to a CPU */ > - bus_bind_intr(dev, que->res, i); > +#ifdef RSS > + cpu_id = rss_getcpu(i % rss_getnumbuckets()); > +#endif > + bus_bind_intr(dev, que->res, cpu_id); > que->msix = vector; > TASK_INIT(&que->tx_task, 0, ixl_deferred_mq_start, que); > TASK_INIT(&que->task, 0, ixl_handle_que, que); > que->tq = taskqueue_create_fast("ixl_que", M_NOWAIT, > taskqueue_thread_enqueue, &que->tq); > - taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que", > - device_get_nameunit(pf->dev)); > +#ifdef RSS > + taskqueue_start_threads_pinned(&que->tq, 1, PI_NET, > + cpu_id, "%s (bucket %d)", > + device_get_nameunit(dev), cpu_id); > +#else > + taskqueue_start_threads(&que->tq, 1, PI_NET, > + "%s que", device_get_nameunit(dev)); > +#endif > } > > return (0); > @@ -1995,6 +2027,12 @@ ixl_init_msix(struct ixl_pf *pf) > if ((ixl_max_queues != 0) && (ixl_max_queues <= queues)) > queues = ixl_max_queues; > > +#ifdef RSS > + /* If we're doing RSS, clamp at the number of RSS buckets */ > + if (queues > rss_getnumbuckets()) > + queues = rss_getnumbuckets(); > +#endif > + > /* > ** Want one vector (RX/TX pair) per queue > ** plus an additional for the admin queue. > @@ -2015,6 +2053,25 @@ ixl_init_msix(struct ixl_pf *pf) > "Using MSIX interrupts with %d vectors\n", vectors); > pf->msix = vectors; > pf->vsi.num_queues = queues; > +#ifdef RSS > + /* > + * If we're doing RSS, the number of queues needs to > + * match the number of RSS buckets that are configured. > + * > + * + If there's more queues than RSS buckets, we'll end > + * up with queues that get no traffic. > + * > + * + If there's more RSS buckets than queues, we'll end > + * up having multiple RSS buckets map to the same queue, > + * so there'll be some contention. > + */ > + if (queues != rss_getnumbuckets()) { > + device_printf(dev, > + "%s: queues (%d) != RSS buckets (%d)" > + "; performance will be impacted.\n", > + __func__, queues, rss_getnumbuckets()); > + } > +#endif > return (vectors); > } > msi: > @@ -2383,7 +2440,8 @@ ixl_setup_interface(device_t dev, struct > if (aq_error == I40E_ERR_UNKNOWN_PHY) { > /* Need delay to detect fiber correctly */ > i40e_msec_delay(200); > - aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, TRUE, &abilities_resp, NULL); > + aq_error = i40e_aq_get_phy_capabilities(hw, FALSE, > + TRUE, &abilities_resp, NULL); > if (aq_error == I40E_ERR_UNKNOWN_PHY) > device_printf(dev, "Unknown PHY type detected!\n"); > else > @@ -3043,7 +3101,6 @@ ixl_add_sysctls_eth_stats(struct sysctl_ > "Multicast Packets Transmitted"}, > {ð_stats->tx_broadcast, "bcast_pkts_txd", > "Broadcast Packets Transmitted"}, > - {ð_stats->tx_discards, "tx_discards", "Discarded TX packets"}, > // end > {0,0,0} > }; > @@ -3126,19 +3183,45 @@ static void ixl_config_rss(struct ixl_vs > struct ixl_pf *pf = (struct ixl_pf *)vsi->back; > struct i40e_hw *hw = vsi->hw; > u32 lut = 0; > - u64 set_hena, hena; > - int i, j; > + u64 set_hena = 0, hena; > + int i, j, que_id; > +#ifdef RSS > + u32 rss_hash_config; > + u32 rss_seed[IXL_KEYSZ]; > +#else > + u32 rss_seed[IXL_KEYSZ] = {0x41b01687, > + 0x183cfd8c, 0xce880440, 0x580cbc3c, > + 0x35897377, 0x328b25e1, 0x4fa98922, > + 0xb7d90c14, 0xd5bad70d, 0xcd15a2c1}; > +#endif > > - static const u32 seed[I40E_PFQF_HKEY_MAX_INDEX + 1] = {0x41b01687, > - 0x183cfd8c, 0xce880440, 0x580cbc3c, 0x35897377, > - 0x328b25e1, 0x4fa98922, 0xb7d90c14, 0xd5bad70d, > - 0xcd15a2c1, 0xe8580225, 0x4a1e9d11, 0xfe5731be}; > +#ifdef RSS > + /* Fetch the configured RSS key */ > + rss_getkey((uint8_t *) &rss_seed); > +#endif > > /* Fill out hash function seed */ > - for (i = 0; i <= I40E_PFQF_HKEY_MAX_INDEX; i++) > - wr32(hw, I40E_PFQF_HKEY(i), seed[i]); > + for (i = 0; i < IXL_KEYSZ; i++) > + wr32(hw, I40E_PFQF_HKEY(i), rss_seed[i]); > > /* Enable PCTYPES for RSS: */ > +#ifdef RSS > + rss_hash_config = rss_gethashconfig(); > + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV4) > + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER); > + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV4) > + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP); > + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4) > + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP); > + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6) > + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER); > + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6_EX) > + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6); > + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV6) > + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP); > + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6) > + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_UDP); > +#else > set_hena = > ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP) | > ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP) | > @@ -3151,7 +3234,7 @@ static void ixl_config_rss(struct ixl_vs > ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER) | > ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6) | > ((u64)1 << I40E_FILTER_PCTYPE_L2_PAYLOAD); > - > +#endif > hena = (u64)rd32(hw, I40E_PFQF_HENA(0)) | > ((u64)rd32(hw, I40E_PFQF_HENA(1)) << 32); > hena |= set_hena; > @@ -3162,8 +3245,19 @@ static void ixl_config_rss(struct ixl_vs > for (i = j = 0; i < pf->hw.func_caps.rss_table_size; i++, j++) { > if (j == vsi->num_queues) > j = 0; > +#ifdef RSS > + /* > + * Fetch the RSS bucket id for the given indirection entry. > + * Cap it at the number of configured buckets (which is > + * num_queues.) > + */ > + que_id = rss_get_indirection_to_bucket(i); > + que_id = que_id % vsi->num_queues; > +#else > + que_id = j; > +#endif > /* lut = 4-byte sliding window of 4 lut entries */ > - lut = (lut << 8) | (j & > + lut = (lut << 8) | (que_id & > ((0x1 << pf->hw.func_caps.rss_table_entry_width) - 1)); > /* On i = 3, we have 4 entries in lut; write to the register */ > if ((i & 3) == 3) > @@ -3401,7 +3495,7 @@ ixl_add_hw_filters(struct ixl_vsi *vsi, > a = malloc(sizeof(struct i40e_aqc_add_macvlan_element_data) * cnt, > M_DEVBUF, M_NOWAIT | M_ZERO); > if (a == NULL) { > - device_printf(dev, "add hw filter failed to get memory\n"); > + device_printf(dev, "add_hw_filters failed to get memory\n"); > return; > } > > @@ -3426,8 +3520,8 @@ ixl_add_hw_filters(struct ixl_vsi *vsi, > if (j > 0) { > err = i40e_aq_add_macvlan(hw, vsi->seid, a, j, NULL); > if (err) > - device_printf(dev, "aq_add_macvlan failure %d\n", > - hw->aq.asq_last_status); > + device_printf(dev, "aq_add_macvlan err %d, aq_error %d\n", > + err, hw->aq.asq_last_status); > else > vsi->hw_filters_add += j; > } > @@ -3476,6 +3570,7 @@ ixl_del_hw_filters(struct ixl_vsi *vsi, > err = i40e_aq_remove_macvlan(hw, vsi->seid, d, j, NULL); > /* NOTE: returns ENOENT every time but seems to work fine, > so we'll ignore that specific error. */ > + // TODO: Does this still occur on current firmwares? > if (err && hw->aq.asq_last_status != I40E_AQ_RC_ENOENT) { > int sc = 0; > for (int i = 0; i < j; i++) > @@ -3828,29 +3923,6 @@ ixl_update_stats_counters(struct ixl_pf > pf->stat_offsets_loaded, > &osd->link_xoff_tx, &nsd->link_xoff_tx); > > - /* Priority flow control stats */ > -#if 0 > - for (int i = 0; i < 8; i++) { > - ixl_stat_update32(hw, I40E_GLPRT_PXONRXC(hw->port, i), > - pf->stat_offsets_loaded, > - &osd->priority_xon_rx[i], > - &nsd->priority_xon_rx[i]); > - ixl_stat_update32(hw, I40E_GLPRT_PXONTXC(hw->port, i), > - pf->stat_offsets_loaded, > - &osd->priority_xon_tx[i], > - &nsd->priority_xon_tx[i]); > - ixl_stat_update32(hw, I40E_GLPRT_PXOFFTXC(hw->port, i), > - pf->stat_offsets_loaded, > - &osd->priority_xoff_tx[i], > - &nsd->priority_xoff_tx[i]); > - ixl_stat_update32(hw, > - I40E_GLPRT_RXON2OFFCNT(hw->port, i), > - pf->stat_offsets_loaded, > - &osd->priority_xon_2_xoff[i], > - &nsd->priority_xon_2_xoff[i]); > - } > -#endif > - > /* Packet size stats rx */ > ixl_stat_update48(hw, I40E_GLPRT_PRC64H(hw->port), > I40E_GLPRT_PRC64L(hw->port), > @@ -4377,6 +4449,15 @@ ixl_set_advertised_speeds(struct ixl_pf > return (EAGAIN); > } > > + /* > + ** This seems a bit heavy handed, but we > + ** need to get a reinit on some devices > + */ > + IXL_PF_LOCK(pf); > + ixl_stop(pf); > + ixl_init_locked(pf); > + IXL_PF_UNLOCK(pf); > + > return (0); > } > > @@ -4521,7 +4602,7 @@ ixl_sysctl_show_fw(SYSCTL_HANDLER_ARGS) > } > > > -#ifdef IXL_DEBUG > +#ifdef IXL_DEBUG_SYSCTL > static int > ixl_sysctl_link_status(SYSCTL_HANDLER_ARGS) > { > @@ -4630,6 +4711,16 @@ ixl_sysctl_sw_filter_list(SYSCTL_HANDLER > > #define IXL_SW_RES_SIZE 0x14 > static int > +ixl_res_alloc_cmp(const void *a, const void *b) > +{ > + const struct i40e_aqc_switch_resource_alloc_element_resp *one, *two; > + one = (struct i40e_aqc_switch_resource_alloc_element_resp *)a; > + two = (struct i40e_aqc_switch_resource_alloc_element_resp *)b; > + > + return ((int)one->resource_type - (int)two->resource_type); > +} > + > +static int > ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS) > { > struct ixl_pf *pf = (struct ixl_pf *)arg1; > @@ -4647,6 +4738,7 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A > return (ENOMEM); > } > > + bzero(resp, sizeof(resp)); > error = i40e_aq_get_switch_resource_alloc(hw, &num_entries, > resp, > IXL_SW_RES_SIZE, > @@ -4657,9 +4749,14 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A > sbuf_delete(buf); > return error; > } > - device_printf(dev, "Num_entries: %d\n", num_entries); > + > + /* Sort entries by type for display */ > + qsort(resp, num_entries, > + sizeof(struct i40e_aqc_switch_resource_alloc_element_resp), > + &ixl_res_alloc_cmp); > > sbuf_cat(buf, "\n"); > + sbuf_printf(buf, "# of entries: %d\n", num_entries); > sbuf_printf(buf, > "Type | Guaranteed | Total | Used | Un-allocated\n" > " | (this) | (all) | (this) | (all) \n"); > @@ -4847,5 +4944,5 @@ ixl_sysctl_dump_txd(SYSCTL_HANDLER_ARGS) > sbuf_delete(buf); > return error; > } > -#endif > +#endif /* IXL_DEBUG_SYSCTL */ > > > Modified: stable/10/sys/dev/ixl/if_ixlv.c > ============================================================================== > --- stable/10/sys/dev/ixl/if_ixlv.c Fri Dec 11 11:08:00 2015 (r292093) > +++ stable/10/sys/dev/ixl/if_ixlv.c Fri Dec 11 12:16:05 2015 (r292094) > @@ -37,10 +37,14 @@ > #include "ixl.h" > #include "ixlv.h" > > +#ifdef RSS > +#include > +#endif > + > /********************************************************************* > * Driver version > *********************************************************************/ > -char ixlv_driver_version[] = "1.1.18"; > +char ixlv_driver_version[] = "1.2.1"; > > /********************************************************************* > * PCI Device ID Table > @@ -1161,7 +1165,11 @@ ixlv_init_msix(struct ixlv_sc *sc) > /* Override with hardcoded value if sane */ > if ((ixlv_max_queues != 0) && (ixlv_max_queues <= queues)) > queues = ixlv_max_queues; > - > +#ifdef RSS > + /* If we're doing RSS, clamp at the number of RSS buckets */ > + if (queues > rss_getnumbuckets()) > + queues = rss_getnumbuckets(); > +#endif > /* Enforce the VF max value */ > if (queues > IXLV_MAX_QUEUES) > queues = IXLV_MAX_QUEUES; > @@ -1181,6 +1189,26 @@ ixlv_init_msix(struct ixlv_sc *sc) > goto fail; > } > > +#ifdef RSS > + /* > + * If we're doing RSS, the number of queues needs to > + * match the number of RSS buckets that are configured. > + * > + * + If there's more queues than RSS buckets, we'll end > + * up with queues that get no traffic. > + * > + * + If there's more RSS buckets than queues, we'll end > + * up having multiple RSS buckets map to the same queue, > + * so there'll be some contention. > + */ > + if (queues != rss_getnumbuckets()) { > + device_printf(dev, > + "%s: queues (%d) != RSS buckets (%d)" > + "; performance will be impacted.\n", > + __func__, queues, rss_getnumbuckets()); > + } > +#endif > + > if (pci_alloc_msix(dev, &vectors) == 0) { > device_printf(sc->dev, > "Using MSIX interrupts with %d vectors\n", vectors); > @@ -1352,6 +1380,7 @@ ixlv_assign_msix(struct ixlv_sc *sc) > int error, rid, vector = 1; > > for (int i = 0; i < vsi->num_queues; i++, vector++, que++) { > + int cpu_id = i; > rid = vector + 1; > txr = &que->txr; > que->res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, > @@ -1372,15 +1401,25 @@ ixlv_assign_msix(struct ixlv_sc *sc) > } > bus_describe_intr(dev, que->res, que->tag, "que %d", i); > /* Bind the vector to a CPU */ > - bus_bind_intr(dev, que->res, i); > +#ifdef RSS > + cpu_id = rss_getcpu(i % rss_getnumbuckets()); > +#endif > + bus_bind_intr(dev, que->res, cpu_id); > que->msix = vector; > vsi->que_mask |= (u64)(1 << que->msix); > TASK_INIT(&que->tx_task, 0, ixl_deferred_mq_start, que); > TASK_INIT(&que->task, 0, ixlv_handle_que, que); > que->tq = taskqueue_create_fast("ixlv_que", M_NOWAIT, > taskqueue_thread_enqueue, &que->tq); > - taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que", > - device_get_nameunit(sc->dev)); > +#ifdef RSS > + taskqueue_start_threads_pinned(&que->tq, 1, PI_NET, > + cpu_id, "%s (bucket %d)", > + device_get_nameunit(dev), cpu_id); > +#else > + taskqueue_start_threads(&que->tq, 1, PI_NET, > + "%s que", device_get_nameunit(dev)); > +#endif > + > } > > return (0); > @@ -2521,16 +2560,18 @@ ixlv_config_rss(struct ixlv_sc *sc) > struct i40e_hw *hw = &sc->hw; > struct ixl_vsi *vsi = &sc->vsi; > u32 lut = 0; > - u64 set_hena, hena; > - int i, j; > - > - /* set up random bits */ > - static const u32 seed[I40E_VFQF_HKEY_MAX_INDEX + 1] = { > - 0x794221b4, 0xbca0c5ab, 0x6cd5ebd9, 0x1ada6127, > - 0x983b3aa1, 0x1c4e71eb, 0x7f6328b2, 0xfcdc0da0, > - 0xc135cafa, 0x7a6f7e2d, 0xe7102d28, 0x163cd12e, > - 0x4954b126 }; > - > + u64 set_hena = 0, hena; > + int i, j, que_id; > +#ifdef RSS > + u32 rss_hash_config; > + u32 rss_seed[IXL_KEYSZ]; > +#else > + u32 rss_seed[IXL_KEYSZ] = {0x41b01687, > + 0x183cfd8c, 0xce880440, 0x580cbc3c, > + 0x35897377, 0x328b25e1, 0x4fa98922, > + 0xb7d90c14, 0xd5bad70d, 0xcd15a2c1}; > +#endif > + > /* Don't set up RSS if using a single queue */ > if (vsi->num_queues == 1) { > wr32(hw, I40E_VFQF_HENA(0), 0); > @@ -2539,11 +2580,32 @@ ixlv_config_rss(struct ixlv_sc *sc) > return; > } > > +#ifdef RSS > + /* Fetch the configured RSS key */ > + rss_getkey((uint8_t *) &rss_seed); > +#endif > /* Fill out hash function seed */ > - for (i = 0; i <= I40E_VFQF_HKEY_MAX_INDEX; i++) > - wr32(hw, I40E_VFQF_HKEY(i), seed[i]); > + for (i = 0; i <= IXL_KEYSZ; i++) > + wr32(hw, I40E_VFQF_HKEY(i), rss_seed[i]); > > /* Enable PCTYPES for RSS: */ > +#ifdef RSS > + rss_hash_config = rss_gethashconfig(); > + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV4) > + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_OTHER); > + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV4) > + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP); > + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV4) > + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP); > + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6) > + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER); > + if (rss_hash_config & RSS_HASHTYPE_RSS_IPV6_EX) > + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6); > + if (rss_hash_config & RSS_HASHTYPE_RSS_TCP_IPV6) > + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_TCP); > + if (rss_hash_config & RSS_HASHTYPE_RSS_UDP_IPV6) > + set_hena |= ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_UDP); > +#else > set_hena = > ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_UDP) | > ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV4_TCP) | > @@ -2556,7 +2618,7 @@ ixlv_config_rss(struct ixlv_sc *sc) > ((u64)1 << I40E_FILTER_PCTYPE_NONF_IPV6_OTHER) | > ((u64)1 << I40E_FILTER_PCTYPE_FRAG_IPV6) | > ((u64)1 << I40E_FILTER_PCTYPE_L2_PAYLOAD); > - > +#endif > hena = (u64)rd32(hw, I40E_VFQF_HENA(0)) | > ((u64)rd32(hw, I40E_VFQF_HENA(1)) << 32); > hena |= set_hena; > @@ -2564,16 +2626,26 @@ ixlv_config_rss(struct ixlv_sc *sc) > wr32(hw, I40E_VFQF_HENA(1), (u32)(hena >> 32)); > > /* Populate the LUT with max no. of queues in round robin fashion */ > - for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; j++) { > + for (i = 0, j = 0; i <= I40E_VFQF_HLUT_MAX_INDEX; i++, j++) { > if (j == vsi->num_queues) > j = 0; > +#ifdef RSS > + /* > + * Fetch the RSS bucket id for the given indirection entry. > + * Cap it at the number of configured buckets (which is > + * num_queues.) > + */ > + que_id = rss_get_indirection_to_bucket(i); > + que_id = que_id % vsi->num_queues; > +#else > + que_id = j; > +#endif > /* lut = 4-byte sliding window of 4 lut entries */ > - lut = (lut << 8) | (j & 0xF); > + lut = (lut << 8) | (que_id & 0xF); > /* On i = 3, we have 4 entries in lut; write to the register */ > - if ((j & 3) == 3) { > + if ((i & 3) == 3) { > wr32(hw, I40E_VFQF_HLUT(i), lut); > DDPRINTF(sc->dev, "HLUT(%2d): %#010x", i, lut); > - i++; > } > } > ixl_flush(hw); > > Modified: stable/10/sys/dev/ixl/ixl.h > ============================================================================== > --- stable/10/sys/dev/ixl/ixl.h Fri Dec 11 11:08:00 2015 (r292093) > +++ stable/10/sys/dev/ixl/ixl.h Fri Dec 11 12:16:05 2015 (r292094) > @@ -93,7 +93,7 @@ > #include "i40e_type.h" > #include "i40e_prototype.h" > > -#ifdef IXL_DEBUG > +#if defined(IXL_DEBUG) || defined(IXL_DEBUG_SYSCTL) > #include > > #define MAC_FORMAT "%02x:%02x:%02x:%02x:%02x:%02x" > @@ -101,7 +101,13 @@ > (mac_addr)[0], (mac_addr)[1], (mac_addr)[2], (mac_addr)[3], \ > (mac_addr)[4], (mac_addr)[5] > #define ON_OFF_STR(is_set) ((is_set) ? "On" : "Off") > +#endif /* IXL_DEBUG || IXL_DEBUG_SYSCTL */ > > +#ifdef IXL_DEBUG > +/* Enable debug sysctls */ > +#ifndef IXL_DEBUG_SYSCTL > +#define IXL_DEBUG_SYSCTL 1 > +#endif > > #define _DBG_PRINTF(S, ...) printf("%s: " S "\n", __func__, ##__VA_ARGS__) > #define _DEV_DBG_PRINTF(dev, S, ...) device_printf(dev, "%s: " S "\n", __func__, ##__VA_ARGS__) > @@ -128,7 +134,7 @@ > > #define HW_DEBUGOUT(...) if (DEBUG_HW) _DBG_PRINTF(__VA_ARGS__) > > -#else > +#else /* no IXL_DEBUG */ > #define DEBUG_INIT 0 > #define DEBUG_IOCTL 0 > #define DEBUG_HW 0 > @@ -144,7 +150,7 @@ > #define IOCTL_DBG_IF2(...) > #define IOCTL_DBG_IF(...) > #define HW_DEBUGOUT(...) > -#endif > +#endif /* IXL_DEBUG */ > > /* Tunables */ > > @@ -214,6 +220,7 @@ > #define IXL_MAX_TSO_SEGS 66 > #define IXL_SPARSE_CHAIN 6 > #define IXL_QUEUE_HUNG 0x80000000 > +#define IXL_KEYSZ 10 > > /* ERJ: hardware can support ~1.5k filters between all functions */ > #define IXL_MAX_FILTERS 256 > > Modified: stable/10/sys/dev/ixl/ixl_txrx.c > ============================================================================== > --- stable/10/sys/dev/ixl/ixl_txrx.c Fri Dec 11 11:08:00 2015 (r292093) > +++ stable/10/sys/dev/ixl/ixl_txrx.c Fri Dec 11 12:16:05 2015 (r292094) > @@ -42,6 +42,10 @@ > #include "opt_inet6.h" > #include "ixl.h" > > +#ifdef RSS > +#include > +#endif > + > /* Local Prototypes */ > static void ixl_rx_checksum(struct mbuf *, u32, u32, u8); > static void ixl_refresh_mbufs(struct ixl_queue *, int); > @@ -65,14 +69,33 @@ ixl_mq_start(struct ifnet *ifp, struct m > struct ixl_queue *que; > struct tx_ring *txr; > int err, i; > +#ifdef RSS > + u32 bucket_id; > +#endif > > - /* check if flowid is set */ > - if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) > - i = m->m_pkthdr.flowid % vsi->num_queues; > - else > + /* > + ** Which queue to use: > + ** > + ** When doing RSS, map it to the same outbound > + ** queue as the incoming flow would be mapped to. > + ** If everything is setup correctly, it should be > + ** the same bucket that the current CPU we're on is. > + */ > + if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { > +#ifdef RSS > + if (rss_hash2bucket(m->m_pkthdr.flowid, > + M_HASHTYPE_GET(m), &bucket_id) == 0) { > + i = bucket_id % vsi->num_queues; > + } else > +#endif > + i = m->m_pkthdr.flowid % vsi->num_queues; > + } else > i = curcpu % vsi->num_queues; > - > - /* Check for a hung queue and pick alternative */ > + /* > + ** This may not be perfect, but until something > + ** better comes along it will keep from scheduling > + ** on stalled queues. > + */ > if (((1 << i) & vsi->active_queues) == 0) > i = ffsl(vsi->active_queues); > > @@ -1089,8 +1112,8 @@ int > ixl_init_rx_ring(struct ixl_queue *que) > { > struct rx_ring *rxr = &que->rxr; > -#if defined(INET6) || defined(INET) > struct ixl_vsi *vsi = que->vsi; > +#if defined(INET6) || defined(INET) > struct ifnet *ifp = vsi->ifp; > struct lro_ctrl *lro = &rxr->lro; > #endif > @@ -1345,6 +1368,63 @@ ixl_rx_discard(struct rx_ring *rxr, int > return; > } > > +#ifdef RSS > +/* > +** ixl_ptype_to_hash: parse the packet type > +** to determine the appropriate hash. > +*/ > +static inline int > +ixl_ptype_to_hash(u8 ptype) > +{ > + struct i40e_rx_ptype_decoded decoded; > + u8 ex = 0; > + > + decoded = decode_rx_desc_ptype(ptype); > + ex = decoded.outer_frag; > + > + if (!decoded.known) > + return M_HASHTYPE_OPAQUE; > + > + if (decoded.outer_ip == I40E_RX_PTYPE_OUTER_L2) > + return M_HASHTYPE_OPAQUE; > + > + /* Note: anything that gets to this point is IP */ > + if (decoded.outer_ip_ver == I40E_RX_PTYPE_OUTER_IPV6) { > + switch (decoded.inner_prot) { > + case I40E_RX_PTYPE_INNER_PROT_TCP: > + if (ex) > + return M_HASHTYPE_RSS_TCP_IPV6_EX; > + else > + return M_HASHTYPE_RSS_TCP_IPV6; > + case I40E_RX_PTYPE_INNER_PROT_UDP: > + if (ex) > + return M_HASHTYPE_RSS_UDP_IPV6_EX; > + else > + return M_HASHTYPE_RSS_UDP_IPV6; > + default: > + if (ex) > + return M_HASHTYPE_RSS_IPV6_EX; > + else > + return M_HASHTYPE_RSS_IPV6; > + } > + } > + if (decoded.outer_ip_ver == I40E_RX_PTYPE_OUTER_IPV4) { > + switch (decoded.inner_prot) { > + case I40E_RX_PTYPE_INNER_PROT_TCP: > + return M_HASHTYPE_RSS_TCP_IPV4; > + case I40E_RX_PTYPE_INNER_PROT_UDP: > + if (ex) > + return M_HASHTYPE_RSS_UDP_IPV4_EX; > + else > + return M_HASHTYPE_RSS_UDP_IPV4; > + default: > + return M_HASHTYPE_RSS_IPV4; > + } > + } > + /* We should never get here!! */ > + return M_HASHTYPE_OPAQUE; > +} > +#endif /* RSS */ > > /********************************************************************* > * > @@ -1542,8 +1622,14 @@ ixl_rxeof(struct ixl_queue *que, int cou > rxr->bytes += sendmp->m_pkthdr.len; > if ((ifp->if_capenable & IFCAP_RXCSUM) != 0) > ixl_rx_checksum(sendmp, status, error, ptype); > +#ifdef RSS > + sendmp->m_pkthdr.flowid = > + le32toh(cur->wb.qword0.hi_dword.rss); > + M_HASHTYPE_SET(sendmp, ixl_ptype_to_hash(ptype)); > +#else > sendmp->m_pkthdr.flowid = que->msix; > M_HASHTYPE_SET(sendmp, M_HASHTYPE_OPAQUE); > +#endif > } > next_desc: > bus_dmamap_sync(rxr->dma.tag, rxr->dma.map, > From owner-svn-src-all@freebsd.org Fri Dec 11 12:24:12 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A37269D5C20; Fri, 11 Dec 2015 12:24:12 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 70F291AC8; Fri, 11 Dec 2015 12:24:12 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBCOBES047289; Fri, 11 Dec 2015 12:24:11 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBCOBd5047286; Fri, 11 Dec 2015 12:24:11 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512111224.tBBCOBd5047286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 11 Dec 2015 12:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292096 - in stable/10/sys/dev: ixl netmap X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 12:24:12 -0000 Author: smh Date: Fri Dec 11 12:24:11 2015 New Revision: 292096 URL: https://svnweb.freebsd.org/changeset/base/292096 Log: MFC r279232: Add native netmap support to ixl Sponsored by: Multiplay Added: stable/10/sys/dev/netmap/if_ixl_netmap.h - copied unchanged from r279232, head/sys/dev/netmap/if_ixl_netmap.h Modified: stable/10/sys/dev/ixl/if_ixl.c stable/10/sys/dev/ixl/ixl_txrx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixl/if_ixl.c ============================================================================== --- stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 12:20:58 2015 (r292095) +++ stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 12:24:11 2015 (r292096) @@ -212,6 +212,9 @@ DRIVER_MODULE(ixl, pci, ixl_driver, ixl_ MODULE_DEPEND(ixl, pci, 1, 1, 1); MODULE_DEPEND(ixl, ether, 1, 1, 1); +#ifdef DEV_NETMAP +MODULE_DEPEND(ixl, netmap, 1, 1, 1); +#endif /* DEV_NETMAP */ /* ** Global reset mutex @@ -286,6 +289,10 @@ int ixl_atr_rate = 20; TUNABLE_INT("hw.ixl.atr_rate", &ixl_atr_rate); #endif +#ifdef DEV_NETMAP +#define NETMAP_IXL_MAIN /* only bring in one part of the netmap code */ +#include +#endif /* DEV_NETMAP */ static char *ixl_fc_string[6] = { "None", @@ -646,6 +653,9 @@ ixl_attach(device_t dev) ixl_unregister_vlan, vsi, EVENTHANDLER_PRI_FIRST); +#ifdef DEV_NETMAP + ixl_netmap_attach(vsi); +#endif /* DEV_NETMAP */ INIT_DEBUGOUT("ixl_attach: end"); return (0); @@ -724,6 +734,9 @@ ixl_detach(device_t dev) EVENTHANDLER_DEREGISTER(vlan_unconfig, vsi->vlan_detach); callout_drain(&pf->timer); +#ifdef DEV_NETMAP + netmap_detach(vsi->ifp); +#endif /* DEV_NETMAP */ ixl_free_pci_resources(pf); @@ -2661,6 +2674,15 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) break; } wr32(vsi->hw, I40E_QRX_TAIL(que->me), 0); +#ifdef DEV_NETMAP + /* preserve queue */ + if (vsi->ifp->if_capenable & IFCAP_NETMAP) { + struct netmap_adapter *na = NA(vsi->ifp); + struct netmap_kring *kring = &na->rx_rings[i]; + int t = na->num_rx_desc - 1 - nm_kr_rxspace(kring); + wr32(vsi->hw, I40E_QRX_TAIL(que->me), t); + } else +#endif /* DEV_NETMAP */ wr32(vsi->hw, I40E_QRX_TAIL(que->me), que->num_desc - 1); } return (err); Modified: stable/10/sys/dev/ixl/ixl_txrx.c ============================================================================== --- stable/10/sys/dev/ixl/ixl_txrx.c Fri Dec 11 12:20:58 2015 (r292095) +++ stable/10/sys/dev/ixl/ixl_txrx.c Fri Dec 11 12:24:11 2015 (r292096) @@ -61,6 +61,10 @@ static __inline void ixl_rx_discard(stru static __inline void ixl_rx_input(struct rx_ring *, struct ifnet *, struct mbuf *, u8); +#ifdef DEV_NETMAP +#include +#endif /* DEV_NETMAP */ + /* ** Multiqueue Transmit driver ** @@ -485,9 +489,21 @@ ixl_init_tx_ring(struct ixl_queue *que) { struct tx_ring *txr = &que->txr; struct ixl_tx_buf *buf; +#ifdef DEV_NETMAP + struct netmap_adapter *na = NA(que->vsi->ifp); + struct netmap_slot *slot; +#endif /* DEV_NETMAP */ /* Clear the old ring contents */ IXL_TX_LOCK(txr); +#ifdef DEV_NETMAP + /* + * (under lock): if in netmap mode, do some consistency + * checks and set slot to entry 0 of the netmap ring. + */ + slot = netmap_reset(na, NR_TX, que->me, 0); +#endif /* DEV_NETMAP */ + bzero((void *)txr->base, (sizeof(struct i40e_tx_desc)) * que->num_desc); @@ -511,6 +527,19 @@ ixl_init_tx_ring(struct ixl_queue *que) m_freem(buf->m_head); buf->m_head = NULL; } +#ifdef DEV_NETMAP + /* + * In netmap mode, set the map for the packet buffer. + * NOTE: Some drivers (not this one) also need to set + * the physical buffer address in the NIC ring. + * netmap_idx_n2k() maps a nic index, i, into the corresponding + * netmap slot index, si + */ + if (slot) { + int si = netmap_idx_n2k(&na->tx_rings[que->me], i); + netmap_load_map(na, buf->tag, buf->map, NMB(na, slot + si)); + } +#endif /* DEV_NETMAP */ /* Clear the EOP index */ buf->eop_index = -1; } @@ -822,6 +851,11 @@ ixl_txeof(struct ixl_queue *que) mtx_assert(&txr->mtx, MA_OWNED); +#ifdef DEV_NETMAP + // XXX todo: implement moderation + if (netmap_tx_irq(que->vsi->ifp, que->me)) + return FALSE; +#endif /* DEF_NETMAP */ /* These are not the descriptors you seek, move along :) */ if (txr->avail == que->num_desc) { @@ -1123,8 +1157,16 @@ ixl_init_rx_ring(struct ixl_queue *que) struct ixl_rx_buf *buf; bus_dma_segment_t pseg[1], hseg[1]; int rsize, nsegs, error = 0; +#ifdef DEV_NETMAP + struct netmap_adapter *na = NA(que->vsi->ifp); + struct netmap_slot *slot; +#endif /* DEV_NETMAP */ IXL_RX_LOCK(rxr); +#ifdef DEV_NETMAP + /* same as in ixl_init_tx_ring() */ + slot = netmap_reset(na, NR_RX, que->me, 0); +#endif /* DEV_NETMAP */ /* Clear the ring contents */ rsize = roundup2(que->num_desc * sizeof(union i40e_rx_desc), DBA_ALIGN); @@ -1158,6 +1200,28 @@ ixl_init_rx_ring(struct ixl_queue *que) struct mbuf *mh, *mp; buf = &rxr->buffers[j]; +#ifdef DEV_NETMAP + /* + * In netmap mode, fill the map and set the buffer + * address in the NIC ring, considering the offset + * between the netmap and NIC rings (see comment in + * ixgbe_setup_transmit_ring() ). No need to allocate + * an mbuf, so end the block with a continue; + */ + if (slot) { + int sj = netmap_idx_n2k(&na->rx_rings[que->me], j); + uint64_t paddr; + void *addr; + + addr = PNMB(na, slot + sj, &paddr); + netmap_load_map(na, rxr->dma.tag, buf->pmap, addr); + /* Update descriptor and the cached value */ + rxr->base[j].read.pkt_addr = htole64(paddr); + rxr->base[j].read.hdr_addr = 0; + continue; + } +#endif /* DEV_NETMAP */ + /* ** Don't allocate mbufs if not ** doing header split, its wasteful @@ -1457,6 +1521,12 @@ ixl_rxeof(struct ixl_queue *que, int cou IXL_RX_LOCK(rxr); +#ifdef DEV_NETMAP + if (netmap_rx_irq(ifp, que->me, &count)) { + IXL_RX_UNLOCK(rxr); + return (FALSE); + } +#endif /* DEV_NETMAP */ for (i = rxr->next_check; count != 0;) { struct mbuf *sendmp, *mh, *mp; Copied: stable/10/sys/dev/netmap/if_ixl_netmap.h (from r279232, head/sys/dev/netmap/if_ixl_netmap.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/sys/dev/netmap/if_ixl_netmap.h Fri Dec 11 12:24:11 2015 (r292096, copy of r279232, head/sys/dev/netmap/if_ixl_netmap.h) @@ -0,0 +1,422 @@ +/* + * Copyright (C) 2015, Luigi Rizzo. 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$ + * + * netmap support for: ixl + * + * derived from ixgbe + * netmap support for a network driver. + * This file contains code but only static or inline functions used + * by a single driver. To avoid replication of code we just #include + * it near the beginning of the standard driver. + * For ixl the file is imported in two places, hence the conditional at the + * beginning. + */ + +#include +#include + +/* + * Some drivers may need the following headers. Others + * already include them by default + +#include +#include + + */ +#include + +int ixl_netmap_txsync(struct netmap_kring *kring, int flags); +int ixl_netmap_rxsync(struct netmap_kring *kring, int flags); + +extern int ixl_rx_miss, ixl_rx_miss_bufs, ixl_crcstrip; + +#ifdef NETMAP_IXL_MAIN +/* + * device-specific sysctl variables: + * + * ixl_crcstrip: 0: keep CRC in rx frames (default), 1: strip it. + * During regular operations the CRC is stripped, but on some + * hardware reception of frames not multiple of 64 is slower, + * so using crcstrip=0 helps in benchmarks. + * + * ixl_rx_miss, ixl_rx_miss_bufs: + * count packets that might be missed due to lost interrupts. + */ +SYSCTL_DECL(_dev_netmap); +int ixl_rx_miss, ixl_rx_miss_bufs, ixl_crcstrip; +SYSCTL_INT(_dev_netmap, OID_AUTO, ixl_crcstrip, + CTLFLAG_RW, &ixl_crcstrip, 0, "strip CRC on rx frames"); +SYSCTL_INT(_dev_netmap, OID_AUTO, ixl_rx_miss, + CTLFLAG_RW, &ixl_rx_miss, 0, "potentially missed rx intr"); +SYSCTL_INT(_dev_netmap, OID_AUTO, ixl_rx_miss_bufs, + CTLFLAG_RW, &ixl_rx_miss_bufs, 0, "potentially missed rx intr bufs"); + + +/* + * Register/unregister. We are already under netmap lock. + * Only called on the first register or the last unregister. + */ +static int +ixl_netmap_reg(struct netmap_adapter *na, int onoff) +{ + struct ifnet *ifp = na->ifp; + struct ixl_vsi *vsi = ifp->if_softc; + struct ixl_pf *pf = (struct ixl_pf *)vsi->back; + + IXL_PF_LOCK(pf); + ixl_disable_intr(vsi); + + /* Tell the stack that the interface is no longer active */ + ifp->if_drv_flags &= ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + + //set_crcstrip(&adapter->hw, onoff); + /* enable or disable flags and callbacks in na and ifp */ + if (onoff) { + nm_set_native_flags(na); + } else { + nm_clear_native_flags(na); + } + ixl_init_locked(pf); /* also enables intr */ + //set_crcstrip(&adapter->hw, onoff); // XXX why twice ? + IXL_PF_UNLOCK(pf); + return (ifp->if_drv_flags & IFF_DRV_RUNNING ? 0 : 1); +} + + +/* + * The attach routine, called near the end of ixl_attach(), + * fills the parameters for netmap_attach() and calls it. + * It cannot fail, in the worst case (such as no memory) + * netmap mode will be disabled and the driver will only + * operate in standard mode. + */ +static void +ixl_netmap_attach(struct ixl_vsi *vsi) +{ + struct netmap_adapter na; + + bzero(&na, sizeof(na)); + + na.ifp = vsi->ifp; + na.na_flags = NAF_BDG_MAYSLEEP; + // XXX check that queues is set. + printf("queues is %p\n", vsi->queues); + if (vsi->queues) { + na.num_tx_desc = vsi->queues[0].num_desc; + na.num_rx_desc = vsi->queues[0].num_desc; + } + na.nm_txsync = ixl_netmap_txsync; + na.nm_rxsync = ixl_netmap_rxsync; + na.nm_register = ixl_netmap_reg; + na.num_tx_rings = na.num_rx_rings = vsi->num_queues; + netmap_attach(&na); +} + + +#else /* !NETMAP_IXL_MAIN, code for ixl_txrx.c */ + +/* + * Reconcile kernel and user view of the transmit ring. + * + * All information is in the kring. + * Userspace wants to send packets up to the one before kring->rhead, + * kernel knows kring->nr_hwcur is the first unsent packet. + * + * Here we push packets out (as many as possible), and possibly + * reclaim buffers from previously completed transmission. + * + * The caller (netmap) guarantees that there is only one instance + * running at any time. Any interference with other driver + * methods should be handled by the individual drivers. + */ +int +ixl_netmap_txsync(struct netmap_kring *kring, int flags) +{ + struct netmap_adapter *na = kring->na; + struct ifnet *ifp = na->ifp; + struct netmap_ring *ring = kring->ring; + u_int nm_i; /* index into the netmap ring */ + u_int nic_i; /* index into the NIC ring */ + u_int n; + u_int const lim = kring->nkr_num_slots - 1; + u_int const head = kring->rhead; + /* + * interrupts on every tx packet are expensive so request + * them every half ring, or where NS_REPORT is set + */ + u_int report_frequency = kring->nkr_num_slots >> 1; + + /* device-specific */ + struct ixl_vsi *vsi = ifp->if_softc; + struct ixl_queue *que = &vsi->queues[kring->ring_id]; + struct tx_ring *txr = &que->txr; + + bus_dmamap_sync(txr->dma.tag, txr->dma.map, + BUS_DMASYNC_POSTREAD); + + /* + * First part: process new packets to send. + * nm_i is the current index in the netmap ring, + * nic_i is the corresponding index in the NIC ring. + * + * If we have packets to send (nm_i != head) + * iterate over the netmap ring, fetch length and update + * the corresponding slot in the NIC ring. Some drivers also + * need to update the buffer's physical address in the NIC slot + * even NS_BUF_CHANGED is not set (PNMB computes the addresses). + * + * The netmap_reload_map() calls is especially expensive, + * even when (as in this case) the tag is 0, so do only + * when the buffer has actually changed. + * + * If possible do not set the report/intr bit on all slots, + * but only a few times per ring or when NS_REPORT is set. + * + * Finally, on 10G and faster drivers, it might be useful + * to prefetch the next slot and txr entry. + */ + + nm_i = kring->nr_hwcur; + if (nm_i != head) { /* we have new packets to send */ + nic_i = netmap_idx_k2n(kring, nm_i); + + __builtin_prefetch(&ring->slot[nm_i]); + __builtin_prefetch(&txr->buffers[nic_i]); + + for (n = 0; nm_i != head; n++) { + struct netmap_slot *slot = &ring->slot[nm_i]; + u_int len = slot->len; + uint64_t paddr; + void *addr = PNMB(na, slot, &paddr); + + /* device-specific */ + struct i40e_tx_desc *curr = &txr->base[nic_i]; + struct ixl_tx_buf *txbuf = &txr->buffers[nic_i]; + u64 flags = (slot->flags & NS_REPORT || + nic_i == 0 || nic_i == report_frequency) ? + ((u64)I40E_TX_DESC_CMD_RS << I40E_TXD_QW1_CMD_SHIFT) : 0; + + /* prefetch for next round */ + __builtin_prefetch(&ring->slot[nm_i + 1]); + __builtin_prefetch(&txr->buffers[nic_i + 1]); + + NM_CHECK_ADDR_LEN(na, addr, len); + + if (slot->flags & NS_BUF_CHANGED) { + /* buffer has changed, reload map */ + netmap_reload_map(na, txr->dma.tag, txbuf->map, addr); + } + slot->flags &= ~(NS_REPORT | NS_BUF_CHANGED); + + /* Fill the slot in the NIC ring. */ + curr->buffer_addr = htole64(paddr); + curr->cmd_type_offset_bsz = htole64( + ((u64)len << I40E_TXD_QW1_TX_BUF_SZ_SHIFT) | + flags | + ((u64)I40E_TX_DESC_CMD_EOP << I40E_TXD_QW1_CMD_SHIFT) + ); // XXX more ? + + /* make sure changes to the buffer are synced */ + bus_dmamap_sync(txr->dma.tag, txbuf->map, + BUS_DMASYNC_PREWRITE); + + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); + } + kring->nr_hwcur = head; + + /* synchronize the NIC ring */ + bus_dmamap_sync(txr->dma.tag, txr->dma.map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + + /* (re)start the tx unit up to slot nic_i (excluded) */ + wr32(vsi->hw, txr->tail, nic_i); + } + + /* + * Second part: reclaim buffers for completed transmissions. + */ + nic_i = LE32_TO_CPU(*(volatile __le32 *)&txr->base[que->num_desc]); + if (nic_i != txr->next_to_clean) { + /* some tx completed, increment avail */ + txr->next_to_clean = nic_i; + kring->nr_hwtail = nm_prev(netmap_idx_n2k(kring, nic_i), lim); + } + + nm_txsync_finalize(kring); + + return 0; +} + + +/* + * Reconcile kernel and user view of the receive ring. + * Same as for the txsync, this routine must be efficient. + * The caller guarantees a single invocations, but races against + * the rest of the driver should be handled here. + * + * On call, kring->rhead is the first packet that userspace wants + * to keep, and kring->rcur is the wakeup point. + * The kernel has previously reported packets up to kring->rtail. + * + * If (flags & NAF_FORCE_READ) also check for incoming packets irrespective + * of whether or not we received an interrupt. + */ +int +ixl_netmap_rxsync(struct netmap_kring *kring, int flags) +{ + struct netmap_adapter *na = kring->na; + struct ifnet *ifp = na->ifp; + struct netmap_ring *ring = kring->ring; + u_int nm_i; /* index into the netmap ring */ + u_int nic_i; /* index into the NIC ring */ + u_int n; + u_int const lim = kring->nkr_num_slots - 1; + u_int const head = nm_rxsync_prologue(kring); + int force_update = (flags & NAF_FORCE_READ) || kring->nr_kflags & NKR_PENDINTR; + + /* device-specific */ + struct ixl_vsi *vsi = ifp->if_softc; + struct ixl_queue *que = &vsi->queues[kring->ring_id]; + struct rx_ring *rxr = &que->rxr; + + if (head > lim) + return netmap_ring_reinit(kring); + + /* XXX check sync modes */ + bus_dmamap_sync(rxr->dma.tag, rxr->dma.map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + + /* + * First part: import newly received packets. + * + * nm_i is the index of the next free slot in the netmap ring, + * nic_i is the index of the next received packet in the NIC ring, + * and they may differ in case if_init() has been called while + * in netmap mode. For the receive ring we have + * + * nic_i = rxr->next_check; + * nm_i = kring->nr_hwtail (previous) + * and + * nm_i == (nic_i + kring->nkr_hwofs) % ring_size + * + * rxr->next_check is set to 0 on a ring reinit + */ + if (netmap_no_pendintr || force_update) { + int crclen = ixl_crcstrip ? 0 : 4; + uint16_t slot_flags = kring->nkr_slot_flags; + + nic_i = rxr->next_check; // or also k2n(kring->nr_hwtail) + nm_i = netmap_idx_n2k(kring, nic_i); + + for (n = 0; ; n++) { + union i40e_32byte_rx_desc *curr = &rxr->base[nic_i]; + uint64_t qword = le64toh(curr->wb.qword1.status_error_len); + uint32_t staterr = (qword & I40E_RXD_QW1_STATUS_MASK) + >> I40E_RXD_QW1_STATUS_SHIFT; + + if ((staterr & (1<slot[nm_i].len = ((qword & I40E_RXD_QW1_LENGTH_PBUF_MASK) + >> I40E_RXD_QW1_LENGTH_PBUF_SHIFT) - crclen; + ring->slot[nm_i].flags = slot_flags; + bus_dmamap_sync(rxr->ptag, + rxr->buffers[nic_i].pmap, BUS_DMASYNC_POSTREAD); + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); + } + if (n) { /* update the state variables */ + if (netmap_no_pendintr && !force_update) { + /* diagnostics */ + ixl_rx_miss ++; + ixl_rx_miss_bufs += n; + } + rxr->next_check = nic_i; + kring->nr_hwtail = nm_i; + } + kring->nr_kflags &= ~NKR_PENDINTR; + } + + /* + * Second part: skip past packets that userspace has released. + * (kring->nr_hwcur to head excluded), + * and make the buffers available for reception. + * As usual nm_i is the index in the netmap ring, + * nic_i is the index in the NIC ring, and + * nm_i == (nic_i + kring->nkr_hwofs) % ring_size + */ + nm_i = kring->nr_hwcur; + if (nm_i != head) { + nic_i = netmap_idx_k2n(kring, nm_i); + for (n = 0; nm_i != head; n++) { + struct netmap_slot *slot = &ring->slot[nm_i]; + uint64_t paddr; + void *addr = PNMB(na, slot, &paddr); + + union i40e_32byte_rx_desc *curr = &rxr->base[nic_i]; + struct ixl_rx_buf *rxbuf = &rxr->buffers[nic_i]; + + if (addr == NETMAP_BUF_BASE(na)) /* bad buf */ + goto ring_reset; + + if (slot->flags & NS_BUF_CHANGED) { + /* buffer has changed, reload map */ + netmap_reload_map(na, rxr->ptag, rxbuf->pmap, addr); + slot->flags &= ~NS_BUF_CHANGED; + } + curr->read.pkt_addr = htole64(paddr); + curr->read.hdr_addr = 0; // XXX needed + bus_dmamap_sync(rxr->ptag, rxbuf->pmap, + BUS_DMASYNC_PREREAD); + nm_i = nm_next(nm_i, lim); + nic_i = nm_next(nic_i, lim); + } + kring->nr_hwcur = head; + + bus_dmamap_sync(rxr->dma.tag, rxr->dma.map, + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + /* + * IMPORTANT: we must leave one free slot in the ring, + * so move nic_i back by one unit + */ + nic_i = nm_prev(nic_i, lim); + wr32(vsi->hw, rxr->tail, nic_i); + } + + /* tell userspace that there might be new packets */ + nm_rxsync_finalize(kring); + + return 0; + +ring_reset: + return netmap_ring_reinit(kring); +} + +#endif /* !NETMAP_IXL_MAIN */ + +/* end of file */ From owner-svn-src-all@freebsd.org Fri Dec 11 12:47:51 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 778159D7E0B; Fri, 11 Dec 2015 12:47:51 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 17DD118CF; Fri, 11 Dec 2015 12:47:51 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBCloNW053344; Fri, 11 Dec 2015 12:47:50 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBClnLI053338; Fri, 11 Dec 2015 12:47:49 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512111247.tBBClnLI053338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 11 Dec 2015 12:47:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292097 - stable/10/sys/dev/ixl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 12:47:51 -0000 Author: smh Date: Fri Dec 11 12:47:49 2015 New Revision: 292097 URL: https://svnweb.freebsd.org/changeset/base/292097 Log: MFC r279858 & r279860: SRIOV & 20G support Sponsored by: Multiplay Modified: stable/10/sys/dev/ixl/i40e_adminq_cmd.h stable/10/sys/dev/ixl/i40e_common.c stable/10/sys/dev/ixl/i40e_prototype.h stable/10/sys/dev/ixl/i40e_type.h stable/10/sys/dev/ixl/if_ixl.c stable/10/sys/dev/ixl/if_ixlv.c stable/10/sys/dev/ixl/ixl.h stable/10/sys/dev/ixl/ixl_pf.h stable/10/sys/dev/ixl/ixl_txrx.c stable/10/sys/dev/ixl/ixlv.h stable/10/sys/dev/ixl/ixlvc.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- stable/10/sys/dev/ixl/i40e_adminq_cmd.h Fri Dec 11 12:24:11 2015 (r292096) +++ stable/10/sys/dev/ixl/i40e_adminq_cmd.h Fri Dec 11 12:47:49 2015 (r292097) @@ -42,7 +42,7 @@ */ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR 0x0004 +#define I40E_FW_API_VERSION_MINOR 0x0002 struct i40e_aq_desc { __le16 flags; @@ -140,7 +140,12 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_list_func_capabilities = 0x000A, i40e_aqc_opc_list_dev_capabilities = 0x000B, + i40e_aqc_opc_set_cppm_configuration = 0x0103, + i40e_aqc_opc_set_arp_proxy_entry = 0x0104, + i40e_aqc_opc_set_ns_proxy_entry = 0x0105, + /* LAA */ + i40e_aqc_opc_mng_laa = 0x0106, /* AQ obsolete */ i40e_aqc_opc_mac_address_read = 0x0107, i40e_aqc_opc_mac_address_write = 0x0108, @@ -265,6 +270,7 @@ enum i40e_admin_queue_opc { /* Tunnel commands */ i40e_aqc_opc_add_udp_tunnel = 0x0B00, i40e_aqc_opc_del_udp_tunnel = 0x0B01, + i40e_aqc_opc_tunnel_key_structure = 0x0B10, /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, @@ -276,6 +282,8 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_oem_ocbb_initialize = 0xFE03, /* debug commands */ + i40e_aqc_opc_debug_get_deviceid = 0xFF00, + i40e_aqc_opc_debug_set_mode = 0xFF01, i40e_aqc_opc_debug_read_reg = 0xFF03, i40e_aqc_opc_debug_write_reg = 0xFF04, i40e_aqc_opc_debug_modify_reg = 0xFF07, @@ -509,8 +517,7 @@ struct i40e_aqc_mac_address_read { #define I40E_AQC_SAN_ADDR_VALID 0x20 #define I40E_AQC_PORT_ADDR_VALID 0x40 #define I40E_AQC_WOL_ADDR_VALID 0x80 -#define I40E_AQC_MC_MAG_EN_VALID 0x100 -#define I40E_AQC_ADDR_VALID_MASK 0x1F0 +#define I40E_AQC_ADDR_VALID_MASK 0xf0 u8 reserved[6]; __le32 addr_high; __le32 addr_low; @@ -533,9 +540,7 @@ struct i40e_aqc_mac_address_write { #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x0000 #define I40E_AQC_WRITE_TYPE_LAA_WOL 0x4000 #define I40E_AQC_WRITE_TYPE_PORT 0x8000 -#define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG 0xC000 -#define I40E_AQC_WRITE_TYPE_MASK 0xC000 - +#define I40E_AQC_WRITE_TYPE_MASK 0xc000 __le16 mac_sah; __le32 mac_sal; u8 reserved[8]; @@ -1071,7 +1076,6 @@ struct i40e_aqc_set_vsi_promiscuous_mode __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF __le16 vlan_tag; -#define I40E_AQC_SET_VSI_VLAN_MASK 0x0FFF #define I40E_AQC_SET_VSI_VLAN_VALID 0x8000 u8 reserved[8]; }; @@ -2066,12 +2070,6 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_star #define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT) #define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8 #define I40E_AQC_CEE_APP_STATUS_MASK (0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT) -#define I40E_AQC_CEE_FCOE_STATUS_SHIFT 0x8 -#define I40E_AQC_CEE_FCOE_STATUS_MASK (0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT) -#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT 0xA -#define I40E_AQC_CEE_ISCSI_STATUS_MASK (0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT) -#define I40E_AQC_CEE_FIP_STATUS_SHIFT 0x10 -#define I40E_AQC_CEE_FIP_STATUS_MASK (0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT) struct i40e_aqc_get_cee_dcb_cfg_v1_resp { u8 reserved1; u8 oper_num_tc; Modified: stable/10/sys/dev/ixl/i40e_common.c ============================================================================== --- stable/10/sys/dev/ixl/i40e_common.c Fri Dec 11 12:24:11 2015 (r292096) +++ stable/10/sys/dev/ixl/i40e_common.c Fri Dec 11 12:47:49 2015 (r292097) @@ -866,7 +866,7 @@ static enum i40e_media_type i40e_get_med return media; } -#define I40E_PF_RESET_WAIT_COUNT 110 +#define I40E_PF_RESET_WAIT_COUNT 200 /** * i40e_pf_reset - Reset the PF * @hw: pointer to the hardware structure @@ -1108,11 +1108,9 @@ u32 i40e_led_get(struct i40e_hw *hw) if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); + /* ignore gpio LED src mode entries related to the activity LEDs */ + current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> + I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); switch (current_mode) { case I40E_COMBINED_ACTIVITY: case I40E_FILTER_ACTIVITY: @@ -1156,11 +1154,9 @@ void i40e_led_set(struct i40e_hw *hw, u3 if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity - * LEDs - */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) - >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); + /* ignore gpio LED src mode entries related to the activity LEDs */ + current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> + I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); switch (current_mode) { case I40E_COMBINED_ACTIVITY: case I40E_FILTER_ACTIVITY: @@ -1529,6 +1525,7 @@ aq_get_link_info_exit: return status; } + /** * i40e_aq_set_phy_int_mask * @hw: pointer to the hw struct @@ -2816,13 +2813,12 @@ i40e_aq_erase_nvm_exit: #define I40E_DEV_FUNC_CAP_MSIX_VF 0x44 #define I40E_DEV_FUNC_CAP_FLOW_DIRECTOR 0x45 #define I40E_DEV_FUNC_CAP_IEEE_1588 0x46 -#define I40E_DEV_FUNC_CAP_FLEX10 0xF1 +#define I40E_DEV_FUNC_CAP_MFP_MODE_1 0xF1 #define I40E_DEV_FUNC_CAP_CEM 0xF2 #define I40E_DEV_FUNC_CAP_IWARP 0x51 #define I40E_DEV_FUNC_CAP_LED 0x61 #define I40E_DEV_FUNC_CAP_SDP 0x62 #define I40E_DEV_FUNC_CAP_MDIO 0x63 -#define I40E_DEV_FUNC_CAP_WR_CSR_PROT 0x64 /** * i40e_parse_discover_capabilities @@ -2840,7 +2836,6 @@ static void i40e_parse_discover_capabili struct i40e_aqc_list_capabilities_element_resp *cap; u32 valid_functions, num_functions; u32 number, logical_id, phys_id; - u8 major_rev; struct i40e_hw_capabilities *p; u32 i = 0; u16 id; @@ -2859,7 +2854,6 @@ static void i40e_parse_discover_capabili number = LE32_TO_CPU(cap->number); logical_id = LE32_TO_CPU(cap->logical_id); phys_id = LE32_TO_CPU(cap->phys_id); - major_rev = cap->major_rev; switch (id) { case I40E_DEV_FUNC_CAP_SWITCH_MODE: @@ -2934,21 +2928,9 @@ static void i40e_parse_discover_capabili case I40E_DEV_FUNC_CAP_MSIX_VF: p->num_msix_vectors_vf = number; break; - case I40E_DEV_FUNC_CAP_FLEX10: - if (major_rev == 1) { - if (number == 1) { - p->flex10_enable = TRUE; - p->flex10_capable = TRUE; - } - } else { - /* Capability revision >= 2 */ - if (number & 1) - p->flex10_enable = TRUE; - if (number & 2) - p->flex10_capable = TRUE; - } - p->flex10_mode = logical_id; - p->flex10_status = phys_id; + case I40E_DEV_FUNC_CAP_MFP_MODE_1: + if (number == 1) + p->mfp_mode_1 = TRUE; break; case I40E_DEV_FUNC_CAP_CEM: if (number == 1) @@ -2981,18 +2963,11 @@ static void i40e_parse_discover_capabili p->fd_filters_guaranteed = number; p->fd_filters_best_effort = logical_id; break; - case I40E_DEV_FUNC_CAP_WR_CSR_PROT: - p->wr_csr_prot = (u64)number; - p->wr_csr_prot |= (u64)logical_id << 32; - break; default: break; } } - if (p->fcoe) - i40e_debug(hw, I40E_DEBUG_ALL, "device is FCoE capable\n"); - /* Always disable FCoE if compiled without the I40E_FCOE_ENA flag */ p->fcoe = FALSE; @@ -4948,63 +4923,6 @@ void i40e_set_pci_config_data(struct i40 } /** - * i40e_aq_debug_dump - * @hw: pointer to the hardware structure - * @cluster_id: specific cluster to dump - * @table_id: table id within cluster - * @start_index: index of line in the block to read - * @buff_size: dump buffer size - * @buff: dump buffer - * @ret_buff_size: actual buffer size returned - * @ret_next_table: next block to read - * @ret_next_index: next index to read - * - * Dump internal FW/HW data for debug purposes. - * - **/ -enum i40e_status_code i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id, - u8 table_id, u32 start_index, u16 buff_size, - void *buff, u16 *ret_buff_size, - u8 *ret_next_table, u32 *ret_next_index, - struct i40e_asq_cmd_details *cmd_details) -{ - struct i40e_aq_desc desc; - struct i40e_aqc_debug_dump_internals *cmd = - (struct i40e_aqc_debug_dump_internals *)&desc.params.raw; - struct i40e_aqc_debug_dump_internals *resp = - (struct i40e_aqc_debug_dump_internals *)&desc.params.raw; - enum i40e_status_code status; - - if (buff_size == 0 || !buff) - return I40E_ERR_PARAM; - - i40e_fill_default_direct_cmd_desc(&desc, - i40e_aqc_opc_debug_dump_internals); - /* Indirect Command */ - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); - if (buff_size > I40E_AQ_LARGE_BUF) - desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_LB); - - cmd->cluster_id = cluster_id; - cmd->table_id = table_id; - cmd->idx = CPU_TO_LE32(start_index); - - desc.datalen = CPU_TO_LE16(buff_size); - - status = i40e_asq_send_command(hw, &desc, buff, buff_size, cmd_details); - if (!status) { - if (ret_buff_size != NULL) - *ret_buff_size = LE16_TO_CPU(desc.datalen); - if (ret_next_table != NULL) - *ret_next_table = resp->table_id; - if (ret_next_index != NULL) - *ret_next_index = LE32_TO_CPU(resp->idx); - } - - return status; -} - -/** * i40e_read_bw_from_alt_ram * @hw: pointer to the hardware structure * @max_bw: pointer for max_bw read Modified: stable/10/sys/dev/ixl/i40e_prototype.h ============================================================================== --- stable/10/sys/dev/ixl/i40e_prototype.h Fri Dec 11 12:24:11 2015 (r292096) +++ stable/10/sys/dev/ixl/i40e_prototype.h Fri Dec 11 12:47:49 2015 (r292097) @@ -445,9 +445,4 @@ enum i40e_status_code i40e_aq_add_rem_co u16 vsi_seid, u16 queue, bool is_add, struct i40e_control_filter_stats *stats, struct i40e_asq_cmd_details *cmd_details); -enum i40e_status_code i40e_aq_debug_dump(struct i40e_hw *hw, u8 cluster_id, - u8 table_id, u32 start_index, u16 buff_size, - void *buff, u16 *ret_buff_size, - u8 *ret_next_table, u32 *ret_next_index, - struct i40e_asq_cmd_details *cmd_details); #endif /* _I40E_PROTOTYPE_H_ */ Modified: stable/10/sys/dev/ixl/i40e_type.h ============================================================================== --- stable/10/sys/dev/ixl/i40e_type.h Fri Dec 11 12:24:11 2015 (r292096) +++ stable/10/sys/dev/ixl/i40e_type.h Fri Dec 11 12:47:49 2015 (r292097) @@ -287,17 +287,7 @@ struct i40e_hw_capabilities { bool dcb; bool fcoe; bool iscsi; /* Indicates iSCSI enabled */ - bool flex10_enable; - bool flex10_capable; - u32 flex10_mode; -#define I40E_FLEX10_MODE_UNKNOWN 0x0 -#define I40E_FLEX10_MODE_DCC 0x1 -#define I40E_FLEX10_MODE_DCI 0x2 - - u32 flex10_status; -#define I40E_FLEX10_STATUS_DCC_ERROR 0x1 -#define I40E_FLEX10_STATUS_VC_MODE 0x2 - + bool mfp_mode_1; bool mgmt_cem; bool ieee_1588; bool iwarp; @@ -326,7 +316,6 @@ struct i40e_hw_capabilities { u8 rx_buf_chain_len; u32 enabled_tcmap; u32 maxtc; - u64 wr_csr_prot; }; struct i40e_mac_info { @@ -573,7 +562,7 @@ struct i40e_hw { u32 debug_mask; }; -static INLINE bool i40e_is_vf(struct i40e_hw *hw) +static inline bool i40e_is_vf(struct i40e_hw *hw) { return hw->mac.type == I40E_MAC_VF; } @@ -1274,9 +1263,6 @@ struct i40e_hw_port_stats { /* flow director stats */ u64 fd_atr_match; u64 fd_sb_match; - u64 fd_atr_tunnel_match; - u32 fd_atr_status; - u32 fd_sb_status; /* EEE LPI */ u32 tx_lpi_status; u32 rx_lpi_status; Modified: stable/10/sys/dev/ixl/if_ixl.c ============================================================================== --- stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 12:24:11 2015 (r292096) +++ stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 12:47:49 2015 (r292097) @@ -47,7 +47,7 @@ /********************************************************************* * Driver version *********************************************************************/ -char ixl_driver_version[] = "1.3.6"; +char ixl_driver_version[] = "1.4.1"; /********************************************************************* * PCI Device ID Table @@ -69,6 +69,7 @@ static ixl_vendor_info_t ixl_vendor_info {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C, 0, 0, 0}, {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T, 0, 0, 0}, + {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_20G_KR2, 0, 0, 0}, /* required last entry */ {0, 0, 0, 0, 0} }; @@ -112,16 +113,17 @@ static void ixl_configure_legacy(struct static void ixl_free_pci_resources(struct ixl_pf *); static void ixl_local_timer(void *); static int ixl_setup_interface(device_t, struct ixl_vsi *); -static bool ixl_config_link(struct i40e_hw *); +static void ixl_link_event(struct ixl_pf *, struct i40e_arq_event_info *); static void ixl_config_rss(struct ixl_vsi *); static void ixl_set_queue_rx_itr(struct ixl_queue *); static void ixl_set_queue_tx_itr(struct ixl_queue *); static int ixl_set_advertised_speeds(struct ixl_pf *, int); -static void ixl_enable_rings(struct ixl_vsi *); -static void ixl_disable_rings(struct ixl_vsi *); -static void ixl_enable_intr(struct ixl_vsi *); -static void ixl_disable_intr(struct ixl_vsi *); +static int ixl_enable_rings(struct ixl_vsi *); +static int ixl_disable_rings(struct ixl_vsi *); +static void ixl_enable_intr(struct ixl_vsi *); +static void ixl_disable_intr(struct ixl_vsi *); +static void ixl_disable_rings_intr(struct ixl_vsi *); static void ixl_enable_adminq(struct i40e_hw *); static void ixl_disable_adminq(struct i40e_hw *); @@ -138,6 +140,7 @@ static void ixl_unregister_vlan(void *, static void ixl_setup_vlan_filters(struct ixl_vsi *); static void ixl_init_filters(struct ixl_vsi *); +static void ixl_reconfigure_filters(struct ixl_vsi *vsi); static void ixl_add_filter(struct ixl_vsi *, u8 *, s16 vlan); static void ixl_del_filter(struct ixl_vsi *, u8 *, s16 vlan); static void ixl_add_hw_filters(struct ixl_vsi *, int, int); @@ -145,6 +148,8 @@ static void ixl_del_hw_filters(struct ix static struct ixl_mac_filter * ixl_find_filter(struct ixl_vsi *, u8 *, s16); static void ixl_add_mc_filter(struct ixl_vsi *, u8 *); +static void ixl_free_mac_filters(struct ixl_vsi *vsi); + /* Sysctl debug interface */ static int ixl_debug_info(SYSCTL_HANDLER_ARGS); @@ -174,6 +179,7 @@ static void ixl_add_sysctls_eth_stats(st struct i40e_eth_stats *); static void ixl_update_stats_counters(struct ixl_pf *); static void ixl_update_eth_stats(struct ixl_vsi *); +static void ixl_update_vsi_stats(struct ixl_vsi *); static void ixl_pf_reset_stats(struct ixl_pf *); static void ixl_vsi_reset_stats(struct ixl_vsi *); static void ixl_stat_update48(struct i40e_hw *, u32, u32, bool, @@ -187,7 +193,21 @@ static int ixl_sysctl_phy_abilities(SYSC static int ixl_sysctl_sw_filter_list(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_ARGS); static int ixl_sysctl_switch_config(SYSCTL_HANDLER_ARGS); -static int ixl_sysctl_dump_txd(SYSCTL_HANDLER_ARGS); +#endif + +#ifdef PCI_IOV +static int ixl_adminq_err_to_errno(enum i40e_admin_queue_err err); + +static int ixl_init_iov(device_t dev, uint16_t num_vfs, const nvlist_t*); +static void ixl_uninit_iov(device_t dev); +static int ixl_add_vf(device_t dev, uint16_t vfnum, const nvlist_t*); + +static void ixl_handle_vf_msg(struct ixl_pf *, + struct i40e_arq_event_info *); +static void ixl_handle_vflr(void *arg, int pending); + +static void ixl_reset_vf(struct ixl_pf *pf, struct ixl_vf *vf); +static void ixl_reinit_vf(struct ixl_pf *pf, struct ixl_vf *vf); #endif /********************************************************************* @@ -200,6 +220,11 @@ static device_method_t ixl_methods[] = { DEVMETHOD(device_attach, ixl_attach), DEVMETHOD(device_detach, ixl_detach), DEVMETHOD(device_shutdown, ixl_shutdown), +#ifdef PCI_IOV + DEVMETHOD(pci_init_iov, ixl_init_iov), + DEVMETHOD(pci_uninit_iov, ixl_uninit_iov), + DEVMETHOD(pci_add_vf, ixl_add_vf), +#endif {0, 0} }; @@ -212,10 +237,12 @@ DRIVER_MODULE(ixl, pci, ixl_driver, ixl_ MODULE_DEPEND(ixl, pci, 1, 1, 1); MODULE_DEPEND(ixl, ether, 1, 1, 1); + #ifdef DEV_NETMAP MODULE_DEPEND(ixl, netmap, 1, 1, 1); #endif /* DEV_NETMAP */ + /* ** Global reset mutex */ @@ -303,6 +330,10 @@ static char *ixl_fc_string[6] = { "Default" }; +static MALLOC_DEFINE(M_IXL, "ixl", "ixl driver allocations"); + +static uint8_t ixl_bcast_addr[ETHER_ADDR_LEN] = + {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; /********************************************************************* * Device identification routine @@ -379,6 +410,10 @@ ixl_attach(device_t dev) struct ixl_vsi *vsi; u16 bus; int error = 0; +#ifdef PCI_IOV + nvlist_t *pf_schema, *vf_schema; + int iov_error; +#endif INIT_DEBUGOUT("ixl_attach: begin"); @@ -466,11 +501,6 @@ ixl_attach(device_t dev) SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "switch_config", CTLTYPE_STRING | CTLFLAG_RD, pf, 0, ixl_sysctl_switch_config, "A", "HW Switch Configuration"); - - SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), - SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), - OID_AUTO, "dump_desc", CTLTYPE_INT | CTLFLAG_WR, - pf, 0, ixl_sysctl_dump_txd, "I", "Desc dump"); #endif /* Save off the PCI information */ @@ -485,6 +515,8 @@ ixl_attach(device_t dev) hw->bus.device = pci_get_slot(dev); hw->bus.func = pci_get_function(dev); + pf->vc_debug_lvl = 1; + /* Do PCI setup - map BAR0, etc */ if (ixl_allocate_pci_resources(pf)) { device_printf(dev, "Allocation of PCI resources failed\n"); @@ -555,7 +587,8 @@ ixl_attach(device_t dev) } /* Set up host memory cache */ - error = i40e_init_lan_hmc(hw, vsi->num_queues, vsi->num_queues, 0, 0); + error = i40e_init_lan_hmc(hw, hw->func_caps.num_tx_qp, + hw->func_caps.num_rx_qp, 0, 0); if (error) { device_printf(dev, "init_lan_hmc failed: %d\n", error); goto err_get_cap; @@ -607,16 +640,8 @@ ixl_attach(device_t dev) } /* Determine link state */ - vsi->link_up = ixl_config_link(hw); - - /* Report if Unqualified modules are found */ - if ((vsi->link_up == FALSE) && - (pf->hw.phy.link_info.link_info & - I40E_AQ_MEDIA_AVAILABLE) && - (!(pf->hw.phy.link_info.an_info & - I40E_AQ_QUALIFIED_MODULE))) - device_printf(dev, "Link failed because " - "an unqualified module was detected\n"); + i40e_aq_get_link_info(hw, TRUE, NULL, NULL); + pf->link_up = i40e_get_link_status(hw); /* Setup OS specific network interface */ if (ixl_setup_interface(dev, vsi) != 0) { @@ -652,10 +677,31 @@ ixl_attach(device_t dev) vsi->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, ixl_unregister_vlan, vsi, EVENTHANDLER_PRI_FIRST); +#ifdef PCI_IOV + /* SR-IOV is only supported when MSI-X is in use. */ + if (pf->msix > 1) { + pf_schema = pci_iov_schema_alloc_node(); + vf_schema = pci_iov_schema_alloc_node(); + pci_iov_schema_add_unicast_mac(vf_schema, "mac-addr", 0, NULL); + pci_iov_schema_add_bool(vf_schema, "mac-anti-spoof", + IOV_SCHEMA_HASDEFAULT, TRUE); + pci_iov_schema_add_bool(vf_schema, "allow-set-mac", + IOV_SCHEMA_HASDEFAULT, FALSE); + pci_iov_schema_add_bool(vf_schema, "allow-promisc", + IOV_SCHEMA_HASDEFAULT, FALSE); + + iov_error = pci_iov_attach(dev, pf_schema, vf_schema); + if (iov_error != 0) + device_printf(dev, + "Failed to initialize SR-IOV (error=%d)\n", + iov_error); + } +#endif #ifdef DEV_NETMAP ixl_netmap_attach(vsi); #endif /* DEV_NETMAP */ + INIT_DEBUGOUT("ixl_attach: end"); return (0); @@ -691,6 +737,9 @@ ixl_detach(device_t dev) struct ixl_vsi *vsi = &pf->vsi; struct ixl_queue *que = vsi->queues; i40e_status status; +#ifdef PCI_IOV + int error; +#endif INIT_DEBUGOUT("ixl_detach: begin"); @@ -700,6 +749,14 @@ ixl_detach(device_t dev) return (EBUSY); } +#ifdef PCI_IOV + error = pci_iov_detach(dev); + if (error != 0) { + device_printf(dev, "SR-IOV in use; detach first.\n"); + return (error); + } +#endif + ether_ifdetach(vsi->ifp); if (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING) { IXL_PF_LOCK(pf); @@ -737,8 +794,6 @@ ixl_detach(device_t dev) #ifdef DEV_NETMAP netmap_detach(vsi->ifp); #endif /* DEV_NETMAP */ - - ixl_free_pci_resources(pf); bus_generic_detach(dev); if_free(vsi->ifp); @@ -907,7 +962,7 @@ static int ixl_ioctl(struct ifnet * ifp, u_long command, caddr_t data) { struct ixl_vsi *vsi = ifp->if_softc; - struct ixl_pf *pf = (struct ixl_pf *)vsi->back; + struct ixl_pf *pf = vsi->back; struct ifreq *ifr = (struct ifreq *) data; #if defined(INET) || defined(INET6) struct ifaddr *ifa = (struct ifaddr *)data; @@ -1132,6 +1187,8 @@ ixl_init_locked(struct ixl_pf *pf) i40e_aq_set_default_vsi(hw, vsi->seid, NULL); + ixl_reconfigure_filters(vsi); + /* Set MTU in hardware*/ int aq_error = i40e_aq_set_mac_config(hw, vsi->max_frame_size, TRUE, 0, NULL); @@ -1226,6 +1283,11 @@ ixl_intr(void *arg) mask = rd32(hw, I40E_PFINT_ICR0_ENA); +#ifdef PCI_IOV + if (icr0 & I40E_PFINT_ICR0_VFLR_MASK) + taskqueue_enqueue(pf->tq, &pf->vflr_task); +#endif + if (icr0 & I40E_PFINT_ICR0_ADMINQ_MASK) { taskqueue_enqueue(pf->tq, &pf->adminq); return; @@ -1329,8 +1391,12 @@ ixl_msix_adminq(void *arg) mask &= ~I40E_PFINT_ICR0_ENA_MAL_DETECT_MASK; } - if (reg & I40E_PFINT_ICR0_VFLR_MASK) +#ifdef PCI_IOV + if (reg & I40E_PFINT_ICR0_VFLR_MASK) { mask &= ~I40E_PFINT_ICR0_ENA_VFLR_MASK; + taskqueue_enqueue(pf->tq, &pf->vflr_task); + } +#endif reg = rd32(hw, I40E_PFINT_DYN_CTL0); reg = reg | I40E_PFINT_DYN_CTL0_CLEARPBA_MASK; @@ -1352,18 +1418,20 @@ static void ixl_media_status(struct ifnet * ifp, struct ifmediareq * ifmr) { struct ixl_vsi *vsi = ifp->if_softc; - struct ixl_pf *pf = (struct ixl_pf *)vsi->back; + struct ixl_pf *pf = vsi->back; struct i40e_hw *hw = &pf->hw; INIT_DEBUGOUT("ixl_media_status: begin"); IXL_PF_LOCK(pf); + hw->phy.get_link_info = TRUE; + pf->link_up = i40e_get_link_status(hw); ixl_update_link_status(pf); ifmr->ifm_status = IFM_AVALID; ifmr->ifm_active = IFM_ETHER; - if (!vsi->link_up) { + if (!pf->link_up) { IXL_PF_UNLOCK(pf); return; } @@ -1753,15 +1821,14 @@ ixl_update_link_status(struct ixl_pf *pf struct ifnet *ifp = vsi->ifp; device_t dev = pf->dev; - - if (vsi->link_up){ + if (pf->link_up){ if (vsi->link_active == FALSE) { - i40e_aq_get_link_info(hw, TRUE, NULL, NULL); pf->fc = hw->fc.current_mode; if (bootverbose) { device_printf(dev,"Link is up %d Gbps %s," " Flow Control: %s\n", - ((vsi->link_speed == I40E_LINK_SPEED_40GB)? 40:10), + ((pf->link_speed == + I40E_LINK_SPEED_40GB)? 40:10), "Full Duplex", ixl_fc_string[pf->fc]); } vsi->link_active = TRUE; @@ -1770,10 +1837,12 @@ ixl_update_link_status(struct ixl_pf *pf ** partition is not at least 10GB */ if (hw->func_caps.npar_enable && - (hw->phy.link_info.link_speed == I40E_LINK_SPEED_1GB || - hw->phy.link_info.link_speed == I40E_LINK_SPEED_100MB)) - device_printf(dev, "The partition detected link" - "speed that is less than 10Gbps\n"); + (hw->phy.link_info.link_speed == + I40E_LINK_SPEED_1GB || + hw->phy.link_info.link_speed == + I40E_LINK_SPEED_100MB)) + device_printf(dev, "The partition detected" + "link speed that is less than 10Gbps\n"); if_link_state_change(ifp, LINK_STATE_UP); } } else { /* Link down */ @@ -1804,7 +1873,10 @@ ixl_stop(struct ixl_pf *pf) mtx_assert(&pf->pf_mtx, MA_OWNED); INIT_DEBUGOUT("ixl_stop: begin\n"); - ixl_disable_intr(vsi); + if (pf->num_vfs == 0) + ixl_disable_intr(vsi); + else + ixl_disable_rings_intr(vsi); ixl_disable_rings(vsi); /* Tell the stack that the interface is no longer active */ @@ -1857,6 +1929,11 @@ ixl_assign_vsi_legacy(struct ixl_pf *pf) taskqueue_start_threads(&que->tq, 1, PI_NET, "%s que", device_get_nameunit(dev)); TASK_INIT(&pf->adminq, 0, ixl_do_adminq, pf); + +#ifdef PCI_IOV + TASK_INIT(&pf->vflr_task, 0, ixl_handle_vflr, pf); +#endif + pf->tq = taskqueue_create_fast("ixl_adm", M_NOWAIT, taskqueue_thread_enqueue, &pf->tq); taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s adminq", @@ -1902,6 +1979,11 @@ ixl_assign_vsi_msix(struct ixl_pf *pf) pf->admvec = vector; /* Tasklet for Admin Queue */ TASK_INIT(&pf->adminq, 0, ixl_do_adminq, pf); + +#ifdef PCI_IOV + TASK_INIT(&pf->vflr_task, 0, ixl_handle_vflr, pf); +#endif + pf->tq = taskqueue_create_fast("ixl_adm", M_NOWAIT, taskqueue_thread_enqueue, &pf->tq); taskqueue_start_threads(&pf->tq, 1, PI_NET, "%s adminq", @@ -2325,6 +2407,10 @@ ixl_add_ifmedia(struct ixl_vsi *vsi, u32 if (phy_type & (1 << I40E_PHY_TYPE_1000BASE_T)) ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_T, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_1000BASE_SX)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_SX, 0, NULL); + if (phy_type & (1 << I40E_PHY_TYPE_1000BASE_LX)) + ifmedia_add(&vsi->media, IFM_ETHER | IFM_1000_LX, 0, NULL); if (phy_type & (1 << I40E_PHY_TYPE_10GBASE_CR1_CU) || phy_type & (1 << I40E_PHY_TYPE_10GBASE_KX4) || @@ -2465,17 +2551,32 @@ ixl_setup_interface(device_t dev, struct return (0); } -static bool -ixl_config_link(struct i40e_hw *hw) +/* +** Run when the Admin Queue gets a +** link transition interrupt. +*/ +static void +ixl_link_event(struct ixl_pf *pf, struct i40e_arq_event_info *e) { + struct i40e_hw *hw = &pf->hw; + struct i40e_aqc_get_link_status *status = + (struct i40e_aqc_get_link_status *)&e->desc.params.raw; bool check; - i40e_aq_get_link_info(hw, TRUE, NULL, NULL); + hw->phy.get_link_info = TRUE; check = i40e_get_link_status(hw); + pf->link_up = check; #ifdef IXL_DEBUG printf("Link is %s\n", check ? "up":"down"); #endif - return (check); + /* Report if Unqualified modules are found */ + if ((status->link_info & I40E_AQ_MEDIA_AVAILABLE) && + (!(status->an_info & I40E_AQ_QUALIFIED_MODULE)) && + (!(status->link_info & I40E_AQ_LINK_UP))) + device_printf(pf->dev, "Link failed because " + "an unqualified module was detected\n"); + + return; } /********************************************************************* @@ -2493,7 +2594,7 @@ ixl_switch_config(struct ixl_pf *pf) device_t dev = vsi->dev; struct i40e_aqc_get_switch_config_resp *sw_config; u8 aq_buf[I40E_AQ_LARGE_BUF]; - int ret = I40E_SUCCESS; + int ret; u16 next = 0; memset(&aq_buf, 0, sizeof(aq_buf)); @@ -2501,19 +2602,26 @@ ixl_switch_config(struct ixl_pf *pf) ret = i40e_aq_get_switch_config(hw, sw_config, sizeof(aq_buf), &next, NULL); if (ret) { - device_printf(dev,"aq_get_switch_config failed!!\n"); + device_printf(dev,"aq_get_switch_config failed (ret=%d)!!\n", + ret); return (ret); } #ifdef IXL_DEBUG - printf("Switch config: header reported: %d in structure, %d total\n", + device_printf(dev, + "Switch config: header reported: %d in structure, %d total\n", sw_config->header.num_reported, sw_config->header.num_total); - printf("type=%d seid=%d uplink=%d downlink=%d\n", - sw_config->element[0].element_type, - sw_config->element[0].seid, - sw_config->element[0].uplink_seid, - sw_config->element[0].downlink_seid); + for (int i = 0; i < sw_config->header.num_reported; i++) { + device_printf(dev, + "%d: type=%d seid=%d uplink=%d downlink=%d\n", i, + sw_config->element[i].element_type, + sw_config->element[i].seid, + sw_config->element[i].uplink_seid, + sw_config->element[i].downlink_seid); + } #endif /* Simplified due to a single VSI at the moment */ + vsi->uplink_seid = sw_config->element[0].uplink_seid; + vsi->downlink_seid = sw_config->element[0].downlink_seid; vsi->seid = sw_config->element[0].seid; return (ret); } @@ -2528,6 +2636,7 @@ ixl_switch_config(struct ixl_pf *pf) static int ixl_initialize_vsi(struct ixl_vsi *vsi) { + struct ixl_pf *pf = vsi->back; struct ixl_queue *que = vsi->queues; device_t dev = vsi->dev; struct i40e_hw *hw = vsi->hw; @@ -2536,6 +2645,8 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) memset(&ctxt, 0, sizeof(ctxt)); ctxt.seid = vsi->seid; + if (pf->veb_seid != 0) + ctxt.uplink_seid = pf->veb_seid; ctxt.pf_num = hw->pf_id; err = i40e_aq_get_vsi_params(hw, &ctxt, NULL); if (err) { @@ -2577,6 +2688,8 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) vsi->hw_filters_add = 0; vsi->hw_filters_del = 0; + ctxt.flags = htole16(I40E_AQ_VSI_TYPE_PF); + err = i40e_aq_update_vsi_params(hw, &ctxt, NULL); if (err) { device_printf(dev,"update vsi params failed %x!!\n", @@ -2597,7 +2710,7 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) size = que->num_desc * sizeof(struct i40e_tx_desc); memset(&tctx, 0, sizeof(struct i40e_hmc_obj_txq)); tctx.new_context = 1; - tctx.base = (txr->dma.pa/128); + tctx.base = (txr->dma.pa/IXL_TX_CTX_BASE_UNITS); tctx.qlen = que->num_desc; tctx.fc_ena = 0; tctx.rdylist = vsi->info.qs_handle[0]; /* index is TC */ @@ -2627,7 +2740,7 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) ixl_init_tx_ring(que); /* Next setup the HMC RX Context */ - if (vsi->max_frame_size <= 2048) + if (vsi->max_frame_size <= MCLBYTES) rxr->mbuf_sz = MCLBYTES; else rxr->mbuf_sz = MJUMPAGESIZE; @@ -2644,7 +2757,7 @@ ixl_initialize_vsi(struct ixl_vsi *vsi) rctx.dtype = 0; rctx.dsize = 1; /* do 32byte descriptors */ rctx.hsplit_0 = 0; /* no HDR split initially */ - rctx.base = (rxr->dma.pa/128); + rctx.base = (rxr->dma.pa/IXL_RX_CTX_BASE_UNITS); rctx.qlen = que->num_desc; rctx.tphrdesc_ena = 1; rctx.tphwdesc_ena = 1; @@ -2699,7 +2812,6 @@ ixl_free_vsi(struct ixl_vsi *vsi) { struct ixl_pf *pf = (struct ixl_pf *)vsi->back; struct ixl_queue *que = vsi->queues; - struct ixl_mac_filter *f; /* Free station queues */ for (int i = 0; i < vsi->num_queues; i++, que++) { @@ -2728,6 +2840,14 @@ ixl_free_vsi(struct ixl_vsi *vsi) free(vsi->queues, M_DEVBUF); /* Free VSI filter list */ + ixl_free_mac_filters(vsi); +} + +static void +ixl_free_mac_filters(struct ixl_vsi *vsi) +{ + struct ixl_mac_filter *f; + while (!SLIST_EMPTY(&vsi->ftl)) { f = SLIST_FIRST(&vsi->ftl); SLIST_REMOVE_HEAD(&vsi->ftl, next); @@ -2759,6 +2879,7 @@ ixl_setup_stations(struct ixl_pf *pf) vsi->hw = &pf->hw; vsi->id = 0; vsi->num_vlans = 0; + vsi->back = pf; /* Get memory for the station queues */ if (!(vsi->queues = @@ -3011,6 +3132,24 @@ ixl_set_queue_tx_itr(struct ixl_queue *q return; } +#define QUEUE_NAME_LEN 32 + +static void +ixl_add_vsi_sysctls(struct ixl_pf *pf, struct ixl_vsi *vsi, + struct sysctl_ctx_list *ctx, const char *sysctl_name) +{ + struct sysctl_oid *tree; + struct sysctl_oid_list *child; + struct sysctl_oid_list *vsi_list; + + tree = device_get_sysctl_tree(pf->dev); + child = SYSCTL_CHILDREN(tree); + vsi->vsi_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, sysctl_name, + CTLFLAG_RD, NULL, "VSI Number"); + vsi_list = SYSCTL_CHILDREN(vsi->vsi_node); + + ixl_add_sysctls_eth_stats(ctx, vsi_list, &vsi->eth_stats); +} static void ixl_add_hw_stats(struct ixl_pf *pf) @@ -3018,18 +3157,19 @@ ixl_add_hw_stats(struct ixl_pf *pf) device_t dev = pf->dev; struct ixl_vsi *vsi = &pf->vsi; struct ixl_queue *queues = vsi->queues; - struct i40e_eth_stats *vsi_stats = &vsi->eth_stats; struct i40e_hw_port_stats *pf_stats = &pf->stats; struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(dev); struct sysctl_oid *tree = device_get_sysctl_tree(dev); struct sysctl_oid_list *child = SYSCTL_CHILDREN(tree); + struct sysctl_oid_list *vsi_list; - struct sysctl_oid *vsi_node, *queue_node; - struct sysctl_oid_list *vsi_list, *queue_list; + struct sysctl_oid *queue_node; + struct sysctl_oid_list *queue_list; struct tx_ring *txr; struct rx_ring *rxr; + char queue_namebuf[QUEUE_NAME_LEN]; /* Driver statistics */ SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "watchdog_events", @@ -3039,23 +3179,18 @@ ixl_add_hw_stats(struct ixl_pf *pf) CTLFLAG_RD, &pf->admin_irq, "Admin Queue IRQ Handled"); - /* VSI statistics */ -#define QUEUE_NAME_LEN 32 - char queue_namebuf[QUEUE_NAME_LEN]; - - // ERJ: Only one vsi now, re-do when >1 VSI enabled - // snprintf(vsi_namebuf, QUEUE_NAME_LEN, "vsi%d", vsi->info.stat_counter_idx); - vsi_node = SYSCTL_ADD_NODE(ctx, child, OID_AUTO, "vsi", - CTLFLAG_RD, NULL, "VSI-specific stats"); - vsi_list = SYSCTL_CHILDREN(vsi_node); + SYSCTL_ADD_INT(ctx, child, OID_AUTO, "vc_debug_level", + CTLFLAG_RW, &pf->vc_debug_lvl, 0, + "PF/VF Virtual Channel debug logging level"); - ixl_add_sysctls_eth_stats(ctx, vsi_list, vsi_stats); + ixl_add_vsi_sysctls(pf, &pf->vsi, ctx, "pf"); + vsi_list = SYSCTL_CHILDREN(pf->vsi.vsi_node); /* Queue statistics */ for (int q = 0; q < vsi->num_queues; q++) { snprintf(queue_namebuf, QUEUE_NAME_LEN, "que%d", q); - queue_node = SYSCTL_ADD_NODE(ctx, vsi_list, OID_AUTO, queue_namebuf, - CTLFLAG_RD, NULL, "Queue #"); + queue_node = SYSCTL_ADD_NODE(ctx, vsi_list, + OID_AUTO, queue_namebuf, CTLFLAG_RD, NULL, "Queue #"); queue_list = SYSCTL_CHILDREN(queue_node); txr = &(queues[q].txr); @@ -3378,8 +3513,7 @@ static void ixl_init_filters(struct ixl_vsi *vsi) { /* Add broadcast address */ - u8 bc[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - ixl_add_filter(vsi, bc, IXL_VLAN_ANY); + ixl_add_filter(vsi, ixl_bcast_addr, IXL_VLAN_ANY); } /* @@ -3408,6 +3542,13 @@ ixl_add_mc_filter(struct ixl_vsi *vsi, u return; } +static void +ixl_reconfigure_filters(struct ixl_vsi *vsi) +{ + + ixl_add_hw_filters(vsi, IXL_FILTER_USED, vsi->num_macs); +} + /* ** This routine adds macvlan filters *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 11 12:58:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C07F9D85EA; Fri, 11 Dec 2015 12:58:21 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F17C61F5A; Fri, 11 Dec 2015 12:58:20 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBCwKL9056418; Fri, 11 Dec 2015 12:58:20 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBCwKWv056417; Fri, 11 Dec 2015 12:58:20 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512111258.tBBCwKWv056417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 11 Dec 2015 12:58:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292098 - stable/10/sys/dev/ixl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 12:58:21 -0000 Author: smh Date: Fri Dec 11 12:58:19 2015 New Revision: 292098 URL: https://svnweb.freebsd.org/changeset/base/292098 Log: MFC r280043: Remove redundant sysctl_handle_string Sponsored by: Multiplay Modified: stable/10/sys/dev/ixl/if_ixl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixl/if_ixl.c ============================================================================== --- stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 12:47:49 2015 (r292097) +++ stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 12:58:19 2015 (r292098) @@ -4989,7 +4989,7 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A u8 num_entries; struct i40e_aqc_switch_resource_alloc_element_resp resp[IXL_SW_RES_SIZE]; - buf = sbuf_new_for_sysctl(NULL, NULL, 0, req); + buf = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (!buf) { device_printf(dev, "Could not allocate sbuf for output.\n"); return (ENOMEM); @@ -5031,6 +5031,9 @@ ixl_sysctl_hw_res_alloc(SYSCTL_HANDLER_A } error = sbuf_finish(buf); + if (error) { + device_printf(dev, "Error finishing sbuf: %d\n", error); + } sbuf_delete(buf); return (error); @@ -5089,7 +5092,7 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ struct i40e_aqc_get_switch_config_resp *sw_config; sw_config = (struct i40e_aqc_get_switch_config_resp *)aq_buf; - buf = sbuf_new_for_sysctl(NULL, NULL, 0, req); + buf = sbuf_new_for_sysctl(NULL, NULL, 128, req); if (!buf) { device_printf(dev, "Could not allocate sbuf for sysctl output.\n"); return (ENOMEM); @@ -5108,6 +5111,7 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ nmbuf = sbuf_new_auto(); if (!nmbuf) { device_printf(dev, "Could not allocate sbuf for name output.\n"); + sbuf_delete(buf); return (ENOMEM); } @@ -5140,6 +5144,9 @@ ixl_sysctl_switch_config(SYSCTL_HANDLER_ sbuf_delete(nmbuf); error = sbuf_finish(buf); + if (error) { + device_printf(dev, "Error finishing sbuf: %d\n", error); + } sbuf_delete(buf); return (error); From owner-svn-src-all@freebsd.org Fri Dec 11 13:05:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D4F19D8BDF; Fri, 11 Dec 2015 13:05:20 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D22DA177A; Fri, 11 Dec 2015 13:05:19 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBD5I7q059337; Fri, 11 Dec 2015 13:05:18 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBD5IDI059336; Fri, 11 Dec 2015 13:05:18 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512111305.tBBD5IDI059336@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 11 Dec 2015 13:05:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292099 - stable/10/sys/dev/ixl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 13:05:20 -0000 Author: smh Date: Fri Dec 11 13:05:18 2015 New Revision: 292099 URL: https://svnweb.freebsd.org/changeset/base/292099 Log: MFC r283119: Remove executable property from ixl Sponsored by: Multiplay Modified: Directory Properties: stable/10/ (props changed) stable/10/sys/dev/ixl/i40e_adminq.c (props changed) stable/10/sys/dev/ixl/i40e_adminq.h (props changed) stable/10/sys/dev/ixl/i40e_adminq_cmd.h (props changed) stable/10/sys/dev/ixl/i40e_alloc.h (props changed) stable/10/sys/dev/ixl/i40e_common.c (props changed) stable/10/sys/dev/ixl/i40e_hmc.c (props changed) stable/10/sys/dev/ixl/i40e_hmc.h (props changed) stable/10/sys/dev/ixl/i40e_lan_hmc.c (props changed) stable/10/sys/dev/ixl/i40e_lan_hmc.h (props changed) stable/10/sys/dev/ixl/i40e_nvm.c (props changed) stable/10/sys/dev/ixl/i40e_osdep.c (props changed) stable/10/sys/dev/ixl/i40e_osdep.h (props changed) stable/10/sys/dev/ixl/i40e_prototype.h (props changed) stable/10/sys/dev/ixl/i40e_register.h (props changed) stable/10/sys/dev/ixl/i40e_status.h (props changed) stable/10/sys/dev/ixl/i40e_type.h (props changed) stable/10/sys/dev/ixl/i40e_virtchnl.h (props changed) stable/10/sys/dev/ixl/if_ixl.c (props changed) stable/10/sys/dev/ixl/ixl_txrx.c (props changed) From owner-svn-src-all@freebsd.org Fri Dec 11 13:08:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 001589D8E53; Fri, 11 Dec 2015 13:08:39 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9286619FF; Fri, 11 Dec 2015 13:08:39 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBD8cKv059515; Fri, 11 Dec 2015 13:08:38 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBD8cYb059510; Fri, 11 Dec 2015 13:08:38 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512111308.tBBD8cYb059510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 11 Dec 2015 13:08:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292100 - in stable/10/sys: dev/ixl modules/ixl modules/ixlv X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 13:08:40 -0000 Author: smh Date: Fri Dec 11 13:08:38 2015 New Revision: 292100 URL: https://svnweb.freebsd.org/changeset/base/292100 Log: MFC r284049: Update SW4 to the Intel ixl/ixlv Sponsored by: Multiplay Added: stable/10/sys/dev/ixl/i40e_devids.h - copied unchanged from r284049, head/sys/dev/ixl/i40e_devids.h Modified: stable/10/sys/dev/ixl/i40e_adminq.c stable/10/sys/dev/ixl/i40e_adminq.h stable/10/sys/dev/ixl/i40e_adminq_cmd.h stable/10/sys/dev/ixl/i40e_common.c stable/10/sys/dev/ixl/i40e_hmc.c stable/10/sys/dev/ixl/i40e_hmc.h stable/10/sys/dev/ixl/i40e_lan_hmc.c stable/10/sys/dev/ixl/i40e_nvm.c stable/10/sys/dev/ixl/i40e_osdep.h stable/10/sys/dev/ixl/i40e_prototype.h stable/10/sys/dev/ixl/i40e_register.h stable/10/sys/dev/ixl/i40e_type.h stable/10/sys/dev/ixl/i40e_virtchnl.h stable/10/sys/dev/ixl/if_ixl.c stable/10/sys/dev/ixl/if_ixlv.c stable/10/sys/dev/ixl/ixlv.h stable/10/sys/dev/ixl/ixlvc.c stable/10/sys/modules/ixl/Makefile stable/10/sys/modules/ixlv/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixl/i40e_adminq.c ============================================================================== --- stable/10/sys/dev/ixl/i40e_adminq.c Fri Dec 11 13:05:18 2015 (r292099) +++ stable/10/sys/dev/ixl/i40e_adminq.c Fri Dec 11 13:08:38 2015 (r292100) @@ -315,8 +315,12 @@ static enum i40e_status_code i40e_config wr32(hw, hw->aq.asq.tail, 0); /* set starting point */ - wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries | - I40E_PF_ATQLEN_ATQENABLE_MASK)); + if (!i40e_is_vf(hw)) + wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries | + I40E_PF_ATQLEN_ATQENABLE_MASK)); + if (i40e_is_vf(hw)) + wr32(hw, hw->aq.asq.len, (hw->aq.num_asq_entries | + I40E_VF_ATQLEN1_ATQENABLE_MASK)); wr32(hw, hw->aq.asq.bal, I40E_LO_DWORD(hw->aq.asq.desc_buf.pa)); wr32(hw, hw->aq.asq.bah, I40E_HI_DWORD(hw->aq.asq.desc_buf.pa)); @@ -344,8 +348,12 @@ static enum i40e_status_code i40e_config wr32(hw, hw->aq.arq.tail, 0); /* set starting point */ - wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries | - I40E_PF_ARQLEN_ARQENABLE_MASK)); + if (!i40e_is_vf(hw)) + wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries | + I40E_PF_ARQLEN_ARQENABLE_MASK)); + if (i40e_is_vf(hw)) + wr32(hw, hw->aq.arq.len, (hw->aq.num_arq_entries | + I40E_VF_ARQLEN1_ARQENABLE_MASK)); wr32(hw, hw->aq.arq.bal, I40E_LO_DWORD(hw->aq.arq.desc_buf.pa)); wr32(hw, hw->aq.arq.bah, I40E_HI_DWORD(hw->aq.arq.desc_buf.pa)); @@ -559,6 +567,7 @@ enum i40e_status_code i40e_init_adminq(s { enum i40e_status_code ret_code; u16 eetrack_lo, eetrack_hi; + u16 cfg_ptr, oem_hi, oem_lo; int retry = 0; /* verify input for valid configuration */ if ((hw->aq.num_arq_entries == 0) || @@ -619,6 +628,12 @@ enum i40e_status_code i40e_init_adminq(s i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_LO, &eetrack_lo); i40e_read_nvm_word(hw, I40E_SR_NVM_EETRACK_HI, &eetrack_hi); hw->nvm.eetrack = (eetrack_hi << 16) | eetrack_lo; + i40e_read_nvm_word(hw, I40E_SR_BOOT_CONFIG_PTR, &cfg_ptr); + i40e_read_nvm_word(hw, (cfg_ptr + I40E_NVM_OEM_VER_OFF), + &oem_hi); + i40e_read_nvm_word(hw, (cfg_ptr + (I40E_NVM_OEM_VER_OFF + 1)), + &oem_lo); + hw->nvm.oem_ver = ((u32)oem_hi << 16) | oem_lo; if (hw->aq.api_maj_ver > I40E_FW_API_VERSION_MAJOR) { ret_code = I40E_ERR_FIRMWARE_API_VERSION; @@ -669,6 +684,9 @@ enum i40e_status_code i40e_shutdown_admi i40e_destroy_spinlock(&hw->aq.asq_spinlock); i40e_destroy_spinlock(&hw->aq.arq_spinlock); + if (hw->nvm_buff.va) + i40e_free_virt_mem(hw, &hw->nvm_buff); + return ret_code; } @@ -688,16 +706,16 @@ u16 i40e_clean_asq(struct i40e_hw *hw) desc = I40E_ADMINQ_DESC(*asq, ntc); details = I40E_ADMINQ_DETAILS(*asq, ntc); + while (rd32(hw, hw->aq.asq.head) != ntc) { i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, - "%s: ntc %d head %d.\n", __FUNCTION__, ntc, - rd32(hw, hw->aq.asq.head)); + "ntc %d head %d.\n", ntc, rd32(hw, hw->aq.asq.head)); if (details->callback) { I40E_ADMINQ_CALLBACK cb_func = (I40E_ADMINQ_CALLBACK)details->callback; - i40e_memcpy(&desc_cb, desc, - sizeof(struct i40e_aq_desc), I40E_DMA_TO_DMA); + i40e_memcpy(&desc_cb, desc, sizeof(struct i40e_aq_desc), + I40E_DMA_TO_DMA); cb_func(hw, &desc_cb); } i40e_memset(desc, 0, sizeof(*desc), I40E_DMA_MEM); @@ -755,6 +773,8 @@ enum i40e_status_code i40e_asq_send_comm u16 retval = 0; u32 val = 0; + hw->aq.asq_last_status = I40E_AQ_RC_OK; + val = rd32(hw, hw->aq.asq.head); if (val >= hw->aq.num_asq_entries) { i40e_debug(hw, I40E_DEBUG_AQ_MESSAGE, @@ -912,6 +932,11 @@ enum i40e_status_code i40e_asq_send_comm "AQTX: desc and buffer writeback:\n"); i40e_debug_aq(hw, I40E_DEBUG_AQ_COMMAND, (void *)desc, buff, buff_size); + /* save writeback aq if requested */ + if (details->wb_desc) + i40e_memcpy(details->wb_desc, desc_on_ring, + sizeof(struct i40e_aq_desc), I40E_DMA_TO_NONDMA); + /* update the error if time out occurred */ if ((!cmd_completed) && (!details->async && !details->postpone)) { @@ -971,7 +996,10 @@ enum i40e_status_code i40e_clean_arq_ele i40e_acquire_spinlock(&hw->aq.arq_spinlock); /* set next_to_use to head */ - ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK); + if (!i40e_is_vf(hw)) + ntu = (rd32(hw, hw->aq.arq.head) & I40E_PF_ARQH_ARQH_MASK); + if (i40e_is_vf(hw)) + ntu = (rd32(hw, hw->aq.arq.head) & I40E_VF_ARQH1_ARQH_MASK); if (ntu == ntc) { /* nothing to do - shouldn't need to update ring's values */ ret_code = I40E_ERR_ADMIN_QUEUE_NO_WORK; @@ -1040,6 +1068,19 @@ clean_arq_element_out: i40e_release_nvm(hw); hw->aq.nvm_release_on_done = FALSE; } + + switch (hw->nvmupd_state) { + case I40E_NVMUPD_STATE_INIT_WAIT: + hw->nvmupd_state = I40E_NVMUPD_STATE_INIT; + break; + + case I40E_NVMUPD_STATE_WRITE_WAIT: + hw->nvmupd_state = I40E_NVMUPD_STATE_WRITING; + break; + + default: + break; + } } return ret_code; @@ -1051,9 +1092,6 @@ void i40e_resume_aq(struct i40e_hw *hw) hw->aq.asq.next_to_use = 0; hw->aq.asq.next_to_clean = 0; -#if (I40E_VF_ATQLEN_ATQENABLE_MASK != I40E_PF_ATQLEN_ATQENABLE_MASK) -#error I40E_VF_ATQLEN_ATQENABLE_MASK != I40E_PF_ATQLEN_ATQENABLE_MASK -#endif i40e_config_asq_regs(hw); hw->aq.arq.next_to_use = 0; Modified: stable/10/sys/dev/ixl/i40e_adminq.h ============================================================================== --- stable/10/sys/dev/ixl/i40e_adminq.h Fri Dec 11 13:05:18 2015 (r292099) +++ stable/10/sys/dev/ixl/i40e_adminq.h Fri Dec 11 13:08:38 2015 (r292100) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2014, Intel Corporation + Copyright (c) 2013-2015, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -77,6 +77,7 @@ struct i40e_asq_cmd_details { u16 flags_dis; bool async; bool postpone; + struct i40e_aq_desc *wb_desc; }; #define I40E_ADMINQ_DETAILS(R, i) \ Modified: stable/10/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- stable/10/sys/dev/ixl/i40e_adminq_cmd.h Fri Dec 11 13:05:18 2015 (r292099) +++ stable/10/sys/dev/ixl/i40e_adminq_cmd.h Fri Dec 11 13:08:38 2015 (r292100) @@ -42,7 +42,11 @@ */ #define I40E_FW_API_VERSION_MAJOR 0x0001 -#define I40E_FW_API_VERSION_MINOR 0x0002 +#ifdef X722_SUPPORT +#define I40E_FW_API_VERSION_MINOR 0x0003 +#else +#define I40E_FW_API_VERSION_MINOR 0x0004 +#endif struct i40e_aq_desc { __le16 flags; @@ -140,12 +144,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_list_func_capabilities = 0x000A, i40e_aqc_opc_list_dev_capabilities = 0x000B, - i40e_aqc_opc_set_cppm_configuration = 0x0103, - i40e_aqc_opc_set_arp_proxy_entry = 0x0104, - i40e_aqc_opc_set_ns_proxy_entry = 0x0105, - /* LAA */ - i40e_aqc_opc_mng_laa = 0x0106, /* AQ obsolete */ i40e_aqc_opc_mac_address_read = 0x0107, i40e_aqc_opc_mac_address_write = 0x0108, @@ -240,6 +239,7 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_nvm_update = 0x0703, i40e_aqc_opc_nvm_config_read = 0x0704, i40e_aqc_opc_nvm_config_write = 0x0705, + i40e_aqc_opc_oem_post_update = 0x0720, /* virtualization commands */ i40e_aqc_opc_send_msg_to_pf = 0x0801, @@ -270,7 +270,12 @@ enum i40e_admin_queue_opc { /* Tunnel commands */ i40e_aqc_opc_add_udp_tunnel = 0x0B00, i40e_aqc_opc_del_udp_tunnel = 0x0B01, - i40e_aqc_opc_tunnel_key_structure = 0x0B10, +#ifdef X722_SUPPORT + i40e_aqc_opc_set_rss_key = 0x0B02, + i40e_aqc_opc_set_rss_lut = 0x0B03, + i40e_aqc_opc_get_rss_key = 0x0B04, + i40e_aqc_opc_get_rss_lut = 0x0B05, +#endif /* Async Events */ i40e_aqc_opc_event_lan_overflow = 0x1001, @@ -282,8 +287,6 @@ enum i40e_admin_queue_opc { i40e_aqc_opc_oem_ocbb_initialize = 0xFE03, /* debug commands */ - i40e_aqc_opc_debug_get_deviceid = 0xFF00, - i40e_aqc_opc_debug_set_mode = 0xFF01, i40e_aqc_opc_debug_read_reg = 0xFF03, i40e_aqc_opc_debug_write_reg = 0xFF04, i40e_aqc_opc_debug_modify_reg = 0xFF07, @@ -517,7 +520,8 @@ struct i40e_aqc_mac_address_read { #define I40E_AQC_SAN_ADDR_VALID 0x20 #define I40E_AQC_PORT_ADDR_VALID 0x40 #define I40E_AQC_WOL_ADDR_VALID 0x80 -#define I40E_AQC_ADDR_VALID_MASK 0xf0 +#define I40E_AQC_MC_MAG_EN_VALID 0x100 +#define I40E_AQC_ADDR_VALID_MASK 0x1F0 u8 reserved[6]; __le32 addr_high; __le32 addr_low; @@ -540,7 +544,9 @@ struct i40e_aqc_mac_address_write { #define I40E_AQC_WRITE_TYPE_LAA_ONLY 0x0000 #define I40E_AQC_WRITE_TYPE_LAA_WOL 0x4000 #define I40E_AQC_WRITE_TYPE_PORT 0x8000 -#define I40E_AQC_WRITE_TYPE_MASK 0xc000 +#define I40E_AQC_WRITE_TYPE_UPDATE_MC_MAG 0xC000 +#define I40E_AQC_WRITE_TYPE_MASK 0xC000 + __le16 mac_sah; __le32 mac_sal; u8 reserved[8]; @@ -834,8 +840,16 @@ struct i40e_aqc_vsi_properties_data { I40E_AQ_VSI_TC_QUE_NUMBER_SHIFT) /* queueing option section */ u8 queueing_opt_flags; +#ifdef X722_SUPPORT +#define I40E_AQ_VSI_QUE_OPT_MULTICAST_UDP_ENA 0x04 +#define I40E_AQ_VSI_QUE_OPT_UNICAST_UDP_ENA 0x08 +#endif #define I40E_AQ_VSI_QUE_OPT_TCP_ENA 0x10 #define I40E_AQ_VSI_QUE_OPT_FCOE_ENA 0x20 +#ifdef X722_SUPPORT +#define I40E_AQ_VSI_QUE_OPT_RSS_LUT_PF 0x00 +#define I40E_AQ_VSI_QUE_OPT_RSS_LUT_VSI 0x40 +#endif u8 queueing_opt_reserved[3]; /* scheduler section */ u8 up_enable_bits; @@ -1076,6 +1090,7 @@ struct i40e_aqc_set_vsi_promiscuous_mode __le16 seid; #define I40E_AQC_VSI_PROM_CMD_SEID_MASK 0x3FF __le16 vlan_tag; +#define I40E_AQC_SET_VSI_VLAN_MASK 0x0FFF #define I40E_AQC_SET_VSI_VLAN_VALID 0x8000 u8 reserved[8]; }; @@ -1725,11 +1740,13 @@ struct i40e_aqc_get_link_status { u8 phy_type; /* i40e_aq_phy_type */ u8 link_speed; /* i40e_aq_link_speed */ u8 link_info; -#define I40E_AQ_LINK_UP 0x01 +#define I40E_AQ_LINK_UP 0x01 /* obsolete */ +#define I40E_AQ_LINK_UP_FUNCTION 0x01 #define I40E_AQ_LINK_FAULT 0x02 #define I40E_AQ_LINK_FAULT_TX 0x04 #define I40E_AQ_LINK_FAULT_RX 0x08 #define I40E_AQ_LINK_FAULT_REMOTE 0x10 +#define I40E_AQ_LINK_UP_PORT 0x20 #define I40E_AQ_MEDIA_AVAILABLE 0x40 #define I40E_AQ_SIGNAL_DETECT 0x80 u8 an_info; @@ -1891,6 +1908,26 @@ struct i40e_aqc_nvm_config_data_immediat I40E_CHECK_STRUCT_LEN(0xc, i40e_aqc_nvm_config_data_immediate_field); +/* OEM Post Update (indirect 0x0720) + * no command data struct used + */ + struct i40e_aqc_nvm_oem_post_update { +#define I40E_AQ_NVM_OEM_POST_UPDATE_EXTERNAL_DATA 0x01 + u8 sel_data; + u8 reserved[7]; +}; + +I40E_CHECK_STRUCT_LEN(0x8, i40e_aqc_nvm_oem_post_update); + +struct i40e_aqc_nvm_oem_post_update_buffer { + u8 str_len; + u8 dev_addr; + __le16 eeprom_addr; + u8 data[36]; +}; + +I40E_CHECK_STRUCT_LEN(0x28, i40e_aqc_nvm_oem_post_update_buffer); + /* Send to PF command (indirect 0x0801) id is only used by PF * Send to VF command (indirect 0x0802) id is only used by PF * Send to Peer PF command (indirect 0x0803) @@ -2064,12 +2101,28 @@ I40E_CHECK_CMD_LENGTH(i40e_aqc_lldp_star #define I40E_AQC_CEE_APP_ISCSI_MASK (0x7 << I40E_AQC_CEE_APP_ISCSI_SHIFT) #define I40E_AQC_CEE_APP_FIP_SHIFT 0x8 #define I40E_AQC_CEE_APP_FIP_MASK (0x7 << I40E_AQC_CEE_APP_FIP_SHIFT) + #define I40E_AQC_CEE_PG_STATUS_SHIFT 0x0 #define I40E_AQC_CEE_PG_STATUS_MASK (0x7 << I40E_AQC_CEE_PG_STATUS_SHIFT) #define I40E_AQC_CEE_PFC_STATUS_SHIFT 0x3 #define I40E_AQC_CEE_PFC_STATUS_MASK (0x7 << I40E_AQC_CEE_PFC_STATUS_SHIFT) #define I40E_AQC_CEE_APP_STATUS_SHIFT 0x8 #define I40E_AQC_CEE_APP_STATUS_MASK (0x7 << I40E_AQC_CEE_APP_STATUS_SHIFT) +#define I40E_AQC_CEE_FCOE_STATUS_SHIFT 0x8 +#define I40E_AQC_CEE_FCOE_STATUS_MASK (0x7 << I40E_AQC_CEE_FCOE_STATUS_SHIFT) +#define I40E_AQC_CEE_ISCSI_STATUS_SHIFT 0xB +#define I40E_AQC_CEE_ISCSI_STATUS_MASK (0x7 << I40E_AQC_CEE_ISCSI_STATUS_SHIFT) +#define I40E_AQC_CEE_FIP_STATUS_SHIFT 0x10 +#define I40E_AQC_CEE_FIP_STATUS_MASK (0x7 << I40E_AQC_CEE_FIP_STATUS_SHIFT) + +/* struct i40e_aqc_get_cee_dcb_cfg_v1_resp was originally defined with + * word boundary layout issues, which the Linux compilers silently deal + * with by adding padding, making the actual struct larger than designed. + * However, the FW compiler for the NIC is less lenient and complains + * about the struct. Hence, the struct defined here has an extra byte in + * fields reserved3 and reserved4 to directly acknowledge that padding, + * and the new length is used in the length check macro. + */ struct i40e_aqc_get_cee_dcb_cfg_v1_resp { u8 reserved1; u8 oper_num_tc; @@ -2077,9 +2130,9 @@ struct i40e_aqc_get_cee_dcb_cfg_v1_resp u8 reserved2; u8 oper_tc_bw[8]; u8 oper_pfc_en; - u8 reserved3; + u8 reserved3[2]; __le16 oper_app_prio; - u8 reserved4; + u8 reserved4[2]; __le16 tlv_status; }; @@ -2168,6 +2221,48 @@ struct i40e_aqc_del_udp_tunnel_completio }; I40E_CHECK_CMD_LENGTH(i40e_aqc_del_udp_tunnel_completion); +#ifdef X722_SUPPORT + +struct i40e_aqc_get_set_rss_key { +#define I40E_AQC_SET_RSS_KEY_VSI_VALID (0x1 << 15) +#define I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT 0 +#define I40E_AQC_SET_RSS_KEY_VSI_ID_MASK (0x3FF << \ + I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT) + __le16 vsi_id; + u8 reserved[6]; + __le32 addr_high; + __le32 addr_low; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_key); + +struct i40e_aqc_get_set_rss_key_data { + u8 standard_rss_key[0x28]; + u8 extended_hash_key[0xc]; +}; + +I40E_CHECK_STRUCT_LEN(0x34, i40e_aqc_get_set_rss_key_data); + +struct i40e_aqc_get_set_rss_lut { +#define I40E_AQC_SET_RSS_LUT_VSI_VALID (0x1 << 15) +#define I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT 0 +#define I40E_AQC_SET_RSS_LUT_VSI_ID_MASK (0x3FF << \ + I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT) + __le16 vsi_id; +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT 0 +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK (0x1 << \ + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) + +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI 0 +#define I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF 1 + __le16 flags; + u8 reserved[4]; + __le32 addr_high; + __le32 addr_low; +}; + +I40E_CHECK_CMD_LENGTH(i40e_aqc_get_set_rss_lut); +#endif /* tunnel key structure 0x0B10 */ Modified: stable/10/sys/dev/ixl/i40e_common.c ============================================================================== --- stable/10/sys/dev/ixl/i40e_common.c Fri Dec 11 13:05:18 2015 (r292099) +++ stable/10/sys/dev/ixl/i40e_common.c Fri Dec 11 13:08:38 2015 (r292100) @@ -62,9 +62,24 @@ enum i40e_status_code i40e_set_mac_type( case I40E_DEV_ID_QSFP_B: case I40E_DEV_ID_QSFP_C: case I40E_DEV_ID_10G_BASE_T: + case I40E_DEV_ID_10G_BASE_T4: case I40E_DEV_ID_20G_KR2: + case I40E_DEV_ID_20G_KR2_A: hw->mac.type = I40E_MAC_XL710; break; +#ifdef X722_SUPPORT + case I40E_DEV_ID_SFP_X722: + case I40E_DEV_ID_1G_BASE_T_X722: + case I40E_DEV_ID_10G_BASE_T_X722: + hw->mac.type = I40E_MAC_X722; + break; +#endif +#ifdef X722_SUPPORT + case I40E_DEV_ID_X722_VF: + case I40E_DEV_ID_X722_VF_HV: + hw->mac.type = I40E_MAC_X722_VF; + break; +#endif case I40E_DEV_ID_VF: case I40E_DEV_ID_VF_HV: hw->mac.type = I40E_MAC_VF; @@ -83,6 +98,212 @@ enum i40e_status_code i40e_set_mac_type( } /** + * i40e_aq_str - convert AQ err code to a string + * @hw: pointer to the HW structure + * @aq_err: the AQ error code to convert + **/ +char *i40e_aq_str(struct i40e_hw *hw, enum i40e_admin_queue_err aq_err) +{ + switch (aq_err) { + case I40E_AQ_RC_OK: + return "OK"; + case I40E_AQ_RC_EPERM: + return "I40E_AQ_RC_EPERM"; + case I40E_AQ_RC_ENOENT: + return "I40E_AQ_RC_ENOENT"; + case I40E_AQ_RC_ESRCH: + return "I40E_AQ_RC_ESRCH"; + case I40E_AQ_RC_EINTR: + return "I40E_AQ_RC_EINTR"; + case I40E_AQ_RC_EIO: + return "I40E_AQ_RC_EIO"; + case I40E_AQ_RC_ENXIO: + return "I40E_AQ_RC_ENXIO"; + case I40E_AQ_RC_E2BIG: + return "I40E_AQ_RC_E2BIG"; + case I40E_AQ_RC_EAGAIN: + return "I40E_AQ_RC_EAGAIN"; + case I40E_AQ_RC_ENOMEM: + return "I40E_AQ_RC_ENOMEM"; + case I40E_AQ_RC_EACCES: + return "I40E_AQ_RC_EACCES"; + case I40E_AQ_RC_EFAULT: + return "I40E_AQ_RC_EFAULT"; + case I40E_AQ_RC_EBUSY: + return "I40E_AQ_RC_EBUSY"; + case I40E_AQ_RC_EEXIST: + return "I40E_AQ_RC_EEXIST"; + case I40E_AQ_RC_EINVAL: + return "I40E_AQ_RC_EINVAL"; + case I40E_AQ_RC_ENOTTY: + return "I40E_AQ_RC_ENOTTY"; + case I40E_AQ_RC_ENOSPC: + return "I40E_AQ_RC_ENOSPC"; + case I40E_AQ_RC_ENOSYS: + return "I40E_AQ_RC_ENOSYS"; + case I40E_AQ_RC_ERANGE: + return "I40E_AQ_RC_ERANGE"; + case I40E_AQ_RC_EFLUSHED: + return "I40E_AQ_RC_EFLUSHED"; + case I40E_AQ_RC_BAD_ADDR: + return "I40E_AQ_RC_BAD_ADDR"; + case I40E_AQ_RC_EMODE: + return "I40E_AQ_RC_EMODE"; + case I40E_AQ_RC_EFBIG: + return "I40E_AQ_RC_EFBIG"; + } + + snprintf(hw->err_str, sizeof(hw->err_str), "%d", aq_err); + return hw->err_str; +} + +/** + * i40e_stat_str - convert status err code to a string + * @hw: pointer to the HW structure + * @stat_err: the status error code to convert + **/ +char *i40e_stat_str(struct i40e_hw *hw, enum i40e_status_code stat_err) +{ + switch (stat_err) { + case I40E_SUCCESS: + return "OK"; + case I40E_ERR_NVM: + return "I40E_ERR_NVM"; + case I40E_ERR_NVM_CHECKSUM: + return "I40E_ERR_NVM_CHECKSUM"; + case I40E_ERR_PHY: + return "I40E_ERR_PHY"; + case I40E_ERR_CONFIG: + return "I40E_ERR_CONFIG"; + case I40E_ERR_PARAM: + return "I40E_ERR_PARAM"; + case I40E_ERR_MAC_TYPE: + return "I40E_ERR_MAC_TYPE"; + case I40E_ERR_UNKNOWN_PHY: + return "I40E_ERR_UNKNOWN_PHY"; + case I40E_ERR_LINK_SETUP: + return "I40E_ERR_LINK_SETUP"; + case I40E_ERR_ADAPTER_STOPPED: + return "I40E_ERR_ADAPTER_STOPPED"; + case I40E_ERR_INVALID_MAC_ADDR: + return "I40E_ERR_INVALID_MAC_ADDR"; + case I40E_ERR_DEVICE_NOT_SUPPORTED: + return "I40E_ERR_DEVICE_NOT_SUPPORTED"; + case I40E_ERR_MASTER_REQUESTS_PENDING: + return "I40E_ERR_MASTER_REQUESTS_PENDING"; + case I40E_ERR_INVALID_LINK_SETTINGS: + return "I40E_ERR_INVALID_LINK_SETTINGS"; + case I40E_ERR_AUTONEG_NOT_COMPLETE: + return "I40E_ERR_AUTONEG_NOT_COMPLETE"; + case I40E_ERR_RESET_FAILED: + return "I40E_ERR_RESET_FAILED"; + case I40E_ERR_SWFW_SYNC: + return "I40E_ERR_SWFW_SYNC"; + case I40E_ERR_NO_AVAILABLE_VSI: + return "I40E_ERR_NO_AVAILABLE_VSI"; + case I40E_ERR_NO_MEMORY: + return "I40E_ERR_NO_MEMORY"; + case I40E_ERR_BAD_PTR: + return "I40E_ERR_BAD_PTR"; + case I40E_ERR_RING_FULL: + return "I40E_ERR_RING_FULL"; + case I40E_ERR_INVALID_PD_ID: + return "I40E_ERR_INVALID_PD_ID"; + case I40E_ERR_INVALID_QP_ID: + return "I40E_ERR_INVALID_QP_ID"; + case I40E_ERR_INVALID_CQ_ID: + return "I40E_ERR_INVALID_CQ_ID"; + case I40E_ERR_INVALID_CEQ_ID: + return "I40E_ERR_INVALID_CEQ_ID"; + case I40E_ERR_INVALID_AEQ_ID: + return "I40E_ERR_INVALID_AEQ_ID"; + case I40E_ERR_INVALID_SIZE: + return "I40E_ERR_INVALID_SIZE"; + case I40E_ERR_INVALID_ARP_INDEX: + return "I40E_ERR_INVALID_ARP_INDEX"; + case I40E_ERR_INVALID_FPM_FUNC_ID: + return "I40E_ERR_INVALID_FPM_FUNC_ID"; + case I40E_ERR_QP_INVALID_MSG_SIZE: + return "I40E_ERR_QP_INVALID_MSG_SIZE"; + case I40E_ERR_QP_TOOMANY_WRS_POSTED: + return "I40E_ERR_QP_TOOMANY_WRS_POSTED"; + case I40E_ERR_INVALID_FRAG_COUNT: + return "I40E_ERR_INVALID_FRAG_COUNT"; + case I40E_ERR_QUEUE_EMPTY: + return "I40E_ERR_QUEUE_EMPTY"; + case I40E_ERR_INVALID_ALIGNMENT: + return "I40E_ERR_INVALID_ALIGNMENT"; + case I40E_ERR_FLUSHED_QUEUE: + return "I40E_ERR_FLUSHED_QUEUE"; + case I40E_ERR_INVALID_PUSH_PAGE_INDEX: + return "I40E_ERR_INVALID_PUSH_PAGE_INDEX"; + case I40E_ERR_INVALID_IMM_DATA_SIZE: + return "I40E_ERR_INVALID_IMM_DATA_SIZE"; + case I40E_ERR_TIMEOUT: + return "I40E_ERR_TIMEOUT"; + case I40E_ERR_OPCODE_MISMATCH: + return "I40E_ERR_OPCODE_MISMATCH"; + case I40E_ERR_CQP_COMPL_ERROR: + return "I40E_ERR_CQP_COMPL_ERROR"; + case I40E_ERR_INVALID_VF_ID: + return "I40E_ERR_INVALID_VF_ID"; + case I40E_ERR_INVALID_HMCFN_ID: + return "I40E_ERR_INVALID_HMCFN_ID"; + case I40E_ERR_BACKING_PAGE_ERROR: + return "I40E_ERR_BACKING_PAGE_ERROR"; + case I40E_ERR_NO_PBLCHUNKS_AVAILABLE: + return "I40E_ERR_NO_PBLCHUNKS_AVAILABLE"; + case I40E_ERR_INVALID_PBLE_INDEX: + return "I40E_ERR_INVALID_PBLE_INDEX"; + case I40E_ERR_INVALID_SD_INDEX: + return "I40E_ERR_INVALID_SD_INDEX"; + case I40E_ERR_INVALID_PAGE_DESC_INDEX: + return "I40E_ERR_INVALID_PAGE_DESC_INDEX"; + case I40E_ERR_INVALID_SD_TYPE: + return "I40E_ERR_INVALID_SD_TYPE"; + case I40E_ERR_MEMCPY_FAILED: + return "I40E_ERR_MEMCPY_FAILED"; + case I40E_ERR_INVALID_HMC_OBJ_INDEX: + return "I40E_ERR_INVALID_HMC_OBJ_INDEX"; + case I40E_ERR_INVALID_HMC_OBJ_COUNT: + return "I40E_ERR_INVALID_HMC_OBJ_COUNT"; + case I40E_ERR_INVALID_SRQ_ARM_LIMIT: + return "I40E_ERR_INVALID_SRQ_ARM_LIMIT"; + case I40E_ERR_SRQ_ENABLED: + return "I40E_ERR_SRQ_ENABLED"; + case I40E_ERR_ADMIN_QUEUE_ERROR: + return "I40E_ERR_ADMIN_QUEUE_ERROR"; + case I40E_ERR_ADMIN_QUEUE_TIMEOUT: + return "I40E_ERR_ADMIN_QUEUE_TIMEOUT"; + case I40E_ERR_BUF_TOO_SHORT: + return "I40E_ERR_BUF_TOO_SHORT"; + case I40E_ERR_ADMIN_QUEUE_FULL: + return "I40E_ERR_ADMIN_QUEUE_FULL"; + case I40E_ERR_ADMIN_QUEUE_NO_WORK: + return "I40E_ERR_ADMIN_QUEUE_NO_WORK"; + case I40E_ERR_BAD_IWARP_CQE: + return "I40E_ERR_BAD_IWARP_CQE"; + case I40E_ERR_NVM_BLANK_MODE: + return "I40E_ERR_NVM_BLANK_MODE"; + case I40E_ERR_NOT_IMPLEMENTED: + return "I40E_ERR_NOT_IMPLEMENTED"; + case I40E_ERR_PE_DOORBELL_NOT_ENABLED: + return "I40E_ERR_PE_DOORBELL_NOT_ENABLED"; + case I40E_ERR_DIAG_TEST_FAILED: + return "I40E_ERR_DIAG_TEST_FAILED"; + case I40E_ERR_NOT_READY: + return "I40E_ERR_NOT_READY"; + case I40E_NOT_SUPPORTED: + return "I40E_NOT_SUPPORTED"; + case I40E_ERR_FIRMWARE_API_VERSION: + return "I40E_ERR_FIRMWARE_API_VERSION"; + } + + snprintf(hw->err_str, sizeof(hw->err_str), "%d", stat_err); + return hw->err_str; +} + +/** * i40e_debug_aq * @hw: debug mask related to admin queue * @mask: debug mask @@ -154,9 +375,13 @@ void i40e_debug_aq(struct i40e_hw *hw, e bool i40e_check_asq_alive(struct i40e_hw *hw) { if (hw->aq.asq.len) - return !!(rd32(hw, hw->aq.asq.len) & I40E_PF_ATQLEN_ATQENABLE_MASK); - else - return FALSE; + if (!i40e_is_vf(hw)) + return !!(rd32(hw, hw->aq.asq.len) & + I40E_PF_ATQLEN_ATQENABLE_MASK); + if (i40e_is_vf(hw)) + return !!(rd32(hw, hw->aq.asq.len) & + I40E_VF_ATQLEN1_ATQENABLE_MASK); + return FALSE; } /** @@ -184,6 +409,171 @@ enum i40e_status_code i40e_aq_queue_shut return status; } +#ifdef X722_SUPPORT + +/** + * i40e_aq_get_set_rss_lut + * @hw: pointer to the hardware structure + * @vsi_id: vsi fw index + * @pf_lut: for PF table set TRUE, for VSI table set FALSE + * @lut: pointer to the lut buffer provided by the caller + * @lut_size: size of the lut buffer + * @set: set TRUE to set the table, FALSE to get the table + * + * Internal function to get or set RSS look up table + **/ +static enum i40e_status_code i40e_aq_get_set_rss_lut(struct i40e_hw *hw, + u16 vsi_id, bool pf_lut, + u8 *lut, u16 lut_size, + bool set) +{ + enum i40e_status_code status; + struct i40e_aq_desc desc; + struct i40e_aqc_get_set_rss_lut *cmd_resp = + (struct i40e_aqc_get_set_rss_lut *)&desc.params.raw; + + if (set) + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_set_rss_lut); + else + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_get_rss_lut); + + /* Indirect command */ + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_RD); + + cmd_resp->vsi_id = + CPU_TO_LE16((u16)((vsi_id << + I40E_AQC_SET_RSS_LUT_VSI_ID_SHIFT) & + I40E_AQC_SET_RSS_LUT_VSI_ID_MASK)); + cmd_resp->vsi_id |= CPU_TO_LE16((u16)I40E_AQC_SET_RSS_LUT_VSI_VALID); + + if (pf_lut) + cmd_resp->flags |= CPU_TO_LE16((u16) + ((I40E_AQC_SET_RSS_LUT_TABLE_TYPE_PF << + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) & + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK)); + else + cmd_resp->flags |= CPU_TO_LE16((u16) + ((I40E_AQC_SET_RSS_LUT_TABLE_TYPE_VSI << + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_SHIFT) & + I40E_AQC_SET_RSS_LUT_TABLE_TYPE_MASK)); + + cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)lut)); + cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)lut)); + + status = i40e_asq_send_command(hw, &desc, lut, lut_size, NULL); + + return status; +} + +/** + * i40e_aq_get_rss_lut + * @hw: pointer to the hardware structure + * @vsi_id: vsi fw index + * @pf_lut: for PF table set TRUE, for VSI table set FALSE + * @lut: pointer to the lut buffer provided by the caller + * @lut_size: size of the lut buffer + * + * get the RSS lookup table, PF or VSI type + **/ +enum i40e_status_code i40e_aq_get_rss_lut(struct i40e_hw *hw, u16 vsi_id, + bool pf_lut, u8 *lut, u16 lut_size) +{ + return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, + FALSE); +} + +/** + * i40e_aq_set_rss_lut + * @hw: pointer to the hardware structure + * @vsi_id: vsi fw index + * @pf_lut: for PF table set TRUE, for VSI table set FALSE + * @lut: pointer to the lut buffer provided by the caller + * @lut_size: size of the lut buffer + * + * set the RSS lookup table, PF or VSI type + **/ +enum i40e_status_code i40e_aq_set_rss_lut(struct i40e_hw *hw, u16 vsi_id, + bool pf_lut, u8 *lut, u16 lut_size) +{ + return i40e_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size, TRUE); +} + +/** + * i40e_aq_get_set_rss_key + * @hw: pointer to the hw struct + * @vsi_id: vsi fw index + * @key: pointer to key info struct + * @set: set TRUE to set the key, FALSE to get the key + * + * get the RSS key per VSI + **/ +static enum i40e_status_code i40e_aq_get_set_rss_key(struct i40e_hw *hw, + u16 vsi_id, + struct i40e_aqc_get_set_rss_key_data *key, + bool set) +{ + enum i40e_status_code status; + struct i40e_aq_desc desc; + struct i40e_aqc_get_set_rss_key *cmd_resp = + (struct i40e_aqc_get_set_rss_key *)&desc.params.raw; + u16 key_size = sizeof(struct i40e_aqc_get_set_rss_key_data); + + if (set) + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_set_rss_key); + else + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_get_rss_key); + + /* Indirect command */ + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_BUF); + desc.flags |= CPU_TO_LE16((u16)I40E_AQ_FLAG_RD); + + cmd_resp->vsi_id = + CPU_TO_LE16((u16)((vsi_id << + I40E_AQC_SET_RSS_KEY_VSI_ID_SHIFT) & + I40E_AQC_SET_RSS_KEY_VSI_ID_MASK)); + cmd_resp->vsi_id |= CPU_TO_LE16((u16)I40E_AQC_SET_RSS_KEY_VSI_VALID); + cmd_resp->addr_high = CPU_TO_LE32(I40E_HI_WORD((u64)key)); + cmd_resp->addr_low = CPU_TO_LE32(I40E_LO_DWORD((u64)key)); + + status = i40e_asq_send_command(hw, &desc, key, key_size, NULL); + + return status; +} + +/** + * i40e_aq_get_rss_key + * @hw: pointer to the hw struct + * @vsi_id: vsi fw index + * @key: pointer to key info struct + * + **/ +enum i40e_status_code i40e_aq_get_rss_key(struct i40e_hw *hw, + u16 vsi_id, + struct i40e_aqc_get_set_rss_key_data *key) +{ + return i40e_aq_get_set_rss_key(hw, vsi_id, key, FALSE); +} + +/** + * i40e_aq_set_rss_key + * @hw: pointer to the hw struct + * @vsi_id: vsi fw index + * @key: pointer to key info struct + * + * set the RSS key per VSI + **/ +enum i40e_status_code i40e_aq_set_rss_key(struct i40e_hw *hw, + u16 vsi_id, + struct i40e_aqc_get_set_rss_key_data *key) +{ + return i40e_aq_get_set_rss_key(hw, vsi_id, key, TRUE); +} +#endif /* X722_SUPPORT */ /* The i40e_ptype_lookup table is used to convert from the 8-bit ptype in the * hardware to a bit-field that can be used by SW to more easily determine the @@ -598,6 +988,9 @@ enum i40e_status_code i40e_init_shared_c switch (hw->mac.type) { case I40E_MAC_XL710: +#ifdef X722_SUPPORT + case I40E_MAC_X722: +#endif break; default: return I40E_ERR_DEVICE_NOT_SUPPORTED; @@ -888,7 +1281,7 @@ enum i40e_status_code i40e_pf_reset(stru grst_del = (rd32(hw, I40E_GLGEN_RSTCTL) & I40E_GLGEN_RSTCTL_GRSTDEL_MASK) >> I40E_GLGEN_RSTCTL_GRSTDEL_SHIFT; - for (cnt = 0; cnt < grst_del + 2; cnt++) { + for (cnt = 0; cnt < grst_del + 10; cnt++) { reg = rd32(hw, I40E_GLGEN_RSTAT); if (!(reg & I40E_GLGEN_RSTAT_DEVSTATE_MASK)) break; @@ -1108,9 +1501,11 @@ u32 i40e_led_get(struct i40e_hw *hw) if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity LEDs */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> - I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); + /* ignore gpio LED src mode entries related to the activity + * LEDs + */ + current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) + >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); switch (current_mode) { case I40E_COMBINED_ACTIVITY: case I40E_FILTER_ACTIVITY: @@ -1154,9 +1549,11 @@ void i40e_led_set(struct i40e_hw *hw, u3 if (!gpio_val) continue; - /* ignore gpio LED src mode entries related to the activity LEDs */ - current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) >> - I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); + /* ignore gpio LED src mode entries related to the activity + * LEDs + */ + current_mode = ((gpio_val & I40E_GLGEN_GPIO_CTL_LED_MODE_MASK) + >> I40E_GLGEN_GPIO_CTL_LED_MODE_SHIFT); switch (current_mode) { case I40E_COMBINED_ACTIVITY: case I40E_FILTER_ACTIVITY: @@ -1175,9 +1572,9 @@ void i40e_led_set(struct i40e_hw *hw, u3 blink = FALSE; if (blink) - gpio_val |= (1 << I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); + gpio_val |= BIT(I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); else - gpio_val &= ~(1 << I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); + gpio_val &= ~BIT(I40E_GLGEN_GPIO_CTL_LED_BLINK_SHIFT); wr32(hw, I40E_GLGEN_GPIO_CTL(i), gpio_val); break; @@ -1329,14 +1726,14 @@ enum i40e_status_code i40e_set_fc(struct *aq_failures |= I40E_SET_FC_AQ_FAIL_SET; } /* Update the link info */ - status = i40e_aq_get_link_info(hw, TRUE, NULL, NULL); + status = i40e_update_link_info(hw); if (status) { /* Wait a little bit (on 40G cards it sometimes takes a really * long time for link to come back from the atomic reset) * and try once more */ i40e_msec_delay(1000); - status = i40e_aq_get_link_info(hw, TRUE, NULL, NULL); + status = i40e_update_link_info(hw); } if (status) *aq_failures |= I40E_SET_FC_AQ_FAIL_UPDATE; @@ -1525,7 +1922,6 @@ aq_get_link_info_exit: return status; } - /** * i40e_aq_set_phy_int_mask * @hw: pointer to the hw struct @@ -1837,6 +2233,74 @@ enum i40e_status_code i40e_aq_set_vsi_mu } /** + * i40e_aq_set_vsi_mc_promisc_on_vlan + * @hw: pointer to the hw struct + * @seid: vsi number + * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN + * @vid: The VLAN tag filter - capture any multicast packet with this VLAN tag + * @cmd_details: pointer to command details structure or NULL + **/ +enum i40e_status_code i40e_aq_set_vsi_mc_promisc_on_vlan(struct i40e_hw *hw, + u16 seid, bool enable, u16 vid, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_set_vsi_promiscuous_modes *cmd = + (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; + enum i40e_status_code status; + u16 flags = 0; + + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_set_vsi_promiscuous_modes); + + if (enable) + flags |= I40E_AQC_SET_VSI_PROMISC_MULTICAST; + + cmd->promiscuous_flags = CPU_TO_LE16(flags); + cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_MULTICAST); + cmd->seid = CPU_TO_LE16(seid); + cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + +/** + * i40e_aq_set_vsi_uc_promisc_on_vlan + * @hw: pointer to the hw struct + * @seid: vsi number + * @enable: set MAC L2 layer unicast promiscuous enable/disable for a given VLAN + * @vid: The VLAN tag filter - capture any unicast packet with this VLAN tag + * @cmd_details: pointer to command details structure or NULL + **/ +enum i40e_status_code i40e_aq_set_vsi_uc_promisc_on_vlan(struct i40e_hw *hw, + u16 seid, bool enable, u16 vid, + struct i40e_asq_cmd_details *cmd_details) +{ + struct i40e_aq_desc desc; + struct i40e_aqc_set_vsi_promiscuous_modes *cmd = + (struct i40e_aqc_set_vsi_promiscuous_modes *)&desc.params.raw; + enum i40e_status_code status; + u16 flags = 0; + + i40e_fill_default_direct_cmd_desc(&desc, + i40e_aqc_opc_set_vsi_promiscuous_modes); + + if (enable) + flags |= I40E_AQC_SET_VSI_PROMISC_UNICAST; + + cmd->promiscuous_flags = CPU_TO_LE16(flags); + cmd->valid_flags = CPU_TO_LE16(I40E_AQC_SET_VSI_PROMISC_UNICAST); + cmd->seid = CPU_TO_LE16(seid); + cmd->vlan_tag = CPU_TO_LE16(vid | I40E_AQC_SET_VSI_VLAN_VALID); + + status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details); + + return status; +} + +/** * i40e_aq_set_vsi_broadcast * @hw: pointer to the hw struct * @seid: vsi number @@ -2067,30 +2531,56 @@ enum i40e_status_code i40e_aq_send_drive /** * i40e_get_link_status - get status of the HW network link * @hw: pointer to the hw struct + * @link_up: pointer to bool (TRUE/FALSE = linkup/linkdown) * - * Returns TRUE if link is up, FALSE if link is down. + * Variable link_up TRUE if link is up, FALSE if link is down. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 11 13:12:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D1719D728F; Fri, 11 Dec 2015 13:12:53 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E08B1E8B; Fri, 11 Dec 2015 13:12:53 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBDCqqb062183; Fri, 11 Dec 2015 13:12:52 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBDCqEo062182; Fri, 11 Dec 2015 13:12:52 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512111312.tBBDCqEo062182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 11 Dec 2015 13:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292101 - stable/10/sys/dev/ixl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 13:12:53 -0000 Author: smh Date: Fri Dec 11 13:12:52 2015 New Revision: 292101 URL: https://svnweb.freebsd.org/changeset/base/292101 Log: MFC r285768: LAA MAC/VLAN filter + success check Sponsored by: Multiplay Modified: stable/10/sys/dev/ixl/if_ixl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixl/if_ixl.c ============================================================================== --- stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 13:08:38 2015 (r292100) +++ stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 13:12:52 2015 (r292101) @@ -1140,7 +1140,8 @@ ixl_init_locked(struct ixl_pf *pf) bcopy(IF_LLADDR(vsi->ifp), tmpaddr, I40E_ETH_LENGTH_OF_ADDRESS); if (!cmp_etheraddr(hw->mac.addr, tmpaddr) && - i40e_validate_mac_addr(tmpaddr)) { + (i40e_validate_mac_addr(tmpaddr) == I40E_SUCCESS)) { + ixl_del_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); bcopy(tmpaddr, hw->mac.addr, I40E_ETH_LENGTH_OF_ADDRESS); ret = i40e_aq_mac_address_write(hw, @@ -1150,6 +1151,8 @@ ixl_init_locked(struct ixl_pf *pf) device_printf(dev, "LLA address" "change failed!!\n"); return; + } else { + ixl_add_filter(vsi, hw->mac.addr, IXL_VLAN_ANY); } } From owner-svn-src-all@freebsd.org Fri Dec 11 13:15:23 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 935469D74A8; Fri, 11 Dec 2015 13:15:23 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5FDEC10A3; Fri, 11 Dec 2015 13:15:23 +0000 (UTC) (envelope-from smh@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBDFMIF062329; Fri, 11 Dec 2015 13:15:22 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBDFMrL062328; Fri, 11 Dec 2015 13:15:22 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201512111315.tBBDFMrL062328@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Fri, 11 Dec 2015 13:15:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292102 - stable/10/sys/dev/ixl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 13:15:23 -0000 Author: smh Date: Fri Dec 11 13:15:22 2015 New Revision: 292102 URL: https://svnweb.freebsd.org/changeset/base/292102 Log: MFC r289231: Fix used function warnings in ixl(4) Sponsored by: Multiplay Modified: stable/10/sys/dev/ixl/if_ixl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixl/if_ixl.c ============================================================================== --- stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 13:12:52 2015 (r292101) +++ stable/10/sys/dev/ixl/if_ixl.c Fri Dec 11 13:15:22 2015 (r292102) @@ -159,8 +159,10 @@ static void ixl_free_mac_filters(struct /* Sysctl debug interface */ +#ifdef IXL_DEBUG_SYSCTL static int ixl_debug_info(SYSCTL_HANDLER_ARGS); static void ixl_print_debug_info(struct ixl_pf *); +#endif /* The MSI/X Interrupt handlers */ static void ixl_intr(void *); @@ -4368,6 +4370,7 @@ ixl_do_adminq(void *context, int pending IXL_PF_UNLOCK(pf); } +#ifdef IXL_DEBUG_SYSCTL static int ixl_debug_info(SYSCTL_HANDLER_ARGS) { @@ -4432,6 +4435,7 @@ ixl_print_debug_info(struct ixl_pf *pf) reg = rd32(hw, I40E_GLPRT_MLFC(hw->port)); printf("mac local fault = %x\n", reg); } +#endif /** * Update VSI-specific ethernet statistics counters. From owner-svn-src-all@freebsd.org Fri Dec 11 13:19:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FDE99D7752; Fri, 11 Dec 2015 13:19:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D5831352; Fri, 11 Dec 2015 13:19:34 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBDJXoC062552; Fri, 11 Dec 2015 13:19:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBDJXxF062551; Fri, 11 Dec 2015 13:19:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512111319.tBBDJXxF062551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 11 Dec 2015 13:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292103 - stable/10/sys/ofed/include/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 13:19:34 -0000 Author: hselasky Date: Fri Dec 11 13:19:33 2015 New Revision: 292103 URL: https://svnweb.freebsd.org/changeset/base/292103 Log: MFC r291690: Remove incorrect defines. The proper version of these macros is defined in linux/etherdevice.h. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/include/linux/compat.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/compat.h ============================================================================== --- stable/10/sys/ofed/include/linux/compat.h Fri Dec 11 13:15:22 2015 (r292102) +++ stable/10/sys/ofed/include/linux/compat.h Fri Dec 11 13:19:33 2015 (r292103) @@ -30,8 +30,4 @@ #ifndef _LINUX_COMPAT_H_ #define _LINUX_COMPAT_H_ -#define is_multicast_ether_addr(x) 0 -#define is_broadcast_ether_addr(x) 0 - - #endif /* _LINUX_COMPAT_H_ */ From owner-svn-src-all@freebsd.org Fri Dec 11 13:20:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EB6F9D79BB; Fri, 11 Dec 2015 13:20:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F403C177F; Fri, 11 Dec 2015 13:20:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBDKq0k062848; Fri, 11 Dec 2015 13:20:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBDKq2x062847; Fri, 11 Dec 2015 13:20:52 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512111320.tBBDKq2x062847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 11 Dec 2015 13:20:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292104 - stable/10/sys/vm X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 13:20:53 -0000 Author: kib Date: Fri Dec 11 13:20:51 2015 New Revision: 292104 URL: https://svnweb.freebsd.org/changeset/base/292104 Log: MFC r291408: In vm_pageout_grow_cache(), do not re-try the inactive queue when active queue scan initiated write, to avoid infinite loop. Modified: stable/10/sys/vm/vm_pageout.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/vm/vm_pageout.c ============================================================================== --- stable/10/sys/vm/vm_pageout.c Fri Dec 11 13:19:33 2015 (r292103) +++ stable/10/sys/vm/vm_pageout.c Fri Dec 11 13:20:51 2015 (r292104) @@ -728,32 +728,33 @@ vm_pageout_grow_cache(int tries, vm_padd * the specified address range, as indicated by segments * constituting the domain. */ -again: +again_inact: if (inactl < inactmax) { if (vm_phys_domain_intersects(vm_dom[dom].vmd_segs, low, high) && vm_pageout_launder(&vm_dom[dom].vmd_pagequeues[PQ_INACTIVE], tries, low, high)) { inactl++; - goto again; + goto again_inact; } if (++dom == vm_ndomains) dom = 0; if (dom != initial_dom) - goto again; + goto again_inact; } +again_act: if (actl < actmax) { if (vm_phys_domain_intersects(vm_dom[dom].vmd_segs, low, high) && vm_pageout_launder(&vm_dom[dom].vmd_pagequeues[PQ_ACTIVE], tries, low, high)) { actl++; - goto again; + goto again_act; } if (++dom == vm_ndomains) dom = 0; if (dom != initial_dom) - goto again; + goto again_act; } } From owner-svn-src-all@freebsd.org Fri Dec 11 13:24:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFA979D7DE4; Fri, 11 Dec 2015 13:24:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AE6A1C0D; Fri, 11 Dec 2015 13:24:43 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id tBBDObtx050885 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Fri, 11 Dec 2015 15:24:38 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua tBBDObtx050885 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id tBBDObHY050851; Fri, 11 Dec 2015 15:24:37 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 11 Dec 2015 15:24:37 +0200 From: Konstantin Belousov To: Oliver Pinter Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r291171 - in head/sys: amd64/amd64 compat/ia32 i386/i386 kern sys Message-ID: <20151211132437.GH82577@kib.kiev.ua> References: <201511230709.tAN79Z4L062228@repo.freebsd.org> <20151210213324.GF82577@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) 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 autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 13:24:44 -0000 On Thu, Dec 10, 2015 at 10:48:11PM +0100, Oliver Pinter wrote: > On Thursday, December 10, 2015, Konstantin Belousov > wrote: > > > On Thu, Dec 10, 2015 at 10:18:19PM +0100, Oliver Pinter wrote: > > > On Mon, Nov 23, 2015 at 8:09 AM, Konstantin Belousov > > wrote: > > > > Author: kib > > > > Date: Mon Nov 23 07:09:35 2015 > > > > New Revision: 291171 > > > > URL: https://svnweb.freebsd.org/changeset/base/291171 > > > > > > > > Log: > > > > Split kerne timekeep ABI structure vdso_sv_tk out of the struct > > > > sysentvec. This allows the timekeep data to be shared between > > similar > > > > ABIs which cannot share sysentvec. > > > > > > > > Make the timekeep_push_vdso() tick callback to the timekeep > > structures > > > > instead of sysentvecs. If several sysentvec share the vdso_sv_tk > > > > structure, we would update the userspace data several times on each > > > > tick, without the change. > > > > > > > > Only allocate vdso_sv_tk in the exec_sysvec_init() sysinit when > > > > sysentvec is marked with the new SV_TIMEKEEP flag. This saves > > > > allocation and update of unneeded vdso_sv_tk for ABIs which do not > > > > provide userspace gettimeofday yet, which are PowerPCs arches right > > > > now. > > > > > > > > Make vdso_sv_tk allocator public, namely split out and export > > > > alloc_sv_tk() and alloc_sv_tk_compat32(). ABIs which share timekeep > > > > data now can allocate it manually and share as appropriate. > > > > > > > > Requested by: nwhitehorn > > > > Tested by: nwhitehorn, pho > > > > Sponsored by: The FreeBSD Foundation > > > > MFC after: 2 weeks > > > > > > Hello Konstantin! > > > > > > Do you plan to MFC back this changes to 10-STABLE in these days? > > > > I decided to not merge the change. > > > > And if I'm not wrong, the rationale behind this decision is the type > stability of struct sysvec / sysent. You are wrong. The modules which use sysentvec are marked as DECLARE_MODULE_TIED(), to designate them as requiring kernel of exactly same version due to KBI issues. I.e. the merge would indeed break KBI, but KBI breakage there is expected and considered acceptable on the stable branch. Mainly, the affected modules are ABI emulators (linux.ko and similar). I got demotivated to merge a prerequisite changes which modified code in kern_sharedpage.c, and do not want to obliterate the code and history on stable/10 with 'fake' merge. This makes the revision you asked about non-mergeable. From owner-svn-src-all@freebsd.org Fri Dec 11 13:30:50 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 924389D8276; Fri, 11 Dec 2015 13:30:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65C241068; Fri, 11 Dec 2015 13:30:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBDUnF2065983; Fri, 11 Dec 2015 13:30:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBDUnpf065982; Fri, 11 Dec 2015 13:30:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512111330.tBBDUnpf065982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 11 Dec 2015 13:30:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292105 - stable/10/sys/ofed/include/linux X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 13:30:50 -0000 Author: hselasky Date: Fri Dec 11 13:30:49 2015 New Revision: 292105 URL: https://svnweb.freebsd.org/changeset/base/292105 Log: MFC r291693: Add some structures and defines which will be used when decoding small form factor, SFF, standards compliant ethernet EEPROMs. Obtained from: Linux Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/include/linux/etherdevice.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/ofed/include/linux/etherdevice.h ============================================================================== --- stable/10/sys/ofed/include/linux/etherdevice.h Fri Dec 11 13:20:51 2015 (r292104) +++ stable/10/sys/ofed/include/linux/etherdevice.h Fri Dec 11 13:30:49 2015 (r292105) @@ -37,6 +37,25 @@ #include +#define ETH_MODULE_SFF_8079 1 +#define ETH_MODULE_SFF_8079_LEN 256 +#define ETH_MODULE_SFF_8472 2 +#define ETH_MODULE_SFF_8472_LEN 512 +#define ETH_MODULE_SFF_8636 3 +#define ETH_MODULE_SFF_8636_LEN 256 +#define ETH_MODULE_SFF_8436 4 +#define ETH_MODULE_SFF_8436_LEN 256 + +struct ethtool_eeprom { + u32 offset; + u32 len; +}; + +struct ethtool_modinfo { + u32 type; + u32 eeprom_len; +}; + /** * is_zero_ether_addr - Determine if give Ethernet address is all zeros. * @addr: Pointer to a six-byte array containing the Ethernet address From owner-svn-src-all@freebsd.org Fri Dec 11 13:55:33 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 156DA9D733E; Fri, 11 Dec 2015 13:55:33 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D7D481410; Fri, 11 Dec 2015 13:55:32 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBDtVHI075989; Fri, 11 Dec 2015 13:55:31 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBDtVF4075988; Fri, 11 Dec 2015 13:55:31 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512111355.tBBDtVF4075988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 11 Dec 2015 13:55:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292106 - head/usr.sbin/crunch/crunchide X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 13:55:33 -0000 Author: emaste Date: Fri Dec 11 13:55:31 2015 New Revision: 292106 URL: https://svnweb.freebsd.org/changeset/base/292106 Log: crunchide: add RISC-V to supported machine types MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c Modified: head/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- head/usr.sbin/crunch/crunchide/exec_elf32.c Fri Dec 11 13:30:49 2015 (r292105) +++ head/usr.sbin/crunch/crunchide/exec_elf32.c Fri Dec 11 13:55:31 2015 (r292106) @@ -187,6 +187,10 @@ ELFNAMEEND(check)(int fd, const char *fn case /* EM_MIPS_RS3_LE */ EM_MIPS_RS4_BE: break; case EM_PPC: break; case EM_PPC64: break; +#ifndef EM_RISCV +#define EM_RISCV 243 +#endif + case EM_RISCV: break; case EM_SPARCV9: break; case EM_X86_64: break; /* ELFDEFNNAME(MACHDEP_ID_CASES) */ From owner-svn-src-all@freebsd.org Fri Dec 11 14:21:59 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F04D69D8725; Fri, 11 Dec 2015 14:21:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94496177C; Fri, 11 Dec 2015 14:21:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBELwTn085723; Fri, 11 Dec 2015 14:21:58 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBELwVD085718; Fri, 11 Dec 2015 14:21:58 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512111421.tBBELwVD085718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 11 Dec 2015 14:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292107 - in stable/10/sys: modules/mlxen ofed/drivers/net/mlx4 ofed/include/linux/mlx4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 14:22:00 -0000 Author: hselasky Date: Fri Dec 11 14:21:58 2015 New Revision: 292107 URL: https://svnweb.freebsd.org/changeset/base/292107 Log: MFC r290710, r291694, r291699 and r291793: - Fix print formatting compile warnings for Sparc64 and PowerPC platforms. - Updated the mlx4 and mlxen drivers to the latest version, v2.1.6: - Added support for dumping the SFP EEPROM content to dmesg. - Fixed handling of network interface capability IOCTLs. - Fixed race when loading and unloading the mlxen driver by applying appropriate locking. - Removed two unused C-files. - Convert the mlxen driver to use the BUSDMA(9) APIs instead of vtophys() when loading mbufs for transmission and reception. While at it all pointer arithmetic and cast qualifier issues were fixed, mostly related to transmission and reception. - Fix i386 build WITH_OFED=YES. Remove some redundant KASSERTs. Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4283 Differential Revision: https://reviews.freebsd.org/D4284 Deleted: stable/10/sys/ofed/drivers/net/mlx4/en_ethtool.c stable/10/sys/ofed/drivers/net/mlx4/en_selftest.c Modified: stable/10/sys/modules/mlxen/Makefile stable/10/sys/ofed/drivers/net/mlx4/en_main.c stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c stable/10/sys/ofed/drivers/net/mlx4/en_port.c stable/10/sys/ofed/drivers/net/mlx4/en_rx.c stable/10/sys/ofed/drivers/net/mlx4/en_tx.c stable/10/sys/ofed/drivers/net/mlx4/main.c stable/10/sys/ofed/drivers/net/mlx4/mlx4.h stable/10/sys/ofed/drivers/net/mlx4/mlx4_en.h stable/10/sys/ofed/drivers/net/mlx4/mlx4_stats.h stable/10/sys/ofed/drivers/net/mlx4/port.c stable/10/sys/ofed/include/linux/mlx4/cq.h stable/10/sys/ofed/include/linux/mlx4/device.h stable/10/sys/ofed/include/linux/mlx4/doorbell.h stable/10/sys/ofed/include/linux/mlx4/qp.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/modules/mlxen/Makefile ============================================================================== --- stable/10/sys/modules/mlxen/Makefile Fri Dec 11 13:55:31 2015 (r292106) +++ stable/10/sys/modules/mlxen/Makefile Fri Dec 11 14:21:58 2015 (r292107) @@ -26,4 +26,4 @@ opt_inet6.h: .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +CFLAGS+= ${GCC_MS_EXTENSIONS} Modified: stable/10/sys/ofed/drivers/net/mlx4/en_main.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_main.c Fri Dec 11 13:55:31 2015 (r292106) +++ stable/10/sys/ofed/drivers/net/mlx4/en_main.c Fri Dec 11 14:21:58 2015 (r292107) @@ -42,14 +42,7 @@ #include "mlx4_en.h" -MODULE_AUTHOR("Liran Liss, Yevgeny Petrilin"); -MODULE_DESCRIPTION("Mellanox ConnectX HCA Ethernet driver"); -MODULE_LICENSE("Dual BSD/GPL"); -MODULE_VERSION(DRV_VERSION " ("DRV_RELDATE")"); - -static const char mlx4_en_version[] = - DRV_NAME ": Mellanox ConnectX HCA Ethernet driver v" - DRV_VERSION " (" DRV_RELDATE ")\n"; +/* Mellanox ConnectX HCA Ethernet driver */ #define MLX4_EN_PARM_INT(X, def_val, desc) \ static unsigned int X = def_val;\ @@ -174,8 +167,6 @@ static void *mlx4_en_add(struct mlx4_dev int i; int err; - printk_once(KERN_INFO "%s", mlx4_en_version); - mdev = kzalloc(sizeof *mdev, GFP_KERNEL); if (!mdev) { dev_err(&dev->pdev->dev, "Device struct alloc failed, " Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Fri Dec 11 13:55:31 2015 (r292106) +++ stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Fri Dec 11 14:21:58 2015 (r292107) @@ -659,8 +659,10 @@ static void mlx4_en_cache_mclist(struct continue; /* Make sure the list didn't grow. */ tmp = kzalloc(sizeof(struct mlx4_en_mc_list), GFP_ATOMIC); - if (tmp == NULL) + if (tmp == NULL) { + en_err(priv, "Failed to allocate multicast list\n"); break; + } memcpy(tmp->addr, LLADDR((struct sockaddr_dl *)ifma->ifma_addr), ETH_ALEN); list_add_tail(&tmp->list, &priv->mc_list); @@ -971,12 +973,12 @@ static void mlx4_en_do_set_rx_mode(struc if (!mlx4_en_QUERY_PORT(mdev, priv->port)) { if (priv->port_state.link_state) { priv->last_link_state = MLX4_DEV_EVENT_PORT_UP; - /* Important note: the following call for if_link_state_change - * is needed for interface up scenario (start port, link state - * change) */ /* update netif baudrate */ priv->dev->if_baudrate = IF_Mbps(priv->port_state.link_speed); + /* Important note: the following call for if_link_state_change + * is needed for interface up scenario (start port, link state + * change) */ if_link_state_change(priv->dev, LINK_STATE_UP); en_dbg(HW, priv, "Link Up\n"); } @@ -1196,8 +1198,8 @@ static void mlx4_en_linkstate(struct wor /* update netif baudrate */ priv->dev->if_baudrate = 0; - /* make sure the port is up before notifying the OS. - * This is tricky since we get here on INIT_PORT and + /* make sure the port is up before notifying the OS. + * This is tricky since we get here on INIT_PORT and * in such case we can't tell the OS the port is up. * To solve this there is a call to if_link_state_change * in set_rx_mode. @@ -1246,7 +1248,6 @@ int mlx4_en_start_port(struct net_device PAGE_SIZE); priv->rx_alloc_order = get_order(priv->rx_alloc_size); priv->rx_buf_size = roundup_pow_of_two(priv->rx_mb_size); - priv->log_rx_info = ROUNDUP_LOG2(sizeof(struct mlx4_en_rx_buf)); en_dbg(DRV, priv, "Rx buf size:%d\n", priv->rx_mb_size); /* Configure rx cq's and rings */ @@ -1575,6 +1576,7 @@ static void mlx4_en_clear_stats(struct n priv->tx_ring[i]->bytes = 0; priv->tx_ring[i]->packets = 0; priv->tx_ring[i]->tx_csum = 0; + priv->tx_ring[i]->oversized_packets = 0; } for (i = 0; i < priv->rx_ring_num; i++) { priv->rx_ring[i]->bytes = 0; @@ -1644,8 +1646,6 @@ void mlx4_en_free_resources(struct mlx4_ if (priv->sysctl) sysctl_ctx_free(&priv->stat_ctx); - - } int mlx4_en_alloc_resources(struct mlx4_en_priv *priv) @@ -1730,8 +1730,11 @@ void mlx4_en_destroy_netdev(struct net_d EVENTHANDLER_DEREGISTER(vlan_unconfig, priv->vlan_detach); /* Unregister device - this will close the port if it was up */ - if (priv->registered) + if (priv->registered) { + mutex_lock(&mdev->state_lock); ether_ifdetach(dev); + mutex_unlock(&mdev->state_lock); + } if (priv->allocated) mlx4_free_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE); @@ -1809,13 +1812,6 @@ static int mlx4_en_calc_media(struct mlx active = IFM_ETHER; if (priv->last_link_state == MLX4_DEV_EVENT_PORT_DOWN) return (active); - /* - * [ShaharK] mlx4_en_QUERY_PORT sleeps and cannot be called under a - * non-sleepable lock. - * I moved it to the periodic mlx4_en_do_get_stats. - if (mlx4_en_QUERY_PORT(priv->mdev, priv->port)) - return (active); - */ active |= IFM_FDX; trans_type = priv->port_state.transciver; /* XXX I don't know all of the transceiver values. */ @@ -1948,12 +1944,55 @@ static int mlx4_en_ioctl(struct ifnet *d case SIOCSIFCAP: mutex_lock(&mdev->state_lock); mask = ifr->ifr_reqcap ^ dev->if_capenable; - if (mask & IFCAP_HWCSUM) - dev->if_capenable ^= IFCAP_HWCSUM; - if (mask & IFCAP_TSO4) + if (mask & IFCAP_TXCSUM) { + dev->if_capenable ^= IFCAP_TXCSUM; + dev->if_hwassist ^= (CSUM_TCP | CSUM_UDP | CSUM_IP); + + if (IFCAP_TSO4 & dev->if_capenable && + !(IFCAP_TXCSUM & dev->if_capenable)) { + dev->if_capenable &= ~IFCAP_TSO4; + dev->if_hwassist &= ~CSUM_IP_TSO; + if_printf(dev, + "tso4 disabled due to -txcsum.\n"); + } + } + if (mask & IFCAP_TXCSUM_IPV6) { + dev->if_capenable ^= IFCAP_TXCSUM_IPV6; + dev->if_hwassist ^= (CSUM_UDP_IPV6 | CSUM_TCP_IPV6); + + if (IFCAP_TSO6 & dev->if_capenable && + !(IFCAP_TXCSUM_IPV6 & dev->if_capenable)) { + dev->if_capenable &= ~IFCAP_TSO6; + dev->if_hwassist &= ~CSUM_IP6_TSO; + if_printf(dev, + "tso6 disabled due to -txcsum6.\n"); + } + } + if (mask & IFCAP_RXCSUM) + dev->if_capenable ^= IFCAP_RXCSUM; + if (mask & IFCAP_RXCSUM_IPV6) + dev->if_capenable ^= IFCAP_RXCSUM_IPV6; + + if (mask & IFCAP_TSO4) { + if (!(IFCAP_TSO4 & dev->if_capenable) && + !(IFCAP_TXCSUM & dev->if_capenable)) { + if_printf(dev, "enable txcsum first.\n"); + error = EAGAIN; + goto out; + } dev->if_capenable ^= IFCAP_TSO4; - if (mask & IFCAP_TSO6) + dev->if_hwassist ^= CSUM_IP_TSO; + } + if (mask & IFCAP_TSO6) { + if (!(IFCAP_TSO6 & dev->if_capenable) && + !(IFCAP_TXCSUM_IPV6 & dev->if_capenable)) { + if_printf(dev, "enable txcsum6 first.\n"); + error = EAGAIN; + goto out; + } dev->if_capenable ^= IFCAP_TSO6; + dev->if_hwassist ^= CSUM_IP6_TSO; + } if (mask & IFCAP_LRO) dev->if_capenable ^= IFCAP_LRO; if (mask & IFCAP_VLAN_HWTAGGING) @@ -1964,9 +2003,11 @@ static int mlx4_en_ioctl(struct ifnet *d dev->if_capenable ^= IFCAP_WOL_MAGIC; if (dev->if_drv_flags & IFF_DRV_RUNNING) mlx4_en_start_port(dev); +out: mutex_unlock(&mdev->state_lock); VLAN_CAPABILITIES(dev); break; +#if __FreeBSD_version >= 1100036 case SIOCGI2C: { struct ifi2creq i2c; @@ -1990,6 +2031,7 @@ static int mlx4_en_ioctl(struct ifnet *d error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); break; } +#endif default: error = ether_ioctl(dev, command, data); break; @@ -2049,8 +2091,6 @@ int mlx4_en_init_netdev(struct mlx4_en_d priv->port = port; priv->port_up = false; priv->flags = prof->flags; - priv->ctrl_flags = cpu_to_be32(MLX4_WQE_CTRL_CQ_UPDATE | - MLX4_WQE_CTRL_SOLICITED); priv->num_tx_rings_p_up = mdev->profile.num_tx_rings_p_up; priv->tx_ring_num = prof->tx_ring_num; @@ -2066,7 +2106,7 @@ int mlx4_en_init_netdev(struct mlx4_en_d err = -ENOMEM; goto out; } - + priv->rx_ring_num = prof->rx_ring_num; priv->cqe_factor = (mdev->dev->caps.cqe_size == 64) ? 1 : 0; priv->mac_index = -1; @@ -2089,7 +2129,6 @@ int mlx4_en_init_netdev(struct mlx4_en_d for (i = 0; i < MLX4_EN_MAC_HASH_SIZE; ++i) INIT_HLIST_HEAD(&priv->mac_hash[i]); - /* Query for default mac and max mtu */ priv->max_mtu = mdev->dev->caps.eth_mtu_cap[priv->port]; priv->mac = mdev->dev->caps.def_mac[priv->port]; @@ -2105,8 +2144,6 @@ int mlx4_en_init_netdev(struct mlx4_en_d goto out; } - - priv->stride = roundup_pow_of_two(sizeof(struct mlx4_en_rx_desc) + DS_SIZE); @@ -2128,7 +2165,7 @@ int mlx4_en_init_netdev(struct mlx4_en_d /* * Set driver features */ - dev->if_capabilities |= IFCAP_RXCSUM | IFCAP_TXCSUM; + dev->if_capabilities |= IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6; dev->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING; dev->if_capabilities |= IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWFILTER; dev->if_capabilities |= IFCAP_LINKSTATE | IFCAP_JUMBO_MTU; @@ -2137,10 +2174,12 @@ int mlx4_en_init_netdev(struct mlx4_en_d if (mdev->LSO_support) dev->if_capabilities |= IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTSO; +#if __FreeBSD_version >= 1100000 /* set TSO limits so that we don't have to drop TX packets */ - dev->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); - dev->if_hw_tsomaxsegcount = 16; - dev->if_hw_tsomaxsegsize = 65536; /* XXX can do up to 4GByte */ + dev->if_hw_tsomax = MLX4_EN_TX_MAX_PAYLOAD_SIZE - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN) /* hdr */; + dev->if_hw_tsomaxsegcount = MLX4_EN_TX_MAX_MBUF_FRAGS - 1 /* hdr */; + dev->if_hw_tsomaxsegsize = MLX4_EN_TX_MAX_MBUF_SIZE; +#endif dev->if_capenable = dev->if_capabilities; @@ -2149,6 +2188,8 @@ int mlx4_en_init_netdev(struct mlx4_en_d dev->if_hwassist |= CSUM_TSO; if (dev->if_capenable & IFCAP_TXCSUM) dev->if_hwassist |= (CSUM_TCP | CSUM_UDP | CSUM_IP); + if (dev->if_capenable & IFCAP_TXCSUM_IPV6) + dev->if_hwassist |= (CSUM_UDP_IPV6 | CSUM_TCP_IPV6); /* Register for VLAN events */ @@ -2211,8 +2252,6 @@ int mlx4_en_init_netdev(struct mlx4_en_d if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS) queue_delayed_work(mdev->workqueue, &priv->service_task, SERVICE_TASK_DELAY); - - return 0; out: @@ -2294,6 +2333,162 @@ static int mlx4_en_set_tx_ring_size(SYSC return (error); } +static int mlx4_en_get_module_info(struct net_device *dev, + struct ethtool_modinfo *modinfo) +{ + struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_dev *mdev = priv->mdev; + int ret; + u8 data[4]; + + /* Read first 2 bytes to get Module & REV ID */ + ret = mlx4_get_module_info(mdev->dev, priv->port, + 0/*offset*/, 2/*size*/, data); + + if (ret < 2) { + en_err(priv, "Failed to read eeprom module first two bytes, error: 0x%x\n", -ret); + return -EIO; + } + + switch (data[0] /* identifier */) { + case MLX4_MODULE_ID_QSFP: + modinfo->type = ETH_MODULE_SFF_8436; + modinfo->eeprom_len = ETH_MODULE_SFF_8436_LEN; + break; + case MLX4_MODULE_ID_QSFP_PLUS: + if (data[1] >= 0x3) { /* revision id */ + modinfo->type = ETH_MODULE_SFF_8636; + modinfo->eeprom_len = ETH_MODULE_SFF_8636_LEN; + } else { + modinfo->type = ETH_MODULE_SFF_8436; + modinfo->eeprom_len = ETH_MODULE_SFF_8436_LEN; + } + break; + case MLX4_MODULE_ID_QSFP28: + modinfo->type = ETH_MODULE_SFF_8636; + modinfo->eeprom_len = ETH_MODULE_SFF_8636_LEN; + break; + case MLX4_MODULE_ID_SFP: + modinfo->type = ETH_MODULE_SFF_8472; + modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN; + break; + default: + en_err(priv, "mlx4_en_get_module_info : Not recognized cable type\n"); + return -EINVAL; + } + + return 0; +} + +static int mlx4_en_get_module_eeprom(struct net_device *dev, + struct ethtool_eeprom *ee, + u8 *data) +{ + struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_dev *mdev = priv->mdev; + int offset = ee->offset; + int i = 0, ret; + + if (ee->len == 0) + return -EINVAL; + + memset(data, 0, ee->len); + + while (i < ee->len) { + en_dbg(DRV, priv, + "mlx4_get_module_info i(%d) offset(%d) len(%d)\n", + i, offset, ee->len - i); + + ret = mlx4_get_module_info(mdev->dev, priv->port, + offset, ee->len - i, data + i); + + if (!ret) /* Done reading */ + return 0; + + if (ret < 0) { + en_err(priv, + "mlx4_get_module_info i(%d) offset(%d) bytes_to_read(%d) - FAILED (0x%x)\n", + i, offset, ee->len - i, ret); + return -1; + } + + i += ret; + offset += ret; + } + return 0; +} + +static void mlx4_en_print_eeprom(u8 *data, __u32 len) +{ + int i; + int j = 0; + int row = 0; + const int NUM_OF_BYTES = 16; + + printf("\nOffset\t\tValues\n"); + printf("------\t\t------\n"); + while(row < len){ + printf("0x%04x\t\t",row); + for(i=0; i < NUM_OF_BYTES; i++){ + printf("%02x ", data[j]); + row++; + j++; + } + printf("\n"); + } +} + +/* Read cable EEPROM module information by first inspecting the first + * two bytes to get the length and then read the rest of the information. + * The information is printed to dmesg. */ +static int mlx4_en_read_eeprom(SYSCTL_HANDLER_ARGS) +{ + + u8* data; + int error; + int result = 0; + struct mlx4_en_priv *priv; + struct net_device *dev; + struct ethtool_modinfo modinfo; + struct ethtool_eeprom ee; + + error = sysctl_handle_int(oidp, &result, 0, req); + if (error || !req->newptr) + return (error); + + if (result == 1) { + priv = arg1; + dev = priv->dev; + data = kmalloc(PAGE_SIZE, GFP_KERNEL); + + error = mlx4_en_get_module_info(dev, &modinfo); + if (error) { + en_err(priv, + "mlx4_en_get_module_info returned with error - FAILED (0x%x)\n", + -error); + goto out; + } + + ee.len = modinfo.eeprom_len; + ee.offset = 0; + + error = mlx4_en_get_module_eeprom(dev, &ee, data); + if (error) { + en_err(priv, + "mlx4_en_get_module_eeprom returned with error - FAILED (0x%x)\n", + -error); + /* Continue printing partial information in case of an error */ + } + + /* EEPROM information will be printed in dmesg */ + mlx4_en_print_eeprom(data, ee.len); +out: + kfree(data); + } + /* Return zero to prevent sysctl failure. */ + return (0); +} + static int mlx4_en_set_tx_ppp(SYSCTL_HANDLER_ARGS) { struct mlx4_en_priv *priv; @@ -2419,7 +2614,7 @@ static void mlx4_en_sysctl_conf(struct m /* Add coalescer configuration. */ coal = SYSCTL_ADD_NODE(ctx, node_list, OID_AUTO, "coalesce", CTLFLAG_RD, NULL, "Interrupt coalesce configuration"); - coal_list = SYSCTL_CHILDREN(node); + coal_list = SYSCTL_CHILDREN(coal); SYSCTL_ADD_UINT(ctx, coal_list, OID_AUTO, "pkt_rate_low", CTLFLAG_RW, &priv->pkt_rate_low, 0, "Packets per-second for minimum delay"); @@ -2438,11 +2633,14 @@ static void mlx4_en_sysctl_conf(struct m SYSCTL_ADD_UINT(ctx, coal_list, OID_AUTO, "adaptive_rx_coal", CTLFLAG_RW, &priv->adaptive_rx_coal, 0, "Enable adaptive rx coalescing"); + /* EEPROM support */ + SYSCTL_ADD_PROC(ctx, node_list, OID_AUTO, "eeprom_info", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0, + mlx4_en_read_eeprom, "I", "EEPROM information"); } static void mlx4_en_sysctl_stat(struct mlx4_en_priv *priv) { - struct net_device *dev; struct sysctl_ctx_list *ctx; struct sysctl_oid *node; struct sysctl_oid_list *node_list; @@ -2453,8 +2651,6 @@ static void mlx4_en_sysctl_stat(struct m char namebuf[128]; int i; - dev = priv->dev; - ctx = &priv->stat_ctx; sysctl_ctx_init(ctx); node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(priv->sysctl), OID_AUTO, @@ -2482,6 +2678,8 @@ static void mlx4_en_sysctl_stat(struct m &priv->port_stats.wake_queue, "Queue resumed after full"); SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_timeout", CTLFLAG_RD, &priv->port_stats.tx_timeout, "Transmit timeouts"); + SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_oversized_packets", CTLFLAG_RD, + &priv->port_stats.oversized_packets, "TX oversized packets, m_defrag failed"); SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_alloc_failed", CTLFLAG_RD, &priv->port_stats.rx_alloc_failed, "RX failed to allocate mbuf"); SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_chksum_good", CTLFLAG_RD, @@ -2565,7 +2763,7 @@ struct mlx4_en_pkt_stats { SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_packets", CTLFLAG_RD, &priv->pkstats.tx_packets, "TX packets"); SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_bytes", CTLFLAG_RD, - &priv->pkstats.tx_packets, "TX Bytes"); + &priv->pkstats.tx_bytes, "TX Bytes"); SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_multicast_packets", CTLFLAG_RD, &priv->pkstats.tx_multicast_packets, "TX Multicast Packets"); SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_broadcast_packets", CTLFLAG_RD, @@ -2606,8 +2804,8 @@ struct mlx4_en_pkt_stats { CTLFLAG_RD, &tx_ring->packets, "TX packets"); SYSCTL_ADD_ULONG(ctx, ring_list, OID_AUTO, "bytes", CTLFLAG_RD, &tx_ring->bytes, "TX bytes"); - } + for (i = 0; i < priv->rx_ring_num; i++) { rx_ring = priv->rx_ring[i]; snprintf(namebuf, sizeof(namebuf), "rx_ring%d", i); Modified: stable/10/sys/ofed/drivers/net/mlx4/en_port.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_port.c Fri Dec 11 13:55:31 2015 (r292106) +++ stable/10/sys/ofed/drivers/net/mlx4/en_port.c Fri Dec 11 14:21:58 2015 (r292107) @@ -194,6 +194,7 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_e priv->port_stats.tx_chksum_offload += priv->tx_ring[i]->tx_csum; priv->port_stats.queue_stopped += priv->tx_ring[i]->queue_stopped; priv->port_stats.wake_queue += priv->tx_ring[i]->wake_queue; + priv->port_stats.oversized_packets += priv->tx_ring[i]->oversized_packets; } /* RX Statistics */ priv->pkstats.rx_packets = be64_to_cpu(mlx4_en_stats->RTOT_prio_0) + Modified: stable/10/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_rx.c Fri Dec 11 13:55:31 2015 (r292106) +++ stable/10/sys/ofed/drivers/net/mlx4/en_rx.c Fri Dec 11 14:21:58 2015 (r292107) @@ -49,106 +49,135 @@ static void mlx4_en_init_rx_desc(struct struct mlx4_en_rx_ring *ring, int index) { - struct mlx4_en_rx_desc *rx_desc = ring->buf + ring->stride * index; + struct mlx4_en_rx_desc *rx_desc = (struct mlx4_en_rx_desc *) + (ring->buf + (ring->stride * index)); int possible_frags; int i; - /* Set size and memtype fields */ - for (i = 0; i < priv->num_frags; i++) { - rx_desc->data[i].byte_count = - cpu_to_be32(priv->frag_info[i].frag_size); - rx_desc->data[i].lkey = cpu_to_be32(priv->mdev->mr.key); - } + rx_desc->data[0].byte_count = cpu_to_be32(priv->rx_mb_size); + rx_desc->data[0].lkey = cpu_to_be32(priv->mdev->mr.key); - /* If the number of used fragments does not fill up the ring stride, - * * remaining (unused) fragments must be padded with null address/size - * * and a special memory key */ + /* + * If the number of used fragments does not fill up the ring + * stride, remaining (unused) fragments must be padded with + * null address/size and a special memory key: + */ possible_frags = (ring->stride - sizeof(struct mlx4_en_rx_desc)) / DS_SIZE; - for (i = priv->num_frags; i < possible_frags; i++) { + for (i = 1; i < possible_frags; i++) { rx_desc->data[i].byte_count = 0; rx_desc->data[i].lkey = cpu_to_be32(MLX4_EN_MEMTYPE_PAD); rx_desc->data[i].addr = 0; } - } -static int mlx4_en_alloc_buf(struct mlx4_en_priv *priv, - struct mlx4_en_rx_desc *rx_desc, - struct mbuf **mb_list, - int i) +static int +mlx4_en_alloc_buf(struct mlx4_en_rx_ring *ring, + __be64 *pdma, struct mlx4_en_rx_mbuf *mb_list) { - struct mlx4_en_dev *mdev = priv->mdev; - struct mlx4_en_frag_info *frag_info = &priv->frag_info[i]; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; struct mbuf *mb; - dma_addr_t dma; + int nsegs; + int err; - if (i == 0) - mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, frag_info->frag_size); - else - mb = m_getjcl(M_NOWAIT, MT_DATA, 0, frag_info->frag_size); - if (mb == NULL) { - priv->port_stats.rx_alloc_failed++; - return -ENOMEM; + /* try to allocate a new spare mbuf */ + if (unlikely(ring->spare.mbuf == NULL)) { + mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, ring->rx_mb_size); + if (unlikely(mb == NULL)) + return (-ENOMEM); + /* setup correct length */ + mb->m_len = ring->rx_mb_size; + + /* load spare mbuf into BUSDMA */ + err = -bus_dmamap_load_mbuf_sg(ring->dma_tag, ring->spare.dma_map, + mb, segs, &nsegs, BUS_DMA_NOWAIT); + if (unlikely(err != 0)) { + m_freem(mb); + return (err); + } + + /* store spare info */ + ring->spare.mbuf = mb; + ring->spare.paddr_be = cpu_to_be64(segs[0].ds_addr); + + bus_dmamap_sync(ring->dma_tag, ring->spare.dma_map, + BUS_DMASYNC_PREREAD); } - dma = pci_map_single(mdev->pdev, mb->m_data, frag_info->frag_size, - PCI_DMA_FROMDEVICE); - rx_desc->data[i].addr = cpu_to_be64(dma); - mb_list[i] = mb; - return 0; -} + /* synchronize and unload the current mbuf, if any */ + if (likely(mb_list->mbuf != NULL)) { + bus_dmamap_sync(ring->dma_tag, mb_list->dma_map, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(ring->dma_tag, mb_list->dma_map); + } -static int mlx4_en_prepare_rx_desc(struct mlx4_en_priv *priv, - struct mlx4_en_rx_ring *ring, int index) -{ - struct mlx4_en_rx_desc *rx_desc = ring->buf + (index * ring->stride); - struct mbuf **mb_list = ring->rx_info + (index << priv->log_rx_info); - int i; + mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, ring->rx_mb_size); + if (unlikely(mb == NULL)) + goto use_spare; + + /* setup correct length */ + mb->m_len = ring->rx_mb_size; + + err = -bus_dmamap_load_mbuf_sg(ring->dma_tag, mb_list->dma_map, + mb, segs, &nsegs, BUS_DMA_NOWAIT); + if (unlikely(err != 0)) { + m_freem(mb); + goto use_spare; + } + + *pdma = cpu_to_be64(segs[0].ds_addr); + mb_list->mbuf = mb; + + bus_dmamap_sync(ring->dma_tag, mb_list->dma_map, BUS_DMASYNC_PREREAD); + return (0); - for (i = 0; i < priv->num_frags; i++) - if (mlx4_en_alloc_buf(priv, rx_desc, mb_list, i)) - goto err; +use_spare: + /* swap DMA maps */ + map = mb_list->dma_map; + mb_list->dma_map = ring->spare.dma_map; + ring->spare.dma_map = map; - return 0; + /* swap MBUFs */ + mb_list->mbuf = ring->spare.mbuf; + ring->spare.mbuf = NULL; -err: - while (i--) - m_free(mb_list[i]); - return -ENOMEM; + /* store physical address */ + *pdma = ring->spare.paddr_be; + return (0); } -static inline void mlx4_en_update_rx_prod_db(struct mlx4_en_rx_ring *ring) +static void +mlx4_en_free_buf(struct mlx4_en_rx_ring *ring, struct mlx4_en_rx_mbuf *mb_list) { - *ring->wqres.db.db = cpu_to_be32(ring->prod & 0xffff); + bus_dmamap_t map = mb_list->dma_map; + bus_dmamap_sync(ring->dma_tag, map, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(ring->dma_tag, map); + m_freem(mb_list->mbuf); + mb_list->mbuf = NULL; /* safety clearing */ } -static void mlx4_en_free_rx_desc(struct mlx4_en_priv *priv, - struct mlx4_en_rx_ring *ring, - int index) +static int +mlx4_en_prepare_rx_desc(struct mlx4_en_priv *priv, + struct mlx4_en_rx_ring *ring, int index) { - struct mlx4_en_frag_info *frag_info; - struct mlx4_en_dev *mdev = priv->mdev; - struct mbuf **mb_list; - struct mlx4_en_rx_desc *rx_desc = ring->buf + (index << ring->log_stride); - dma_addr_t dma; - int nr; - - mb_list = ring->rx_info + (index << priv->log_rx_info); - for (nr = 0; nr < priv->num_frags; nr++) { - en_dbg(DRV, priv, "Freeing fragment:%d\n", nr); - frag_info = &priv->frag_info[nr]; - dma = be64_to_cpu(rx_desc->data[nr].addr); - -#if BITS_PER_LONG == 64 - en_dbg(DRV, priv, "Unmaping buffer at dma:0x%lx\n", (u64) dma); -#elif BITS_PER_LONG == 32 - en_dbg(DRV, priv, "Unmaping buffer at dma:0x%llx\n", (u64) dma); -#endif - pci_unmap_single(mdev->pdev, dma, frag_info->frag_size, - PCI_DMA_FROMDEVICE); - m_free(mb_list[nr]); + struct mlx4_en_rx_desc *rx_desc = (struct mlx4_en_rx_desc *) + (ring->buf + (index * ring->stride)); + struct mlx4_en_rx_mbuf *mb_list = ring->mbuf + index; + + mb_list->mbuf = NULL; + + if (mlx4_en_alloc_buf(ring, &rx_desc->data[0].addr, mb_list)) { + priv->port_stats.rx_alloc_failed++; + return (-ENOMEM); } + return (0); +} + +static inline void +mlx4_en_update_rx_prod_db(struct mlx4_en_rx_ring *ring) +{ + *ring->wqres.db.db = cpu_to_be32(ring->prod & 0xffff); } static int mlx4_en_fill_rx_buffers(struct mlx4_en_priv *priv) @@ -191,7 +220,8 @@ reduce_rings: while (ring->actual_size > new_size) { ring->actual_size--; ring->prod--; - mlx4_en_free_rx_desc(priv, ring, ring->actual_size); + mlx4_en_free_buf(ring, + ring->mbuf + ring->actual_size); } } @@ -211,100 +241,106 @@ static void mlx4_en_free_rx_buf(struct m while (ring->cons != ring->prod) { index = ring->cons & ring->size_mask; en_dbg(DRV, priv, "Processing descriptor:%d\n", index); - mlx4_en_free_rx_desc(priv, ring, index); + mlx4_en_free_buf(ring, ring->mbuf + index); ++ring->cons; } } -#if MLX4_EN_MAX_RX_FRAGS == 3 -static int frag_sizes[] = { - FRAG_SZ0, - FRAG_SZ1, - FRAG_SZ2, -}; -#elif MLX4_EN_MAX_RX_FRAGS == 2 -static int frag_sizes[] = { - FRAG_SZ0, - FRAG_SZ1, -}; -#else -#error "Unknown MAX_RX_FRAGS" -#endif - void mlx4_en_calc_rx_buf(struct net_device *dev) { struct mlx4_en_priv *priv = netdev_priv(dev); int eff_mtu = dev->if_mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN; - int buf_size = 0; - int i, frag; - for (i = 0, frag = 0; buf_size < eff_mtu; frag++, i++) { - /* - * Allocate small to large but only as much as is needed for - * the tail. - */ - while (i > 0 && eff_mtu - buf_size <= frag_sizes[i - 1]) - i--; - priv->frag_info[frag].frag_size = frag_sizes[i]; - priv->frag_info[frag].frag_prefix_size = buf_size; - buf_size += priv->frag_info[frag].frag_size; - } + if (eff_mtu > MJUM16BYTES) { + en_err(priv, "MTU(%d) is too big\n", (int)dev->if_mtu); + eff_mtu = MJUM16BYTES; + } else if (eff_mtu > MJUM9BYTES) { + eff_mtu = MJUM16BYTES; + } else if (eff_mtu > MJUMPAGESIZE) { + eff_mtu = MJUM9BYTES; + } else if (eff_mtu > MCLBYTES) { + eff_mtu = MJUMPAGESIZE; + } else { + eff_mtu = MCLBYTES; + } - priv->num_frags = frag; priv->rx_mb_size = eff_mtu; - priv->log_rx_info = - ROUNDUP_LOG2(priv->num_frags * sizeof(struct mbuf *)); - en_dbg(DRV, priv, "Rx buffer scatter-list (effective-mtu:%d " - "num_frags:%d):\n", eff_mtu, priv->num_frags); - for (i = 0; i < priv->num_frags; i++) { - en_dbg(DRV, priv, " frag:%d - size:%d prefix:%d\n", i, - priv->frag_info[i].frag_size, - priv->frag_info[i].frag_prefix_size); - } + en_dbg(DRV, priv, "Effective RX MTU: %d bytes\n", eff_mtu); } - int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring **pring, u32 size, int node) { struct mlx4_en_dev *mdev = priv->mdev; struct mlx4_en_rx_ring *ring; - int err = -ENOMEM; + int err; int tmp; + uint32_t x; ring = kzalloc(sizeof(struct mlx4_en_rx_ring), GFP_KERNEL); if (!ring) { en_err(priv, "Failed to allocate RX ring structure\n"); return -ENOMEM; } - + + /* Create DMA descriptor TAG */ + if ((err = -bus_dma_tag_create( + bus_get_dma_tag(mdev->pdev->dev.bsddev), + 1, /* any alignment */ + 0, /* no boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MJUM16BYTES, /* maxsize */ + 1, /* nsegments */ + MJUM16BYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &ring->dma_tag))) { + en_err(priv, "Failed to create DMA tag\n"); + goto err_ring; + } + ring->prod = 0; ring->cons = 0; ring->size = size; ring->size_mask = size - 1; - ring->stride = roundup_pow_of_two(sizeof(struct mlx4_en_rx_desc) + - DS_SIZE * MLX4_EN_MAX_RX_FRAGS); + ring->stride = roundup_pow_of_two( + sizeof(struct mlx4_en_rx_desc) + DS_SIZE); ring->log_stride = ffs(ring->stride) - 1; ring->buf_size = ring->size * ring->stride + TXBB_SIZE; - tmp = size * roundup_pow_of_two(MLX4_EN_MAX_RX_FRAGS * - sizeof(struct mbuf *)); + tmp = size * sizeof(struct mlx4_en_rx_mbuf); - ring->rx_info = kmalloc(tmp, GFP_KERNEL); - if (!ring->rx_info) { + ring->mbuf = kzalloc(tmp, GFP_KERNEL); + if (ring->mbuf == NULL) { err = -ENOMEM; - goto err_ring; + goto err_dma_tag; } - en_dbg(DRV, priv, "Allocated rx_info ring at addr:%p size:%d\n", - ring->rx_info, tmp); + err = -bus_dmamap_create(ring->dma_tag, 0, &ring->spare.dma_map); + if (err != 0) + goto err_info; + + for (x = 0; x != size; x++) { + err = -bus_dmamap_create(ring->dma_tag, 0, + &ring->mbuf[x].dma_map); + if (err != 0) { + while (x--) + bus_dmamap_destroy(ring->dma_tag, + ring->mbuf[x].dma_map); + goto err_info; + } + } + en_dbg(DRV, priv, "Allocated MBUF ring at addr:%p size:%d\n", + ring->mbuf, tmp); err = mlx4_alloc_hwq_res(mdev->dev, &ring->wqres, ring->buf_size, 2 * PAGE_SIZE); if (err) - goto err_info; + goto err_dma_map; err = mlx4_en_map_buffer(&ring->wqres.buf); if (err) { @@ -317,23 +353,29 @@ int mlx4_en_create_rx_ring(struct mlx4_e err_hwq: mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size); +err_dma_map: + for (x = 0; x != size; x++) { + bus_dmamap_destroy(ring->dma_tag, + ring->mbuf[x].dma_map); + } + bus_dmamap_destroy(ring->dma_tag, ring->spare.dma_map); err_info: - vfree(ring->rx_info); + vfree(ring->mbuf); +err_dma_tag: + bus_dma_tag_destroy(ring->dma_tag); err_ring: kfree(ring); - - return err; + return (err); } - int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv) { struct mlx4_en_rx_ring *ring; int i; int ring_ind; int err; - int stride = roundup_pow_of_two(sizeof(struct mlx4_en_rx_desc) + - DS_SIZE * priv->num_frags); + int stride = roundup_pow_of_two( + sizeof(struct mlx4_en_rx_desc) + DS_SIZE); for (ring_ind = 0; ring_ind < priv->rx_ring_num; ring_ind++) { ring = priv->rx_ring[ring_ind]; @@ -409,10 +451,22 @@ void mlx4_en_destroy_rx_ring(struct mlx4 { struct mlx4_en_dev *mdev = priv->mdev; struct mlx4_en_rx_ring *ring = *pring; + uint32_t x; mlx4_en_unmap_buffer(&ring->wqres.buf); mlx4_free_hwq_res(mdev->dev, &ring->wqres, size * stride + TXBB_SIZE); - vfree(ring->rx_info); + for (x = 0; x != size; x++) + bus_dmamap_destroy(ring->dma_tag, ring->mbuf[x].dma_map); + /* free spare mbuf, if any */ + if (ring->spare.mbuf != NULL) { + bus_dmamap_sync(ring->dma_tag, ring->spare.dma_map, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(ring->dma_tag, ring->spare.dma_map); + m_freem(ring->spare.mbuf); + } + bus_dmamap_destroy(ring->dma_tag, ring->spare.dma_map); + vfree(ring->mbuf); + bus_dma_tag_destroy(ring->dma_tag); kfree(ring); *pring = NULL; #ifdef CONFIG_RFS_ACCEL @@ -420,7 +474,6 @@ void mlx4_en_destroy_rx_ring(struct mlx4 #endif } - void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring *ring) { @@ -469,69 +522,27 @@ static inline int invalid_cqe(struct mlx return 0; } - -/* Unmap a completed descriptor and free unused pages */ -static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv, - struct mlx4_en_rx_desc *rx_desc, - struct mbuf **mb_list, - int length) +static struct mbuf * +mlx4_en_rx_mb(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring *ring, + struct mlx4_en_rx_desc *rx_desc, struct mlx4_en_rx_mbuf *mb_list, + int length) { - struct mlx4_en_dev *mdev = priv->mdev; - struct mlx4_en_frag_info *frag_info; - dma_addr_t dma; struct mbuf *mb; - int nr; - mb = mb_list[0]; - mb->m_pkthdr.len = length; - /* Collect used fragments while replacing them in the HW descirptors */ - for (nr = 0; nr < priv->num_frags; nr++) { - frag_info = &priv->frag_info[nr]; - if (length <= frag_info->frag_prefix_size) - break; - if (nr) - mb->m_next = mb_list[nr]; - mb = mb_list[nr]; - mb->m_len = frag_info->frag_size; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 11 14:53:41 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8CAD9D7C91; Fri, 11 Dec 2015 14:53:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AC642107D; Fri, 11 Dec 2015 14:53:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBErewD094871; Fri, 11 Dec 2015 14:53:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBEreg2094870; Fri, 11 Dec 2015 14:53:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512111453.tBBEreg2094870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 11 Dec 2015 14:53: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: r292108 - stable/9/sys/ofed/include/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 14:53:41 -0000 Author: hselasky Date: Fri Dec 11 14:53:40 2015 New Revision: 292108 URL: https://svnweb.freebsd.org/changeset/base/292108 Log: MFC r291690: Remove incorrect defines. The proper version of these macros is defined in linux/etherdevice.h. Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/include/linux/compat.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/include/linux/compat.h ============================================================================== --- stable/9/sys/ofed/include/linux/compat.h Fri Dec 11 14:21:58 2015 (r292107) +++ stable/9/sys/ofed/include/linux/compat.h Fri Dec 11 14:53:40 2015 (r292108) @@ -30,8 +30,4 @@ #ifndef _LINUX_COMPAT_H_ #define _LINUX_COMPAT_H_ -#define is_multicast_ether_addr(x) 0 -#define is_broadcast_ether_addr(x) 0 - - #endif /* _LINUX_COMPAT_H_ */ From owner-svn-src-all@freebsd.org Fri Dec 11 14:56:20 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C928B9D7F6A; Fri, 11 Dec 2015 14:56:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 96DA014A4; Fri, 11 Dec 2015 14:56:20 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBEuJW3095022; Fri, 11 Dec 2015 14:56:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBEuJ8C095021; Fri, 11 Dec 2015 14:56:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512111456.tBBEuJ8C095021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 11 Dec 2015 14:56: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: r292109 - stable/9/sys/ofed/include/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 14:56:20 -0000 Author: hselasky Date: Fri Dec 11 14:56:19 2015 New Revision: 292109 URL: https://svnweb.freebsd.org/changeset/base/292109 Log: MFC r291693: Add some structures and defines which will be used when decoding small form factor, SFF, standards compliant ethernet EEPROMs. Obtained from: Linux Sponsored by: Mellanox Technologies Modified: stable/9/sys/ofed/include/linux/etherdevice.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ofed/include/linux/etherdevice.h ============================================================================== --- stable/9/sys/ofed/include/linux/etherdevice.h Fri Dec 11 14:53:40 2015 (r292108) +++ stable/9/sys/ofed/include/linux/etherdevice.h Fri Dec 11 14:56:19 2015 (r292109) @@ -37,6 +37,25 @@ #include +#define ETH_MODULE_SFF_8079 1 +#define ETH_MODULE_SFF_8079_LEN 256 +#define ETH_MODULE_SFF_8472 2 +#define ETH_MODULE_SFF_8472_LEN 512 +#define ETH_MODULE_SFF_8636 3 +#define ETH_MODULE_SFF_8636_LEN 256 +#define ETH_MODULE_SFF_8436 4 +#define ETH_MODULE_SFF_8436_LEN 256 + +struct ethtool_eeprom { + u32 offset; + u32 len; +}; + +struct ethtool_modinfo { + u32 type; + u32 eeprom_len; +}; + /** * is_zero_ether_addr - Determine if give Ethernet address is all zeros. * @addr: Pointer to a six-byte array containing the Ethernet address From owner-svn-src-all@freebsd.org Fri Dec 11 15:12:02 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A9669D8B22; Fri, 11 Dec 2015 15:12:02 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EE911FD7; Fri, 11 Dec 2015 15:12:02 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBFC1bN000852; Fri, 11 Dec 2015 15:12:01 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBFC1q3000851; Fri, 11 Dec 2015 15:12:01 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201512111512.tBBFC1q3000851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Fri, 11 Dec 2015 15:12:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292110 - head/contrib/top X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 15:12:02 -0000 Author: lidl Date: Fri Dec 11 15:12:01 2015 New Revision: 292110 URL: https://svnweb.freebsd.org/changeset/base/292110 Log: Fixup include protections for building on mips64 with clang Reviewed by: sbruno, imp Approved by: rpaulo (mentor) Differential Revision: https://reviews.freebsd.org/D4457 Modified: head/contrib/top/loadavg.h Modified: head/contrib/top/loadavg.h ============================================================================== --- head/contrib/top/loadavg.h Fri Dec 11 14:56:19 2015 (r292109) +++ head/contrib/top/loadavg.h Fri Dec 11 15:12:01 2015 (r292110) @@ -19,10 +19,10 @@ * * Defined types: load_avg for load averages, pctcpu for cpu percentages. */ -#if defined(mips) && !defined(NetBSD) +#if defined(mips) && !(defined(NetBSD) || defined(FreeBSD)) # include # if defined(FBITS) && !defined(FSCALE) -# define FSCALE (1 << FBITS) /* mips */ +# define FSCALE (1 << FBITS) /* RISC/os on mips */ # endif #endif From owner-svn-src-all@freebsd.org Fri Dec 11 15:24:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ABCF19D7509; Fri, 11 Dec 2015 15:24:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BCB617DD; Fri, 11 Dec 2015 15:24:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBFOTvv003852; Fri, 11 Dec 2015 15:24:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBFOTqh003849; Fri, 11 Dec 2015 15:24:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512111524.tBBFOTqh003849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 11 Dec 2015 15:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292111 - in head/sys/dev: ncv nsp stg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 15:24:30 -0000 Author: imp Date: Fri Dec 11 15:24:29 2015 New Revision: 292111 URL: https://svnweb.freebsd.org/changeset/base/292111 Log: Use the right product names. Pointy Hat To: imp@ Modified: head/sys/dev/ncv/ncr53c500_pccard.c head/sys/dev/nsp/nsp_pccard.c head/sys/dev/stg/tmc18c30_pccard.c Modified: head/sys/dev/ncv/ncr53c500_pccard.c ============================================================================== --- head/sys/dev/ncv/ncr53c500_pccard.c Fri Dec 11 15:12:01 2015 (r292110) +++ head/sys/dev/ncv/ncr53c500_pccard.c Fri Dec 11 15:24:29 2015 (r292111) @@ -293,7 +293,7 @@ static devclass_t ncv_devclass; MODULE_DEPEND(ncv, scsi_low, 1, 1, 1); DRIVER_MODULE(ncv, pccard, ncv_pccard_driver, ncv_devclass, 0, 0); -PCCARD_PNP_INFO(ncv_pccard_products); +PCCARD_PNP_INFO(ncv_products); static void ncv_card_unload(device_t devi) Modified: head/sys/dev/nsp/nsp_pccard.c ============================================================================== --- head/sys/dev/nsp/nsp_pccard.c Fri Dec 11 15:12:01 2015 (r292110) +++ head/sys/dev/nsp/nsp_pccard.c Fri Dec 11 15:24:29 2015 (r292111) @@ -233,7 +233,7 @@ static devclass_t nsp_devclass; MODULE_DEPEND(nsp, scsi_low, 1, 1, 1); DRIVER_MODULE(nsp, pccard, nsp_pccard_driver, nsp_devclass, 0, 0); -PCCARD_PNP_INFO(nsp_pccard_products); +PCCARD_PNP_INFO(nsp_products); static void nsp_card_unload(device_t devi) Modified: head/sys/dev/stg/tmc18c30_pccard.c ============================================================================== --- head/sys/dev/stg/tmc18c30_pccard.c Fri Dec 11 15:12:01 2015 (r292110) +++ head/sys/dev/stg/tmc18c30_pccard.c Fri Dec 11 15:24:29 2015 (r292111) @@ -136,4 +136,4 @@ static driver_t stg_pccard_driver = { DRIVER_MODULE(stg, pccard, stg_pccard_driver, stg_devclass, 0, 0); MODULE_DEPEND(stg, scsi_low, 1, 1, 1); -PCCARD_PNP_INFO(stg_pccard_products); +PCCARD_PNP_INFO(stg_products); From owner-svn-src-all@freebsd.org Fri Dec 11 15:25:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C0789D7677; Fri, 11 Dec 2015 15:25:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C1541A9F; Fri, 11 Dec 2015 15:25:48 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBFPlb8004057; Fri, 11 Dec 2015 15:25:47 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBFPl3V004056; Fri, 11 Dec 2015 15:25:47 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201512111525.tBBFPl3V004056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 11 Dec 2015 15:25:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292112 - head/sys/arm64/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 15:25:48 -0000 Author: andrew Date: Fri Dec 11 15:25:47 2015 New Revision: 292112 URL: https://svnweb.freebsd.org/changeset/base/292112 Log: Sort the list of NICs after the mii options. While here add the msk driver as it has now been tested. Sponsored by: SoftIron Inc Modified: head/sys/arm64/conf/GENERIC Modified: head/sys/arm64/conf/GENERIC ============================================================================== --- head/sys/arm64/conf/GENERIC Fri Dec 11 15:24:29 2015 (r292111) +++ head/sys/arm64/conf/GENERIC Fri Dec 11 15:25:47 2015 (r292112) @@ -99,11 +99,12 @@ device pci options PCI_IOV # PCI SR-IOV support # Ethernet NICs -device vnic # Cavium ThunderX NIC -device em # Intel PRO/1000 Gigabit Ethernet Family -device igb # Intel PRO/1000 PCIE Server Gigabit Family device mii device miibus # MII bus support +device em # Intel PRO/1000 Gigabit Ethernet Family +device igb # Intel PRO/1000 PCIE Server Gigabit Family +device msk # Marvell/SysKonnect Yukon II Gigabit Ethernet +device vnic # Cavium ThunderX NIC # Block devices device ahci From owner-svn-src-all@freebsd.org Fri Dec 11 15:35:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F24A9D7DFD; Fri, 11 Dec 2015 15:35:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 202FF1F49; Fri, 11 Dec 2015 15:35:48 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBFZlsV006993; Fri, 11 Dec 2015 15:35:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBFZlc6006992; Fri, 11 Dec 2015 15:35:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512111535.tBBFZlc6006992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 11 Dec 2015 15:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r292113 - stable/10/sys/ofed/drivers/net/mlx4 X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 15:35:48 -0000 Author: hselasky Date: Fri Dec 11 15:35:47 2015 New Revision: 292113 URL: https://svnweb.freebsd.org/changeset/base/292113 Log: Enable the mlx4en TSO limits. This is a direct commit to stable/10. Sponsored by: Mellanox Technologies Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Modified: stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Fri Dec 11 15:25:47 2015 (r292112) +++ stable/10/sys/ofed/drivers/net/mlx4/en_netdev.c Fri Dec 11 15:35:47 2015 (r292113) @@ -2174,12 +2174,10 @@ int mlx4_en_init_netdev(struct mlx4_en_d if (mdev->LSO_support) dev->if_capabilities |= IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTSO; -#if __FreeBSD_version >= 1100000 /* set TSO limits so that we don't have to drop TX packets */ dev->if_hw_tsomax = MLX4_EN_TX_MAX_PAYLOAD_SIZE - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN) /* hdr */; dev->if_hw_tsomaxsegcount = MLX4_EN_TX_MAX_MBUF_FRAGS - 1 /* hdr */; dev->if_hw_tsomaxsegsize = MLX4_EN_TX_MAX_MBUF_SIZE; -#endif dev->if_capenable = dev->if_capabilities; From owner-svn-src-all@freebsd.org Fri Dec 11 16:51:05 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7693D9D7611; Fri, 11 Dec 2015 16:51:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4841F1EC7; Fri, 11 Dec 2015 16:51:05 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBGp4Wa030951; Fri, 11 Dec 2015 16:51:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBGp4er030950; Fri, 11 Dec 2015 16:51:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201512111651.tBBGp4er030950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 11 Dec 2015 16:51:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292114 - head/sys/mips/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 16:51:05 -0000 Author: imp Date: Fri Dec 11 16:51:04 2015 New Revision: 292114 URL: https://svnweb.freebsd.org/changeset/base/292114 Log: Correct the CONFIG0_VI value. According to http://www.t-es-t.hu/download/mips/md00090c.pdf this is bit 3 of the config0 word, not bit 2. This should fix virtually indexed caches (relatively new in the MIPS world, so no current platforms used this and current code just uses it as an optimization). It was causing false positives on newer platforms that default to large values for the kseg0 cache coherency attribute. Submitted by: Stanislav Galabov PR: 205249 Modified: head/sys/mips/include/cpuregs.h Modified: head/sys/mips/include/cpuregs.h ============================================================================== --- head/sys/mips/include/cpuregs.h Fri Dec 11 15:35:47 2015 (r292113) +++ head/sys/mips/include/cpuregs.h Fri Dec 11 16:51:04 2015 (r292114) @@ -524,7 +524,7 @@ #define MIPS_CONFIG0_MT_MASK 0x00000380 /* bits 9..7 MMU Type */ #define MIPS_CONFIG0_MT_SHIFT 7 #define MIPS_CONFIG0_BE 0x00008000 /* data is big-endian */ -#define MIPS_CONFIG0_VI 0x00000004 /* instruction cache is virtual */ +#define MIPS_CONFIG0_VI 0x00000008 /* instruction cache is virtual */ #define MIPS_CONFIG1_TLBSZ_MASK 0x7E000000 /* bits 30..25 # tlb entries minus one */ #define MIPS_CONFIG1_TLBSZ_SHIFT 25 From owner-svn-src-all@freebsd.org Fri Dec 11 18:28:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C500CA049D7; Fri, 11 Dec 2015 18:28:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8CAD51528; Fri, 11 Dec 2015 18:28:21 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBISK1T057210; Fri, 11 Dec 2015 18:28:20 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBISKXJ057205; Fri, 11 Dec 2015 18:28:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201512111828.tBBISKXJ057205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 11 Dec 2015 18:28: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: r292115 - in stable/9/sys: modules/mlxen ofed/drivers/net/mlx4 ofed/include/linux/mlx4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 18:28:21 -0000 Author: hselasky Date: Fri Dec 11 18:28:20 2015 New Revision: 292115 URL: https://svnweb.freebsd.org/changeset/base/292115 Log: MFC r283612, r290710, r291694, r291699 and r291793: - Add SIOCGI2C ioctl support to the driver. Would work only on ConnectX-3 with fresh firmware. The low level code is based on code provided by Mellanox. - Fix print formatting compile warnings for Sparc64 and PowerPC platforms. - Updated the mlx4 and mlxen drivers to the latest version, v2.1.6: - Added support for dumping the SFP EEPROM content to dmesg. - Fixed handling of network interface capability IOCTLs. - Fixed race when loading and unloading the mlxen driver by applying appropriate locking. - Removed two unused C-files. - Convert the mlxen driver to use the BUSDMA(9) APIs instead of vtophys() when loading mbufs for transmission and reception. While at it all pointer arithmetic and cast qualifier issues were fixed, mostly related to transmission and reception. - Fix i386 build WITH_OFED=YES. Remove some redundant KASSERTs. Sponsored by: Mellanox Technologies Differential Revision: https://reviews.freebsd.org/D4283 Differential Revision: https://reviews.freebsd.org/D4284 Deleted: stable/9/sys/ofed/drivers/net/mlx4/en_ethtool.c stable/9/sys/ofed/drivers/net/mlx4/en_selftest.c Modified: stable/9/sys/modules/mlxen/Makefile stable/9/sys/ofed/drivers/net/mlx4/en_main.c stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c stable/9/sys/ofed/drivers/net/mlx4/en_port.c stable/9/sys/ofed/drivers/net/mlx4/en_rx.c stable/9/sys/ofed/drivers/net/mlx4/en_tx.c stable/9/sys/ofed/drivers/net/mlx4/main.c stable/9/sys/ofed/drivers/net/mlx4/mlx4.h stable/9/sys/ofed/drivers/net/mlx4/mlx4_en.h stable/9/sys/ofed/drivers/net/mlx4/mlx4_stats.h stable/9/sys/ofed/drivers/net/mlx4/port.c stable/9/sys/ofed/include/linux/mlx4/cq.h stable/9/sys/ofed/include/linux/mlx4/device.h stable/9/sys/ofed/include/linux/mlx4/doorbell.h stable/9/sys/ofed/include/linux/mlx4/qp.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/modules/mlxen/Makefile ============================================================================== --- stable/9/sys/modules/mlxen/Makefile Fri Dec 11 16:51:04 2015 (r292114) +++ stable/9/sys/modules/mlxen/Makefile Fri Dec 11 18:28:20 2015 (r292115) @@ -26,4 +26,4 @@ opt_inet6.h: .include -CFLAGS+= -Wno-cast-qual -Wno-pointer-arith ${GCC_MS_EXTENSIONS} +CFLAGS+= ${GCC_MS_EXTENSIONS} Modified: stable/9/sys/ofed/drivers/net/mlx4/en_main.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_main.c Fri Dec 11 16:51:04 2015 (r292114) +++ stable/9/sys/ofed/drivers/net/mlx4/en_main.c Fri Dec 11 18:28:20 2015 (r292115) @@ -42,14 +42,7 @@ #include "mlx4_en.h" -MODULE_AUTHOR("Liran Liss, Yevgeny Petrilin"); -MODULE_DESCRIPTION("Mellanox ConnectX HCA Ethernet driver"); -MODULE_LICENSE("Dual BSD/GPL"); -MODULE_VERSION(DRV_VERSION " ("DRV_RELDATE")"); - -static const char mlx4_en_version[] = - DRV_NAME ": Mellanox ConnectX HCA Ethernet driver v" - DRV_VERSION " (" DRV_RELDATE ")\n"; +/* Mellanox ConnectX HCA Ethernet driver */ #define MLX4_EN_PARM_INT(X, def_val, desc) \ static unsigned int X = def_val;\ @@ -174,8 +167,6 @@ static void *mlx4_en_add(struct mlx4_dev int i; int err; - printk_once(KERN_INFO "%s", mlx4_en_version); - mdev = kzalloc(sizeof *mdev, GFP_KERNEL); if (!mdev) { dev_err(&dev->pdev->dev, "Device struct alloc failed, " Modified: stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Fri Dec 11 16:51:04 2015 (r292114) +++ stable/9/sys/ofed/drivers/net/mlx4/en_netdev.c Fri Dec 11 18:28:20 2015 (r292115) @@ -659,8 +659,10 @@ static void mlx4_en_cache_mclist(struct continue; /* Make sure the list didn't grow. */ tmp = kzalloc(sizeof(struct mlx4_en_mc_list), GFP_ATOMIC); - if (tmp == NULL) + if (tmp == NULL) { + en_err(priv, "Failed to allocate multicast list\n"); break; + } memcpy(tmp->addr, LLADDR((struct sockaddr_dl *)ifma->ifma_addr), ETH_ALEN); list_add_tail(&tmp->list, &priv->mc_list); @@ -971,12 +973,12 @@ static void mlx4_en_do_set_rx_mode(struc if (!mlx4_en_QUERY_PORT(mdev, priv->port)) { if (priv->port_state.link_state) { priv->last_link_state = MLX4_DEV_EVENT_PORT_UP; - /* Important note: the following call for if_link_state_change - * is needed for interface up scenario (start port, link state - * change) */ /* update netif baudrate */ priv->dev->if_baudrate = IF_Mbps(priv->port_state.link_speed); + /* Important note: the following call for if_link_state_change + * is needed for interface up scenario (start port, link state + * change) */ if_link_state_change(priv->dev, LINK_STATE_UP); en_dbg(HW, priv, "Link Up\n"); } @@ -1196,8 +1198,8 @@ static void mlx4_en_linkstate(struct wor /* update netif baudrate */ priv->dev->if_baudrate = 0; - /* make sure the port is up before notifying the OS. - * This is tricky since we get here on INIT_PORT and + /* make sure the port is up before notifying the OS. + * This is tricky since we get here on INIT_PORT and * in such case we can't tell the OS the port is up. * To solve this there is a call to if_link_state_change * in set_rx_mode. @@ -1246,7 +1248,6 @@ int mlx4_en_start_port(struct net_device PAGE_SIZE); priv->rx_alloc_order = get_order(priv->rx_alloc_size); priv->rx_buf_size = roundup_pow_of_two(priv->rx_mb_size); - priv->log_rx_info = ROUNDUP_LOG2(sizeof(struct mlx4_en_rx_buf)); en_dbg(DRV, priv, "Rx buf size:%d\n", priv->rx_mb_size); /* Configure rx cq's and rings */ @@ -1575,6 +1576,7 @@ static void mlx4_en_clear_stats(struct n priv->tx_ring[i]->bytes = 0; priv->tx_ring[i]->packets = 0; priv->tx_ring[i]->tx_csum = 0; + priv->tx_ring[i]->oversized_packets = 0; } for (i = 0; i < priv->rx_ring_num; i++) { priv->rx_ring[i]->bytes = 0; @@ -1644,8 +1646,6 @@ void mlx4_en_free_resources(struct mlx4_ if (priv->sysctl) sysctl_ctx_free(&priv->stat_ctx); - - } int mlx4_en_alloc_resources(struct mlx4_en_priv *priv) @@ -1730,8 +1730,11 @@ void mlx4_en_destroy_netdev(struct net_d EVENTHANDLER_DEREGISTER(vlan_unconfig, priv->vlan_detach); /* Unregister device - this will close the port if it was up */ - if (priv->registered) + if (priv->registered) { + mutex_lock(&mdev->state_lock); ether_ifdetach(dev); + mutex_unlock(&mdev->state_lock); + } if (priv->allocated) mlx4_free_hwq_res(mdev->dev, &priv->res, MLX4_EN_PAGE_SIZE); @@ -1809,13 +1812,6 @@ static int mlx4_en_calc_media(struct mlx active = IFM_ETHER; if (priv->last_link_state == MLX4_DEV_EVENT_PORT_DOWN) return (active); - /* - * [ShaharK] mlx4_en_QUERY_PORT sleeps and cannot be called under a - * non-sleepable lock. - * I moved it to the periodic mlx4_en_do_get_stats. - if (mlx4_en_QUERY_PORT(priv->mdev, priv->port)) - return (active); - */ active |= IFM_FDX; trans_type = priv->port_state.transciver; /* XXX I don't know all of the transceiver values. */ @@ -1948,12 +1944,57 @@ static int mlx4_en_ioctl(struct ifnet *d case SIOCSIFCAP: mutex_lock(&mdev->state_lock); mask = ifr->ifr_reqcap ^ dev->if_capenable; - if (mask & IFCAP_HWCSUM) - dev->if_capenable ^= IFCAP_HWCSUM; - if (mask & IFCAP_TSO4) + if (mask & IFCAP_TXCSUM) { + dev->if_capenable ^= IFCAP_TXCSUM; + dev->if_hwassist ^= (CSUM_TCP | CSUM_UDP | CSUM_IP); + + if (IFCAP_TSO4 & dev->if_capenable && + !(IFCAP_TXCSUM & dev->if_capenable)) { + dev->if_capenable &= ~IFCAP_TSO4; + dev->if_hwassist &= ~CSUM_TSO; + if_printf(dev, + "tso4 disabled due to -txcsum.\n"); + } + } + if (mask & IFCAP_TXCSUM_IPV6) { + dev->if_capenable ^= IFCAP_TXCSUM_IPV6; + dev->if_hwassist ^= (CSUM_UDP_IPV6 | CSUM_TCP_IPV6); + + if (IFCAP_TSO6 & dev->if_capenable && + !(IFCAP_TXCSUM_IPV6 & dev->if_capenable)) { + dev->if_capenable &= ~IFCAP_TSO6; + dev->if_hwassist &= ~CSUM_TSO; + if_printf(dev, + "tso6 disabled due to -txcsum6.\n"); + } + } + if (mask & IFCAP_RXCSUM) + dev->if_capenable ^= IFCAP_RXCSUM; + if (mask & IFCAP_RXCSUM_IPV6) + dev->if_capenable ^= IFCAP_RXCSUM_IPV6; + + if (mask & IFCAP_TSO4) { + if (!(IFCAP_TSO4 & dev->if_capenable) && + !(IFCAP_TXCSUM & dev->if_capenable)) { + if_printf(dev, "enable txcsum first.\n"); + error = EAGAIN; + goto out; + } dev->if_capenable ^= IFCAP_TSO4; - if (mask & IFCAP_TSO6) + } + if (mask & IFCAP_TSO6) { + if (!(IFCAP_TSO6 & dev->if_capenable) && + !(IFCAP_TXCSUM_IPV6 & dev->if_capenable)) { + if_printf(dev, "enable txcsum6 first.\n"); + error = EAGAIN; + goto out; + } dev->if_capenable ^= IFCAP_TSO6; + } + if (dev->if_capenable & (IFCAP_TSO4 | IFCAP_TSO6)) + dev->if_hwassist |= CSUM_TSO; + else + dev->if_hwassist &= ~CSUM_TSO; if (mask & IFCAP_LRO) dev->if_capenable ^= IFCAP_LRO; if (mask & IFCAP_VLAN_HWTAGGING) @@ -1964,9 +2005,35 @@ static int mlx4_en_ioctl(struct ifnet *d dev->if_capenable ^= IFCAP_WOL_MAGIC; if (dev->if_drv_flags & IFF_DRV_RUNNING) mlx4_en_start_port(dev); +out: mutex_unlock(&mdev->state_lock); VLAN_CAPABILITIES(dev); break; +#if __FreeBSD_version >= 1100036 + case SIOCGI2C: { + struct ifi2creq i2c; + + error = copyin(ifr->ifr_data, &i2c, sizeof(i2c)); + if (error) + break; + if (i2c.len > sizeof(i2c.data)) { + error = EINVAL; + break; + } + /* + * Note that we ignore i2c.addr here. The driver hardcodes + * the address to 0x50, while standard expects it to be 0xA0. + */ + error = mlx4_get_module_info(mdev->dev, priv->port, + i2c.offset, i2c.len, i2c.data); + if (error < 0) { + error = -error; + break; + } + error = copyout(&i2c, ifr->ifr_data, sizeof(i2c)); + break; + } +#endif default: error = ether_ioctl(dev, command, data); break; @@ -2026,8 +2093,6 @@ int mlx4_en_init_netdev(struct mlx4_en_d priv->port = port; priv->port_up = false; priv->flags = prof->flags; - priv->ctrl_flags = cpu_to_be32(MLX4_WQE_CTRL_CQ_UPDATE | - MLX4_WQE_CTRL_SOLICITED); priv->num_tx_rings_p_up = mdev->profile.num_tx_rings_p_up; priv->tx_ring_num = prof->tx_ring_num; @@ -2043,7 +2108,7 @@ int mlx4_en_init_netdev(struct mlx4_en_d err = -ENOMEM; goto out; } - + priv->rx_ring_num = prof->rx_ring_num; priv->cqe_factor = (mdev->dev->caps.cqe_size == 64) ? 1 : 0; priv->mac_index = -1; @@ -2066,7 +2131,6 @@ int mlx4_en_init_netdev(struct mlx4_en_d for (i = 0; i < MLX4_EN_MAC_HASH_SIZE; ++i) INIT_HLIST_HEAD(&priv->mac_hash[i]); - /* Query for default mac and max mtu */ priv->max_mtu = mdev->dev->caps.eth_mtu_cap[priv->port]; priv->mac = mdev->dev->caps.def_mac[priv->port]; @@ -2082,8 +2146,6 @@ int mlx4_en_init_netdev(struct mlx4_en_d goto out; } - - priv->stride = roundup_pow_of_two(sizeof(struct mlx4_en_rx_desc) + DS_SIZE); @@ -2105,7 +2167,7 @@ int mlx4_en_init_netdev(struct mlx4_en_d /* * Set driver features */ - dev->if_capabilities |= IFCAP_RXCSUM | IFCAP_TXCSUM; + dev->if_capabilities |= IFCAP_HWCSUM | IFCAP_HWCSUM_IPV6; dev->if_capabilities |= IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING; dev->if_capabilities |= IFCAP_VLAN_HWCSUM | IFCAP_VLAN_HWFILTER; dev->if_capabilities |= IFCAP_LINKSTATE | IFCAP_JUMBO_MTU; @@ -2115,9 +2177,9 @@ int mlx4_en_init_netdev(struct mlx4_en_d dev->if_capabilities |= IFCAP_TSO4 | IFCAP_TSO6 | IFCAP_VLAN_HWTSO; /* set TSO limits so that we don't have to drop TX packets */ - dev->if_hw_tsomax = 65536 - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN); - dev->if_hw_tsomaxsegcount = 16; - dev->if_hw_tsomaxsegsize = 65536; /* XXX can do up to 4GByte */ + dev->if_hw_tsomax = MLX4_EN_TX_MAX_PAYLOAD_SIZE - (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN) /* hdr */; + dev->if_hw_tsomaxsegcount = MLX4_EN_TX_MAX_MBUF_FRAGS - 1 /* hdr */; + dev->if_hw_tsomaxsegsize = MLX4_EN_TX_MAX_MBUF_SIZE; dev->if_capenable = dev->if_capabilities; @@ -2126,6 +2188,8 @@ int mlx4_en_init_netdev(struct mlx4_en_d dev->if_hwassist |= CSUM_TSO; if (dev->if_capenable & IFCAP_TXCSUM) dev->if_hwassist |= (CSUM_TCP | CSUM_UDP | CSUM_IP); + if (dev->if_capenable & IFCAP_TXCSUM_IPV6) + dev->if_hwassist |= (CSUM_UDP_IPV6 | CSUM_TCP_IPV6); /* Register for VLAN events */ @@ -2188,8 +2252,6 @@ int mlx4_en_init_netdev(struct mlx4_en_d if (mdev->dev->caps.flags2 & MLX4_DEV_CAP_FLAG2_TS) queue_delayed_work(mdev->workqueue, &priv->service_task, SERVICE_TASK_DELAY); - - return 0; out: @@ -2271,6 +2333,162 @@ static int mlx4_en_set_tx_ring_size(SYSC return (error); } +static int mlx4_en_get_module_info(struct net_device *dev, + struct ethtool_modinfo *modinfo) +{ + struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_dev *mdev = priv->mdev; + int ret; + u8 data[4]; + + /* Read first 2 bytes to get Module & REV ID */ + ret = mlx4_get_module_info(mdev->dev, priv->port, + 0/*offset*/, 2/*size*/, data); + + if (ret < 2) { + en_err(priv, "Failed to read eeprom module first two bytes, error: 0x%x\n", -ret); + return -EIO; + } + + switch (data[0] /* identifier */) { + case MLX4_MODULE_ID_QSFP: + modinfo->type = ETH_MODULE_SFF_8436; + modinfo->eeprom_len = ETH_MODULE_SFF_8436_LEN; + break; + case MLX4_MODULE_ID_QSFP_PLUS: + if (data[1] >= 0x3) { /* revision id */ + modinfo->type = ETH_MODULE_SFF_8636; + modinfo->eeprom_len = ETH_MODULE_SFF_8636_LEN; + } else { + modinfo->type = ETH_MODULE_SFF_8436; + modinfo->eeprom_len = ETH_MODULE_SFF_8436_LEN; + } + break; + case MLX4_MODULE_ID_QSFP28: + modinfo->type = ETH_MODULE_SFF_8636; + modinfo->eeprom_len = ETH_MODULE_SFF_8636_LEN; + break; + case MLX4_MODULE_ID_SFP: + modinfo->type = ETH_MODULE_SFF_8472; + modinfo->eeprom_len = ETH_MODULE_SFF_8472_LEN; + break; + default: + en_err(priv, "mlx4_en_get_module_info : Not recognized cable type\n"); + return -EINVAL; + } + + return 0; +} + +static int mlx4_en_get_module_eeprom(struct net_device *dev, + struct ethtool_eeprom *ee, + u8 *data) +{ + struct mlx4_en_priv *priv = netdev_priv(dev); + struct mlx4_en_dev *mdev = priv->mdev; + int offset = ee->offset; + int i = 0, ret; + + if (ee->len == 0) + return -EINVAL; + + memset(data, 0, ee->len); + + while (i < ee->len) { + en_dbg(DRV, priv, + "mlx4_get_module_info i(%d) offset(%d) len(%d)\n", + i, offset, ee->len - i); + + ret = mlx4_get_module_info(mdev->dev, priv->port, + offset, ee->len - i, data + i); + + if (!ret) /* Done reading */ + return 0; + + if (ret < 0) { + en_err(priv, + "mlx4_get_module_info i(%d) offset(%d) bytes_to_read(%d) - FAILED (0x%x)\n", + i, offset, ee->len - i, ret); + return -1; + } + + i += ret; + offset += ret; + } + return 0; +} + +static void mlx4_en_print_eeprom(u8 *data, __u32 len) +{ + int i; + int j = 0; + int row = 0; + const int NUM_OF_BYTES = 16; + + printf("\nOffset\t\tValues\n"); + printf("------\t\t------\n"); + while(row < len){ + printf("0x%04x\t\t",row); + for(i=0; i < NUM_OF_BYTES; i++){ + printf("%02x ", data[j]); + row++; + j++; + } + printf("\n"); + } +} + +/* Read cable EEPROM module information by first inspecting the first + * two bytes to get the length and then read the rest of the information. + * The information is printed to dmesg. */ +static int mlx4_en_read_eeprom(SYSCTL_HANDLER_ARGS) +{ + + u8* data; + int error; + int result = 0; + struct mlx4_en_priv *priv; + struct net_device *dev; + struct ethtool_modinfo modinfo; + struct ethtool_eeprom ee; + + error = sysctl_handle_int(oidp, &result, 0, req); + if (error || !req->newptr) + return (error); + + if (result == 1) { + priv = arg1; + dev = priv->dev; + data = kmalloc(PAGE_SIZE, GFP_KERNEL); + + error = mlx4_en_get_module_info(dev, &modinfo); + if (error) { + en_err(priv, + "mlx4_en_get_module_info returned with error - FAILED (0x%x)\n", + -error); + goto out; + } + + ee.len = modinfo.eeprom_len; + ee.offset = 0; + + error = mlx4_en_get_module_eeprom(dev, &ee, data); + if (error) { + en_err(priv, + "mlx4_en_get_module_eeprom returned with error - FAILED (0x%x)\n", + -error); + /* Continue printing partial information in case of an error */ + } + + /* EEPROM information will be printed in dmesg */ + mlx4_en_print_eeprom(data, ee.len); +out: + kfree(data); + } + /* Return zero to prevent sysctl failure. */ + return (0); +} + static int mlx4_en_set_tx_ppp(SYSCTL_HANDLER_ARGS) { struct mlx4_en_priv *priv; @@ -2396,7 +2614,7 @@ static void mlx4_en_sysctl_conf(struct m /* Add coalescer configuration. */ coal = SYSCTL_ADD_NODE(ctx, node_list, OID_AUTO, "coalesce", CTLFLAG_RD, NULL, "Interrupt coalesce configuration"); - coal_list = SYSCTL_CHILDREN(node); + coal_list = SYSCTL_CHILDREN(coal); SYSCTL_ADD_UINT(ctx, coal_list, OID_AUTO, "pkt_rate_low", CTLFLAG_RW, &priv->pkt_rate_low, 0, "Packets per-second for minimum delay"); @@ -2415,11 +2633,14 @@ static void mlx4_en_sysctl_conf(struct m SYSCTL_ADD_UINT(ctx, coal_list, OID_AUTO, "adaptive_rx_coal", CTLFLAG_RW, &priv->adaptive_rx_coal, 0, "Enable adaptive rx coalescing"); + /* EEPROM support */ + SYSCTL_ADD_PROC(ctx, node_list, OID_AUTO, "eeprom_info", + CTLTYPE_INT | CTLFLAG_RW | CTLFLAG_MPSAFE, priv, 0, + mlx4_en_read_eeprom, "I", "EEPROM information"); } static void mlx4_en_sysctl_stat(struct mlx4_en_priv *priv) { - struct net_device *dev; struct sysctl_ctx_list *ctx; struct sysctl_oid *node; struct sysctl_oid_list *node_list; @@ -2430,8 +2651,6 @@ static void mlx4_en_sysctl_stat(struct m char namebuf[128]; int i; - dev = priv->dev; - ctx = &priv->stat_ctx; sysctl_ctx_init(ctx); node = SYSCTL_ADD_NODE(ctx, SYSCTL_CHILDREN(priv->sysctl), OID_AUTO, @@ -2459,6 +2678,8 @@ static void mlx4_en_sysctl_stat(struct m &priv->port_stats.wake_queue, "Queue resumed after full"); SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_timeout", CTLFLAG_RD, &priv->port_stats.tx_timeout, "Transmit timeouts"); + SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_oversized_packets", CTLFLAG_RD, + &priv->port_stats.oversized_packets, "TX oversized packets, m_defrag failed"); SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_alloc_failed", CTLFLAG_RD, &priv->port_stats.rx_alloc_failed, "RX failed to allocate mbuf"); SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "rx_chksum_good", CTLFLAG_RD, @@ -2542,7 +2763,7 @@ struct mlx4_en_pkt_stats { SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_packets", CTLFLAG_RD, &priv->pkstats.tx_packets, "TX packets"); SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_bytes", CTLFLAG_RD, - &priv->pkstats.tx_packets, "TX Bytes"); + &priv->pkstats.tx_bytes, "TX Bytes"); SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_multicast_packets", CTLFLAG_RD, &priv->pkstats.tx_multicast_packets, "TX Multicast Packets"); SYSCTL_ADD_ULONG(ctx, node_list, OID_AUTO, "tx_broadcast_packets", CTLFLAG_RD, @@ -2583,8 +2804,8 @@ struct mlx4_en_pkt_stats { CTLFLAG_RD, &tx_ring->packets, "TX packets"); SYSCTL_ADD_ULONG(ctx, ring_list, OID_AUTO, "bytes", CTLFLAG_RD, &tx_ring->bytes, "TX bytes"); - } + for (i = 0; i < priv->rx_ring_num; i++) { rx_ring = priv->rx_ring[i]; snprintf(namebuf, sizeof(namebuf), "rx_ring%d", i); Modified: stable/9/sys/ofed/drivers/net/mlx4/en_port.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_port.c Fri Dec 11 16:51:04 2015 (r292114) +++ stable/9/sys/ofed/drivers/net/mlx4/en_port.c Fri Dec 11 18:28:20 2015 (r292115) @@ -194,6 +194,7 @@ int mlx4_en_DUMP_ETH_STATS(struct mlx4_e priv->port_stats.tx_chksum_offload += priv->tx_ring[i]->tx_csum; priv->port_stats.queue_stopped += priv->tx_ring[i]->queue_stopped; priv->port_stats.wake_queue += priv->tx_ring[i]->wake_queue; + priv->port_stats.oversized_packets += priv->tx_ring[i]->oversized_packets; } /* RX Statistics */ priv->pkstats.rx_packets = be64_to_cpu(mlx4_en_stats->RTOT_prio_0) + Modified: stable/9/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- stable/9/sys/ofed/drivers/net/mlx4/en_rx.c Fri Dec 11 16:51:04 2015 (r292114) +++ stable/9/sys/ofed/drivers/net/mlx4/en_rx.c Fri Dec 11 18:28:20 2015 (r292115) @@ -49,106 +49,135 @@ static void mlx4_en_init_rx_desc(struct struct mlx4_en_rx_ring *ring, int index) { - struct mlx4_en_rx_desc *rx_desc = ring->buf + ring->stride * index; + struct mlx4_en_rx_desc *rx_desc = (struct mlx4_en_rx_desc *) + (ring->buf + (ring->stride * index)); int possible_frags; int i; - /* Set size and memtype fields */ - for (i = 0; i < priv->num_frags; i++) { - rx_desc->data[i].byte_count = - cpu_to_be32(priv->frag_info[i].frag_size); - rx_desc->data[i].lkey = cpu_to_be32(priv->mdev->mr.key); - } + rx_desc->data[0].byte_count = cpu_to_be32(priv->rx_mb_size); + rx_desc->data[0].lkey = cpu_to_be32(priv->mdev->mr.key); - /* If the number of used fragments does not fill up the ring stride, - * * remaining (unused) fragments must be padded with null address/size - * * and a special memory key */ + /* + * If the number of used fragments does not fill up the ring + * stride, remaining (unused) fragments must be padded with + * null address/size and a special memory key: + */ possible_frags = (ring->stride - sizeof(struct mlx4_en_rx_desc)) / DS_SIZE; - for (i = priv->num_frags; i < possible_frags; i++) { + for (i = 1; i < possible_frags; i++) { rx_desc->data[i].byte_count = 0; rx_desc->data[i].lkey = cpu_to_be32(MLX4_EN_MEMTYPE_PAD); rx_desc->data[i].addr = 0; } - } -static int mlx4_en_alloc_buf(struct mlx4_en_priv *priv, - struct mlx4_en_rx_desc *rx_desc, - struct mbuf **mb_list, - int i) +static int +mlx4_en_alloc_buf(struct mlx4_en_rx_ring *ring, + __be64 *pdma, struct mlx4_en_rx_mbuf *mb_list) { - struct mlx4_en_dev *mdev = priv->mdev; - struct mlx4_en_frag_info *frag_info = &priv->frag_info[i]; + bus_dma_segment_t segs[1]; + bus_dmamap_t map; struct mbuf *mb; - dma_addr_t dma; + int nsegs; + int err; - if (i == 0) - mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, frag_info->frag_size); - else - mb = m_getjcl(M_NOWAIT, MT_DATA, 0, frag_info->frag_size); - if (mb == NULL) { - priv->port_stats.rx_alloc_failed++; - return -ENOMEM; + /* try to allocate a new spare mbuf */ + if (unlikely(ring->spare.mbuf == NULL)) { + mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, ring->rx_mb_size); + if (unlikely(mb == NULL)) + return (-ENOMEM); + /* setup correct length */ + mb->m_len = ring->rx_mb_size; + + /* load spare mbuf into BUSDMA */ + err = -bus_dmamap_load_mbuf_sg(ring->dma_tag, ring->spare.dma_map, + mb, segs, &nsegs, BUS_DMA_NOWAIT); + if (unlikely(err != 0)) { + m_freem(mb); + return (err); + } + + /* store spare info */ + ring->spare.mbuf = mb; + ring->spare.paddr_be = cpu_to_be64(segs[0].ds_addr); + + bus_dmamap_sync(ring->dma_tag, ring->spare.dma_map, + BUS_DMASYNC_PREREAD); } - dma = pci_map_single(mdev->pdev, mb->m_data, frag_info->frag_size, - PCI_DMA_FROMDEVICE); - rx_desc->data[i].addr = cpu_to_be64(dma); - mb_list[i] = mb; - return 0; -} + /* synchronize and unload the current mbuf, if any */ + if (likely(mb_list->mbuf != NULL)) { + bus_dmamap_sync(ring->dma_tag, mb_list->dma_map, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(ring->dma_tag, mb_list->dma_map); + } -static int mlx4_en_prepare_rx_desc(struct mlx4_en_priv *priv, - struct mlx4_en_rx_ring *ring, int index) -{ - struct mlx4_en_rx_desc *rx_desc = ring->buf + (index * ring->stride); - struct mbuf **mb_list = ring->rx_info + (index << priv->log_rx_info); - int i; + mb = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, ring->rx_mb_size); + if (unlikely(mb == NULL)) + goto use_spare; + + /* setup correct length */ + mb->m_len = ring->rx_mb_size; + + err = -bus_dmamap_load_mbuf_sg(ring->dma_tag, mb_list->dma_map, + mb, segs, &nsegs, BUS_DMA_NOWAIT); + if (unlikely(err != 0)) { + m_freem(mb); + goto use_spare; + } + + *pdma = cpu_to_be64(segs[0].ds_addr); + mb_list->mbuf = mb; + + bus_dmamap_sync(ring->dma_tag, mb_list->dma_map, BUS_DMASYNC_PREREAD); + return (0); - for (i = 0; i < priv->num_frags; i++) - if (mlx4_en_alloc_buf(priv, rx_desc, mb_list, i)) - goto err; +use_spare: + /* swap DMA maps */ + map = mb_list->dma_map; + mb_list->dma_map = ring->spare.dma_map; + ring->spare.dma_map = map; - return 0; + /* swap MBUFs */ + mb_list->mbuf = ring->spare.mbuf; + ring->spare.mbuf = NULL; -err: - while (i--) - m_free(mb_list[i]); - return -ENOMEM; + /* store physical address */ + *pdma = ring->spare.paddr_be; + return (0); } -static inline void mlx4_en_update_rx_prod_db(struct mlx4_en_rx_ring *ring) +static void +mlx4_en_free_buf(struct mlx4_en_rx_ring *ring, struct mlx4_en_rx_mbuf *mb_list) { - *ring->wqres.db.db = cpu_to_be32(ring->prod & 0xffff); + bus_dmamap_t map = mb_list->dma_map; + bus_dmamap_sync(ring->dma_tag, map, BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(ring->dma_tag, map); + m_freem(mb_list->mbuf); + mb_list->mbuf = NULL; /* safety clearing */ } -static void mlx4_en_free_rx_desc(struct mlx4_en_priv *priv, - struct mlx4_en_rx_ring *ring, - int index) +static int +mlx4_en_prepare_rx_desc(struct mlx4_en_priv *priv, + struct mlx4_en_rx_ring *ring, int index) { - struct mlx4_en_frag_info *frag_info; - struct mlx4_en_dev *mdev = priv->mdev; - struct mbuf **mb_list; - struct mlx4_en_rx_desc *rx_desc = ring->buf + (index << ring->log_stride); - dma_addr_t dma; - int nr; - - mb_list = ring->rx_info + (index << priv->log_rx_info); - for (nr = 0; nr < priv->num_frags; nr++) { - en_dbg(DRV, priv, "Freeing fragment:%d\n", nr); - frag_info = &priv->frag_info[nr]; - dma = be64_to_cpu(rx_desc->data[nr].addr); - -#if BITS_PER_LONG == 64 - en_dbg(DRV, priv, "Unmaping buffer at dma:0x%lx\n", (u64) dma); -#elif BITS_PER_LONG == 32 - en_dbg(DRV, priv, "Unmaping buffer at dma:0x%llx\n", (u64) dma); -#endif - pci_unmap_single(mdev->pdev, dma, frag_info->frag_size, - PCI_DMA_FROMDEVICE); - m_free(mb_list[nr]); + struct mlx4_en_rx_desc *rx_desc = (struct mlx4_en_rx_desc *) + (ring->buf + (index * ring->stride)); + struct mlx4_en_rx_mbuf *mb_list = ring->mbuf + index; + + mb_list->mbuf = NULL; + + if (mlx4_en_alloc_buf(ring, &rx_desc->data[0].addr, mb_list)) { + priv->port_stats.rx_alloc_failed++; + return (-ENOMEM); } + return (0); +} + +static inline void +mlx4_en_update_rx_prod_db(struct mlx4_en_rx_ring *ring) +{ + *ring->wqres.db.db = cpu_to_be32(ring->prod & 0xffff); } static int mlx4_en_fill_rx_buffers(struct mlx4_en_priv *priv) @@ -191,7 +220,8 @@ reduce_rings: while (ring->actual_size > new_size) { ring->actual_size--; ring->prod--; - mlx4_en_free_rx_desc(priv, ring, ring->actual_size); + mlx4_en_free_buf(ring, + ring->mbuf + ring->actual_size); } } @@ -211,100 +241,106 @@ static void mlx4_en_free_rx_buf(struct m while (ring->cons != ring->prod) { index = ring->cons & ring->size_mask; en_dbg(DRV, priv, "Processing descriptor:%d\n", index); - mlx4_en_free_rx_desc(priv, ring, index); + mlx4_en_free_buf(ring, ring->mbuf + index); ++ring->cons; } } -#if MLX4_EN_MAX_RX_FRAGS == 3 -static int frag_sizes[] = { - FRAG_SZ0, - FRAG_SZ1, - FRAG_SZ2, -}; -#elif MLX4_EN_MAX_RX_FRAGS == 2 -static int frag_sizes[] = { - FRAG_SZ0, - FRAG_SZ1, -}; -#else -#error "Unknown MAX_RX_FRAGS" -#endif - void mlx4_en_calc_rx_buf(struct net_device *dev) { struct mlx4_en_priv *priv = netdev_priv(dev); int eff_mtu = dev->if_mtu + ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN; - int buf_size = 0; - int i, frag; - for (i = 0, frag = 0; buf_size < eff_mtu; frag++, i++) { - /* - * Allocate small to large but only as much as is needed for - * the tail. - */ - while (i > 0 && eff_mtu - buf_size <= frag_sizes[i - 1]) - i--; - priv->frag_info[frag].frag_size = frag_sizes[i]; - priv->frag_info[frag].frag_prefix_size = buf_size; - buf_size += priv->frag_info[frag].frag_size; - } + if (eff_mtu > MJUM16BYTES) { + en_err(priv, "MTU(%d) is too big\n", (int)dev->if_mtu); + eff_mtu = MJUM16BYTES; + } else if (eff_mtu > MJUM9BYTES) { + eff_mtu = MJUM16BYTES; + } else if (eff_mtu > MJUMPAGESIZE) { + eff_mtu = MJUM9BYTES; + } else if (eff_mtu > MCLBYTES) { + eff_mtu = MJUMPAGESIZE; + } else { + eff_mtu = MCLBYTES; + } - priv->num_frags = frag; priv->rx_mb_size = eff_mtu; - priv->log_rx_info = - ROUNDUP_LOG2(priv->num_frags * sizeof(struct mbuf *)); - en_dbg(DRV, priv, "Rx buffer scatter-list (effective-mtu:%d " - "num_frags:%d):\n", eff_mtu, priv->num_frags); - for (i = 0; i < priv->num_frags; i++) { - en_dbg(DRV, priv, " frag:%d - size:%d prefix:%d\n", i, - priv->frag_info[i].frag_size, - priv->frag_info[i].frag_prefix_size); - } + en_dbg(DRV, priv, "Effective RX MTU: %d bytes\n", eff_mtu); } - int mlx4_en_create_rx_ring(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring **pring, u32 size, int node) { struct mlx4_en_dev *mdev = priv->mdev; struct mlx4_en_rx_ring *ring; - int err = -ENOMEM; + int err; int tmp; + uint32_t x; ring = kzalloc(sizeof(struct mlx4_en_rx_ring), GFP_KERNEL); if (!ring) { en_err(priv, "Failed to allocate RX ring structure\n"); return -ENOMEM; } - + + /* Create DMA descriptor TAG */ + if ((err = -bus_dma_tag_create( + bus_get_dma_tag(mdev->pdev->dev.bsddev), + 1, /* any alignment */ + 0, /* no boundary */ + BUS_SPACE_MAXADDR, /* lowaddr */ + BUS_SPACE_MAXADDR, /* highaddr */ + NULL, NULL, /* filter, filterarg */ + MJUM16BYTES, /* maxsize */ + 1, /* nsegments */ + MJUM16BYTES, /* maxsegsize */ + 0, /* flags */ + NULL, NULL, /* lockfunc, lockfuncarg */ + &ring->dma_tag))) { + en_err(priv, "Failed to create DMA tag\n"); + goto err_ring; + } + ring->prod = 0; ring->cons = 0; ring->size = size; ring->size_mask = size - 1; - ring->stride = roundup_pow_of_two(sizeof(struct mlx4_en_rx_desc) + - DS_SIZE * MLX4_EN_MAX_RX_FRAGS); + ring->stride = roundup_pow_of_two( + sizeof(struct mlx4_en_rx_desc) + DS_SIZE); ring->log_stride = ffs(ring->stride) - 1; ring->buf_size = ring->size * ring->stride + TXBB_SIZE; - tmp = size * roundup_pow_of_two(MLX4_EN_MAX_RX_FRAGS * - sizeof(struct mbuf *)); + tmp = size * sizeof(struct mlx4_en_rx_mbuf); - ring->rx_info = kmalloc(tmp, GFP_KERNEL); - if (!ring->rx_info) { + ring->mbuf = kzalloc(tmp, GFP_KERNEL); + if (ring->mbuf == NULL) { err = -ENOMEM; - goto err_ring; + goto err_dma_tag; } - en_dbg(DRV, priv, "Allocated rx_info ring at addr:%p size:%d\n", - ring->rx_info, tmp); + err = -bus_dmamap_create(ring->dma_tag, 0, &ring->spare.dma_map); + if (err != 0) + goto err_info; + + for (x = 0; x != size; x++) { + err = -bus_dmamap_create(ring->dma_tag, 0, + &ring->mbuf[x].dma_map); + if (err != 0) { + while (x--) + bus_dmamap_destroy(ring->dma_tag, + ring->mbuf[x].dma_map); + goto err_info; + } + } + en_dbg(DRV, priv, "Allocated MBUF ring at addr:%p size:%d\n", + ring->mbuf, tmp); err = mlx4_alloc_hwq_res(mdev->dev, &ring->wqres, ring->buf_size, 2 * PAGE_SIZE); if (err) - goto err_info; + goto err_dma_map; err = mlx4_en_map_buffer(&ring->wqres.buf); if (err) { @@ -317,23 +353,29 @@ int mlx4_en_create_rx_ring(struct mlx4_e err_hwq: mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size); +err_dma_map: + for (x = 0; x != size; x++) { + bus_dmamap_destroy(ring->dma_tag, + ring->mbuf[x].dma_map); + } + bus_dmamap_destroy(ring->dma_tag, ring->spare.dma_map); err_info: - vfree(ring->rx_info); + vfree(ring->mbuf); +err_dma_tag: + bus_dma_tag_destroy(ring->dma_tag); err_ring: kfree(ring); - - return err; + return (err); } - int mlx4_en_activate_rx_rings(struct mlx4_en_priv *priv) { struct mlx4_en_rx_ring *ring; int i; int ring_ind; int err; - int stride = roundup_pow_of_two(sizeof(struct mlx4_en_rx_desc) + - DS_SIZE * priv->num_frags); + int stride = roundup_pow_of_two( + sizeof(struct mlx4_en_rx_desc) + DS_SIZE); for (ring_ind = 0; ring_ind < priv->rx_ring_num; ring_ind++) { ring = priv->rx_ring[ring_ind]; @@ -409,10 +451,22 @@ void mlx4_en_destroy_rx_ring(struct mlx4 { struct mlx4_en_dev *mdev = priv->mdev; struct mlx4_en_rx_ring *ring = *pring; + uint32_t x; mlx4_en_unmap_buffer(&ring->wqres.buf); mlx4_free_hwq_res(mdev->dev, &ring->wqres, size * stride + TXBB_SIZE); - vfree(ring->rx_info); + for (x = 0; x != size; x++) + bus_dmamap_destroy(ring->dma_tag, ring->mbuf[x].dma_map); + /* free spare mbuf, if any */ + if (ring->spare.mbuf != NULL) { + bus_dmamap_sync(ring->dma_tag, ring->spare.dma_map, + BUS_DMASYNC_POSTREAD); + bus_dmamap_unload(ring->dma_tag, ring->spare.dma_map); + m_freem(ring->spare.mbuf); + } + bus_dmamap_destroy(ring->dma_tag, ring->spare.dma_map); + vfree(ring->mbuf); + bus_dma_tag_destroy(ring->dma_tag); kfree(ring); *pring = NULL; #ifdef CONFIG_RFS_ACCEL @@ -420,7 +474,6 @@ void mlx4_en_destroy_rx_ring(struct mlx4 #endif } - void mlx4_en_deactivate_rx_ring(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring *ring) { @@ -469,69 +522,27 @@ static inline int invalid_cqe(struct mlx return 0; } - -/* Unmap a completed descriptor and free unused pages */ -static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv, - struct mlx4_en_rx_desc *rx_desc, - struct mbuf **mb_list, - int length) +static struct mbuf * +mlx4_en_rx_mb(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring *ring, + struct mlx4_en_rx_desc *rx_desc, struct mlx4_en_rx_mbuf *mb_list, + int length) { - struct mlx4_en_dev *mdev = priv->mdev; - struct mlx4_en_frag_info *frag_info; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 11 18:47:42 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DC95A9D7BFE; Fri, 11 Dec 2015 18:47:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8EC181F71; Fri, 11 Dec 2015 18:47:42 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBIlf5q062989; Fri, 11 Dec 2015 18:47:41 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBIlfuF062988; Fri, 11 Dec 2015 18:47:41 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512111847.tBBIlfuF062988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 11 Dec 2015 18:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292116 - head/contrib/elftoolchain/elfcopy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 18:47:43 -0000 Author: emaste Date: Fri Dec 11 18:47:41 2015 New Revision: 292116 URL: https://svnweb.freebsd.org/changeset/base/292116 Log: elfcopy: include extension but replace . when converting from binary The change in r291958 was not consistent with GNU objcopy. The start, end and size symbols created for ELF objects converted from binary need to include the full filename including the extension, but with the periods replaced with underscores. Reviewed by: imp Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4474 Modified: head/contrib/elftoolchain/elfcopy/binary.c Modified: head/contrib/elftoolchain/elfcopy/binary.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/binary.c Fri Dec 11 18:28:20 2015 (r292115) +++ head/contrib/elftoolchain/elfcopy/binary.c Fri Dec 11 18:47:41 2015 (r292116) @@ -37,16 +37,6 @@ ELFTC_VCSID("$Id: binary.c 3174 2015-03-27 17:13:41Z emaste $"); -static int -basename_length(const char *filename) -{ - char *p; - - if ((p = strchr(filename, '.')) != NULL) - return (p - filename); - return (strlen(filename)); -} - /* * Convert ELF object to `binary'. Sections with SHF_ALLOC flag set * are copied to the result binary. The relative offsets for each section @@ -150,6 +140,7 @@ create_elf_from_binary(struct elfcopy *e GElf_Shdr sh; void *content; uint64_t off, data_start, data_end, data_size; + char *sym_basename, *p; /* Reset internal section list. */ if (!TAILQ_EMPTY(&ecp->v_sec)) @@ -220,9 +211,13 @@ create_elf_from_binary(struct elfcopy *e /* Count in .symtab and .strtab section headers. */ shtab->sz += gelf_fsize(ecp->eout, ELF_T_SHDR, 2, EV_CURRENT); + if ((sym_basename = strdup(ifn)) == NULL) + err(1, "strdup"); + p = sym_basename; + while ((p = strchr(p, '.')) != NULL) + *p++ = '_'; #define _GEN_SYMNAME(S) do { \ - snprintf(name, sizeof(name), "%s%.*s%s", "_binary_", \ - basename_length(ifn), ifn, S); \ + snprintf(name, sizeof(name), "%s%s%s", "_binary_", sym_basename, S); \ } while (0) /* @@ -244,6 +239,7 @@ create_elf_from_binary(struct elfcopy *e finalize_external_symtab(ecp); create_symtab_data(ecp); #undef _GEN_SYMNAME + free(sym_basename); /* * Write the underlying ehdr. Note that it should be called From owner-svn-src-all@freebsd.org Fri Dec 11 20:05:08 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B1C49D8000; Fri, 11 Dec 2015 20:05:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2E8F71A61; Fri, 11 Dec 2015 20:05:08 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBK57AS086545; Fri, 11 Dec 2015 20:05:07 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBK576W086543; Fri, 11 Dec 2015 20:05:07 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201512112005.tBBK576W086543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 11 Dec 2015 20:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292117 - in head/sys: kern vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 20:05:08 -0000 Author: markj Date: Fri Dec 11 20:05:07 2015 New Revision: 292117 URL: https://svnweb.freebsd.org/changeset/base/292117 Log: Don't make assertions about td_critnest when the scheduler is stopped. A panicking thread always executes with a critical section held, so any attempt to allocate or free memory while dumping will otherwise cause a second panic. This can occur, for example, if xpt_polled_action() completes non-dump I/O that was pending at the time of the panic. The fact that this can occur is itself a bug, but asserting in this case does little but reduce the reliability of kernel dumps. Suggested by: kib Reported by: pho Modified: head/sys/kern/kern_malloc.c head/sys/vm/uma_core.c Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Fri Dec 11 18:47:41 2015 (r292116) +++ head/sys/kern/kern_malloc.c Fri Dec 11 20:05:07 2015 (r292117) @@ -475,8 +475,7 @@ malloc(unsigned long size, struct malloc if (flags & M_WAITOK) KASSERT(curthread->td_intr_nesting_level == 0, ("malloc(M_WAITOK) in interrupt context")); - - KASSERT(curthread->td_critnest == 0, + KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), ("malloc: called with spinlock or critical section held")); #ifdef DEBUG_MEMGUARD @@ -544,8 +543,7 @@ free(void *addr, struct malloc_type *mtp u_long size; KASSERT(mtp->ks_magic == M_MAGIC, ("free: bad malloc type magic")); - - KASSERT(curthread->td_critnest == 0, + KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), ("free: called with spinlock or critical section held")); /* free(NULL, ...) does nothing */ @@ -610,8 +608,7 @@ realloc(void *addr, unsigned long size, KASSERT(mtp->ks_magic == M_MAGIC, ("realloc: bad malloc type magic")); - - KASSERT(curthread->td_critnest == 0, + KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), ("realloc: called with spinlock or critical section held")); /* realloc(NULL, ...) is equivalent to malloc(...) */ Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Dec 11 18:47:41 2015 (r292116) +++ head/sys/vm/uma_core.c Fri Dec 11 20:05:07 2015 (r292117) @@ -2149,8 +2149,7 @@ uma_zalloc_arg(uma_zone_t zone, void *ud WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "uma_zalloc_arg: zone \"%s\"", zone->uz_name); } - - KASSERT(curthread->td_critnest == 0, + KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), ("uma_zalloc_arg: called with spinlock or critical section held")); #ifdef DEBUG_MEMGUARD @@ -2690,7 +2689,7 @@ uma_zfree_arg(uma_zone_t zone, void *ite CTR2(KTR_UMA, "uma_zfree_arg thread %x zone %s", curthread, zone->uz_name); - KASSERT(curthread->td_critnest == 0, + KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(), ("uma_zfree_arg: called with spinlock or critical section held")); /* uma_zfree(..., NULL) does nothing, to match free(9). */ From owner-svn-src-all@freebsd.org Fri Dec 11 20:13:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F1D10A04770; Fri, 11 Dec 2015 20:13:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BC9FF10A1; Fri, 11 Dec 2015 20:13:38 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBKDck7089436; Fri, 11 Dec 2015 20:13:38 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBKDbnr089426; Fri, 11 Dec 2015 20:13:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512112013.tBBKDbnr089426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 11 Dec 2015 20:13:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292118 - in vendor/elftoolchain/dist: addr2line common elfcopy libelf readelf X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 20:13:39 -0000 Author: emaste Date: Fri Dec 11 20:13:36 2015 New Revision: 292118 URL: https://svnweb.freebsd.org/changeset/base/292118 Log: Import ELF Tool Chain snapshot revision r3272 From http://svn.code.sf.net/p/elftoolchain/code/ Modified: vendor/elftoolchain/dist/addr2line/addr2line.1 vendor/elftoolchain/dist/addr2line/addr2line.c vendor/elftoolchain/dist/common/elfdefinitions.h vendor/elftoolchain/dist/elfcopy/binary.c vendor/elftoolchain/dist/elfcopy/elfcopy.1 vendor/elftoolchain/dist/elfcopy/main.c vendor/elftoolchain/dist/elfcopy/sections.c vendor/elftoolchain/dist/elfcopy/segments.c vendor/elftoolchain/dist/libelf/elf_data.c vendor/elftoolchain/dist/readelf/readelf.c Modified: vendor/elftoolchain/dist/addr2line/addr2line.1 ============================================================================== --- vendor/elftoolchain/dist/addr2line/addr2line.1 Fri Dec 11 20:05:07 2015 (r292117) +++ vendor/elftoolchain/dist/addr2line/addr2line.1 Fri Dec 11 20:13:36 2015 (r292118) @@ -22,9 +22,9 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: addr2line.1 3195 2015-05-12 17:22:19Z emaste $ +.\" $Id: addr2line.1 3263 2015-11-30 04:25:54Z kaiwang27 $ .\" -.Dd July 25, 2010 +.Dd November 30, 2015 .Os .Dt ADDR2LINE 1 .Sh NAME @@ -32,10 +32,13 @@ .Nd translate program addresses to source file names and line numbers .Sh SYNOPSIS .Nm +.Op Fl a | Fl -addresses .Op Fl b Ar target | Fl -target Ns = Ns Ar target .Op Fl e Ar pathname | Fl -exe Ns = Ns Ar pathname .Op Fl f | Fl -functions +.Op Fl i | Fl -inlines .Op Fl j Ar sectionname | Fl -section Ns = Ns Ar sectionname +.Op Fl p | Fl -pretty-print .Op Fl s | Fl -basename .Op Fl C | Fl -demangle .Op Fl H | Fl -help @@ -69,6 +72,8 @@ The .Nm utility recognizes the following options: .Bl -tag -width indent +.It Fl a | Fl -addresses +Display the address prior to the line number information. .It Fl b Ar target | Fl -target Ns = Ns Ar target This option is recognized by .Nm @@ -84,11 +89,17 @@ will use the file .Dq Pa a.out . .It Fl f | Fl -functions Display function names in addition to file and line number information. +.It Fl i | Fl -inlines +If the address specified belongs to an inlined function, also display the line +number information for its caller, recursively until the first non-inlined +caller. .It Fl j Ar sectionname | Fl -section Ns = Ns Ar sectionname The values specified by arguments .Ar hexaddress are to be treated as offsets into the section named .Ar sectionname . +.It Fl p | -pretty-print +Display the line number information on one line, in human readable manner. .It Fl s | -basename Display only the base name for each file name. .It Fl C | Fl -demangle @@ -115,6 +126,18 @@ to program address .Ar hexaddress , followed by a line with the file name and line number. .Pp +If the +.Fl p +option was specified, +.Nm +will print line number information and function name on one line in +human readable manner. If the +.Fl i +option was also specified, +.Nm +will print the caller function information prefixed with +.Dq (inlined by) . +.Pp The .Nm utility prints the file name and line number using the format Modified: vendor/elftoolchain/dist/addr2line/addr2line.c ============================================================================== --- vendor/elftoolchain/dist/addr2line/addr2line.c Fri Dec 11 20:05:07 2015 (r292117) +++ vendor/elftoolchain/dist/addr2line/addr2line.c Fri Dec 11 20:13:36 2015 (r292118) @@ -37,33 +37,64 @@ #include #include +#include "uthash.h" #include "_elftc.h" -ELFTC_VCSID("$Id: addr2line.c 3249 2015-10-04 08:11:30Z kaiwang27 $"); +ELFTC_VCSID("$Id: addr2line.c 3264 2015-11-30 05:38:14Z kaiwang27 $"); + +struct Func { + char *name; + Dwarf_Unsigned lopc; + Dwarf_Unsigned hipc; + Dwarf_Unsigned call_file; + Dwarf_Unsigned call_line; + Dwarf_Ranges *ranges; + Dwarf_Signed ranges_cnt; + struct Func *inlined_caller; + STAILQ_ENTRY(Func) next; +}; + +struct CU { + Dwarf_Off off; + Dwarf_Unsigned lopc; + Dwarf_Unsigned hipc; + char **srcfiles; + Dwarf_Signed nsrcfiles; + STAILQ_HEAD(, Func) funclist; + UT_hash_handle hh; +}; static struct option longopts[] = { + {"addresses", no_argument, NULL, 'a'}, {"target" , required_argument, NULL, 'b'}, {"demangle", no_argument, NULL, 'C'}, {"exe", required_argument, NULL, 'e'}, {"functions", no_argument, NULL, 'f'}, + {"inlines", no_argument, NULL, 'i'}, {"section", required_argument, NULL, 'j'}, + {"pretty-print", no_argument, NULL, 'p'}, {"basename", no_argument, NULL, 's'}, {"help", no_argument, NULL, 'H'}, {"version", no_argument, NULL, 'V'}, {NULL, 0, NULL, 0} }; -static int demangle, func, base; +static int demangle, func, base, inlines, print_addr, pretty_print; static char unknown[] = { '?', '?', '\0' }; static Dwarf_Addr section_base; +static struct CU *culist; #define USAGE_MESSAGE "\ Usage: %s [options] hexaddress...\n\ Map program addresses to source file names and line numbers.\n\n\ Options:\n\ + -a | --addresses Display address prior to line number info.\n\ -b TGT | --target=TGT (Accepted but ignored).\n\ -e EXE | --exe=EXE Use program \"EXE\" to translate addresses.\n\ -f | --functions Display function names.\n\ + -i | --inlines Display caller info for inlined functions.\n\ -j NAME | --section=NAME Values are offsets into section \"NAME\".\n\ + -p | --pretty-print Display line number info and function name\n\ + in human readable manner.\n\ -s | --basename Only show the base name for each file name.\n\ -C | --demangle Demangle C++ names.\n\ -H | --help Print a help message.\n\ @@ -122,71 +153,160 @@ handle_high_pc(Dwarf_Die die, Dwarf_Unsi return (DW_DLV_OK); } +static struct Func * +search_func(struct CU *cu, Dwarf_Unsigned addr) +{ + struct Func *f, *f0; + Dwarf_Unsigned lopc, hipc, addr_base; + int i; + + f0 = NULL; + + STAILQ_FOREACH(f, &cu->funclist, next) { + if (f->ranges != NULL) { + addr_base = 0; + for (i = 0; i < f->ranges_cnt; i++) { + if (f->ranges[i].dwr_type == DW_RANGES_END) + break; + if (f->ranges[i].dwr_type == + DW_RANGES_ADDRESS_SELECTION) { + addr_base = f->ranges[i].dwr_addr2; + continue; + } + + /* DW_RANGES_ENTRY */ + lopc = f->ranges[i].dwr_addr1 + addr_base; + hipc = f->ranges[i].dwr_addr2 + addr_base; + if (addr >= lopc && addr < hipc) { + if (f0 == NULL || + (lopc >= f0->lopc && + hipc <= f0->hipc)) { + f0 = f; + f0->lopc = lopc; + f0->hipc = hipc; + break; + } + } + } + } else if (addr >= f->lopc && addr < f->hipc) { + if (f0 == NULL || + (f->lopc >= f0->lopc && f->hipc <= f0->hipc)) + f0 = f; + } + } + + return (f0); +} + static void -search_func(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Addr addr, char **rlt_func) +collect_func(Dwarf_Debug dbg, Dwarf_Die die, struct Func *parent, struct CU *cu) { - Dwarf_Die ret_die, spec_die; + Dwarf_Die ret_die, abst_die, spec_die; Dwarf_Error de; Dwarf_Half tag; - Dwarf_Unsigned lopc, hipc; + Dwarf_Unsigned lopc, hipc, ranges_off; + Dwarf_Signed ranges_cnt; Dwarf_Off ref; - Dwarf_Attribute sub_at, spec_at; - char *func0; - const char *func1; - int ret; + Dwarf_Attribute abst_at, spec_at; + Dwarf_Ranges *ranges; + const char *funcname; + struct Func *f; + int found_ranges, ret; - if (*rlt_func != NULL) - goto done; + f = NULL; + abst_die = spec_die = NULL; if (dwarf_tag(die, &tag, &de)) { warnx("dwarf_tag: %s", dwarf_errmsg(de)); goto cont_search; } - if (tag == DW_TAG_subprogram) { + if (tag == DW_TAG_subprogram || tag == DW_TAG_entry_point || + tag == DW_TAG_inlined_subroutine) { + /* + * Function address range can be specified by either + * a DW_AT_ranges attribute which points to a range list or + * by a pair of DW_AT_low_pc and DW_AT_high_pc attributes. + */ + ranges = NULL; + ranges_cnt = 0; + found_ranges = 0; + if (dwarf_attrval_unsigned(die, DW_AT_ranges, &ranges_off, + &de) == DW_DLV_OK && + dwarf_get_ranges(dbg, (Dwarf_Off) ranges_off, &ranges, + &ranges_cnt, NULL, &de) == DW_DLV_OK) { + if (ranges != NULL && ranges_cnt > 0) { + found_ranges = 1; + goto get_func_name; + } + } + + /* + * Search for DW_AT_low_pc/DW_AT_high_pc if ranges pointer + * not found. + */ if (dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, &de) || dwarf_attrval_unsigned(die, DW_AT_high_pc, &hipc, &de)) goto cont_search; if (handle_high_pc(die, lopc, &hipc) != DW_DLV_OK) goto cont_search; - if (addr < lopc || addr >= hipc) - goto cont_search; - /* Found it! */ + get_func_name: + /* + * Most common case the function name is stored in DW_AT_name + * attribute. + */ + if (dwarf_attrval_string(die, DW_AT_name, &funcname, &de) == + DW_DLV_OK) + goto add_func; - if ((*rlt_func = strdup(unknown)) == NULL) - err(EXIT_FAILURE, "strdup"); - ret = dwarf_attr(die, DW_AT_name, &sub_at, &de); - if (ret == DW_DLV_ERROR) - goto done; - if (ret == DW_DLV_OK) { - if (dwarf_formstring(sub_at, &func0, &de) == - DW_DLV_OK) { - free(*rlt_func); - if ((*rlt_func = strdup(func0)) == NULL) - err(EXIT_FAILURE, "strdup"); - } - goto done; - } + /* + * For inlined function, the actual name is probably in the DIE + * referenced by DW_AT_abstract_origin. (if present) + */ + if (dwarf_attr(die, DW_AT_abstract_origin, &abst_at, &de) == + DW_DLV_OK && + dwarf_global_formref(abst_at, &ref, &de) == DW_DLV_OK && + dwarf_offdie(dbg, ref, &abst_die, &de) == DW_DLV_OK && + dwarf_attrval_string(abst_die, DW_AT_name, &funcname, + &de) == DW_DLV_OK) + goto add_func; /* * If DW_AT_name is not present, but DW_AT_specification is * present, then probably the actual name is in the DIE * referenced by DW_AT_specification. */ - if (dwarf_attr(die, DW_AT_specification, &spec_at, &de)) - goto done; - if (dwarf_global_formref(spec_at, &ref, &de)) - goto done; - if (dwarf_offdie(dbg, ref, &spec_die, &de)) - goto done; - if (dwarf_attrval_string(spec_die, DW_AT_name, &func1, &de) == - DW_DLV_OK) { - free(*rlt_func); - if ((*rlt_func = strdup(func1)) == NULL) - err(EXIT_FAILURE, "strdup"); - } + if (dwarf_attr(die, DW_AT_specification, &spec_at, &de) == + DW_DLV_OK && + dwarf_global_formref(spec_at, &ref, &de) == DW_DLV_OK && + dwarf_offdie(dbg, ref, &spec_die, &de) == DW_DLV_OK && + dwarf_attrval_string(spec_die, DW_AT_name, &funcname, + &de) == DW_DLV_OK) + goto add_func; - goto done; + /* Skip if no name assoicated with this DIE. */ + goto cont_search; + + add_func: + if ((f = calloc(1, sizeof(*f))) == NULL) + err(EXIT_FAILURE, "calloc"); + if ((f->name = strdup(funcname)) == NULL) + err(EXIT_FAILURE, "strdup"); + if (found_ranges) { + f->ranges = ranges; + f->ranges_cnt = ranges_cnt; + } else { + f->lopc = lopc; + f->hipc = hipc; + } + if (tag == DW_TAG_inlined_subroutine) { + f->inlined_caller = parent; + dwarf_attrval_unsigned(die, DW_AT_call_file, + &f->call_file, &de); + dwarf_attrval_unsigned(die, DW_AT_call_line, + &f->call_line, &de); + } + STAILQ_INSERT_TAIL(&cu->funclist, f, next); } cont_search: @@ -194,23 +314,69 @@ cont_search: /* Search children. */ ret = dwarf_child(die, &ret_die, &de); if (ret == DW_DLV_ERROR) - errx(EXIT_FAILURE, "dwarf_child: %s", dwarf_errmsg(de)); - else if (ret == DW_DLV_OK) - search_func(dbg, ret_die, addr, rlt_func); + warnx("dwarf_child: %s", dwarf_errmsg(de)); + else if (ret == DW_DLV_OK) { + if (f != NULL) + collect_func(dbg, ret_die, f, cu); + else + collect_func(dbg, ret_die, parent, cu); + } /* Search sibling. */ ret = dwarf_siblingof(dbg, die, &ret_die, &de); if (ret == DW_DLV_ERROR) - errx(EXIT_FAILURE, "dwarf_siblingof: %s", dwarf_errmsg(de)); + warnx("dwarf_siblingof: %s", dwarf_errmsg(de)); else if (ret == DW_DLV_OK) - search_func(dbg, ret_die, addr, rlt_func); + collect_func(dbg, ret_die, parent, cu); -done: + /* Cleanup */ dwarf_dealloc(dbg, die, DW_DLA_DIE); + + if (abst_die != NULL) + dwarf_dealloc(dbg, abst_die, DW_DLA_DIE); + + if (spec_die != NULL) + dwarf_dealloc(dbg, spec_die, DW_DLA_DIE); +} + +static void +print_inlines(struct CU *cu, struct Func *f, Dwarf_Unsigned call_file, + Dwarf_Unsigned call_line) +{ + char demangled[1024]; + char *file; + + if (call_file > 0 && (Dwarf_Signed) call_file <= cu->nsrcfiles) + file = cu->srcfiles[call_file - 1]; + else + file = unknown; + + if (pretty_print) + printf(" (inlined by) "); + + if (func) { + if (demangle && !elftc_demangle(f->name, demangled, + sizeof(demangled), 0)) { + if (pretty_print) + printf("%s at ", demangled); + else + printf("%s\n", demangled); + } else { + if (pretty_print) + printf("%s at ", f->name); + else + printf("%s\n", f->name); + } + } + (void) printf("%s:%ju\n", base ? basename(file) : file, call_line); + + if (f->inlined_caller != NULL) + print_inlines(cu, f->inlined_caller, f->call_file, + f->call_line); } static void -translate(Dwarf_Debug dbg, const char* addrstr) +translate(Dwarf_Debug dbg, Elf *e, const char* addrstr) { Dwarf_Die die, ret_die; Dwarf_Line *lbuf; @@ -219,17 +385,20 @@ translate(Dwarf_Debug dbg, const char* a Dwarf_Unsigned lopc, hipc, addr, lineno, plineno; Dwarf_Signed lcount; Dwarf_Addr lineaddr, plineaddr; - char *funcname; + Dwarf_Off off; + struct CU *cu; + struct Func *f; + const char *funcname; char *file, *file0, *pfile; char demangled[1024]; - int i, ret; + int ec, i, ret; addr = strtoull(addrstr, NULL, 16); addr += section_base; lineno = 0; file = unknown; - lbuf = NULL; - lcount = 0; + cu = NULL; + die = NULL; while ((ret = dwarf_next_cu_header(dbg, NULL, NULL, NULL, NULL, NULL, &de)) == DW_DLV_OK) { @@ -252,59 +421,46 @@ translate(Dwarf_Debug dbg, const char* a warnx("could not find DW_TAG_compile_unit die"); goto next_cu; } - if (!dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, &de) && - !dwarf_attrval_unsigned(die, DW_AT_high_pc, &hipc, &de)) { + if (dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, &de) == + DW_DLV_OK) { + if (dwarf_attrval_unsigned(die, DW_AT_high_pc, &hipc, + &de) == DW_DLV_OK) { + /* + * Check if the address falls into the PC + * range of this CU. + */ + if (handle_high_pc(die, lopc, &hipc) != + DW_DLV_OK) + goto out; + } else { + /* Assume ~0ULL if DW_AT_high_pc not present */ + hipc = ~0ULL; + } + /* - * Check if the address falls into the PC range of - * this CU. + * Record the CU in the hash table for faster lookup + * later. */ - if (handle_high_pc(die, lopc, &hipc) != DW_DLV_OK) - goto next_cu; - if (addr < lopc || addr >= hipc) - goto next_cu; - } - - switch (dwarf_srclines(die, &lbuf, &lcount, &de)) { - case DW_DLV_OK: - break; - case DW_DLV_NO_ENTRY: - /* If a CU lacks debug info, just skip it. */ - goto next_cu; - default: - warnx("dwarf_srclines: %s", dwarf_errmsg(de)); - goto out; - } - - plineaddr = ~0ULL; - plineno = 0; - pfile = unknown; - for (i = 0; i < lcount; i++) { - if (dwarf_lineaddr(lbuf[i], &lineaddr, &de)) { - warnx("dwarf_lineaddr: %s", - dwarf_errmsg(de)); - goto out; - } - if (dwarf_lineno(lbuf[i], &lineno, &de)) { - warnx("dwarf_lineno: %s", + if (dwarf_dieoffset(die, &off, &de) != DW_DLV_OK) { + warnx("dwarf_dieoffset failed: %s", dwarf_errmsg(de)); goto out; } - if (dwarf_linesrc(lbuf[i], &file0, &de)) { - warnx("dwarf_linesrc: %s", - dwarf_errmsg(de)); - } else - file = file0; - if (addr == lineaddr) - goto out; - else if (addr < lineaddr && addr > plineaddr) { - lineno = plineno; - file = pfile; - goto out; + HASH_FIND(hh, culist, &off, sizeof(off), cu); + if (cu == NULL) { + if ((cu = calloc(1, sizeof(*cu))) == NULL) + err(EXIT_FAILURE, "calloc"); + cu->off = off; + cu->lopc = lopc; + cu->hipc = hipc; + STAILQ_INIT(&cu->funclist); + HASH_ADD(hh, culist, off, sizeof(off), cu); } - plineaddr = lineaddr; - plineno = lineno; - pfile = file; + + if (addr >= lopc && addr < hipc) + break; } + next_cu: if (die != NULL) { dwarf_dealloc(dbg, die, DW_DLA_DIE); @@ -312,27 +468,107 @@ translate(Dwarf_Debug dbg, const char* a } } + if (ret != DW_DLV_OK || die == NULL) + goto out; + + switch (dwarf_srclines(die, &lbuf, &lcount, &de)) { + case DW_DLV_OK: + break; + case DW_DLV_NO_ENTRY: + /* If a CU lacks debug info, just skip it. */ + goto out; + default: + warnx("dwarf_srclines: %s", dwarf_errmsg(de)); + goto out; + } + + plineaddr = ~0ULL; + plineno = 0; + pfile = unknown; + for (i = 0; i < lcount; i++) { + if (dwarf_lineaddr(lbuf[i], &lineaddr, &de)) { + warnx("dwarf_lineaddr: %s", dwarf_errmsg(de)); + goto out; + } + if (dwarf_lineno(lbuf[i], &lineno, &de)) { + warnx("dwarf_lineno: %s", dwarf_errmsg(de)); + goto out; + } + if (dwarf_linesrc(lbuf[i], &file0, &de)) { + warnx("dwarf_linesrc: %s", dwarf_errmsg(de)); + } else + file = file0; + if (addr == lineaddr) + goto out; + else if (addr < lineaddr && addr > plineaddr) { + lineno = plineno; + file = pfile; + goto out; + } + plineaddr = lineaddr; + plineno = lineno; + pfile = file; + } + out: + f = NULL; funcname = NULL; - if (ret == DW_DLV_OK && func) { - search_func(dbg, die, addr, &funcname); - die = NULL; + if (ret == DW_DLV_OK && (func || inlines) && cu != NULL) { + if (cu->srcfiles == NULL) + if (dwarf_srcfiles(die, &cu->srcfiles, &cu->nsrcfiles, + &de)) + warnx("dwarf_srcfiles: %s", dwarf_errmsg(de)); + if (STAILQ_EMPTY(&cu->funclist)) { + collect_func(dbg, die, NULL, cu); + die = NULL; + } + f = search_func(cu, addr); + if (f != NULL) + funcname = f->name; + } + + if (print_addr) { + if ((ec = gelf_getclass(e)) == ELFCLASSNONE) { + warnx("gelf_getclass failed: %s", elf_errmsg(-1)); + ec = ELFCLASS64; + } + if (ec == ELFCLASS32) { + if (pretty_print) + printf("0x%08jx: ", (uintmax_t) addr); + else + printf("0x%08jx\n", (uintmax_t) addr); + } else { + if (pretty_print) + printf("0x%016jx: ", (uintmax_t) addr); + else + printf("0x%016jx\n", (uintmax_t) addr); + } } if (func) { if (funcname == NULL) - if ((funcname = strdup(unknown)) == NULL) - err(EXIT_FAILURE, "strdup"); - if (demangle && - !elftc_demangle(funcname, demangled, sizeof(demangled), 0)) - printf("%s\n", demangled); - else - printf("%s\n", funcname); - free(funcname); + funcname = unknown; + if (demangle && !elftc_demangle(funcname, demangled, + sizeof(demangled), 0)) { + if (pretty_print) + printf("%s at ", demangled); + else + printf("%s\n", demangled); + } else { + if (pretty_print) + printf("%s at ", funcname); + else + printf("%s\n", funcname); + } } (void) printf("%s:%ju\n", base ? basename(file) : file, lineno); + if (ret == DW_DLV_OK && inlines && cu != NULL && + cu->srcfiles != NULL && f != NULL && f->inlined_caller != NULL) + print_inlines(cu, f->inlined_caller, f->call_file, + f->call_line); + if (die != NULL) dwarf_dealloc(dbg, die, DW_DLA_DIE); @@ -420,9 +656,12 @@ main(int argc, char **argv) exe = NULL; section = NULL; - while ((opt = getopt_long(argc, argv, "b:Ce:fj:sHV", longopts, NULL)) != - -1) { + while ((opt = getopt_long(argc, argv, "ab:Ce:fij:psHV", longopts, + NULL)) != -1) { switch (opt) { + case 'a': + print_addr = 1; + break; case 'b': /* ignored */ break; @@ -435,9 +674,15 @@ main(int argc, char **argv) case 'f': func = 1; break; + case 'i': + inlines = 1; + break; case 'j': section = optarg; break; + case 'p': + pretty_print = 1; + break; case 's': base = 1; break; @@ -472,10 +717,10 @@ main(int argc, char **argv) if (argc > 0) for (i = 0; i < argc; i++) - translate(dbg, argv[i]); + translate(dbg, e, argv[i]); else while (fgets(line, sizeof(line), stdin) != NULL) { - translate(dbg, line); + translate(dbg, e, line); fflush(stdout); } Modified: vendor/elftoolchain/dist/common/elfdefinitions.h ============================================================================== --- vendor/elftoolchain/dist/common/elfdefinitions.h Fri Dec 11 20:05:07 2015 (r292117) +++ vendor/elftoolchain/dist/common/elfdefinitions.h Fri Dec 11 20:13:36 2015 (r292118) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfdefinitions.h 3247 2015-09-22 16:57:51Z emaste $ + * $Id: elfdefinitions.h 3253 2015-10-10 18:31:33Z kaiwang27 $ */ /* @@ -1659,25 +1659,38 @@ _ELF_DEFINE_RELOC(R_IA_64_DTPREL64MSB, _ELF_DEFINE_RELOC(R_IA_64_DTPREL64LSB, 0xB7) \ _ELF_DEFINE_RELOC(R_IA_64_LTOFF_DTPREL22, 0xBA) -#define _ELF_DEFINE_MIPS_RELOCATIONS() \ -_ELF_DEFINE_RELOC(R_MIPS_NONE, 0) \ -_ELF_DEFINE_RELOC(R_MIPS_16, 1) \ -_ELF_DEFINE_RELOC(R_MIPS_32, 2) \ -_ELF_DEFINE_RELOC(R_MIPS_REL32, 3) \ -_ELF_DEFINE_RELOC(R_MIPS_26, 4) \ -_ELF_DEFINE_RELOC(R_MIPS_HI16, 5) \ -_ELF_DEFINE_RELOC(R_MIPS_LO16, 6) \ -_ELF_DEFINE_RELOC(R_MIPS_GPREL16, 7) \ -_ELF_DEFINE_RELOC(R_MIPS_LITERAL, 8) \ -_ELF_DEFINE_RELOC(R_MIPS_GOT16, 9) \ -_ELF_DEFINE_RELOC(R_MIPS_PC16, 10) \ -_ELF_DEFINE_RELOC(R_MIPS_CALL16, 11) \ -_ELF_DEFINE_RELOC(R_MIPS_GPREL32, 12) \ -_ELF_DEFINE_RELOC(R_MIPS_64, 18) \ -_ELF_DEFINE_RELOC(R_MIPS_GOTHI16, 21) \ -_ELF_DEFINE_RELOC(R_MIPS_GOTLO16, 22) \ -_ELF_DEFINE_RELOC(R_MIPS_CALLHI16, 30) \ -_ELF_DEFINE_RELOC(R_MIPS_CALLLO16, 31) +#define _ELF_DEFINE_MIPS_RELOCATIONS() \ +_ELF_DEFINE_RELOC(R_MIPS_NONE, 0) \ +_ELF_DEFINE_RELOC(R_MIPS_16, 1) \ +_ELF_DEFINE_RELOC(R_MIPS_32, 2) \ +_ELF_DEFINE_RELOC(R_MIPS_REL32, 3) \ +_ELF_DEFINE_RELOC(R_MIPS_26, 4) \ +_ELF_DEFINE_RELOC(R_MIPS_HI16, 5) \ +_ELF_DEFINE_RELOC(R_MIPS_LO16, 6) \ +_ELF_DEFINE_RELOC(R_MIPS_GPREL16, 7) \ +_ELF_DEFINE_RELOC(R_MIPS_LITERAL, 8) \ +_ELF_DEFINE_RELOC(R_MIPS_GOT16, 9) \ +_ELF_DEFINE_RELOC(R_MIPS_PC16, 10) \ +_ELF_DEFINE_RELOC(R_MIPS_CALL16, 11) \ +_ELF_DEFINE_RELOC(R_MIPS_GPREL32, 12) \ +_ELF_DEFINE_RELOC(R_MIPS_64, 18) \ +_ELF_DEFINE_RELOC(R_MIPS_GOTHI16, 21) \ +_ELF_DEFINE_RELOC(R_MIPS_GOTLO16, 22) \ +_ELF_DEFINE_RELOC(R_MIPS_CALLHI16, 30) \ +_ELF_DEFINE_RELOC(R_MIPS_CALLLO16, 31) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_DTPMOD32, 38) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_DTPREL32, 39) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_DTPMOD64, 40) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_DTPREL64, 41) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_GD, 42) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_LDM, 43) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_DTPREL_HI16, 44) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_DTPREL_LO16, 45) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_GOTTPREL, 46) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_TPREL32, 47) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_TPREL64, 48) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_TPREL_HI16, 49) \ +_ELF_DEFINE_RELOC(R_MIPS_TLS_TPREL_LO16, 50) #define _ELF_DEFINE_PPC32_RELOCATIONS() \ _ELF_DEFINE_RELOC(R_PPC_NONE, 0) \ Modified: vendor/elftoolchain/dist/elfcopy/binary.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/binary.c Fri Dec 11 20:05:07 2015 (r292117) +++ vendor/elftoolchain/dist/elfcopy/binary.c Fri Dec 11 20:13:36 2015 (r292118) @@ -35,7 +35,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: binary.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: binary.c 3270 2015-12-11 18:48:56Z emaste $"); /* * Convert ELF object to `binary'. Sections with SHF_ALLOC flag set @@ -140,6 +140,7 @@ create_elf_from_binary(struct elfcopy *e GElf_Shdr sh; void *content; uint64_t off, data_start, data_end, data_size; + char *sym_basename, *p; /* Reset internal section list. */ if (!TAILQ_EMPTY(&ecp->v_sec)) @@ -210,8 +211,13 @@ create_elf_from_binary(struct elfcopy *e /* Count in .symtab and .strtab section headers. */ shtab->sz += gelf_fsize(ecp->eout, ELF_T_SHDR, 2, EV_CURRENT); + if ((sym_basename = strdup(ifn)) == NULL) + err(1, "strdup"); + p = sym_basename; + while ((p = strchr(p, '.')) != NULL) + *p++ = '_'; #define _GEN_SYMNAME(S) do { \ - snprintf(name, sizeof(name), "%s%s%s", "_binary_", ifn, S); \ + snprintf(name, sizeof(name), "%s%s%s", "_binary_", sym_basename, S); \ } while (0) /* @@ -233,6 +239,7 @@ create_elf_from_binary(struct elfcopy *e finalize_external_symtab(ecp); create_symtab_data(ecp); #undef _GEN_SYMNAME + free(sym_basename); /* * Write the underlying ehdr. Note that it should be called Modified: vendor/elftoolchain/dist/elfcopy/elfcopy.1 ============================================================================== --- vendor/elftoolchain/dist/elfcopy/elfcopy.1 Fri Dec 11 20:05:07 2015 (r292117) +++ vendor/elftoolchain/dist/elfcopy/elfcopy.1 Fri Dec 11 20:13:36 2015 (r292118) @@ -21,9 +21,9 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elfcopy.1 3195 2015-05-12 17:22:19Z emaste $ +.\" $Id: elfcopy.1 3266 2015-12-07 15:38:26Z emaste $ .\" -.Dd March 27, 2015 +.Dd December 7, 2015 .Os .Dt ELFCOPY 1 .Sh NAME @@ -47,6 +47,7 @@ .Op Fl p | Fl -preserve-dates .Op Fl w | Fl -wildcard .Op Fl x | Fl -discard-all +.Op Fl -add-gnu-debuglink Ns = Ns Ar filename .Op Fl -add-section Ar sectionname Ns = Ns Ar filename .Oo .Fl -adjust-section-vma Ar section Ns {+|-|=} Ns Ar val | @@ -165,6 +166,10 @@ Mark the end of a character class. .El .It Fl x | Fl -discard-all Do not copy non-global symbols to the output. +.It Fl -add-gnu-debuglink Ns = Ns Ar filename +Create a .gnu_debuglink section in the output file that references the +debug data in +.Ar filename . .It Fl -add-section Ar sectionname Ns = Ns Ar filename Add a new section to the output file with name .Ar sectionname . Modified: vendor/elftoolchain/dist/elfcopy/main.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/main.c Fri Dec 11 20:05:07 2015 (r292117) +++ vendor/elftoolchain/dist/elfcopy/main.c Fri Dec 11 20:13:36 2015 (r292118) @@ -39,7 +39,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3216 2015-05-23 21:16:36Z kaiwang27 $"); +ELFTC_VCSID("$Id: main.c 3268 2015-12-07 20:30:55Z emaste $"); enum options { @@ -1375,11 +1375,13 @@ Usage: %s [options] infile [outfile]\n\ -w | --wildcard Use shell-style patterns to name symbols.\n\ -x | --discard-all Do not copy non-globals to the output.\n\ -I FORMAT | --input-target=FORMAT\n\ - (Accepted but ignored).\n\ + Specify object format for the input file.\n\ -K SYM | --keep-symbol=SYM Copy symbol SYM to the output.\n\ -L SYM | --localize-symbol=SYM\n\ Make symbol SYM local to the output file.\n\ -N SYM | --strip-symbol=SYM Do not copy symbol SYM to the output.\n\ + -O FORMAT | --output-target=FORMAT\n\ + Specify object format for the output file.\n\ -R NAME | --remove-section=NAME\n\ Remove the named section.\n\ -S | --strip-all Remove all symbol and relocation information\n\ Modified: vendor/elftoolchain/dist/elfcopy/sections.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/sections.c Fri Dec 11 20:05:07 2015 (r292117) +++ vendor/elftoolchain/dist/elfcopy/sections.c Fri Dec 11 20:13:36 2015 (r292118) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: sections.c 3225 2015-06-06 02:35:23Z kaiwang27 $"); +ELFTC_VCSID("$Id: sections.c 3272 2015-12-11 20:00:54Z kaiwang27 $"); static void add_gnu_debuglink(struct elfcopy *ecp); static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc); @@ -457,11 +457,17 @@ create_scn(struct elfcopy *ecp) /* * If strip action is STRIP_NONDEBUG(only keep debug), - * change sections flags of loadable sections to SHF_NOBITS, - * and the content of those sections will be ignored. + * change sections type of loadable sections and section + * groups to SHT_NOBITS, and the content of those sections + * will be discarded. However, SHT_NOTE sections should + * be kept. */ - if (ecp->strip == STRIP_NONDEBUG && (ish.sh_flags & SHF_ALLOC)) - s->type = SHT_NOBITS; + if (ecp->strip == STRIP_NONDEBUG) { + if (((ish.sh_flags & SHF_ALLOC) || + (ish.sh_flags & SHF_GROUP)) && + ish.sh_type != SHT_NOTE) + s->type = SHT_NOBITS; + } check_section_rename(ecp, s); Modified: vendor/elftoolchain/dist/elfcopy/segments.c ============================================================================== --- vendor/elftoolchain/dist/elfcopy/segments.c Fri Dec 11 20:05:07 2015 (r292117) +++ vendor/elftoolchain/dist/elfcopy/segments.c Fri Dec 11 20:13:36 2015 (r292118) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: segments.c 3196 2015-05-12 17:33:48Z emaste $"); +ELFTC_VCSID("$Id: segments.c 3269 2015-12-11 18:38:43Z kaiwang27 $"); static void insert_to_inseg_list(struct segment *seg, struct section *sec); @@ -77,8 +77,6 @@ add_to_inseg_list(struct elfcopy *ecp, s if (s->off + s->sz > seg->off + seg->fsz && s->type != SHT_NOBITS) continue; - if (s->off + s->sz > seg->off + seg->msz) - continue; if (s->vma + s->sz > seg->addr + seg->msz) continue; Modified: vendor/elftoolchain/dist/libelf/elf_data.c ============================================================================== --- vendor/elftoolchain/dist/libelf/elf_data.c Fri Dec 11 20:05:07 2015 (r292117) +++ vendor/elftoolchain/dist/libelf/elf_data.c Fri Dec 11 20:13:36 2015 (r292118) @@ -32,7 +32,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: elf_data.c 3177 2015-03-30 18:19:41Z emaste $"); +ELFTC_VCSID("$Id: elf_data.c 3258 2015-11-20 18:59:43Z emaste $"); Elf_Data * elf_getdata(Elf_Scn *s, Elf_Data *ed) @@ -253,6 +253,12 @@ elf_rawdata(Elf_Scn *s, Elf_Data *ed) return (NULL); } + if (sh_type != SHT_NOBITS && + sh_offset + sh_size > (uint64_t) e->e_rawsize) { + LIBELF_SET_ERROR(SECTION, 0); + return (NULL); + } + if ((d = _libelf_allocate_data(s)) == NULL) return (NULL); Modified: vendor/elftoolchain/dist/readelf/readelf.c ============================================================================== --- vendor/elftoolchain/dist/readelf/readelf.c Fri Dec 11 20:05:07 2015 (r292117) +++ vendor/elftoolchain/dist/readelf/readelf.c Fri Dec 11 20:13:36 2015 (r292118) @@ -47,7 +47,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: readelf.c 3250 2015-10-06 13:56:15Z emaste $"); +ELFTC_VCSID("$Id: readelf.c 3271 2015-12-11 18:53:08Z kaiwang27 $"); /* * readelf(1) options. @@ -256,7 +256,7 @@ static const char *dt_type(unsigned int static void dump_ar(struct readelf *re, int); static void dump_arm_attributes(struct readelf *re, uint8_t *p, uint8_t *pe); static void dump_attributes(struct readelf *re); -static uint8_t *dump_compatibility_tag(uint8_t *p); +static uint8_t *dump_compatibility_tag(uint8_t *p, uint8_t *pe); static void dump_dwarf(struct readelf *re); static void dump_dwarf_abbrev(struct readelf *re); static void dump_dwarf_aranges(struct readelf *re); @@ -306,7 +306,7 @@ static void dump_ppc_attributes(uint8_t static void dump_section_groups(struct readelf *re); static void dump_symtab(struct readelf *re, int i); static void dump_symtabs(struct readelf *re); -static uint8_t *dump_unknown_tag(uint64_t tag, uint8_t *p); +static uint8_t *dump_unknown_tag(uint64_t tag, uint8_t *p, uint8_t *pe); static void dump_ver(struct readelf *re); static void dump_verdef(struct readelf *re, int dump); static void dump_verneed(struct readelf *re, int dump); @@ -332,6 +332,7 @@ static const char *note_type_gnu(unsigne static const char *note_type_netbsd(unsigned int nt); static const char *note_type_openbsd(unsigned int nt); static const char *note_type_unknown(unsigned int nt); +static const char *note_type_xen(unsigned int nt); static const char *option_kind(uint8_t kind); static const char *phdr_type(unsigned int ptype); static const char *ppc_abi_fp(uint64_t fp); @@ -357,8 +358,8 @@ static uint64_t _read_msb(Elf_Data *d, u int bytes_to_read); static uint64_t _decode_lsb(uint8_t **data, int bytes_to_read); static uint64_t _decode_msb(uint8_t **data, int bytes_to_read); -static int64_t _decode_sleb128(uint8_t **dp); -static uint64_t _decode_uleb128(uint8_t **dp); +static int64_t _decode_sleb128(uint8_t **dp, uint8_t *dpe); +static uint64_t _decode_uleb128(uint8_t **dp, uint8_t *dpe); static struct eflags_desc arm_eflags_desc[] = { {EF_ARM_RELEXEC, "relocatable executable"}, @@ -1170,10 +1171,14 @@ r_type(unsigned int mach, unsigned int t case 10: return "R_ARM_THM_PC22"; case 11: return "R_ARM_THM_PC8"; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 11 20:14:21 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48E43A0482C; Fri, 11 Dec 2015 20:14:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F2A2F1243; Fri, 11 Dec 2015 20:14:20 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBKEKAX089506; Fri, 11 Dec 2015 20:14:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBKEKRI089505; Fri, 11 Dec 2015 20:14:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512112014.tBBKEKRI089505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 11 Dec 2015 20:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292119 - vendor/elftoolchain/elftoolchain-r3272 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 20:14:21 -0000 Author: emaste Date: Fri Dec 11 20:14:19 2015 New Revision: 292119 URL: https://svnweb.freebsd.org/changeset/base/292119 Log: Tag elftoolchain-r3272 Added: vendor/elftoolchain/elftoolchain-r3272/ - copied from r292118, vendor/elftoolchain/dist/ From owner-svn-src-all@freebsd.org Fri Dec 11 20:28:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3119B9D7388; Fri, 11 Dec 2015 20:28:29 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F26CB1B9F; Fri, 11 Dec 2015 20:28:28 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBKSSh4092976; Fri, 11 Dec 2015 20:28:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBKSRtn092966; Fri, 11 Dec 2015 20:28:27 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201512112028.tBBKSRtn092966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 11 Dec 2015 20:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292120 - in head/contrib/elftoolchain: addr2line common elfcopy libelf readelf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 20:28:29 -0000 Author: emaste Date: Fri Dec 11 20:28:27 2015 New Revision: 292120 URL: https://svnweb.freebsd.org/changeset/base/292120 Log: Update to ELF Tool Chain r3272 Highlights (not already in the FreeBSD tree): - addr2line: Speed up and support searching inlined functions - addr2line: Support -i, -a, -p options - readelf: Add some ARM relocation types - readelf, libelf: Avoid reading beyond end of buffer/file Relnotes: Yes Sponsored by: The FreeBSD Foundation Modified: head/contrib/elftoolchain/addr2line/addr2line.1 head/contrib/elftoolchain/addr2line/addr2line.c head/contrib/elftoolchain/common/elfdefinitions.h head/contrib/elftoolchain/elfcopy/binary.c head/contrib/elftoolchain/elfcopy/elfcopy.1 head/contrib/elftoolchain/elfcopy/main.c head/contrib/elftoolchain/elfcopy/sections.c head/contrib/elftoolchain/elfcopy/segments.c head/contrib/elftoolchain/libelf/elf_data.c head/contrib/elftoolchain/readelf/readelf.c Directory Properties: head/contrib/elftoolchain/ (props changed) Modified: head/contrib/elftoolchain/addr2line/addr2line.1 ============================================================================== --- head/contrib/elftoolchain/addr2line/addr2line.1 Fri Dec 11 20:14:19 2015 (r292119) +++ head/contrib/elftoolchain/addr2line/addr2line.1 Fri Dec 11 20:28:27 2015 (r292120) @@ -22,9 +22,9 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: addr2line.1 3195 2015-05-12 17:22:19Z emaste $ +.\" $Id: addr2line.1 3263 2015-11-30 04:25:54Z kaiwang27 $ .\" -.Dd July 25, 2010 +.Dd November 30, 2015 .Os .Dt ADDR2LINE 1 .Sh NAME @@ -32,10 +32,13 @@ .Nd translate program addresses to source file names and line numbers .Sh SYNOPSIS .Nm +.Op Fl a | Fl -addresses .Op Fl b Ar target | Fl -target Ns = Ns Ar target .Op Fl e Ar pathname | Fl -exe Ns = Ns Ar pathname .Op Fl f | Fl -functions +.Op Fl i | Fl -inlines .Op Fl j Ar sectionname | Fl -section Ns = Ns Ar sectionname +.Op Fl p | Fl -pretty-print .Op Fl s | Fl -basename .Op Fl C | Fl -demangle .Op Fl H | Fl -help @@ -69,6 +72,8 @@ The .Nm utility recognizes the following options: .Bl -tag -width indent +.It Fl a | Fl -addresses +Display the address prior to the line number information. .It Fl b Ar target | Fl -target Ns = Ns Ar target This option is recognized by .Nm @@ -84,11 +89,17 @@ will use the file .Dq Pa a.out . .It Fl f | Fl -functions Display function names in addition to file and line number information. +.It Fl i | Fl -inlines +If the address specified belongs to an inlined function, also display the line +number information for its caller, recursively until the first non-inlined +caller. .It Fl j Ar sectionname | Fl -section Ns = Ns Ar sectionname The values specified by arguments .Ar hexaddress are to be treated as offsets into the section named .Ar sectionname . +.It Fl p | -pretty-print +Display the line number information on one line, in human readable manner. .It Fl s | -basename Display only the base name for each file name. .It Fl C | Fl -demangle @@ -115,6 +126,18 @@ to program address .Ar hexaddress , followed by a line with the file name and line number. .Pp +If the +.Fl p +option was specified, +.Nm +will print line number information and function name on one line in +human readable manner. If the +.Fl i +option was also specified, +.Nm +will print the caller function information prefixed with +.Dq (inlined by) . +.Pp The .Nm utility prints the file name and line number using the format Modified: head/contrib/elftoolchain/addr2line/addr2line.c ============================================================================== --- head/contrib/elftoolchain/addr2line/addr2line.c Fri Dec 11 20:14:19 2015 (r292119) +++ head/contrib/elftoolchain/addr2line/addr2line.c Fri Dec 11 20:28:27 2015 (r292120) @@ -37,33 +37,64 @@ #include #include +#include "uthash.h" #include "_elftc.h" -ELFTC_VCSID("$Id: addr2line.c 3249 2015-10-04 08:11:30Z kaiwang27 $"); +ELFTC_VCSID("$Id: addr2line.c 3264 2015-11-30 05:38:14Z kaiwang27 $"); + +struct Func { + char *name; + Dwarf_Unsigned lopc; + Dwarf_Unsigned hipc; + Dwarf_Unsigned call_file; + Dwarf_Unsigned call_line; + Dwarf_Ranges *ranges; + Dwarf_Signed ranges_cnt; + struct Func *inlined_caller; + STAILQ_ENTRY(Func) next; +}; + +struct CU { + Dwarf_Off off; + Dwarf_Unsigned lopc; + Dwarf_Unsigned hipc; + char **srcfiles; + Dwarf_Signed nsrcfiles; + STAILQ_HEAD(, Func) funclist; + UT_hash_handle hh; +}; static struct option longopts[] = { + {"addresses", no_argument, NULL, 'a'}, {"target" , required_argument, NULL, 'b'}, {"demangle", no_argument, NULL, 'C'}, {"exe", required_argument, NULL, 'e'}, {"functions", no_argument, NULL, 'f'}, + {"inlines", no_argument, NULL, 'i'}, {"section", required_argument, NULL, 'j'}, + {"pretty-print", no_argument, NULL, 'p'}, {"basename", no_argument, NULL, 's'}, {"help", no_argument, NULL, 'H'}, {"version", no_argument, NULL, 'V'}, {NULL, 0, NULL, 0} }; -static int demangle, func, base; +static int demangle, func, base, inlines, print_addr, pretty_print; static char unknown[] = { '?', '?', '\0' }; static Dwarf_Addr section_base; +static struct CU *culist; #define USAGE_MESSAGE "\ Usage: %s [options] hexaddress...\n\ Map program addresses to source file names and line numbers.\n\n\ Options:\n\ + -a | --addresses Display address prior to line number info.\n\ -b TGT | --target=TGT (Accepted but ignored).\n\ -e EXE | --exe=EXE Use program \"EXE\" to translate addresses.\n\ -f | --functions Display function names.\n\ + -i | --inlines Display caller info for inlined functions.\n\ -j NAME | --section=NAME Values are offsets into section \"NAME\".\n\ + -p | --pretty-print Display line number info and function name\n\ + in human readable manner.\n\ -s | --basename Only show the base name for each file name.\n\ -C | --demangle Demangle C++ names.\n\ -H | --help Print a help message.\n\ @@ -122,71 +153,160 @@ handle_high_pc(Dwarf_Die die, Dwarf_Unsi return (DW_DLV_OK); } +static struct Func * +search_func(struct CU *cu, Dwarf_Unsigned addr) +{ + struct Func *f, *f0; + Dwarf_Unsigned lopc, hipc, addr_base; + int i; + + f0 = NULL; + + STAILQ_FOREACH(f, &cu->funclist, next) { + if (f->ranges != NULL) { + addr_base = 0; + for (i = 0; i < f->ranges_cnt; i++) { + if (f->ranges[i].dwr_type == DW_RANGES_END) + break; + if (f->ranges[i].dwr_type == + DW_RANGES_ADDRESS_SELECTION) { + addr_base = f->ranges[i].dwr_addr2; + continue; + } + + /* DW_RANGES_ENTRY */ + lopc = f->ranges[i].dwr_addr1 + addr_base; + hipc = f->ranges[i].dwr_addr2 + addr_base; + if (addr >= lopc && addr < hipc) { + if (f0 == NULL || + (lopc >= f0->lopc && + hipc <= f0->hipc)) { + f0 = f; + f0->lopc = lopc; + f0->hipc = hipc; + break; + } + } + } + } else if (addr >= f->lopc && addr < f->hipc) { + if (f0 == NULL || + (f->lopc >= f0->lopc && f->hipc <= f0->hipc)) + f0 = f; + } + } + + return (f0); +} + static void -search_func(Dwarf_Debug dbg, Dwarf_Die die, Dwarf_Addr addr, char **rlt_func) +collect_func(Dwarf_Debug dbg, Dwarf_Die die, struct Func *parent, struct CU *cu) { - Dwarf_Die ret_die, spec_die; + Dwarf_Die ret_die, abst_die, spec_die; Dwarf_Error de; Dwarf_Half tag; - Dwarf_Unsigned lopc, hipc; + Dwarf_Unsigned lopc, hipc, ranges_off; + Dwarf_Signed ranges_cnt; Dwarf_Off ref; - Dwarf_Attribute sub_at, spec_at; - char *func0; - const char *func1; - int ret; + Dwarf_Attribute abst_at, spec_at; + Dwarf_Ranges *ranges; + const char *funcname; + struct Func *f; + int found_ranges, ret; - if (*rlt_func != NULL) - goto done; + f = NULL; + abst_die = spec_die = NULL; if (dwarf_tag(die, &tag, &de)) { warnx("dwarf_tag: %s", dwarf_errmsg(de)); goto cont_search; } - if (tag == DW_TAG_subprogram) { + if (tag == DW_TAG_subprogram || tag == DW_TAG_entry_point || + tag == DW_TAG_inlined_subroutine) { + /* + * Function address range can be specified by either + * a DW_AT_ranges attribute which points to a range list or + * by a pair of DW_AT_low_pc and DW_AT_high_pc attributes. + */ + ranges = NULL; + ranges_cnt = 0; + found_ranges = 0; + if (dwarf_attrval_unsigned(die, DW_AT_ranges, &ranges_off, + &de) == DW_DLV_OK && + dwarf_get_ranges(dbg, (Dwarf_Off) ranges_off, &ranges, + &ranges_cnt, NULL, &de) == DW_DLV_OK) { + if (ranges != NULL && ranges_cnt > 0) { + found_ranges = 1; + goto get_func_name; + } + } + + /* + * Search for DW_AT_low_pc/DW_AT_high_pc if ranges pointer + * not found. + */ if (dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, &de) || dwarf_attrval_unsigned(die, DW_AT_high_pc, &hipc, &de)) goto cont_search; if (handle_high_pc(die, lopc, &hipc) != DW_DLV_OK) goto cont_search; - if (addr < lopc || addr >= hipc) - goto cont_search; - /* Found it! */ + get_func_name: + /* + * Most common case the function name is stored in DW_AT_name + * attribute. + */ + if (dwarf_attrval_string(die, DW_AT_name, &funcname, &de) == + DW_DLV_OK) + goto add_func; - if ((*rlt_func = strdup(unknown)) == NULL) - err(EXIT_FAILURE, "strdup"); - ret = dwarf_attr(die, DW_AT_name, &sub_at, &de); - if (ret == DW_DLV_ERROR) - goto done; - if (ret == DW_DLV_OK) { - if (dwarf_formstring(sub_at, &func0, &de) == - DW_DLV_OK) { - free(*rlt_func); - if ((*rlt_func = strdup(func0)) == NULL) - err(EXIT_FAILURE, "strdup"); - } - goto done; - } + /* + * For inlined function, the actual name is probably in the DIE + * referenced by DW_AT_abstract_origin. (if present) + */ + if (dwarf_attr(die, DW_AT_abstract_origin, &abst_at, &de) == + DW_DLV_OK && + dwarf_global_formref(abst_at, &ref, &de) == DW_DLV_OK && + dwarf_offdie(dbg, ref, &abst_die, &de) == DW_DLV_OK && + dwarf_attrval_string(abst_die, DW_AT_name, &funcname, + &de) == DW_DLV_OK) + goto add_func; /* * If DW_AT_name is not present, but DW_AT_specification is * present, then probably the actual name is in the DIE * referenced by DW_AT_specification. */ - if (dwarf_attr(die, DW_AT_specification, &spec_at, &de)) - goto done; - if (dwarf_global_formref(spec_at, &ref, &de)) - goto done; - if (dwarf_offdie(dbg, ref, &spec_die, &de)) - goto done; - if (dwarf_attrval_string(spec_die, DW_AT_name, &func1, &de) == - DW_DLV_OK) { - free(*rlt_func); - if ((*rlt_func = strdup(func1)) == NULL) - err(EXIT_FAILURE, "strdup"); - } + if (dwarf_attr(die, DW_AT_specification, &spec_at, &de) == + DW_DLV_OK && + dwarf_global_formref(spec_at, &ref, &de) == DW_DLV_OK && + dwarf_offdie(dbg, ref, &spec_die, &de) == DW_DLV_OK && + dwarf_attrval_string(spec_die, DW_AT_name, &funcname, + &de) == DW_DLV_OK) + goto add_func; - goto done; + /* Skip if no name assoicated with this DIE. */ + goto cont_search; + + add_func: + if ((f = calloc(1, sizeof(*f))) == NULL) + err(EXIT_FAILURE, "calloc"); + if ((f->name = strdup(funcname)) == NULL) + err(EXIT_FAILURE, "strdup"); + if (found_ranges) { + f->ranges = ranges; + f->ranges_cnt = ranges_cnt; + } else { + f->lopc = lopc; + f->hipc = hipc; + } + if (tag == DW_TAG_inlined_subroutine) { + f->inlined_caller = parent; + dwarf_attrval_unsigned(die, DW_AT_call_file, + &f->call_file, &de); + dwarf_attrval_unsigned(die, DW_AT_call_line, + &f->call_line, &de); + } + STAILQ_INSERT_TAIL(&cu->funclist, f, next); } cont_search: @@ -194,23 +314,69 @@ cont_search: /* Search children. */ ret = dwarf_child(die, &ret_die, &de); if (ret == DW_DLV_ERROR) - errx(EXIT_FAILURE, "dwarf_child: %s", dwarf_errmsg(de)); - else if (ret == DW_DLV_OK) - search_func(dbg, ret_die, addr, rlt_func); + warnx("dwarf_child: %s", dwarf_errmsg(de)); + else if (ret == DW_DLV_OK) { + if (f != NULL) + collect_func(dbg, ret_die, f, cu); + else + collect_func(dbg, ret_die, parent, cu); + } /* Search sibling. */ ret = dwarf_siblingof(dbg, die, &ret_die, &de); if (ret == DW_DLV_ERROR) - errx(EXIT_FAILURE, "dwarf_siblingof: %s", dwarf_errmsg(de)); + warnx("dwarf_siblingof: %s", dwarf_errmsg(de)); else if (ret == DW_DLV_OK) - search_func(dbg, ret_die, addr, rlt_func); + collect_func(dbg, ret_die, parent, cu); -done: + /* Cleanup */ dwarf_dealloc(dbg, die, DW_DLA_DIE); + + if (abst_die != NULL) + dwarf_dealloc(dbg, abst_die, DW_DLA_DIE); + + if (spec_die != NULL) + dwarf_dealloc(dbg, spec_die, DW_DLA_DIE); +} + +static void +print_inlines(struct CU *cu, struct Func *f, Dwarf_Unsigned call_file, + Dwarf_Unsigned call_line) +{ + char demangled[1024]; + char *file; + + if (call_file > 0 && (Dwarf_Signed) call_file <= cu->nsrcfiles) + file = cu->srcfiles[call_file - 1]; + else + file = unknown; + + if (pretty_print) + printf(" (inlined by) "); + + if (func) { + if (demangle && !elftc_demangle(f->name, demangled, + sizeof(demangled), 0)) { + if (pretty_print) + printf("%s at ", demangled); + else + printf("%s\n", demangled); + } else { + if (pretty_print) + printf("%s at ", f->name); + else + printf("%s\n", f->name); + } + } + (void) printf("%s:%ju\n", base ? basename(file) : file, call_line); + + if (f->inlined_caller != NULL) + print_inlines(cu, f->inlined_caller, f->call_file, + f->call_line); } static void -translate(Dwarf_Debug dbg, const char* addrstr) +translate(Dwarf_Debug dbg, Elf *e, const char* addrstr) { Dwarf_Die die, ret_die; Dwarf_Line *lbuf; @@ -219,18 +385,20 @@ translate(Dwarf_Debug dbg, const char* a Dwarf_Unsigned lopc, hipc, addr, lineno, plineno; Dwarf_Signed lcount; Dwarf_Addr lineaddr, plineaddr; - char *funcname; + Dwarf_Off off; + struct CU *cu; + struct Func *f; + const char *funcname; char *file, *file0, *pfile; char demangled[1024]; - int i, ret; + int ec, i, ret; addr = strtoull(addrstr, NULL, 16); addr += section_base; lineno = 0; file = unknown; + cu = NULL; die = NULL; - lbuf = NULL; - lcount = 0; while ((ret = dwarf_next_cu_header(dbg, NULL, NULL, NULL, NULL, NULL, &de)) == DW_DLV_OK) { @@ -253,59 +421,46 @@ translate(Dwarf_Debug dbg, const char* a warnx("could not find DW_TAG_compile_unit die"); goto next_cu; } - if (!dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, &de) && - !dwarf_attrval_unsigned(die, DW_AT_high_pc, &hipc, &de)) { + if (dwarf_attrval_unsigned(die, DW_AT_low_pc, &lopc, &de) == + DW_DLV_OK) { + if (dwarf_attrval_unsigned(die, DW_AT_high_pc, &hipc, + &de) == DW_DLV_OK) { + /* + * Check if the address falls into the PC + * range of this CU. + */ + if (handle_high_pc(die, lopc, &hipc) != + DW_DLV_OK) + goto out; + } else { + /* Assume ~0ULL if DW_AT_high_pc not present */ + hipc = ~0ULL; + } + /* - * Check if the address falls into the PC range of - * this CU. + * Record the CU in the hash table for faster lookup + * later. */ - if (handle_high_pc(die, lopc, &hipc) != DW_DLV_OK) - goto next_cu; - if (addr < lopc || addr >= hipc) - goto next_cu; - } - - switch (dwarf_srclines(die, &lbuf, &lcount, &de)) { - case DW_DLV_OK: - break; - case DW_DLV_NO_ENTRY: - /* If a CU lacks debug info, just skip it. */ - goto next_cu; - default: - warnx("dwarf_srclines: %s", dwarf_errmsg(de)); - goto out; - } - - plineaddr = ~0ULL; - plineno = 0; - pfile = unknown; - for (i = 0; i < lcount; i++) { - if (dwarf_lineaddr(lbuf[i], &lineaddr, &de)) { - warnx("dwarf_lineaddr: %s", - dwarf_errmsg(de)); - goto out; - } - if (dwarf_lineno(lbuf[i], &lineno, &de)) { - warnx("dwarf_lineno: %s", + if (dwarf_dieoffset(die, &off, &de) != DW_DLV_OK) { + warnx("dwarf_dieoffset failed: %s", dwarf_errmsg(de)); goto out; } - if (dwarf_linesrc(lbuf[i], &file0, &de)) { - warnx("dwarf_linesrc: %s", - dwarf_errmsg(de)); - } else - file = file0; - if (addr == lineaddr) - goto out; - else if (addr < lineaddr && addr > plineaddr) { - lineno = plineno; - file = pfile; - goto out; + HASH_FIND(hh, culist, &off, sizeof(off), cu); + if (cu == NULL) { + if ((cu = calloc(1, sizeof(*cu))) == NULL) + err(EXIT_FAILURE, "calloc"); + cu->off = off; + cu->lopc = lopc; + cu->hipc = hipc; + STAILQ_INIT(&cu->funclist); + HASH_ADD(hh, culist, off, sizeof(off), cu); } - plineaddr = lineaddr; - plineno = lineno; - pfile = file; + + if (addr >= lopc && addr < hipc) + break; } + next_cu: if (die != NULL) { dwarf_dealloc(dbg, die, DW_DLA_DIE); @@ -313,27 +468,107 @@ translate(Dwarf_Debug dbg, const char* a } } + if (ret != DW_DLV_OK || die == NULL) + goto out; + + switch (dwarf_srclines(die, &lbuf, &lcount, &de)) { + case DW_DLV_OK: + break; + case DW_DLV_NO_ENTRY: + /* If a CU lacks debug info, just skip it. */ + goto out; + default: + warnx("dwarf_srclines: %s", dwarf_errmsg(de)); + goto out; + } + + plineaddr = ~0ULL; + plineno = 0; + pfile = unknown; + for (i = 0; i < lcount; i++) { + if (dwarf_lineaddr(lbuf[i], &lineaddr, &de)) { + warnx("dwarf_lineaddr: %s", dwarf_errmsg(de)); + goto out; + } + if (dwarf_lineno(lbuf[i], &lineno, &de)) { + warnx("dwarf_lineno: %s", dwarf_errmsg(de)); + goto out; + } + if (dwarf_linesrc(lbuf[i], &file0, &de)) { + warnx("dwarf_linesrc: %s", dwarf_errmsg(de)); + } else + file = file0; + if (addr == lineaddr) + goto out; + else if (addr < lineaddr && addr > plineaddr) { + lineno = plineno; + file = pfile; + goto out; + } + plineaddr = lineaddr; + plineno = lineno; + pfile = file; + } + out: + f = NULL; funcname = NULL; - if (ret == DW_DLV_OK && func) { - search_func(dbg, die, addr, &funcname); - die = NULL; + if (ret == DW_DLV_OK && (func || inlines) && cu != NULL) { + if (cu->srcfiles == NULL) + if (dwarf_srcfiles(die, &cu->srcfiles, &cu->nsrcfiles, + &de)) + warnx("dwarf_srcfiles: %s", dwarf_errmsg(de)); + if (STAILQ_EMPTY(&cu->funclist)) { + collect_func(dbg, die, NULL, cu); + die = NULL; + } + f = search_func(cu, addr); + if (f != NULL) + funcname = f->name; + } + + if (print_addr) { + if ((ec = gelf_getclass(e)) == ELFCLASSNONE) { + warnx("gelf_getclass failed: %s", elf_errmsg(-1)); + ec = ELFCLASS64; + } + if (ec == ELFCLASS32) { + if (pretty_print) + printf("0x%08jx: ", (uintmax_t) addr); + else + printf("0x%08jx\n", (uintmax_t) addr); + } else { + if (pretty_print) + printf("0x%016jx: ", (uintmax_t) addr); + else + printf("0x%016jx\n", (uintmax_t) addr); + } } if (func) { if (funcname == NULL) - if ((funcname = strdup(unknown)) == NULL) - err(EXIT_FAILURE, "strdup"); - if (demangle && - !elftc_demangle(funcname, demangled, sizeof(demangled), 0)) - printf("%s\n", demangled); - else - printf("%s\n", funcname); - free(funcname); + funcname = unknown; + if (demangle && !elftc_demangle(funcname, demangled, + sizeof(demangled), 0)) { + if (pretty_print) + printf("%s at ", demangled); + else + printf("%s\n", demangled); + } else { + if (pretty_print) + printf("%s at ", funcname); + else + printf("%s\n", funcname); + } } (void) printf("%s:%ju\n", base ? basename(file) : file, lineno); + if (ret == DW_DLV_OK && inlines && cu != NULL && + cu->srcfiles != NULL && f != NULL && f->inlined_caller != NULL) + print_inlines(cu, f->inlined_caller, f->call_file, + f->call_line); + if (die != NULL) dwarf_dealloc(dbg, die, DW_DLA_DIE); @@ -421,9 +656,12 @@ main(int argc, char **argv) exe = NULL; section = NULL; - while ((opt = getopt_long(argc, argv, "b:Ce:fj:sHV", longopts, NULL)) != - -1) { + while ((opt = getopt_long(argc, argv, "ab:Ce:fij:psHV", longopts, + NULL)) != -1) { switch (opt) { + case 'a': + print_addr = 1; + break; case 'b': /* ignored */ break; @@ -436,9 +674,15 @@ main(int argc, char **argv) case 'f': func = 1; break; + case 'i': + inlines = 1; + break; case 'j': section = optarg; break; + case 'p': + pretty_print = 1; + break; case 's': base = 1; break; @@ -473,10 +717,10 @@ main(int argc, char **argv) if (argc > 0) for (i = 0; i < argc; i++) - translate(dbg, argv[i]); + translate(dbg, e, argv[i]); else while (fgets(line, sizeof(line), stdin) != NULL) { - translate(dbg, line); + translate(dbg, e, line); fflush(stdout); } Modified: head/contrib/elftoolchain/common/elfdefinitions.h ============================================================================== --- head/contrib/elftoolchain/common/elfdefinitions.h Fri Dec 11 20:14:19 2015 (r292119) +++ head/contrib/elftoolchain/common/elfdefinitions.h Fri Dec 11 20:28:27 2015 (r292120) @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: elfdefinitions.h 3247 2015-09-22 16:57:51Z emaste $ + * $Id: elfdefinitions.h 3253 2015-10-10 18:31:33Z kaiwang27 $ */ /* Modified: head/contrib/elftoolchain/elfcopy/binary.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/binary.c Fri Dec 11 20:14:19 2015 (r292119) +++ head/contrib/elftoolchain/elfcopy/binary.c Fri Dec 11 20:28:27 2015 (r292120) @@ -35,7 +35,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: binary.c 3174 2015-03-27 17:13:41Z emaste $"); +ELFTC_VCSID("$Id: binary.c 3270 2015-12-11 18:48:56Z emaste $"); /* * Convert ELF object to `binary'. Sections with SHF_ALLOC flag set Modified: head/contrib/elftoolchain/elfcopy/elfcopy.1 ============================================================================== --- head/contrib/elftoolchain/elfcopy/elfcopy.1 Fri Dec 11 20:14:19 2015 (r292119) +++ head/contrib/elftoolchain/elfcopy/elfcopy.1 Fri Dec 11 20:28:27 2015 (r292120) @@ -21,9 +21,9 @@ .\" out of the use of this software, even if advised of the possibility of .\" such damage. .\" -.\" $Id: elfcopy.1 3195 2015-05-12 17:22:19Z emaste $ +.\" $Id: elfcopy.1 3266 2015-12-07 15:38:26Z emaste $ .\" -.Dd March 27, 2015 +.Dd December 7, 2015 .Os .Dt ELFCOPY 1 .Sh NAME @@ -47,6 +47,7 @@ .Op Fl p | Fl -preserve-dates .Op Fl w | Fl -wildcard .Op Fl x | Fl -discard-all +.Op Fl -add-gnu-debuglink Ns = Ns Ar filename .Op Fl -add-section Ar sectionname Ns = Ns Ar filename .Oo .Fl -adjust-section-vma Ar section Ns {+|-|=} Ns Ar val | @@ -165,6 +166,10 @@ Mark the end of a character class. .El .It Fl x | Fl -discard-all Do not copy non-global symbols to the output. +.It Fl -add-gnu-debuglink Ns = Ns Ar filename +Create a .gnu_debuglink section in the output file that references the +debug data in +.Ar filename . .It Fl -add-section Ar sectionname Ns = Ns Ar filename Add a new section to the output file with name .Ar sectionname . Modified: head/contrib/elftoolchain/elfcopy/main.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/main.c Fri Dec 11 20:14:19 2015 (r292119) +++ head/contrib/elftoolchain/elfcopy/main.c Fri Dec 11 20:28:27 2015 (r292120) @@ -39,7 +39,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: main.c 3216 2015-05-23 21:16:36Z kaiwang27 $"); +ELFTC_VCSID("$Id: main.c 3268 2015-12-07 20:30:55Z emaste $"); enum options { @@ -1375,11 +1375,13 @@ Usage: %s [options] infile [outfile]\n\ -w | --wildcard Use shell-style patterns to name symbols.\n\ -x | --discard-all Do not copy non-globals to the output.\n\ -I FORMAT | --input-target=FORMAT\n\ - (Accepted but ignored).\n\ + Specify object format for the input file.\n\ -K SYM | --keep-symbol=SYM Copy symbol SYM to the output.\n\ -L SYM | --localize-symbol=SYM\n\ Make symbol SYM local to the output file.\n\ -N SYM | --strip-symbol=SYM Do not copy symbol SYM to the output.\n\ + -O FORMAT | --output-target=FORMAT\n\ + Specify object format for the output file.\n\ -R NAME | --remove-section=NAME\n\ Remove the named section.\n\ -S | --strip-all Remove all symbol and relocation information\n\ Modified: head/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/sections.c Fri Dec 11 20:14:19 2015 (r292119) +++ head/contrib/elftoolchain/elfcopy/sections.c Fri Dec 11 20:28:27 2015 (r292120) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: sections.c 3225 2015-06-06 02:35:23Z kaiwang27 $"); +ELFTC_VCSID("$Id: sections.c 3272 2015-12-11 20:00:54Z kaiwang27 $"); static void add_gnu_debuglink(struct elfcopy *ecp); static uint32_t calc_crc32(const char *p, size_t len, uint32_t crc); @@ -457,11 +457,17 @@ create_scn(struct elfcopy *ecp) /* * If strip action is STRIP_NONDEBUG(only keep debug), - * change sections flags of loadable sections to SHF_NOBITS, - * and the content of those sections will be ignored. + * change sections type of loadable sections and section + * groups to SHT_NOBITS, and the content of those sections + * will be discarded. However, SHT_NOTE sections should + * be kept. */ - if (ecp->strip == STRIP_NONDEBUG && (ish.sh_flags & SHF_ALLOC)) - s->type = SHT_NOBITS; + if (ecp->strip == STRIP_NONDEBUG) { + if (((ish.sh_flags & SHF_ALLOC) || + (ish.sh_flags & SHF_GROUP)) && + ish.sh_type != SHT_NOTE) + s->type = SHT_NOBITS; + } check_section_rename(ecp, s); Modified: head/contrib/elftoolchain/elfcopy/segments.c ============================================================================== --- head/contrib/elftoolchain/elfcopy/segments.c Fri Dec 11 20:14:19 2015 (r292119) +++ head/contrib/elftoolchain/elfcopy/segments.c Fri Dec 11 20:28:27 2015 (r292120) @@ -34,7 +34,7 @@ #include "elfcopy.h" -ELFTC_VCSID("$Id: segments.c 3196 2015-05-12 17:33:48Z emaste $"); +ELFTC_VCSID("$Id: segments.c 3269 2015-12-11 18:38:43Z kaiwang27 $"); static void insert_to_inseg_list(struct segment *seg, struct section *sec); @@ -77,8 +77,6 @@ add_to_inseg_list(struct elfcopy *ecp, s if (s->off + s->sz > seg->off + seg->fsz && s->type != SHT_NOBITS) continue; - if (s->off + s->sz > seg->off + seg->msz) - continue; if (s->vma + s->sz > seg->addr + seg->msz) continue; Modified: head/contrib/elftoolchain/libelf/elf_data.c ============================================================================== --- head/contrib/elftoolchain/libelf/elf_data.c Fri Dec 11 20:14:19 2015 (r292119) +++ head/contrib/elftoolchain/libelf/elf_data.c Fri Dec 11 20:28:27 2015 (r292120) @@ -32,7 +32,7 @@ #include "_libelf.h" -ELFTC_VCSID("$Id: elf_data.c 3177 2015-03-30 18:19:41Z emaste $"); +ELFTC_VCSID("$Id: elf_data.c 3258 2015-11-20 18:59:43Z emaste $"); Elf_Data * elf_getdata(Elf_Scn *s, Elf_Data *ed) @@ -253,6 +253,12 @@ elf_rawdata(Elf_Scn *s, Elf_Data *ed) return (NULL); } + if (sh_type != SHT_NOBITS && + sh_offset + sh_size > (uint64_t) e->e_rawsize) { + LIBELF_SET_ERROR(SECTION, 0); + return (NULL); + } + if ((d = _libelf_allocate_data(s)) == NULL) return (NULL); Modified: head/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- head/contrib/elftoolchain/readelf/readelf.c Fri Dec 11 20:14:19 2015 (r292119) +++ head/contrib/elftoolchain/readelf/readelf.c Fri Dec 11 20:28:27 2015 (r292120) @@ -47,7 +47,7 @@ #include "_elftc.h" -ELFTC_VCSID("$Id: readelf.c 3250 2015-10-06 13:56:15Z emaste $"); +ELFTC_VCSID("$Id: readelf.c 3271 2015-12-11 18:53:08Z kaiwang27 $"); /* * readelf(1) options. @@ -256,7 +256,7 @@ static const char *dt_type(unsigned int static void dump_ar(struct readelf *re, int); static void dump_arm_attributes(struct readelf *re, uint8_t *p, uint8_t *pe); static void dump_attributes(struct readelf *re); -static uint8_t *dump_compatibility_tag(uint8_t *p); +static uint8_t *dump_compatibility_tag(uint8_t *p, uint8_t *pe); static void dump_dwarf(struct readelf *re); static void dump_dwarf_abbrev(struct readelf *re); static void dump_dwarf_aranges(struct readelf *re); @@ -306,7 +306,7 @@ static void dump_ppc_attributes(uint8_t static void dump_section_groups(struct readelf *re); static void dump_symtab(struct readelf *re, int i); static void dump_symtabs(struct readelf *re); -static uint8_t *dump_unknown_tag(uint64_t tag, uint8_t *p); +static uint8_t *dump_unknown_tag(uint64_t tag, uint8_t *p, uint8_t *pe); static void dump_ver(struct readelf *re); static void dump_verdef(struct readelf *re, int dump); static void dump_verneed(struct readelf *re, int dump); @@ -358,8 +358,8 @@ static uint64_t _read_msb(Elf_Data *d, u int bytes_to_read); static uint64_t _decode_lsb(uint8_t **data, int bytes_to_read); static uint64_t _decode_msb(uint8_t **data, int bytes_to_read); -static int64_t _decode_sleb128(uint8_t **dp); -static uint64_t _decode_uleb128(uint8_t **dp); +static int64_t _decode_sleb128(uint8_t **dp, uint8_t *dpe); +static uint64_t _decode_uleb128(uint8_t **dp, uint8_t *dpe); static struct eflags_desc arm_eflags_desc[] = { {EF_ARM_RELEXEC, "relocatable executable"}, @@ -1171,10 +1171,14 @@ r_type(unsigned int mach, unsigned int t case 10: return "R_ARM_THM_PC22"; case 11: return "R_ARM_THM_PC8"; case 12: return "R_ARM_AMP_VCALL9"; - case 13: return "R_ARM_SWI24"; + case 13: return "R_ARM_TLS_DESC"; + /* Obsolete R_ARM_SWI24 is also 13 */ case 14: return "R_ARM_THM_SWI8"; case 15: return "R_ARM_XPC25"; case 16: return "R_ARM_THM_XPC22"; + case 17: return "R_ARM_TLS_DTPMOD32"; + case 18: return "R_ARM_TLS_DTPOFF32"; + case 19: return "R_ARM_TLS_TPOFF32"; case 20: return "R_ARM_COPY"; case 21: return "R_ARM_GLOB_DAT"; case 22: return "R_ARM_JUMP_SLOT"; @@ -1183,6 +1187,17 @@ r_type(unsigned int mach, unsigned int t case 25: return "R_ARM_GOTPC"; case 26: return "R_ARM_GOT32"; case 27: return "R_ARM_PLT32"; + case 28: return "R_ARM_CALL"; + case 29: return "R_ARM_JUMP24"; + case 30: return "R_ARM_THM_JUMP24"; + case 31: return "R_ARM_BASE_ABS"; + case 38: return "R_ARM_TARGET1"; + case 40: return "R_ARM_V4BX"; + case 42: return "R_ARM_PREL31"; + case 43: return "R_ARM_MOVW_ABS_NC"; + case 44: return "R_ARM_MOVT_ABS"; + case 45: return "R_ARM_MOVW_PREL_NC"; + case 46: return "R_ARM_MOVT_PREL"; case 100: return "R_ARM_GNU_VTENTRY"; case 101: return "R_ARM_GNU_VTINHERIT"; case 250: return "R_ARM_RSBREL32"; @@ -2847,9 +2862,9 @@ dump_phdr(struct readelf *re) printf(" %2.2d ", i); /* skip NULL section. */ for (j = 1; (size_t)j < re->shnum; j++) - if (re->sl[j].off >= phdr.p_offset && - re->sl[j].off + re->sl[j].sz <= - phdr.p_offset + phdr.p_memsz) + if (re->sl[j].addr >= phdr.p_vaddr && + re->sl[j].addr + re->sl[j].sz <= + phdr.p_vaddr + phdr.p_memsz) printf("%s ", re->sl[j].name); printf("\n"); } @@ -4245,7 +4260,7 @@ dump_section_groups(struct readelf *re) } static uint8_t * -dump_unknown_tag(uint64_t tag, uint8_t *p) +dump_unknown_tag(uint64_t tag, uint8_t *p, uint8_t *pe) { uint64_t val; @@ -4262,7 +4277,7 @@ dump_unknown_tag(uint64_t tag, uint8_t * printf("%s\n", (char *) p); p += strlen((char *) p) + 1; } else { - val = _decode_uleb128(&p); + val = _decode_uleb128(&p, pe); printf("%ju\n", (uintmax_t) val); } @@ -4270,11 +4285,11 @@ dump_unknown_tag(uint64_t tag, uint8_t * } static uint8_t * -dump_compatibility_tag(uint8_t *p) +dump_compatibility_tag(uint8_t *p, uint8_t *pe) { uint64_t val; - val = _decode_uleb128(&p); + val = _decode_uleb128(&p, pe); printf("flag = %ju, vendor = %s\n", val, p); p += strlen((char *) p) + 1; @@ -4291,7 +4306,7 @@ dump_arm_attributes(struct readelf *re, (void) re; while (p < pe) { - tag = _decode_uleb128(&p); + tag = _decode_uleb128(&p, pe); found = desc = 0; for (i = 0; i < sizeof(aeabi_tags) / sizeof(aeabi_tags[0]); i++) { @@ -4300,7 +4315,7 @@ dump_arm_attributes(struct readelf *re, printf(" %s: ", aeabi_tags[i].s_tag); if (aeabi_tags[i].get_desc) { desc = 1; - val = _decode_uleb128(&p); + val = _decode_uleb128(&p, pe); printf("%s\n", aeabi_tags[i].get_desc(val)); } @@ -4310,7 +4325,7 @@ dump_arm_attributes(struct readelf *re, break; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Dec 11 20:45:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C9926A04354; Fri, 11 Dec 2015 20:45:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A150017CB; Fri, 11 Dec 2015 20:45:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBKjd2a099031; Fri, 11 Dec 2015 20:45:39 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBKjdxS099027; Fri, 11 Dec 2015 20:45:39 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512112045.tBBKjdxS099027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 11 Dec 2015 20:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292121 - head/usr.sbin/sesutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 20:45:41 -0000 Author: bapt Date: Fri Dec 11 20:45:39 2015 New Revision: 292121 URL: https://svnweb.freebsd.org/changeset/base/292121 Log: sesutil: Add extra information specific to some SES devices to sesutil map Rework stat2ascii preparing a buffer of what could be printed. This prevent the risk of overflowing a static buffer. Do not print those informations anymore in the "status" but into a new "extra status" only printed if there are actually extra things to print. Now add those extra informations: * Thermal sensor temperature * Cooling devices speed * Voltage sensors, current consumption Tested by: AllanJude Sponsored by: Gandi.net Differential Revision: https://reviews.freebsd.org/D4520 Modified: head/usr.sbin/sesutil/Makefile head/usr.sbin/sesutil/eltsub.c head/usr.sbin/sesutil/eltsub.h head/usr.sbin/sesutil/sesutil.c Modified: head/usr.sbin/sesutil/Makefile ============================================================================== --- head/usr.sbin/sesutil/Makefile Fri Dec 11 20:28:27 2015 (r292120) +++ head/usr.sbin/sesutil/Makefile Fri Dec 11 20:45:39 2015 (r292121) @@ -4,4 +4,6 @@ PROG= sesutil SRCS= sesutil.c eltsub.c MAN= sesutil.8 +LIBADD= sbuf + .include Modified: head/usr.sbin/sesutil/eltsub.c ============================================================================== --- head/usr.sbin/sesutil/eltsub.c Fri Dec 11 20:28:27 2015 (r292120) +++ head/usr.sbin/sesutil/eltsub.c Fri Dec 11 20:45:39 2015 (r292121) @@ -32,6 +32,11 @@ * mjacob@feral.com */ +#include +#include +#include + +#include #include #include #include @@ -43,6 +48,13 @@ #include "eltsub.h" +/* + * offset by +20 degrees. + * The range of the value expresses a temperature between -19 and +235 degrees + * Celsius. A value of 00h is reserved. + */ +#define TEMPERATURE_OFFSET 20 + char * geteltnm(int type) { @@ -134,7 +146,7 @@ geteltnm(int type) return (rbuf); } -static char * +char * scode2ascii(u_char code) { static char rbuf[32]; @@ -173,22 +185,51 @@ scode2ascii(u_char code) return (rbuf); } - -char * -stat2ascii(int eletype, u_char *cstat) +struct sbuf * +stat2sbuf(int eletype, u_char *cstat) { - static char ebuf[256], *scode; + struct sbuf *buf; - scode = scode2ascii(cstat[0]); - sprintf(ebuf, "%s%s%s%s%s%s (0x%02x 0x%02x 0x%02x 0x%02x)", - scode, - (cstat[0] & 0x40) ? ", Prd.Fail" : "", - (cstat[0] & 0x20) ? ", Disabled" : "", - (cstat[0] & 0x10) ? ", Swapped" : "", - ((eletype == ELMTYP_DEVICE || eletype == ELMTYP_ARRAY_DEV) - && (cstat[2] & 0x02)) ? ", LED=Locate" : "", - ((eletype == ELMTYP_DEVICE || eletype == ELMTYP_ARRAY_DEV) - && (cstat[3] & 0x20)) ? ", LED=Fault" : "", - cstat[0], cstat[1], cstat[2], cstat[3]); - return (ebuf); + buf = sbuf_new_auto(); + if (buf == NULL) + err(EXIT_FAILURE, "sbuf_new_auto()"); + + if (cstat[0] & 0x40) + sbuf_printf(buf, "\t\t- Predicted Failure\n"); + if (cstat[0] & 0x20) + sbuf_printf(buf, "\t\t- Disabled\n"); + if (cstat[0] & 0x10) + sbuf_printf(buf, "\t\t- Swapped\n"); + switch (eletype) { + case ELMTYP_DEVICE: + if (cstat[2] & 0x02) + sbuf_printf(buf, "\t\t- LED=locate\n"); + if (cstat[2] & 0x20) + sbuf_printf(buf, "\t\t- LED=fault\n"); + break; + case ELMTYP_ARRAY_DEV: + if (cstat[2] & 0x02) + sbuf_printf(buf, "\t\t- LED=locate\n"); + if (cstat[2] & 0x20) + sbuf_printf(buf, "\t\t- LED=fault\n"); + break; + case ELMTYP_FAN: + sbuf_printf(buf, "\t\t- Speed: %d rpm\n", + (((0x7 & cstat[1]) << 8) + cstat[2]) * 10); + break; + case ELMTYP_THERM: + if (cstat[2]) { + sbuf_printf(buf, "\t\t- Temperature: %d C\n", + cstat[2] - TEMPERATURE_OFFSET); + } else { + sbuf_printf(buf, "\t\t- Temperature: -reserved-\n"); + } + break; + case ELMTYP_VOM: + sbuf_printf(buf, "\t\t- Voltage: %.2f V\n", + be16dec(cstat + 2) / 100.0); + break; + } + sbuf_finish(buf); + return (buf); } Modified: head/usr.sbin/sesutil/eltsub.h ============================================================================== --- head/usr.sbin/sesutil/eltsub.h Fri Dec 11 20:28:27 2015 (r292120) +++ head/usr.sbin/sesutil/eltsub.h Fri Dec 11 20:45:39 2015 (r292121) @@ -32,5 +32,6 @@ * mjacob@feral.com */ -char * geteltnm(int); -char * stat2ascii(int, u_char *); +char *geteltnm(int); +char *scode2ascii(u_char); +struct sbuf *stat2sbuf(int, u_char *); Modified: head/usr.sbin/sesutil/sesutil.c ============================================================================== --- head/usr.sbin/sesutil/sesutil.c Fri Dec 11 20:28:27 2015 (r292120) +++ head/usr.sbin/sesutil/sesutil.c Fri Dec 11 20:45:39 2015 (r292121) @@ -31,6 +31,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include @@ -299,6 +301,7 @@ fault(int argc, char **argv) static int objmap(int argc, char **argv __unused) { + struct sbuf *extra; encioc_elm_devnames_t e_devname; encioc_elm_status_t e_status; encioc_elm_desc_t e_desc; @@ -391,8 +394,10 @@ objmap(int argc, char **argv __unused) } printf("\tElement %u, Type: %s\n", e_ptr[j].elm_idx, geteltnm(e_ptr[j].elm_type)); - printf("\t\tStatus: %s\n", - stat2ascii(e_ptr[j].elm_type, e_status.cstat)); + printf("\t\tStatus: %s (0x%02x 0x%02x 0x%02x 0x%02x)\n", + scode2ascii(e_status.cstat[0]), e_status.cstat[0], + e_status.cstat[1], e_status.cstat[2], + e_status.cstat[3]); if (e_desc.elm_desc_len > 0) { printf("\t\tDescription: %s\n", e_desc.elm_desc_str); @@ -401,6 +406,12 @@ objmap(int argc, char **argv __unused) printf("\t\tDevice Names: %s\n", e_devname.elm_devnames); } + extra = stat2sbuf(e_ptr[j].elm_type, e_status.cstat); + if (sbuf_len(extra) > 0) { + printf("\t\tExtra status:\n%s", + sbuf_data(extra)); + } + sbuf_delete(extra); free(e_devname.elm_devnames); } close(fd); From owner-svn-src-all@freebsd.org Fri Dec 11 21:11:03 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6B1F9D7A09; Fri, 11 Dec 2015 21:11:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 98C0914CF; Fri, 11 Dec 2015 21:11:03 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBLB2eJ005028; Fri, 11 Dec 2015 21:11:02 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBLB2wj005027; Fri, 11 Dec 2015 21:11:02 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201512112111.tBBLB2wj005027@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Fri, 11 Dec 2015 21:11:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292122 - head/usr.sbin/sesutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 21:11:03 -0000 Author: bapt Date: Fri Dec 11 21:11:02 2015 New Revision: 292122 URL: https://svnweb.freebsd.org/changeset/base/292122 Log: Fix sesutil locate when a sesid is passed to locate command Modified: head/usr.sbin/sesutil/sesutil.c Modified: head/usr.sbin/sesutil/sesutil.c ============================================================================== --- head/usr.sbin/sesutil/sesutil.c Fri Dec 11 20:45:39 2015 (r292121) +++ head/usr.sbin/sesutil/sesutil.c Fri Dec 11 21:11:02 2015 (r292122) @@ -172,7 +172,7 @@ sesled(int argc, char **argv, bool setfa sesid = strtoul(disk, &endptr, 10); if (*endptr == '\0') { endptr = strrchr(uflag, '*'); - if (*endptr == '*') { + if (endptr != NULL && *endptr == '*') { warnx("Must specifying a SES device (-u) to use a SES " "id# to identify a disk"); usage(stderr, (setfault ? "fault" : "locate")); From owner-svn-src-all@freebsd.org Fri Dec 11 21:51:01 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EDBEA04158; Fri, 11 Dec 2015 21:51:01 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2333E1357; Fri, 11 Dec 2015 21:51:01 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBLp0am016613; Fri, 11 Dec 2015 21:51:00 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBLp0TE016612; Fri, 11 Dec 2015 21:51:00 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201512112151.tBBLp0TE016612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Fri, 11 Dec 2015 21:51:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292123 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 21:51:01 -0000 Author: rpokala Date: Fri Dec 11 21:50:59 2015 New Revision: 292123 URL: https://svnweb.freebsd.org/changeset/base/292123 Log: [PR 195033] Document mps.enable_ssu mps(4) sends StartStopUnit to SATA direct-access devices during shutdown. Document the tunables which control that behavior. PR: 195033 Reviewed by: scottl Approved by: jhb MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D4456 Modified: head/share/man/man4/mps.4 Modified: head/share/man/man4/mps.4 ============================================================================== --- head/share/man/man4/mps.4 Fri Dec 11 21:11:02 2015 (r292122) +++ head/share/man/man4/mps.4 Fri Dec 11 21:50:59 2015 (r292123) @@ -34,7 +34,7 @@ .\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $ .\" $FreeBSD$ .\" -.Dd January 3, 2013 +.Dd December 9, 2015 .Dt MPS 4 .Os .Sh NAME @@ -129,6 +129,8 @@ driver instance, set the following tunab dev.mps.X.disable_msix=1 .Ed .Pp +where X is the adapter number. +.Pp To set the maximum number of DMA chains allocated for all adapters, set the following variable in .Xr loader.conf 5 : @@ -166,6 +168,39 @@ The maximum number of active I/O command dev.mps.X.io_cmds_highwater .Xr sysctl 8 variable. +.Pp +The adapter can issue the +.Sy StartStopUnit +SCSI command to SATA direct-access devices during shutdown, to allow the +device to quiesce before being powered down. +To control this feature for all adapters, set the +.Bd -literal -offset indent +hw.mps.enable_ssu +.Ed +.Pp +tunable value in +.Xr loader.conf 5 +to one of the following values: +.Bl -tag -width 6n -offset indent +.It 0 +Do not send SSU to either HDDs or SSDs. +.It 1 +Send SSU to SSDs, but not to HDDs; this is the default value. +.It 2 +Send SSU to HDDs, but not to SSDs. +.It 3 +Send SSU to both HDDs and SSDs. +.El +.Pp +To control the feature for a specific adapter, set the following tunable +value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mps.X.enable_ssu +.Ed +.Pp +where X is the adapter number. +The same set of values are valid as for all adapters. .Sh DEBUGGING To enable debugging prints from the .Nm @@ -218,7 +253,7 @@ This man page was written by This driver has a couple of known shortcomings: .Bl -bullet -compact .It -No userland utility available (e.g. +No userland utility available (e.g., .Xr mptutil 8 ) . .It The driver probes devices sequentially. From owner-svn-src-all@freebsd.org Fri Dec 11 22:55:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3502C9D7FFE; Fri, 11 Dec 2015 22:55:26 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 01B731FF1; Fri, 11 Dec 2015 22:55:25 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBMtPdM037218; Fri, 11 Dec 2015 22:55:25 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBMtNTK037201; Fri, 11 Dec 2015 22:55:23 GMT (envelope-from br@FreeBSD.org) Message-Id: <201512112255.tBBMtNTK037201@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Fri, 11 Dec 2015 22:55:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292124 - in head: . etc/etc.riscv lib/csu/riscv lib/libc/riscv lib/libthr/arch/riscv lib/msun/riscv share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 22:55:26 -0000 Author: br Date: Fri Dec 11 22:55:23 2015 New Revision: 292124 URL: https://svnweb.freebsd.org/changeset/base/292124 Log: Start support for the RISC-V 64-bit architecture developed by UC Berkeley. RISC-V is a new ISA designed to support computer research and education, and is now become a standard open architecture for industry implementations. This is a minimal set of changes required to run 'make kernel-toolchain' using external (GNU) toolchain. The FreeBSD/RISC-V project home: https://wiki.freebsd.org/riscv. Reviewed by: andrew, bdrewery, emaste, imp Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D4445 Added: head/etc/etc.riscv/ head/etc/etc.riscv/ttys (contents, props changed) head/lib/csu/riscv/ head/lib/csu/riscv/Makefile (contents, props changed) head/lib/csu/riscv/crt1.c (contents, props changed) head/lib/csu/riscv/crti.S (contents, props changed) head/lib/csu/riscv/crtn.S (contents, props changed) head/lib/libc/riscv/ head/lib/libc/riscv/Makefile.inc (contents, props changed) head/lib/libthr/arch/riscv/ head/lib/libthr/arch/riscv/Makefile.inc (contents, props changed) head/lib/msun/riscv/ head/lib/msun/riscv/Makefile.inc (contents, props changed) head/lib/msun/riscv/fenv.h (contents, props changed) Modified: head/Makefile head/Makefile.inc1 head/share/mk/bsd.cpu.mk head/share/mk/bsd.endian.mk head/share/mk/bsd.sys.mk head/share/mk/local.meta.sys.mk head/share/mk/src.opts.mk head/share/mk/sys.mk Modified: head/Makefile ============================================================================== --- head/Makefile Fri Dec 11 21:50:59 2015 (r292123) +++ head/Makefile Fri Dec 11 22:55:23 2015 (r292124) @@ -180,7 +180,7 @@ _MAKE= PATH=${PATH} ${SUB_MAKE} -f Makef _TARGET_ARCH= ${TARGET:S/pc98/i386/:S/arm64/aarch64/} .elif !defined(TARGET) && defined(TARGET_ARCH) && \ ${TARGET_ARCH} != ${MACHINE_ARCH} -_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/} +_TARGET= ${TARGET_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/aarch64/arm64/:C/powerpc64/powerpc/:C/riscv64/riscv/} .endif .if defined(TARGET) && !defined(_TARGET) _TARGET=${TARGET} Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Fri Dec 11 21:50:59 2015 (r292123) +++ head/Makefile.inc1 Fri Dec 11 22:55:23 2015 (r292124) @@ -172,7 +172,11 @@ VERSION= FreeBSD ${REVISION}-${BRANCH:C/ .export VERSION .endif -KNOWN_ARCHES?= aarch64/arm64 amd64 arm armeb/arm armv6/arm armv6hf/arm i386 i386/pc98 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64 +KNOWN_ARCHES?= aarch64/arm64 amd64 arm armeb/arm armv6/arm armv6hf/arm \ + i386 i386/pc98 mips mipsel/mips mips64el/mips mips64/mips \ + mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc \ + riscv64/riscv sparc64 + .if ${TARGET} == ${TARGET_ARCH} _t= ${TARGET} .else Added: head/etc/etc.riscv/ttys ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/etc.riscv/ttys Fri Dec 11 22:55:23 2015 (r292124) @@ -0,0 +1,51 @@ +# +# $FreeBSD$ +# @(#)ttys 5.1 (Berkeley) 4/17/89 +# +# This file specifies various information about terminals on the system. +# It is used by several different programs. Common entries for the +# various columns include: +# +# name The name of the terminal device. +# +# getty The program to start running on the terminal. Typically a +# getty program, as the name implies. Other common entries +# include none, when no getty is needed, and xdm, to start the +# X Window System. +# +# type The initial terminal type for this port. For hardwired +# terminal lines, this will contain the type of terminal used. +# For virtual consoles, the correct type is typically xterm. +# Other common values include dialup for incoming modem ports, and +# unknown when the terminal type cannot be predetermined. +# +# status Must be on or off. If on, init will run the getty program on +# the specified port. If the word "secure" appears, this tty +# allows root login. +# +# name getty type status comments +# +# If console is marked "insecure", then init will ask for the root password +# when going to single-user mode. +console none unknown off secure +# +ttyv0 "/usr/libexec/getty Pc" xterm onifconsole secure +# Virtual terminals +ttyv1 "/usr/libexec/getty Pc" xterm off secure +ttyv2 "/usr/libexec/getty Pc" xterm off secure +ttyv3 "/usr/libexec/getty Pc" xterm off secure +ttyv4 "/usr/libexec/getty Pc" xterm off secure +ttyv5 "/usr/libexec/getty Pc" xterm off secure +ttyv6 "/usr/libexec/getty Pc" xterm off secure +ttyv7 "/usr/libexec/getty Pc" xterm off secure +#ttyv8 "/usr/local/bin/xdm -nodaemon" xterm off secure +# Serial terminals +# The 'dialup' keyword identifies dialin lines to login, fingerd etc. +ttyu0 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu1 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu2 "/usr/libexec/getty 3wire" vt100 onifconsole secure +ttyu3 "/usr/libexec/getty 3wire" vt100 onifconsole secure +# Dumb console +dcons "/usr/libexec/getty std.9600" vt100 off secure +# RISC-V HTIF console +rcons "/usr/libexec/getty std.9600" vt100 onifconsole secure Added: head/lib/csu/riscv/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/riscv/Makefile Fri Dec 11 22:55:23 2015 (r292124) @@ -0,0 +1,46 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../common + +SRCS= crt1.c crti.S crtn.S +OBJS= ${SRCS:N*.h:R:S/$/.o/g} +OBJS+= Scrt1.o gcrt1.o +CFLAGS+= -I${.CURDIR}/../common \ + -I${.CURDIR}/../../libc/include + +FILES= ${OBJS} +FILESMODE= ${LIBMODE} +FILESOWN= ${LIBOWN} +FILESGRP= ${LIBGRP} +FILESDIR= ${LIBDIR} +# These FILES qualify as libraries for the purpose of LIBRARIES_ONLY. +.undef LIBRARIES_ONLY + +CLEANFILES= ${OBJS} +CLEANFILES+= crt1.s gcrt1.s Scrt1.s + +# See the comment in lib/csu/common/crtbrand.c for the reason crt1.c is not +# directly compiled to .o files. + +crt1.s: crt1.c + ${CC} ${CFLAGS} -S -o ${.TARGET} ${.CURDIR}/crt1.c + sed ${SED_FIX_NOTE} ${.TARGET} + +crt1.o: crt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} crt1.s + +gcrt1.s: crt1.c + ${CC} ${CFLAGS} -DGCRT -S -o ${.TARGET} ${.CURDIR}/crt1.c + sed ${SED_FIX_NOTE} ${.TARGET} + +gcrt1.o: gcrt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} gcrt1.s + +Scrt1.s: crt1.c + ${CC} ${CFLAGS} -fPIC -DPIC -S -o ${.TARGET} ${.CURDIR}/crt1.c + sed ${SED_FIX_NOTE} ${.TARGET} + +Scrt1.o: Scrt1.s + ${CC} ${ACFLAGS} -c -o ${.TARGET} Scrt1.s + +.include Added: head/lib/csu/riscv/crt1.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/riscv/crt1.c Fri Dec 11 22:55:23 2015 (r292124) @@ -0,0 +1,89 @@ +/* LINTLIBRARY */ +/*- + * Copyright 1996-1998 John D. Polstra. + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * 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 ``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 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 "libc_private.h" +#include "crtbrand.c" +#include "ignore_init.c" + +typedef void (*fptr)(void); + +#ifdef GCRT +extern void _mcleanup(void); +extern void monstartup(void *, void *); +extern int eprol; +extern int etext; +#endif + +void __start(int argc, char **argv, char **env, void (*cleanup)(void)); + +/* The entry function. */ +__asm(" .text \n" +" .align 0 \n" +" .globl _start \n" +" _start: \n" +" mv a3, a2 \n" /* cleanup */ +" addi a1, a0, 8 \n" /* get argv */ +" ld a0, 0(a0) \n" /* load argc */ +" slli t0, a0, 3 \n" /* mult by arg size */ +" add a2, a1, t0 \n" /* env is after argv */ +" addi a2, a2, 8 \n" /* argv is null terminated */ +" lla gp, _gp \n" /* load global pointer */ +" call __start"); + +void +__start(int argc, char **argv, char **env, void (*cleanup)(void)) +{ + + handle_argv(argc, argv, env); + + if (&_DYNAMIC != NULL) + atexit(cleanup); + else + _init_tls(); + +#ifdef GCRT + atexit(_mcleanup); + monstartup(&eprol, &etext); +__asm__("eprol:"); +#endif + + handle_static_init(argc, argv, env); + exit(main(argc, argv, env)); +} Added: head/lib/csu/riscv/crti.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/riscv/crti.S Fri Dec 11 22:55:23 2015 (r292124) @@ -0,0 +1,58 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * 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$"); + +# this puts _gp into .dynsym, so symlook_obj can now find that (see reloc.c) + .weak _gp +_gp: + + .section .init,"ax",@progbits + .align 2 + .globl _init + .type _init,@function +_init: + addi sp, sp, -16 + sd ra, 0(sp) + + .section .fini,"ax",@progbits + .align 2 + .globl _fini + .type _fini,@function +_fini: + addi sp, sp, -16 + sd ra, 0(sp) + + .section .note.GNU-stack,"",%progbits Added: head/lib/csu/riscv/crtn.S ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/csu/riscv/crtn.S Fri Dec 11 22:55:23 2015 (r292124) @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * 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$"); + + .section .init,"ax",@progbits + ld ra, 0(sp) + addi sp, sp, 16 + ret + + .section .fini,"ax",@progbits + ld ra, 0(sp) + addi sp, sp, 16 + ret + + .section .note.GNU-stack,"",%progbits Added: head/lib/libc/riscv/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/riscv/Makefile.inc Fri Dec 11 22:55:23 2015 (r292124) @@ -0,0 +1 @@ +# $FreeBSD$ Added: head/lib/libthr/arch/riscv/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libthr/arch/riscv/Makefile.inc Fri Dec 11 22:55:23 2015 (r292124) @@ -0,0 +1 @@ +# $FreeBSD$ Added: head/lib/msun/riscv/Makefile.inc ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/riscv/Makefile.inc Fri Dec 11 22:55:23 2015 (r292124) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +# RISCVTODO: should be 113 +# compilation problems: gcc generates bltuz instruction, which is not exists + +LDBL_PREC = 53 Added: head/lib/msun/riscv/fenv.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/msun/riscv/fenv.h Fri Dec 11 22:55:23 2015 (r292124) @@ -0,0 +1,228 @@ +/*- + * Copyright (c) 2004-2005 David Schultz + * Copyright (c) 2015 Ruslan Bukin + * All rights reserved. + * + * Portions of this software were developed by SRI International and the + * University of Cambridge Computer Laboratory under DARPA/AFRL contract + * FA8750-10-C-0237 ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Portions of this software were developed by the University of Cambridge + * Computer Laboratory as part of the CTSRD Project, with support from the + * UK Higher Education Innovation Fund (HEIF). + * + * 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 _FENV_H_ +#define _FENV_H_ + +#include + +#ifndef __fenv_static +#define __fenv_static static +#endif + +typedef __uint64_t fenv_t; +typedef __uint64_t fexcept_t; + +/* Exception flags */ +#define FE_INVALID 0x0010 +#define FE_DIVBYZERO 0x0008 +#define FE_OVERFLOW 0x0004 +#define FE_UNDERFLOW 0x0002 +#define FE_INEXACT 0x0001 +#define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | \ + FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW) + +/* + * RISC-V Rounding modes + */ +#define FE_TONEAREST (0x00 << 5) +#define FE_TOWARDZERO (0x01 << 5) +#define FE_DOWNWARD (0x02 << 5) +#define FE_UPWARD (0x03 << 5) +#define _ROUND_SHIFT 5 +#define _ROUND_MASK (FE_TONEAREST | FE_DOWNWARD | \ + FE_UPWARD | FE_TOWARDZERO) + +__BEGIN_DECLS + +/* Default floating-point environment */ +extern const fenv_t __fe_dfl_env; +#define FE_DFL_ENV (&__fe_dfl_env) + +/* We need to be able to map status flag positions to mask flag positions */ +#define _FPUSW_SHIFT 0 +#define _ENABLE_MASK (FE_ALL_EXCEPT << _FPUSW_SHIFT) + +#define __rfs(__fpsr) __asm __volatile("csrr %0, fcsr" : "=r" (*(__fpsr))) +#define __wfs(__fpsr) __asm __volatile("csrw fcsr, %0" :: "r" (__fpsr)) + +__fenv_static inline int +feclearexcept(int __excepts) +{ + fexcept_t __fpsr; + + __rfs(&__fpsr); + __fpsr &= ~__excepts; + __wfs(__fpsr); + return (0); +} + +__fenv_static inline int +fegetexceptflag(fexcept_t *__flagp, int __excepts) +{ + fexcept_t __fpsr; + + __rfs(&__fpsr); + *__flagp = __fpsr & __excepts; + return (0); +} + +__fenv_static inline int +fesetexceptflag(const fexcept_t *__flagp, int __excepts) +{ + fexcept_t __fpsr; + + __rfs(&__fpsr); + __fpsr &= ~__excepts; + __fpsr |= *__flagp & __excepts; + __wfs(__fpsr); + return (0); +} + +__fenv_static inline int +feraiseexcept(int __excepts) +{ + fexcept_t __ex = __excepts; + + fesetexceptflag(&__ex, __excepts); /* XXX */ + return (0); +} + +__fenv_static inline int +fetestexcept(int __excepts) +{ + fexcept_t __fpsr; + + __rfs(&__fpsr); + return (__fpsr & __excepts); +} + +__fenv_static inline int +fegetround(void) +{ + + return (-1); +} + +__fenv_static inline int +fesetround(int __round) +{ + + return (-1); +} + +__fenv_static inline int +fegetenv(fenv_t *__envp) +{ + + __rfs(__envp); + return (0); +} + +__fenv_static inline int +feholdexcept(fenv_t *__envp) +{ + fenv_t __env; + + __rfs(&__env); + *__envp = __env; + __env &= ~(FE_ALL_EXCEPT | _ENABLE_MASK); + __wfs(__env); + return (0); +} + +__fenv_static inline int +fesetenv(const fenv_t *__envp) +{ + + __wfs(*__envp); + return (0); +} + +__fenv_static inline int +feupdateenv(const fenv_t *__envp) +{ + fexcept_t __fpsr; + + __rfs(&__fpsr); + __wfs(*__envp); + feraiseexcept(__fpsr & FE_ALL_EXCEPT); + return (0); +} + +#if __BSD_VISIBLE + +/* We currently provide no external definitions of the functions below. */ + +static inline int +feenableexcept(int __mask) +{ + fenv_t __old_fpsr; + fenv_t __new_fpsr; + + __rfs(&__old_fpsr); + __new_fpsr = __old_fpsr | (__mask & FE_ALL_EXCEPT) << _FPUSW_SHIFT; + __wfs(__new_fpsr); + return ((__old_fpsr >> _FPUSW_SHIFT) & FE_ALL_EXCEPT); +} + +static inline int +fedisableexcept(int __mask) +{ + fenv_t __old_fpsr; + fenv_t __new_fpsr; + + __rfs(&__old_fpsr); + __new_fpsr = __old_fpsr & ~((__mask & FE_ALL_EXCEPT) << _FPUSW_SHIFT); + __wfs(__new_fpsr); + return ((__old_fpsr >> _FPUSW_SHIFT) & FE_ALL_EXCEPT); +} + +static inline int +fegetexcept(void) +{ + fenv_t __fpsr; + + __rfs(&__fpsr); + return ((__fpsr & _ENABLE_MASK) >> _FPUSW_SHIFT); +} + +#endif /* __BSD_VISIBLE */ + +__END_DECLS + +#endif /* !_FENV_H_ */ Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Fri Dec 11 21:50:59 2015 (r292123) +++ head/share/mk/bsd.cpu.mk Fri Dec 11 22:55:23 2015 (r292124) @@ -18,6 +18,8 @@ MACHINE_CPU = i486 MACHINE_CPU = mips . elif ${MACHINE_CPUARCH} == "powerpc" MACHINE_CPU = aim +. elif ${MACHINE_CPUARCH} == "riscv" +MACHINE_CPU = riscv . elif ${MACHINE_CPUARCH} == "sparc64" MACHINE_CPU = ultrasparc . endif @@ -148,6 +150,8 @@ _CPUCFLAGS = -march=${CPUTYPE} # sb1, xlp, xlr _CPUCFLAGS = -march=${CPUTYPE:S/^mips//} . endif +. elif ${MACHINE_CPUARCH} == "riscv" +_CPUCFLAGS = -msoft-float # -march="RV64I" # RISCVTODO . elif ${MACHINE_ARCH} == "sparc64" . if ${CPUTYPE} == "v9" _CPUCFLAGS = -mcpu=v9 @@ -277,6 +281,9 @@ MACHINE_CPU = mips . if ${CPUTYPE} == "e500" MACHINE_CPU = booke softfp . endif +########## riscv +. elif ${MACHINE_CPUARCH} == "riscv" +MACHINE_CPU = riscv ########## sparc64 . elif ${MACHINE_ARCH} == "sparc64" . if ${CPUTYPE} == "v9" @@ -313,6 +320,10 @@ CFLAGS += -mfloat-abi=softfp .endif .endif +.if ${MACHINE_CPUARCH} == "riscv" +CFLAGS += -msoft-float +.endif + # NB: COPTFLAGS is handled in /usr/src/sys/conf/kern.pre.mk .if !defined(NO_CPU_CFLAGS) Modified: head/share/mk/bsd.endian.mk ============================================================================== --- head/share/mk/bsd.endian.mk Fri Dec 11 21:50:59 2015 (r292123) +++ head/share/mk/bsd.endian.mk Fri Dec 11 22:55:23 2015 (r292124) @@ -4,6 +4,7 @@ ${MACHINE_ARCH} == "amd64" || \ ${MACHINE_ARCH} == "i386" || \ (${MACHINE} == "arm" && ${MACHINE_ARCH:Marm*eb*} == "") || \ + ${MACHINE_CPUARCH} == "riscv" || \ ${MACHINE_ARCH:Mmips*el} != "" TARGET_ENDIANNESS= 1234 .elif ${MACHINE_ARCH} == "powerpc" || \ Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Fri Dec 11 21:50:59 2015 (r292123) +++ head/share/mk/bsd.sys.mk Fri Dec 11 22:55:23 2015 (r292124) @@ -109,6 +109,11 @@ CWARNFLAGS+= -Werror CWARNFLAGS+= -Wno-format .endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE} +# GCC 5.2.0 +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50200 +CWARNFLAGS+= -Wno-error=unused-function -Wno-error=enum-compare -Wno-error=logical-not-parentheses -Wno-error=bool-compare -Wno-error=uninitialized -Wno-error=array-bounds -Wno-error=clobbered -Wno-error=cast-align -Wno-error=extra -Wno-error=attributes -Wno-error=inline -Wno-error=unused-but-set-variable -Wno-error=unused-value -Wno-error=strict-aliasing -Wno-error=address +.endif + # How to handle FreeBSD custom printf format specifiers. .if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30600 FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__ Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Fri Dec 11 21:50:59 2015 (r292123) +++ head/share/mk/local.meta.sys.mk Fri Dec 11 22:55:23 2015 (r292124) @@ -48,13 +48,14 @@ TARGET_ARCHES_arm64?= aarch64 TARGET_ARCHES_mips?= mipsel mips mips64el mips64 mipsn32 mipsn32el TARGET_ARCHES_powerpc?= powerpc powerpc64 TARGET_ARCHES_pc98?= i386 +TARGET_ARCHES_riscv?= riscv64 # some corner cases BOOT_MACHINE_DIR.amd64 = boot/i386 MACHINE_ARCH.host = ${_HOST_ARCH} # the list of machines we support -ALL_MACHINE_LIST?= amd64 arm arm64 i386 mips pc98 powerpc sparc64 +ALL_MACHINE_LIST?= amd64 arm arm64 i386 mips pc98 powerpc riscv sparc64 .for m in ${ALL_MACHINE_LIST:O:u} MACHINE_ARCH_LIST.$m?= ${TARGET_ARCHES_${m}:U$m} MACHINE_ARCH.$m?= ${MACHINE_ARCH_LIST.$m:[1]} Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Dec 11 21:50:59 2015 (r292123) +++ head/share/mk/src.opts.mk Fri Dec 11 22:55:23 2015 (r292124) @@ -229,12 +229,17 @@ __DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC .endif # In-tree binutils/gcc are older versions without modern architecture support. -.if ${__T} == "aarch64" +.if ${__T} == "aarch64" || ${__T} == "riscv64" BROKEN_OPTIONS+=BINUTILS BINUTILS_BOOTSTRAP GCC GCC_BOOTSTRAP GDB __DEFAULT_YES_OPTIONS+=ELFCOPY_AS_OBJCOPY .else __DEFAULT_NO_OPTIONS+=ELFCOPY_AS_OBJCOPY .endif +.if ${__T} == "riscv64" +BROKEN_OPTIONS+=PROFILE # "sorry, unimplemented: profiler support for RISC-V" +BROKEN_OPTIONS+=TESTS # "undefined reference to `_Unwind_Resume'" +BROKEN_OPTIONS+=CXX # "libcxxrt.so: undefined reference to `_Unwind_Resume_or_Rethrow'" +.endif # LLVM lacks support for FreeBSD 64-bit atomic operations for ARMv4/ARMv5 .if ${__T} == "arm" || ${__T} == "armeb" BROKEN_OPTIONS+=LLDB Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Fri Dec 11 21:50:59 2015 (r292123) +++ head/share/mk/sys.mk Fri Dec 11 22:55:23 2015 (r292124) @@ -13,7 +13,7 @@ unix ?= We run FreeBSD, not UNIX. # and/or endian. This is called MACHINE_CPU in NetBSD, but that's used # for something different in FreeBSD. # -MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/} +MACHINE_CPUARCH=${MACHINE_ARCH:C/mips(n32|64)?(el)?/mips/:C/arm(v6)?(eb|hf)?/arm/:C/powerpc64/powerpc/:C/riscv64/riscv/} .endif From owner-svn-src-all@freebsd.org Fri Dec 11 22:55:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09AFEA0405A; Fri, 11 Dec 2015 22:55:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D09611161; Fri, 11 Dec 2015 22:55:42 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBMtfeO037276; Fri, 11 Dec 2015 22:55:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBMtfXN037275; Fri, 11 Dec 2015 22:55:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201512112255.tBBMtfXN037275@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 11 Dec 2015 22:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292125 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 22:55:43 -0000 Author: bdrewery Date: Fri Dec 11 22:55:41 2015 New Revision: 292125 URL: https://svnweb.freebsd.org/changeset/base/292125 Log: DIRDEPS_BUILD: Don't force C dependencies on kernel modules for bootstrapping. These use ld(1), effectively -nostdlib, and don't need any of these normal dependencies. kmod builds also define PROG so just checking for KMOD here seems to be the easiest to handle it. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.dirdeps.mk Modified: head/share/mk/local.dirdeps.mk ============================================================================== --- head/share/mk/local.dirdeps.mk Fri Dec 11 22:55:23 2015 (r292124) +++ head/share/mk/local.dirdeps.mk Fri Dec 11 22:55:41 2015 (r292125) @@ -97,6 +97,8 @@ _have_depfile= .endif .endfor .if !defined(_have_depfile) +# KMOD does not use any stdlibs. +.if !defined(KMOD) # Has C files. The C_DIRDEPS are shared with C++ files as well. C_DIRDEPS= \ gnu/lib/csu \ @@ -121,7 +123,8 @@ DIRDEPS+= gnu/lib/libstdc++ gnu/lib/libs .endif # XXX: Clang and GCC always adds -lm currently, even when not needed. DIRDEPS+= lib/msun -.endif +.endif # CXX +.endif # !defined(KMOD) # Has yacc files. .if !empty(SRCS:M*.y) DIRDEPS+= usr.bin/yacc.host From owner-svn-src-all@freebsd.org Fri Dec 11 23:46:34 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1BB2A04FC7; Fri, 11 Dec 2015 23:46:34 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9183A1190; Fri, 11 Dec 2015 23:46:34 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBNkX0g052959; Fri, 11 Dec 2015 23:46:33 GMT (envelope-from ak@FreeBSD.org) Received: (from ak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBNkX7Q052958; Fri, 11 Dec 2015 23:46:33 GMT (envelope-from ak@FreeBSD.org) Message-Id: <201512112346.tBBNkX7Q052958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ak set sender to ak@FreeBSD.org using -f From: Alex Kozlov Date: Fri, 11 Dec 2015 23:46:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292126 - head/usr.bin/unzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 23:46:34 -0000 Author: ak (ports committer) Date: Fri Dec 11 23:46:33 2015 New Revision: 292126 URL: https://svnweb.freebsd.org/changeset/base/292126 Log: - Remove stray whitespaces Approved by: des Modified: head/usr.bin/unzip/unzip.c Modified: head/usr.bin/unzip/unzip.c ============================================================================== --- head/usr.bin/unzip/unzip.c Fri Dec 11 22:55:41 2015 (r292125) +++ head/usr.bin/unzip/unzip.c Fri Dec 11 23:46:33 2015 (r292126) @@ -439,7 +439,7 @@ handle_existing_file(char **path) (void)unlink(*path); return 1; case 'N': - n_opt = 1; + n_opt = 1; /* FALLTHROUGH */ case 'n': return -1; @@ -855,7 +855,6 @@ test(struct archive *a, struct archive_e return error_count; } - /* * Main loop: open the zipfile, iterate over its contents and decide what * to do with each entry. @@ -1040,7 +1039,7 @@ main(int argc, char *argv[]) */ nopts = getopts(argc, argv); - /* + /* * When more of the zipinfo mode options are implemented, this * will need to change. */ From owner-svn-src-all@freebsd.org Fri Dec 11 23:52:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC1FC9D7464; Fri, 11 Dec 2015 23:52:09 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A77091534; Fri, 11 Dec 2015 23:52:09 +0000 (UTC) (envelope-from ak@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBBNq8f3055010; Fri, 11 Dec 2015 23:52:08 GMT (envelope-from ak@FreeBSD.org) Received: (from ak@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBBNq8x7055008; Fri, 11 Dec 2015 23:52:08 GMT (envelope-from ak@FreeBSD.org) Message-Id: <201512112352.tBBNq8x7055008@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ak set sender to ak@FreeBSD.org using -f From: Alex Kozlov Date: Fri, 11 Dec 2015 23:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292127 - head/usr.bin/unzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 23:52:10 -0000 Author: ak (ports committer) Date: Fri Dec 11 23:52:08 2015 New Revision: 292127 URL: https://svnweb.freebsd.org/changeset/base/292127 Log: - Allow to extract symlinks - Implement 4-digit year format listing (-y option) - Improve detection of text files - Use %ju for error_count as it is unsigned Obtained from: NetBSD Approved by: des Modified: head/usr.bin/unzip/unzip.1 head/usr.bin/unzip/unzip.c Modified: head/usr.bin/unzip/unzip.1 ============================================================================== --- head/usr.bin/unzip/unzip.1 Fri Dec 11 23:46:33 2015 (r292126) +++ head/usr.bin/unzip/unzip.1 Fri Dec 11 23:52:08 2015 (r292127) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 10, 2012 +.Dd December 12, 2015 .Dt UNZIP 1 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd extract files from a ZIP archive .Sh SYNOPSIS .Nm -.Op Fl aCcfjLlnopqtuv +.Op Fl aCcfjLlnopqtuvy .Op Fl d Ar dir .Ar zipfile .Sh DESCRIPTION @@ -102,6 +102,8 @@ content of the archive. .It Fl x Ar pattern Exclude files matching the pattern .Ar pattern . +.It Fl y +Print four digit years in listings instead of two. .It Fl Z Ar mode Emulate .Xr zipinfo 1L Modified: head/usr.bin/unzip/unzip.c ============================================================================== --- head/usr.bin/unzip/unzip.c Fri Dec 11 23:46:33 2015 (r292126) +++ head/usr.bin/unzip/unzip.c Fri Dec 11 23:52:08 2015 (r292127) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009 Joerg Sonnenberger + * Copyright (c) 2009, 2010 Joerg Sonnenberger * Copyright (c) 2007-2008 Dag-Erling Smørgrav * All rights reserved. * @@ -65,6 +65,7 @@ static int q_opt; /* quiet */ static int t_opt; /* test */ static int u_opt; /* update */ static int v_opt; /* verbose/list */ +static const char *y_str = ""; /* 4 digit year */ static int Z1_opt; /* zipinfo mode list files only */ /* debug flag */ @@ -461,6 +462,34 @@ handle_existing_file(char **path) } /* + * Detect binary files by a combination of character white list and + * black list. NUL bytes and other control codes without use in text files + * result directly in switching the file to binary mode. Otherwise, at least + * one white-listed byte has to be found. + * + * Black-listed: 0..6, 14..25, 28..31 + * White-listed: 9..10, 13, >= 32 + * + * See the proginfo/txtvsbin.txt in the zip sources for a detailed discussion. + */ +#define BYTE_IS_BINARY(x) ((x) < 32 && (0xf3ffc07fU & (1U << (x)))) +#define BYTE_IS_TEXT(x) ((x) >= 32 || (0x00002600U & (1U << (x)))) + +static int +check_binary(const unsigned char *buf, size_t len) +{ + int rv; + for (rv = 1; len--; ++buf) { + if (BYTE_IS_BINARY(*buf)) + return 1; + if (BYTE_IS_TEXT(*buf)) + rv = 0; + } + + return rv; +} + +/* * Extract a regular file. */ static void @@ -472,6 +501,7 @@ extract_file(struct archive *a, struct a struct timespec ts[2]; int cr, fd, text, warn, check; ssize_t len; + const char *linkname; unsigned char *p, *q, *end; mode = archive_entry_mode(e) & 0777; @@ -485,7 +515,7 @@ recheck: if (lstat(*path, &sb) == 0) { if (u_opt || f_opt) { /* check if up-to-date */ - if (S_ISREG(sb.st_mode) && + if ((S_ISREG(sb.st_mode) || S_ISLNK(sb.st_mode)) && (sb.st_mtim.tv_sec > mtime.tv_sec || (sb.st_mtim.tv_sec == mtime.tv_sec && sb.st_mtim.tv_nsec >= mtime.tv_nsec))) @@ -509,6 +539,15 @@ recheck: return; } + /* process symlinks */ + linkname = archive_entry_symlink(e); + if (linkname != NULL) { + if (symlink(linkname, *path) < 0) + error("symlink('%s')", *path); + info(" extracting: %s -> %s\n", *path, linkname); + return; + } + if ((fd = open(*path, O_RDWR|O_CREAT|O_TRUNC, mode)) < 0) error("open('%s')", *path); @@ -550,12 +589,8 @@ recheck: * guess wrong, we print a warning message later. */ if (a_opt && n == 0) { - for (p = buffer; p < end; ++p) { - if (!isascii((unsigned char)*p)) { - text = 0; - break; - } - } + if (check_binary(buffer, len)) + text = 0; } /* simple case */ @@ -568,7 +603,7 @@ recheck: /* hard case: convert \r\n to \n (sigh...) */ for (p = buffer; p < end; p = q + 1) { for (q = p; q < end; q++) { - if (!warn && !isascii(*q)) { + if (!warn && BYTE_IS_BINARY(*q)) { warningx("%s may be corrupted due" " to weak text file detection" " heuristic", *path); @@ -639,7 +674,7 @@ extract(struct archive *a, struct archiv } /* I don't think this can happen in a zipfile.. */ - if (!S_ISDIR(filetype) && !S_ISREG(filetype)) { + if (!S_ISDIR(filetype) && !S_ISREG(filetype) && !S_ISLNK(filetype)) { warningx("skipping non-regular entry '%s'", pathname); ac(archive_read_data_skip(a)); free(pathname); @@ -695,7 +730,7 @@ extract_stdout(struct archive *a, struct filetype = archive_entry_filetype(e); /* I don't think this can happen in a zipfile.. */ - if (!S_ISDIR(filetype) && !S_ISREG(filetype)) { + if (!S_ISDIR(filetype) && !S_ISREG(filetype) && !S_ISLNK(filetype)) { warningx("skipping non-regular entry '%s'", pathname); ac(archive_read_data_skip(a)); free(pathname); @@ -753,12 +788,8 @@ extract_stdout(struct archive *a, struct * guess wrong, we print a warning message later. */ if (a_opt && n == 0) { - for (p = buffer; p < end; ++p) { - if (!isascii((unsigned char)*p)) { - text = 0; - break; - } - } + if (check_binary(buffer, len)) + text = 0; } /* simple case */ @@ -771,7 +802,7 @@ extract_stdout(struct archive *a, struct /* hard case: convert \r\n to \n (sigh...) */ for (p = buffer; p < end; p = q + 1) { for (q = p; q < end; q++) { - if (!warn && !isascii(*q)) { + if (!warn && BYTE_IS_BINARY(*q)) { warningx("%s may be corrupted due" " to weak text file detection" " heuristic", pathname); @@ -802,9 +833,14 @@ list(struct archive *a, struct archive_e { char buf[20]; time_t mtime; + struct tm *tm; mtime = archive_entry_mtime(e); - strftime(buf, sizeof(buf), "%m-%d-%g %R", localtime(&mtime)); + tm = localtime(&mtime); + if (*y_str) + strftime(buf, sizeof(buf), "%m-%d-%G %R", tm); + else + strftime(buf, sizeof(buf), "%m-%d-%g %R", tm); if (!zipinfo_mode) { if (v_opt == 1) { @@ -877,11 +913,11 @@ unzip(const char *fn) if (!p_opt && !q_opt) printf("Archive: %s\n", fn); if (v_opt == 1) { - printf(" Length Date Time Name\n"); - printf(" -------- ---- ---- ----\n"); + printf(" Length %sDate Time Name\n", y_str); + printf(" -------- %s---- ---- ----\n", y_str); } else if (v_opt == 2) { - printf(" Length Method Size Ratio Date Time CRC-32 Name\n"); - printf("-------- ------ ------- ----- ---- ---- ------ ----\n"); + printf(" Length Method Size Ratio %sDate Time CRC-32 Name\n", y_str); + printf("-------- ------ ------- ----- %s---- ---- ------ ----\n", y_str); } } @@ -913,13 +949,13 @@ unzip(const char *fn) if (zipinfo_mode) { if (v_opt == 1) { - printf(" -------- -------\n"); - printf(" %8ju %ju file%s\n", - total_size, file_count, file_count != 1 ? "s" : ""); + printf(" -------- %s-------\n", y_str); + printf(" %8ju %s%ju file%s\n", + total_size, y_str, file_count, file_count != 1 ? "s" : ""); } else if (v_opt == 2) { - printf("-------- ------- --- -------\n"); - printf("%8ju %7ju 0%% %ju file%s\n", - total_size, total_size, file_count, + printf("-------- ------- --- %s-------\n", y_str); + printf("%8ju %7ju 0%% %s%ju file%s\n", + total_size, total_size, y_str, file_count, file_count != 1 ? "s" : ""); } } @@ -929,7 +965,7 @@ unzip(const char *fn) if (t_opt) { if (error_count > 0) { - errorx("%d checksum error(s) found.", error_count); + errorx("%ju checksum error(s) found.", error_count); } else { printf("No errors detected in compressed data of %s.\n", @@ -942,7 +978,7 @@ static void usage(void) { - fprintf(stderr, "usage: unzip [-aCcfjLlnopqtuvZ1] [-d dir] [-x pattern] zipfile\n"); + fprintf(stderr, "Usage: unzip [-aCcfjLlnopqtuvyZ1] [-d dir] [-x pattern] zipfile\n"); exit(1); } @@ -952,7 +988,7 @@ getopts(int argc, char *argv[]) int opt; optreset = optind = 1; - while ((opt = getopt(argc, argv, "aCcd:fjLlnopqtuvx:Z1")) != -1) + while ((opt = getopt(argc, argv, "aCcd:fjLlnopqtuvx:yZ1")) != -1) switch (opt) { case '1': Z1_opt = 1; @@ -1007,6 +1043,9 @@ getopts(int argc, char *argv[]) case 'x': add_pattern(&exclude, optarg); break; + case 'y': + y_str = " "; + break; case 'Z': zipinfo_mode = 1; break; From owner-svn-src-all@freebsd.org Fri Dec 11 23:54:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33A1B9D769E for ; Fri, 11 Dec 2015 23:54:38 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7DB0196E for ; Fri, 11 Dec 2015 23:54:37 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x22c.google.com with SMTP id n186so51302986wmn.1 for ; Fri, 11 Dec 2015 15:54:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=S/KkB90Bz68DgWsxapReY2KvtkSogKCuvbbqLBw6IDM=; b=fnQCZ1ApHB56dNwWOOyTB7JFzT7eCfiqKXLw6ho92LfJZxGrz+A0SD6Yx/8FxVDN4E fjvPoCWbGOjrhXvvq8WDV7LzOZezRbbos0x9c4B8DGc2gOhqNeNqnlSfwlUsnVfH+mvR 3H9esPHZjZSXn+ceyGDEnt/orhZGlD6MQbz6QKHXhK4sMyOaPcQc4CqFzxRjS+eHqDgf mJ0iwnBZQSuTAYF3W+wA+UYxxi3/1ih8xV74UWVu2A8i1fs3R8NRsZL6Tu1wmDI30G5Q N4lSEbTOSN9ZRllFPalwPbNZxSyXAcGzD4yCxpzNmjfKanfIF9dWOv7NlkcRZnA7/o0L +sjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=S/KkB90Bz68DgWsxapReY2KvtkSogKCuvbbqLBw6IDM=; b=F40puzA/mxpHh8vLFyf9TkSm6hyyz+hzf0IacRLKF9yx1mlWT1/Xf8MQLpyfSqDpQm 8/h3pO9bCb7t3ynpRRVDWt9kOkHy0eKTlGTb4AekqvMpkUiW9Q5ArrIRKdoVGJHTZ561 I9oEzSU9NtT+NZ5SvxORujZ5XOQ3hT6Q4ox7k2oAxRM8Sx4OI0I8Li5urUfvoiEdr1Ix 19jdHz6smLhQIhhtZ4bC9BN2MIvJLrDNy0Vf0xt6MOPfQ4pm+hdd5lwyFg/mRXKgJhcq ew3k5z5aVN845DfuYJaXt/F6DYW9DwEmR+uamSh3NiT7Uc6fZI648N/5c6rauko2gt0m pnrg== X-Gm-Message-State: ALoCoQlKzwPAbNU14bJCqCc1vYbDWBsOeoWhjt3mmbLrmmPHZX5COtKakRiNo1HboP1UyxfFsYOqJYnekLGif78vqZJJOzrX4+mTE+2zwUNklsIMQyirLJ4= MIME-Version: 1.0 X-Received: by 10.194.223.39 with SMTP id qr7mr22165566wjc.63.1449878075307; Fri, 11 Dec 2015 15:54:35 -0800 (PST) Received: by 10.194.85.167 with HTTP; Fri, 11 Dec 2015 15:54:35 -0800 (PST) In-Reply-To: <20151211132437.GH82577@kib.kiev.ua> References: <201511230709.tAN79Z4L062228@repo.freebsd.org> <20151210213324.GF82577@kib.kiev.ua> <20151211132437.GH82577@kib.kiev.ua> Date: Sat, 12 Dec 2015 00:54:35 +0100 Message-ID: Subject: Re: svn commit: r291171 - in head/sys: amd64/amd64 compat/ia32 i386/i386 kern sys From: Oliver Pinter To: Konstantin Belousov Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2015 23:54:38 -0000 On Friday, December 11, 2015, Konstantin Belousov wrote: > On Thu, Dec 10, 2015 at 10:48:11PM +0100, Oliver Pinter wrote: > > On Thursday, December 10, 2015, Konstantin Belousov > > > wrote: > > > > > On Thu, Dec 10, 2015 at 10:18:19PM +0100, Oliver Pinter wrote: > > > > On Mon, Nov 23, 2015 at 8:09 AM, Konstantin Belousov < > kib@freebsd.org > > > > wrote: > > > > > Author: kib > > > > > Date: Mon Nov 23 07:09:35 2015 > > > > > New Revision: 291171 > > > > > URL: https://svnweb.freebsd.org/changeset/base/291171 > > > > > > > > > > Log: > > > > > Split kerne timekeep ABI structure vdso_sv_tk out of the struct > > > > > sysentvec. This allows the timekeep data to be shared between > > > similar > > > > > ABIs which cannot share sysentvec. > > > > > > > > > > Make the timekeep_push_vdso() tick callback to the timekeep > > > structures > > > > > instead of sysentvecs. If several sysentvec share the vdso_sv_tk > > > > > structure, we would update the userspace data several times on > each > > > > > tick, without the change. > > > > > > > > > > Only allocate vdso_sv_tk in the exec_sysvec_init() sysinit when > > > > > sysentvec is marked with the new SV_TIMEKEEP flag. This saves > > > > > allocation and update of unneeded vdso_sv_tk for ABIs which do > not > > > > > provide userspace gettimeofday yet, which are PowerPCs arches > right > > > > > now. > > > > > > > > > > Make vdso_sv_tk allocator public, namely split out and export > > > > > alloc_sv_tk() and alloc_sv_tk_compat32(). ABIs which share > timekeep > > > > > data now can allocate it manually and share as appropriate. > > > > > > > > > > Requested by: nwhitehorn > > > > > Tested by: nwhitehorn, pho > > > > > Sponsored by: The FreeBSD Foundation > > > > > MFC after: 2 weeks > > > > > > > > Hello Konstantin! > > > > > > > > Do you plan to MFC back this changes to 10-STABLE in these days? > > > > > > I decided to not merge the change. > > > > > > > And if I'm not wrong, the rationale behind this decision is the type > > stability of struct sysvec / sysent. > You are wrong. The modules which use sysentvec are marked as > DECLARE_MODULE_TIED(), to designate them as requiring kernel of exactly > same version due to KBI issues. I.e. the merge would indeed break KBI, > but KBI breakage there is expected and considered acceptable on the > stable branch. Mainly, the affected modules are ABI emulators (linux.ko > and similar). > > I got demotivated to merge a prerequisite changes which modified code > in kern_sharedpage.c, and do not want to obliterate the code and > history on stable/10 with 'fake' merge. This makes the revision you > asked about non-mergeable. > Okay, thank you for the detailed answer. If From owner-svn-src-all@freebsd.org Sat Dec 12 07:56:22 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45F15A140D2; Sat, 12 Dec 2015 07:56:22 +0000 (UTC) (envelope-from cochard@gmail.com) Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com [IPv6:2a00:1450:4010:c04::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACFED1630; Sat, 12 Dec 2015 07:56:21 +0000 (UTC) (envelope-from cochard@gmail.com) Received: by lbpu9 with SMTP id u9so75574941lbp.2; Fri, 11 Dec 2015 23:56:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=FtQsa1erTWb3ujBw7hko3DPBeso4Tyxrna6KfzQHQwo=; b=ILCtCprJ0xVM5ZQKPDvmgcaT/AvUulkGPaiu8jqBmqL7wj1xIbtqpM3abMvx98e2/b s2K+6gY7h+o/+JNQB2lLrKNZe+qz8DhdCzg3gCf4FhEFIgdtPJdodp1tYLLWMeVDNpCE VtgO7Z513Lh0GtQ5sNT7dSTZxOPTUJo090m3zxcqiMWi8IvERSPrusEBVJbYARk1T9Hr g2islazIaH7OcJzTro+kg3WHg+qI52SqrRsORrp3K+/VrC3NatowjWQsQlAVWKlXN4ma UXQkqrU8bO7HvsS0EHRGSqELjdxGRoH+yD0SZul3VbudyNd/WxktFyhqttwe7fjrorEt iuqg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cochard-me.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=FtQsa1erTWb3ujBw7hko3DPBeso4Tyxrna6KfzQHQwo=; b=SwFWvOsa2WHTVc2Gbh6CtpRdNjxq3naESXTrjLF7UiihIVH9SoqwZIKgQXpIwceCum GxcHSSOFz3NGw3QFWDo7wAkr5/MuKVrgpV8WgOGTiGKFE9ivzhN6mFcci3E8+7huzxby TQ0cGJqBEgSwHIsWyA/afH4clz2YtdqfJk4png/nk0mU5oyeU4LisRaxNEJSUP3my6Xj JcqWMIh+huOMclRtm1YB/jrFPyEYY+IRC4SaWu/MZuStRcKowvI9m+yDCyQtr6AupSa5 059oB1roPIkwOqEAE0gnz7JWCsEZvN+7VaRxT+w3JbR0KFGVH5tUNlk/dnJYmpffSgZG S+Rg== X-Received: by 10.112.172.231 with SMTP id bf7mr9323321lbc.5.1449906979054; Fri, 11 Dec 2015 23:56:19 -0800 (PST) MIME-Version: 1.0 Sender: cochard@gmail.com Received: by 10.25.197.195 with HTTP; Fri, 11 Dec 2015 23:55:59 -0800 (PST) In-Reply-To: <201512070402.tB742V3Z081964@repo.freebsd.org> References: <201512070402.tB742V3Z081964@repo.freebsd.org> From: =?UTF-8?Q?Olivier_Cochard=2DLabb=C3=A9?= Date: Sat, 12 Dec 2015 08:55:59 +0100 X-Google-Sender-Auth: 2GRZRjHiu1gFe1Ch_JsSuPf9jA4 Message-ID: Subject: Re: svn commit: r291913 - head/tools/tools/nanobsd To: Warner Losh Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 07:56:22 -0000 On Mon, Dec 7, 2015 at 5:02 AM, Warner Losh wrote: > Author: imp > Date: Mon Dec 7 04:02:31 2015 > New Revision: 291913 > URL: https://svnweb.freebsd.org/changeset/base/291913 > > Log: > Generally use shorter, more idiomatic sh expressions in a bunch of > places. > > Modified: > head/tools/tools/nanobsd/defaults.sh (contents, props changed) > =E2=80=8BHi, I beleive there is a tipo here : =E2=80=8B > > Modified: head/tools/tools/nanobsd/defaults.sh > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/tools/tools/nanobsd/defaults.sh Mon Dec 7 04:02:19 2015 > (r291912) > +++ head/tools/tools/nanobsd/defaults.sh Mon Dec 7 04:02:31 2015 > (r291913) > > ####################################################################### > @@ -949,21 +949,21 @@ export_var ( ) { # Don't wawnt a subshe > # Call this function to set defaults _after_ parsing options. > # dont want a subshell otherwise variable setting is thrown away. > set_defaults_and_export ( ) { > - test -n "${NANO_OBJ}" || NANO_OBJ=3D/usr/obj/nanobsd.${NANO_NAME} > - test -n "${MAKEOBJDIRPREFIX}" || MAKEOBJDIRPREFIX=3D${NANO_OBJ} > - test -n "${NANO_DISKIMGDIR}" || NANO_DISKIMGDIR=3D${NANO_OBJ} > + : ${NANO_OBJ:=3D/usr/obj/nanobsd.${NANO_NAME}} > + : ${MAKEOBJDIRPREFIX:=3D${NANO_OBJ}} > + : ${NANO_DISKIMGDIR=3D:${NANO_OBJ}} > NANO_WORLDDIR=3D${NANO_OBJ}/_.w > NANO_MAKE_CONF_BUILD=3D${MAKEOBJDIRPREFIX}/make.conf.build > NANO_MAKE_CONF_INSTALL=3D${NANO_OBJ}/make.conf.install > > =E2=80=8BNotice the line: : ${NANO_DISKIMGDIR=3D:${NANO_OBJ}} I beleive the good one is: : ${NANO_DISKIMGDIR=3D${NANO_OBJ}} =E2=80=8B(without the ':' before ${NANO_OBJ}} Because with the ':' variable NANO_DISKIMGDIR includes the ':' in front of its values, and dd didn't like it: + IMG=3D:/usr/obj/BSDRPcur.amd64/BSDRP-1.9998-full-amd64-vga.img + MNT=3D/usr/obj/BSDRPcur.amd64/_.mnt + mkdir -p /usr/obj/BSDRPcur.amd64/_.mnt + [ file '=3D' swap ] + echo 'Creating md backing file...' Creating md backing file... + rm -f :/usr/obj/BSDRPcur.amd64/BSDRP-1.9998-full-amd64-vga.img + echo 'NANO RM -f :/usr/obj/BSDRPcur.amd64/BSDRP-1.9998-full-amd64-vga.img= ' NANO RM -f :/usr/obj/BSDRPcur.amd64/BSDRP-1.9998-full-amd64-vga.img + uname -r + command rm -x -f :/usr/obj/BSDRPcur.amd64/BSDRP-1.9998-full-amd64-vga.img + dd 'if=3D/dev/zero' 'of=3D:/usr/obj/BSDRPcur.amd64/BSDRP-1.9998-full-amd64-vga.img' 'seek=3D1000000' 'count=3D0' dd: :/usr/obj/BSDRPcur.amd64/BSDRP-1.9998-full-amd64-vga.img: No such file or directory Regards, Olivier From owner-svn-src-all@freebsd.org Sat Dec 12 12:12:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 329909D87C1; Sat, 12 Dec 2015 12:12:09 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 27CAE1527; Sat, 12 Dec 2015 12:12:09 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 280E61D78; Sat, 12 Dec 2015 12:12:09 +0000 (UTC) Date: Sat, 12 Dec 2015 12:12:09 +0000 From: Alexey Dokuchaev To: "Andrey V. Elsukov" Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292058 - head/sbin/geom/class/part Message-ID: <20151212121209.GA60800@FreeBSD.org> References: <201512101037.tBAAbDMq065138@repo.freebsd.org> <1449767147.1358.62.camel@freebsd.org> <5669B969.5020605@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5669B969.5020605@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 12:12:09 -0000 On Thu, Dec 10, 2015 at 08:42:01PM +0300, Andrey V. Elsukov wrote: > On 10.12.15 20:05, Ian Lepore wrote: > > On Thu, 2015-12-10 at 10:37 +0000, Andrey V. Elsukov wrote: > >> Author: ae > >> Date: Thu Dec 10 10:37:12 2015 > >> New Revision: 292058 > >> URL: https://svnweb.freebsd.org/changeset/base/292058 > >> > >> Log: > >> Remove a note about damaged PMBR. Now GPT will be detected > >> automatically > >> with such corruption. > >> > >> MFC after: 1 month > > > > Will all of these changes add up to it being impossible to make a > > device NOT be recognized as gpt once it has had gpt on it? > > It's typical to dd some zeroes to the start of a volume to clean out > > old info, but if geom is going to aggressively ressurect a purposely > > -nuked GPT based on the backup info (which is hard to find and dd over > > by hand) this is going to add up to a lot of frustration for those of > > us who have to frequently work with regenerating sdcard and CF images. +1, I'm also used to "dd'ing zeros" trick. > If you want to make device to not be recognized as GPT, you should use > 'gpart destroy -F ' this will destroy first two sectors where > PMBR and primary GPT header are located, also it will destroy the last > sector with backup GPT. While this' technically more accurate, "geom destroy" never worked for me without googling or reading the manpage because of missing -F switch, I think. Filling first few sectors with zeros worked for so many years and people got used to that. Would it perhaps make sense to add debug message when backup GPT is being used? ./danfe From owner-svn-src-all@freebsd.org Sat Dec 12 12:23:26 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEB4AA1417F; Sat, 12 Dec 2015 12:23:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx2.freebsd.org", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D0031CD8; Sat, 12 Dec 2015 12:23:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 98C2430AD; Sat, 12 Dec 2015 12:23:24 +0000 (UTC) (envelope-from ae@FreeBSD.org) Subject: Re: svn commit: r292058 - head/sbin/geom/class/part To: Alexey Dokuchaev References: <201512101037.tBAAbDMq065138@repo.freebsd.org> <1449767147.1358.62.camel@freebsd.org> <5669B969.5020605@FreeBSD.org> <20151212121209.GA60800@FreeBSD.org> Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: "Andrey V. Elsukov" X-Enigmail-Draft-Status: N1110 Message-ID: <566C11A3.3080300@FreeBSD.org> Date: Sat, 12 Dec 2015 15:22:59 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <20151212121209.GA60800@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uK26IIf7pt1MpAr4iIPd63ddXSa8TCaxC" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 12:23:26 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --uK26IIf7pt1MpAr4iIPd63ddXSa8TCaxC Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 12.12.15 15:12, Alexey Dokuchaev wrote: >> If you want to make device to not be recognized as GPT, you should use= >> 'gpart destroy -F ' this will destroy first two sectors where >> PMBR and primary GPT header are located, also it will destroy the last= >> sector with backup GPT. >=20 > While this' technically more accurate, "geom destroy" never worked for = me > without googling or reading the manpage because of missing -F switch, I= > think. Filling first few sectors with zeros worked for so many years a= nd > people got used to that. Would it perhaps make sense to add debug mess= age > when backup GPT is being used? So, now you know about -F switch :) There is possible two cases: 1. When you have not PMBR and primary GPT is damaged, you will see the message about corrupted primary GPT. 2. When you have not PMBR, but have correct primary GPT. In this case seems all will looks good. I think we should report about such corruption. Thanks. --=20 WBR, Andrey V. Elsukov --uK26IIf7pt1MpAr4iIPd63ddXSa8TCaxC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWbBGjAAoJEAHF6gQQyKF6ZOQIAIfKUwtPoOhw9gpQttO9N9Hy nuyvd4N5+0Fu9rYlPZc8ZRy2d+90TxmmK6ncqWFi89iVTO1x0FlZVfa6qy9i9tRS T05/K3IJTttW/UyyMc+yJwx/pcOuDTnhoDVdHv+H61pDdx6d7tBqq9MtF/oh2v9I pBknUupQHl0ICUx1ZGoYBPb3XAe27z/Vze8eiF12dgCqFK6KAdg8kA2rUH+hBYTu EpLrp1rPHZbAH9UIAVeIwTgOyvLA6d9nq/vqaG8GDsR4pegz5N1wiHWsu+1s5yv1 ru4gZwSR72lQV6HZDs7IXO2enjDEEZ089m0DG51tOJxrQ/t4LUI4YwYJQlB2H+U= =iEUu -----END PGP SIGNATURE----- --uK26IIf7pt1MpAr4iIPd63ddXSa8TCaxC-- From owner-svn-src-all@freebsd.org Sat Dec 12 14:08:30 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6542F9D6577; Sat, 12 Dec 2015 14:08:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3C7311079; Sat, 12 Dec 2015 14:08:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBCE8TlJ008559; Sat, 12 Dec 2015 14:08:29 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBCE8TDS008558; Sat, 12 Dec 2015 14:08:29 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201512121408.tBCE8TDS008558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 12 Dec 2015 14:08:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292128 - head/sys/dev/md X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 14:08:30 -0000 Author: kib Date: Sat Dec 12 14:08:29 2015 New Revision: 292128 URL: https://svnweb.freebsd.org/changeset/base/292128 Log: In md(4) over vnode, correct handling of the unaligned unmapped io requests which page alignment + size is greater than MAXPHYS. Right now md(4) over vnode would use the physical buffer of the size MAXPHYS to map a data of size MAXPHYS + page offset of the user buffer. This typically corrupts next pbuf, or, if the pbuf used was the last pbuf in the map, the next page after the pbuf's map. Split request up to the size of io which fits into pbuf KVA with alignment, and retry if a part of the bio is left unprocessed. Reported by: Fabian Keil Tested by: Fabian Keil, pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Fri Dec 11 23:52:08 2015 (r292127) +++ head/sys/dev/md/md.c Sat Dec 12 14:08:29 2015 (r292128) @@ -836,8 +836,8 @@ mdstart_vnode(struct md_s *sc, struct bi struct buf *pb; bus_dma_segment_t *vlist; struct thread *td; - off_t len, zerosize; - int ma_offs; + off_t iolen, len, zerosize; + int ma_offs, npages; switch (bp->bio_cmd) { case BIO_READ: @@ -858,6 +858,7 @@ mdstart_vnode(struct md_s *sc, struct bi pb = NULL; piov = NULL; ma_offs = bp->bio_ma_offset; + len = bp->bio_length; /* * VNODE I/O @@ -890,7 +891,6 @@ mdstart_vnode(struct md_s *sc, struct bi auio.uio_iovcnt = howmany(bp->bio_length, zerosize); piov = malloc(sizeof(*piov) * auio.uio_iovcnt, M_MD, M_WAITOK); auio.uio_iov = piov; - len = bp->bio_length; while (len > 0) { piov->iov_base = __DECONST(void *, zero_region); piov->iov_len = len; @@ -904,7 +904,6 @@ mdstart_vnode(struct md_s *sc, struct bi piov = malloc(sizeof(*piov) * bp->bio_ma_n, M_MD, M_WAITOK); auio.uio_iov = piov; vlist = (bus_dma_segment_t *)bp->bio_data; - len = bp->bio_length; while (len > 0) { piov->iov_base = (void *)(uintptr_t)(vlist->ds_addr + ma_offs); @@ -920,11 +919,20 @@ mdstart_vnode(struct md_s *sc, struct bi piov = auio.uio_iov; } else if ((bp->bio_flags & BIO_UNMAPPED) != 0) { pb = getpbuf(&md_vnode_pbuf_freecnt); - pmap_qenter((vm_offset_t)pb->b_data, bp->bio_ma, bp->bio_ma_n); - aiov.iov_base = (void *)((vm_offset_t)pb->b_data + ma_offs); - aiov.iov_len = bp->bio_length; + bp->bio_resid = len; +unmapped_step: + npages = atop(min(MAXPHYS, round_page(len + (ma_offs & + PAGE_MASK)))); + iolen = min(ptoa(npages) - (ma_offs & PAGE_MASK), len); + KASSERT(iolen > 0, ("zero iolen")); + pmap_qenter((vm_offset_t)pb->b_data, + &bp->bio_ma[atop(ma_offs)], npages); + aiov.iov_base = (void *)((vm_offset_t)pb->b_data + + (ma_offs & PAGE_MASK)); + aiov.iov_len = iolen; auio.uio_iov = &aiov; auio.uio_iovcnt = 1; + auio.uio_resid = iolen; } else { aiov.iov_base = bp->bio_data; aiov.iov_len = bp->bio_length; @@ -948,15 +956,21 @@ mdstart_vnode(struct md_s *sc, struct bi vn_finished_write(mp); } - if (pb) { - pmap_qremove((vm_offset_t)pb->b_data, bp->bio_ma_n); + if (pb != NULL) { + pmap_qremove((vm_offset_t)pb->b_data, npages); + if (error == 0) { + len -= iolen; + bp->bio_resid -= iolen; + ma_offs += iolen; + if (len > 0) + goto unmapped_step; + } relpbuf(pb, &md_vnode_pbuf_freecnt); } - if (piov != NULL) - free(piov, M_MD); - - bp->bio_resid = auio.uio_resid; + free(piov, M_MD); + if (pb == NULL) + bp->bio_resid = auio.uio_resid; return (error); } From owner-svn-src-all@freebsd.org Sat Dec 12 14:42:52 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C05AA14F69; Sat, 12 Dec 2015 14:42:52 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DF4A61616; Sat, 12 Dec 2015 14:42:51 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBCEgoWS020469; Sat, 12 Dec 2015 14:42:50 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBCEgo2p020468; Sat, 12 Dec 2015 14:42:50 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201512121442.tBCEgo2p020468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sat, 12 Dec 2015 14:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292129 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 14:42:52 -0000 Author: ume Date: Sat Dec 12 14:42:50 2015 New Revision: 292129 URL: https://svnweb.freebsd.org/changeset/base/292129 Log: RFC 3493 requires ignoring the loopback address for A_ADDRCONFIG. Since it breaks certain jail setup, we ignore just 127.0.0.1 instead of whole loopback address range. PR: 192014 Reviewed by: hrs MFC after: 1 week Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Sat Dec 12 14:08:29 2015 (r292128) +++ head/lib/libc/net/getaddrinfo.c Sat Dec 12 14:42:50 2015 (r292129) @@ -1563,7 +1563,7 @@ addrconfig(struct addrinfo *pai) if (seen_inet) continue; sin = (struct sockaddr_in *)(ifa->ifa_addr); - if (IN_LOOPBACK(htonl(sin->sin_addr.s_addr))) + if (htonl(sin->sin_addr.s_addr) == INADDR_LOOPBACK) continue; seen_inet = 1; break; From owner-svn-src-all@freebsd.org Sat Dec 12 15:31:11 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 954D8A1429A; Sat, 12 Dec 2015 15:31:11 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 85AEB1E14; Sat, 12 Dec 2015 15:31:11 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [64.201.244.132] (port=64765 helo=[10.0.0.108]) by shxd.cx with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1a7gP7-0000Jt-4x; Sat, 12 Dec 2015 01:23:49 -0800 From: Devin Teske Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r291913 - head/tools/tools/nanobsd Date: Sat, 12 Dec 2015 07:27:09 -0800 Message-Id: <4D007463-F8E5-4092-9FA4-0396E0A1444D@shxd.cx> References: <201512070402.tB742V3Z081964@repo.freebsd.org> Cc: Warner Losh , src-committers , svn-src-all , svn-src-head , Devin Teske In-Reply-To: To: =?utf-8?Q?Olivier_Cochard-Labb=C3=A9?= X-Mailer: iPhone Mail (13B143) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 15:31:11 -0000 > On Dec 11, 2015, at 11:55 PM, Olivier Cochard-Labb=C3=A9 wrote: >=20 >> On Mon, Dec 7, 2015 at 5:02 AM, Warner Losh wrote: >=20 >> Author: imp >> Date: Mon Dec 7 04:02:31 2015 >> New Revision: 291913 >> URL: https://svnweb.freebsd.org/changeset/base/291913 >>=20 >> Log: >> Generally use shorter, more idiomatic sh expressions in a bunch of >> places. >>=20 >> Modified: >> head/tools/tools/nanobsd/defaults.sh (contents, props changed) >=20 >=20 > =E2=80=8BHi, >=20 > I beleive there is a tipo here : > =E2=80=8B=20 >>=20 >> Modified: head/tools/tools/nanobsd/defaults.sh >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D >> --- head/tools/tools/nanobsd/defaults.sh Mon Dec 7 04:02:19 2015 = (r291912) >> +++ head/tools/tools/nanobsd/defaults.sh Mon Dec 7 04:02:31 2015 = (r291913) >>=20 >> ####################################################################### >> @@ -949,21 +949,21 @@ export_var ( ) { # Don't wawnt a subshe >> # Call this function to set defaults _after_ parsing options. >> # dont want a subshell otherwise variable setting is thrown away. >> set_defaults_and_export ( ) { >> - test -n "${NANO_OBJ}" || NANO_OBJ=3D/usr/obj/nanobsd.${NANO_NAME}= >> - test -n "${MAKEOBJDIRPREFIX}" || MAKEOBJDIRPREFIX=3D${NANO_OBJ} >> - test -n "${NANO_DISKIMGDIR}" || NANO_DISKIMGDIR=3D${NANO_OBJ} >> + : ${NANO_OBJ:=3D/usr/obj/nanobsd.${NANO_NAME}} >> + : ${MAKEOBJDIRPREFIX:=3D${NANO_OBJ}} >> + : ${NANO_DISKIMGDIR=3D:${NANO_OBJ}} >> NANO_WORLDDIR=3D${NANO_OBJ}/_.w >> NANO_MAKE_CONF_BUILD=3D${MAKEOBJDIRPREFIX}/make.conf.build >> NANO_MAKE_CONF_INSTALL=3D${NANO_OBJ}/make.conf.install >=20 > =E2=80=8BNotice the line: > : ${NANO_DISKIMGDIR=3D:${NANO_OBJ}} Author meant ":=3D" instead of "=3D:" --=20 Devin= From owner-svn-src-all@freebsd.org Sat Dec 12 15:57:47 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8746A14637; Sat, 12 Dec 2015 15:57:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 987CB1A2C; Sat, 12 Dec 2015 15:57:47 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBCFvkLW041201; Sat, 12 Dec 2015 15:57:46 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBCFvknQ041200; Sat, 12 Dec 2015 15:57:46 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201512121557.tBCFvknQ041200@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 12 Dec 2015 15:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292130 - head/lib/libc/gen X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 15:57:47 -0000 Author: jilles Date: Sat Dec 12 15:57:46 2015 New Revision: 292130 URL: https://svnweb.freebsd.org/changeset/base/292130 Log: exec(3): Fix COMPATIBILITY section: default path does not contain cwd. MFC after: 1 week Modified: head/lib/libc/gen/exec.3 Modified: head/lib/libc/gen/exec.3 ============================================================================== --- head/lib/libc/gen/exec.3 Sat Dec 12 14:42:50 2015 (r292129) +++ head/lib/libc/gen/exec.3 Sat Dec 12 15:57:46 2015 (r292130) @@ -28,7 +28,7 @@ .\" @(#)exec.3 8.3 (Berkeley) 1/24/94 .\" $FreeBSD$ .\" -.Dd January 24, 1994 +.Dd December 12, 2015 .Dt EXEC 3 .Os .Sh NAME @@ -223,7 +223,7 @@ and .Fn execvp functions was .Dq Pa :/bin:/usr/bin . -This was changed to place the current directory last to enhance system +This was changed to remove the current directory to enhance system security. .Pp The behavior of From owner-svn-src-all@freebsd.org Sat Dec 12 17:20:38 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80A8DA146CE for ; Sat, 12 Dec 2015 17:20:38 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 65728116B for ; Sat, 12 Dec 2015 17:20:38 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sat, 12 Dec 2015 17:20:35 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tBCHKT7H014356; Sat, 12 Dec 2015 10:20:29 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1449940829.1358.154.camel@freebsd.org> Subject: Re: svn commit: r292058 - head/sbin/geom/class/part From: Ian Lepore To: Alexey Dokuchaev , "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 12 Dec 2015 10:20:29 -0700 In-Reply-To: <20151212121209.GA60800@FreeBSD.org> References: <201512101037.tBAAbDMq065138@repo.freebsd.org> <1449767147.1358.62.camel@freebsd.org> <5669B969.5020605@FreeBSD.org> <20151212121209.GA60800@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 17:20:38 -0000 On Sat, 2015-12-12 at 12:12 +0000, Alexey Dokuchaev wrote: > On Thu, Dec 10, 2015 at 08:42:01PM +0300, Andrey V. Elsukov wrote: > > On 10.12.15 20:05, Ian Lepore wrote: > > > On Thu, 2015-12-10 at 10:37 +0000, Andrey V. Elsukov wrote: > > > > Author: ae > > > > Date: Thu Dec 10 10:37:12 2015 > > > > New Revision: 292058 > > > > URL: https://svnweb.freebsd.org/changeset/base/292058 > > > > > > > > Log: > > > > Remove a note about damaged PMBR. Now GPT will be detected > > > > automatically > > > > with such corruption. > > > > > > > > MFC after: 1 month > > > > > > Will all of these changes add up to it being impossible to make a > > > device NOT be recognized as gpt once it has had gpt on it? > > > It's typical to dd some zeroes to the start of a volume to clean > > > out > > > old info, but if geom is going to aggressively ressurect a > > > purposely > > > -nuked GPT based on the backup info (which is hard to find and dd > > > over > > > by hand) this is going to add up to a lot of frustration for > > > those of > > > us who have to frequently work with regenerating sdcard and CF > > > images. > > +1, I'm also used to "dd'ing zeros" trick. > > > If you want to make device to not be recognized as GPT, you should > > use > > 'gpart destroy -F ' this will destroy first two sectors > > where > > PMBR and primary GPT header are located, also it will destroy the > > last > > sector with backup GPT. > > While this' technically more accurate, "geom destroy" never worked > for me > without googling or reading the manpage because of missing -F switch, > I > think. Filling first few sectors with zeros worked for so many years > and > people got used to that. Would it perhaps make sense to add debug > message > when backup GPT is being used? > I spent much of the last week fighting with "geom destroy" and trying to prevent the ressurection of old geoms during the creation of new ones. It's a Big Mess and it doesn't really work well at all. I came to the conclusion that it's not geom destroy that needs a force flag so much as geom create, where it would mean "it is okay to replace any existing geom with the new one." For example if you have a freebsd slice da0s1 that contains freebsd partitions within it, and you geom destroy -F da0 then that slice and the partitions within it disappear. Then as soon as you create a new geom for the device and add a slice that happens to fall on the same sector that da0s1 used to live at, suddenly that whole geom tree comes back to life and your next command to create a new geom da0s1 fails because it already exists. With a task like formatting and populating an sd card with a script, you have to deal with whatever data is on the sd card when it's first inserted. You don't know where existing geoms might be, and it's quite burdensome to write script code to figure that out and do a recursive destroy -F. (Actually, a "geom destroy -R -F" to recursively clean everything would be quite nice.) I eventually worked around the problem by using the no-commit feature to do all the work in the sort of virtual space that creates, then commit everything after the whole volume is laid out. That process is another Big Mess, because it turns out you have to commit each geom individually. Just committing the top level doesn't recurse and that creates insanity because now you've got uncommitted nested geoms that are somehow locked such that anything you try to do results in permission errors with no clue why root doesn't have permission to do commands that usually work fine. (I literally had to add printfs to sys/geom code and reboot with that kernel to figure out what was wrong.) Maybe it shouldn't be possible to commit an outer geom if it contains uncommitted nested geoms. Or maybe commit should have a -R flag to recurse automatically as well (but that would have to be implemented on the kernel side, unless there's some way to query from userland about whether a geom is committed or not). -- Ian From owner-svn-src-all@freebsd.org Sat Dec 12 17:24:40 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8B64A14AAF; Sat, 12 Dec 2015 17:24:40 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.freebsd.org (Postfix) with ESMTP id 8272B15D3; Sat, 12 Dec 2015 17:24:40 +0000 (UTC) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.55.3]) by phk.freebsd.dk (Postfix) with ESMTP id 95ECB4F865; Sat, 12 Dec 2015 17:24:32 +0000 (UTC) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.15.2/8.15.2) with ESMTP id tBCHOVTd021377; Sat, 12 Dec 2015 17:24:32 GMT (envelope-from phk@phk.freebsd.dk) To: Alexey Dokuchaev cc: "Andrey V. Elsukov" , Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r292058 - head/sbin/geom/class/part In-reply-to: <20151212121209.GA60800@FreeBSD.org> From: "Poul-Henning Kamp" References: <201512101037.tBAAbDMq065138@repo.freebsd.org> <1449767147.1358.62.camel@freebsd.org> <5669B969.5020605@FreeBSD.org> <20151212121209.GA60800@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <21375.1449941071.1@critter.freebsd.dk> Date: Sat, 12 Dec 2015 17:24:31 +0000 Message-ID: <21376.1449941071@critter.freebsd.dk> X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 17:24:40 -0000 -------- In message <20151212121209.GA60800@FreeBSD.org>, Alexey Dokuchaev writes: >+1, I'm also used to "dd'ing zeros" trick. The modern way to do that is to reinitialize the on-drive encryption to a new key. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. From owner-svn-src-all@freebsd.org Sat Dec 12 18:10:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDF54A14EC1; Sat, 12 Dec 2015 18:10:43 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mx2.freebsd.org (mx2.freebsd.org [8.8.178.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx2.freebsd.org", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CC0BD13C8; Sat, 12 Dec 2015 18:10:43 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 8CD1318B8; Sat, 12 Dec 2015 18:10:41 +0000 (UTC) (envelope-from ae@FreeBSD.org) Subject: Re: svn commit: r292058 - head/sbin/geom/class/part To: Ian Lepore , Alexey Dokuchaev References: <201512101037.tBAAbDMq065138@repo.freebsd.org> <1449767147.1358.62.camel@freebsd.org> <5669B969.5020605@FreeBSD.org> <20151212121209.GA60800@FreeBSD.org> <1449940829.1358.154.camel@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: "Andrey V. Elsukov" X-Enigmail-Draft-Status: N1110 Message-ID: <566C6307.70200@FreeBSD.org> Date: Sat, 12 Dec 2015 21:10:15 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1449940829.1358.154.camel@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SqfIPepbUVEapbF5QW8uJT8oehujB4ubj" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 18:10:44 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --SqfIPepbUVEapbF5QW8uJT8oehujB4ubj Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 12.12.15 20:20, Ian Lepore wrote: > I spent much of the last week fighting with "geom destroy" and trying > to prevent the ressurection of old geoms during the creation of new > ones. It's a Big Mess and it doesn't really work well at all. I came > to the conclusion that it's not geom destroy that needs a force flag so= > much as geom create, where it would mean "it is okay to replace any > existing geom with the new one." Let's be honest. This problem is completely unrelated to what I committed= =2E > For example if you have a freebsd slice da0s1 that contains freebsd > partitions within it, and you geom destroy -F da0 then that slice and > the partitions within it disappear. Then as soon as you create a new > geom for the device and add a slice that happens to fall on the same > sector that da0s1 used to live at, suddenly that whole geom tree comes > back to life and your next command to create a new geom da0s1 fails > because it already exists. >=20 > With a task like formatting and populating an sd card with a script, > you have to deal with whatever data is on the sd card when it's first > inserted. You don't know where existing geoms might be, and it's quite= > burdensome to write script code to figure that out and do a recursive > destroy -F. (Actually, a "geom destroy -R -F" to recursively clean > everything would be quite nice.) Recursive destroying can be easily implemented in the mentioned script. But yes, this also can be done in gpart(8). > I eventually worked around the problem by using the no-commit feature > to do all the work in the sort of virtual space that creates, then > commit everything after the whole volume is laid out. That process is > another Big Mess, because it turns out you have to commit each geom > individually. >=20 > Just committing the top level doesn't recurse and that creates insanity= > because now you've got uncommitted nested geoms that are somehow locked= > such that anything you try to do results in permission errors with no > clue why root doesn't have permission to do commands that usually work > fine. (I literally had to add printfs to sys/geom code and reboot with= > that kernel to figure out what was wrong.) >=20 > Maybe it shouldn't be possible to commit an outer geom if it contains > uncommitted nested geoms. Or maybe commit should have a -R flag to > recurse automatically as well (but that would have to be implemented on= > the kernel side, unless there's some way to query from userland about > whether a geom is committed or not). You can determine what geom is uncommitted by "modified: true" attribute.= # gpart list | grep modified --=20 WBR, Andrey V. Elsukov --SqfIPepbUVEapbF5QW8uJT8oehujB4ubj Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWbGMIAAoJEAHF6gQQyKF6iwwH/1yJrnlENJPUcFRiQ4sIBSq8 ckdiSpYapakG7R3j3woeclLnYsvPrJOvve0BI6kTRlFiYF4KXP8afpE8b3Ot+pY8 1a0gb1skp8ZOcCrVPtjcep8x0mrP/lI18q6PpRmjorQnlIcAzHG0Gc87HLfg9H77 tOnapcvKYLeJPvbDWitPu85D9YuuzOBZcWG0dJ+5wwg+LVYAt5Yqkt0zo2+/0Ag9 XOWJkAJvu6jMf/8Q1/1sM8sGAN6u69jy/t63gGjyqDQ3R1CXeUMX59SMAoUB+RZd XKytQr8E1hANw4N9RClnGNi7xKbLKPIYRk7lHiAw33kvKA5QM9omOSGutWdJuZU= =GsMl -----END PGP SIGNATURE----- --SqfIPepbUVEapbF5QW8uJT8oehujB4ubj-- From owner-svn-src-all@freebsd.org Sat Dec 12 18:26:48 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7FA35A14B4F for ; Sat, 12 Dec 2015 18:26:48 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 611431EBC for ; Sat, 12 Dec 2015 18:26:48 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sat, 12 Dec 2015 18:26:45 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tBCIQdNl014499; Sat, 12 Dec 2015 11:26:39 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1449944799.1358.160.camel@freebsd.org> Subject: Re: svn commit: r292058 - head/sbin/geom/class/part From: Ian Lepore To: "Andrey V. Elsukov" , Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 12 Dec 2015 11:26:39 -0700 In-Reply-To: <566C6307.70200@FreeBSD.org> References: <201512101037.tBAAbDMq065138@repo.freebsd.org> <1449767147.1358.62.camel@freebsd.org> <5669B969.5020605@FreeBSD.org> <20151212121209.GA60800@FreeBSD.org> <1449940829.1358.154.camel@freebsd.org> <566C6307.70200@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 18:26:48 -0000 On Sat, 2015-12-12 at 21:10 +0300, Andrey V. Elsukov wrote: > On 12.12.15 20:20, Ian Lepore wrote: > > I spent much of the last week fighting with "geom destroy" and > > trying > > to prevent the ressurection of old geoms during the creation of new > > ones. It's a Big Mess and it doesn't really work well at all. I > > came > > to the conclusion that it's not geom destroy that needs a force > > flag so > > much as geom create, where it would mean "it is okay to replace any > > existing geom with the new one." > > Let's be honest. This problem is completely unrelated to what I > committed. > Oh yeah, totally. One of the first things I discovered about this problem was that dd'ing some zeroes (where some < the whole device) didn't help. But 'destroy -F' was mentioned in a panacea-like way, andit's not really all that. I don't think I'll bother to reply to the rest, since it seemed to be saying basically "raw data is available to you and beyond that this stuff is supposed to be hard to work with". -- Ian From owner-svn-src-all@freebsd.org Sat Dec 12 20:07:13 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A905A3EABF; Sat, 12 Dec 2015 20:07:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx2.freebsd.org", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 393861F51; Sat, 12 Dec 2015 20:07:13 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 4485565B7F; Sat, 12 Dec 2015 20:07:10 +0000 (UTC) (envelope-from ae@FreeBSD.org) Subject: Re: svn commit: r292058 - head/sbin/geom/class/part To: Ian Lepore , Alexey Dokuchaev References: <201512101037.tBAAbDMq065138@repo.freebsd.org> <1449767147.1358.62.camel@freebsd.org> <5669B969.5020605@FreeBSD.org> <20151212121209.GA60800@FreeBSD.org> <1449940829.1358.154.camel@freebsd.org> <566C6307.70200@FreeBSD.org> <1449944799.1358.160.camel@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: "Andrey V. Elsukov" X-Enigmail-Draft-Status: N1110 Message-ID: <566C7E55.2030303@FreeBSD.org> Date: Sat, 12 Dec 2015 23:06:45 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1449944799.1358.160.camel@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="OP1CT7tL2OuldcwEDomDawu9Dit6xdXJf" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 20:07:13 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --OP1CT7tL2OuldcwEDomDawu9Dit6xdXJf Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 12.12.15 21:26, Ian Lepore wrote: > On Sat, 2015-12-12 at 21:10 +0300, Andrey V. Elsukov wrote: >> On 12.12.15 20:20, Ian Lepore wrote: >>> I spent much of the last week fighting with "geom destroy" and >>> trying >>> to prevent the ressurection of old geoms during the creation of new >>> ones. It's a Big Mess and it doesn't really work well at all. I >>> came >>> to the conclusion that it's not geom destroy that needs a force >>> flag so >>> much as geom create, where it would mean "it is okay to replace any >>> existing geom with the new one." >> >> Let's be honest. This problem is completely unrelated to what I >> committed. >> >=20 > Oh yeah, totally. One of the first things I discovered about this > problem was that dd'ing some zeroes (where some < the whole device) > didn't help. But 'destroy -F' was mentioned in a panacea-like way, and= it's not really all that. 1. The goal of this patch is helping to users with recovering its GPT from damage. User must not know internals of GPT to work with it and they don't know. If you position yourself as power user and you think that dd will do what you want, just continue use it. But as power user you should know and now you know what you need overwrite using dd to destroy GPT. Just another one sector in the end of the disk. 2. All problems that you described in previous messages was related to MBR+BSD label. FreeBSD uses native GPT without any nested partitioning tables, and described problems aren't related to GPT. 3. You are criticizing the change that doesn't affect you, so what you want? Do you want to revert this change? Ok, feel free to do it. Personally, I can recover or just recreate my partition tables without this change. The change was done, because several users asked me to do it= =2E > I don't think I'll bother to reply to the rest, since it seemed to be > saying basically "raw data is available to you and beyond that this > stuff is supposed to be hard to work with". --=20 WBR, Andrey V. Elsukov --OP1CT7tL2OuldcwEDomDawu9Dit6xdXJf Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWbH5VAAoJEAHF6gQQyKF6LpAH/jZEgsPtbRJz+K/oFgp2+wfL YSN9YWYEb7o6VFLCK5bPqLjh5ZC9j+Q7C8urF/NeS3GYpX/6gNP/AQVAYvTAQh3t qeUlpOnSpaamCDnuVdadhYsRDJ9zwWMzrHc+Feu0LQjDmCHISSNm+LI9QYFripkh Li5KvGlQ8iRFQWoOcx8evjLsa2UugKgO/uz2KPB/KIaFviRejJqDc2bhKsXJhx5C 4qy71IEslG4Mg1kYdgoiGEAhA8j3s+sHMpPuAxE+iFwSHfIV4V/+dhueNpDafKwK 7IkfZvGoyObxrkimmDfNlpz1v1EOrAw47ZGpid+gl7aeZqlbz9/8n3ZgG6wch+Q= =B6sV -----END PGP SIGNATURE----- --OP1CT7tL2OuldcwEDomDawu9Dit6xdXJf-- From owner-svn-src-all@freebsd.org Sat Dec 12 20:13:29 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69509A14069 for ; Sat, 12 Dec 2015 20:13:29 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 50124153A for ; Sat, 12 Dec 2015 20:13:29 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound1.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Sat, 12 Dec 2015 20:13:32 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id tBCKDQ2g014662; Sat, 12 Dec 2015 13:13:26 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1449951206.1358.165.camel@freebsd.org> Subject: Re: svn commit: r292058 - head/sbin/geom/class/part From: Ian Lepore To: "Andrey V. Elsukov" , Alexey Dokuchaev Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sat, 12 Dec 2015 13:13:26 -0700 In-Reply-To: <566C7E55.2030303@FreeBSD.org> References: <201512101037.tBAAbDMq065138@repo.freebsd.org> <1449767147.1358.62.camel@freebsd.org> <5669B969.5020605@FreeBSD.org> <20151212121209.GA60800@FreeBSD.org> <1449940829.1358.154.camel@freebsd.org> <566C6307.70200@FreeBSD.org> <1449944799.1358.160.camel@freebsd.org> <566C7E55.2030303@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.16.5 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 20:13:29 -0000 On Sat, 2015-12-12 at 23:06 +0300, Andrey V. Elsukov wrote: > On 12.12.15 21:26, Ian Lepore wrote: > > On Sat, 2015-12-12 at 21:10 +0300, Andrey V. Elsukov wrote: > > > On 12.12.15 20:20, Ian Lepore wrote: > > > > I spent much of the last week fighting with "geom destroy" and > > > > trying > > > > to prevent the ressurection of old geoms during the creation of > > > > new > > > > ones. It's a Big Mess and it doesn't really work well at all. > > > > I > > > > came > > > > to the conclusion that it's not geom destroy that needs a force > > > > flag so > > > > much as geom create, where it would mean "it is okay to replace > > > > any > > > > existing geom with the new one." > > > > > > Let's be honest. This problem is completely unrelated to what I > > > committed. > > > > > > > Oh yeah, totally. One of the first things I discovered about this > > problem was that dd'ing some zeroes (where some < the whole device) > > didn't help. But 'destroy -F' was mentioned in a panacea-like way, > > andit's not really all that. > > 1. The goal of this patch is helping to users with recovering its GPT > from damage. User must not know internals of GPT to work with it and > they don't know. If you position yourself as power user and you think > that dd will do what you want, just continue use it. But as power > user > you should know and now you know what you need overwrite using dd to > destroy GPT. Just another one sector in the end of the disk. > > 2. All problems that you described in previous messages was related > to > MBR+BSD label. FreeBSD uses native GPT without any nested > partitioning > tables, and described problems aren't related to GPT. > > 3. You are criticizing the change that doesn't affect you, so what > you > want? Do you want to revert this change? Ok, feel free to do it. > Personally, I can recover or just recreate my partition tables > without > this change. The change was done, because several users asked me to > do it. > > > I don't think I'll bother to reply to the rest, since it seemed to > > be > > saying basically "raw data is available to you and beyond that this > > stuff is supposed to be hard to work with". > I start by agreeing with you that my remarks are *totally* unrelated to your changes, and still you feel the need to rant again about how my remarks are unrelated to your changes? I was basically conveying information about some experiences I had to the community at large, because they were vaguely related to some remarks in one of the replies to your commit. It is unfortunate that you seem to have interpreted it as some sort of attack on your commit. -- Ian From owner-svn-src-all@freebsd.org Sat Dec 12 20:23:44 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E72FA1472F; Sat, 12 Dec 2015 20:23:44 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:1900:2254:206a::19:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx2.freebsd.org", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CCF51ACB; Sat, 12 Dec 2015 20:23:44 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from butcher-nb.yandex.net (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx2.freebsd.org (Postfix) with ESMTP id 87EE52556; Sat, 12 Dec 2015 20:23:42 +0000 (UTC) (envelope-from ae@FreeBSD.org) Subject: Re: svn commit: r292058 - head/sbin/geom/class/part To: Ian Lepore , Alexey Dokuchaev References: <201512101037.tBAAbDMq065138@repo.freebsd.org> <1449767147.1358.62.camel@freebsd.org> <5669B969.5020605@FreeBSD.org> <20151212121209.GA60800@FreeBSD.org> <1449940829.1358.154.camel@freebsd.org> <566C6307.70200@FreeBSD.org> <1449944799.1358.160.camel@freebsd.org> <566C7E55.2030303@FreeBSD.org> <1449951206.1358.165.camel@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: "Andrey V. Elsukov" X-Enigmail-Draft-Status: N1110 Message-ID: <566C8234.20409@FreeBSD.org> Date: Sat, 12 Dec 2015 23:23:16 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <1449951206.1358.165.camel@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="xbIcd8kXmWI2VBCHRrXQXmruppN2Aq8NN" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 20:23:44 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --xbIcd8kXmWI2VBCHRrXQXmruppN2Aq8NN Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 12.12.15 23:13, Ian Lepore wrote: > I start by agreeing with you that my remarks are *totally* unrelated to= > your changes, and still you feel the need to rant again about how my > remarks are unrelated to your changes? I thought it was sarcasm. > I was basically conveying information about some experiences I had to > the community at large, because they were vaguely related to some > remarks in one of the replies to your commit. It is unfortunate that > you seem to have interpreted it as some sort of attack on your commit. Yes, there are many problems and most of them are documented in bugzilla. You also may add to the list: * GPT labels don't updated in devfs after gpart modify -l * GMIRROR failed to appears after upgrade when GRAID find stale metadata;= * unable to stop some GEOM class due to retasting on the same device via GEOM label; --=20 WBR, Andrey V. Elsukov --xbIcd8kXmWI2VBCHRrXQXmruppN2Aq8NN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWbII0AAoJEAHF6gQQyKF6N7gH/0D2U3nIEnAJRnqaHF2PTdFk LO8DUHirDoRgp+03hP1KME9PIlQr6NulKd2eiVsOeb9jEU6PIst5cueeK5awyCpr akaFBf0YIL5M4SGH6cDcGqfVLCJ2uqZUZoV4r/G0ZAybBg5G4UYgiPvEBB18Sq43 UVGhxnYW40daalun5b/sgjTzWFIYD1/fqlMlZ8DcUtIoD6KNrTsMfD8mSod8BnGt V6zJYcaRJR9YIPl+bOmK7AW/dopjhTgyBI5aO9wpp1gEvoq0ZQuZ04QITGMlMibj VRMCDKBWnNDhd2zsA8ovd/DzRdys/7lAiBQ/qwKBNKNrZ1jIcumt9OuINr87N7k= =kf1a -----END PGP SIGNATURE----- --xbIcd8kXmWI2VBCHRrXQXmruppN2Aq8NN-- From owner-svn-src-all@freebsd.org Sat Dec 12 22:17:04 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E79C3A3BCA2; Sat, 12 Dec 2015 22:17:04 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AE24A1CAC; Sat, 12 Dec 2015 22:17:04 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBCMH3ia059536; Sat, 12 Dec 2015 22:17:03 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBCMH2tN059516; Sat, 12 Dec 2015 22:17:02 GMT (envelope-from des@FreeBSD.org) Message-Id: <201512122217.tBCMH2tN059516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sat, 12 Dec 2015 22:17:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292131 - in vendor/unbound/dist: . dns64 doc services/cache sldns testdata util X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 22:17:05 -0000 Author: des Date: Sat Dec 12 22:17:01 2015 New Revision: 292131 URL: https://svnweb.freebsd.org/changeset/base/292131 Log: import unbound 1.5.6 Modified: vendor/unbound/dist/configure vendor/unbound/dist/configure.ac vendor/unbound/dist/dns64/dns64.c vendor/unbound/dist/doc/Changelog vendor/unbound/dist/doc/README vendor/unbound/dist/doc/example.conf.in vendor/unbound/dist/doc/libunbound.3.in vendor/unbound/dist/doc/unbound-anchor.8.in vendor/unbound/dist/doc/unbound-checkconf.8.in vendor/unbound/dist/doc/unbound-control.8.in vendor/unbound/dist/doc/unbound-host.1.in vendor/unbound/dist/doc/unbound.8.in vendor/unbound/dist/doc/unbound.conf.5.in vendor/unbound/dist/services/cache/dns.c vendor/unbound/dist/sldns/wire2str.c vendor/unbound/dist/testdata/dns64_lookup.rpl vendor/unbound/dist/util/config_file.c vendor/unbound/dist/util/iana_ports.inc Modified: vendor/unbound/dist/configure ============================================================================== --- vendor/unbound/dist/configure Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/configure Sat Dec 12 22:17:01 2015 (r292131) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for unbound 1.5.5. +# Generated by GNU Autoconf 2.69 for unbound 1.5.6. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='unbound' PACKAGE_TARNAME='unbound' -PACKAGE_VERSION='1.5.5' -PACKAGE_STRING='unbound 1.5.5' +PACKAGE_VERSION='1.5.6' +PACKAGE_STRING='unbound 1.5.6' PACKAGE_BUGREPORT='unbound-bugs@nlnetlabs.nl' PACKAGE_URL='' @@ -1391,7 +1391,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures unbound 1.5.5 to adapt to many kinds of systems. +\`configure' configures unbound 1.5.6 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1456,7 +1456,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of unbound 1.5.5:";; + short | recursive ) echo "Configuration of unbound 1.5.6:";; esac cat <<\_ACEOF @@ -1635,7 +1635,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -unbound configure 1.5.5 +unbound configure 1.5.6 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2344,7 +2344,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by unbound $as_me 1.5.5, which was +It was created by unbound $as_me 1.5.6, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2696,11 +2696,11 @@ UNBOUND_VERSION_MAJOR=1 UNBOUND_VERSION_MINOR=5 -UNBOUND_VERSION_MICRO=5 +UNBOUND_VERSION_MICRO=6 LIBUNBOUND_CURRENT=5 -LIBUNBOUND_REVISION=8 +LIBUNBOUND_REVISION=9 LIBUNBOUND_AGE=3 # 1.0.0 had 0:12:0 # 1.0.1 had 0:13:0 @@ -2745,6 +2745,7 @@ LIBUNBOUND_AGE=3 # 1.5.3 had 5:6:3 # 1.5.4 had 5:7:3 # 1.5.5 had 5:8:3 +# 1.5.6 had 5:9:3 # Current -- the number of the binary API that we're implementing # Revision -- which iteration of the implementation of the binary @@ -19017,7 +19018,7 @@ _ACEOF -version=1.5.5 +version=1.5.6 date=`date +'%b %e, %Y'` @@ -19532,7 +19533,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_wri # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by unbound $as_me 1.5.5, which was +This file was extended by unbound $as_me 1.5.6, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19598,7 +19599,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -unbound config.status 1.5.5 +unbound config.status 1.5.6 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: vendor/unbound/dist/configure.ac ============================================================================== --- vendor/unbound/dist/configure.ac Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/configure.ac Sat Dec 12 22:17:01 2015 (r292131) @@ -10,14 +10,14 @@ sinclude(dnstap/dnstap.m4) # must be numbers. ac_defun because of later processing m4_define([VERSION_MAJOR],[1]) m4_define([VERSION_MINOR],[5]) -m4_define([VERSION_MICRO],[5]) +m4_define([VERSION_MICRO],[6]) AC_INIT(unbound, m4_defn([VERSION_MAJOR]).m4_defn([VERSION_MINOR]).m4_defn([VERSION_MICRO]), unbound-bugs@nlnetlabs.nl, unbound) AC_SUBST(UNBOUND_VERSION_MAJOR, [VERSION_MAJOR]) AC_SUBST(UNBOUND_VERSION_MINOR, [VERSION_MINOR]) AC_SUBST(UNBOUND_VERSION_MICRO, [VERSION_MICRO]) LIBUNBOUND_CURRENT=5 -LIBUNBOUND_REVISION=8 +LIBUNBOUND_REVISION=9 LIBUNBOUND_AGE=3 # 1.0.0 had 0:12:0 # 1.0.1 had 0:13:0 @@ -62,6 +62,7 @@ LIBUNBOUND_AGE=3 # 1.5.3 had 5:6:3 # 1.5.4 had 5:7:3 # 1.5.5 had 5:8:3 +# 1.5.6 had 5:9:3 # Current -- the number of the binary API that we're implementing # Revision -- which iteration of the implementation of the binary Modified: vendor/unbound/dist/dns64/dns64.c ============================================================================== --- vendor/unbound/dist/dns64/dns64.c Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/dns64/dns64.c Sat Dec 12 22:17:01 2015 (r292131) @@ -618,8 +618,10 @@ dns64_synth_aaaa_data(const struct ub_pa dd->rr_ttl = (time_t*)&dd->rr_data[dd->count]; for(i = 0; i < fd->count; ++i) { if (fd->rr_len[i] != 6 || fd->rr_data[i][0] != 0 - || fd->rr_data[i][1] != 4) + || fd->rr_data[i][1] != 4) { + *dd_out = NULL; return; + } dd->rr_len[i] = 18; dd->rr_data[i] = (uint8_t*)&dd->rr_ttl[dd->count] + 18*i; @@ -638,6 +640,7 @@ dns64_synth_aaaa_data(const struct ub_pa */ if(!dk) { log_err("no key"); + *dd_out = NULL; return; } @@ -646,6 +649,7 @@ dns64_synth_aaaa_data(const struct ub_pa if(!dk->rk.dname) { log_err("out of memory"); + *dd_out = NULL; return; } Modified: vendor/unbound/dist/doc/Changelog ============================================================================== --- vendor/unbound/dist/doc/Changelog Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/doc/Changelog Sat Dec 12 22:17:01 2015 (r292131) @@ -1,3 +1,25 @@ +15 October 2015: Wouter + - Fix segfault in the dns64 module in the formaterror error path. + - Fix sldns_wire2str_rdata_scan for malformed RRs. + - tag for 1.5.6rc1 release. + +14 October 2015: Wouter + - ANY responses include DNAME records if present, as per Evan Hunt's + remark in dnsop. + - Fix manpage to suggest using SIGTERM to terminate the server. + +9 October 2015: Wouter + - Default for ssl-port is port 853, the temporary port assignment + for secure domain name system traffic. + If you used to rely on the older default of port 443, you have + to put a clause in unbound.conf for that. The new value is likely + going to be the standardised port number for this traffic. + - iana portlist update. + +6 October 2015: Wouter + - 1.5.5 release. + - trunk tracks the development of 1.5.6. + 28 September 2015: Wouter - MAX_TARGET_COUNT increased to 64, to fix up sporadic resolution failures. Modified: vendor/unbound/dist/doc/README ============================================================================== --- vendor/unbound/dist/doc/README Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/doc/README Sat Dec 12 22:17:01 2015 (r292131) @@ -1,4 +1,4 @@ -README for Unbound 1.5.5 +README for Unbound 1.5.6 Copyright 2007 NLnet Labs http://unbound.net Modified: vendor/unbound/dist/doc/example.conf.in ============================================================================== --- vendor/unbound/dist/doc/example.conf.in Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/doc/example.conf.in Sat Dec 12 22:17:01 2015 (r292131) @@ -1,7 +1,7 @@ # # Example configuration file. # -# See unbound.conf(5) man page, version 1.5.5. +# See unbound.conf(5) man page, version 1.5.6. # # this is a comment. @@ -552,7 +552,7 @@ server: # default is "" (disabled). requires restart to take effect. # ssl-service-key: "path/to/privatekeyfile.key" # ssl-service-pem: "path/to/publiccertfile.pem" - # ssl-port: 443 + # ssl-port: 853 # request upstream over SSL (with plain DNS inside the SSL stream). # Default is no. Can be turned on and off with unbound-control. Modified: vendor/unbound/dist/doc/libunbound.3.in ============================================================================== --- vendor/unbound/dist/doc/libunbound.3.in Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/doc/libunbound.3.in Sat Dec 12 22:17:01 2015 (r292131) @@ -1,4 +1,4 @@ -.TH "libunbound" "3" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5" +.TH "libunbound" "3" "Oct 20, 2015" "NLnet Labs" "unbound 1.5.6" .\" .\" libunbound.3 -- unbound library functions manual .\" @@ -42,7 +42,7 @@ .B ub_ctx_zone_remove, .B ub_ctx_data_add, .B ub_ctx_data_remove -\- Unbound DNS validating resolver 1.5.5 functions. +\- Unbound DNS validating resolver 1.5.6 functions. .SH "SYNOPSIS" .B #include .LP Modified: vendor/unbound/dist/doc/unbound-anchor.8.in ============================================================================== --- vendor/unbound/dist/doc/unbound-anchor.8.in Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/doc/unbound-anchor.8.in Sat Dec 12 22:17:01 2015 (r292131) @@ -1,4 +1,4 @@ -.TH "unbound-anchor" "8" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5" +.TH "unbound-anchor" "8" "Oct 20, 2015" "NLnet Labs" "unbound 1.5.6" .\" .\" unbound-anchor.8 -- unbound anchor maintenance utility manual .\" Modified: vendor/unbound/dist/doc/unbound-checkconf.8.in ============================================================================== --- vendor/unbound/dist/doc/unbound-checkconf.8.in Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/doc/unbound-checkconf.8.in Sat Dec 12 22:17:01 2015 (r292131) @@ -1,4 +1,4 @@ -.TH "unbound-checkconf" "8" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5" +.TH "unbound-checkconf" "8" "Oct 20, 2015" "NLnet Labs" "unbound 1.5.6" .\" .\" unbound-checkconf.8 -- unbound configuration checker manual .\" Modified: vendor/unbound/dist/doc/unbound-control.8.in ============================================================================== --- vendor/unbound/dist/doc/unbound-control.8.in Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/doc/unbound-control.8.in Sat Dec 12 22:17:01 2015 (r292131) @@ -1,4 +1,4 @@ -.TH "unbound-control" "8" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5" +.TH "unbound-control" "8" "Oct 20, 2015" "NLnet Labs" "unbound 1.5.6" .\" .\" unbound-control.8 -- unbound remote control manual .\" Modified: vendor/unbound/dist/doc/unbound-host.1.in ============================================================================== --- vendor/unbound/dist/doc/unbound-host.1.in Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/doc/unbound-host.1.in Sat Dec 12 22:17:01 2015 (r292131) @@ -1,4 +1,4 @@ -.TH "unbound\-host" "1" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5" +.TH "unbound\-host" "1" "Oct 20, 2015" "NLnet Labs" "unbound 1.5.6" .\" .\" unbound-host.1 -- unbound DNS lookup utility .\" Modified: vendor/unbound/dist/doc/unbound.8.in ============================================================================== --- vendor/unbound/dist/doc/unbound.8.in Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/doc/unbound.8.in Sat Dec 12 22:17:01 2015 (r292131) @@ -1,4 +1,4 @@ -.TH "unbound" "8" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5" +.TH "unbound" "8" "Oct 20, 2015" "NLnet Labs" "unbound 1.5.6" .\" .\" unbound.8 -- unbound manual .\" @@ -9,7 +9,7 @@ .\" .SH "NAME" .B unbound -\- Unbound DNS validating resolver 1.5.5. +\- Unbound DNS validating resolver 1.5.6. .SH "SYNOPSIS" .B unbound .RB [ \-h ] Modified: vendor/unbound/dist/doc/unbound.conf.5.in ============================================================================== --- vendor/unbound/dist/doc/unbound.conf.5.in Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/doc/unbound.conf.5.in Sat Dec 12 22:17:01 2015 (r292131) @@ -1,4 +1,4 @@ -.TH "unbound.conf" "5" "Oct 6, 2015" "NLnet Labs" "unbound 1.5.5" +.TH "unbound.conf" "5" "Oct 20, 2015" "NLnet Labs" "unbound 1.5.6" .\" .\" unbound.conf.5 -- unbound.conf manual .\" @@ -362,7 +362,7 @@ The public key certificate pem file for turned off. .TP .B ssl\-port: \fI -The port number on which to provide TCP SSL service, default 443, only +The port number on which to provide TCP SSL service, default 853, only interfaces configured with that port number as @number get the SSL service. .TP .B do\-daemonize: \fI @@ -481,7 +481,7 @@ kill \-HUP `cat @UNBOUND_PIDFILE@` .fi triggers a reload, .nf -kill \-QUIT `cat @UNBOUND_PIDFILE@` +kill \-TERM `cat @UNBOUND_PIDFILE@` .fi gracefully terminates. .TP Modified: vendor/unbound/dist/services/cache/dns.c ============================================================================== --- vendor/unbound/dist/services/cache/dns.c Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/services/cache/dns.c Sat Dec 12 22:17:01 2015 (r292131) @@ -656,8 +656,9 @@ fill_any(struct module_env* env, time_t now = *env->now; struct dns_msg* msg = NULL; uint16_t lookup[] = {LDNS_RR_TYPE_A, LDNS_RR_TYPE_AAAA, - LDNS_RR_TYPE_MX, LDNS_RR_TYPE_SOA, LDNS_RR_TYPE_NS, 0}; - int i, num=5; /* number of RR types to look up */ + LDNS_RR_TYPE_MX, LDNS_RR_TYPE_SOA, LDNS_RR_TYPE_NS, + LDNS_RR_TYPE_DNAME, 0}; + int i, num=6; /* number of RR types to look up */ log_assert(lookup[num] == 0); for(i=0; itcp_upstream = 0; cfg->ssl_service_key = NULL; cfg->ssl_service_pem = NULL; - cfg->ssl_port = 443; + cfg->ssl_port = 853; cfg->ssl_upstream = 0; cfg->use_syslog = 1; cfg->log_time_ascii = 0; Modified: vendor/unbound/dist/util/iana_ports.inc ============================================================================== --- vendor/unbound/dist/util/iana_ports.inc Sat Dec 12 15:57:46 2015 (r292130) +++ vendor/unbound/dist/util/iana_ports.inc Sat Dec 12 22:17:01 2015 (r292131) @@ -660,6 +660,7 @@ 833, 847, 848, +853, 860, 861, 862, From owner-svn-src-all@freebsd.org Sat Dec 12 22:17:53 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 823F7A3BD85; Sat, 12 Dec 2015 22:17:53 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 392081E0C; Sat, 12 Dec 2015 22:17:53 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBCMHqZ9059654; Sat, 12 Dec 2015 22:17:52 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBCMHqkf059653; Sat, 12 Dec 2015 22:17:52 GMT (envelope-from des@FreeBSD.org) Message-Id: <201512122217.tBCMHqkf059653@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sat, 12 Dec 2015 22:17:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292132 - vendor/unbound/1.5.6 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 22:17:53 -0000 Author: des Date: Sat Dec 12 22:17:52 2015 New Revision: 292132 URL: https://svnweb.freebsd.org/changeset/base/292132 Log: tag unbound 1.5.6 Added: vendor/unbound/1.5.6/ - copied from r292131, vendor/unbound/dist/ From owner-svn-src-all@freebsd.org Sat Dec 12 22:19:00 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED097A3BE5A; Sat, 12 Dec 2015 22:18:59 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 94E781FB2; Sat, 12 Dec 2015 22:18:59 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBCMIwJj059817; Sat, 12 Dec 2015 22:18:58 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBCMIvqQ059802; Sat, 12 Dec 2015 22:18:57 GMT (envelope-from des@FreeBSD.org) Message-Id: <201512122218.tBCMIvqQ059802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sat, 12 Dec 2015 22:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292133 - in vendor/unbound/dist: . compat contrib daemon dnstap doc iterator libunbound libunbound/python libunbound/python/doc libunbound/python/doc/modules libunbound/python/examples... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 22:19:00 -0000 Author: des Date: Sat Dec 12 22:18:57 2015 New Revision: 292133 URL: https://svnweb.freebsd.org/changeset/base/292133 Log: import unbound 1.5.7 Added: vendor/unbound/dist/.gitignore vendor/unbound/dist/compat/isblank.c (contents, props changed) vendor/unbound/dist/testdata/iter_resolve_minimised.rpl vendor/unbound/dist/testdata/iter_resolve_minimised_nx.rpl vendor/unbound/dist/testdata/iter_resolve_minimised_refused.rpl vendor/unbound/dist/testdata/iter_scrub_dname_rev.rpl Modified: vendor/unbound/dist/Makefile.in vendor/unbound/dist/acx_nlnetlabs.m4 vendor/unbound/dist/compat/arc4random.c vendor/unbound/dist/compat/getentropy_linux.c vendor/unbound/dist/compat/getentropy_solaris.c vendor/unbound/dist/compat/reallocarray.c vendor/unbound/dist/compat/sha512.c vendor/unbound/dist/compat/snprintf.c vendor/unbound/dist/config.h.in vendor/unbound/dist/configure vendor/unbound/dist/configure.ac vendor/unbound/dist/contrib/aaaa-filter-iterator.patch vendor/unbound/dist/contrib/create_unbound_ad_servers.cmd vendor/unbound/dist/contrib/unbound.spec_fedora vendor/unbound/dist/daemon/remote.c vendor/unbound/dist/daemon/unbound.c vendor/unbound/dist/daemon/worker.c vendor/unbound/dist/dnstap/dnstap.proto vendor/unbound/dist/doc/Changelog vendor/unbound/dist/doc/README vendor/unbound/dist/doc/example.conf.in vendor/unbound/dist/doc/libunbound.3.in vendor/unbound/dist/doc/unbound-anchor.8.in vendor/unbound/dist/doc/unbound-checkconf.8.in vendor/unbound/dist/doc/unbound-control.8.in vendor/unbound/dist/doc/unbound-host.1.in vendor/unbound/dist/doc/unbound.8.in vendor/unbound/dist/doc/unbound.conf.5.in vendor/unbound/dist/iterator/iter_scrub.c vendor/unbound/dist/iterator/iter_utils.c vendor/unbound/dist/iterator/iterator.c vendor/unbound/dist/iterator/iterator.h vendor/unbound/dist/libunbound/libunbound.c vendor/unbound/dist/libunbound/python/Makefile vendor/unbound/dist/libunbound/python/doc/install.rst vendor/unbound/dist/libunbound/python/doc/modules/unbound.rst vendor/unbound/dist/libunbound/python/examples/dnssec-valid.py vendor/unbound/dist/libunbound/python/libunbound.i vendor/unbound/dist/ltmain.sh vendor/unbound/dist/pythonmod/doc/examples/example4.rst vendor/unbound/dist/pythonmod/doc/modules/config.rst vendor/unbound/dist/pythonmod/doc/modules/env.rst vendor/unbound/dist/pythonmod/doc/modules/struct.rst vendor/unbound/dist/pythonmod/doc/usecase.rst vendor/unbound/dist/services/cache/rrset.c vendor/unbound/dist/sldns/parseutil.h vendor/unbound/dist/smallapp/unbound-anchor.c vendor/unbound/dist/smallapp/unbound-checkconf.c vendor/unbound/dist/smallapp/unbound-control-setup.sh.in vendor/unbound/dist/smallapp/unbound-control.c vendor/unbound/dist/testcode/checklocks.c vendor/unbound/dist/testcode/fake_event.c vendor/unbound/dist/testcode/lock_verify.c vendor/unbound/dist/testcode/testbound.c vendor/unbound/dist/testcode/testpkts.h vendor/unbound/dist/testcode/unitlruhash.c vendor/unbound/dist/testcode/unitmain.c vendor/unbound/dist/testcode/unitslabhash.c vendor/unbound/dist/testcode/unitverify.c vendor/unbound/dist/util/config_file.c vendor/unbound/dist/util/config_file.h vendor/unbound/dist/util/configlexer.c vendor/unbound/dist/util/configlexer.lex vendor/unbound/dist/util/configparser.c vendor/unbound/dist/util/configparser.h vendor/unbound/dist/util/configparser.y vendor/unbound/dist/util/iana_ports.inc vendor/unbound/dist/util/locks.c vendor/unbound/dist/util/net_help.c vendor/unbound/dist/util/random.c vendor/unbound/dist/util/rbtree.c vendor/unbound/dist/util/rtt.h vendor/unbound/dist/util/storage/lookup3.c vendor/unbound/dist/util/tube.h vendor/unbound/dist/util/winsock_event.h vendor/unbound/dist/validator/autotrust.c vendor/unbound/dist/validator/val_neg.c vendor/unbound/dist/validator/val_neg.h vendor/unbound/dist/validator/val_nsec.c vendor/unbound/dist/validator/val_nsec.h vendor/unbound/dist/validator/val_nsec3.c vendor/unbound/dist/validator/val_nsec3.h vendor/unbound/dist/validator/val_secalgo.c vendor/unbound/dist/validator/val_secalgo.h vendor/unbound/dist/validator/val_sigcrypt.c vendor/unbound/dist/validator/val_utils.h vendor/unbound/dist/validator/validator.c vendor/unbound/dist/winrc/setup.nsi vendor/unbound/dist/winrc/unbound-control-setup.cmd vendor/unbound/dist/winrc/vista_admin.manifest vendor/unbound/dist/winrc/win_svc.c Added: vendor/unbound/dist/.gitignore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/unbound/dist/.gitignore Sat Dec 12 22:18:57 2015 (r292133) @@ -0,0 +1,38 @@ +*.lo +*.o +/.libs/ +/Makefile +/autom4te.cache/ +/config.h +/config.log +/config.status +/dnstap/dnstap_config.h +/doc/example.conf +/doc/libunbound.3 +/doc/unbound-anchor.8 +/doc/unbound-checkconf.8 +/doc/unbound-control.8 +/doc/unbound-host.1 +/doc/unbound.8 +/doc/unbound.conf.5 +/libtool +/libunbound.la +/smallapp/unbound-control-setup.sh +/unbound +/unbound-anchor +/unbound-checkconf +/unbound-control +/unbound-control-setup +/unbound-host +/unbound.h +/asynclook +/delayer +/lock-verify +/memstats +/perf +/petal +/pktview +/streamtcp +/testbound +/unittest + Modified: vendor/unbound/dist/Makefile.in ============================================================================== --- vendor/unbound/dist/Makefile.in Sat Dec 12 22:17:52 2015 (r292132) +++ vendor/unbound/dist/Makefile.in Sat Dec 12 22:18:57 2015 (r292133) @@ -38,6 +38,7 @@ UNBOUND_VERSION_MINOR=@UNBOUND_VERSION_M UNBOUND_VERSION_MICRO=@UNBOUND_VERSION_MICRO@ ALLTARGET=@ALLTARGET@ INSTALLTARGET=@INSTALLTARGET@ +SSLLIB=@SSLLIB@ # _unbound.la if pyunbound enabled. PYUNBOUND_TARGET=@PYUNBOUND_TARGET@ @@ -132,7 +133,7 @@ compat/memcmp.c compat/memmove.c compat/ compat/strlcpy.c compat/strptime.c compat/getentropy_linux.c \ compat/getentropy_osx.c compat/getentropy_solaris.c compat/getentropy_win.c \ compat/explicit_bzero.c compat/arc4random.c compat/arc4random_uniform.c \ -compat/arc4_lock.c compat/sha512.c compat/reallocarray.c +compat/arc4_lock.c compat/sha512.c compat/reallocarray.c compat/isblank.c COMPAT_OBJ=$(LIBOBJS:.o=.lo) COMPAT_OBJ_WITHOUT_CTIME=$(LIBOBJ_WITHOUT_CTIME:.o=.lo) COMPAT_OBJ_WITHOUT_CTIMEARC4=$(LIBOBJ_WITHOUT_CTIMEARC4:.o=.lo) @@ -295,22 +296,22 @@ longtest: tests lib: libunbound.la unbound.h libunbound.la: $(LIBUNBOUND_OBJ_LINK) - $(LINK_LIB) $(UBSYMS) -o $@ $(LIBUNBOUND_OBJ_LINK) -rpath $(libdir) -lssl $(LIBS) + $(LINK_LIB) $(UBSYMS) -o $@ $(LIBUNBOUND_OBJ_LINK) -rpath $(libdir) $(SSLLIB) $(LIBS) unbound$(EXEEXT): $(DAEMON_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(DAEMON_OBJ_LINK) $(EXTRALINK) -lssl $(LIBS) + $(LINK) -o $@ $(DAEMON_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) unbound-checkconf$(EXEEXT): $(CHECKCONF_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(CHECKCONF_OBJ_LINK) $(EXTRALINK) -lssl $(LIBS) + $(LINK) -o $@ $(CHECKCONF_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) unbound-control$(EXEEXT): $(CONTROL_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(CONTROL_OBJ_LINK) $(EXTRALINK) -lssl $(LIBS) + $(LINK) -o $@ $(CONTROL_OBJ_LINK) $(EXTRALINK) $(SSLLIB) $(LIBS) unbound-host$(EXEEXT): $(HOST_OBJ_LINK) libunbound.la $(LINK) -o $@ $(HOST_OBJ_LINK) -L. -L.libs -lunbound $(LIBS) unbound-anchor$(EXEEXT): $(UBANCHOR_OBJ_LINK) libunbound.la - $(LINK) -o $@ $(UBANCHOR_OBJ_LINK) -L. -L.libs -lunbound -lexpat -lssl $(LIBS) + $(LINK) -o $@ $(UBANCHOR_OBJ_LINK) -L. -L.libs -lunbound -lexpat $(SSLLIB) $(LIBS) unbound-service-install$(EXEEXT): $(SVCINST_OBJ_LINK) $(LINK) -o $@ $(SVCINST_OBJ_LINK) $(LIBS) @@ -322,37 +323,37 @@ anchor-update$(EXEEXT): $(ANCHORUPD_OBJ $(LINK) -o $@ $(ANCHORUPD_OBJ_LINK) -L. -L.libs -lunbound $(LIBS) unittest$(EXEEXT): $(UNITTEST_OBJ_LINK) - $(LINK) -o $@ $(UNITTEST_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(UNITTEST_OBJ_LINK) $(SSLLIB) $(LIBS) testbound$(EXEEXT): $(TESTBOUND_OBJ_LINK) - $(LINK) -o $@ $(TESTBOUND_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(TESTBOUND_OBJ_LINK) $(SSLLIB) $(LIBS) lock-verify$(EXEEXT): $(LOCKVERIFY_OBJ_LINK) - $(LINK) -o $@ $(LOCKVERIFY_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(LOCKVERIFY_OBJ_LINK) $(SSLLIB) $(LIBS) petal$(EXEEXT): $(PETAL_OBJ_LINK) - $(LINK) -o $@ $(PETAL_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(PETAL_OBJ_LINK) $(SSLLIB) $(LIBS) pktview$(EXEEXT): $(PKTVIEW_OBJ_LINK) - $(LINK) -o $@ $(PKTVIEW_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(PKTVIEW_OBJ_LINK) $(SSLLIB) $(LIBS) memstats$(EXEEXT): $(MEMSTATS_OBJ_LINK) - $(LINK) -o $@ $(MEMSTATS_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(MEMSTATS_OBJ_LINK) $(SSLLIB) $(LIBS) asynclook$(EXEEXT): $(ASYNCLOOK_OBJ_LINK) libunbound.la $(LINK) -o $@ $(ASYNCLOOK_OBJ_LINK) $(LIBS) -L. -L.libs -lunbound streamtcp$(EXEEXT): $(STREAMTCP_OBJ_LINK) - $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(STREAMTCP_OBJ_LINK) $(SSLLIB) $(LIBS) perf$(EXEEXT): $(PERF_OBJ_LINK) - $(LINK) -o $@ $(PERF_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(PERF_OBJ_LINK) $(SSLLIB) $(LIBS) delayer$(EXEEXT): $(DELAYER_OBJ_LINK) - $(LINK) -o $@ $(DELAYER_OBJ_LINK) -lssl $(LIBS) + $(LINK) -o $@ $(DELAYER_OBJ_LINK) $(SSLLIB) $(LIBS) signit$(EXEEXT): testcode/signit.c - $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ testcode/signit.c $(LDFLAGS) -lldns -lssl $(LIBS) + $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ testcode/signit.c $(LDFLAGS) -lldns $(SSLLIB) $(LIBS) unbound.h: $(srcdir)/libunbound/unbound.h sed -e 's/@''UNBOUND_VERSION_MAJOR@/$(UNBOUND_VERSION_MAJOR)/' -e 's/@''UNBOUND_VERSION_MINOR@/$(UNBOUND_VERSION_MINOR)/' -e 's/@''UNBOUND_VERSION_MICRO@/$(UNBOUND_VERSION_MICRO)/' < $(srcdir)/libunbound/unbound.h > $@ @@ -644,7 +645,7 @@ iterator.lo iterator.o: $(srcdir)/iterat $(srcdir)/util/rtt.h $(srcdir)/util/netevent.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h $(srcdir)/util/config_file.h $(srcdir)/util/random.h \ - $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h + $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h iter_delegpt.lo iter_delegpt.o: $(srcdir)/iterator/iter_delegpt.c config.h $(srcdir)/iterator/iter_delegpt.h \ $(srcdir)/util/log.h $(srcdir)/services/cache/dns.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/regional.h \ @@ -727,8 +728,7 @@ outside_network.lo outside_network.o: $( $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgencode.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/net_help.h $(srcdir)/util/random.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/module.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/services/modstack.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/dnstap/dnstap.h \ - + $(srcdir)/sldns/sbuffer.h $(srcdir)/dnstap/dnstap.h alloc.lo alloc.o: $(srcdir)/util/alloc.c config.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/util/regional.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/fptr_wlist.h $(srcdir)/util/netevent.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ @@ -776,14 +776,12 @@ netevent.lo netevent.o: $(srcdir)/util/n $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h \ $(srcdir)/services/mesh.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h + $(srcdir)/dnstap/dnstap.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h net_help.lo net_help.o: $(srcdir)/util/net_help.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/module.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/regional.h $(srcdir)/sldns/parseutil.h \ - $(srcdir)/sldns/wire2str.h \ - + $(srcdir)/sldns/wire2str.h random.lo random.o: $(srcdir)/util/random.c config.h $(srcdir)/util/random.h $(srcdir)/util/log.h rbtree.lo rbtree.o: $(srcdir)/util/rbtree.c config.h $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \ $(srcdir)/util/netevent.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ @@ -818,8 +816,7 @@ autotrust.lo autotrust.o: $(srcdir)/vali $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/random.h \ $(srcdir)/services/mesh.h $(srcdir)/util/netevent.h $(srcdir)/services/modstack.h \ $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/validator/val_kcache.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h \ - + $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/keyraw.h val_anchor.lo val_anchor.o: $(srcdir)/validator/val_anchor.c config.h $(srcdir)/validator/val_anchor.h \ $(srcdir)/util/rbtree.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_sigcrypt.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/autotrust.h \ @@ -844,18 +841,16 @@ val_kcache.lo val_kcache.o: $(srcdir)/va val_kentry.lo val_kentry.o: $(srcdir)/validator/val_kentry.c config.h $(srcdir)/validator/val_kentry.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/data/dname.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ - -val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h \ - $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/rbtree.h \ - $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h $(srcdir)/util/config_file.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h -val_nsec3.lo val_nsec3.o: $(srcdir)/validator/val_nsec3.c config.h \ - $(srcdir)/validator/val_nsec3.h $(srcdir)/util/rbtree.h $(srcdir)/util/data/packed_rrset.h \ - $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/validator.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h +val_neg.lo val_neg.o: $(srcdir)/validator/val_neg.c config.h $(srcdir)/validator/val_neg.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/rbtree.h $(srcdir)/validator/val_nsec.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/validator/val_nsec3.h $(srcdir)/validator/val_utils.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/config_file.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h +val_nsec3.lo val_nsec3.o: $(srcdir)/validator/val_nsec3.c config.h $(srcdir)/validator/val_nsec3.h \ + $(srcdir)/util/rbtree.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ + $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h $(srcdir)/validator/validator.h \ $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/validator/val_utils.h $(srcdir)/validator/val_kentry.h \ $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/regional.h \ @@ -867,17 +862,15 @@ val_nsec.lo val_nsec.o: $(srcdir)/valida $(srcdir)/sldns/rrdef.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h val_secalgo.lo val_secalgo.o: $(srcdir)/validator/val_secalgo.c config.h $(srcdir)/util/data/packed_rrset.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/sbuffer.h \ - + $(srcdir)/validator/val_nsec3.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ + $(srcdir)/sldns/sbuffer.h val_sigcrypt.lo val_sigcrypt.o: $(srcdir)/validator/val_sigcrypt.c config.h \ $(srcdir)/validator/val_sigcrypt.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/validator/val_secalgo.h $(srcdir)/validator/validator.h \ $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/validator/val_utils.h $(srcdir)/util/data/dname.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h \ - + $(srcdir)/util/net_help.h $(srcdir)/util/regional.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/wire2str.h val_utils.lo val_utils.o: $(srcdir)/validator/val_utils.c config.h $(srcdir)/validator/val_utils.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/validator/validator.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ @@ -895,11 +888,6 @@ dns64.lo dns64.o: $(srcdir)/dns64/dns64. $(srcdir)/services/modstack.h $(srcdir)/util/net_help.h $(srcdir)/util/regional.h checklocks.lo checklocks.o: $(srcdir)/testcode/checklocks.c config.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ $(srcdir)/testcode/checklocks.h -dnstap.lo dnstap.o: $(srcdir)/dnstap/dnstap.c config.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ - $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/dnstap/dnstap.pb-c.h -dnstap.pb-c.lo dnstap.pb-c.o: $(srcdir)/dnstap/dnstap.pb-c.c $(srcdir)/dnstap/dnstap.pb-c.h unitanchor.lo unitanchor.o: $(srcdir)/testcode/unitanchor.c config.h $(srcdir)/util/log.h $(srcdir)/util/data/dname.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/util/rbtree.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/rrdef.h @@ -908,8 +896,7 @@ unitdname.lo unitdname.o: $(srcdir)/test $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/rrdef.h unitlruhash.lo unitlruhash.o: $(srcdir)/testcode/unitlruhash.c config.h $(srcdir)/testcode/unitmain.h \ $(srcdir)/util/log.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/storage/slabhash.h -unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ +unitmain.lo unitmain.o: $(srcdir)/testcode/unitmain.c config.h $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/keyraw.h \ $(srcdir)/util/log.h $(srcdir)/testcode/unitmain.h $(srcdir)/util/alloc.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ $(srcdir)/util/config_file.h $(srcdir)/util/rtt.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ @@ -947,38 +934,35 @@ unitldns.lo unitldns.o: $(srcdir)/testco acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/regional.h $(srcdir)/util/log.h \ $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h -cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h \ - $(srcdir)/daemon/cachedump.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h \ +cachedump.lo cachedump.o: $(srcdir)/daemon/cachedump.c config.h $(srcdir)/daemon/cachedump.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ + $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/dns.h \ + $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h \ + $(srcdir)/util/regional.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h \ + $(srcdir)/iterator/iter_resptype.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ + $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h \ $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ - $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/cache/dns.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/regional.h $(srcdir)/util/net_help.h \ - $(srcdir)/util/data/dname.h $(srcdir)/iterator/iterator.h $(srcdir)/services/outbound_list.h \ - $(srcdir)/iterator/iter_delegpt.h $(srcdir)/iterator/iter_utils.h $(srcdir)/iterator/iter_resptype.h \ - $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/sldns/wire2str.h \ - $(srcdir)/sldns/str2wire.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/config_file.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/util/random.h $(srcdir)/util/tube.h \ $(srcdir)/util/net_help.h $(srcdir)/sldns/keyraw.h -remote.lo remote.o: $(srcdir)/daemon/remote.c config.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ - $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ - $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ - $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ +remote.lo remote.o: $(srcdir)/daemon/remote.c config.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/worker.h \ + $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/netevent.h \ + $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \ + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ $(srcdir)/services/modstack.h $(srcdir)/daemon/cachedump.h $(srcdir)/util/config_file.h \ $(srcdir)/util/net_help.h $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ @@ -1002,35 +986,33 @@ stats.lo stats.o: $(srcdir)/daemon/stats $(srcdir)/util/rtt.h $(srcdir)/validator/val_kcache.h unbound.lo unbound.o: $(srcdir)/daemon/unbound.c config.h $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h \ $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ - $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ - $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/net_help.h $(srcdir)/util/mini_event.h \ - $(srcdir)/util/rbtree.h + $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/util/storage/lruhash.h $(srcdir)/services/listen_dnsport.h $(srcdir)/util/netevent.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/rtt.h $(srcdir)/util/fptr_wlist.h \ + $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ + $(srcdir)/sldns/rrdef.h $(srcdir)/util/tube.h $(srcdir)/services/mesh.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h worker.lo worker.o: $(srcdir)/daemon/worker.c config.h $(srcdir)/util/log.h $(srcdir)/util/net_help.h \ $(srcdir)/util/random.h $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h \ $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ - $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h \ + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/config_file.h $(srcdir)/util/regional.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h \ $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/libunbound/libworker.h testbound.lo testbound.o: $(srcdir)/testcode/testbound.c config.h $(srcdir)/testcode/testpkts.h \ $(srcdir)/testcode/replay.h $(srcdir)/util/netevent.h $(srcdir)/util/rbtree.h $(srcdir)/testcode/fake_event.h \ - $(srcdir)/daemon/remote.h \ - $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c $(srcdir)/util/log.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/sldns/keyraw.h $(srcdir)/daemon/unbound.c \ + $(srcdir)/util/log.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ $(srcdir)/util/storage/slabhash.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h \ @@ -1046,12 +1028,12 @@ worker.lo worker.o: $(srcdir)/daemon/wor $(srcdir)/util/netevent.h $(srcdir)/util/alloc.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h \ $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/daemon.h \ - $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/regional.h $(srcdir)/util/storage/slabhash.h \ - $(srcdir)/services/listen_dnsport.h $(srcdir)/services/outside_network.h \ - $(srcdir)/services/outbound_list.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ - $(srcdir)/util/rtt.h $(srcdir)/services/cache/dns.h $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h \ + $(srcdir)/services/modstack.h $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h \ + $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/config_file.h $(srcdir)/util/regional.h \ + $(srcdir)/util/storage/slabhash.h $(srcdir)/services/listen_dnsport.h \ + $(srcdir)/services/outside_network.h $(srcdir)/services/outbound_list.h \ + $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h $(srcdir)/util/rtt.h \ + $(srcdir)/services/cache/dns.h $(srcdir)/services/mesh.h $(srcdir)/services/localzone.h \ $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/dname.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h \ $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h $(srcdir)/validator/autotrust.h \ $(srcdir)/validator/val_anchor.h $(srcdir)/libunbound/context.h $(srcdir)/libunbound/unbound.h \ @@ -1059,14 +1041,13 @@ worker.lo worker.o: $(srcdir)/daemon/wor acl_list.lo acl_list.o: $(srcdir)/daemon/acl_list.c config.h $(srcdir)/daemon/acl_list.h \ $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h $(srcdir)/util/regional.h $(srcdir)/util/log.h \ $(srcdir)/util/config_file.h $(srcdir)/util/net_help.h -daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h \ - $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ - $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ - $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ +daemon.lo daemon.o: $(srcdir)/daemon/daemon.c config.h $(srcdir)/daemon/daemon.h $(srcdir)/util/locks.h \ + $(srcdir)/util/log.h $(srcdir)/util/alloc.h $(srcdir)/services/modstack.h \ + $(srcdir)/daemon/worker.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/netevent.h \ + $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h \ + $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h $(srcdir)/dnstap/dnstap.h \ + $(srcdir)/daemon/remote.h $(srcdir)/daemon/acl_list.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rbtree.h \ $(srcdir)/util/config_file.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/storage/slabhash.h \ $(srcdir)/services/listen_dnsport.h $(srcdir)/services/cache/rrset.h $(srcdir)/services/cache/infra.h \ $(srcdir)/util/rtt.h $(srcdir)/services/localzone.h $(srcdir)/util/random.h $(srcdir)/util/tube.h \ @@ -1141,19 +1122,18 @@ libunbound.lo libunbound.o: $(srcdir)/li $(srcdir)/util/random.h $(srcdir)/util/net_help.h $(srcdir)/util/tube.h $(srcdir)/services/localzone.h \ $(srcdir)/services/cache/infra.h $(srcdir)/util/storage/dnstree.h $(srcdir)/util/rtt.h \ $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h $(srcdir)/sldns/sbuffer.h -libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h \ - $(srcdir)/libunbound/libworker.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ - $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h \ - $(srcdir)/services/modstack.h $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/worker.h \ - $(srcdir)/sldns/sbuffer.h $(srcdir)/libunbound/unbound-event.h $(srcdir)/services/outside_network.h \ - $(srcdir)/util/netevent.h $(srcdir)/services/mesh.h \ - $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h \ - $(srcdir)/util/data/msgreply.h $(srcdir)/services/localzone.h $(srcdir)/services/cache/rrset.h \ - $(srcdir)/util/storage/slabhash.h $(srcdir)/services/outbound_list.h $(srcdir)/util/fptr_wlist.h \ - $(srcdir)/util/tube.h $(srcdir)/util/regional.h $(srcdir)/util/random.h $(srcdir)/util/config_file.h \ - $(srcdir)/util/storage/lookup3.h $(srcdir)/util/net_help.h $(srcdir)/util/data/dname.h \ - $(srcdir)/util/data/msgencode.h $(srcdir)/iterator/iter_fwd.h $(srcdir)/iterator/iter_hints.h \ - $(srcdir)/util/storage/dnstree.h $(srcdir)/sldns/str2wire.h +libworker.lo libworker.o: $(srcdir)/libunbound/libworker.c config.h $(srcdir)/libunbound/libworker.h \ + $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h \ + $(srcdir)/libunbound/context.h $(srcdir)/util/alloc.h $(srcdir)/util/rbtree.h $(srcdir)/services/modstack.h \ + $(srcdir)/libunbound/unbound.h $(srcdir)/libunbound/worker.h $(srcdir)/sldns/sbuffer.h \ + $(srcdir)/libunbound/unbound-event.h $(srcdir)/services/outside_network.h $(srcdir)/util/netevent.h \ + $(srcdir)/services/mesh.h $(srcdir)/util/data/msgparse.h \ + $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/module.h $(srcdir)/util/data/msgreply.h \ + $(srcdir)/services/localzone.h $(srcdir)/services/cache/rrset.h $(srcdir)/util/storage/slabhash.h \ + $(srcdir)/services/outbound_list.h $(srcdir)/util/fptr_wlist.h $(srcdir)/util/tube.h $(srcdir)/util/regional.h \ + $(srcdir)/util/random.h $(srcdir)/util/config_file.h $(srcdir)/util/storage/lookup3.h $(srcdir)/util/net_help.h \ + $(srcdir)/util/data/dname.h $(srcdir)/util/data/msgencode.h $(srcdir)/iterator/iter_fwd.h \ + $(srcdir)/iterator/iter_hints.h $(srcdir)/util/storage/dnstree.h $(srcdir)/sldns/str2wire.h unbound-host.lo unbound-host.o: $(srcdir)/smallapp/unbound-host.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/wire2str.h asynclook.lo asynclook.o: $(srcdir)/testcode/asynclook.c config.h $(srcdir)/libunbound/unbound.h \ @@ -1164,21 +1144,18 @@ streamtcp.lo streamtcp.o: $(srcdir)/test $(srcdir)/util/net_help.h $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgparse.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/rrdef.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/dname.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h \ - + $(srcdir)/sldns/str2wire.h $(srcdir)/sldns/wire2str.h perf.lo perf.o: $(srcdir)/testcode/perf.c config.h $(srcdir)/util/log.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h \ $(srcdir)/util/data/msgencode.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/sbuffer.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h delayer.lo delayer.o: $(srcdir)/testcode/delayer.c config.h $(srcdir)/util/net_help.h $(srcdir)/util/log.h \ $(srcdir)/util/config_file.h $(srcdir)/sldns/sbuffer.h -unbound-control.lo unbound-control.o: $(srcdir)/smallapp/unbound-control.c config.h \ - $(srcdir)/util/log.h $(srcdir)/util/config_file.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h +unbound-control.lo unbound-control.o: $(srcdir)/smallapp/unbound-control.c config.h $(srcdir)/util/log.h \ + $(srcdir)/util/config_file.h $(srcdir)/util/locks.h $(srcdir)/util/net_help.h unbound-anchor.lo unbound-anchor.o: $(srcdir)/smallapp/unbound-anchor.c config.h $(srcdir)/libunbound/unbound.h \ - $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h \ - -petal.lo petal.o: $(srcdir)/testcode/petal.c config.h \ - + $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/parseutil.h +petal.lo petal.o: $(srcdir)/testcode/petal.c config.h pythonmod_utils.lo pythonmod_utils.o: $(srcdir)/pythonmod/pythonmod_utils.c config.h $(srcdir)/util/module.h \ $(srcdir)/util/storage/lruhash.h $(srcdir)/util/locks.h $(srcdir)/util/log.h $(srcdir)/util/data/msgreply.h \ $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ @@ -1191,8 +1168,7 @@ win_svc.lo win_svc.o: $(srcdir)/winrc/wi $(srcdir)/sldns/sbuffer.h $(srcdir)/util/data/packed_rrset.h $(srcdir)/util/storage/lruhash.h \ $(srcdir)/util/netevent.h $(srcdir)/util/data/msgreply.h $(srcdir)/util/data/msgparse.h $(srcdir)/sldns/pkthdr.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/daemon/stats.h $(srcdir)/util/timehist.h $(srcdir)/util/module.h \ - $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h \ - $(srcdir)/util/config_file.h $(srcdir)/util/winsock_event.h + $(srcdir)/dnstap/dnstap.h $(srcdir)/daemon/remote.h $(srcdir)/util/config_file.h $(srcdir)/util/winsock_event.h w_inst.lo w_inst.o: $(srcdir)/winrc/w_inst.c config.h $(srcdir)/winrc/w_inst.h $(srcdir)/winrc/win_svc.h unbound-service-install.lo unbound-service-install.o: $(srcdir)/winrc/unbound-service-install.c config.h \ $(srcdir)/winrc/w_inst.h @@ -1200,14 +1176,11 @@ unbound-service-remove.lo unbound-servic $(srcdir)/winrc/w_inst.h anchor-update.lo anchor-update.o: $(srcdir)/winrc/anchor-update.c config.h $(srcdir)/libunbound/unbound.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/wire2str.h -keyraw.lo keyraw.o: $(srcdir)/sldns/keyraw.c config.h $(srcdir)/sldns/keyraw.h \ - $(srcdir)/sldns/rrdef.h \ - +keyraw.lo keyraw.o: $(srcdir)/sldns/keyraw.c config.h $(srcdir)/sldns/keyraw.h $(srcdir)/sldns/rrdef.h sbuffer.lo sbuffer.o: $(srcdir)/sldns/sbuffer.c config.h $(srcdir)/sldns/sbuffer.h wire2str.lo wire2str.o: $(srcdir)/sldns/wire2str.c config.h $(srcdir)/sldns/wire2str.h $(srcdir)/sldns/str2wire.h \ $(srcdir)/sldns/rrdef.h $(srcdir)/sldns/pkthdr.h $(srcdir)/sldns/parseutil.h $(srcdir)/sldns/sbuffer.h \ - $(srcdir)/sldns/keyraw.h \ - + $(srcdir)/sldns/keyraw.h parse.lo parse.o: $(srcdir)/sldns/parse.c config.h $(srcdir)/sldns/parse.h $(srcdir)/sldns/parseutil.h \ $(srcdir)/sldns/sbuffer.h parseutil.lo parseutil.o: $(srcdir)/sldns/parseutil.c config.h $(srcdir)/sldns/parseutil.h @@ -1227,8 +1200,7 @@ snprintf.lo snprintf.o: $(srcdir)/compat strlcat.lo strlcat.o: $(srcdir)/compat/strlcat.c config.h strlcpy.lo strlcpy.o: $(srcdir)/compat/strlcpy.c config.h strptime.lo strptime.o: $(srcdir)/compat/strptime.c config.h -getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c config.h \ - +getentropy_linux.lo getentropy_linux.o: $(srcdir)/compat/getentropy_linux.c config.h getentropy_osx.lo getentropy_osx.o: $(srcdir)/compat/getentropy_osx.c config.h getentropy_solaris.lo getentropy_solaris.o: $(srcdir)/compat/getentropy_solaris.c config.h getentropy_win.lo getentropy_win.o: $(srcdir)/compat/getentropy_win.c @@ -1238,3 +1210,4 @@ arc4random_uniform.lo arc4random_uniform arc4_lock.lo arc4_lock.o: $(srcdir)/compat/arc4_lock.c config.h $(srcdir)/util/locks.h sha512.lo sha512.o: $(srcdir)/compat/sha512.c config.h reallocarray.lo reallocarray.o: $(srcdir)/compat/reallocarray.c config.h +isblank.lo isblank.o: $(srcdir)/compat/isblank.c config.h Modified: vendor/unbound/dist/acx_nlnetlabs.m4 ============================================================================== --- vendor/unbound/dist/acx_nlnetlabs.m4 Sat Dec 12 22:17:52 2015 (r292132) +++ vendor/unbound/dist/acx_nlnetlabs.m4 Sat Dec 12 22:18:57 2015 (r292133) @@ -2,7 +2,9 @@ # Copyright 2009, Wouter Wijngaards, NLnet Labs. # BSD licensed. # -# Version 28 +# Version 30 +# 2015-11-18 spelling check fix. +# 2015-11-05 ACX_SSL_CHECKS no longer adds -ldl needlessly. # 2015-08-28 ACX_CHECK_PIE and ACX_CHECK_RELRO_NOW added. # 2015-03-17 AHX_CONFIG_REALLOCARRAY added # 2013-09-19 FLTO help text improved. @@ -24,7 +26,7 @@ # 2010-07-02 Add check for ss_family (for minix). # 2010-04-26 Fix to use CPPFLAGS for CHECK_COMPILER_FLAGS. # 2010-03-01 Fix RPATH using CONFIG_COMMANDS to run at the very end. -# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS seperate, -ldl +# 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS separate, -ldl # 2010-02-01 added ACX_CHECK_MEMCMP_SIGNED, AHX_MEMCMP_BROKEN # 2010-01-20 added AHX_COONFIG_STRLCAT # 2009-07-14 U_CHAR detection improved for windows crosscompile. @@ -715,12 +717,6 @@ AC_DEFUN([ACX_SSL_CHECKS], [ fi AC_SUBST(HAVE_SSL) AC_SUBST(RUNTIME_PATH) - # openssl engine functionality needs dlopen(). - BAKLIBS="$LIBS" - AC_SEARCH_LIBS([dlopen], [dl]) - if test "$LIBS" != "$BAKLIBS"; then - LIBSSL_LIBS="$LIBSSL_LIBS -ldl" - fi fi AC_CHECK_HEADERS([openssl/ssl.h],,, [AC_INCLUDES_DEFAULT]) AC_CHECK_HEADERS([openssl/err.h],,, [AC_INCLUDES_DEFAULT]) Modified: vendor/unbound/dist/compat/arc4random.c ============================================================================== --- vendor/unbound/dist/compat/arc4random.c Sat Dec 12 22:17:52 2015 (r292132) +++ vendor/unbound/dist/compat/arc4random.c Sat Dec 12 22:18:57 2015 (r292133) @@ -26,7 +26,9 @@ #include #include #include +#ifdef HAVE_STDINT_H #include +#endif #include #include #include Modified: vendor/unbound/dist/compat/getentropy_linux.c ============================================================================== --- vendor/unbound/dist/compat/getentropy_linux.c Sat Dec 12 22:17:52 2015 (r292132) +++ vendor/unbound/dist/compat/getentropy_linux.c Sat Dec 12 22:18:57 2015 (r292133) @@ -46,7 +46,12 @@ #include #include #include + +#if defined(HAVE_SSL) #include +#elif defined(HAVE_NETTLE) +#include +#endif #include #include @@ -67,9 +72,21 @@ HD(b); \ } while (0) +#if defined(HAVE_SSL) +#define CRYPTO_SHA512_CTX SHA512_CTX +#define CRYPTO_SHA512_INIT(x) SHA512_Init(x) +#define CRYPTO_SHA512_FINAL(r, c) SHA512_Final(r, c) #define HR(x, l) (SHA512_Update(&ctx, (char *)(x), (l))) #define HD(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (x))) #define HF(x) (SHA512_Update(&ctx, (char *)&(x), sizeof (void*))) +#elif defined(HAVE_NETTLE) +#define CRYPTO_SHA512_CTX struct sha512_ctx +#define CRYPTO_SHA512_INIT(x) sha512_init(x) +#define CRYPTO_SHA512_FINAL(r, c) sha512_digest(c, SHA512_DIGEST_SIZE, r) +#define HR(x, l) (sha512_update(&ctx, (l), (uint8_t *)(x))) +#define HD(x) (sha512_update(&ctx, sizeof (x), (uint8_t *)&(x))) +#define HF(x) (sha512_update(&ctx, sizeof (void*), (uint8_t *)&(x))) +#endif int getentropy(void *buf, size_t len); @@ -122,7 +139,7 @@ getentropy(void *buf, size_t len) * Try to use sysctl CTL_KERN, KERN_RANDOM, RANDOM_UUID. * sysctl is a failsafe API, so it guarantees a result. This * should work inside a chroot, or when file descriptors are - * exhuasted. + * exhausted. * * However this can fail if the Linux kernel removes support * for sysctl. Starting in 2007, there have been efforts to @@ -337,7 +354,7 @@ getentropy_fallback(void *buf, size_t le struct rusage ru; sigset_t sigset; struct stat st; - SHA512_CTX ctx; + CRYPTO_SHA512_CTX ctx; static pid_t lastpid; pid_t pid; size_t i, ii, m; @@ -354,7 +371,7 @@ getentropy_fallback(void *buf, size_t le } for (i = 0; i < len; ) { int j; - SHA512_Init(&ctx); + CRYPTO_SHA512_INIT(&ctx); for (j = 0; j < repeat; j++) { HX((e = gettimeofday(&tv, NULL)) == -1, tv); if (e != -1) { @@ -526,7 +543,7 @@ getentropy_fallback(void *buf, size_t le # endif #endif /* HAVE_GETAUXVAL */ - SHA512_Final(results, &ctx); + CRYPTO_SHA512_FINAL(results, &ctx); memcpy((char*)buf + i, results, min(sizeof(results), len - i)); i += min(sizeof(results), len - i); } Modified: vendor/unbound/dist/compat/getentropy_solaris.c ============================================================================== --- vendor/unbound/dist/compat/getentropy_solaris.c Sat Dec 12 22:17:52 2015 (r292132) +++ vendor/unbound/dist/compat/getentropy_solaris.c Sat Dec 12 22:18:57 2015 (r292133) @@ -30,7 +30,9 @@ #include #include #include +#ifdef HAVE_STDINT_H #include +#endif #include #include #include @@ -39,10 +41,14 @@ #include #include #include +#ifdef HAVE_SYS_SHA2_H #include #define SHA512_Init SHA512Init #define SHA512_Update SHA512Update #define SHA512_Final SHA512Final +#else +#include "openssl/sha.h" +#endif #include #include Added: vendor/unbound/dist/compat/isblank.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/unbound/dist/compat/isblank.c Sat Dec 12 22:18:57 2015 (r292133) @@ -0,0 +1,45 @@ +/* isblank - compatibility implementation of isblank + * + * Copyright (c) 2015, NLnet Labs. All rights reserved. + * + * This software is open source. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 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. + * + * Neither the name of the NLNET LABS 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 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDER 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 "config.h" + +/* return true for a blank character: space or tab */ +int isblank(int c); + +/* implementation of isblank. unsigned char is the argument */ +int +isblank(int c) +{ + return (c==' ' || c=='\t'); +} Modified: vendor/unbound/dist/compat/reallocarray.c ============================================================================== --- vendor/unbound/dist/compat/reallocarray.c Sat Dec 12 22:17:52 2015 (r292132) +++ vendor/unbound/dist/compat/reallocarray.c Sat Dec 12 22:18:57 2015 (r292133) @@ -18,7 +18,10 @@ #include "config.h" #include #include +#ifdef HAVE_STDINT_H #include +#endif +#include #include /* Modified: vendor/unbound/dist/compat/sha512.c ============================================================================== --- vendor/unbound/dist/compat/sha512.c Sat Dec 12 22:17:52 2015 (r292132) +++ vendor/unbound/dist/compat/sha512.c Sat Dec 12 22:18:57 2015 (r292133) @@ -70,7 +70,7 @@ unsigned char *SHA512(void *data, unsign * Please make sure that your system defines BYTE_ORDER. If your * architecture is little-endian, make sure it also defines * LITTLE_ENDIAN and that the two (BYTE_ORDER and LITTLE_ENDIAN) are - * equivilent. + * equivalent. * * If your system does not define the above, then you can do so by * hand like this: Modified: vendor/unbound/dist/compat/snprintf.c ============================================================================== --- vendor/unbound/dist/compat/snprintf.c Sat Dec 12 22:17:52 2015 (r292132) +++ vendor/unbound/dist/compat/snprintf.c Sat Dec 12 22:18:57 2015 (r292133) @@ -42,6 +42,7 @@ #ifdef HAVE_STDINT_H #include #endif +#include /* for test */ /* #define SNPRINTF_TEST 1 */ @@ -428,7 +429,7 @@ print_num_llp(char** at, size_t* left, i char buf[PRINT_DEC_BUFSZ]; int negative = 0; int zero = (value == 0); -#if defined(UINTPTR_MAX) && defined(UINT32_MAX) && (UINTPTR_MAX == UINT32_MAX) +#if defined(SIZE_MAX) && defined(UINT32_MAX) && (UINT32_MAX == SIZE_MAX || INT32_MAX == SIZE_MAX) /* avoid warning about upcast on 32bit systems */ unsigned long long llvalue = (unsigned long)value; #else Modified: vendor/unbound/dist/config.h.in ============================================================================== --- vendor/unbound/dist/config.h.in Sat Dec 12 22:17:52 2015 (r292132) +++ vendor/unbound/dist/config.h.in Sat Dec 12 22:18:57 2015 (r292133) @@ -94,6 +94,10 @@ don't. */ #undef HAVE_DECL_STRLCPY +/* Define to 1 if you have the declaration of `XML_StopParser', and to 0 if + you don't. */ +#undef HAVE_DECL_XML_STOPPARSER + /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H @@ -151,6 +155,9 @@ /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO +/* Define to 1 if you have the `fsync' function. */ +#undef HAVE_FSYNC + /* Whether getaddrinfo is available */ #undef HAVE_GETADDRINFO @@ -205,6 +212,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_IPHLPAPI_H +/* Define to 1 if you have the `isblank' function. */ +#undef HAVE_ISBLANK + /* Define to 1 if you have the `kill' function. */ #undef HAVE_KILL @@ -232,6 +242,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_H +/* Use libnettle for crypto */ +#undef HAVE_NETTLE + /* Use libnss for crypto */ #undef HAVE_NSS @@ -535,6 +548,9 @@ /* The size of `time_t', as computed by sizeof. */ #undef SIZEOF_TIME_T +/* define if (v)snprintf does not return length needed, (but length used) */ +#undef SNPRINTF_RET_BROKEN + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -848,15 +864,13 @@ #define MAXHOSTNAMELEN 256 #endif - -#ifndef HAVE_SNPRINTF +#if !defined(HAVE_SNPRINTF) || defined(SNPRINTF_RET_BROKEN) #define snprintf snprintf_unbound #define vsnprintf vsnprintf_unbound #include int snprintf (char *str, size_t count, const char *fmt, ...); int vsnprintf (char *str, size_t count, const char *fmt, va_list arg); -#endif /* HAVE_SNPRINTF */ - +#endif /* HAVE_SNPRINTF or SNPRINTF_RET_BROKEN */ #ifndef HAVE_INET_PTON #define inet_pton inet_pton_unbound @@ -952,6 +966,11 @@ int memcmp(const void *x, const void *y, char *ctime_r(const time_t *timep, char *buf); #endif +#ifndef HAVE_ISBLANK +#define isblank unbound_isblank +int isblank(int c); +#endif + #if !defined(HAVE_STRPTIME) || !defined(STRPTIME_WORKS) #define strptime unbound_strptime struct tm; Modified: vendor/unbound/dist/configure ============================================================================== --- vendor/unbound/dist/configure Sat Dec 12 22:17:52 2015 (r292132) +++ vendor/unbound/dist/configure Sat Dec 12 22:18:57 2015 (r292133) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for unbound 1.5.6. +# Generated by GNU Autoconf 2.69 for unbound 1.5.7. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='unbound' PACKAGE_TARNAME='unbound' -PACKAGE_VERSION='1.5.6' -PACKAGE_STRING='unbound 1.5.6' +PACKAGE_VERSION='1.5.7' +PACKAGE_STRING='unbound 1.5.7' PACKAGE_BUGREPORT='unbound-bugs@nlnetlabs.nl' PACKAGE_URL='' @@ -661,6 +661,7 @@ CHECKLOCK_OBJ staticexe UNBOUND_EVENT_UNINSTALL UNBOUND_EVENT_INSTALL +SSLLIB HAVE_SSL CONFIG_DATE NETBSD_LINTFLAGS @@ -823,6 +824,7 @@ with_solaris_threads with_pyunbound with_pythonmodule with_nss +with_nettle with_ssl enable_sha2 enable_gost @@ -1391,7 +1393,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures unbound 1.5.6 to adapt to many kinds of systems. +\`configure' configures unbound 1.5.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1456,7 +1458,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of unbound 1.5.6:";; + short | recursive ) echo "Configuration of unbound 1.5.7:";; esac cat <<\_ACEOF @@ -1534,6 +1536,7 @@ Optional Packages: --with-pythonmodule build Python module, or --without-pythonmodule to disable script engine. (default=no) --with-nss=path use libnss instead of openssl, installed at path. + --with-nettle=path use libnettle as crypto library, installed at path. --with-ssl=pathname enable SSL (will check /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr) @@ -1635,7 +1638,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -unbound configure 1.5.6 +unbound configure 1.5.7 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2344,7 +2347,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by unbound $as_me 1.5.6, which was +It was created by unbound $as_me 1.5.7, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2696,11 +2699,11 @@ UNBOUND_VERSION_MAJOR=1 UNBOUND_VERSION_MINOR=5 -UNBOUND_VERSION_MICRO=6 +UNBOUND_VERSION_MICRO=7 LIBUNBOUND_CURRENT=5 -LIBUNBOUND_REVISION=9 +LIBUNBOUND_REVISION=10 LIBUNBOUND_AGE=3 # 1.0.0 had 0:12:0 # 1.0.1 had 0:13:0 @@ -2746,6 +2749,7 @@ LIBUNBOUND_AGE=3 # 1.5.4 had 5:7:3 # 1.5.5 had 5:8:3 # 1.5.6 had 5:9:3 +# 1.5.7 had 5:10:3 # Current -- the number of the binary API that we're implementing # Revision -- which iteration of the implementation of the binary @@ -16407,13 +16411,44 @@ $as_echo "#define HAVE_NSS 1" >>confdefs CPPFLAGS="-I/usr/include/nspr4 $CPPFLAGS" fi LIBS="$LIBS -lnss3 -lnspr4" + SSLLIB="" + + +fi + + +# libnettle +USE_NETTLE="no" + +# Check whether --with-nettle was given. +if test "${with_nettle+set}" = set; then : + withval=$with_nettle; + USE_NETTLE="yes" + +$as_echo "#define HAVE_NETTLE 1" >>confdefs.h + + if test "$withval" != "" -a "$withval" != "yes"; then + CPPFLAGS="$CPPFLAGS -I$withval/include/nettle" + LDFLAGS="$LDFLAGS -L$withval/lib" + + if test "x$enable_rpath" = xyes; then + if echo "$withval/lib" | grep "^/" >/dev/null; then + RUNTIME_PATH="$RUNTIME_PATH -R$withval/lib" + fi + fi + + else + CPPFLAGS="$CPPFLAGS -I/usr/include/nettle" + fi + LIBS="$LIBS -lhogweed -lnettle -lgmp" + SSLLIB="" fi # openssl -if test $USE_NSS = "no"; then +if test $USE_NSS = "no" -a $USE_NETTLE = "no"; then # Check whether --with-ssl was given. @@ -16582,67 +16617,6 @@ rm -f core conftest.err conftest.$ac_obj fi - # openssl engine functionality needs dlopen(). - BAKLIBS="$LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing dlopen" >&5 -$as_echo_n "checking for library containing dlopen... " >&6; } -if ${ac_cv_search_dlopen+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_func_search_save_LIBS=$LIBS -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Sat Dec 12 22:19:09 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD83CA3BEAF; Sat, 12 Dec 2015 22:19:09 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6290A1095; Sat, 12 Dec 2015 22:19:09 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBCMJ8Pj059878; Sat, 12 Dec 2015 22:19:08 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBCMJ84O059877; Sat, 12 Dec 2015 22:19:08 GMT (envelope-from des@FreeBSD.org) Message-Id: <201512122219.tBCMJ84O059877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sat, 12 Dec 2015 22:19:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r292134 - vendor/unbound/1.5.7 X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 22:19:09 -0000 Author: des Date: Sat Dec 12 22:19:08 2015 New Revision: 292134 URL: https://svnweb.freebsd.org/changeset/base/292134 Log: tag unbound 1.5.7 Added: vendor/unbound/1.5.7/ - copied from r292133, vendor/unbound/dist/ From owner-svn-src-all@freebsd.org Sat Dec 12 22:54:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B9F9A4096A; Sat, 12 Dec 2015 22:54:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F30161241; Sat, 12 Dec 2015 22:54:13 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tBCMsDTj073093; Sat, 12 Dec 2015 22:54:13 GMT (envelope-from des@FreeBSD.org) Received: (from des@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBCMsDFV073092; Sat, 12 Dec 2015 22:54:13 GMT (envelope-from des@FreeBSD.org) Message-Id: <201512122254.tBCMsDFV073092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: des set sender to des@FreeBSD.org using -f From: =?UTF-8?Q?Dag-Erling_Sm=c3=b8rgrav?= Date: Sat, 12 Dec 2015 22:54:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r292135 - head/contrib/unbound X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 Dec 2015 22:54:14 -0000 Author: des Date: Sat Dec 12 22:54:12 2015 New Revision: 292135 URL: https://svnweb.freebsd.org/changeset/base/292135 Log: Ask make(1) which compiler to use rather than rely on whatever is in $PATH. Modified: head/contrib/unbound/freebsd-configure.sh Modified: head/contrib/unbound/freebsd-configure.sh ============================================================================== --- head/contrib/unbound/freebsd-configure.sh Sat Dec 12 22:19:08 2015 (r292134) +++ head/contrib/unbound/freebsd-configure.sh Sat Dec 12 22:54:12 2015 (r292135) @@ -24,6 +24,9 @@ ldnsobj=$(realpath $(make -C$ldnsbld -V. [ -f $ldnsobj/libprivateldns.a ] || error "can't find LDNS object directory" export LDFLAGS="-L$ldnsobj" +export CC=$(echo ".include " | make -f /dev/stdin -VCC) +export CPP=$(echo ".include " | make -f /dev/stdin -VCPP) + autoconf autoheader ./configure \