From owner-svn-src-head@freebsd.org Sun Jun 19 00:06:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A5CFA79BB9; Sun, 19 Jun 2016 00:06:37 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E9B4216E0; Sun, 19 Jun 2016 00:06:36 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id EQFvbNWpVN9d0EQFwb3vwr; Sat, 18 Jun 2016 18:06:29 -0600 X-Authority-Analysis: v=2.2 cv=QZUkhYTv c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=pD_ry4oyNxEA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=6bjs4j2-ulXUaOp-ORUA:9 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 0479913752; Sat, 18 Jun 2016 17:06:27 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u5J06Qk6009591; Sat, 18 Jun 2016 17:06:26 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201606190006.u5J06Qk6009591@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Niclas Zeising cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r288291 - head/etc In-Reply-To: Message from Niclas Zeising of "Sun, 19 Jun 2016 00:06:32 +0200." <2171b966-35c7-2dad-2c0f-f23061cb677a@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 18 Jun 2016 17:06:26 -0700 X-CMAE-Envelope: MS4wfNEk94othDyAawdxAUUBXXWjvvMz70gz8uaG1KddphgPc9DOGr+uUBu8MUpaxq2X6PrqyQHlS0rDO865IGakQubgFFtuGkxuyOqLI5cTCwM6r8xiiY0h zh3m+w1pFLMSVG2kYBOj/KCEgIbdqVM+yvyRG7tK97iBDsFKMFraFCMqc2OPTpf+V1mwuLrvOkgWRrp+7sGCtkHPjxS7eF8voPqcW2j56rt2SOfygPcwG3XG A5X5hrUaeOWyNAtI+gF6JU78K7Hl5Jfyke8viTnj9gekkr9NV1sOTanODa3nNPJri6OqeWiL9n/kIHwEDQmNYA== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 00:06:37 -0000 In message <2171b966-35c7-2dad-2c0f-f23061cb677a@freebsd.org>, Niclas Zeising w rites: > On 09/27/15 06:03, Adrian Chadd wrote: > > Author: adrian > > Date: Sun Sep 27 04:03:11 2015 > > New Revision: 288291 > > URL: https://svnweb.freebsd.org/changeset/base/288291 > > > > Log: > > Enforce consistent limits of daemons run from rc.subr: > > > > * Allow the user to configure the login class to use in rc.conf > > by using {daemon}_login_class, which; > > * Use the daemon class by default; > > * .. and then use 'limits' to set the login class so it works both > > via init at startup (which runs this in 'daemon' class) and via > > whichever root environment (eg command line, other daemons, etc.) > > > > Reviewed by: dteske > > Differential Revision: https://reviews.freebsd.org/D3630 > > > > Modified: > > head/etc/rc.subr > > > > Modified: head/etc/rc.subr > > =========================================================================== > === > > --- head/etc/rc.subr Sun Sep 27 03:46:55 2015 (r288290) > > +++ head/etc/rc.subr Sun Sep 27 04:03:11 2015 (r288291) > > @@ -768,6 +768,8 @@ check_startmsgs() > > # > > # ${name}_prepend n Command added before ${command}. > > # > > +# ${name}_login_class n Login class to use, else "daemon". > > +# > > # ${rc_arg}_cmd n If set, use this as the method when invoked; > > # Otherwise, use default command (see below) > > # > > @@ -942,7 +944,7 @@ run_rc_command() > > _nice=\$${name}_nice _user=\$${name}_user \ > > _group=\$${name}_group _groups=\$${name}_groups \ > > _fib=\$${name}_fib _env=\$${name}_env \ > > - _prepend=\$${name}_prepend > > + _prepend=\$${name}_prepend _login_class=\${${name}_login_class:-da > emon} > > > > if [ -n "$_user" ]; then # unset $_user if running as that user > > if [ "$_user" = "$(eval $IDCMD)" ]; then > > @@ -1050,6 +1052,9 @@ $command $rc_flags $command_args" > > fi > > fi > > > > + # Prepend default limits > > + _doit="limits -C $_login_class $_doit" > ^^^^^^^^^^ > > + > > # run the full command > > # > > if ! _run_rc_doit "$_doit"; then > > Apologies for waking so late. > This breaks the start of scripts running before file systems are > mounted, for example /etc/rc.d/ddb, if / and /usr are on separate > partitions. The issue is that limits is /usr/bin/limits, and for > obvious reasons can't be found before /usr is mounted. > I suggest either move /usr/bin/limits to /bin/limits or avoid using it > altogether. > Do you want me to open a PR to track this issue? > Regards! A simple solution might be, Index: rc.subr =================================================================== --- rc.subr (revision 302001) +++ rc.subr (working copy) @@ -1071,8 +1071,13 @@ fi fi + # Before we prepend limits, test if limits is + # available (/usr is mounted) so that limits can + # be run. + if limits >/dev/null 2>&1; then # Prepend default limits - _doit="limits -C $_login_class $_doit" + _doit="limits -C $_login_class $_doit" + fi # run the full command # -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sun Jun 19 03:32:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DED2A7A319; Sun, 19 Jun 2016 03:32:28 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x22e.google.com (mail-io0-x22e.google.com [IPv6:2607:f8b0:4001:c06::22e]) (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 630522B48; Sun, 19 Jun 2016 03:32:28 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x22e.google.com with SMTP id f30so98107825ioj.2; Sat, 18 Jun 2016 20:32:28 -0700 (PDT) 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; bh=P1JsJPb3unPZtLMZIZSL20vvHQcYN9ktddSV4IIQ05M=; b=E/le8PaySYylMSmzkaX+GF4UjWsi3Mpn3HwtAhzrqsRAFRiN+A6W8TWzGlWkBjjN3y 2vQahlO+RHOrRiALcX8LlnwA/DNJryqMO1p3oV4EjJzTJUJbZ93AmBQ9jEtdcUP8xbse f8SnLP9/8Uk+bGpY6YUL2n6wbpc5A4rPqsYaOcQuZuvaVHZYbr2QoDLHuQR8Z5cDMmIz tk2wUGH4ylmEPPJq3VM57+dF2v2NSNtHpcUSuW8ZThQ9t3xDs3HDjVYhhcRTC+yAUfol 45c5bgkbOCZleCaHRACH5WeXvFdmg2PKVmlphWONdp09u01bSsNW7OarHgqeowS07Q6F bbMw== 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:from :date:message-id:subject:to:cc; bh=P1JsJPb3unPZtLMZIZSL20vvHQcYN9ktddSV4IIQ05M=; b=BodpDUsQ+PDH3OmGs4SC9yOVapsmu5ESNuCsUmh1LOo3iqoS37FDUUiMauK2wpWvUb mD+lStfAEF+QfCSJ9vAcbzdjCFwILAKrrfq0e0OgR8tJC/cNWrVzQWIQWUkJfX0baH9Z OhzRszW9T5bUgBmCDS270MACZEXJbd9kc1WpTayhsveiSqvkIekqeSXBT/6diymtcsJ2 /XCLApqdWXr6cue59xg9wliaOdRirXKntWNxBY1C2Bjz4ONGUU8s53RXfrc1IVDFRaiZ wtGSizyleFKDW6SCcsuA3ss8OgC0nR4wyk1ar6D7BNrvqauNVEDr+qU7aULnuwpMsby9 N6QQ== X-Gm-Message-State: ALyK8tKW9KdIhbASJfRbP3NpnuHZ4iAS85ETUicQlpNmF3OLQycb8fkeIteHGBd9oeQoZ4uLFpr5C+PHzWmbng== X-Received: by 10.107.144.2 with SMTP id s2mr12322349iod.165.1466307147600; Sat, 18 Jun 2016 20:32:27 -0700 (PDT) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.36.113.3 with HTTP; Sat, 18 Jun 2016 20:32:26 -0700 (PDT) In-Reply-To: <201606190006.u5J06Qk6009591@slippy.cwsent.com> References: <2171b966-35c7-2dad-2c0f-f23061cb677a@freebsd.org> <201606190006.u5J06Qk6009591@slippy.cwsent.com> From: Adrian Chadd Date: Sat, 18 Jun 2016 20:32:26 -0700 X-Google-Sender-Auth: pGY9XasTuOiq20l4LYAMBYCbDds Message-ID: Subject: Re: svn commit: r288291 - head/etc To: Cy Schubert Cc: Niclas Zeising , "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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 03:32:28 -0000 i think that's fine for -11. I'd like to just move limits to /bin for 12. (I mean, it's 2016, why are you splitting / and /usr again? But..) I don't want to see differing system behaviour between limits but it's likely unavoidable for 11 and could do with some errata notice so people know what to expect. Thanks, -adrian On 18 June 2016 at 17:06, Cy Schubert wrote: > In message <2171b966-35c7-2dad-2c0f-f23061cb677a@freebsd.org>, Niclas > Zeising w > rites: >> On 09/27/15 06:03, Adrian Chadd wrote: >> > Author: adrian >> > Date: Sun Sep 27 04:03:11 2015 >> > New Revision: 288291 >> > URL: https://svnweb.freebsd.org/changeset/base/288291 >> > >> > Log: >> > Enforce consistent limits of daemons run from rc.subr: >> > >> > * Allow the user to configure the login class to use in rc.conf >> > by using {daemon}_login_class, which; >> > * Use the daemon class by default; >> > * .. and then use 'limits' to set the login class so it works both >> > via init at startup (which runs this in 'daemon' class) and via >> > whichever root environment (eg command line, other daemons, etc.) >> > >> > Reviewed by: dteske >> > Differential Revision: https://reviews.freebsd.org/D3630 >> > >> > Modified: >> > head/etc/rc.subr >> > >> > Modified: head/etc/rc.subr >> > =========================================================================== >> === >> > --- head/etc/rc.subr Sun Sep 27 03:46:55 2015 (r288290) >> > +++ head/etc/rc.subr Sun Sep 27 04:03:11 2015 (r288291) >> > @@ -768,6 +768,8 @@ check_startmsgs() >> > # >> > # ${name}_prepend n Command added before ${command}. >> > # >> > +# ${name}_login_class n Login class to use, else "daemon". >> > +# >> > # ${rc_arg}_cmd n If set, use this as the method when invoked; >> > # Otherwise, use default command (see below) >> > # >> > @@ -942,7 +944,7 @@ run_rc_command() >> > _nice=\$${name}_nice _user=\$${name}_user \ >> > _group=\$${name}_group _groups=\$${name}_groups \ >> > _fib=\$${name}_fib _env=\$${name}_env \ >> > - _prepend=\$${name}_prepend >> > + _prepend=\$${name}_prepend _login_class=\${${name}_login_class:-da >> emon} >> > >> > if [ -n "$_user" ]; then # unset $_user if running as that user >> > if [ "$_user" = "$(eval $IDCMD)" ]; then >> > @@ -1050,6 +1052,9 @@ $command $rc_flags $command_args" >> > fi >> > fi >> > >> > + # Prepend default limits >> > + _doit="limits -C $_login_class $_doit" >> ^^^^^^^^^^ >> > + >> > # run the full command >> > # >> > if ! _run_rc_doit "$_doit"; then >> >> Apologies for waking so late. >> This breaks the start of scripts running before file systems are >> mounted, for example /etc/rc.d/ddb, if / and /usr are on separate >> partitions. The issue is that limits is /usr/bin/limits, and for >> obvious reasons can't be found before /usr is mounted. >> I suggest either move /usr/bin/limits to /bin/limits or avoid using it >> altogether. >> Do you want me to open a PR to track this issue? >> Regards! > > A simple solution might be, > > Index: rc.subr > =================================================================== > --- rc.subr (revision 302001) > +++ rc.subr (working copy) > @@ -1071,8 +1071,13 @@ > fi > fi > > + # Before we prepend limits, test if limits is > + # available (/usr is mounted) so that limits can > + # be run. > + if limits >/dev/null 2>&1; then > # Prepend default limits > - _doit="limits -C $_login_class $_doit" > + _doit="limits -C $_login_class $_doit" > + fi > > # run the full command > # > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: http://www.FreeBSD.org > > The need of the many outweighs the greed of the few. > > > From owner-svn-src-head@freebsd.org Sun Jun 19 03:44:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5DD4A7A4B7; Sun, 19 Jun 2016 03:44:36 +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 86C8F2F97; Sun, 19 Jun 2016 03:44:36 +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 u5J3iZ2D079685; Sun, 19 Jun 2016 03:44:35 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5J3iWO6079652; Sun, 19 Jun 2016 03:44:32 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201606190344.u5J3iWO6079652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Sun, 19 Jun 2016 03:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 03:44:36 -0000 Author: ume Date: Sun Jun 19 03:44:32 2016 New Revision: 302016 URL: https://svnweb.freebsd.org/changeset/base/302016 Log: - Prefer to use %d over %e where the day of the month should be zero filled. - Since %e means the day of the month as well, regard %e as same as %d in md_order. Reported by: vangyzen Approved by: re (gjb) Modified: head/share/timedef/ar_JO.UTF-8.src head/share/timedef/ar_MA.UTF-8.src head/share/timedef/ar_SA.UTF-8.src head/share/timedef/be_BY.CP1131.src head/share/timedef/be_BY.CP1251.src head/share/timedef/be_BY.ISO8859-5.src head/share/timedef/be_BY.UTF-8.src head/share/timedef/bg_BG.CP1251.src head/share/timedef/bg_BG.UTF-8.src head/share/timedef/ca_IT.ISO8859-15.src head/share/timedef/ca_IT.UTF-8.src head/share/timedef/el_GR.ISO8859-7.src head/share/timedef/el_GR.UTF-8.src head/share/timedef/en_SG.UTF-8.src head/share/timedef/en_US.UTF-8.src head/share/timedef/es_AR.ISO8859-1.src head/share/timedef/es_CR.UTF-8.src head/share/timedef/es_ES.ISO8859-15.src head/share/timedef/es_ES.UTF-8.src head/share/timedef/fi_FI.ISO8859-15.src head/share/timedef/fi_FI.UTF-8.src head/share/timedef/fr_BE.ISO8859-15.src head/share/timedef/fr_BE.UTF-8.src head/share/timedef/he_IL.UTF-8.src head/share/timedef/hi_IN.ISCII-DEV.src head/share/timedef/hi_IN.UTF-8.src head/share/timedef/is_IS.ISO8859-15.src head/share/timedef/is_IS.UTF-8.src head/share/timedef/ko_KR.UTF-8.src head/share/timedef/ko_KR.eucKR.src head/share/timedef/nl_BE.UTF-8.src head/share/timedef/sl_SI.ISO8859-2.src head/share/timedef/sl_SI.UTF-8.src head/share/timedef/sr_Cyrl_RS.ISO8859-5.src head/share/timedef/sr_Latn_RS.ISO8859-2.src head/share/timedef/sr_Latn_RS.UTF-8.src head/share/timedef/tr_TR.ISO8859-9.src head/share/timedef/tr_TR.UTF-8.src head/share/timedef/zh_Hans_CN.GB2312.src head/share/timedef/zh_Hans_CN.GBK.src head/share/timedef/zh_Hans_CN.UTF-8.src head/share/timedef/zh_Hans_CN.eucCN.src head/share/timedef/zh_Hant_HK.UTF-8.src head/share/timedef/zh_Hant_TW.Big5.src head/share/timedef/zh_Hant_TW.UTF-8.src head/tools/tools/locale/tools/cldr2def.pl Modified: head/share/timedef/ar_JO.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/ar_MA.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/ar_SA.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.CP1131.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.CP1251.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.ISO8859-5.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/be_BY.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/bg_BG.CP1251.src ============================================================================== --- head/share/timedef/bg_BG.CP1251.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/bg_BG.CP1251.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ %H:%M:%S # # x_fmt -%e.%m.%y г. +%d.%m.%y г. # # c_fmt %A %e %B %Y . %H:%M:%S @@ -80,7 +80,7 @@ # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/bg_BG.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/ca_IT.ISO8859-15.src ============================================================================== --- head/share/timedef/ca_IT.ISO8859-15.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/ca_IT.ISO8859-15.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ dissabte %H:%M:%S # # x_fmt -%e/%m/%y +%d/%m/%y # # c_fmt %A %e %B de %Y, %H:%M:%S @@ -80,7 +80,7 @@ de novembre de desembre # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/ca_IT.UTF-8.src ============================================================================== --- head/share/timedef/ca_IT.UTF-8.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/ca_IT.UTF-8.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ dissabte %H:%M:%S # # x_fmt -%e/%m/%y +%d/%m/%y # # c_fmt %A %e %B de %Y, %H:%M:%S @@ -80,7 +80,7 @@ de novembre de desembre # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/el_GR.ISO8859-7.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/el_GR.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/en_SG.UTF-8.src ============================================================================== --- head/share/timedef/en_SG.UTF-8.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/en_SG.UTF-8.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ Saturday %I:%M:%S %p # # x_fmt -%e/%m/%y +%d/%m/%y # # c_fmt %A %e %B %Y at %I:%M:%S %p @@ -80,7 +80,7 @@ November December # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/en_US.UTF-8.src ============================================================================== --- head/share/timedef/en_US.UTF-8.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/en_US.UTF-8.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ Saturday %I:%M:%S %p # # x_fmt -%m/%e/%y +%m/%d/%y # # c_fmt %A, %B %e, %Y at %I:%M:%S %p @@ -80,7 +80,7 @@ November December # # md_order -m +md # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/es_AR.ISO8859-1.src ============================================================================== --- head/share/timedef/es_AR.ISO8859-1.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/es_AR.ISO8859-1.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ sbado %I:%M:%S %p # # x_fmt -%e/%m/%y +%d/%m/%y # # c_fmt %e de %B de %Y, %I:%M:%S %p @@ -80,7 +80,7 @@ noviembre diciembre # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/es_CR.UTF-8.src ============================================================================== --- head/share/timedef/es_CR.UTF-8.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/es_CR.UTF-8.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ sábado %I:%M:%S %p # # x_fmt -%e/%m/%y +%d/%m/%y # # c_fmt %e de %B de %Y, %I:%M:%S %p @@ -80,7 +80,7 @@ noviembre diciembre # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/es_ES.ISO8859-15.src ============================================================================== --- head/share/timedef/es_ES.ISO8859-15.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/es_ES.ISO8859-15.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ sbado %H:%M:%S # # x_fmt -%e/%m/%y +%d/%m/%y # # c_fmt %e de %B de %Y, %H:%M:%S @@ -80,7 +80,7 @@ noviembre diciembre # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/es_ES.UTF-8.src ============================================================================== --- head/share/timedef/es_ES.UTF-8.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/es_ES.UTF-8.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ sábado %H:%M:%S # # x_fmt -%e/%m/%y +%d/%m/%y # # c_fmt %e de %B de %Y, %H:%M:%S @@ -80,7 +80,7 @@ noviembre diciembre # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/fi_FI.ISO8859-15.src ============================================================================== --- head/share/timedef/fi_FI.ISO8859-15.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/fi_FI.ISO8859-15.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ lauantaina %H.%M.%S # # x_fmt -%e.%m.%Y +%d.%m.%Y # # c_fmt %e. %B %Y klo %H.%M.%S @@ -80,7 +80,7 @@ marraskuuta joulukuuta # # md_order -m +dm # # ampm_fmt %I.%M.%S %p Modified: head/share/timedef/fi_FI.UTF-8.src ============================================================================== --- head/share/timedef/fi_FI.UTF-8.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/fi_FI.UTF-8.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ lauantaina %H.%M.%S # # x_fmt -%e.%m.%Y +%d.%m.%Y # # c_fmt %e. %B %Y klo %H.%M.%S @@ -80,7 +80,7 @@ marraskuuta joulukuuta # # md_order -m +dm # # ampm_fmt %I.%M.%S %p Modified: head/share/timedef/fr_BE.ISO8859-15.src ============================================================================== --- head/share/timedef/fr_BE.ISO8859-15.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/fr_BE.ISO8859-15.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ samedi %H:%M:%S # # x_fmt -%e/%m/%y +%d/%m/%y # # c_fmt %A %e %B %Y %H:%M:%S @@ -80,7 +80,7 @@ novembre dcembre # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/fr_BE.UTF-8.src ============================================================================== --- head/share/timedef/fr_BE.UTF-8.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/fr_BE.UTF-8.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ samedi %H:%M:%S # # x_fmt -%e/%m/%y +%d/%m/%y # # c_fmt %A %e %B %Y %H:%M:%S @@ -80,7 +80,7 @@ novembre décembre # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/he_IL.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/hi_IN.ISCII-DEV.src ============================================================================== --- head/share/timedef/hi_IN.ISCII-DEV.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/hi_IN.ISCII-DEV.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ %I:%M:%S %p # # x_fmt -%e/%m/%y +%d/%m/%y # # c_fmt %A %e %B %Y %I:%M:%S %p @@ -80,7 +80,7 @@ ע # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/hi_IN.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/is_IS.ISO8859-15.src ============================================================================== --- head/share/timedef/is_IS.ISO8859-15.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/is_IS.ISO8859-15.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ laugardagur %H:%M:%S # # x_fmt -%e.%m.%Y +%d.%m.%Y # # c_fmt %e. %B %Y kl. %H:%M:%S @@ -80,7 +80,7 @@ nvember desember # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/is_IS.UTF-8.src ============================================================================== --- head/share/timedef/is_IS.UTF-8.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/is_IS.UTF-8.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ laugardagur %H:%M:%S # # x_fmt -%e.%m.%Y +%d.%m.%Y # # c_fmt %e. %B %Y kl. %H:%M:%S @@ -80,7 +80,7 @@ nóvember desember # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/ko_KR.UTF-8.src ============================================================================== --- head/share/timedef/ko_KR.UTF-8.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/ko_KR.UTF-8.src Sun Jun 19 03:44:32 2016 (r302016) @@ -80,7 +80,7 @@ 12월 # # md_order -m +md # # ampm_fmt %p %I:%M:%S Modified: head/share/timedef/ko_KR.eucKR.src ============================================================================== --- head/share/timedef/ko_KR.eucKR.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/ko_KR.eucKR.src Sun Jun 19 03:44:32 2016 (r302016) @@ -80,7 +80,7 @@ 12 # # md_order -m +md # # ampm_fmt %p %I:%M:%S Modified: head/share/timedef/nl_BE.UTF-8.src ============================================================================== --- head/share/timedef/nl_BE.UTF-8.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/nl_BE.UTF-8.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ zaterdag %H:%M:%S # # x_fmt -%e/%m/%y +%d/%m/%y # # c_fmt %A %e %B %Y %H:%M:%S @@ -80,7 +80,7 @@ november december # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/sl_SI.ISO8859-2.src ============================================================================== --- head/share/timedef/sl_SI.ISO8859-2.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/sl_SI.ISO8859-2.src Sun Jun 19 03:44:32 2016 (r302016) @@ -80,7 +80,7 @@ november december # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/sl_SI.UTF-8.src ============================================================================== --- head/share/timedef/sl_SI.UTF-8.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/sl_SI.UTF-8.src Sun Jun 19 03:44:32 2016 (r302016) @@ -80,7 +80,7 @@ november december # # md_order -m +dm # # ampm_fmt %I:%M:%S %p Modified: head/share/timedef/sr_Cyrl_RS.ISO8859-5.src ============================================================================== --- head/share/timedef/sr_Cyrl_RS.ISO8859-5.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/sr_Cyrl_RS.ISO8859-5.src Sun Jun 19 03:44:32 2016 (r302016) @@ -87,7 +87,7 @@ subota %H.%M.%S""%H.%M.%S # # x_fmt -%e.%m.%y.""%e.%m.%y. +%d.%m.%y.""%e.%m.%y. # # c_fmt %d. %B %Y. %H.%M.%S""%d. %B %Y. %H.%M.%S %Z @@ -126,7 +126,7 @@ novembar decembar # # md_order -mm +dmdm # # ampm_fmt %I.%M.%S %p""%I.%M.%S %p Modified: head/share/timedef/sr_Latn_RS.ISO8859-2.src ============================================================================== --- head/share/timedef/sr_Latn_RS.ISO8859-2.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/sr_Latn_RS.ISO8859-2.src Sun Jun 19 03:44:32 2016 (r302016) @@ -87,7 +87,7 @@ subota %H.%M.%S""%H.%M.%S # # x_fmt -%e.%m.%y.""%e.%m.%y. +%d.%m.%y.""%d.%m.%y. # # c_fmt %d. %B %Y. %H.%M.%S""%d. %B %Y. %H.%M.%S %Z @@ -126,7 +126,7 @@ novembar decembar # # md_order -mm +dmdm # # ampm_fmt %I.%M.%S %p""%I.%M.%S %p Modified: head/share/timedef/sr_Latn_RS.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/tr_TR.ISO8859-9.src ============================================================================== --- head/share/timedef/tr_TR.ISO8859-9.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/tr_TR.ISO8859-9.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ Cumartesi %H:%M:%S # # x_fmt -%e.%m.%Y +%d.%m.%Y # # c_fmt %A %e %B %Y %H:%M:%S @@ -80,7 +80,7 @@ Kasm Aralk # # md_order -m +dm # # ampm_fmt %p %I:%M:%S Modified: head/share/timedef/tr_TR.UTF-8.src ============================================================================== --- head/share/timedef/tr_TR.UTF-8.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/tr_TR.UTF-8.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ Cumartesi %H:%M:%S # # x_fmt -%e.%m.%Y +%d.%m.%Y # # c_fmt %A %e %B %Y %H:%M:%S @@ -80,7 +80,7 @@ Kasım Aralık # # md_order -m +dm # # ampm_fmt %p %I:%M:%S Modified: head/share/timedef/zh_Hans_CN.GB2312.src ============================================================================== --- head/share/timedef/zh_Hans_CN.GB2312.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/zh_Hans_CN.GB2312.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ PGFZAy %p%I:%M:%S # # x_fmt -%y#/%m#/%e +%y#/%m#/%d # # c_fmt %YDj%mTB%eHU %p%I:%M:%S @@ -80,7 +80,7 @@ J.R;TB J.6~TB # # md_order -m +md # # ampm_fmt %p%I:%M:%S Modified: head/share/timedef/zh_Hans_CN.GBK.src ============================================================================== --- head/share/timedef/zh_Hans_CN.GBK.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/zh_Hans_CN.GBK.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ %p%I:%M:%S # # x_fmt -%y/%m/%e +%y/%m/%d # # c_fmt %Y%m%e %p%I:%M:%S @@ -80,7 +80,7 @@ ʮ # # md_order -m +md # # ampm_fmt %p%I:%M:%S Modified: head/share/timedef/zh_Hans_CN.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/share/timedef/zh_Hans_CN.eucCN.src ============================================================================== --- head/share/timedef/zh_Hans_CN.eucCN.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/zh_Hans_CN.eucCN.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ %p%I:%M:%S # # x_fmt -%y%m%e +%y%m%d # # c_fmt %Y%m%e %p%I:%M:%S @@ -80,7 +80,7 @@ ʮ # # md_order -m +md # # ampm_fmt %p%I:%M:%S Modified: head/share/timedef/zh_Hant_HK.UTF-8.src ============================================================================== --- head/share/timedef/zh_Hant_HK.UTF-8.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/zh_Hant_HK.UTF-8.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ %p%I:%M:%S # # x_fmt -%e/%m/%y +%d/%m/%y # # c_fmt %Y年%m月%e日 %p%I:%M:%S [%Z] @@ -80,7 +80,7 @@ 12月 # # md_order -m +dm # # ampm_fmt %p%I:%M:%S Modified: head/share/timedef/zh_Hant_TW.Big5.src ============================================================================== --- head/share/timedef/zh_Hant_TW.Big5.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/zh_Hant_TW.Big5.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ %p%I:%M:%S # # x_fmt -%YA%mA%e +%YA%mA%d # # c_fmt %Y~%m%e %p%I:%M:%S [%Z] @@ -80,7 +80,7 @@ # # md_order -m +md # # ampm_fmt %p%I:%M:%S Modified: head/share/timedef/zh_Hant_TW.UTF-8.src ============================================================================== --- head/share/timedef/zh_Hant_TW.UTF-8.src Sun Jun 19 00:39:23 2016 (r302015) +++ head/share/timedef/zh_Hant_TW.UTF-8.src Sun Jun 19 03:44:32 2016 (r302016) @@ -53,7 +53,7 @@ %p%I:%M:%S # # x_fmt -%Y/%m/%e +%Y/%m/%d # # c_fmt %Y年%m月%e日 %p%I:%M:%S [%Z] @@ -80,7 +80,7 @@ 12月 # # md_order -m +md # # ampm_fmt %p%I:%M:%S Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Sun Jun 19 00:39:23 2016 (r302015) +++ head/tools/tools/locale/tools/cldr2def.pl Sun Jun 19 03:44:32 2016 (r302016) @@ -68,6 +68,7 @@ my %callback = ( mdorder => \&callback_mdorder, altmon => \&callback_altmon, cformat => \&callback_cformat, + dformat => \&callback_dformat, dtformat => \&callback_dtformat, cbabmon => \&callback_abmon, cbampm => \&callback_ampm, @@ -183,10 +184,9 @@ if ($TYPE eq "timedef") { "abday" => "as", "day" => "as", "t_fmt" => "s", - "d_fmt" => "s", + "d_fmt" => " " " "s", "d_t_fmt" => " " "|[-.]))%e/$1%d/; + $s =~ s/%e((|[-.])%m)/%d$1/; + return $s; +}; + sub callback_dtformat { my $s = shift; my $nl = $callback{data}{l} . "_" . $callback{data}{c}; @@ -241,7 +249,8 @@ sub callback_dtformat { sub callback_mdorder { my $s = shift; return undef if (!defined $s); - $s =~ s/[^dm]//g; + $s =~ s/[^dem]//g; + $s =~ s/e/d/g; return $s; }; From owner-svn-src-head@freebsd.org Sun Jun 19 03:45:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCB65A7A516; Sun, 19 Jun 2016 03:45:33 +0000 (UTC) (envelope-from adrian@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 B7C091237; Sun, 19 Jun 2016 03:45:33 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5J3jW4S079769; Sun, 19 Jun 2016 03:45:32 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5J3jWKi079768; Sun, 19 Jun 2016 03:45:32 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606190345.u5J3jWKi079768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 19 Jun 2016 03:45:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302017 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 03:45:34 -0000 Author: adrian Date: Sun Jun 19 03:45:32 2016 New Revision: 302017 URL: https://svnweb.freebsd.org/changeset/base/302017 Log: [ath] add support for batching frames to the general TX queues. It turns out the frame scheduling policies (eg DBA_GATED) operate on a single TX FIFO entry. ASAP scheduling is fine; those frames always go out. DBA-gated sets the TX queue ready when the DBA timer fires, which triggers a beacon transmit. Normally this is used for content-after-beacon queue (CABQ) work, which needs to burst out immediately after a beacon. (eg broadcast, multicast, etc frames.) This is a general policy that you can use for any queue, and Sam's TDMA code uses it. When DBA_GATED is used and something like say, an 11e TX burst window, it only operates on a single TX FIFO entry. If you have a single frame per TX FIFO entry and say, a 2.5ms long burst window (eg TDMA!) then it'll only burst a single frame every 2.5ms. If there's no gating (eg ASAP) then the burst window is fine, and multiple TX FIFO slots get used. The CABQ code does pack in a list of frames (ie, the whole cabq) but up until this commit, the normal TX queues didn't. It showed up when I started to debug TDMA on the AR9380 and later. This commit doesn't fix the TDMA case - that's still broken here, because all I'm doing here is allowing 'some' frames to be bursting, but I'm certainly not filling the whole TX FIFO slot entry with frames. Doing that 'properly' kind of requires me to take into account how long packets should take to transmit and say, doing 1.5 or something times that per TX FIFO slot, as if you partially transmit a slot, when it's next gated it'll just finish that TX FIFO slot, then not advance to the next one. Now, I /also/ think queuing a new packet restarts DMA, but you have to push new frames into the TX FIFO. I need to experiment some more with this because if it's really the case, I will be able to do TDMA support without the egregious hacks I have in my local tree. Sam's TDMA code for previous chips would just kick the TXE bit to push along DMA again, but we can't do that for EDMA chips - we /have/ to push a new frame into the TX FIFO to restart DMA. Ugh. Tested: * AR9380, STA mode * AR9380, hostap mode * AR9580, hostap mode Approved by: re (gjb) Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Sun Jun 19 03:44:32 2016 (r302016) +++ head/sys/dev/ath/if_ath_tx_edma.c Sun Jun 19 03:45:32 2016 (r302017) @@ -138,79 +138,186 @@ MALLOC_DECLARE(M_ATHDEV); static void ath_edma_tx_processq(struct ath_softc *sc, int dosched); -/* - * Push some frames into the TX FIFO if we have space. - */ +#ifdef ATH_DEBUG_ALQ static void -ath_edma_tx_fifo_fill(struct ath_softc *sc, struct ath_txq *txq) +ath_tx_alq_edma_push(struct ath_softc *sc, int txq, int nframes, + int fifo_depth, int frame_cnt) +{ + struct if_ath_alq_tx_fifo_push aq; + + aq.txq = htobe32(txq); + aq.nframes = htobe32(nframes); + aq.fifo_depth = htobe32(fifo_depth); + aq.frame_cnt = htobe32(frame_cnt); + + if_ath_alq_post(&sc->sc_alq, ATH_ALQ_TX_FIFO_PUSH, + sizeof(aq), + (const char *) &aq); +} +#endif /* ATH_DEBUG_ALQ */ + +static void +ath_tx_edma_push_staging_list(struct ath_softc *sc, struct ath_txq *txq, + int limit) { struct ath_buf *bf, *bf_last; - int i = 0; + struct ath_buf *bfi, *bfp; + int i, sqdepth; + TAILQ_HEAD(axq_q_f_s, ath_buf) sq; ATH_TXQ_LOCK_ASSERT(txq); - DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: Q%d: called\n", - __func__, - txq->axq_qnum); + /* + * Don't bother doing any work if it's full. + */ + if (txq->axq_fifo_depth >= HAL_TXFIFO_DEPTH) + return; - TAILQ_FOREACH(bf, &txq->axq_q, bf_list) { - if (txq->axq_fifo_depth >= HAL_TXFIFO_DEPTH) - break; + if (TAILQ_EMPTY(&txq->axq_q)) + return; - /* - * We have space in the FIFO - so let's push a frame - * into it. - */ + TAILQ_INIT(&sq); - /* - * Remove it from the normal list - */ + /* + * First pass - walk sq, queue up to 'limit' entries, + * subtract them from the staging queue. + */ + sqdepth = 0; + for (i = 0; i < limit; i++) { + /* Grab the head entry */ + bf = ATH_TXQ_FIRST(txq); + if (bf == NULL) + break; ATH_TXQ_REMOVE(txq, bf, bf_list); - /* - * XXX for now, we only dequeue a frame at a time, so - * that's only one buffer. Later on when we just - * push this staging _list_ into the queue, we'll - * set bf_last to the end pointer in the list. - */ - bf_last = bf; - DPRINTF(sc, ATH_DEBUG_TX_PROC, - "%s: Q%d: depth=%d; pushing %p->%p\n", - __func__, - txq->axq_qnum, - txq->axq_fifo_depth, - bf, - bf_last); + /* Queue it into our staging list */ + TAILQ_INSERT_TAIL(&sq, bf, bf_list); + sqdepth++; + } - /* - * Append it to the FIFO staging list - */ - ATH_TXQ_INSERT_TAIL(&txq->fifo, bf, bf_list); + /* + * Ok, so now we have a staging list of up to 'limit' + * frames from the txq. Now let's wrap that up + * into its own list and pass that to the hardware + * as one FIFO entry. + */ - /* - * Set fifo start / fifo end flags appropriately - * - */ - bf->bf_flags |= ATH_BUF_FIFOPTR; - bf_last->bf_flags |= ATH_BUF_FIFOEND; + bf = TAILQ_FIRST(&sq); + bf_last = TAILQ_LAST(&sq, axq_q_s); - /* - * Push _into_ the FIFO. - */ - ath_hal_puttxbuf(sc->sc_ah, txq->axq_qnum, bf->bf_daddr); + /* + * Ok, so here's the gymnastics reqiured to make this + * all sensible. + */ + + /* + * Tag the first/last buffer appropriately. + */ + bf->bf_flags |= ATH_BUF_FIFOPTR; + bf_last->bf_flags |= ATH_BUF_FIFOEND; + + /* + * Walk the descriptor list and link them appropriately. + */ + bfp = NULL; + TAILQ_FOREACH(bfi, &sq, bf_list) { + if (bfp != NULL) { + ath_hal_settxdesclink(sc->sc_ah, bfp->bf_lastds, + bfi->bf_daddr); + } + bfp = bfi; + } + + i = 0; + TAILQ_FOREACH(bfi, &sq, bf_list) { #ifdef ATH_DEBUG if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) - ath_printtxbuf(sc, bf, txq->axq_qnum, i, 0); + ath_printtxbuf(sc, bfi, txq->axq_qnum, i, 0); #endif/* ATH_DEBUG */ #ifdef ATH_DEBUG_ALQ if (if_ath_alq_checkdebug(&sc->sc_alq, ATH_ALQ_EDMA_TXDESC)) - ath_tx_alq_post(sc, bf); + ath_tx_alq_post(sc, bfi); #endif /* ATH_DEBUG_ALQ */ - txq->axq_fifo_depth++; i++; } - if (i > 0) - ath_hal_txstart(sc->sc_ah, txq->axq_qnum); + + /* + * We now need to push this set of frames onto the tail + * of the FIFO queue. We don't adjust the aggregate + * count, only the queue depth counter(s). + * We also need to blank the link pointer now. + */ + + TAILQ_CONCAT(&txq->fifo.axq_q, &sq, bf_list); + /* Bump total queue tracking in FIFO queue */ + txq->fifo.axq_depth += sqdepth; + + /* Bump FIFO queue */ + txq->axq_fifo_depth++; + DPRINTF(sc, ATH_DEBUG_XMIT, + "%s: queued %d packets; depth=%d, fifo depth=%d\n", + __func__, sqdepth, txq->fifo.axq_depth, txq->axq_fifo_depth); + + /* Push the first entry into the hardware */ + ath_hal_puttxbuf(sc->sc_ah, txq->axq_qnum, bf->bf_daddr); + + /* Push start on the DMA if it's not already started */ + ath_hal_txstart(sc->sc_ah, txq->axq_qnum); + +#ifdef ATH_DEBUG_ALQ + ath_tx_alq_edma_push(sc, txq->axq_qnum, sqdepth, + txq->axq_fifo_depth, + txq->fifo.axq_depth); +#endif /* ATH_DEBUG_ALQ */ +} + +/* + * Push some frames into the TX FIFO if we have space. + */ +static void +ath_edma_tx_fifo_fill(struct ath_softc *sc, struct ath_txq *txq) +{ + + ATH_TXQ_LOCK_ASSERT(txq); + + DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: Q%d: called\n", + __func__, + txq->axq_qnum); + + /* + * For now, push up to 4 frames per TX FIFO slot. + * If more are in the hardware queue then they'll + * get populated when we try to send another frame + * or complete a frame - so at most there'll be + * 32 non-AMPDU frames per TXQ. + * + * Note that the hardware staging queue will limit + * how many frames in total we will have pushed into + * here. + * + * Later on, we'll want to push less frames into + * the TX FIFO since we don't want to necessarily + * fill tens or hundreds of milliseconds of potential + * frames. + * + * However, we need more frames right now because of + * how the MAC implements the frame scheduling policy. + * It only ungates a single FIFO entry at a time, + * and will run that until CHNTIME expires or the + * end of that FIFO entry descriptor list is reached. + * So for TDMA we suffer a big performance penalty - + * single TX FIFO entries mean the MAC only sends out + * one frame per DBA event, which turned out on average + * 6ms per TX frame. + * + * So, for aggregates it's okay - it'll push two at a + * time and this will just do them more efficiently. + * For non-aggregates it'll do 4 at a time, up to the + * non-aggr limit (non_aggr, which is 32.) They should + * be time based rather than a hard count, but I also + * do need sleep. + */ + ath_tx_edma_push_staging_list(sc, txq, 4); } /* From owner-svn-src-head@freebsd.org Sun Jun 19 03:45:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84410A7A53C; Sun, 19 Jun 2016 03:45:43 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 66AC91391; Sun, 19 Jun 2016 03:45:42 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 33493DE21; Sun, 19 Jun 2016 03:45:36 +0000 (UTC) Subject: Re: svn commit: r288291 - head/etc To: Adrian Chadd , Cy Schubert References: <2171b966-35c7-2dad-2c0f-f23061cb677a@freebsd.org> <201606190006.u5J06Qk6009591@slippy.cwsent.com> Cc: Niclas Zeising , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: <9ca0ba1b-d9b3-6028-5645-d8d03e730f5e@freebsd.org> Date: Sat, 18 Jun 2016 23:45:35 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 03:45:43 -0000 On 2016-06-18 23:32, Adrian Chadd wrote: > i think that's fine for -11. I'd like to just move limits to /bin for > 12. (I mean, it's 2016, why are you splitting / and /usr again? But..) > bsdinstall for UFS just uses one big /, and ZFS does something similar for boot environments. Only people who have partitioned manually, or upgraded in place from 8.x or earlier, will still have separate / and /usr. We can't throw those people under the bus, but, it is reasonable to consider switching things around for 12. > I don't want to see differing system behaviour between limits but it's > likely unavoidable for 11 and could do with some errata notice so > people know what to expect. > > Thanks, > > > -adrian > -- Allan Jude From owner-svn-src-head@freebsd.org Sun Jun 19 04:58:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EEF4CA7801E for ; Sun, 19 Jun 2016 04:58:00 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f51.google.com (mail-lf0-f51.google.com [209.85.215.51]) (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 782A32C42 for ; Sun, 19 Jun 2016 04:58:00 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f51.google.com with SMTP id f6so19660801lfg.0 for ; Sat, 18 Jun 2016 21:58:00 -0700 (PDT) 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-transfer-encoding; bh=gUz0urVfuDPnzYt754mRo+HTlub/Of3e/6PtZ/GXshI=; b=CxnE2GMqYC/J0y+hVyw45P7ae8Pl0hLOlhe0VUXUzUFI7Ef9IpuFXYN3hGVS4LhPSB XIUbqhDwH8nvq1dmlw917CL4cDKCexCths9EMoM1+9rOF6/Vb4524hBOFk6gYEl1aVhN Gbwgx+RV4NvdGf2gLryni3iQm4r3BS85kE8yLxJwnzyDo+YVHDFUoHYbPGiivgJca0iE Pa0tdNgjWyIA8SB1LXtQXwm+uvsWbu8lE3qpaQ/+R3xVWsB07yE5UrYW4UveRKSRjnMu 3iDc1IVlZPXFiUBaqgu/m1FUx7NT1Q5Kthv/Z2tsdPOBpG+dErNgNB1XaR2hWWPvvmpr g7eA== X-Gm-Message-State: ALyK8tLqQKlxbccwYGz/1Q2LYcBn1oK/LR03xDru0PFh4JiGZ51m6/GvmATCwaPG/BGgzQ== X-Received: by 10.25.153.148 with SMTP id b142mr2696747lfe.61.1466312271479; Sat, 18 Jun 2016 21:57:51 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id m71sm2931372lfb.48.2016.06.18.21.57.50 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 18 Jun 2016 21:57:50 -0700 (PDT) Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools To: Hajimu UMEMOTO , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606190344.u5J3iWO6079652@repo.freebsd.org> From: Andrey Chernov Message-ID: <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> Date: Sun, 19 Jun 2016 07:57:49 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606190344.u5J3iWO6079652@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 04:58:01 -0000 On 19.06.2016 6:44, Hajimu UMEMOTO wrote: > Log: > - Prefer to use %d over %e where the day of the month should be zero > filled. > - Since %e means the day of the month as well, regard %e as same as %d > in md_order. Nonsense doubled formats in sr_*_RS locales and nonsense md_order there too. From owner-svn-src-head@freebsd.org Sun Jun 19 05:12:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78750A78603; Sun, 19 Jun 2016 05:12:45 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E7FC1689; Sun, 19 Jun 2016 05:12:44 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id EV2CbY2XWEWlrEV2Dbvmlr; Sat, 18 Jun 2016 23:12:38 -0600 X-Authority-Analysis: v=2.2 cv=P7p4vWIu c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=pD_ry4oyNxEA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=zi7m5VRXUajJoAgkUkEA:9 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 6493013753; Sat, 18 Jun 2016 22:12:36 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u5J5CYoL045032; Sat, 18 Jun 2016 22:12:34 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201606190512.u5J5CYoL045032@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Adrian Chadd cc: Cy Schubert , Niclas Zeising , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r288291 - head/etc In-Reply-To: Message from Adrian Chadd of "Sat, 18 Jun 2016 20:32:26 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 18 Jun 2016 22:12:34 -0700 X-CMAE-Envelope: MS4wfIh0upPgUsAsKi6HCn3NWleg9IS/MG2ZlAltD4zcGFHu5S9F3ENwmt+ReZqY9urSxqax4P9F/xX4HK8tjE0tnGpaua+lm14eQ3fmzNCypRtDsUyUDIl/ aFGRMReGFKZZLUoIO2RN2OUA4m7njyxQqPbhbKDPZYFAJ4OAs6mdvriwIYBT3KE3uZm9pRfyYWkEnMMUfqMMAQhC+sOW6y14XrFYkB+JgrUHIGrPuZe7bJIu s9Fttz73yQHGEnPSyM+JtHBBuONBWnSvEaRixIxAEceGj9ukdsE5I97n2k8lrTdywue/+YjVKSk/F/J0Ity0nQ== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 05:12:45 -0000 In message , Adrian Chadd writes: > i think that's fine for -11. I'd like to just move limits to /bin for > 12. (I mean, it's 2016, why are you splitting / and /usr again? But..) > > I don't want to see differing system behaviour between limits but it's > likely unavoidable for 11 and could do with some errata notice so > people know what to expect. There aren't any daemons started prior to critical local filesystems being mounted. I suppose one day there could be but none at this point in time. Setting limits before filesystems are mounted is practically a NOP anyway. (Except it could negatively affect fsck of huge UFS filesystems some day.) -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sun Jun 19 05:31:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A75EA788B6; Sun, 19 Jun 2016 05:31:19 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F11351CC0; Sun, 19 Jun 2016 05:31:18 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id EVK9bOiRXN9d0EVKAb4eTu; Sat, 18 Jun 2016 23:31:11 -0600 X-Authority-Analysis: v=2.2 cv=QZUkhYTv c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=pD_ry4oyNxEA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=L_FtLdo2QMd5WKjfqdYA:9 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 2E1AF13753; Sat, 18 Jun 2016 22:31:09 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u5J5V84J049670; Sat, 18 Jun 2016 22:31:08 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201606190531.u5J5V84J049670@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Allan Jude cc: Adrian Chadd , Cy Schubert , Niclas Zeising , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r288291 - head/etc In-Reply-To: Message from Allan Jude of "Sat, 18 Jun 2016 23:45:35 -0400." <9ca0ba1b-d9b3-6028-5645-d8d03e730f5e@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 18 Jun 2016 22:31:08 -0700 X-CMAE-Envelope: MS4wfJoYz4WasfekSuvV3THq/bVs8YiCUJVbLbf10grECaKsaHo661eKwuAKeif0/+y7BbU1gCWMGWrBBEKa+YRw9QCzeUWjDuKE+sOpgzeJ1U6cQJyMUd/S ztXQFlnMUD7DgOb4P1l8RACINVJrMIM/3Qpzlojpq0WcPLKA7ITD9rmSm1ZNSceedPCNkOQNgdsEDGHaS6t//yk3hthOT2IRRumAkYfJvW2tp9erMGoFE3iQ kRQ3PCnxWGbIoqut7RMZGBvM32wY6Tp4/qiUv8mk/ZU5ZjvETsBfY6VeIg6WYGhf42r3biCY0wFoCYQYrwIbNjujyM2Tiy8YC4rLWILHmIXh4qSGKRXA2QZ7 Tlj2DT0a X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 05:31:19 -0000 In message <9ca0ba1b-d9b3-6028-5645-d8d03e730f5e@freebsd.org>, Allan Jude write s: > On 2016-06-18 23:32, Adrian Chadd wrote: > > i think that's fine for -11. I'd like to just move limits to /bin for > > 12. (I mean, it's 2016, why are you splitting / and /usr again? But..) > > > > bsdinstall for UFS just uses one big /, and ZFS does something similar > for boot environments. Only people who have partitioned manually, or > upgraded in place from 8.x or earlier, will still have separate / and > /usr. We can't throw those people under the bus, but, it is reasonable > to consider switching things around for 12. This is only an issue legacy systems, systems that have had their disks be installed on faster systems and systems which have been cloned from older systems (dump | restore). There's something to be said about an O/S that doesn't need to be re-imaged every hardware/software upgrade or migration. It's also an issue for systems which have a small local root/ramdisk, and mount /usr via NFS. I managed a setup like this (not FreeBSD) once. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sun Jun 19 05:32:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D772A78A3C; Sun, 19 Jun 2016 05:32:37 +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 BEE9A1EF0; Sun, 19 Jun 2016 05:32:36 +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 u5J5WUQG085806 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Sun, 19 Jun 2016 14:32:31 +0900 (JST) (envelope-from ume@mahoroba.org) Date: Sun, 19 Jun 2016 14:31:53 +0900 Message-ID: From: Hajimu UMEMOTO To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools In-Reply-To: <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> User-Agent: xcite1.60> Wanderlust/2.15.9 (Almost Unreal) Emacs/24.5 Mule/6.0 (HANACHIRUSATO) X-Operating-System: FreeBSD 10.3-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.6 (mail.mahoroba.org [IPv6:2001:2f0:104:8010::1]); Sun, 19 Jun 2016 14:32:31 +0900 (JST) X-Virus-Scanned: clamav-milter 0.99.2 at asuka.mahoroba.org X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 05:32:37 -0000 Hi, >>>>> On Sun, 19 Jun 2016 07:57:49 +0300 >>>>> Andrey Chernov said: ache> Nonsense doubled formats in sr_*_RS locales and nonsense md_order there too. It seems there was the problem before my commit. Only saw a little, I'm not sure were it comes. Sincerely, -- Hajimu UMEMOTO ume@mahoroba.org ume@FreeBSD.org http://www.mahoroba.org/~ume/ From owner-svn-src-head@freebsd.org Sun Jun 19 07:31:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EABF4A7AEF8; Sun, 19 Jun 2016 07:31:03 +0000 (UTC) (envelope-from adrian@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 B908D28FE; Sun, 19 Jun 2016 07:31:03 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5J7V36W063668; Sun, 19 Jun 2016 07:31:03 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5J7V22Q063663; Sun, 19 Jun 2016 07:31:02 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606190731.u5J7V22Q063663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 19 Jun 2016 07:31:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302018 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 07:31:04 -0000 Author: adrian Date: Sun Jun 19 07:31:02 2016 New Revision: 302018 URL: https://svnweb.freebsd.org/changeset/base/302018 Log: [net80211] remove node scan lock / generation number + fix few LORs Drop scan generation number and node table scan lock - the only place where ni_scangen is checked is in ieee80211_timeout_stations() (and it is used to prevent duplicate checking of the same node); node scan lock protects only this variable + node table scan generation number. This will fix (at least) next LOR (hostap mode): lock order reversal: 1st 0xc175f84c urtwm0_scan_loc (urtwm0_scan_loc) @ /usr/src/sys/modules/wlan/../../net80211/ieee80211_node.c:2019 2nd 0xc175e018 urtwm0_com_lock (urtwm0_com_lock) @ /usr/src/sys/modules/wlan/../../net80211/ieee80211_node.c:2693 stack backtrace: #0 0xa070d1c5 at witness_debugger+0x75 #1 0xa070d0f6 at witness_checkorder+0xd46 #2 0xa0694cce at __mtx_lock_flags+0x9e #3 0xb03ad9ef at ieee80211_node_leave+0x12f #4 0xb03afd13 at ieee80211_timeout_stations+0x483 #5 0xb03aa1c2 at ieee80211_node_timeout+0x42 #6 0xa06c6fa1 at softclock_call_cc+0x1e1 #7 0xa06c7518 at softclock+0xc8 #8 0xa06789ae at intr_event_execute_handlers+0x8e #9 0xa0678fa0 at ithread_loop+0x90 #10 0xa0675fbe at fork_exit+0x7e #11 0xa08af910 at fork_trampoline+0x8 In addition to the above: * switch to ieee80211_iterate_nodes(); * do not assert that node table lock is held, while calling node_age(); that's not really needed (there are no resources, which can be protected by this lock) + this fixes LOR/deadlock between ieee80211_timeout_stations() and ieee80211_set_tim() (easy to reproduce in HOSTAP mode while sending something to an STA with enabled power management). Tested: * (avos) urtwn0, hostap mode * (adrian) AR9380, STA mode * (adrian) AR9380, AR9331, AR9580, hostap mode Notes: * This changes the net80211 internals, so you have to recompile all of it and the wifi drivers. Submitted by: avos Approved by: re (delphij) Differential Revision: https://reviews.freebsd.org/D6833 Modified: head/sys/net80211/ieee80211_ddb.c head/sys/net80211/ieee80211_freebsd.h head/sys/net80211/ieee80211_node.c head/sys/net80211/ieee80211_node.h head/sys/net80211/ieee80211_superg.c Modified: head/sys/net80211/ieee80211_ddb.c ============================================================================== --- head/sys/net80211/ieee80211_ddb.c Sun Jun 19 03:45:32 2016 (r302017) +++ head/sys/net80211/ieee80211_ddb.c Sun Jun 19 07:31:02 2016 (r302018) @@ -233,9 +233,8 @@ _db_show_sta(const struct ieee80211_node db_printf("\tvap %p wdsvap %p ic %p table %p\n", ni->ni_vap, ni->ni_wdsvap, ni->ni_ic, ni->ni_table); db_printf("\tflags=%b\n", ni->ni_flags, IEEE80211_NODE_BITS); - db_printf("\tscangen %u authmode %u ath_flags 0x%x ath_defkeyix %u\n", - ni->ni_scangen, ni->ni_authmode, - ni->ni_ath_flags, ni->ni_ath_defkeyix); + db_printf("\tauthmode %u ath_flags 0x%x ath_defkeyix %u\n", + ni->ni_authmode, ni->ni_ath_flags, ni->ni_ath_defkeyix); db_printf("\tassocid 0x%x txpower %u vlan %u\n", ni->ni_associd, ni->ni_txpower, ni->ni_vlan); db_printf("\tjointime %d (%lu secs) challenge %p\n", @@ -688,8 +687,6 @@ _db_show_node_table(const char *tag, con db_printf("%s%s@%p:\n", tag, nt->nt_name, nt); db_printf("%s nodelock %p", tag, &nt->nt_nodelock); db_printf(" inact_init %d", nt->nt_inact_init); - db_printf(" scanlock %p", &nt->nt_scanlock); - db_printf(" scangen %u\n", nt->nt_scangen); db_printf("%s keyixmax %d keyixmap %p\n", tag, nt->nt_keyixmax, nt->nt_keyixmap); for (i = 0; i < nt->nt_keyixmax; i++) { Modified: head/sys/net80211/ieee80211_freebsd.h ============================================================================== --- head/sys/net80211/ieee80211_freebsd.h Sun Jun 19 03:45:32 2016 (r302017) +++ head/sys/net80211/ieee80211_freebsd.h Sun Jun 19 07:31:02 2016 (r302018) @@ -107,28 +107,6 @@ typedef struct { mtx_assert(IEEE80211_NODE_LOCK_OBJ(_nt), MA_OWNED) /* - * Node table iteration locking definitions; this protects the - * scan generation # used to iterate over the station table - * while grabbing+releasing the node lock. - */ -typedef struct { - char name[16]; /* e.g. "ath0_scan_lock" */ - struct mtx mtx; -} ieee80211_scan_lock_t; -#define IEEE80211_NODE_ITERATE_LOCK_INIT(_nt, _name) do { \ - ieee80211_scan_lock_t *sl = &(_nt)->nt_scanlock; \ - snprintf(sl->name, sizeof(sl->name), "%s_scan_lock", _name); \ - mtx_init(&sl->mtx, sl->name, NULL, MTX_DEF); \ -} while (0) -#define IEEE80211_NODE_ITERATE_LOCK_OBJ(_nt) (&(_nt)->nt_scanlock.mtx) -#define IEEE80211_NODE_ITERATE_LOCK_DESTROY(_nt) \ - mtx_destroy(IEEE80211_NODE_ITERATE_LOCK_OBJ(_nt)) -#define IEEE80211_NODE_ITERATE_LOCK(_nt) \ - mtx_lock(IEEE80211_NODE_ITERATE_LOCK_OBJ(_nt)) -#define IEEE80211_NODE_ITERATE_UNLOCK(_nt) \ - mtx_unlock(IEEE80211_NODE_ITERATE_LOCK_OBJ(_nt)) - -/* * Power-save queue definitions. */ typedef struct mtx ieee80211_psq_lock_t; Modified: head/sys/net80211/ieee80211_node.c ============================================================================== --- head/sys/net80211/ieee80211_node.c Sun Jun 19 03:45:32 2016 (r302017) +++ head/sys/net80211/ieee80211_node.c Sun Jun 19 07:31:02 2016 (r302018) @@ -1099,8 +1099,6 @@ node_age(struct ieee80211_node *ni) { struct ieee80211vap *vap = ni->ni_vap; - IEEE80211_NODE_LOCK_ASSERT(&vap->iv_ic->ic_sta); - /* * Age frames on the power save queue. */ @@ -1922,10 +1920,8 @@ ieee80211_node_table_init(struct ieee802 nt->nt_ic = ic; IEEE80211_NODE_LOCK_INIT(nt, ic->ic_name); - IEEE80211_NODE_ITERATE_LOCK_INIT(nt, ic->ic_name); TAILQ_INIT(&nt->nt_node); nt->nt_name = name; - nt->nt_scangen = 1; nt->nt_inact_init = inact; nt->nt_keyixmax = keyixmax; if (nt->nt_keyixmax > 0) { @@ -1994,159 +1990,137 @@ ieee80211_node_table_cleanup(struct ieee IEEE80211_FREE(nt->nt_keyixmap, M_80211_NODE); nt->nt_keyixmap = NULL; } - IEEE80211_NODE_ITERATE_LOCK_DESTROY(nt); IEEE80211_NODE_LOCK_DESTROY(nt); } -/* - * Timeout inactive stations and do related housekeeping. - * Note that we cannot hold the node lock while sending a - * frame as this would lead to a LOR. Instead we use a - * generation number to mark nodes that we've scanned and - * drop the lock and restart a scan if we have to time out - * a node. Since we are single-threaded by virtue of - * controlling the inactivity timer we can be sure this will - * process each node only once. - */ static void -ieee80211_timeout_stations(struct ieee80211com *ic) +timeout_stations(void *arg __unused, struct ieee80211_node *ni) { - struct ieee80211_node_table *nt = &ic->ic_sta; - struct ieee80211vap *vap; - struct ieee80211_node *ni; - int gen = 0; + struct ieee80211com *ic = ni->ni_ic; + struct ieee80211vap *vap = ni->ni_vap; - IEEE80211_NODE_ITERATE_LOCK(nt); - gen = ++nt->nt_scangen; -restart: - IEEE80211_NODE_LOCK(nt); - TAILQ_FOREACH(ni, &nt->nt_node, ni_list) { - if (ni->ni_scangen == gen) /* previously handled */ - continue; - ni->ni_scangen = gen; - /* - * Ignore entries for which have yet to receive an - * authentication frame. These are transient and - * will be reclaimed when the last reference to them - * goes away (when frame xmits complete). - */ - vap = ni->ni_vap; - /* - * Only process stations when in RUN state. This - * insures, for example, that we don't timeout an - * inactive station during CAC. Note that CSA state - * is actually handled in ieee80211_node_timeout as - * it applies to more than timeout processing. - */ - if (vap->iv_state != IEEE80211_S_RUN) - continue; - /* XXX can vap be NULL? */ - if ((vap->iv_opmode == IEEE80211_M_HOSTAP || - vap->iv_opmode == IEEE80211_M_STA) && - (ni->ni_flags & IEEE80211_NODE_AREF) == 0) - continue; + /* + * Only process stations when in RUN state. This + * insures, for example, that we don't timeout an + * inactive station during CAC. Note that CSA state + * is actually handled in ieee80211_node_timeout as + * it applies to more than timeout processing. + */ + if (vap->iv_state != IEEE80211_S_RUN) + return; + /* + * Ignore entries for which have yet to receive an + * authentication frame. These are transient and + * will be reclaimed when the last reference to them + * goes away (when frame xmits complete). + */ + if ((vap->iv_opmode == IEEE80211_M_HOSTAP || + vap->iv_opmode == IEEE80211_M_STA) && + (ni->ni_flags & IEEE80211_NODE_AREF) == 0) + return; + /* + * Free fragment if not needed anymore + * (last fragment older than 1s). + * XXX doesn't belong here, move to node_age + */ + if (ni->ni_rxfrag[0] != NULL && + ticks > ni->ni_rxfragstamp + hz) { + m_freem(ni->ni_rxfrag[0]); + ni->ni_rxfrag[0] = NULL; + } + if (ni->ni_inact > 0) { + ni->ni_inact--; + IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, + "%s: inact %u inact_reload %u nrates %u", + __func__, ni->ni_inact, ni->ni_inact_reload, + ni->ni_rates.rs_nrates); + } + /* + * Special case ourself; we may be idle for extended periods + * of time and regardless reclaiming our state is wrong. + * XXX run ic_node_age + */ + /* XXX before inact decrement? */ + if (ni == vap->iv_bss) + return; + if (ni->ni_associd != 0 || + (vap->iv_opmode == IEEE80211_M_IBSS || + vap->iv_opmode == IEEE80211_M_AHDEMO)) { /* - * Free fragment if not needed anymore - * (last fragment older than 1s). - * XXX doesn't belong here, move to node_age + * Age/drain resources held by the station. */ - if (ni->ni_rxfrag[0] != NULL && - ticks > ni->ni_rxfragstamp + hz) { - m_freem(ni->ni_rxfrag[0]); - ni->ni_rxfrag[0] = NULL; - } - if (ni->ni_inact > 0) { - ni->ni_inact--; - IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, - "%s: inact %u inact_reload %u nrates %u", - __func__, ni->ni_inact, ni->ni_inact_reload, - ni->ni_rates.rs_nrates); - } + ic->ic_node_age(ni); /* - * Special case ourself; we may be idle for extended periods - * of time and regardless reclaiming our state is wrong. - * XXX run ic_node_age + * Probe the station before time it out. We + * send a null data frame which may not be + * universally supported by drivers (need it + * for ps-poll support so it should be...). + * + * XXX don't probe the station unless we've + * received a frame from them (and have + * some idea of the rates they are capable + * of); this will get fixed more properly + * soon with better handling of the rate set. */ - if (ni == vap->iv_bss) - continue; - if (ni->ni_associd != 0 || - (vap->iv_opmode == IEEE80211_M_IBSS || - vap->iv_opmode == IEEE80211_M_AHDEMO)) { - /* - * Age/drain resources held by the station. - */ - ic->ic_node_age(ni); - /* - * Probe the station before time it out. We - * send a null data frame which may not be - * universally supported by drivers (need it - * for ps-poll support so it should be...). - * - * XXX don't probe the station unless we've - * received a frame from them (and have - * some idea of the rates they are capable - * of); this will get fixed more properly - * soon with better handling of the rate set. - */ - if ((vap->iv_flags_ext & IEEE80211_FEXT_INACT) && - (0 < ni->ni_inact && - ni->ni_inact <= vap->iv_inact_probe) && - ni->ni_rates.rs_nrates != 0) { - IEEE80211_NOTE(vap, - IEEE80211_MSG_INACT | IEEE80211_MSG_NODE, - ni, "%s", - "probe station due to inactivity"); - /* - * Grab a reference before unlocking the table - * so the node cannot be reclaimed before we - * send the frame. ieee80211_send_nulldata - * understands we've done this and reclaims the - * ref for us as needed. - */ - ieee80211_ref_node(ni); - IEEE80211_NODE_UNLOCK(nt); - ieee80211_send_nulldata(ni); - /* XXX stat? */ - goto restart; - } - } if ((vap->iv_flags_ext & IEEE80211_FEXT_INACT) && - ni->ni_inact <= 0) { + (0 < ni->ni_inact && + ni->ni_inact <= vap->iv_inact_probe) && + ni->ni_rates.rs_nrates != 0) { IEEE80211_NOTE(vap, - IEEE80211_MSG_INACT | IEEE80211_MSG_NODE, ni, - "station timed out due to inactivity " - "(refcnt %u)", ieee80211_node_refcnt(ni)); + IEEE80211_MSG_INACT | IEEE80211_MSG_NODE, + ni, "%s", + "probe station due to inactivity"); /* - * Send a deauthenticate frame and drop the station. - * This is somewhat complicated due to reference counts - * and locking. At this point a station will typically - * have a reference count of 1. ieee80211_node_leave - * will do a "free" of the node which will drop the - * reference count. But in the meantime a reference - * wil be held by the deauth frame. The actual reclaim - * of the node will happen either after the tx is - * completed or by ieee80211_node_leave. - * - * Separately we must drop the node lock before sending - * in case the driver takes a lock, as this can result - * in a LOR between the node lock and the driver lock. + * Grab a reference so the node cannot + * be reclaimed before we send the frame. + * ieee80211_send_nulldata understands + * we've done this and reclaims the + * ref for us as needed. */ + /* XXX fix this (not required anymore). */ ieee80211_ref_node(ni); - IEEE80211_NODE_UNLOCK(nt); - if (ni->ni_associd != 0) { - IEEE80211_SEND_MGMT(ni, - IEEE80211_FC0_SUBTYPE_DEAUTH, - IEEE80211_REASON_AUTH_EXPIRE); - } - ieee80211_node_leave(ni); - ieee80211_free_node(ni); - vap->iv_stats.is_node_timeout++; - goto restart; + /* XXX useless */ + ieee80211_send_nulldata(ni); + /* XXX stat? */ + return; } } - IEEE80211_NODE_UNLOCK(nt); + if ((vap->iv_flags_ext & IEEE80211_FEXT_INACT) && + ni->ni_inact <= 0) { + IEEE80211_NOTE(vap, + IEEE80211_MSG_INACT | IEEE80211_MSG_NODE, ni, + "station timed out due to inactivity " + "(refcnt %u)", ieee80211_node_refcnt(ni)); + /* + * Send a deauthenticate frame and drop the station. + * This is somewhat complicated due to reference counts + * and locking. At this point a station will typically + * have a reference count of 2. ieee80211_node_leave + * will do a "free" of the node which will drop the + * reference count. But in the meantime a reference + * wil be held by the deauth frame. The actual reclaim + * of the node will happen either after the tx is + * completed or by ieee80211_node_leave. + */ + if (ni->ni_associd != 0) { + IEEE80211_SEND_MGMT(ni, + IEEE80211_FC0_SUBTYPE_DEAUTH, + IEEE80211_REASON_AUTH_EXPIRE); + } + ieee80211_node_leave(ni); + vap->iv_stats.is_node_timeout++; + } +} - IEEE80211_NODE_ITERATE_UNLOCK(nt); +/* + * Timeout inactive stations and do related housekeeping. + */ +static void +ieee80211_timeout_stations(struct ieee80211com *ic) +{ + struct ieee80211_node_table *nt = &ic->ic_sta; + + ieee80211_iterate_nodes(nt, timeout_stations, NULL); } /* @@ -2247,23 +2221,12 @@ int ieee80211_iterate_nt(struct ieee80211_node_table *nt, struct ieee80211_node **ni_arr, uint16_t max_aid) { - u_int gen; int i, j, ret; struct ieee80211_node *ni; - IEEE80211_NODE_ITERATE_LOCK(nt); IEEE80211_NODE_LOCK(nt); - gen = ++nt->nt_scangen; i = ret = 0; - - /* - * We simply assume here that since the node - * scan generation doesn't change (as - * we are holding both the node table and - * node table iteration locks), we can simply - * assign it to the node here. - */ TAILQ_FOREACH(ni, &nt->nt_node, ni_list) { if (i >= max_aid) { ret = E2BIG; @@ -2272,7 +2235,6 @@ ieee80211_iterate_nt(struct ieee80211_no break; } ni_arr[i] = ieee80211_ref_node(ni); - ni_arr[i]->ni_scangen = gen; i++; } @@ -2287,7 +2249,6 @@ ieee80211_iterate_nt(struct ieee80211_no * ieee80211_free_node(). */ IEEE80211_NODE_UNLOCK(nt); - IEEE80211_NODE_ITERATE_UNLOCK(nt); /* * If ret is non-zero, we hit some kind of error. @@ -2362,8 +2323,8 @@ ieee80211_dump_node(struct ieee80211_nod { printf("0x%p: mac %s refcnt %d\n", ni, ether_sprintf(ni->ni_macaddr), ieee80211_node_refcnt(ni)); - printf("\tscangen %u authmode %u flags 0x%x\n", - ni->ni_scangen, ni->ni_authmode, ni->ni_flags); + printf("\tauthmode %u flags 0x%x\n", + ni->ni_authmode, ni->ni_flags); printf("\tassocid 0x%x txpower %u vlan %u\n", ni->ni_associd, ni->ni_txpower, ni->ni_vlan); printf("\ttxseq %u rxseq %u fragno %u rxfragstamp %u\n", Modified: head/sys/net80211/ieee80211_node.h ============================================================================== --- head/sys/net80211/ieee80211_node.h Sun Jun 19 03:45:32 2016 (r302017) +++ head/sys/net80211/ieee80211_node.h Sun Jun 19 07:31:02 2016 (r302018) @@ -115,7 +115,6 @@ struct ieee80211_node { TAILQ_ENTRY(ieee80211_node) ni_list; /* list of all nodes */ LIST_ENTRY(ieee80211_node) ni_hash; /* hash collision list */ u_int ni_refcnt; /* count of held references */ - u_int ni_scangen; /* gen# for timeout scan */ u_int ni_flags; #define IEEE80211_NODE_AUTH 0x000001 /* authorized for data */ #define IEEE80211_NODE_QOS 0x000002 /* QoS enabled */ @@ -360,8 +359,6 @@ struct ieee80211_node_table { struct ieee80211_node **nt_keyixmap; /* key ix -> node map */ int nt_keyixmax; /* keyixmap size */ const char *nt_name; /* table name for debug msgs */ - ieee80211_scan_lock_t nt_scanlock; /* on nt_scangen */ - u_int nt_scangen; /* gen# for iterators */ int nt_inact_init; /* initial node inact setting */ }; Modified: head/sys/net80211/ieee80211_superg.c ============================================================================== --- head/sys/net80211/ieee80211_superg.c Sun Jun 19 03:45:32 2016 (r302017) +++ head/sys/net80211/ieee80211_superg.c Sun Jun 19 07:31:02 2016 (r302018) @@ -912,6 +912,12 @@ ieee80211_ff_node_init(struct ieee80211_ ieee80211_ff_node_cleanup(ni); } +/* + * Note: this comlock acquisition LORs with the node lock: + * + * 1: sta_join1 -> NODE_LOCK -> node_free -> node_cleanup -> ff_node_cleanup -> COM_LOCK + * 2: TBD + */ void ieee80211_ff_node_cleanup(struct ieee80211_node *ni) { From owner-svn-src-head@freebsd.org Sun Jun 19 07:37:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85E15A7A119 for ; Sun, 19 Jun 2016 07:37:51 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) (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 1413E2CF4 for ; Sun, 19 Jun 2016 07:37:50 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f52.google.com with SMTP id q132so20532976lfe.3 for ; Sun, 19 Jun 2016 00:37:50 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=0yZ7SQdGgFDYv/BaM95cN1x2JaYHZpLAaWLNfO4NRUQ=; b=dFAAE1MG1k3Be5o0t+SAIU9D2XEmN3rArnb42rBRCsojd+8pvtaZ9rH290S5CaaAsb Q/cWx5u3Q02GSKEkC2pbF5T7y/raJe7hPDguNWoVAw7+VgeEXgTQipqrs4wtKvDsUgIU syCtzuGvjjTP11iZ70UrRjIhofiL+1BfpKWYQTFPLA/wbbJKNtH3QZWZ+alaPHntN3Dz cI1vPaLgXX7g+fEoBwnEwE05hXRmWzXHEjrUrynOYpB+cEDGaPg2AhpWeJjHoACjRW2c 83oBs6se8u6eyKgwJVcrcihq2JU4y1Aj7lHc7XdjBXjwuUfsKgHRQCWq0tKI3MvxK0c0 cx4Q== X-Gm-Message-State: ALyK8tK5e/HSFIvY9unVLDXdloyRh0K+zvcVM2uG5y/b42KfOgJABOeNR5wxxTZYBErfAg== X-Received: by 10.25.88.146 with SMTP id m140mr90377lfb.217.1466321863185; Sun, 19 Jun 2016 00:37:43 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id l79sm3445870lfi.40.2016.06.19.00.37.42 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2016 00:37:42 -0700 (PDT) Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools To: Hajimu UMEMOTO References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: Date: Sun, 19 Jun 2016 10:37:41 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 07:37:51 -0000 On 19.06.2016 8:31, Hajimu UMEMOTO wrote: > Hi, > >>>>>> On Sun, 19 Jun 2016 07:57:49 +0300 >>>>>> Andrey Chernov said: > > ache> Nonsense doubled formats in sr_*_RS locales and nonsense md_order there too. > > It seems there was the problem before my commit. Only saw a little, > I'm not sure were it comes. I understand, just notice that. From owner-svn-src-head@freebsd.org Sun Jun 19 08:08:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6F0BA7ACEF; Sun, 19 Jun 2016 08:08:10 +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 78913205F; Sun, 19 Jun 2016 08:08:10 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x232.google.com with SMTP id 187so1314544wmz.1; Sun, 19 Jun 2016 01:08:10 -0700 (PDT) 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-disposition:in-reply-to:user-agent; bh=eV8cLX63cu50liV5LaGw+PfR1n8tUcPnjb5lEZkY4L8=; b=a8nqQUG8iMEhY7dFF7QURmqEQAMi4gKXaUCSiz6l2IBcWvXlr48QieSeuusStwHlAx tqNI7uJ1y6fXjawSVHRMBY86lB6xjF4UoXhRrqAAQSbSFFF12UxIDkaXOMwttYwi+8yB EVQwnhgOSzbnwzhh/pGPH+bGIQ9RCyA7Te0P2dBtLukcLOXv8BFrDb2sf2JuNUKgTdn6 qjv++2fLZQxLmggnkqqbaFdwyjxzyYYzBzAkhR8/fG+V3RZyor6EU8djY4EvrptCLOLo oLC6Z3IDAh52hhKqPOv3hppZFh39CLAtfEuw0/5MBWmShZ7NOCSdBwTsYjmPLPOuYCvN rCWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=eV8cLX63cu50liV5LaGw+PfR1n8tUcPnjb5lEZkY4L8=; b=CWMhMeR38zl6IMfPUKq31SAceq61lS8gWmmnd5CTH47eocMiph0MDkoDdXFG1+2r+J wQ1dZ8WSb5etEcBxal1HYsjebYrBK1qrSW7u38zzVANssaww1mZPm6qbaa8BUu8+dIOr vjdCxZG4XsWAD5KkqVmR54DNHIQxXdM2EzqPXMIdoTKvoSvJaIIg/X3tN/BRZKOwp2ij KeMOdapVnlr99EnIUSoOkhV9UIJamalM4tRHeWl6T0/Gj5pqUjgBibcWxgaH22JFVEg9 LplSWXKYENfBjEF6s79VYSddCTnN7q+/WIBnHHW1xtJIYTcKH9H9sDjw8RFf8w4AmjRM Jxkg== X-Gm-Message-State: ALyK8tLc+z3Pttes87+ngFsS+7J9ALZQaAYellSdlFlSerDDGxxW4CRroGhLD6sTVBLT8A== X-Received: by 10.194.81.72 with SMTP id y8mr9997771wjx.83.1466323688074; Sun, 19 Jun 2016 01:08:08 -0700 (PDT) Received: from brick (abpy178.neoplus.adsl.tpnet.pl. [83.8.66.178]) by smtp.gmail.com with ESMTPSA id e5sm57365008wjj.10.2016.06.19.01.08.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Jun 2016 01:08:07 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Sun, 19 Jun 2016 10:08:03 +0200 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Jan Beich Cc: Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299448 - in head/sys/cddl/contrib/opensolaris: common/acl uts/common/fs/zfs uts/common/sys Message-ID: <20160619080803.GA1638@brick> Mail-Followup-To: Jan Beich , Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201605111343.u4BDhKhp076695@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 08:08:11 -0000 On 0614T0232, Jan Beich wrote: > Alexander Motin writes: > > > Author: mav > > Date: Wed May 11 13:43:20 2016 > > New Revision: 299448 > > URL: https://svnweb.freebsd.org/changeset/base/299448 > > > > Log: > > MFV r299442: 6762 POSIX write should imply DELETE_CHILD on directories - and > > some additional considerations > > > > Reviewed by: Gordon Ross > > Reviewed by: Yuri Pankov > > Author: Kevin Crowe > > > > openzfs/openzfs@d316fffc9c361532a482208561bbb614dac7f916 > > This commit confuses acl_is_trivial_np(3). Notice '+' in ls(1) and 'D' > in getfacl(1) outputs. It's not just that. Those changes: 1. Confuse acl_is_trivial_np(3), as you say. It's hard to fix in libc, because they make trivial ACLs different for files and directories, and acl_is_trivial_np(3) has no way of telling which is which. 2. They make delete deny permission take precedence over the containing directory write allow permission, which is rather different from what people expect in unix systems, and is against the NFSv4 specification, even though it might be a better fit for Windows. 3. They make umask apply to inherit_only permissions, and 4. I don't fully understand this one yet, but from the ACL regression test suite (which lives in tests/sys/acl/, and I'd appreciate people actually ran this before committing ACL-related changes) it looks like it makes umask not apply to the stuff it should. The #1 could be fixed by making ZFS not setting delete_child on write, basically reverting to the previous behaviour in that aspect. As for the others... I'm not saying each one of those is wrong, but they certainly warrant further discussion, especially #2 and #4. Basically, what I'm trying to say is that we should consider backing this out for 11.0-RELEASE, reverting to the previous semantics, verified by passing the regression tests. From owner-svn-src-head@freebsd.org Sun Jun 19 08:15:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4AE3A7AE85; Sun, 19 Jun 2016 08:15:39 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (cloud.daemonic.se [185.34.0.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8D0D5253F; Sun, 19 Jun 2016 08:15:38 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cloud.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 3rXRd370rhz27L1; Sun, 19 Jun 2016 08:15:35 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([IPv6:::1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cloud.daemonic.se (mailscanner.daemonic.se [IPv6:::1]) (amavisd-new, port 10587) with ESMTPS id tR8ic_DR6-FE; Sun, 19 Jun 2016 08:15:35 +0000 (UTC) Received: from [IPv6:2001:470:dca9:2::3] (celes.daemonic.se [IPv6:2001:470:dca9:2::3]) by mail.daemonic.se (Postfix) with ESMTPSA id 3rXRd24lX5z27C0; Sun, 19 Jun 2016 08:15:34 +0000 (UTC) Subject: Re: svn commit: r288291 - head/etc To: Allan Jude , Adrian Chadd , Cy Schubert References: <2171b966-35c7-2dad-2c0f-f23061cb677a@freebsd.org> <201606190006.u5J06Qk6009591@slippy.cwsent.com> <9ca0ba1b-d9b3-6028-5645-d8d03e730f5e@freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Niclas Zeising Message-ID: <19333e20-7242-220f-8553-07b828d462e0@freebsd.org> Date: Sun, 19 Jun 2016 10:15:25 +0200 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <9ca0ba1b-d9b3-6028-5645-d8d03e730f5e@freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 08:15:39 -0000 On 2016-06-19 05:45, Allan Jude wrote: > On 2016-06-18 23:32, Adrian Chadd wrote: >> i think that's fine for -11. I'd like to just move limits to /bin for >> 12. (I mean, it's 2016, why are you splitting / and /usr again? But..) >> > > bsdinstall for UFS just uses one big /, and ZFS does something similar > for boot environments. Only people who have partitioned manually, or > upgraded in place from 8.x or earlier, will still have separate / and > /usr. We can't throw those people under the bus, but, it is reasonable > to consider switching things around for 12. > I have several systems with separate /usr, done either manually or upgraded in place since forever, so this is an issue, and I expect there are several others out there in the same situation. Regards! -- Niclas From owner-svn-src-head@freebsd.org Sun Jun 19 08:18:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 90D1CA7AF90; Sun, 19 Jun 2016 08:18:17 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (mail.daemonic.se [IPv6:2a00:d1e0:1000:c00::25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5A75E2842; Sun, 19 Jun 2016 08:18:17 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cloud.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 3rXRh66Dqhz27L1; Sun, 19 Jun 2016 08:18:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cloud.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id eBNDttigPqsU; Sun, 19 Jun 2016 08:18:14 +0000 (UTC) Received: from [IPv6:2001:470:dca9:2::3] (celes.daemonic.se [IPv6:2001:470:dca9:2::3]) by mail.daemonic.se (Postfix) with ESMTPSA id 3rXRh62V03z27C0; Sun, 19 Jun 2016 08:18:14 +0000 (UTC) Subject: Re: svn commit: r288291 - head/etc To: Cy Schubert , Adrian Chadd References: <201606190512.u5J5CYoL045032@slippy.cwsent.com> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Niclas Zeising Message-ID: <4e985ab9-0d98-a160-bdad-fa4924ddc5b3@freebsd.org> Date: Sun, 19 Jun 2016 10:18:12 +0200 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <201606190512.u5J5CYoL045032@slippy.cwsent.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 08:18:17 -0000 On 2016-06-19 07:12, Cy Schubert wrote: > In message om> > , Adrian Chadd writes: >> i think that's fine for -11. I'd like to just move limits to /bin for >> 12. (I mean, it's 2016, why are you splitting / and /usr again? But..) >> >> I don't want to see differing system behaviour between limits but it's >> likely unavoidable for 11 and could do with some errata notice so >> people know what to expect. > > There aren't any daemons started prior to critical local filesystems being > mounted. I suppose one day there could be but none at this point in time. > Setting limits before filesystems are mounted is practically a NOP anyway. > (Except it could negatively affect fsck of huge UFS filesystems some day.) > > This is wrong, and how I discovered it. ddb (/etc/rc.d/ddb) starts before disks, and currently refuses to start on my systems with this issue. This means no crash dumps, unless I remember to manually start it later in the boot process, so this is an issue. Regards! Niclas From owner-svn-src-head@freebsd.org Sun Jun 19 14:08:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3A17A7A284; Sun, 19 Jun 2016 14:08:43 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DF48177B; Sun, 19 Jun 2016 14:08:42 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id EdOrb3cQeBLFmEdOsbCrgq; Sun, 19 Jun 2016 08:08:36 -0600 X-Authority-Analysis: v=2.2 cv=W5d6blek c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=pD_ry4oyNxEA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=T2o6xq4IccvRw0ohEP4A:9 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 581C413753; Sun, 19 Jun 2016 07:08:33 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u5JE8W5w053656; Sun, 19 Jun 2016 07:08:32 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201606191408.u5JE8W5w053656@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Niclas Zeising cc: Cy Schubert , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r288291 - head/etc In-Reply-To: Message from Niclas Zeising of "Sun, 19 Jun 2016 10:18:12 +0200." <4e985ab9-0d98-a160-bdad-fa4924ddc5b3@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 19 Jun 2016 07:08:32 -0700 X-CMAE-Envelope: MS4wfE8vIl5LajPyEMkBxO/D4UDqn/AFHLKvfemYSVSJnMCSt4Vif5W05056u7CHYmI+rXGD94dnv6EUfeUO/cDIXpphISdg1SZ+D7pdNPLGaTU35e1/1JWz KUfL2r7v1DZsiazoPWQVdomUO9OIaUfpoVp8YQfi07aYB8PumpIeImPLZwr0C20lHfL0hMjubbvXYSKxanZr1SfwCiyBPgQlzJViF89gvBP3wlGIZdQVVyZR z9FswSR/FoVSqZppfvFx/eEQjquiBITzA7JSkSzcE9NxWQd/1DzNx6dTDLZfQuyDRq/khPdqveZjo+u1LJ6Paw== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 14:08:43 -0000 In message <4e985ab9-0d98-a160-bdad-fa4924ddc5b3@freebsd.org>, Niclas Zeising w rites: > On 2016-06-19 07:12, Cy Schubert wrote: > > In message c > > om> > > , Adrian Chadd writes: > >> i think that's fine for -11. I'd like to just move limits to /bin for > >> 12. (I mean, it's 2016, why are you splitting / and /usr again? But..) > >> > >> I don't want to see differing system behaviour between limits but it's > >> likely unavoidable for 11 and could do with some errata notice so > >> people know what to expect. > > > > There aren't any daemons started prior to critical local filesystems being > > mounted. I suppose one day there could be but none at this point in time. > > Setting limits before filesystems are mounted is practically a NOP anyway. > > (Except it could negatively affect fsck of huge UFS filesystems some day.) > > > > > > This is wrong, and how I discovered it. ddb (/etc/rc.d/ddb) starts > before disks, and currently refuses to start on my systems with this > issue. This means no crash dumps, unless I remember to manually start > it later in the boot process, so this is an issue. ddb isn't a daemon. It's an interface into the kernel that configures DDB properties. It runs and completes. And, yes, it is affected by limits not being found in the path. My point is, since there are no daemons, as per the definition of a daemon (processes that become daemons and run in the background) prior to the filesystems being run, to say that there would be differing systems behavior before and after filesystems are started is presently false (though technically true because one day we might have daemons started before critical filesystems are mounted). I can see Adrian's point but not in the present day. In the future, possibly. Another option might be to move ddb after filesytems are mounted or this should circumvent the problem too: Index: ddb =================================================================== --- ddb (revision 302001) +++ ddb (working copy) @@ -15,6 +15,7 @@ rcvar="ddb_enable" command="/sbin/${name}" start_precmd="ddb_prestart" +start_cmd="ddb_start" stop_cmd=":" ddb_prestart() @@ -25,6 +26,11 @@ fi } +ddb_start() +{ + ${command} ${command_args} +} + load_rc_config $name required_files="${ddb_config}" -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sun Jun 19 14:28:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37CF4A7A648; Sun, 19 Jun 2016 14:28:48 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F09F1F43; Sun, 19 Jun 2016 14:28:47 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id EdiIbXkmTwsAcEdiJbCKkZ; Sun, 19 Jun 2016 08:28:40 -0600 X-Authority-Analysis: v=2.2 cv=U7HQNqju c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=pD_ry4oyNxEA:10 a=6I5d2MoRAAAA:8 a=U4EAvKDJAAAA:8 a=YxBL1-UpAAAA:8 a=FxgTLzK3pLkextSvKCcA:9 a=IjZwj45LgO3ly-622nXo:22 a=LH9_I48XOzAQGoZ0y7Dq:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id C3E9413753; Sun, 19 Jun 2016 07:28:37 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u5JESbbs053857; Sun, 19 Jun 2016 07:28:37 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201606191428.u5JESbbs053857@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Jan Beich , Alexander Motin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299448 - in head/sys/cddl/contrib/opensolaris: common/acl uts/common/fs/zfs uts/common/sys In-Reply-To: Message from Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= of "Sun, 19 Jun 2016 10:08:03 +0200." <20160619080803.GA1638@brick> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 19 Jun 2016 07:28:37 -0700 X-CMAE-Envelope: MS4wfHVzaaSYuuHJQfKv8fjCDd2YDUlKQedRFglDS71I8eGOdDx2kADClzqZpOsPpoNdX5PGpj7khpRsxBGOkf3WSSHC0hcrhBc56mk1KMGgVZDAYmflLa8Y VnHSPg52EVfp5hRGpEVxBzMzIDr6PS2qT1mvKFIGGvlluod1sMaZFznNY1rhPM/75tJjqPvvGHNacaYvyW448aivE0XqnY9RqeKP1SHT/FBxlZHlntNixHts +SDLD2XmAisXZM4FQjkTN7Tu0m0njh5QLUCmDVCkI8FxUjA0+eeu6vMzHSRDZ7JxaAsgE3eq81gsNz4R+JwllA== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 14:28:48 -0000 In message <20160619080803.GA1638@brick>, Edward Tomasz =?utf-8?Q?Napiera=C5=82 a?= writes: > On 0614T0232, Jan Beich wrote: > > Alexander Motin writes: > > > > > Author: mav > > > Date: Wed May 11 13:43:20 2016 > > > New Revision: 299448 > > > URL: https://svnweb.freebsd.org/changeset/base/299448 > > > > > > Log: > > > MFV r299442: 6762 POSIX write should imply DELETE_CHILD on directories > - and > > > some additional considerations > > > > > > Reviewed by: Gordon Ross > > > Reviewed by: Yuri Pankov > > > Author: Kevin Crowe > > > > > > openzfs/openzfs@d316fffc9c361532a482208561bbb614dac7f916 > > > > This commit confuses acl_is_trivial_np(3). Notice '+' in ls(1) and 'D' > > in getfacl(1) outputs. > > It's not just that. > > Those changes: > > 1. Confuse acl_is_trivial_np(3), as you say. It's hard to fix in libc, > because they make trivial ACLs different for files and directories, > and acl_is_trivial_np(3) has no way of telling which is which. > > 2. They make delete deny permission take precedence over the containing > directory write allow permission, which is rather different from what > people expect in unix systems, and is against the NFSv4 specification, > even though it might be a better fit for Windows. This is Windows behavior and inconsistent with the rest of FreeBSD and any UNIX or Linux system. > > 3. They make umask apply to inherit_only permissions, and > > 4. I don't fully understand this one yet, but from the ACL regression > test suite (which lives in tests/sys/acl/, and I'd appreciate people > actually ran this before committing ACL-related changes) it looks > like it makes umask not apply to the stuff it should. > > The #1 could be fixed by making ZFS not setting delete_child on write, > basically reverting to the previous behaviour in that aspect. As for > the others... I'm not saying each one of those is wrong, but they > certainly warrant further discussion, especially #2 and #4. I think #2 is wrong behavior on any UNIX-like or POSIX system. > > Basically, what I'm trying to say is that we should consider backing > this out for 11.0-RELEASE, reverting to the previous semantics, verified > by passing the regression tests. Agreed. What in FreeBSD was this patch supposed to solve in the first place? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sun Jun 19 14:33:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C563A7A876; Sun, 19 Jun 2016 14:33:51 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lf0-x232.google.com (mail-lf0-x232.google.com [IPv6:2a00:1450:4010:c07::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 BE55724F0; Sun, 19 Jun 2016 14:33:50 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: by mail-lf0-x232.google.com with SMTP id l188so23580222lfe.2; Sun, 19 Jun 2016 07:33:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=PFgkSJ/ao4/s1xg/wsYbkKKmrVMkj8zIQgpBKKs/OSU=; b=QvLYL9qwpmLWTAY4bmgHAsEo2fVXBOEjmjBWekpidnIxyOTD4rSbuHRqwx45nVwA2L lvveK5HyqQWpc8BrTNCV7I2y9bzv6qCUszHBEl7Odecu8h2WTCnNWmyzi+ewUs4gCoX+ V9Tb7q+iye7d8heG8afQrdNFw45ueaBmyaS7kjxAOPDuEuREbO03IKGDZH0JGV06DWhB /pUtTeKgzc226m2QQ4TU9Ypq9KcgkWtmP+5EWx146vWsYgCwsxqFO5iOM+nsrbn2FX9F OGM2Bv7QnMLE+FYYzR4zYc8Iyz2r+fjVYmqB31b3AKeQkwfcEnl45SDvXdleSUwVt5eS a0zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=PFgkSJ/ao4/s1xg/wsYbkKKmrVMkj8zIQgpBKKs/OSU=; b=N03Cd8xB9B0014yMbVwGA5BgrG5hxq8qVdJ71zwgg63E7WMDiZUQQw7dNC23E51+s2 9DBS5qMp0CEzN55EIj08E75/+thB2YSN/JVYlJNApeb1UHq0/BkSvmcz2IOoWCEZltF8 t43lGip6GY+XH1TXZ4kZoo+bG4TuHt/5XlPIFlOUzTjIYx6Y2SiYWy2pBRuJ1lcAk/Ml Av2xTAnKVKrpsN1pDrBEc7P4HvOAQb4UjqceFoILvYYc31hXmFHCKY56h8ulgyam8VrS 8nCCsSdkpQRJ50VrLvxEXYH/aFi4NkTeaXETtQ8BHpFmQM9YKSoYPFvc0z87fIa/8mZA OVfA== X-Gm-Message-State: ALyK8tK9FhHExzbIFs2YOsRX7PAORJZfahJNFAaa9vHXdpk+2ivrzQmExi3UJ0TVziz0oQ== X-Received: by 10.46.9.2 with SMTP id 2mr2897272ljj.1.1466346828570; Sun, 19 Jun 2016 07:33:48 -0700 (PDT) Received: from mavbook.mavhome.dp.ua ([134.249.139.101]) by smtp.gmail.com with ESMTPSA id y124sm5960396lfd.0.2016.06.19.07.33.47 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2016 07:33:47 -0700 (PDT) Sender: Alexander Motin Subject: Re: svn commit: r299448 - in head/sys/cddl/contrib/opensolaris: common/acl uts/common/fs/zfs uts/common/sys To: Cy Schubert , Jan Beich , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606191428.u5JESbbs053857@slippy.cwsent.com> From: Alexander Motin Message-ID: <49d3d34d-ba91-ebdf-497f-cbe1614bec53@FreeBSD.org> Date: Sun, 19 Jun 2016 17:33:45 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606191428.u5JESbbs053857@slippy.cwsent.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 14:33:51 -0000 On 19.06.16 17:28, Cy Schubert wrote: > In message <20160619080803.GA1638@brick>, Edward Tomasz > =?utf-8?Q?Napiera=C5=82 > a?= writes: >> On 0614T0232, Jan Beich wrote: >>> Alexander Motin writes: >>> >>>> Author: mav >>>> Date: Wed May 11 13:43:20 2016 >>>> New Revision: 299448 >>>> URL: https://svnweb.freebsd.org/changeset/base/299448 >>>> >>>> Log: >>>> MFV r299442: 6762 POSIX write should imply DELETE_CHILD on directories >> - and >>>> some additional considerations >>>> >>>> Reviewed by: Gordon Ross >>>> Reviewed by: Yuri Pankov >>>> Author: Kevin Crowe >>>> >>>> openzfs/openzfs@d316fffc9c361532a482208561bbb614dac7f916 >>> >>> This commit confuses acl_is_trivial_np(3). Notice '+' in ls(1) and 'D' >>> in getfacl(1) outputs. >> >> It's not just that. >> >> Those changes: >> >> 1. Confuse acl_is_trivial_np(3), as you say. It's hard to fix in libc, >> because they make trivial ACLs different for files and directories, >> and acl_is_trivial_np(3) has no way of telling which is which. >> >> 2. They make delete deny permission take precedence over the containing >> directory write allow permission, which is rather different from what >> people expect in unix systems, and is against the NFSv4 specification, >> even though it might be a better fit for Windows. > > This is Windows behavior and inconsistent with the rest of FreeBSD and any > UNIX or Linux system. > >> >> 3. They make umask apply to inherit_only permissions, and >> >> 4. I don't fully understand this one yet, but from the ACL regression >> test suite (which lives in tests/sys/acl/, and I'd appreciate people >> actually ran this before committing ACL-related changes) it looks >> like it makes umask not apply to the stuff it should. >> >> The #1 could be fixed by making ZFS not setting delete_child on write, >> basically reverting to the previous behaviour in that aspect. As for >> the others... I'm not saying each one of those is wrong, but they >> certainly warrant further discussion, especially #2 and #4. > > I think #2 is wrong behavior on any UNIX-like or POSIX system. > >> >> Basically, what I'm trying to say is that we should consider backing >> this out for 11.0-RELEASE, reverting to the previous semantics, verified >> by passing the regression tests. > > Agreed. > > What in FreeBSD was this patch supposed to solve in the first place? Growing divergence from OpenZFS upstream. I am not advocating this patch, but it would be good, if possible, to not revert it completely, but block wrong behavior with some minimal ifdefs to make further ZFS merges easier. Help would be appreciated. ;) -- Alexander Motin From owner-svn-src-head@freebsd.org Sun Jun 19 14:52:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C67AA7AD47; Sun, 19 Jun 2016 14:52:38 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) (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 A1AB62D62; Sun, 19 Jun 2016 14:52:37 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x241.google.com with SMTP id c82so5425599wme.3; Sun, 19 Jun 2016 07:52:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dCzQxX+81megEQQS5IEFg+jJ0xZc5zaaR/UAF5sjsLs=; b=bk+IqefUAHgj9eFWQnU9MrxHaY9TUKkg+nNkXNz0z06Jfootl3QYGVteWBPPssQETb Kct8fQ3vXxZEUNGVUi7arhXWXezyhByjDA7QcBnM7OfqB884QLMclV6WRKLfWEkg4XPq RGXisbr0qWB2hYx2kxzvswhpFu76bTGGa/47Ti/ninYkjUVoE+fP/fEUs8Eh8bXGD2Yf ZjKL4EtDZRwRHch8m2ld6TskedyVPNPi2jix2cRH0QGKI7izDQPr0+orzp3tqPeaO9IS mHmPEo+VWtaLKL8/R6v87ck28QYwdJSvfctdkNjRfkTSrik7/GGtciXX+cxLrYNbRX9i y0bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=dCzQxX+81megEQQS5IEFg+jJ0xZc5zaaR/UAF5sjsLs=; b=Y96JuEVFIMQP2tEbqT23C07o88Rca1TOqhmQrcCI+MvEL1jws0BMcZbZCmQQmZTst8 3U6kl1UNFOLr4d45ghCF/3YSdsI2GcSlsX+/7b7JkO31RT8HObh/2JfGccjU5EQoR9jk /Q3Z2Aaq1QdlERd9xSEBzV8Coz2g68VrDtB0Q2PgsHGZFdN3XIpTr+N6K7Z2ts4s8xMF pAPOg+N6VxQXS1BwunJFuDSv8oZEy1EV+VH28UdCJBFs+xYugHGpJDGoTSOrIhdq/A+P vju10+5677NAI+PYA8MKJgIWE+82g8E25tkSy/uepkX7uE5voX2YRE7KiPmJcrpaBYTH 7QNA== X-Gm-Message-State: ALyK8tJ3DLMrn2i41EUkcui/uXU6CQWcqPXPqAl5iS78zk7wCRAz0GJ6DTS/3youcYMDUQ== X-Received: by 10.28.129.197 with SMTP id c188mr7555574wmd.46.1466347955995; Sun, 19 Jun 2016 07:52:35 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id a84sm8898535wma.0.2016.06.19.07.52.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Jun 2016 07:52:35 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 19 Jun 2016 16:52:34 +0200 From: Baptiste Daroussin To: Andrey Chernov Cc: Hajimu UMEMOTO , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools Message-ID: <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uemritr6a2t6vnd4" Content-Disposition: inline In-Reply-To: <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> User-Agent: Mutt/1.6.1-neo (2016-06-11) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 14:52:38 -0000 --uemritr6a2t6vnd4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 19, 2016 at 07:57:49AM +0300, Andrey Chernov wrote: > On 19.06.2016 6:44, Hajimu UMEMOTO wrote: > > Log: > > - Prefer to use %d over %e where the day of the month should be zero > > filled. > > - Since %e means the day of the month as well, regard %e as same as %d > > in md_order. >=20 > Nonsense doubled formats in sr_*_RS locales and nonsense md_order there t= oo. Crap I'll dig into it, thanks for spotting it. Best regards, Bapt --uemritr6a2t6vnd4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXZrGxAAoJEGOJi9zxtz5aokYP/RWpDVKmRAkS8UjyUAQQ+/60 RgnqvbXwMd8Hv4lCOJZSkIxY9cyVaKCI+PdwhlTBIzEPxFM3RfZHon2jyg5Mf6/7 KbnmHAlvx/bJ+aBrmBoarSGBpHpwsI7GPGF7ull3utFAshWRiotyA7HvSL95XgQm ch982O4JMZWfIMDlRRLytNPVrUMSmEF8nFwj3ftP5fMU8g6iE/gz2Jo2s3fZD4pk oafyTRbRcmbyiibldCPNxeq1E7DyOAdy8wI62YlzwjovL+t8HYwUaIxgySX1mKIP QnuZwFI6Su2FIbwRZkkIdS46+g/wxKk6PtlmOYlfXfVppaQQsT8MqNF/IqZ3zZzr wzMgjV+Y8X7PotgA+LqOIWsbVFL7tN8AveOrJy/5k85jrKVqrfhTbIzny8CHM0nt QlcccbbrYHjNtMNrBpN5jzcnGiG+kuDMCfHJjBHxAIgNhGsO+6dbaBsshD5I8px1 /JqbZgPyZYMczpKL9qjy8C0/OMixijIA2Yl1HmWiBUNO6URMZvJMVLTGoxwq2dRl 2Z/sQF3NADyj0o35EmSaycsYJLmzutxTuP8hELm6cqghy3evIc2tyiyUxhM1jXrh BfYtyTnNI5KCMkeikrYCT8lTtw0t7tLVDDEZKZL+xj8QHCsT7Tjs+mZBOR/qArUt qJWnlvNef9GzKn7NCU/0 =125R -----END PGP SIGNATURE----- --uemritr6a2t6vnd4-- From owner-svn-src-head@freebsd.org Sun Jun 19 14:59:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEA45A7AE27; Sun, 19 Jun 2016 14:59:35 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from mail.daemonic.se (cloud.daemonic.se [185.34.0.151]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FEE22F80; Sun, 19 Jun 2016 14:59:35 +0000 (UTC) (envelope-from zeising@freebsd.org) Received: from cloud.daemonic.se (localhost [IPv6:::1]) by mail.daemonic.se (Postfix) with ESMTP id 3rXcb800fzz27L1; Sun, 19 Jun 2016 14:59:32 +0000 (UTC) X-Virus-Scanned: amavisd-new at daemonic.se Received: from mail.daemonic.se ([127.0.0.1]) (using TLS with cipher ECDHE-RSA-AES128-GCM-SHA256) by cloud.daemonic.se (mailscanner.daemonic.se [127.0.0.1]) (amavisd-new, port 10587) with ESMTPS id n7JrC19zxNsu; Sun, 19 Jun 2016 14:59:31 +0000 (UTC) Received: from [IPv6:2001:470:dca9:2::3] (celes.daemonic.se [IPv6:2001:470:dca9:2::3]) by mail.daemonic.se (Postfix) with ESMTPSA id 3rXcb65jpdz27C0; Sun, 19 Jun 2016 14:59:30 +0000 (UTC) Subject: Re: svn commit: r288291 - head/etc To: Cy Schubert References: <201606191408.u5JE8W5w053656@slippy.cwsent.com> Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Niclas Zeising Message-ID: <658f8bf1-6ded-903f-7469-55bc4b6798fd@freebsd.org> Date: Sun, 19 Jun 2016 16:59:28 +0200 User-Agent: Mutt/1.5.21 MIME-Version: 1.0 In-Reply-To: <201606191408.u5JE8W5w053656@slippy.cwsent.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 14:59:35 -0000 On 2016-06-19 16:08, Cy Schubert wrote: > In message <4e985ab9-0d98-a160-bdad-fa4924ddc5b3@freebsd.org>, Niclas > Zeising writes: >> >> This is wrong, and how I discovered it. ddb (/etc/rc.d/ddb) starts >> before disks, and currently refuses to start on my systems with this >> issue. This means no crash dumps, unless I remember to manually start >> it later in the boot process, so this is an issue. > > ddb isn't a daemon. It's an interface into the kernel that configures DDB > properties. It runs and completes. And, yes, it is affected by limits not > being found in the path. I think I misunderstood what you mean, I thought you meant nothing is affected by this. Apologies for that. > > My point is, since there are no daemons, as per the definition of a daemon > (processes that become daemons and run in the background) prior to the > filesystems being run, to say that there would be differing systems > behavior before and after filesystems are started is presently false > (though technically true because one day we might have daemons started > before critical filesystems are mounted). Agreed. I understand if we are too late in the release cycle for 11 to move limits to /bin, which seems like the best solutions. Are there any other reasons not to move /usr/bin/limits? I wanted to bring this to attention, since it seems noone else has noticed it, or cared enough about it. It is nothing that stops me from using FreeBSD, I will just have to remember to start ddb manually, or run the commands in case of a panic. Regards! -- Niclas From owner-svn-src-head@freebsd.org Sun Jun 19 15:49:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1822BA7996B; Sun, 19 Jun 2016 15:49:23 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (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 9D75A2C6E; Sun, 19 Jun 2016 15:49:22 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id a66so3465501wme.2; Sun, 19 Jun 2016 08:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=V04uj9prdxixxVKGQ7M8d0TRwNWtRaUJb/sSnZj02Dc=; b=k3VchkvlF9GDu6oxny9d8Z2T4rhs5RZo/SuI3OzGssJbJHGSmzu4coK744AAPR72vN FodacZslj5IsISFLnPeBbmHtjdwiI19ps91Q8bdtgglKXFN6AkUQ6MurEw26eP7t1cC2 CSLD/llLv6Dogl4wEz7JLQ17qd2vVcGwFwkJIaPbo747RN/LvgamENKxfkCcO6VX6wZA 14AByAd1dLXZ2zDbqZ0e5C5jFLOb2SMHW+OTsq1guAmjsZ34DXeG2YidXklWa8s0okEJ teThbao3HzWWB8KFFy9urb30Kq9Ed7F02zhnhzDVApYxodLZ/eaLCsVmEDM8yyQpA6DI 3g2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=V04uj9prdxixxVKGQ7M8d0TRwNWtRaUJb/sSnZj02Dc=; b=fkZJkNzAOqm4Wnrwc3d2cRtkEZTkQ0f43Uj6cXxHc6D+V2XmYOxo22FoxdAeSwC+9n NoyvOqjUtJVuMbtLEC1+7wNQ/k6TnJEk12vjaJ6GLlut0ulYvEKsS4Cvz4OGHYnDVwFj gYlb6IKFcUh+yz2Mm1zZxkv8WhYta7Jt8QJp0F1YxstEr+6/Yw4o2uPAk0KCGoqOm5KS hZLHqE0YPXzlb1P75gw4wzLSb+3SMkkyacEbBMes12RnyXRYEXnkEFkixFKy/VzdiJSB QHQmLbBmNSbXUbhVnq3CCnb6bTP3nOVptvTmymZdU9ebNQXFCvA2vjYhphAdYADcys8u BECQ== X-Gm-Message-State: ALyK8tIZB6il5UUbfaunubxPsv7Ofl5pCa9EgAdJijEgKGB/thQADo9V2ksBYr53XJANRA== X-Received: by 10.194.88.106 with SMTP id bf10mr4991134wjb.37.1466351360466; Sun, 19 Jun 2016 08:49:20 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id yr4sm47735395wjc.18.2016.06.19.08.49.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Jun 2016 08:49:19 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 19 Jun 2016 17:49:19 +0200 From: Baptiste Daroussin To: Andrey Chernov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools Message-ID: <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pc7s4e6evzu5cliy" Content-Disposition: inline In-Reply-To: <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> User-Agent: Mutt/1.6.1-neo (2016-06-11) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 15:49:23 -0000 --pc7s4e6evzu5cliy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 19, 2016 at 04:52:34PM +0200, Baptiste Daroussin wrote: > On Sun, Jun 19, 2016 at 07:57:49AM +0300, Andrey Chernov wrote: > > On 19.06.2016 6:44, Hajimu UMEMOTO wrote: > > > Log: > > > - Prefer to use %d over %e where the day of the month should be zero > > > filled. > > > - Since %e means the day of the month as well, regard %e as same as= %d > > > in md_order. > >=20 > > Nonsense doubled formats in sr_*_RS locales and nonsense md_order there= too. >=20 > Crap I'll dig into it, thanks for spotting it. >=20 > Best regards, > Bapt Should be fixed by: https://people.freebsd.org/~bapt/locale-triple-components.diff The perl script generating the locales was badly handling locales with 3 components, fixed now. Sorry about that Best regards, Bapt --pc7s4e6evzu5cliy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXZr7+AAoJEGOJi9zxtz5aiYcP/0yH1RQV4ivjWBKaIh+G+rZS 2PD/n1P0mMcP/LQ7seQT2P23lJHEbdxCFriYFz8w8DXwQd/RQzX7nKW/5sLI9YTM ddI4ISHC0MM8icQVnDD1xMD7H4UbcI57lAI3KV7DYhnO1yFT3AM9ttQC2RqBFKJN PHpkLU8wx3GKK0qsL6wYa8I6OulYK+/NjKeJtoeqPdVSnMnC7bWR3PNaBh0/7wMJ djUT6Ghaso1xaMjWwDbe9njsnYQj6f67E62LqmuQsY8cPKu2I6a3ovm7DVntzq3D Fj9L9zC7Dx6fQFCE89RfGH9w/Mm2CMa+aFv8GzSu4hz6dclF3qdTLjpv2FCAyHXW Mq6N/VmuBC8PxGCWBSZVV4ijnwn/SX14AtZ8mh3KRuSpZDbxrSFW1FUbNzXKsGs/ MeyuuPqMJN4IAPdL8uuZ7dNwh1tGL+p7Zq/g5HT7nmDrD8e/lcq5XIVevAKvRPt3 pFLgQ3MAP+tpwN6tEHPBO0VyWqVSVohMTokcxYPNFnk67hwqTiCYisyUNty4K4N3 JMBag8P2dRPx7iR5oR/gOD9uV7GSjYPaM3j2peoTaD+hIql1oEDr/HAGQfy6tUaB p85Bzqir+I4YJIL30V4IoN3equDTWbC9cr5YMVITaerYxgqxBG1DOhmTSU4ZPK15 GQbDwAwuLQtj2ky2mZMO =Ftn0 -----END PGP SIGNATURE----- --pc7s4e6evzu5cliy-- From owner-svn-src-head@freebsd.org Sun Jun 19 16:21:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 062F1A7A49D; Sun, 19 Jun 2016 16:21:26 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id DD7112292; Sun, 19 Jun 2016 16:21:25 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id D8C65D758; Sun, 19 Jun 2016 16:21:24 +0000 (UTC) Subject: Re: svn commit: r288291 - head/etc To: Cy Schubert , Niclas Zeising References: <201606191408.u5JE8W5w053656@slippy.cwsent.com> Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: Date: Sun, 19 Jun 2016 12:21:24 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606191408.u5JE8W5w053656@slippy.cwsent.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 16:21:26 -0000 On 2016-06-19 10:08, Cy Schubert wrote: > In message <4e985ab9-0d98-a160-bdad-fa4924ddc5b3@freebsd.org>, Niclas > Zeising w > rites: >> On 2016-06-19 07:12, Cy Schubert wrote: >>> In message > c >>> om> >>> , Adrian Chadd writes: >>>> i think that's fine for -11. I'd like to just move limits to /bin for >>>> 12. (I mean, it's 2016, why are you splitting / and /usr again? But..) >>>> >>>> I don't want to see differing system behaviour between limits but it's >>>> likely unavoidable for 11 and could do with some errata notice so >>>> people know what to expect. >>> >>> There aren't any daemons started prior to critical local filesystems being >>> mounted. I suppose one day there could be but none at this point in time. >>> Setting limits before filesystems are mounted is practically a NOP anyway. >>> (Except it could negatively affect fsck of huge UFS filesystems some day.) >>> >>> >> >> This is wrong, and how I discovered it. ddb (/etc/rc.d/ddb) starts >> before disks, and currently refuses to start on my systems with this >> issue. This means no crash dumps, unless I remember to manually start >> it later in the boot process, so this is an issue. > > ddb isn't a daemon. It's an interface into the kernel that configures DDB > properties. It runs and completes. And, yes, it is affected by limits not > being found in the path. > > My point is, since there are no daemons, as per the definition of a daemon > (processes that become daemons and run in the background) prior to the > filesystems being run, to say that there would be differing systems > behavior before and after filesystems are started is presently false > (though technically true because one day we might have daemons started > before critical filesystems are mounted). > > I can see Adrian's point but not in the present day. In the future, > possibly. > > Another option might be to move ddb after filesytems are mounted or this > should circumvent the problem too: > I think you still want ddb early, because it configures crash dumps, and another daemon or process that starts might cause a crash. -- Allan Jude From owner-svn-src-head@freebsd.org Sun Jun 19 16:25:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91D63A7A662; Sun, 19 Jun 2016 16:25:43 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from mail.made4.biz (mail.made4.biz [IPv6:2001:41d0:2:c018::1:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52E59271D; Sun, 19 Jun 2016 16:25:42 +0000 (UTC) (envelope-from jean-sebastien.pedron@dumbbell.fr) Received: from 141.7.19.93.rev.sfr.net ([93.19.7.141] helo=magellan.dumbbell.fr) by mail.made4.biz with esmtpsa (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.86_2 (FreeBSD)) (envelope-from ) id 1bEfXY-000HhY-9J; Sun, 19 Jun 2016 18:25:40 +0200 Subject: Re: svn commit: r288291 - head/etc To: Niclas Zeising , Cy Schubert References: <201606191408.u5JE8W5w053656@slippy.cwsent.com> <658f8bf1-6ded-903f-7469-55bc4b6798fd@freebsd.org> Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= Message-ID: Date: Sun, 19 Jun 2016 18:25:30 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: <658f8bf1-6ded-903f-7469-55bc4b6798fd@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="awAWXl9rb8G1sPlaXoFQCxafg6Qs2naNv" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 16:25:43 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --awAWXl9rb8G1sPlaXoFQCxafg6Qs2naNv Content-Type: multipart/mixed; boundary="QOVdWKCaBSo7tKojpUcOJ8KIvU3oRtHac" From: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= To: Niclas Zeising , Cy Schubert Cc: Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-ID: Subject: Re: svn commit: r288291 - head/etc References: <201606191408.u5JE8W5w053656@slippy.cwsent.com> <658f8bf1-6ded-903f-7469-55bc4b6798fd@freebsd.org> In-Reply-To: <658f8bf1-6ded-903f-7469-55bc4b6798fd@freebsd.org> --QOVdWKCaBSo7tKojpUcOJ8KIvU3oRtHac Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 19/06/2016 16:59, Niclas Zeising wrote: > I wanted to bring this to attention, since it seems noone else has > noticed it, or cared enough about it. It is nothing that stops me from= > using FreeBSD, I will just have to remember to start ddb manually, or > run the commands in case of a panic. There is a bug filed to track this issue: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206291 I have the same problem because the system was installed a long time ago.= --=20 Jean-S=E9bastien P=E9dron --QOVdWKCaBSo7tKojpUcOJ8KIvU3oRtHac-- --awAWXl9rb8G1sPlaXoFQCxafg6Qs2naNv Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIcBAEBCgAGBQJXZseDAAoJEDnpl2Gl/ZTM9QsQAJU8xYwd0qyN9hdCCIOuWfT4 fr+hCgp7+a0zrakiVQ8oGDxk7Hekuw7xmwWLDJeUmBLDpY24lsQWQWIr12h4cnaX 9medWYB+9wN7bbPWrAgRihdBJ2dl4cRqIuLi1HWzECPs3FBOQ+T2IXsQUNAfpT4r BdxrrGgy7qIey1PoYGGRm19ntmZE2gAAwBtQVNfVXuCr++T+w2oGt9IuZ2bOKz8T OHyBWoLWiLpKEt0gVfC1uV26gcWmyvQvY6JOzP1pbqgENoIytGEho8al2NV93fmP zcSblH0EQoDihoG1qy3KUETcyes4uZNgLi1xlj9rQk8OUg3+1tFNOE5zh2DZuYgg v63mTGT6lYmVXDI/pwYPbaCCpMTaSae6NlWBIroWiyEKFYLES3WkJ5HZcbUh/mxn 9GdqN5mvbOcaHpJIFfWLsmi6NonsvopfTk1d2ooyNoI79OWRjWrJKYU57dl4LwGL u9UC0IG9zjLnnXK8LnNk4/kSAXG4tecbxpASA6nuP9oBMZzSi3Nns4ofH/IDYLPW 9hexRyqIaEu2HTinEiL9JsTkOkFu3/0WqpfcIfHBxxLqzoO8bVMRPH43QUfvJOtj tZQsfHg2HRaJnj8+/stHteY3b/oFZHKv0qmiMogmvxjJwg6zH4buwG6GhEBeByt6 e/rwyUP7V4tA6rDxihyB =Zy73 -----END PGP SIGNATURE----- --awAWXl9rb8G1sPlaXoFQCxafg6Qs2naNv-- From owner-svn-src-head@freebsd.org Sun Jun 19 16:47:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55645A7AB49 for ; Sun, 19 Jun 2016 16:47:37 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) (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 EBF171319 for ; Sun, 19 Jun 2016 16:47:36 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f41.google.com with SMTP id q132so24604507lfe.3 for ; Sun, 19 Jun 2016 09:47:36 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=3LpkDs9hCcTRoLtT6x9WnGgiO+9oNTcNVTmueb/D4xo=; b=BPnJVfG/q5Q+k/MY/pKqJ65kP3RWMVWjF8B4QPnSYmAhJutELVGZeAqSr7TEK3FOFg QiA2hDyCCqEg1oymjXw9gN7B8Lg4I78zWujMs1P6tHadX96MEVQHn4otkokurEIAEYzI gSHrkxXfBS7GAlJQW40uVrbsXMqXlPFjgJpmc7IVNj5HDRHrN9GyYrX3Mz4KmO6IfRr0 j38tXdLyPF9JwYTLO9REOOQUUD9cCI9sDlF4A/ZULDVvi6ozGcHs0HVKTIcCTFKrEYVU CM/f4GSsrHHympBd9o6Hw0WNZJU2z8dfRn8ROfNW+xkeVQqDknG5vbN2TeuLgq4jZnB8 Jbzg== X-Gm-Message-State: ALyK8tLzenSCN6W34zMXgRP2PaqPJDHwLwjep9JHIZ0FLtjBqA0l1aN29JShsk4QutQIEg== X-Received: by 10.46.32.28 with SMTP id g28mr2979736ljg.34.1466354849289; Sun, 19 Jun 2016 09:47:29 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id 25sm3685393lft.24.2016.06.19.09.47.28 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2016 09:47:28 -0700 (PDT) Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools To: Baptiste Daroussin References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO From: Andrey Chernov Message-ID: Date: Sun, 19 Jun 2016 19:47:27 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="owAtx50hIioIj6EgeutMGddJcBkh7GGR6" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 16:47:37 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --owAtx50hIioIj6EgeutMGddJcBkh7GGR6 Content-Type: multipart/mixed; boundary="o9vC4UbdPgfPscj79O59kWQ7hnehiBrT4" From: Andrey Chernov To: Baptiste Daroussin Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Message-ID: Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> In-Reply-To: <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> --o9vC4UbdPgfPscj79O59kWQ7hnehiBrT4 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 19.06.2016 18:49, Baptiste Daroussin wrote: > On Sun, Jun 19, 2016 at 04:52:34PM +0200, Baptiste Daroussin wrote: >> On Sun, Jun 19, 2016 at 07:57:49AM +0300, Andrey Chernov wrote: >>> On 19.06.2016 6:44, Hajimu UMEMOTO wrote: >>>> Log: >>>> - Prefer to use %d over %e where the day of the month should be ze= ro >>>> filled. >>>> - Since %e means the day of the month as well, regard %e as same a= s %d >>>> in md_order. >>> >>> Nonsense doubled formats in sr_*_RS locales and nonsense md_order the= re too. >> >> Crap I'll dig into it, thanks for spotting it. >> >> Best regards, >> Bapt >=20 > Should be fixed by: > https://people.freebsd.org/~bapt/locale-triple-components.diff >=20 > The perl script generating the locales was badly handling locales with = 3 > components, fixed now. >=20 > Sorry about that >=20 > Best regards, > Bapt >=20 sr locales are badly named before anything else, proper format is language[_COUNTRY][.encoding][@variant] I.e. sr_RS.UTF-8@Latn sr_RS.ISO8859-2@Latn sr_RS.ISO8859-t@Cyrl I don't know, if out utilities (f.e. locale(1)) can handle @variant suffi= x. --o9vC4UbdPgfPscj79O59kWQ7hnehiBrT4-- --owAtx50hIioIj6EgeutMGddJcBkh7GGR6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXZsyfAAoJEKUckv0MjfbKLFgH/RaDpaqA3TRHUH11YqkclUAj cnsfaN5UET0TQMfP2E0wnx/ZjxDic2FMLDcynA2N6l+2AuwRq1Y1KER7jOBpQPr7 q5HqlpCKXj0Utqst02xEUGox6PWx/HI3PGle1l1SwcFNmJLCnpiNIosdPBYw6pMd pKXA/jQaWnr1tA+uzkkYTTBe/jEKPrMDzOK2SumpY7Uxup1oQZBTqSubhua4pmLF eAJxUUiDoDOmenjnal67PZKyWWShT+6nclNcSfDDQsH9PjJj/x2r2Vn1TqsV2l82 NRi2hgWn3F0vaWRriMiHEcEn1ilHEhgeGwjG4taltcAdMxxBWbIkBa3JEcuYY2A= =/+CM -----END PGP SIGNATURE----- --owAtx50hIioIj6EgeutMGddJcBkh7GGR6-- From owner-svn-src-head@freebsd.org Sun Jun 19 16:52:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01D81A7AD21 for ; Sun, 19 Jun 2016 16:52:22 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (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 7C4A5181C for ; Sun, 19 Jun 2016 16:52:20 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f47.google.com with SMTP id f6so24726836lfg.0 for ; Sun, 19 Jun 2016 09:52:20 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=zEk+RXEjTCJlmJ+7g5VOH+GUhANwz+t9xPh7PyJMXsM=; b=cu8G0AHu1pWlvvBomXrRXoQYga/cRQ3cSGNv7+DBo+DACD3HBEVZ22UwePg4VB/u2+ 6ASl9dYKgtX4I/+XCweZgxaR8mjoRxYPVnvoV3sPKpTsyW7mwwTu0pRGaCo14BZ5c4ZE xjhSFWYIWdohXZMITztZBkCgrya+l3TxtmOvRWwuyKI7VKTAfe+SLRp3vTmgXVbozM04 obdJTTu9w3SPgwLJwgYbudW8UPkhpmLK8yp1vkkeehJeobBOHXlUf/tnpz922TkHgJn6 GiPOUxqcW5ZUS+uz/S8jVu8bl27vVVOJwSPpeMEIlt2W0OKnOYS+MQz8nRh2iY7T3bwY uwkg== X-Gm-Message-State: ALyK8tLBz1iQSIanWBugTq/gLgeECuA+eQlxDhi9Ud1JrDCNi0hFVDqaGyY7D6bIOt+yPg== X-Received: by 10.25.22.217 with SMTP id 86mr3232037lfw.100.1466355138771; Sun, 19 Jun 2016 09:52:18 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id z10sm260644lbr.12.2016.06.19.09.52.17 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2016 09:52:18 -0700 (PDT) Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools To: Baptiste Daroussin References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO From: Andrey Chernov Message-ID: Date: Sun, 19 Jun 2016 19:52:17 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="eW515PGpxbVjNUPRXLlTLhRjABBiMR5if" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 16:52:22 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --eW515PGpxbVjNUPRXLlTLhRjABBiMR5if Content-Type: multipart/mixed; boundary="tAbqLOkI4CX1nd1Nx5sK2VmDhm5hseT78" From: Andrey Chernov To: Baptiste Daroussin Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Message-ID: Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> In-Reply-To: --tAbqLOkI4CX1nd1Nx5sK2VmDhm5hseT78 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 19.06.2016 19:47, Andrey Chernov wrote: > On 19.06.2016 18:49, Baptiste Daroussin wrote: >> On Sun, Jun 19, 2016 at 04:52:34PM +0200, Baptiste Daroussin wrote: >>> On Sun, Jun 19, 2016 at 07:57:49AM +0300, Andrey Chernov wrote: >>>> On 19.06.2016 6:44, Hajimu UMEMOTO wrote: >>>>> Log: >>>>> - Prefer to use %d over %e where the day of the month should be z= ero >>>>> filled. >>>>> - Since %e means the day of the month as well, regard %e as same = as %d >>>>> in md_order. >>>> >>>> Nonsense doubled formats in sr_*_RS locales and nonsense md_order th= ere too. >>> >>> Crap I'll dig into it, thanks for spotting it. >>> >>> Best regards, >>> Bapt >> >> Should be fixed by: >> https://people.freebsd.org/~bapt/locale-triple-components.diff >> >> The perl script generating the locales was badly handling locales with= 3 >> components, fixed now. >> >> Sorry about that >> >> Best regards, >> Bapt >> >=20 > sr locales are badly named before anything else, proper format is > language[_COUNTRY][.encoding][@variant] > I.e. > sr_RS.UTF-8@Latn > sr_RS.ISO8859-2@Latn > sr_RS.ISO8859-t@Cyrl >=20 > I don't know, if out utilities (f.e. locale(1)) can handle @variant suf= fix. >=20 >=20 =3Dsr_RS.ISO8859-5@Cyrl =3Dour, and not utilities only but libc too --tAbqLOkI4CX1nd1Nx5sK2VmDhm5hseT78-- --eW515PGpxbVjNUPRXLlTLhRjABBiMR5if Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXZs3BAAoJEKUckv0MjfbKgC4H/0OogkzEPP42VCqvpVK+573t CNqK6VqlDJHSKB1YBrW2nTC5GjLlvLUFpcp32UM7INMxLTTS80XvEsN1vOnjsuWX c32UYSChng7W4H3qolADiK0m4Rm9pjmBeIhtM+igDq3XzRTlUv8MyB27tdJD1nyt t8tMvDPgWBFNz22TR/Bij9LJvFhQFxL5hMMlatjd1BBvT61EbKrnoyLA+7WJoE/L 4pd/0LY43OImT7aGek1fLn4IF2bq3mZIkk3aZuUkIZjE3tuT4lkaTkhtK/yOW70h wCakjNevg1gg2ESrsUYXLsP+w1aLnwI5+5+C/pn7wsCoIcG8DAccyDpwoRNoHLg= =QxXX -----END PGP SIGNATURE----- --eW515PGpxbVjNUPRXLlTLhRjABBiMR5if-- From owner-svn-src-head@freebsd.org Sun Jun 19 17:05:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34A3BA7A2C3 for ; Sun, 19 Jun 2016 17:05:40 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f46.google.com (mail-lf0-f46.google.com [209.85.215.46]) (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 B258D2036 for ; Sun, 19 Jun 2016 17:05:39 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f46.google.com with SMTP id h129so23959969lfh.1 for ; Sun, 19 Jun 2016 10:05:39 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=X/KhJLcTFWSqZ+VwnDufhH4HJ8HvyNhrSMEUyIyI9P0=; b=WmigcoB9jun2BcOgr4+92cKfaQvF7nY1yIev4k2AsRjA4WSxRbdbTEqoiGNvegLd1v JHJDy8ej8JarnkRW+4ZFqqKK2K/9RwJ6/snrLmcogm59ajHuRjuDjg1k3xp6q2sAC6Xk P9l5miiKshVtZLxC++roVDtTSKwrZoJUP+488j9keBDFCC7jNatwXvklhi0uXl0k7yTb urtH6c6j34tnO1wJ9U4MQXgJrQ2heRb0oqTH+GEbXTdA4u/0IPhjN9apWxH2wXSvUtVX WedVecc8BMdwP9/6+ecSZe89bUXCiXAv/8fguoQrMsrjVKlOnrdqyRVoanY1vJlnV6WB LVIA== X-Gm-Message-State: ALyK8tJ51CAK+S1wUBMBY5kIU2ndarwKc0p+GnZAMrJCzPzLKxMRPeArU84zDTQ1tA8PAQ== X-Received: by 10.25.18.234 with SMTP id 103mr3583249lfs.118.1466355931852; Sun, 19 Jun 2016 10:05:31 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id f17sm6035591lfg.35.2016.06.19.10.05.30 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2016 10:05:31 -0700 (PDT) Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools To: Baptiste Daroussin References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO From: Andrey Chernov Message-ID: <77076d87-41ad-0cce-c703-ed9cef1bdb8b@freebsd.org> Date: Sun, 19 Jun 2016 20:05:30 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2qEDkAXlhRDV2rTRvnDjE0Mu4qdMjdnvX" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 17:05:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2qEDkAXlhRDV2rTRvnDjE0Mu4qdMjdnvX Content-Type: multipart/mixed; boundary="Qlb6DpaT3WRgTOvCfutkB45THtThh99ir" From: Andrey Chernov To: Baptiste Daroussin Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Message-ID: <77076d87-41ad-0cce-c703-ed9cef1bdb8b@freebsd.org> Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> In-Reply-To: --Qlb6DpaT3WRgTOvCfutkB45THtThh99ir Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 19.06.2016 19:52, Andrey Chernov wrote: > On 19.06.2016 19:47, Andrey Chernov wrote: >> On 19.06.2016 18:49, Baptiste Daroussin wrote: >>> On Sun, Jun 19, 2016 at 04:52:34PM +0200, Baptiste Daroussin wrote: >>>> On Sun, Jun 19, 2016 at 07:57:49AM +0300, Andrey Chernov wrote: >>>>> On 19.06.2016 6:44, Hajimu UMEMOTO wrote: >>>>>> Log: >>>>>> - Prefer to use %d over %e where the day of the month should be = zero >>>>>> filled. >>>>>> - Since %e means the day of the month as well, regard %e as same= as %d >>>>>> in md_order. >>>>> >>>>> Nonsense doubled formats in sr_*_RS locales and nonsense md_order t= here too. >>>> >>>> Crap I'll dig into it, thanks for spotting it. >>>> >>>> Best regards, >>>> Bapt >>> >>> Should be fixed by: >>> https://people.freebsd.org/~bapt/locale-triple-components.diff >>> >>> The perl script generating the locales was badly handling locales wit= h 3 >>> components, fixed now. >>> >>> Sorry about that >>> >>> Best regards, >>> Bapt >>> >> >> sr locales are badly named before anything else, proper format is >> language[_COUNTRY][.encoding][@variant] >> I.e. >> sr_RS.UTF-8@Latn >> sr_RS.ISO8859-2@Latn >> sr_RS.ISO8859-t@Cyrl >> >> I don't know, if out utilities (f.e. locale(1)) can handle @variant su= ffix. >> >> > =3Dsr_RS.ISO8859-5@Cyrl > =3Dour, and not utilities only but libc too Since right now we have only single @variant per each encoding, and no @variant for other locales, we can just drop it and use right names like:= sr_RS.UTF-8 sr_RS.ISO8859-2 sr_RS.ISO8859-5 --Qlb6DpaT3WRgTOvCfutkB45THtThh99ir-- --2qEDkAXlhRDV2rTRvnDjE0Mu4qdMjdnvX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXZtDaAAoJEKUckv0MjfbKobsIAMuAx1/nEwCJkLFsA/2BbLbQ TQei43xsVX5jIgYErVaH3B/nk0jTJJMC8KQdJh6yqchz5uj5xAGDsQ5YsjKepcCy 38p9tzi28TXPnQhe4bT0VFEJ8E9PacoW7hQYkvetQjUCT5ec/6lQ3wj50tXSRuOn uNIVqO0YmkLHK3QCzEUSbToNl3O78yAJ7O381Pb/eab8gwVG0MbjmScGE11DIhkQ ievblj+gw9hC3CoWNq2rnhVtt4RFqty8J4fv8JqseS3IpAvclT60MuLwYDFLGy2m jc7UQD9kMQIF6Mx968VRb8LP6jUm/MGRTDfJkBArJFA0YLtc16PAviPtxVd+/Qs= =Ndqx -----END PGP SIGNATURE----- --2qEDkAXlhRDV2rTRvnDjE0Mu4qdMjdnvX-- From owner-svn-src-head@freebsd.org Sun Jun 19 17:05:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39220A7A2C9; Sun, 19 Jun 2016 17:05:42 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (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 A1DFD2095; Sun, 19 Jun 2016 17:05:41 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id a66so3748584wme.2; Sun, 19 Jun 2016 10:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cQwnudjChlRHrrpHku6vh1UeGH0HtxVFTRC+lPgpVvU=; b=JjiqNOVnAd1QvwJUNt8e98B2rMOuPpzX9nv1ofvZie8j442+ECZ/7oqtHnzX6uwkhI HSOwgpusQNsuXrOM6a1hqzWTuw7x+Sgs8C+2l0mgRsC2QSESX2bkbu2Old/dVWEPW0jN QrXoWKzO7ur/hJf7B3T2VKGHTWcVJ+CPopHDaCBtNnt/DpuxJ6w5/1DoTmoGiSJ98cHA dJ6UnxeeZdvfTB6Wqp5kwwHy9wLHSXuipXVdrxSFBcbTTjMfdHxUzr/17bJaXYIPP7RU hs0r4XiTk0OShuBi2rH/68Yq5BTGj6pxvhtUzFTo2l3Ug0pxqFqikOw0gfYjr9WL+Rx3 gYvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=cQwnudjChlRHrrpHku6vh1UeGH0HtxVFTRC+lPgpVvU=; b=f4gn1Gge8iZr7uEZImVRCssn/QCRaxC98Ev9hgEvtoWmdt2LSW+91JqN8G4BAeu/Vu fD8UBSXbRD+9nHPI5ppdpFIyryMpBOmn/khT3X0R0WtxcLqD8uHcNG9sjdDs/MoVZSzl QKec5wFgNdBpHYr23EQxaPJHCtSQD0t8qO06uCbvcJhWqRbV9xHw5BWMOnZkNX6cs2Mt FQ88e487K9oc65eufVh4eei2x4cLXuswKL1Os+b5ZjVasIyzUVZvgEzvyVaY8P7xVJ6u kWjk/4uZPLCqFznD3E/4jiTIccfYm6/UjqqQ9pENHkUDmkU6qbd1yuWGploHOIr3H/Vr KevQ== X-Gm-Message-State: ALyK8tJsR4hB1AMIMxs+dn+NpqqT/T1nyZNmb6DpX4Y1d70lHKk8CESc59OzuXZbqK9adA== X-Received: by 10.28.228.69 with SMTP id b66mr6928379wmh.25.1466355940005; Sun, 19 Jun 2016 10:05:40 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id o10sm22607784wjs.38.2016.06.19.10.05.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Jun 2016 10:05:39 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 19 Jun 2016 19:05:38 +0200 From: Baptiste Daroussin To: Andrey Chernov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools Message-ID: <20160619170538.qt2kmzr5fo34ekvj@ivaldir.etoilebsd.net> References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fh7brfnogevkb7bw" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.1-neo (2016-06-11) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 17:05:42 -0000 --fh7brfnogevkb7bw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 19, 2016 at 07:47:27PM +0300, Andrey Chernov wrote: > On 19.06.2016 18:49, Baptiste Daroussin wrote: > > On Sun, Jun 19, 2016 at 04:52:34PM +0200, Baptiste Daroussin wrote: > >> On Sun, Jun 19, 2016 at 07:57:49AM +0300, Andrey Chernov wrote: > >>> On 19.06.2016 6:44, Hajimu UMEMOTO wrote: > >>>> Log: > >>>> - Prefer to use %d over %e where the day of the month should be ze= ro > >>>> filled. > >>>> - Since %e means the day of the month as well, regard %e as same a= s %d > >>>> in md_order. > >>> > >>> Nonsense doubled formats in sr_*_RS locales and nonsense md_order the= re too. > >> > >> Crap I'll dig into it, thanks for spotting it. > >> > >> Best regards, > >> Bapt > >=20 > > Should be fixed by: > > https://people.freebsd.org/~bapt/locale-triple-components.diff > >=20 > > The perl script generating the locales was badly handling locales with 3 > > components, fixed now. > >=20 > > Sorry about that > >=20 > > Best regards, > > Bapt > >=20 >=20 > sr locales are badly named before anything else, proper format is > language[_COUNTRY][.encoding][@variant] > I.e. > sr_RS.UTF-8@Latn > sr_RS.ISO8859-2@Latn > sr_RS.ISO8859-t@Cyrl According to what? >=20 > I don't know, if out utilities (f.e. locale(1)) can handle @variant suffi= x. >=20 Our syntax is the syntax for the variants that has been the widly adopted: Microsoft, ICU, java, python's babel internationalisation thing, cldr (of course), CPAN components (Datime::Locales for example) This is respecting RFC 3066 with the little difference that we use '_' inst= ead of '-' Best regards, Bapt --fh7brfnogevkb7bw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXZtDfAAoJEGOJi9zxtz5atQYP/jMq+j78/JFlN/yBbJO9lMzn SLCRl594TJ7H6sAqB9lfzNsKCsHkhsHlHVvabsLQ2viQAYf7admZd3JTVOExwR6l otAZhUfLF8PFM6Sm2NZmcBPNQ+a3CYjrwueZF7P2OxYR/seSSPRLsx2/AFlmm25U w108Uhv/GatttIO+rWvQBMJIHuytv15mlfSF60I2q9I/aVufStHpp2xP+uagXC+n aNt71m3IQC1yAUOldNFBi70d48ZEOqrj6/0fCrIUy6tCd1rhNmAnKEINJr7D8Fo1 dRRzjsfBsNdmd0nATR9rI9FBe4sclUhauZTtFVNluLfd/VcT9pAnc1V9GQTU/3jb Ep5z8nzPc7vzFnTtfyz+3BvbjL4eueiKDCeY2FBDFqP6Keq5WjszApXYEoVdaxep CER8Unp/Juv6T9aeUQ+Vbhja+hO5/ckZQNRLDAqJ9qzOlUBeqbfh/YJJfgjzc4mi fCGm6GYSxo88Z2KPO4AoI+SH9oYXUvwPrEBrZOqfMbRR/SR/QwVlfzWFFxsGtPB4 37scBATDm141o1Rli7PRe7k7QGsgSRtTtr010Gyk3nfPI27CE1uPi1la6YK4mhgs RtCaJ+VKOysX4uMSjXtPs00YOgtG9z8MrvehRbCT+6lvx0znbKxC4MbKnV8Fec7X hlPDOnlCFuvlXpzIVkYC =6UFc -----END PGP SIGNATURE----- --fh7brfnogevkb7bw-- From owner-svn-src-head@freebsd.org Sun Jun 19 17:10:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF4D7A7A4A2; Sun, 19 Jun 2016 17:10:24 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::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 7E0DC24ED; Sun, 19 Jun 2016 17:10:24 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x229.google.com with SMTP id r201so32336329wme.1; Sun, 19 Jun 2016 10:10:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=qHJpJx9ortWOx28KLDXqUo/N7Q49z6Wb0Pd0w02zmds=; b=EYWhyiDR2LkDIoYv/kAPeQ7pMLPpAmWLing7LTO3kIwy+TrNe9ZITUris0yLsOdZ8g A4BxeijJtX3kXeogpv3x/3a0rYHyo8ekbB3RA6QSWmv7H8+vKRYxCukXt8kCwRxURf8x DVF6EWFBpDtiuZUFuA0mTLOgcsrdTS10WIXc2fvSgBK+O8lsrf/q/cv80DHhYHxpEO/9 luroeGR+L/gTaSdEZ0nyqNpf85mFUFksyso0HfMcrGG97uLOi2U/tTvxMhQlgPNisaMq cv/7acznoJxXTqSHW/+Kl3t79z7TH5yTOEQFfNA5ZTr/z3+Xz/31LBhNCkBaiBfFKVtB xrxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=qHJpJx9ortWOx28KLDXqUo/N7Q49z6Wb0Pd0w02zmds=; b=AgrsVCzY/tl6cmGReUckjmMIeS3v1697ZCN0qeUHTH796PuVl040jrfrZplZyLxbA7 qWQfbWl8nQk6/vRU7EY6b5Jvi8KLtHVjupd4rdLVgKfuIBgt8aBSWspG4LuSiDmU30sH IEg9+++swaf3EozhlO+pWEMWFdSiE5OfPHZZ0vQyy5PiaPtTGtwiCBuGXzsUffc1TxrG 3sxK3DjvoriOiwOF+EdVan5Ue4jMn1yDsw9nIVKLDZGwkdtTKrhWqpnDkj/bgxHBtjCL 2rBzzLXoucFzxL1P/YIRe6g+O4WAj3/QcDYatGCUir3GnemCY7bGllLW+dKTqn4pyIXU mRaQ== X-Gm-Message-State: ALyK8tIdrw8Sd3xBONCjPtCQa7cO7MwxYnjd47GvkCsO2eSJhIF2N6JNzt8qXvlIo2VkPQ== X-Received: by 10.194.203.105 with SMTP id kp9mr11463431wjc.70.1466356222765; Sun, 19 Jun 2016 10:10:22 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id jf3sm28563493wjb.41.2016.06.19.10.10.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Jun 2016 10:10:22 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 19 Jun 2016 19:10:21 +0200 From: Baptiste Daroussin To: Andrey Chernov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools Message-ID: <20160619171021.7ps2te7wgoxfqznv@ivaldir.etoilebsd.net> References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> <77076d87-41ad-0cce-c703-ed9cef1bdb8b@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="imdvuh4tgkvycob7" Content-Disposition: inline In-Reply-To: <77076d87-41ad-0cce-c703-ed9cef1bdb8b@freebsd.org> User-Agent: Mutt/1.6.1-neo (2016-06-11) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 17:10:25 -0000 --imdvuh4tgkvycob7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 19, 2016 at 08:05:30PM +0300, Andrey Chernov wrote: > On 19.06.2016 19:52, Andrey Chernov wrote: > > On 19.06.2016 19:47, Andrey Chernov wrote: > >> On 19.06.2016 18:49, Baptiste Daroussin wrote: > >>> On Sun, Jun 19, 2016 at 04:52:34PM +0200, Baptiste Daroussin wrote: > >>>> On Sun, Jun 19, 2016 at 07:57:49AM +0300, Andrey Chernov wrote: > >>>>> On 19.06.2016 6:44, Hajimu UMEMOTO wrote: > >>>>>> Log: > >>>>>> - Prefer to use %d over %e where the day of the month should be = zero > >>>>>> filled. > >>>>>> - Since %e means the day of the month as well, regard %e as same= as %d > >>>>>> in md_order. > >>>>> > >>>>> Nonsense doubled formats in sr_*_RS locales and nonsense md_order t= here too. > >>>> > >>>> Crap I'll dig into it, thanks for spotting it. > >>>> > >>>> Best regards, > >>>> Bapt > >>> > >>> Should be fixed by: > >>> https://people.freebsd.org/~bapt/locale-triple-components.diff > >>> > >>> The perl script generating the locales was badly handling locales wit= h 3 > >>> components, fixed now. > >>> > >>> Sorry about that > >>> > >>> Best regards, > >>> Bapt > >>> > >> > >> sr locales are badly named before anything else, proper format is > >> language[_COUNTRY][.encoding][@variant] > >> I.e. > >> sr_RS.UTF-8@Latn > >> sr_RS.ISO8859-2@Latn > >> sr_RS.ISO8859-t@Cyrl > >> > >> I don't know, if out utilities (f.e. locale(1)) can handle @variant su= ffix. > >> > >> > > =3Dsr_RS.ISO8859-5@Cyrl > > =3Dour, and not utilities only but libc too >=20 > Since right now we have only single @variant per each encoding, and no > @variant for other locales, we can just drop it and use right names like: > sr_RS.UTF-8 We have 2 for the above the Cyrl version and the Latn version > sr_RS.ISO8859-2 > sr_RS.ISO8859-5 We can make aliases easily for that is that is what people want, not the we= have the same for other locales: zh_Hans_CN.GB18030 zh_Hans_CN.GB2312 zh_Hans_CN.GBK zh_Hans_CN.UTF-8 zh_Hans_CN.eucCN zh_Hant_HK.UTF-8 zh_Hant_TW.Big5 zh_Hant_TW.UTF-8 With some aliases for some of the previously existing ones: zh_TW.Big5 zh_TW.UTF-8 zh_CN.GB18030 zh_CN.GB2312 zh_CN.GBK zh_CN.UTF-8 zh_CN.eucCN zh_HK.UTF-8 Some of the new locales (that didn't exist before) I have only imported the= new name format: kk_Cyrl_KZ.UTF-8 mn_Cyrl_MN.UTF-8 sr_Cyrl_RS.ISO8859-5 sr_Cyrl_RS.UTF-8 sr_Latn_RS.ISO8859-2 sr_Latn_RS.UTF-8 I would prefer staying on the new syntax given it is allowed by some RFC an= d it is slowly being adopted everywhere else. Btw another RFC: https://www.ietf.org/rfc/rfc5646.txt Best regards, Bapt --imdvuh4tgkvycob7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXZtH9AAoJEGOJi9zxtz5atOwP/jF5+B26EI6I0w3pafvZDbQz 9ZPLoJxWBxKEoX2y57IPOGlbSZfMf3j0OEyEUuZHMxCTO6M8lETmD/GoNOG5m2x2 txuZctZ77wJo5IQChu5MWTLYXeDi8jr0HJvKyAngkN8dJxBbDyjPQFHZPcqh8AKZ ULSBH0MakGKzAXrgwAZf7uv+52JWO+cO5YV8uyqkXWWwlma7UnrrqaEKR5zvqx59 NZ3fxz8a2AQazxQcepnh55sflUBkPRX0ycFrMpUWf4a4lJvub15oKHxfEW8lO3DY AJzNI4nXdyZFV6K7r280AaaK+CVaC2hmVZJQ/Poob+R5wkVF5fnQoBouVizKRMQw 7lfJmGlA4x+hMulsv60bNhjmQLWXj8pqr3RbFFvQxN/1oCUKZxRIUcInqNxbJkE7 CfBcDlcTDdImIZ57ORdKMNVJyp6q0g34t6oXr0blNXsANB+7FHSIGcvQgXnafTVi O0NiPxfnvAng1m6rUaB7XD4NAVekgPAqdVy4QPPRmEq8TlRWUSQNqiHNYX/kkLbJ opxIb47ofmPWf2BPujcGPRSuTkEaSLrXHFfSYAcnEKN9igRRCN0G9iVGGE492Or5 PD3uQy7Y2KRG4x0jtrfiBZXOvwrQyHSuDTyRz0rCf2eD32fG+V1JN+5mqmaBzTcv v/PsstkK1c2NPOiTjO8l =/nxt -----END PGP SIGNATURE----- --imdvuh4tgkvycob7-- From owner-svn-src-head@freebsd.org Sun Jun 19 17:16:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04D37A7A67B for ; Sun, 19 Jun 2016 17:16:59 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (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 7B5E9288D for ; Sun, 19 Jun 2016 17:16:58 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f47.google.com with SMTP id l188so24850918lfe.2 for ; Sun, 19 Jun 2016 10:16:58 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=KxseqSs9p8RhPX+r7OHyvsrlV2G92pWdL5+avZ3YuFM=; b=XIHuL9W6OTk5CoWo03wQ3RBsDFJJ9oocnZyiYb2cqliyUiyKKzO4HsEMqzC2ZyR6oy u4RpTW1HhC+aWYCH2t0814DJNbDnglmQSBWPEnMLdYcImAQcq9BKdUswxPJsn5nLyxFc FV/KRJU+GYRpSsGxqwfS91QuOsQRwTIHb5zGVoBKRe3SG28DURMGZvC869KFX/ticSN7 0JfUNPSgwhquE87AKgw/bwRzLVjvoMNqjYNEo9O7CyRxgRzqDrTbALJd6n0FSAX3oBKb /nuxlx9xHjGY72qrbuU48t9DrAMUD/TtU6IlhR3T5ZLRlPNKMRlcHqosMLHrpKYvDyBm gwfg== X-Gm-Message-State: ALyK8tKDh8n9N5noMNWIkMA28T4rWTmi842aQxAYFrkxNEM4kfx4TlVJkJszO1YE6Snuzg== X-Received: by 10.25.148.200 with SMTP id w191mr518788lfd.2.1466356616240; Sun, 19 Jun 2016 10:16:56 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id o93sm5308824lfi.5.2016.06.19.10.16.55 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2016 10:16:55 -0700 (PDT) Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools To: Baptiste Daroussin References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> <20160619170538.qt2kmzr5fo34ekvj@ivaldir.etoilebsd.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO From: Andrey Chernov Message-ID: <73ce250f-71f6-7bde-9340-e6b6bf7ce749@freebsd.org> Date: Sun, 19 Jun 2016 20:16:54 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160619170538.qt2kmzr5fo34ekvj@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="9Chb07Aorhm3nSW9RXFxUV8wR4owxwHAV" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 17:16:59 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --9Chb07Aorhm3nSW9RXFxUV8wR4owxwHAV Content-Type: multipart/mixed; boundary="flFCXQtdfuMgdi61K12UDpQaNU4Tbi9O3" From: Andrey Chernov To: Baptiste Daroussin Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Message-ID: <73ce250f-71f6-7bde-9340-e6b6bf7ce749@freebsd.org> Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> <20160619170538.qt2kmzr5fo34ekvj@ivaldir.etoilebsd.net> In-Reply-To: <20160619170538.qt2kmzr5fo34ekvj@ivaldir.etoilebsd.net> --flFCXQtdfuMgdi61K12UDpQaNU4Tbi9O3 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 19.06.2016 20:05, Baptiste Daroussin wrote: > On Sun, Jun 19, 2016 at 07:47:27PM +0300, Andrey Chernov wrote: >> On 19.06.2016 18:49, Baptiste Daroussin wrote: >>> On Sun, Jun 19, 2016 at 04:52:34PM +0200, Baptiste Daroussin wrote: >>>> On Sun, Jun 19, 2016 at 07:57:49AM +0300, Andrey Chernov wrote: >>>>> On 19.06.2016 6:44, Hajimu UMEMOTO wrote: >>>>>> Log: >>>>>> - Prefer to use %d over %e where the day of the month should be = zero >>>>>> filled. >>>>>> - Since %e means the day of the month as well, regard %e as same= as %d >>>>>> in md_order. >>>>> >>>>> Nonsense doubled formats in sr_*_RS locales and nonsense md_order t= here too. >>>> >>>> Crap I'll dig into it, thanks for spotting it. >>>> >>>> Best regards, >>>> Bapt >>> >>> Should be fixed by: >>> https://people.freebsd.org/~bapt/locale-triple-components.diff >>> >>> The perl script generating the locales was badly handling locales wit= h 3 >>> components, fixed now. >>> >>> Sorry about that >>> >>> Best regards, >>> Bapt >>> >> >> sr locales are badly named before anything else, proper format is >> language[_COUNTRY][.encoding][@variant] >> I.e. >> sr_RS.UTF-8@Latn >> sr_RS.ISO8859-2@Latn >> sr_RS.ISO8859-t@Cyrl >=20 > According to what? >> >> I don't know, if out utilities (f.e. locale(1)) can handle @variant su= ffix. >> > Our syntax is the syntax for the variants that has been the widly adopt= ed: > Microsoft, ICU, java, python's babel internationalisation thing, > cldr (of course), CPAN components (Datime::Locales for example) >=20 > This is respecting RFC 3066 with the little difference that we use '_' = instead > of '-' >=20 > Best regards, > Bapt >=20 According to POSIX, but I can't find the reference right now, it is related to XPG3 or XPG4. It was already many years. First reference from Google http://www.boost.org/doc/libs/1_60_0/libs/locale/doc/html/locale_gen.html= Next from Gentoo: https://wiki.gentoo.org/wiki/Localization/Guide Microsoft, Linux and GNU iconv understand @-syntax --flFCXQtdfuMgdi61K12UDpQaNU4Tbi9O3-- --9Chb07Aorhm3nSW9RXFxUV8wR4owxwHAV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXZtOGAAoJEKUckv0MjfbKtiAH/RO4AWLQDvdvUHsIyi8amFDM QdsZjWAcW3ZBwLp0T7FRQLh6Et197pVJ4jaPIApR0Z5ALTg41H0ZWYsqy19iktbE tkC8rxj3fqWctkwnxnHVGeAuk8FQ5uV8GI1hffjMsVqYc7adovqO1gcIkBiGS9ZQ qqTZ1e/aoPjENbno1X5KwuA/ZpY3YYyesGB0/x8513L9h1mLM6jiaD2+pbcHhX6k kqeI7tHjihgB8aOYMz5to8LiRZ4KbzCEiyG3iMj+Y4QjFYdBqTfxl9+2hNK4pt65 PQOrDw2nGs2PwKKlUYdM+ER44BtF+QX93RdIqdXsqsOvO9QCJgAE0+aoiIJKc9U= =vXYA -----END PGP SIGNATURE----- --9Chb07Aorhm3nSW9RXFxUV8wR4owxwHAV-- From owner-svn-src-head@freebsd.org Sun Jun 19 17:19:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D523A7A744; Sun, 19 Jun 2016 17:19:38 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x242.google.com (mail-wm0-x242.google.com [IPv6:2a00:1450:400c:c09::242]) (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 DBE772A01; Sun, 19 Jun 2016 17:19:37 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x242.google.com with SMTP id 187so8922501wmz.1; Sun, 19 Jun 2016 10:19:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Uoh/iEoW4Qb3yOet5UgpmAem8U8Tlu1aw1/5rwYyZZc=; b=IwncSFsn51y6ZARx3X9hKwuELr0elfilYxIlqecaqSUEohwIBFHblpGmuJIvnQCO5F Lco2V0I295B3h688lPfX32LsW7+kXs/JEDdT2g1AHyJi94hrSW1pwzk3sHakb5BboSBq Ix34O8N42I+Mbr3uQm5HTOkFL6tNw8LXvraLznOGmN7SLYVDTxR5b3Eiuhs2ZBsGXLqd 4EdT+U8HeBLe2H/bt7pOZUQ/icO2BUgSma9681ShMpRmsswHBSb8jnNVL9RlD8Q8/HlH ortl93QYt/lUvodGKhaGCUzSiu4xtmQwqOVZFzf2KN1moIlJrjwCiN9mio/0pob5WQUl HrmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Uoh/iEoW4Qb3yOet5UgpmAem8U8Tlu1aw1/5rwYyZZc=; b=cLOitJHVLI6XPjBmHOewJ8dBwaudhyocoH10wzXH2+G/TaOgoaCKJUfMSlsSF1J1L1 zXUL0xfGHSc0ni8dO2WZqJghou/yitPUSn/YxC7jmskaDhozvxjRBJivKMIEHMclncFg uULNckPKnwK03JqixiRN/enOPVABBt3voruV/u3nb+zX1qojDKbZpUQ1y3hVK0SpHu0u X8+pRs9qA3vqDI+Zembw4HMqQah5zAnXUswCRRYPvmup4F+orSARAlIODiIo29ilv07V hDhoXAbZLTHHO+Ry0j1aIWJ4YAJOpVU4GUhFAghEVlWMWn29/7qAxyjPfPNV7b4ZSvlQ cBHA== X-Gm-Message-State: ALyK8tLnXs8kcZmtFoCy/Pl5uXAGM+Nsi30PWuBoy5Nt8GOHWiC2Od/PpeWNkHsRSYOUvg== X-Received: by 10.28.140.194 with SMTP id o185mr7071079wmd.86.1466356776371; Sun, 19 Jun 2016 10:19:36 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id v200sm9364734wmv.4.2016.06.19.10.19.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Jun 2016 10:19:35 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 19 Jun 2016 19:19:34 +0200 From: Baptiste Daroussin To: Andrey Chernov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools Message-ID: <20160619171934.5hxchhcvrbhhxvti@ivaldir.etoilebsd.net> References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> <20160619170538.qt2kmzr5fo34ekvj@ivaldir.etoilebsd.net> <73ce250f-71f6-7bde-9340-e6b6bf7ce749@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fkepdmjy6vfsgsuy" Content-Disposition: inline In-Reply-To: <73ce250f-71f6-7bde-9340-e6b6bf7ce749@freebsd.org> User-Agent: Mutt/1.6.1-neo (2016-06-11) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 17:19:38 -0000 --fkepdmjy6vfsgsuy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 19, 2016 at 08:16:54PM +0300, Andrey Chernov wrote: > On 19.06.2016 20:05, Baptiste Daroussin wrote: > > On Sun, Jun 19, 2016 at 07:47:27PM +0300, Andrey Chernov wrote: > >> On 19.06.2016 18:49, Baptiste Daroussin wrote: > >>> On Sun, Jun 19, 2016 at 04:52:34PM +0200, Baptiste Daroussin wrote: > >>>> On Sun, Jun 19, 2016 at 07:57:49AM +0300, Andrey Chernov wrote: > >>>>> On 19.06.2016 6:44, Hajimu UMEMOTO wrote: > >>>>>> Log: > >>>>>> - Prefer to use %d over %e where the day of the month should be = zero > >>>>>> filled. > >>>>>> - Since %e means the day of the month as well, regard %e as same= as %d > >>>>>> in md_order. > >>>>> > >>>>> Nonsense doubled formats in sr_*_RS locales and nonsense md_order t= here too. > >>>> > >>>> Crap I'll dig into it, thanks for spotting it. > >>>> > >>>> Best regards, > >>>> Bapt > >>> > >>> Should be fixed by: > >>> https://people.freebsd.org/~bapt/locale-triple-components.diff > >>> > >>> The perl script generating the locales was badly handling locales wit= h 3 > >>> components, fixed now. > >>> > >>> Sorry about that > >>> > >>> Best regards, > >>> Bapt > >>> > >> > >> sr locales are badly named before anything else, proper format is > >> language[_COUNTRY][.encoding][@variant] > >> I.e. > >> sr_RS.UTF-8@Latn > >> sr_RS.ISO8859-2@Latn > >> sr_RS.ISO8859-t@Cyrl > >=20 > > According to what? > >> > >> I don't know, if out utilities (f.e. locale(1)) can handle @variant su= ffix. > >> > > Our syntax is the syntax for the variants that has been the widly adopt= ed: > > Microsoft, ICU, java, python's babel internationalisation thing, > > cldr (of course), CPAN components (Datime::Locales for example) > >=20 > > This is respecting RFC 3066 with the little difference that we use '_' = instead > > of '-' > >=20 > > Best regards, > > Bapt > >=20 >=20 > According to POSIX, but I can't find the reference right now, it is > related to XPG3 or XPG4. It was already many years. > First reference from Google > http://www.boost.org/doc/libs/1_60_0/libs/locale/doc/html/locale_gen.html > Next from Gentoo: > https://wiki.gentoo.org/wiki/Localization/Guide > Microsoft, Linux and GNU iconv understand @-syntax >=20 >=20 As soon as our libc and locale tool support it we can make aliases to suppo= rt both syntax Best regards, Bapt --fkepdmjy6vfsgsuy Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXZtQlAAoJEGOJi9zxtz5axGwQAM6N/UorjrdVO1iPAAsvNiNR RsCxmMGj+38WO7m4THozi0ryUaF4bDbS4yDNo5kkwuir8YMsPxjjrFg8M0fA5WZF 0JN4ljLDlh59ZOZuEvOssBB1gNVxoG5ElW+YArxv7M9BoKck0Omdx1liRjCbc2B6 1Y2qmh6T0IMOl5TOtpezpT6hIs9uCn2GzS66XpnQ0yXSsvnqtd+xb3QzAbM0f+aY 491dxmcczdy3vqicJmfVFH2P27UmyD67DWw6KyIfgwKCKMGrm2PtsRIiMJ/XdpVD pZ689njw5jLwCwFz71OOBfceLUHyT+e4nURLKZ/0zTlS5wjK3jrb/gcm9Hm/8rJd AAaveN9VY3SXvn7hkEicpb5QefRd/MfcoWS7Qw1gs7QuL0AFcrKHjiWisqV3R973 3DoCpCvse1qPCouH5ISq0ONRITTC6SDBhb7lvBt9ZiwaVTzDPkrrRIje3hxM45/7 2dz0L6rgw4SoQ2DQaA79FEAT5g6j+/CjM8NzAfrjcfoLsSO6PiMOoLOvajpSAvG7 xzredNs4Lua3KpsTyFDz0YCXNNgT+yO7xTSbJby5dauZWDOx8UB3O97fTiNRSRGV uR/98rodkiN8ObLKg+IxG/gG7lK2VGhKg2X6zvwY0bsPiw2He6Ma+hXj6rGNb6dI c1FrKgpMbGKYPehiJYoC =VA8Q -----END PGP SIGNATURE----- --fkepdmjy6vfsgsuy-- From owner-svn-src-head@freebsd.org Sun Jun 19 17:21:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2989DA7A7DA for ; Sun, 19 Jun 2016 17:21:40 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f54.google.com (mail-lf0-f54.google.com [209.85.215.54]) (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 97D2C2D2F for ; Sun, 19 Jun 2016 17:21:39 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f54.google.com with SMTP id l188so24885912lfe.2 for ; Sun, 19 Jun 2016 10:21:39 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=B6glWHyYP+n71RtPFxB53Zk1Q5RSBDu7IsUKLQiB76s=; b=j3tDg1aqKJjoe0Z51P2bmIaEFnGEhOTFO/Hyg9NJmZmUGusKAAu7ddk94BWeSDWb5l LIY4c8RUz1s8uqS9jlnWUo5Uw1whjllpSmW1SBRVglfqsDgRZJXkuycz//uuzdTtEw0a L5szav4ASmKsFARzVA2BJv7ZROPmSOSAHXkjo0heBdjPLZVupNquWRy0qkY5m4HpGJOI M4mluDG4cxDZ9qxdAOK9G9Q2d7cci/jMAAEQxa2NZ1iig0pzSBvPeAkr05j4rPIPiNK8 FgxeL5tsr3HlRZsVeWJJn6gad9BVlQkaP2u+CqAc2eU9ll+8OT4wjRK+p7xfQkkcMAVB nIYA== X-Gm-Message-State: ALyK8tKnXxuko+2uT0JKqwhg+f2lGnaXF0gGtpl15ZWm2YI204q7hlL56xz6KsLR2mG5DA== X-Received: by 10.25.26.194 with SMTP id a185mr2526427lfa.156.1466356897382; Sun, 19 Jun 2016 10:21:37 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id l138sm783043lfb.22.2016.06.19.10.21.36 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2016 10:21:36 -0700 (PDT) Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools To: Baptiste Daroussin References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> <77076d87-41ad-0cce-c703-ed9cef1bdb8b@freebsd.org> <20160619171021.7ps2te7wgoxfqznv@ivaldir.etoilebsd.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO From: Andrey Chernov Message-ID: Date: Sun, 19 Jun 2016 20:21:35 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160619171021.7ps2te7wgoxfqznv@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6m75Ost4vG0OV8lve34fUTm0HoOHsRVin" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 17:21:40 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6m75Ost4vG0OV8lve34fUTm0HoOHsRVin Content-Type: multipart/mixed; boundary="ljhoxWrLxihoE186QEtis6QLrjBEkHmPC" From: Andrey Chernov To: Baptiste Daroussin Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Message-ID: Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> <77076d87-41ad-0cce-c703-ed9cef1bdb8b@freebsd.org> <20160619171021.7ps2te7wgoxfqznv@ivaldir.etoilebsd.net> In-Reply-To: <20160619171021.7ps2te7wgoxfqznv@ivaldir.etoilebsd.net> --ljhoxWrLxihoE186QEtis6QLrjBEkHmPC Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 19.06.2016 20:10, Baptiste Daroussin wrote: > On Sun, Jun 19, 2016 at 08:05:30PM +0300, Andrey Chernov wrote: >> On 19.06.2016 19:52, Andrey Chernov wrote: >>> On 19.06.2016 19:47, Andrey Chernov wrote: >>>> On 19.06.2016 18:49, Baptiste Daroussin wrote: >>>>> On Sun, Jun 19, 2016 at 04:52:34PM +0200, Baptiste Daroussin wrote:= >>>>>> On Sun, Jun 19, 2016 at 07:57:49AM +0300, Andrey Chernov wrote: >>>>>>> On 19.06.2016 6:44, Hajimu UMEMOTO wrote: >>>>>>>> Log: >>>>>>>> - Prefer to use %d over %e where the day of the month should b= e zero >>>>>>>> filled. >>>>>>>> - Since %e means the day of the month as well, regard %e as sa= me as %d >>>>>>>> in md_order. >>>>>>> >>>>>>> Nonsense doubled formats in sr_*_RS locales and nonsense md_order= there too. >>>>>> >>>>>> Crap I'll dig into it, thanks for spotting it. >>>>>> >>>>>> Best regards, >>>>>> Bapt >>>>> >>>>> Should be fixed by: >>>>> https://people.freebsd.org/~bapt/locale-triple-components.diff >>>>> >>>>> The perl script generating the locales was badly handling locales w= ith 3 >>>>> components, fixed now. >>>>> >>>>> Sorry about that >>>>> >>>>> Best regards, >>>>> Bapt >>>>> >>>> >>>> sr locales are badly named before anything else, proper format is >>>> language[_COUNTRY][.encoding][@variant] >>>> I.e. >>>> sr_RS.UTF-8@Latn >>>> sr_RS.ISO8859-2@Latn >>>> sr_RS.ISO8859-t@Cyrl >>>> >>>> I don't know, if out utilities (f.e. locale(1)) can handle @variant = suffix. >>>> >>>> >>> =3Dsr_RS.ISO8859-5@Cyrl >>> =3Dour, and not utilities only but libc too >> >> Since right now we have only single @variant per each encoding, and no= >> @variant for other locales, we can just drop it and use right names li= ke: >> sr_RS.UTF-8 >=20 > We have 2 for the above the Cyrl version and the Latn version >=20 >> sr_RS.ISO8859-2 >> sr_RS.ISO8859-5 >=20 > We can make aliases easily for that is that is what people want, not th= e we have > the same for other locales: >=20 > zh_Hans_CN.GB18030 > zh_Hans_CN.GB2312 > zh_Hans_CN.GBK > zh_Hans_CN.UTF-8 > zh_Hans_CN.eucCN > zh_Hant_HK.UTF-8 > zh_Hant_TW.Big5 > zh_Hant_TW.UTF-8 >=20 > With some aliases for some of the previously existing ones: > zh_TW.Big5 > zh_TW.UTF-8 > zh_CN.GB18030 > zh_CN.GB2312 > zh_CN.GBK > zh_CN.UTF-8 > zh_CN.eucCN > zh_HK.UTF-8 >=20 > Some of the new locales (that didn't exist before) I have only imported= the new > name format: > kk_Cyrl_KZ.UTF-8 > mn_Cyrl_MN.UTF-8 > sr_Cyrl_RS.ISO8859-5 > sr_Cyrl_RS.UTF-8 > sr_Latn_RS.ISO8859-2 > sr_Latn_RS.UTF-8 >=20 > I would prefer staying on the new syntax given it is allowed by some RF= C and it > is slowly being adopted everywhere else. >=20 > Btw another RFC: https://www.ietf.org/rfc/rfc5646.txt >=20 > Best regards, > Bapt >=20 Old POSIX don't use RFC 5646, there are ISO-639 two-letter codes. When encodings are different, there is no needs to specify variants, they have meaning only for the same encoding. --ljhoxWrLxihoE186QEtis6QLrjBEkHmPC-- --6m75Ost4vG0OV8lve34fUTm0HoOHsRVin Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXZtSfAAoJEKUckv0MjfbKgIQIAMrDxXUpLz5SNUNkI3uSZg76 3oy0rRpDuvL3ZW2tR7iB90MEF9J2YJD+vBayC2wP4aYRlqk+XoGbkMHyjMZOzbFW vp09lD6K+kPOzkDy5xxnipvuGFQVMjOUaHhdJo8oX0KeCYq5UdcjqF4bvsDa+cQS EmPkGcTfCxh6CP51AwzulxLMzuThdgm7J1ymAurkn4Y14++H2tMca3EMnWC/WLUK Z5x9FHUq/ZYVu1jKvT/2JlH9zTEJ7AXPqVlDW67PyG1UfwYZ2Qy5r5B8Rx3iCpJn SaRm6236N/yGIr/3UaYXXiS+T2NR8AELUfsHmUy609WwVtofRvB/dvcG7lSI+AA= =TYfX -----END PGP SIGNATURE----- --6m75Ost4vG0OV8lve34fUTm0HoOHsRVin-- From owner-svn-src-head@freebsd.org Sun Jun 19 17:34:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F05EA7AAEB; Sun, 19 Jun 2016 17:34:13 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 191D8163C; Sun, 19 Jun 2016 17:34:12 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with SMTP id EgbobYWPuwsAcEgbpbCn44; Sun, 19 Jun 2016 11:34:11 -0600 X-Authority-Analysis: v=2.2 cv=U7HQNqju c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=pD_ry4oyNxEA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=qSgVzNnN3oH25cI-RzoA:9 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 4D70A13753; Sun, 19 Jun 2016 10:34:08 -0700 (PDT) Received: from slippy (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id u5JHY79U055006; Sun, 19 Jun 2016 10:34:07 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201606191734.u5JHY79U055006@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.6 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= cc: Niclas Zeising , Cy Schubert , Adrian Chadd , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r288291 - head/etc In-Reply-To: Message from =?UTF-8?Q?Jean-S=c3=a9bastien_P=c3=a9dron?= of "Sun, 19 Jun 2016 18:25:30 +0200." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 19 Jun 2016 10:34:07 -0700 X-CMAE-Envelope: MS4wfPbETxoQH9LTmmxa8OupNy2QR6ub80g8mI5pzCtS9g4IFvSQpiA/yl0cixCtwfkYl1SPOLG6W+E3b7nWF1XWErg1Ec4NwEM9Ge1mH8HqS4LVTmRw/0Xv 1qDNqR5SKuuhT97WBs7q1xwUTDIU4VbKqNbr5Y+2uB63nl2d7Cs6VcITMonneQK2gVlmNe+Iwp9q4X8K8NUPvCroXej17ZtU5ZjQ5BwUreTOmJHlYLYen2kX Ia68NTkSPqpNtHuXm41AE7OjtnYGmlGPnCAAGkWx/BrANWND9Q8ByypJIIc4xZcp0aZl4tBYzloIAcL4c2pk6HNoca/yaUl/01penrHcgHb1cyVB2yKm3/8k JAa603zmieS/HtMI76X+ueCVz9TesA== X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 17:34:13 -0000 In message , =?UTF-8?Q?Jean-S > On 19/06/2016 16:59, Niclas Zeising wrote: > > I wanted to bring this to attention, since it seems noone else has > > noticed it, or cared enough about it. It is nothing that stops me from= > > > using FreeBSD, I will just have to remember to start ddb manually, or > > run the commands in case of a panic. > > There is a bug filed to track this issue: > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D206291 > > I have the same problem because the system was installed a long time ago.= I have some older systems that have been upgraded over the years. If nobody minds, I'd like to assign this to myself, unless of course someone else wants it... -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Sun Jun 19 18:29:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5A3DA7A9D9; Sun, 19 Jun 2016 18:29:44 +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 A30012FED; Sun, 19 Jun 2016 18:29:44 +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 u5JITh9S007425; Sun, 19 Jun 2016 18:29:43 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5JIThWV007424; Sun, 19 Jun 2016 18:29:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606191829.u5JIThWV007424@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 Jun 2016 18:29:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302019 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 18:29:44 -0000 Author: kib Date: Sun Jun 19 18:29:43 2016 New Revision: 302019 URL: https://svnweb.freebsd.org/changeset/base/302019 Log: Do not access NFS data for reclaimed vnode. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (delphij) Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 19 07:31:02 2016 (r302018) +++ head/sys/fs/nfsclient/nfs_clvnops.c Sun Jun 19 18:29:43 2016 (r302019) @@ -3097,10 +3097,14 @@ nfs_advlock(struct vop_advlock_args *ap) } } if (error == 0 && ap->a_op == F_SETLK) { - /* Mark that a file lock has been acquired. */ - mtx_lock(&np->n_mtx); - np->n_flag |= NHASBEENLOCKED; - mtx_unlock(&np->n_mtx); + error = NFSVOPLOCK(vp, LK_SHARED); + if (error == 0) { + /* Mark that a file lock has been acquired. */ + mtx_lock(&np->n_mtx); + np->n_flag |= NHASBEENLOCKED; + mtx_unlock(&np->n_mtx); + NFSVOPUNLOCK(vp, 0); + } } } return (error); From owner-svn-src-head@freebsd.org Sun Jun 19 18:32:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28C6CA7AC21; Sun, 19 Jun 2016 18:32:37 +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 D44591633; Sun, 19 Jun 2016 18:32:36 +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 u5JIWaSI011044; Sun, 19 Jun 2016 18:32:36 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5JIWaNa011043; Sun, 19 Jun 2016 18:32:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606191832.u5JIWaNa011043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 19 Jun 2016 18:32:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302020 - head/sys/nlm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 18:32:37 -0000 Author: kib Date: Sun Jun 19 18:32:35 2016 New Revision: 302020 URL: https://svnweb.freebsd.org/changeset/base/302020 Log: Remote and local adv lock servers might de-synchronize (the added comment explains the plausible scenario), resulting in EDEADLK returned on the local registration attempt. Handle this by re-trying the local op [1]. On unmount, local registration abort is indicated as EINTR, abort the nlm call as well. Reported and tested by: pho Suggested and reviewed by: dfr (previous version, [1]) Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (delphij) Modified: head/sys/nlm/nlm_advlock.c Modified: head/sys/nlm/nlm_advlock.c ============================================================================== --- head/sys/nlm/nlm_advlock.c Sun Jun 19 18:29:43 2016 (r302019) +++ head/sys/nlm/nlm_advlock.c Sun Jun 19 18:32:35 2016 (r302020) @@ -713,7 +713,37 @@ nlm_record_lock(struct vnode *vp, int op newfl.l_pid = svid; newfl.l_sysid = NLM_SYSID_CLIENT | sysid; - error = lf_advlockasync(&a, &vp->v_lockf, size); + for (;;) { + error = lf_advlockasync(&a, &vp->v_lockf, size); + if (error == EDEADLK) { + /* + * Locks are associated with the processes and + * not with threads. Suppose we have two + * threads A1 A2 in one process, A1 locked + * file f1, A2 is locking file f2, and A1 is + * unlocking f1. Then remote server may + * already unlocked f1, while local still not + * yet scheduled A1 to make the call to local + * advlock manager. The process B owns lock on + * f2 and issued the lock on f1. Remote would + * grant B the request on f1, but local would + * return EDEADLK. + */ + pause("nlmdlk", 1); + /* XXXKIB allow suspend */ + } else if (error == EINTR) { + /* + * lf_purgelocks() might wake up the lock + * waiter and removed our lock graph edges. + * There is no sense in re-trying recording + * the lock to the local manager after + * reclaim. + */ + error = 0; + break; + } else + break; + } KASSERT(error == 0 || error == ENOENT, ("Failed to register NFS lock locally - error=%d", error)); } From owner-svn-src-head@freebsd.org Sun Jun 19 19:02:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C870A7A1E5 for ; Sun, 19 Jun 2016 19:02:33 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f41.google.com (mail-lf0-f41.google.com [209.85.215.41]) (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 9AFB113CF for ; Sun, 19 Jun 2016 19:02:32 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f41.google.com with SMTP id q132so25624527lfe.3 for ; Sun, 19 Jun 2016 12:02:32 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=q9sFnyRXmn8bT45xEDKzMeBH5XWcvcyHDwHRrdF5aek=; b=NvQrwglwtlPzn37EYyfR5KAEiwLf+Qz5RK52zYcT9mkSPifq8hcm0gkCcOjyHyrDqF swth7HThymrUzlGSSJa/Y34jQGLKBYoCB8GQxKZHaicrG0AvjzZO7RGAP8NT2otDcxfl nQnyqSAIArdRmABTurOPLN5Pmqf4miMRveSjsvNq8CFRe50YKubTVzSDjxRTSBr/bf+4 f/W4CnVCfJyihtmnnW3H5jZei8CsI3l88WclfZDu5oXcmCkyrhQ2WfYZyDgQJlfgvN3N AYaQ804P4FYdlfO6ZRDVp1aDEuEAX3/sdyBW4a1xcNhROo6/zdzrDKbUNcQF+I67k0Am sESg== X-Gm-Message-State: ALyK8tIl3NBlxKnMNqyHcMJfvXaKv+zhTZ0JybCAnSE3UKyv2yq/IQHxrBXNXYh3Jncdkg== X-Received: by 10.25.19.204 with SMTP id 73mr2471353lft.24.1466362948822; Sun, 19 Jun 2016 12:02:28 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id a7sm1066229lbg.31.2016.06.19.12.02.27 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2016 12:02:28 -0700 (PDT) Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools To: Baptiste Daroussin References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> <77076d87-41ad-0cce-c703-ed9cef1bdb8b@freebsd.org> <20160619171021.7ps2te7wgoxfqznv@ivaldir.etoilebsd.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO From: Andrey Chernov Message-ID: <1f579a9a-3aa4-e99b-f991-b42a1672a9b4@freebsd.org> Date: Sun, 19 Jun 2016 22:02:26 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="WoTE0oBWc3SakH7xS1VPsx0ukpJBp64nC" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 19:02:33 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --WoTE0oBWc3SakH7xS1VPsx0ukpJBp64nC Content-Type: multipart/mixed; boundary="1LAqo2a7sSKGut8OSAFBxCCJj96jGObXe" From: Andrey Chernov To: Baptiste Daroussin Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Message-ID: <1f579a9a-3aa4-e99b-f991-b42a1672a9b4@freebsd.org> Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> <77076d87-41ad-0cce-c703-ed9cef1bdb8b@freebsd.org> <20160619171021.7ps2te7wgoxfqznv@ivaldir.etoilebsd.net> In-Reply-To: --1LAqo2a7sSKGut8OSAFBxCCJj96jGObXe Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 19.06.2016 20:21, Andrey Chernov wrote: > On 19.06.2016 20:10, Baptiste Daroussin wrote: >> On Sun, Jun 19, 2016 at 08:05:30PM +0300, Andrey Chernov wrote: >>> On 19.06.2016 19:52, Andrey Chernov wrote: >>>> On 19.06.2016 19:47, Andrey Chernov wrote: >>>>> On 19.06.2016 18:49, Baptiste Daroussin wrote: >>>>>> On Sun, Jun 19, 2016 at 04:52:34PM +0200, Baptiste Daroussin wrote= : >>>>>>> On Sun, Jun 19, 2016 at 07:57:49AM +0300, Andrey Chernov wrote: >>>>>>>> On 19.06.2016 6:44, Hajimu UMEMOTO wrote: >>>>>>>>> Log: >>>>>>>>> - Prefer to use %d over %e where the day of the month should = be zero >>>>>>>>> filled. >>>>>>>>> - Since %e means the day of the month as well, regard %e as s= ame as %d >>>>>>>>> in md_order. >>>>>>>> >>>>>>>> Nonsense doubled formats in sr_*_RS locales and nonsense md_orde= r there too. >>>>>>> >>>>>>> Crap I'll dig into it, thanks for spotting it. >>>>>>> >>>>>>> Best regards, >>>>>>> Bapt >>>>>> >>>>>> Should be fixed by: >>>>>> https://people.freebsd.org/~bapt/locale-triple-components.diff >>>>>> >>>>>> The perl script generating the locales was badly handling locales = with 3 >>>>>> components, fixed now. >>>>>> >>>>>> Sorry about that >>>>>> >>>>>> Best regards, >>>>>> Bapt >>>>>> >>>>> >>>>> sr locales are badly named before anything else, proper format is >>>>> language[_COUNTRY][.encoding][@variant] >>>>> I.e. >>>>> sr_RS.UTF-8@Latn >>>>> sr_RS.ISO8859-2@Latn >>>>> sr_RS.ISO8859-t@Cyrl >>>>> >>>>> I don't know, if out utilities (f.e. locale(1)) can handle @variant= suffix. >>>>> >>>>> >>>> =3Dsr_RS.ISO8859-5@Cyrl >>>> =3Dour, and not utilities only but libc too >>> >>> Since right now we have only single @variant per each encoding, and n= o >>> @variant for other locales, we can just drop it and use right names l= ike: >>> sr_RS.UTF-8 >> >> We have 2 for the above the Cyrl version and the Latn version >> >>> sr_RS.ISO8859-2 >>> sr_RS.ISO8859-5 >> >> We can make aliases easily for that is that is what people want, not t= he we have >> the same for other locales: >> >> zh_Hans_CN.GB18030 >> zh_Hans_CN.GB2312 >> zh_Hans_CN.GBK >> zh_Hans_CN.UTF-8 >> zh_Hans_CN.eucCN >> zh_Hant_HK.UTF-8 >> zh_Hant_TW.Big5 >> zh_Hant_TW.UTF-8 >> >> With some aliases for some of the previously existing ones: >> zh_TW.Big5 >> zh_TW.UTF-8 >> zh_CN.GB18030 >> zh_CN.GB2312 >> zh_CN.GBK >> zh_CN.UTF-8 >> zh_CN.eucCN >> zh_HK.UTF-8 >> >> Some of the new locales (that didn't exist before) I have only importe= d the new >> name format: >> kk_Cyrl_KZ.UTF-8 >> mn_Cyrl_MN.UTF-8 >> sr_Cyrl_RS.ISO8859-5 >> sr_Cyrl_RS.UTF-8 >> sr_Latn_RS.ISO8859-2 >> sr_Latn_RS.UTF-8 >> >> I would prefer staying on the new syntax given it is allowed by some R= FC and it >> is slowly being adopted everywhere else. >> >> Btw another RFC: https://www.ietf.org/rfc/rfc5646.txt >> >> Best regards, >> Bapt >> >=20 > Old POSIX don't use RFC 5646, there are ISO-639 two-letter codes. When > encodings are different, there is no needs to specify variants, they > have meaning only for the same encoding. >=20 >=20 I found POSIX reference about @-syntax: [language[_territory][.codeset][@modifier]] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html It says nothing about language, territory or codeset standards. They comes from another standard, ISO 15897: "8. Natural language, as specified in ISO 639 9. Territory, as two-letter form of ISO 3166" I can't find there something about codeset/charmap standartization, but perhaps I just overlook some reference. --1LAqo2a7sSKGut8OSAFBxCCJj96jGObXe-- --WoTE0oBWc3SakH7xS1VPsx0ukpJBp64nC Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXZuxDAAoJEKUckv0MjfbKWXEH/iBBMGi43MlgKWOMwN7ufY8J e1uEjw4CnZ4qkRPqGZIJZy7tUhbVm1AOeU8A50BDDrDR/VPA+/Wdnc9VCC0u++LE Jmgd4InFxjP7QjrpOGRSkuyq3iDdPeEkFCrEiQ+p8l+2Zbs13Yp9lCOdDBlL8Kuf WYQVnWtGCcM9KWhZkWIRP0DAovC3crrRkbXUb9tq07BpVCfFnk6RxccykoXMKZwp ISa5LE45AlDEksej5CF/UYX7WByM7AEq7BAcyaI2Ai4k0NKmn+aNsE1e1vTU0m37 d3wfyG1+kOYXbYgeblZO/NNmlkbBv9uxtCNSuGEKJXkmoFs+LFNeDWKvXC6w64Q= =W+Ss -----END PGP SIGNATURE----- --WoTE0oBWc3SakH7xS1VPsx0ukpJBp64nC-- From owner-svn-src-head@freebsd.org Sun Jun 19 19:40:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24965A7AECF; Sun, 19 Jun 2016 19:40:55 +0000 (UTC) (envelope-from baptiste.daroussin@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 BA2B927FA; Sun, 19 Jun 2016 19:40:54 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x22c.google.com with SMTP id r201so35155261wme.1; Sun, 19 Jun 2016 12:40:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=WISp0Cmp79qSyT7asbuYkgcbQEbL7u3DxyWhUcF/iFk=; b=MKgdXV/EgBt8svSFjHL/W1/2AyjW4QwS5EtKVql5QadJXNGAwz2XSqZovyCoJKqWRO 7AWwWZziAvNgIM0yNWsr/WSw7pJLOFAQkDfPKD1U5Ah3FRL6ePmZvrJ30KDMKLvHbOPe +Fse2xAoOotjsfWWYAcHnSS1YvVCgNOMJ+pAp/YQ5vJ2jPNCDaZYv9MS46vHMA5DmT9R zm9g0MAe7xT2atpuok+M0Q3WJztritHFzcKtb/uePjBvHNkL/TUFJj61zO0eKjoZ96eH lcTkU11dDjG08DqBDCWb6iJLa15ZfSkJ8pf6al6sLwDoBvCQ7UKR71heLHLgYNoj4voJ xtdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=WISp0Cmp79qSyT7asbuYkgcbQEbL7u3DxyWhUcF/iFk=; b=ISjiPHBHtyPlJltBq8wiR+wvYEkMzP7+2vTy40LLFWjOqzkXeKvzle386ylsa3iEO6 MyEHoBAfj/Xb14o+626vN/h5bH0eI6mNIQVvZPgnOpJ22bxf7R5fETUs3lxj7XqHmB7i 05GLyPgPCEsCXREkNdVuOznXCHvML2EtBOPcNUYji+crIFBRCiTipDwfkU6vTOy5j0I5 iUp9NGIGLtqqbISzZ3v3jI5g3PbZNp0Mdk1igaEkQNHDy1118aR5XniOBaEGpH24Z6p1 RegTYvuL/jfSQ4/KpVjdy4cztktH8VlM3eREek+uea37mrwyieAcrveKGKvxdW3yi80S nTuw== X-Gm-Message-State: ALyK8tK8AtbjAr8IfGm6OvvCG+x+vbUgCpI06T8VcjiAfG0OEBA2jiXv9gapPzIRTWR9QQ== X-Received: by 10.28.25.134 with SMTP id 128mr3098254wmz.16.1466365253230; Sun, 19 Jun 2016 12:40:53 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id w76sm9847792wmd.11.2016.06.19.12.40.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Jun 2016 12:40:52 -0700 (PDT) Sender: Baptiste Daroussin Date: Sun, 19 Jun 2016 21:40:51 +0200 From: Baptiste Daroussin To: Andrey Chernov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools Message-ID: <20160619194051.w4dueeutrgtjcfuf@ivaldir.etoilebsd.net> References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> <77076d87-41ad-0cce-c703-ed9cef1bdb8b@freebsd.org> <20160619171021.7ps2te7wgoxfqznv@ivaldir.etoilebsd.net> <1f579a9a-3aa4-e99b-f991-b42a1672a9b4@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="q2c376tbb6u7dqvn" Content-Disposition: inline In-Reply-To: <1f579a9a-3aa4-e99b-f991-b42a1672a9b4@freebsd.org> User-Agent: Mutt/1.6.1-neo (2016-06-11) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 19:40:55 -0000 --q2c376tbb6u7dqvn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jun 19, 2016 at 10:02:26PM +0300, Andrey Chernov wrote: > On 19.06.2016 20:21, Andrey Chernov wrote: > > On 19.06.2016 20:10, Baptiste Daroussin wrote: > >> On Sun, Jun 19, 2016 at 08:05:30PM +0300, Andrey Chernov wrote: > >>> On 19.06.2016 19:52, Andrey Chernov wrote: > >>>> On 19.06.2016 19:47, Andrey Chernov wrote: > >>>>> On 19.06.2016 18:49, Baptiste Daroussin wrote: > >>>>>> On Sun, Jun 19, 2016 at 04:52:34PM +0200, Baptiste Daroussin wrote: > >>>>>>> On Sun, Jun 19, 2016 at 07:57:49AM +0300, Andrey Chernov wrote: > >>>>>>>> On 19.06.2016 6:44, Hajimu UMEMOTO wrote: > >>>>>>>>> Log: > >>>>>>>>> - Prefer to use %d over %e where the day of the month should = be zero > >>>>>>>>> filled. > >>>>>>>>> - Since %e means the day of the month as well, regard %e as s= ame as %d > >>>>>>>>> in md_order. > >>>>>>>> > >>>>>>>> Nonsense doubled formats in sr_*_RS locales and nonsense md_orde= r there too. > >>>>>>> > >>>>>>> Crap I'll dig into it, thanks for spotting it. > >>>>>>> > >>>>>>> Best regards, > >>>>>>> Bapt > >>>>>> > >>>>>> Should be fixed by: > >>>>>> https://people.freebsd.org/~bapt/locale-triple-components.diff > >>>>>> > >>>>>> The perl script generating the locales was badly handling locales = with 3 > >>>>>> components, fixed now. > >>>>>> > >>>>>> Sorry about that > >>>>>> > >>>>>> Best regards, > >>>>>> Bapt > >>>>>> > >>>>> > >>>>> sr locales are badly named before anything else, proper format is > >>>>> language[_COUNTRY][.encoding][@variant] > >>>>> I.e. > >>>>> sr_RS.UTF-8@Latn > >>>>> sr_RS.ISO8859-2@Latn > >>>>> sr_RS.ISO8859-t@Cyrl > >>>>> > >>>>> I don't know, if out utilities (f.e. locale(1)) can handle @variant= suffix. > >>>>> > >>>>> > >>>> =3Dsr_RS.ISO8859-5@Cyrl > >>>> =3Dour, and not utilities only but libc too > >>> > >>> Since right now we have only single @variant per each encoding, and no > >>> @variant for other locales, we can just drop it and use right names l= ike: > >>> sr_RS.UTF-8 > >> > >> We have 2 for the above the Cyrl version and the Latn version > >> > >>> sr_RS.ISO8859-2 > >>> sr_RS.ISO8859-5 > >> > >> We can make aliases easily for that is that is what people want, not t= he we have > >> the same for other locales: > >> > >> zh_Hans_CN.GB18030 > >> zh_Hans_CN.GB2312 > >> zh_Hans_CN.GBK > >> zh_Hans_CN.UTF-8 > >> zh_Hans_CN.eucCN > >> zh_Hant_HK.UTF-8 > >> zh_Hant_TW.Big5 > >> zh_Hant_TW.UTF-8 > >> > >> With some aliases for some of the previously existing ones: > >> zh_TW.Big5 > >> zh_TW.UTF-8 > >> zh_CN.GB18030 > >> zh_CN.GB2312 > >> zh_CN.GBK > >> zh_CN.UTF-8 > >> zh_CN.eucCN > >> zh_HK.UTF-8 > >> > >> Some of the new locales (that didn't exist before) I have only importe= d the new > >> name format: > >> kk_Cyrl_KZ.UTF-8 > >> mn_Cyrl_MN.UTF-8 > >> sr_Cyrl_RS.ISO8859-5 > >> sr_Cyrl_RS.UTF-8 > >> sr_Latn_RS.ISO8859-2 > >> sr_Latn_RS.UTF-8 > >> > >> I would prefer staying on the new syntax given it is allowed by some R= FC and it > >> is slowly being adopted everywhere else. > >> > >> Btw another RFC: https://www.ietf.org/rfc/rfc5646.txt > >> > >> Best regards, > >> Bapt > >> > >=20 > > Old POSIX don't use RFC 5646, there are ISO-639 two-letter codes. When > > encodings are different, there is no needs to specify variants, they > > have meaning only for the same encoding. > >=20 > >=20 >=20 > I found POSIX reference about @-syntax: > [language[_territory][.codeset][@modifier]] > http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html > It says nothing about language, territory or codeset standards. >=20 > They comes from another standard, ISO 15897: > "8. Natural language, as specified in ISO 639 > 9. Territory, as two-letter form of ISO 3166" > I can't find there something about codeset/charmap standartization, but > perhaps I just overlook some reference. >=20 Thanks a lot for that reference I wonder how I failed at finding it, I read twice the locale definition in opengroup documents. I have found yet proof in the code, but from my testings (using nl_langinfo= ()) I can see that the @modifier is properly supported. I have 2 proposal then: 1/ Keep the current version and add aliases with "@" for the one in variants 2/ Rename all the variants we have now into the POSIX version with "@" What do you think? Best regards, Bapt --q2c376tbb6u7dqvn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXZvUnAAoJEGOJi9zxtz5a2dcP/2+VFqGafUG6o7XnZ9rNSx+f DynRmTSbSgo0Uv/EEPOSkbTqvGg/lWgiL1+YxfX2aO++3rBQqLsS7McjBcUwYwPg cg1rkfZRhOPne3YT6YOlWs4nL3DWq5EUXiKX5R15mnQHxQQgkfF7aa5lhW746sgR K7ieDx6e1Jvt8KlZhvbgBpLiLYeaMbyxWqlyFNT5tEE2CYgwT9bhkRY7N6XkQ+le 74dU+UXW0gF1rAn5tDG9JwJvQ+cLH5x3cmf5gVaDiLPgOIOj3pZ/MtGrasWZDkua llqgVpGnQDBtgH7XLPhpIF/lH0227Di8e7OvYYFSRy5jQ3BCb6d9wOJEZJoPLi/K Stm5ejgLZfZu4l9u/pgAaCerjVv/iImHlHVXRL6IJwo4R+rMNxlkV1AmYPNrezZx f1EkRtDjRc7xLk7STg31GSMNoOgPgTl2lsZ85N/o3ttjSFjh2vFfMjwz8HEjqRL0 tf9weDPukIonqNBuQ5pCcLBp78I62kIxPg3+V+2oCdHr9zcbRKCieFocVLS7j1kt gqvDWxJWSbOKSfqJhXU/qJ1Aarp7CT82fIh7C1JBiCFd9FZA4qeQ5vKuytDkHNJw WGyikuET06nVcfcL2aopiW8Ykk0yu8jPxUkvpyUbfJSwmssO4JUSEmJrRmOGSXIe i8jb2c1QHy9RlWGsGt77 =X0qN -----END PGP SIGNATURE----- --q2c376tbb6u7dqvn-- From owner-svn-src-head@freebsd.org Sun Jun 19 19:52:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6899FA7915D; Sun, 19 Jun 2016 19:52:04 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [5.9.78.60]) by mx1.freebsd.org (Postfix) with ESMTP id 9F7552E5E; Sun, 19 Jun 2016 19:52:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from [IPv6:2a02:2450:1023:80df:ec62:d80e:1be2:9454] (unknown [IPv6:2a02:2450:1023:80df:ec62:d80e:1be2:9454]) by mail.vx.sk (Postfix) with ESMTPSA id BA06E9DED1; Sun, 19 Jun 2016 21:52:01 +0200 (CEST) Subject: Re: svn commit: r299448 - in head/sys/cddl/contrib/opensolaris: common/acl uts/common/fs/zfs uts/common/sys To: Alexander Motin , Cy Schubert , Jan Beich , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606191428.u5JESbbs053857@slippy.cwsent.com> <49d3d34d-ba91-ebdf-497f-cbe1614bec53@FreeBSD.org> From: Martin Matuska Message-ID: Date: Sun, 19 Jun 2016 21:52:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <49d3d34d-ba91-ebdf-497f-cbe1614bec53@FreeBSD.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 19:52:04 -0000 I highly suggest dealing with this at OpenZFS: - opening an issue at Ilumos - discussing this on the developer@open-zfs.org mailing list On 19.06.2016 16:33, Alexander Motin wrote: > On 19.06.16 17:28, Cy Schubert wrote: >> In message <20160619080803.GA1638@brick>, Edward Tomasz=20 >> =3D?utf-8?Q?Napiera=3DC5=3D82 >> a?=3D writes: >>> On 0614T0232, Jan Beich wrote: >>>> Alexander Motin writes: >>>> >>>>> Author: mav >>>>> Date: Wed May 11 13:43:20 2016 >>>>> New Revision: 299448 >>>>> URL: https://svnweb.freebsd.org/changeset/base/299448 >>>>> >>>>> Log: >>>>> MFV r299442: 6762 POSIX write should imply DELETE_CHILD on direct= ories=20 >>> - and >>>>> some additional considerations >>>>> =20 >>>>> Reviewed by: Gordon Ross >>>>> Reviewed by: Yuri Pankov >>>>> Author: Kevin Crowe >>>>> =20 >>>>> openzfs/openzfs@d316fffc9c361532a482208561bbb614dac7f916 >>>> This commit confuses acl_is_trivial_np(3). Notice '+' in ls(1) and '= D' >>>> in getfacl(1) outputs. >>> It's not just that. >>> >>> Those changes: >>> >>> 1. Confuse acl_is_trivial_np(3), as you say. It's hard to fix in lib= c, >>> because they make trivial ACLs different for files and directories= , >>> and acl_is_trivial_np(3) has no way of telling which is which. >>> >>> 2. They make delete deny permission take precedence over the containi= ng >>> directory write allow permission, which is rather different from w= hat >>> people expect in unix systems, and is against the NFSv4 specificat= ion, >>> even though it might be a better fit for Windows. >> This is Windows behavior and inconsistent with the rest of FreeBSD and= any=20 >> UNIX or Linux system. >> >>> 3. They make umask apply to inherit_only permissions, and >>> >>> 4. I don't fully understand this one yet, but from the ACL regression= >>> test suite (which lives in tests/sys/acl/, and I'd appreciate peop= le >>> actually ran this before committing ACL-related changes) it looks >>> like it makes umask not apply to the stuff it should. >>> >>> The #1 could be fixed by making ZFS not setting delete_child on write= , >>> basically reverting to the previous behaviour in that aspect. As for= >>> the others... I'm not saying each one of those is wrong, but they >>> certainly warrant further discussion, especially #2 and #4. >> I think #2 is wrong behavior on any UNIX-like or POSIX system. >> >>> Basically, what I'm trying to say is that we should consider backing >>> this out for 11.0-RELEASE, reverting to the previous semantics, verif= ied >>> by passing the regression tests. >> Agreed. >> >> What in FreeBSD was this patch supposed to solve in the first place? > Growing divergence from OpenZFS upstream. I am not advocating this > patch, but it would be good, if possible, to not revert it completely, > but block wrong behavior with some minimal ifdefs to make further ZFS > merges easier. Help would be appreciated. ;) > From owner-svn-src-head@freebsd.org Sun Jun 19 23:36:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78D57A7A2B5; Sun, 19 Jun 2016 23:36:41 +0000 (UTC) (envelope-from karels@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 3B21D139D; Sun, 19 Jun 2016 23:36:41 +0000 (UTC) (envelope-from karels@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5JNaeBU022503; Sun, 19 Jun 2016 23:36:40 GMT (envelope-from karels@FreeBSD.org) Received: (from karels@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5JNaeYt022502; Sun, 19 Jun 2016 23:36:40 GMT (envelope-from karels@FreeBSD.org) Message-Id: <201606192336.u5JNaeYt022502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: karels set sender to karels@FreeBSD.org using -f From: Mike Karels Date: Sun, 19 Jun 2016 23:36:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302023 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jun 2016 23:36:41 -0000 Author: karels Date: Sun Jun 19 23:36:40 2016 New Revision: 302023 URL: https://svnweb.freebsd.org/changeset/base/302023 Log: Add Mike Karels as committer, with gnn as mentor. Approved by: gnn (mentor) Approved by: re Modified: head/share/misc/committers-src.dot Modified: head/share/misc/committers-src.dot ============================================================================== --- head/share/misc/committers-src.dot Sun Jun 19 21:29:17 2016 (r302022) +++ head/share/misc/committers-src.dot Sun Jun 19 23:36:40 2016 (r302023) @@ -212,6 +212,7 @@ julian [label="Julian Elischer\njulian@F jwd [label="John De Boskey\njwd@FreeBSD.org\n2000/05/19"] kaiw [label="Kai Wang\nkaiw@FreeBSD.org\n2007/09/26"] kan [label="Alexander Kabaev\nkan@FreeBSD.org\n2002/07/21"] +karels [label="Mike Karels\nkarels@FreeBSD.org\n2016/06/09"] ken [label="Ken Merry\nken@FreeBSD.org\n1998/09/08"] kensmith [label="Ken Smith\nkensmith@FreeBSD.org\n2004/01/23"] kevlo [label="Kevin Lo\nkevlo@FreeBSD.org\n2006/07/23"] @@ -481,6 +482,7 @@ gnn -> arybchik gnn -> erj gnn -> kp gnn -> jtl +gnn -> karels gonzo -> jmcneill From owner-svn-src-head@freebsd.org Mon Jun 20 02:04:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9327EA79FAE; Mon, 20 Jun 2016 02:04:41 +0000 (UTC) (envelope-from adrian@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 4F39B2833; Mon, 20 Jun 2016 02:04:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5K24eUE077101; Mon, 20 Jun 2016 02:04:40 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5K24eph077100; Mon, 20 Jun 2016 02:04:40 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606200204.u5K24eph077100@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 20 Jun 2016 02:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302024 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 02:04:41 -0000 Author: adrian Date: Mon Jun 20 02:04:40 2016 New Revision: 302024 URL: https://svnweb.freebsd.org/changeset/base/302024 Log: [ath] fix EDMA TX buffer flags for use when retransmitting frames. This started showing up when doing lots of aggregate traffic. For TDMA it's always no-ACK traffic and I didn't notice this, and I didn't notice it when doing 11abg traffic as it didn't fail enough in a bad way to trigger this. This showed up as the fifo depth being < 0. Eg: Jun 19 09:23:07 gertrude kernel: ath0: ath_tx_edma_push_staging_list: queued 2 packets; depth=2, fifo depth=1 Jun 19 09:23:07 gertrude kernel: ath0: ath_edma_tx_processq: Q1, bf=0xfffffe000385f068, start=1, end=1 Jun 19 09:23:07 gertrude kernel: ath0: ath_edma_tx_processq: Q1: FIFO depth is now 0 (1) Jun 19 09:23:07 gertrude kernel: ath0: ath_edma_tx_processq: Q1, bf=0xfffffe0003866fe8, start=0, end=1 Jun 19 09:23:07 gertrude kernel: ath0: ath_edma_tx_processq: Q1: FIFO depth is now -1 (0) So, clear the flags before adding them to a TX queue, so if they're re-added for the retransmit path it'll clear whatever they were and not double-account the FIFOEND flag. Oops. Tested: * AR9380, STA mode, 11n iperf testing (~130mbit) Approved by: re (delphij) Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Sun Jun 19 23:36:40 2016 (r302023) +++ head/sys/dev/ath/if_ath_tx_edma.c Mon Jun 20 02:04:40 2016 (r302024) @@ -192,6 +192,9 @@ ath_tx_edma_push_staging_list(struct ath /* Queue it into our staging list */ TAILQ_INSERT_TAIL(&sq, bf, bf_list); + + /* Ensure the flags are cleared */ + bf->bf_flags &= ~(ATH_BUF_FIFOPTR | ATH_BUF_FIFOEND); sqdepth++; } From owner-svn-src-head@freebsd.org Mon Jun 20 02:57:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34110A7B898 for ; Mon, 20 Jun 2016 02:57:13 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (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 8A9E31CE8 for ; Mon, 20 Jun 2016 02:57:12 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f48.google.com with SMTP id f6so29148565lfg.0 for ; Sun, 19 Jun 2016 19:57:11 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=tk5HI0dkrq3Y39Z+zcRtseY3wLt1rKNaFGzZKEyd/Vw=; b=DAgUzvvv9LMFYf+Pvbzo1SRkiT78OAqffwyX9EZXtk0/xr1TQ5rZmfcQvnJCcIS88+ RpN5IIEensqQ8VuGhFzSaLrTBVTqI8BVSaCH9ZSn0rHFIXIN06UcCRUOILnM0B/CJMUV sgJGqQphbx5hBkuLzXQMMY6vI2lNFqlWgcrrh8gzAMktAGaY/G5EqwB2iVc6/3qeRlum XSoW4OXRl2zihiunF9y0nq0IqyAMYIki62bRn87g3LwUKSF7mF0iKaA+LIoQCfRKyTf0 HEKn8qEr/1Vxw2FYvRa/GVOSlhLZ66BH0bsRQucBTr39rXKJt9pVbQxgZBqo9cCLM6cZ yG7g== X-Gm-Message-State: ALyK8tLLM88rIQU83K++MC8Q7Zz9Wfz4rrYK88v/2C8cd+U58Kyw3iMao/d3htjd+PvEkA== X-Received: by 10.25.32.6 with SMTP id g6mr234052lfg.188.1466391430028; Sun, 19 Jun 2016 19:57:10 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id h73sm3219838lfe.8.2016.06.19.19.57.08 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 19 Jun 2016 19:57:09 -0700 (PDT) Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools To: Baptiste Daroussin References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> <77076d87-41ad-0cce-c703-ed9cef1bdb8b@freebsd.org> <20160619171021.7ps2te7wgoxfqznv@ivaldir.etoilebsd.net> <1f579a9a-3aa4-e99b-f991-b42a1672a9b4@freebsd.org> <20160619194051.w4dueeutrgtjcfuf@ivaldir.etoilebsd.net> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO From: Andrey Chernov Message-ID: <45daf91a-6e15-eded-03bd-9d126938b1f0@freebsd.org> Date: Mon, 20 Jun 2016 05:57:08 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160619194051.w4dueeutrgtjcfuf@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="kopswqJwNuk46FLvDUiWXhImPHw3NTB6M" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 02:57:13 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --kopswqJwNuk46FLvDUiWXhImPHw3NTB6M Content-Type: multipart/mixed; boundary="scj0p6wei9JQP1OV1fqbTtiv4IGfGFkTU" From: Andrey Chernov To: Baptiste Daroussin Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Hajimu UMEMOTO Message-ID: <45daf91a-6e15-eded-03bd-9d126938b1f0@freebsd.org> Subject: Re: svn commit: r302016 - in head: share/timedef tools/tools/locale/tools References: <201606190344.u5J3iWO6079652@repo.freebsd.org> <3387744f-7abd-417c-599f-163e78b4170e@freebsd.org> <20160619145233.kjnfyxjb75fdcucz@ivaldir.etoilebsd.net> <20160619154918.etycha7kvj4v7nrp@ivaldir.etoilebsd.net> <77076d87-41ad-0cce-c703-ed9cef1bdb8b@freebsd.org> <20160619171021.7ps2te7wgoxfqznv@ivaldir.etoilebsd.net> <1f579a9a-3aa4-e99b-f991-b42a1672a9b4@freebsd.org> <20160619194051.w4dueeutrgtjcfuf@ivaldir.etoilebsd.net> In-Reply-To: <20160619194051.w4dueeutrgtjcfuf@ivaldir.etoilebsd.net> --scj0p6wei9JQP1OV1fqbTtiv4IGfGFkTU Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 19.06.2016 22:40, Baptiste Daroussin wrote: > On Sun, Jun 19, 2016 at 10:02:26PM +0300, Andrey Chernov wrote: >> On 19.06.2016 20:21, Andrey Chernov wrote: >>> On 19.06.2016 20:10, Baptiste Daroussin wrote: >>>> On Sun, Jun 19, 2016 at 08:05:30PM +0300, Andrey Chernov wrote: >>>>> On 19.06.2016 19:52, Andrey Chernov wrote: >>>>>> On 19.06.2016 19:47, Andrey Chernov wrote: >>>>>>> On 19.06.2016 18:49, Baptiste Daroussin wrote: >>>>>>>> On Sun, Jun 19, 2016 at 04:52:34PM +0200, Baptiste Daroussin wro= te: >>>>>>>>> On Sun, Jun 19, 2016 at 07:57:49AM +0300, Andrey Chernov wrote:= >>>>>>>>>> On 19.06.2016 6:44, Hajimu UMEMOTO wrote: >>>>>>>>>>> Log: >>>>>>>>>>> - Prefer to use %d over %e where the day of the month shoul= d be zero >>>>>>>>>>> filled. >>>>>>>>>>> - Since %e means the day of the month as well, regard %e as= same as %d >>>>>>>>>>> in md_order. >>>>>>>>>> >>>>>>>>>> Nonsense doubled formats in sr_*_RS locales and nonsense md_or= der there too. >>>>>>>>> >>>>>>>>> Crap I'll dig into it, thanks for spotting it. >>>>>>>>> >>>>>>>>> Best regards, >>>>>>>>> Bapt >>>>>>>> >>>>>>>> Should be fixed by: >>>>>>>> https://people.freebsd.org/~bapt/locale-triple-components.diff >>>>>>>> >>>>>>>> The perl script generating the locales was badly handling locale= s with 3 >>>>>>>> components, fixed now. >>>>>>>> >>>>>>>> Sorry about that >>>>>>>> >>>>>>>> Best regards, >>>>>>>> Bapt >>>>>>>> >>>>>>> >>>>>>> sr locales are badly named before anything else, proper format is= >>>>>>> language[_COUNTRY][.encoding][@variant] >>>>>>> I.e. >>>>>>> sr_RS.UTF-8@Latn >>>>>>> sr_RS.ISO8859-2@Latn >>>>>>> sr_RS.ISO8859-t@Cyrl >>>>>>> >>>>>>> I don't know, if out utilities (f.e. locale(1)) can handle @varia= nt suffix. >>>>>>> >>>>>>> >>>>>> =3Dsr_RS.ISO8859-5@Cyrl >>>>>> =3Dour, and not utilities only but libc too >>>>> >>>>> Since right now we have only single @variant per each encoding, and= no >>>>> @variant for other locales, we can just drop it and use right names= like: >>>>> sr_RS.UTF-8 >>>> >>>> We have 2 for the above the Cyrl version and the Latn version >>>> >>>>> sr_RS.ISO8859-2 >>>>> sr_RS.ISO8859-5 >>>> >>>> We can make aliases easily for that is that is what people want, not= the we have >>>> the same for other locales: >>>> >>>> zh_Hans_CN.GB18030 >>>> zh_Hans_CN.GB2312 >>>> zh_Hans_CN.GBK >>>> zh_Hans_CN.UTF-8 >>>> zh_Hans_CN.eucCN >>>> zh_Hant_HK.UTF-8 >>>> zh_Hant_TW.Big5 >>>> zh_Hant_TW.UTF-8 >>>> >>>> With some aliases for some of the previously existing ones: >>>> zh_TW.Big5 >>>> zh_TW.UTF-8 >>>> zh_CN.GB18030 >>>> zh_CN.GB2312 >>>> zh_CN.GBK >>>> zh_CN.UTF-8 >>>> zh_CN.eucCN >>>> zh_HK.UTF-8 >>>> >>>> Some of the new locales (that didn't exist before) I have only impor= ted the new >>>> name format: >>>> kk_Cyrl_KZ.UTF-8 >>>> mn_Cyrl_MN.UTF-8 >>>> sr_Cyrl_RS.ISO8859-5 >>>> sr_Cyrl_RS.UTF-8 >>>> sr_Latn_RS.ISO8859-2 >>>> sr_Latn_RS.UTF-8 >>>> >>>> I would prefer staying on the new syntax given it is allowed by some= RFC and it >>>> is slowly being adopted everywhere else. >>>> >>>> Btw another RFC: https://www.ietf.org/rfc/rfc5646.txt >>>> >>>> Best regards, >>>> Bapt >>>> >>> >>> Old POSIX don't use RFC 5646, there are ISO-639 two-letter codes. Whe= n >>> encodings are different, there is no needs to specify variants, they >>> have meaning only for the same encoding. >>> >>> >> >> I found POSIX reference about @-syntax: >> [language[_territory][.codeset][@modifier]] >> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.htm= l >> It says nothing about language, territory or codeset standards. >> >> They comes from another standard, ISO 15897: >> "8. Natural language, as specified in ISO 639 >> 9. Territory, as two-letter form of ISO 3166" >> I can't find there something about codeset/charmap standartization, bu= t >> perhaps I just overlook some reference. >> >=20 > Thanks a lot for that reference I wonder how I failed at finding it, I = read > twice the locale definition in opengroup documents. >=20 > I have found yet proof in the code, but from my testings (using nl_lang= info()) >=20 > I can see that the @modifier is properly supported. >=20 > I have 2 proposal then: > 1/ Keep the current version and add aliases with "@" for the one in var= iants > 2/ Rename all the variants we have now into the POSIX version with "@" To minimize confusion among people and better cross-platform compatibility IMHO we need to see what Linux have here (in parts it not violates POSIX and ISO standards, of course). We have different charmap names (ISO-* vs. ISO*), and we have it already too long to change as many people thinks, but new sr and other locales can be easily set in line while they are still new. --scj0p6wei9JQP1OV1fqbTtiv4IGfGFkTU-- --kopswqJwNuk46FLvDUiWXhImPHw3NTB6M Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXZ1uEAAoJEKUckv0MjfbKyPcH/A3MaB7QuK5HlJlhX2Ta49jK 0meAEjCkMm+f0ax8yqaoXStjwZMPJKB5eLMEEWEwIMmQjnirc0ftgyomeO+eXLcQ pOItxy4nw31YtGNUs68xBMe1dELXVUHy1P/CaGd5gr1+0AlYGFpKbDgDZbDS8XU5 bipHGj6QIUUOyZIVc69puhCOrNvA6fEJ4skeT3FmYhs2+Slx9ll9qCUb3gnmEOuh TcpAzSwDD2ms3VAJ93YeXfx4GDfQCcBNvg+xJHiYXySt8mD6xTdOnwzOipAB7vpC 9lVkBKsW9WF/OBh9Jiq0Yc9SbgtHtoTpDy0jgrA0ntJ10Ni5VZQU0IlQpwPVTJ0= =uCLD -----END PGP SIGNATURE----- --kopswqJwNuk46FLvDUiWXhImPHw3NTB6M-- From owner-svn-src-head@freebsd.org Mon Jun 20 06:40:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7011DA7B38C; Mon, 20 Jun 2016 06:40:59 +0000 (UTC) (envelope-from wma@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 4B9F913B2; Mon, 20 Jun 2016 06:40:59 +0000 (UTC) (envelope-from wma@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5K6ewfU078178; Mon, 20 Jun 2016 06:40:58 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5K6ewF0078176; Mon, 20 Jun 2016 06:40:58 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201606200640.u5K6ewF0078176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Mon, 20 Jun 2016 06:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302025 - head/usr.sbin/bsdinstall/partedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 06:40:59 -0000 Author: wma Date: Mon Jun 20 06:40:58 2016 New Revision: 302025 URL: https://svnweb.freebsd.org/changeset/base/302025 Log: ARM64: bsdinstall support for creating EFI partitions This patch enables bsdinstall to create EFI partition during installation and uploading it's contents, making the ARM64 FreeBSD installation bootable. Obtained from: Semihalf Sponsored by: Cavium Approved by: re Reviewed by: allanjude, emaste, nwhitehorn, wma Differential Revision: https://reviews.freebsd.org/D6853 Added: head/usr.sbin/bsdinstall/partedit/partedit_arm64.c (contents, props changed) Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Jun 20 02:04:40 2016 (r302024) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Mon Jun 20 06:40:58 2016 (r302025) @@ -218,7 +218,7 @@ choose_part_type(const char *def_scheme) {"BSD", "BSD Labels", "Bootable on most x86 systems", 0 }, {"GPT", "GUID Partition Table", - "Bootable on most x86 systems", 0 }, + "Bootable on most x86 systems and EFI aware ARM64", 0 }, {"MBR", "DOS Partitions", "Bootable on most x86 systems", 0 }, {"PC98", "NEC PC9801 Partition Table", Added: head/usr.sbin/bsdinstall/partedit/partedit_arm64.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bsdinstall/partedit/partedit_arm64.c Mon Jun 20 06:40:58 2016 (r302025) @@ -0,0 +1,104 @@ +/* + * Copyright (C) 2016 Cavium Inc. + * All rights reserved. + * + * Developed by Semihalf. + * Based on work by Nathan Whitehorn. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include + +#include "partedit.h" + +/* EFI partition size in KB */ +#define EFI_BOOTPART_SIZE (50 * 1024) +#define EFI_BOOTPART_PATH "/boot/boot1.efifat" + +const char * +default_scheme(void) +{ + + return ("GPT"); +} + +int +is_scheme_bootable(const char *part_type) +{ + + if (strcmp(part_type, "GPT") == 0) + return (1); + + return (0); +} + +int +is_fs_bootable(const char *part_type, const char *fs) +{ + + if (strcmp(fs, "freebsd-ufs") == 0) + return (1); + + return (0); +} + +size_t +bootpart_size(const char *scheme) +{ + + /* We only support GPT with EFI */ + if (strcmp(scheme, "GPT") != 0) + return (0); + + return ((EFI_BOOTPART_SIZE) * 1024); +} + +const char * +bootpart_type(const char *scheme) +{ + + /* Only EFI is supported as boot partition */ + return ("efi"); +} + +const char * +bootcode_path(const char *part_type) +{ + + return (NULL); +} + +const char * +partcode_path(const char *part_type, const char *fs_type) +{ + + if (strcmp(part_type, "GPT") == 0) + return (EFI_BOOTPART_PATH); + + /* No boot partition data for non-GPT */ + return (NULL); +} + From owner-svn-src-head@freebsd.org Mon Jun 20 06:45:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05D4DA7B544; Mon, 20 Jun 2016 06:45:45 +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 C2ECD19F0; Mon, 20 Jun 2016 06:45:44 +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 u5K6ji9O081762; Mon, 20 Jun 2016 06:45:44 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5K6jhBr081752; Mon, 20 Jun 2016 06:45:43 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201606200645.u5K6jhBr081752@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 20 Jun 2016 06:45:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302026 - in head: share/monetdef share/msgdef share/numericdef share/timedef tools/tools/locale/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 06:45:45 -0000 Author: bapt Date: Mon Jun 20 06:45:42 2016 New Revision: 302026 URL: https://svnweb.freebsd.org/changeset/base/302026 Log: Fix generation of locales with multiple variants Serbian locales have triple components to represent the 2 variations of the locale: Latin and Cyrillic. Previously the tools generatic the locale were appending both definitions instead of differentiating them. Reported by: ache Approved by: re (gjb) Added: head/share/msgdef/sr_Cyrl_RS.UTF-8.src (contents, props changed) head/share/timedef/sr_Cyrl_RS.UTF-8.src (contents, props changed) Deleted: head/share/msgdef/bg_BG.UTF-8.src head/share/msgdef/sl_SI.UTF-8.src head/share/msgdef/sr_Latn_RS.ISO8859-2.src head/share/numericdef/sr_Latn_RS.UTF-8.src head/share/timedef/en_HK.UTF-8.src Modified: head/share/monetdef/sr_Latn_RS.UTF-8.src head/share/msgdef/Makefile head/share/msgdef/sr_Cyrl_RS.ISO8859-5.src head/share/msgdef/sr_Latn_RS.UTF-8.src head/share/numericdef/Makefile head/share/timedef/Makefile head/share/timedef/sr_Cyrl_RS.ISO8859-5.src head/share/timedef/sr_Latn_RS.ISO8859-2.src (contents, props changed) head/share/timedef/sr_Latn_RS.UTF-8.src (contents, props changed) head/tools/tools/locale/tools/cldr2def.pl Modified: head/share/monetdef/sr_Latn_RS.UTF-8.src ============================================================================== --- head/share/monetdef/sr_Latn_RS.UTF-8.src Mon Jun 20 06:40:58 2016 (r302025) +++ head/share/monetdef/sr_Latn_RS.UTF-8.src Mon Jun 20 06:45:42 2016 (r302026) @@ -4,47 +4,47 @@ # ----------------------------------------------------------------------------- # # int_curr_symbol (last character always SPACE) -RSD ""RSD +RSD # # currency_symbol -RSD""RSD +RSD # # mon_decimal_point -,"", +, # # mon_thousands_sep -."". +. # # mon_grouping -33 +3 # # positive_sign -"" + # # negative_sign --""- +- # # int_frac_digits -00 +0 # # frac_digits -00 +0 # # p_cs_precedes -00 +0 # # p_sep_by_space -11 +1 # # n_cs_precedes -00 +0 # # n_sep_by_space -11 +1 # # p_sign_posn -11 +1 # # n_sign_posn -11 +1 # EOF Modified: head/share/msgdef/Makefile ============================================================================== --- head/share/msgdef/Makefile Mon Jun 20 06:40:58 2016 (r302025) +++ head/share/msgdef/Makefile Mon Jun 20 06:45:42 2016 (r302026) @@ -16,7 +16,6 @@ LOCALES+= be_BY.CP1251 LOCALES+= be_BY.ISO8859-5 LOCALES+= be_BY.UTF-8 LOCALES+= bg_BG.CP1251 -LOCALES+= bg_BG.UTF-8 LOCALES+= cs_CZ.UTF-8 LOCALES+= de_DE.UTF-8 LOCALES+= el_GR.ISO8859-7 @@ -64,9 +63,8 @@ LOCALES+= ru_RU.UTF-8 LOCALES+= se_NO.UTF-8 LOCALES+= sk_SK.ISO8859-2 LOCALES+= sk_SK.UTF-8 -LOCALES+= sl_SI.UTF-8 LOCALES+= sr_Cyrl_RS.ISO8859-5 -LOCALES+= sr_Latn_RS.ISO8859-2 +LOCALES+= sr_Cyrl_RS.UTF-8 LOCALES+= sr_Latn_RS.UTF-8 LOCALES+= sv_SE.UTF-8 LOCALES+= tr_TR.ISO8859-9 @@ -97,6 +95,7 @@ SAME+= ar_SA.UTF-8 ar_MA.UTF-8 SAME+= ar_SA.UTF-8 ar_JO.UTF-8 SAME+= ar_SA.UTF-8 ar_EG.UTF-8 SAME+= ar_SA.UTF-8 ar_AE.UTF-8 +SAME+= sr_Cyrl_RS.UTF-8 bg_BG.UTF-8 SAME+= es_MX.ISO8859-1 es_ES.ISO8859-15 SAME+= es_MX.ISO8859-1 es_ES.ISO8859-1 SAME+= es_MX.ISO8859-1 es_AR.ISO8859-1 @@ -179,9 +178,11 @@ SAME+= fr_FR.UTF-8 fr_CA.ISO8859-1 SAME+= fr_FR.UTF-8 fr_BE.UTF-8 SAME+= fr_FR.UTF-8 fr_BE.ISO8859-15 SAME+= fr_FR.UTF-8 fr_BE.ISO8859-1 -SAME+= sl_SI.UTF-8 sl_SI.ISO8859-2 -SAME+= sl_SI.UTF-8 hr_HR.UTF-8 -SAME+= sl_SI.UTF-8 hr_HR.ISO8859-2 +SAME+= sr_Latn_RS.UTF-8 sr_Latn_RS.ISO8859-2 +SAME+= sr_Latn_RS.UTF-8 sl_SI.UTF-8 +SAME+= sr_Latn_RS.UTF-8 sl_SI.ISO8859-2 +SAME+= sr_Latn_RS.UTF-8 hr_HR.UTF-8 +SAME+= sr_Latn_RS.UTF-8 hr_HR.ISO8859-2 SAME+= hu_HU.UTF-8 hu_HU.ISO8859-2 SAME+= is_IS.ISO8859-15 is_IS.ISO8859-1 SAME+= it_IT.ISO8859-15 it_IT.ISO8859-1 @@ -199,7 +200,6 @@ SAME+= pt_PT.ISO8859-15 pt_BR.ISO8859-1 SAME+= pt_PT.UTF-8 pt_BR.UTF-8 SAME+= ro_RO.UTF-8 ro_RO.ISO8859-2 SAME+= se_NO.UTF-8 se_FI.UTF-8 -SAME+= sr_Latn_RS.UTF-8 sr_Cyrl_RS.UTF-8 SAME+= zh_Hans_CN.GBK zh_Hans_CN.GB18030 SAME+= zh_Hans_CN.GBK zh_Hans_CN.eucCN SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) Modified: head/share/msgdef/sr_Cyrl_RS.ISO8859-5.src ============================================================================== --- head/share/msgdef/sr_Cyrl_RS.ISO8859-5.src Mon Jun 20 06:40:58 2016 (r302025) +++ head/share/msgdef/sr_Cyrl_RS.ISO8859-5.src Mon Jun 20 06:45:42 2016 (r302026) @@ -4,14 +4,14 @@ # ----------------------------------------------------------------------------- # # yesexpr -^(([Դ]([а])?)|([Դ])|([yY]([eE][sS])?)|([yY]))""^(([dD]([aA])?)|([dD])|([yY]([eE][sS])?)|([yY])) +^(([Դ]([а])?)|([Դ])|([yY]([eE][sS])?)|([yY])) # # noexpr -^(([ݽ]([յ])?)|([ݽ])|([nN]([oO])?)|([nN]))""^(([nN]([eE])?)|([nN])|([nN]([oO])?)|([nN])) +^(([ݽ]([յ])?)|([ݽ])|([nN]([oO])?)|([nN])) # # yesstr -::::yes:y:YES:Y""da:d:DA:D:yes:y:YES:Y +::::yes:y:YES:Y # # nostr -::::no:n:NO:N""ne:n:NE:N:no:n:NO:N +::::no:n:NO:N # EOF Added: head/share/msgdef/sr_Cyrl_RS.UTF-8.src ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/msgdef/sr_Cyrl_RS.UTF-8.src Mon Jun 20 06:45:42 2016 (r302026) @@ -0,0 +1,17 @@ +# Warning: Do not edit. This file is automatically generated from the +# tools in /usr/src/tools/tools/locale. The data is obtained from the +# CLDR project, obtained from http://cldr.unicode.org/ +# ----------------------------------------------------------------------------- +# +# yesexpr +^(([дД]([аА])?)|([дД])|([yY]([eE][sS])?)|([yY])) +# +# noexpr +^(([нН]([еЕ])?)|([нН])|([nN]([oO])?)|([nN])) +# +# yesstr +да:д:ДА:Д:yes:y:YES:Y +# +# nostr +не:н:НЕ:Н:no:n:NO:N +# EOF Modified: head/share/msgdef/sr_Latn_RS.UTF-8.src ============================================================================== --- head/share/msgdef/sr_Latn_RS.UTF-8.src Mon Jun 20 06:40:58 2016 (r302025) +++ head/share/msgdef/sr_Latn_RS.UTF-8.src Mon Jun 20 06:45:42 2016 (r302026) @@ -4,14 +4,14 @@ # ----------------------------------------------------------------------------- # # yesexpr -^(([дД]([аА])?)|([дД])|([yY]([eE][sS])?)|([yY]))""^(([dD]([aA])?)|([dD])|([yY]([eE][sS])?)|([yY])) +^(([dD]([aA])?)|([dD])|([yY]([eE][sS])?)|([yY])) # # noexpr -^(([нН]([еЕ])?)|([нН])|([nN]([oO])?)|([nN]))""^(([nN]([eE])?)|([nN])|([nN]([oO])?)|([nN])) +^(([nN]([eE])?)|([nN])|([nN]([oO])?)|([nN])) # # yesstr -да:д:ДА:Д:yes:y:YES:Y""da:d:DA:D:yes:y:YES:Y +da:d:DA:D:yes:y:YES:Y # # nostr -не:н:НЕ:Н:no:n:NO:N""ne:n:NE:N:no:n:NO:N +ne:n:NE:N:no:n:NO:N # EOF Modified: head/share/numericdef/Makefile ============================================================================== --- head/share/numericdef/Makefile Mon Jun 20 06:40:58 2016 (r302025) +++ head/share/numericdef/Makefile Mon Jun 20 06:45:42 2016 (r302026) @@ -18,7 +18,6 @@ LOCALES+= hi_IN.UTF-8 LOCALES+= hy_AM.UTF-8 LOCALES+= it_CH.UTF-8 LOCALES+= ru_RU.CP866 -LOCALES+= sr_Latn_RS.UTF-8 LOCALES+= tr_TR.UTF-8 LOCALES+= uk_UA.ISO8859-5 LOCALES+= uk_UA.KOI8-U @@ -133,6 +132,10 @@ SAME+= ar_SA.UTF-8 ar_JO.UTF-8 SAME+= ar_SA.UTF-8 ar_EG.UTF-8 SAME+= ar_SA.UTF-8 ar_AE.UTF-8 SAME+= tr_TR.UTF-8 tr_TR.ISO8859-9 +SAME+= tr_TR.UTF-8 sr_Latn_RS.UTF-8 +SAME+= tr_TR.UTF-8 sr_Latn_RS.ISO8859-2 +SAME+= tr_TR.UTF-8 sr_Cyrl_RS.UTF-8 +SAME+= tr_TR.UTF-8 sr_Cyrl_RS.ISO8859-5 SAME+= tr_TR.UTF-8 sl_SI.UTF-8 SAME+= tr_TR.UTF-8 sl_SI.ISO8859-2 SAME+= tr_TR.UTF-8 ro_RO.UTF-8 @@ -199,9 +202,6 @@ SAME+= fr_CH.ISO8859-15 fr_CH.ISO8859-1 SAME+= hi_IN.UTF-8 hi_IN.ISCII-DEV SAME+= hy_AM.UTF-8 hy_AM.ARMSCII-8 SAME+= uk_UA.KOI8-U ru_RU.KOI8-R -SAME+= sr_Latn_RS.UTF-8 sr_Latn_RS.ISO8859-2 -SAME+= sr_Latn_RS.UTF-8 sr_Cyrl_RS.UTF-8 -SAME+= sr_Latn_RS.UTF-8 sr_Cyrl_RS.ISO8859-5 SAME+= ko_KR.eucKR ko_KR.CP949 # legacy (same charset) FILES= ${LOCALES:S/$/.out/} Modified: head/share/timedef/Makefile ============================================================================== --- head/share/timedef/Makefile Mon Jun 20 06:40:58 2016 (r302025) +++ head/share/timedef/Makefile Mon Jun 20 06:45:42 2016 (r302026) @@ -34,7 +34,6 @@ LOCALES+= el_GR.ISO8859-7 LOCALES+= el_GR.UTF-8 LOCALES+= en_CA.UTF-8 LOCALES+= en_GB.UTF-8 -LOCALES+= en_HK.UTF-8 LOCALES+= en_IE.UTF-8 LOCALES+= en_PH.UTF-8 LOCALES+= en_SG.UTF-8 @@ -111,6 +110,7 @@ LOCALES+= sk_SK.UTF-8 LOCALES+= sl_SI.ISO8859-2 LOCALES+= sl_SI.UTF-8 LOCALES+= sr_Cyrl_RS.ISO8859-5 +LOCALES+= sr_Cyrl_RS.UTF-8 LOCALES+= sr_Latn_RS.ISO8859-2 LOCALES+= sr_Latn_RS.UTF-8 LOCALES+= sv_FI.ISO8859-15 @@ -154,11 +154,12 @@ SAME+= de_DE.ISO8859-15 de_DE.ISO8859-1 SAME+= de_DE.ISO8859-15 de_CH.ISO8859-15 SAME+= de_DE.ISO8859-15 de_CH.ISO8859-1 SAME+= de_DE.UTF-8 de_CH.UTF-8 -SAME+= en_HK.UTF-8 en_HK.ISO8859-1 -SAME+= en_HK.UTF-8 en_AU.UTF-8 -SAME+= en_HK.UTF-8 en_AU.US-ASCII -SAME+= en_HK.UTF-8 en_AU.ISO8859-15 -SAME+= en_HK.UTF-8 en_AU.ISO8859-1 +SAME+= en_PH.UTF-8 en_HK.UTF-8 +SAME+= en_PH.UTF-8 en_HK.ISO8859-1 +SAME+= en_PH.UTF-8 en_AU.UTF-8 +SAME+= en_PH.UTF-8 en_AU.US-ASCII +SAME+= en_PH.UTF-8 en_AU.ISO8859-15 +SAME+= en_PH.UTF-8 en_AU.ISO8859-1 SAME+= en_CA.UTF-8 en_CA.US-ASCII SAME+= en_CA.UTF-8 en_CA.ISO8859-15 SAME+= en_CA.UTF-8 en_CA.ISO8859-1 @@ -198,7 +199,6 @@ SAME+= nl_NL.UTF-8 nl_NL.ISO8859-15 SAME+= nl_NL.UTF-8 nl_NL.ISO8859-1 SAME+= nn_NO.ISO8859-15 nn_NO.ISO8859-1 SAME+= pt_PT.ISO8859-15 pt_PT.ISO8859-1 -SAME+= sr_Latn_RS.UTF-8 sr_Cyrl_RS.UTF-8 SAME+= sv_FI.ISO8859-15 sv_FI.ISO8859-1 SAME+= sv_SE.ISO8859-15 sv_SE.ISO8859-1 SAME+= zh_Hans_CN.GBK zh_Hans_CN.GB18030 Modified: head/share/timedef/sr_Cyrl_RS.ISO8859-5.src ============================================================================== --- head/share/timedef/sr_Cyrl_RS.ISO8859-5.src Mon Jun 20 06:40:58 2016 (r302025) +++ head/share/timedef/sr_Cyrl_RS.ISO8859-5.src Mon Jun 20 06:45:42 2016 (r302026) @@ -15,18 +15,7 @@ -""jan -feb -mar -apr -maj -jun -jul -avg -sep -okt -nov -dec + # # Long month names (as in a date) @@ -40,18 +29,7 @@ dec -""januar -februar -mart -april -maj -jun -jul -avgust -septembar -oktobar -novembar -decembar + # # Short weekday names @@ -60,13 +38,7 @@ decembar -""ned -pon -uto -sre -cet -pet -sub + # # Long weekday names @@ -75,30 +47,23 @@ sub -""nedelja -ponedeljak -utorak -sreda -cetvrtak -petak -subota + # # X_fmt -%H.%M.%S""%H.%M.%S +%H.%M.%S # # x_fmt -%d.%m.%y.""%e.%m.%y. +%d.%m.%y. # # c_fmt -%d. %B %Y. %H.%M.%S""%d. %B %Y. %H.%M.%S %Z +%d. %B %Y. %H.%M.%S # # AM/PM - ""pre podne -po podne + # # date_fmt -%d. %B %Y. %H.%M.%S %Z""%d. %B %Y. %H.%M.%S %Z +%d. %B %Y. %H.%M.%S %Z # # Long month names (without case ending) @@ -112,22 +77,11 @@ po podne -""januar -februar -mart -april -maj -jun -jul -avgust -septembar -oktobar -novembar -decembar + # # md_order -dmdm +dm # # ampm_fmt -%I.%M.%S %p""%I.%M.%S %p +%I.%M.%S %p # EOF Added: head/share/timedef/sr_Cyrl_RS.UTF-8.src ============================================================================== Binary file. No diff available. Modified: head/share/timedef/sr_Latn_RS.ISO8859-2.src ============================================================================== --- head/share/timedef/sr_Latn_RS.ISO8859-2.src Mon Jun 20 06:40:58 2016 (r302025) +++ head/share/timedef/sr_Latn_RS.ISO8859-2.src Mon Jun 20 06:45:42 2016 (r302026) @@ -4,18 +4,7 @@ # ----------------------------------------------------------------------------- # # Short month names -jah -feb -mar -apr -maj -juh -jul -abg -cep -okt -hob -dec""jan +jan feb mar apr @@ -29,18 +18,7 @@ nov dec # # Long month names (as in a date) -jahuar -februar -mart -aprjl -maj -juh -jul -abguct -ceptembar -oktobar -hobembar -decembar""januar +januar februar mart april @@ -54,13 +32,7 @@ novembar decembar # # Short weekday names -hed -poh -uto -cre -et -pet -cub""ned +ned pon uto sre @@ -69,13 +41,7 @@ pet sub # # Long weekday names -hedelja -pohedeljak -utorak -creda -etbrtak -petak -cubota""nedelja +nedelja ponedeljak utorak sreda @@ -84,35 +50,23 @@ petak subota # # X_fmt -%H.%M.%S""%H.%M.%S +%H.%M.%S # # x_fmt -%d.%m.%y.""%d.%m.%y. +%d.%m.%y. # # c_fmt -%d. %B %Y. %H.%M.%S""%d. %B %Y. %H.%M.%S %Z +%d. %B %Y. %H.%M.%S # # AM/PM -pre podhe -po podhe""pre podne +pre podne po podne # # date_fmt -%d. %B %Y. %H.%M.%S %Z""%d. %B %Y. %H.%M.%S %Z +%d. %B %Y. %H.%M.%S %Z # # Long month names (without case ending) -jahuar -februar -mart -aprjl -maj -juh -jul -abguct -ceptembar -oktobar -hobembar -decembar""januar +januar februar mart april @@ -126,8 +80,8 @@ novembar decembar # # md_order -dmdm +dm # # ampm_fmt -%I.%M.%S %p""%I.%M.%S %p +%I.%M.%S %p # EOF Modified: head/share/timedef/sr_Latn_RS.UTF-8.src ============================================================================== Binary file (source and/or target). No diff available. Modified: head/tools/tools/locale/tools/cldr2def.pl ============================================================================== --- head/tools/tools/locale/tools/cldr2def.pl Mon Jun 20 06:40:58 2016 (r302025) +++ head/tools/tools/locale/tools/cldr2def.pl Mon Jun 20 06:45:42 2016 (r302026) @@ -595,8 +595,8 @@ sub get_fields { $line =~ s/^$k\s+//; } - $values{$l}{$c}{$k} = "" - if (!defined $values{$l}{$c}{$k}); + $values{$l}{$f}{$c}{$k} = "" + if (!defined $values{$l}{$f}{$c}{$k}); $continue = ($line =~ /\/$/); $line =~ s/\/$// if ($continue); @@ -606,7 +606,7 @@ sub get_fields { s/\<([^>_]+)_([^>]+)\>/<$1 $2>/; } die "_ in data - $line" if ($line =~ /_/); - $values{$l}{$c}{$k} .= $line; + $values{$l}{$f}{$c}{$k} .= $line; last if (!$continue); } @@ -723,7 +723,7 @@ sub print_fields { # ----------------------------------------------------------------------------- EOF foreach my $k (keys(%keys)) { - my $f = $keys{$k}; + my $g = $keys{$k}; die("Unknown $k in \%DESC") if (!defined $DESC{$k}); @@ -731,37 +731,38 @@ EOF $output .= "#\n# $DESC{$k}\n"; # Replace one row with another - if ($f =~ /^>/) { - $k = substr($f, 1); - $f = $keys{$k}; + if ($g =~ /^>/) { + $k = substr($g, 1); + $g = $keys{$k}; } # Callback function - if ($f =~ /^\ Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50BCDAC436B; Mon, 20 Jun 2016 14:59:31 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F20C228A0; Mon, 20 Jun 2016 14:59:30 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [150.158.232.236] (114.40-78-194.adsl-static.isp.belgacom.be [194.78.40.114]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 599E61EF5F; Mon, 20 Jun 2016 16:59:28 +0200 (CEST) From: "Kristof Provost" To: "Alan Somers" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r300881 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs geom Date: Mon, 20 Jun 2016 16:59:27 +0200 Message-ID: In-Reply-To: <201605272232.u4RMWjku087648@repo.freebsd.org> References: <201605272232.u4RMWjku087648@repo.freebsd.org> MIME-Version: 1.0 X-Mailer: MailMate (1.9.4r5234) Content-Type: text/plain; charset=utf-8; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 14:59:31 -0000 Hi, It looks like this change breaks boot on my machine. I’m running a root-on-ZFS system and reliably see this panic during boot. It’s a 4 disk raidz-1. It’s now running r302028 with r300881 backed out, and booting fine. The panic: panic: solaris assert: refcount(count(&spa->spa_refcount) >= spa->spa_minref || MUTEX_HELD(&spa_namespace_lock), file: /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c, line: 863 Unfortunately I can’t get a dump, but here’s a picture of the backtrace: https://people.freebsd.org/~kp/zfs_panic.jpg Regards, Kristof On 28 May 2016, at 0:32, Alan Somers wrote: > Author: asomers > Date: Fri May 27 22:32:44 2016 > New Revision: 300881 > URL: https://svnweb.freebsd.org/changeset/base/300881 > > Log: > Avoid issuing spa config updates for physical path when not > necessary > > ZFS's configuration needs to be updated whenever the physical path > for a > device changes, but not when a new device is introduced. This is > because new > devices necessarily cause config updates, but only if they are > actually > accepted into the pool. > > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c > Split vdev_geom_set_physpath out of vdev_geom_attrchanged. When > setting the vdev's physical path, only request a config update if > the physical path has changed. Don't request it when opening a > device for the first time, because the config sync will happen > anyway upstack. > > sys/geom/geom_dev.c > Split g_dev_set_physpath and g_dev_set_media out of > g_dev_attrchanged > > Submitted by: will, asomers > MFC after: 4 weeks > Sponsored by: Spectra Logic Corp > Differential Revision: https://reviews.freebsd.org/D6428 > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c > head/sys/geom/geom_dev.c From owner-svn-src-head@freebsd.org Mon Jun 20 15:27:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A039DAC48D7; Mon, 20 Jun 2016 15:27:19 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ob0-x22d.google.com (mail-ob0-x22d.google.com [IPv6:2607:f8b0:4003:c01::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 64846198C; Mon, 20 Jun 2016 15:27:19 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ob0-x22d.google.com with SMTP id ot10so515685obb.2; Mon, 20 Jun 2016 08:27:19 -0700 (PDT) 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-transfer-encoding; bh=Ee7A08SnpK/qwPMZTJ0PX7Uk9Wrsmf4tozGE+Wa1crs=; b=Rp2YjmIceElMXfXyp3l7zbd+FG2D9n4b8D2x1KIHiD9DQQDvyAfOQFI4rFuTHcAmzl CH+Q3cbtOjktZqGWSdHWxkN2rGn9aLhvi9LGKDk3o9XNLGIJ9PNtQ6mTvQgboNSJH4Ep YGh7vyIx5yl+SQsMhjrEo32bFvMaZE+txT+H2vOJxcDVQqZNC+4vuKVRqx0J2mEhC4pB zW32oSb6zSWt0kk/ZhC0LEITvpgrxSfTnM4M7YMNynou8t3ExOi7hXgNisNO1ld0/5Kx exmzeyk2+Tsf0DNP/+HRj3mfWEh+vOdUpI3D2gD5r+ZW/4bVj0JdbJKcBjH8cylgUlOX eAzQ== 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:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=Ee7A08SnpK/qwPMZTJ0PX7Uk9Wrsmf4tozGE+Wa1crs=; b=M0buPYKdAJfRTeoB0WtXYXU5uFjN5vIeLOTpe9pWWYRGxlgcdDI8Hp9+0jJtIAQyjb ucDsnNXiZYiixWRo061pAmkAwhtiyu2z2JPmRogHlvj/xIgd5isa7uB74X3CCN1MX1Ii EGHWlQy6zzdVFmB6QtZI1kP6nJCrPmqLc7t0Sn008G8Wh+LItiSLItDKgwEsba+CaOlG wjBmJO3siTbKuwn8NKY3ebZQFrXNuwCreHv9vSWYBn3MBxgWYBkY5XSZ4x9hthyjFf5D adoW8HCGT6Mnxor4QmfBqG+MDjlq1TA4E+a+vfLmHUdpyNyokuHoW2xuEbJgtAilR0Rg isQA== X-Gm-Message-State: ALyK8tI9OJu99UaLTau5H8l7He2S8r/Z6R6kg1USfDqhfgy0t4cCKJOFczeMy5UN/R4gi2O8BmfmDI4LLC9bwA== X-Received: by 10.157.0.74 with SMTP id 68mr11008420ota.55.1466436438449; Mon, 20 Jun 2016 08:27:18 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.202.102.206 with HTTP; Mon, 20 Jun 2016 08:27:17 -0700 (PDT) In-Reply-To: References: <201605272232.u4RMWjku087648@repo.freebsd.org> From: Alan Somers Date: Mon, 20 Jun 2016 09:27:17 -0600 X-Google-Sender-Auth: gvyGmPphMt_dHbGBCHsGMh5XdFM Message-ID: Subject: Re: svn commit: r300881 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs geom To: Kristof Provost Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 15:27:19 -0000 You say it's a 4-disk RAIDZ1. Anything topologically weird, like a log, cache or spare device? SAS or SATA? Any SAS expanders? Please open a bug for this and assign to me so we can be sure to get this fixed in time for 11.0. -Alan On Mon, Jun 20, 2016 at 8:59 AM, Kristof Provost wrote: > Hi, > > It looks like this change breaks boot on my machine. > I=E2=80=99m running a root-on-ZFS system and reliably see this panic duri= ng boot. > It=E2=80=99s a 4 disk raidz-1. > > It=E2=80=99s now running r302028 with r300881 backed out, and booting fin= e. > > The panic: > panic: solaris assert: refcount(count(&spa->spa_refcount) >=3D spa->spa_m= inref > || > MUTEX_HELD(&spa_namespace_lock), file: > /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c, line: > 863 > > Unfortunately I can=E2=80=99t get a dump, but here=E2=80=99s a picture of= the backtrace: > https://people.freebsd.org/~kp/zfs_panic.jpg > > Regards, > Kristof > > On 28 May 2016, at 0:32, Alan Somers wrote: > > Author: asomers > Date: Fri May 27 22:32:44 2016 > New Revision: 300881 > URL: https://svnweb.freebsd.org/changeset/base/300881 > > Log: > Avoid issuing spa config updates for physical path when not necessary > > ZFS's configuration needs to be updated whenever the physical path for a > device changes, but not when a new device is introduced. This is because = new > devices necessarily cause config updates, but only if they are actually > accepted into the pool. > > sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c > Split vdev_geom_set_physpath out of vdev_geom_attrchanged. When > setting the vdev's physical path, only request a config update if > the physical path has changed. Don't request it when opening a > device for the first time, because the config sync will happen > anyway upstack. > > sys/geom/geom_dev.c > Split g_dev_set_physpath and g_dev_set_media out of > g_dev_attrchanged > > Submitted by: will, asomers > MFC after: 4 weeks > Sponsored by: Spectra Logic Corp > Differential Revision: https://reviews.freebsd.org/D6428 > > Modified: > head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c > head/sys/geom/geom_dev.c From owner-svn-src-head@freebsd.org Mon Jun 20 15:31:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91889AC4AD2; Mon, 20 Jun 2016 15:31:58 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 27B471EB6; Mon, 20 Jun 2016 15:31:58 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [150.158.232.236] (114.40-78-194.adsl-static.isp.belgacom.be [194.78.40.114]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 1CABA1E03E; Mon, 20 Jun 2016 17:31:56 +0200 (CEST) From: "Kristof Provost" To: "Alan Somers" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r300881 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs geom Date: Mon, 20 Jun 2016 17:31:54 +0200 Message-ID: In-Reply-To: References: <201605272232.u4RMWjku087648@repo.freebsd.org> MIME-Version: 1.0 X-Mailer: MailMate (1.9.4r5234) Content-Type: text/plain; charset=utf-8; format=flowed; markup=markdown Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 15:31:58 -0000 No, it’s an HP Microserver. 4 data disks and that’s it. Bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210409 Regards, Kristof On 20 Jun 2016, at 17:27, Alan Somers wrote: > You say it's a 4-disk RAIDZ1. Anything topologically weird, like a > log, cache or spare device? SAS or SATA? Any SAS expanders? Please > open a bug for this and assign to me so we can be sure to get this > fixed in time for 11.0. > > -Alan > > On Mon, Jun 20, 2016 at 8:59 AM, Kristof Provost > wrote: >> Hi, >> >> It looks like this change breaks boot on my machine. >> I’m running a root-on-ZFS system and reliably see this panic during >> boot. >> It’s a 4 disk raidz-1. >> >> It’s now running r302028 with r300881 backed out, and booting fine. >> >> The panic: >> panic: solaris assert: refcount(count(&spa->spa_refcount) >= >> spa->spa_minref >> || >> MUTEX_HELD(&spa_namespace_lock), file: >> /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c, >> line: >> 863 >> >> Unfortunately I can’t get a dump, but here’s a picture of the >> backtrace: >> https://people.freebsd.org/~kp/zfs_panic.jpg >> >> Regards, >> Kristof >> >> On 28 May 2016, at 0:32, Alan Somers wrote: >> >> Author: asomers >> Date: Fri May 27 22:32:44 2016 >> New Revision: 300881 >> URL: https://svnweb.freebsd.org/changeset/base/300881 >> >> Log: >> Avoid issuing spa config updates for physical path when not necessary >> >> ZFS's configuration needs to be updated whenever the physical path >> for a >> device changes, but not when a new device is introduced. This is >> because new >> devices necessarily cause config updates, but only if they are >> actually >> accepted into the pool. >> >> sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c >> Split vdev_geom_set_physpath out of vdev_geom_attrchanged. When >> setting the vdev's physical path, only request a config update if >> the physical path has changed. Don't request it when opening a >> device for the first time, because the config sync will happen >> anyway upstack. >> >> sys/geom/geom_dev.c >> Split g_dev_set_physpath and g_dev_set_media out of >> g_dev_attrchanged >> >> Submitted by: will, asomers >> MFC after: 4 weeks >> Sponsored by: Spectra Logic Corp >> Differential Revision: https://reviews.freebsd.org/D6428 >> >> Modified: >> head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c >> head/sys/geom/geom_dev.c From owner-svn-src-head@freebsd.org Mon Jun 20 15:34:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3115AC4D0F; Mon, 20 Jun 2016 15:34:33 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id B4BB520FF; Mon, 20 Jun 2016 15:34:33 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id C6F31DB5D; Mon, 20 Jun 2016 15:34:27 +0000 (UTC) Subject: Re: svn commit: r300881 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs geom To: Kristof Provost , Alan Somers References: <201605272232.u4RMWjku087648@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Allan Jude Message-ID: Date: Mon, 20 Jun 2016 11:34:27 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 15:34:33 -0000 On 2016-06-20 11:31, Kristof Provost wrote: > No, it’s an HP Microserver. 4 data disks and that’s it. > > Bug: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=210409 > > Regards, > Kristof > > On 20 Jun 2016, at 17:27, Alan Somers wrote: > > You say it's a 4-disk RAIDZ1. Anything topologically weird, like a > log, cache or spare device? SAS or SATA? Any SAS expanders? Please > open a bug for this and assign to me so we can be sure to get this > fixed in time for 11.0. > > -Alan > > On Mon, Jun 20, 2016 at 8:59 AM, Kristof Provost kp@freebsd.org > wrote: > > Hi, > > It looks like this change breaks boot on my machine. > I’m running a root-on-ZFS system and reliably see this panic > during boot. > It’s a 4 disk raidz-1. > > It’s now running r302028 with r300881 backed out, and booting fine. > > The panic: > panic: solaris assert: refcount(count(&spa->spa_refcount) >= > spa->spa_minref > || > MUTEX_HELD(&spa_namespace_lock), file: > /usr/src/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c, > line: > 863 > > Unfortunately I can’t get a dump, but here’s a picture of the > backtrace: > https://people.freebsd.org/~kp/zfs_panic.jpg > > > Regards, > Kristof > > Looking at the backtrace, do you have one or more ZVOLs? -- Allan Jude From owner-svn-src-head@freebsd.org Mon Jun 20 15:37:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57438AC4E9E; Mon, 20 Jun 2016 15:37:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [IPv6:2a01:4f8:162:1127::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.codepro.be", Issuer "Gandi Standard SSL CA 2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F52A24CF; Mon, 20 Jun 2016 15:37:50 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [150.158.232.236] (114.40-78-194.adsl-static.isp.belgacom.be [194.78.40.114]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id C675B1E0BF; Mon, 20 Jun 2016 17:37:47 +0200 (CEST) From: "Kristof Provost" To: "Allan Jude" Cc: "Alan Somers" , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r300881 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs geom Date: Mon, 20 Jun 2016 17:37:46 +0200 Message-ID: <7EEFB79D-649B-4115-9E46-F077FA686EA6@FreeBSD.org> In-Reply-To: References: <201605272232.u4RMWjku087648@repo.freebsd.org> MIME-Version: 1.0 X-Mailer: MailMate (1.9.4r5234) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 15:37:50 -0000 On 20 Jun 2016, at 17:34, Allan Jude wrote: > Looking at the backtrace, do you have one or more ZVOLs? > No, there are no zvols: % zfs list -t volume no datasets available Regards, Kristof From owner-svn-src-head@freebsd.org Mon Jun 20 15:45:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C00EA7B0FC; Mon, 20 Jun 2016 15:45: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 68D4E2A4A; Mon, 20 Jun 2016 15:45: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 u5KFjo4n082200; Mon, 20 Jun 2016 15:45:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5KFjo9S082199; Mon, 20 Jun 2016 15:45:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606201545.u5KFjo9S082199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 20 Jun 2016 15:45:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302029 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 15:45:51 -0000 Author: kib Date: Mon Jun 20 15:45:50 2016 New Revision: 302029 URL: https://svnweb.freebsd.org/changeset/base/302029 Log: Fix typo. Note that atomic is still required even for interlocked case. Sponsored by: The FreeBSD Foundation Approved by: re (marius) Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Jun 20 09:15:03 2016 (r302028) +++ head/sys/kern/vfs_subr.c Mon Jun 20 15:45:50 2016 (r302029) @@ -2494,9 +2494,10 @@ v_decr_devcount(struct vnode *vp) * * Notes on lockless counter manipulation: * _vhold, vputx and other routines make various decisions based - * on either holdcnt or usecount being 0. As long as either contuner + * on either holdcnt or usecount being 0. As long as either counter * is not transitioning 0->1 nor 1->0, the manipulation can be done - * with atomic operations. Otherwise the interlock is taken. + * with atomic operations. Otherwise the interlock is taken covering + * both the atomic and additional actions. */ int vget(struct vnode *vp, int flags, struct thread *td) From owner-svn-src-head@freebsd.org Mon Jun 20 16:12:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42C66A7B93A; Mon, 20 Jun 2016 16:12:28 +0000 (UTC) (envelope-from adrian@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 1AF271EF1; Mon, 20 Jun 2016 16:12:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5KGCRQT093473; Mon, 20 Jun 2016 16:12:27 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5KGCR1c093472; Mon, 20 Jun 2016 16:12:27 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606201612.u5KGCR1c093472@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 20 Jun 2016 16:12:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302030 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 16:12:28 -0000 Author: adrian Date: Mon Jun 20 16:12:27 2016 New Revision: 302030 URL: https://svnweb.freebsd.org/changeset/base/302030 Log: [ath] implement TX queue configuration extensions for the AR9380 HAL. Among other things, this introduces the idea of DBA-gated queues that aren't the CABQ. The TDMA support requires this. Tested: * AR9580 (hostap mode) * AR9380 (sta mode) Approved by: re (gjb) Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c Mon Jun 20 15:45:50 2016 (r302029) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_xmit.c Mon Jun 20 16:12:27 2016 (r302030) @@ -368,19 +368,40 @@ ar9300_reset_tx_queue(struct ath_hal *ah OS_REG_WRITE(ah, AR_DCHNTIME(q), SM(qi->tqi_burstTime, AR_D_CHNTIME_DUR) | (qi->tqi_burstTime ? AR_D_CHNTIME_EN : 0)); - if (qi->tqi_burstTime && - (qi->tqi_qflags & HAL_TXQ_RDYTIME_EXP_POLICY_ENABLE)) - { + if (qi->tqi_readyTime && + (qi->tqi_qflags & HAL_TXQ_RDYTIME_EXP_POLICY_ENABLE)) qmisc |= AR_Q_MISC_RDYTIME_EXP_POLICY; + if (qi->tqi_qflags & HAL_TXQ_DBA_GATED) + qmisc = (qmisc &~ AR_Q_MISC_FSP) | AR_Q_MISC_FSP_DBA_GATED; + if (MS(qmisc, AR_Q_MISC_FSP) != AR_Q_MISC_FSP_ASAP) { + /* + * These are meangingful only when not scheduled asap. + */ + if (qi->tqi_qflags & HAL_TXQ_CBR_DIS_BEMPTY) + qmisc |= AR_Q_MISC_CBR_INCR_DIS0; + else + qmisc &= ~AR_Q_MISC_CBR_INCR_DIS0; + if (qi->tqi_qflags & HAL_TXQ_CBR_DIS_QEMPTY) + qmisc |= AR_Q_MISC_CBR_INCR_DIS1; + else + qmisc &= ~AR_Q_MISC_CBR_INCR_DIS1; } - if (qi->tqi_qflags & HAL_TXQ_BACKOFF_DISABLE) { + if (qi->tqi_qflags & HAL_TXQ_BACKOFF_DISABLE) dmisc |= AR_D_MISC_POST_FR_BKOFF_DIS; - } - - if (qi->tqi_qflags & HAL_TXQ_FRAG_BURST_BACKOFF_ENABLE) { + if (qi->tqi_qflags & HAL_TXQ_FRAG_BURST_BACKOFF_ENABLE) dmisc |= AR_D_MISC_FRAG_BKOFF_EN; - } + if (qi->tqi_qflags & HAL_TXQ_ARB_LOCKOUT_GLOBAL) + dmisc |= SM(AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL, + AR_D_MISC_ARB_LOCKOUT_CNTRL); + else if (qi->tqi_qflags & HAL_TXQ_ARB_LOCKOUT_INTRA) + dmisc |= SM(AR_D_MISC_ARB_LOCKOUT_CNTRL_INTRA_FR, + AR_D_MISC_ARB_LOCKOUT_CNTRL); + if (qi->tqi_qflags & HAL_TXQ_IGNORE_VIRTCOL) + dmisc |= SM(AR_D_MISC_VIR_COL_HANDLING_IGNORE, + AR_D_MISC_VIR_COL_HANDLING); + if (qi->tqi_qflags & HAL_TXQ_SEQNUM_INC_DIS) + dmisc |= AR_D_MISC_SEQ_NUM_INCR_DIS; switch (qi->tqi_type) { case HAL_TX_QUEUE_BEACON: /* beacon frames */ @@ -433,9 +454,8 @@ ar9300_reset_tx_queue(struct ath_hal *ah SM(TU_TO_USEC(value), AR_Q_RDYTIMECFG_DURATION) | AR_Q_RDYTIMECFG_EN); } - - dmisc |= (AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL << - AR_D_MISC_ARB_LOCKOUT_CNTRL_S); + dmisc |= SM(AR_D_MISC_ARB_LOCKOUT_CNTRL_GLOBAL, + AR_D_MISC_ARB_LOCKOUT_CNTRL); break; case HAL_TX_QUEUE_PSPOLL: /* From owner-svn-src-head@freebsd.org Mon Jun 20 18:14:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0418FA7AA8A; Mon, 20 Jun 2016 18:14:53 +0000 (UTC) (envelope-from slm@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 B9AC7286B; Mon, 20 Jun 2016 18:14:52 +0000 (UTC) (envelope-from slm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5KIEpKu044797; Mon, 20 Jun 2016 18:14:51 GMT (envelope-from slm@FreeBSD.org) Received: (from slm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5KIEpIh044790; Mon, 20 Jun 2016 18:14:51 GMT (envelope-from slm@FreeBSD.org) Message-Id: <201606201814.u5KIEpIh044790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slm set sender to slm@FreeBSD.org using -f From: Stephen McConnell Date: Mon, 20 Jun 2016 18:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302031 - head/sys/dev/mps X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 18:14:53 -0000 Author: slm Date: Mon Jun 20 18:14:51 2016 New Revision: 302031 URL: https://svnweb.freebsd.org/changeset/base/302031 Log: - No log bit in IOCStatus and endian-safe changes. Use MPI2_IOCSTATUS_MASK when checking IOCStatus to mask off the log bit, and make a few more things endian-safe. - Fix possible use of invalid pointer. It was possible to use an invalid pointer to get the target ID value. To fix this, initialize a local Target ID variable to an invalid value and change that variable to a valid value only if the pointer to the Target ID is not NULL. - No need to set the MPSSAS_SHUTDOWN flag because it's never used. - done_ccb pointer can be used if it is NULL. To prevent this, move check for done_ccb == NULL to before done_ccb is used in mpssas_stop_unit_done(). - Disks can go missing until a reboot is done in some cases. This is due to the DevHandle not being released, which causes the Firmware to not allow that disk to be re-added. Reviewed by: ken Approved by: re (gjb), ken, scottl, ambrisko (mentors) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6872 Modified: head/sys/dev/mps/mps.c head/sys/dev/mps/mps_config.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_sas_lsi.c head/sys/dev/mps/mps_user.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Mon Jun 20 16:12:27 2016 (r302030) +++ head/sys/dev/mps/mps.c Mon Jun 20 18:14:51 2016 (r302031) @@ -1922,9 +1922,10 @@ mps_intr_locked(void *data) */ rel_rep = (MPI2_DIAG_RELEASE_REPLY *)reply; - if (le16toh(rel_rep->IOCStatus) == + if ((le16toh(rel_rep->IOCStatus) & + MPI2_IOCSTATUS_MASK) == MPI2_IOCSTATUS_DIAGNOSTIC_RELEASED) - { + { pBuffer = &sc->fw_diag_buffer_list[ rel_rep->BufferType]; Modified: head/sys/dev/mps/mps_config.c ============================================================================== --- head/sys/dev/mps/mps_config.c Mon Jun 20 16:12:27 2016 (r302030) +++ head/sys/dev/mps/mps_config.c Mon Jun 20 18:14:51 2016 (r302031) @@ -499,7 +499,8 @@ mps_wd_config_pages(struct mps_softc *sc */ if (mps_config_get_raid_volume_pg0(sc, &mpi_reply, raid_vol_pg0, (u32)raid_vol_pg0->DevHandle)) { - if (mpi_reply.IOCStatus != + if ((le16toh(mpi_reply.IOCStatus) & + MPI2_IOCSTATUS_MASK) != MPI2_IOCSTATUS_CONFIG_INVALID_PAGE) { mps_dprint(sc, MPS_FAULT, "Multiple RAID Volume Page0! Direct Drive " Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Mon Jun 20 16:12:27 2016 (r302030) +++ head/sys/dev/mps/mps_sas.c Mon Jun 20 18:14:51 2016 (r302031) @@ -241,6 +241,8 @@ mpssas_alloc_tm(struct mps_softc *sc) void mpssas_free_tm(struct mps_softc *sc, struct mps_command *tm) { + int target_id = 0xFFFFFFFF; + if (tm == NULL) return; @@ -251,10 +253,11 @@ mpssas_free_tm(struct mps_softc *sc, str */ if (tm->cm_targ != NULL) { tm->cm_targ->flags &= ~MPSSAS_TARGET_INRESET; + target_id = tm->cm_targ->tid; } if (tm->cm_ccb) { mps_dprint(sc, MPS_INFO, "Unfreezing devq for target ID %d\n", - tm->cm_targ->tid); + target_id); xpt_release_devq(tm->cm_ccb->ccb_h.path, 1, TRUE); xpt_free_path(tm->cm_ccb->ccb_h.path); xpt_free_ccb(tm->cm_ccb); @@ -372,12 +375,11 @@ mpssas_remove_volume(struct mps_softc *s return; } - if (reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) { - mps_dprint(sc, MPS_FAULT, + if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != + MPI2_IOCSTATUS_SUCCESS) { + mps_dprint(sc, MPS_ERROR, "IOCStatus = 0x%x while resetting device 0x%x\n", - reply->IOCStatus, handle); - mpssas_free_tm(sc, tm); - return; + le16toh(reply->IOCStatus), handle); } mps_dprint(sc, MPS_XINFO, @@ -394,7 +396,8 @@ mpssas_remove_volume(struct mps_softc *s * this target id if possible, and so we can assign the same target id * to this device if it comes back in the future. */ - if (reply->IOCStatus == MPI2_IOCSTATUS_SUCCESS) { + if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) == + MPI2_IOCSTATUS_SUCCESS) { targ = tm->cm_targ; targ->handle = 0x0; targ->encl_handle = 0x0; @@ -567,24 +570,22 @@ mpssas_remove_device(struct mps_softc *s "%s: cm_flags = %#x for remove of handle %#04x! " "This should not happen!\n", __func__, tm->cm_flags, handle); - mpssas_free_tm(sc, tm); - return; } if (reply == NULL) { /* XXX retry the remove after the diag reset completes? */ mps_dprint(sc, MPS_FAULT, - "%s NULL reply reseting device 0x%04x\n", __func__, handle); + "%s NULL reply resetting device 0x%04x\n", __func__, + handle); mpssas_free_tm(sc, tm); return; } - if (le16toh(reply->IOCStatus) != MPI2_IOCSTATUS_SUCCESS) { - mps_dprint(sc, MPS_FAULT, + if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != + MPI2_IOCSTATUS_SUCCESS) { + mps_dprint(sc, MPS_ERROR, "IOCStatus = 0x%x while resetting device 0x%x\n", le16toh(reply->IOCStatus), handle); - mpssas_free_tm(sc, tm); - return; } mps_dprint(sc, MPS_XINFO, "Reset aborted %u commands\n", @@ -662,7 +663,8 @@ mpssas_remove_complete(struct mps_softc * this target id if possible, and so we can assign the same target id * to this device if it comes back in the future. */ - if (le16toh(reply->IOCStatus) == MPI2_IOCSTATUS_SUCCESS) { + if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) == + MPI2_IOCSTATUS_SUCCESS) { targ = tm->cm_targ; targ->handle = 0x0; targ->encl_handle = 0x0; @@ -880,7 +882,6 @@ mps_detach_sas(struct mps_softc *sc) cam_sim_free(sassc->sim, FALSE); } - sassc->flags |= MPSSAS_SHUTDOWN; mps_unlock(sc); if (sassc->devq != NULL) Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Mon Jun 20 16:12:27 2016 (r302030) +++ head/sys/dev/mps/mps_sas_lsi.c Mon Jun 20 18:14:51 2016 (r302031) @@ -1161,15 +1161,15 @@ mpssas_stop_unit_done(struct cam_periph struct mpssas_softc *sassc; char path_str[64]; + if (done_ccb == NULL) + return; + sassc = (struct mpssas_softc *)done_ccb->ccb_h.ppriv_ptr1; xpt_path_string(done_ccb->ccb_h.path, path_str, sizeof(path_str)); mps_dprint(sassc->sc, MPS_INFO, "Completing stop unit for %s\n", path_str); - if (done_ccb == NULL) - return; - /* * Nothing more to do except free the CCB and path. If the command * timed out, an abort reset, then target reset will be issued during Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Mon Jun 20 16:12:27 2016 (r302030) +++ head/sys/dev/mps/mps_user.c Mon Jun 20 18:14:51 2016 (r302031) @@ -1220,12 +1220,14 @@ mps_post_fw_diag_buffer(struct mps_softc * Process POST reply. */ reply = (MPI2_DIAG_BUFFER_POST_REPLY *)cm->cm_reply; - if (reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) { + if ((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != + MPI2_IOCSTATUS_SUCCESS) { status = MPS_DIAG_FAILURE; mps_dprint(sc, MPS_FAULT, "%s: post of FW Diag Buffer failed " "with IOCStatus = 0x%x, IOCLogInfo = 0x%x and " - "TransferLength = 0x%x\n", __func__, reply->IOCStatus, - reply->IOCLogInfo, reply->TransferLength); + "TransferLength = 0x%x\n", __func__, + le16toh(reply->IOCStatus), le32toh(reply->IOCLogInfo), + le32toh(reply->TransferLength)); goto done; } @@ -1304,12 +1306,13 @@ mps_release_fw_diag_buffer(struct mps_so * Process RELEASE reply. */ reply = (MPI2_DIAG_RELEASE_REPLY *)cm->cm_reply; - if ((reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) || - pBuffer->owned_by_firmware) { + if (((le16toh(reply->IOCStatus) & MPI2_IOCSTATUS_MASK) != + MPI2_IOCSTATUS_SUCCESS) || pBuffer->owned_by_firmware) { status = MPS_DIAG_FAILURE; mps_dprint(sc, MPS_FAULT, "%s: release of FW Diag Buffer " "failed with IOCStatus = 0x%x and IOCLogInfo = 0x%x\n", - __func__, reply->IOCStatus, reply->IOCLogInfo); + __func__, le16toh(reply->IOCStatus), + le32toh(reply->IOCLogInfo)); goto done; } Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Mon Jun 20 16:12:27 2016 (r302030) +++ head/sys/dev/mps/mpsvar.h Mon Jun 20 18:14:51 2016 (r302031) @@ -33,7 +33,7 @@ #ifndef _MPSVAR_H #define _MPSVAR_H -#define MPS_DRIVER_VERSION "20.00.00.00-fbsd" +#define MPS_DRIVER_VERSION "21.00.00.00-fbsd" #define MPS_DB_MAX_WAIT 2500 From owner-svn-src-head@freebsd.org Mon Jun 20 19:14:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1D604AC4D19 for ; Mon, 20 Jun 2016 19:14:15 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) (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 C02AF2FB0 for ; Mon, 20 Jun 2016 19:14:14 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f48.google.com with SMTP id q132so43890677lfe.3 for ; Mon, 20 Jun 2016 12:14:14 -0700 (PDT) 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-transfer-encoding; bh=iyxKpX4UwXDyl6+RtcmYonJ2/ppbeeZNmspQT4kygEc=; b=Tr5SCmV6279DU/A3T8KMipmWCBS0T7dnLK21hws6sFDah81DwvJkXf6XXIHIpDFrmu r7fvrjU+B+KQatHhsXV880a5X4aU4u2B5ezvFqhE22E2L7uRG5FeYNm3303MnUihk1Jh tepgzz4+VZZkYD8B9hegfVzY4CxhtK3VCTtQVUOWDzOjqBkciusIMfcdHi5JlztQWa/G Q74HgMkeu/4ilLfq4+OR6edOiQCOYx93WGBR8yYEeTOcR0x25yy4jAXqY+309domWshr LieZoD57S7oTfTPQuXuAZmIZ24bVas1QSP78qSpKQVAUjeQ4O6fu3j4+l6+Nod2w9GP+ F40A== X-Gm-Message-State: ALyK8tJtwAElQfpMZqddjJK1AibbWEAB3xeeNDzBx1JtT14vg6kcaYabtgye0nRlj2RhLA== X-Received: by 10.25.152.1 with SMTP id a1mr3756950lfe.33.1466450046320; Mon, 20 Jun 2016 12:14:06 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id dw5sm1241626lbc.26.2016.06.20.12.14.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Jun 2016 12:14:05 -0700 (PDT) Subject: Re: svn commit: r302026 - in head: share/monetdef share/msgdef share/numericdef share/timedef tools/tools/locale/tools To: Baptiste Daroussin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606200645.u5K6jhBr081752@repo.freebsd.org> From: Andrey Chernov Message-ID: <0de854da-5914-901a-3d15-41429808ace1@freebsd.org> Date: Mon, 20 Jun 2016 22:14:04 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606200645.u5K6jhBr081752@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 19:14:15 -0000 On 20.06.2016 9:45, Baptiste Daroussin wrote: > Author: bapt > Date: Mon Jun 20 06:45:42 2016 > New Revision: 302026 > URL: https://svnweb.freebsd.org/changeset/base/302026 > > Log: > Fix generation of locales with multiple variants Thanx. Just want to note, even if we stay with RFC 5646 language tags instead of ISO 639 ones with @modifier (per ISO 15897), current tags are incorrect because have "_" instead of "-" which makes parsing harder, because "_" is territory separator and someone may not expect several "_" exists. Per RFC 5646 we need names like sr-Cyrl_RS.UTF-8.src and not sr_Cyrl_RS.UTF-8.src From owner-svn-src-head@freebsd.org Mon Jun 20 21:27:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39C0FAC4AB6; Mon, 20 Jun 2016 21:27:13 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-lf0-x235.google.com (mail-lf0-x235.google.com [IPv6:2a00:1450:4010:c07::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 C912A1344; Mon, 20 Jun 2016 21:27:12 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-lf0-x235.google.com with SMTP id f6so47729810lfg.0; Mon, 20 Jun 2016 14:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=x5G3vTJ737rQT176wTe9zZaWH2Wb5+GQ98PoSWsaLMo=; b=QFCXAIY8SEjt2J+Q8aVjvCW0OsIE7Sl2dJb2D5bidB+wiGrBt6iVCT3z4lfyIC+LSx 0vHrV3wVT7v3J33SQ2HT0tIj/a7iUy5LmyC3TdJX0thIitR4GjG1wAuD6syNxZK6dK1Z gNhdt7cSRerUJj6ZjzMRCbOZO9mYesb+eQpinQlRp0dDlbmSPlKqV/h9j8fPEsq93vSH sCIY/L/28bvcfOpwL0SvxHM+hDhJsKZctSYA85+J8ri6rOH4CeHICbIkMBfOSsqz+Cdt rwxPBzw/45DzaM1qq0qa5NpmZLWt5gJFDFn4Eh5qgruXvsy4FoJ1QWSYEubDDaf/+53F cvuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=x5G3vTJ737rQT176wTe9zZaWH2Wb5+GQ98PoSWsaLMo=; b=nJfBcBeGkZHebE9QstDp6HM8wPlpG0+8IEIkGpkR1m9QCu2D4ucMLtn4PV3UWVldg7 fe965L1mNNij92hdJD1InBDuRLR68CYW1a0DhXv2ovY+kx7Rj+R4bvn7kJvOl15IHxzR x6M+cELr9QgXlLc/Bu5hXUV5UjAZSM0RnuSkPCz46WrrbfPCmjE7NeIH8gXfyTRpzFE0 cA5vfpwFPnhKRo1njhbj2Umrv+reZoadVAXYS41N6qJfmmdC9gymxIrIjv2crm0HGs8B aG0Cd7bU/5DjH0cJM5UV1Z+1alwUq5a6bpnZzJcXjnO52OfcNniU6hVkeZOs9oe0Nvo0 quXQ== X-Gm-Message-State: ALyK8tIzDNBptYUrVMS8VlrnCiURHi0xwuTsPRmVSIKWpy5lmMgCmmLR4PnpbIKOEfAklg== X-Received: by 10.28.48.15 with SMTP id w15mr69831wmw.28.1466458030181; Mon, 20 Jun 2016 14:27:10 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id zg10sm41028165wjb.1.2016.06.20.14.27.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Jun 2016 14:27:09 -0700 (PDT) Sender: Baptiste Daroussin Date: Mon, 20 Jun 2016 23:27:08 +0200 From: Baptiste Daroussin To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302026 - in head: share/monetdef share/msgdef share/numericdef share/timedef tools/tools/locale/tools Message-ID: <20160620212708.6hckbjzqntihtiba@ivaldir.etoilebsd.net> References: <201606200645.u5K6jhBr081752@repo.freebsd.org> <0de854da-5914-901a-3d15-41429808ace1@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jf2slo6kygmfunon" Content-Disposition: inline In-Reply-To: <0de854da-5914-901a-3d15-41429808ace1@freebsd.org> User-Agent: Mutt/1.6.1-neo (2016-06-11) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 21:27:13 -0000 --jf2slo6kygmfunon Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 20, 2016 at 10:14:04PM +0300, Andrey Chernov wrote: > On 20.06.2016 9:45, Baptiste Daroussin wrote: > > Author: bapt > > Date: Mon Jun 20 06:45:42 2016 > > New Revision: 302026 > > URL: https://svnweb.freebsd.org/changeset/base/302026 > >=20 > > Log: > > Fix generation of locales with multiple variants >=20 > Thanx. > Just want to note, even if we stay with RFC 5646 language tags instead > of ISO 639 ones with @modifier (per ISO 15897), current tags are > incorrect because have "_" instead of "-" which makes parsing harder, > because "_" is territory separator and someone may not expect several > "_" exists. Per RFC 5646 we need names like > sr-Cyrl_RS.UTF-8.src > and not > sr_Cyrl_RS.UTF-8.src >=20 I'm going to move to the @modifier, just it needs a first step which was fi= xing the locales with multiple variants. Just give me a bit of time Best regards, Bapt --jf2slo6kygmfunon Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXaF+mAAoJEGOJi9zxtz5aB00P/2To7SHuBEsAN4SVriEbg5i5 xIbWaI+tX69ei1FZWgT5HkdxBCgp627HSD4zb4A+iAWr7DXfG3OKmWtCNU+o8Y3Q 0suJavazP5hOejJojmObx4s7ZJA0i7TvQbYEzfWHn70UzMhbdk5PLmGiKIfhX6GU TfVu0YZgw6LpRtOpzpz5cVnXJSTnrye/xQEnxXkhgICCgF8IPBQJmNjB2QSBolvI +3i8a+Kc200SKQkijXOgYiPmPSnZSmL+1HDY8Sko9FLRed6tVLS+tH9KBe0WB+ml XpAUjpHAhVB8Cuu1o+xk/jxLCXkGF8X4k8fvCOVHcAjLpGYTlVPvmrj/WERDbL60 zMgwVj1nIW986PHwc+eQRCVFhrTmKyEjxvEmIza4Txhncus8Dey0edKGM+USYV1q R65YgG11CryF+v1tVrJUzblLpOW3gM/QfsYNBF0+zCRNs2Vuky5+HH40eAx6EroJ FxRN+8bQd0XBj4JJQc3zLDmDoPBXkR2IzW1Uk4orHMduEx2lhbnxOribBzg+4J09 YvZIoaJecJGnx1vqjTniBJUWnqxwPDmPBGidBAX/6J84KPEdoO46x7EVjVAP73pW 4IJK3hHWyMMv/XffenIZqxucLNQ5K4LE4UT8P7J01AwnTM2YqJViSKAgfFR9m04W /fenBavz6ZgoS719lGf4 =HZWO -----END PGP SIGNATURE----- --jf2slo6kygmfunon-- From owner-svn-src-head@freebsd.org Mon Jun 20 22:39:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06454AC4054; Mon, 20 Jun 2016 22:39:34 +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 BC6D71CB8; Mon, 20 Jun 2016 22:39:33 +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 u5KMdWvF042732; Mon, 20 Jun 2016 22:39:32 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5KMdWaa042731; Mon, 20 Jun 2016 22:39:32 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606202239.u5KMdWaa042731@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 20 Jun 2016 22:39:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302034 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 22:39:34 -0000 Author: avos Date: Mon Jun 20 22:39:32 2016 New Revision: 302034 URL: https://svnweb.freebsd.org/changeset/base/302034 Log: urtwn: fix panic on device detach. Remove frames from active/pending Tx queues and free related node references when vap is destroyed to prevent various use-after-free scenarios. Reported and tested by: Aleksander Alekseev PR: 208632 Approved by: re (gjb) Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Mon Jun 20 22:05:59 2016 (r302033) +++ head/sys/dev/urtwn/if_urtwn.c Mon Jun 20 22:39:32 2016 (r302034) @@ -208,6 +208,10 @@ static struct ieee80211vap *urtwn_vap_cr const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN]); static void urtwn_vap_delete(struct ieee80211vap *); +static void urtwn_vap_clear_tx(struct urtwn_softc *, + struct ieee80211vap *); +static void urtwn_vap_clear_tx_queue(struct urtwn_softc *, + urtwn_datahead *, struct ieee80211vap *); static struct mbuf * urtwn_rx_copy_to_mbuf(struct urtwn_softc *, struct r92c_rx_stat *, int); static struct mbuf * urtwn_report_intr(struct usb_xfer *, @@ -824,8 +828,16 @@ urtwn_vap_delete(struct ieee80211vap *va struct urtwn_softc *sc = ic->ic_softc; struct urtwn_vap *uvp = URTWN_VAP(vap); + /* Guarantee that nothing will go through this vap. */ + ieee80211_new_state(vap, IEEE80211_S_INIT, -1); + ieee80211_draintask(ic, &vap->iv_nstate_task); + + URTWN_LOCK(sc); if (uvp->bcn_mbuf != NULL) m_freem(uvp->bcn_mbuf); + /* Cancel any unfinished Tx. */ + urtwn_vap_clear_tx(sc, vap); + URTWN_UNLOCK(sc); if (vap->iv_opmode == IEEE80211_M_IBSS) ieee80211_draintask(ic, &uvp->tsf_task_adhoc); if (URTWN_CHIP_HAS_RATECTL(sc)) @@ -834,6 +846,41 @@ urtwn_vap_delete(struct ieee80211vap *va free(uvp, M_80211_VAP); } +static void +urtwn_vap_clear_tx(struct urtwn_softc *sc, struct ieee80211vap *vap) +{ + + URTWN_ASSERT_LOCKED(sc); + + urtwn_vap_clear_tx_queue(sc, &sc->sc_tx_active, vap); + urtwn_vap_clear_tx_queue(sc, &sc->sc_tx_pending, vap); +} + +static void +urtwn_vap_clear_tx_queue(struct urtwn_softc *sc, urtwn_datahead *head, + struct ieee80211vap *vap) +{ + struct urtwn_data *dp, *tmp; + + STAILQ_FOREACH_SAFE(dp, head, next, tmp) { + if (dp->ni != NULL) { + if (dp->ni->ni_vap == vap) { + ieee80211_free_node(dp->ni); + dp->ni = NULL; + + if (dp->m != NULL) { + m_freem(dp->m); + dp->m = NULL; + } + + STAILQ_REMOVE(head, dp, urtwn_data, next); + STAILQ_INSERT_TAIL(&sc->sc_tx_inactive, dp, + next); + } + } + } +} + static struct mbuf * urtwn_rx_copy_to_mbuf(struct urtwn_softc *sc, struct r92c_rx_stat *stat, int totlen) From owner-svn-src-head@freebsd.org Mon Jun 20 22:45:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D43EAAC4275; Mon, 20 Jun 2016 22:45:20 +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 AB24920CD; Mon, 20 Jun 2016 22:45:20 +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 u5KMjJxd046232; Mon, 20 Jun 2016 22:45:19 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5KMjJLv046231; Mon, 20 Jun 2016 22:45:19 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606202245.u5KMjJLv046231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Mon, 20 Jun 2016 22:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302035 - head/sys/dev/rtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 22:45:20 -0000 Author: avos Date: Mon Jun 20 22:45:19 2016 New Revision: 302035 URL: https://svnweb.freebsd.org/changeset/base/302035 Log: rtwn: fix Tx processing, add some busdma synchronization. 1) Unload mbuf instead of descriptor in rtwn_tx_done(). 2) Add more synchronization for device visible mappings before touching the memory. 3) Improve watchdog timer logic. Reported and tested by: mva Approved by: re (gjb) Modified: head/sys/dev/rtwn/if_rtwn.c Modified: head/sys/dev/rtwn/if_rtwn.c ============================================================================== --- head/sys/dev/rtwn/if_rtwn.c Mon Jun 20 22:39:32 2016 (r302034) +++ head/sys/dev/rtwn/if_rtwn.c Mon Jun 20 22:45:19 2016 (r302035) @@ -586,6 +586,9 @@ rtwn_free_rx_list(struct rtwn_softc *sc) if (rx_ring->desc_dmat != NULL) { if (rx_ring->desc != NULL) { + bus_dmamap_sync(rx_ring->desc_dmat, + rx_ring->desc_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(rx_ring->desc_dmat, rx_ring->desc_map); bus_dmamem_free(rx_ring->desc_dmat, rx_ring->desc, @@ -600,6 +603,8 @@ rtwn_free_rx_list(struct rtwn_softc *sc) rx_data = &rx_ring->rx_data[i]; if (rx_data->m != NULL) { + bus_dmamap_sync(rx_ring->data_dmat, + rx_data->map, BUS_DMASYNC_POSTREAD); bus_dmamap_unload(rx_ring->data_dmat, rx_data->map); m_freem(rx_data->m); rx_data->m = NULL; @@ -643,6 +648,8 @@ rtwn_alloc_tx_list(struct rtwn_softc *sc device_printf(sc->sc_dev, "could not load desc DMA map\n"); goto fail; } + bus_dmamap_sync(tx_ring->desc_dmat, tx_ring->desc_map, + BUS_DMASYNC_PREWRITE); error = bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 1, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, @@ -691,6 +698,8 @@ rtwn_reset_tx_list(struct rtwn_softc *sc sizeof(desc->nextdescaddr))); if (tx_data->m != NULL) { + bus_dmamap_sync(tx_ring->data_dmat, tx_data->map, + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(tx_ring->data_dmat, tx_data->map); m_freem(tx_data->m); tx_data->m = NULL; @@ -718,6 +727,8 @@ rtwn_free_tx_list(struct rtwn_softc *sc, if (tx_ring->desc_dmat != NULL) { if (tx_ring->desc != NULL) { + bus_dmamap_sync(tx_ring->desc_dmat, + tx_ring->desc_map, BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(tx_ring->desc_dmat, tx_ring->desc_map); bus_dmamem_free(tx_ring->desc_dmat, tx_ring->desc, @@ -730,6 +741,8 @@ rtwn_free_tx_list(struct rtwn_softc *sc, tx_data = &tx_ring->tx_data[i]; if (tx_data->m != NULL) { + bus_dmamap_sync(tx_ring->data_dmat, tx_data->map, + BUS_DMASYNC_POSTWRITE); bus_dmamap_unload(tx_ring->data_dmat, tx_data->map); m_freem(tx_data->m); tx_data->m = NULL; @@ -1761,7 +1774,10 @@ rtwn_tx_done(struct rtwn_softc *sc, int if (le32toh(tx_desc->txdw0) & R92C_TXDW0_OWN) continue; - bus_dmamap_unload(tx_ring->desc_dmat, tx_ring->desc_map); + /* Unmap and free mbuf. */ + bus_dmamap_sync(tx_ring->data_dmat, tx_data->map, + BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(tx_ring->data_dmat, tx_data->map); /* * XXX TODO: figure out whether the transmit succeeded or not. @@ -1771,8 +1787,10 @@ rtwn_tx_done(struct rtwn_softc *sc, int tx_data->ni = NULL; tx_data->m = NULL; - sc->sc_tx_timer = 0; - tx_ring->queued--; + if (--tx_ring->queued) + sc->sc_tx_timer = 5; + else + sc->sc_tx_timer = 0; } if (tx_ring->queued < (RTWN_TX_LIST_COUNT - 1)) From owner-svn-src-head@freebsd.org Mon Jun 20 23:17:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 995C4AC4D72; Mon, 20 Jun 2016 23:17:01 +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 6AC32123C; Mon, 20 Jun 2016 23:17:01 +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 u5KNH09T057421; Mon, 20 Jun 2016 23:17:00 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5KNH0TH057420; Mon, 20 Jun 2016 23:17:00 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201606202317.u5KNH0TH057420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 20 Jun 2016 23:17:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302036 - head/tests/sys/acl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 20 Jun 2016 23:17:01 -0000 Author: asomers Date: Mon Jun 20 23:17:00 2016 New Revision: 302036 URL: https://svnweb.freebsd.org/changeset/base/302036 Log: Skip sys/acl tests on systems lacking perl tests/sys/acl/Makefile add perl to the required_programs for all tests in this directory Reviewed by: ngie Approved by: re (gjb) MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6870 Modified: head/tests/sys/acl/Makefile Modified: head/tests/sys/acl/Makefile ============================================================================== --- head/tests/sys/acl/Makefile Mon Jun 20 22:45:19 2016 (r302035) +++ head/tests/sys/acl/Makefile Mon Jun 20 23:17:00 2016 (r302036) @@ -27,11 +27,11 @@ TEST_METADATA.$t+= required_user="root" _ACL_PROGS= getfacl setfacl .for t in 01 03 04 -TEST_METADATA.$t+= required_programs="zpool ${_ACL_PROGS}" +TEST_METADATA.$t+= required_programs="perl zpool ${_ACL_PROGS}" .endfor .for t in 00 02 -TEST_METADATA.$t+= required_programs="${_ACL_PROGS}" +TEST_METADATA.$t+= required_programs="perl ${_ACL_PROGS}" .endfor .include From owner-svn-src-head@freebsd.org Tue Jun 21 07:12:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A41F7AC5174; Tue, 21 Jun 2016 07:12:54 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-lf0-x22d.google.com (mail-lf0-x22d.google.com [IPv6:2a00:1450:4010:c07::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 1962D1D54; Tue, 21 Jun 2016 07:12:54 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-lf0-x22d.google.com with SMTP id q132so9230245lfe.3; Tue, 21 Jun 2016 00:12:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=7dQih5MafRpb5XkR2BBSUc2uV4n2jT9z28WQhJhsJlo=; b=MJeXKy7Ry9W16yAilrCqSdfYYQw6A4h5ZovK4TGlR4zQV3s7rzgeE0NfJKedF5/QIH uP4A+ef/rImkOkAqcKockMc+t1yjcyg6cK+KVFJimvMzPkB7wacAAfqMO/x0gzv3ohyu 2dgEMmXJzhoBESWOW4+JQG1PWFNYFKor2Eyu92+XeSId5E9bhWZ6XsfRkvEyiU2alUJh adrqetk96S37I9n1l6bNpSZXKbC51dxc7D7ChhXcjzWluC/SZdip+Bn2/RP9r2Gxh+qe 8Zorc78MbmCuuMDK4M31ad9uuAOqZxFwkFCgabcFsDjOvRg9zo1D4maRn0lL32iT+bIU Yt3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=7dQih5MafRpb5XkR2BBSUc2uV4n2jT9z28WQhJhsJlo=; b=bSzIongaHDbpm1uAYOdifjXaqqYHiPSWftgKT2Bh4zFi3FooK3KypL0PmmwfuXVv10 67laEVQIYSYE1D5KDAjRGUxrhWWiBnIPZVGLMYqRyymqHHGH9p1Y2DsXuKAJfRNwRMGr cjvLLD1sGc3FGbMCA4zQF6pewpeh7Ru/UmdXzRbtHSbXqldqrXCgr/sPBERB+i60QMHg 5NKCk9ORifnKcS4x32QA3u9/6+Cd6gENB+xMTYC87nV12WP/C697JX79DRugEH++wNc/ dQoH015X3Hw0n5aPPB406OCbHuq+ZUNQpQTga/gsQsWTpnxqZdM10MqCFczO46oYPtMv ywHg== X-Gm-Message-State: ALyK8tJT6Zlqd6qr1HkT7rH9Axj+UlBTwZmwuGS8LvjdDIrGKTtMzYBa2mWfXf+1c1SuoQ== X-Received: by 10.28.166.23 with SMTP id p23mr1648220wme.58.1466493171597; Tue, 21 Jun 2016 00:12:51 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id t188sm1466204wma.8.2016.06.21.00.12.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jun 2016 00:12:50 -0700 (PDT) Sender: Baptiste Daroussin Date: Tue, 21 Jun 2016 09:12:49 +0200 From: Baptiste Daroussin To: Andrey Chernov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302026 - in head: share/monetdef share/msgdef share/numericdef share/timedef tools/tools/locale/tools Message-ID: <20160621071249.coi44qjecd67hz32@ivaldir.etoilebsd.net> References: <201606200645.u5K6jhBr081752@repo.freebsd.org> <0de854da-5914-901a-3d15-41429808ace1@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="24bdtrqibjdslz6r" Content-Disposition: inline In-Reply-To: <0de854da-5914-901a-3d15-41429808ace1@freebsd.org> User-Agent: Mutt/1.6.1-neo (2016-06-11) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 07:12:54 -0000 --24bdtrqibjdslz6r Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jun 20, 2016 at 10:14:04PM +0300, Andrey Chernov wrote: > On 20.06.2016 9:45, Baptiste Daroussin wrote: > > Author: bapt > > Date: Mon Jun 20 06:45:42 2016 > > New Revision: 302026 > > URL: https://svnweb.freebsd.org/changeset/base/302026 > >=20 > > Log: > > Fix generation of locales with multiple variants >=20 > Thanx. > Just want to note, even if we stay with RFC 5646 language tags instead > of ISO 639 ones with @modifier (per ISO 15897), current tags are > incorrect because have "_" instead of "-" which makes parsing harder, > because "_" is territory separator and someone may not expect several > "_" exists. Per RFC 5646 we need names like > sr-Cyrl_RS.UTF-8.src > and not > sr_Cyrl_RS.UTF-8.src >=20 I have a patch that create the @modifier version meaning for instance: sr_RS.UTF-8@[modifier] it also adds an alias sr_RS.UTF-8 which is the cyrillic version (following = the what has been done on linux for this locale) I am seeking for your opinion on a policy to handle the locales with varian= ts. I am hesitating between 2 options: 1/ Provide all locales that may have modifier: - for sr_RS: sr_RS.UTF-8@cyrillic sr_RS.UTF-8@latin and sr_RS.UTF-8 (which is actually the same as sr_RS.UTF-8@cyrillic) - for zh_TW zh_TW.UTF-8@hant and zh_TW.UTF-8 (which is an alias on zh_TW.UTF-8@hant) - for mn_MN mn_MN.UTF-8@cyrillic mn_MN.UTF-8 (which is an alias on mn_MN.UTF-8@cyrillic) 2/ Only provide the @version for the ones for which we have an ambiguity - for sr_RS: sr_RS.UTF-8@latin sr_RS.UTF-8 (would be the cyrillic one) - for zh_TW zh_TW.UTF-8 (no @modifier version) - for mn_MN mn_MN.UTF-8 (no @modifier version) I do like the first (more explicit and simpler to do with our code while st= ill compatible with the second). Linux only does the second. But I understand the first can be confusing for languages with (for now) on= ly one variant supported like users asking themselves: which one should I choose: mn_MN.UTF-8 or mn_MN.UTF-8@cyrillic? They might not now they are actually the same Any opinion? Best regards Bapt --24bdtrqibjdslz6r Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXaOhZAAoJEGOJi9zxtz5ahX8QALqUh+/49ShThYKudtNNhvxT C3ROihA1eGSweACBAjJ5iprhZtgg0RmM4Jzdzwv+gsTkt92FrShRgdjcErxKUxRo qDwByMlA1b5+ZIETDYcURXkzYHDuMBXjWH58a+antv/6QChY+xPPdKiBuxafMJfy L+/SBKr8eb/WekHF1ZHhZmD6QuGbXtvWIiUPRmAjNlwSCMskn53EfOHOUB+FhD9y 0JSg4/mEVSeurh4aylP/+gEROHybH7X5UNzJMVKf2lYOFBs/b59jluLZhCsQn+Z4 HiI00svmPSisrAQI4ylQsFfxpgkJYvrmwCuxgsdmgiPdYoPJlGsEy9DJBw3bNrcE o16/4iSso4686X/gHqXtAdSFz/nfEJqRFVMalBoB8F/HNk22PWvXTHk9gnepfZvw Ht6OWxt+l51BKAntlYeYoOoH6XUjLOOUF8tEo4QxxtAjsTSlMHp2SXQxQb512S6C Ay+l8J2UhK1Efi10hEJHEmnkHDr4DF2CcAu7g57/Q8meNUuLFcsbjnpxwYph7Fcu 4nYYzQoOQhz2k0fRT3X+YvzR4PqXZVfZArBK+I4BqrREIS8Casbbsr2wCP7z4dxx lemfRAb454pgA22QEVJ1dEWRcbw/Yvwgjfd+0Y12kGoGDbJ+2gFEnitpCt6VkPOa rG8xlmii1lSMxZB1Deoc =VDVy -----END PGP SIGNATURE----- --24bdtrqibjdslz6r-- From owner-svn-src-head@freebsd.org Tue Jun 21 09:36:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F302AC5F63; Tue, 21 Jun 2016 09:36:31 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-lb0-x22b.google.com (mail-lb0-x22b.google.com [IPv6:2a00:1450:4010:c04::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 0D4442872; Tue, 21 Jun 2016 09:36:31 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-lb0-x22b.google.com with SMTP id xp5so6898057lbb.0; Tue, 21 Jun 2016 02:36:30 -0700 (PDT) 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-disposition:in-reply-to:user-agent; bh=jTKuvjRLStrRA/fOm9S/pzxjvaqa42lBkMxr+xPgxnc=; b=m5sucP3GAJezdEemHXLzYS3N0miLliynnjNokKYLiGwOZs7vcG24GzD/husg5doMzE EMz5OYgSXrWlxQhrbGSJg4OzV3e2YGdtR4Y6GgZNQpTflRDexRi9ggxJBYqYUeC3i3h2 jPfCiD6HbCg5KZVfG386k+pEZX49a/7vjq2MftN7njPpp3+c52xWBvV5h6Lf6B6ELOm8 0v1gS41CISNKOv+x0dbbTtleWxZiMWhWOgkfKFhzNKpctu5pJCqviXbxX7AM7DKHtdtD 70n2+vLHuMaDHGu7HOLQxp5PvvsTqvbb/QK8x7pOzOvrdIcwDZUfG3xfyfLX4cRZTnvo MxlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=jTKuvjRLStrRA/fOm9S/pzxjvaqa42lBkMxr+xPgxnc=; b=jrB7PsWIZAWTuHRBTQwiYPmbBryXL4bN/ZaLET9q4tPltgM7wOe7rQ72wC4y1Ry0t0 dqQofNRV/1hcs5UKmnlRjxPjQ6mCIdMIxE7bs0BDcAhGGnyYF21zzDOJQsojGxHec2Ub isRVpC2MN1MaEtaq+wUuvxHI8JXSIZ8MLYFlJgm031bMLtro1UKdefGF1DIjPWgV82V+ y6Xof6qTwyy0oDkLZjgdukp/0vZtFN/j39ky2roqL84K4in8cpOYuerpPsSeyvtA6C24 fis0hUtfuluyKtMd+1aST7I0qghkS7XxJNEFLWay+tJ4YS3/vHWXKm7T5Loyec9P0h4z xrQA== X-Gm-Message-State: ALyK8tLIJGmywPOAsbWTQuI4bGH/GuGle7jpCSj2CeM6Gnh/9/pUrfMFMM8ay89b2XJEZw== X-Received: by 10.194.235.4 with SMTP id ui4mr20092268wjc.23.1466501789081; Tue, 21 Jun 2016 02:36:29 -0700 (PDT) Received: from brick (acyt159.neoplus.adsl.tpnet.pl. [83.11.203.159]) by smtp.gmail.com with ESMTPSA id t67sm2093644wma.1.2016.06.21.02.36.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 21 Jun 2016 02:36:28 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Tue, 21 Jun 2016 11:36:24 +0200 From: Edward Tomasz =?utf-8?Q?Napiera=C5=82a?= To: Alexander Motin Cc: Cy Schubert , Jan Beich , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r299448 - in head/sys/cddl/contrib/opensolaris: common/acl uts/common/fs/zfs uts/common/sys Message-ID: <20160621093624.GD80346@brick> Mail-Followup-To: Alexander Motin , Cy Schubert , Jan Beich , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606191428.u5JESbbs053857@slippy.cwsent.com> <49d3d34d-ba91-ebdf-497f-cbe1614bec53@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49d3d34d-ba91-ebdf-497f-cbe1614bec53@FreeBSD.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 09:36:31 -0000 On 0619T1733, Alexander Motin wrote: > On 19.06.16 17:28, Cy Schubert wrote: > > In message <20160619080803.GA1638@brick>, Edward Tomasz > > =?utf-8?Q?Napiera=C5=82 > > a?= writes: > >> On 0614T0232, Jan Beich wrote: > >>> Alexander Motin writes: > >>> > >>>> Author: mav > >>>> Date: Wed May 11 13:43:20 2016 > >>>> New Revision: 299448 > >>>> URL: https://svnweb.freebsd.org/changeset/base/299448 > >>>> > >>>> Log: > >>>> MFV r299442: 6762 POSIX write should imply DELETE_CHILD on directories > >> - and > >>>> some additional considerations > >>>> > >>>> Reviewed by: Gordon Ross > >>>> Reviewed by: Yuri Pankov > >>>> Author: Kevin Crowe > >>>> > >>>> openzfs/openzfs@d316fffc9c361532a482208561bbb614dac7f916 > >>> > >>> This commit confuses acl_is_trivial_np(3). Notice '+' in ls(1) and 'D' > >>> in getfacl(1) outputs. > >> > >> It's not just that. > >> > >> Those changes: > >> > >> 1. Confuse acl_is_trivial_np(3), as you say. It's hard to fix in libc, > >> because they make trivial ACLs different for files and directories, > >> and acl_is_trivial_np(3) has no way of telling which is which. > >> > >> 2. They make delete deny permission take precedence over the containing > >> directory write allow permission, which is rather different from what > >> people expect in unix systems, and is against the NFSv4 specification, > >> even though it might be a better fit for Windows. > > > > This is Windows behavior and inconsistent with the rest of FreeBSD and any > > UNIX or Linux system. > > > >> > >> 3. They make umask apply to inherit_only permissions, and > >> > >> 4. I don't fully understand this one yet, but from the ACL regression > >> test suite (which lives in tests/sys/acl/, and I'd appreciate people > >> actually ran this before committing ACL-related changes) it looks > >> like it makes umask not apply to the stuff it should. > >> > >> The #1 could be fixed by making ZFS not setting delete_child on write, > >> basically reverting to the previous behaviour in that aspect. As for > >> the others... I'm not saying each one of those is wrong, but they > >> certainly warrant further discussion, especially #2 and #4. > > > > I think #2 is wrong behavior on any UNIX-like or POSIX system. > > > >> > >> Basically, what I'm trying to say is that we should consider backing > >> this out for 11.0-RELEASE, reverting to the previous semantics, verified > >> by passing the regression tests. > > > > Agreed. > > > > What in FreeBSD was this patch supposed to solve in the first place? > > Growing divergence from OpenZFS upstream. I am not advocating this > patch, but it would be good, if possible, to not revert it completely, > but block wrong behavior with some minimal ifdefs to make further ZFS > merges easier. Help would be appreciated. ;) Our family just expanded, and thus I'm afraid I won't be able to help for the next few weeks. That's one of the reasons why I've suggested the backout for 11.0 - not a permanent "let's ignore this piece of code forever" backout, but a temporary one, for 11.0; we would then go back to the topic after the release. From owner-svn-src-head@freebsd.org Tue Jun 21 13:48:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45F03AC5898; Tue, 21 Jun 2016 13:48:54 +0000 (UTC) (envelope-from bz@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 0F53314E6; Tue, 21 Jun 2016 13:48:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5LDmraV081638; Tue, 21 Jun 2016 13:48:53 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5LDmom9081605; Tue, 21 Jun 2016 13:48:50 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606211348.u5LDmom9081605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Tue, 21 Jun 2016 13:48:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302054 - in head/sys: contrib/ipfilter/netinet dev/usb/net kern net netgraph netinet netinet6 netipsec netpfil/ipfw netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 13:48:54 -0000 Author: bz Date: Tue Jun 21 13:48:49 2016 New Revision: 302054 URL: https://svnweb.freebsd.org/changeset/base/302054 Log: Get closer to a VIMAGE network stack teardown from top to bottom rather than removing the network interfaces first. This change is rather larger and convoluted as the ordering requirements cannot be separated. Move the pfil(9) framework to SI_SUB_PROTO_PFIL, move Firewalls and related modules to their own SI_SUB_PROTO_FIREWALL. Move initialization of "physical" interfaces to SI_SUB_DRIVERS, move virtual (cloned) interfaces to SI_SUB_PSEUDO. Move Multicast to SI_SUB_PROTO_MC. Re-work parts of multicast initialisation and teardown, not taking the huge amount of memory into account if used as a module yet. For interface teardown we try to do as many of them as we can on SI_SUB_INIT_IF, but for some this makes no sense, e.g., when tunnelling over a higher layer protocol such as IP. In that case the interface has to go along (or before) the higher layer protocol is shutdown. Kernel hhooks need to go last on teardown as they may be used at various higher layers and we cannot remove them before we cleaned up the higher layers. For interface teardown there are multiple paths: (a) a cloned interface is destroyed (inside a VIMAGE or in the base system), (b) any interface is moved from a virtual network stack to a different network stack ("vmove"), or (c) a virtual network stack is being shut down. All code paths go through if_detach_internal() where we, depending on the vmove flag or the vnet state, make a decision on how much to shut down; in case we are destroying a VNET the individual protocol layers will cleanup their own parts thus we cannot do so again for each interface as we end up with, e.g., double-frees, destroying locks twice or acquiring already destroyed locks. When calling into protocol cleanups we equally have to tell them whether they need to detach upper layer protocols ("ulp") or not (e.g., in6_ifdetach()). Provide or enahnce helper functions to do proper cleanup at a protocol rather than at an interface level. Approved by: re (hrs) Obtained from: projects/vnet Reviewed by: gnn, jhb Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6747 Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c head/sys/dev/usb/net/usb_ethernet.c head/sys/kern/kern_hhook.c head/sys/net/if.c head/sys/net/if_bridge.c head/sys/net/if_disc.c head/sys/net/if_edsc.c head/sys/net/if_enc.c head/sys/net/if_epair.c head/sys/net/if_lagg.c head/sys/net/if_loop.c head/sys/net/if_vlan.c head/sys/net/pfil.c head/sys/net/route.c head/sys/net/vnet.c head/sys/net/vnet.h head/sys/netgraph/ng_eiface.c head/sys/netgraph/ng_iface.c head/sys/netinet/igmp.c head/sys/netinet/in.c head/sys/netinet/in_var.h head/sys/netinet/ip_id.c head/sys/netinet/ip_input.c head/sys/netinet/ip_mroute.c head/sys/netinet6/in6.c head/sys/netinet6/in6_ifattach.c head/sys/netinet6/in6_ifattach.h head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_mroute.c head/sys/netinet6/mld6.c head/sys/netinet6/nd6.c head/sys/netinet6/nd6.h head/sys/netipsec/ipsec.c head/sys/netipsec/xform_tcp.c head/sys/netpfil/ipfw/dn_sched.h head/sys/netpfil/ipfw/ip_dummynet.c head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_nat.c head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c ============================================================================== --- head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Tue Jun 21 13:48:49 2016 (r302054) @@ -287,7 +287,7 @@ static moduledata_t ipfiltermod = { }; -DECLARE_MODULE(ipfilter, ipfiltermod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); +DECLARE_MODULE(ipfilter, ipfiltermod, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY); #ifdef MODULE_VERSION MODULE_VERSION(ipfilter, 1); #endif Modified: head/sys/dev/usb/net/usb_ethernet.c ============================================================================== --- head/sys/dev/usb/net/usb_ethernet.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/dev/usb/net/usb_ethernet.c Tue Jun 21 13:48:49 2016 (r302054) @@ -641,5 +641,9 @@ uether_rxflush(struct usb_ether *ue) } } -DECLARE_MODULE(uether, uether_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +/* + * USB net drivers are run by DRIVER_MODULE() thus SI_SUB_DRIVERS, + * SI_ORDER_MIDDLE. Run uether after that. + */ +DECLARE_MODULE(uether, uether_mod, SI_SUB_DRIVERS, SI_ORDER_ANY); MODULE_VERSION(uether, 1); Modified: head/sys/kern/kern_hhook.c ============================================================================== --- head/sys/kern/kern_hhook.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/kern/kern_hhook.c Tue Jun 21 13:48:49 2016 (r302054) @@ -510,7 +510,7 @@ hhook_vnet_uninit(const void *unused __u /* * When a vnet is created and being initialised, init the V_hhook_vhead_list. */ -VNET_SYSINIT(hhook_vnet_init, SI_SUB_MBUF, SI_ORDER_FIRST, +VNET_SYSINIT(hhook_vnet_init, SI_SUB_INIT_IF, SI_ORDER_FIRST, hhook_vnet_init, NULL); /* @@ -518,5 +518,5 @@ VNET_SYSINIT(hhook_vnet_init, SI_SUB_MBU * points to clean up on vnet tear down, but in case the KPI is misused, * provide a function to clean up and free memory for a vnet being destroyed. */ -VNET_SYSUNINIT(hhook_vnet_uninit, SI_SUB_MBUF, SI_ORDER_ANY, +VNET_SYSUNINIT(hhook_vnet_uninit, SI_SUB_INIT_IF, SI_ORDER_FIRST, hhook_vnet_uninit, NULL); Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/net/if.c Tue Jun 21 13:48:49 2016 (r302054) @@ -914,6 +914,16 @@ if_detach(struct ifnet *ifp) CURVNET_RESTORE(); } +/* + * The vmove flag, if set, indicates that we are called from a callpath + * that is moving an interface to a different vnet instance. + * + * The shutdown flag, if set, indicates that we are called in the + * process of shutting down a vnet instance. Currently only the + * vnet_if_return SYSUNINIT function sets it. Note: we can be called + * on a vnet instance shutdown without this flag being set, e.g., when + * the cloned interfaces are destoyed as first thing of teardown. + */ static int if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp) { @@ -921,8 +931,10 @@ if_detach_internal(struct ifnet *ifp, in int i; struct domain *dp; struct ifnet *iter; - int found = 0; + int found = 0, shutdown; + shutdown = (ifp->if_vnet->vnet_state > SI_SUB_VNET && + ifp->if_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0; IFNET_WLOCK(); TAILQ_FOREACH(iter, &V_ifnet, if_link) if (iter == ifp) { @@ -930,10 +942,6 @@ if_detach_internal(struct ifnet *ifp, in found = 1; break; } -#ifdef VIMAGE - if (found) - curvnet->vnet_ifcnt--; -#endif IFNET_WUNLOCK(); if (!found) { /* @@ -951,19 +959,58 @@ if_detach_internal(struct ifnet *ifp, in #endif } - /* Check if this is a cloned interface or not. */ + /* + * At this point we know the interface still was on the ifnet list + * and we removed it so we are in a stable state. + */ +#ifdef VIMAGE + curvnet->vnet_ifcnt--; +#endif + + /* + * In any case (destroy or vmove) detach us from the groups + * and remove/wait for pending events on the taskq. + * XXX-BZ in theory an interface could still enqueue a taskq change? + */ + if_delgroups(ifp); + + taskqueue_drain(taskqueue_swi, &ifp->if_linktask); + + /* + * Check if this is a cloned interface or not. Must do even if + * shutting down as a if_vmove_reclaim() would move the ifp and + * the if_clone_addgroup() will have a corrupted string overwise + * from a gibberish pointer. + */ if (vmove && ifcp != NULL) *ifcp = if_clone_findifc(ifp); + if_down(ifp); + /* - * Remove/wait for pending events. + * On VNET shutdown abort here as the stack teardown will do all + * the work top-down for us. + */ + if (shutdown) { + /* + * In case of a vmove we are done here without error. + * If we would signal an error it would lead to the same + * abort as if we did not find the ifnet anymore. + * if_detach() calls us in void context and does not care + * about an early abort notification, so life is splendid :) + */ + goto finish_vnet_shutdown; + } + + /* + * At this point we are not tearing down a VNET and are either + * going to destroy or vmove the interface and have to cleanup + * accordingly. */ - taskqueue_drain(taskqueue_swi, &ifp->if_linktask); /* * Remove routes and flush queues. */ - if_down(ifp); #ifdef ALTQ if (ALTQ_IS_ENABLED(&ifp->if_snd)) altq_disable(&ifp->if_snd); @@ -1018,8 +1065,8 @@ if_detach_internal(struct ifnet *ifp, in } rt_flushifroutes(ifp); - if_delgroups(ifp); +finish_vnet_shutdown: /* * We cannot hold the lock over dom_ifdetach calls as they might * sleep, for example trying to drain a callout, thus open up the @@ -1048,7 +1095,7 @@ if_detach_internal(struct ifnet *ifp, in * unused if_index in target vnet and calls if_grow() if necessary, * and finally find an unused if_xname for the target vnet. */ -void +static void if_vmove(struct ifnet *ifp, struct vnet *new_vnet) { struct if_clone *ifc; @@ -1115,6 +1162,7 @@ if_vmove_loan(struct thread *td, struct { struct prison *pr; struct ifnet *difp; + int shutdown; /* Try to find the prison within our visibility. */ sx_slock(&allprison_lock); @@ -1135,12 +1183,22 @@ if_vmove_loan(struct thread *td, struct /* XXX Lock interfaces to avoid races. */ CURVNET_SET_QUIET(pr->pr_vnet); difp = ifunit(ifname); - CURVNET_RESTORE(); if (difp != NULL) { + CURVNET_RESTORE(); prison_free(pr); return (EEXIST); } + /* Make sure the VNET is stable. */ + shutdown = (ifp->if_vnet->vnet_state > SI_SUB_VNET && + ifp->if_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0; + if (shutdown) { + CURVNET_RESTORE(); + prison_free(pr); + return (EBUSY); + } + CURVNET_RESTORE(); + /* Move the interface into the child jail/vnet. */ if_vmove(ifp, pr->pr_vnet); @@ -1157,6 +1215,7 @@ if_vmove_reclaim(struct thread *td, char struct prison *pr; struct vnet *vnet_dst; struct ifnet *ifp; + int shutdown; /* Try to find the prison within our visibility. */ sx_slock(&allprison_lock); @@ -1184,6 +1243,15 @@ if_vmove_reclaim(struct thread *td, char return (EEXIST); } + /* Make sure the VNET is stable. */ + shutdown = (ifp->if_vnet->vnet_state > SI_SUB_VNET && + ifp->if_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0; + if (shutdown) { + CURVNET_RESTORE(); + prison_free(pr); + return (EBUSY); + } + /* Get interface back from child jail/vnet. */ if_vmove(ifp, vnet_dst); CURVNET_RESTORE(); @@ -2642,8 +2710,22 @@ ifioctl(struct socket *so, u_long cmd, c struct ifreq *ifr; int error; int oif_flags; +#ifdef VIMAGE + int shutdown; +#endif CURVNET_SET(so->so_vnet); +#ifdef VIMAGE + /* Make sure the VNET is stable. */ + shutdown = (so->so_vnet->vnet_state > SI_SUB_VNET && + so->so_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0; + if (shutdown) { + CURVNET_RESTORE(); + return (EBUSY); + } +#endif + + switch (cmd) { case SIOCGIFCONF: error = ifconf(cmd, data); Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/net/if_bridge.c Tue Jun 21 13:48:49 2016 (r302054) @@ -541,7 +541,7 @@ vnet_bridge_uninit(const void *unused __ V_bridge_cloner = NULL; BRIDGE_LIST_LOCK_DESTROY(); } -VNET_SYSUNINIT(vnet_bridge_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_bridge_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_bridge_uninit, NULL); static int Modified: head/sys/net/if_disc.c ============================================================================== --- head/sys/net/if_disc.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/net/if_disc.c Tue Jun 21 13:48:49 2016 (r302054) @@ -137,7 +137,7 @@ vnet_disc_init(const void *unused __unus V_disc_cloner = if_clone_simple(discname, disc_clone_create, disc_clone_destroy, 0); } -VNET_SYSINIT(vnet_disc_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSINIT(vnet_disc_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_disc_init, NULL); static void @@ -146,7 +146,7 @@ vnet_disc_uninit(const void *unused __un if_clone_detach(V_disc_cloner); } -VNET_SYSUNINIT(vnet_disc_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_disc_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, vnet_disc_uninit, NULL); static int Modified: head/sys/net/if_edsc.c ============================================================================== --- head/sys/net/if_edsc.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/net/if_edsc.c Tue Jun 21 13:48:49 2016 (r302054) @@ -336,7 +336,7 @@ vnet_edsc_uninit(const void *unused __un */ if_clone_detach(V_edsc_cloner); } -VNET_SYSUNINIT(vnet_edsc_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_edsc_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, vnet_edsc_uninit, NULL); /* Modified: head/sys/net/if_enc.c ============================================================================== --- head/sys/net/if_enc.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/net/if_enc.c Tue Jun 21 13:48:49 2016 (r302054) @@ -136,7 +136,6 @@ enc_clone_destroy(struct ifnet *ifp) sc = ifp->if_softc; KASSERT(sc == V_enc_sc, ("sc != ifp->if_softc")); - enc_remove_hhooks(sc); bpfdetach(ifp); if_detach(ifp); if_free(ifp); @@ -170,10 +169,6 @@ enc_clone_create(struct if_clone *ifc, i ifp->if_softc = sc; if_attach(ifp); bpfattach(ifp, DLT_ENC, sizeof(struct enchdr)); - if (enc_add_hhooks(sc) != 0) { - enc_clone_destroy(ifp); - return (ENXIO); - } return (0); } @@ -369,18 +364,44 @@ vnet_enc_init(const void *unused __unuse V_enc_cloner = if_clone_simple(encname, enc_clone_create, enc_clone_destroy, 1); } -VNET_SYSINIT(vnet_enc_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSINIT(vnet_enc_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_enc_init, NULL); static void +vnet_enc_init_proto(void *unused __unused) +{ + KASSERT(V_enc_sc != NULL, ("%s: V_enc_sc is %p\n", __func__, V_enc_sc)); + + if (enc_add_hhooks(V_enc_sc) != 0) + enc_clone_destroy(V_enc_sc->sc_ifp); +} +VNET_SYSINIT(vnet_enc_init_proto, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, + vnet_enc_init_proto, NULL); + +static void vnet_enc_uninit(const void *unused __unused) { + KASSERT(V_enc_sc != NULL, ("%s: V_enc_sc is %p\n", __func__, V_enc_sc)); if_clone_detach(V_enc_cloner); } -VNET_SYSUNINIT(vnet_enc_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_enc_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, vnet_enc_uninit, NULL); +/* + * The hhook consumer needs to go before ip[6]_destroy are called on + * SI_ORDER_THIRD. + */ +static void +vnet_enc_uninit_hhook(const void *unused __unused) +{ + KASSERT(V_enc_sc != NULL, ("%s: V_enc_sc is %p\n", __func__, V_enc_sc)); + + enc_remove_hhooks(V_enc_sc); +} +VNET_SYSUNINIT(vnet_enc_uninit_hhook, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, + vnet_enc_uninit_hhook, NULL); + static int enc_modevent(module_t mod, int type, void *data) { @@ -401,4 +422,4 @@ static moduledata_t enc_mod = { 0 }; -DECLARE_MODULE(if_enc, enc_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); +DECLARE_MODULE(if_enc, enc_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); Modified: head/sys/net/if_epair.c ============================================================================== --- head/sys/net/if_epair.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/net/if_epair.c Tue Jun 21 13:48:49 2016 (r302054) @@ -963,7 +963,7 @@ vnet_epair_init(const void *unused __unu netisr_register_vnet(&epair_nh); #endif } -VNET_SYSINIT(vnet_epair_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSINIT(vnet_epair_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_epair_init, NULL); static void @@ -975,7 +975,7 @@ vnet_epair_uninit(const void *unused __u #endif if_clone_detach(V_epair_cloner); } -VNET_SYSUNINIT(vnet_epair_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_epair_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, vnet_epair_uninit, NULL); static int @@ -1012,5 +1012,5 @@ static moduledata_t epair_mod = { 0 }; -DECLARE_MODULE(if_epair, epair_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +DECLARE_MODULE(if_epair, epair_mod, SI_SUB_PSEUDO, SI_ORDER_MIDDLE); MODULE_VERSION(if_epair, 1); Modified: head/sys/net/if_lagg.c ============================================================================== --- head/sys/net/if_lagg.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/net/if_lagg.c Tue Jun 21 13:48:49 2016 (r302054) @@ -271,7 +271,7 @@ vnet_lagg_uninit(const void *unused __un if_clone_detach(V_lagg_cloner); LAGG_LIST_LOCK_DESTROY(); } -VNET_SYSUNINIT(vnet_lagg_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_lagg_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, vnet_lagg_uninit, NULL); static int Modified: head/sys/net/if_loop.c ============================================================================== --- head/sys/net/if_loop.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/net/if_loop.c Tue Jun 21 13:48:49 2016 (r302054) @@ -156,7 +156,7 @@ vnet_loif_init(const void *unused __unus 1); #endif } -VNET_SYSINIT(vnet_loif_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSINIT(vnet_loif_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_loif_init, NULL); #ifdef VIMAGE @@ -167,7 +167,7 @@ vnet_loif_uninit(const void *unused __un if_clone_detach(V_lo_cloner); V_loif = NULL; } -VNET_SYSUNINIT(vnet_loif_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_loif_uninit, SI_SUB_INIT_IF, SI_ORDER_SECOND, vnet_loif_uninit, NULL); #endif Modified: head/sys/net/if_vlan.c ============================================================================== --- head/sys/net/if_vlan.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/net/if_vlan.c Tue Jun 21 13:48:49 2016 (r302054) @@ -823,7 +823,7 @@ vnet_vlan_uninit(const void *unused __un if_clone_detach(V_vlan_cloner); } -VNET_SYSUNINIT(vnet_vlan_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_FIRST, +VNET_SYSUNINIT(vnet_vlan_uninit, SI_SUB_INIT_IF, SI_ORDER_FIRST, vnet_vlan_uninit, NULL); #endif Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/net/pfil.c Tue Jun 21 13:48:49 2016 (r302054) @@ -383,17 +383,14 @@ vnet_pfil_uninit(const void *unused __un PFIL_LOCK_DESTROY_REAL(&V_pfil_lock); } -/* Define startup order. */ -#define PFIL_SYSINIT_ORDER SI_SUB_PROTO_BEGIN -#define PFIL_MODEVENT_ORDER (SI_ORDER_FIRST) /* On boot slot in here. */ -#define PFIL_VNET_ORDER (PFIL_MODEVENT_ORDER + 2) /* Later still. */ - /* * Starting up. * * VNET_SYSINIT is called for each existing vnet and each new vnet. + * Make sure the pfil bits are first before any possible subsystem which + * might piggyback on the SI_SUB_PROTO_PFIL. */ -VNET_SYSINIT(vnet_pfil_init, PFIL_SYSINIT_ORDER, PFIL_VNET_ORDER, +VNET_SYSINIT(vnet_pfil_init, SI_SUB_PROTO_PFIL, SI_ORDER_FIRST, vnet_pfil_init, NULL); /* @@ -401,5 +398,5 @@ VNET_SYSINIT(vnet_pfil_init, PFIL_SYSINI * * VNET_SYSUNINIT is called for each exiting vnet as it exits. */ -VNET_SYSUNINIT(vnet_pfil_uninit, PFIL_SYSINIT_ORDER, PFIL_VNET_ORDER, +VNET_SYSUNINIT(vnet_pfil_uninit, SI_SUB_PROTO_PFIL, SI_ORDER_FIRST, vnet_pfil_uninit, NULL); Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/net/route.c Tue Jun 21 13:48:49 2016 (r302054) @@ -334,7 +334,7 @@ vnet_route_uninit(const void *unused __u free(V_rt_tables, M_RTABLE); uma_zdestroy(V_rtzone); } -VNET_SYSUNINIT(vnet_route_uninit, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, +VNET_SYSUNINIT(vnet_route_uninit, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, vnet_route_uninit, 0); #endif Modified: head/sys/net/vnet.c ============================================================================== --- head/sys/net/vnet.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/net/vnet.c Tue Jun 21 13:48:49 2016 (r302054) @@ -331,8 +331,7 @@ vnet_init_done(void *unused __unused) curvnet = NULL; } - -SYSINIT(vnet_init_done, SI_SUB_VNET_DONE, SI_ORDER_FIRST, vnet_init_done, +SYSINIT(vnet_init_done, SI_SUB_VNET_DONE, SI_ORDER_ANY, vnet_init_done, NULL); /* Modified: head/sys/net/vnet.h ============================================================================== --- head/sys/net/vnet.h Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/net/vnet.h Tue Jun 21 13:48:49 2016 (r302054) @@ -111,8 +111,8 @@ vnet_##name##_init(const void *unused) \ { \ VNET_PCPUSTAT_ALLOC(name, M_WAITOK); \ } \ -VNET_SYSINIT(vnet_ ## name ## _init, SI_SUB_PROTO_IFATTACHDOMAIN, \ - SI_ORDER_ANY, vnet_ ## name ## _init, NULL) +VNET_SYSINIT(vnet_ ## name ## _init, SI_SUB_INIT_IF, \ + SI_ORDER_FIRST, vnet_ ## name ## _init, NULL) #define VNET_PCPUSTAT_SYSUNINIT(name) \ static void \ @@ -120,8 +120,8 @@ vnet_##name##_uninit(const void *unused) { \ VNET_PCPUSTAT_FREE(name); \ } \ -VNET_SYSUNINIT(vnet_ ## name ## _uninit, SI_SUB_PROTO_IFATTACHDOMAIN, \ - SI_ORDER_ANY, vnet_ ## name ## _uninit, NULL) +VNET_SYSUNINIT(vnet_ ## name ## _uninit, SI_SUB_INIT_IF, \ + SI_ORDER_FIRST, vnet_ ## name ## _uninit, NULL) #ifdef SYSCTL_OID #define SYSCTL_VNET_PCPUSTAT(parent, nbr, name, type, array, desc) \ Modified: head/sys/netgraph/ng_eiface.c ============================================================================== --- head/sys/netgraph/ng_eiface.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netgraph/ng_eiface.c Tue Jun 21 13:48:49 2016 (r302054) @@ -679,5 +679,5 @@ vnet_ng_eiface_uninit(const void *unused delete_unrhdr(V_ng_eiface_unit); } -VNET_SYSUNINIT(vnet_ng_eiface_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_ng_eiface_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, vnet_ng_eiface_uninit, NULL); Modified: head/sys/netgraph/ng_iface.c ============================================================================== --- head/sys/netgraph/ng_iface.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netgraph/ng_iface.c Tue Jun 21 13:48:49 2016 (r302054) @@ -786,5 +786,5 @@ vnet_ng_iface_uninit(const void *unused) delete_unrhdr(V_ng_iface_unit); } -VNET_SYSUNINIT(vnet_ng_iface_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_ng_iface_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, vnet_ng_iface_uninit, NULL); Modified: head/sys/netinet/igmp.c ============================================================================== --- head/sys/netinet/igmp.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netinet/igmp.c Tue Jun 21 13:48:49 2016 (r302054) @@ -227,7 +227,8 @@ static VNET_DEFINE(int, current_state_ti #define V_state_change_timers_running VNET(state_change_timers_running) #define V_current_state_timers_running VNET(current_state_timers_running) -static VNET_DEFINE(LIST_HEAD(, igmp_ifsoftc), igi_head); +static VNET_DEFINE(LIST_HEAD(, igmp_ifsoftc), igi_head) = + LIST_HEAD_INITIALIZER(igi_head); static VNET_DEFINE(struct igmpstat, igmpstat) = { .igps_version = IGPS_VERSION_3, .igps_len = sizeof(struct igmpstat), @@ -701,10 +702,6 @@ igi_delete_locked(const struct ifnet *if return; } } - -#ifdef INVARIANTS - panic("%s: igmp_ifsoftc not found for ifp %p\n", __func__, ifp); -#endif } /* @@ -3595,57 +3592,28 @@ igmp_rec_type_to_str(const int type) } #endif -static void -igmp_init(void *unused __unused) -{ - - CTR1(KTR_IGMPV3, "%s: initializing", __func__); - - IGMP_LOCK_INIT(); - - m_raopt = igmp_ra_alloc(); - - netisr_register(&igmp_nh); -} -SYSINIT(igmp_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, igmp_init, NULL); - -static void -igmp_uninit(void *unused __unused) -{ - - CTR1(KTR_IGMPV3, "%s: tearing down", __func__); - - netisr_unregister(&igmp_nh); - - m_free(m_raopt); - m_raopt = NULL; - - IGMP_LOCK_DESTROY(); -} -SYSUNINIT(igmp_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, igmp_uninit, NULL); - +#ifdef VIMAGE static void vnet_igmp_init(const void *unused __unused) { - CTR1(KTR_IGMPV3, "%s: initializing", __func__); - - LIST_INIT(&V_igi_head); + netisr_register_vnet(&igmp_nh); } -VNET_SYSINIT(vnet_igmp_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_igmp_init, - NULL); +VNET_SYSINIT(vnet_igmp_init, SI_SUB_PROTO_MC, SI_ORDER_ANY, + vnet_igmp_init, NULL); static void vnet_igmp_uninit(const void *unused __unused) { + /* This can happen when we shutdown the entire network stack. */ CTR1(KTR_IGMPV3, "%s: tearing down", __func__); - KASSERT(LIST_EMPTY(&V_igi_head), - ("%s: igi list not empty; ifnets not detached?", __func__)); + netisr_unregister_vnet(&igmp_nh); } -VNET_SYSUNINIT(vnet_igmp_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_igmp_uninit, SI_SUB_PROTO_MC, SI_ORDER_ANY, vnet_igmp_uninit, NULL); +#endif #ifdef DDB DB_SHOW_COMMAND(igi_list, db_show_igi_list) @@ -3682,14 +3650,24 @@ static int igmp_modevent(module_t mod, int type, void *unused __unused) { - switch (type) { - case MOD_LOAD: - case MOD_UNLOAD: - break; - default: - return (EOPNOTSUPP); - } - return (0); + switch (type) { + case MOD_LOAD: + CTR1(KTR_IGMPV3, "%s: initializing", __func__); + IGMP_LOCK_INIT(); + m_raopt = igmp_ra_alloc(); + netisr_register(&igmp_nh); + break; + case MOD_UNLOAD: + CTR1(KTR_IGMPV3, "%s: tearing down", __func__); + netisr_unregister(&igmp_nh); + m_free(m_raopt); + m_raopt = NULL; + IGMP_LOCK_DESTROY(); + break; + default: + return (EOPNOTSUPP); + } + return (0); } static moduledata_t igmp_mod = { @@ -3697,4 +3675,4 @@ static moduledata_t igmp_mod = { igmp_modevent, 0 }; -DECLARE_MODULE(igmp, igmp_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +DECLARE_MODULE(igmp, igmp_mod, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE); Modified: head/sys/netinet/in.c ============================================================================== --- head/sys/netinet/in.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netinet/in.c Tue Jun 21 13:48:49 2016 (r302054) @@ -895,6 +895,39 @@ in_scrubprefix(struct in_ifaddr *target, #undef rtinitflags +void +in_ifscrub_all(void) +{ + struct ifnet *ifp; + struct ifaddr *ifa, *nifa; + struct ifaliasreq ifr; + + IFNET_RLOCK(); + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { + /* Cannot lock here - lock recursion. */ + /* IF_ADDR_RLOCK(ifp); */ + TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, nifa) { + if (ifa->ifa_addr->sa_family != AF_INET) + continue; + + /* + * This is ugly but the only way for legacy IP to + * cleanly remove addresses and everything attached. + */ + bzero(&ifr, sizeof(ifr)); + ifr.ifra_addr = *ifa->ifa_addr; + if (ifa->ifa_dstaddr) + ifr.ifra_broadaddr = *ifa->ifa_dstaddr; + (void)in_control(NULL, SIOCDIFADDR, (caddr_t)&ifr, + ifp, NULL); + } + /* IF_ADDR_RUNLOCK(ifp); */ + in_purgemaddrs(ifp); + igmp_domifdetach(ifp); + } + IFNET_RUNLOCK(); +} + /* * Return 1 if the address might be a local broadcast address. */ Modified: head/sys/netinet/in_var.h ============================================================================== --- head/sys/netinet/in_var.h Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netinet/in_var.h Tue Jun 21 13:48:49 2016 (r302054) @@ -376,6 +376,7 @@ int in_control(struct socket *, u_long, struct thread *); int in_addprefix(struct in_ifaddr *, int); int in_scrubprefix(struct in_ifaddr *, u_int); +void in_ifscrub_all(void); void ip_input(struct mbuf *); void ip_direct_input(struct mbuf *); void in_ifadown(struct ifaddr *ifa, int); Modified: head/sys/netinet/ip_id.c ============================================================================== --- head/sys/netinet/ip_id.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netinet/ip_id.c Tue Jun 21 13:48:49 2016 (r302054) @@ -294,4 +294,4 @@ ipid_sysuninit(void) counter_u64_free(V_ip_id); mtx_destroy(&V_ip_id_mtx); } -VNET_SYSUNINIT(ip_id, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, ipid_sysuninit, NULL); +VNET_SYSUNINIT(ip_id, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, ipid_sysuninit, NULL); Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netinet/ip_input.c Tue Jun 21 13:48:49 2016 (r302054) @@ -370,6 +370,7 @@ ip_init(void) static void ip_destroy(void *unused __unused) { + struct ifnet *ifp; int error; #ifdef RSS @@ -393,11 +394,21 @@ ip_destroy(void *unused __unused) "type HHOOK_TYPE_IPSEC_OUT, id HHOOK_IPSEC_INET: " "error %d returned\n", __func__, error); } - /* Cleanup in_ifaddr hash table; should be empty. */ - hashdestroy(V_in_ifaddrhashtbl, M_IFADDR, V_in_ifaddrhmask); + + /* Remove the IPv4 addresses from all interfaces. */ + in_ifscrub_all(); + + /* Make sure the IPv4 routes are gone as well. */ + IFNET_RLOCK(); + TAILQ_FOREACH(ifp, &V_ifnet, if_link) + rt_flushifroutes_af(ifp, AF_INET); + IFNET_RUNLOCK(); /* Destroy IP reassembly queue. */ ipreass_destroy(); + + /* Cleanup in_ifaddr hash table; should be empty. */ + hashdestroy(V_in_ifaddrhashtbl, M_IFADDR, V_in_ifaddrhmask); } VNET_SYSUNINIT(ip, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, ip_destroy, NULL); Modified: head/sys/netinet/ip_mroute.c ============================================================================== --- head/sys/netinet/ip_mroute.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netinet/ip_mroute.c Tue Jun 21 13:48:49 2016 (r302054) @@ -2822,7 +2822,7 @@ vnet_mroute_init(const void *unused __un callout_init(&V_bw_meter_ch, 1); } -VNET_SYSINIT(vnet_mroute_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_mroute_init, +VNET_SYSINIT(vnet_mroute_init, SI_SUB_PROTO_MC, SI_ORDER_ANY, vnet_mroute_init, NULL); static void @@ -2833,7 +2833,7 @@ vnet_mroute_uninit(const void *unused __ V_nexpire = NULL; } -VNET_SYSUNINIT(vnet_mroute_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, +VNET_SYSUNINIT(vnet_mroute_uninit, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE, vnet_mroute_uninit, NULL); static int @@ -2946,4 +2946,4 @@ static moduledata_t ip_mroutemod = { 0 }; -DECLARE_MODULE(ip_mroute, ip_mroutemod, SI_SUB_PSEUDO, SI_ORDER_MIDDLE); +DECLARE_MODULE(ip_mroute, ip_mroutemod, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE); Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netinet6/in6.c Tue Jun 21 13:48:49 2016 (r302054) @@ -2419,7 +2419,7 @@ in6_domifdetach(struct ifnet *ifp, void mld_domifdetach(ifp); scope6_ifdetach(ext->scope6_id); - nd6_ifdetach(ext->nd_ifinfo); + nd6_ifdetach(ifp, ext->nd_ifinfo); lltable_free(ext->lltable); COUNTER_ARRAY_FREE(ext->in6_ifstat, sizeof(struct in6_ifstat) / sizeof(uint64_t)); Modified: head/sys/netinet6/in6_ifattach.c ============================================================================== --- head/sys/netinet6/in6_ifattach.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netinet6/in6_ifattach.c Tue Jun 21 13:48:49 2016 (r302054) @@ -761,19 +761,30 @@ in6_ifattach(struct ifnet *ifp, struct i /* * NOTE: in6_ifdetach() does not support loopback if at this moment. - * We don't need this function in bsdi, because interfaces are never removed - * from the ifnet list in bsdi. + * + * When shutting down a VNET we clean up layers top-down. In that case + * upper layer protocols (ulp) are cleaned up already and locks are destroyed + * and we must not call into these cleanup functions anymore, thus purgeulp + * is set to 0 in that case by in6_ifdetach_destroy(). + * The normal case of destroying a (cloned) interface still needs to cleanup + * everything related to the interface and will have purgeulp set to 1. */ -void -in6_ifdetach(struct ifnet *ifp) +static void +_in6_ifdetach(struct ifnet *ifp, int purgeulp) { struct ifaddr *ifa, *next; if (ifp->if_afdata[AF_INET6] == NULL) return; - /* remove neighbor management table */ - nd6_purge(ifp); + /* + * Remove neighbor management table. + * Enabling the nd6_purge will panic on vmove for interfaces on VNET + * teardown as the IPv6 layer is cleaned up already and the locks + * are destroyed. + */ + if (purgeulp) + nd6_purge(ifp); /* * nuke any of IPv6 addresses we have @@ -784,9 +795,11 @@ in6_ifdetach(struct ifnet *ifp) continue; in6_purgeaddr(ifa); } - in6_pcbpurgeif0(&V_udbinfo, ifp); - in6_pcbpurgeif0(&V_ulitecbinfo, ifp); - in6_pcbpurgeif0(&V_ripcbinfo, ifp); + if (purgeulp) { + in6_pcbpurgeif0(&V_udbinfo, ifp); + in6_pcbpurgeif0(&V_ulitecbinfo, ifp); + in6_pcbpurgeif0(&V_ripcbinfo, ifp); + } /* leave from all multicast groups joined */ in6_purgemaddrs(ifp); @@ -798,7 +811,22 @@ in6_ifdetach(struct ifnet *ifp) * prefixes after removing all addresses above. * (Or can we just delay calling nd6_purge until at this point?) */ - nd6_purge(ifp); + if (purgeulp) + nd6_purge(ifp); +} + +void +in6_ifdetach(struct ifnet *ifp) +{ + + _in6_ifdetach(ifp, 1); +} + +void +in6_ifdetach_destroy(struct ifnet *ifp) +{ + + _in6_ifdetach(ifp, 0); } int Modified: head/sys/netinet6/in6_ifattach.h ============================================================================== --- head/sys/netinet6/in6_ifattach.h Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netinet6/in6_ifattach.h Tue Jun 21 13:48:49 2016 (r302054) @@ -37,6 +37,7 @@ void in6_ifattach(struct ifnet *, struct ifnet *); void in6_ifattach_destroy(void); void in6_ifdetach(struct ifnet *); +void in6_ifdetach_destroy(struct ifnet *); int in6_get_tmpifid(struct ifnet *, u_int8_t *, const u_int8_t *, int); void in6_tmpaddrtimer(void *); int in6_get_hw_ifid(struct ifnet *, struct in6_addr *); Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netinet6/ip6_input.c Tue Jun 21 13:48:49 2016 (r302054) @@ -113,6 +113,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -314,6 +315,8 @@ ip6proto_unregister(short ip6proto) static void ip6_destroy(void *unused __unused) { + struct ifaddr *ifa, *nifa; + struct ifnet *ifp; int error; #ifdef RSS @@ -336,9 +339,30 @@ ip6_destroy(void *unused __unused) "type HHOOK_TYPE_IPSEC_OUT, id HHOOK_IPSEC_INET6: " "error %d returned\n", __func__, error); } - hashdestroy(V_in6_ifaddrhashtbl, M_IFADDR, V_in6_ifaddrhmask); + + /* Cleanup addresses. */ + IFNET_RLOCK(); + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { + /* Cannot lock here - lock recursion. */ + /* IF_ADDR_LOCK(ifp); */ + TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, nifa) { + + if (ifa->ifa_addr->sa_family != AF_INET6) + continue; + in6_purgeaddr(ifa); + } + /* IF_ADDR_UNLOCK(ifp); */ + in6_ifdetach_destroy(ifp); + mld_domifdetach(ifp); + /* Make sure any routes are gone as well. */ + rt_flushifroutes_af(ifp, AF_INET6); + } + IFNET_RUNLOCK(); + nd6_destroy(); in6_ifattach_destroy(); + + hashdestroy(V_in6_ifaddrhashtbl, M_IFADDR, V_in6_ifaddrhmask); } VNET_SYSUNINIT(inet6, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, ip6_destroy, NULL); Modified: head/sys/netinet6/ip6_mroute.c ============================================================================== --- head/sys/netinet6/ip6_mroute.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netinet6/ip6_mroute.c Tue Jun 21 13:48:49 2016 (r302054) @@ -1966,4 +1966,4 @@ static moduledata_t ip6_mroutemod = { 0 }; -DECLARE_MODULE(ip6_mroute, ip6_mroutemod, SI_SUB_PSEUDO, SI_ORDER_ANY); +DECLARE_MODULE(ip6_mroute, ip6_mroutemod, SI_SUB_PROTO_MC, SI_ORDER_ANY); Modified: head/sys/netinet6/mld6.c ============================================================================== --- head/sys/netinet6/mld6.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netinet6/mld6.c Tue Jun 21 13:48:49 2016 (r302054) @@ -612,9 +612,6 @@ mli_delete_locked(const struct ifnet *if return; } } -#ifdef INVARIANTS - panic("%s: mld_ifsoftc not found for ifp %p\n", __func__, ifp); -#endif } /* @@ -3265,7 +3262,7 @@ mld_init(void *unused __unused) mld_po.ip6po_prefer_tempaddr = IP6PO_TEMPADDR_NOTPREFER; mld_po.ip6po_flags = IP6PO_DONTFRAG; } -SYSINIT(mld_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, mld_init, NULL); +SYSINIT(mld_init, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE, mld_init, NULL); static void mld_uninit(void *unused __unused) @@ -3274,7 +3271,7 @@ mld_uninit(void *unused __unused) CTR1(KTR_MLD, "%s: tearing down", __func__); MLD_LOCK_DESTROY(); } -SYSUNINIT(mld_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, mld_uninit, NULL); +SYSUNINIT(mld_uninit, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE, mld_uninit, NULL); static void vnet_mld_init(const void *unused __unused) @@ -3284,19 +3281,17 @@ vnet_mld_init(const void *unused __unuse LIST_INIT(&V_mli_head); } -VNET_SYSINIT(vnet_mld_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_mld_init, +VNET_SYSINIT(vnet_mld_init, SI_SUB_PROTO_MC, SI_ORDER_ANY, vnet_mld_init, NULL); static void vnet_mld_uninit(const void *unused __unused) { + /* This can happen if we shutdown the network stack. */ CTR1(KTR_MLD, "%s: tearing down", __func__); - - KASSERT(LIST_EMPTY(&V_mli_head), - ("%s: mli list not empty; ifnets not detached?", __func__)); } -VNET_SYSUNINIT(vnet_mld_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_mld_uninit, +VNET_SYSUNINIT(vnet_mld_uninit, SI_SUB_PROTO_MC, SI_ORDER_ANY, vnet_mld_uninit, NULL); static int @@ -3318,4 +3313,4 @@ static moduledata_t mld_mod = { mld_modevent, 0 }; -DECLARE_MODULE(mld, mld_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +DECLARE_MODULE(mld, mld_mod, SI_SUB_PROTO_MC, SI_ORDER_ANY); Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Tue Jun 21 07:05:49 2016 (r302053) +++ head/sys/netinet6/nd6.c Tue Jun 21 13:48:49 2016 (r302054) @@ -292,8 +292,19 @@ nd6_ifattach(struct ifnet *ifp) } void -nd6_ifdetach(struct nd_ifinfo *nd) +nd6_ifdetach(struct ifnet *ifp, struct nd_ifinfo *nd) { + struct ifaddr *ifa, *next; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Jun 21 14:16:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BDA5AC5EA7; Tue, 21 Jun 2016 14:16:34 +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 1365E267D; Tue, 21 Jun 2016 14:16:34 +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 u5LEGXhN092562; Tue, 21 Jun 2016 14:16:33 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5LEGXde092560; Tue, 21 Jun 2016 14:16:33 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201606211416.u5LEGXde092560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 21 Jun 2016 14:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302055 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 14:16:34 -0000 Author: emaste Date: Tue Jun 21 14:16:32 2016 New Revision: 302055 URL: https://svnweb.freebsd.org/changeset/base/302055 Log: syscons.4,vt.4: update kern.vty description reflecting vt as default rS274085 made vt(4) the default system console. Catch up to this in the man page description for the kern.vty tunable. Reviewed by: bz Approved by: re (hrs) Differential Revision: https://reviews.freebsd.org/D6901 Modified: head/share/man/man4/syscons.4 head/share/man/man4/vt.4 Modified: head/share/man/man4/syscons.4 ============================================================================== --- head/share/man/man4/syscons.4 Tue Jun 21 13:48:49 2016 (r302054) +++ head/share/man/man4/syscons.4 Tue Jun 21 14:16:32 2016 (r302055) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 3, 2014 +.Dd June 21, 2016 .Dt SYSCONS 4 .Os .Sh NAME @@ -468,9 +468,10 @@ be selected by setting this variable to .Ql sc or .Ql vt . -If not set, -.Nm -provides the default system console. +If not set, the default console in the +.Pa GENERIC +kernel is +.Xr vt 4 . .El .Sh FILES .Bl -tag -width /usr/share/syscons/xxxxyyyyzzz -compact Modified: head/share/man/man4/vt.4 ============================================================================== --- head/share/man/man4/vt.4 Tue Jun 21 13:48:49 2016 (r302054) +++ head/share/man/man4/vt.4 Tue Jun 21 14:16:32 2016 (r302055) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2016 +.Dd June 21, 2016 .Dt "VIRTUAL TERMINALS" 4 .Os .Sh NAME @@ -200,12 +200,11 @@ Set this value to .Ql vt or .Ql sc -to override the default driver used for the system console. -By default, -.Xr sc 4 -is used on computers that boot from BIOS, and -.Nm -is used on computers that boot from UEFI. +to choose a specific system console, overriding the default. +If not set, the default in the +.Pa GENERIC +kernel is +.Nm . .It Va kern.vt.fb.default_mode Set this value to a graphic mode to override the default mode picked by the .Nm From owner-svn-src-head@freebsd.org Tue Jun 21 15:27:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE6E7AC5E51; Tue, 21 Jun 2016 15:27:17 +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 AFE801D42; Tue, 21 Jun 2016 15:27:17 +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 u5LFRGdA026148; Tue, 21 Jun 2016 15:27:16 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5LFRG6o026147; Tue, 21 Jun 2016 15:27:16 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201606211527.u5LFRG6o026147@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 21 Jun 2016 15:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302058 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 15:27:18 -0000 Author: asomers Date: Tue Jun 21 15:27:16 2016 New Revision: 302058 URL: https://svnweb.freebsd.org/changeset/base/302058 Log: Fix uninitialized variable from r300881 sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Initialize needs_update in vdev_geom_set_physpath PR: 210409 Reported by: kp Reviewed by: kp Approved by: re (hrs) MFC after: 4 weeks X-MFC-With: 300881 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 Tue Jun 21 15:26:59 2016 (r302057) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Jun 21 15:27:16 2016 (r302058) @@ -87,7 +87,7 @@ vdev_geom_set_rotation_rate(vdev_t *vd, static void vdev_geom_set_physpath(struct g_consumer *cp, boolean_t do_null_update) { - boolean_t needs_update; + boolean_t needs_update = B_FALSE; vdev_t *vd; char *physpath; int error, physpath_len; From owner-svn-src-head@freebsd.org Tue Jun 21 15:38:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8F7BBAC50AF; Tue, 21 Jun 2016 15:38:21 +0000 (UTC) (envelope-from adrian@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 529E425AE; Tue, 21 Jun 2016 15:38:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5LFcKTK030153; Tue, 21 Jun 2016 15:38:20 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5LFcKW9030152; Tue, 21 Jun 2016 15:38:20 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606211538.u5LFcKW9030152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 21 Jun 2016 15:38:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302060 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 15:38:21 -0000 Author: adrian Date: Tue Jun 21 15:38:20 2016 New Revision: 302060 URL: https://svnweb.freebsd.org/changeset/base/302060 Log: [ath] fix TX throughput for EDMA chips by pushing more into the TX FIFO. It turns out that getting decent performance requires stacking the TX FIFO a little more aggressively. * Ensure that when we complete a frame, we attempt to push a new frame into the FIFO so TX is kept as active as it needs to be * Be more aggressive about batching non-aggregate frames into a single TX FIFO slot. This "fixes" TDMA performance (since we only get one TX FIFO slot ungated per DMA beacon alert) but it does this by pushing a whole lot of work into the TX FIFO slot. I'm not /entirely/ pleased by this solution, but it does fix a whole bunch of corner case issues in the transmit side and fix TDMA whilst I'm at it. I'll go revisit transmit packet scheduling in ath(4) post 11. Tested: * AR9380, STA mode * AR9580, hostap mode * AR9380, TDMA client mode Approved by: re (hrs) Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Tue Jun 21 15:29:06 2016 (r302059) +++ head/sys/dev/ath/if_ath_tx_edma.c Tue Jun 21 15:38:20 2016 (r302060) @@ -156,6 +156,17 @@ ath_tx_alq_edma_push(struct ath_softc *s } #endif /* ATH_DEBUG_ALQ */ +/* + * XXX TODO: push an aggregate as a single FIFO slot, even though + * it may not meet the TXOP for say, DBA-gated traffic in TDMA mode. + * + * The TX completion code handles a TX FIFO slot having multiple frames, + * aggregate or otherwise, but it may just make things easier to deal + * with. + * + * XXX TODO: track the number of aggregate subframes and put that in the + * push alq message. + */ static void ath_tx_edma_push_staging_list(struct ath_softc *sc, struct ath_txq *txq, int limit) @@ -274,6 +285,8 @@ ath_tx_edma_push_staging_list(struct ath #endif /* ATH_DEBUG_ALQ */ } +#define TX_BATCH_SIZE 32 + /* * Push some frames into the TX FIFO if we have space. */ @@ -320,7 +333,50 @@ ath_edma_tx_fifo_fill(struct ath_softc * * be time based rather than a hard count, but I also * do need sleep. */ - ath_tx_edma_push_staging_list(sc, txq, 4); + + /* + * Do some basic, basic batching to the hardware + * queue. + * + * If we have TX_BATCH_SIZE entries in the staging + * queue, then let's try to send them all in one hit. + * + * Ensure we don't push more than TX_BATCH_SIZE worth + * in, otherwise we end up draining 8 slots worth of + * 32 frames into the hardware queue and then we don't + * attempt to push more frames in until we empty the + * FIFO. + */ + if (txq->axq_depth >= TX_BATCH_SIZE / 2 && + txq->fifo.axq_depth <= TX_BATCH_SIZE) { + ath_tx_edma_push_staging_list(sc, txq, TX_BATCH_SIZE); + } + + /* + * Aggregate check: if we have less than two FIFO slots + * busy and we have some aggregate frames, queue it. + * + * Now, ideally we'd just check to see if the scheduler + * has given us aggregate frames and push them into the FIFO + * as individual slots, as honestly we should just be pushing + * a single aggregate in as one FIFO slot. + * + * Let's do that next once I know this works. + */ + else if (txq->axq_aggr_depth > 0 && txq->axq_fifo_depth < 2) + ath_tx_edma_push_staging_list(sc, txq, TX_BATCH_SIZE); + + /* + * + * If we have less, and the TXFIFO isn't empty, let's + * wait until we've finished sending the FIFO. + * + * If we have less, and the TXFIFO is empty, then + * send them. + */ + else if (txq->axq_fifo_depth == 0) { + ath_tx_edma_push_staging_list(sc, txq, TX_BATCH_SIZE); + } } /* @@ -478,13 +534,6 @@ ath_edma_xmit_handoff_hw(struct ath_soft /* Push and update frame stats */ ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); - /* For now, set the link pointer in the last descriptor - * to be NULL. - * - * Later on, when it comes time to handling multiple descriptors - * in one FIFO push, we can link descriptors together this way. - */ - /* * Finally, call the FIFO schedule routine to schedule some * frames to the FIFO. @@ -722,6 +771,7 @@ ath_edma_tx_processq(struct ath_softc *s struct ieee80211_node *ni; int nacked = 0; int idx; + int i; #ifdef ATH_DEBUG /* XXX */ @@ -927,28 +977,28 @@ ath_edma_tx_processq(struct ath_softc *s /* Handle frame completion and rate control update */ ath_tx_process_buf_completion(sc, txq, &ts, bf); - /* bf is invalid at this point */ - - /* - * Now that there's space in the FIFO, let's push some - * more frames into it. - */ - ATH_TXQ_LOCK(txq); - if (dosched) - ath_edma_tx_fifo_fill(sc, txq); - ATH_TXQ_UNLOCK(txq); + /* NB: bf is invalid at this point */ } sc->sc_wd_timer = 0; - /* Kick software scheduler */ /* * XXX It's inefficient to do this if the FIFO queue is full, * but there's no easy way right now to only populate * the txq task for _one_ TXQ. This should be fixed. */ - if (dosched) + if (dosched) { + /* Attempt to schedule more hardware frames to the TX FIFO */ + for (i = 0; i < HAL_NUM_TX_QUEUES; i++) { + if (ATH_TXQ_SETUP(sc, i)) { + ATH_TXQ_LOCK(&sc->sc_txq[i]); + ath_edma_tx_fifo_fill(sc, &sc->sc_txq[i]); + ATH_TXQ_UNLOCK(&sc->sc_txq[i]); + } + } + /* Kick software scheduler */ ath_tx_swq_kick(sc); + } } static void From owner-svn-src-head@freebsd.org Tue Jun 21 15:39:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE7B4AC511B; Tue, 21 Jun 2016 15:39:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-it0-x22c.google.com (mail-it0-x22c.google.com [IPv6:2607:f8b0:4001:c0b::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 B5B1E275B; Tue, 21 Jun 2016 15:39:56 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-it0-x22c.google.com with SMTP id g127so21327444ith.0; Tue, 21 Jun 2016 08:39:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=UtQNlua9UtO3a+yWUvyYdZvxAgu+RcMPkGG57uLtyqA=; b=BjPt5meYcd62QnSut5/wYEZWpGcPrMXHaTpzLX9idtIF+Xxv1Qe6n6fP0OmmOiv8om uHO2MHF0kfzgJQ5v7j3u4nDxxIMjyeeEkeVXNXINWVDY5cOrvI95dZpmf70sKRQk47Np ROJrx9WCtsZ4d9miTVtwnsk2HrKgsmz8KuF7Ueo0XJD4MHKLXmPNhuwKZmAtwuyWqwVX n9lFZ74AgLTN6jcdzP0O/6vpCorsGyARWKJxdO8v/b08mPCICpiJtWgI5v72dcEBgffs 3ysQmoOMWyH8sWEDKHBPoeDqq4pqT7CmndTfhFzCydzfH0/Lf1qwwcCkJVALVP8ze2vn fJqw== 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:from:date :message-id:subject:to:content-transfer-encoding; bh=UtQNlua9UtO3a+yWUvyYdZvxAgu+RcMPkGG57uLtyqA=; b=mEuL9KAusHyAhdYCsVwvsKX7Qf05KJbEdDJB4SfzqsH9MlhDCT+JgH6dK7OVAm4QTY cemjEwNkuQ3cW8Ryi+NNBUq0KE9LgddM4N/fdJyMA3/Gz9qDeTG+0CbUL8rk9SaU+lPs /I/2FS/SpxEcu5k65F45IrF1QvmqQZGBe9jh+3/RU382QFYDZNk3agx/v3gbJvdN2b7B GWkMeBpD0Zg2lAqG/Pj/9V5uj2qYqS/IOpL7GMr4VYyXpr/n5vvZ9Wv1qx9F3I5CJ56e KXOts2nT/Fp51cWFLr6zEPat89noUslH2qpnD98c9QhCcYnQUo4V5gJYAtmE0Y02p/pT uxzw== X-Gm-Message-State: ALyK8tIWmy1WJK9+lfahvjRUhz699uQkPCs+qLr5ov0skQ928OHRMrEga4uflYPYhF+R3J+muWCwSbwqB6QURg== X-Received: by 10.36.250.10 with SMTP id v10mr6434473ith.25.1466523595883; Tue, 21 Jun 2016 08:39:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.210.212 with HTTP; Tue, 21 Jun 2016 08:39:55 -0700 (PDT) In-Reply-To: <20160621093624.GD80346@brick> References: <201606191428.u5JESbbs053857@slippy.cwsent.com> <49d3d34d-ba91-ebdf-497f-cbe1614bec53@FreeBSD.org> <20160621093624.GD80346@brick> From: Adrian Chadd Date: Tue, 21 Jun 2016 08:39:55 -0700 Message-ID: Subject: Re: svn commit: r299448 - in head/sys/cddl/contrib/opensolaris: common/acl uts/common/fs/zfs uts/common/sys To: Alexander Motin , Cy Schubert , Jan Beich , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 15:39:57 -0000 "Solution dictated on account of personal life" is totally legit! -a On 21 June 2016 at 02:36, Edward Tomasz Napiera=C5=82a = wrote: > On 0619T1733, Alexander Motin wrote: >> On 19.06.16 17:28, Cy Schubert wrote: >> > In message <20160619080803.GA1638@brick>, Edward Tomasz >> > =3D?utf-8?Q?Napiera=3DC5=3D82 >> > a?=3D writes: >> >> On 0614T0232, Jan Beich wrote: >> >>> Alexander Motin writes: >> >>> >> >>>> Author: mav >> >>>> Date: Wed May 11 13:43:20 2016 >> >>>> New Revision: 299448 >> >>>> URL: https://svnweb.freebsd.org/changeset/base/299448 >> >>>> >> >>>> Log: >> >>>> MFV r299442: 6762 POSIX write should imply DELETE_CHILD on direct= ories >> >> - and >> >>>> some additional considerations >> >>>> >> >>>> Reviewed by: Gordon Ross >> >>>> Reviewed by: Yuri Pankov >> >>>> Author: Kevin Crowe >> >>>> >> >>>> openzfs/openzfs@d316fffc9c361532a482208561bbb614dac7f916 >> >>> >> >>> This commit confuses acl_is_trivial_np(3). Notice '+' in ls(1) and '= D' >> >>> in getfacl(1) outputs. >> >> >> >> It's not just that. >> >> >> >> Those changes: >> >> >> >> 1. Confuse acl_is_trivial_np(3), as you say. It's hard to fix in lib= c, >> >> because they make trivial ACLs different for files and directories= , >> >> and acl_is_trivial_np(3) has no way of telling which is which. >> >> >> >> 2. They make delete deny permission take precedence over the containi= ng >> >> directory write allow permission, which is rather different from w= hat >> >> people expect in unix systems, and is against the NFSv4 specificat= ion, >> >> even though it might be a better fit for Windows. >> > >> > This is Windows behavior and inconsistent with the rest of FreeBSD and= any >> > UNIX or Linux system. >> > >> >> >> >> 3. They make umask apply to inherit_only permissions, and >> >> >> >> 4. I don't fully understand this one yet, but from the ACL regression >> >> test suite (which lives in tests/sys/acl/, and I'd appreciate peop= le >> >> actually ran this before committing ACL-related changes) it looks >> >> like it makes umask not apply to the stuff it should. >> >> >> >> The #1 could be fixed by making ZFS not setting delete_child on write= , >> >> basically reverting to the previous behaviour in that aspect. As for >> >> the others... I'm not saying each one of those is wrong, but they >> >> certainly warrant further discussion, especially #2 and #4. >> > >> > I think #2 is wrong behavior on any UNIX-like or POSIX system. >> > >> >> >> >> Basically, what I'm trying to say is that we should consider backing >> >> this out for 11.0-RELEASE, reverting to the previous semantics, verif= ied >> >> by passing the regression tests. >> > >> > Agreed. >> > >> > What in FreeBSD was this patch supposed to solve in the first place? >> >> Growing divergence from OpenZFS upstream. I am not advocating this >> patch, but it would be good, if possible, to not revert it completely, >> but block wrong behavior with some minimal ifdefs to make further ZFS >> merges easier. Help would be appreciated. ;) > > Our family just expanded, and thus I'm afraid I won't be able to help > for the next few weeks. That's one of the reasons why I've suggested > the backout for 11.0 - not a permanent "let's ignore this piece of code > forever" backout, but a temporary one, for 11.0; we would then go back > to the topic after the release. > > From owner-svn-src-head@freebsd.org Tue Jun 21 17:05:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1B4EAC48D5 for ; Tue, 21 Jun 2016 17:05:43 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f45.google.com (mail-lf0-f45.google.com [209.85.215.45]) (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 4807C1E13 for ; Tue, 21 Jun 2016 17:05:42 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f45.google.com with SMTP id h129so33310328lfh.1 for ; Tue, 21 Jun 2016 10:05:42 -0700 (PDT) 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:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=VPnP+OAJLJquK6nqc3qNeT0Tf7lcWhj97g5zjDHiL4o=; b=Oiq60M8KCjMqetpqGoQbmCGkoBoC3KyM6gLLchrohX4HhNhZvgEnV8J/K6b3htspEZ bZ27HnFJcNVzLR6jrUjYC+NZHS6+awKo+z8JvtJhmAkoEngdU8nTvWf1WCROnvMUUstu mZ4tiSWoZCeNygnofbNEiwbjWzk38vdV/i2yScFsqOUPuNAmfU/G899XfJDvN8gxaiAO nA2mA6zNK+jsLvKlhgY+6tstYOyVJA3tTbp9lLrYi/xSr9qYUgoBoG9kwT1D4HTRawm5 W5wMGMpNTWOR86xLX+Gy9rO/nzp/VFdQS9XEu7XADVpGYARL7SWM+atTjVt6m5OLvnaQ BhXQ== X-Gm-Message-State: ALyK8tKoXSCdF44ysjZ5hdxg9oRaX3QuMlqHPwGycr8d2ZUSo0Fvp8kmZ5jk6o7AjYmmJw== X-Received: by 10.25.4.4 with SMTP id 4mr5640422lfe.208.1466528735374; Tue, 21 Jun 2016 10:05:35 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id q20sm7677000lbn.25.2016.06.21.10.05.34 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Jun 2016 10:05:34 -0700 (PDT) Subject: Re: svn commit: r302026 - in head: share/monetdef share/msgdef share/numericdef share/timedef tools/tools/locale/tools To: Baptiste Daroussin References: <201606200645.u5K6jhBr081752@repo.freebsd.org> <0de854da-5914-901a-3d15-41429808ace1@freebsd.org> <20160621071249.coi44qjecd67hz32@ivaldir.etoilebsd.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Andrey Chernov Message-ID: <70f03752-4b50-caf6-48ad-68b41bfd00d2@freebsd.org> Date: Tue, 21 Jun 2016 20:05:33 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <20160621071249.coi44qjecd67hz32@ivaldir.etoilebsd.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="fv6ApRKvpDalSXWfDDgDX2ndMFP9FOFod" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 17:05:43 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --fv6ApRKvpDalSXWfDDgDX2ndMFP9FOFod Content-Type: multipart/mixed; boundary="QwxPkHatLbWuUn544k9i7Bud9wtJLPbfi" From: Andrey Chernov To: Baptiste Daroussin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <70f03752-4b50-caf6-48ad-68b41bfd00d2@freebsd.org> Subject: Re: svn commit: r302026 - in head: share/monetdef share/msgdef share/numericdef share/timedef tools/tools/locale/tools References: <201606200645.u5K6jhBr081752@repo.freebsd.org> <0de854da-5914-901a-3d15-41429808ace1@freebsd.org> <20160621071249.coi44qjecd67hz32@ivaldir.etoilebsd.net> In-Reply-To: <20160621071249.coi44qjecd67hz32@ivaldir.etoilebsd.net> --QwxPkHatLbWuUn544k9i7Bud9wtJLPbfi Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 21.06.2016 10:12, Baptiste Daroussin wrote: > On Mon, Jun 20, 2016 at 10:14:04PM +0300, Andrey Chernov wrote: >> On 20.06.2016 9:45, Baptiste Daroussin wrote: >>> Author: bapt >>> Date: Mon Jun 20 06:45:42 2016 >>> New Revision: 302026 >>> URL: https://svnweb.freebsd.org/changeset/base/302026 >>> >>> Log: >>> Fix generation of locales with multiple variants >> >> Thanx. >> Just want to note, even if we stay with RFC 5646 language tags instead= >> of ISO 639 ones with @modifier (per ISO 15897), current tags are >> incorrect because have "_" instead of "-" which makes parsing harder, >> because "_" is territory separator and someone may not expect several >> "_" exists. Per RFC 5646 we need names like >> sr-Cyrl_RS.UTF-8.src >> and not >> sr_Cyrl_RS.UTF-8.src >> > I have a patch that create the @modifier version meaning > for instance: > sr_RS.UTF-8@[modifier] >=20 > it also adds an alias sr_RS.UTF-8 which is the cyrillic version (follow= ing the > what has been done on linux for this locale) >=20 > I am seeking for your opinion on a policy to handle the locales with va= riants. > I am hesitating between 2 options: > 1/ Provide all locales that may have modifier: >=20 > - for sr_RS: > sr_RS.UTF-8@cyrillic > sr_RS.UTF-8@latin >=20 > and sr_RS.UTF-8 (which is actually the same as sr_RS.UTF-8@cyrillic) >=20 > - for zh_TW > zh_TW.UTF-8@hant > and zh_TW.UTF-8 (which is an alias on zh_TW.UTF-8@hant) >=20 > - for mn_MN > mn_MN.UTF-8@cyrillic > mn_MN.UTF-8 (which is an alias on mn_MN.UTF-8@cyrillic) >=20 > 2/ Only provide the @version for the ones for which we have an ambiguit= y >=20 > - for sr_RS: > sr_RS.UTF-8@latin > sr_RS.UTF-8 (would be the cyrillic one) >=20 > - for zh_TW > zh_TW.UTF-8 (no @modifier version) >=20 > - for mn_MN > mn_MN.UTF-8 (no @modifier version) >=20 >=20 > I do like the first (more explicit and simpler to do with our code whil= e still > compatible with the second). Linux only does the second. >=20 > But I understand the first can be confusing for languages with (for now= ) only > one variant supported like users asking themselves: > which one should I choose: mn_MN.UTF-8 or mn_MN.UTF-8@cyrillic? > They might not now they are actually the same >=20 > Any opinion? Since @modifier exists just to avoid ambiguity, we definitely don't need to add f.e. @cyrillic to every cyrillic-based locale and @latin to every latin-based one, and so on. Difference between no @modifier and some @modifier is enough to avoid ambiguity too, so I vote for Linux way. GNU libintl drops any @modifier in any case and use its own default encoding it tries to convert to user one later. --QwxPkHatLbWuUn544k9i7Bud9wtJLPbfi-- --fv6ApRKvpDalSXWfDDgDX2ndMFP9FOFod Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJXaXPdAAoJEKUckv0MjfbKqB8H/RrOZA/ObnY5rfP1I58BL7Qt DZFZTuyBwA5VPiBpF+b42p/x2RNpwurmDLHG+gCGg6Va+wAVok3U9sUsQ2SUVIOi rRfallmQ9jCjekyhfpgN1tEgMI+8FGeICXe3UquZ047icl1h0eawnF4zoUuEOwun HuA2JSFQ0mR2th7MNM8v14tKJ1EH1m4rEXqcYO+auK1ag+ftbPG2vMk3HbvjSroi 914cdlehR4dZK9GUkU1Hz/YWjBTq/YBdlJOUHoVoPBmj/1NIsVVY9QMoFKX7sI8j nKzKJgPKDFYtLAw4NyV2v7O0xA+XWY21nsHPeRGwWPgmCVE34wSUjBH51moISDw= =mzVM -----END PGP SIGNATURE----- --fv6ApRKvpDalSXWfDDgDX2ndMFP9FOFod-- From owner-svn-src-head@freebsd.org Tue Jun 21 17:49:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA324AC5646; Tue, 21 Jun 2016 17:49:34 +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 6D45E1721; Tue, 21 Jun 2016 17:49:34 +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 u5LHnX50078954; Tue, 21 Jun 2016 17:49:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5LHnXLk078952; Tue, 21 Jun 2016 17:49:33 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606211749.u5LHnXLk078952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 21 Jun 2016 17:49:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302063 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 17:49:34 -0000 Author: kib Date: Tue Jun 21 17:49:33 2016 New Revision: 302063 URL: https://svnweb.freebsd.org/changeset/base/302063 Log: The vmtotal sysctl handler marks active vm objects to calculate statistics. Marking is done by setting the OBJ_ACTIVE flag. The flags change is locked, but the problem is that many parts of system assume that vm object initialization ensures that no other code could change the object, and thus performed lockless. The end result is corrupted flags in vm objects, most visible is spurious OBJ_DEAD flag, causing random hangs. Avoid the active object marking, instead provide equally inexact but immutable is_object_alive() definition for the object mapped state. Avoid iterating over the processes mappings altogether by using arguably improved definition of the paging thread as one which sleeps on the v_free_count. PR: 204764 Diagnosed by: pho Tested by: pho (previous version) Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 1 week Approved by: re (gjb) Modified: head/sys/vm/vm_meter.c head/sys/vm/vm_object.h Modified: head/sys/vm/vm_meter.c ============================================================================== --- head/sys/vm/vm_meter.c Tue Jun 21 15:49:09 2016 (r302062) +++ head/sys/vm/vm_meter.c Tue Jun 21 17:49:33 2016 (r302063) @@ -89,29 +89,31 @@ SYSCTL_PROC(_vm, VM_LOADAVG, loadavg, CT CTLFLAG_MPSAFE, NULL, 0, sysctl_vm_loadavg, "S,loadavg", "Machine loadaverage history"); +/* + * This function aims to determine if the object is mapped, + * specifically, if it is referenced by a vm_map_entry. Because + * objects occasionally acquire transient references that do not + * represent a mapping, the method used here is inexact. However, it + * has very low overhead and is good enough for the advisory + * vm.vmtotal sysctl. + */ +static bool +is_object_active(vm_object_t obj) +{ + + return (obj->ref_count > obj->shadow_count); +} + static int vmtotal(SYSCTL_HANDLER_ARGS) { - struct proc *p; struct vmtotal total; - vm_map_entry_t entry; vm_object_t object; - vm_map_t map; - int paging; + struct proc *p; struct thread *td; - struct vmspace *vm; bzero(&total, sizeof(total)); - /* - * Mark all objects as inactive. - */ - mtx_lock(&vm_object_list_mtx); - TAILQ_FOREACH(object, &vm_object_list, object_list) { - VM_OBJECT_WLOCK(object); - vm_object_clear_flag(object, OBJ_ACTIVE); - VM_OBJECT_WUNLOCK(object); - } - mtx_unlock(&vm_object_list_mtx); + /* * Calculate process statistics. */ @@ -132,11 +134,15 @@ vmtotal(SYSCTL_HANDLER_ARGS) case TDS_INHIBITED: if (TD_IS_SWAPPED(td)) total.t_sw++; - else if (TD_IS_SLEEPING(td) && - td->td_priority <= PZERO) - total.t_dw++; - else - total.t_sl++; + else if (TD_IS_SLEEPING(td)) { + if (td->td_priority <= PZERO) + total.t_dw++; + else + total.t_sl++; + if (td->td_wchan == + &vm_cnt.v_free_count) + total.t_pw++; + } break; case TDS_CAN_RUN: @@ -154,29 +160,6 @@ vmtotal(SYSCTL_HANDLER_ARGS) } } PROC_UNLOCK(p); - /* - * Note active objects. - */ - paging = 0; - vm = vmspace_acquire_ref(p); - if (vm == NULL) - continue; - map = &vm->vm_map; - vm_map_lock_read(map); - for (entry = map->header.next; - entry != &map->header; entry = entry->next) { - if ((entry->eflags & MAP_ENTRY_IS_SUB_MAP) || - (object = entry->object.vm_object) == NULL) - continue; - VM_OBJECT_WLOCK(object); - vm_object_set_flag(object, OBJ_ACTIVE); - paging |= object->paging_in_progress; - VM_OBJECT_WUNLOCK(object); - } - vm_map_unlock_read(map); - vmspace_free(vm); - if (paging) - total.t_pw++; } sx_sunlock(&allproc_lock); /* @@ -202,9 +185,18 @@ vmtotal(SYSCTL_HANDLER_ARGS) */ continue; } + if (object->ref_count == 1 && + (object->flags & OBJ_NOSPLIT) != 0) { + /* + * Also skip otherwise unreferenced swap + * objects backing tmpfs vnodes, and POSIX or + * SysV shared memory. + */ + continue; + } total.t_vm += object->size; total.t_rm += object->resident_page_count; - if (object->flags & OBJ_ACTIVE) { + if (is_object_active(object)) { total.t_avm += object->size; total.t_arm += object->resident_page_count; } @@ -212,7 +204,7 @@ vmtotal(SYSCTL_HANDLER_ARGS) /* shared object */ total.t_vmshr += object->size; total.t_rmshr += object->resident_page_count; - if (object->flags & OBJ_ACTIVE) { + if (is_object_active(object)) { total.t_avmshr += object->size; total.t_armshr += object->resident_page_count; } Modified: head/sys/vm/vm_object.h ============================================================================== --- head/sys/vm/vm_object.h Tue Jun 21 15:49:09 2016 (r302062) +++ head/sys/vm/vm_object.h Tue Jun 21 17:49:33 2016 (r302063) @@ -182,7 +182,6 @@ struct vm_object { */ #define OBJ_FICTITIOUS 0x0001 /* (c) contains fictitious pages */ #define OBJ_UNMANAGED 0x0002 /* (c) contains unmanaged pages */ -#define OBJ_ACTIVE 0x0004 /* active objects */ #define OBJ_DEAD 0x0008 /* dead objects (during rundown) */ #define OBJ_NOSPLIT 0x0010 /* dont split this object */ #define OBJ_UMTXDEAD 0x0020 /* umtx pshared was terminated */ From owner-svn-src-head@freebsd.org Tue Jun 21 17:53:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 722BDAC5800; Tue, 21 Jun 2016 17:53:43 +0000 (UTC) (envelope-from ian@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 1CE1C1BFF; Tue, 21 Jun 2016 17:53:43 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5LHrgnL082488; Tue, 21 Jun 2016 17:53:42 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5LHrg7t082487; Tue, 21 Jun 2016 17:53:42 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201606211753.u5LHrg7t082487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Tue, 21 Jun 2016 17:53:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302064 - head/sys/arm/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 17:53:43 -0000 Author: ian Date: Tue Jun 21 17:53:42 2016 New Revision: 302064 URL: https://svnweb.freebsd.org/changeset/base/302064 Log: Revert the recent armv6 changes to ALIGNED_POINTER(), restoring the fully-pessimized implementation that requires a type to be aligned to its natural size. On armv6+ the compiler might generate load-/store-multiple instructions which require 4-byte alignment even though the source code is only accessing individual uint32_t values in a way that doesn't require any particular alignment at all. The compiler apparently feels free to combine multiple accesses into a single instruction that requires a more-strict alignment, and no set of compiler flags seems to disable this behavior (at least in clang 3.8). This fixes alignment faults on arm systems using wifi adapters. The wifi code uses ALIGNED_POINTER(p, uint32_t) to decide whether it needs to copy-align tcp headers. Because clang is combining several uint32_t accesses into a single ldm instruction, we need to say that accessing a uint32_t requires 4-byte alignment. Approved by: re(gjb) Modified: head/sys/arm/include/param.h Modified: head/sys/arm/include/param.h ============================================================================== --- head/sys/arm/include/param.h Tue Jun 21 17:49:33 2016 (r302063) +++ head/sys/arm/include/param.h Tue Jun 21 17:53:42 2016 (r302064) @@ -91,15 +91,15 @@ * This does not reflect the optimal alignment, just the possibility * (within reasonable limits). * - * armv4 and v5 require alignment to the type's size. armv6 and later require - * that an 8-byte type be aligned to at least a 4-byte boundary; access to - * smaller types can be unaligned. + * armv4 and v5 require alignment to the type's size. armv6 requires 8-byte + * alignment for the ldrd/strd instructions, but otherwise follows armv7 rules. + * armv7 requires that an 8-byte type be aligned to at least a 4-byte boundary; + * access to smaller types can be unaligned, except that the compiler may + * optimize access to adjacent uint32_t values into a single load/store-multiple + * instruction which requires 4-byte alignment, so we must provide the most- + * pessimistic answer possible even on armv7. */ -#if __ARM_ARCH >= 6 -#define ALIGNED_POINTER(p, t) (((sizeof(t) != 8) || ((unsigned)(p) & 3) == 0)) -#else #define ALIGNED_POINTER(p, t) ((((unsigned)(p)) & (sizeof(t)-1)) == 0) -#endif /* * CACHE_LINE_SIZE is the compile-time maximum cache line size for an From owner-svn-src-head@freebsd.org Tue Jun 21 18:50:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B880FAC5382; Tue, 21 Jun 2016 18:50:26 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 819CA1C7F; Tue, 21 Jun 2016 18:50:25 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id VAA11991; Tue, 21 Jun 2016 21:50:17 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bFQkb-000IMc-B3; Tue, 21 Jun 2016 21:50:17 +0300 Subject: Re: svn commit: r301929 - head/sys/kern To: Konstantin Belousov , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201606151556.u5FFu3pt032257@repo.freebsd.org> From: Andriy Gapon Message-ID: <5200834c-c3d4-6331-eecb-155e6453ba96@FreeBSD.org> Date: Tue, 21 Jun 2016 21:49:24 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606151556.u5FFu3pt032257@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 18:50:26 -0000 On 15/06/2016 18:56, Konstantin Belousov wrote: > Author: kib > Date: Wed Jun 15 15:56:03 2016 > New Revision: 301929 > URL: https://svnweb.freebsd.org/changeset/base/301929 > > Log: > Do not assume that we own the use reference on the covered vnode until > we set MNTK_UNMOUNT flag on the mp. Otherwise parallel unmount which > wins race with us could dereference the covered vnode, and we are > left with the locked freed memory. > > Reported and tested by: pho > Sponsored by: The FreeBSD Foundation > Approved by: re (gjb) > MFC after: 1 week Kostik, does this change fix (or is likely to fix) the following panic? Thanks! VNASSERT failed 0xfffff8000c926588: tag none, type VBAD usecount 0, writecount 0, refcount 0 mountedhere 0 VNASSERT failed 0xfffff8000e95f000: tag none, type VBAD usecount 0, writecount 0, refcount 0 mountedhere 0 flags () lock type zfs: EXCL by thread 0xfffff80020921a00 (pid 2017, zfs, tid 100794) panic: No vop_unlock(0xfffff8000e95f000, 0xfffffe004df8a980) cpuid = 2 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe004df8a820 vpanic() at vpanic+0x182/frame 0xfffffe004df8a8a0 kassert_panic() at kassert_panic+0x126/frame 0xfffffe004df8a910 VOP_UNLOCK_APV() at VOP_UNLOCK_APV+0x94/frame 0xfffffe004df8a940 dounmount() at dounmount+0x138/frame 0xfffffe004df8a9c0 sys_unmount() at sys_unmount+0x35d/frame 0xfffffe004df8aae0 amd64_syscall() at amd64_syscall+0x2db/frame 0xfffffe004df8abf0 Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe004df8abf0 --- syscall (22, FreeBSD ELF64, sys_unmount), rip = 0x8012f4e4a, rsp = 0x7fffffffc298, rbp = 0x7fffffffc300 --- KDB: enter: panic [ thread pid 2017 tid 100794 ] Stopped at kdb_enter+0x3b: movq $0,kdb_why P.S. Not sure why two VNASSERTs are reported here, but this is copied verbatim from a console. > Modified: > head/sys/kern/vfs_mount.c -- Andriy Gapon From owner-svn-src-head@freebsd.org Tue Jun 21 19:03:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48FB1AC56FB; Tue, 21 Jun 2016 19:03:26 +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 E65B325F3; Tue, 21 Jun 2016 19:03:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u5LJ3K8F099569 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 21 Jun 2016 22:03:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u5LJ3K8F099569 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u5LJ3KOP099568; Tue, 21 Jun 2016 22:03:20 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 21 Jun 2016 22:03:20 +0300 From: Konstantin Belousov To: Andriy Gapon Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Subject: Re: svn commit: r301929 - head/sys/kern Message-ID: <20160621190320.GF38613@kib.kiev.ua> References: <201606151556.u5FFu3pt032257@repo.freebsd.org> <5200834c-c3d4-6331-eecb-155e6453ba96@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5200834c-c3d4-6331-eecb-155e6453ba96@FreeBSD.org> User-Agent: Mutt/1.6.1 (2016-04-27) 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 19:03:26 -0000 On Tue, Jun 21, 2016 at 09:49:24PM +0300, Andriy Gapon wrote: > On 15/06/2016 18:56, Konstantin Belousov wrote: > > Author: kib > > Date: Wed Jun 15 15:56:03 2016 > > New Revision: 301929 > > URL: https://svnweb.freebsd.org/changeset/base/301929 > > > > Log: > > Do not assume that we own the use reference on the covered vnode until > > we set MNTK_UNMOUNT flag on the mp. Otherwise parallel unmount which > > wins race with us could dereference the covered vnode, and we are > > left with the locked freed memory. > > > > Reported and tested by: pho > > Sponsored by: The FreeBSD Foundation > > Approved by: re (gjb) > > MFC after: 1 week > > > Kostik, > > does this change fix (or is likely to fix) the following panic? Yes, this is exactly the problem that was reported, Peter made sure that he is able to reproduce the issue at will, and that the patch fixed it. > Thanks! > > VNASSERT failed > 0xfffff8000c926588: tag none, type VBAD > usecount 0, writecount 0, refcount 0 mountedhere 0 > VNASSERT failed > 0xfffff8000e95f000: tag none, type VBAD > usecount 0, writecount 0, refcount 0 mountedhere 0 > flags () > lock type zfs: EXCL by thread 0xfffff80020921a00 (pid 2017, zfs, tid > 100794) > panic: No vop_unlock(0xfffff8000e95f000, 0xfffffe004df8a980) > cpuid = 2 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe004df8a820 > vpanic() at vpanic+0x182/frame 0xfffffe004df8a8a0 > kassert_panic() at kassert_panic+0x126/frame 0xfffffe004df8a910 > VOP_UNLOCK_APV() at VOP_UNLOCK_APV+0x94/frame 0xfffffe004df8a940 > dounmount() at dounmount+0x138/frame 0xfffffe004df8a9c0 > sys_unmount() at sys_unmount+0x35d/frame 0xfffffe004df8aae0 > amd64_syscall() at amd64_syscall+0x2db/frame 0xfffffe004df8abf0 > Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe004df8abf0 > --- syscall (22, FreeBSD ELF64, sys_unmount), rip = 0x8012f4e4a, rsp = > 0x7fffffffc298, rbp = 0x7fffffffc300 --- > KDB: enter: panic > [ thread pid 2017 tid 100794 ] > Stopped at kdb_enter+0x3b: movq $0,kdb_why > > P.S. Not sure why two VNASSERTs are reported here, but this is copied > verbatim from a console. Most likely you got two CPUs checking the same assert, but only one was able to enter the panic state. Look at the backtraces of running threads on other processors. > > > Modified: > > head/sys/kern/vfs_mount.c > > > -- > Andriy Gapon From owner-svn-src-head@freebsd.org Tue Jun 21 20:14:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAF35AC59D0; Tue, 21 Jun 2016 20:14:33 +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 BA0D82E75; Tue, 21 Jun 2016 20:14:33 +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 u5LKEWme034573; Tue, 21 Jun 2016 20:14:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5LKEWEP034572; Tue, 21 Jun 2016 20:14:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606212014.u5LKEWEP034572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 21 Jun 2016 20:14:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302067 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 20:14:34 -0000 Author: bdrewery Date: Tue Jun 21 20:14:32 2016 New Revision: 302067 URL: https://svnweb.freebsd.org/changeset/base/302067 Log: Fix top-level builds with fmake / 9.x. Reported by: allanjude Approved by: re (marius) Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Tue Jun 21 20:13:19 2016 (r302066) +++ head/Makefile Tue Jun 21 20:14:32 2016 (r302067) @@ -103,7 +103,7 @@ # This is included so CC is set to ccache for -V, and COMPILER_TYPE/VERSION # can be cached for sub-makes. -.if ${MAKE_VERSION} >= 20140620 +.if ${MAKE_VERSION} >= 20140620 && defined(.PARSEDIR) .include .endif @@ -218,7 +218,9 @@ _CAN_USE_META_MODE?= yes .endfor .if !defined(_CAN_USE_META_MODE) _MAKE+= MK_META_MODE=no +.if defined(.PARSEDIR) .unexport META_MODE +.endif .elif defined(MK_META_MODE) && ${MK_META_MODE} == "yes" .if !exists(/dev/filemon) && !defined(NO_FILEMON) && !make(showconfig) # Require filemon be loaded to provide a working incremental build From owner-svn-src-head@freebsd.org Tue Jun 21 20:18:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F254AC5AE4; Tue, 21 Jun 2016 20:18:20 +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 21C6F12BE; Tue, 21 Jun 2016 20:18:20 +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 u5LKIJcF034786; Tue, 21 Jun 2016 20:18:19 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5LKIJ7C034784; Tue, 21 Jun 2016 20:18:19 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201606212018.u5LKIJ7C034784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Tue, 21 Jun 2016 20:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302069 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 20:18:20 -0000 Author: ken Date: Tue Jun 21 20:18:19 2016 New Revision: 302069 URL: https://svnweb.freebsd.org/changeset/base/302069 Log: Fix a bug that caused da(4) instances to hang around after the underlying device is gone. The problem was that when disk_gone() is called, if the GEOM disk creation process has not yet happened, the withering process couldn't start. We didn't record any state in the GEOM disk code, and so the d_gone() callback to the da(4) driver never happened. The solution is to track the state of the creation process, and initiate the withering process from g_disk_create() if the disk is being created. This change does add fields to struct disk, and so I have bumped DISK_VERSION. geom_disk.c: Track where we are in the disk creation process, and check to see whether our underlying disk has gone away or not. In disk_gone(), set a new d_goneflag variable that g_disk_create() can check to see if it needs to clean up the disk instance. geom_disk.h: Add a mutex to struct disk (for internal use) disk init level, and a gone flag. Bump DISK_VERSION because the size of struct disk has changed and fields have been added at the beginning. Sponsored by: Spectra Logic Approved by: re (marius) Modified: head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Tue Jun 21 20:15:30 2016 (r302068) +++ head/sys/geom/geom_disk.c Tue Jun 21 20:18:19 2016 (r302069) @@ -669,6 +669,22 @@ g_disk_create(void *arg, int flag) return; g_topology_assert(); dp = arg; + + mtx_lock(&dp->d_mtx); + dp->d_init_level = DISK_INIT_START; + + /* + * If the disk has already gone away, we can just stop here and + * call the user's callback to tell him we've cleaned things up. + */ + if (dp->d_goneflag != 0) { + mtx_unlock(&dp->d_mtx); + if (dp->d_gone != NULL) + dp->d_gone(dp); + return; + } + mtx_unlock(&dp->d_mtx); + sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); mtx_init(&sc->start_mtx, "g_disk_start", NULL, MTX_DEF); mtx_init(&sc->done_mtx, "g_disk_done", NULL, MTX_DEF); @@ -704,6 +720,21 @@ g_disk_create(void *arg, int flag) pp->private = sc; dp->d_geom = gp; g_error_provider(pp, 0); + + mtx_lock(&dp->d_mtx); + dp->d_init_level = DISK_INIT_DONE; + + /* + * If the disk has gone away at this stage, start the withering + * process for it. + */ + if (dp->d_goneflag != 0) { + mtx_unlock(&dp->d_mtx); + g_wither_provider(pp, ENXIO); + return; + } + mtx_unlock(&dp->d_mtx); + } /* @@ -754,6 +785,9 @@ g_disk_destroy(void *ptr, int flag) dp->d_geom = NULL; g_wither_geom(gp, ENXIO); } + + mtx_destroy(&dp->d_mtx); + g_free(dp); } @@ -817,6 +851,12 @@ disk_create(struct disk *dp, int version dp->d_sectorsize, DEVSTAT_ALL_SUPPORTED, DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); dp->d_geom = NULL; + + snprintf(dp->d_mtx_name, sizeof(dp->d_mtx_name), "%s%ddlk", + dp->d_name, dp->d_unit); + mtx_init(&dp->d_mtx, dp->d_mtx_name, NULL, MTX_DEF); + dp->d_init_level = DISK_INIT_NONE; + g_disk_ident_adjust(dp->d_ident, sizeof(dp->d_ident)); g_post_event(g_disk_create, dp, M_WAITOK, dp, NULL); } @@ -838,6 +878,30 @@ disk_gone(struct disk *dp) struct g_geom *gp; struct g_provider *pp; + mtx_lock(&dp->d_mtx); + dp->d_goneflag = 1; + + /* + * If we're still in the process of creating this disk (the + * g_disk_create() function is still queued, or is in + * progress), the init level will not yet be DISK_INIT_DONE. + * + * If that is the case, g_disk_create() will see d_goneflag + * and take care of cleaning things up. + * + * If the disk has already been created, we default to + * withering the provider as usual below. + * + * If the caller has not set a d_gone() callback, he will + * not be any worse off by returning here, because the geom + * has not been fully setup in any case. + */ + if (dp->d_init_level < DISK_INIT_DONE) { + mtx_unlock(&dp->d_mtx); + return; + } + mtx_unlock(&dp->d_mtx); + gp = dp->d_geom; if (gp != NULL) { pp = LIST_FIRST(&gp->provider); Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Tue Jun 21 20:15:30 2016 (r302068) +++ head/sys/geom/geom_disk.h Tue Jun 21 20:18:19 2016 (r302069) @@ -60,11 +60,21 @@ typedef int disk_ioctl_t(struct disk *, struct g_geom; struct devstat; +typedef enum { + DISK_INIT_NONE, + DISK_INIT_START, + DISK_INIT_DONE +} disk_init_level; + struct disk { /* Fields which are private to geom_disk */ struct g_geom *d_geom; struct devstat *d_devstat; + int d_goneflag; int d_destroyed; + struct mtx d_mtx; + char d_mtx_name[24]; + disk_init_level d_init_level; /* Shared fields */ u_int d_flags; @@ -125,7 +135,8 @@ int disk_resize(struct disk *dp, int fla #define DISK_VERSION_02 0x5856105b #define DISK_VERSION_03 0x5856105c #define DISK_VERSION_04 0x5856105d -#define DISK_VERSION DISK_VERSION_04 +#define DISK_VERSION_05 0x5856105e +#define DISK_VERSION DISK_VERSION_05 #endif /* _KERNEL */ #endif /* _GEOM_GEOM_DISK_H_ */ From owner-svn-src-head@freebsd.org Tue Jun 21 20:28:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00C82AC5EA2; Tue, 21 Jun 2016 20:28:32 +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 C4DB61E12; Tue, 21 Jun 2016 20:28:31 +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 u5LKSUiF039042; Tue, 21 Jun 2016 20:28:30 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5LKSUiS039041; Tue, 21 Jun 2016 20:28:30 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201606212028.u5LKSUiS039041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Tue, 21 Jun 2016 20:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302071 - 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 20:28:32 -0000 Author: ken Date: Tue Jun 21 20:28:30 2016 New Revision: 302071 URL: https://svnweb.freebsd.org/changeset/base/302071 Log: Bump __FreeBSD_version to 1100118 for r302069, which breaks binary compatibility for loadable modules that depend on struct disk. Approved by: re (delphij) Sponsored by: Spectra Logic Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Tue Jun 21 20:20:30 2016 (r302070) +++ head/sys/sys/param.h Tue Jun 21 20:28:30 2016 (r302071) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100117 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100118 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Tue Jun 21 21:55:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 99BC0AC53EA; Tue, 21 Jun 2016 21:55: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 74DA722BC; Tue, 21 Jun 2016 21:55: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 u5LLt3Og072330; Tue, 21 Jun 2016 21:55:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5LLt3sH072326; Tue, 21 Jun 2016 21:55:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606212155.u5LLt3sH072326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 21 Jun 2016 21:55:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302073 - in head: share/mk sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 21:55:04 -0000 Author: bdrewery Date: Tue Jun 21 21:55:03 2016 New Revision: 302073 URL: https://svnweb.freebsd.org/changeset/base/302073 Log: META_MODE: Don't generate or read _EXTRADEPEND dependencies when using filemon. The DPADD data in .depend will be redundant with what is in the .meta file. Also extend NO_EXTRADEPEND support to bsd.prog.mk. Approved by: re (blanket, META_MODE) Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.dep.mk head/share/mk/bsd.prog.mk head/share/mk/sys.mk head/sys/conf/kern.post.mk Modified: head/share/mk/bsd.dep.mk ============================================================================== --- head/share/mk/bsd.dep.mk Tue Jun 21 20:32:34 2016 (r302072) +++ head/share/mk/bsd.dep.mk Tue Jun 21 21:55:03 2016 (r302073) @@ -72,10 +72,16 @@ tags: ${SRCS} .endif .endif +.if !empty(.MAKE.MODE:Mmeta) && empty(.MAKE.MODE:Mnofilemon) +_meta_filemon= 1 +.endif + # Skip reading .depend when not needed to speed up tree-walks # and simple lookups. +# Also skip generating or including .depend.* files if in meta+filemon mode +# since it will track dependencies itself. OBJS_DEPEND_GUESS is still used. .if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \ - make(install*) || make(analyze) + make(install*) || make(analyze) || defined(_meta_filemon) _SKIP_READ_DEPEND= 1 .if ${MK_DIRDEPS_BUILD} == "no" .MAKE.DEPENDFILE= /dev/null @@ -157,9 +163,6 @@ ${_D}.po: ${_DSRC} ${POBJS:S/^${_D}.po$/ .endfor -.if !empty(.MAKE.MODE:Mmeta) && empty(.MAKE.MODE:Mnofilemon) -_meta_filemon= 1 -.endif .if ${MAKE_VERSION} < 20160220 DEPEND_MP?= -MP .endif @@ -173,8 +176,6 @@ DEPENDOBJS+= ${DEPENDSRCS:R:S,$,.o,} DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:${DEPEND_FILTER}:C/^/${DEPENDFILE}./} DEPEND_CFLAGS+= -MD ${DEPEND_MP} -MF${DEPENDFILE}.${.TARGET:${DEPEND_FILTER}} DEPEND_CFLAGS+= -MT${.TARGET} -# Skip generating or including .depend.* files if in meta+filemon mode since -# it will track dependencies itself. OBJS_DEPEND_GUESS is still used though. .if !defined(_meta_filemon) .if defined(.PARSEDIR) # Only add in DEPEND_CFLAGS for CFLAGS on files we expect from DEPENDOBJS @@ -201,7 +202,7 @@ CFLAGS+= ${DEPEND_CFLAGS} .depend: .include # If using filemon then _EXTRADEPEND is skipped since it is not needed. -.if empty(.MAKE.MODE:Mnofilemon) +.if defined(_meta_filemon) # this depend: bypasses that below # the dependency helps when bootstrapping depend: beforedepend ${DPSRCS} ${SRCS} afterdepend @@ -245,15 +246,18 @@ depend: beforedepend ${DEPENDFILE} after DPSRCS+= ${SRCS} # A .depend file will only be generated if there are commands in -# beforedepend/_EXTRADEPEND/afterdepend. The target is kept -# to allow 'make depend' to generate files. +# beforedepend/_EXTRADEPEND/afterdepend The _EXTRADEPEND target is +# ignored if using meta+filemon since it handles all dependencies. The other +# targets are kept as they be used for generating something. The target is +# kept to allow 'make depend' to generate files. ${DEPENDFILE}: ${DPSRCS} .if exists(${.OBJDIR}/${DEPENDFILE}) || \ - ((commands(beforedepend) || commands(_EXTRADEPEND) || \ + ((commands(beforedepend) || \ + (!defined(_meta_filemon) && commands(_EXTRADEPEND)) || \ commands(afterdepend)) && !empty(.MAKE.MODE:Mmeta)) rm -f ${DEPENDFILE} .endif -.if target(_EXTRADEPEND) +.if !defined(_meta_filemon) && target(_EXTRADEPEND) _EXTRADEPEND: .USE ${DEPENDFILE}: _EXTRADEPEND .endif Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Tue Jun 21 20:32:34 2016 (r302072) +++ head/share/mk/bsd.prog.mk Tue Jun 21 21:55:03 2016 (r302073) @@ -178,6 +178,7 @@ CLEANFILES+= ${OBJS} .include .if defined(PROG) +.if !defined(NO_EXTRADEPEND) _EXTRADEPEND: .if defined(LDFLAGS) && !empty(LDFLAGS:M-nostdlib) .if defined(DPADD) && !empty(DPADD) @@ -193,6 +194,7 @@ _EXTRADEPEND: .endif .endif .endif +.endif # !defined(NO_EXTRADEPEND) .endif .if !target(install) Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Tue Jun 21 20:32:34 2016 (r302072) +++ head/share/mk/sys.mk Tue Jun 21 21:55:03 2016 (r302073) @@ -75,6 +75,8 @@ META_MODE?= normal # buildworld -> installworld -> buildworld to rebuild everything. # Since the build is self-reliant and bootstraps everything it needs, # this should not be a real problem for incremental builds. +# XXX: This relies on the existing host tools retaining ABI compatibility +# through upgrades since they won't be rebuilt on header/library changes. # Note that these are prefix matching, so /lib matches /libexec. .MAKE.META.IGNORE_PATHS+= \ ${__MAKE_SHELL} \ Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue Jun 21 20:32:34 2016 (r302072) +++ head/sys/conf/kern.post.mk Tue Jun 21 21:55:03 2016 (r302073) @@ -189,11 +189,16 @@ genassym.o: $S/$M/$M/genassym.c ${SYSTEM_OBJS} genassym.o vers.o: opt_global.h +.if !empty(.MAKE.MODE:Unormal:Mmeta) && empty(.MAKE.MODE:Unormal:Mnofilemon) +_meta_filemon= 1 +.endif # Skip reading .depend when not needed to speed up tree-walks # and simple lookups. +# Also skip generating or including .depend.* files if in meta+filemon mode +# since it will track dependencies itself. OBJS_DEPEND_GUESS is still used. .if !empty(.MAKEFLAGS:M-V${_V_READ_DEPEND}) || make(obj) || make(clean*) || \ make(install*) || make(kernel-obj) || make(kernel-clean*) || \ - make(kernel-install*) + make(kernel-install*) || defined(_meta_filemon) _SKIP_READ_DEPEND= 1 .MAKE.DEPENDFILE= /dev/null .endif @@ -203,11 +208,6 @@ SRCS= assym.s vnode_if.h ${BEFORE_DEPEND ${SYSTEM_CFILES} ${GEN_CFILES} ${SFILES} \ ${MFILES:T:S/.m$/.h/} DEPENDFILES= .depend .depend.* -# Skip generating or including .depend.* files if in meta+filemon mode since -# it will track dependencies itself. OBJS_DEPEND_GUESS is still used though. -.if !empty(.MAKE.MODE:Unormal:Mmeta) && empty(.MAKE.MODE:Unormal:Mnofilemon) -_meta_filemon= 1 -.endif DEPENDOBJS+= ${SYSTEM_OBJS} genassym.o DEPENDFILES_OBJS= ${DEPENDOBJS:O:u:C/^/.depend./} .if ${MAKE_VERSION} < 20160220 From owner-svn-src-head@freebsd.org Tue Jun 21 22:19:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7563CAC5A00; Tue, 21 Jun 2016 22:19:08 +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 50D282F7D; Tue, 21 Jun 2016 22:19:08 +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 u5LMJ7TK080138; Tue, 21 Jun 2016 22:19:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5LMJ7qT080133; Tue, 21 Jun 2016 22:19:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201606212219.u5LMJ7qT080133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 21 Jun 2016 22:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302074 - in head: sys/dev/cxgbe/tom sys/kern sys/sys tests/sys/aio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 22:19:08 -0000 Author: jhb Date: Tue Jun 21 22:19:06 2016 New Revision: 302074 URL: https://svnweb.freebsd.org/changeset/base/302074 Log: Account for AIO socket operations in thread/process resource usage. File and disk-backed I/O requests store counts of read/written disk blocks in each AIO job so that they can be charged to the thread that completes an AIO request via aio_return() or aio_waitcomplete(). This change extends AIO jobs to store counts of received/sent messages and updates socket backends to set these counts accordingly. Note that the socket backends are careful to only charge a single messages for each AIO request even though a single request on a blocking socket might invoke sosend or soreceive multiple times. This is to mimic the resource accounting of synchronous read/write. Adjust the UNIX socketpair AIO test to verify that the message resource usage counts update accordingly for aio_read and aio_write. Approved by: re (hrs) Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D6911 Modified: head/sys/dev/cxgbe/tom/t4_ddp.c head/sys/kern/sys_socket.c head/sys/kern/vfs_aio.c head/sys/sys/aio.h head/tests/sys/aio/aio_test.c Modified: head/sys/dev/cxgbe/tom/t4_ddp.c ============================================================================== --- head/sys/dev/cxgbe/tom/t4_ddp.c Tue Jun 21 21:55:03 2016 (r302073) +++ head/sys/dev/cxgbe/tom/t4_ddp.c Tue Jun 21 22:19:06 2016 (r302074) @@ -360,6 +360,8 @@ insert_ddp_data(struct toepcb *toep, uin placed = n; if (placed > job->uaiocb.aio_nbytes - copied) placed = job->uaiocb.aio_nbytes - copied; + if (placed > 0) + job->msgrcv = 1; if (!aio_clear_cancel_function(job)) { /* * Update the copied length for when @@ -602,6 +604,7 @@ handle_ddp_data(struct toepcb *toep, __b toep->rx_credits += len; #endif + job->msgrcv = 1; if (db->cancel_pending) { /* * Update the job's length but defer completion to the @@ -756,6 +759,8 @@ handle_ddp_close(struct toepcb *toep, st placed = len; if (placed > job->uaiocb.aio_nbytes - copied) placed = job->uaiocb.aio_nbytes - copied; + if (placed > 0) + job->msgrcv = 1; if (!aio_clear_cancel_function(job)) { /* * Update the copied length for when @@ -1458,6 +1463,7 @@ sbcopy: if (copied != 0) { sbdrop_locked(sb, copied); job->aio_received += copied; + job->msgrcv = 1; copied = job->aio_received; inp = sotoinpcb(so); if (!INP_TRY_WLOCK(inp)) { Modified: head/sys/kern/sys_socket.c ============================================================================== --- head/sys/kern/sys_socket.c Tue Jun 21 21:55:03 2016 (r302073) +++ head/sys/kern/sys_socket.c Tue Jun 21 22:19:06 2016 (r302074) @@ -563,6 +563,7 @@ soaio_process_job(struct socket *so, str struct uio uio; struct iovec iov; size_t cnt, done; + long ru_before; int error, flags; SOCKBUF_UNLOCK(sb); @@ -585,23 +586,33 @@ retry: uio.uio_td = td; flags = MSG_NBIO; - /* TODO: Charge ru_msg* to job. */ + /* + * For resource usage accounting, only count a completed request + * as a single message to avoid counting multiple calls to + * sosend/soreceive on a blocking socket. + */ if (sb == &so->so_rcv) { uio.uio_rw = UIO_READ; + ru_before = td->td_ru.ru_msgrcv; #ifdef MAC error = mac_socket_check_receive(fp->f_cred, so); if (error == 0) #endif error = soreceive(so, NULL, &uio, NULL, NULL, &flags); + if (td->td_ru.ru_msgrcv != ru_before) + job->msgrcv = 1; } else { uio.uio_rw = UIO_WRITE; + ru_before = td->td_ru.ru_msgsnd; #ifdef MAC error = mac_socket_check_send(fp->f_cred, so); if (error == 0) #endif error = sosend(so, NULL, &uio, NULL, NULL, flags, td); + if (td->td_ru.ru_msgsnd != ru_before) + job->msgsnd = 1; if (error == EPIPE && (so->so_options & SO_NOSIGPIPE) == 0) { PROC_LOCK(job->userproc); kern_psignal(job->userproc, SIGPIPE); Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Tue Jun 21 21:55:03 2016 (r302073) +++ head/sys/kern/vfs_aio.c Tue Jun 21 22:19:06 2016 (r302074) @@ -743,9 +743,11 @@ aio_process_rw(struct kaiocb *job) struct uio auio; struct iovec aiov; ssize_t cnt; + long msgsnd_st, msgsnd_end; + long msgrcv_st, msgrcv_end; + long oublock_st, oublock_end; + long inblock_st, inblock_end; int error; - int oublock_st, oublock_end; - int inblock_st, inblock_end; KASSERT(job->uaiocb.aio_lio_opcode == LIO_READ || job->uaiocb.aio_lio_opcode == LIO_WRITE, @@ -769,8 +771,11 @@ aio_process_rw(struct kaiocb *job) auio.uio_segflg = UIO_USERSPACE; auio.uio_td = td; + msgrcv_st = td->td_ru.ru_msgrcv; + msgsnd_st = td->td_ru.ru_msgsnd; inblock_st = td->td_ru.ru_inblock; oublock_st = td->td_ru.ru_oublock; + /* * aio_aqueue() acquires a reference to the file that is * released in aio_free_entry(). @@ -787,11 +792,15 @@ aio_process_rw(struct kaiocb *job) auio.uio_rw = UIO_WRITE; error = fo_write(fp, &auio, fp->f_cred, FOF_OFFSET, td); } + msgrcv_end = td->td_ru.ru_msgrcv; + msgsnd_end = td->td_ru.ru_msgsnd; inblock_end = td->td_ru.ru_inblock; oublock_end = td->td_ru.ru_oublock; - job->inputcharge = inblock_end - inblock_st; - job->outputcharge = oublock_end - oublock_st; + job->msgrcv = msgrcv_end - msgrcv_st; + job->msgsnd = msgsnd_end - msgsnd_st; + job->inblock = inblock_end - inblock_st; + job->outblock = oublock_end - oublock_st; if ((error) && (auio.uio_resid != cnt)) { if (error == ERESTART || error == EINTR || error == EWOULDBLOCK) @@ -1805,13 +1814,10 @@ kern_aio_return(struct thread *td, struc status = job->uaiocb._aiocb_private.status; error = job->uaiocb._aiocb_private.error; td->td_retval[0] = status; - if (job->uaiocb.aio_lio_opcode == LIO_WRITE) { - td->td_ru.ru_oublock += job->outputcharge; - job->outputcharge = 0; - } else if (job->uaiocb.aio_lio_opcode == LIO_READ) { - td->td_ru.ru_inblock += job->inputcharge; - job->inputcharge = 0; - } + td->td_ru.ru_oublock += job->outblock; + td->td_ru.ru_inblock += job->inblock; + td->td_ru.ru_msgsnd += job->msgsnd; + td->td_ru.ru_msgrcv += job->msgrcv; aio_free_entry(job); AIO_UNLOCK(ki); ops->store_error(ujob, error); @@ -2327,9 +2333,9 @@ aio_physwakeup(struct bio *bp) error = bp->bio_error; nblks = btodb(nbytes); if (job->uaiocb.aio_lio_opcode == LIO_WRITE) - job->outputcharge += nblks; + job->outblock += nblks; else - job->inputcharge += nblks; + job->inblock += nblks; if (error) aio_complete(job, -1, error); @@ -2395,13 +2401,10 @@ kern_aio_waitcomplete(struct thread *td, status = job->uaiocb._aiocb_private.status; error = job->uaiocb._aiocb_private.error; td->td_retval[0] = status; - if (job->uaiocb.aio_lio_opcode == LIO_WRITE) { - td->td_ru.ru_oublock += job->outputcharge; - job->outputcharge = 0; - } else if (job->uaiocb.aio_lio_opcode == LIO_READ) { - td->td_ru.ru_inblock += job->inputcharge; - job->inputcharge = 0; - } + td->td_ru.ru_oublock += job->outblock; + td->td_ru.ru_inblock += job->inblock; + td->td_ru.ru_msgsnd += job->msgsnd; + td->td_ru.ru_msgrcv += job->msgrcv; aio_free_entry(job); AIO_UNLOCK(ki); ops->store_aiocb(ujobp, ujob); Modified: head/sys/sys/aio.h ============================================================================== --- head/sys/sys/aio.h Tue Jun 21 21:55:03 2016 (r302073) +++ head/sys/sys/aio.h Tue Jun 21 22:19:06 2016 (r302074) @@ -119,8 +119,10 @@ struct kaiocb { TAILQ_ENTRY(kaiocb) plist; /* (a) lists of pending / done jobs */ TAILQ_ENTRY(kaiocb) allist; /* (a) list of all jobs in proc */ int jobflags; /* (a) job flags */ - int inputcharge; /* (*) input blocks */ - int outputcharge; /* (*) output blocks */ + int inblock; /* (*) input blocks */ + int outblock; /* (*) output blocks */ + int msgsnd; /* (*) messages sent */ + int msgrcv; /* (*) messages received */ struct proc *userproc; /* (*) user process */ struct ucred *cred; /* (*) active credential when created */ struct file *fd_file; /* (*) pointer to file structure */ Modified: head/tests/sys/aio/aio_test.c ============================================================================== --- head/tests/sys/aio/aio_test.c Tue Jun 21 21:55:03 2016 (r302073) +++ head/tests/sys/aio/aio_test.c Tue Jun 21 22:19:06 2016 (r302074) @@ -40,6 +40,7 @@ #include #include +#include #include #include #include @@ -455,6 +456,7 @@ ATF_TC_BODY(aio_unix_socketpair_test, tc { struct aio_unix_socketpair_arg arg; struct aio_context ac; + struct rusage ru_before, ru_after; int sockets[2]; ATF_REQUIRE_KERNEL_MODULE("aio"); @@ -467,8 +469,17 @@ ATF_TC_BODY(aio_unix_socketpair_test, tc aio_context_init(&ac, sockets[0], sockets[1], UNIX_SOCKETPAIR_LEN, UNIX_SOCKETPAIR_TIMEOUT, aio_unix_socketpair_cleanup, &arg); + ATF_REQUIRE_MSG(getrusage(RUSAGE_SELF, &ru_before) != -1, + "getrusage failed: %s", strerror(errno)); aio_write_test(&ac); + ATF_REQUIRE_MSG(getrusage(RUSAGE_SELF, &ru_after) != -1, + "getrusage failed: %s", strerror(errno)); + ATF_REQUIRE(ru_after.ru_msgsnd == ru_before.ru_msgsnd + 1); + ru_before = ru_after; aio_read_test(&ac); + ATF_REQUIRE_MSG(getrusage(RUSAGE_SELF, &ru_after) != -1, + "getrusage failed: %s", strerror(errno)); + ATF_REQUIRE(ru_after.ru_msgrcv == ru_before.ru_msgrcv + 1); aio_unix_socketpair_cleanup(&arg); } From owner-svn-src-head@freebsd.org Tue Jun 21 23:59:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C65EAC518D; Tue, 21 Jun 2016 23:59:52 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pf0-x244.google.com (mail-pf0-x244.google.com [IPv6:2607:f8b0:400e:c00::244]) (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 D28531CA0; Tue, 21 Jun 2016 23:59:51 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pf0-x244.google.com with SMTP id t190so2349673pfb.2; Tue, 21 Jun 2016 16:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=k1XlRIHaoh1jmh1C04R90ae/BFOGnAg9TBY55etdSv8=; b=hZjk5QphvSZljkfKnB5aSPeiQTnVnOd0D5GQuzKkuPS3UIiAESzg25IZLgoaGgA+Ag tS0Ib/wbc5tUgy0yzu5agHc+w70mccSlSJ7KKvJINn2txk5B8F3hm5DgCDJqB6kuxPtM c9SECA5tcGcoKMyscKpiV1SrKWw4/6IrWdMQY8sNw84XjFhhfE3r4gsXNbK7BI+jDk+C aTOncnm14CztIxhEMc5DWlQcGDmxCRByQLJx9auB9VtVvpRF81+DXWXJT/eJcdIpUypk 1+mt/eQgwclJPtlIXvvnjFJRg0F0ja1KS2wSmZ3lePEHsDrJeYd49d0PlfKFRUr8LRXG WU0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=k1XlRIHaoh1jmh1C04R90ae/BFOGnAg9TBY55etdSv8=; b=C+pcTfSsxQ/6y5OWZTeE9N+y/30jiIRHKy9N0zBzc13Ijr6Q+Fpf2sFeJs0BdleZY1 IwyisqE0Vmll50gEeBprjXY57ylZbAQbwE3Te/OH84qfrxyof7TYLA6h1GSbx6bQ/KEB +wMHXLmSiA/+UIj8oeXfF+oOr44cto8hgZiDqIxDaSyQhSuX2is0qe62V0bY9jYI/TzM WZ1bJD7LBTokba6ZehpBR0fVDQf0+vGG1YpXxkc6AG3LEeLM9wpVn7DLHBJBL5f5tE0z 8zyjvIl5E53ZaHVMgb6tRDyfdPmfqtd4AKyiVVBhLHzqWJFO9WedTmNNPu6D/uKwRjR2 wz8g== X-Gm-Message-State: ALyK8tJprSmNZzIHUjx2uDTvp8dxVpsO9eM9fmUs982+16Q3gSACb2A4rv3ceUr9lntscA== X-Received: by 10.98.38.132 with SMTP id m126mr6349208pfm.57.1466553590440; Tue, 21 Jun 2016 16:59:50 -0700 (PDT) Received: from [10.192.166.0] ([12.32.117.8]) by smtp.googlemail.com with ESMTPSA id tj10sm7351428pab.21.2016.06.21.16.59.49 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 21 Jun 2016 16:59:49 -0700 (PDT) Sender: Navdeep Parhar Subject: Re: svn commit: r302054 - in head/sys: contrib/ipfilter/netinet dev/usb/net kern net netgraph netinet netinet6 netipsec netpfil/ipfw netpfil/pf To: "Bjoern A. Zeeb" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606211348.u5LDmom9081605@repo.freebsd.org> From: Navdeep Parhar Message-ID: Date: Tue, 21 Jun 2016 16:59:48 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606211348.u5LDmom9081605@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Jun 2016 23:59:52 -0000 This causes a panic when a NIC driver module is unloaded from a kernel without VIMAGE. if_vnet is NULL and if_detach_internal tries to dereference it. Regards, Navdeep On 06/21/2016 06:48, Bjoern A. Zeeb wrote: > Author: bz > Date: Tue Jun 21 13:48:49 2016 > New Revision: 302054 > URL: https://svnweb.freebsd.org/changeset/base/302054 > > Log: > Get closer to a VIMAGE network stack teardown from top to bottom rather > than removing the network interfaces first. This change is rather larger > and convoluted as the ordering requirements cannot be separated. > > Move the pfil(9) framework to SI_SUB_PROTO_PFIL, move Firewalls and > related modules to their own SI_SUB_PROTO_FIREWALL. > Move initialization of "physical" interfaces to SI_SUB_DRIVERS, > move virtual (cloned) interfaces to SI_SUB_PSEUDO. > Move Multicast to SI_SUB_PROTO_MC. > > Re-work parts of multicast initialisation and teardown, not taking the > huge amount of memory into account if used as a module yet. > > For interface teardown we try to do as many of them as we can on > SI_SUB_INIT_IF, but for some this makes no sense, e.g., when tunnelling > over a higher layer protocol such as IP. In that case the interface > has to go along (or before) the higher layer protocol is shutdown. > > Kernel hhooks need to go last on teardown as they may be used at various > higher layers and we cannot remove them before we cleaned up the higher > layers. > > For interface teardown there are multiple paths: > (a) a cloned interface is destroyed (inside a VIMAGE or in the base system), > (b) any interface is moved from a virtual network stack to a different > network stack ("vmove"), or (c) a virtual network stack is being shut down. > All code paths go through if_detach_internal() where we, depending on the > vmove flag or the vnet state, make a decision on how much to shut down; > in case we are destroying a VNET the individual protocol layers will > cleanup their own parts thus we cannot do so again for each interface as > we end up with, e.g., double-frees, destroying locks twice or acquiring > already destroyed locks. > When calling into protocol cleanups we equally have to tell them > whether they need to detach upper layer protocols ("ulp") or not > (e.g., in6_ifdetach()). > > Provide or enahnce helper functions to do proper cleanup at a protocol > rather than at an interface level. > > Approved by: re (hrs) > Obtained from: projects/vnet > Reviewed by: gnn, jhb > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D6747 > > Modified: > head/sys/contrib/ipfilter/netinet/mlfk_ipl.c > head/sys/dev/usb/net/usb_ethernet.c > head/sys/kern/kern_hhook.c > head/sys/net/if.c > head/sys/net/if_bridge.c > head/sys/net/if_disc.c > head/sys/net/if_edsc.c > head/sys/net/if_enc.c > head/sys/net/if_epair.c > head/sys/net/if_lagg.c > head/sys/net/if_loop.c > head/sys/net/if_vlan.c > head/sys/net/pfil.c > head/sys/net/route.c > head/sys/net/vnet.c > head/sys/net/vnet.h > head/sys/netgraph/ng_eiface.c > head/sys/netgraph/ng_iface.c > head/sys/netinet/igmp.c > head/sys/netinet/in.c > head/sys/netinet/in_var.h > head/sys/netinet/ip_id.c > head/sys/netinet/ip_input.c > head/sys/netinet/ip_mroute.c > head/sys/netinet6/in6.c > head/sys/netinet6/in6_ifattach.c > head/sys/netinet6/in6_ifattach.h > head/sys/netinet6/ip6_input.c > head/sys/netinet6/ip6_mroute.c > head/sys/netinet6/mld6.c > head/sys/netinet6/nd6.c > head/sys/netinet6/nd6.h > head/sys/netipsec/ipsec.c > head/sys/netipsec/xform_tcp.c > head/sys/netpfil/ipfw/dn_sched.h > head/sys/netpfil/ipfw/ip_dummynet.c > head/sys/netpfil/ipfw/ip_fw2.c > head/sys/netpfil/ipfw/ip_fw_nat.c > head/sys/netpfil/pf/pf_ioctl.c > > Modified: head/sys/contrib/ipfilter/netinet/mlfk_ipl.c > ============================================================================== > --- head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/contrib/ipfilter/netinet/mlfk_ipl.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -287,7 +287,7 @@ static moduledata_t ipfiltermod = { > }; > > > -DECLARE_MODULE(ipfilter, ipfiltermod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); > +DECLARE_MODULE(ipfilter, ipfiltermod, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY); > #ifdef MODULE_VERSION > MODULE_VERSION(ipfilter, 1); > #endif > > Modified: head/sys/dev/usb/net/usb_ethernet.c > ============================================================================== > --- head/sys/dev/usb/net/usb_ethernet.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/dev/usb/net/usb_ethernet.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -641,5 +641,9 @@ uether_rxflush(struct usb_ether *ue) > } > } > > -DECLARE_MODULE(uether, uether_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); > +/* > + * USB net drivers are run by DRIVER_MODULE() thus SI_SUB_DRIVERS, > + * SI_ORDER_MIDDLE. Run uether after that. > + */ > +DECLARE_MODULE(uether, uether_mod, SI_SUB_DRIVERS, SI_ORDER_ANY); > MODULE_VERSION(uether, 1); > > Modified: head/sys/kern/kern_hhook.c > ============================================================================== > --- head/sys/kern/kern_hhook.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/kern/kern_hhook.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -510,7 +510,7 @@ hhook_vnet_uninit(const void *unused __u > /* > * When a vnet is created and being initialised, init the V_hhook_vhead_list. > */ > -VNET_SYSINIT(hhook_vnet_init, SI_SUB_MBUF, SI_ORDER_FIRST, > +VNET_SYSINIT(hhook_vnet_init, SI_SUB_INIT_IF, SI_ORDER_FIRST, > hhook_vnet_init, NULL); > > /* > @@ -518,5 +518,5 @@ VNET_SYSINIT(hhook_vnet_init, SI_SUB_MBU > * points to clean up on vnet tear down, but in case the KPI is misused, > * provide a function to clean up and free memory for a vnet being destroyed. > */ > -VNET_SYSUNINIT(hhook_vnet_uninit, SI_SUB_MBUF, SI_ORDER_ANY, > +VNET_SYSUNINIT(hhook_vnet_uninit, SI_SUB_INIT_IF, SI_ORDER_FIRST, > hhook_vnet_uninit, NULL); > > Modified: head/sys/net/if.c > ============================================================================== > --- head/sys/net/if.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/net/if.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -914,6 +914,16 @@ if_detach(struct ifnet *ifp) > CURVNET_RESTORE(); > } > > +/* > + * The vmove flag, if set, indicates that we are called from a callpath > + * that is moving an interface to a different vnet instance. > + * > + * The shutdown flag, if set, indicates that we are called in the > + * process of shutting down a vnet instance. Currently only the > + * vnet_if_return SYSUNINIT function sets it. Note: we can be called > + * on a vnet instance shutdown without this flag being set, e.g., when > + * the cloned interfaces are destoyed as first thing of teardown. > + */ > static int > if_detach_internal(struct ifnet *ifp, int vmove, struct if_clone **ifcp) > { > @@ -921,8 +931,10 @@ if_detach_internal(struct ifnet *ifp, in > int i; > struct domain *dp; > struct ifnet *iter; > - int found = 0; > + int found = 0, shutdown; > > + shutdown = (ifp->if_vnet->vnet_state > SI_SUB_VNET && > + ifp->if_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0; > IFNET_WLOCK(); > TAILQ_FOREACH(iter, &V_ifnet, if_link) > if (iter == ifp) { > @@ -930,10 +942,6 @@ if_detach_internal(struct ifnet *ifp, in > found = 1; > break; > } > -#ifdef VIMAGE > - if (found) > - curvnet->vnet_ifcnt--; > -#endif > IFNET_WUNLOCK(); > if (!found) { > /* > @@ -951,19 +959,58 @@ if_detach_internal(struct ifnet *ifp, in > #endif > } > > - /* Check if this is a cloned interface or not. */ > + /* > + * At this point we know the interface still was on the ifnet list > + * and we removed it so we are in a stable state. > + */ > +#ifdef VIMAGE > + curvnet->vnet_ifcnt--; > +#endif > + > + /* > + * In any case (destroy or vmove) detach us from the groups > + * and remove/wait for pending events on the taskq. > + * XXX-BZ in theory an interface could still enqueue a taskq change? > + */ > + if_delgroups(ifp); > + > + taskqueue_drain(taskqueue_swi, &ifp->if_linktask); > + > + /* > + * Check if this is a cloned interface or not. Must do even if > + * shutting down as a if_vmove_reclaim() would move the ifp and > + * the if_clone_addgroup() will have a corrupted string overwise > + * from a gibberish pointer. > + */ > if (vmove && ifcp != NULL) > *ifcp = if_clone_findifc(ifp); > > + if_down(ifp); > + > /* > - * Remove/wait for pending events. > + * On VNET shutdown abort here as the stack teardown will do all > + * the work top-down for us. > + */ > + if (shutdown) { > + /* > + * In case of a vmove we are done here without error. > + * If we would signal an error it would lead to the same > + * abort as if we did not find the ifnet anymore. > + * if_detach() calls us in void context and does not care > + * about an early abort notification, so life is splendid :) > + */ > + goto finish_vnet_shutdown; > + } > + > + /* > + * At this point we are not tearing down a VNET and are either > + * going to destroy or vmove the interface and have to cleanup > + * accordingly. > */ > - taskqueue_drain(taskqueue_swi, &ifp->if_linktask); > > /* > * Remove routes and flush queues. > */ > - if_down(ifp); > #ifdef ALTQ > if (ALTQ_IS_ENABLED(&ifp->if_snd)) > altq_disable(&ifp->if_snd); > @@ -1018,8 +1065,8 @@ if_detach_internal(struct ifnet *ifp, in > } > > rt_flushifroutes(ifp); > - if_delgroups(ifp); > > +finish_vnet_shutdown: > /* > * We cannot hold the lock over dom_ifdetach calls as they might > * sleep, for example trying to drain a callout, thus open up the > @@ -1048,7 +1095,7 @@ if_detach_internal(struct ifnet *ifp, in > * unused if_index in target vnet and calls if_grow() if necessary, > * and finally find an unused if_xname for the target vnet. > */ > -void > +static void > if_vmove(struct ifnet *ifp, struct vnet *new_vnet) > { > struct if_clone *ifc; > @@ -1115,6 +1162,7 @@ if_vmove_loan(struct thread *td, struct > { > struct prison *pr; > struct ifnet *difp; > + int shutdown; > > /* Try to find the prison within our visibility. */ > sx_slock(&allprison_lock); > @@ -1135,12 +1183,22 @@ if_vmove_loan(struct thread *td, struct > /* XXX Lock interfaces to avoid races. */ > CURVNET_SET_QUIET(pr->pr_vnet); > difp = ifunit(ifname); > - CURVNET_RESTORE(); > if (difp != NULL) { > + CURVNET_RESTORE(); > prison_free(pr); > return (EEXIST); > } > > + /* Make sure the VNET is stable. */ > + shutdown = (ifp->if_vnet->vnet_state > SI_SUB_VNET && > + ifp->if_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0; > + if (shutdown) { > + CURVNET_RESTORE(); > + prison_free(pr); > + return (EBUSY); > + } > + CURVNET_RESTORE(); > + > /* Move the interface into the child jail/vnet. */ > if_vmove(ifp, pr->pr_vnet); > > @@ -1157,6 +1215,7 @@ if_vmove_reclaim(struct thread *td, char > struct prison *pr; > struct vnet *vnet_dst; > struct ifnet *ifp; > + int shutdown; > > /* Try to find the prison within our visibility. */ > sx_slock(&allprison_lock); > @@ -1184,6 +1243,15 @@ if_vmove_reclaim(struct thread *td, char > return (EEXIST); > } > > + /* Make sure the VNET is stable. */ > + shutdown = (ifp->if_vnet->vnet_state > SI_SUB_VNET && > + ifp->if_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0; > + if (shutdown) { > + CURVNET_RESTORE(); > + prison_free(pr); > + return (EBUSY); > + } > + > /* Get interface back from child jail/vnet. */ > if_vmove(ifp, vnet_dst); > CURVNET_RESTORE(); > @@ -2642,8 +2710,22 @@ ifioctl(struct socket *so, u_long cmd, c > struct ifreq *ifr; > int error; > int oif_flags; > +#ifdef VIMAGE > + int shutdown; > +#endif > > CURVNET_SET(so->so_vnet); > +#ifdef VIMAGE > + /* Make sure the VNET is stable. */ > + shutdown = (so->so_vnet->vnet_state > SI_SUB_VNET && > + so->so_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0; > + if (shutdown) { > + CURVNET_RESTORE(); > + return (EBUSY); > + } > +#endif > + > + > switch (cmd) { > case SIOCGIFCONF: > error = ifconf(cmd, data); > > Modified: head/sys/net/if_bridge.c > ============================================================================== > --- head/sys/net/if_bridge.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/net/if_bridge.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -541,7 +541,7 @@ vnet_bridge_uninit(const void *unused __ > V_bridge_cloner = NULL; > BRIDGE_LIST_LOCK_DESTROY(); > } > -VNET_SYSUNINIT(vnet_bridge_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, > +VNET_SYSUNINIT(vnet_bridge_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, > vnet_bridge_uninit, NULL); > > static int > > Modified: head/sys/net/if_disc.c > ============================================================================== > --- head/sys/net/if_disc.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/net/if_disc.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -137,7 +137,7 @@ vnet_disc_init(const void *unused __unus > V_disc_cloner = if_clone_simple(discname, disc_clone_create, > disc_clone_destroy, 0); > } > -VNET_SYSINIT(vnet_disc_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, > +VNET_SYSINIT(vnet_disc_init, SI_SUB_PSEUDO, SI_ORDER_ANY, > vnet_disc_init, NULL); > > static void > @@ -146,7 +146,7 @@ vnet_disc_uninit(const void *unused __un > > if_clone_detach(V_disc_cloner); > } > -VNET_SYSUNINIT(vnet_disc_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, > +VNET_SYSUNINIT(vnet_disc_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, > vnet_disc_uninit, NULL); > > static int > > Modified: head/sys/net/if_edsc.c > ============================================================================== > --- head/sys/net/if_edsc.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/net/if_edsc.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -336,7 +336,7 @@ vnet_edsc_uninit(const void *unused __un > */ > if_clone_detach(V_edsc_cloner); > } > -VNET_SYSUNINIT(vnet_edsc_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, > +VNET_SYSUNINIT(vnet_edsc_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, > vnet_edsc_uninit, NULL); > > /* > > Modified: head/sys/net/if_enc.c > ============================================================================== > --- head/sys/net/if_enc.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/net/if_enc.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -136,7 +136,6 @@ enc_clone_destroy(struct ifnet *ifp) > sc = ifp->if_softc; > KASSERT(sc == V_enc_sc, ("sc != ifp->if_softc")); > > - enc_remove_hhooks(sc); > bpfdetach(ifp); > if_detach(ifp); > if_free(ifp); > @@ -170,10 +169,6 @@ enc_clone_create(struct if_clone *ifc, i > ifp->if_softc = sc; > if_attach(ifp); > bpfattach(ifp, DLT_ENC, sizeof(struct enchdr)); > - if (enc_add_hhooks(sc) != 0) { > - enc_clone_destroy(ifp); > - return (ENXIO); > - } > return (0); > } > > @@ -369,18 +364,44 @@ vnet_enc_init(const void *unused __unuse > V_enc_cloner = if_clone_simple(encname, enc_clone_create, > enc_clone_destroy, 1); > } > -VNET_SYSINIT(vnet_enc_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, > +VNET_SYSINIT(vnet_enc_init, SI_SUB_PSEUDO, SI_ORDER_ANY, > vnet_enc_init, NULL); > > static void > +vnet_enc_init_proto(void *unused __unused) > +{ > + KASSERT(V_enc_sc != NULL, ("%s: V_enc_sc is %p\n", __func__, V_enc_sc)); > + > + if (enc_add_hhooks(V_enc_sc) != 0) > + enc_clone_destroy(V_enc_sc->sc_ifp); > +} > +VNET_SYSINIT(vnet_enc_init_proto, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, > + vnet_enc_init_proto, NULL); > + > +static void > vnet_enc_uninit(const void *unused __unused) > { > + KASSERT(V_enc_sc != NULL, ("%s: V_enc_sc is %p\n", __func__, V_enc_sc)); > > if_clone_detach(V_enc_cloner); > } > -VNET_SYSUNINIT(vnet_enc_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, > +VNET_SYSUNINIT(vnet_enc_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, > vnet_enc_uninit, NULL); > > +/* > + * The hhook consumer needs to go before ip[6]_destroy are called on > + * SI_ORDER_THIRD. > + */ > +static void > +vnet_enc_uninit_hhook(const void *unused __unused) > +{ > + KASSERT(V_enc_sc != NULL, ("%s: V_enc_sc is %p\n", __func__, V_enc_sc)); > + > + enc_remove_hhooks(V_enc_sc); > +} > +VNET_SYSUNINIT(vnet_enc_uninit_hhook, SI_SUB_PROTO_DOMAIN, SI_ORDER_FOURTH, > + vnet_enc_uninit_hhook, NULL); > + > static int > enc_modevent(module_t mod, int type, void *data) > { > @@ -401,4 +422,4 @@ static moduledata_t enc_mod = { > 0 > }; > > -DECLARE_MODULE(if_enc, enc_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); > +DECLARE_MODULE(if_enc, enc_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); > > Modified: head/sys/net/if_epair.c > ============================================================================== > --- head/sys/net/if_epair.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/net/if_epair.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -963,7 +963,7 @@ vnet_epair_init(const void *unused __unu > netisr_register_vnet(&epair_nh); > #endif > } > -VNET_SYSINIT(vnet_epair_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, > +VNET_SYSINIT(vnet_epair_init, SI_SUB_PSEUDO, SI_ORDER_ANY, > vnet_epair_init, NULL); > > static void > @@ -975,7 +975,7 @@ vnet_epair_uninit(const void *unused __u > #endif > if_clone_detach(V_epair_cloner); > } > -VNET_SYSUNINIT(vnet_epair_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, > +VNET_SYSUNINIT(vnet_epair_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, > vnet_epair_uninit, NULL); > > static int > @@ -1012,5 +1012,5 @@ static moduledata_t epair_mod = { > 0 > }; > > -DECLARE_MODULE(if_epair, epair_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); > +DECLARE_MODULE(if_epair, epair_mod, SI_SUB_PSEUDO, SI_ORDER_MIDDLE); > MODULE_VERSION(if_epair, 1); > > Modified: head/sys/net/if_lagg.c > ============================================================================== > --- head/sys/net/if_lagg.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/net/if_lagg.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -271,7 +271,7 @@ vnet_lagg_uninit(const void *unused __un > if_clone_detach(V_lagg_cloner); > LAGG_LIST_LOCK_DESTROY(); > } > -VNET_SYSUNINIT(vnet_lagg_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, > +VNET_SYSUNINIT(vnet_lagg_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, > vnet_lagg_uninit, NULL); > > static int > > Modified: head/sys/net/if_loop.c > ============================================================================== > --- head/sys/net/if_loop.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/net/if_loop.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -156,7 +156,7 @@ vnet_loif_init(const void *unused __unus > 1); > #endif > } > -VNET_SYSINIT(vnet_loif_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, > +VNET_SYSINIT(vnet_loif_init, SI_SUB_PSEUDO, SI_ORDER_ANY, > vnet_loif_init, NULL); > > #ifdef VIMAGE > @@ -167,7 +167,7 @@ vnet_loif_uninit(const void *unused __un > if_clone_detach(V_lo_cloner); > V_loif = NULL; > } > -VNET_SYSUNINIT(vnet_loif_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, > +VNET_SYSUNINIT(vnet_loif_uninit, SI_SUB_INIT_IF, SI_ORDER_SECOND, > vnet_loif_uninit, NULL); > #endif > > > Modified: head/sys/net/if_vlan.c > ============================================================================== > --- head/sys/net/if_vlan.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/net/if_vlan.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -823,7 +823,7 @@ vnet_vlan_uninit(const void *unused __un > > if_clone_detach(V_vlan_cloner); > } > -VNET_SYSUNINIT(vnet_vlan_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_FIRST, > +VNET_SYSUNINIT(vnet_vlan_uninit, SI_SUB_INIT_IF, SI_ORDER_FIRST, > vnet_vlan_uninit, NULL); > #endif > > > Modified: head/sys/net/pfil.c > ============================================================================== > --- head/sys/net/pfil.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/net/pfil.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -383,17 +383,14 @@ vnet_pfil_uninit(const void *unused __un > PFIL_LOCK_DESTROY_REAL(&V_pfil_lock); > } > > -/* Define startup order. */ > -#define PFIL_SYSINIT_ORDER SI_SUB_PROTO_BEGIN > -#define PFIL_MODEVENT_ORDER (SI_ORDER_FIRST) /* On boot slot in here. */ > -#define PFIL_VNET_ORDER (PFIL_MODEVENT_ORDER + 2) /* Later still. */ > - > /* > * Starting up. > * > * VNET_SYSINIT is called for each existing vnet and each new vnet. > + * Make sure the pfil bits are first before any possible subsystem which > + * might piggyback on the SI_SUB_PROTO_PFIL. > */ > -VNET_SYSINIT(vnet_pfil_init, PFIL_SYSINIT_ORDER, PFIL_VNET_ORDER, > +VNET_SYSINIT(vnet_pfil_init, SI_SUB_PROTO_PFIL, SI_ORDER_FIRST, > vnet_pfil_init, NULL); > > /* > @@ -401,5 +398,5 @@ VNET_SYSINIT(vnet_pfil_init, PFIL_SYSINI > * > * VNET_SYSUNINIT is called for each exiting vnet as it exits. > */ > -VNET_SYSUNINIT(vnet_pfil_uninit, PFIL_SYSINIT_ORDER, PFIL_VNET_ORDER, > +VNET_SYSUNINIT(vnet_pfil_uninit, SI_SUB_PROTO_PFIL, SI_ORDER_FIRST, > vnet_pfil_uninit, NULL); > > Modified: head/sys/net/route.c > ============================================================================== > --- head/sys/net/route.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/net/route.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -334,7 +334,7 @@ vnet_route_uninit(const void *unused __u > free(V_rt_tables, M_RTABLE); > uma_zdestroy(V_rtzone); > } > -VNET_SYSUNINIT(vnet_route_uninit, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, > +VNET_SYSUNINIT(vnet_route_uninit, SI_SUB_PROTO_DOMAIN, SI_ORDER_FIRST, > vnet_route_uninit, 0); > #endif > > > Modified: head/sys/net/vnet.c > ============================================================================== > --- head/sys/net/vnet.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/net/vnet.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -331,8 +331,7 @@ vnet_init_done(void *unused __unused) > > curvnet = NULL; > } > - > -SYSINIT(vnet_init_done, SI_SUB_VNET_DONE, SI_ORDER_FIRST, vnet_init_done, > +SYSINIT(vnet_init_done, SI_SUB_VNET_DONE, SI_ORDER_ANY, vnet_init_done, > NULL); > > /* > > Modified: head/sys/net/vnet.h > ============================================================================== > --- head/sys/net/vnet.h Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/net/vnet.h Tue Jun 21 13:48:49 2016 (r302054) > @@ -111,8 +111,8 @@ vnet_##name##_init(const void *unused) \ > { \ > VNET_PCPUSTAT_ALLOC(name, M_WAITOK); \ > } \ > -VNET_SYSINIT(vnet_ ## name ## _init, SI_SUB_PROTO_IFATTACHDOMAIN, \ > - SI_ORDER_ANY, vnet_ ## name ## _init, NULL) > +VNET_SYSINIT(vnet_ ## name ## _init, SI_SUB_INIT_IF, \ > + SI_ORDER_FIRST, vnet_ ## name ## _init, NULL) > > #define VNET_PCPUSTAT_SYSUNINIT(name) \ > static void \ > @@ -120,8 +120,8 @@ vnet_##name##_uninit(const void *unused) > { \ > VNET_PCPUSTAT_FREE(name); \ > } \ > -VNET_SYSUNINIT(vnet_ ## name ## _uninit, SI_SUB_PROTO_IFATTACHDOMAIN, \ > - SI_ORDER_ANY, vnet_ ## name ## _uninit, NULL) > +VNET_SYSUNINIT(vnet_ ## name ## _uninit, SI_SUB_INIT_IF, \ > + SI_ORDER_FIRST, vnet_ ## name ## _uninit, NULL) > > #ifdef SYSCTL_OID > #define SYSCTL_VNET_PCPUSTAT(parent, nbr, name, type, array, desc) \ > > Modified: head/sys/netgraph/ng_eiface.c > ============================================================================== > --- head/sys/netgraph/ng_eiface.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netgraph/ng_eiface.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -679,5 +679,5 @@ vnet_ng_eiface_uninit(const void *unused > > delete_unrhdr(V_ng_eiface_unit); > } > -VNET_SYSUNINIT(vnet_ng_eiface_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, > +VNET_SYSUNINIT(vnet_ng_eiface_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, > vnet_ng_eiface_uninit, NULL); > > Modified: head/sys/netgraph/ng_iface.c > ============================================================================== > --- head/sys/netgraph/ng_iface.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netgraph/ng_iface.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -786,5 +786,5 @@ vnet_ng_iface_uninit(const void *unused) > > delete_unrhdr(V_ng_iface_unit); > } > -VNET_SYSUNINIT(vnet_ng_iface_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, > +VNET_SYSUNINIT(vnet_ng_iface_uninit, SI_SUB_INIT_IF, SI_ORDER_ANY, > vnet_ng_iface_uninit, NULL); > > Modified: head/sys/netinet/igmp.c > ============================================================================== > --- head/sys/netinet/igmp.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netinet/igmp.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -227,7 +227,8 @@ static VNET_DEFINE(int, current_state_ti > #define V_state_change_timers_running VNET(state_change_timers_running) > #define V_current_state_timers_running VNET(current_state_timers_running) > > -static VNET_DEFINE(LIST_HEAD(, igmp_ifsoftc), igi_head); > +static VNET_DEFINE(LIST_HEAD(, igmp_ifsoftc), igi_head) = > + LIST_HEAD_INITIALIZER(igi_head); > static VNET_DEFINE(struct igmpstat, igmpstat) = { > .igps_version = IGPS_VERSION_3, > .igps_len = sizeof(struct igmpstat), > @@ -701,10 +702,6 @@ igi_delete_locked(const struct ifnet *if > return; > } > } > - > -#ifdef INVARIANTS > - panic("%s: igmp_ifsoftc not found for ifp %p\n", __func__, ifp); > -#endif > } > > /* > @@ -3595,57 +3592,28 @@ igmp_rec_type_to_str(const int type) > } > #endif > > -static void > -igmp_init(void *unused __unused) > -{ > - > - CTR1(KTR_IGMPV3, "%s: initializing", __func__); > - > - IGMP_LOCK_INIT(); > - > - m_raopt = igmp_ra_alloc(); > - > - netisr_register(&igmp_nh); > -} > -SYSINIT(igmp_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, igmp_init, NULL); > - > -static void > -igmp_uninit(void *unused __unused) > -{ > - > - CTR1(KTR_IGMPV3, "%s: tearing down", __func__); > - > - netisr_unregister(&igmp_nh); > - > - m_free(m_raopt); > - m_raopt = NULL; > - > - IGMP_LOCK_DESTROY(); > -} > -SYSUNINIT(igmp_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, igmp_uninit, NULL); > - > +#ifdef VIMAGE > static void > vnet_igmp_init(const void *unused __unused) > { > > - CTR1(KTR_IGMPV3, "%s: initializing", __func__); > - > - LIST_INIT(&V_igi_head); > + netisr_register_vnet(&igmp_nh); > } > -VNET_SYSINIT(vnet_igmp_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_igmp_init, > - NULL); > +VNET_SYSINIT(vnet_igmp_init, SI_SUB_PROTO_MC, SI_ORDER_ANY, > + vnet_igmp_init, NULL); > > static void > vnet_igmp_uninit(const void *unused __unused) > { > > + /* This can happen when we shutdown the entire network stack. */ > CTR1(KTR_IGMPV3, "%s: tearing down", __func__); > > - KASSERT(LIST_EMPTY(&V_igi_head), > - ("%s: igi list not empty; ifnets not detached?", __func__)); > + netisr_unregister_vnet(&igmp_nh); > } > -VNET_SYSUNINIT(vnet_igmp_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, > +VNET_SYSUNINIT(vnet_igmp_uninit, SI_SUB_PROTO_MC, SI_ORDER_ANY, > vnet_igmp_uninit, NULL); > +#endif > > #ifdef DDB > DB_SHOW_COMMAND(igi_list, db_show_igi_list) > @@ -3682,14 +3650,24 @@ static int > igmp_modevent(module_t mod, int type, void *unused __unused) > { > > - switch (type) { > - case MOD_LOAD: > - case MOD_UNLOAD: > - break; > - default: > - return (EOPNOTSUPP); > - } > - return (0); > + switch (type) { > + case MOD_LOAD: > + CTR1(KTR_IGMPV3, "%s: initializing", __func__); > + IGMP_LOCK_INIT(); > + m_raopt = igmp_ra_alloc(); > + netisr_register(&igmp_nh); > + break; > + case MOD_UNLOAD: > + CTR1(KTR_IGMPV3, "%s: tearing down", __func__); > + netisr_unregister(&igmp_nh); > + m_free(m_raopt); > + m_raopt = NULL; > + IGMP_LOCK_DESTROY(); > + break; > + default: > + return (EOPNOTSUPP); > + } > + return (0); > } > > static moduledata_t igmp_mod = { > @@ -3697,4 +3675,4 @@ static moduledata_t igmp_mod = { > igmp_modevent, > 0 > }; > -DECLARE_MODULE(igmp, igmp_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); > +DECLARE_MODULE(igmp, igmp_mod, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE); > > Modified: head/sys/netinet/in.c > ============================================================================== > --- head/sys/netinet/in.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netinet/in.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -895,6 +895,39 @@ in_scrubprefix(struct in_ifaddr *target, > > #undef rtinitflags > > +void > +in_ifscrub_all(void) > +{ > + struct ifnet *ifp; > + struct ifaddr *ifa, *nifa; > + struct ifaliasreq ifr; > + > + IFNET_RLOCK(); > + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { > + /* Cannot lock here - lock recursion. */ > + /* IF_ADDR_RLOCK(ifp); */ > + TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, nifa) { > + if (ifa->ifa_addr->sa_family != AF_INET) > + continue; > + > + /* > + * This is ugly but the only way for legacy IP to > + * cleanly remove addresses and everything attached. > + */ > + bzero(&ifr, sizeof(ifr)); > + ifr.ifra_addr = *ifa->ifa_addr; > + if (ifa->ifa_dstaddr) > + ifr.ifra_broadaddr = *ifa->ifa_dstaddr; > + (void)in_control(NULL, SIOCDIFADDR, (caddr_t)&ifr, > + ifp, NULL); > + } > + /* IF_ADDR_RUNLOCK(ifp); */ > + in_purgemaddrs(ifp); > + igmp_domifdetach(ifp); > + } > + IFNET_RUNLOCK(); > +} > + > /* > * Return 1 if the address might be a local broadcast address. > */ > > Modified: head/sys/netinet/in_var.h > ============================================================================== > --- head/sys/netinet/in_var.h Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netinet/in_var.h Tue Jun 21 13:48:49 2016 (r302054) > @@ -376,6 +376,7 @@ int in_control(struct socket *, u_long, > struct thread *); > int in_addprefix(struct in_ifaddr *, int); > int in_scrubprefix(struct in_ifaddr *, u_int); > +void in_ifscrub_all(void); > void ip_input(struct mbuf *); > void ip_direct_input(struct mbuf *); > void in_ifadown(struct ifaddr *ifa, int); > > Modified: head/sys/netinet/ip_id.c > ============================================================================== > --- head/sys/netinet/ip_id.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netinet/ip_id.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -294,4 +294,4 @@ ipid_sysuninit(void) > counter_u64_free(V_ip_id); > mtx_destroy(&V_ip_id_mtx); > } > -VNET_SYSUNINIT(ip_id, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY, ipid_sysuninit, NULL); > +VNET_SYSUNINIT(ip_id, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, ipid_sysuninit, NULL); > > Modified: head/sys/netinet/ip_input.c > ============================================================================== > --- head/sys/netinet/ip_input.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netinet/ip_input.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -370,6 +370,7 @@ ip_init(void) > static void > ip_destroy(void *unused __unused) > { > + struct ifnet *ifp; > int error; > > #ifdef RSS > @@ -393,11 +394,21 @@ ip_destroy(void *unused __unused) > "type HHOOK_TYPE_IPSEC_OUT, id HHOOK_IPSEC_INET: " > "error %d returned\n", __func__, error); > } > - /* Cleanup in_ifaddr hash table; should be empty. */ > - hashdestroy(V_in_ifaddrhashtbl, M_IFADDR, V_in_ifaddrhmask); > + > + /* Remove the IPv4 addresses from all interfaces. */ > + in_ifscrub_all(); > + > + /* Make sure the IPv4 routes are gone as well. */ > + IFNET_RLOCK(); > + TAILQ_FOREACH(ifp, &V_ifnet, if_link) > + rt_flushifroutes_af(ifp, AF_INET); > + IFNET_RUNLOCK(); > > /* Destroy IP reassembly queue. */ > ipreass_destroy(); > + > + /* Cleanup in_ifaddr hash table; should be empty. */ > + hashdestroy(V_in_ifaddrhashtbl, M_IFADDR, V_in_ifaddrhmask); > } > > VNET_SYSUNINIT(ip, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, ip_destroy, NULL); > > Modified: head/sys/netinet/ip_mroute.c > ============================================================================== > --- head/sys/netinet/ip_mroute.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netinet/ip_mroute.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -2822,7 +2822,7 @@ vnet_mroute_init(const void *unused __un > callout_init(&V_bw_meter_ch, 1); > } > > -VNET_SYSINIT(vnet_mroute_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_mroute_init, > +VNET_SYSINIT(vnet_mroute_init, SI_SUB_PROTO_MC, SI_ORDER_ANY, vnet_mroute_init, > NULL); > > static void > @@ -2833,7 +2833,7 @@ vnet_mroute_uninit(const void *unused __ > V_nexpire = NULL; > } > > -VNET_SYSUNINIT(vnet_mroute_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, > +VNET_SYSUNINIT(vnet_mroute_uninit, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE, > vnet_mroute_uninit, NULL); > > static int > @@ -2946,4 +2946,4 @@ static moduledata_t ip_mroutemod = { > 0 > }; > > -DECLARE_MODULE(ip_mroute, ip_mroutemod, SI_SUB_PSEUDO, SI_ORDER_MIDDLE); > +DECLARE_MODULE(ip_mroute, ip_mroutemod, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE); > > Modified: head/sys/netinet6/in6.c > ============================================================================== > --- head/sys/netinet6/in6.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netinet6/in6.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -2419,7 +2419,7 @@ in6_domifdetach(struct ifnet *ifp, void > > mld_domifdetach(ifp); > scope6_ifdetach(ext->scope6_id); > - nd6_ifdetach(ext->nd_ifinfo); > + nd6_ifdetach(ifp, ext->nd_ifinfo); > lltable_free(ext->lltable); > COUNTER_ARRAY_FREE(ext->in6_ifstat, > sizeof(struct in6_ifstat) / sizeof(uint64_t)); > > Modified: head/sys/netinet6/in6_ifattach.c > ============================================================================== > --- head/sys/netinet6/in6_ifattach.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netinet6/in6_ifattach.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -761,19 +761,30 @@ in6_ifattach(struct ifnet *ifp, struct i > > /* > * NOTE: in6_ifdetach() does not support loopback if at this moment. > - * We don't need this function in bsdi, because interfaces are never removed > - * from the ifnet list in bsdi. > + * > + * When shutting down a VNET we clean up layers top-down. In that case > + * upper layer protocols (ulp) are cleaned up already and locks are destroyed > + * and we must not call into these cleanup functions anymore, thus purgeulp > + * is set to 0 in that case by in6_ifdetach_destroy(). > + * The normal case of destroying a (cloned) interface still needs to cleanup > + * everything related to the interface and will have purgeulp set to 1. > */ > -void > -in6_ifdetach(struct ifnet *ifp) > +static void > +_in6_ifdetach(struct ifnet *ifp, int purgeulp) > { > struct ifaddr *ifa, *next; > > if (ifp->if_afdata[AF_INET6] == NULL) > return; > > - /* remove neighbor management table */ > - nd6_purge(ifp); > + /* > + * Remove neighbor management table. > + * Enabling the nd6_purge will panic on vmove for interfaces on VNET > + * teardown as the IPv6 layer is cleaned up already and the locks > + * are destroyed. > + */ > + if (purgeulp) > + nd6_purge(ifp); > > /* > * nuke any of IPv6 addresses we have > @@ -784,9 +795,11 @@ in6_ifdetach(struct ifnet *ifp) > continue; > in6_purgeaddr(ifa); > } > - in6_pcbpurgeif0(&V_udbinfo, ifp); > - in6_pcbpurgeif0(&V_ulitecbinfo, ifp); > - in6_pcbpurgeif0(&V_ripcbinfo, ifp); > + if (purgeulp) { > + in6_pcbpurgeif0(&V_udbinfo, ifp); > + in6_pcbpurgeif0(&V_ulitecbinfo, ifp); > + in6_pcbpurgeif0(&V_ripcbinfo, ifp); > + } > /* leave from all multicast groups joined */ > in6_purgemaddrs(ifp); > > @@ -798,7 +811,22 @@ in6_ifdetach(struct ifnet *ifp) > * prefixes after removing all addresses above. > * (Or can we just delay calling nd6_purge until at this point?) > */ > - nd6_purge(ifp); > + if (purgeulp) > + nd6_purge(ifp); > +} > + > +void > +in6_ifdetach(struct ifnet *ifp) > +{ > + > + _in6_ifdetach(ifp, 1); > +} > + > +void > +in6_ifdetach_destroy(struct ifnet *ifp) > +{ > + > + _in6_ifdetach(ifp, 0); > } > > int > > Modified: head/sys/netinet6/in6_ifattach.h > ============================================================================== > --- head/sys/netinet6/in6_ifattach.h Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netinet6/in6_ifattach.h Tue Jun 21 13:48:49 2016 (r302054) > @@ -37,6 +37,7 @@ > void in6_ifattach(struct ifnet *, struct ifnet *); > void in6_ifattach_destroy(void); > void in6_ifdetach(struct ifnet *); > +void in6_ifdetach_destroy(struct ifnet *); > int in6_get_tmpifid(struct ifnet *, u_int8_t *, const u_int8_t *, int); > void in6_tmpaddrtimer(void *); > int in6_get_hw_ifid(struct ifnet *, struct in6_addr *); > > Modified: head/sys/netinet6/ip6_input.c > ============================================================================== > --- head/sys/netinet6/ip6_input.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netinet6/ip6_input.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -113,6 +113,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > > @@ -314,6 +315,8 @@ ip6proto_unregister(short ip6proto) > static void > ip6_destroy(void *unused __unused) > { > + struct ifaddr *ifa, *nifa; > + struct ifnet *ifp; > int error; > > #ifdef RSS > @@ -336,9 +339,30 @@ ip6_destroy(void *unused __unused) > "type HHOOK_TYPE_IPSEC_OUT, id HHOOK_IPSEC_INET6: " > "error %d returned\n", __func__, error); > } > - hashdestroy(V_in6_ifaddrhashtbl, M_IFADDR, V_in6_ifaddrhmask); > + > + /* Cleanup addresses. */ > + IFNET_RLOCK(); > + TAILQ_FOREACH(ifp, &V_ifnet, if_link) { > + /* Cannot lock here - lock recursion. */ > + /* IF_ADDR_LOCK(ifp); */ > + TAILQ_FOREACH_SAFE(ifa, &ifp->if_addrhead, ifa_link, nifa) { > + > + if (ifa->ifa_addr->sa_family != AF_INET6) > + continue; > + in6_purgeaddr(ifa); > + } > + /* IF_ADDR_UNLOCK(ifp); */ > + in6_ifdetach_destroy(ifp); > + mld_domifdetach(ifp); > + /* Make sure any routes are gone as well. */ > + rt_flushifroutes_af(ifp, AF_INET6); > + } > + IFNET_RUNLOCK(); > + > nd6_destroy(); > in6_ifattach_destroy(); > + > + hashdestroy(V_in6_ifaddrhashtbl, M_IFADDR, V_in6_ifaddrhmask); > } > > VNET_SYSUNINIT(inet6, SI_SUB_PROTO_DOMAIN, SI_ORDER_THIRD, ip6_destroy, NULL); > > Modified: head/sys/netinet6/ip6_mroute.c > ============================================================================== > --- head/sys/netinet6/ip6_mroute.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netinet6/ip6_mroute.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -1966,4 +1966,4 @@ static moduledata_t ip6_mroutemod = { > 0 > }; > > -DECLARE_MODULE(ip6_mroute, ip6_mroutemod, SI_SUB_PSEUDO, SI_ORDER_ANY); > +DECLARE_MODULE(ip6_mroute, ip6_mroutemod, SI_SUB_PROTO_MC, SI_ORDER_ANY); > > Modified: head/sys/netinet6/mld6.c > ============================================================================== > --- head/sys/netinet6/mld6.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netinet6/mld6.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -612,9 +612,6 @@ mli_delete_locked(const struct ifnet *if > return; > } > } > -#ifdef INVARIANTS > - panic("%s: mld_ifsoftc not found for ifp %p\n", __func__, ifp); > -#endif > } > > /* > @@ -3265,7 +3262,7 @@ mld_init(void *unused __unused) > mld_po.ip6po_prefer_tempaddr = IP6PO_TEMPADDR_NOTPREFER; > mld_po.ip6po_flags = IP6PO_DONTFRAG; > } > -SYSINIT(mld_init, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, mld_init, NULL); > +SYSINIT(mld_init, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE, mld_init, NULL); > > static void > mld_uninit(void *unused __unused) > @@ -3274,7 +3271,7 @@ mld_uninit(void *unused __unused) > CTR1(KTR_MLD, "%s: tearing down", __func__); > MLD_LOCK_DESTROY(); > } > -SYSUNINIT(mld_uninit, SI_SUB_PSEUDO, SI_ORDER_MIDDLE, mld_uninit, NULL); > +SYSUNINIT(mld_uninit, SI_SUB_PROTO_MC, SI_ORDER_MIDDLE, mld_uninit, NULL); > > static void > vnet_mld_init(const void *unused __unused) > @@ -3284,19 +3281,17 @@ vnet_mld_init(const void *unused __unuse > > LIST_INIT(&V_mli_head); > } > -VNET_SYSINIT(vnet_mld_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_mld_init, > +VNET_SYSINIT(vnet_mld_init, SI_SUB_PROTO_MC, SI_ORDER_ANY, vnet_mld_init, > NULL); > > static void > vnet_mld_uninit(const void *unused __unused) > { > > + /* This can happen if we shutdown the network stack. */ > CTR1(KTR_MLD, "%s: tearing down", __func__); > - > - KASSERT(LIST_EMPTY(&V_mli_head), > - ("%s: mli list not empty; ifnets not detached?", __func__)); > } > -VNET_SYSUNINIT(vnet_mld_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_mld_uninit, > +VNET_SYSUNINIT(vnet_mld_uninit, SI_SUB_PROTO_MC, SI_ORDER_ANY, vnet_mld_uninit, > NULL); > > static int > @@ -3318,4 +3313,4 @@ static moduledata_t mld_mod = { > mld_modevent, > 0 > }; > -DECLARE_MODULE(mld, mld_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); > +DECLARE_MODULE(mld, mld_mod, SI_SUB_PROTO_MC, SI_ORDER_ANY); > > Modified: head/sys/netinet6/nd6.c > ============================================================================== > --- head/sys/netinet6/nd6.c Tue Jun 21 07:05:49 2016 (r302053) > +++ head/sys/netinet6/nd6.c Tue Jun 21 13:48:49 2016 (r302054) > @@ -292,8 +292,19 @@ nd6_ifattach(struct ifnet *ifp) > } > > void > -nd6_ifdetach(struct nd_ifinfo *nd) > +nd6_ifdetach(struct ifnet *ifp, struct nd_ifinfo *nd) > { > + struct ifaddr *ifa, *next; > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-head@freebsd.org Wed Jun 22 07:50:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E429EB03086; Wed, 22 Jun 2016 07:50:03 +0000 (UTC) (envelope-from mm@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 999181CC1; Wed, 22 Jun 2016 07:50:03 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5M7o2Pg089630; Wed, 22 Jun 2016 07:50:02 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5M7nxYm089575; Wed, 22 Jun 2016 07:49:59 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201606220749.u5M7nxYm089575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 22 Jun 2016 07:49:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302075 - in head: contrib/libarchive contrib/libarchive/cat/test contrib/libarchive/cpio contrib/libarchive/cpio/test contrib/libarchive/libarchive contrib/libarchive/libarchive/test c... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 07:50:04 -0000 Author: mm Date: Wed Jun 22 07:49:59 2016 New Revision: 302075 URL: https://svnweb.freebsd.org/changeset/base/302075 Log: MFV r302003,r302037,r302038,r302056: Update libarchive to 3.2.1 (bugfix and security fix release) List of vendor fixes: - fix exploitable heap overflow vulnerability in Rar decompression (vendor issue 719, CVE-2016-4302, TALOS-2016-0154) - fix exploitable stack based buffer overflow vulnebarility in mtree parse_device functionality (vendor PR 715, CVE-2016-4301, TALOS-2016-0153) - fix exploitable heap overflow vulnerability in 7-zip read_SubStreamsInfo (vendor issue 718, CVE-2016-4300, TALOS-2016-152) - fix integer overflow when computing location of volume descriptor (vendor issue 717) - fix buffer overflow when reading a crafred rar archive (vendor issue 521) - fix possible buffer overflow when reading ISO9660 archives on machines where sizeof(int) < sizeof(size_t) (vendor issue 711) - tar and cpio should fail if an input file named on the command line is missing (vendor issue 708) - fix incorrect writing of gnutar filenames that are exactly 512 bytes long (vendor issue 682) - allow tests to be run from paths that are equal or longer than 128 characters (vendor issue 657) - add memory allocation errors in archive_entry_xattr.c (vendor PR 603) - remove dead code in archive_entry_xattr_add_entry() (vendor PR 716) - fix broken decryption of ZIP files (vendor issue 553) - manpage style, typo and description fixes Post-3.2.1 vendor fixes: - fix typo in cpio version reporting (Vendor PR 725, 726) - fix argument range of ctype functions in libarchive_fe/passphrase.c - fix ctype use and avoid empty loop bodies in WARC reader MFC after: 1 week Security: CVE-2016-4300, CVE-2016-4301, CVE-2016-4302 Approved by: re (kib) Added: head/contrib/libarchive/cpio/test/test_missing_file.c - copied unchanged from r302003, vendor/libarchive/dist/cpio/test/test_missing_file.c head/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.c - copied unchanged from r302038, vendor/libarchive/dist/libarchive/test/test_read_format_rar_invalid1.c head/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.rar.uu - copied unchanged from r302038, vendor/libarchive/dist/libarchive/test/test_read_format_rar_invalid1.rar.uu head/contrib/libarchive/libarchive/test/test_write_format_gnutar_filenames.c - copied, changed from r302003, vendor/libarchive/dist/libarchive/test/test_write_format_gnutar_filenames.c head/contrib/libarchive/tar/test/test_missing_file.c - copied unchanged from r302003, vendor/libarchive/dist/tar/test/test_missing_file.c Modified: head/contrib/libarchive/NEWS head/contrib/libarchive/cat/test/main.c head/contrib/libarchive/cpio/cpio.c head/contrib/libarchive/cpio/test/main.c head/contrib/libarchive/cpio/test/test_option_version.c head/contrib/libarchive/libarchive/archive.h head/contrib/libarchive/libarchive/archive_entry.h head/contrib/libarchive/libarchive/archive_entry_xattr.c head/contrib/libarchive/libarchive/archive_ppmd7.c head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c head/contrib/libarchive/libarchive/archive_read_support_format_lha.c head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c head/contrib/libarchive/libarchive/archive_read_support_format_rar.c head/contrib/libarchive/libarchive/archive_read_support_format_warc.c head/contrib/libarchive/libarchive/archive_read_support_format_zip.c head/contrib/libarchive/libarchive/archive_write_filter.3 head/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c head/contrib/libarchive/libarchive/archive_write_set_options.3 head/contrib/libarchive/libarchive/libarchive-formats.5 head/contrib/libarchive/libarchive/libarchive_changes.3 head/contrib/libarchive/libarchive/test/main.c head/contrib/libarchive/libarchive_fe/passphrase.c head/contrib/libarchive/tar/test/main.c head/contrib/libarchive/tar/write.c head/lib/libarchive/tests/Makefile head/usr.bin/bsdcat/Makefile head/usr.bin/cpio/Makefile head/usr.bin/cpio/tests/Makefile head/usr.bin/tar/Makefile head/usr.bin/tar/tests/Makefile Directory Properties: head/contrib/libarchive/ (props changed) head/contrib/libarchive/cpio/ (props changed) head/contrib/libarchive/libarchive/ (props changed) head/contrib/libarchive/libarchive_fe/ (props changed) head/contrib/libarchive/tar/ (props changed) Modified: head/contrib/libarchive/NEWS ============================================================================== --- head/contrib/libarchive/NEWS Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/NEWS Wed Jun 22 07:49:59 2016 (r302075) @@ -1,3 +1,8 @@ +Jun 20, 2016: libarchive 3.2.1 released + This fixes a handful of security and other critical issues with 3.2.0 + +May 01, 2016: libarchive 3.2.0 released + Apr 09, 2016: libarchive 3.1.901a released Another test release in preparation for 3.2.0 Modified: head/contrib/libarchive/cat/test/main.c ============================================================================== --- head/contrib/libarchive/cat/test/main.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/cat/test/main.c Wed Jun 22 07:49:59 2016 (r302075) @@ -2534,18 +2534,36 @@ usage(const char *program) static char * get_refdir(const char *d) { - char tried[512] = { '\0' }; - char buff[128]; - char *pwd, *p; + size_t tried_size, buff_size; + char *buff, *tried, *pwd = NULL, *p = NULL; + +#ifdef PATH_MAX + buff_size = PATH_MAX; +#else + buff_size = 8192; +#endif + buff = calloc(buff_size, 1); + if (buff == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } + + /* Allocate a buffer to hold the various directories we checked. */ + tried_size = buff_size * 2; + tried = calloc(tried_size, 1); + if (tried == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } /* If a dir was specified, try that */ if (d != NULL) { pwd = NULL; - snprintf(buff, sizeof(buff), "%s", d); + snprintf(buff, buff_size, "%s", d); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); goto failure; } @@ -2559,48 +2577,48 @@ get_refdir(const char *d) pwd[strlen(pwd) - 1] = '\0'; /* Look for a known file. */ - snprintf(buff, sizeof(buff), "%s", pwd); + snprintf(buff, buff_size, "%s", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd); + snprintf(buff, buff_size, "%s/test", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(LIBRARY) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, LIBRARY); + snprintf(buff, buff_size, "%s/%s/test", pwd, LIBRARY); #else - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM); #endif p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(PROGRAM_ALIAS) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM_ALIAS); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM_ALIAS); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #endif if (memcmp(pwd, "/usr/obj", 8) == 0) { - snprintf(buff, sizeof(buff), "%s", pwd + 8); + snprintf(buff, buff_size, "%s", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd + 8); + snprintf(buff, buff_size, "%s/test", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); } failure: @@ -2615,7 +2633,12 @@ failure: success: free(p); free(pwd); - return strdup(buff); + free(tried); + + /* Copy result into a fresh buffer to reduce memory usage. */ + p = strdup(buff); + free(buff); + return p; } int Modified: head/contrib/libarchive/cpio/cpio.c ============================================================================== --- head/contrib/libarchive/cpio/cpio.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/cpio/cpio.c Wed Jun 22 07:49:59 2016 (r302075) @@ -498,7 +498,7 @@ long_help(void) static void version(void) { - fprintf(stdout,"bsdcpio %s -- %s\n", + fprintf(stdout,"bsdcpio %s - %s\n", BSDCPIO_VERSION_STRING, archive_version_details()); exit(0); Modified: head/contrib/libarchive/cpio/test/main.c ============================================================================== --- head/contrib/libarchive/cpio/test/main.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/cpio/test/main.c Wed Jun 22 07:49:59 2016 (r302075) @@ -2535,18 +2535,36 @@ usage(const char *program) static char * get_refdir(const char *d) { - char tried[512] = { '\0' }; - char buff[128]; - char *pwd, *p; + size_t tried_size, buff_size; + char *buff, *tried, *pwd = NULL, *p = NULL; + +#ifdef PATH_MAX + buff_size = PATH_MAX; +#else + buff_size = 8192; +#endif + buff = calloc(buff_size, 1); + if (buff == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } + + /* Allocate a buffer to hold the various directories we checked. */ + tried_size = buff_size * 2; + tried = calloc(tried_size, 1); + if (tried == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } /* If a dir was specified, try that */ if (d != NULL) { pwd = NULL; - snprintf(buff, sizeof(buff), "%s", d); + snprintf(buff, buff_size, "%s", d); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); goto failure; } @@ -2560,48 +2578,48 @@ get_refdir(const char *d) pwd[strlen(pwd) - 1] = '\0'; /* Look for a known file. */ - snprintf(buff, sizeof(buff), "%s", pwd); + snprintf(buff, buff_size, "%s", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd); + snprintf(buff, buff_size, "%s/test", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(LIBRARY) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, LIBRARY); + snprintf(buff, buff_size, "%s/%s/test", pwd, LIBRARY); #else - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM); #endif p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(PROGRAM_ALIAS) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM_ALIAS); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM_ALIAS); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #endif if (memcmp(pwd, "/usr/obj", 8) == 0) { - snprintf(buff, sizeof(buff), "%s", pwd + 8); + snprintf(buff, buff_size, "%s", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd + 8); + snprintf(buff, buff_size, "%s/test", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); } failure: @@ -2616,7 +2634,12 @@ failure: success: free(p); free(pwd); - return strdup(buff); + free(tried); + + /* Copy result into a fresh buffer to reduce memory usage. */ + p = strdup(buff); + free(buff); + return p; } int Copied: head/contrib/libarchive/cpio/test/test_missing_file.c (from r302003, vendor/libarchive/dist/cpio/test/test_missing_file.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/cpio/test/test_missing_file.c Wed Jun 22 07:49:59 2016 (r302075, copy of r302003, vendor/libarchive/dist/cpio/test/test_missing_file.c) @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2016 Tim Kientzle + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_missing_file) +{ + int r; + + assertMakeFile("file1", 0644, "file1"); + assertMakeFile("file2", 0644, "file2"); + + assertMakeFile("filelist1", 0644, "file1\nfile2\n"); + r = systemf("%s -o stdout1 2>stderr1", testprog); + assertEqualInt(r, 0); + assertTextFileContents("1 block\n", "stderr1"); + + assertMakeFile("filelist2", 0644, "file1\nfile2\nfile3\n"); + r = systemf("%s -o stdout2 2>stderr2", testprog); + assert(r != 0); + + assertMakeFile("filelist3", 0644, ""); + r = systemf("%s -o stdout3 2>stderr3", testprog); + assertEqualInt(r, 0); + assertTextFileContents("1 block\n", "stderr3"); + + assertMakeFile("filelist4", 0644, "file3\n"); + r = systemf("%s -o stdout4 2>stderr4", testprog); + assert(r != 0); +} Modified: head/contrib/libarchive/cpio/test/test_option_version.c ============================================================================== --- head/contrib/libarchive/cpio/test/test_option_version.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/cpio/test/test_option_version.c Wed Jun 22 07:49:59 2016 (r302075) @@ -59,8 +59,8 @@ verify(const char *p, size_t s) ++q; --s; /* Separator. */ failure("Version: %s", p); - assertEqualMem(q, "-- ", 3); - q += 3; s -= 3; + assertEqualMem(q, "- ", 2); + q += 2; s -= 2; /* libarchive name and version number */ assert(s > 11); failure("Version: %s", p); Modified: head/contrib/libarchive/libarchive/archive.h ============================================================================== --- head/contrib/libarchive/libarchive/archive.h Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive.h Wed Jun 22 07:49:59 2016 (r302075) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3002000 +#define ARCHIVE_VERSION_NUMBER 3002001 #include #include /* for wchar_t */ @@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(vo /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_ONLY_STRING "3.2.0" +#define ARCHIVE_VERSION_ONLY_STRING "3.2.1" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); Modified: head/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry.h Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive_entry.h Wed Jun 22 07:49:59 2016 (r302075) @@ -29,7 +29,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3002000 +#define ARCHIVE_VERSION_NUMBER 3002001 /* * Note: archive_entry.h is for use outside of libarchive; the Modified: head/contrib/libarchive/libarchive/archive_entry_xattr.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_entry_xattr.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive_entry_xattr.c Wed Jun 22 07:49:59 2016 (r302075) @@ -91,16 +91,11 @@ archive_entry_xattr_add_entry(struct arc { struct ae_xattr *xp; - for (xp = entry->xattr_head; xp != NULL; xp = xp->next) - ; - if ((xp = (struct ae_xattr *)malloc(sizeof(struct ae_xattr))) == NULL) - /* XXX Error XXX */ - return; + __archive_errx(1, "Out of memory"); if ((xp->name = strdup(name)) == NULL) - /* XXX Error XXX */ - return; + __archive_errx(1, "Out of memory"); if ((xp->value = malloc(size)) != NULL) { memcpy(xp->value, value, size); Modified: head/contrib/libarchive/libarchive/archive_ppmd7.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_ppmd7.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive_ppmd7.c Wed Jun 22 07:49:59 2016 (r302075) @@ -126,6 +126,11 @@ static Bool Ppmd7_Alloc(CPpmd7 *p, UInt3 { if (p->Base == 0 || p->Size != size) { + /* RestartModel() below assumes that p->Size >= UNIT_SIZE + (see the calculation of m->MinContext). */ + if (size < UNIT_SIZE) { + return False; + } Ppmd7_Free(p, alloc); p->AlignOffset = #ifdef PPMD_32BIT Modified: head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive_read_support_format_7zip.c Wed Jun 22 07:49:59 2016 (r302075) @@ -2153,6 +2153,9 @@ read_SubStreamsInfo(struct archive_read return (-1); if (UMAX_ENTRY < f[i].numUnpackStreams) return (-1); + if (unpack_streams > SIZE_MAX - UMAX_ENTRY) { + return (-1); + } unpack_streams += (size_t)f[i].numUnpackStreams; } if ((p = header_bytes(a, 1)) == NULL) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c Wed Jun 22 07:49:59 2016 (r302075) @@ -1091,7 +1091,7 @@ choose_volume(struct archive_read *a, st /* This condition is unlikely; by way of caution. */ vd = &(iso9660->joliet); - skipsize = LOGICAL_BLOCK_SIZE * vd->location; + skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location; skipsize = __archive_read_consume(a, skipsize); if (skipsize < 0) return ((int)skipsize); @@ -1129,7 +1129,7 @@ choose_volume(struct archive_read *a, st && iso9660->seenJoliet) { /* Switch reading data from primary to joliet. */ vd = &(iso9660->joliet); - skipsize = LOGICAL_BLOCK_SIZE * vd->location; + skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location; skipsize -= iso9660->current_position; skipsize = __archive_read_consume(a, skipsize); if (skipsize < 0) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_lha.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_lha.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive_read_support_format_lha.c Wed Jun 22 07:49:59 2016 (r302075) @@ -1712,6 +1712,7 @@ lha_crc16(uint16_t crc, const void *pp, for (;len >= 8; len -= 8) { /* This if statement expects compiler optimization will * remove the stament which will not be executed. */ +#undef bswap16 #if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual Studio */ # define bswap16(x) _byteswap_ushort(x) #elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8) \ Modified: head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Wed Jun 22 07:49:59 2016 (r302075) @@ -1385,12 +1385,12 @@ parse_device(dev_t *pdev, struct archive "Missing number"); return ARCHIVE_WARN; } - numbers[argc++] = (unsigned long)mtree_atol(&p); - if (argc > MAX_PACK_ARGS) { + if (argc >= MAX_PACK_ARGS) { archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT, "Too many arguments"); return ARCHIVE_WARN; } + numbers[argc++] = (unsigned long)mtree_atol(&p); } if (argc < 2) { archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT, Modified: head/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_rar.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive_read_support_format_rar.c Wed Jun 22 07:49:59 2016 (r302075) @@ -2127,6 +2127,12 @@ parse_codes(struct archive_read *a) rar->range_dec.Stream = &rar->bytein; __archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context); + if (rar->dictionary_size == 0) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Invalid zero dictionary size"); + return (ARCHIVE_FATAL); + } + if (!__archive_ppmd7_functions.Ppmd7_Alloc(&rar->ppmd7_context, rar->dictionary_size, &g_szalloc)) { @@ -2884,11 +2890,10 @@ copy_from_lzss_window(struct archive_rea } windowoffs = lzss_offset_for_position(&rar->lzss, startpos); - if(windowoffs + length <= lzss_size(&rar->lzss)) + if(windowoffs + length <= lzss_size(&rar->lzss)) { memcpy(&rar->unp_buffer[rar->unp_offset], &rar->lzss.window[windowoffs], length); - else - { + } else if (length <= lzss_size(&rar->lzss)) { firstpart = lzss_size(&rar->lzss) - windowoffs; if (firstpart < 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, @@ -2900,9 +2905,14 @@ copy_from_lzss_window(struct archive_rea &rar->lzss.window[windowoffs], firstpart); memcpy(&rar->unp_buffer[rar->unp_offset + firstpart], &rar->lzss.window[0], length - firstpart); - } else + } else { memcpy(&rar->unp_buffer[rar->unp_offset], &rar->lzss.window[windowoffs], length); + } + } else { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Bad RAR file data"); + return (ARCHIVE_FATAL); } rar->unp_offset += length; if (rar->unp_offset >= rar->unp_buffer_size) Modified: head/contrib/libarchive/libarchive/archive_read_support_format_warc.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_warc.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive_read_support_format_warc.c Wed Jun 22 07:49:59 2016 (r302075) @@ -535,7 +535,8 @@ xstrpisotime(const char *s, char **endpt /* as a courtesy to our callers, and since this is a non-standard * routine, we skip leading whitespace */ - for (; isspace(*s); s++); + while (isspace((unsigned char)*s)) + ++s; /* read year */ if ((tm.tm_year = strtoi_lim(s, &s, 1583, 4095)) < 0 || *s++ != '-') { @@ -639,7 +640,9 @@ _warc_rdtyp(const char *buf, size_t bsz) return WT_NONE; } /* overread whitespace */ - for (val += sizeof(_key) - 1U; val < eob && isspace(*val); val++); + val += sizeof(_key) - 1U; + while (val < eob && isspace((unsigned char)*val)) + ++val; if (val + 8U > eob) { ; @@ -676,7 +679,9 @@ _warc_rduri(const char *buf, size_t bsz) return res; } /* overread whitespace */ - for (val += sizeof(_key) - 1U; val < eob && isspace(*val); val++); + val += sizeof(_key) - 1U; + while (val < eob && isspace((unsigned char)*val)) + ++val; /* overread URL designators */ if ((uri = xmemmem(val, eob - val, "://", 3U)) == NULL) { @@ -692,7 +697,8 @@ _warc_rduri(const char *buf, size_t bsz) /* also massage eol to point to the first whitespace * after the last non-whitespace character before * the end of the line */ - for (; eol > uri && isspace(eol[-1]); eol--); + while (eol > uri && isspace((unsigned char)eol[-1])) + --eol; /* now then, inspect the URI */ if (memcmp(val, "file", 4U) == 0) { @@ -727,7 +733,7 @@ _warc_rdlen(const char *buf, size_t bsz) /* strtol kindly overreads whitespace for us, so use that */ val += sizeof(_key) - 1U; len = strtol(val, &on, 10); - if (on == NULL || !isspace(*on)) { + if (on == NULL || !isspace((unsigned char)*on)) { /* hm, can we trust that number? Best not. */ return -1; } @@ -750,7 +756,7 @@ _warc_rdrtm(const char *buf, size_t bsz) /* xstrpisotime() kindly overreads whitespace for us, so use that */ val += sizeof(_key) - 1U; res = xstrpisotime(val, &on); - if (on == NULL || !isspace(*on)) { + if (on == NULL || !isspace((unsigned char)*on)) { /* hm, can we trust that number? Best not. */ return (time_t)-1; } @@ -773,7 +779,7 @@ _warc_rdmtm(const char *buf, size_t bsz) /* xstrpisotime() kindly overreads whitespace for us, so use that */ val += sizeof(_key) - 1U; res = xstrpisotime(val, &on); - if (on == NULL || !isspace(*on)) { + if (on == NULL || !isspace((unsigned char)*on)) { /* hm, can we trust that number? Best not. */ return (time_t)-1; } Modified: head/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive_read_support_format_zip.c Wed Jun 22 07:49:59 2016 (r302075) @@ -181,6 +181,14 @@ struct zip { char init_decryption; /* Decryption buffer. */ + /* + * The decrypted data starts at decrypted_ptr and + * extends for decrypted_bytes_remaining. Decryption + * adds new data to the end of this block, data is returned + * to clients from the beginning. When the block hits the + * end of decrypted_buffer, it has to be shuffled back to + * the beginning of the buffer. + */ unsigned char *decrypted_buffer; unsigned char *decrypted_ptr; size_t decrypted_buffer_size; @@ -1293,8 +1301,9 @@ zip_read_data_deflate(struct archive_rea if (zip->tctx_valid || zip->cctx_valid) { if (zip->decrypted_bytes_remaining < (size_t)bytes_avail) { - size_t buff_remaining = zip->decrypted_buffer_size - - (zip->decrypted_ptr - zip->decrypted_buffer); + size_t buff_remaining = + (zip->decrypted_buffer + zip->decrypted_buffer_size) + - (zip->decrypted_ptr + zip->decrypted_bytes_remaining); if (buff_remaining > (size_t)bytes_avail) buff_remaining = (size_t)bytes_avail; Modified: head/contrib/libarchive/libarchive/archive_write_filter.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_filter.3 Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive_write_filter.3 Wed Jun 22 07:49:59 2016 (r302075) @@ -43,6 +43,7 @@ .Nm archive_write_add_filter_program , .Nm archive_write_add_filter_uuencode , .Nm archive_write_add_filter_xz +.Nd functions enabling output filters .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) .Sh SYNOPSIS Modified: head/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c Wed Jun 22 07:49:59 2016 (r302075) @@ -467,7 +467,7 @@ archive_write_gnutar_header(struct archi } } if (gnutar->linkname_length > GNUTAR_linkname_size) { - size_t todo = gnutar->linkname_length; + size_t length = gnutar->linkname_length + 1; struct archive_entry *temp = archive_entry_new2(&a->archive); /* Uname/gname here don't really matter since no one reads them; @@ -476,7 +476,7 @@ archive_write_gnutar_header(struct archi archive_entry_set_gname(temp, "wheel"); archive_entry_set_pathname(temp, "././@LongLink"); - archive_entry_set_size(temp, gnutar->linkname_length + 1); + archive_entry_set_size(temp, length); ret = archive_format_gnutar_header(a, buff, temp, 'K'); if (ret < ARCHIVE_WARN) goto exit_write_header; @@ -484,11 +484,12 @@ archive_write_gnutar_header(struct archi if(ret < ARCHIVE_WARN) goto exit_write_header; archive_entry_free(temp); - /* Write as many 512 bytes blocks as needed to write full name. */ - ret = __archive_write_output(a, gnutar->linkname, todo); + /* Write name and trailing null byte. */ + ret = __archive_write_output(a, gnutar->linkname, length); if(ret < ARCHIVE_WARN) goto exit_write_header; - ret = __archive_write_nulls(a, 0x1ff & (-(ssize_t)todo)); + /* Pad to 512 bytes */ + ret = __archive_write_nulls(a, 0x1ff & (-(ssize_t)length)); if (ret < ARCHIVE_WARN) goto exit_write_header; } @@ -496,7 +497,7 @@ archive_write_gnutar_header(struct archi /* If pathname is longer than 100 chars we need to add an 'L' header. */ if (gnutar->pathname_length > GNUTAR_name_size) { const char *pathname = gnutar->pathname; - size_t todo = gnutar->pathname_length; + size_t length = gnutar->pathname_length + 1; struct archive_entry *temp = archive_entry_new2(&a->archive); /* Uname/gname here don't really matter since no one reads them; @@ -505,7 +506,7 @@ archive_write_gnutar_header(struct archi archive_entry_set_gname(temp, "wheel"); archive_entry_set_pathname(temp, "././@LongLink"); - archive_entry_set_size(temp, gnutar->pathname_length + 1); + archive_entry_set_size(temp, length); ret = archive_format_gnutar_header(a, buff, temp, 'L'); if (ret < ARCHIVE_WARN) goto exit_write_header; @@ -513,11 +514,12 @@ archive_write_gnutar_header(struct archi if(ret < ARCHIVE_WARN) goto exit_write_header; archive_entry_free(temp); - /* Write as many 512 bytes blocks as needed to write full name. */ - ret = __archive_write_output(a, pathname, todo); + /* Write pathname + trailing null byte. */ + ret = __archive_write_output(a, pathname, length); if(ret < ARCHIVE_WARN) goto exit_write_header; - ret = __archive_write_nulls(a, 0x1ff & (-(ssize_t)todo)); + /* Pad to multiple of 512 bytes. */ + ret = __archive_write_nulls(a, 0x1ff & (-(ssize_t)length)); if (ret < ARCHIVE_WARN) goto exit_write_header; } Modified: head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c Wed Jun 22 07:49:59 2016 (r302075) @@ -6225,7 +6225,7 @@ isoent_gen_joliet_identifier(struct arch unsigned char *p; size_t l; int r; - int ffmax, parent_len; + size_t ffmax, parent_len; static const struct archive_rb_tree_ops rb_ops = { isoent_cmp_node_joliet, isoent_cmp_key_joliet }; @@ -6239,7 +6239,7 @@ isoent_gen_joliet_identifier(struct arch else ffmax = 128; - r = idr_start(a, idr, isoent->children.cnt, ffmax, 6, 2, &rb_ops); + r = idr_start(a, idr, isoent->children.cnt, (int)ffmax, 6, 2, &rb_ops); if (r < 0) return (r); @@ -6252,7 +6252,7 @@ isoent_gen_joliet_identifier(struct arch int ext_off, noff, weight; size_t lt; - if ((int)(l = np->file->basename_utf16.length) > ffmax) + if ((l = np->file->basename_utf16.length) > ffmax) l = ffmax; p = malloc((l+1)*2); @@ -6285,7 +6285,7 @@ isoent_gen_joliet_identifier(struct arch /* * Get a length of MBS of a full-pathname. */ - if ((int)np->file->basename_utf16.length > ffmax) { + if (np->file->basename_utf16.length > ffmax) { if (archive_strncpy_l(&iso9660->mbs, (const char *)np->identifier, l, iso9660->sconv_from_utf16be) != 0 && @@ -6302,7 +6302,9 @@ isoent_gen_joliet_identifier(struct arch /* If a length of full-pathname is longer than 240 bytes, * it violates Joliet extensions regulation. */ - if (parent_len + np->mb_len > 240) { + if (parent_len > 240 + || np->mb_len > 240 + || parent_len + np->mb_len > 240) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "The regulation of Joliet extensions;" " A length of a full-pathname of `%s' is " @@ -6314,11 +6316,11 @@ isoent_gen_joliet_identifier(struct arch /* Make an offset of the number which is used to be set * hexadecimal number to avoid duplicate identifier. */ - if ((int)l == ffmax) + if (l == ffmax) noff = ext_off - 6; - else if ((int)l == ffmax-2) + else if (l == ffmax-2) noff = ext_off - 4; - else if ((int)l == ffmax-4) + else if (l == ffmax-4) noff = ext_off - 2; else noff = ext_off; Modified: head/contrib/libarchive/libarchive/archive_write_set_options.3 ============================================================================== --- head/contrib/libarchive/libarchive/archive_write_set_options.3 Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/archive_write_set_options.3 Wed Jun 22 07:49:59 2016 (r302075) @@ -32,7 +32,7 @@ .Nm archive_write_set_format_option , .Nm archive_write_set_option , .Nm archive_write_set_options -.Nd functions controlling options for reading archives +.Nd functions controlling options for writing archives .Sh LIBRARY Streaming Archive Library (libarchive, -larchive) .Sh SYNOPSIS Modified: head/contrib/libarchive/libarchive/libarchive-formats.5 ============================================================================== --- head/contrib/libarchive/libarchive/libarchive-formats.5 Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/libarchive-formats.5 Wed Jun 22 07:49:59 2016 (r302075) @@ -65,7 +65,6 @@ Later variants have extended this by eit areas of the header record, extending the header to multiple records, or by storing special entries that modify the interpretation of subsequent entries. -.Pp .Bl -tag -width indent .It Cm gnutar The Modified: head/contrib/libarchive/libarchive/libarchive_changes.3 ============================================================================== --- head/contrib/libarchive/libarchive/libarchive_changes.3 Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/libarchive_changes.3 Wed Jun 22 07:49:59 2016 (r302075) @@ -28,7 +28,7 @@ .Dt LIBARCHIVE_CHANGES 3 .Os .Sh NAME -.Nm changes in libarchive interface +.Nd changes in libarchive interface .\" .Sh CHANGES IN LIBARCHIVE 3 This page describes user-visible changes in libarchive3, and lists Modified: head/contrib/libarchive/libarchive/test/main.c ============================================================================== --- head/contrib/libarchive/libarchive/test/main.c Tue Jun 21 22:19:06 2016 (r302074) +++ head/contrib/libarchive/libarchive/test/main.c Wed Jun 22 07:49:59 2016 (r302075) @@ -2533,18 +2533,36 @@ usage(const char *program) static char * get_refdir(const char *d) { - char tried[512] = { '\0' }; - char buff[128]; - char *pwd, *p; + size_t tried_size, buff_size; + char *buff, *tried, *pwd = NULL, *p = NULL; + +#ifdef PATH_MAX + buff_size = PATH_MAX; +#else + buff_size = 8192; +#endif + buff = calloc(buff_size, 1); + if (buff == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } + + /* Allocate a buffer to hold the various directories we checked. */ + tried_size = buff_size * 2; + tried = calloc(tried_size, 1); + if (tried == NULL) { + fprintf(stderr, "Unable to allocate memory\n"); + exit(1); + } /* If a dir was specified, try that */ if (d != NULL) { pwd = NULL; - snprintf(buff, sizeof(buff), "%s", d); + snprintf(buff, buff_size, "%s", d); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); goto failure; } @@ -2558,48 +2576,48 @@ get_refdir(const char *d) pwd[strlen(pwd) - 1] = '\0'; /* Look for a known file. */ - snprintf(buff, sizeof(buff), "%s", pwd); + snprintf(buff, buff_size, "%s", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd); + snprintf(buff, buff_size, "%s/test", pwd); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(LIBRARY) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, LIBRARY); + snprintf(buff, buff_size, "%s/%s/test", pwd, LIBRARY); #else - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM); #endif p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #if defined(PROGRAM_ALIAS) - snprintf(buff, sizeof(buff), "%s/%s/test", pwd, PROGRAM_ALIAS); + snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM_ALIAS); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); #endif if (memcmp(pwd, "/usr/obj", 8) == 0) { - snprintf(buff, sizeof(buff), "%s", pwd + 8); + snprintf(buff, buff_size, "%s", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); - snprintf(buff, sizeof(buff), "%s/test", pwd + 8); + snprintf(buff, buff_size, "%s/test", pwd + 8); p = slurpfile(NULL, "%s/%s", buff, KNOWNREF); if (p != NULL) goto success; - strncat(tried, buff, sizeof(tried) - strlen(tried) - 1); - strncat(tried, "\n", sizeof(tried) - strlen(tried) - 1); + strncat(tried, buff, tried_size - strlen(tried) - 1); + strncat(tried, "\n", tried_size - strlen(tried) - 1); } failure: @@ -2614,7 +2632,12 @@ failure: success: free(p); free(pwd); - return strdup(buff); + free(tried); + + /* Copy result into a fresh buffer to reduce memory usage. */ + p = strdup(buff); + free(buff); + return p; } int Copied: head/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.c (from r302038, vendor/libarchive/dist/libarchive/test/test_read_format_rar_invalid1.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.c Wed Jun 22 07:49:59 2016 (r302075, copy of r302038, vendor/libarchive/dist/libarchive/test/test_read_format_rar_invalid1.c) @@ -0,0 +1,44 @@ +/*- + * Copyright (c) 2003-2016 Tim Kientzle + * 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(S) ``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(S) 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 "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_read_format_rar_invalid1) +{ + const char *refname = "test_read_format_rar_invalid1.rar"; + struct archive *a; + struct archive_entry *ae; + char *buff[100]; + + extract_reference_file(refname); + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 10240)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_FATAL, archive_read_data(a, buff, 99)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} Copied: head/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.rar.uu (from r302038, vendor/libarchive/dist/libarchive/test/test_read_format_rar_invalid1.rar.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libarchive/libarchive/test/test_read_format_rar_invalid1.rar.uu Wed Jun 22 07:49:59 2016 (r302075, copy of r302038, vendor/libarchive/dist/libarchive/test/test_read_format_rar_invalid1.rar.uu) @@ -0,0 +1,5 @@ +begin 644 test_read_format_rar_invalid1.rar +M4F%R(1H'`,^0B$4= +2,P0`I($``'1E -#include +#include #include #include #ifdef HAVE_PATHS_H #include #endif +#include #include +#include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jun 22 09:03:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44E30AC4EE0; Wed, 22 Jun 2016 09:03:57 +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 1FD9420E1; Wed, 22 Jun 2016 09:03:57 +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 u5M93ukJ018667; Wed, 22 Jun 2016 09:03:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5M93u0X018664; Wed, 22 Jun 2016 09:03:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606220903.u5M93u0X018664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 22 Jun 2016 09:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302076 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 09:03:57 -0000 Author: hselasky Date: Wed Jun 22 09:03:55 2016 New Revision: 302076 URL: https://svnweb.freebsd.org/changeset/base/302076 Log: Update the definition for number of scratch pages to match the latest version of the XHCI specification. Make sure the code can handle the maximum number of allowed scratch pages. Submitted by: Shichun_Ma@Dell.com Approved by: re (hrs) MFC after: 1 week Modified: head/sys/dev/usb/controller/xhci.c head/sys/dev/usb/controller/xhci.h head/sys/dev/usb/controller/xhcireg.h Modified: head/sys/dev/usb/controller/xhci.c ============================================================================== --- head/sys/dev/usb/controller/xhci.c Wed Jun 22 07:49:59 2016 (r302075) +++ head/sys/dev/usb/controller/xhci.c Wed Jun 22 09:03:55 2016 (r302076) @@ -210,7 +210,7 @@ static void xhci_iterate_hw_softc(struct usb_bus *bus, usb_bus_mem_sub_cb_t *cb) { struct xhci_softc *sc = XHCI_BUS2SC(bus); - uint8_t i; + uint16_t i; cb(bus, &sc->sc_hw.root_pc, &sc->sc_hw.root_pg, sizeof(struct xhci_hw_root), XHCI_PAGE_SIZE); @@ -218,7 +218,7 @@ xhci_iterate_hw_softc(struct usb_bus *bu cb(bus, &sc->sc_hw.ctx_pc, &sc->sc_hw.ctx_pg, sizeof(struct xhci_dev_ctx_addr), XHCI_PAGE_SIZE); - for (i = 0; i != XHCI_MAX_SCRATCHPADS; i++) { + for (i = 0; i != sc->sc_noscratch; i++) { cb(bus, &sc->sc_hw.scratch_pc[i], &sc->sc_hw.scratch_pg[i], XHCI_PAGE_SIZE, XHCI_PAGE_SIZE); } Modified: head/sys/dev/usb/controller/xhci.h ============================================================================== --- head/sys/dev/usb/controller/xhci.h Wed Jun 22 07:49:59 2016 (r302075) +++ head/sys/dev/usb/controller/xhci.h Wed Jun 22 09:03:55 2016 (r302076) @@ -30,7 +30,7 @@ #define XHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128) #define XHCI_MAX_ENDPOINTS 32 /* hardcoded - do not change */ -#define XHCI_MAX_SCRATCHPADS 32 +#define XHCI_MAX_SCRATCHPADS 1024 #define XHCI_MAX_EVENTS (16 * 13) #define XHCI_MAX_COMMANDS (16 * 1) #define XHCI_MAX_RSEG 1 @@ -496,14 +496,15 @@ struct xhci_softc { uint16_t sc_command_idx; uint16_t sc_imod_default; + /* number of scratch pages */ + uint16_t sc_noscratch; + uint8_t sc_event_ccs; uint8_t sc_command_ccs; /* number of XHCI device slots */ uint8_t sc_noslot; /* number of ports on root HUB */ uint8_t sc_noport; - /* number of scratch pages */ - uint8_t sc_noscratch; /* root HUB device configuration */ uint8_t sc_conf; /* root HUB port event bitmap, max 256 ports */ Modified: head/sys/dev/usb/controller/xhcireg.h ============================================================================== --- head/sys/dev/usb/controller/xhcireg.h Wed Jun 22 07:49:59 2016 (r302075) +++ head/sys/dev/usb/controller/xhcireg.h Wed Jun 22 09:03:55 2016 (r302076) @@ -52,8 +52,8 @@ #define XHCI_HCSPARAMS2 0x08 /* RO structural parameters 2 */ #define XHCI_HCS2_IST(x) ((x) & 0xF) #define XHCI_HCS2_ERST_MAX(x) (((x) >> 4) & 0xF) -#define XHCI_HCS2_SPR(x) (((x) >> 24) & 0x1) -#define XHCI_HCS2_SPB_MAX(x) (((x) >> 27) & 0x7F) +#define XHCI_HCS2_SPR(x) (((x) >> 26) & 0x1) +#define XHCI_HCS2_SPB_MAX(x) ((((x) >> 16) & 0x3E0) | (((x) >> 27) & 0x1F)) #define XHCI_HCSPARAMS3 0x0C /* RO structural parameters 3 */ #define XHCI_HCS3_U1_DEL(x) ((x) & 0xFF) #define XHCI_HCS3_U2_DEL(x) (((x) >> 16) & 0xFFFF) From owner-svn-src-head@freebsd.org Wed Jun 22 10:32:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 286B3B3BA58; Wed, 22 Jun 2016 10:32:35 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id E06FB12DE; Wed, 22 Jun 2016 10:32:34 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id E586D25D37C2; Wed, 22 Jun 2016 10:32:30 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id BA38CD1F7E4; Wed, 22 Jun 2016 10:32:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 8ZJ0xH5vZmmg; Wed, 22 Jun 2016 10:32:28 +0000 (UTC) Received: from nv.sbone.de (nv.sbone.de [IPv6:fde9:577b:c1a9:31::2013:138]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 6821BD1F7E0; Wed, 22 Jun 2016 10:32:28 +0000 (UTC) Date: Wed, 22 Jun 2016 10:32:27 +0000 (UTC) From: "Bjoern A. Zeeb" To: Navdeep Parhar cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302054 - in head/sys: contrib/ipfilter/netinet dev/usb/net kern net netgraph netinet netinet6 netipsec netpfil/ipfw netpfil/pf In-Reply-To: Message-ID: References: <201606211348.u5LDmom9081605@repo.freebsd.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 10:32:35 -0000 On Tue, 21 Jun 2016, Navdeep Parhar wrote: > This causes a panic when a NIC driver module is unloaded from a kernel > without VIMAGE. if_vnet is NULL and if_detach_internal tries to > dereference it. whoops; I'll try this patch in a few minutes but if it works for you let me know and I'll get it in. Index: sys/net/if.c =================================================================== --- sys/net/if.c (revision 302079) +++ sys/net/if.c (working copy) @@ -933,8 +933,12 @@ if_detach_internal(struct ifnet *ifp, int vmove, s struct ifnet *iter; int found = 0, shutdown; +#ifdef VIMAGE shutdown = (ifp->if_vnet->vnet_state > SI_SUB_VNET && ifp->if_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0; +#else + shutdown = 0; +#endif IFNET_WLOCK(); TAILQ_FOREACH(iter, &V_ifnet, if_link) if (iter == ifp) { /bz From owner-svn-src-head@freebsd.org Wed Jun 22 10:38:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBFAAB3BD12; Wed, 22 Jun 2016 10:38:42 +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 8B65B1729; Wed, 22 Jun 2016 10:38:42 +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 u5MAcfTC052897; Wed, 22 Jun 2016 10:38:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5MAcfDY052891; Wed, 22 Jun 2016 10:38:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606221038.u5MAcfDY052891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 22 Jun 2016 10:38:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302080 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 10:38:42 -0000 Author: hselasky Date: Wed Jun 22 10:38:41 2016 New Revision: 302080 URL: https://svnweb.freebsd.org/changeset/base/302080 Log: Implement libusb_hotplug_register_callback() and libusb_hotplug_deregister_callback() for the LibUSB v1.0 API and update the libusb(3) manual page. Approved by: re (kib) Requested by: swills MFC after: 1 week Added: head/lib/libusb/libusb10_hotplug.c (contents, props changed) Modified: head/lib/libusb/Makefile head/lib/libusb/libusb.3 head/lib/libusb/libusb.h head/lib/libusb/libusb10.c head/lib/libusb/libusb10.h Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Wed Jun 22 09:10:52 2016 (r302079) +++ head/lib/libusb/Makefile Wed Jun 22 10:38:41 2016 (r302080) @@ -32,6 +32,7 @@ SRCS+= libusb01.c INCS+= libusb.h SRCS+= libusb10.c SRCS+= libusb10_desc.c +SRCS+= libusb10_hotplug.c SRCS+= libusb10_io.c .if defined(COMPAT_32BIT) @@ -142,6 +143,8 @@ MLINKS += libusb.3 libusb_handle_events_ MLINKS += libusb.3 libusb_get_next_timeout.3 MLINKS += libusb.3 libusb_set_pollfd_notifiers.3 MLINKS += libusb.3 libusb_get_pollfds.3 +MLINKS += libusb.3 libusb_hotplug_register_callback.3 +MLINKS += libusb.3 libusb_hotplug_deregister_callback.3 # LibUSB v0.1 MLINKS += libusb.3 usb_open.3 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Wed Jun 22 09:10:52 2016 (r302079) +++ head/lib/libusb/libusb.3 Wed Jun 22 10:38:41 2016 (r302080) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 17, 2016 +.Dd June 22, 2016 .Dt LIBUSB 3 .Os .Sh NAME @@ -642,6 +642,47 @@ that libusb uses as an event source. Retrive a list of file descriptors that should be polled by your main loop as libusb event sources. Returns a NULL-terminated list on success or NULL on failure. +.Pp +.Ft int +.Fn libusb_hotplug_register_callback "libusb_context *ctx" "libusb_hotplug_event events" "libusb_hotplug_flag flags" "int vendor_id" "int product_id" "int dev_class" "libusb_hotplug_callback_fn cb_fn" "void *user_data" "libusb_hotplug_callback_handle *handle" +This function registers a hotplug filter. +The +.Fa events +argument select which events makes the hotplug filter trigger. +Available event values are LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED and LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT. +One or more events must be specified. +The +.Fa vendor_id , +.Fa product_id +and +.Fa dev_class +arguments can be set to LIBUSB_HOTPLUG_MATCH_ANY to match any value in the USB device descriptor. +Else the specified value is used for matching. +If the +.Fa flags +argument is set to LIBUSB_HOTPLUG_ENUMERATE, all currently attached and matching USB devices will be passed to the hotplug filter, given by the +.Fa cb_fn +argument. +Else the +.Fa flags +argument should be set to LIBUSB_HOTPLUG_NO_FLAGS. +This function returns 0 upon success or a LIBUSB_ERROR code on failure. +.Pp +.Ft int +.Fn libusb_hotplug_callback_fn "libusb_context *ctx" "libusb_device *device" "libusb_hotplug_event event" "void *user_data" +The hotplug filter function. +If this function returns non-zero, the filter is removed. +Else the filter is kept and can receive more events. +The +.Fa user_data +argument is the same as given when the filter was registered. +The +.Fa event +argument can be either of LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED or LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT. +.Pp +.Ft void +.Fn libusb_hotplug_deregister_callback "libusb_context *ctx" "libusb_hotplug_callback_handle handle" +This function unregisters a hotplug filter. .Sh LIBUSB VERSION 0.1 COMPATIBILITY The library is also compliant with LibUSB version 0.1.12. .Pp Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Wed Jun 22 09:10:52 2016 (r302079) +++ head/lib/libusb/libusb.h Wed Jun 22 10:38:41 2016 (r302080) @@ -236,12 +236,25 @@ enum libusb_debug_level { LIBUSB_DEBUG_TRANSFER=2, }; +#define LIBUSB_HOTPLUG_MATCH_ANY -1 + +typedef enum { + LIBUSB_HOTPLUG_NO_FLAGS = 0, + LIBUSB_HOTPLUG_ENUMERATE = 1 << 0, +} libusb_hotplug_flag; + +typedef enum { + LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED = 1, + LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT = 2, +} libusb_hotplug_event; + /* libusb structures */ struct libusb_context; struct libusb_device; struct libusb_transfer; struct libusb_device_handle; +struct libusb_hotplug_callback_handle; struct libusb_pollfd { int fd; @@ -263,6 +276,7 @@ typedef struct libusb_device_handle libu typedef struct libusb_pollfd libusb_pollfd; typedef void (*libusb_pollfd_added_cb) (int fd, short events, void *user_data); typedef void (*libusb_pollfd_removed_cb) (int fd, void *user_data); +typedef struct libusb_hotplug_callback_handle *libusb_hotplug_callback_handle; typedef struct libusb_device_descriptor { uint8_t bLength; @@ -539,6 +553,14 @@ int libusb_interrupt_transfer(libusb_dev uint16_t libusb_cpu_to_le16(uint16_t x); uint16_t libusb_le16_to_cpu(uint16_t x); +/* Hotplug support */ + +typedef int (*libusb_hotplug_callback_fn)(libusb_context *ctx, + libusb_device *device, libusb_hotplug_event event, void *user_data); + +int libusb_hotplug_register_callback(libusb_context *ctx, libusb_hotplug_event events, libusb_hotplug_flag flags, int vendor_id, int product_id, int dev_class, libusb_hotplug_callback_fn cb_fn, void *user_data, libusb_hotplug_callback_handle *handle); +void libusb_hotplug_deregister_callback(libusb_context *ctx, libusb_hotplug_callback_handle handle); + #if 0 { /* indent fix */ #endif Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Wed Jun 22 09:10:52 2016 (r302079) +++ head/lib/libusb/libusb10.c Wed Jun 22 10:38:41 2016 (r302080) @@ -134,24 +134,34 @@ libusb_init(libusb_context **context) } TAILQ_INIT(&ctx->pollfds); TAILQ_INIT(&ctx->tr_done); + TAILQ_INIT(&ctx->hotplug_cbh); + TAILQ_INIT(&ctx->hotplug_devs); if (pthread_mutex_init(&ctx->ctx_lock, NULL) != 0) { free(ctx); return (LIBUSB_ERROR_NO_MEM); } + if (pthread_mutex_init(&ctx->hotplug_lock, NULL) != 0) { + pthread_mutex_destroy(&ctx->ctx_lock); + free(ctx); + return (LIBUSB_ERROR_NO_MEM); + } if (pthread_condattr_init(&attr) != 0) { pthread_mutex_destroy(&ctx->ctx_lock); + pthread_mutex_destroy(&ctx->hotplug_lock); free(ctx); return (LIBUSB_ERROR_NO_MEM); } if (pthread_condattr_setclock(&attr, CLOCK_MONOTONIC) != 0) { pthread_mutex_destroy(&ctx->ctx_lock); + pthread_mutex_destroy(&ctx->hotplug_lock); pthread_condattr_destroy(&attr); free(ctx); return (LIBUSB_ERROR_OTHER); } if (pthread_cond_init(&ctx->ctx_cond, &attr) != 0) { pthread_mutex_destroy(&ctx->ctx_lock); + pthread_mutex_destroy(&ctx->hotplug_lock); pthread_condattr_destroy(&attr); free(ctx); return (LIBUSB_ERROR_NO_MEM); @@ -159,10 +169,12 @@ libusb_init(libusb_context **context) pthread_condattr_destroy(&attr); ctx->ctx_handler = NO_THREAD; + ctx->hotplug_handler = NO_THREAD; ret = pipe(ctx->ctrl_pipe); if (ret < 0) { pthread_mutex_destroy(&ctx->ctx_lock); + pthread_mutex_destroy(&ctx->hotplug_lock); pthread_cond_destroy(&ctx->ctx_cond); free(ctx); return (LIBUSB_ERROR_OTHER); @@ -195,12 +207,27 @@ libusb_exit(libusb_context *ctx) if (ctx == NULL) return; + /* stop hotplug thread, if any */ + + if (ctx->hotplug_handler != NO_THREAD) { + pthread_t td; + void *ptr; + + HOTPLUG_LOCK(ctx); + td = ctx->hotplug_handler; + ctx->hotplug_handler = NO_THREAD; + HOTPLUG_UNLOCK(ctx); + + pthread_join(td, &ptr); + } + /* XXX cleanup devices */ libusb10_remove_pollfd(ctx, &ctx->ctx_poll); close(ctx->ctrl_pipe[0]); close(ctx->ctrl_pipe[1]); pthread_mutex_destroy(&ctx->ctx_lock); + pthread_mutex_destroy(&ctx->hotplug_lock); pthread_cond_destroy(&ctx->ctx_cond); pthread_mutex_lock(&default_context_lock); Modified: head/lib/libusb/libusb10.h ============================================================================== --- head/lib/libusb/libusb10.h Wed Jun 22 09:10:52 2016 (r302079) +++ head/lib/libusb/libusb10.h Wed Jun 22 10:38:41 2016 (r302080) @@ -36,6 +36,8 @@ #define CTX_LOCK(ctx) pthread_mutex_lock(&(ctx)->ctx_lock) #define CTX_TRYLOCK(ctx) pthread_mutex_trylock(&(ctx)->ctx_lock) #define CTX_UNLOCK(ctx) pthread_mutex_unlock(&(ctx)->ctx_lock) +#define HOTPLUG_LOCK(ctx) pthread_mutex_lock(&(ctx)->hotplug_lock) +#define HOTPLUG_UNLOCK(ctx) pthread_mutex_unlock(&(ctx)->hotplug_lock) #define DPRINTF(ctx, dbg, format, args...) do { \ if ((ctx)->debug == dbg) { \ @@ -72,6 +74,16 @@ struct libusb_super_transfer { #define LIBUSB_SUPER_XFER_ST_PEND 1 }; +struct libusb_hotplug_callback_handle { + TAILQ_ENTRY(libusb_hotplug_callback_handle) entry; + int events; + int vendor; + int product; + int devclass; + libusb_hotplug_callback_fn fn; + void *user_data; +}; + struct libusb_context { int debug; int debug_fixed; @@ -80,12 +92,16 @@ struct libusb_context { int tr_done_gen; pthread_mutex_t ctx_lock; + pthread_mutex_t hotplug_lock; pthread_cond_t ctx_cond; + pthread_t hotplug_handler; pthread_t ctx_handler; #define NO_THREAD ((pthread_t)-1) TAILQ_HEAD(, libusb_super_pollfd) pollfds; TAILQ_HEAD(, libusb_super_transfer) tr_done; + TAILQ_HEAD(, libusb_hotplug_callback_handle) hotplug_cbh; + TAILQ_HEAD(, libusb_device) hotplug_devs; struct libusb_super_pollfd ctx_poll; @@ -103,6 +119,8 @@ struct libusb_device { struct libusb_context *ctx; + TAILQ_ENTRY(libusb_device) hotplug_entry; + TAILQ_HEAD(, libusb_super_transfer) tr_head; struct libusb20_device *os_priv; Added: head/lib/libusb/libusb10_hotplug.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libusb/libusb10_hotplug.c Wed Jun 22 10:38:41 2016 (r302080) @@ -0,0 +1,237 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2016 Hans Petter Selasky. 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. + */ + +#ifdef LIBUSB_GLOBAL_INCLUDE_FILE +#include LIBUSB_GLOBAL_INCLUDE_FILE +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#endif + +#define libusb_device_handle libusb20_device + +#include "libusb20.h" +#include "libusb20_desc.h" +#include "libusb20_int.h" +#include "libusb.h" +#include "libusb10.h" + +static int +libusb_hotplug_equal(libusb_device *_adev, libusb_device *_bdev) +{ + struct libusb20_device *adev = _adev->os_priv; + struct libusb20_device *bdev = _bdev->os_priv; + + if (adev->bus_number != bdev->bus_number) + return (0); + if (adev->device_address != bdev->device_address) + return (0); + if (memcmp(&adev->ddesc, &bdev->ddesc, sizeof(adev->ddesc))) + return (0); + if (memcmp(&adev->session_data, &bdev->session_data, sizeof(adev->session_data))) + return (0); + return (1); +} + +static int +libusb_hotplug_filter(libusb_context *ctx, libusb_hotplug_callback_handle pcbh, + libusb_device *dev, libusb_hotplug_event event) +{ + if (!(pcbh->events & event)) + return (0); + if (pcbh->vendor != LIBUSB_HOTPLUG_MATCH_ANY && + pcbh->vendor != libusb20_dev_get_device_desc(dev->os_priv)->idVendor) + return (0); + if (pcbh->product != LIBUSB_HOTPLUG_MATCH_ANY && + pcbh->product != libusb20_dev_get_device_desc(dev->os_priv)->idProduct) + return (0); + if (pcbh->devclass != LIBUSB_HOTPLUG_MATCH_ANY && + pcbh->devclass != libusb20_dev_get_device_desc(dev->os_priv)->bDeviceClass) + return (0); + return (pcbh->fn(ctx, dev, event, pcbh->user_data)); +} + +static void * +libusb_hotplug_scan(void *arg) +{ + TAILQ_HEAD(, libusb_device) hotplug_devs; + libusb_hotplug_callback_handle acbh; + libusb_hotplug_callback_handle bcbh; + libusb_context *ctx = arg; + libusb_device **ppdev; + libusb_device *temp; + libusb_device *adev; + libusb_device *bdev; + unsigned do_loop = 1; + ssize_t count; + ssize_t x; + + while (do_loop) { + usleep(4000000); + + HOTPLUG_LOCK(ctx); + + TAILQ_INIT(&hotplug_devs); + + if (ctx->hotplug_handler != NO_THREAD) { + count = libusb_get_device_list(ctx, &ppdev); + if (count < 0) + continue; + for (x = 0; x != count; x++) { + TAILQ_INSERT_TAIL(&hotplug_devs, ppdev[x], + hotplug_entry); + } + libusb_free_device_list(ppdev, 0); + } else { + do_loop = 0; + } + + /* figure out which devices are gone */ + TAILQ_FOREACH_SAFE(adev, &ctx->hotplug_devs, hotplug_entry, temp) { + TAILQ_FOREACH(bdev, &hotplug_devs, hotplug_entry) { + if (libusb_hotplug_equal(adev, bdev)) + break; + } + if (bdev == NULL) { + TAILQ_REMOVE(&ctx->hotplug_devs, adev, hotplug_entry); + TAILQ_FOREACH_SAFE(acbh, &ctx->hotplug_cbh, entry, bcbh) { + if (libusb_hotplug_filter(ctx, acbh, adev, + LIBUSB_HOTPLUG_EVENT_DEVICE_LEFT) == 0) + continue; + TAILQ_REMOVE(&ctx->hotplug_cbh, acbh, entry); + free(acbh); + } + libusb_unref_device(adev); + } + } + + /* figure out which devices are new */ + TAILQ_FOREACH_SAFE(adev, &hotplug_devs, hotplug_entry, temp) { + TAILQ_FOREACH(bdev, &ctx->hotplug_devs, hotplug_entry) { + if (libusb_hotplug_equal(adev, bdev)) + break; + } + if (bdev == NULL) { + TAILQ_REMOVE(&hotplug_devs, adev, hotplug_entry); + TAILQ_INSERT_TAIL(&ctx->hotplug_devs, adev, hotplug_entry); + TAILQ_FOREACH_SAFE(acbh, &ctx->hotplug_cbh, entry, bcbh) { + if (libusb_hotplug_filter(ctx, acbh, adev, + LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED) == 0) + continue; + TAILQ_REMOVE(&ctx->hotplug_cbh, acbh, entry); + free(acbh); + } + } + } + HOTPLUG_UNLOCK(ctx); + + /* unref remaining devices */ + while ((adev = TAILQ_FIRST(&hotplug_devs)) != NULL) { + TAILQ_REMOVE(&hotplug_devs, adev, hotplug_entry); + libusb_unref_device(adev); + } + } + return (NULL); +} + +int libusb_hotplug_register_callback(libusb_context *ctx, + libusb_hotplug_event events, libusb_hotplug_flag flags, + int vendor_id, int product_id, int dev_class, + libusb_hotplug_callback_fn cb_fn, void *user_data, + libusb_hotplug_callback_handle *phandle) +{ + libusb_hotplug_callback_handle handle; + struct libusb_device *adev; + + ctx = GET_CONTEXT(ctx); + + if (ctx == NULL || cb_fn == NULL || events == 0 || + vendor_id < -1 || vendor_id > 0xffff || + product_id < -1 || product_id > 0xffff || + dev_class < -1 || dev_class > 0xff) + return (LIBUSB_ERROR_INVALID_PARAM); + + handle = malloc(sizeof(*handle)); + if (handle == NULL) + return (LIBUSB_ERROR_NO_MEM); + + HOTPLUG_LOCK(ctx); + if (ctx->hotplug_handler == NO_THREAD) { + if (pthread_create(&ctx->hotplug_handler, NULL, + &libusb_hotplug_scan, ctx) != 0) + ctx->hotplug_handler = NO_THREAD; + } + handle->events = events; + handle->vendor = vendor_id; + handle->product = product_id; + handle->devclass = dev_class; + handle->fn = cb_fn; + handle->user_data = user_data; + + if (flags & LIBUSB_HOTPLUG_ENUMERATE) { + TAILQ_FOREACH(adev, &ctx->hotplug_devs, hotplug_entry) { + if (libusb_hotplug_filter(ctx, handle, adev, + LIBUSB_HOTPLUG_EVENT_DEVICE_ARRIVED) == 0) + continue; + free(handle); + handle = NULL; + break; + } + } + if (handle != NULL) + TAILQ_INSERT_TAIL(&ctx->hotplug_cbh, handle, entry); + HOTPLUG_UNLOCK(ctx); + + if (phandle != NULL) + *phandle = handle; + return (LIBUSB_SUCCESS); +} + +void libusb_hotplug_deregister_callback(libusb_context *ctx, + libusb_hotplug_callback_handle handle) +{ + ctx = GET_CONTEXT(ctx); + + if (ctx == NULL || handle == NULL) + return; + + HOTPLUG_LOCK(ctx); + TAILQ_REMOVE(&ctx->hotplug_cbh, handle, entry); + HOTPLUG_UNLOCK(ctx); + + free(handle); +} From owner-svn-src-head@freebsd.org Wed Jun 22 11:29:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24E49AC598B; Wed, 22 Jun 2016 11:29:23 +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 E9F9E2EE2; Wed, 22 Jun 2016 11:29:22 +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 u5MBTMxS071428; Wed, 22 Jun 2016 11:29:22 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5MBTMun071427; Wed, 22 Jun 2016 11:29:22 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201606221129.u5MBTMun071427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Wed, 22 Jun 2016 11:29:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302081 - 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 11:29:23 -0000 Author: ae Date: Wed Jun 22 11:29:21 2016 New Revision: 302081 URL: https://svnweb.freebsd.org/changeset/base/302081 Log: Fix the NULL pointer dereference for unresolved link layer entries in the netinet6 code. Copy link layer address only when corresponding entry has LLE_VALID flag. PR: 210379 Approved by: re (kib) Modified: head/sys/netinet6/in6.c Modified: head/sys/netinet6/in6.c ============================================================================== --- head/sys/netinet6/in6.c Wed Jun 22 10:38:41 2016 (r302080) +++ head/sys/netinet6/in6.c Wed Jun 22 11:29:21 2016 (r302081) @@ -2322,10 +2322,16 @@ in6_lltable_dump_entry(struct lltable *l sdl = &ndpc.sdl; sdl->sdl_family = AF_LINK; sdl->sdl_len = sizeof(*sdl); - sdl->sdl_alen = ifp->if_addrlen; sdl->sdl_index = ifp->if_index; sdl->sdl_type = ifp->if_type; - bcopy(lle->ll_addr, LLADDR(sdl), ifp->if_addrlen); + if ((lle->la_flags & LLE_VALID) == LLE_VALID) { + sdl->sdl_alen = ifp->if_addrlen; + bcopy(lle->ll_addr, LLADDR(sdl), + ifp->if_addrlen); + } else { + sdl->sdl_alen = 0; + bzero(LLADDR(sdl), ifp->if_addrlen); + } if (lle->la_expire != 0) ndpc.rtm.rtm_rmx.rmx_expire = lle->la_expire + lle->lle_remtime / hz + From owner-svn-src-head@freebsd.org Wed Jun 22 11:45:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02381A7A268; Wed, 22 Jun 2016 11:45:32 +0000 (UTC) (envelope-from bz@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 C34351D28; Wed, 22 Jun 2016 11:45:31 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5MBjU9a078656; Wed, 22 Jun 2016 11:45:30 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5MBjUg1078655; Wed, 22 Jun 2016 11:45:30 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606221145.u5MBjUg1078655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 22 Jun 2016 11:45:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302083 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 11:45:32 -0000 Author: bz Date: Wed Jun 22 11:45:30 2016 New Revision: 302083 URL: https://svnweb.freebsd.org/changeset/base/302083 Log: After r302054 unloading an network interface driver on a kernel without VIMAGE support would dereference a NULL point unconditionally leading to a panic. Wrap the entire VIMAGE related code with #ifdefs rather than just the decision making part to save an extra bit of resources. Reported by: np Sponsored by: The FreeBSD Foundation MFC After: 13 days Approved by: re (marius) Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Jun 22 11:38:26 2016 (r302082) +++ head/sys/net/if.c Wed Jun 22 11:45:30 2016 (r302083) @@ -931,10 +931,13 @@ if_detach_internal(struct ifnet *ifp, in int i; struct domain *dp; struct ifnet *iter; - int found = 0, shutdown; + int found = 0; +#ifdef VIMAGE + int shutdown; shutdown = (ifp->if_vnet->vnet_state > SI_SUB_VNET && ifp->if_vnet->vnet_state < SI_SUB_VNET_DONE) ? 1 : 0; +#endif IFNET_WLOCK(); TAILQ_FOREACH(iter, &V_ifnet, if_link) if (iter == ifp) { @@ -987,6 +990,7 @@ if_detach_internal(struct ifnet *ifp, in if_down(ifp); +#ifdef VIMAGE /* * On VNET shutdown abort here as the stack teardown will do all * the work top-down for us. @@ -1001,6 +1005,7 @@ if_detach_internal(struct ifnet *ifp, in */ goto finish_vnet_shutdown; } +#endif /* * At this point we are not tearing down a VNET and are either @@ -1066,7 +1071,9 @@ if_detach_internal(struct ifnet *ifp, in rt_flushifroutes(ifp); +#ifdef VIMAGE finish_vnet_shutdown: +#endif /* * We cannot hold the lock over dom_ifdetach calls as they might * sleep, for example trying to drain a callout, thus open up the From owner-svn-src-head@freebsd.org Wed Jun 22 12:05:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C5DDA7AF21; Wed, 22 Jun 2016 12:05:09 +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 4DBEA2874; Wed, 22 Jun 2016 12:05:09 +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 u5MC58cd086058; Wed, 22 Jun 2016 12:05:08 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5MC58Dc086057; Wed, 22 Jun 2016 12:05:08 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201606221205.u5MC58Dc086057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 22 Jun 2016 12:05:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302084 - 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 12:05:09 -0000 Author: andrew Date: Wed Jun 22 12:05:08 2016 New Revision: 302084 URL: https://svnweb.freebsd.org/changeset/base/302084 Log: Fix a race when the hardware has raised an exception with an unknown or uncategorised reason. We need to read the fault address register before enabling interrupts as the interrupt handler may cause this register to change. Approved by: re (marius, kib) Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/trap.c Modified: head/sys/arm64/arm64/trap.c ============================================================================== --- head/sys/arm64/arm64/trap.c Wed Jun 22 11:45:30 2016 (r302083) +++ head/sys/arm64/arm64/trap.c Wed Jun 22 12:05:08 2016 (r302084) @@ -313,13 +313,11 @@ do_el1h_sync(struct trapframe *frame) * instruction results in an exception with an unknown reason. */ static void -el0_excp_unknown(struct trapframe *frame) +el0_excp_unknown(struct trapframe *frame, uint64_t far) { struct thread *td; - uint64_t far; td = curthread; - far = READ_SPECIALREG(far_el1); call_trapsignal(td, SIGILL, ILL_ILLTRP, (void *)far); userret(td, frame); } @@ -342,6 +340,7 @@ do_el0_sync(struct trapframe *frame) esr = READ_SPECIALREG(esr_el1); exception = ESR_ELx_EXCEPTION(esr); switch (exception) { + case EXCP_UNKNOWN: case EXCP_INSN_ABORT_L: case EXCP_DATA_ABORT_L: case EXCP_DATA_ABORT: @@ -371,7 +370,7 @@ do_el0_sync(struct trapframe *frame) data_abort(frame, esr, far, 1); break; case EXCP_UNKNOWN: - el0_excp_unknown(frame); + el0_excp_unknown(frame, far); break; case EXCP_SP_ALIGN: call_trapsignal(td, SIGBUS, BUS_ADRALN, (void *)frame->tf_sp); From owner-svn-src-head@freebsd.org Wed Jun 22 12:53:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E85E8AC5BF0; Wed, 22 Jun 2016 12:53:11 +0000 (UTC) (envelope-from bz@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 B9906242B; Wed, 22 Jun 2016 12:53:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5MCrAGX004349; Wed, 22 Jun 2016 12:53:10 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5MCrAbx004348; Wed, 22 Jun 2016 12:53:10 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606221253.u5MCrAbx004348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 22 Jun 2016 12:53:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302086 - head/sys/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 12:53:12 -0000 Author: bz Date: Wed Jun 22 12:53:10 2016 New Revision: 302086 URL: https://svnweb.freebsd.org/changeset/base/302086 Log: Add more fields to if_debug.c for ddb(4) 'show ifnet'; resort some fields to match the order in the struct. Especially needed if_pf_kif to do pf(4) VNET debugging. Approved by: re (marius) Obtained from: projects/vnet MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/net/if_debug.c Modified: head/sys/net/if_debug.c ============================================================================== --- head/sys/net/if_debug.c Wed Jun 22 12:12:13 2016 (r302085) +++ head/sys/net/if_debug.c Wed Jun 22 12:53:10 2016 (r302086) @@ -65,6 +65,10 @@ if_show_ifnet(struct ifnet *ifp) IF_DB_PRINTF("%d", if_index_reserved); IF_DB_PRINTF("%p", if_softc); IF_DB_PRINTF("%p", if_l2com); + IF_DB_PRINTF("%p", if_llsoftc); + IF_DB_PRINTF("%d", if_amcount); + IF_DB_PRINTF("%p", if_addr); + IF_DB_PRINTF("%p", if_broadcastaddr); IF_DB_PRINTF("%p", if_afdata); IF_DB_PRINTF("%d", if_afdata_initialized); IF_DB_PRINTF("%u", if_fib); @@ -72,10 +76,13 @@ if_show_ifnet(struct ifnet *ifp) IF_DB_PRINTF("%p", if_home_vnet); IF_DB_PRINTF("%p", if_vlantrunk); IF_DB_PRINTF("%p", if_bpf); - IF_DB_PRINTF("%p", if_addr); - IF_DB_PRINTF("%p", if_llsoftc); - IF_DB_PRINTF("%p", if_label); IF_DB_PRINTF("%u", if_pcount); + IF_DB_PRINTF("%p", if_bridge); + IF_DB_PRINTF("%p", if_lagg); + IF_DB_PRINTF("%p", if_pf_kif); + IF_DB_PRINTF("%p", if_carp); + IF_DB_PRINTF("%p", if_label); + IF_DB_PRINTF("%p", if_netmap); IF_DB_PRINTF("0x%08x", if_flags); IF_DB_PRINTF("0x%08x", if_drv_flags); IF_DB_PRINTF("0x%08x", if_capabilities); From owner-svn-src-head@freebsd.org Wed Jun 22 14:39:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C7DB69F78; Wed, 22 Jun 2016 14:39:15 +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 D3D772640; Wed, 22 Jun 2016 14:39:14 +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 u5MEdE0M042150; Wed, 22 Jun 2016 14:39:14 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5MEdE3o042149; Wed, 22 Jun 2016 14:39:14 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201606221439.u5MEdE3o042149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Wed, 22 Jun 2016 14:39:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302087 - head/sys/geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 14:39:15 -0000 Author: ken Date: Wed Jun 22 14:39:13 2016 New Revision: 302087 URL: https://svnweb.freebsd.org/changeset/base/302087 Log: Fix a bug that caused da(4) peripheral drivers to not fully go away after the underlying device went away. The problem was that callers who queue the GEOM resize provider event didn't check to make sure that the provider had not been withered. For the other equivalent case, g_new_provider_event(), the code checks to see whether the provider has been withered before queueing a g_new_provider_event() to the event thread. In some cases, a resize provider event would come through after the provider had been withered and all of the existing consumers had been orphaned. When the resize event triggered a taste of the provider, that would attach a new consumer to the now withered provider. The wither washer (g_wither_washer() would never be able to completely tear down the GEOM because of the consumers that were hanging around. The solution was to check the G_PF_WITHER provider flag before queueing the g_resize_provider_event(), and add an assert to g_resize_provider_event() to insure that it isn't called on a withered provider. sys/geom/geom_subr.c: In g_resize_provider(), don't try to continue if the G_PF_WITHER flag is set. In g_resize_provider_event(), add an assert that the G_PF_WITHER flag is not set. In g_access(), if a provider has an error, print out the name of the provider with the error. Sponsored by: Spectra Logic Approved by: re (marius) MFC after: 3 days Modified: head/sys/geom/geom_subr.c Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Wed Jun 22 12:53:10 2016 (r302086) +++ head/sys/geom/geom_subr.c Wed Jun 22 14:39:13 2016 (r302087) @@ -620,6 +620,8 @@ g_resize_provider_event(void *arg, int f g_free(hh); G_VALID_PROVIDER(pp); + KASSERT(!(pp->flags & G_PF_WITHER), + ("g_resize_provider_event but withered")); g_trace(G_T_TOPOLOGY, "g_resize_provider_event(%p)", pp); LIST_FOREACH_SAFE(cp, &pp->consumers, consumers, cp2) { @@ -662,6 +664,8 @@ g_resize_provider(struct g_provider *pp, struct g_hh00 *hh; G_VALID_PROVIDER(pp); + if (pp->flags & G_PF_WITHER) + return; if (size == pp->mediasize) return; @@ -909,8 +913,11 @@ g_access(struct g_consumer *cp, int dcr, else if (dcw > 0 && pe > 0) return (EPERM); /* If we try to open more but provider is error'ed: fail */ - else if ((dcr > 0 || dcw > 0 || dce > 0) && pp->error != 0) + else if ((dcr > 0 || dcw > 0 || dce > 0) && pp->error != 0) { + printf("%s(%d): provider %s has error\n", + __func__, __LINE__, pp->name); return (pp->error); + } /* Ok then... */ From owner-svn-src-head@freebsd.org Wed Jun 22 15:51:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81C5CAC532E; Wed, 22 Jun 2016 15:51:40 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id 7428A1944; Wed, 22 Jun 2016 15:51:39 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 7C4E617E46; Wed, 22 Jun 2016 08:46:13 -0700 (PDT) Date: Wed, 22 Jun 2016 08:46:13 -0700 From: hiren panchasara To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302081 - head/sys/netinet6 Message-ID: <20160622154613.GR60812@strugglingcoder.info> References: <201606221129.u5MBTMun071427@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3ig5MTpp3LwprTX9" Content-Disposition: inline In-Reply-To: <201606221129.u5MBTMun071427@repo.freebsd.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 15:51:40 -0000 --3ig5MTpp3LwprTX9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 06/22/16 at 11:29P, Andrey V. Elsukov wrote: > Author: ae > Date: Wed Jun 22 11:29:21 2016 > New Revision: 302081 > URL: https://svnweb.freebsd.org/changeset/base/302081 >=20 > Log: > Fix the NULL pointer dereference for unresolved link layer entries in > the netinet6 code. Copy link layer address only when corresponding entry > has LLE_VALID flag. > =20 > PR: 210379 > Approved by: re (kib) >=20 > Modified: > head/sys/netinet6/in6.c Cursory look tells me that this bug is also present in 10. Is that true? If so, is it possible for you to mfc this? Cheers, Hiren --3ig5MTpp3LwprTX9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXarLBXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lx9MIAKa0ydc/njGrR5i61FZ/eHMW Q+hRfF9Wx+VN0mkscN8WUycSYdSLoIH49IeXEbr/aV10DJNqXvA+LPhhPJnHLeoY 1YRShL83NiKXYDSScDddtEe3agXnDNltnM4GNCpWfGTnLZioxWCtHQN+mAqHPrHn XeiYRhw6luoJ7pkeX+g2/vBYNBPrKXRoK+alq6wL7NpEIIGrJ8qHtSUNEfLEOzs2 kGyBjl2g5Kfhk1xBGPLtyNxRdUK2btErXU0+jqnJlWqta598QZAuPDdJUzA6mIY6 y8S2rPFjg6f6b11RN+66sCAR+pPC7dejQG9PVfFGF9YWZhmHHCO+Jr4UySpIywQ= =zgcR -----END PGP SIGNATURE----- --3ig5MTpp3LwprTX9-- From owner-svn-src-head@freebsd.org Wed Jun 22 19:07:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 56A75B721BD; Wed, 22 Jun 2016 19:07:42 +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 27CF32409; Wed, 22 Jun 2016 19:07: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 u5MJ7fw1044888; Wed, 22 Jun 2016 19:07:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5MJ7fJC044887; Wed, 22 Jun 2016 19:07:41 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606221907.u5MJ7fJC044887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 22 Jun 2016 19:07:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302088 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 19:07:42 -0000 Author: bdrewery Date: Wed Jun 22 19:07:41 2016 New Revision: 302088 URL: https://svnweb.freebsd.org/changeset/base/302088 Log: WITH_META_MODE: Whitelist 'make kernel-toolchain' Approved by: re (blanket, META_MODE) Sponsored by: EMC / Isilon Storage Division Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed Jun 22 14:39:13 2016 (r302087) +++ head/Makefile Wed Jun 22 19:07:41 2016 (r302088) @@ -150,9 +150,9 @@ TGTS+= ${BITGTS} # the ones that benefit from it. META_TGT_WHITELIST+= \ _* build32 buildfiles buildincludes buildkernel buildsoft \ - buildworld everything kernel-toolchains kernel kernels libraries \ - native-xtools showconfig tinderbox toolchain toolchains universe \ - world worlds xdev xdev-build + buildworld everything kernel-toolchain kernel-toolchains kernel \ + kernels libraries native-xtools showconfig tinderbox toolchain \ + toolchains universe world worlds xdev xdev-build .ORDER: buildworld installworld .ORDER: buildworld distributeworld From owner-svn-src-head@freebsd.org Wed Jun 22 19:09:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B8F8B722B2 for ; Wed, 22 Jun 2016 19:09:54 +0000 (UTC) (envelope-from webuser@d01.trendelier.com) Received: from d01.trendelier.com (d01.trendelier.com [45.55.194.92]) by mx1.freebsd.org (Postfix) with ESMTP id 7527F2596 for ; Wed, 22 Jun 2016 19:09:54 +0000 (UTC) (envelope-from webuser@d01.trendelier.com) Received: by d01.trendelier.com (Postfix, from userid 502) id 4A16440CD6; Wed, 22 Jun 2016 15:01:59 -0400 (EDT) To: svn-src-head@freebsd.org Subject: Play Volleyball for Free (PROMO: MFBHCF) X-PHP-Originating-Script: 502:post.php(6) : regexp code(1) : eval()'d code(17) : eval()'d code Date: Wed, 22 Jun 2016 15:01:59 -0400 From: "Verise Promocodes" Reply-To: "Verise Promocodes" Message-ID: X-Priority: 4 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 19:09:54 -0000 Congratulations! Invite your friends and play volleyball at your local club for free. The offer is valid for a limited time only. Please, see your coupon [MFBHCF] attached. With thanks and appreciation, Andy Bowers, Administrative Services Officer Verise Promocodes 177 Laurel Drive 82722 Port St. Lucie, Florida From owner-svn-src-head@freebsd.org Wed Jun 22 20:15:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F583AC5322; Wed, 22 Jun 2016 20:15:39 +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 DF4F42672; Wed, 22 Jun 2016 20:15:38 +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 u5MKFcBj071036; Wed, 22 Jun 2016 20:15:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5MKFbiA071033; Wed, 22 Jun 2016 20:15:37 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606222015.u5MKFbiA071033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 22 Jun 2016 20:15:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302089 - in head/sys: sys vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 20:15:39 -0000 Author: kib Date: Wed Jun 22 20:15:37 2016 New Revision: 302089 URL: https://svnweb.freebsd.org/changeset/base/302089 Log: Fix a LOR between vnode locks and allproc_lock. There is an order between covered vnode lock and allproc_lock, which is established by calling mountcheckdirs() while owning the covered vnode lock. mountcheckdirs() iterates over the processes, protected by allproc_lock. This order is needed and seems to be not avoidable. On the other hand, various VM daemons also need to iterate over all processes, and they lock and unlock user maps. Since unlock of the user map may trigger processing of the deferred map entries, it causes vnode locking to occur. Or, when vmspace is freed, dropping references on the vnode-backed object also lock vnodes. We get reverted order comparing with the mount/unmount order. For VM daemons, there is no need to own allproc_lock while we operate on vmspaces. If the process is held, it serves as the marker for allproc list, which allows to continue the iteration. Add _PHOLD_LITE() macro, similar to _PHOLD(), but not causing swap-in of the kernel stacks. It is used instead of _PHOLD() in vm code, since e.g. calling faultin() in OOM conditions only exaggerates the problem. Modernize comment describing PHOLD. Reported by: lists@yamagi.org Tested by: pho (previous version) Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 3 week Approved by: re (gjb) Differential revision: https://reviews.freebsd.org/D6679 Modified: head/sys/sys/proc.h head/sys/vm/vm_glue.c head/sys/vm/vm_pageout.c Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Wed Jun 22 19:07:41 2016 (r302088) +++ head/sys/sys/proc.h Wed Jun 22 20:15:37 2016 (r302089) @@ -827,7 +827,20 @@ extern pid_t pid_max; #define SESS_LOCKED(s) mtx_owned(&(s)->s_mtx) #define SESS_LOCK_ASSERT(s, type) mtx_assert(&(s)->s_mtx, (type)) -/* Hold process U-area in memory, normally for ptrace/procfs work. */ +/* + * Non-zero p_lock ensures that: + * - exit1() is not performed until p_lock reaches zero; + * - the process' threads stack are not swapped out if they are currently + * not (P_INMEM). + * + * PHOLD() asserts that the process (except the current process) is + * not exiting, increments p_lock and swaps threads stacks into memory, + * if needed. + * _PHOLD() is same as PHOLD(), it takes the process locked. + * _PHOLD_LITE() also takes the process locked, but comparing with + * _PHOLD(), it only guarantees that exit1() is not executed, + * faultin() is not called. + */ #define PHOLD(p) do { \ PROC_LOCK(p); \ _PHOLD(p); \ @@ -841,6 +854,12 @@ extern pid_t pid_max; if (((p)->p_flag & P_INMEM) == 0) \ faultin((p)); \ } while (0) +#define _PHOLD_LITE(p) do { \ + PROC_LOCK_ASSERT((p), MA_OWNED); \ + KASSERT(!((p)->p_flag & P_WEXIT) || (p) == curproc, \ + ("PHOLD of exiting process %p", p)); \ + (p)->p_lock++; \ +} while (0) #define PROC_ASSERT_HELD(p) do { \ KASSERT((p)->p_lock > 0, ("process %p not held", p)); \ } while (0) Modified: head/sys/vm/vm_glue.c ============================================================================== --- head/sys/vm/vm_glue.c Wed Jun 22 19:07:41 2016 (r302088) +++ head/sys/vm/vm_glue.c Wed Jun 22 20:15:37 2016 (r302089) @@ -863,22 +863,32 @@ retry: struct vmspace *vm; int minslptime = 100000; int slptime; - + + PROC_LOCK(p); /* * Watch out for a process in * creation. It may have no * address space or lock yet. */ - if (p->p_state == PRS_NEW) + if (p->p_state == PRS_NEW) { + PROC_UNLOCK(p); continue; + } /* * An aio daemon switches its * address space while running. * Perform a quick check whether * a process has P_SYSTEM. + * Filter out exiting processes. */ - if ((p->p_flag & P_SYSTEM) != 0) + if ((p->p_flag & (P_SYSTEM | P_WEXIT)) != 0) { + PROC_UNLOCK(p); continue; + } + _PHOLD_LITE(p); + PROC_UNLOCK(p); + sx_sunlock(&allproc_lock); + /* * Do not swapout a process that * is waiting for VM data @@ -893,16 +903,15 @@ retry: */ vm = vmspace_acquire_ref(p); if (vm == NULL) - continue; + goto nextproc2; if (!vm_map_trylock(&vm->vm_map)) goto nextproc1; PROC_LOCK(p); - if (p->p_lock != 0 || - (p->p_flag & (P_STOPPED_SINGLE|P_TRACED|P_SYSTEM|P_WEXIT) - ) != 0) { + if (p->p_lock != 1 || (p->p_flag & (P_STOPPED_SINGLE | + P_TRACED | P_SYSTEM)) != 0) goto nextproc; - } + /* * only aiod changes vmspace, however it will be * skipped because of the if statement above checking @@ -977,12 +986,12 @@ retry: if ((action & VM_SWAP_NORMAL) || ((action & VM_SWAP_IDLE) && (minslptime > swap_idle_threshold2))) { + _PRELE(p); if (swapout(p) == 0) didswap++; PROC_UNLOCK(p); vm_map_unlock(&vm->vm_map); vmspace_free(vm); - sx_sunlock(&allproc_lock); goto retry; } } @@ -991,7 +1000,9 @@ nextproc: vm_map_unlock(&vm->vm_map); nextproc1: vmspace_free(vm); - continue; +nextproc2: + sx_slock(&allproc_lock); + PRELE(p); } sx_sunlock(&allproc_lock); /* Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Wed Jun 22 19:07:41 2016 (r302088) +++ head/sys/vm/vm_pageout.c Wed Jun 22 20:15:37 2016 (r302089) @@ -1485,19 +1485,21 @@ vm_pageout_oom(int shortage) PROC_UNLOCK(p); continue; } - _PHOLD(p); + _PHOLD_LITE(p); + PROC_UNLOCK(p); + sx_sunlock(&allproc_lock); if (!vm_map_trylock_read(&vm->vm_map)) { - _PRELE(p); - PROC_UNLOCK(p); vmspace_free(vm); + sx_slock(&allproc_lock); + PRELE(p); continue; } - PROC_UNLOCK(p); size = vmspace_swap_count(vm); if (shortage == VM_OOM_MEM) size += vm_pageout_oom_pagecount(vm); vm_map_unlock_read(&vm->vm_map); vmspace_free(vm); + sx_slock(&allproc_lock); /* * If this process is bigger than the biggest one, @@ -1812,9 +1814,13 @@ again: if ((p->p_flag & P_INMEM) == 0) limit = 0; /* XXX */ vm = vmspace_acquire_ref(p); + _PHOLD_LITE(p); PROC_UNLOCK(p); - if (vm == NULL) + if (vm == NULL) { + PRELE(p); continue; + } + sx_sunlock(&allproc_lock); size = vmspace_resident_count(vm); if (size >= limit) { @@ -1859,6 +1865,8 @@ again: } #endif vmspace_free(vm); + sx_slock(&allproc_lock); + PRELE(p); } sx_sunlock(&allproc_lock); if (tryagain != 0 && attempts <= 10) From owner-svn-src-head@freebsd.org Wed Jun 22 20:31:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4AF9AAC5835; Wed, 22 Jun 2016 20:31:51 +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 14D7711F8; Wed, 22 Jun 2016 20:31:51 +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 u5MKVotI077834; Wed, 22 Jun 2016 20:31:50 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5MKVo2r077832; Wed, 22 Jun 2016 20:31:50 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606222031.u5MKVo2r077832@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 22 Jun 2016 20:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302090 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 20:31:51 -0000 Author: bdrewery Date: Wed Jun 22 20:31:49 2016 New Revision: 302090 URL: https://svnweb.freebsd.org/changeset/base/302090 Log: Add AFLAGS.IMPSRC and document A[C]FLAGS Approved by: re (gjb) Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/bsd.README head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.README ============================================================================== --- head/share/mk/bsd.README Wed Jun 22 20:15:37 2016 (r302089) +++ head/share/mk/bsd.README Wed Jun 22 20:31:49 2016 (r302090) @@ -120,6 +120,8 @@ object. The following variables are common: +AFLAGS.${SRC} + Flags dependent on source file name. ACFLAGS.${SRC} Flags dependent on source file name. CFLAGS.${SRC} @@ -255,6 +257,11 @@ It has seven targets: It sets/uses the following variables: +AFLAGS Flags to the assembler when assembling .s files. + +ACFLAGS Flags to the compiler when preprocessing and + assembling .S files. + BINGRP Binary group. BINOWN Binary owner. Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Wed Jun 22 20:15:37 2016 (r302089) +++ head/share/mk/bsd.sys.mk Wed Jun 22 20:31:49 2016 (r302090) @@ -174,6 +174,7 @@ CFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} CFLAGS+= ${CFLAGS.${COMPILER_TYPE}} CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}} +AFLAGS+= ${AFLAGS.${.IMPSRC:T}} ACFLAGS+= ${ACFLAGS.${.IMPSRC:T}} CFLAGS+= ${CFLAGS.${.IMPSRC:T}} CXXFLAGS+= ${CXXFLAGS.${.IMPSRC:T}} From owner-svn-src-head@freebsd.org Wed Jun 22 21:00:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B1EDAC5EF1; Wed, 22 Jun 2016 21:00:30 +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 EE7E92178; Wed, 22 Jun 2016 21:00:29 +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 u5ML0T91086310; Wed, 22 Jun 2016 21:00:29 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ML0TRd086309; Wed, 22 Jun 2016 21:00:29 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606222100.u5ML0TRd086309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 22 Jun 2016 21:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302091 - head/sys/geom/mirror X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 21:00:30 -0000 Author: markj Date: Wed Jun 22 21:00:28 2016 New Revision: 302091 URL: https://svnweb.freebsd.org/changeset/base/302091 Log: Do not complete pending gmirror BIOs when tearing down the provider. This will result in lock recursion and is more generally incorrect since the completion handlers will just reinsert the BIOs into the queue we're trying to drain. Reviewed by: imp, ngie Approved by: re (gjb) MFC after: 3 weeks Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6908 Modified: head/sys/geom/mirror/g_mirror.c Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Jun 22 20:31:49 2016 (r302090) +++ head/sys/geom/mirror/g_mirror.c Wed Jun 22 21:00:28 2016 (r302091) @@ -2121,8 +2121,21 @@ g_mirror_destroy_provider(struct g_mirro g_topology_lock(); g_error_provider(sc->sc_provider, ENXIO); mtx_lock(&sc->sc_queue_mtx); - while ((bp = bioq_takefirst(&sc->sc_queue)) != NULL) - g_io_deliver(bp, ENXIO); + while ((bp = bioq_takefirst(&sc->sc_queue)) != NULL) { + /* + * Abort any pending I/O that wasn't generated by us. + * Synchronization requests and requests destined for individual + * mirror components can be destroyed immediately. + */ + if (bp->bio_to == sc->sc_provider && + bp->bio_from->geom != sc->sc_sync.ds_geom) { + g_io_deliver(bp, ENXIO); + } else { + if ((bp->bio_cflags & G_MIRROR_BIO_FLAG_SYNC) != 0) + free(bp->bio_data, M_MIRROR); + g_destroy_bio(bp); + } + } mtx_unlock(&sc->sc_queue_mtx); G_MIRROR_DEBUG(0, "Device %s: provider %s destroyed.", sc->sc_name, sc->sc_provider->name); From owner-svn-src-head@freebsd.org Wed Jun 22 21:11:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BA3CB722DF; Wed, 22 Jun 2016 21:11:29 +0000 (UTC) (envelope-from brooks@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 5A53528EE; Wed, 22 Jun 2016 21:11:29 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5MLBSAC090839; Wed, 22 Jun 2016 21:11:28 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5MLBRHn090827; Wed, 22 Jun 2016 21:11:27 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201606222111.u5MLBRHn090827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 22 Jun 2016 21:11:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302092 - in head/lib/libc: aarch64/sys amd64/sys arm/sys i386/sys mips/sys powerpc/sys powerpc64/sys riscv/sys sparc64/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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 21:11:29 -0000 Author: brooks Date: Wed Jun 22 21:11:27 2016 New Revision: 302092 URL: https://svnweb.freebsd.org/changeset/base/302092 Log: Replace use of the pipe(2) system call with pipe2(2) with a zero flags value. This eliminates the need for machine dependant assembly wrappers for pipe(2). It also make passing an invalid address to pipe(2) return EFAULT rather than triggering a segfault. Document this behavior (which was already true for pipe2(2), but undocumented). Reviewed by: andrew Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D6815 Added: head/lib/libc/sys/pipe.c (contents, props changed) Deleted: head/lib/libc/aarch64/sys/pipe.S head/lib/libc/amd64/sys/pipe.S head/lib/libc/arm/sys/pipe.S head/lib/libc/i386/sys/pipe.S head/lib/libc/mips/sys/pipe.S head/lib/libc/powerpc/sys/pipe.S head/lib/libc/powerpc64/sys/pipe.S head/lib/libc/riscv/sys/pipe.S head/lib/libc/sparc64/sys/pipe.S Modified: head/lib/libc/aarch64/sys/Makefile.inc head/lib/libc/amd64/sys/Makefile.inc head/lib/libc/arm/sys/Makefile.inc head/lib/libc/i386/sys/Makefile.inc head/lib/libc/mips/sys/Makefile.inc head/lib/libc/powerpc/sys/Makefile.inc head/lib/libc/powerpc64/sys/Makefile.inc head/lib/libc/riscv/sys/Makefile.inc head/lib/libc/sparc64/sys/Makefile.inc head/lib/libc/sys/Makefile.inc head/lib/libc/sys/pipe.2 Modified: head/lib/libc/aarch64/sys/Makefile.inc ============================================================================== --- head/lib/libc/aarch64/sys/Makefile.inc Wed Jun 22 21:00:28 2016 (r302091) +++ head/lib/libc/aarch64/sys/Makefile.inc Wed Jun 22 21:11:27 2016 (r302092) @@ -6,7 +6,6 @@ SRCS+= __vdso_gettc.c #MDASM= ptrace.S MDASM= cerror.S \ - pipe.S \ shmat.S \ sigreturn.S \ syscall.S \ Modified: head/lib/libc/amd64/sys/Makefile.inc ============================================================================== --- head/lib/libc/amd64/sys/Makefile.inc Wed Jun 22 21:00:28 2016 (r302091) +++ head/lib/libc/amd64/sys/Makefile.inc Wed Jun 22 21:11:27 2016 (r302092) @@ -4,7 +4,7 @@ SRCS+= amd64_get_fsbase.c amd64_get_gsbase.c amd64_set_fsbase.c \ amd64_set_gsbase.c __vdso_gettc.c -MDASM= vfork.S brk.S cerror.S exect.S getcontext.S pipe.S ptrace.S \ +MDASM= vfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \ sbrk.S setlogin.S sigreturn.S # Don't generate default code for these syscalls: Modified: head/lib/libc/arm/sys/Makefile.inc ============================================================================== --- head/lib/libc/arm/sys/Makefile.inc Wed Jun 22 21:00:28 2016 (r302091) +++ head/lib/libc/arm/sys/Makefile.inc Wed Jun 22 21:11:27 2016 (r302092) @@ -2,7 +2,7 @@ SRCS+= __vdso_gettc.c -MDASM= Ovfork.S brk.S cerror.S pipe.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S +MDASM= Ovfork.S brk.S cerror.S ptrace.S sbrk.S shmat.S sigreturn.S syscall.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o Modified: head/lib/libc/i386/sys/Makefile.inc ============================================================================== --- head/lib/libc/i386/sys/Makefile.inc Wed Jun 22 21:00:28 2016 (r302091) +++ head/lib/libc/i386/sys/Makefile.inc Wed Jun 22 21:11:27 2016 (r302092) @@ -8,7 +8,7 @@ SRCS+= i386_get_fsbase.c i386_get_gsbase i386_set_fsbase.c i386_set_gsbase.c i386_set_ioperm.c i386_set_ldt.c \ __vdso_gettc.c -MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S pipe.S ptrace.S \ +MDASM= Ovfork.S brk.S cerror.S exect.S getcontext.S ptrace.S \ sbrk.S setlogin.S sigreturn.S syscall.S # Don't generate default code for these syscalls: Modified: head/lib/libc/mips/sys/Makefile.inc ============================================================================== --- head/lib/libc/mips/sys/Makefile.inc Wed Jun 22 21:00:28 2016 (r302091) +++ head/lib/libc/mips/sys/Makefile.inc Wed Jun 22 21:11:27 2016 (r302092) @@ -3,7 +3,7 @@ SRCS+= trivial-vdso_tc.c MDASM= Ovfork.S brk.S cerror.S exect.S \ - pipe.S ptrace.S sbrk.S syscall.S + ptrace.S sbrk.S syscall.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o vfork.o yield.o Modified: head/lib/libc/powerpc/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc/sys/Makefile.inc Wed Jun 22 21:00:28 2016 (r302091) +++ head/lib/libc/powerpc/sys/Makefile.inc Wed Jun 22 21:11:27 2016 (r302092) @@ -1,6 +1,6 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o Modified: head/lib/libc/powerpc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/powerpc64/sys/Makefile.inc Wed Jun 22 21:00:28 2016 (r302091) +++ head/lib/libc/powerpc64/sys/Makefile.inc Wed Jun 22 21:11:27 2016 (r302092) @@ -1,6 +1,6 @@ # $FreeBSD$ -MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S +MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o Modified: head/lib/libc/riscv/sys/Makefile.inc ============================================================================== --- head/lib/libc/riscv/sys/Makefile.inc Wed Jun 22 21:00:28 2016 (r302091) +++ head/lib/libc/riscv/sys/Makefile.inc Wed Jun 22 21:11:27 2016 (r302092) @@ -4,7 +4,6 @@ SRCS+= trivial-vdso_tc.c #MDASM= ptrace.S MDASM= cerror.S \ - pipe.S \ shmat.S \ sigreturn.S \ syscall.S \ Modified: head/lib/libc/sparc64/sys/Makefile.inc ============================================================================== --- head/lib/libc/sparc64/sys/Makefile.inc Wed Jun 22 21:00:28 2016 (r302091) +++ head/lib/libc/sparc64/sys/Makefile.inc Wed Jun 22 21:11:27 2016 (r302092) @@ -12,7 +12,7 @@ SRCS+= __sparc_sigtramp_setup.c \ CFLAGS+= -I${LIBC_SRCTOP}/sparc64/fpu -MDASM+= brk.S cerror.S exect.S pipe.S ptrace.S sbrk.S setlogin.S sigaction1.S +MDASM+= brk.S cerror.S exect.S ptrace.S sbrk.S setlogin.S sigaction1.S # Don't generate default code for these syscalls: NOASM= break.o exit.o getlogin.o openbsd_poll.o sstk.o yield.o Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Wed Jun 22 21:00:28 2016 (r302091) +++ head/lib/libc/sys/Makefile.inc Wed Jun 22 21:11:27 2016 (r302092) @@ -28,6 +28,8 @@ SRCS+= futimens.c utimensat.c NOASM+= futimens.o utimensat.o PSEUDO+= _futimens.o _utimensat.o +SRCS+= pipe.c + INTERPOSED = \ accept \ accept4 \ Modified: head/lib/libc/sys/pipe.2 ============================================================================== --- head/lib/libc/sys/pipe.2 Wed Jun 22 21:00:28 2016 (r302091) +++ head/lib/libc/sys/pipe.2 Wed Jun 22 21:11:27 2016 (r302092) @@ -28,7 +28,7 @@ .\" @(#)pipe.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd May 1, 2013 +.Dd June 22, 2016 .Dt PIPE 2 .Os .Sh NAME @@ -118,6 +118,9 @@ and .Fn pipe2 system calls will fail if: .Bl -tag -width Er +.It Bq Er EFAULT +.Ar fildes +argument points to an invalid memory location. .It Bq Er EMFILE Too many descriptors are active. .It Bq Er ENFILE Added: head/lib/libc/sys/pipe.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/sys/pipe.c Wed Jun 22 21:11:27 2016 (r302092) @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2016 SRI International + * All rights reserved. + * + * This software was 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. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include + +__weak_reference(__sys_pipe, pipe); +__weak_reference(__sys_pipe, _pipe); + +extern int __sys_pipe2(int fildes[2], int flags); + +int +__sys_pipe(int fildes[2]) +{ + + return (__sys_pipe2(fildes, 0)); +} From owner-svn-src-head@freebsd.org Wed Jun 22 21:12:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 270F6B724BB; Wed, 22 Jun 2016 21:12:55 +0000 (UTC) (envelope-from brooks@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 021522CDC; Wed, 22 Jun 2016 21:12:54 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5MLCs87093490; Wed, 22 Jun 2016 21:12:54 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5MLCse9093489; Wed, 22 Jun 2016 21:12:54 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201606222112.u5MLCse9093489@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 22 Jun 2016 21:12:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302093 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 21:12:55 -0000 Author: brooks Date: Wed Jun 22 21:12:53 2016 New Revision: 302093 URL: https://svnweb.freebsd.org/changeset/base/302093 Log: Add support for COMPAT10 keywords in syscalls.master. Approved by: re (gjb) Sponsored by: DARPA, AFRL Modified: head/sys/kern/makesyscalls.sh Modified: head/sys/kern/makesyscalls.sh ============================================================================== --- head/sys/kern/makesyscalls.sh Wed Jun 22 21:11:27 2016 (r302092) +++ head/sys/kern/makesyscalls.sh Wed Jun 22 21:12:53 2016 (r302093) @@ -9,6 +9,7 @@ compat=COMPAT_43 compat4=COMPAT_FREEBSD4 compat6=COMPAT_FREEBSD6 compat7=COMPAT_FREEBSD7 +compat10=COMPAT_FREEBSD10 # output files: sysnames="syscalls.c" @@ -33,6 +34,8 @@ syscompat6="sysent.compat6.$$" syscompat6dcl="sysent.compat6dcl.$$" syscompat7="sysent.compat7.$$" syscompat7dcl="sysent.compat7dcl.$$" +syscompat10="sysent.compat10.$$" +syscompat10dcl="sysent.compat10dcl.$$" sysent="sysent.switch.$$" sysinc="sysinc.switch.$$" sysarg="sysarg.switch.$$" @@ -47,9 +50,9 @@ else capenabled="" fi -trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret" 0 +trap "rm $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat10 $syscompat10dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret" 0 -touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret +touch $sysaue $sysdcl $syscompat $syscompatdcl $syscompat4 $syscompat4dcl $syscompat6 $syscompat6dcl $syscompat7 $syscompat7dcl $syscompat10 $syscompat10dcl $sysent $sysinc $sysarg $sysprotoend $systracetmp $systraceret case $# in 0) echo "usage: $0 input-file " 1>&2 @@ -88,6 +91,8 @@ s/\$//g syscompat6dcl = \"$syscompat6dcl\" syscompat7 = \"$syscompat7\" syscompat7dcl = \"$syscompat7dcl\" + syscompat10 = \"$syscompat10\" + syscompat10dcl = \"$syscompat10dcl\" sysent = \"$sysent\" syssw = \"$syssw\" sysinc = \"$sysinc\" @@ -102,6 +107,7 @@ s/\$//g compat4 = \"$compat4\" compat6 = \"$compat6\" compat7 = \"$compat7\" + compat10 = \"$compat10\" syscallprefix = \"$syscallprefix\" switchname = \"$switchname\" namesname = \"$namesname\" @@ -123,6 +129,7 @@ s/\$//g printf "\n#ifdef %s\n\n", compat4 > syscompat4 printf "\n#ifdef %s\n\n", compat6 > syscompat6 printf "\n#ifdef %s\n\n", compat7 > syscompat7 + printf "\n#ifdef %s\n\n", compat10 > syscompat10 printf "/*\n * System call names.\n *\n" > sysnames printf " * DO NOT EDIT-- this file is automatically generated.\n" > sysnames @@ -206,6 +213,7 @@ s/\$//g print > syscompat4 print > syscompat6 print > syscompat7 + print > syscompat10 print > sysnames print > systrace print > systracetmp @@ -221,6 +229,7 @@ s/\$//g print > syscompat4 print > syscompat6 print > syscompat7 + print > syscompat10 print > sysnames print > systrace print > systracetmp @@ -236,6 +245,7 @@ s/\$//g print > syscompat4 print > syscompat6 print > syscompat7 + print > syscompat10 print > sysnames print > systrace print > systracetmp @@ -342,6 +352,8 @@ s/\$//g argalias = "freebsd6_" argalias if (flag("COMPAT7")) argalias = "freebsd7_" argalias + if (flag("COMPAT10")) + argalias = "freebsd10_" argalias } f++ @@ -493,7 +505,7 @@ s/\$//g next } type("COMPAT") || type("COMPAT4") || type("COMPAT6") || \ - type("COMPAT7") { + type("COMPAT7") || type("COMPAT10") { if (flag("COMPAT")) { ncompat++ out = syscompat @@ -522,6 +534,13 @@ s/\$//g wrap = "compat7" prefix = "freebsd7_" descr = "freebsd7" + } else if (flag("COMPAT10")) { + ncompat10++ + out = syscompat10 + outdcl = syscompat10dcl + wrap = "compat10" + prefix = "freebsd10_" + descr = "freebsd10" } parseline() if (argc != 0 && !flag("NOARGS") && !flag("NOPROTO") && \ @@ -559,7 +578,8 @@ s/\$//g printf("/* %d = %s %s */\n", syscall, descr, funcalias) > sysent printf("\t\"%s.%s\",\t\t/* %d = %s %s */\n", wrap, funcalias, syscall, descr, funcalias) > sysnames - if (flag("COMPAT") || flag("COMPAT4") || flag("COMPAT6")) { + # XXX-BD: why no COMPAT7? + if (flag("COMPAT") || flag("COMPAT4") || flag("COMPAT6") || flag("COMPAT10")) { printf("\t\t\t\t/* %d is %s %s */\n", syscall, descr, funcalias) > syshdr } else if (!flag("NODEF")) { @@ -596,7 +616,7 @@ s/\$//g END { printf "\n#define AS(name) (sizeof(struct name) / sizeof(register_t))\n" > sysinc - if (ncompat != 0 || ncompat4 != 0 || ncompat6 != 0 || ncompat7 != 0) + if (ncompat != 0 || ncompat4 != 0 || ncompat6 != 0 || ncompat7 != 0 || ncompat10 != 0) printf "#include \"opt_compat.h\"\n\n" > syssw if (ncompat != 0) { @@ -630,11 +650,18 @@ s/\$//g printf "#define compat7(n, name) 0, (sy_call_t *)nosys\n" > sysinc printf "#endif\n" > sysinc } - + if (ncompat10 != 0) { + printf "\n#ifdef %s\n", compat10 > sysinc + printf "#define compat10(n, name) n, (sy_call_t *)__CONCAT(freebsd10_,name)\n" > sysinc + printf "#else\n" > sysinc + printf "#define compat10(n, name) 0, (sy_call_t *)nosys\n" > sysinc + printf "#endif\n" > sysinc + } printf("\n#endif /* %s */\n\n", compat) > syscompatdcl printf("\n#endif /* %s */\n\n", compat4) > syscompat4dcl printf("\n#endif /* %s */\n\n", compat6) > syscompat6dcl printf("\n#endif /* %s */\n\n", compat7) > syscompat7dcl + printf("\n#endif /* %s */\n\n", compat10) > syscompat10dcl printf("\n#undef PAD_\n") > sysprotoend printf("#undef PADL_\n") > sysprotoend @@ -657,6 +684,7 @@ cat $sysarg $sysdcl \ $syscompat4 $syscompat4dcl \ $syscompat6 $syscompat6dcl \ $syscompat7 $syscompat7dcl \ + $syscompat10 $syscompat10dcl \ $sysaue $sysprotoend > $sysproto cat $systracetmp >> $systrace cat $systraceret >> $systrace From owner-svn-src-head@freebsd.org Wed Jun 22 21:16:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4373B725A9; Wed, 22 Jun 2016 21:16:00 +0000 (UTC) (envelope-from brooks@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 6B9662EC8; Wed, 22 Jun 2016 21:16:00 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5MLFx8F093630; Wed, 22 Jun 2016 21:15:59 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5MLFxBD093628; Wed, 22 Jun 2016 21:15:59 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201606222115.u5MLFxBD093628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 22 Jun 2016 21:15:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302094 - in head/sys: compat/freebsd32 kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 21:16:00 -0000 Author: brooks Date: Wed Jun 22 21:15:59 2016 New Revision: 302094 URL: https://svnweb.freebsd.org/changeset/base/302094 Log: Mark the pipe() system call as COMPAT10. As of r302092 libc uses pipe2() with a zero flags value instead of pipe(). Commit with regenerated files and implementation to follow. Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D6816 Modified: head/sys/compat/freebsd32/syscalls.master head/sys/kern/syscalls.master Modified: head/sys/compat/freebsd32/syscalls.master ============================================================================== --- head/sys/compat/freebsd32/syscalls.master Wed Jun 22 21:12:53 2016 (r302093) +++ head/sys/compat/freebsd32/syscalls.master Wed Jun 22 21:15:59 2016 (r302094) @@ -29,6 +29,7 @@ ; COMPAT4 included on COMPAT4 #ifdef (FreeBSD 4 compat) ; COMPAT6 included on COMPAT6 #ifdef (FreeBSD 6 compat) ; COMPAT7 included on COMPAT7 #ifdef (FreeBSD 7 compat) +; COMPAT10 included on COMPAT10 #ifdef (FreeBSD 10 compat) ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically @@ -124,7 +125,7 @@ 40 AUE_LSTAT COMPAT { int freebsd32_lstat(char *path, \ struct ostat *ub); } 41 AUE_DUP NOPROTO { int dup(u_int fd); } -42 AUE_PIPE NOPROTO { int pipe(void); } +42 AUE_PIPE COMPAT10 { int freebsd32_pipe(void); } 43 AUE_GETEGID NOPROTO { gid_t getegid(void); } 44 AUE_PROFILE NOPROTO { int profil(caddr_t samples, size_t size, \ size_t offset, u_int scale); } Modified: head/sys/kern/syscalls.master ============================================================================== --- head/sys/kern/syscalls.master Wed Jun 22 21:12:53 2016 (r302093) +++ head/sys/kern/syscalls.master Wed Jun 22 21:15:59 2016 (r302094) @@ -28,6 +28,7 @@ ; COMPAT4 included on COMPAT4 #ifdef (FreeBSD 4 compat) ; COMPAT6 included on COMPAT6 #ifdef (FreeBSD 6 compat) ; COMPAT7 included on COMPAT7 #ifdef (FreeBSD 7 compat) +; COMPAT10 included on COMPAT7 #ifdef (FreeBSD 10 compat) ; OBSOL obsolete, not included in system, only specifies name ; UNIMPL not implemented, placeholder only ; NOSTD implemented but as a lkm that can be statically @@ -123,7 +124,7 @@ 39 AUE_GETPPID STD { pid_t getppid(void); } 40 AUE_LSTAT COMPAT { int lstat(char *path, struct ostat *ub); } 41 AUE_DUP STD { int dup(u_int fd); } -42 AUE_PIPE STD { int pipe(void); } +42 AUE_PIPE COMPAT10 { int pipe(void); } 43 AUE_GETEGID STD { gid_t getegid(void); } 44 AUE_PROFILE STD { int profil(caddr_t samples, size_t size, \ size_t offset, u_int scale); } From owner-svn-src-head@freebsd.org Wed Jun 22 21:18:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36DB2B72622; Wed, 22 Jun 2016 21:18:22 +0000 (UTC) (envelope-from brooks@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 012051158; Wed, 22 Jun 2016 21:18:21 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5MLILgX093761; Wed, 22 Jun 2016 21:18:21 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5MLIJjQ093748; Wed, 22 Jun 2016 21:18:19 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201606222118.u5MLIJjQ093748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Wed, 22 Jun 2016 21:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302095 - in head/sys: compat/freebsd32 kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2016 21:18:22 -0000 Author: brooks Date: Wed Jun 22 21:18:19 2016 New Revision: 302095 URL: https://svnweb.freebsd.org/changeset/base/302095 Log: Generate syscall tables and update pipe() implementation after r302094. Mark the pipe() system call as COMPAT10. As of r302092 libc uses pipe2() with a zero flags value instead of pipe(). Approved by: re (gjb) Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D6816 Modified: head/sys/compat/freebsd32/freebsd32_misc.c head/sys/compat/freebsd32/freebsd32_proto.h head/sys/compat/freebsd32/freebsd32_syscall.h head/sys/compat/freebsd32/freebsd32_syscalls.c head/sys/compat/freebsd32/freebsd32_sysent.c head/sys/compat/freebsd32/freebsd32_systrace_args.c head/sys/kern/init_sysent.c head/sys/kern/sys_pipe.c head/sys/kern/syscalls.c head/sys/kern/systrace_args.c head/sys/sys/syscall.h head/sys/sys/syscall.mk head/sys/sys/sysproto.h Modified: head/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_misc.c Wed Jun 22 21:15:59 2016 (r302094) +++ head/sys/compat/freebsd32/freebsd32_misc.c Wed Jun 22 21:18:19 2016 (r302095) @@ -272,6 +272,15 @@ freebsd4_freebsd32_getfsstat(struct thre } #endif +#ifdef COMPAT_FREEBSD10 +int +freebsd10_freebsd32_pipe(struct thread *td, + struct freebsd10_freebsd32_pipe_args *uap) { + + return (freebsd10_pipe(td, (struct freebsd10_pipe_args*)uap)); +} +#endif + int freebsd32_sigaltstack(struct thread *td, struct freebsd32_sigaltstack_args *uap) Modified: head/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_proto.h Wed Jun 22 21:15:59 2016 (r302094) +++ head/sys/compat/freebsd32/freebsd32_proto.h Wed Jun 22 21:18:19 2016 (r302095) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -61,6 +61,9 @@ struct freebsd32_recvfrom_args { char from_l_[PADL_(uint32_t)]; uint32_t from; char from_r_[PADR_(uint32_t)]; char fromlenaddr_l_[PADL_(uint32_t)]; uint32_t fromlenaddr; char fromlenaddr_r_[PADR_(uint32_t)]; }; +struct freebsd10_freebsd32_pipe_args { + register_t dummy; +}; struct ofreebsd32_sigpending_args { register_t dummy; }; @@ -1099,6 +1102,28 @@ int freebsd7_freebsd32_shmctl(struct thr #endif /* COMPAT_FREEBSD7 */ + +#ifdef COMPAT_FREEBSD10 + +#if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) +#define PAD64_REQUIRED +#endif +#ifdef PAD64_REQUIRED +#else +#endif +#ifdef PAD64_REQUIRED +#else +#endif +#ifdef PAD64_REQUIRED +#else +#endif +#ifdef PAD64_REQUIRED +#else +#endif +int freebsd10_freebsd32_pipe(struct thread *, struct freebsd10_freebsd32_pipe_args *); + +#endif /* COMPAT_FREEBSD10 */ + #define FREEBSD32_SYS_AUE_freebsd32_wait4 AUE_WAIT4 #define FREEBSD32_SYS_AUE_freebsd4_freebsd32_getfsstat AUE_GETFSSTAT #define FREEBSD32_SYS_AUE_ofreebsd32_lseek AUE_LSEEK @@ -1107,6 +1132,7 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_recvfrom AUE_RECVFROM #define FREEBSD32_SYS_AUE_ofreebsd32_stat AUE_STAT #define FREEBSD32_SYS_AUE_ofreebsd32_lstat AUE_LSTAT +#define FREEBSD32_SYS_AUE_freebsd10_freebsd32_pipe AUE_PIPE #define FREEBSD32_SYS_AUE_ofreebsd32_sigaction AUE_SIGACTION #define FREEBSD32_SYS_AUE_ofreebsd32_sigprocmask AUE_SIGPROCMASK #define FREEBSD32_SYS_AUE_ofreebsd32_sigpending AUE_SIGPENDING Modified: head/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscall.h Wed Jun 22 21:15:59 2016 (r302094) +++ head/sys/compat/freebsd32/freebsd32_syscall.h Wed Jun 22 21:18:19 2016 (r302095) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks */ #define FREEBSD32_SYS_syscall 0 @@ -48,7 +48,7 @@ #define FREEBSD32_SYS_getppid 39 /* 40 is old freebsd32_lstat */ #define FREEBSD32_SYS_dup 41 -#define FREEBSD32_SYS_pipe 42 + /* 42 is freebsd10 freebsd32_pipe */ #define FREEBSD32_SYS_getegid 43 #define FREEBSD32_SYS_profil 44 #define FREEBSD32_SYS_ktrace 45 Modified: head/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_syscalls.c Wed Jun 22 21:15:59 2016 (r302094) +++ head/sys/compat/freebsd32/freebsd32_syscalls.c Wed Jun 22 21:18:19 2016 (r302095) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks */ const char *freebsd32_syscallnames[] = { @@ -52,7 +52,7 @@ const char *freebsd32_syscallnames[] = { "getppid", /* 39 = getppid */ "compat.freebsd32_lstat", /* 40 = old freebsd32_lstat */ "dup", /* 41 = dup */ - "pipe", /* 42 = pipe */ + "compat10.freebsd32_pipe", /* 42 = freebsd10 freebsd32_pipe */ "getegid", /* 43 = getegid */ "profil", /* 44 = profil */ "ktrace", /* 45 = ktrace */ Modified: head/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_sysent.c Wed Jun 22 21:15:59 2016 (r302094) +++ head/sys/compat/freebsd32/freebsd32_sysent.c Wed Jun 22 21:18:19 2016 (r302095) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 296572 2016-03-09 19:05:11Z jhb + * created from FreeBSD: head/sys/compat/freebsd32/syscalls.master 302094 2016-06-22 21:15:59Z brooks */ #include "opt_compat.h" @@ -42,6 +42,12 @@ #define compat7(n, name) 0, (sy_call_t *)nosys #endif +#ifdef COMPAT_FREEBSD10 +#define compat10(n, name) n, (sy_call_t *)__CONCAT(freebsd10_,name) +#else +#define compat10(n, name) 0, (sy_call_t *)nosys +#endif + /* The casts are bogus but will do for now. */ struct sysent freebsd32_sysent[] = { #if !defined(PAD64_REQUIRED) && (defined(__powerpc__) || defined(__mips__)) @@ -89,7 +95,7 @@ struct sysent freebsd32_sysent[] = { { 0, (sy_call_t *)sys_getppid, AUE_GETPPID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 39 = getppid */ { compat(AS(ofreebsd32_lstat_args),freebsd32_lstat), AUE_LSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 40 = old freebsd32_lstat */ { AS(dup_args), (sy_call_t *)sys_dup, AUE_DUP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 41 = dup */ - { 0, (sy_call_t *)sys_pipe, AUE_PIPE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = pipe */ + { compat10(0,freebsd32_pipe), AUE_PIPE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = freebsd10 freebsd32_pipe */ { 0, (sy_call_t *)sys_getegid, AUE_GETEGID, NULL, 0, 0, 0, SY_THR_STATIC }, /* 43 = getegid */ { AS(profil_args), (sy_call_t *)sys_profil, AUE_PROFILE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 44 = profil */ { AS(ktrace_args), (sy_call_t *)sys_ktrace, AUE_KTRACE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 45 = ktrace */ Modified: head/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed Jun 22 21:15:59 2016 (r302094) +++ head/sys/compat/freebsd32/freebsd32_systrace_args.c Wed Jun 22 21:18:19 2016 (r302095) @@ -293,11 +293,6 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } - /* pipe */ - case 42: { - *n_args = 0; - break; - } /* getegid */ case 43: { *n_args = 0; @@ -3768,9 +3763,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* pipe */ - case 42: - break; /* getegid */ case 43: break; @@ -9083,8 +9075,6 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* pipe */ - case 42: /* getegid */ case 43: /* profil */ Modified: head/sys/kern/init_sysent.c ============================================================================== --- head/sys/kern/init_sysent.c Wed Jun 22 21:15:59 2016 (r302094) +++ head/sys/kern/init_sysent.c Wed Jun 22 21:18:19 2016 (r302095) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 302094 2016-06-22 21:15:59Z brooks */ #include "opt_compat.h" @@ -38,6 +38,12 @@ #define compat7(n, name) 0, (sy_call_t *)nosys #endif +#ifdef COMPAT_FREEBSD10 +#define compat10(n, name) n, (sy_call_t *)__CONCAT(freebsd10_,name) +#else +#define compat10(n, name) 0, (sy_call_t *)nosys +#endif + /* The casts are bogus but will do for now. */ struct sysent sysent[] = { { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 0 = syscall */ @@ -82,7 +88,7 @@ struct sysent sysent[] = { { 0, (sy_call_t *)sys_getppid, AUE_GETPPID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 39 = getppid */ { compat(AS(olstat_args),lstat), AUE_LSTAT, NULL, 0, 0, 0, SY_THR_STATIC }, /* 40 = old lstat */ { AS(dup_args), (sy_call_t *)sys_dup, AUE_DUP, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 41 = dup */ - { 0, (sy_call_t *)sys_pipe, AUE_PIPE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = pipe */ + { compat10(0,pipe), AUE_PIPE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 42 = freebsd10 pipe */ { 0, (sy_call_t *)sys_getegid, AUE_GETEGID, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 43 = getegid */ { AS(profil_args), (sy_call_t *)sys_profil, AUE_PROFILE, NULL, 0, 0, SYF_CAPENABLED, SY_THR_STATIC }, /* 44 = profil */ { AS(ktrace_args), (sy_call_t *)sys_ktrace, AUE_KTRACE, NULL, 0, 0, 0, SY_THR_STATIC }, /* 45 = ktrace */ Modified: head/sys/kern/sys_pipe.c ============================================================================== --- head/sys/kern/sys_pipe.c Wed Jun 22 21:15:59 2016 (r302094) +++ head/sys/kern/sys_pipe.c Wed Jun 22 21:18:19 2016 (r302095) @@ -89,6 +89,8 @@ * in the structure may have changed. */ +#include "opt_compat.h" + #include __FBSDID("$FreeBSD$"); @@ -445,9 +447,10 @@ kern_pipe(struct thread *td, int fildes[ return (0); } +#ifdef COMPAT_FREEBSD10 /* ARGSUSED */ int -sys_pipe(struct thread *td, struct pipe_args *uap) +freebsd10_pipe(struct thread *td, struct freebsd10_pipe_args *uap __unused) { int error; int fildes[2]; @@ -461,6 +464,7 @@ sys_pipe(struct thread *td, struct pipe_ return (0); } +#endif int sys_pipe2(struct thread *td, struct pipe2_args *uap) Modified: head/sys/kern/syscalls.c ============================================================================== --- head/sys/kern/syscalls.c Wed Jun 22 21:15:59 2016 (r302094) +++ head/sys/kern/syscalls.c Wed Jun 22 21:18:19 2016 (r302095) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 302094 2016-06-22 21:15:59Z brooks */ const char *syscallnames[] = { @@ -49,7 +49,7 @@ const char *syscallnames[] = { "getppid", /* 39 = getppid */ "compat.lstat", /* 40 = old lstat */ "dup", /* 41 = dup */ - "pipe", /* 42 = pipe */ + "compat10.pipe", /* 42 = freebsd10 pipe */ "getegid", /* 43 = getegid */ "profil", /* 44 = profil */ "ktrace", /* 45 = ktrace */ Modified: head/sys/kern/systrace_args.c ============================================================================== --- head/sys/kern/systrace_args.c Wed Jun 22 21:15:59 2016 (r302094) +++ head/sys/kern/systrace_args.c Wed Jun 22 21:18:19 2016 (r302095) @@ -290,11 +290,6 @@ systrace_args(int sysnum, void *params, *n_args = 1; break; } - /* pipe */ - case 42: { - *n_args = 0; - break; - } /* getegid */ case 43: { *n_args = 0; @@ -3775,9 +3770,6 @@ systrace_entry_setargdesc(int sysnum, in break; }; break; - /* pipe */ - case 42: - break; /* getegid */ case 43: break; @@ -9040,8 +9032,6 @@ systrace_return_setargdesc(int sysnum, i if (ndx == 0 || ndx == 1) p = "int"; break; - /* pipe */ - case 42: /* getegid */ case 43: /* profil */ Modified: head/sys/sys/syscall.h ============================================================================== --- head/sys/sys/syscall.h Wed Jun 22 21:15:59 2016 (r302094) +++ head/sys/sys/syscall.h Wed Jun 22 21:18:19 2016 (r302095) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 302094 2016-06-22 21:15:59Z brooks */ #define SYS_syscall 0 @@ -48,7 +48,7 @@ #define SYS_getppid 39 /* 40 is old lstat */ #define SYS_dup 41 -#define SYS_pipe 42 + /* 42 is freebsd10 pipe */ #define SYS_getegid 43 #define SYS_profil 44 #define SYS_ktrace 45 Modified: head/sys/sys/syscall.mk ============================================================================== --- head/sys/sys/syscall.mk Wed Jun 22 21:15:59 2016 (r302094) +++ head/sys/sys/syscall.mk Wed Jun 22 21:18:19 2016 (r302095) @@ -1,7 +1,7 @@ # FreeBSD system call object files. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb +# created from FreeBSD: head/sys/kern/syscalls.master 302094 2016-06-22 21:15:59Z brooks MIASM = \ syscall.o \ exit.o \ @@ -39,7 +39,6 @@ MIASM = \ kill.o \ getppid.o \ dup.o \ - pipe.o \ getegid.o \ profil.o \ ktrace.o \ Modified: head/sys/sys/sysproto.h ============================================================================== --- head/sys/sys/sysproto.h Wed Jun 22 21:15:59 2016 (r302094) +++ head/sys/sys/sysproto.h Wed Jun 22 21:18:19 2016 (r302095) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/kern/syscalls.master 297167 2016-03-21 21:37:33Z jhb + * created from FreeBSD: head/sys/kern/syscalls.master 302094 2016-06-22 21:15:59Z brooks */ #ifndef _SYS_SYSPROTO_H_ @@ -183,7 +183,7 @@ struct getppid_args { struct dup_args { char fd_l_[PADL_(u_int)]; u_int fd; char fd_r_[PADR_(u_int)]; }; -struct pipe_args { +struct freebsd10_pipe_args { register_t dummy; }; struct getegid_args { @@ -1824,7 +1824,6 @@ int sys_sync(struct thread *, struct syn int sys_kill(struct thread *, struct kill_args *); int sys_getppid(struct thread *, struct getppid_args *); int sys_dup(struct thread *, struct dup_args *); -int sys_pipe(struct thread *, struct pipe_args *); int sys_getegid(struct thread *, struct getegid_args *); int sys_profil(struct thread *, struct profil_args *); int sys_ktrace(struct thread *, struct ktrace_args *); @@ -2499,6 +2498,13 @@ int freebsd7_shmctl(struct thread *, str #endif /* COMPAT_FREEBSD7 */ + +#ifdef COMPAT_FREEBSD10 + +int freebsd10_pipe(struct thread *, struct freebsd10_pipe_args *); + +#endif /* COMPAT_FREEBSD10 */ + #define SYS_AUE_syscall AUE_NULL #define SYS_AUE_exit AUE_EXIT #define SYS_AUE_fork AUE_FORK @@ -2540,7 +2546,7 @@ int freebsd7_shmctl(struct thread *, str #define SYS_AUE_getppid AUE_GETPPID #define SYS_AUE_olstat AUE_LSTAT #define SYS_AUE_dup AUE_DUP -#define SYS_AUE_pipe AUE_PIPE +#define SYS_AUE_freebsd10_pipe AUE_PIPE #define SYS_AUE_getegid AUE_GETEGID #define SYS_AUE_profil AUE_PROFILE #define SYS_AUE_ktrace AUE_KTRACE From owner-svn-src-head@freebsd.org Thu Jun 23 00:09:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0FBA7AC5B1D; Thu, 23 Jun 2016 00:09:43 +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 E51641BF6; Thu, 23 Jun 2016 00:09:42 +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 0A50BB97F; Wed, 22 Jun 2016 20:09:42 -0400 (EDT) From: John Baldwin To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302094 - in head/sys: compat/freebsd32 kern Date: Wed, 22 Jun 2016 15:36:42 -0700 Message-ID: <29935239.gerWokA4VB@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201606222115.u5MLFxBD093628@repo.freebsd.org> References: <201606222115.u5MLFxBD093628@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); Wed, 22 Jun 2016 20:09:42 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 00:09:43 -0000 On Wednesday, June 22, 2016 09:15:59 PM Brooks Davis wrote: > Author: brooks > Date: Wed Jun 22 21:15:59 2016 > New Revision: 302094 > URL: https://svnweb.freebsd.org/changeset/base/302094 > > Log: > Mark the pipe() system call as COMPAT10. > > As of r302092 libc uses pipe2() with a zero flags value instead of pipe(). > > Commit with regenerated files and implementation to follow. I think open() already uses openat() in libc as well? open() should be under COMPAT10 as well in that case. It does make the output of things like ktrace and truss a bit odd to see functions in section (2) show up as something else. Arguably we should move pipe.2 to pipe.3 (and same for open.2) except that we document their aliases in the same pages. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jun 23 00:09:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 118D0AC5B19; Thu, 23 Jun 2016 00:09:42 +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 E6B0D1BF3; Thu, 23 Jun 2016 00:09:41 +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 8BC1AB917; Wed, 22 Jun 2016 20:09:40 -0400 (EDT) From: John Baldwin To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302094 - in head/sys: compat/freebsd32 kern Date: Wed, 22 Jun 2016 17:09:34 -0700 Message-ID: <5096414.4TN0ypqLNM@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201606222115.u5MLFxBD093628@repo.freebsd.org> References: <201606222115.u5MLFxBD093628@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); Wed, 22 Jun 2016 20:09:40 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 00:09:42 -0000 On Wednesday, June 22, 2016 09:15:59 PM Brooks Davis wrote: > Author: brooks > Date: Wed Jun 22 21:15:59 2016 > New Revision: 302094 > URL: https://svnweb.freebsd.org/changeset/base/302094 > > Log: > Mark the pipe() system call as COMPAT10. > > As of r302092 libc uses pipe2() with a zero flags value instead of pipe(). > > Commit with regenerated files and implementation to follow. This breaks the build on at least i386 because other ABIs depend on being able to call sys_pipe directly. You should at least add COMPAT_FREEBSD10 to GENERIC on architectures that shipped a 10.x release. That will fix the build breakage on i386, but it's also the policy we follow for all the other compat knobs. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jun 23 00:29:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CFF2B72139; Thu, 23 Jun 2016 00:29:04 +0000 (UTC) (envelope-from brooks@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 4E5022752; Thu, 23 Jun 2016 00:29:04 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N0T3M4065545; Thu, 23 Jun 2016 00:29:03 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N0T3Ht065544; Thu, 23 Jun 2016 00:29:03 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201606230029.u5N0T3Ht065544@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 23 Jun 2016 00:29:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302096 - head/sys/compat/svr4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 00:29:04 -0000 Author: brooks Date: Thu Jun 23 00:29:03 2016 New Revision: 302096 URL: https://svnweb.freebsd.org/changeset/base/302096 Log: Declare a svr4 version of pipe() now that sys_pipe() is no more. Approved by: re (implicit, fixing build) Sponsored by: DARPA, AFRL Modified: head/sys/compat/svr4/syscalls.master Modified: head/sys/compat/svr4/syscalls.master ============================================================================== --- head/sys/compat/svr4/syscalls.master Wed Jun 22 21:18:19 2016 (r302095) +++ head/sys/compat/svr4/syscalls.master Thu Jun 23 00:29:03 2016 (r302096) @@ -87,7 +87,7 @@ int pgid); } 40 AUE_NULL UNIMPL xenix 41 AUE_NULL NOPROTO { int dup(u_int fd); } -42 AUE_NULL NOPROTO { int pipe(void); } +42 AUE_NULL STD { int svr4_pipe(void); } 43 AUE_NULL STD { int svr4_sys_times(struct tms *tp); } 44 AUE_NULL UNIMPL profil 45 AUE_NULL UNIMPL plock From owner-svn-src-head@freebsd.org Thu Jun 23 00:30:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 670CCB721AE; Thu, 23 Jun 2016 00:30:11 +0000 (UTC) (envelope-from brooks@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 3F32828BF; Thu, 23 Jun 2016 00:30:11 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N0UAMD065649; Thu, 23 Jun 2016 00:30:10 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N0UAaA065643; Thu, 23 Jun 2016 00:30:10 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201606230030.u5N0UAaA065643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 23 Jun 2016 00:30:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302097 - head/sys/compat/svr4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 00:30:11 -0000 Author: brooks Date: Thu Jun 23 00:30:09 2016 New Revision: 302097 URL: https://svnweb.freebsd.org/changeset/base/302097 Log: Regen post r302096 and implement svr4_pipe(). Approved by: re (implict, fixing build) Sponsored by: DARPA, AFRL Modified: head/sys/compat/svr4/svr4_filio.c head/sys/compat/svr4/svr4_proto.h head/sys/compat/svr4/svr4_syscall.h head/sys/compat/svr4/svr4_syscallnames.c head/sys/compat/svr4/svr4_sysent.c Modified: head/sys/compat/svr4/svr4_filio.c ============================================================================== --- head/sys/compat/svr4/svr4_filio.c Thu Jun 23 00:29:03 2016 (r302096) +++ head/sys/compat/svr4/svr4_filio.c Thu Jun 23 00:30:09 2016 (r302097) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -250,3 +251,19 @@ svr4_fil_ioctl(fp, td, retval, fd, cmd, return 0; /* ENOSYS really */ } } + +int +svr4_pipe(struct thread *td, struct svr4_pipe_args *uap) { + int error; + int fildes[2]; + + error = kern_pipe(td, fildes, 0, NULL, NULL); + if (error) + return (error); + + td->td_retval[0] = fildes[0]; + td->td_retval[1] = fildes[1]; + + return (0); +} + Modified: head/sys/compat/svr4/svr4_proto.h ============================================================================== --- head/sys/compat/svr4/svr4_proto.h Thu Jun 23 00:29:03 2016 (r302096) +++ head/sys/compat/svr4/svr4_proto.h Thu Jun 23 00:30:09 2016 (r302097) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/compat/svr4/syscalls.master 302096 2016-06-23 00:29:03Z brooks */ #ifndef _SVR4_SYSPROTO_H_ @@ -12,8 +12,10 @@ #include #include #include +#include #include #include +#include #include @@ -93,6 +95,9 @@ struct svr4_sys_pgrpsys_args { char pid_l_[PADL_(int)]; int pid; char pid_r_[PADR_(int)]; char pgid_l_[PADL_(int)]; int pgid; char pgid_r_[PADR_(int)]; }; +struct svr4_pipe_args { + register_t dummy; +}; struct svr4_sys_times_args { char tp_l_[PADL_(struct tms *)]; struct tms * tp; char tp_r_[PADR_(struct tms *)]; }; @@ -422,6 +427,7 @@ int svr4_sys_access(struct thread *, str int svr4_sys_nice(struct thread *, struct svr4_sys_nice_args *); int svr4_sys_kill(struct thread *, struct svr4_sys_kill_args *); int svr4_sys_pgrpsys(struct thread *, struct svr4_sys_pgrpsys_args *); +int svr4_pipe(struct thread *, struct svr4_pipe_args *); int svr4_sys_times(struct thread *, struct svr4_sys_times_args *); int svr4_sys_signal(struct thread *, struct svr4_sys_signal_args *); int svr4_sys_msgsys(struct thread *, struct svr4_sys_msgsys_args *); @@ -509,6 +515,12 @@ int svr4_sys_sendto(struct thread *, str #endif /* COMPAT_FREEBSD7 */ + +#ifdef COMPAT_FREEBSD10 + + +#endif /* COMPAT_FREEBSD10 */ + #define SVR4_SYS_AUE_svr4_sys_open AUE_NULL #define SVR4_SYS_AUE_svr4_sys_wait AUE_NULL #define SVR4_SYS_AUE_svr4_sys_creat AUE_NULL @@ -525,6 +537,7 @@ int svr4_sys_sendto(struct thread *, str #define SVR4_SYS_AUE_svr4_sys_nice AUE_NULL #define SVR4_SYS_AUE_svr4_sys_kill AUE_NULL #define SVR4_SYS_AUE_svr4_sys_pgrpsys AUE_NULL +#define SVR4_SYS_AUE_svr4_pipe AUE_NULL #define SVR4_SYS_AUE_svr4_sys_times AUE_NULL #define SVR4_SYS_AUE_svr4_sys_signal AUE_NULL #define SVR4_SYS_AUE_svr4_sys_msgsys AUE_NULL Modified: head/sys/compat/svr4/svr4_syscall.h ============================================================================== --- head/sys/compat/svr4/svr4_syscall.h Thu Jun 23 00:29:03 2016 (r302096) +++ head/sys/compat/svr4/svr4_syscall.h Thu Jun 23 00:30:09 2016 (r302097) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/compat/svr4/syscalls.master 302096 2016-06-23 00:29:03Z brooks */ #define SVR4_SYS_exit 1 @@ -38,7 +38,7 @@ #define SVR4_SYS_svr4_sys_kill 37 #define SVR4_SYS_svr4_sys_pgrpsys 39 #define SVR4_SYS_dup 41 -#define SVR4_SYS_pipe 42 +#define SVR4_SYS_svr4_pipe 42 #define SVR4_SYS_svr4_sys_times 43 #define SVR4_SYS_setgid 46 #define SVR4_SYS_getgid 47 Modified: head/sys/compat/svr4/svr4_syscallnames.c ============================================================================== --- head/sys/compat/svr4/svr4_syscallnames.c Thu Jun 23 00:29:03 2016 (r302096) +++ head/sys/compat/svr4/svr4_syscallnames.c Thu Jun 23 00:30:09 2016 (r302097) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/compat/svr4/syscalls.master 302096 2016-06-23 00:29:03Z brooks */ const char *svr4_syscallnames[] = { @@ -49,7 +49,7 @@ const char *svr4_syscallnames[] = { "svr4_sys_pgrpsys", /* 39 = svr4_sys_pgrpsys */ "#40", /* 40 = xenix */ "dup", /* 41 = dup */ - "pipe", /* 42 = pipe */ + "svr4_pipe", /* 42 = svr4_pipe */ "svr4_sys_times", /* 43 = svr4_sys_times */ "#44", /* 44 = profil */ "#45", /* 45 = plock */ Modified: head/sys/compat/svr4/svr4_sysent.c ============================================================================== --- head/sys/compat/svr4/svr4_sysent.c Thu Jun 23 00:29:03 2016 (r302096) +++ head/sys/compat/svr4/svr4_sysent.c Thu Jun 23 00:30:09 2016 (r302097) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: head/sys/compat/svr4/syscalls.master 227691 2011-11-19 06:35:15Z ed + * created from FreeBSD: head/sys/compat/svr4/syscalls.master 302096 2016-06-23 00:29:03Z brooks */ #include @@ -61,7 +61,7 @@ struct sysent svr4_sysent[] = { { AS(svr4_sys_pgrpsys_args), (sy_call_t *)svr4_sys_pgrpsys, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 39 = svr4_sys_pgrpsys */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 40 = xenix */ { AS(dup_args), (sy_call_t *)sys_dup, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 41 = dup */ - { 0, (sy_call_t *)sys_pipe, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = pipe */ + { 0, (sy_call_t *)svr4_pipe, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 42 = svr4_pipe */ { AS(svr4_sys_times_args), (sy_call_t *)svr4_sys_times, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 43 = svr4_sys_times */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 44 = profil */ { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 45 = plock */ From owner-svn-src-head@freebsd.org Thu Jun 23 00:30:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26791B72203; Thu, 23 Jun 2016 00:30:34 +0000 (UTC) (envelope-from gjb@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 17C362A11; Thu, 23 Jun 2016 00:30:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from FreeBSD.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by freefall.freebsd.org (Postfix) with ESMTP id B7E3B1A37; Thu, 23 Jun 2016 00:30:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Date: Thu, 23 Jun 2016 00:30:32 +0000 From: Glen Barber To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302096 - head/sys/compat/svr4 Message-ID: <20160623003032.GP10155@FreeBSD.org> References: <201606230029.u5N0T3Ht065544@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nLMor0SRtNCuLS/8" Content-Disposition: inline In-Reply-To: <201606230029.u5N0T3Ht065544@repo.freebsd.org> X-Operating-System: FreeBSD 11.0-CURRENT amd64 X-SCUD-Definition: Sudden Completely Unexpected Dataloss X-SULE-Definition: Sudden Unexpected Learning Event X-PEKBAC-Definition: Problem Exists, Keyboard Between Admin/Computer User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 00:30:34 -0000 --nLMor0SRtNCuLS/8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 23, 2016 at 12:29:03AM +0000, Brooks Davis wrote: > Author: brooks > Date: Thu Jun 23 00:29:03 2016 > New Revision: 302096 > URL: https://svnweb.freebsd.org/changeset/base/302096 >=20 > Log: > Declare a svr4 version of pipe() now that sys_pipe() is no more. > =20 > Approved by: re (implicit, fixing build) Thank you. Glen --nLMor0SRtNCuLS/8 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXay2kAAoJEAMUWKVHj+KT5tgQAI62yEQweWqNwQ4xMwAENlag wwModYZXZzy0Jh0AKE4JAwQvfNGqcBmdhyFFtvEgfzLllkVa/+i1CCjvs3k9ist+ qbZQQldpBTmR8WOgxwe891GfR5eSDdgB3Xwq8fKwlokAVdRCbbVmjlGu3B6nh6SQ oLFZ08sylyTC/NzTOt1vpVdUtgrqqt38N/NEkNBUhLTjoRjM+WtBLfIh3Rpwr3Pk ttNgwOBEhEyg7aQW1Z3x21D1sjcyAbYKRTkxae8adfYmE2wwJzA/Sc/Ur6vfKJMx xf/tx93Lj0JUBuRVS/JLAJaEySW2ctYOOawm5oRJYMmVK5XGEougery9dpuVtcDe 8K+jBouylMr9lG7/S5kVWPpDB5aPcqGfDsraCNCbfGWvMJ6tIqOLfIp3KA5IwuYm T1BrsZx4J2hO56wsOcYVId2s0Xr3JX0n5epVPr77+BAdmyiC+Reb5j3nkkcYqWSp Oo1674r7qRjwNsQ/ODDT5zvhzTrd5RD4Dc1LOcHY/lYvdE7QxYefI19Pf3PZk/sZ eQNzzwS+ic+yvlXvvynolu3ftQKMMkml+uQSqMYu3Bru50Had98Awhiejkng6Wtj 5wG9k7PJzEBxGepFqtHeF9E6pA7b5aJH7mqetahqtfMNHZ4Bt9WIeW2Ikrb47pLH uFVpqCzmFBvo7fZ1jw9R =KDG6 -----END PGP SIGNATURE----- --nLMor0SRtNCuLS/8-- From owner-svn-src-head@freebsd.org Thu Jun 23 00:33:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29659B72474; Thu, 23 Jun 2016 00:33:00 +0000 (UTC) (envelope-from bz@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 EAF992DE1; Thu, 23 Jun 2016 00:32:59 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N0WxLG069003; Thu, 23 Jun 2016 00:32:59 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N0WxNF069002; Thu, 23 Jun 2016 00:32:59 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606230032.u5N0WxNF069002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 00:32:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302098 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 00:33:00 -0000 Author: bz Date: Thu Jun 23 00:32:58 2016 New Revision: 302098 URL: https://svnweb.freebsd.org/changeset/base/302098 Log: No longer mark TCP TW zone NO_FREE. Timewait code does a proper cleanup after itself. Reviewed by: gnn Approved by: re (gjb) Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6922 Modified: head/sys/netinet/tcp_timewait.c Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Thu Jun 23 00:30:09 2016 (r302097) +++ head/sys/netinet/tcp_timewait.c Thu Jun 23 00:32:58 2016 (r302098) @@ -186,7 +186,7 @@ tcp_tw_init(void) { V_tcptw_zone = uma_zcreate("tcptw", sizeof(struct tcptw), - NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); TUNABLE_INT_FETCH("net.inet.tcp.maxtcptw", &maxtcptw); if (maxtcptw == 0) uma_zone_set_max(V_tcptw_zone, tcptw_auto_size()); From owner-svn-src-head@freebsd.org Thu Jun 23 00:34:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF041B72529; Thu, 23 Jun 2016 00:34:04 +0000 (UTC) (envelope-from bz@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 BF7622F6C; Thu, 23 Jun 2016 00:34:04 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N0Y3md069104; Thu, 23 Jun 2016 00:34:03 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N0Y3Ea069103; Thu, 23 Jun 2016 00:34:03 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606230034.u5N0Y3Ea069103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 00:34:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302099 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 00:34:05 -0000 Author: bz Date: Thu Jun 23 00:34:03 2016 New Revision: 302099 URL: https://svnweb.freebsd.org/changeset/base/302099 Log: Check the V_tcbinfo.ipi_count to hit 0 before doing the full TCP cleanup. That way timers can finish cleanly and we do not gamble with a DELAY(). Reviewed by: gnn, jtl Approved by: re (gjb) Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6923 Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Jun 23 00:32:58 2016 (r302098) +++ head/sys/netinet/tcp_subr.c Thu Jun 23 00:34:03 2016 (r302099) @@ -731,18 +731,19 @@ tcp_init(void) static void tcp_destroy(void *unused __unused) { - int error; + int error, n; /* * All our processes are gone, all our sockets should be cleaned * up, which means, we should be past the tcp_discardcb() calls. - * Sleep to let all tcpcb timers really disappear and then cleanup. - * Timewait will cleanup its queue and will be ready to go. - * XXX-BZ In theory a few ticks should be good enough to make sure - * the timers are all really gone. We should see if we could use a - * better metric here and, e.g., check a tcbcb count as an optimization? + * Sleep to let all tcpcb timers really disappear and cleanup. */ - DELAY(1000000 / hz); + do { + pause("tcpdes", hz/10); + INP_LIST_RLOCK(&V_tcbinfo); + n = V_tcbinfo.ipi_count; + INP_LIST_RUNLOCK(&V_tcbinfo); + } while (n != 0); tcp_hc_destroy(); syncache_destroy(); tcp_tw_destroy(); From owner-svn-src-head@freebsd.org Thu Jun 23 00:37:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8AA74B725BE; Thu, 23 Jun 2016 00:37:58 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 608421269; Thu, 23 Jun 2016 00:37:58 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id F069E5A9F27; Thu, 23 Jun 2016 00:37:56 +0000 (UTC) Date: Thu, 23 Jun 2016 00:37:56 +0000 From: Brooks Davis To: Glen Barber Cc: Brooks Davis , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302096 - head/sys/compat/svr4 Message-ID: <20160623003756.GA41630@spindle.one-eyed-alien.net> References: <201606230029.u5N0T3Ht065544@repo.freebsd.org> <20160623003032.GP10155@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <20160623003032.GP10155@FreeBSD.org> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 00:37:58 -0000 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 23, 2016 at 12:30:32AM +0000, Glen Barber wrote: > On Thu, Jun 23, 2016 at 12:29:03AM +0000, Brooks Davis wrote: > > Author: brooks > > Date: Thu Jun 23 00:29:03 2016 > > New Revision: 302096 > > URL: https://svnweb.freebsd.org/changeset/base/302096 > >=20 > > Log: > > Declare a svr4 version of pipe() now that sys_pipe() is no more. > > =20 > > Approved by: re (implicit, fixing build) >=20 > Thank you. Sorry about the breakage. I thought I'd done a successful i386 build, but apparently not with the compat portion of the patch. -- Brooks --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJXay9kAAoJEKzQXbSebgfA5JsH/3Ht8/aeVI5g7uJ8mPH/Sq+j E4Yg+SjnrEM4SXwPIrudNeEGyff+TjcT/Ar22GtRtzBB01VIcA8UvhD9Nz/hey+T jJlSXdgJhE7BU7hPX5bkKlZjh5v8A52UX1VTz8/iHqeZG3OLgg2I4qKMCfF5yNTy JBRwOMKQAEPDZNeYYsQ2wqJwv7F7aeI//sKCXL7KGqCg2UV6SupMePBsHij6Ctjh k30hz4ZPGiXbO0vst7o5S06zbKiQ71L75b6mD1q0Q9RTtBi4tmBl7pm9FBbI4fuV i2SYI9FbZgMHJ3Ev6IDyFyovkY9ilA72e/OLUoJ/JgUYFuYW7yEuck6XHxDef4c= =gNvR -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0-- From owner-svn-src-head@freebsd.org Thu Jun 23 00:39:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D117CB7264C; Thu, 23 Jun 2016 00:39:49 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AD21C13DE; Thu, 23 Jun 2016 00:39:49 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 749475A9F2A; Thu, 23 Jun 2016 00:39:48 +0000 (UTC) Date: Thu, 23 Jun 2016 00:39:48 +0000 From: Brooks Davis To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302094 - in head/sys: compat/freebsd32 kern Message-ID: <20160623003948.GB41630@spindle.one-eyed-alien.net> References: <201606222115.u5MLFxBD093628@repo.freebsd.org> <5096414.4TN0ypqLNM@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5/uDoXvLw7AC5HRs" Content-Disposition: inline In-Reply-To: <5096414.4TN0ypqLNM@ralph.baldwin.cx> User-Agent: Mutt/1.6.1 (2016-04-27) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 00:39:49 -0000 --5/uDoXvLw7AC5HRs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 22, 2016 at 05:09:34PM -0700, John Baldwin wrote: > On Wednesday, June 22, 2016 09:15:59 PM Brooks Davis wrote: > > Author: brooks > > Date: Wed Jun 22 21:15:59 2016 > > New Revision: 302094 > > URL: https://svnweb.freebsd.org/changeset/base/302094 > >=20 > > Log: > > Mark the pipe() system call as COMPAT10. > > =20 > > As of r302092 libc uses pipe2() with a zero flags value instead of pi= pe(). > > =20 > > Commit with regenerated files and implementation to follow. >=20 > This breaks the build on at least i386 because other ABIs depend on being > able to call sys_pipe directly. You should at least add COMPAT_FREEBSD10 > to GENERIC on architectures that shipped a 10.x release. That will fix t= he > build breakage on i386, but it's also the policy we follow for all the ot= her > compat knobs. It was actually that sys_pipe() was renamed by the COMPAT10 tag. I've copied the implementation to a svr4_pipe(). -- Brooks --5/uDoXvLw7AC5HRs Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJXay/TAAoJEKzQXbSebgfAUwkIAI+9MNKDIAiT4QUcT+7yGNMb wBMrSkCbjaWjxUc5DVUjjL3uPMtx+dfFIAW8JR7KSpQytqfI0rKDVcHJbDNRrivx Np/X+cJbmNXUJUKltgS+31XotNR6nmA0UoARslVPTBklF6+3BfjJ9pSGOGzYEuyc vQT/mSMX8NK3TUhDqKeXGtPWvxA0yjMdDflUnlnEm0zXQPlggpnG6j3BBkabSdLy +AJIoYk5aNj2SdtH+3noH5tP2YF4oB2m6hwn6OrIVC43jey0+VvalalMHhkaGIPK u4Qev1/r8f4V3/2yzNwBvj3TXayKfXc35Q3mn6Duhr94LiPx1GuxUkcgdtbwcYg= =SHFd -----END PGP SIGNATURE----- --5/uDoXvLw7AC5HRs-- From owner-svn-src-head@freebsd.org Thu Jun 23 00:54:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7A07B72993; Thu, 23 Jun 2016 00:54:15 +0000 (UTC) (envelope-from adrian@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 94C4A1CD7; Thu, 23 Jun 2016 00:54:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N0sEPo076502; Thu, 23 Jun 2016 00:54:14 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N0sESS076501; Thu, 23 Jun 2016 00:54:14 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606230054.u5N0sESS076501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 23 Jun 2016 00:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302100 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 00:54:15 -0000 Author: adrian Date: Thu Jun 23 00:54:14 2016 New Revision: 302100 URL: https://svnweb.freebsd.org/changeset/base/302100 Log: [ath] fix comments! I keep asking myself "what do these fields mean" and so now I've clarified it for myself. Tested: * Reading the comments, going "a-ha!" a couple times. Approved by: re (gjb) Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Thu Jun 23 00:34:03 2016 (r302099) +++ head/sys/dev/ath/if_athvar.h Thu Jun 23 00:54:14 2016 (r302100) @@ -370,9 +370,9 @@ struct ath_txq { */ struct { TAILQ_HEAD(axq_q_f_s, ath_buf) axq_q; - u_int axq_depth; + u_int axq_depth; /* how many frames (1 per legacy, 1 per A-MPDU list) are in the FIFO queue */ } fifo; - u_int axq_fifo_depth; /* depth of FIFO frames */ + u_int axq_fifo_depth; /* how many FIFO slots are active */ /* * XXX the holdingbf field is protected by the TXBUF lock From owner-svn-src-head@freebsd.org Thu Jun 23 00:56:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FC41B72AB4; Thu, 23 Jun 2016 00:56:56 +0000 (UTC) (envelope-from adrian@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 C72541F5A; Thu, 23 Jun 2016 00:56:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N0usQs076790; Thu, 23 Jun 2016 00:56:54 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N0usOG076788; Thu, 23 Jun 2016 00:56:54 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606230056.u5N0usOG076788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 23 Jun 2016 00:56:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302101 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 00:56:56 -0000 Author: adrian Date: Thu Jun 23 00:56:54 2016 New Revision: 302101 URL: https://svnweb.freebsd.org/changeset/base/302101 Log: [iwm] Use vap->iv_myaddr instead of ic->ic_macaddr when vap != NULL. ic_macaddr is only used for the initial mac address provided by NVM. We should rather use vap->iv_myaddr when vap != NULL, to allow the MAC address to be changed later with ifconfig(8). Submitted by: Imre Vadasz Reviewed by: avos Approved by: re (gjb) Obtained from: DragonflyBSD git 4aee7a78275676d22d14c04177bd0c9377d91478 Differential Revision: https://reviews.freebsd.org/D6743 Modified: head/sys/dev/iwm/if_iwm_mac_ctxt.c head/sys/dev/iwm/if_iwm_scan.c Modified: head/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- head/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Jun 23 00:54:14 2016 (r302100) +++ head/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Jun 23 00:56:54 2016 (r302101) @@ -275,7 +275,7 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_s */ cmd->tsf_id = htole32(IWM_DEFAULT_TSFID); - IEEE80211_ADDR_COPY(cmd->node_addr, ic->ic_macaddr); + IEEE80211_ADDR_COPY(cmd->node_addr, vap->iv_myaddr); /* * XXX should we error out if in_assoc is 1 and ni == NULL? Modified: head/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- head/sys/dev/iwm/if_iwm_scan.c Thu Jun 23 00:54:14 2016 (r302100) +++ head/sys/dev/iwm/if_iwm_scan.c Thu Jun 23 00:56:54 2016 (r302101) @@ -371,6 +371,8 @@ iwm_mvm_scan_request(struct iwm_softc *s .dataflags = { IWM_HCMD_DFL_NOCOPY, }, }; struct iwm_scan_cmd *cmd = sc->sc_scan_cmd; + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); int is_assoc = 0; int ret; uint32_t status; @@ -421,8 +423,9 @@ iwm_mvm_scan_request(struct iwm_softc *s cmd->tx_cmd.len = htole16(iwm_mvm_fill_probe_req(sc, (struct ieee80211_frame *)cmd->data, - sc->sc_ic.ic_macaddr, n_ssids, ssid, ssid_len, - NULL, 0, sc->sc_capa_max_probe_len)); + vap ? vap->iv_myaddr : ic->ic_macaddr, n_ssids, + ssid, ssid_len, NULL, 0, + sc->sc_capa_max_probe_len)); cmd->channel_count = iwm_mvm_scan_fill_channels(sc, cmd, flags, n_ssids, basic_ssid); From owner-svn-src-head@freebsd.org Thu Jun 23 01:00:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 859E6B72B8A; Thu, 23 Jun 2016 01:00:14 +0000 (UTC) (envelope-from adrian@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 392692155; Thu, 23 Jun 2016 01:00:14 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N10DqH076982; Thu, 23 Jun 2016 01:00:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N10DWI076981; Thu, 23 Jun 2016 01:00:13 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606230100.u5N10DWI076981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 23 Jun 2016 01:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302102 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 01:00:14 -0000 Author: adrian Date: Thu Jun 23 01:00:13 2016 New Revision: 302102 URL: https://svnweb.freebsd.org/changeset/base/302102 Log: [iwm] Fix iwm_dma_contig_free(). dma->map is always NULL here. * When bus_dmamem_alloc is used, the bus_dmamap_t is usually set to NULL, so we were never actually freeing any dma memory allocations done via iwm_dma_contig_alloc(). So we should check dma->vaddr instead of dma->map here. * Also, the dmamap is actually supposed to be invalidated as part of bus_dmamem_free(), so bus_dmamap_destroy() is never needed here. Submitted by: Imre Vadasz Approved by: re (gjb) Obtained from: DragonflyBSD git ef2b29a7ba6ca8a9d2c82ab591c0622227ff84cb Modified: head/sys/dev/iwm/if_iwm.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jun 23 00:56:54 2016 (r302101) +++ head/sys/dev/iwm/if_iwm.c Thu Jun 23 01:00:13 2016 (r302102) @@ -721,6 +721,7 @@ iwm_dma_contig_alloc(bus_dma_tag_t tag, dma->tag = NULL; dma->size = size; + dma->vaddr = NULL; error = bus_dma_tag_create(tag, alignment, 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, size, @@ -735,8 +736,11 @@ iwm_dma_contig_alloc(bus_dma_tag_t tag, error = bus_dmamap_load(dma->tag, dma->map, dma->vaddr, size, iwm_dma_map_addr, &dma->paddr, BUS_DMA_NOWAIT); - if (error != 0) + if (error != 0) { + bus_dmamem_free(dma->tag, dma->vaddr, dma->map); + dma->vaddr = NULL; goto fail; + } bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_PREWRITE); @@ -749,16 +753,12 @@ fail: iwm_dma_contig_free(dma); static void iwm_dma_contig_free(struct iwm_dma_info *dma) { - if (dma->map != NULL) { - if (dma->vaddr != NULL) { - bus_dmamap_sync(dma->tag, dma->map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(dma->tag, dma->map); - bus_dmamem_free(dma->tag, dma->vaddr, dma->map); - dma->vaddr = NULL; - } - bus_dmamap_destroy(dma->tag, dma->map); - dma->map = NULL; + if (dma->vaddr != NULL) { + bus_dmamap_sync(dma->tag, dma->map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(dma->tag, dma->map); + bus_dmamem_free(dma->tag, dma->vaddr, dma->map); + dma->vaddr = NULL; } if (dma->tag != NULL) { bus_dma_tag_destroy(dma->tag); From owner-svn-src-head@freebsd.org Thu Jun 23 01:11:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C7A8B72E4A; Thu, 23 Jun 2016 01:11:54 +0000 (UTC) (envelope-from adrian@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 C20EF283E; Thu, 23 Jun 2016 01:11:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N1Bq50081941; Thu, 23 Jun 2016 01:11:52 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N1BqK2081938; Thu, 23 Jun 2016 01:11:52 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606230111.u5N1BqK2081938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 23 Jun 2016 01:11:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302103 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 01:11:54 -0000 Author: adrian Date: Thu Jun 23 01:11:52 2016 New Revision: 302103 URL: https://svnweb.freebsd.org/changeset/base/302103 Log: [iwm] Add and use iwm_phy_db_free(), to plug phy_db memory leak. (Together with other iwm(4) memory leak fixes) Memory leakage in M_DEVBUF is now at ca. 2KB for each iwm(4) module load/unload cycle. Submitted by: Imre Vadasz Approved by: re (gjb) Obtained from: DragonflyBSD git eaf551a1d464c643e98ce5781971dd32124e9af1 Differential Revision: https://reviews.freebsd.org/D6819 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_phy_db.c head/sys/dev/iwm/if_iwm_phy_db.h Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jun 23 01:00:13 2016 (r302102) +++ head/sys/dev/iwm/if_iwm.c Thu Jun 23 01:11:52 2016 (r302103) @@ -5014,6 +5014,8 @@ iwm_detach_local(struct iwm_softc *sc, i if (do_net80211) ieee80211_ifdetach(&sc->sc_ic); + iwm_phy_db_free(sc); + /* Free descriptor rings */ iwm_free_rx_ring(sc, &sc->rxq); for (i = 0; i < nitems(sc->txq); i++) Modified: head/sys/dev/iwm/if_iwm_phy_db.c ============================================================================== --- head/sys/dev/iwm/if_iwm_phy_db.c Thu Jun 23 01:00:13 2016 (r302102) +++ head/sys/dev/iwm/if_iwm_phy_db.c Thu Jun 23 01:11:52 2016 (r302103) @@ -451,3 +451,33 @@ iwm_send_phy_db_data(struct iwm_softc *s __func__); return 0; } + +static void +iwm_phy_db_free_section(struct iwm_softc *sc, + enum iwm_phy_db_section_type type, uint16_t chg_id) +{ + struct iwm_phy_db_entry *entry = + iwm_phy_db_get_section(sc, type, chg_id); + if (!entry) + return; + + if (entry->data != NULL) + free(entry->data, M_DEVBUF); + entry->data = NULL; + entry->size = 0; +} + +void +iwm_phy_db_free(struct iwm_softc *sc) +{ + int i; + + iwm_phy_db_free_section(sc, IWM_PHY_DB_CFG, 0); + iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_NCH, 0); + + for (i = 0; i < IWM_NUM_PAPD_CH_GROUPS; i++) + iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_CHG_PAPD, i); + + for (i = 0; i < IWM_NUM_TXP_CH_GROUPS; i++) + iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_CHG_TXP, i); +} Modified: head/sys/dev/iwm/if_iwm_phy_db.h ============================================================================== --- head/sys/dev/iwm/if_iwm_phy_db.h Thu Jun 23 01:00:13 2016 (r302102) +++ head/sys/dev/iwm/if_iwm_phy_db.h Thu Jun 23 01:11:52 2016 (r302103) @@ -109,4 +109,5 @@ extern int iwm_phy_db_set_section(struct iwm_softc *sc, struct iwm_calib_res_notif_phy_db *phy_db_notif); extern int iwm_send_phy_db_data(struct iwm_softc *sc); +extern void iwm_phy_db_free(struct iwm_softc *sc); #endif /* __IF_IWM_PHY_DB_H__ */ From owner-svn-src-head@freebsd.org Thu Jun 23 01:13:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98061B72F00; Thu, 23 Jun 2016 01:13:31 +0000 (UTC) (envelope-from adrian@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 742CE2BBD; Thu, 23 Jun 2016 01:13:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N1DUGD084030; Thu, 23 Jun 2016 01:13:30 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N1DUgD084028; Thu, 23 Jun 2016 01:13:30 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606230113.u5N1DUgD084028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 23 Jun 2016 01:13:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302104 - head/sys/dev/iwm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 01:13:31 -0000 Author: adrian Date: Thu Jun 23 01:13:30 2016 New Revision: 302104 URL: https://svnweb.freebsd.org/changeset/base/302104 Log: [iwm] Use mbuf for large firmware commands, like OpenBSD does. We also need to consider the size of large firmware commands in iwm_alloc_tx_ring(), in the dma tag creation, when qid == IWM_MVM_CMD_QUEUE. The old code apparently only allocated a 2KB (MCLBYTES) sized buffer when it actually expected 4KB. Submitted by: Imre Vadasz Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D6824 Modified: head/sys/dev/iwm/if_iwm.c head/sys/dev/iwm/if_iwm_util.c Modified: head/sys/dev/iwm/if_iwm.c ============================================================================== --- head/sys/dev/iwm/if_iwm.c Thu Jun 23 01:11:52 2016 (r302103) +++ head/sys/dev/iwm/if_iwm.c Thu Jun 23 01:13:30 2016 (r302104) @@ -956,6 +956,8 @@ iwm_alloc_tx_ring(struct iwm_softc *sc, { bus_addr_t paddr; bus_size_t size; + size_t maxsize; + int nsegments; int i, error; ring->qid = qid; @@ -988,9 +990,18 @@ iwm_alloc_tx_ring(struct iwm_softc *sc, } ring->cmd = ring->cmd_dma.vaddr; + /* FW commands may require more mapped space than packets. */ + if (qid == IWM_MVM_CMD_QUEUE) { + maxsize = IWM_RBUF_SIZE; + nsegments = 1; + } else { + maxsize = MCLBYTES; + nsegments = IWM_MAX_SCATTER - 2; + } + error = bus_dma_tag_create(sc->sc_dmat, 1, 0, - BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, MCLBYTES, - IWM_MAX_SCATTER - 2, MCLBYTES, 0, NULL, NULL, &ring->data_dmat); + BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, maxsize, + nsegments, maxsize, 0, NULL, NULL, &ring->data_dmat); if (error != 0) { device_printf(sc->sc_dev, "could not create TX buf DMA tag\n"); goto fail; Modified: head/sys/dev/iwm/if_iwm_util.c ============================================================================== --- head/sys/dev/iwm/if_iwm_util.c Thu Jun 23 01:11:52 2016 (r302103) +++ head/sys/dev/iwm/if_iwm_util.c Thu Jun 23 01:13:30 2016 (r302104) @@ -157,19 +157,6 @@ __FBSDID("$FreeBSD$"); #include #include -static void -iwm_dma_map_mem(void *arg, bus_dma_segment_t *segs, int nsegs, int error) -{ - if (error != 0) - return; - KASSERT(nsegs <= 2, ("too many DMA segments, %d should be <= 2", - nsegs)); - if (nsegs > 1) - KASSERT(segs[1].ds_addr == segs[0].ds_addr + segs[0].ds_len, - ("fragmented DMA memory")); - *(bus_addr_t *)arg = segs[0].ds_addr; -} - /* * Send a command to the firmware. We try to implement the Linux * driver interface for the routine. @@ -183,12 +170,15 @@ iwm_send_cmd(struct iwm_softc *sc, struc struct iwm_tx_ring *ring = &sc->txq[IWM_MVM_CMD_QUEUE]; struct iwm_tfd *desc; struct iwm_tx_data *data; - struct iwm_device_cmd *cmd = NULL; + struct iwm_device_cmd *cmd; + struct mbuf *m; + bus_dma_segment_t seg; bus_addr_t paddr; uint32_t addr_lo; int error = 0, i, paylen, off; int code; int async, wantresp; + int nsegs; code = hcmd->id; async = hcmd->flags & IWM_CMD_ASYNC; @@ -231,15 +221,24 @@ iwm_send_cmd(struct iwm_softc *sc, struc error = EINVAL; goto out; } - error = bus_dmamem_alloc(ring->data_dmat, (void **)&cmd, - BUS_DMA_NOWAIT | BUS_DMA_COHERENT, &data->map); - if (error != 0) + m = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, IWM_RBUF_SIZE); + if (m == NULL) { + error = ENOBUFS; goto out; - error = bus_dmamap_load(ring->data_dmat, data->map, - cmd, paylen + sizeof(cmd->hdr), iwm_dma_map_mem, - &paddr, BUS_DMA_NOWAIT); - if (error != 0) + } + + m->m_len = m->m_pkthdr.len = m->m_ext.ext_size; + error = bus_dmamap_load_mbuf_sg(ring->data_dmat, + data->map, m, &seg, &nsegs, BUS_DMA_NOWAIT); + if (error != 0) { + device_printf(sc->sc_dev, + "%s: can't map mbuf, error %d\n", __func__, error); + m_freem(m); goto out; + } + data->m = m; /* mbuf will be freed in iwm_cmd_done() */ + cmd = mtod(m, struct iwm_device_cmd *); + paddr = seg.ds_addr; } else { cmd = &ring->cmd[ring->cur]; paddr = data->cmd_paddr; @@ -319,8 +318,6 @@ iwm_send_cmd(struct iwm_softc *sc, struc } } out: - if (cmd && paylen > sizeof(cmd->data)) - bus_dmamem_free(ring->data_dmat, cmd, data->map); if (wantresp && error != 0) { iwm_free_resp(sc, hcmd); } From owner-svn-src-head@freebsd.org Thu Jun 23 01:14:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E8B2B72FA1; Thu, 23 Jun 2016 01:14:35 +0000 (UTC) (envelope-from adrian@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 DF8CD2D48; Thu, 23 Jun 2016 01:14:34 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N1EYdN084135; Thu, 23 Jun 2016 01:14:34 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N1EXLP084132; Thu, 23 Jun 2016 01:14:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606230114.u5N1EXLP084132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 23 Jun 2016 01:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302105 - in head/sys/dev/bhnd: . bcma bhndb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 01:14:35 -0000 Author: adrian Date: Thu Jun 23 01:14:33 2016 New Revision: 302105 URL: https://svnweb.freebsd.org/changeset/base/302105 Log: [BHND/bcma] Add implementation of BHND_BUS_RESET_CORE function for BCMA This patch addes missing implementation of BHND_BUS_RESET_CORE function for BCMA. The reset procedure is very simple: enable reset mode, stop clocking, enable clocking & force clock gating, disable reset mode, stop clock gating. Tested: * (michael) Tested on ASUS RT-N53 for enabling/reset USB core Submitted by: Michael Zhilin Approved by: re (gjb) Modified: head/sys/dev/bhnd/bcma/bcma.c head/sys/dev/bhnd/bhnd_core.h head/sys/dev/bhnd/bhndb/bhndb.c Modified: head/sys/dev/bhnd/bcma/bcma.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma.c Thu Jun 23 01:13:30 2016 (r302104) +++ head/sys/dev/bhnd/bcma/bcma.c Thu Jun 23 01:14:33 2016 (r302105) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "bcma_eromreg.h" #include "bcma_eromvar.h" +#include int bcma_probe(device_t dev) @@ -218,9 +219,33 @@ bcma_reset_core(device_t dev, device_t c if (dinfo->res_agent == NULL) return (ENODEV); - // TODO - perform reset + /* Start reset */ + bhnd_bus_write_4(dinfo->res_agent, BHND_RESET_CF, BHND_RESET_CF_ENABLE); + bhnd_bus_read_4(dinfo->res_agent, BHND_RESET_CF); + DELAY(10); + + /* Disable clock */ + bhnd_bus_write_4(dinfo->res_agent, BHND_CF, flags); + bhnd_bus_read_4(dinfo->res_agent, BHND_CF); + DELAY(10); + + /* Enable clocks & force clock gating */ + bhnd_bus_write_4(dinfo->res_agent, BHND_CF, BHND_CF_CLOCK_EN | + BHND_CF_FGC | flags); + bhnd_bus_read_4(dinfo->res_agent, BHND_CF); + DELAY(10); + + /* Complete reset */ + bhnd_bus_write_4(dinfo->res_agent, BHND_RESET_CF, 0); + bhnd_bus_read_4(dinfo->res_agent, BHND_RESET_CF); + DELAY(10); + + /* Release force clock gating */ + bhnd_bus_write_4(dinfo->res_agent, BHND_CF, BHND_CF_CLOCK_EN | flags); + bhnd_bus_read_4(dinfo->res_agent, BHND_CF); + DELAY(10); - return (ENXIO); + return (0); } static int Modified: head/sys/dev/bhnd/bhnd_core.h ============================================================================== --- head/sys/dev/bhnd/bhnd_core.h Thu Jun 23 01:13:30 2016 (r302104) +++ head/sys/dev/bhnd/bhnd_core.h Thu Jun 23 01:14:33 2016 (r302105) @@ -25,19 +25,27 @@ #define _BHND_BHND_CORE_H_ /* Common core control flags */ -#define BHND_CF_BIST_EN 0x8000 /**< ??? */ +#define BHND_CF 0x0408 +#define BHND_CF_BIST_EN 0x8000 /**< built-in self test */ #define BHND_CF_PME_EN 0x4000 /**< ??? */ #define BHND_CF_CORE_BITS 0x3ffc /**< core specific flag mask */ #define BHND_CF_FGC 0x0002 /**< force clock gating */ #define BHND_CF_CLOCK_EN 0x0001 /**< enable clock */ /* Common core status flags */ +#define BHND_SF 0x0500 #define BHND_SF_BIST_DONE 0x8000 /**< ??? */ #define BHND_SF_BIST_ERROR 0x4000 /**< ??? */ #define BHND_SF_GATED_CLK 0x2000 /**< clock gated */ #define BHND_SF_DMA64 0x1000 /**< supports 64-bit DMA */ #define BHND_SF_CORE_BITS 0x0fff /**< core-specific status mask */ +/*Reset core control flags */ +#define BHND_RESET_CF 0x0800 +#define BHND_RESET_CF_ENABLE 0x0001 + +#define BHND_RESET_SF 0x0804 + /* * A register that is common to all cores to * communicate w/PMU regarding clock control. Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Thu Jun 23 01:13:30 2016 (r302104) +++ head/sys/dev/bhnd/bhndb/bhndb.c Thu Jun 23 01:14:33 2016 (r302105) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); #include "bhndb_private.h" /* Debugging flags */ -static u_long bhndb_debug = 0; +static u_long bhndb_debug = -1; TUNABLE_ULONG("hw.bhndb.debug", &bhndb_debug); enum { @@ -596,8 +596,10 @@ bhndb_generic_init_full_config(device_t hostb = NULL; /* Fetch the full set of bhnd-attached cores */ - if ((error = device_get_children(sc->bus_dev, &devs, &ndevs))) + if ((error = device_get_children(sc->bus_dev, &devs, &ndevs))) { + device_printf(sc->dev, "unable to get children\n"); return (error); + } /* Find our host bridge device */ hostb = BHNDB_FIND_HOSTB_DEVICE(dev, child); From owner-svn-src-head@freebsd.org Thu Jun 23 01:15:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0794B72070; Thu, 23 Jun 2016 01:15:36 +0000 (UTC) (envelope-from adrian@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 BDCBF2EA7; Thu, 23 Jun 2016 01:15:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N1FZIY084246; Thu, 23 Jun 2016 01:15:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N1FZVI084245; Thu, 23 Jun 2016 01:15:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606230115.u5N1FZVI084245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 23 Jun 2016 01:15:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302106 - head/sys/dev/bhnd/bhndb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 01:15:37 -0000 Author: adrian Date: Thu Jun 23 01:15:35 2016 New Revision: 302106 URL: https://svnweb.freebsd.org/changeset/base/302106 Log: revert error commit from previous commit. my bad! Approved by: re (implicit) Modified: head/sys/dev/bhnd/bhndb/bhndb.c Modified: head/sys/dev/bhnd/bhndb/bhndb.c ============================================================================== --- head/sys/dev/bhnd/bhndb/bhndb.c Thu Jun 23 01:14:33 2016 (r302105) +++ head/sys/dev/bhnd/bhndb/bhndb.c Thu Jun 23 01:15:35 2016 (r302106) @@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$"); #include "bhndb_private.h" /* Debugging flags */ -static u_long bhndb_debug = -1; +static u_long bhndb_debug = 0; TUNABLE_ULONG("hw.bhndb.debug", &bhndb_debug); enum { From owner-svn-src-head@freebsd.org Thu Jun 23 02:53:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE668B73767; Thu, 23 Jun 2016 02:53:01 +0000 (UTC) (envelope-from np@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 A55B82059; Thu, 23 Jun 2016 02:53:01 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N2r0Tg021628; Thu, 23 Jun 2016 02:53:00 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N2r0lM021624; Thu, 23 Jun 2016 02:53:00 GMT (envelope-from np@FreeBSD.org) Message-Id: <201606230253.u5N2r0lM021624@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 23 Jun 2016 02:53:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302110 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 02:53:02 -0000 Author: np Date: Thu Jun 23 02:53:00 2016 New Revision: 302110 URL: https://svnweb.freebsd.org/changeset/base/302110 Log: cxgbe(4): Merge netmap support from the ncxgbe/ncxl interfaces to the vcxgbe/vcxl interfaces and retire the 'n' interfaces. The main cxgbe/cxl interfaces and tunables related to them are not affected by any of this and will continue to operate as usual. The driver used to create an additional 'n' interface for every cxgbe/cxl interface if "device netmap" was in the kernel. The 'n' interface shared the wire with the main interface but was otherwise autonomous (with its own MAC address, etc.). It did not have normal tx/rx but had a specialized netmap-only data path. r291665 added another set of virtual interfaces (the 'v' interfaces) to the driver. These had normal tx/rx but no netmap support. This revision consolidates the features of both the interfaces into the 'v' interface which now has a normal data path, TOE support, and native netmap support. The 'v' interfaces need to be created explicitly with the hw.cxgbe.num_vis tunable. This means "device netmap" will not result in the automatic creation of any virtual interfaces. The following tunables can be used to override the default number of queues allocated for each 'v' interface. nofld* = 0 will disable TOE on the virtual interface and nnm* = 0 to will disable native netmap support. # number of normal NIC queues hw.cxgbe.ntxq_vi hw.cxgbe.nrxq_vi # number of TOE queues hw.cxgbe.nofldtxq_vi hw.cxgbe.nofldrxq_vi # number of netmap queues hw.cxgbe.nnmtxq_vi hw.cxgbe.nnmrxq_vi hw.cxgbe.nnm{t,r}xq{10,1}g tunables have been removed. --- tl;dr version --- The workflow for netmap on cxgbe starting with FreeBSD 11 is: 1) "device netmap" in the kernel config. 2) "hw.cxgbe.num_vis=2" in loader.conf. num_vis > 2 is ok too, you'll end up with multiple autonomous netmap-capable interfaces for every port. 3) "dmesg | grep vcxl | grep netmap" to verify that the interface has netmap queues. 4) Use any of the 'v' interfaces for netmap. pkt-gen -i vcxl... . One major improvement is that the netmap interface has a normal data path as expected. 5) Just ignore the cxl interfaces if you want to use netmap only. No need to bring them up. The vcxl interfaces are completely independent and everything should just work. --------------------- Approved by: re@ (gjb@) Relnotes: Yes Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/cxgbe/t4_sge.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Thu Jun 23 02:37:24 2016 (r302109) +++ head/sys/dev/cxgbe/adapter.h Thu Jun 23 02:53:00 2016 (r302110) @@ -208,7 +208,6 @@ enum { INTR_RXQ = (1 << 4), /* All NIC rxq's take interrupts */ INTR_OFLD_RXQ = (1 << 5), /* All TOE rxq's take interrupts */ INTR_ALL = (INTR_RXQ | INTR_OFLD_RXQ), - VI_NETMAP = (1 << 6), /* adapter debug_flags */ DF_DUMP_MBOX = (1 << 0), @@ -230,7 +229,7 @@ struct vi_info { unsigned long flags; int if_flags; - uint16_t *rss; + uint16_t *rss, *nm_rss; uint16_t viid; int16_t xact_addr_filt;/* index of exact MAC address filter */ uint16_t rss_size; /* size of VI's RSS table slice */ @@ -251,6 +250,10 @@ struct vi_info { int first_ofld_txq; /* index of first offload tx queue */ int nofldrxq; /* # of offload rx queues */ int first_ofld_rxq; /* index of first offload rx queue */ + int nnmtxq; + int first_nm_txq; + int nnmrxq; + int first_nm_rxq; int tmr_idx; int pktc_idx; int qsize_rxq; @@ -362,6 +365,11 @@ enum { IQS_DISABLED = 0, IQS_BUSY = 1, IQS_IDLE = 2, + + /* netmap related flags */ + NM_OFF = 0, + NM_ON = 1, + NM_BUSY = 2, }; /* @@ -765,8 +773,11 @@ struct adapter { struct irq { struct resource *res; int rid; + volatile int nm_state; /* NM_OFF, NM_ON, or NM_BUSY */ void *tag; - } *irq; + struct sge_rxq *rxq; + struct sge_nm_rxq *nm_rxq; + } __aligned(CACHE_LINE_SIZE) *irq; bus_dma_tag_t dmat; /* Parent DMA tag */ @@ -911,11 +922,11 @@ struct adapter { for (q = &vi->pi->adapter->sge.ofld_rxq[vi->first_ofld_rxq], iter = 0; \ iter < vi->nofldrxq; ++iter, ++q) #define for_each_nm_txq(vi, iter, q) \ - for (q = &vi->pi->adapter->sge.nm_txq[vi->first_txq], iter = 0; \ - iter < vi->ntxq; ++iter, ++q) + for (q = &vi->pi->adapter->sge.nm_txq[vi->first_nm_txq], iter = 0; \ + iter < vi->nnmtxq; ++iter, ++q) #define for_each_nm_rxq(vi, iter, q) \ - for (q = &vi->pi->adapter->sge.nm_rxq[vi->first_rxq], iter = 0; \ - iter < vi->nrxq; ++iter, ++q) + for (q = &vi->pi->adapter->sge.nm_rxq[vi->first_nm_rxq], iter = 0; \ + iter < vi->nnmrxq; ++iter, ++q) #define for_each_vi(_pi, _iter, _vi) \ for ((_vi) = (_pi)->vi, (_iter) = 0; (_iter) < (_pi)->nvi; \ ++(_iter), ++(_vi)) @@ -1087,8 +1098,8 @@ void vi_tick(void *); #ifdef DEV_NETMAP /* t4_netmap.c */ -int create_netmap_ifnet(struct port_info *); -int destroy_netmap_ifnet(struct port_info *); +void cxgbe_nm_attach(struct vi_info *); +void cxgbe_nm_detach(struct vi_info *); void t4_nm_intr(void *); #endif @@ -1109,6 +1120,7 @@ int t4_setup_vi_queues(struct vi_info *) int t4_teardown_vi_queues(struct vi_info *); void t4_intr_all(void *); void t4_intr(void *); +void t4_vi_intr(void *); void t4_intr_err(void *); void t4_intr_evt(void *); void t4_wrq_tx_locked(struct adapter *, struct sge_wrq *, struct wrqe *); Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Jun 23 02:37:24 2016 (r302109) +++ head/sys/dev/cxgbe/t4_main.c Thu Jun 23 02:53:00 2016 (r302110) @@ -230,6 +230,14 @@ TUNABLE_INT("hw.cxgbe.ntxq1g", &t4_ntxq1 static int t4_nrxq1g = -1; TUNABLE_INT("hw.cxgbe.nrxq1g", &t4_nrxq1g); +#define NTXQ_VI 1 +static int t4_ntxq_vi = -1; +TUNABLE_INT("hw.cxgbe.ntxq_vi", &t4_ntxq_vi); + +#define NRXQ_VI 1 +static int t4_nrxq_vi = -1; +TUNABLE_INT("hw.cxgbe.nrxq_vi", &t4_nrxq_vi); + static int t4_rsrv_noflowq = 0; TUNABLE_INT("hw.cxgbe.rsrv_noflowq", &t4_rsrv_noflowq); @@ -249,24 +257,24 @@ TUNABLE_INT("hw.cxgbe.nofldtxq1g", &t4_n #define NOFLDRXQ_1G 1 static int t4_nofldrxq1g = -1; TUNABLE_INT("hw.cxgbe.nofldrxq1g", &t4_nofldrxq1g); + +#define NOFLDTXQ_VI 1 +static int t4_nofldtxq_vi = -1; +TUNABLE_INT("hw.cxgbe.nofldtxq_vi", &t4_nofldtxq_vi); + +#define NOFLDRXQ_VI 1 +static int t4_nofldrxq_vi = -1; +TUNABLE_INT("hw.cxgbe.nofldrxq_vi", &t4_nofldrxq_vi); #endif #ifdef DEV_NETMAP -#define NNMTXQ_10G 2 -static int t4_nnmtxq10g = -1; -TUNABLE_INT("hw.cxgbe.nnmtxq10g", &t4_nnmtxq10g); - -#define NNMRXQ_10G 2 -static int t4_nnmrxq10g = -1; -TUNABLE_INT("hw.cxgbe.nnmrxq10g", &t4_nnmrxq10g); - -#define NNMTXQ_1G 1 -static int t4_nnmtxq1g = -1; -TUNABLE_INT("hw.cxgbe.nnmtxq1g", &t4_nnmtxq1g); - -#define NNMRXQ_1G 1 -static int t4_nnmrxq1g = -1; -TUNABLE_INT("hw.cxgbe.nnmrxq1g", &t4_nnmrxq1g); +#define NNMTXQ_VI 2 +static int t4_nnmtxq_vi = -1; +TUNABLE_INT("hw.cxgbe.nnmtxq_vi", &t4_nnmtxq_vi); + +#define NNMRXQ_VI 2 +static int t4_nnmrxq_vi = -1; +TUNABLE_INT("hw.cxgbe.nnmrxq_vi", &t4_nnmrxq_vi); #endif /* @@ -387,18 +395,18 @@ struct intrs_and_queues { uint16_t ntxq1g; /* # of NIC txq's for each 1G port */ uint16_t nrxq1g; /* # of NIC rxq's for each 1G port */ uint16_t rsrv_noflowq; /* Flag whether to reserve queue 0 */ -#ifdef TCP_OFFLOAD uint16_t nofldtxq10g; /* # of TOE txq's for each 10G port */ uint16_t nofldrxq10g; /* # of TOE rxq's for each 10G port */ uint16_t nofldtxq1g; /* # of TOE txq's for each 1G port */ uint16_t nofldrxq1g; /* # of TOE rxq's for each 1G port */ -#endif -#ifdef DEV_NETMAP - uint16_t nnmtxq10g; /* # of netmap txq's for each 10G port */ - uint16_t nnmrxq10g; /* # of netmap rxq's for each 10G port */ - uint16_t nnmtxq1g; /* # of netmap txq's for each 1G port */ - uint16_t nnmrxq1g; /* # of netmap rxq's for each 1G port */ -#endif + + /* The vcxgbe/vcxl interfaces use these and not the ones above. */ + uint16_t ntxq_vi; /* # of NIC txq's */ + uint16_t nrxq_vi; /* # of NIC rxq's */ + uint16_t nofldtxq_vi; /* # of TOE txq's */ + uint16_t nofldrxq_vi; /* # of TOE rxq's */ + uint16_t nnmtxq_vi; /* # of netmap txq's */ + uint16_t nnmrxq_vi; /* # of netmap rxq's */ }; struct filter_entry { @@ -802,10 +810,10 @@ t4_attach(device_t dev) goto done; /* error message displayed already */ /* - * Number of VIs to create per-port. The first VI is the - * "main" regular VI for the port. The second VI is used for - * netmap if present, and any remaining VIs are used for - * additional virtual interfaces. + * Number of VIs to create per-port. The first VI is the "main" regular + * VI for the port. The rest are additional virtual interfaces on the + * same physical port. Note that the main VI does not have native + * netmap support but the extra VIs do. * * Limit the number of VIs per port to the number of available * MAC addresses per port. @@ -814,9 +822,6 @@ t4_attach(device_t dev) num_vis = t4_num_vis; else num_vis = 1; -#ifdef DEV_NETMAP - num_vis++; -#endif if (num_vis > nitems(vi_mac_funcs)) { num_vis = nitems(vi_mac_funcs); device_printf(dev, "Number of VIs limited to %d\n", num_vis); @@ -831,7 +836,6 @@ t4_attach(device_t dev) n10g = n1g = 0; for_each_port(sc, i) { struct port_info *pi; - struct vi_info *vi; pi = malloc(sizeof(*pi), M_CXGBE, M_ZERO | M_WAITOK); sc->port[i] = pi; @@ -839,7 +843,10 @@ t4_attach(device_t dev) /* These must be set before t4_port_init */ pi->adapter = sc; pi->port_id = i; - pi->nvi = num_vis; + /* + * XXX: vi[0] is special so we can't delay this allocation until + * pi->nvi's final value is known. + */ pi->vi = malloc(sizeof(struct vi_info) * num_vis, M_CXGBE, M_ZERO | M_WAITOK); @@ -881,26 +888,12 @@ t4_attach(device_t dev) if (is_10G_port(pi) || is_40G_port(pi)) { n10g++; - for_each_vi(pi, j, vi) { - vi->tmr_idx = t4_tmr_idx_10g; - vi->pktc_idx = t4_pktc_idx_10g; - } } else { n1g++; - for_each_vi(pi, j, vi) { - vi->tmr_idx = t4_tmr_idx_1g; - vi->pktc_idx = t4_pktc_idx_1g; - } } pi->linkdnrc = -1; - for_each_vi(pi, j, vi) { - vi->qsize_rxq = t4_qsize_rxq; - vi->qsize_txq = t4_qsize_txq; - vi->pi = pi; - } - pi->dev = device_add_child(dev, is_t4(sc) ? "cxgbe" : "cxl", -1); if (pi->dev == NULL) { device_printf(dev, @@ -915,12 +908,11 @@ t4_attach(device_t dev) /* * Interrupt type, # of interrupts, # of rx/tx queues, etc. */ -#ifdef DEV_NETMAP - num_vis--; -#endif rc = cfg_itype_and_nqueues(sc, n10g, n1g, num_vis, &iaq); if (rc != 0) goto done; /* error message displayed already */ + if (iaq.nrxq_vi + iaq.nofldrxq_vi + iaq.nnmrxq_vi == 0) + num_vis = 1; sc->intr_type = iaq.intr_type; sc->intr_count = iaq.nirq; @@ -929,8 +921,8 @@ t4_attach(device_t dev) s->nrxq = n10g * iaq.nrxq10g + n1g * iaq.nrxq1g; s->ntxq = n10g * iaq.ntxq10g + n1g * iaq.ntxq1g; if (num_vis > 1) { - s->nrxq += (n10g + n1g) * (num_vis - 1); - s->ntxq += (n10g + n1g) * (num_vis - 1); + s->nrxq += (n10g + n1g) * (num_vis - 1) * iaq.nrxq_vi; + s->ntxq += (n10g + n1g) * (num_vis - 1) * iaq.ntxq_vi; } s->neq = s->ntxq + s->nrxq; /* the free list in an rxq is an eq */ s->neq += sc->params.nports + 1;/* ctrl queues: 1 per port + 1 mgmt */ @@ -940,8 +932,10 @@ t4_attach(device_t dev) s->nofldrxq = n10g * iaq.nofldrxq10g + n1g * iaq.nofldrxq1g; s->nofldtxq = n10g * iaq.nofldtxq10g + n1g * iaq.nofldtxq1g; if (num_vis > 1) { - s->nofldrxq += (n10g + n1g) * (num_vis - 1); - s->nofldtxq += (n10g + n1g) * (num_vis - 1); + s->nofldrxq += (n10g + n1g) * (num_vis - 1) * + iaq.nofldrxq_vi; + s->nofldtxq += (n10g + n1g) * (num_vis - 1) * + iaq.nofldtxq_vi; } s->neq += s->nofldtxq + s->nofldrxq; s->niq += s->nofldrxq; @@ -953,8 +947,10 @@ t4_attach(device_t dev) } #endif #ifdef DEV_NETMAP - s->nnmrxq = n10g * iaq.nnmrxq10g + n1g * iaq.nnmrxq1g; - s->nnmtxq = n10g * iaq.nnmtxq10g + n1g * iaq.nnmtxq1g; + if (num_vis > 1) { + s->nnmrxq = (n10g + n1g) * (num_vis - 1) * iaq.nnmrxq_vi; + s->nnmtxq = (n10g + n1g) * (num_vis - 1) * iaq.nnmtxq_vi; + } s->neq += s->nnmtxq + s->nnmrxq; s->niq += s->nnmrxq; @@ -998,62 +994,64 @@ t4_attach(device_t dev) if (pi == NULL) continue; + pi->nvi = num_vis; for_each_vi(pi, j, vi) { -#ifdef DEV_NETMAP - if (j == 1) { - vi->flags |= VI_NETMAP | INTR_RXQ; - vi->first_rxq = nm_rqidx; - vi->first_txq = nm_tqidx; - if (is_10G_port(pi) || is_40G_port(pi)) { - vi->nrxq = iaq.nnmrxq10g; - vi->ntxq = iaq.nnmtxq10g; - } else { - vi->nrxq = iaq.nnmrxq1g; - vi->ntxq = iaq.nnmtxq1g; - } - nm_rqidx += vi->nrxq; - nm_tqidx += vi->ntxq; - continue; - } -#endif + vi->pi = pi; + vi->qsize_rxq = t4_qsize_rxq; + vi->qsize_txq = t4_qsize_txq; vi->first_rxq = rqidx; vi->first_txq = tqidx; if (is_10G_port(pi) || is_40G_port(pi)) { + vi->tmr_idx = t4_tmr_idx_10g; + vi->pktc_idx = t4_pktc_idx_10g; vi->flags |= iaq.intr_flags_10g & INTR_RXQ; - vi->nrxq = j == 0 ? iaq.nrxq10g : 1; - vi->ntxq = j == 0 ? iaq.ntxq10g : 1; + vi->nrxq = j == 0 ? iaq.nrxq10g : iaq.nrxq_vi; + vi->ntxq = j == 0 ? iaq.ntxq10g : iaq.ntxq_vi; } else { + vi->tmr_idx = t4_tmr_idx_1g; + vi->pktc_idx = t4_pktc_idx_1g; vi->flags |= iaq.intr_flags_1g & INTR_RXQ; - vi->nrxq = j == 0 ? iaq.nrxq1g : 1; - vi->ntxq = j == 0 ? iaq.ntxq1g : 1; + vi->nrxq = j == 0 ? iaq.nrxq1g : iaq.nrxq_vi; + vi->ntxq = j == 0 ? iaq.ntxq1g : iaq.ntxq_vi; } + rqidx += vi->nrxq; + tqidx += vi->ntxq; - if (vi->ntxq > 1) + if (j == 0 && vi->ntxq > 1) vi->rsrv_noflowq = iaq.rsrv_noflowq ? 1 : 0; else vi->rsrv_noflowq = 0; - rqidx += vi->nrxq; - tqidx += vi->ntxq; - #ifdef TCP_OFFLOAD - if (!is_offload(sc)) - continue; vi->first_ofld_rxq = ofld_rqidx; vi->first_ofld_txq = ofld_tqidx; if (is_10G_port(pi) || is_40G_port(pi)) { vi->flags |= iaq.intr_flags_10g & INTR_OFLD_RXQ; - vi->nofldrxq = j == 0 ? iaq.nofldrxq10g : 1; - vi->nofldtxq = j == 0 ? iaq.nofldtxq10g : 1; + vi->nofldrxq = j == 0 ? iaq.nofldrxq10g : + iaq.nofldrxq_vi; + vi->nofldtxq = j == 0 ? iaq.nofldtxq10g : + iaq.nofldtxq_vi; } else { vi->flags |= iaq.intr_flags_1g & INTR_OFLD_RXQ; - vi->nofldrxq = j == 0 ? iaq.nofldrxq1g : 1; - vi->nofldtxq = j == 0 ? iaq.nofldtxq1g : 1; + vi->nofldrxq = j == 0 ? iaq.nofldrxq1g : + iaq.nofldrxq_vi; + vi->nofldtxq = j == 0 ? iaq.nofldtxq1g : + iaq.nofldtxq_vi; } ofld_rqidx += vi->nofldrxq; ofld_tqidx += vi->nofldtxq; #endif +#ifdef DEV_NETMAP + if (j > 0) { + vi->first_nm_rxq = nm_rqidx; + vi->first_nm_txq = nm_tqidx; + vi->nnmrxq = iaq.nnmrxq_vi; + vi->nnmtxq = iaq.nnmtxq_vi; + nm_rqidx += vi->nnmrxq; + nm_tqidx += vi->nnmtxq; + } +#endif } } @@ -1275,7 +1273,10 @@ cxgbe_vi_attach(device_t dev, struct vi_ EVENTHANDLER_PRI_ANY); ether_ifattach(ifp, vi->hw_addr); - +#ifdef DEV_NETMAP + if (vi->nnmrxq != 0) + cxgbe_nm_attach(vi); +#endif sb = sbuf_new_auto(); sbuf_printf(sb, "%d txq, %d rxq (NIC)", vi->ntxq, vi->nrxq); #ifdef TCP_OFFLOAD @@ -1283,6 +1284,11 @@ cxgbe_vi_attach(device_t dev, struct vi_ sbuf_printf(sb, "; %d txq, %d rxq (TOE)", vi->nofldtxq, vi->nofldrxq); #endif +#ifdef DEV_NETMAP + if (ifp->if_capabilities & IFCAP_NETMAP) + sbuf_printf(sb, "; %d txq, %d rxq (netmap)", + vi->nnmtxq, vi->nnmrxq); +#endif sbuf_finish(sb); device_printf(dev, "%s\n", sbuf_data(sb)); sbuf_delete(sb); @@ -1308,21 +1314,8 @@ cxgbe_attach(device_t dev) for_each_vi(pi, i, vi) { if (i == 0) continue; -#ifdef DEV_NETMAP - if (vi->flags & VI_NETMAP) { - /* - * media handled here to keep - * implementation private to this file - */ - ifmedia_init(&vi->media, IFM_IMASK, cxgbe_media_change, - cxgbe_media_status); - build_medialist(pi, &vi->media); - vi->dev = device_add_child(dev, is_t4(pi->adapter) ? - "ncxgbe" : "ncxl", device_get_unit(dev)); - } else -#endif - vi->dev = device_add_child(dev, is_t4(pi->adapter) ? - "vcxgbe" : "vcxl", -1); + vi->dev = device_add_child(dev, is_t4(pi->adapter) ? + "vcxgbe" : "vcxl", -1); if (vi->dev == NULL) { device_printf(dev, "failed to add VI %d\n", i); continue; @@ -1348,6 +1341,10 @@ cxgbe_vi_detach(struct vi_info *vi) EVENTHANDLER_DEREGISTER(vlan_config, vi->vlan_c); /* Let detach proceed even if these fail. */ +#ifdef DEV_NETMAP + if (ifp->if_capabilities & IFCAP_NETMAP) + cxgbe_nm_detach(vi); +#endif cxgbe_uninit_synchronized(vi); callout_drain(&vi->tick); vi_full_uninit(vi); @@ -1710,7 +1707,7 @@ vi_get_counter(struct ifnet *ifp, ift_co uint64_t drops; drops = 0; - if ((vi->flags & (VI_INIT_DONE | VI_NETMAP)) == VI_INIT_DONE) { + if (vi->flags & VI_INIT_DONE) { int i; struct sge_txq *txq; @@ -2379,28 +2376,29 @@ cfg_itype_and_nqueues(struct adapter *sc { int rc, itype, navail, nrxq10g, nrxq1g, n; int nofldrxq10g = 0, nofldrxq1g = 0; - int nnmrxq10g = 0, nnmrxq1g = 0; bzero(iaq, sizeof(*iaq)); iaq->ntxq10g = t4_ntxq10g; iaq->ntxq1g = t4_ntxq1g; + iaq->ntxq_vi = t4_ntxq_vi; iaq->nrxq10g = nrxq10g = t4_nrxq10g; iaq->nrxq1g = nrxq1g = t4_nrxq1g; + iaq->nrxq_vi = t4_nrxq_vi; iaq->rsrv_noflowq = t4_rsrv_noflowq; #ifdef TCP_OFFLOAD if (is_offload(sc)) { iaq->nofldtxq10g = t4_nofldtxq10g; iaq->nofldtxq1g = t4_nofldtxq1g; + iaq->nofldtxq_vi = t4_nofldtxq_vi; iaq->nofldrxq10g = nofldrxq10g = t4_nofldrxq10g; iaq->nofldrxq1g = nofldrxq1g = t4_nofldrxq1g; + iaq->nofldrxq_vi = t4_nofldrxq_vi; } #endif #ifdef DEV_NETMAP - iaq->nnmtxq10g = t4_nnmtxq10g; - iaq->nnmtxq1g = t4_nnmtxq1g; - iaq->nnmrxq10g = nnmrxq10g = t4_nnmrxq10g; - iaq->nnmrxq1g = nnmrxq1g = t4_nnmrxq1g; + iaq->nnmtxq_vi = t4_nnmtxq_vi; + iaq->nnmrxq_vi = t4_nnmrxq_vi; #endif for (itype = INTR_MSIX; itype; itype >>= 1) { @@ -2424,14 +2422,17 @@ restart: /* * Best option: an interrupt vector for errors, one for the - * firmware event queue, and one for every rxq (NIC, TOE, and - * netmap). + * firmware event queue, and one for every rxq (NIC and TOE) of + * every VI. The VIs that support netmap use the same + * interrupts for the NIC rx queues and the netmap rx queues + * because only one set of queues is active at a time. */ iaq->nirq = T4_EXTRA_INTR; - iaq->nirq += n10g * (nrxq10g + nofldrxq10g + nnmrxq10g); - iaq->nirq += n10g * 2 * (num_vis - 1); - iaq->nirq += n1g * (nrxq1g + nofldrxq1g + nnmrxq1g); - iaq->nirq += n1g * 2 * (num_vis - 1); + iaq->nirq += n10g * (nrxq10g + nofldrxq10g); + iaq->nirq += n1g * (nrxq1g + nofldrxq1g); + iaq->nirq += (n10g + n1g) * (num_vis - 1) * + max(iaq->nrxq_vi, iaq->nnmrxq_vi); /* See comment above. */ + iaq->nirq += (n10g + n1g) * (num_vis - 1) * iaq->nofldrxq_vi; if (iaq->nirq <= navail && (itype != INTR_MSI || powerof2(iaq->nirq))) { iaq->intr_flags_10g = INTR_ALL; @@ -2439,43 +2440,44 @@ restart: goto allocate; } + /* Disable the VIs (and netmap) if there aren't enough intrs */ + if (num_vis > 1) { + device_printf(sc->dev, "virtual interfaces disabled " + "because num_vis=%u with current settings " + "(nrxq10g=%u, nrxq1g=%u, nofldrxq10g=%u, " + "nofldrxq1g=%u, nrxq_vi=%u nofldrxq_vi=%u, " + "nnmrxq_vi=%u) would need %u interrupts but " + "only %u are available.\n", num_vis, nrxq10g, + nrxq1g, nofldrxq10g, nofldrxq1g, iaq->nrxq_vi, + iaq->nofldrxq_vi, iaq->nnmrxq_vi, iaq->nirq, + navail); + num_vis = 1; + iaq->ntxq_vi = iaq->nrxq_vi = 0; + iaq->nofldtxq_vi = iaq->nofldrxq_vi = 0; + iaq->nnmtxq_vi = iaq->nnmrxq_vi = 0; + goto restart; + } + /* * Second best option: a vector for errors, one for the firmware * event queue, and vectors for either all the NIC rx queues or * all the TOE rx queues. The queues that don't get vectors * will forward their interrupts to those that do. - * - * Note: netmap rx queues cannot be created early and so they - * can't be setup to receive forwarded interrupts for others. */ iaq->nirq = T4_EXTRA_INTR; if (nrxq10g >= nofldrxq10g) { iaq->intr_flags_10g = INTR_RXQ; iaq->nirq += n10g * nrxq10g; - iaq->nirq += n10g * (num_vis - 1); -#ifdef DEV_NETMAP - iaq->nnmrxq10g = min(nnmrxq10g, nrxq10g); -#endif } else { iaq->intr_flags_10g = INTR_OFLD_RXQ; iaq->nirq += n10g * nofldrxq10g; -#ifdef DEV_NETMAP - iaq->nnmrxq10g = min(nnmrxq10g, nofldrxq10g); -#endif } if (nrxq1g >= nofldrxq1g) { iaq->intr_flags_1g = INTR_RXQ; iaq->nirq += n1g * nrxq1g; - iaq->nirq += n1g * (num_vis - 1); -#ifdef DEV_NETMAP - iaq->nnmrxq1g = min(nnmrxq1g, nrxq1g); -#endif } else { iaq->intr_flags_1g = INTR_OFLD_RXQ; iaq->nirq += n1g * nofldrxq1g; -#ifdef DEV_NETMAP - iaq->nnmrxq1g = min(nnmrxq1g, nofldrxq1g); -#endif } if (iaq->nirq <= navail && (itype != INTR_MSI || powerof2(iaq->nirq))) @@ -2483,12 +2485,12 @@ restart: /* * Next best option: an interrupt vector for errors, one for the - * firmware event queue, and at least one per VI. At this - * point we know we'll have to downsize nrxq and/or nofldrxq - * and/or nnmrxq to fit what's available to us. + * firmware event queue, and at least one per main-VI. At this + * point we know we'll have to downsize nrxq and/or nofldrxq to + * fit what's available to us. */ iaq->nirq = T4_EXTRA_INTR; - iaq->nirq += (n10g + n1g) * num_vis; + iaq->nirq += n10g + n1g; if (iaq->nirq <= navail) { int leftover = navail - iaq->nirq; @@ -2508,9 +2510,6 @@ restart: #ifdef TCP_OFFLOAD iaq->nofldrxq10g = min(n, nofldrxq10g); #endif -#ifdef DEV_NETMAP - iaq->nnmrxq10g = min(n, nnmrxq10g); -#endif } if (n1g > 0) { @@ -2529,9 +2528,6 @@ restart: #ifdef TCP_OFFLOAD iaq->nofldrxq1g = min(n, nofldrxq1g); #endif -#ifdef DEV_NETMAP - iaq->nnmrxq1g = min(n, nnmrxq1g); -#endif } if (itype != INTR_MSI || powerof2(iaq->nirq)) @@ -2547,10 +2543,6 @@ restart: if (is_offload(sc)) iaq->nofldrxq10g = iaq->nofldrxq1g = 1; #endif -#ifdef DEV_NETMAP - iaq->nnmrxq10g = iaq->nnmrxq1g = 1; -#endif - allocate: navail = iaq->nirq; rc = 0; @@ -3823,6 +3815,7 @@ setup_intr_handlers(struct adapter *sc) struct irq *irq; struct port_info *pi; struct vi_info *vi; + struct sge *sge = &sc->sge; struct sge_rxq *rxq; #ifdef TCP_OFFLOAD struct sge_ofld_rxq *ofld_rxq; @@ -3854,7 +3847,7 @@ setup_intr_handlers(struct adapter *sc) rid++; /* The second one is always the firmware event queue */ - rc = t4_alloc_irq(sc, irq, rid, t4_intr_evt, &sc->sge.fwq, "evt"); + rc = t4_alloc_irq(sc, irq, rid, t4_intr_evt, &sge->fwq, "evt"); if (rc != 0) return (rc); irq++; @@ -3864,29 +3857,37 @@ setup_intr_handlers(struct adapter *sc) pi = sc->port[p]; for_each_vi(pi, v, vi) { vi->first_intr = rid - 1; + + if (vi->nnmrxq > 0) { + int n = max(vi->nrxq, vi->nnmrxq); + + MPASS(vi->flags & INTR_RXQ); + + rxq = &sge->rxq[vi->first_rxq]; #ifdef DEV_NETMAP - if (vi->flags & VI_NETMAP) { - for_each_nm_rxq(vi, q, nm_rxq) { - snprintf(s, sizeof(s), "%d-%d", p, q); + nm_rxq = &sge->nm_rxq[vi->first_nm_rxq]; +#endif + for (q = 0; q < n; q++) { + snprintf(s, sizeof(s), "%x%c%x", p, + 'a' + v, q); + if (q < vi->nrxq) + irq->rxq = rxq++; +#ifdef DEV_NETMAP + if (q < vi->nnmrxq) + irq->nm_rxq = nm_rxq++; +#endif rc = t4_alloc_irq(sc, irq, rid, - t4_nm_intr, nm_rxq, s); + t4_vi_intr, irq, s); if (rc != 0) return (rc); irq++; rid++; vi->nintr++; } - continue; - } -#endif - if (vi->flags & INTR_RXQ) { + } else if (vi->flags & INTR_RXQ) { for_each_rxq(vi, q, rxq) { - if (v == 0) - snprintf(s, sizeof(s), "%d.%d", - p, q); - else - snprintf(s, sizeof(s), - "%d(%d).%d", p, v, q); + snprintf(s, sizeof(s), "%x%c%x", p, + 'a' + v, q); rc = t4_alloc_irq(sc, irq, rid, t4_intr, rxq, s); if (rc != 0) @@ -3903,7 +3904,8 @@ setup_intr_handlers(struct adapter *sc) #ifdef TCP_OFFLOAD if (vi->flags & INTR_OFLD_RXQ) { for_each_ofld_rxq(vi, q, ofld_rxq) { - snprintf(s, sizeof(s), "%d,%d", p, q); + snprintf(s, sizeof(s), "%x%c%x", p, + 'A' + v, q); rc = t4_alloc_irq(sc, irq, rid, t4_intr, ofld_rxq, s); if (rc != 0) @@ -4074,14 +4076,6 @@ vi_full_init(struct vi_info *vi) if (rc != 0) goto done; /* error message displayed already */ -#ifdef DEV_NETMAP - /* Netmap VIs configure RSS when netmap is enabled. */ - if (vi->flags & VI_NETMAP) { - vi->flags |= VI_INIT_DONE; - return (0); - } -#endif - /* * Setup RSS for this VI. Save a copy of the RSS table for later use. */ @@ -4206,10 +4200,6 @@ vi_full_uninit(struct vi_info *vi) if (vi->flags & VI_INIT_DONE) { /* Need to quiesce queues. */ -#ifdef DEV_NETMAP - if (vi->flags & VI_NETMAP) - goto skip; -#endif /* XXX: Only for the first VI? */ if (IS_MAIN_VI(vi)) @@ -4237,10 +4227,8 @@ vi_full_uninit(struct vi_info *vi) } #endif free(vi->rss, M_CXGBE); + free(vi->nm_rss, M_CXGBE); } -#ifdef DEV_NETMAP -skip: -#endif t4_teardown_vi_queues(vi); vi->flags &= ~VI_INIT_DONE; @@ -4975,7 +4963,7 @@ vi_sysctls(struct vi_info *vi) ctx = device_get_sysctl_ctx(vi->dev); /* - * dev.[nv](cxgbe|cxl).X. + * dev.v?(cxgbe|cxl).X. */ oid = device_get_sysctl_tree(vi->dev); children = SYSCTL_CHILDREN(oid); @@ -4991,12 +4979,11 @@ vi_sysctls(struct vi_info *vi) SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_txq", CTLFLAG_RD, &vi->first_txq, 0, "index of first tx queue"); - if (vi->flags & VI_NETMAP) - return; - - SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rsrv_noflowq", CTLTYPE_INT | - CTLFLAG_RW, vi, 0, sysctl_noflowq, "IU", - "Reserve queue 0 for non-flowid packets"); + if (IS_MAIN_VI(vi)) { + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "rsrv_noflowq", + CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_noflowq, "IU", + "Reserve queue 0 for non-flowid packets"); + } #ifdef TCP_OFFLOAD if (vi->nofldrxq != 0) { @@ -5014,6 +5001,20 @@ vi_sysctls(struct vi_info *vi) "index of first TOE tx queue"); } #endif +#ifdef DEV_NETMAP + if (vi->nnmrxq != 0) { + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nnmrxq", CTLFLAG_RD, + &vi->nnmrxq, 0, "# of netmap rx queues"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "nnmtxq", CTLFLAG_RD, + &vi->nnmtxq, 0, "# of netmap tx queues"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_nm_rxq", + CTLFLAG_RD, &vi->first_nm_rxq, 0, + "index of first netmap rx queue"); + SYSCTL_ADD_INT(ctx, children, OID_AUTO, "first_nm_txq", + CTLFLAG_RD, &vi->first_nm_txq, 0, + "index of first netmap tx queue"); + } +#endif SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "holdoff_tmr_idx", CTLTYPE_INT | CTLFLAG_RW, vi, 0, sysctl_holdoff_tmr_idx, "I", @@ -8871,9 +8872,6 @@ t4_ioctl(struct cdev *dev, unsigned long struct sge_txq *txq; struct sge_wrq *wrq; - if (vi->flags & VI_NETMAP) - continue; - for_each_rxq(vi, i, rxq) { #if defined(INET) || defined(INET6) rxq->lro.lro_queued = 0; @@ -9187,6 +9185,9 @@ tweak_tunables(void) #endif } + if (t4_ntxq_vi < 1) + t4_ntxq_vi = min(nc, NTXQ_VI); + if (t4_nrxq10g < 1) { #ifdef RSS t4_nrxq10g = rss_getnumbuckets(); @@ -9204,6 +9205,9 @@ tweak_tunables(void) #endif } + if (t4_nrxq_vi < 1) + t4_nrxq_vi = min(nc, NRXQ_VI); + #ifdef TCP_OFFLOAD if (t4_nofldtxq10g < 1) t4_nofldtxq10g = min(nc, NOFLDTXQ_10G); @@ -9211,12 +9215,18 @@ tweak_tunables(void) if (t4_nofldtxq1g < 1) t4_nofldtxq1g = min(nc, NOFLDTXQ_1G); + if (t4_nofldtxq_vi < 1) + t4_nofldtxq_vi = min(nc, NOFLDTXQ_VI); + if (t4_nofldrxq10g < 1) t4_nofldrxq10g = min(nc, NOFLDRXQ_10G); if (t4_nofldrxq1g < 1) t4_nofldrxq1g = min(nc, NOFLDRXQ_1G); + if (t4_nofldrxq_vi < 1) + t4_nofldrxq_vi = min(nc, NOFLDRXQ_VI); + if (t4_toecaps_allowed == -1) t4_toecaps_allowed = FW_CAPS_CONFIG_TOE; @@ -9242,17 +9252,11 @@ tweak_tunables(void) #endif #ifdef DEV_NETMAP - if (t4_nnmtxq10g < 1) - t4_nnmtxq10g = min(nc, NNMTXQ_10G); - - if (t4_nnmtxq1g < 1) - t4_nnmtxq1g = min(nc, NNMTXQ_1G); - - if (t4_nnmrxq10g < 1) - t4_nnmrxq10g = min(nc, NNMRXQ_10G); + if (t4_nnmtxq_vi < 1) + t4_nnmtxq_vi = min(nc, NNMTXQ_VI); - if (t4_nnmrxq1g < 1) - t4_nnmrxq1g = min(nc, NNMRXQ_1G); + if (t4_nnmrxq_vi < 1) + t4_nnmrxq_vi = min(nc, NNMRXQ_VI); #endif if (t4_tmr_idx_10g < 0 || t4_tmr_idx_10g >= SGE_NTIMERS) Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Thu Jun 23 02:37:24 2016 (r302109) +++ head/sys/dev/cxgbe/t4_netmap.c Thu Jun 23 02:53:00 2016 (r302110) @@ -85,198 +85,6 @@ SYSCTL_INT(_hw_cxgbe, OID_AUTO, nm_holdo static int nm_cong_drop = 1; TUNABLE_INT("hw.cxgbe.nm_cong_drop", &nm_cong_drop); -/* netmap ifnet routines */ -static void cxgbe_nm_init(void *); -static int cxgbe_nm_ioctl(struct ifnet *, unsigned long, caddr_t); -static int cxgbe_nm_transmit(struct ifnet *, struct mbuf *); -static void cxgbe_nm_qflush(struct ifnet *); - -static int cxgbe_nm_init_synchronized(struct vi_info *); -static int cxgbe_nm_uninit_synchronized(struct vi_info *); - -/* T4 netmap VI (ncxgbe) interface */ -static int ncxgbe_probe(device_t); -static int ncxgbe_attach(device_t); -static int ncxgbe_detach(device_t); -static device_method_t ncxgbe_methods[] = { - DEVMETHOD(device_probe, ncxgbe_probe), - DEVMETHOD(device_attach, ncxgbe_attach), - DEVMETHOD(device_detach, ncxgbe_detach), - { 0, 0 } -}; -static driver_t ncxgbe_driver = { - "ncxgbe", - ncxgbe_methods, - sizeof(struct vi_info) -}; - -/* T5 netmap VI (ncxl) interface */ -static driver_t ncxl_driver = { - "ncxl", - ncxgbe_methods, - sizeof(struct vi_info) -}; - -static void -cxgbe_nm_init(void *arg) -{ - struct vi_info *vi = arg; - struct adapter *sc = vi->pi->adapter; - - if (begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4nminit") != 0) - return; - cxgbe_nm_init_synchronized(vi); - end_synchronized_op(sc, 0); - - return; -} - -static int -cxgbe_nm_init_synchronized(struct vi_info *vi) -{ - struct adapter *sc = vi->pi->adapter; - struct ifnet *ifp = vi->ifp; - int rc = 0; - - ASSERT_SYNCHRONIZED_OP(sc); - - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - return (0); /* already running */ - - if (!(sc->flags & FULL_INIT_DONE) && - ((rc = adapter_full_init(sc)) != 0)) - return (rc); /* error message displayed already */ - - if (!(vi->flags & VI_INIT_DONE) && - ((rc = vi_full_init(vi)) != 0)) - return (rc); /* error message displayed already */ - - rc = update_mac_settings(ifp, XGMAC_ALL); - if (rc) - return (rc); /* error message displayed already */ - - ifp->if_drv_flags |= IFF_DRV_RUNNING; - callout_reset(&vi->tick, hz, vi_tick, vi); - - return (rc); -} - -static int -cxgbe_nm_uninit_synchronized(struct vi_info *vi) -{ -#ifdef INVARIANTS - struct adapter *sc = vi->pi->adapter; -#endif - struct ifnet *ifp = vi->ifp; - - ASSERT_SYNCHRONIZED_OP(sc); - - callout_stop(&vi->tick); - ifp->if_drv_flags &= ~IFF_DRV_RUNNING; - - return (0); -} - -static int -cxgbe_nm_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) -{ - int rc = 0, mtu, flags; - struct vi_info *vi = ifp->if_softc; - struct adapter *sc = vi->pi->adapter; - struct ifreq *ifr = (struct ifreq *)data; - uint32_t mask; - - MPASS(vi->ifp == ifp); - - switch (cmd) { - case SIOCSIFMTU: - mtu = ifr->ifr_mtu; - if ((mtu < ETHERMIN) || (mtu > ETHERMTU_JUMBO)) - return (EINVAL); - - rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4nmtu"); - if (rc) - return (rc); - ifp->if_mtu = mtu; - if (ifp->if_drv_flags & IFF_DRV_RUNNING) - rc = update_mac_settings(ifp, XGMAC_MTU); - end_synchronized_op(sc, 0); - break; - - case SIOCSIFFLAGS: - rc = begin_synchronized_op(sc, vi, SLEEP_OK | INTR_OK, "t4nflg"); - if (rc) - return (rc); - - if (ifp->if_flags & IFF_UP) { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - flags = vi->if_flags; - if ((ifp->if_flags ^ flags) & *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jun 23 05:41:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6969B72B56; Thu, 23 Jun 2016 05:41:47 +0000 (UTC) (envelope-from bz@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 76D1816DF; Thu, 23 Jun 2016 05:41:47 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N5fkQa083573; Thu, 23 Jun 2016 05:41:46 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N5fku1083572; Thu, 23 Jun 2016 05:41:46 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606230541.u5N5fku1083572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 05:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302117 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 05:41:47 -0000 Author: bz Date: Thu Jun 23 05:41:46 2016 New Revision: 302117 URL: https://svnweb.freebsd.org/changeset/base/302117 Log: Import a fix for and old security issue (CVE-2010-3830) in pf which was not relevant to FreeBSD as only root could open /dev/pf by default. With VIMAGE this is will longer be the case. As pf(4) starts to be supported with VNETs 3rd party users may open /dev/pf inside the virtual jail instance; thus we need to address this issue after all. While OpenBSD largely rewrote code parts for the fix [1], and it's unclear what Apple [3] did, import the minimal fix from NetBSD [2]. [1] http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/net/pf_ioctl.c.diff?r1=1.235&r2=1.236 [2] http://mail-index.netbsd.org/source-changes/2011/01/19/msg017518.html [3] https://support.apple.com/en-gb/HT202154 Obtained from: http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/dist/pf/net/pf_ioctl.c.diff?r1=1.42&r2=1.43&only_with_tag=MAIN MFC After: 2 weeks Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Security: CVE-2010-3830 Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Thu Jun 23 05:35:08 2016 (r302116) +++ head/sys/netpfil/pf/pf_ioctl.c Thu Jun 23 05:41:46 2016 (r302117) @@ -1254,6 +1254,7 @@ pfioctl(struct cdev *dev, u_long cmd, ca error = ENOMEM; } + rule->overload_tbl = NULL; if (rule->overload_tblname[0]) { if ((rule->overload_tbl = pfr_attach_table(ruleset, rule->overload_tblname)) == NULL) @@ -1511,6 +1512,7 @@ DIOCADDRULE_error: error = ENOMEM; } + newrule->overload_tbl = NULL; if (newrule->overload_tblname[0]) { if ((newrule->overload_tbl = pfr_attach_table( ruleset, newrule->overload_tblname)) == From owner-svn-src-head@freebsd.org Thu Jun 23 06:32:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BADEB73987; Thu, 23 Jun 2016 06:32:28 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv157.fwdcdn.com (frv157.fwdcdn.com [212.42.77.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3F7751B35; Thu, 23 Jun 2016 06:32:27 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=j+Nlrk3HfJqsV6on9LFZDNZHoxNQh0D5b6rCgCk0Lu4=; b=MwVlJbDerYIrXXd3/6awrv9lcnKS2yWOgT3uv2CbkdpFC5h5FN5IZM1XXEgBo72Rog0HSQDNZhzyqJKri6bFc4MDhDpAh7NliwpYtwZcxio/5EN4jAMbkCo937B0L2dhYhTM5f834YIgGNgtwEdNOFQKDpRZ8sE7L2f6+w5jIHc=; Received: from [37.229.193.176] (helo=nonamehost.local) by frv157.fwdcdn.com with esmtpsa ID 1bFyBc-000NgT-Nh ; Thu, 23 Jun 2016 09:32:24 +0300 Date: Thu, 23 Jun 2016 09:32:24 +0300 From: Ivan Klymenko To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302092 - in head/lib/libc: aarch64/sys amd64/sys arm/sys i386/sys mips/sys powerpc/sys powerpc64/sys riscv/sys sparc64/sys sys Message-ID: <20160623093224.18d30b89@nonamehost.local> In-Reply-To: <201606222111.u5MLBRHn090827@repo.freebsd.org> References: <201606222111.u5MLBRHn090827@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=37.229.193.176; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 06:32:28 -0000 On Wed, 22 Jun 2016 21:11:27 +0000 (UTC) Brooks Davis wrote: > Author: brooks > Date: Wed Jun 22 21:11:27 2016 > New Revision: 302092 > URL: https://svnweb.freebsd.org/changeset/base/302092 > > Log: > Replace use of the pipe(2) system call with pipe2(2) with a zero > flags value. > > This eliminates the need for machine dependant assembly wrappers for > pipe(2). > > It also make passing an invalid address to pipe(2) return EFAULT > rather than triggering a segfault. Document this behavior (which was > already true for pipe2(2), but undocumented). > > Reviewed by: andrew > Approved by: re (gjb) > Sponsored by: DARPA, AFRL > Differential Revision: https://reviews.freebsd.org/D6815 > > Added: > head/lib/libc/sys/pipe.c (contents, props changed) > Deleted: > head/lib/libc/aarch64/sys/pipe.S > head/lib/libc/amd64/sys/pipe.S > head/lib/libc/arm/sys/pipe.S > head/lib/libc/i386/sys/pipe.S > head/lib/libc/mips/sys/pipe.S > head/lib/libc/powerpc/sys/pipe.S > head/lib/libc/powerpc64/sys/pipe.S > head/lib/libc/riscv/sys/pipe.S > head/lib/libc/sparc64/sys/pipe.S > Modified: > head/lib/libc/aarch64/sys/Makefile.inc > head/lib/libc/amd64/sys/Makefile.inc > head/lib/libc/arm/sys/Makefile.inc > head/lib/libc/i386/sys/Makefile.inc > head/lib/libc/mips/sys/Makefile.inc > head/lib/libc/powerpc/sys/Makefile.inc > head/lib/libc/powerpc64/sys/Makefile.inc > head/lib/libc/riscv/sys/Makefile.inc > head/lib/libc/sparc64/sys/Makefile.inc > head/lib/libc/sys/Makefile.inc > head/lib/libc/sys/pipe.2 > ... /usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 --sysroot=/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin -fpic -DPIC -O2 -pipe -mmmx -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -mavx -maes -mpclmul -march=native -I/usr/src/lib/libc/include -I/usr/src/lib/libc/../../include -I/usr/src/lib/libc/amd64 -DNLS -D__DBINTERFACE_PRIVATE -I/usr/src/lib/libc/../../contrib/gdtoa -I/usr/src/lib/libc/../../contrib/libc-vis -DINET6 -I/media/da0s1/obj/usr/src/lib/libc -I/usr/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/src/lib/libc/../libmd -I/usr/src/lib/libc/../../contrib/jemalloc/include -DMALLOC_PRODUCTION -I/usr/src/lib/libc/../../contrib/tzcode/stdtime -I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING -DSYMBOL_VERSIONING -DNDEBUG -MD -MF.depend.gettimeofday.So -MTgettimeofday.So -std=gnu99 -fstack-protector-strong -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Ofast -fvectorize -fslp-vectorize -fblocks -fcolor-diagnostics -Qunused-arguments -I/usr/src/lib/libutil -I/usr/src/lib/msun/amd64 -I/usr/src/lib/msun/x86 -I/usr/src/lib/msun/src -c /usr/src/lib/libc/sys/gettimeofday.c -o gettimeofday.So --- pipe.So --- /usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 --sysroot=/media/da0s1/obj/usr/src/tmp -B/media/da0s1/obj/usr/src/tmp/usr/bin -fpic -DPIC -O2 -pipe -mmmx -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -mavx -maes -mpclmul -march=native -I/usr/src/lib/libc/include -I/usr/src/lib/libc/../../include -I/usr/src/lib/libc/amd64 -DNLS -D__DBINTERFACE_PRIVATE -I/usr/src/lib/libc/../../contrib/gdtoa -I/usr/src/lib/libc/../../contrib/libc-vis -DINET6 -I/media/da0s1/obj/usr/src/lib/libc -I/usr/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/src/lib/libc/../libmd -I/usr/src/lib/libc/../../contrib/jemalloc/include -DMALLOC_PRODUCTION -I/usr/src/lib/libc/../../contrib/tzcode/stdtime -I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING -DSYMBOL_VERSIONING -DNDEBUG -MD -MF.depend.pipe.So -MTpipe.So -std=gnu99 -fstack-protector-strong -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Ofast -fvectorize -fslp-vectorize -fblocks -fcolor-diagnostics -Qunused-arguments -I/usr/src/lib/libutil -I/usr/src/lib/msun/amd64 -I/usr/src/lib/msun/x86 -I/usr/src/lib/msun/src -c /usr/src/lib/libc/amd64/sys/pipe.S -o pipe.So cc: error: no such file or directory: '/usr/src/lib/libc/amd64/sys/pipe.S' cc: error: no input files *** [pipe.So] Error code 1 make[4]: stopped in /usr/src/lib/libc 1 error make[4]: stopped in /usr/src/lib/libc *** [lib/libc__L] Error code 2 make[3]: stopped in /usr/src 1 error make[3]: stopped in /usr/src *** [libraries] Error code 2 make[2]: stopped in /usr/src 1 error make[2]: stopped in /usr/src *** [_libraries] Error code 2 make[1]: stopped in /usr/src 1 error make[1]: stopped in /usr/src *** [buildworld] Error code 2 make: stopped in /usr/src 1 error make: stopped in /usr/src root@nonamehost:/usr/src # From owner-svn-src-head@freebsd.org Thu Jun 23 07:01:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89AE6B73EB3; Thu, 23 Jun 2016 07:01:55 +0000 (UTC) (envelope-from avg@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 3DF442981; Thu, 23 Jun 2016 07:01:55 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5N71sVw016901; Thu, 23 Jun 2016 07:01:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N71sLm016900; Thu, 23 Jun 2016 07:01:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201606230701.u5N71sLm016900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 23 Jun 2016 07:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302123 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 07:01:55 -0000 Author: avg Date: Thu Jun 23 07:01:54 2016 New Revision: 302123 URL: https://svnweb.freebsd.org/changeset/base/302123 Log: fix deadlock-prone code in getzfsvfs() getzfsvfs() called vfs_busy() in the waiting mode while having a hold on a pool (via a call to dmu_objset_hold). In other words, dp_config_rwlock was held in the shared mode while a thread could be sleeping in vfs_busy(). The pool's txg sync thread needs to take dp_config_rwlock in the exclusive mode for some actions, e.g., for executing sync tasks. If the sync thread gets blocked, then any thread waiting for its sync task to get executed is also blocked. Which, in turn, could mean that vfs_busy() will keep waiting indefinitely. The solution is to use vfs_ref() in the locked section and to call vfs_busy() only after dropping other locks. Note that a reference on a struct mount object does not prevent an associated zfsvfs_t object from being destroyed. So, we have to be careful to operate only on the struct mount object until we successfully vfs_busy it. Approved by: re (gjb) MFC after: 2 weeks Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Jun 23 06:27:41 2016 (r302122) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Thu Jun 23 07:01:54 2016 (r302123) @@ -1430,6 +1430,7 @@ static int getzfsvfs(const char *dsname, zfsvfs_t **zfvp) { objset_t *os; + vfs_t *vfsp; int error; error = dmu_objset_hold(dsname, FTAG, &os); @@ -1443,19 +1444,21 @@ getzfsvfs(const char *dsname, zfsvfs_t * mutex_enter(&os->os_user_ptr_lock); *zfvp = dmu_objset_get_user(os); if (*zfvp) { -#ifdef illumos - VFS_HOLD((*zfvp)->z_vfs); -#else - if (vfs_busy((*zfvp)->z_vfs, 0) != 0) { - *zfvp = NULL; - error = SET_ERROR(ESRCH); - } -#endif + vfsp = (*zfvp)->z_vfs; + vfs_ref(vfsp); } else { error = SET_ERROR(ESRCH); } mutex_exit(&os->os_user_ptr_lock); dmu_objset_rele(os, FTAG); + if (error == 0) { + error = vfs_busy(vfsp, 0); + vfs_rel(vfsp); + if (error != 0) { + *zfvp = NULL; + error = SET_ERROR(ESRCH); + } + } return (error); } From owner-svn-src-head@freebsd.org Thu Jun 23 07:07:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3739BB73F7E; Thu, 23 Jun 2016 07:07:24 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv157.fwdcdn.com (frv157.fwdcdn.com [212.42.77.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE7C62D03; Thu, 23 Jun 2016 07:07:23 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=wr7CUcohF/0oSWzV6mha3B0QzIzXlX9rRpBwv+7pWt8=; b=q/NDT3Uu7teHsU9+6kj/A6yf9wpJOaRfgbjIZY2bmHDhadCFvrJVGemY25oxzHhqkwimcVgHR58nPNmkaiqXdv9lYRu4hdVd7EdJYT0rVfViKe4GZBTzcjl/cmb9uDk6vKd2326ijA5wnoS5Re11juFDC03w/PHI7uWXQEaMJ3M=; Received: from [37.229.193.176] (helo=nonamehost.local) by frv157.fwdcdn.com with esmtpsa ID 1bFyjR-0007LO-MG ; Thu, 23 Jun 2016 10:07:21 +0300 Date: Thu, 23 Jun 2016 10:07:21 +0300 From: Ivan Klymenko To: Brooks Davis Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r302092 - in head/lib/libc: aarch64/sys amd64/sys arm/sys i386/sys mips/sys powerpc/sys powerpc64/sys riscv/sys sparc64/sys sys Message-ID: <20160623100721.690d67e0@nonamehost.local> In-Reply-To: <20160623093224.18d30b89@nonamehost.local> References: <201606222111.u5MLBRHn090827@repo.freebsd.org> <20160623093224.18d30b89@nonamehost.local> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=37.229.193.176; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 07:07:24 -0000 On Thu, 23 Jun 2016 09:32:24 +0300 Ivan Klymenko wrote: > On Wed, 22 Jun 2016 21:11:27 +0000 (UTC) > Brooks Davis wrote: > > > Author: brooks > > Date: Wed Jun 22 21:11:27 2016 > > New Revision: 302092 > > URL: https://svnweb.freebsd.org/changeset/base/302092 > > > > Log: > > Replace use of the pipe(2) system call with pipe2(2) with a zero > > flags value. > > > > This eliminates the need for machine dependant assembly wrappers > > for pipe(2). > > > > It also make passing an invalid address to pipe(2) return EFAULT > > rather than triggering a segfault. Document this behavior (which > > was already true for pipe2(2), but undocumented). > > > > Reviewed by: andrew > > Approved by: re (gjb) > > Sponsored by: DARPA, AFRL > > Differential Revision: https://reviews.freebsd.org/D6815 > > > > Added: > > head/lib/libc/sys/pipe.c (contents, props changed) > > Deleted: > > head/lib/libc/aarch64/sys/pipe.S > > head/lib/libc/amd64/sys/pipe.S > > head/lib/libc/arm/sys/pipe.S > > head/lib/libc/i386/sys/pipe.S > > head/lib/libc/mips/sys/pipe.S > > head/lib/libc/powerpc/sys/pipe.S > > head/lib/libc/powerpc64/sys/pipe.S > > head/lib/libc/riscv/sys/pipe.S > > head/lib/libc/sparc64/sys/pipe.S > > Modified: > > head/lib/libc/aarch64/sys/Makefile.inc > > head/lib/libc/amd64/sys/Makefile.inc > > head/lib/libc/arm/sys/Makefile.inc > > head/lib/libc/i386/sys/Makefile.inc > > head/lib/libc/mips/sys/Makefile.inc > > head/lib/libc/powerpc/sys/Makefile.inc > > head/lib/libc/powerpc64/sys/Makefile.inc > > head/lib/libc/riscv/sys/Makefile.inc > > head/lib/libc/sparc64/sys/Makefile.inc > > head/lib/libc/sys/Makefile.inc > > head/lib/libc/sys/pipe.2 > > > > ... > /usr/local/libexec/ccache/world/cc -target x86_64-unknown-freebsd11.0 > --sysroot=/media/da0s1/obj/usr/src/tmp > -B/media/da0s1/obj/usr/src/tmp/usr/bin -fpic -DPIC -O2 -pipe -mmmx > -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -mavx -maes > -mpclmul -march=native -I/usr/src/lib/libc/include > -I/usr/src/lib/libc/../../include -I/usr/src/lib/libc/amd64 -DNLS > -D__DBINTERFACE_PRIVATE -I/usr/src/lib/libc/../../contrib/gdtoa > -I/usr/src/lib/libc/../../contrib/libc-vis -DINET6 > -I/media/da0s1/obj/usr/src/lib/libc -I/usr/src/lib/libc/resolv > -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/src/lib/libc/../libmd > -I/usr/src/lib/libc/../../contrib/jemalloc/include -DMALLOC_PRODUCTION > -I/usr/src/lib/libc/../../contrib/tzcode/stdtime > -I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES > -DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING > -DSYMBOL_VERSIONING -DNDEBUG -MD -MF.depend.gettimeofday.So > -MTgettimeofday.So -std=gnu99 -fstack-protector-strong > -Wsystem-headers -Wall -Wno-format-y2k -Wno-uninitialized > -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int > -Wno-unused-const-variable -Wno-tautological-compare > -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function > -Wno-enum-conversion -Wno-unused-local-typedef -Wno-switch > -Wno-switch-enum -Wno-knr-promoted-parameter -Ofast -fvectorize > -fslp-vectorize -fblocks -fcolor-diagnostics -Qunused-arguments > -I/usr/src/lib/libutil -I/usr/src/lib/msun/amd64 > -I/usr/src/lib/msun/x86 -I/usr/src/lib/msun/src > -c /usr/src/lib/libc/sys/gettimeofday.c -o gettimeofday.So --- > pipe.So --- /usr/local/libexec/ccache/world/cc -target > x86_64-unknown-freebsd11.0 --sysroot=/media/da0s1/obj/usr/src/tmp > -B/media/da0s1/obj/usr/src/tmp/usr/bin -fpic -DPIC -O2 -pipe -mmmx > -msse -msse2 -msse3 -mssse3 -msse4 -msse4.1 -msse4.2 -mavx -maes > -mpclmul -march=native -I/usr/src/lib/libc/include > -I/usr/src/lib/libc/../../include -I/usr/src/lib/libc/amd64 -DNLS > -D__DBINTERFACE_PRIVATE -I/usr/src/lib/libc/../../contrib/gdtoa > -I/usr/src/lib/libc/../../contrib/libc-vis -DINET6 > -I/media/da0s1/obj/usr/src/lib/libc -I/usr/src/lib/libc/resolv > -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/src/lib/libc/../libmd > -I/usr/src/lib/libc/../../contrib/jemalloc/include > -DMALLOC_PRODUCTION -I/usr/src/lib/libc/../../contrib/tzcode/stdtime > -I/usr/src/lib/libc/stdtime -I/usr/src/lib/libc/locale -DBROKEN_DES > -DPORTMAP -DDES_BUILTIN -I/usr/src/lib/libc/rpc -DYP -DNS_CACHING > -DSYMBOL_VERSIONING -DNDEBUG -MD -MF.depend.pipe.So -MTpipe.So > -std=gnu99 -fstack-protector-strong -Wsystem-headers -Wall > -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wno-empty-body > -Wno-string-plus-int -Wno-unused-const-variable > -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality > -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef > -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter -Ofast > -fvectorize -fslp-vectorize -fblocks -fcolor-diagnostics > -Qunused-arguments -I/usr/src/lib/libutil -I/usr/src/lib/msun/amd64 > -I/usr/src/lib/msun/x86 -I/usr/src/lib/msun/src > -c /usr/src/lib/libc/amd64/sys/pipe.S -o pipe.So cc: error: no such > file or directory: '/usr/src/lib/libc/amd64/sys/pipe.S' cc: error: no > input files *** [pipe.So] Error code 1 > > make[4]: stopped in /usr/src/lib/libc > 1 error > > make[4]: stopped in /usr/src/lib/libc > *** [lib/libc__L] Error code 2 > > make[3]: stopped in /usr/src > 1 error > > make[3]: stopped in /usr/src > *** [libraries] Error code 2 > > make[2]: stopped in /usr/src > 1 error > > make[2]: stopped in /usr/src > *** [_libraries] Error code 2 > > make[1]: stopped in /usr/src > 1 error > > make[1]: stopped in /usr/src > *** [buildworld] Error code 2 > > make: stopped in /usr/src > 1 error > > make: stopped in /usr/src > root@nonamehost:/usr/src # Sorry for noise. I build with -DNO_CLEAN From owner-svn-src-head@freebsd.org Thu Jun 23 07:12:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F410CB72328; Thu, 23 Jun 2016 07:12:23 +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 C9759148A; Thu, 23 Jun 2016 07:12:23 +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 u5N7CNLc021663; Thu, 23 Jun 2016 07:12:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N7CMXj021657; Thu, 23 Jun 2016 07:12:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606230712.u5N7CMXj021657@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 23 Jun 2016 07:12:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302125 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 07:12:24 -0000 Author: hselasky Date: Thu Jun 23 07:12:22 2016 New Revision: 302125 URL: https://svnweb.freebsd.org/changeset/base/302125 Log: Add support for USB streams to the LibUSB v1.0 API and update the libusb(3) manual page. Approved by: re (gjb) Requested by: swills MFC after: 1 week Modified: head/lib/libusb/Makefile head/lib/libusb/libusb.3 head/lib/libusb/libusb.h head/lib/libusb/libusb10.c head/lib/libusb/libusb10.h head/lib/libusb/libusb10_io.c Modified: head/lib/libusb/Makefile ============================================================================== --- head/lib/libusb/Makefile Thu Jun 23 07:09:44 2016 (r302124) +++ head/lib/libusb/Makefile Thu Jun 23 07:12:22 2016 (r302125) @@ -120,8 +120,12 @@ MLINKS += libusb.3 libusb_get_ss_usb_dev MLINKS += libusb.3 libusb_free_ss_usb_device_capability_descriptor.3 MLINKS += libusb.3 libusb_get_container_id_descriptor.3 MLINKS += libusb.3 libusb_free_container_id_descriptor.3 +MLINKS += libusb.3 libusb_alloc_streams.3 +MLINKS += libusb.3 libusb_free_streams.3 MLINKS += libusb.3 libusb_alloc_transfer.3 MLINKS += libusb.3 libusb_free_transfer.3 +MLINKS += libusb.3 libusb_transfer_set_stream_id.3 +MLINKS += libusb.3 libusb_transfer_get_stream_id.3 MLINKS += libusb.3 libusb_submit_transfer.3 MLINKS += libusb.3 libusb_cancel_transfer.3 MLINKS += libusb.3 libusb_control_transfer.3 Modified: head/lib/libusb/libusb.3 ============================================================================== --- head/lib/libusb/libusb.3 Thu Jun 23 07:09:44 2016 (r302124) +++ head/lib/libusb/libusb.3 Thu Jun 23 07:12:22 2016 (r302125) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 22, 2016 +.Dd June 23, 2016 .Dt LIBUSB 3 .Os .Sh NAME @@ -521,6 +521,29 @@ if the transfer timed out, LIBUSB_ERROR_ supported, LIBUSB_ERROR_OVERFLOW if the device offered more data, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a LIBUSB_ERROR code on other failure. +.Sh USB STREAMS SUPPORT +.Ft int +.Fn libusb_alloc_streams "libusb_device_handle *dev" "uint32_t num_streams" "unsigned char *endpoints" "int num_endpoints" +This function verifies that the given number of streams using the +given number of endpoints is allowed and allocates the resources +needed to use so-called USB streams. +Currently only a single stream per endpoint is supported to simplify +the internals of LibUSB. +This function returns 0 on success or a LIBUSB_ERROR code on failure. +.Pp +.Ft int +.Fn libusb_free_streams "libusb_device_handle *dev" "unsigned char *endpoints" "int num_endpoints" +This function release resources needed for streams usage. +Returns 0 on success or a LIBUSB_ERROR code on failure. +.Pp +.Ft void +.Fn libusb_transfer_set_stream_id "struct libusb_transfer *transfer" "uint32_t stream_id" +This function sets the stream ID for the given USB transfer. +.Pp +.Ft uint32_t +.Fn libusb_transfer_get_stream_id "struct libusb_transfer *transfer" +This function returns the stream ID for the given USB transfer. +If no stream ID is used a value of zero is returned. .Sh USB EVENTS .Ft int .Fn libusb_try_lock_events "libusb_context *ctx" Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Thu Jun 23 07:09:44 2016 (r302124) +++ head/lib/libusb/libusb.h Thu Jun 23 07:12:22 2016 (r302125) @@ -561,6 +561,13 @@ typedef int (*libusb_hotplug_callback_fn int libusb_hotplug_register_callback(libusb_context *ctx, libusb_hotplug_event events, libusb_hotplug_flag flags, int vendor_id, int product_id, int dev_class, libusb_hotplug_callback_fn cb_fn, void *user_data, libusb_hotplug_callback_handle *handle); void libusb_hotplug_deregister_callback(libusb_context *ctx, libusb_hotplug_callback_handle handle); +/* Streams support */ + +int libusb_alloc_streams(libusb_device_handle *dev, uint32_t num_streams, unsigned char *endpoints, int num_endpoints); +int libusb_free_streams(libusb_device_handle *dev, unsigned char *endpoints, int num_endpoints); +void libusb_transfer_set_stream_id(struct libusb_transfer *transfer, uint32_t stream_id); +uint32_t libusb_transfer_get_stream_id(struct libusb_transfer *transfer); + #if 0 { /* indent fix */ #endif Modified: head/lib/libusb/libusb10.c ============================================================================== --- head/lib/libusb/libusb10.c Thu Jun 23 07:09:44 2016 (r302124) +++ head/lib/libusb/libusb10.c Thu Jun 23 07:12:22 2016 (r302125) @@ -1403,7 +1403,8 @@ found: maxframe = libusb10_get_maxframe(pdev, uxfer); /* make sure the transfer is opened */ - err = libusb20_tr_open(pxfer0, buffsize, maxframe, endpoint); + err = libusb20_tr_open_stream(pxfer0, buffsize, maxframe, + endpoint, sxfer->stream_id); if (err && (err != LIBUSB20_ERROR_BUSY)) { goto failure; } Modified: head/lib/libusb/libusb10.h ============================================================================== --- head/lib/libusb/libusb10.h Thu Jun 23 07:09:44 2016 (r302124) +++ head/lib/libusb/libusb10.h Thu Jun 23 07:12:22 2016 (r302125) @@ -69,6 +69,7 @@ struct libusb_super_transfer { uint8_t *curr_data; uint32_t rem_len; uint32_t last_len; + uint32_t stream_id; uint8_t state; #define LIBUSB_SUPER_XFER_ST_NONE 0 #define LIBUSB_SUPER_XFER_ST_PEND 1 Modified: head/lib/libusb/libusb10_io.c ============================================================================== --- head/lib/libusb/libusb10_io.c Thu Jun 23 07:09:44 2016 (r302124) +++ head/lib/libusb/libusb10_io.c Thu Jun 23 07:12:22 2016 (r302125) @@ -767,3 +767,48 @@ libusb_fill_iso_transfer(struct libusb_t transfer->callback = callback; } +int +libusb_alloc_streams(libusb_device_handle *dev, uint32_t num_streams, + unsigned char *endpoints, int num_endpoints) +{ + if (num_streams > 1) + return (LIBUSB_ERROR_INVALID_PARAM); + return (0); +} + +int +libusb_free_streams(libusb_device_handle *dev, unsigned char *endpoints, int num_endpoints) +{ + + return (0); +} + +void +libusb_transfer_set_stream_id(struct libusb_transfer *transfer, uint32_t stream_id) +{ + struct libusb_super_transfer *sxfer; + + if (transfer == NULL) + return; + + sxfer = (struct libusb_super_transfer *)( + ((uint8_t *)transfer) - sizeof(*sxfer)); + + /* set stream ID */ + sxfer->stream_id = stream_id; +} + +uint32_t +libusb_transfer_get_stream_id(struct libusb_transfer *transfer) +{ + struct libusb_super_transfer *sxfer; + + if (transfer == NULL) + return (0); + + sxfer = (struct libusb_super_transfer *)( + ((uint8_t *)transfer) - sizeof(*sxfer)); + + /* get stream ID */ + return (sxfer->stream_id); +} From owner-svn-src-head@freebsd.org Thu Jun 23 08:18:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 113D6AC63F4; Thu, 23 Jun 2016 08:18:07 +0000 (UTC) (envelope-from zec@fer.hr) Received: from mail.fer.hr (mail.fer.hr [161.53.72.233]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail.fer.hr", Issuer "TERENA SSL CA 3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AA52170C; Thu, 23 Jun 2016 08:18:05 +0000 (UTC) (envelope-from zec@fer.hr) Received: from x23 (161.53.63.210) by MAIL.fer.hr (161.53.72.233) with Microsoft SMTP Server (TLS) id 14.3.279.2; Thu, 23 Jun 2016 10:16:52 +0200 Date: Thu, 23 Jun 2016 10:17:57 +0200 From: Marko Zec To: "Bjoern A. Zeeb" CC: , , , , , Subject: Re: svn commit: r302099 - head/sys/netinet Message-ID: <20160623101757.3e8022fe@x23> In-Reply-To: <201606230034.u5N0Y3Ea069103@repo.freebsd.org> References: <201606230034.u5N0Y3Ea069103@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd10.1) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [161.53.63.210] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 08:18:07 -0000 On Thu, 23 Jun 2016 00:34:03 +0000 "Bjoern A. Zeeb" wrote: > Author: bz > Date: Thu Jun 23 00:34:03 2016 > New Revision: 302099 > URL: https://svnweb.freebsd.org/changeset/base/302099 > > Log: > Check the V_tcbinfo.ipi_count to hit 0 before doing the full TCP > cleanup. That way timers can finish cleanly and we do not gamble with > a DELAY(). > Reviewed by: gnn, jtl > Approved by: re (gjb) > Obtained from: projects/vnet > MFC after: 2 weeks > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D6923 As much as this change is welcome, it unnecesarily introduces a mandatory 100 ms delay on each vnet teardown, which I already pointed out in a comment to r301601 two weeks ago, which remained unanswered, along with the question why a delay of 100 ms was introduced here, when before r302099 the delay was only a single clock tick? And furthermore the delay computation expresion here is not style(9) compliant... Hence, please rectify the above objections, perhaps by something like: =================================================================== --- tcp_subr.c (revision 302126) +++ tcp_subr.c (working copy) @@ -739,10 +739,11 @@ * Sleep to let all tcpcb timers really disappear and cleanup. */ do { - pause("tcpdes", hz/10); INP_LIST_RLOCK(&V_tcbinfo); n = V_tcbinfo.ipi_count; INP_LIST_RUNLOCK(&V_tcbinfo); + if (n != 0) + pause("tcpdes", hz / 100); } while (n != 0); tcp_hc_destroy(); syncache_destroy(); Thanks, Marko > > Modified: > head/sys/netinet/tcp_subr.c > > Modified: head/sys/netinet/tcp_subr.c > ============================================================================== > --- head/sys/netinet/tcp_subr.c Thu Jun 23 00:32:58 > 2016 (r302098) +++ head/sys/netinet/tcp_subr.c Thu Jun > 23 00:34:03 2016 (r302099) @@ -731,18 +731,19 @@ tcp_init(void) > static void > tcp_destroy(void *unused __unused) > { > - int error; > + int error, n; > > /* > * All our processes are gone, all our sockets should be > cleaned > * up, which means, we should be past the tcp_discardcb() > calls. > - * Sleep to let all tcpcb timers really disappear and then > cleanup. > - * Timewait will cleanup its queue and will be ready to go. > - * XXX-BZ In theory a few ticks should be good enough to > make sure > - * the timers are all really gone. We should see if we > could use a > - * better metric here and, e.g., check a tcbcb count as an > optimization? > + * Sleep to let all tcpcb timers really disappear and > cleanup. */ > - DELAY(1000000 / hz); > + do { > + pause("tcpdes", hz/10); > + INP_LIST_RLOCK(&V_tcbinfo); > + n = V_tcbinfo.ipi_count; > + INP_LIST_RUNLOCK(&V_tcbinfo); > + } while (n != 0); > tcp_hc_destroy(); > syncache_destroy(); > tcp_tw_destroy(); > From owner-svn-src-head@freebsd.org Thu Jun 23 08:27:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B97C6AC66D1; Thu, 23 Jun 2016 08:27:39 +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 89AA61EDF; Thu, 23 Jun 2016 08:27:39 +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 u5N8Rcxe050311; Thu, 23 Jun 2016 08:27:38 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N8Rc2B050310; Thu, 23 Jun 2016 08:27:38 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606230827.u5N8Rc2B050310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Jun 2016 08:27:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302130 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 08:27:39 -0000 Author: kib Date: Thu Jun 23 08:27:38 2016 New Revision: 302130 URL: https://svnweb.freebsd.org/changeset/base/302130 Log: Add a comment noting locking regime for vm_page_xunbusy(). Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (gjb) Modified: head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Thu Jun 23 08:26:07 2016 (r302129) +++ head/sys/vm/vm_page.h Thu Jun 23 08:27:38 2016 (r302130) @@ -552,6 +552,7 @@ void vm_page_lock_assert_KBI(vm_page_t m (m)); \ } while (0) +/* Note: page m's lock must not be owned by the caller. */ #define vm_page_xunbusy(m) do { \ if (!atomic_cmpset_rel_int(&(m)->busy_lock, \ VPB_SINGLE_EXCLUSIVER, VPB_UNBUSIED)) \ From owner-svn-src-head@freebsd.org Thu Jun 23 08:28:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5403FAC6715; Thu, 23 Jun 2016 08:28:14 +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 0AE04209F; Thu, 23 Jun 2016 08:28:13 +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 u5N8SDAJ050388; Thu, 23 Jun 2016 08:28:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N8SDaT050387; Thu, 23 Jun 2016 08:28:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606230828.u5N8SDaT050387@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 23 Jun 2016 08:28:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302131 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 08:28:14 -0000 Author: kib Date: Thu Jun 23 08:28:13 2016 New Revision: 302131 URL: https://svnweb.freebsd.org/changeset/base/302131 Log: In vm_page_xunbusy_maybelocked(), add fast path for unbusy when no waiters exist, same as for vm_page_xunbusy(). If previous value of busy_lock was VPB_SINGLE_EXCLUSIVER, no waiters existed and wakeup is not needed. Move common code from vm_page_xunbusy_maybelocked() and vm_page_xunbusy_hard() to vm_page_xunbusy_locked(). Reviewed by: alc Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (gjb) Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Jun 23 08:27:38 2016 (r302130) +++ head/sys/vm/vm_page.c Thu Jun 23 08:28:13 2016 (r302131) @@ -760,17 +760,36 @@ vm_page_trysbusy(vm_page_t m) } static void +vm_page_xunbusy_locked(vm_page_t m) +{ + + vm_page_assert_xbusied(m); + vm_page_assert_locked(m); + + atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED); + /* There is a waiter, do wakeup() instead of vm_page_flash(). */ + wakeup(m); +} + +static void vm_page_xunbusy_maybelocked(vm_page_t m) { bool lockacq; vm_page_assert_xbusied(m); + /* + * Fast path for unbusy. If it succeeds, we know that there + * are no waiters, so we do not need a wakeup. + */ + if (atomic_cmpset_rel_int(&m->busy_lock, VPB_SINGLE_EXCLUSIVER, + VPB_UNBUSIED)) + return; + lockacq = !mtx_owned(vm_page_lockptr(m)); if (lockacq) vm_page_lock(m); - vm_page_flash(m); - atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED); + vm_page_xunbusy_locked(m); if (lockacq) vm_page_unlock(m); } @@ -788,8 +807,7 @@ vm_page_xunbusy_hard(vm_page_t m) vm_page_assert_xbusied(m); vm_page_lock(m); - atomic_store_rel_int(&m->busy_lock, VPB_UNBUSIED); - wakeup(m); + vm_page_xunbusy_locked(m); vm_page_unlock(m); } From owner-svn-src-head@freebsd.org Thu Jun 23 08:49:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BE53AC6C7D; Thu, 23 Jun 2016 08:49:14 +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 73F792C22; Thu, 23 Jun 2016 08:49:14 +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 D95756565A; Thu, 23 Jun 2016 08:49:12 +0000 (UTC) (envelope-from ae@FreeBSD.org) Subject: Re: svn commit: r302081 - head/sys/netinet6 To: hiren panchasara References: <201606221129.u5MBTMun071427@repo.freebsd.org> <20160622154613.GR60812@strugglingcoder.info> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: "Andrey V. Elsukov" Message-ID: <576BA265.2060104@FreeBSD.org> Date: Thu, 23 Jun 2016 11:48:37 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <20160622154613.GR60812@strugglingcoder.info> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VX0Jd7o79FJWhI9dKEwXqau6IFD0kAUGi" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 08:49:14 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --VX0Jd7o79FJWhI9dKEwXqau6IFD0kAUGi Content-Type: multipart/mixed; boundary="mDIUVbicci99ngUtcJa3nTnODAlBjmgTV" From: "Andrey V. Elsukov" To: hiren panchasara Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <576BA265.2060104@FreeBSD.org> Subject: Re: svn commit: r302081 - head/sys/netinet6 References: <201606221129.u5MBTMun071427@repo.freebsd.org> <20160622154613.GR60812@strugglingcoder.info> In-Reply-To: <20160622154613.GR60812@strugglingcoder.info> --mDIUVbicci99ngUtcJa3nTnODAlBjmgTV Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 22.06.16 18:46, hiren panchasara wrote: >> Fix the NULL pointer dereference for unresolved link layer entries i= n >> the netinet6 code. Copy link layer address only when corresponding e= ntry >> has LLE_VALID flag. >> =20 >> PR: 210379 >> Approved by: re (kib) >> >> Modified: >> head/sys/netinet6/in6.c >=20 > Cursory look tells me that this bug is also present in 10. Is that true= ? > If so, is it possible for you to mfc this? The patch is applicable, but due to the difference in the LLE code stable/10 has not affected with this bug. --=20 WBR, Andrey V. Elsukov --mDIUVbicci99ngUtcJa3nTnODAlBjmgTV-- --VX0Jd7o79FJWhI9dKEwXqau6IFD0kAUGi 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/ iQEcBAEBCAAGBQJXa6JpAAoJEAHF6gQQyKF6nXEH/0d5sSm0HZWnSCqL/mA82EjP ZXOeKvA+AMPPjDeeUD2vol9tKFAixbTuFHhR9FR0cRuaj3TsiX9o20qImRoqwEbp 5Rl9yZ+drwuzOkgAnvqE9lA9CSwFjoVJSHB4DmKG7qX2Gks0VxdG+tE75gRmhMfu mFLnrKiaQDYRunFnfbINEA4GFLGVGvImeoL9EVa5vQe1ixxz3wmoKzxaFnTXXEWF wXL06A5UsI/mBJjxrdhmnRt2ceJI3aZ6WwK7Rto6cd6+ZZOOD/nWzAN07PeU/i8I xuL+hB0d/L4ePDU4vLZdQPC7+VwWPSGPq2u1RYKi5cCJieESy9pkzBlHKjooMVU= =K0lL -----END PGP SIGNATURE----- --VX0Jd7o79FJWhI9dKEwXqau6IFD0kAUGi-- From owner-svn-src-head@freebsd.org Thu Jun 23 09:13:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F891B73B70; Thu, 23 Jun 2016 09:13:17 +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 2782C2846; Thu, 23 Jun 2016 09:13:17 +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 u5N9DGSI069959; Thu, 23 Jun 2016 09:13:16 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N9DGq2069956; Thu, 23 Jun 2016 09:13:16 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201606230913.u5N9DGq2069956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 23 Jun 2016 09:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302138 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 09:13:17 -0000 Author: tuexen Date: Thu Jun 23 09:13:15 2016 New Revision: 302138 URL: https://svnweb.freebsd.org/changeset/base/302138 Log: Don't consider the socket when processing an incoming ICMP/ICMP6 packet, which was triggered by an SCTP packet. Whether a socket exists, is just not relevant. Approved by: re (kib) MFC after: 1 week Modified: head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c head/sys/netinet6/sctp6_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Thu Jun 23 09:06:11 2016 (r302137) +++ head/sys/netinet/sctp_usrreq.c Thu Jun 23 09:13:15 2016 (r302138) @@ -291,8 +291,7 @@ sctp_ctlinput(int cmd, struct sockaddr * SCTP_DEFAULT_VRFID); if ((stcb != NULL) && (net != NULL) && - (inp != NULL) && - (inp->sctp_socket != NULL)) { + (inp != NULL)) { /* Check the verification tag */ if (ntohl(sh->v_tag) != 0) { /* Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Thu Jun 23 09:06:11 2016 (r302137) +++ head/sys/netinet/sctputil.c Thu Jun 23 09:13:15 2016 (r302138) @@ -6965,8 +6965,7 @@ sctp_recv_icmp_tunneled_packet(int cmd, SCTP_DEFAULT_VRFID); if ((stcb != NULL) && (net != NULL) && - (inp != NULL) && - (inp->sctp_socket != NULL)) { + (inp != NULL)) { /* Check the UDP port numbers */ if ((udp->uh_dport != net->port) || (udp->uh_sport != htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)))) { @@ -7092,8 +7091,7 @@ sctp_recv_icmp6_tunneled_packet(int cmd, &inp, &net, 1, SCTP_DEFAULT_VRFID); if ((stcb != NULL) && (net != NULL) && - (inp != NULL) && - (inp->sctp_socket != NULL)) { + (inp != NULL)) { /* Check the UDP port numbers */ if ((udp.uh_dport != net->port) || (udp.uh_sport != htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)))) { Modified: head/sys/netinet6/sctp6_usrreq.c ============================================================================== --- head/sys/netinet6/sctp6_usrreq.c Thu Jun 23 09:06:11 2016 (r302137) +++ head/sys/netinet6/sctp6_usrreq.c Thu Jun 23 09:13:15 2016 (r302138) @@ -341,8 +341,7 @@ sctp6_ctlinput(int cmd, struct sockaddr &inp, &net, 1, SCTP_DEFAULT_VRFID); if ((stcb != NULL) && (net != NULL) && - (inp != NULL) && - (inp->sctp_socket != NULL)) { + (inp != NULL)) { /* Check the verification tag */ if (ntohl(sh.v_tag) != 0) { /* From owner-svn-src-head@freebsd.org Thu Jun 23 09:23:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C67BCA7903D; Thu, 23 Jun 2016 09:23:38 +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 972B82E11; Thu, 23 Jun 2016 09:23:38 +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 u5N9Nbxn073681; Thu, 23 Jun 2016 09:23:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5N9Nb6g073680; Thu, 23 Jun 2016 09:23:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606230923.u5N9Nb6g073680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 23 Jun 2016 09:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302139 - head/sys/dev/mlx5/mlx5_core X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 09:23:38 -0000 Author: hselasky Date: Thu Jun 23 09:23:37 2016 New Revision: 302139 URL: https://svnweb.freebsd.org/changeset/base/302139 Log: Use correct Q-counter output array. Sponsored by: Mellanox Technologies Approved by: re (kib) MFC after: 3 days Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vport.c Modified: head/sys/dev/mlx5/mlx5_core/mlx5_vport.c ============================================================================== --- head/sys/dev/mlx5/mlx5_core/mlx5_vport.c Thu Jun 23 09:13:15 2016 (r302138) +++ head/sys/dev/mlx5/mlx5_core/mlx5_vport.c Thu Jun 23 09:23:37 2016 (r302139) @@ -71,7 +71,7 @@ static int mlx5_query_nic_vport_context( int mlx5_vport_alloc_q_counter(struct mlx5_core_dev *mdev, int *counter_set_id) { u32 in[MLX5_ST_SZ_DW(alloc_q_counter_in)]; - u32 out[MLX5_ST_SZ_DW(alloc_q_counter_in)]; + u32 out[MLX5_ST_SZ_DW(alloc_q_counter_out)]; int err; memset(in, 0, sizeof(in)); From owner-svn-src-head@freebsd.org Thu Jun 23 11:55:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9C20B73D53; Thu, 23 Jun 2016 11:55:16 +0000 (UTC) (envelope-from bz@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 BB4E4265D; Thu, 23 Jun 2016 11:55:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5NBtFRb031975; Thu, 23 Jun 2016 11:55:15 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NBtFor031974; Thu, 23 Jun 2016 11:55:15 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606231155.u5NBtFor031974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 11:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302140 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 11:55:17 -0000 Author: bz Date: Thu Jun 23 11:55:15 2016 New Revision: 302140 URL: https://svnweb.freebsd.org/changeset/base/302140 Log: In VNET TCP teardown Do not sleep unconditionally but only if we have any TCP connections left. Submitted by: zec Approved by: re (hrs) MFC after: 13 days Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Jun 23 09:23:37 2016 (r302139) +++ head/sys/netinet/tcp_subr.c Thu Jun 23 11:55:15 2016 (r302140) @@ -739,10 +739,11 @@ tcp_destroy(void *unused __unused) * Sleep to let all tcpcb timers really disappear and cleanup. */ do { - pause("tcpdes", hz/10); INP_LIST_RLOCK(&V_tcbinfo); n = V_tcbinfo.ipi_count; INP_LIST_RUNLOCK(&V_tcbinfo); + if (n != 0) + pause("tcpdes", hz / 10); } while (n != 0); tcp_hc_destroy(); syncache_destroy(); From owner-svn-src-head@freebsd.org Thu Jun 23 12:01:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B5DFB73624; Thu, 23 Jun 2016 12:01:40 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (bird.sbone.de [46.4.1.90]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DCA52FDF; Thu, 23 Jun 2016 12:01:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id D1E6F25D37C2; Thu, 23 Jun 2016 12:01:30 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id BD775D1F827; Thu, 23 Jun 2016 12:01:29 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id q0pnQXFj4MLF; Thu, 23 Jun 2016 12:01:27 +0000 (UTC) Received: from [192.168.124.1] (unknown [IPv6:fde9:577b:c1a9:4410:21bf:e4ab:2432:b9]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 0908AD1F825; Thu, 23 Jun 2016 11:59:26 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Marko Zec" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302099 - head/sys/netinet Date: Thu, 23 Jun 2016 11:59:24 +0000 Message-ID: <1875471F-E650-4A29-89A5-D60DAD926C9F@FreeBSD.org> In-Reply-To: <20160623101757.3e8022fe@x23> References: <201606230034.u5N0Y3Ea069103@repo.freebsd.org> <20160623101757.3e8022fe@x23> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Mailer: MailMate Trial (2.0BETAr6032) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 12:01:40 -0000 On 23 Jun 2016, at 8:17, Marko Zec wrote: > On Thu, 23 Jun 2016 00:34:03 +0000 > "Bjoern A. Zeeb" wrote: > >> Author: bz >> Date: Thu Jun 23 00:34:03 2016 >> New Revision: 302099 >> URL: https://svnweb.freebsd.org/changeset/base/302099 >> >> Log: >> Check the V_tcbinfo.ipi_count to hit 0 before doing the full TCP >> cleanup. That way timers can finish cleanly and we do not gamble with >> a DELAY(). >> Reviewed by: gnn, jtl >> Approved by: re (gjb) >> Obtained from: projects/vnet >> MFC after: 2 weeks >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D6923 > > As much as this change is welcome, it unnecesarily introduces a > mandatory 100 ms delay on each vnet teardown, which I already pointed > out in a comment to r301601 two weeks ago, which remained unanswered, sorry about that. While VNET teardown is a non-criticial slow path and the pause doesn’t really matter a lot (unless you need the resources to be freed) you actually made me go an “benchmark” this in terms of how often my test cases do run into the pause after your change. It was indeed very rare. > along with the question why a delay of 100 ms was introduced here, when > before r302099 the delay was only a single clock tick? And furthermore > the delay computation expresion here is not style(9) compliant... > > Hence, please rectify the above objections, perhaps by something like: Done. Thanks a lot! /bz From owner-svn-src-head@freebsd.org Thu Jun 23 15:02:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FD1BB72740; Thu, 23 Jun 2016 15:02:59 +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 E3A6E1A28; Thu, 23 Jun 2016 15:02:58 +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 u5NF2wXb003208; Thu, 23 Jun 2016 15:02:58 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NF2v1g003203; Thu, 23 Jun 2016 15:02:57 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201606231502.u5NF2v1g003203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 23 Jun 2016 15:02:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302141 - in head/cddl/lib: libavl libctf libnvpair libumem libuutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 15:02:59 -0000 Author: asomers Date: Thu Jun 23 15:02:57 2016 New Revision: 302141 URL: https://svnweb.freebsd.org/changeset/base/302141 Log: Raise the WARNS level in cddl/lib cddl/lib/libavl/Makefile cddl/lib/libctf/Makefile cddl/lib/libnvpair/Makefile cddl/lib/libumem/Makefile cddl/lib/libuutil/Makefile Increase WARNS to the highest working level for each of these libraries Approved by: re (gjb, hrs) MFC after: 4 weeks Sponsored by: Spectra Logic Corp Modified: head/cddl/lib/libavl/Makefile head/cddl/lib/libctf/Makefile head/cddl/lib/libnvpair/Makefile head/cddl/lib/libumem/Makefile head/cddl/lib/libuutil/Makefile Modified: head/cddl/lib/libavl/Makefile ============================================================================== --- head/cddl/lib/libavl/Makefile Thu Jun 23 11:55:15 2016 (r302140) +++ head/cddl/lib/libavl/Makefile Thu Jun 23 15:02:57 2016 (r302141) @@ -4,7 +4,7 @@ LIB= avl SRCS= avl.c -WARNS?= 0 +WARNS?= 3 CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris CFLAGS+= -I${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common Modified: head/cddl/lib/libctf/Makefile ============================================================================== --- head/cddl/lib/libctf/Makefile Thu Jun 23 11:55:15 2016 (r302140) +++ head/cddl/lib/libctf/Makefile Thu Jun 23 15:02:57 2016 (r302141) @@ -18,7 +18,7 @@ SRCS= ctf_create.c \ ctf_util.c MAN= ctf.5 -WARNS?= 0 +WARNS?= 2 CFLAGS+= -DCTF_OLD_VERSIONS CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris \ Modified: head/cddl/lib/libnvpair/Makefile ============================================================================== --- head/cddl/lib/libnvpair/Makefile Thu Jun 23 11:55:15 2016 (r302140) +++ head/cddl/lib/libnvpair/Makefile Thu Jun 23 15:02:57 2016 (r302141) @@ -12,7 +12,7 @@ SRCS= libnvpair.c \ opensolaris_nvpair.c \ opensolaris_nvpair_alloc_fixed.c -WARNS?= 0 +WARNS?= 1 CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/include CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libzpool/common CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris Modified: head/cddl/lib/libumem/Makefile ============================================================================== --- head/cddl/lib/libumem/Makefile Thu Jun 23 11:55:15 2016 (r302140) +++ head/cddl/lib/libumem/Makefile Thu Jun 23 15:02:57 2016 (r302141) @@ -4,7 +4,7 @@ LIB= umem SRCS= umem.c -WARNS?= 0 +WARNS?= 3 CFLAGS+= -I${.CURDIR}/../../../cddl/compat/opensolaris/lib/libumem .include Modified: head/cddl/lib/libuutil/Makefile ============================================================================== --- head/cddl/lib/libuutil/Makefile Thu Jun 23 11:55:15 2016 (r302140) +++ head/cddl/lib/libuutil/Makefile Thu Jun 23 15:02:57 2016 (r302141) @@ -15,7 +15,7 @@ SRCS= avl.c \ uu_pname.c \ uu_strtoint.c -WARNS?= 0 +WARNS?= 1 CFLAGS+= -DNATIVE_BUILD CFLAGS+= -I${.CURDIR}/../../../cddl/contrib/opensolaris/lib/libuutil/common CFLAGS+= -I${.CURDIR}/../../../sys/cddl/compat/opensolaris From owner-svn-src-head@freebsd.org Thu Jun 23 15:57:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1690AC59FA; Thu, 23 Jun 2016 15:57:58 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from mail.strugglingcoder.info (strugglingcoder.info [104.236.146.68]) by mx1.freebsd.org (Postfix) with ESMTP id A349B1B96; Thu, 23 Jun 2016 15:57:58 +0000 (UTC) (envelope-from hiren@strugglingcoder.info) Received: from localhost (unknown [10.1.1.3]) (Authenticated sender: hiren@strugglingcoder.info) by mail.strugglingcoder.info (Postfix) with ESMTPA id 58170174F8; Thu, 23 Jun 2016 08:57:52 -0700 (PDT) Date: Thu, 23 Jun 2016 08:57:52 -0700 From: hiren panchasara To: "Andrey V. Elsukov" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302081 - head/sys/netinet6 Message-ID: <20160623155752.GC60812@strugglingcoder.info> References: <201606221129.u5MBTMun071427@repo.freebsd.org> <20160622154613.GR60812@strugglingcoder.info> <576BA265.2060104@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="z3ND3gJe4e1E4uwh" Content-Disposition: inline In-Reply-To: <576BA265.2060104@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 15:57:58 -0000 --z3ND3gJe4e1E4uwh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 06/23/16 at 11:48P, Andrey V. Elsukov wrote: > On 22.06.16 18:46, hiren panchasara wrote: > >> Fix the NULL pointer dereference for unresolved link layer entries in > >> the netinet6 code. Copy link layer address only when corresponding e= ntry > >> has LLE_VALID flag. > >> =20 > >> PR: 210379 > >> Approved by: re (kib) > >> > >> Modified: > >> head/sys/netinet6/in6.c > >=20 > > Cursory look tells me that this bug is also present in 10. Is that true? > > If so, is it possible for you to mfc this? >=20 > The patch is applicable, but due to the difference in the LLE code > stable/10 has not affected with this bug. Ah, okay. Thanks a lot for checking. Cheers, Hiren --z3ND3gJe4e1E4uwh Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAABCgBmBQJXbAb9XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRBNEUyMEZBMUQ4Nzg4RjNGMTdFNjZGMDI4 QjkyNTBFMTU2M0VERkU1AAoJEIuSUOFWPt/lAU8H/0yn9lAe4Va0/jRMkFV6pquM fxwfY9Dc32m3TUDQ766Kn3cbosXCGJHYEQVWNT1TUMtfXEpNLgOVd0k+Olk1bLwV pvVBjxzyV/lkRJw1j1PlW4EwMvi82qv+OJf/+NnEgxCsE6JjTkRTyA1Yl05rd3Bx fp4M/bGuBe7Ke3a+0ho1Wqwa9OUk73j0I+QqMXI/YZ21z87Td5Y4O3A9keaPBHTW 9ZTD6/9amyG9fU7PeXfjQ447pxizLiSJGHLsqa74yBEDz2pEHiythGLjcHoW8U9K zWguV67/6AulkXZk+9gks35p8uMX/aeZj5XNczVW0dtZgKegowtRmnqahicobk0= =o0Si -----END PGP SIGNATURE----- --z3ND3gJe4e1E4uwh-- From owner-svn-src-head@freebsd.org Thu Jun 23 16:55:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BBE0B73CA9; Thu, 23 Jun 2016 16:55:06 +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 37BBA2D60; Thu, 23 Jun 2016 16:55:06 +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 069E9B923; Thu, 23 Jun 2016 12:55:05 -0400 (EDT) From: John Baldwin To: Marko Zec Cc: "Bjoern A. Zeeb" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, gnn@freebsd.org, jtl@freebsd.org, gjb@freebsd.org Subject: Re: svn commit: r302099 - head/sys/netinet Date: Thu, 23 Jun 2016 09:54:35 -0700 Message-ID: <2792317.yMOeJVR7no@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160623101757.3e8022fe@x23> References: <201606230034.u5N0Y3Ea069103@repo.freebsd.org> <20160623101757.3e8022fe@x23> 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, 23 Jun 2016 12:55:05 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 16:55:06 -0000 On Thursday, June 23, 2016 10:17:57 AM Marko Zec wrote: > On Thu, 23 Jun 2016 00:34:03 +0000 > "Bjoern A. Zeeb" wrote: > > > Author: bz > > Date: Thu Jun 23 00:34:03 2016 > > New Revision: 302099 > > URL: https://svnweb.freebsd.org/changeset/base/302099 > > > > Log: > > Check the V_tcbinfo.ipi_count to hit 0 before doing the full TCP > > cleanup. That way timers can finish cleanly and we do not gamble with > > a DELAY(). > > Reviewed by: gnn, jtl > > Approved by: re (gjb) > > Obtained from: projects/vnet > > MFC after: 2 weeks > > Sponsored by: The FreeBSD Foundation > > Differential Revision: https://reviews.freebsd.org/D6923 > > As much as this change is welcome, it unnecesarily introduces a > mandatory 100 ms delay on each vnet teardown, which I already pointed > out in a comment to r301601 two weeks ago, which remained unanswered, > along with the question why a delay of 100 ms was introduced here, when > before r302099 the delay was only a single clock tick? And furthermore > the delay computation expresion here is not style(9) compliant... > > Hence, please rectify the above objections, perhaps by something like: > > =================================================================== > --- tcp_subr.c (revision 302126) > +++ tcp_subr.c (working copy) > @@ -739,10 +739,11 @@ > * Sleep to let all tcpcb timers really disappear and cleanup. > */ > do { > - pause("tcpdes", hz/10); > INP_LIST_RLOCK(&V_tcbinfo); > n = V_tcbinfo.ipi_count; > INP_LIST_RUNLOCK(&V_tcbinfo); > + if (n != 0) > + pause("tcpdes", hz / 100); > } while (n != 0); > tcp_hc_destroy(); > syncache_destroy(); I would suggest avoiding the duplicate test by using a break: for (;;) { /* fetch 'n' */ if (n == 0) break; pause(...); } -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jun 23 16:55:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C08FFB73CAE; Thu, 23 Jun 2016 16:55:07 +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 A0F052D70; Thu, 23 Jun 2016 16:55:07 +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 B8DD2B945; Thu, 23 Jun 2016 12:55:06 -0400 (EDT) From: John Baldwin To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302094 - in head/sys: compat/freebsd32 kern Date: Thu, 23 Jun 2016 09:52:58 -0700 Message-ID: <1867573.VqAxCqRXft@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.3-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160623003948.GB41630@spindle.one-eyed-alien.net> References: <201606222115.u5MLFxBD093628@repo.freebsd.org> <5096414.4TN0ypqLNM@ralph.baldwin.cx> <20160623003948.GB41630@spindle.one-eyed-alien.net> 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, 23 Jun 2016 12:55:06 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 16:55:07 -0000 On Thursday, June 23, 2016 12:39:48 AM Brooks Davis wrote: > On Wed, Jun 22, 2016 at 05:09:34PM -0700, John Baldwin wrote: > > On Wednesday, June 22, 2016 09:15:59 PM Brooks Davis wrote: > > > Author: brooks > > > Date: Wed Jun 22 21:15:59 2016 > > > New Revision: 302094 > > > URL: https://svnweb.freebsd.org/changeset/base/302094 > > > > > > Log: > > > Mark the pipe() system call as COMPAT10. > > > > > > As of r302092 libc uses pipe2() with a zero flags value instead of pipe(). > > > > > > Commit with regenerated files and implementation to follow. > > > > This breaks the build on at least i386 because other ABIs depend on being > > able to call sys_pipe directly. You should at least add COMPAT_FREEBSD10 > > to GENERIC on architectures that shipped a 10.x release. That will fix the > > build breakage on i386, but it's also the policy we follow for all the other > > compat knobs. > > It was actually that sys_pipe() was renamed by the COMPAT10 tag. I've > copied the implementation to a svr4_pipe(). Thanks, my bad for jumping the gun on assuming FREEBSD10 was missing from GENERIC. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Jun 23 18:04:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2929B73EED; Thu, 23 Jun 2016 18:04:49 +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 8068F1236; Thu, 23 Jun 2016 18:04:49 +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 u5NI4mmm072084; Thu, 23 Jun 2016 18:04:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NI4mEb072083; Thu, 23 Jun 2016 18:04:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201606231804.u5NI4mEb072083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 23 Jun 2016 18:04:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302145 - head/usr.sbin/bsdinstall/partedit X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 18:04:49 -0000 Author: emaste Date: Thu Jun 23 18:04:48 2016 New Revision: 302145 URL: https://svnweb.freebsd.org/changeset/base/302145 Log: bsdinstall: increase EFI partition size to 200MB A larger EFI file system size will facilitate multi-boot configurations and the installation other EFI applications like firmware update tools. 200MB matches OS X. Note that this changes only the partition size, not the file system that bsdinstall places there. We need to do both, but as the partition size is difficult to adjust later make this change for now so that at least systems installed with FreeBSD 11.0 have a partition layout with room to grow. Reviewed by: allanjude, imp Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6935 Modified: head/usr.sbin/bsdinstall/partedit/partedit_x86.c Modified: head/usr.sbin/bsdinstall/partedit/partedit_x86.c ============================================================================== --- head/usr.sbin/bsdinstall/partedit/partedit_x86.c Thu Jun 23 16:37:43 2016 (r302144) +++ head/usr.sbin/bsdinstall/partedit/partedit_x86.c Thu Jun 23 18:04:48 2016 (r302145) @@ -99,7 +99,7 @@ bootpart_size(const char *scheme) if (strcmp(x86_bootmethod(), "BIOS") == 0) return (512*1024); else - return (800*1024); + return (200*1024*1024); return (0); } From owner-svn-src-head@freebsd.org Thu Jun 23 19:19:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80903B73E16; Thu, 23 Jun 2016 19:19:45 +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 4711F2293; Thu, 23 Jun 2016 19:19:45 +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 u5NJJiLR097934; Thu, 23 Jun 2016 19:19:44 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NJJidh097933; Thu, 23 Jun 2016 19:19:44 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201606231919.u5NJJidh097933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 23 Jun 2016 19:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302146 - head/tools/tools/makeroot X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 19:19:45 -0000 Author: emaste Date: Thu Jun 23 19:19:44 2016 New Revision: 302146 URL: https://svnweb.freebsd.org/changeset/base/302146 Log: makeroot: zero out subsecond component of time= keywords They are currently not supported by makefs(1). PR: 194703 Reviewed by: brooks Approved by: re (gjb) Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6925 Modified: head/tools/tools/makeroot/makeroot.sh Modified: head/tools/tools/makeroot/makeroot.sh ============================================================================== --- head/tools/tools/makeroot/makeroot.sh Thu Jun 23 18:04:48 2016 (r302145) +++ head/tools/tools/makeroot/makeroot.sh Thu Jun 23 19:19:44 2016 (r302146) @@ -238,5 +238,9 @@ if [ -n "${SIZE}" ]; then SIZEFLAG="-s ${SIZE}" fi +# Zero out subsecond component of time= keywords as they are currently not +# supported by makefs +sed -i '' -E 's/(time=[0-9]*)\.[0-9]*/\1.0/' ${manifest} + cd ${BSDROOT}; makefs ${DUPFLAG} -N ${DBDIR} ${SIZEFLAG} ${BFLAG} \ -t ffs ${LABELFLAG} -f 256 ${IMGFILE} ${manifest} From owner-svn-src-head@freebsd.org Thu Jun 23 19:24:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 72546B73225; Thu, 23 Jun 2016 19:24:39 +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 3FB75194F; Thu, 23 Jun 2016 19:24:39 +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 u5NJOcS9001901; Thu, 23 Jun 2016 19:24:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NJOc9J001900; Thu, 23 Jun 2016 19:24:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606231924.u5NJOc9J001900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 23 Jun 2016 19:24:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302147 - head/sys/x86/acpica X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 19:24:39 -0000 Author: markj Date: Thu Jun 23 19:24:38 2016 New Revision: 302147 URL: https://svnweb.freebsd.org/changeset/base/302147 Log: Use M_NOWAIT when allocating memory for the ACPI wakeup handler. If the allocation attempt fails, we may otherwise VM_WAIT after a failed attempt to reclaim contiguous memory in the requested range. After r297466, this results in the thread going to sleep, causing a hang during boot. Reviewed by: jkim, kib Approved by: re (gjb) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D6945 Modified: head/sys/x86/acpica/acpi_wakeup.c Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Thu Jun 23 19:19:44 2016 (r302146) +++ head/sys/x86/acpica/acpi_wakeup.c Thu Jun 23 19:24:38 2016 (r302147) @@ -322,7 +322,7 @@ acpi_alloc_wakeup_handler(void) * page-aligned. */ wakeaddr = contigmalloc((ACPI_PAGETABLES + 1) * PAGE_SIZE, M_DEVBUF, - M_WAITOK, 0x500, 0xa0000, PAGE_SIZE, 0ul); + M_NOWAIT, 0x500, 0xa0000, PAGE_SIZE, 0ul); if (wakeaddr == NULL) { printf("%s: can't alloc wake memory\n", __func__); return (NULL); From owner-svn-src-head@freebsd.org Thu Jun 23 19:27:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34332B73317; Thu, 23 Jun 2016 19:27:31 +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 D859224A1; Thu, 23 Jun 2016 19:27:30 +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 u5NJRTbY002037; Thu, 23 Jun 2016 19:27:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NJRTpk002036; Thu, 23 Jun 2016 19:27:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201606231927.u5NJRTpk002036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Thu, 23 Jun 2016 19:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302148 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 19:27:31 -0000 Author: tuexen Date: Thu Jun 23 19:27:29 2016 New Revision: 302148 URL: https://svnweb.freebsd.org/changeset/base/302148 Log: Fix a bug in the handling of non-blocking SCTP 1-to-1 sockets. When using this code in the userland stack, it could result in a loop. This happened on iOS. However, I was not able to reproduce this when using the code in the kernel. Thanks to Eugen-Andrei Gavriloaie for reporting the issue and proving detailed information to find the root of the problem. Approved by: re (gjb) MFC after: 1 week Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Thu Jun 23 19:24:38 2016 (r302147) +++ head/sys/netinet/sctputil.c Thu Jun 23 19:27:29 2016 (r302148) @@ -5274,8 +5274,14 @@ restart_nosblocks: } } } - if ((so->so_rcv.sb_cc <= held_length) && block_allowed) { - /* we need to wait for data */ + if (so->so_rcv.sb_cc <= held_length) { + if (so->so_error) { + error = so->so_error; + if ((in_flags & MSG_PEEK) == 0) { + so->so_error = 0; + } + goto out; + } if ((so->so_rcv.sb_cc == 0) && ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL))) { @@ -5306,51 +5312,18 @@ restart_nosblocks: goto out; } } - error = sbwait(&so->so_rcv); - if (error) { - goto out; - } - held_length = 0; - goto restart_nosblocks; - } else if (so->so_rcv.sb_cc == 0) { - if (so->so_error) { - error = so->so_error; - if ((in_flags & MSG_PEEK) == 0) - so->so_error = 0; - } else { - if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) || - (inp->sctp_flags & SCTP_PCB_FLAGS_IN_TCPPOOL)) { - if ((inp->sctp_flags & SCTP_PCB_FLAGS_CONNECTED) == 0) { - /* - * For active open side clear flags - * for re-use passive open is - * blocked by connect. - */ - if (inp->sctp_flags & SCTP_PCB_FLAGS_WAS_ABORTED) { - /* - * You were aborted, passive - * side always hits here - */ - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ECONNRESET); - error = ECONNRESET; - } - so->so_state &= ~(SS_ISCONNECTING | - SS_ISDISCONNECTING | - SS_ISCONFIRMING | - SS_ISCONNECTED); - if (error == 0) { - if ((inp->sctp_flags & SCTP_PCB_FLAGS_WAS_CONNECTED) == 0) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, ENOTCONN); - error = ENOTCONN; - } - } - goto out; - } + if (block_allowed) { + error = sbwait(&so->so_rcv); + if (error) { + goto out; } + held_length = 0; + goto restart_nosblocks; + } else { SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTPUTIL, EWOULDBLOCK); error = EWOULDBLOCK; + goto out; } - goto out; } if (hold_sblock == 1) { SOCKBUF_UNLOCK(&so->so_rcv); From owner-svn-src-head@freebsd.org Thu Jun 23 19:37:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D23EBB73548; Thu, 23 Jun 2016 19:37:01 +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 914942A02; Thu, 23 Jun 2016 19:37:01 +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 u5NJb0eD005773; Thu, 23 Jun 2016 19:37:00 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NJb03I005772; Thu, 23 Jun 2016 19:37:00 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201606231937.u5NJb03I005772@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Thu, 23 Jun 2016 19:37:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302149 - head/etc/defaults X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 19:37:01 -0000 Author: lidl Date: Thu Jun 23 19:37:00 2016 New Revision: 302149 URL: https://svnweb.freebsd.org/changeset/base/302149 Log: Add support for a /etc/defaults/vendor.conf override file Reviewed by: stas, imp Approved by: re (gjb) Differential Revision: https://reviews.freebsd.org/D6895 Modified: head/etc/defaults/rc.conf Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Thu Jun 23 19:27:29 2016 (r302148) +++ head/etc/defaults/rc.conf Thu Jun 23 19:37:00 2016 (r302149) @@ -741,3 +741,9 @@ if [ -z "${source_rc_confs_defined}" ]; done } fi + +# Allow vendors to override FreeBSD defaults in /etc/default/rc.conf +# without the need to carefully manage /etc/rc.conf. +if [ -r /etc/defaults/vendor.conf ]; then + . /etc/defaults/vendor.conf +fi From owner-svn-src-head@freebsd.org Thu Jun 23 20:06:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93F45B73A3A; Thu, 23 Jun 2016 20:06:00 +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 6F48D1DCD; Thu, 23 Jun 2016 20:06:00 +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 u5NK5xGm017066; Thu, 23 Jun 2016 20:05:59 GMT (envelope-from ken@FreeBSD.org) Received: (from ken@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NK5xTc017063; Thu, 23 Jun 2016 20:05:59 GMT (envelope-from ken@FreeBSD.org) Message-Id: <201606232005.u5NK5xTc017063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ken set sender to ken@FreeBSD.org using -f From: "Kenneth D. Merry" Date: Thu, 23 Jun 2016 20:05:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302150 - in head/sys: geom sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 20:06:00 -0000 Author: ken Date: Thu Jun 23 20:05:59 2016 New Revision: 302150 URL: https://svnweb.freebsd.org/changeset/base/302150 Log: Switch geom_disk over to using a pool mutex. The GEOM disk d_mtx is only acquired on disk creation and destruction. It is a good candidate for replacement with a pool mutex. This eliminates the mutex initialization and teardown and the mutex and name variables themselves from struct disk. sys/geom/geom_disk.h: Take d_mtx and d_mtx_name out of struct disk. sys/geom/geom_disk.c: Use mtx_pool_lock() and mtx_pool_unlock() to guard the disk initialization state instead of a dedicated mutex. This allows removing the initialization and destruction of d_mtx. sys/sys/param.h: Bump __FreeBSD_version to 1100119 for the change to struct disk. Suggested by: jhb Sponsored by: Spectra Logic Approved by: re (gjb) Modified: head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h head/sys/sys/param.h Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Thu Jun 23 19:37:00 2016 (r302149) +++ head/sys/geom/geom_disk.c Thu Jun 23 20:05:59 2016 (r302150) @@ -670,7 +670,7 @@ g_disk_create(void *arg, int flag) g_topology_assert(); dp = arg; - mtx_lock(&dp->d_mtx); + mtx_pool_lock(mtxpool_sleep, dp); dp->d_init_level = DISK_INIT_START; /* @@ -678,12 +678,12 @@ g_disk_create(void *arg, int flag) * call the user's callback to tell him we've cleaned things up. */ if (dp->d_goneflag != 0) { - mtx_unlock(&dp->d_mtx); + mtx_pool_unlock(mtxpool_sleep, dp); if (dp->d_gone != NULL) dp->d_gone(dp); return; } - mtx_unlock(&dp->d_mtx); + mtx_pool_unlock(mtxpool_sleep, dp); sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO); mtx_init(&sc->start_mtx, "g_disk_start", NULL, MTX_DEF); @@ -721,7 +721,7 @@ g_disk_create(void *arg, int flag) dp->d_geom = gp; g_error_provider(pp, 0); - mtx_lock(&dp->d_mtx); + mtx_pool_lock(mtxpool_sleep, dp); dp->d_init_level = DISK_INIT_DONE; /* @@ -729,11 +729,11 @@ g_disk_create(void *arg, int flag) * process for it. */ if (dp->d_goneflag != 0) { - mtx_unlock(&dp->d_mtx); + mtx_pool_unlock(mtxpool_sleep, dp); g_wither_provider(pp, ENXIO); return; } - mtx_unlock(&dp->d_mtx); + mtx_pool_unlock(mtxpool_sleep, dp); } @@ -786,8 +786,6 @@ g_disk_destroy(void *ptr, int flag) g_wither_geom(gp, ENXIO); } - mtx_destroy(&dp->d_mtx); - g_free(dp); } @@ -852,9 +850,6 @@ disk_create(struct disk *dp, int version DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX); dp->d_geom = NULL; - snprintf(dp->d_mtx_name, sizeof(dp->d_mtx_name), "%s%ddlk", - dp->d_name, dp->d_unit); - mtx_init(&dp->d_mtx, dp->d_mtx_name, NULL, MTX_DEF); dp->d_init_level = DISK_INIT_NONE; g_disk_ident_adjust(dp->d_ident, sizeof(dp->d_ident)); @@ -878,7 +873,7 @@ disk_gone(struct disk *dp) struct g_geom *gp; struct g_provider *pp; - mtx_lock(&dp->d_mtx); + mtx_pool_lock(mtxpool_sleep, dp); dp->d_goneflag = 1; /* @@ -897,10 +892,10 @@ disk_gone(struct disk *dp) * has not been fully setup in any case. */ if (dp->d_init_level < DISK_INIT_DONE) { - mtx_unlock(&dp->d_mtx); + mtx_pool_unlock(mtxpool_sleep, dp); return; } - mtx_unlock(&dp->d_mtx); + mtx_pool_unlock(mtxpool_sleep, dp); gp = dp->d_geom; if (gp != NULL) { Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Thu Jun 23 19:37:00 2016 (r302149) +++ head/sys/geom/geom_disk.h Thu Jun 23 20:05:59 2016 (r302150) @@ -72,8 +72,6 @@ struct disk { struct devstat *d_devstat; int d_goneflag; int d_destroyed; - struct mtx d_mtx; - char d_mtx_name[24]; disk_init_level d_init_level; /* Shared fields */ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Jun 23 19:37:00 2016 (r302149) +++ head/sys/sys/param.h Thu Jun 23 20:05:59 2016 (r302150) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100118 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100119 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Thu Jun 23 20:59:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B176CB73574; Thu, 23 Jun 2016 20:59:14 +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 7EA111730; Thu, 23 Jun 2016 20:59:14 +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 u5NKxDMJ040642; Thu, 23 Jun 2016 20:59:13 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NKxDOO040641; Thu, 23 Jun 2016 20:59:13 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201606232059.u5NKxDOO040641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 23 Jun 2016 20:59:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302151 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 20:59:14 -0000 Author: jilles Date: Thu Jun 23 20:59:13 2016 New Revision: 302151 URL: https://svnweb.freebsd.org/changeset/base/302151 Log: posixshm: Fix lock leak when mac_posixshm_check_read rejects read. While reading the code, I noticed that shm_read() returns without unlocking foffset and rangelock if mac_posixshm_check_read() rejects the read. Reviewed by: kib, jhb, rwatson Approved by: re (gjb) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D6927 Modified: head/sys/kern/uipc_shm.c Modified: head/sys/kern/uipc_shm.c ============================================================================== --- head/sys/kern/uipc_shm.c Thu Jun 23 20:05:59 2016 (r302150) +++ head/sys/kern/uipc_shm.c Thu Jun 23 20:59:13 2016 (r302151) @@ -295,14 +295,14 @@ shm_read(struct file *fp, struct uio *ui int error; shmfd = fp->f_data; - foffset_lock_uio(fp, uio, flags); - rl_cookie = rangelock_rlock(&shmfd->shm_rl, uio->uio_offset, - uio->uio_offset + uio->uio_resid, &shmfd->shm_mtx); #ifdef MAC error = mac_posixshm_check_read(active_cred, fp->f_cred, shmfd); if (error) return (error); #endif + foffset_lock_uio(fp, uio, flags); + rl_cookie = rangelock_rlock(&shmfd->shm_rl, uio->uio_offset, + uio->uio_offset + uio->uio_resid, &shmfd->shm_mtx); error = uiomove_object(shmfd->shm_object, shmfd->shm_size, uio); rangelock_unlock(&shmfd->shm_rl, rl_cookie, &shmfd->shm_mtx); foffset_unlock_uio(fp, uio, flags); From owner-svn-src-head@freebsd.org Thu Jun 23 21:02:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93666B73706; Thu, 23 Jun 2016 21:02:06 +0000 (UTC) (envelope-from brooks@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 658A02530; Thu, 23 Jun 2016 21:02:06 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5NL25Er044146; Thu, 23 Jun 2016 21:02:05 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NL259V044145; Thu, 23 Jun 2016 21:02:05 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201606232102.u5NL259V044145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 23 Jun 2016 21:02:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302152 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 21:02:06 -0000 Author: brooks Date: Thu Jun 23 21:02:05 2016 New Revision: 302152 URL: https://svnweb.freebsd.org/changeset/base/302152 Log: Add an UPDATING entry for the pipe() -> pipe2() transition. Approved by: re (gjb) Sponsored by: DARPA, AFRL Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jun 23 20:59:13 2016 (r302151) +++ head/UPDATING Thu Jun 23 21:02:05 2016 (r302152) @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160622: + The the libc stub for the pipe(2) system call has been replaced with + a wrapper which calls the pipe2(2) system call and the pipe(2) is now + only implemented by the kernels which include "options + FREEBSD10_COMPAT" in their config file (this is the default). + Users should ensure that this option is enabled in their kernel + or upgrade userspace to r302092 before upgrading their kernel. + 20160527: CAM will now strip leading spaces from SCSI disks' serial numbers. This will effect users who create UFS filesystems on SCSI disks using From owner-svn-src-head@freebsd.org Thu Jun 23 21:05:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD778B737D8 for ; Thu, 23 Jun 2016 21:05:35 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qk0-x22b.google.com (mail-qk0-x22b.google.com [IPv6:2607:f8b0:400d:c09::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 9619E220B for ; Thu, 23 Jun 2016 21:05:35 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qk0-x22b.google.com with SMTP id c73so123182118qkg.2 for ; Thu, 23 Jun 2016 14:05:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=subject:mime-version:from:in-reply-to:date:cc:message-id:references :to; bh=vL8KRIC2er//avjaTtH/ULMI4w7dIJnpNX6iL9vkRFM=; b=04jmC0tZdwvySMhzsGTQzf+fAezkYvrV/60bGnE010u2Q0DFnFvovEhHAJIsx15Sal a6lp0++/zKjFejUMJ/JqnaVNUMnWA5Tj/cnM/ED/oMsgQRjQUOVMobaGloKKjxvP1nrj Gdosl3Y1epA8kiOjqcQmhI5Nlj8BF7Hs78+VmxqteyKBLAnGrBEIJ1KQxGxYcF0Da6vZ cr7Bddu0PjgoyPWB7KRx1wIFct8SDsrxGDdkC2uyqLC1REKRAo89ebROUttnWqkvnkIe FHTqi5ACCTrOK35zNjT89rpKqq8QMTxW9H/p+IguQjg1Nz2mLXhV52FVyqanCF4uBXRZ EXwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:mime-version:from:in-reply-to:date:cc :message-id:references:to; bh=vL8KRIC2er//avjaTtH/ULMI4w7dIJnpNX6iL9vkRFM=; b=JH4+qInqZFs+fbJwZws+n0mJOQeOCIgep/Y6At0I3v1egI9e7uW+Z27JxzyoYwfaee fYLv25hT2YbdDj0bStWb0hTUIOkqmjvcKNdKqagIj1gdmO1mslurL3kjmkTUs2V8arNP gZ0/hCA7t6xDjdvh2cTTlFrzG95gZTU9FQWV7vhQBIFKyUHjF0y9KpKb99eznsF3nufF cxEC24d5GPr0qhWSw1gFg2yLgDd3ewhcazlYjNUSJKULtYnvARqBesADp6R0/2MdaVRL pMfdxrfIjrQT35dRekXUUavoGZu7m+f6GRzCAstpfgTEIx7apNi4UCgh3+m+L92/m4vg jf/Q== X-Gm-Message-State: ALyK8tJQmSBQZ1VDXe/HOAn/hSWIpN7RPxZ734oYlgC3Sx5T0yOUBd3mKs+bR5r1e7uCkOZn X-Received: by 10.55.59.196 with SMTP id i187mr638540qka.167.1466715934622; Thu, 23 Jun 2016 14:05:34 -0700 (PDT) Received: from ?IPv6:2001:470:e290:1:39a5:20df:41d9:eebb? ([2001:470:e290:1:39a5:20df:41d9:eebb]) by smtp.gmail.com with ESMTPSA id x136sm773064qkb.32.2016.06.23.14.05.33 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 Jun 2016 14:05:33 -0700 (PDT) Subject: Re: svn commit: r302152 - head Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: multipart/signed; boundary="Apple-Mail=_505E6EE3-C4D0-4B98-83B1-B8FBC77ACDC0"; protocol="application/pgp-signature"; micalg=pgp-sha512 X-Pgp-Agent: GPGMail 2.6b2 From: Shawn Webb In-Reply-To: <201606232102.u5NL259V044145@repo.freebsd.org> Date: Thu, 23 Jun 2016 17:05:28 -0400 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: <32BAEECA-9CDB-4199-89AF-4BDB31E39343@hardenedbsd.org> References: <201606232102.u5NL259V044145@repo.freebsd.org> To: Brooks Davis X-Mailer: Apple Mail (2.3124) X-Content-Filtered-By: Mailman/MimeDel 2.1.22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 21:05:36 -0000 --Apple-Mail=_505E6EE3-C4D0-4B98-83B1-B8FBC77ACDC0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hey Brooks, > On Jun 23, 2016, at 5:02 PM, Brooks Davis wrote: >=20 > Author: brooks > Date: Thu Jun 23 21:02:05 2016 > New Revision: 302152 > URL: https://svnweb.freebsd.org/changeset/base/302152 >=20 > Log: > Add an UPDATING entry for the pipe() -> pipe2() transition. >=20 > Approved by: re (gjb) > Sponsored by: DARPA, AFRL >=20 > Modified: > head/UPDATING >=20 > Modified: head/UPDATING > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=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/UPDATING Thu Jun 23 20:59:13 2016 (r302151) > +++ head/UPDATING Thu Jun 23 21:02:05 2016 (r302152) > @@ -31,6 +31,14 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 > disable the most expensive debugging functionality run > "ln -s 'abort:false,junk:false' /etc/malloc.conf".) >=20 > +20160622: > + The the libc stub for the pipe(2) system call has been replaced = with > + a wrapper which calls the pipe2(2) system call and the pipe(2) = is now > + only implemented by the kernels which include "options > + FREEBSD10_COMPAT" in their config file (this is the default). The option is COMPAT_FREEBSD10, not FREEBSD10_COMPAT. Shawn Webb Cofounder and Security Engineer HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --Apple-Mail=_505E6EE3-C4D0-4B98-83B1-B8FBC77ACDC0 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQIcBAEBCgAGBQJXbE8bAAoJEGqEZY9SRW7uOYUP/1KCcF0SYaT0Jv3mHbD55lnU Iez3uyD2z4339B0nCqk50TE6Wkvro9Vlq10gbwmHm6JMNb+eyM9e0OGdmwTlIgST MBTSJvB5gFogS+q3jK3QN4jyNsgNMQYwoeuLnXyxo/thPEMD77Y+nMxmqTRAoKZL BZt17GvcdmKW6v8lFDFQ7Wvhdd4grDrzJ/aPAnXLgRWEn0BW5sE3aR7Sue1PheEy 39S/yRURk3aYJ3KoMiWH/mPTjr/WIdNYQpANAkllFdrykI7156eJz9otb7zrjkJK Kho75hFufGaQEBeAvJn3ARW2LVQglGQDWvnOQTDAg/aGX/MJ24rGSRdPWx7sJSii 0kxS7H2HYPK1wlCV9ToQdixU6IwxnncccQMsCXto4fC+36QzzDc7uw0YWmkMuNLi Cjx1s2uoS7/VXnyUzIWPnNviczkdfZWYjxWDva/h8lI8/id6JfiOG54mtwvv0mrL CzR60f9tek92CO/qwRrYPLTX4NDV1jBlqrYjB+a0soi8n2sCav2i441D1/E+2kPd Z7ORinndWhxdxFddNU+cZloxfm00u6tyfayaGFXpaMwM8fERkA9mezDjGZeyN9Ko rPHEOpGHSBU/d6uGzWCZZeo0ALgcDQziZnaSr1xMezf16ngDEYDnDwKJGKX8oz4y ABh9qijrnaO5zEAme4mY =wLNC -----END PGP SIGNATURE----- --Apple-Mail=_505E6EE3-C4D0-4B98-83B1-B8FBC77ACDC0-- From owner-svn-src-head@freebsd.org Thu Jun 23 21:07:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3EC7B73845; Thu, 23 Jun 2016 21:07:16 +0000 (UTC) (envelope-from np@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 7538C298A; Thu, 23 Jun 2016 21:07:16 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5NL7FBP044388; Thu, 23 Jun 2016 21:07:15 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NL7F3b044384; Thu, 23 Jun 2016 21:07:15 GMT (envelope-from np@FreeBSD.org) Message-Id: <201606232107.u5NL7F3b044384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 23 Jun 2016 21:07:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302153 - in head/sys: net netinet sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 21:07:16 -0000 Author: np Date: Thu Jun 23 21:07:15 2016 New Revision: 302153 URL: https://svnweb.freebsd.org/changeset/base/302153 Log: Add spares to struct ifnet and socket for packet pacing and/or general use. Update comments regarding the spare fields in struct inpcb. Bump __FreeBSD_version for the changes to the size of the structures. Reviewed by: gnn@ Approved by: re@ (gjb@) Sponsored by: Chelsio Communications Modified: head/sys/net/if_var.h head/sys/netinet/in_pcb.h head/sys/sys/param.h head/sys/sys/socketvar.h Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Thu Jun 23 21:02:05 2016 (r302152) +++ head/sys/net/if_var.h Thu Jun 23 21:07:15 2016 (r302153) @@ -311,6 +311,8 @@ struct ifnet { * that structure can be enhanced without changing the kernel * binary interface. */ + void *if_pspare[4]; /* packet pacing / general use */ + int if_ispare[4]; /* packet pacing / general use */ }; /* for compatibility with other BSDs */ Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Thu Jun 23 21:02:05 2016 (r302152) +++ head/sys/netinet/in_pcb.h Thu Jun 23 21:07:15 2016 (r302153) @@ -202,10 +202,10 @@ struct inpcb { u_char inp_ip_minttl; /* (i) minimum TTL or drop */ uint32_t inp_flowid; /* (x) flow id / queue id */ u_int inp_refcount; /* (i) refcount */ - void *inp_pspare[5]; /* (x) route caching / general use */ + void *inp_pspare[5]; /* (x) packet pacing / general use */ uint32_t inp_flowtype; /* (x) M_HASHTYPE value */ uint32_t inp_rss_listen_bucket; /* (x) overridden RSS listen bucket */ - u_int inp_ispare[4]; /* (x) route caching / user cookie / + u_int inp_ispare[4]; /* (x) packet pacing / user cookie / * general use */ /* Local and foreign ports, local and foreign addr. */ Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Thu Jun 23 21:02:05 2016 (r302152) +++ head/sys/sys/param.h Thu Jun 23 21:07:15 2016 (r302153) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1100119 /* Master, propagated to newvers */ +#define __FreeBSD_version 1100120 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/socketvar.h ============================================================================== --- head/sys/sys/socketvar.h Thu Jun 23 21:02:05 2016 (r302152) +++ head/sys/sys/socketvar.h Thu Jun 23 21:07:15 2016 (r302153) @@ -126,6 +126,9 @@ struct socket { */ int so_fibnum; /* routing domain for this socket */ uint32_t so_user_cookie; + + void *so_pspare[2]; /* packet pacing / general use */ + int so_ispare[2]; /* packet pacing / general use */ }; /* From owner-svn-src-head@freebsd.org Thu Jun 23 21:09:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74D4BB7395D; Thu, 23 Jun 2016 21:09:08 +0000 (UTC) (envelope-from brooks@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 427FE220B; Thu, 23 Jun 2016 21:09:08 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5NL97Bu044534; Thu, 23 Jun 2016 21:09:07 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NL97JJ044533; Thu, 23 Jun 2016 21:09:07 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201606232109.u5NL97JJ044533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Thu, 23 Jun 2016 21:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302154 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 21:09:08 -0000 Author: brooks Date: Thu Jun 23 21:09:07 2016 New Revision: 302154 URL: https://svnweb.freebsd.org/changeset/base/302154 Log: Fix two typos in r302152. Approved by: re (implicit) Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Thu Jun 23 21:07:15 2016 (r302153) +++ head/UPDATING Thu Jun 23 21:09:07 2016 (r302154) @@ -32,10 +32,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 "ln -s 'abort:false,junk:false' /etc/malloc.conf".) 20160622: - The the libc stub for the pipe(2) system call has been replaced with + The libc stub for the pipe(2) system call has been replaced with a wrapper which calls the pipe2(2) system call and the pipe(2) is now only implemented by the kernels which include "options - FREEBSD10_COMPAT" in their config file (this is the default). + COMPAT_FREEBSD10" in their config file (this is the default). Users should ensure that this option is enabled in their kernel or upgrade userspace to r302092 before upgrading their kernel. From owner-svn-src-head@freebsd.org Thu Jun 23 21:32:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEC86B73F4D; Thu, 23 Jun 2016 21:32:53 +0000 (UTC) (envelope-from bz@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 7B6231634; Thu, 23 Jun 2016 21:32:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5NLWq4L055900; Thu, 23 Jun 2016 21:32:52 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NLWqdj055899; Thu, 23 Jun 2016 21:32:52 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606232132.u5NLWqdj055899@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 21:32:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302155 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 21:32:53 -0000 Author: bz Date: Thu Jun 23 21:32:52 2016 New Revision: 302155 URL: https://svnweb.freebsd.org/changeset/base/302155 Log: Try to avoid a 2nd conditional by re-writing the loop, pause, and escape clause another time. Submitted by: jhb Approved by: re (gjb) MFC after: 12 days Modified: head/sys/netinet/tcp_subr.c Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Thu Jun 23 21:09:07 2016 (r302154) +++ head/sys/netinet/tcp_subr.c Thu Jun 23 21:32:52 2016 (r302155) @@ -738,13 +738,14 @@ tcp_destroy(void *unused __unused) * up, which means, we should be past the tcp_discardcb() calls. * Sleep to let all tcpcb timers really disappear and cleanup. */ - do { + for (;;) { INP_LIST_RLOCK(&V_tcbinfo); n = V_tcbinfo.ipi_count; INP_LIST_RUNLOCK(&V_tcbinfo); - if (n != 0) - pause("tcpdes", hz / 10); - } while (n != 0); + if (n == 0) + break; + pause("tcpdes", hz / 10); + } tcp_hc_destroy(); syncache_destroy(); tcp_tw_destroy(); From owner-svn-src-head@freebsd.org Thu Jun 23 21:34:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35075B73FD1; Thu, 23 Jun 2016 21:34:13 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F39E11C29; Thu, 23 Jun 2016 21:34:12 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 9BA86B80DB; Thu, 23 Jun 2016 23:34:10 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 6D24828494; Thu, 23 Jun 2016 23:34:11 +0200 (CEST) Date: Thu, 23 Jun 2016 23:34:11 +0200 From: Jilles Tjoelker To: Brooks Davis Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302092 - in head/lib/libc: aarch64/sys amd64/sys arm/sys i386/sys mips/sys powerpc/sys powerpc64/sys riscv/sys sparc64/sys sys Message-ID: <20160623213411.GB5381@stack.nl> References: <201606222111.u5MLBRHn090827@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201606222111.u5MLBRHn090827@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 21:34:13 -0000 On Wed, Jun 22, 2016 at 09:11:27PM +0000, Brooks Davis wrote: > Author: brooks > Date: Wed Jun 22 21:11:27 2016 > New Revision: 302092 > URL: https://svnweb.freebsd.org/changeset/base/302092 > Log: > Replace use of the pipe(2) system call with pipe2(2) with a zero flags > value. > This eliminates the need for machine dependant assembly wrappers for > pipe(2). I like it. > It also make passing an invalid address to pipe(2) return EFAULT rather > than triggering a segfault. Document this behavior (which was already > true for pipe2(2), but undocumented). It is valid to promise [EFAULT] in this specific case since the kernel undoes the call's effects when the copyout fails (by closing the descriptors) and it seems unlikely that we will need a userland wrapper around pipe() or pipe2() that needs to access the created file descriptors. However, POSIX does not require it: passing invalid pointers to functions specified by the standard is undefined behaviour. See r241001 for some man pages where I removed the [EFAULT] condition because it is wrong for both reasons mentioned above (something changes even after copyout failure and userland wrappers dereference pointers). -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Thu Jun 23 21:34:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2A3EB74019; Thu, 23 Jun 2016 21:34:39 +0000 (UTC) (envelope-from bz@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 A6FEA1EC4; Thu, 23 Jun 2016 21:34:39 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5NLYcOO056021; Thu, 23 Jun 2016 21:34:38 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NLYcCP056016; Thu, 23 Jun 2016 21:34:38 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606232134.u5NLYcCP056016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 21:34:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302156 - in head/sys: net netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 21:34:40 -0000 Author: bz Date: Thu Jun 23 21:34:38 2016 New Revision: 302156 URL: https://svnweb.freebsd.org/changeset/base/302156 Log: Update pf(4) and pflog(4) to survive basic VNET testing, which includes proper virtualisation, teardown, avoiding use-after-free, race conditions, no longer creating a thread per VNET (which could easily be a couple of thousand threads), gracefully ignoring global events (e.g., eventhandlers) on teardown, clearing various globally cached pointers and checking them before use. Reviewed by: kp Approved by: re (gjb) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6924 Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/if_pflog.c head/sys/netpfil/pf/pf.c head/sys/netpfil/pf/pf_if.c head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Thu Jun 23 21:32:52 2016 (r302155) +++ head/sys/net/pfvar.h Thu Jun 23 21:34:38 2016 (r302156) @@ -835,7 +835,6 @@ typedef int pflog_packet_t(struct pfi_ki struct pf_ruleset *, struct pf_pdesc *, int); extern pflog_packet_t *pflog_packet_ptr; -#define V_pf_end_threads VNET(pf_end_threads) #endif /* _KERNEL */ #define PFSYNC_FLAG_SRCNODE 0x04 @@ -1520,6 +1519,7 @@ VNET_DECLARE(uma_zone_t, pf_state_scrub #define V_pf_state_scrub_z VNET(pf_state_scrub_z) extern void pf_purge_thread(void *); +extern void pf_unload_vnet_purge(void); extern void pf_intr(void *); extern void pf_purge_expired_src_nodes(void); @@ -1661,7 +1661,9 @@ VNET_DECLARE(struct pfi_kif *, pfi_all #define V_pfi_all VNET(pfi_all) void pfi_initialize(void); +void pfi_initialize_vnet(void); void pfi_cleanup(void); +void pfi_cleanup_vnet(void); void pfi_kif_ref(struct pfi_kif *); void pfi_kif_unref(struct pfi_kif *); struct pfi_kif *pfi_kif_find(const char *); Modified: head/sys/netpfil/pf/if_pflog.c ============================================================================== --- head/sys/netpfil/pf/if_pflog.c Thu Jun 23 21:32:52 2016 (r302155) +++ head/sys/netpfil/pf/if_pflog.c Thu Jun 23 21:34:38 2016 (r302156) @@ -91,19 +91,22 @@ static int pflogioctl(struct ifnet *, u_ static void pflogstart(struct ifnet *); static int pflog_clone_create(struct if_clone *, int, caddr_t); static void pflog_clone_destroy(struct ifnet *); -static struct if_clone *pflog_cloner; static const char pflogname[] = "pflog"; -struct ifnet *pflogifs[PFLOGIFS_MAX]; /* for fast access */ +static VNET_DEFINE(struct if_clone *, pflog_cloner); +#define V_pflog_cloner VNET(pflog_cloner) + +VNET_DEFINE(struct ifnet *, pflogifs[PFLOGIFS_MAX]); /* for fast access */ +#define V_pflogifs VNET(pflogifs) static void -pflogattach(int npflog) +pflogattach(int npflog __unused) { int i; for (i = 0; i < PFLOGIFS_MAX; i++) - pflogifs[i] = NULL; - pflog_cloner = if_clone_simple(pflogname, pflog_clone_create, + V_pflogifs[i] = NULL; + V_pflog_cloner = if_clone_simple(pflogname, pflog_clone_create, pflog_clone_destroy, 1); } @@ -130,7 +133,7 @@ pflog_clone_create(struct if_clone *ifc, bpfattach(ifp, DLT_PFLOG, PFLOG_HDRLEN); - pflogifs[unit] = ifp; + V_pflogifs[unit] = ifp; return (0); } @@ -141,8 +144,8 @@ pflog_clone_destroy(struct ifnet *ifp) int i; for (i = 0; i < PFLOGIFS_MAX; i++) - if (pflogifs[i] == ifp) - pflogifs[i] = NULL; + if (V_pflogifs[i] == ifp) + V_pflogifs[i] = NULL; bpfdetach(ifp); if_detach(ifp); @@ -206,7 +209,7 @@ pflog_packet(struct pfi_kif *kif, struct if (kif == NULL || m == NULL || rm == NULL || pd == NULL) return ( 1); - if ((ifn = pflogifs[rm->logif]) == NULL || !ifn->if_bpf) + if ((ifn = V_pflogifs[rm->logif]) == NULL || !ifn->if_bpf) return (0); bzero(&hdr, sizeof(hdr)); @@ -259,6 +262,24 @@ pflog_packet(struct pfi_kif *kif, struct return (0); } +static void +vnet_pflog_init(const void *unused __unused) +{ + + pflogattach(1); +} +VNET_SYSINIT(vnet_pflog_init, SI_SUB_PSEUDO, SI_ORDER_ANY, + vnet_pflog_init, NULL); + +static void +vnet_pflog_uninit(const void *unused __unused) +{ + + if_clone_detach(V_pflog_cloner); +} +VNET_SYSUNINIT(vnet_pflog_uninit, SI_SUB_INIT_IF, SI_ORDER_SECOND, + vnet_pflog_uninit, NULL); + static int pflog_modevent(module_t mod, int type, void *data) { @@ -266,7 +287,6 @@ pflog_modevent(module_t mod, int type, v switch (type) { case MOD_LOAD: - pflogattach(1); PF_RULES_WLOCK(); pflog_packet_ptr = pflog_packet; PF_RULES_WUNLOCK(); @@ -275,10 +295,9 @@ pflog_modevent(module_t mod, int type, v PF_RULES_WLOCK(); pflog_packet_ptr = NULL; PF_RULES_WUNLOCK(); - if_clone_detach(pflog_cloner); break; default: - error = EINVAL; + error = EOPNOTSUPP; break; } Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Thu Jun 23 21:32:52 2016 (r302155) +++ head/sys/netpfil/pf/pf.c Thu Jun 23 21:34:38 2016 (r302156) @@ -299,7 +299,7 @@ static void pf_route6(struct mbuf **, int in4_cksum(struct mbuf *m, u_int8_t nxt, int off, int len); -VNET_DECLARE(int, pf_end_threads); +extern int pf_end_threads; VNET_DEFINE(struct pf_limit, pf_limits[PF_LIMIT_MAX]); @@ -1421,51 +1421,25 @@ pf_intr(void *v) } void -pf_purge_thread(void *v) +pf_purge_thread(void *unused __unused) { + VNET_ITERATOR_DECL(vnet_iter); u_int idx = 0; - CURVNET_SET((struct vnet *)v); - for (;;) { PF_RULES_RLOCK(); rw_sleep(pf_purge_thread, &pf_rules_lock, 0, "pftm", hz / 10); + PF_RULES_RUNLOCK(); - if (V_pf_end_threads) { - /* - * To cleanse up all kifs and rules we need - * two runs: first one clears reference flags, - * then pf_purge_expired_states() doesn't - * raise them, and then second run frees. - */ - PF_RULES_RUNLOCK(); - pf_purge_unlinked_rules(); - pfi_kif_purge(); - - /* - * Now purge everything. - */ - pf_purge_expired_states(0, pf_hashmask); - pf_purge_expired_fragments(); - pf_purge_expired_src_nodes(); - - /* - * Now all kifs & rules should be unreferenced, - * thus should be successfully freed. - */ - pf_purge_unlinked_rules(); - pfi_kif_purge(); + VNET_LIST_RLOCK(); + VNET_FOREACH(vnet_iter) { + CURVNET_SET(vnet_iter); - /* - * Announce success and exit. - */ - PF_RULES_RLOCK(); - V_pf_end_threads++; - PF_RULES_RUNLOCK(); + if (pf_end_threads) { + pf_end_threads++; wakeup(pf_purge_thread); kproc_exit(0); } - PF_RULES_RUNLOCK(); /* Process 1/interval fraction of the state table every run. */ idx = pf_purge_expired_states(idx, pf_hashmask / @@ -1483,11 +1457,42 @@ pf_purge_thread(void *v) pf_purge_unlinked_rules(); pfi_kif_purge(); } + CURVNET_RESTORE(); + } + VNET_LIST_RUNLOCK(); } /* not reached */ - CURVNET_RESTORE(); } +void +pf_unload_vnet_purge(void) +{ + + /* + * To cleanse up all kifs and rules we need + * two runs: first one clears reference flags, + * then pf_purge_expired_states() doesn't + * raise them, and then second run frees. + */ + pf_purge_unlinked_rules(); + pfi_kif_purge(); + + /* + * Now purge everything. + */ + pf_purge_expired_states(0, pf_hashmask); + pf_purge_expired_fragments(); + pf_purge_expired_src_nodes(); + + /* + * Now all kifs & rules should be unreferenced, + * thus should be successfully freed. + */ + pf_purge_unlinked_rules(); + pfi_kif_purge(); +} + + u_int32_t pf_state_expires(const struct pf_state *state) { Modified: head/sys/netpfil/pf/pf_if.c ============================================================================== --- head/sys/netpfil/pf/pf_if.c Thu Jun 23 21:32:52 2016 (r302155) +++ head/sys/netpfil/pf/pf_if.c Thu Jun 23 21:34:38 2016 (r302156) @@ -58,6 +58,9 @@ static VNET_DEFINE(long, pfi_update); #define V_pfi_update VNET(pfi_update) #define PFI_BUFFER_MAX 0x10000 +VNET_DECLARE(int, pf_vnet_active); +#define V_pf_vnet_active VNET(pf_vnet_active) + static VNET_DEFINE(struct pfr_addr *, pfi_buffer); static VNET_DEFINE(int, pfi_buffer_cnt); static VNET_DEFINE(int, pfi_buffer_max); @@ -108,7 +111,7 @@ MTX_SYSINIT(pfi_unlnkdkifs_mtx, &pfi_unl MTX_DEF); void -pfi_initialize(void) +pfi_initialize_vnet(void) { struct ifg_group *ifg; struct ifnet *ifp; @@ -129,6 +132,11 @@ pfi_initialize(void) TAILQ_FOREACH(ifp, &V_ifnet, if_link) pfi_attach_ifnet(ifp); IFNET_RUNLOCK(); +} + +void +pfi_initialize(void) +{ pfi_attach_cookie = EVENTHANDLER_REGISTER(ifnet_arrival_event, pfi_attach_ifnet_event, NULL, EVENTHANDLER_PRI_ANY); @@ -145,31 +153,44 @@ pfi_initialize(void) } void -pfi_cleanup(void) +pfi_cleanup_vnet(void) { - struct pfi_kif *p; + struct pfi_kif *kif; - EVENTHANDLER_DEREGISTER(ifnet_arrival_event, pfi_attach_cookie); - EVENTHANDLER_DEREGISTER(ifnet_departure_event, pfi_detach_cookie); - EVENTHANDLER_DEREGISTER(group_attach_event, pfi_attach_group_cookie); - EVENTHANDLER_DEREGISTER(group_change_event, pfi_change_group_cookie); - EVENTHANDLER_DEREGISTER(group_detach_event, pfi_detach_group_cookie); - EVENTHANDLER_DEREGISTER(ifaddr_event, pfi_ifaddr_event_cookie); + PF_RULES_WASSERT(); V_pfi_all = NULL; - while ((p = RB_MIN(pfi_ifhead, &V_pfi_ifs))) { - RB_REMOVE(pfi_ifhead, &V_pfi_ifs, p); - free(p, PFI_MTYPE); + while ((kif = RB_MIN(pfi_ifhead, &V_pfi_ifs))) { + RB_REMOVE(pfi_ifhead, &V_pfi_ifs, kif); + if (kif->pfik_group) + kif->pfik_group->ifg_pf_kif = NULL; + if (kif->pfik_ifp) + kif->pfik_ifp->if_pf_kif = NULL; + free(kif, PFI_MTYPE); } - while ((p = LIST_FIRST(&V_pfi_unlinked_kifs))) { - LIST_REMOVE(p, pfik_list); - free(p, PFI_MTYPE); + mtx_lock(&pfi_unlnkdkifs_mtx); + while ((kif = LIST_FIRST(&V_pfi_unlinked_kifs))) { + LIST_REMOVE(kif, pfik_list); + free(kif, PFI_MTYPE); } + mtx_unlock(&pfi_unlnkdkifs_mtx); free(V_pfi_buffer, PFI_MTYPE); } +void +pfi_cleanup(void) +{ + + EVENTHANDLER_DEREGISTER(ifnet_arrival_event, pfi_attach_cookie); + EVENTHANDLER_DEREGISTER(ifnet_departure_event, pfi_detach_cookie); + EVENTHANDLER_DEREGISTER(group_attach_event, pfi_attach_group_cookie); + EVENTHANDLER_DEREGISTER(group_change_event, pfi_change_group_cookie); + EVENTHANDLER_DEREGISTER(group_detach_event, pfi_detach_group_cookie); + EVENTHANDLER_DEREGISTER(ifaddr_event, pfi_ifaddr_event_cookie); +} + struct pfi_kif * pfi_kif_find(const char *kif_name) { @@ -668,7 +689,7 @@ pfi_update_status(const char *name, stru bzero(pfs->bcounters, sizeof(pfs->bcounters)); } TAILQ_FOREACH(ifgm, &ifg_members, ifgm_next) { - if (ifgm->ifgm_ifp == NULL) + if (ifgm->ifgm_ifp == NULL || ifgm->ifgm_ifp->if_pf_kif == NULL) continue; p = (struct pfi_kif *)ifgm->ifgm_ifp->if_pf_kif; @@ -780,6 +801,11 @@ pfi_attach_ifnet_event(void *arg __unuse { CURVNET_SET(ifp->if_vnet); + if (V_pf_vnet_active == 0) { + /* Avoid teardown race in the least expensive way. */ + CURVNET_RESTORE(); + return; + } pfi_attach_ifnet(ifp); #ifdef ALTQ PF_RULES_WLOCK(); @@ -794,7 +820,15 @@ pfi_detach_ifnet_event(void *arg __unuse { struct pfi_kif *kif = (struct pfi_kif *)ifp->if_pf_kif; + if (kif == NULL) + return; + CURVNET_SET(ifp->if_vnet); + if (V_pf_vnet_active == 0) { + /* Avoid teardown race in the least expensive way. */ + CURVNET_RESTORE(); + return; + } PF_RULES_WLOCK(); V_pfi_update++; pfi_kif_update(kif); @@ -813,6 +847,11 @@ pfi_attach_group_event(void *arg , struc { CURVNET_SET((struct vnet *)arg); + if (V_pf_vnet_active == 0) { + /* Avoid teardown race in the least expensive way. */ + CURVNET_RESTORE(); + return; + } pfi_attach_ifgroup(ifg); CURVNET_RESTORE(); } @@ -822,9 +861,14 @@ pfi_change_group_event(void *arg, char * { struct pfi_kif *kif; - kif = malloc(sizeof(*kif), PFI_MTYPE, M_WAITOK); - CURVNET_SET((struct vnet *)arg); + if (V_pf_vnet_active == 0) { + /* Avoid teardown race in the least expensive way. */ + CURVNET_RESTORE(); + return; + } + + kif = malloc(sizeof(*kif), PFI_MTYPE, M_WAITOK); PF_RULES_WLOCK(); V_pfi_update++; kif = pfi_kif_attach(kif, gname); @@ -838,7 +882,15 @@ pfi_detach_group_event(void *arg, struct { struct pfi_kif *kif = (struct pfi_kif *)ifg->ifg_pf_kif; + if (kif == NULL) + return; + CURVNET_SET((struct vnet *)arg); + if (V_pf_vnet_active == 0) { + /* Avoid teardown race in the least expensive way. */ + CURVNET_RESTORE(); + return; + } PF_RULES_WLOCK(); V_pfi_update++; @@ -851,8 +903,15 @@ pfi_detach_group_event(void *arg, struct static void pfi_ifaddr_event(void *arg __unused, struct ifnet *ifp) { + if (ifp->if_pf_kif == NULL) + return; CURVNET_SET(ifp->if_vnet); + if (V_pf_vnet_active == 0) { + /* Avoid teardown race in the least expensive way. */ + CURVNET_RESTORE(); + return; + } PF_RULES_WLOCK(); if (ifp && ifp->if_pf_kif) { V_pfi_update++; Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Thu Jun 23 21:32:52 2016 (r302155) +++ head/sys/netpfil/pf/pf_ioctl.c Thu Jun 23 21:34:38 2016 (r302156) @@ -87,7 +87,6 @@ __FBSDID("$FreeBSD$"); #include #endif -static int pfattach(void); static struct pf_pool *pf_get_pool(char *, u_int32_t, u_int8_t, u_int32_t, u_int8_t, u_int8_t, u_int8_t); @@ -189,7 +188,16 @@ static struct cdevsw pf_cdevsw = { static volatile VNET_DEFINE(int, pf_pfil_hooked); #define V_pf_pfil_hooked VNET(pf_pfil_hooked) -VNET_DEFINE(int, pf_end_threads); + +/* + * We need a flag that is neither hooked nor running to know when + * the VNET is "valid". We primarily need this to control (global) + * external event, e.g., eventhandlers. + */ +VNET_DEFINE(int, pf_vnet_active); +#define V_pf_vnet_active VNET(pf_vnet_active) + +int pf_end_threads; struct rwlock pf_rules_lock; struct sx pf_ioctl_lock; @@ -204,17 +212,14 @@ pfsync_defer_t *pfsync_defer_ptr = NUL /* pflog */ pflog_packet_t *pflog_packet_ptr = NULL; -static int -pfattach(void) +static void +pfattach_vnet(void) { u_int32_t *my_timeout = V_pf_default_rule.timeout; - int error; - if (IS_DEFAULT_VNET(curvnet)) - pf_mtag_initialize(); pf_initialize(); pfr_initialize(); - pfi_initialize(); + pfi_initialize_vnet(); pf_normalize_init(); V_pf_limits[PF_LIMIT_STATES].limit = PFSTATE_HIWAT; @@ -276,18 +281,13 @@ pfattach(void) for (int i = 0; i < SCNT_MAX; i++) V_pf_status.scounters[i] = counter_u64_alloc(M_WAITOK); - if ((error = kproc_create(pf_purge_thread, curvnet, NULL, 0, 0, - "pf purge")) != 0) - /* XXXGL: leaked all above. */ - return (error); - if ((error = swi_add(NULL, "pf send", pf_intr, curvnet, SWI_NET, - INTR_MPSAFE, &V_pf_swi_cookie)) != 0) + if (swi_add(NULL, "pf send", pf_intr, curvnet, SWI_NET, + INTR_MPSAFE, &V_pf_swi_cookie) != 0) /* XXXGL: leaked all above. */ - return (error); - - return (0); + return; } + static struct pf_pool * pf_get_pool(char *anchor, u_int32_t ticket, u_int8_t rule_action, u_int32_t rule_number, u_int8_t r_last, u_int8_t active, @@ -3480,21 +3480,6 @@ shutdown_pf(void) u_int32_t t[5]; char nn = '\0'; - V_pf_status.running = 0; - - counter_u64_free(V_pf_default_rule.states_cur); - counter_u64_free(V_pf_default_rule.states_tot); - counter_u64_free(V_pf_default_rule.src_nodes); - - for (int i = 0; i < PFRES_MAX; i++) - counter_u64_free(V_pf_status.counters[i]); - for (int i = 0; i < LCNT_MAX; i++) - counter_u64_free(V_pf_status.lcounters[i]); - for (int i = 0; i < FCNT_MAX; i++) - counter_u64_free(V_pf_status.fcounters[i]); - for (int i = 0; i < SCNT_MAX; i++) - counter_u64_free(V_pf_status.scounters[i]); - do { if ((error = pf_begin_rules(&t[0], PF_RULESET_SCRUB, &nn)) != 0) { @@ -3546,6 +3531,20 @@ shutdown_pf(void) /* status does not use malloced mem so no need to cleanup */ /* fingerprints and interfaces have their own cleanup code */ + + /* Free counters last as we updated them during shutdown. */ + counter_u64_free(V_pf_default_rule.states_cur); + counter_u64_free(V_pf_default_rule.states_tot); + counter_u64_free(V_pf_default_rule.src_nodes); + + for (int i = 0; i < PFRES_MAX; i++) + counter_u64_free(V_pf_status.counters[i]); + for (int i = 0; i < LCNT_MAX; i++) + counter_u64_free(V_pf_status.lcounters[i]); + for (int i = 0; i < FCNT_MAX; i++) + counter_u64_free(V_pf_status.fcounters[i]); + for (int i = 0; i < SCNT_MAX; i++) + counter_u64_free(V_pf_status.scounters[i]); } while(0); return (error); @@ -3697,39 +3696,55 @@ dehook_pf(void) return (0); } -static int -pf_load(void) +static void +pf_load_vnet(void) { - int error; - VNET_ITERATOR_DECL(vnet_iter); VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); V_pf_pfil_hooked = 0; - V_pf_end_threads = 0; TAILQ_INIT(&V_pf_tags); TAILQ_INIT(&V_pf_qids); CURVNET_RESTORE(); } VNET_LIST_RUNLOCK(); + pfattach_vnet(); + V_pf_vnet_active = 1; +} + +static int +pf_load(void) +{ + int error; + rw_init(&pf_rules_lock, "pf rulesets"); sx_init(&pf_ioctl_lock, "pf ioctl"); + pf_mtag_initialize(); + pf_dev = make_dev(&pf_cdevsw, 0, 0, 0, 0600, PF_NAME); - if ((error = pfattach()) != 0) + if (pf_dev == NULL) + return (ENOMEM); + + pf_end_threads = 0; + error = kproc_create(pf_purge_thread, NULL, NULL, 0, 0, "pf purge"); + if (error != 0) return (error); + pfi_initialize(); + return (0); } -static int -pf_unload(void) +static void +pf_unload_vnet() { - int error = 0; + int error; + V_pf_vnet_active = 0; V_pf_status.running = 0; swi_remove(V_pf_swi_cookie); error = dehook_pf(); @@ -3740,30 +3755,67 @@ pf_unload(void) * a message like 'No such process'. */ printf("%s : pfil unregisteration fail\n", __FUNCTION__); - return error; + return; } + + pf_unload_vnet_purge(); + PF_RULES_WLOCK(); shutdown_pf(); - V_pf_end_threads = 1; - while (V_pf_end_threads < 2) { - wakeup_one(pf_purge_thread); - rw_sleep(pf_purge_thread, &pf_rules_lock, 0, "pftmo", 0); - } PF_RULES_WUNLOCK(); + pf_normalize_cleanup(); - pfi_cleanup(); + PF_RULES_WLOCK(); + pfi_cleanup_vnet(); + PF_RULES_WUNLOCK(); pfr_cleanup(); pf_osfp_flush(); pf_cleanup(); if (IS_DEFAULT_VNET(curvnet)) pf_mtag_cleanup(); - destroy_dev(pf_dev); +} + +static int +pf_unload(void) +{ + int error = 0; + + pf_end_threads = 1; + while (pf_end_threads < 2) { + wakeup_one(pf_purge_thread); + rw_sleep(pf_purge_thread, &pf_rules_lock, 0, "pftmo", 0); + } + + if (pf_dev != NULL) + destroy_dev(pf_dev); + + pfi_cleanup(); + rw_destroy(&pf_rules_lock); sx_destroy(&pf_ioctl_lock); return (error); } +static void +vnet_pf_init(void *unused __unused) +{ + + pf_load_vnet(); +} +VNET_SYSINIT(vnet_pf_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_THIRD, + vnet_pf_init, NULL); + +static void +vnet_pf_uninit(const void *unused __unused) +{ + + pf_unload_vnet(); +} +VNET_SYSUNINIT(vnet_pf_uninit, SI_SUB_PROTO_FIREWALL, SI_ORDER_THIRD, + vnet_pf_uninit, NULL); + + static int pf_modevent(module_t mod, int type, void *data) { @@ -3796,5 +3848,5 @@ static moduledata_t pf_mod = { 0 }; -DECLARE_MODULE(pf, pf_mod, SI_SUB_PROTO_FIREWALL, SI_ORDER_FIRST); +DECLARE_MODULE(pf, pf_mod, SI_SUB_PROTO_FIREWALL, SI_ORDER_SECOND); MODULE_VERSION(pf, PF_MODVER); From owner-svn-src-head@freebsd.org Thu Jun 23 21:42:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63ABAB7441D; Thu, 23 Jun 2016 21:42:44 +0000 (UTC) (envelope-from bz@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 30F3521C9; Thu, 23 Jun 2016 21:42:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5NLgh4c059648; Thu, 23 Jun 2016 21:42:43 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NLghX2059647; Thu, 23 Jun 2016 21:42:43 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606232142.u5NLghX2059647@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 21:42:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302157 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 21:42:44 -0000 Author: bz Date: Thu Jun 23 21:42:43 2016 New Revision: 302157 URL: https://svnweb.freebsd.org/changeset/base/302157 Log: PFSTATE_NOSYNC goes onto state_flags, not sync_state; this prevents: panic: pfsync_delete_state: unexpected sync state 8 Reviewed by: kp Approved by: re (gjb) MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D6942 Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Thu Jun 23 21:34:38 2016 (r302156) +++ head/sys/netpfil/pf/pf_ioctl.c Thu Jun 23 21:42:43 2016 (r302157) @@ -3362,7 +3362,7 @@ relock: LIST_FOREACH(s, &ih->states, entry) { s->timeout = PFTM_PURGE; /* Don't send out individual delete messages. */ - s->sync_state = PFSTATE_NOSYNC; + s->state_flags |= PFSTATE_NOSYNC; pf_unlink_state(s, PF_ENTER_LOCKED); goto relock; } From owner-svn-src-head@freebsd.org Thu Jun 23 22:31:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1522FB74C36; Thu, 23 Jun 2016 22:31:12 +0000 (UTC) (envelope-from bz@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 DB0A929C5; Thu, 23 Jun 2016 22:31:11 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5NMVBJU075889; Thu, 23 Jun 2016 22:31:11 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NMVBTj075888; Thu, 23 Jun 2016 22:31:11 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606232231.u5NMVBTj075888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 22:31:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302159 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 22:31:12 -0000 Author: bz Date: Thu Jun 23 22:31:10 2016 New Revision: 302159 URL: https://svnweb.freebsd.org/changeset/base/302159 Log: Make sure pflog is attached after pf is initializaed so we can borrow pf's lock, and also make sure pflog goes after pf is gone in order to avoid callouts in VNETs to an already freed instance. Reported by: Ivan Klymenko, Johan Hendriks on current@ today Obtained from: projects/vnet Sponsored by: The FreeBSD Foundation MFC after: 13 days Approved by: re (gjb) Modified: head/sys/netpfil/pf/if_pflog.c Modified: head/sys/netpfil/pf/if_pflog.c ============================================================================== --- head/sys/netpfil/pf/if_pflog.c Thu Jun 23 21:50:52 2016 (r302158) +++ head/sys/netpfil/pf/if_pflog.c Thu Jun 23 22:31:10 2016 (r302159) @@ -268,7 +268,7 @@ vnet_pflog_init(const void *unused __unu pflogattach(1); } -VNET_SYSINIT(vnet_pflog_init, SI_SUB_PSEUDO, SI_ORDER_ANY, +VNET_SYSINIT(vnet_pflog_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY, vnet_pflog_init, NULL); static void @@ -277,6 +277,10 @@ vnet_pflog_uninit(const void *unused __u if_clone_detach(V_pflog_cloner); } +/* + * Detach after pf is gone; otherwise we might touch pflog memory + * from within pf after freeing pflog. + */ VNET_SYSUNINIT(vnet_pflog_uninit, SI_SUB_INIT_IF, SI_ORDER_SECOND, vnet_pflog_uninit, NULL); @@ -308,6 +312,7 @@ static moduledata_t pflog_mod = { pflogn #define PFLOG_MODVER 1 -DECLARE_MODULE(pflog, pflog_mod, SI_SUB_PSEUDO, SI_ORDER_ANY); +/* Do not run before pf is initialized as we depend on its locks. */ +DECLARE_MODULE(pflog, pflog_mod, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY); MODULE_VERSION(pflog, PFLOG_MODVER); MODULE_DEPEND(pflog, pf, PF_MODVER, PF_MODVER, PF_MODVER); From owner-svn-src-head@freebsd.org Thu Jun 23 22:31:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6154DB74D32; Thu, 23 Jun 2016 22:31:45 +0000 (UTC) (envelope-from bz@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 3DE542BAB; Thu, 23 Jun 2016 22:31:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5NMVikm075949; Thu, 23 Jun 2016 22:31:44 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NMViLv075948; Thu, 23 Jun 2016 22:31:44 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606232231.u5NMViLv075948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Thu, 23 Jun 2016 22:31:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302160 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 22:31:45 -0000 Author: bz Date: Thu Jun 23 22:31:44 2016 New Revision: 302160 URL: https://svnweb.freebsd.org/changeset/base/302160 Log: Proerply virtualize pfsync for bringup after pf is initialized and teardown of VNETs once pf(4) has been shut down. Properly split resources into VNET_SYS(UN)INITs and one time module loading. While here cover the INET parts in the uninit callpath with proper #ifdefs. Approved by: re (gjb) Obtained from: projects/vnet MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/sys/netpfil/pf/if_pfsync.c Modified: head/sys/netpfil/pf/if_pfsync.c ============================================================================== --- head/sys/netpfil/pf/if_pfsync.c Thu Jun 23 22:31:10 2016 (r302159) +++ head/sys/netpfil/pf/if_pfsync.c Thu Jun 23 22:31:44 2016 (r302160) @@ -78,6 +78,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -2315,71 +2316,67 @@ pfsync_pointers_uninit() PF_RULES_WUNLOCK(); } -static int -pfsync_init() +static void +vnet_pfsync_init(const void *unused __unused) { - VNET_ITERATOR_DECL(vnet_iter); - int error = 0; + int error; - VNET_LIST_RLOCK(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - V_pfsync_cloner = if_clone_simple(pfsyncname, - pfsync_clone_create, pfsync_clone_destroy, 1); - error = swi_add(NULL, pfsyncname, pfsyncintr, V_pfsyncif, - SWI_NET, INTR_MPSAFE, &V_pfsync_swi_cookie); - CURVNET_RESTORE(); - if (error) - goto fail_locked; + V_pfsync_cloner = if_clone_simple(pfsyncname, + pfsync_clone_create, pfsync_clone_destroy, 1); + error = swi_add(NULL, pfsyncname, pfsyncintr, V_pfsyncif, + SWI_NET, INTR_MPSAFE, &V_pfsync_swi_cookie); + if (error) { + if_clone_detach(V_pfsync_cloner); + log(LOG_INFO, "swi_add() failed in %s\n", __func__); } - VNET_LIST_RUNLOCK(); +} +VNET_SYSINIT(vnet_pfsync_init, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY, + vnet_pfsync_init, NULL); + +static void +vnet_pfsync_uninit(const void *unused __unused) +{ + + if_clone_detach(V_pfsync_cloner); + swi_remove(V_pfsync_swi_cookie); +} +/* + * Detach after pf is gone; otherwise we might touch pfsync memory + * from within pf after freeing pfsync. + */ +VNET_SYSUNINIT(vnet_pfsync_uninit, SI_SUB_INIT_IF, SI_ORDER_SECOND, + vnet_pfsync_uninit, NULL); + +static int +pfsync_init() +{ #ifdef INET + int error; + error = pf_proto_register(PF_INET, &in_pfsync_protosw); if (error) - goto fail; + return (error); error = ipproto_register(IPPROTO_PFSYNC); if (error) { pf_proto_unregister(PF_INET, IPPROTO_PFSYNC, SOCK_RAW); - goto fail; + return (error); } #endif pfsync_pointers_init(); return (0); - -fail: - VNET_LIST_RLOCK(); -fail_locked: - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - if (V_pfsync_swi_cookie) { - swi_remove(V_pfsync_swi_cookie); - if_clone_detach(V_pfsync_cloner); - } - CURVNET_RESTORE(); - } - VNET_LIST_RUNLOCK(); - - return (error); } static void pfsync_uninit() { - VNET_ITERATOR_DECL(vnet_iter); pfsync_pointers_uninit(); +#ifdef INET ipproto_unregister(IPPROTO_PFSYNC); pf_proto_unregister(PF_INET, IPPROTO_PFSYNC, SOCK_RAW); - VNET_LIST_RLOCK(); - VNET_FOREACH(vnet_iter) { - CURVNET_SET(vnet_iter); - if_clone_detach(V_pfsync_cloner); - swi_remove(V_pfsync_swi_cookie); - CURVNET_RESTORE(); - } - VNET_LIST_RUNLOCK(); +#endif } static int @@ -2416,6 +2413,7 @@ static moduledata_t pfsync_mod = { #define PFSYNC_MODVER 1 -DECLARE_MODULE(pfsync, pfsync_mod, SI_SUB_PROTO_DOMAIN, SI_ORDER_ANY); +/* Stay on FIREWALL as we depend on pf being initialized and on inetdomain. */ +DECLARE_MODULE(pfsync, pfsync_mod, SI_SUB_PROTO_FIREWALL, SI_ORDER_ANY); MODULE_VERSION(pfsync, PFSYNC_MODVER); MODULE_DEPEND(pfsync, pf, PF_MODVER, PF_MODVER, PF_MODVER); From owner-svn-src-head@freebsd.org Thu Jun 23 23:13:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8F83B73D26; Thu, 23 Jun 2016 23:13:15 +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 5D66228EE; Thu, 23 Jun 2016 23:13:15 +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 u5NNDEA5093675; Thu, 23 Jun 2016 23:13:14 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NNDEu3093674; Thu, 23 Jun 2016 23:13:14 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201606232313.u5NNDEu3093674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Thu, 23 Jun 2016 23:13:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302162 - head/usr.sbin/gstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 23:13:15 -0000 Author: asomers Date: Thu Jun 23 23:13:14 2016 New Revision: 302162 URL: https://svnweb.freebsd.org/changeset/base/302162 Log: Fix gstat's interactive f and q commands curses and libedit don't play well together. After last year's libedit upgrade in head, they play even less well together. This change resets some curses settings after they get screwed up by libedit calls. Without it, gstat's interactive commands require an extra "enter", screw up the terminal on exit, and screw up the display if the user enters an invalid filter string. PR: 204852 Submitted by: Keith White Reviewed by: pfg Approved by: re (gjb) MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6934 Modified: head/usr.sbin/gstat/gstat.c Modified: head/usr.sbin/gstat/gstat.c ============================================================================== --- head/usr.sbin/gstat/gstat.c Thu Jun 23 22:42:03 2016 (r302161) +++ head/usr.sbin/gstat/gstat.c Thu Jun 23 23:13:14 2016 (r302162) @@ -167,20 +167,6 @@ main(int argc, char **argv) if (sq == NULL) err(1, "geom_stats_snapshot()"); if (!flag_b) { - /* Setup curses */ - initscr(); - start_color(); - use_default_colors(); - pair_content(0, &cf, &cb); - init_pair(1, COLOR_GREEN, cb); - init_pair(2, COLOR_MAGENTA, cb); - init_pair(3, COLOR_RED, cb); - cbreak(); - noecho(); - nonl(); - nodelay(stdscr, 1); - intrflush(stdscr, FALSE); - keypad(stdscr, TRUE); /* Setup libedit */ hist = history_init(); if (hist == NULL) @@ -195,6 +181,20 @@ main(int argc, char **argv) el_set(el, EL_PROMPT, el_prompt); if (f_s[0] != '\0') history(hist, &hist_ev, H_ENTER, f_s); + /* Setup curses */ + initscr(); + start_color(); + use_default_colors(); + pair_content(0, &cf, &cb); + init_pair(1, COLOR_GREEN, cb); + init_pair(2, COLOR_MAGENTA, cb); + init_pair(3, COLOR_RED, cb); + cbreak(); + noecho(); + nonl(); + nodelay(stdscr, 1); + intrflush(stdscr, FALSE); + keypad(stdscr, TRUE); } geom_stats_snapshot_timestamp(sq, &tq); for (quit = 0; !quit;) { @@ -410,12 +410,15 @@ main(int argc, char **argv) if ((p = strchr(tmp_f_s, '\n')) != NULL) *p = '\0'; /* - * We have to clear since we messed up + * Fix the terminal. We messed up * curses idea of the screen by using * libedit. */ clear(); refresh(); + cbreak(); + noecho(); + nonl(); if (regcomp(&tmp_f_re, tmp_f_s, REG_EXTENDED) != 0) { move(0, 0); @@ -440,8 +443,8 @@ main(int argc, char **argv) } if (!flag_b) { - endwin(); el_end(el); + endwin(); } exit(EX_OK); } From owner-svn-src-head@freebsd.org Thu Jun 23 23:16:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15DEFB73E5D for ; Thu, 23 Jun 2016 23:16:47 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi0-x242.google.com (mail-oi0-x242.google.com [IPv6:2607:f8b0:4003:c06::242]) (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 CF52F2BB4 for ; Thu, 23 Jun 2016 23:16:46 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi0-x242.google.com with SMTP id d132so15131191oig.2 for ; Thu, 23 Jun 2016 16:16:46 -0700 (PDT) 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:cc; bh=8BFysJjX3BaCntKSUYSC6tEe/32YcNW5kb1qDVh0/DY=; b=HDYwpU32G6p+PqFx5UPnKj5MkG4MZ/cl++o4juJtz2rhXRlyumjOU2LtJmvGQtJS9d AdusesZaU9pVqhz0TlijGsWq1yNaQbK2ZK/BOKwkmV16QM10RqHpd06Cc0tpOXuz+v1v hfXvtjY4C8q9QIUd8OC/L1LBpOU4t4vkt3/QY4hu1b0Pi2ldjHSXRWJFf0tkPTd7I+uf DygOt5p34x3dZ+Y7055sx4FCWyiLpSA+qIo3H0iZeFhPHXtRhxa8W6EMIBfTekdxPQwG VQjGEjW7grdoErr0L9bo61v+k637UMKz/FtOtX88fb0ZNAVkh2Q1oh1NatlkUtTx+lKg gYNQ== 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:from :date:message-id:subject:cc; bh=8BFysJjX3BaCntKSUYSC6tEe/32YcNW5kb1qDVh0/DY=; b=m60g4l2c8zVWOSqe49oaGKActu6MLrO0NouGrj9OHJCXLmiMCH+0OEKce5gg8aPdL6 T8jvoatfLitq+Em4pm8K1Pr3cV9tO3nxcac1JpKKGzsVWfUDr+MbVV7sy2oMP7TxOY4X Nm/gRKTUCqkRxXhSOr6RdI26wt8W1CGIYm6xZQ6wx08RSlJ6DdGQ15MwaKbSynotWdnx 9feBJBmCMwWkhCkhQsSY0wXtrNYAiuL0O5i1Dp35fApeaDLtF+qT1Uk0rMLtc+RikBOG rGLD/DYyAD3FG+/R5vU1DnnvVkMsjTHQ1SYBt8/7tUF/ynCdILHyiq+QJc0Of7Wi+rH9 0+tw== X-Gm-Message-State: ALyK8tLwaWgasOXUXh4Oj9dySRqgEWIKssORPiXZ3pOnSPaS8spuKotyVSwmGlMMCvFawAWQXMK85cHjvj18Yg== X-Received: by 10.157.0.74 with SMTP id 68mt931553ota.55.1466723806063; Thu, 23 Jun 2016 16:16:46 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.202.168.149 with HTTP; Thu, 23 Jun 2016 16:16:45 -0700 (PDT) In-Reply-To: <201606232313.u5NNDEu3093674@repo.freebsd.org> References: <201606232313.u5NNDEu3093674@repo.freebsd.org> From: Alan Somers Date: Thu, 23 Jun 2016 17:16:45 -0600 X-Google-Sender-Auth: W5xb1xwuHZK900xxLyBU35wT8RM Message-ID: Subject: Re: svn commit: r302162 - head/usr.sbin/gstat 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 23:16:47 -0000 On Thu, Jun 23, 2016 at 5:13 PM, Alan Somers wrote: > Author: asomers > Date: Thu Jun 23 23:13:14 2016 > New Revision: 302162 > URL: https://svnweb.freebsd.org/changeset/base/302162 > > Log: > Fix gstat's interactive f and q commands > > curses and libedit don't play well together. After last year's libedit > upgrade in head, they play even less well together. This change resets some > curses settings after they get screwed up by libedit calls. Without it, > gstat's interactive commands require an extra "enter", screw up the terminal > on exit, and screw up the display if the user enters an invalid filter > string. > > PR: 204852 > Submitted by: Keith White > Reviewed by: pfg > Approved by: re (gjb) > MFC after: 4 weeks > Sponsored by: Spectra Logic Corp > Differential Revision: https://reviews.freebsd.org/D6934 > > Modified: > head/usr.sbin/gstat/gstat.c > For the record, the MFC field is a mistake. This bug does not affect stable/9 or stable/10. From owner-svn-src-head@freebsd.org Thu Jun 23 23:21:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3A01CB73F5F; Thu, 23 Jun 2016 23:21: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 ED3F52F5F; Thu, 23 Jun 2016 23:20: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 u5NNKxFp094248; Thu, 23 Jun 2016 23:20:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5NNKwR9094246; Thu, 23 Jun 2016 23:20:58 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201606232320.u5NNKwR9094246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 23 Jun 2016 23:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302163 - in head/sys: cam conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Jun 2016 23:21:00 -0000 Author: imp Date: Thu Jun 23 23:20:58 2016 New Revision: 302163 URL: https://svnweb.freebsd.org/changeset/base/302163 Log: Rename CAM_NETFLIX_IOSCHED to CAM_IOSCHED_DYNAMIC to better reflect its nature. Approved by: re Reviewed By: jhb Differential Revision: https://reviews.freebsd.org/D6811 Modified: head/sys/cam/cam_iosched.c head/sys/conf/options Modified: head/sys/cam/cam_iosched.c ============================================================================== --- head/sys/cam/cam_iosched.c Thu Jun 23 23:13:14 2016 (r302162) +++ head/sys/cam/cam_iosched.c Thu Jun 23 23:20:58 2016 (r302163) @@ -61,7 +61,7 @@ static MALLOC_DEFINE(M_CAMSCHED, "CAM I/ * for trims. */ -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC static int do_netflix_iosched = 1; TUNABLE_INT("kern.cam.do_netflix_iosched", &do_netflix_iosched); @@ -250,7 +250,7 @@ struct cam_iosched_softc /* scheduler flags < 16, user flags >= 16 */ uint32_t flags; int sort_io_queue; -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC int read_bias; /* Read bias setting */ int current_read_bias; /* Current read bias state */ int total_ticks; @@ -269,7 +269,7 @@ struct cam_iosched_softc #endif }; -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC /* * helper functions to call the limsw functions. */ @@ -624,7 +624,7 @@ cam_iosched_cl_maybe_steer(struct contro /* Periph drivers set these flags to indicate work */ #define CAM_IOSCHED_FLAG_WORK_FLAGS ((0xffffu) << 16) -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC static void cam_iosched_io_metric_update(struct cam_iosched_softc *isc, sbintime_t sim_latency, int cmd, size_t size); @@ -639,7 +639,7 @@ cam_iosched_has_flagged_work(struct cam_ static inline int cam_iosched_has_io(struct cam_iosched_softc *isc) { -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (do_netflix_iosched) { struct bio *rbp = bioq_first(&isc->bio_queue); struct bio *wbp = bioq_first(&isc->write_queue); @@ -672,7 +672,7 @@ cam_iosched_has_more_trim(struct cam_ios static inline int cam_iosched_has_work(struct cam_iosched_softc *isc) { -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (iosched_debug > 2) printf("has work: %d %d %d\n", cam_iosched_has_io(isc), cam_iosched_has_more_trim(isc), @@ -684,7 +684,7 @@ cam_iosched_has_work(struct cam_iosched_ cam_iosched_has_flagged_work(isc); } -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC static void cam_iosched_iop_stats_init(struct cam_iosched_softc *isc, struct iop_stats *ios) { @@ -946,14 +946,14 @@ cam_iosched_init(struct cam_iosched_soft *iscp = malloc(sizeof(**iscp), M_CAMSCHED, M_NOWAIT | M_ZERO); if (*iscp == NULL) return ENOMEM; -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (iosched_debug) printf("CAM IOSCHEDULER Allocating entry at %p\n", *iscp); #endif (*iscp)->sort_io_queue = -1; bioq_init(&(*iscp)->bio_queue); bioq_init(&(*iscp)->trim_queue); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (do_netflix_iosched) { bioq_init(&(*iscp)->write_queue); (*iscp)->read_bias = 100; @@ -984,7 +984,7 @@ cam_iosched_fini(struct cam_iosched_soft { if (isc) { cam_iosched_flush(isc, NULL, ENXIO); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC cam_iosched_iop_stats_fini(&isc->read_stats); cam_iosched_iop_stats_fini(&isc->write_stats); cam_iosched_iop_stats_fini(&isc->trim_stats); @@ -1009,7 +1009,7 @@ cam_iosched_fini(struct cam_iosched_soft void cam_iosched_sysctl_init(struct cam_iosched_softc *isc, struct sysctl_ctx_list *ctx, struct sysctl_oid *node) { -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC struct sysctl_oid_list *n; #endif @@ -1018,7 +1018,7 @@ void cam_iosched_sysctl_init(struct cam_ &isc->sort_io_queue, 0, "Sort IO queue to try and optimise disk access patterns"); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (!do_netflix_iosched) return; @@ -1060,13 +1060,13 @@ cam_iosched_flush(struct cam_iosched_sof { bioq_flush(&isc->bio_queue, stp, err); bioq_flush(&isc->trim_queue, stp, err); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (do_netflix_iosched) bioq_flush(&isc->write_queue, stp, err); #endif } -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC static struct bio * cam_iosched_get_write(struct cam_iosched_softc *isc) { @@ -1132,7 +1132,7 @@ void cam_iosched_put_back_trim(struct cam_iosched_softc *isc, struct bio *bp) { bioq_insert_head(&isc->trim_queue, bp); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC isc->trim_stats.queued++; isc->trim_stats.total--; /* since we put it back, don't double count */ isc->trim_stats.pending--; @@ -1155,7 +1155,7 @@ cam_iosched_next_trim(struct cam_iosched if (bp == NULL) return NULL; bioq_remove(&isc->trim_queue, bp); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC isc->trim_stats.queued--; isc->trim_stats.total++; isc->trim_stats.pending++; @@ -1201,7 +1201,7 @@ cam_iosched_next_bio(struct cam_iosched_ if ((bp = cam_iosched_get_trim(isc)) != NULL) return bp; -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC /* * See if we have any pending writes, and room in the queue for them, * and if so, those are next. @@ -1218,7 +1218,7 @@ cam_iosched_next_bio(struct cam_iosched_ if ((bp = bioq_first(&isc->bio_queue)) == NULL) return NULL; -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC /* * For the netflix scheduler, bio_queue is only for reads, so enforce * the limits here. Enforce only for reads. @@ -1230,7 +1230,7 @@ cam_iosched_next_bio(struct cam_iosched_ } #endif bioq_remove(&isc->bio_queue, bp); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (do_netflix_iosched) { if (bp->bio_cmd == BIO_READ) { isc->read_stats.queued--; @@ -1262,12 +1262,12 @@ cam_iosched_queue_work(struct cam_iosche */ if (bp->bio_cmd == BIO_DELETE) { bioq_disksort(&isc->trim_queue, bp); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC isc->trim_stats.in++; isc->trim_stats.queued++; #endif } -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC else if (do_netflix_iosched && (bp->bio_cmd == BIO_WRITE || bp->bio_cmd == BIO_FLUSH)) { if (cam_iosched_sort_queue(isc)) @@ -1287,7 +1287,7 @@ cam_iosched_queue_work(struct cam_iosche bioq_disksort(&isc->bio_queue, bp); else bioq_insert_tail(&isc->bio_queue, bp); -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (iosched_debug > 9) printf("Qr : %p %#x\n", bp, bp->bio_cmd); if (bp->bio_cmd == BIO_READ) { @@ -1331,7 +1331,7 @@ cam_iosched_bio_complete(struct cam_iosc union ccb *done_ccb) { int retval = 0; -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC if (!do_netflix_iosched) return retval; @@ -1399,7 +1399,7 @@ cam_iosched_clr_work_flags(struct cam_io isc->flags &= ~flags; } -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC /* * After the method presented in Jack Crenshaw's 1998 article "Integer * Suqare Roots," reprinted at @@ -1523,7 +1523,7 @@ cam_iosched_update(struct iop_stats *iop iop->sd = (int64_t)var < 0 ? 0 : isqrt64(var); } -#ifdef CAM_NETFLIX_IOSCHED +#ifdef CAM_IOSCHED_DYNAMIC static void cam_iosched_io_metric_update(struct cam_iosched_softc *isc, sbintime_t sim_latency, int cmd, size_t size) Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Jun 23 23:13:14 2016 (r302162) +++ head/sys/conf/options Thu Jun 23 23:20:58 2016 (r302163) @@ -330,7 +330,7 @@ CAM_DEBUG_TARGET opt_cam.h CAM_DEBUG_LUN opt_cam.h CAM_DEBUG_FLAGS opt_cam.h CAM_BOOT_DELAY opt_cam.h -CAM_NETFLIX_IOSCHED opt_cam.h +CAM_IOSCHED_DYNAMIC opt_cam.h SCSI_DELAY opt_scsi.h SCSI_NO_SENSE_STRINGS opt_scsi.h SCSI_NO_OP_STRINGS opt_scsi.h From owner-svn-src-head@freebsd.org Fri Jun 24 00:05:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FB03AC6A85; Fri, 24 Jun 2016 00:05:46 +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 3FCF02616; Fri, 24 Jun 2016 00:05:46 +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 u5O05jWG012822; Fri, 24 Jun 2016 00:05:45 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5O05jVe012821; Fri, 24 Jun 2016 00:05:45 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606240005.u5O05jVe012821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 24 Jun 2016 00:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302164 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 00:05:46 -0000 Author: gjb Date: Fri Jun 24 00:05:45 2016 New Revision: 302164 URL: https://svnweb.freebsd.org/changeset/base/302164 Log: Update head to ALPHA5 in preparation of new snapshot builds. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Thu Jun 23 23:20:58 2016 (r302163) +++ head/sys/conf/newvers.sh Fri Jun 24 00:05:45 2016 (r302164) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="11.0" -BRANCH="ALPHA4" +BRANCH="ALPHA5" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-head@freebsd.org Fri Jun 24 10:55:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F48BB7343D; Fri, 24 Jun 2016 10:55:16 +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 D5B5726CB; Fri, 24 Jun 2016 10:55:15 +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 u5OAtFBb052932; Fri, 24 Jun 2016 10:55:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5OAtEZm052930; Fri, 24 Jun 2016 10:55:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201606241055.u5OAtEZm052930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 24 Jun 2016 10:55:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302171 - head/lib/libusb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 10:55:16 -0000 Author: hselasky Date: Fri Jun 24 10:55:14 2016 New Revision: 302171 URL: https://svnweb.freebsd.org/changeset/base/302171 Log: Resolve issue with libusb C++ header file inclusion. Approved by: re (marius) PR: 210509 MFC after: 1 week Modified: head/lib/libusb/libusb.h head/lib/libusb/libusb10.h Modified: head/lib/libusb/libusb.h ============================================================================== --- head/lib/libusb/libusb.h Fri Jun 24 02:30:14 2016 (r302170) +++ head/lib/libusb/libusb.h Fri Jun 24 10:55:14 2016 (r302171) @@ -254,7 +254,7 @@ struct libusb_context; struct libusb_device; struct libusb_transfer; struct libusb_device_handle; -struct libusb_hotplug_callback_handle; +struct libusb_hotplug_callback_handle_struct; struct libusb_pollfd { int fd; @@ -276,7 +276,7 @@ typedef struct libusb_device_handle libu typedef struct libusb_pollfd libusb_pollfd; typedef void (*libusb_pollfd_added_cb) (int fd, short events, void *user_data); typedef void (*libusb_pollfd_removed_cb) (int fd, void *user_data); -typedef struct libusb_hotplug_callback_handle *libusb_hotplug_callback_handle; +typedef struct libusb_hotplug_callback_handle_struct *libusb_hotplug_callback_handle; typedef struct libusb_device_descriptor { uint8_t bLength; Modified: head/lib/libusb/libusb10.h ============================================================================== --- head/lib/libusb/libusb10.h Fri Jun 24 02:30:14 2016 (r302170) +++ head/lib/libusb/libusb10.h Fri Jun 24 10:55:14 2016 (r302171) @@ -75,8 +75,8 @@ struct libusb_super_transfer { #define LIBUSB_SUPER_XFER_ST_PEND 1 }; -struct libusb_hotplug_callback_handle { - TAILQ_ENTRY(libusb_hotplug_callback_handle) entry; +struct libusb_hotplug_callback_handle_struct { + TAILQ_ENTRY(libusb_hotplug_callback_handle_struct) entry; int events; int vendor; int product; @@ -101,7 +101,7 @@ struct libusb_context { TAILQ_HEAD(, libusb_super_pollfd) pollfds; TAILQ_HEAD(, libusb_super_transfer) tr_done; - TAILQ_HEAD(, libusb_hotplug_callback_handle) hotplug_cbh; + TAILQ_HEAD(, libusb_hotplug_callback_handle_struct) hotplug_cbh; TAILQ_HEAD(, libusb_device) hotplug_devs; struct libusb_super_pollfd ctx_poll; From owner-svn-src-head@freebsd.org Fri Jun 24 11:26:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B79E8B73CEF; Fri, 24 Jun 2016 11:26:49 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 4320B1720; Fri, 24 Jun 2016 11:26:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from c122-106-149-109.carlnfd1.nsw.optusnet.com.au (c122-106-149-109.carlnfd1.nsw.optusnet.com.au [122.106.149.109]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id 390901044DF1; Fri, 24 Jun 2016 21:26:39 +1000 (AEST) Date: Fri, 24 Jun 2016 21:26:39 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301932 - head/sys/dev/cxgbe/tom In-Reply-To: <10550858.Wqzuf5sXBE@ralph.baldwin.cx> Message-ID: <20160624210041.J1013@besplex.bde.org> References: <201606152108.u5FL8pcO012174@repo.freebsd.org> <10550858.Wqzuf5sXBE@ralph.baldwin.cx> 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=OtmysHLt c=1 sm=1 tr=0 a=R/f3m204ZbWUO/0rwPSMPw==:117 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=WQYTAzPHRSsGqI3LFlkA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 11:26:49 -0000 On Wed, 15 Jun 2016, John Baldwin wrote: > On Wednesday, June 15, 2016 09:08:51 PM John Baldwin wrote: >> Author: jhb >> Date: Wed Jun 15 21:08:51 2016 >> New Revision: 301932 >> URL: https://svnweb.freebsd.org/changeset/base/301932 >> >> Log: >> Use sbused() instead of sbspace() to avoid signed issues. This description is sort of backwards. sbused() is unsigned (u_int), so using it gives (un)sign extension bugs. sbspace() has complications to return signed (long) to avoid (un)sign extension bugs. It has to be careful to avoid (un)sign extension bugs internally (intermediate versions of it were broken by removing this care when converting it from a macro to an inline function). The changed code also mostly uses signed types, but ... >> Inserting a full mbuf with an external cluster into the socket buffer >> resulted in sbspace() returning -MLEN. However, since sb_hiwat is >> unsigned, the -MLEN value was converted to unsigned in comparisons. As a >> result, the socket buffer was never autosized. Note that sb_lowat is signed >> to permit direct comparisons with sbspace(), but sb_hiwat is unsigned. >> Follow suit with what tcp_output() does and compare the value of sbused() >> with sb_hiwat instead. ... direct comparisons with sb_hiwat gives the (un)sign extension bugs since its foor-shooting type is exposed. > Amusingly (or not), sb_lowat used to be signed as well. Mike Karels > changed it to signed in this commit to BSD: > > https://svnweb.freebsd.org/csrg/sys/sys/socketvar.h?revision=43896 > > The log reads: > > add SB_ASYNC in sockbuf, add SB_NOTIFY, SB_NOINTR; > make lowat signed for comparison with sbspace (should probably give up > and make all fields signed They shoyld all have been signed to begin with. X Modified: head/sys/dev/cxgbe/tom/t4_cpl_io.c X ============================================================================== X --- head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jun 15 21:01:53 2016 (r301931) X +++ head/sys/dev/cxgbe/tom/t4_cpl_io.c Wed Jun 15 21:08:51 2016 (r301932) X @@ -577,7 +577,7 @@ t4_push_frames(struct adapter *sc, struc X struct tcpcb *tp = intotcpcb(inp); X struct socket *so = inp->inp_socket; X struct sockbuf *sb = &so->so_snd; X - int tx_credits, shove, compl, space, sowwakeup; X + int tx_credits, shove, compl, sowwakeup; X struct ofld_tx_sdesc *txsd = &toep->txsd[toep->txsd_pidx]; X X INP_WLOCK_ASSERT(inp); X @@ -652,9 +652,7 @@ t4_push_frames(struct adapter *sc, struc X } X } X X - space = sbspace(sb); Here 'space' was signed (int) to hold sbspace(), but this was still a type mismatch since sbspace() returns signed long. X - X - if (space <= sb->sb_hiwat * 3 / 8 && Then this broke because the unsigned sb_hiwat is too hard to use. X + if (sbused(sb) > sb->sb_hiwat * 5 / 8 && Is this conversion really correct? sbspace(sb) is only sb->sb_hiwat - sbused(sb) in the usual case. For a direct translation, convert sb_hiwat * 3 / 8 to int (it is sure to fit). Bruce From owner-svn-src-head@freebsd.org Fri Jun 24 11:53:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EFC5B80269; Fri, 24 Jun 2016 11:53:13 +0000 (UTC) (envelope-from bz@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 3F3EE25FB; Fri, 24 Jun 2016 11:53:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5OBrC6l075182; Fri, 24 Jun 2016 11:53:12 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5OBrCkC075181; Fri, 24 Jun 2016 11:53:12 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606241153.u5OBrCkC075181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 24 Jun 2016 11:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302173 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 11:53:13 -0000 Author: bz Date: Fri Jun 24 11:53:12 2016 New Revision: 302173 URL: https://svnweb.freebsd.org/changeset/base/302173 Log: The void isn't void. Unbreak sparc64 and powerpc builds. Approved by: re (gjb) Sponsored by: The FreeBSD Foundation MFC after: 12 days Modified: head/sys/netpfil/pf/pf_ioctl.c Modified: head/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- head/sys/netpfil/pf/pf_ioctl.c Fri Jun 24 11:45:56 2016 (r302172) +++ head/sys/netpfil/pf/pf_ioctl.c Fri Jun 24 11:53:12 2016 (r302173) @@ -3740,7 +3740,7 @@ pf_load(void) } static void -pf_unload_vnet() +pf_unload_vnet(void) { int error; From owner-svn-src-head@freebsd.org Fri Jun 24 14:58:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 357DDB80190; Fri, 24 Jun 2016 14:58:39 +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 DC9D62871; Fri, 24 Jun 2016 14:58:38 +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 u5OEwcJr043168; Fri, 24 Jun 2016 14:58:38 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5OEwcuq043167; Fri, 24 Jun 2016 14:58:38 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201606241458.u5OEwcuq043167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 24 Jun 2016 14:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302174 - head/sbin/sysctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 14:58:39 -0000 Author: asomers Date: Fri Jun 24 14:58:37 2016 New Revision: 302174 URL: https://svnweb.freebsd.org/changeset/base/302174 Log: Fix "sysctl vm.vmtotal" output on machines with > 2TB virtual memory sbin/sysctl/sysctl.c Fix integer overflows in printf format strings PR: 199673 Submitted by: Vitaly Magerya Reviewed by: cem Approved by: re (marius) MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6941 Modified: head/sbin/sysctl/sysctl.c Modified: head/sbin/sysctl/sysctl.c ============================================================================== --- head/sbin/sysctl/sysctl.c Fri Jun 24 11:53:12 2016 (r302173) +++ head/sbin/sysctl/sysctl.c Fri Jun 24 14:58:37 2016 (r302174) @@ -623,15 +623,15 @@ S_vmtotal(size_t l2, void *p) "%hd Sleep: %hd)\n", v->t_rq, v->t_dw, v->t_pw, v->t_sl); printf( - "Virtual Memory:\t\t(Total: %dK Active: %dK)\n", - v->t_vm * pageKilo, v->t_avm * pageKilo); - printf("Real Memory:\t\t(Total: %dK Active: %dK)\n", - v->t_rm * pageKilo, v->t_arm * pageKilo); - printf("Shared Virtual Memory:\t(Total: %dK Active: %dK)\n", - v->t_vmshr * pageKilo, v->t_avmshr * pageKilo); - printf("Shared Real Memory:\t(Total: %dK Active: %dK)\n", - v->t_rmshr * pageKilo, v->t_armshr * pageKilo); - printf("Free Memory:\t%dK", v->t_free * pageKilo); + "Virtual Memory:\t\t(Total: %jdK Active: %jdK)\n", + (intmax_t)v->t_vm * pageKilo, (intmax_t)v->t_avm * pageKilo); + printf("Real Memory:\t\t(Total: %jdK Active: %jdK)\n", + (intmax_t)v->t_rm * pageKilo, (intmax_t)v->t_arm * pageKilo); + printf("Shared Virtual Memory:\t(Total: %jdK Active: %jdK)\n", + (intmax_t)v->t_vmshr * pageKilo, (intmax_t)v->t_avmshr * pageKilo); + printf("Shared Real Memory:\t(Total: %jdK Active: %jdK)\n", + (intmax_t)v->t_rmshr * pageKilo, (intmax_t)v->t_armshr * pageKilo); + printf("Free Memory:\t%jdK", (intmax_t)v->t_free * pageKilo); return (0); } From owner-svn-src-head@freebsd.org Fri Jun 24 17:26:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E012EB80F6B; Fri, 24 Jun 2016 17:26:43 +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 A28FC164D; Fri, 24 Jun 2016 17:26:43 +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 u5OHQguN099445; Fri, 24 Jun 2016 17:26:42 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5OHQgQ0099442; Fri, 24 Jun 2016 17:26:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201606241726.u5OHQgQ0099442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 24 Jun 2016 17:26:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302175 - in head: share/man/man9 sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 17:26:44 -0000 Author: jhb Date: Fri Jun 24 17:26:42 2016 New Revision: 302175 URL: https://svnweb.freebsd.org/changeset/base/302175 Log: Add pci_get_max_payload() to fetch the PCI-express maximum payload size. Approved by: re (gjb) MFC after: 2 weeks Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D6951 Modified: head/share/man/man9/pci.9 head/sys/dev/pci/pci.c head/sys/dev/pci/pcivar.h Modified: head/share/man/man9/pci.9 ============================================================================== --- head/share/man/man9/pci.9 Fri Jun 24 14:58:37 2016 (r302174) +++ head/share/man/man9/pci.9 Fri Jun 24 17:26:42 2016 (r302175) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2016 +.Dd June 24, 2016 .Dt PCI 9 .Os .Sh NAME @@ -44,6 +44,7 @@ .Nm pci_find_htcap , .Nm pci_find_pcie_root_port , .Nm pci_get_id , +.Nm pci_get_max_payload , .Nm pci_get_max_read_req , .Nm pci_get_powerstate , .Nm pci_get_vpd_ident , @@ -100,6 +101,8 @@ .Ft int .Fn pci_get_id "device_t dev" "enum pci_id_type type" "uintptr_t *id" .Ft int +.Fn pci_get_max_payload "device_t dev" +.Ft int .Fn pci_get_max_read_req "device_t dev" .Ft int .Fn pci_get_powerstate "device_t dev" @@ -461,6 +464,16 @@ or .Xr bus_activate_resource 9 . .Pp The +.Fn pci_get_max_payload +function returns the current maximum TLP payload size in bytes for a +PCI-express device. +If the +.Fa dev +device is not a PCI-express device, +.Fn pci_get_max_payload +returns zero. +.Pp +The .Fn pci_get_max_read_req function returns the current maximum read request size in bytes for a PCI-express device. Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Fri Jun 24 14:58:37 2016 (r302174) +++ head/sys/dev/pci/pci.c Fri Jun 24 17:26:42 2016 (r302175) @@ -1993,6 +1993,22 @@ pci_ht_map_msi(device_t dev, uint64_t ad } int +pci_get_max_payload(device_t dev) +{ + struct pci_devinfo *dinfo = device_get_ivars(dev); + int cap; + uint16_t val; + + cap = dinfo->cfg.pcie.pcie_location; + if (cap == 0) + return (0); + val = pci_read_config(dev, cap + PCIER_DEVICE_CTL, 2); + val &= PCIEM_CTL_MAX_PAYLOAD; + val >>= 5; + return (1 << (val + 7)); +} + +int pci_get_max_read_req(device_t dev) { struct pci_devinfo *dinfo = device_get_ivars(dev); Modified: head/sys/dev/pci/pcivar.h ============================================================================== --- head/sys/dev/pci/pcivar.h Fri Jun 24 14:58:37 2016 (r302174) +++ head/sys/dev/pci/pcivar.h Fri Jun 24 17:26:42 2016 (r302175) @@ -585,6 +585,7 @@ int pci_msix_device_blacklisted(device_t void pci_ht_map_msi(device_t dev, uint64_t addr); device_t pci_find_pcie_root_port(device_t dev); +int pci_get_max_payload(device_t dev); int pci_get_max_read_req(device_t dev); void pci_restore_state(device_t dev); void pci_save_state(device_t dev); From owner-svn-src-head@freebsd.org Fri Jun 24 18:45:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B328B73FB9; Fri, 24 Jun 2016 18:45:17 +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 2A8D41EEF; Fri, 24 Jun 2016 18:45:17 +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 u5OIjG9C029422; Fri, 24 Jun 2016 18:45:16 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5OIjGL5029421; Fri, 24 Jun 2016 18:45:16 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201606241845.u5OIjGL5029421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 24 Jun 2016 18:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302176 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 18:45:17 -0000 Author: emaste Date: Fri Jun 24 18:45:16 2016 New Revision: 302176 URL: https://svnweb.freebsd.org/changeset/base/302176 Log: bsd.prog.mk: add "/usr/lib" to list of base system directories kgzldr.o is installed into /usr/lib but using bsd.prog.mk. Add /usr/lib to the base system directory list so that debug files are installed into /usr/lib/debug/usr/lib, not /usr/lib/.debug . Approved by: re (gjb) MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/share/mk/bsd.prog.mk Modified: head/share/mk/bsd.prog.mk ============================================================================== --- head/share/mk/bsd.prog.mk Fri Jun 24 17:26:42 2016 (r302175) +++ head/share/mk/bsd.prog.mk Fri Jun 24 18:45:16 2016 (r302176) @@ -66,7 +66,8 @@ PROG_FULL=${PROG}.full ${BINDIR} == "/bin" ||\ ${BINDIR:C%/libexec(/.*)?%/libexec%} == "/libexec" ||\ ${BINDIR} == "/sbin" ||\ - ${BINDIR:C%/usr/(bin|bsdinstall|libexec|lpr|sendmail|sm.bin|sbin|tests)(/.*)?%/usr/bin%} == "/usr/bin"\ + ${BINDIR:C%/usr/(bin|bsdinstall|libexec|lpr|sendmail|sm.bin|sbin|tests)(/.*)?%/usr/bin%} == "/usr/bin" ||\ + ${BINDIR} == "/usr/lib" \ ) DEBUGFILEDIR= ${DEBUGDIR}${BINDIR} .else From owner-svn-src-head@freebsd.org Fri Jun 24 19:56:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6523B8030F; Fri, 24 Jun 2016 19:56:00 +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 72D64249E; Fri, 24 Jun 2016 19:56:00 +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 u5OJtxO5055259; Fri, 24 Jun 2016 19:55:59 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5OJtxQ8055258; Fri, 24 Jun 2016 19:55:59 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606241955.u5OJtxQ8055258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 24 Jun 2016 19:55:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302177 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 19:56:00 -0000 Author: bdrewery Date: Fri Jun 24 19:55:59 2016 New Revision: 302177 URL: https://svnweb.freebsd.org/changeset/base/302177 Log: WITH_SYSTEM_COMPILER: Enable by default This improves buildworld, toolchain, kernel-toolchain, and universe targets. See r300354 or src.conf(5) for more details. Approved by: re (gjb) Relnotes: yes (r300354) Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/src.opts.mk Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Jun 24 18:45:16 2016 (r302176) +++ head/share/mk/src.opts.mk Fri Jun 24 19:55:59 2016 (r302177) @@ -158,6 +158,7 @@ __DEFAULT_YES_OPTIONS = \ SOURCELESS_UCODE \ SVNLITE \ SYSCONS \ + SYSTEM_COMPILER \ TALK \ TCP_WRAPPERS \ TCSH \ @@ -189,7 +190,6 @@ __DEFAULT_NO_OPTIONS = \ SHARED_TOOLCHAIN \ SORT_THREADS \ SVN \ - SYSTEM_COMPILER \ # From owner-svn-src-head@freebsd.org Fri Jun 24 20:00:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B89B2B8057F; Fri, 24 Jun 2016 20:00:40 +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 6CC512791; Fri, 24 Jun 2016 20:00:40 +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 u5OK0d3j055515; Fri, 24 Jun 2016 20:00:39 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5OK0dcD055514; Fri, 24 Jun 2016 20:00:39 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201606242000.u5OK0dcD055514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 24 Jun 2016 20:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302178 - head/share/man/man5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 20:00:40 -0000 Author: bdrewery Date: Fri Jun 24 20:00:39 2016 New Revision: 302178 URL: https://svnweb.freebsd.org/changeset/base/302178 Log: Regenerate Approved by: re (implicit, r302177) Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Jun 24 19:55:59 2016 (r302177) +++ head/share/man/man5/src.conf.5 Fri Jun 24 20:00:39 2016 (r302178) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 292283 2015-12-15 18:42:30Z bdrewery .\" $FreeBSD$ -.Dd June 14, 2016 +.Dd June 24, 2016 .Dt SRC.CONF 5 .Os .Sh NAME @@ -536,6 +536,10 @@ When set, it also enforces the following When set, the following options are also in effect: .Pp .Bl -inset -compact +.It Va WITHOUT_SYSTEM_COMPILER +(unless +.Va WITH_SYSTEM_COMPILER +is set explicitly) .It Va WITH_AUTO_OBJ (unless .Va WITHOUT_AUTO_OBJ @@ -1134,6 +1138,14 @@ to .Pp Currently this also enforces .Va WITHOUT_SYSTEM_COMPILER . +When set, the following options are also in effect: +.Pp +.Bl -inset -compact +.It Va WITHOUT_SYSTEM_COMPILER +(unless +.Va WITH_SYSTEM_COMPILER +is set explicitly) +.El .Pp This must be set in the environment, make command line, or .Pa /etc/src-env.conf , @@ -1434,12 +1446,12 @@ This must be set in the environment, mak .Pa /etc/src-env.conf , not .Pa /etc/src.conf . -.It Va WITH_SYSTEM_COMPILER -.\" from FreeBSD: head/tools/build/options/WITH_SYSTEM_COMPILER 300354 2016-05-21 01:32:23Z bdrewery -Set to opportunistically skip building a cross-compiler during the +.It Va WITHOUT_SYSTEM_COMPILER +.\" from FreeBSD: head/tools/build/options/WITHOUT_SYSTEM_COMPILER 300354 2016-05-21 01:32:23Z bdrewery +Set to not opportunistically skip building a cross-compiler during the bootstrap phase of the build. -If the currently installed compiler matches the planned bootstrap compiler -type and revision, then it will not be built. +Normally, if the currently installed compiler matches the planned bootstrap +compiler type and revision, then it will not be built. This does not prevent a compiler from being built for installation though, only for building one for the build itself. The From owner-svn-src-head@freebsd.org Fri Jun 24 20:21:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6279BB809B8; Fri, 24 Jun 2016 20:21:33 +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 327D912F6; Fri, 24 Jun 2016 20:21:33 +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 u5OKLWhp064114; Fri, 24 Jun 2016 20:21:32 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5OKLWRG064113; Fri, 24 Jun 2016 20:21:32 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201606242021.u5OKLWRG064113@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 24 Jun 2016 20:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302179 - head/usr.bin/gcore X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 20:21:33 -0000 Author: markj Date: Fri Jun 24 20:21:32 2016 New Revision: 302179 URL: https://svnweb.freebsd.org/changeset/base/302179 Log: gcore: Forward pending signals when detaching from the target. Otherwise gcore's ptrace attach operation can race with delivery of a signal and cause it to be lost. In collaboration with: Suraj Raju Reviewed by: bdrewery Approved by: re (gjb, kib) MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Division Modified: head/usr.bin/gcore/elfcore.c Modified: head/usr.bin/gcore/elfcore.c ============================================================================== --- head/usr.bin/gcore/elfcore.c Fri Jun 24 20:00:39 2016 (r302178) +++ head/usr.bin/gcore/elfcore.c Fri Jun 24 20:21:32 2016 (r302179) @@ -126,6 +126,7 @@ static vm_map_entry_t readmap(pid_t); static void *procstat_sysctl(void *, int, size_t, size_t *sizep); static pid_t g_pid; /* Pid being dumped, global for elf_detach */ +static int g_status; /* proc status after ptrace attach */ static int elf_ident(int efd, pid_t pid __unused, char *binfile __unused) @@ -159,9 +160,18 @@ elf_ident(int efd, pid_t pid __unused, c static void elf_detach(void) { + int sig; - if (g_pid != 0) - ptrace(PT_DETACH, g_pid, (caddr_t)1, 0); + if (g_pid != 0) { + /* + * Forward any pending signals. SIGSTOP is generated by ptrace + * itself, so ignore it. + */ + sig = WIFSTOPPED(g_status) ? WSTOPSIG(g_status) : 0; + if (sig == SIGSTOP) + sig = 0; + ptrace(PT_DETACH, g_pid, (caddr_t)1, sig); + } } /* @@ -187,7 +197,7 @@ elf_coredump(int efd __unused, int fd, p ptrace(PT_ATTACH, pid, NULL, 0); if (errno) err(1, "PT_ATTACH"); - if (waitpid(pid, NULL, 0) == -1) + if (waitpid(pid, &g_status, 0) == -1) err(1, "waitpid"); /* Get the program's memory map. */ From owner-svn-src-head@freebsd.org Fri Jun 24 21:44:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A2A1B74E71; Fri, 24 Jun 2016 21:44:47 +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 3D3CE25FF; Fri, 24 Jun 2016 21:44:47 +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 u5OLikcJ096478; Fri, 24 Jun 2016 21:44:46 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5OLikjj096476; Fri, 24 Jun 2016 21:44:46 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201606242144.u5OLikjj096476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 24 Jun 2016 21:44:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302180 - in head: sys/sys tests/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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 21:44:47 -0000 Author: asomers Date: Fri Jun 24 21:44:46 2016 New Revision: 302180 URL: https://svnweb.freebsd.org/changeset/base/302180 Log: Fix bitstring allocation on 32-bit platforms sys/sys/bitstring.h Fix a rounding calculation that could undersize a bitstring on 32-bit platforms. tests/sys/sys/bitstring_test.h Add a test for bitstr_size PR: 210260 Reported by: Mark Millard Reviewed by: gibbs Approved by: re (marius) Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D6848 Modified: head/sys/sys/bitstring.h head/tests/sys/sys/bitstring_test.c Modified: head/sys/sys/bitstring.h ============================================================================== --- head/sys/sys/bitstring.h Fri Jun 24 20:21:32 2016 (r302179) +++ head/sys/sys/bitstring.h Fri Jun 24 21:44:46 2016 (r302180) @@ -75,6 +75,12 @@ typedef unsigned long bitstr_t; #define _BITSTR_MASK (~0UL) #define _BITSTR_BITS (sizeof(bitstr_t) * 8) +#ifdef roundup2 +#define _bit_roundup2 roundup2 +#else +#define _bit_roundup2(x, y) (((x)+((y)-1))&(~((y)-1))) /* if y is powers of two */ +#endif + /* bitstr_t in bit string containing the bit. */ static inline int _bit_idx(int _bit) @@ -104,9 +110,8 @@ _bit_make_mask(int _start, int _stop) } /*----------------------------- Public Interface -----------------------------*/ -/* Number of bytes consumed by a bit string of nbits bits */ -#define bitstr_size(_nbits) \ - (((_nbits) + _BITSTR_BITS - 1) / 8) +/* Number of bytes allocated for a bit string of nbits bits */ +#define bitstr_size(_nbits) (_bit_roundup2(_nbits, _BITSTR_BITS) / 8) /* Allocate a bit string initialized with no bits set. */ #ifdef _KERNEL @@ -123,7 +128,7 @@ bit_alloc(int _nbits) } #endif -/* Allocate a bit string on the stack with no bits set. */ +/* Allocate a bit string on the stack */ #define bit_decl(name, nbits) \ ((name)[bitstr_size(nbits) / sizeof(bitstr_t)]) Modified: head/tests/sys/sys/bitstring_test.c ============================================================================== --- head/tests/sys/sys/bitstring_test.c Fri Jun 24 20:21:32 2016 (r302179) +++ head/tests/sys/sys/bitstring_test.c Fri Jun 24 21:44:46 2016 (r302180) @@ -102,6 +102,17 @@ ATF_TC_BODY(bitstr_in_struct, tc) bit_nclear(test_struct.bitstr, 0, 8); } +ATF_TC_WITHOUT_HEAD(bitstr_size); +ATF_TC_BODY(bitstr_size, tc) +{ + size_t sob = sizeof(bitstr_t); + + ATF_CHECK_EQ(0, bitstr_size(0)); + ATF_CHECK_EQ(sob, bitstr_size(1)); + ATF_CHECK_EQ(sob, bitstr_size(sob * 8)); + ATF_CHECK_EQ(2 * sob, bitstr_size(sob * 8 + 1)); +} + BITSTRING_TC_DEFINE(bit_set) /* bitstr_t *bitstr, int nbits, const char *memloc */ { @@ -407,6 +418,7 @@ ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, bitstr_in_struct); + ATF_TP_ADD_TC(tp, bitstr_size); BITSTRING_TC_ADD(tp, bit_set); BITSTRING_TC_ADD(tp, bit_clear); BITSTRING_TC_ADD(tp, bit_ffs); From owner-svn-src-head@freebsd.org Fri Jun 24 22:49:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B8B1B80D18; Fri, 24 Jun 2016 22:49:33 +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 12AF729A5; Fri, 24 Jun 2016 22:49:33 +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 u5OMnWXV019174; Fri, 24 Jun 2016 22:49:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5OMnWbN019173; Fri, 24 Jun 2016 22:49:32 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201606242249.u5OMnWbN019173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 24 Jun 2016 22:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302181 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 22:49:33 -0000 Author: jhb Date: Fri Jun 24 22:49:32 2016 New Revision: 302181 URL: https://svnweb.freebsd.org/changeset/base/302181 Log: Add a tunable to disable migration of MSI-X interrupts. The new 'machdep.disable_msix_migration' tunable can be set to 1 to disable migration of MSI-X interrupts. Xen versions prior to 4.6.0 do not properly handle updates to MSI-X table entries after the initial write. In particular, the operation to unmask a table entry after updating it during migration is not propagated to the "real" table for passthrough devices causing the interrupt to remain masked. At least some systems in EC2 are affected by this bug when using SRIOV. The tunable can be set in loader.conf as a workaround. Submitted by: Jeremiah Lott (original patch) Approved by: re (marius) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D6947 Modified: head/sys/x86/x86/msi.c Modified: head/sys/x86/x86/msi.c ============================================================================== --- head/sys/x86/x86/msi.c Fri Jun 24 21:44:46 2016 (r302180) +++ head/sys/x86/x86/msi.c Fri Jun 24 22:49:32 2016 (r302181) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -148,6 +149,16 @@ struct pic msi_pic = { .pic_reprogram_pin = NULL, }; +/* + * Xen hypervisors prior to 4.6.0 do not properly handle updates to + * enabled MSI-X table entries. Allow migration of MSI-X interrupts + * to be disabled via a tunable. + */ +static int msix_disable_migration = 0; +SYSCTL_INT(_machdep, OID_AUTO, disable_msix_migration, CTLFLAG_RDTUN, + &msix_disable_migration, 0, + "Disable migration of MSI-X interrupts between CPUs"); + static int msi_enabled; static int msi_last_irq; static struct mtx msi_lock; @@ -226,6 +237,9 @@ msi_assign_cpu(struct intsrc *isrc, u_in if (msi->msi_first != msi) return (EINVAL); + if (msix_disable_migration && msi->msi_msix) + return (EINVAL); + /* Store information to free existing irq. */ old_vector = msi->msi_vector; old_id = msi->msi_cpu; From owner-svn-src-head@freebsd.org Fri Jun 24 23:22:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BD5AB8077D; Fri, 24 Jun 2016 23:22:44 +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 EB88224B2; Fri, 24 Jun 2016 23:22:43 +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 u5ONMhmM034366; Fri, 24 Jun 2016 23:22:43 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ONMgqN034358; Fri, 24 Jun 2016 23:22:42 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606242322.u5ONMgqN034358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 24 Jun 2016 23:22:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302182 - in head: crypto/openssh secure/usr.sbin/sshd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 23:22:44 -0000 Author: gjb Date: Fri Jun 24 23:22:42 2016 New Revision: 302182 URL: https://svnweb.freebsd.org/changeset/base/302182 Log: Revert r301551, which added blacklistd(8) to sshd(8). This change has functional impact, and other concerns raised by the OpenSSH maintainer. Requested by: des PR: 210479 (related) Approved by: re (marius) Sponsored by: The FreeBSD Foundation Deleted: head/crypto/openssh/blacklist.c head/crypto/openssh/blacklist_client.h Modified: head/crypto/openssh/auth-pam.c head/crypto/openssh/auth.c head/crypto/openssh/auth1.c head/crypto/openssh/auth2.c head/crypto/openssh/packet.c head/crypto/openssh/sshd.c head/secure/usr.sbin/sshd/Makefile head/secure/usr.sbin/sshd/Makefile.depend Modified: head/crypto/openssh/auth-pam.c ============================================================================== --- head/crypto/openssh/auth-pam.c Fri Jun 24 22:49:32 2016 (r302181) +++ head/crypto/openssh/auth-pam.c Fri Jun 24 23:22:42 2016 (r302182) @@ -98,9 +98,6 @@ #include "ssh-gss.h" #endif #include "monitor_wrap.h" -#ifdef USE_BLACKLIST -#include "blacklist_client.h" -#endif extern ServerOptions options; extern Buffer loginmsg; @@ -797,9 +794,6 @@ sshpam_query(void *ctx, char **name, cha free(msg); return (0); } -#ifdef USE_BLACKLIST - blacklist_notify(1); -#endif error("PAM: %s for %s%.100s from %.100s", msg, sshpam_authctxt->valid ? "" : "illegal user ", sshpam_authctxt->user, Modified: head/crypto/openssh/auth.c ============================================================================== --- head/crypto/openssh/auth.c Fri Jun 24 22:49:32 2016 (r302181) +++ head/crypto/openssh/auth.c Fri Jun 24 23:22:42 2016 (r302182) @@ -75,9 +75,6 @@ __RCSID("$FreeBSD$"); #include "authfile.h" #include "ssherr.h" #include "compat.h" -#ifdef USE_BLACKLIST -#include "blacklist_client.h" -#endif /* import */ extern ServerOptions options; @@ -309,10 +306,6 @@ auth_log(Authctxt *authctxt, int authent compat20 ? "ssh2" : "ssh1", authctxt->info != NULL ? ": " : "", authctxt->info != NULL ? authctxt->info : ""); -#ifdef USE_BLACKLIST - if (!authctxt->postponed) - blacklist_notify(!authenticated); -#endif free(authctxt->info); authctxt->info = NULL; @@ -647,9 +640,6 @@ getpwnamallow(const char *user) } #endif if (pw == NULL) { -#ifdef USE_BLACKLIST - blacklist_notify(1); -#endif logit("Invalid user %.100s from %.100s", user, get_remote_ipaddr()); #ifdef CUSTOM_FAILED_LOGIN Modified: head/crypto/openssh/auth1.c ============================================================================== --- head/crypto/openssh/auth1.c Fri Jun 24 22:49:32 2016 (r302181) +++ head/crypto/openssh/auth1.c Fri Jun 24 23:22:42 2016 (r302182) @@ -43,9 +43,6 @@ #endif #include "monitor_wrap.h" #include "buffer.h" -#ifdef USE_BLACKLIST -#include "blacklist_client.h" -#endif /* import */ extern ServerOptions options; @@ -340,9 +337,6 @@ do_authloop(Authctxt *authctxt) char *msg; size_t len; -#ifdef USE_BLACKLIST - blacklist_notify(1); -#endif error("Access denied for user %s by PAM account " "configuration", authctxt->user); len = buffer_len(&loginmsg); @@ -410,9 +404,6 @@ do_authentication(Authctxt *authctxt) else { debug("do_authentication: invalid user %s", user); authctxt->pw = fakepw(); -#ifdef USE_BLACKLIST - blacklist_notify(1); -#endif } /* Configuration may have changed as a result of Match */ Modified: head/crypto/openssh/auth2.c ============================================================================== --- head/crypto/openssh/auth2.c Fri Jun 24 22:49:32 2016 (r302181) +++ head/crypto/openssh/auth2.c Fri Jun 24 23:22:42 2016 (r302182) @@ -52,9 +52,6 @@ __RCSID("$FreeBSD$"); #include "pathnames.h" #include "buffer.h" #include "canohost.h" -#ifdef USE_BLACKLIST -#include "blacklist_client.h" -#endif #ifdef GSSAPI #include "ssh-gss.h" @@ -251,9 +248,6 @@ input_userauth_request(int type, u_int32 } else { logit("input_userauth_request: invalid user %s", user); authctxt->pw = fakepw(); -#ifdef USE_BLACKLIST - blacklist_notify(1); -#endif #ifdef SSH_AUDIT_EVENTS PRIVSEP(audit_event(SSH_INVALID_USER)); #endif Modified: head/crypto/openssh/packet.c ============================================================================== --- head/crypto/openssh/packet.c Fri Jun 24 22:49:32 2016 (r302181) +++ head/crypto/openssh/packet.c Fri Jun 24 23:22:42 2016 (r302182) @@ -86,9 +86,6 @@ __RCSID("$FreeBSD$"); #include "packet.h" #include "ssherr.h" #include "sshbuf.h" -#ifdef USE_BLACKLIST -#include "blacklist_client.h" -#endif #ifdef PACKET_DEBUG #define DBG(x) x @@ -2074,9 +2071,6 @@ sshpkt_fatal(struct ssh *ssh, const char case SSH_ERR_NO_KEX_ALG_MATCH: case SSH_ERR_NO_HOSTKEY_ALG_MATCH: if (ssh && ssh->kex && ssh->kex->failed_choice) { -#ifdef USE_BLACKLIST - blacklist_notify(1); -#endif fatal("Unable to negotiate with %.200s port %d: %s. " "Their offer: %s", ssh_remote_ipaddr(ssh), ssh_remote_port(ssh), ssh_err(r), Modified: head/crypto/openssh/sshd.c ============================================================================== --- head/crypto/openssh/sshd.c Fri Jun 24 22:49:32 2016 (r302181) +++ head/crypto/openssh/sshd.c Fri Jun 24 23:22:42 2016 (r302182) @@ -135,9 +135,6 @@ __RCSID("$FreeBSD$"); #include "ssh-sandbox.h" #include "version.h" #include "ssherr.h" -#ifdef USE_BLACKLIST -#include "blacklist_client.h" -#endif #ifdef LIBWRAP #include @@ -391,9 +388,6 @@ grace_alarm_handler(int sig) kill(0, SIGTERM); } -#ifdef USE_BLACKLIST - blacklist_notify(1); -#endif /* Log error and exit. */ sigdie("Timeout before authentication for %s", get_remote_ipaddr()); } @@ -655,10 +649,6 @@ privsep_preauth_child(void) /* Demote the private keys to public keys. */ demote_sensitive_data(); -#ifdef USE_BLACKLIST - blacklist_init(); -#endif - /* Demote the child */ if (getuid() == 0 || geteuid() == 0) { /* Change our root directory */ @@ -1282,9 +1272,6 @@ server_accept_loop(int *sock_in, int *so for (i = 0; i < options.max_startups; i++) startup_pipes[i] = -1; -#ifdef USE_BLACKLIST - blacklist_init(); -#endif /* * Stay listening for connections until the system crashes or * the daemon is killed with a signal. Modified: head/secure/usr.sbin/sshd/Makefile ============================================================================== --- head/secure/usr.sbin/sshd/Makefile Fri Jun 24 22:49:32 2016 (r302181) +++ head/secure/usr.sbin/sshd/Makefile Fri Jun 24 23:22:42 2016 (r302182) @@ -40,13 +40,6 @@ CFLAGS+= -DUSE_BSM_AUDIT -DHAVE_GETAUDIT LIBADD+= bsm .endif -.if ${MK_BLACKLIST_SUPPORT} != "no" -CFLAGS+= -DUSE_BLACKLIST -I${SRCTOP}/contrib/blacklist/include -SRCS+= blacklist.c -LIBADD+= blacklist -LDFLAGS+=-L${LIBBLACKLISTDIR} -.endif - .if ${MK_KERBEROS_SUPPORT} != "no" CFLAGS+= -include krb5_config.h SRCS+= krb5_config.h Modified: head/secure/usr.sbin/sshd/Makefile.depend ============================================================================== --- head/secure/usr.sbin/sshd/Makefile.depend Fri Jun 24 22:49:32 2016 (r302181) +++ head/secure/usr.sbin/sshd/Makefile.depend Fri Jun 24 23:22:42 2016 (r302182) @@ -17,7 +17,6 @@ DIRDEPS = \ kerberos5/lib/libroken \ kerberos5/lib/libwind \ lib/${CSU_DIR} \ - lib/libblacklist \ lib/libbsm \ lib/libc \ lib/libcom_err \ From owner-svn-src-head@freebsd.org Fri Jun 24 23:36:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78DF7B8099E; Fri, 24 Jun 2016 23:36:23 +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 1DCAC2B62; Fri, 24 Jun 2016 23:36:23 +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 u5ONaMDZ038111; Fri, 24 Jun 2016 23:36:22 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ONaMUV038110; Fri, 24 Jun 2016 23:36:22 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606242336.u5ONaMUV038110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 24 Jun 2016 23:36:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302183 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 23:36:23 -0000 Author: avos Date: Fri Jun 24 23:36:22 2016 New Revision: 302183 URL: https://svnweb.freebsd.org/changeset/base/302183 Log: urtwn: fix memory leak on device restart Free data buffers every time when device is stopped, not when it is detached; they are allocated at the initialization stage. How-to-reproduce: 1) ifconfig wlan0 create wlandev urtwn0 up 2) vmstat -m | grep USBdev 3) service netif restart 4) vmstat -m | grep USBdev Also, remove usbd_transfer_drain() call; it is already called by usbd_transfer_unsetup(). Tested with RTL8188CUS, STA mode. Approved by: re (marius) Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Fri Jun 24 23:22:42 2016 (r302182) +++ head/sys/dev/urtwn/if_urtwn.c Fri Jun 24 23:36:22 2016 (r302183) @@ -683,7 +683,6 @@ urtwn_detach(device_t self) { struct urtwn_softc *sc = device_get_softc(self); struct ieee80211com *ic = &sc->sc_ic; - unsigned int x; /* Prevent further ioctls. */ URTWN_LOCK(sc); @@ -698,26 +697,6 @@ urtwn_detach(device_t self) /* stop all USB transfers */ usbd_transfer_unsetup(sc->sc_xfer, URTWN_N_TRANSFER); - /* Prevent further allocations from RX/TX data lists. */ - URTWN_LOCK(sc); - STAILQ_INIT(&sc->sc_tx_active); - STAILQ_INIT(&sc->sc_tx_inactive); - STAILQ_INIT(&sc->sc_tx_pending); - - STAILQ_INIT(&sc->sc_rx_active); - STAILQ_INIT(&sc->sc_rx_inactive); - URTWN_UNLOCK(sc); - - /* drain USB transfers */ - for (x = 0; x != URTWN_N_TRANSFER; x++) - usbd_transfer_drain(sc->sc_xfer[x]); - - /* Free data buffers. */ - URTWN_LOCK(sc); - urtwn_free_tx_list(sc); - urtwn_free_rx_list(sc); - URTWN_UNLOCK(sc); - if (ic->ic_softc == sc) { ieee80211_draintask(ic, &sc->cmdq_task); ieee80211_ifdetach(ic); @@ -1359,12 +1338,19 @@ static void urtwn_free_rx_list(struct urtwn_softc *sc) { urtwn_free_list(sc, sc->sc_rx, URTWN_RX_LIST_COUNT); + + STAILQ_INIT(&sc->sc_rx_active); + STAILQ_INIT(&sc->sc_rx_inactive); } static void urtwn_free_tx_list(struct urtwn_softc *sc) { urtwn_free_list(sc, sc->sc_tx, URTWN_TX_LIST_COUNT); + + STAILQ_INIT(&sc->sc_tx_active); + STAILQ_INIT(&sc->sc_tx_inactive); + STAILQ_INIT(&sc->sc_tx_pending); } static void @@ -5579,6 +5565,8 @@ urtwn_stop(struct urtwn_softc *sc) urtwn_abort_xfers(sc); urtwn_drain_mbufq(sc); + urtwn_free_tx_list(sc); + urtwn_free_rx_list(sc); urtwn_power_off(sc); URTWN_UNLOCK(sc); } From owner-svn-src-head@freebsd.org Fri Jun 24 23:39:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 002AEB80AB5; Fri, 24 Jun 2016 23:39:46 +0000 (UTC) (envelope-from cperciva@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 C51562DB8; Fri, 24 Jun 2016 23:39:45 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5ONdjLv038257; Fri, 24 Jun 2016 23:39:45 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ONdjlP038256; Fri, 24 Jun 2016 23:39:45 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201606242339.u5ONdjlP038256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Fri, 24 Jun 2016 23:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302184 - head/release/tools X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 23:39:46 -0000 Author: cperciva Date: Fri Jun 24 23:39:44 2016 New Revision: 302184 URL: https://svnweb.freebsd.org/changeset/base/302184 Log: Turn off MSI-X interrupt migration by default in EC2 instances; this works around a bug in older versions of Xen and unbreaks SR-IOV (aka. "EC2 Enhanced Networking"). Approved by: re (gjb) Thanks to: jhb, Jeremiah Lott Modified: head/release/tools/ec2.conf Modified: head/release/tools/ec2.conf ============================================================================== --- head/release/tools/ec2.conf Fri Jun 24 23:36:22 2016 (r302183) +++ head/release/tools/ec2.conf Fri Jun 24 23:39:44 2016 (r302184) @@ -77,6 +77,12 @@ vm_extra_pre_umount() { # by default for now. echo 'hw.xbd.xbd_enable_indirect="0"' >> ${DESTDIR}/boot/loader.conf + # Some EC2 instances run on a version of Xen which has a bug relating + # to the migration of MSI-X interrupts; this is visible as SR-IOV + # networking (aka. "EC2 Enhanced Networking") not being able to pass + # packets. Disable MSI-X interrupt migration to work around this bug. + echo 'machdep.disable_msix_migration="1"' >> ${DESTDIR}/boot/loader.conf + # The first time the AMI boots, the installed "first boot" scripts # should be allowed to run: # * ec2_configinit (download and process EC2 user-data) From owner-svn-src-head@freebsd.org Fri Jun 24 23:42:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0847FB80C11; Fri, 24 Jun 2016 23:42:35 +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 C6A6B1256; Fri, 24 Jun 2016 23:42:34 +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 u5ONgXga041634; Fri, 24 Jun 2016 23:42:33 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ONgXTu041633; Fri, 24 Jun 2016 23:42:33 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201606242342.u5ONgXTu041633@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 24 Jun 2016 23:42:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302185 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 23:42:35 -0000 Author: gjb Date: Fri Jun 24 23:42:33 2016 New Revision: 302185 URL: https://svnweb.freebsd.org/changeset/base/302185 Log: Update the release notes following r302182. Approved by: re (implicit, relnotes) Sponsored by: The FreeBSD Foundation Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jun 24 23:39:44 2016 (r302184) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Fri Jun 24 23:42:33 2016 (r302185) @@ -621,9 +621,8 @@ A selection of system daemons, including: fingerd, ftpd, - rlogind, - rshd, and - sshd have been modified to support + rlogind, and + rshd have been modified to support sending notifications to the blacklistd daemon. From owner-svn-src-head@freebsd.org Fri Jun 24 23:43:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7D52B80C61; Fri, 24 Jun 2016 23:43:20 +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 99FDB13DA; Fri, 24 Jun 2016 23:43:20 +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 u5ONhJww041703; Fri, 24 Jun 2016 23:43:19 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5ONhJRq041702; Fri, 24 Jun 2016 23:43:19 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201606242343.u5ONhJRq041702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 24 Jun 2016 23:43:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302186 - head/sys/dev/urtwn X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2016 23:43:20 -0000 Author: avos Date: Fri Jun 24 23:43:19 2016 New Revision: 302186 URL: https://svnweb.freebsd.org/changeset/base/302186 Log: urtwn: use m_get2() in Rx path. Replace m_getcl() with m_get2(); this fixes 'frame too long' messages for frames, which are longer than MCLBYTES (can be easily triggered when A-MSDU is used). Tested with RTL8188CUS (AP) and RTL8188EU (STA). Approved by: re (marius) Modified: head/sys/dev/urtwn/if_urtwn.c Modified: head/sys/dev/urtwn/if_urtwn.c ============================================================================== --- head/sys/dev/urtwn/if_urtwn.c Fri Jun 24 23:42:33 2016 (r302185) +++ head/sys/dev/urtwn/if_urtwn.c Fri Jun 24 23:43:19 2016 (r302186) @@ -895,14 +895,7 @@ urtwn_rx_copy_to_mbuf(struct urtwn_softc goto fail; } - if (__predict_false(totlen > MCLBYTES)) { - /* convert to m_getjcl if this happens */ - device_printf(sc->sc_dev, "%s: frame too long: %d (%d)\n", - __func__, pktlen, totlen); - goto fail; - } - - m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); + m = m_get2(totlen, M_NOWAIT, MT_DATA, M_PKTHDR); if (__predict_false(m == NULL)) { device_printf(sc->sc_dev, "%s: could not allocate RX mbuf\n", __func__); From owner-svn-src-head@freebsd.org Sat Jun 25 04:33:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F6E1B73BBD; Sat, 25 Jun 2016 04:33:03 +0000 (UTC) (envelope-from landonf@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 B9EF21822; Sat, 25 Jun 2016 04:33:02 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5P4X2VE050454; Sat, 25 Jun 2016 04:33:02 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5P4X1G8050443; Sat, 25 Jun 2016 04:33:01 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201606250433.u5P4X1G8050443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 25 Jun 2016 04:33:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302189 - in head/sys: dev/bhnd dev/bhnd/cores/chipc mips/broadcom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 04:33:03 -0000 Author: landonf Date: Sat Jun 25 04:33:00 2016 New Revision: 302189 URL: https://svnweb.freebsd.org/changeset/base/302189 Log: bhnd(4): Perform explicit chipc child enumeration. Replaces use of DEVICE_IDENTIFY with explicit enumeration of chipc child devices using the chipc capability structure. This is a precursor to PMU support, which requires more complex resource assignment handling than achievable with the static device name-based hints table. Reviewed by: Michael Zhilin (Broadcom MIPS support) Approved by: re (gjb), adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6896 Modified: head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhnd_subr.c head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c head/sys/dev/bhnd/cores/chipc/chipc.c head/sys/dev/bhnd/cores/chipc/chipc_cfi.c head/sys/dev/bhnd/cores/chipc/chipc_private.h head/sys/dev/bhnd/cores/chipc/chipc_slicer.c head/sys/dev/bhnd/cores/chipc/chipc_slicer.h head/sys/dev/bhnd/cores/chipc/chipc_spi.c head/sys/dev/bhnd/cores/chipc/chipc_spi.h head/sys/dev/bhnd/cores/chipc/chipc_subr.c head/sys/dev/bhnd/cores/chipc/chipcreg.h head/sys/dev/bhnd/cores/chipc/chipcvar.h head/sys/mips/broadcom/uart_bus_chipc.c Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Sat Jun 25 02:09:49 2016 (r302188) +++ head/sys/dev/bhnd/bhnd_bus_if.m Sat Jun 25 04:33:00 2016 (r302189) @@ -55,6 +55,12 @@ CODE { panic("bhnd_bus_get_chipid unimplemented"); } + static bhnd_attach_type + bhnd_bus_null_get_attach_type(device_t dev, device_t child) + { + panic("bhnd_bus_get_attach_type unimplemented"); + } + static int bhnd_bus_null_read_board_info(device_t dev, device_t child, struct bhnd_board_info *info) @@ -197,7 +203,7 @@ METHOD const struct bhnd_chipid * get_ch METHOD bhnd_attach_type get_attach_type { device_t dev; device_t child; -} DEFAULT bhnd_bus_generic_get_attach_type; +} DEFAULT bhnd_bus_null_get_attach_type; /** * Attempt to read the BHND board identification from the parent bus. Modified: head/sys/dev/bhnd/bhnd_subr.c ============================================================================== --- head/sys/dev/bhnd/bhnd_subr.c Sat Jun 25 02:09:49 2016 (r302188) +++ head/sys/dev/bhnd/bhnd_subr.c Sat Jun 25 04:33:00 2016 (r302189) @@ -1159,21 +1159,3 @@ bhnd_bus_generic_deactivate_resource(dev return (EINVAL); }; -/** - * Helper function for implementing BHND_BUS_GET_ATTACH_TYPE(). - * - * This implementation of BHND_BUS_GET_ATTACH_TYPE() simply calls the - * BHND_BUS_GET_ATTACH_TYPE() method of the parent of @p dev. - */ -bhnd_attach_type -bhnd_bus_generic_get_attach_type(device_t dev, device_t child) -{ - /* iterate from cores via bhnd to bridge or SoC */ - if (device_get_parent(dev) != NULL) - return (BHND_BUS_GET_ATTACH_TYPE(device_get_parent(dev), - child)); - - panic("bhnd_bus_get_attach_type unimplemented"); - /* Unreachable */ - return (BHND_ATTACH_ADAPTER); -} Modified: head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m ============================================================================== --- head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m Sat Jun 25 02:09:49 2016 (r302188) +++ head/sys/dev/bhnd/cores/chipc/bhnd_chipc_if.m Sat Jun 25 04:33:00 2016 (r302189) @@ -36,32 +36,16 @@ INTERFACE bhnd_chipc; # HEADER { - #include /* forward declarations */ struct chipc_caps; - struct chipc_caps *bhnd_chipc_generic_get_caps(device_t dev); } CODE { - - /** - * Helper function for implementing BHND_CHIPC_GET_CAPS(). - * - * This implementation of BHND_CHIPC_GET_CAPS() simply calls the - * BHND_CHIPC_GET_CAPS() method of the parent of @p dev. - */ - struct chipc_caps* - bhnd_chipc_generic_get_caps(device_t dev) + static struct chipc_caps * + bhnd_chipc_null_get_caps(device_t dev) { - - if (device_get_parent(dev) != NULL) - return (BHND_CHIPC_GET_CAPS(device_get_parent(dev))); - panic("bhnd_chipc_generic_get_caps unimplemented"); - /* Unreachable */ - return (NULL); } - } /** @@ -91,7 +75,7 @@ METHOD void write_chipctrl { */ METHOD struct chipc_caps * get_caps { device_t dev; -} DEFAULT bhnd_chipc_generic_get_caps; +} DEFAULT bhnd_chipc_null_get_caps; /** * Enable hardware access to the SPROM/OTP source. @@ -114,12 +98,3 @@ METHOD int enable_sprom { METHOD void disable_sprom { device_t dev; } - -/** - * Return the flash configuration register value - * - * @param dev A bhnd(4) ChipCommon device - */ -METHOD uint32_t get_flash_cfg { - device_t dev; -} Modified: head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c Sat Jun 25 02:09:49 2016 (r302188) +++ head/sys/dev/bhnd/cores/chipc/bhnd_sprom_chipc.c Sat Jun 25 04:33:00 2016 (r302189) @@ -54,22 +54,6 @@ __FBSDID("$FreeBSD$"); #define CHIPC_VALID_SPROM_SRC(_src) \ ((_src) == BHND_NVRAM_SRC_SPROM || (_src) == BHND_NVRAM_SRC_OTP) -static void -chipc_sprom_identify(driver_t *driver, device_t parent) -{ - struct chipc_caps *caps; - - caps = BHND_CHIPC_GET_CAPS(parent); - if (!CHIPC_VALID_SPROM_SRC(caps->nvram_src)) - return; - - if (device_find_child(parent, "bhnd_nvram", 0) != NULL) - return; - - if (BUS_ADD_CHILD(parent, 0, "bhnd_nvram", 0) == NULL) - device_printf(parent, "add bhnd_nvram failed\n"); -} - static int chipc_sprom_probe(device_t dev) { @@ -113,7 +97,6 @@ chipc_sprom_attach(device_t dev) static device_method_t chipc_sprom_methods[] = { /* Device interface */ - DEVMETHOD(device_identify, chipc_sprom_identify), DEVMETHOD(device_probe, chipc_sprom_probe), DEVMETHOD(device_attach, chipc_sprom_attach), DEVMETHOD_END Modified: head/sys/dev/bhnd/cores/chipc/chipc.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc.c Sat Jun 25 02:09:49 2016 (r302188) +++ head/sys/dev/bhnd/cores/chipc/chipc.c Sat Jun 25 04:33:00 2016 (r302189) @@ -37,25 +37,8 @@ __FBSDID("$FreeBSD$"); * With the exception of some very early chipsets, the ChipCommon core * has been included in all HND SoCs and chipsets based on the siba(4) * and bcma(4) interconnects, providing a common interface to chipset - * identification, bus enumeration, UARTs, clocks, watchdog interrupts, GPIO, - * flash, etc. - * - * The purpose of this driver is memory resource management for ChipCommon drivers - * like UART, PMU, flash. ChipCommon core has several memory regions. - * - * ChipCommon driver has memory resource manager. Driver - * gets information about BHND core ports/regions and map them - * into drivers' resources. - * - * Here is overview of mapping: - * - * ------------------------------------------------------ - * | Port.Region| Purpose | - * ------------------------------------------------------ - * | 0.0 | PMU, SPI(0x40), UART(0x300) | - * | 1.0 | ? | - * | 1.1 | MMIO flash (SPI & CFI) | - * ------------------------------------------------------ + * identification, bus enumeration, UARTs, clocks, watchdog interrupts, + * GPIO, flash, etc. */ #include @@ -76,6 +59,7 @@ __FBSDID("$FreeBSD$"); #include "chipcreg.h" #include "chipcvar.h" + #include "chipc_private.h" devclass_t bhnd_chipc_devclass; /**< bhnd(4) chipcommon device class */ @@ -123,49 +107,10 @@ static struct bhnd_device_quirk chipc_qu BHND_DEVICE_QUIRK_END }; +// FIXME: IRQ shouldn't be hard-coded +#define CHIPC_MIPS_IRQ 2 -/* - * Here is resource configuration hints for child devices - * - * [Flash] There are 2 flash resources: - * - resource ID (rid) = 0: memory-mapped flash memory - * - resource ID (rid) = 1: memory-mapped flash registers (i.e for SPI) - * - * [UART] Uses IRQ and memory resources: - * - resource ID (rid) = 0: memory-mapped registers - * - IRQ resource ID (rid) = 0: shared IRQ line for Tx/Rx. - */ - -static const struct chipc_hint { - const char *name; - int unit; - int type; - int rid; - rman_res_t base; /* relative to parent resource */ - rman_res_t size; - u_int port; /* ignored if SYS_RES_IRQ */ - u_int region; -} chipc_hints[] = { - // FIXME: cfg/spi port1.1 mapping on siba(4) SoCs - // FIXME: IRQ shouldn't be hardcoded - /* device unit type rid base size port,region */ - { "bhnd_nvram", 0, SYS_RES_MEMORY, 0, CHIPC_SPROM_OTP, CHIPC_SPROM_OTP_SIZE, 0,0 }, - { "uart", 0, SYS_RES_MEMORY, 0, CHIPC_UART0_BASE, CHIPC_UART_SIZE, 0,0 }, - { "uart", 0, SYS_RES_IRQ, 0, 2, 1 }, - { "uart", 1, SYS_RES_MEMORY, 0, CHIPC_UART1_BASE, CHIPC_UART_SIZE, 0,0 }, - { "uart", 1, SYS_RES_IRQ, 0, 2, 1 }, - { "spi", 0, SYS_RES_MEMORY, 0, 0, RM_MAX_END, 1,1 }, - { "spi", 0, SYS_RES_MEMORY, 1, CHIPC_SFLASH_BASE, CHIPC_SFLASH_SIZE, 0,0 }, - { "cfi", 0, SYS_RES_MEMORY, 0, 0, RM_MAX_END, 1,1}, - { "cfi", 0, SYS_RES_MEMORY, 1, CHIPC_SFLASH_BASE, CHIPC_SFLASH_SIZE, 0,0 }, - { NULL } -}; - - -static int chipc_try_activate_resource( - struct chipc_softc *sc, device_t child, - int type, int rid, struct resource *r, - bool req_direct); +static int chipc_add_children(struct chipc_softc *sc); static bhnd_nvram_src chipc_find_nvram_src(struct chipc_softc *sc, struct chipc_caps *caps); @@ -175,6 +120,11 @@ static int chipc_read_caps(struct chi static bool chipc_should_enable_sprom( struct chipc_softc *sc); +static int chipc_try_activate_resource( + struct chipc_softc *sc, device_t child, + int type, int rid, struct resource *r, + bool req_direct); + static int chipc_init_rman(struct chipc_softc *sc); static void chipc_free_rman(struct chipc_softc *sc); static struct rman *chipc_get_rman(struct chipc_softc *sc, @@ -210,9 +160,6 @@ static int chipc_attach(device_t dev) { struct chipc_softc *sc; - bhnd_addr_t enum_addr; - uint32_t ccid_reg; - uint8_t chip_type; int error; sc = device_get_softc(dev); @@ -231,7 +178,7 @@ chipc_attach(device_t dev) goto failed; } - /* Allocate the region containing our core registers */ + /* Allocate the region containing the chipc register block */ if ((sc->core_region = chipc_find_region_by_rid(sc, 0)) == NULL) { error = ENXIO; goto failed; @@ -242,30 +189,10 @@ chipc_attach(device_t dev) if (error) { sc->core_region = NULL; goto failed; - } else { - sc->core = sc->core_region->cr_res; } - /* Fetch our chipset identification data */ - ccid_reg = bhnd_bus_read_4(sc->core, CHIPC_ID); - chip_type = CHIPC_GET_BITS(ccid_reg, CHIPC_ID_BUS); - - switch (chip_type) { - case BHND_CHIPTYPE_SIBA: - /* enumeration space starts at the ChipCommon register base. */ - enum_addr = rman_get_start(sc->core->res); - break; - case BHND_CHIPTYPE_BCMA: - case BHND_CHIPTYPE_BCMA_ALT: - enum_addr = bhnd_bus_read_4(sc->core, CHIPC_EROMPTR); - break; - default: - device_printf(dev, "unsupported chip type %hhu\n", chip_type); - error = ENODEV; - goto failed; - } - - sc->ccid = bhnd_parse_chipid(ccid_reg, enum_addr); + /* Save a direct reference to our chipc registers */ + sc->core = sc->core_region->cr_res; /* Fetch and parse capability register(s) */ if ((error = chipc_read_caps(sc, &sc->caps))) @@ -274,8 +201,10 @@ chipc_attach(device_t dev) if (bootverbose) chipc_print_caps(sc->dev, &sc->caps); - /* Probe and attach children */ - bus_generic_probe(dev); + /* Attach all supported child devices */ + if ((error = chipc_add_children(sc))) + goto failed; + if ((error = bus_generic_attach(dev))) goto failed; @@ -313,6 +242,119 @@ chipc_detach(device_t dev) return (0); } +static int +chipc_add_children(struct chipc_softc *sc) +{ + device_t child; + const char *flash_bus; + int error; + + /* SPROM/OTP */ + if (sc->caps.nvram_src == BHND_NVRAM_SRC_SPROM || + sc->caps.nvram_src == BHND_NVRAM_SRC_OTP) + { + child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_nvram", -1); + if (child == NULL) { + device_printf(sc->dev, "failed to add nvram device\n"); + return (ENXIO); + } + + /* Both OTP and external SPROM are mapped at CHIPC_SPROM_OTP */ + error = chipc_set_resource(sc, child, SYS_RES_MEMORY, 0, + CHIPC_SPROM_OTP, CHIPC_SPROM_OTP_SIZE, 0, 0); + if (error) + return (error); + } + +#ifdef notyet + /* + * PMU/SLOWCLK/INSTACLK + * + * On AOB ("Always on Bus") devices, a PMU core (if it exists) is + * enumerated directly by the bhnd(4) bus -- not chipc. + * + * Otherwise, we always add a PMU child device, and let the + * chipc bhnd_pmu drivers probe for it. If the core supports an + * earlier non-PMU clock/power register interface, one of the instaclk, + * powerctl, or null bhnd_pmu drivers will claim the device. + */ + if (!sc->caps.aob || (sc->caps.aob && !sc->caps.pmu)) { + child = BUS_ADD_CHILD(sc->dev, 0, "bhnd_pmu", -1); + if (child == NULL) { + device_printf(sc->dev, "failed to add pmu\n"); + return (ENXIO); + } + + /* Associate the applicable register block */ + error = 0; + if (sc->caps.pmu) { + error = chipc_set_resource(sc, child, SYS_RES_MEMORY, 0, + CHIPC_PMU, CHIPC_PMU_SIZE, 0, 0); + } else if (sc->caps.power_control) { + error = chipc_set_resource(sc, child, SYS_RES_MEMORY, 0, + CHIPC_PWRCTL, CHIPC_PWRCTL_SIZE, 0, 0); + } + + if (error) + return (error); + + } +#endif /* notyet */ + + /* All remaining devices are SoC-only */ + if (bhnd_get_attach_type(sc->dev) != BHND_ATTACH_NATIVE) + return (0); + + /* UARTs */ + for (u_int i = 0; i < min(sc->caps.num_uarts, CHIPC_UART_MAX); i++) { + child = BUS_ADD_CHILD(sc->dev, 0, "uart", -1); + if (child == NULL) { + device_printf(sc->dev, "failed to add uart%u\n", i); + return (ENXIO); + } + + /* Shared IRQ */ + error = bus_set_resource(child, SYS_RES_IRQ, 0, CHIPC_MIPS_IRQ, + 1); + if (error) { + device_printf(sc->dev, "failed to set uart%u irq %u\n", + i, CHIPC_MIPS_IRQ); + return (error); + } + + /* UART registers are mapped sequentially */ + error = chipc_set_resource(sc, child, SYS_RES_MEMORY, 0, + CHIPC_UART(i), CHIPC_UART_SIZE, 0, 0); + if (error) + return (error); + } + + /* Flash */ + flash_bus = chipc_flash_bus_name(sc->caps.flash_type); + if (flash_bus != NULL) { + child = BUS_ADD_CHILD(sc->dev, 0, flash_bus, -1); + if (child == NULL) { + device_printf(sc->dev, "failed to add %s device\n", + flash_bus); + return (ENXIO); + } + + /* flash memory mapping */ + error = chipc_set_resource(sc, child, SYS_RES_MEMORY, 0, + 0, RM_MAX_END, 1, 1); + if (error) + return (error); + + /* flashctrl registers */ + error = chipc_set_resource(sc, child, SYS_RES_MEMORY, 1, + CHIPC_SFLASH_BASE, CHIPC_SFLASH_SIZE, 0, 0); + if (error) + return (error); + } + + return (0); +} + /** * Determine the NVRAM data source for this device. * @@ -411,7 +453,6 @@ chipc_read_caps(struct chipc_softc *sc, /* Determine flash type and parameters */ caps->cfi_width = 0; - switch (CHIPC_GET_BITS(cap_reg, CHIPC_CAP_FLASH)) { case CHIPC_CAP_SFLASH_ST: caps->flash_type = CHIPC_SFLASH_ST; @@ -420,6 +461,7 @@ chipc_read_caps(struct chipc_softc *sc, caps->flash_type = CHIPC_SFLASH_AT; break; case CHIPC_CAP_NFLASH: + /* unimplemented */ caps->flash_type = CHIPC_NFLASH; break; case CHIPC_CAP_PFLASH: @@ -548,33 +590,16 @@ chipc_child_location_str(device_t dev, d static device_t chipc_add_child(device_t dev, u_int order, const char *name, int unit) { + struct chipc_softc *sc; struct chipc_devinfo *dinfo; - const struct chipc_hint *hint; device_t child; - devclass_t child_dc; - int error; - int busrel_unit; + + sc = device_get_softc(dev); child = device_add_child_ordered(dev, order, name, unit); if (child == NULL) return (NULL); - /* system-wide device unit */ - unit = device_get_unit(child); - child_dc = device_get_devclass(child); - - busrel_unit = 0; - for (int i = 0; i < unit; i++) { - device_t tmp; - - tmp = devclass_get_device(child_dc, i); - if (tmp != NULL && (device_get_parent(tmp) == dev)) - busrel_unit++; - } - - /* bus-wide device unit (override unit for further hint matching) */ - unit = busrel_unit; - dinfo = malloc(sizeof(struct chipc_devinfo), M_BHND, M_NOWAIT); if (dinfo == NULL) { device_delete_child(dev, child); @@ -584,93 +609,7 @@ chipc_add_child(device_t dev, u_int orde resource_list_init(&dinfo->resources); device_set_ivars(child, dinfo); - /* Hint matching requires a device name */ - if (name == NULL) - return (child); - - /* Use hint table to set child resources */ - for (hint = chipc_hints; hint->name != NULL; hint++) { - bhnd_addr_t region_addr; - bhnd_size_t region_size; - - /* Check device name */ - if (strcmp(hint->name, name) != 0) - continue; - - /* Check device unit */ - if (hint->unit >= 0 && unit != hint->unit) - continue; - - switch (hint->type) { - case SYS_RES_IRQ: - /* Add child resource */ - error = bus_set_resource(child, hint->type, hint->rid, - hint->base, hint->size); - if (error) { - device_printf(dev, - "bus_set_resource() failed for %s: %d\n", - device_get_nameunit(child), error); - goto failed; - } - break; - - case SYS_RES_MEMORY: - /* Fetch region address and size */ - error = bhnd_get_region_addr(dev, BHND_PORT_DEVICE, - hint->port, hint->region, ®ion_addr, - ®ion_size); - if (error) { - device_printf(dev, - "lookup of %s%u.%u failed: %d\n", - bhnd_port_type_name(BHND_PORT_DEVICE), - hint->port, hint->region, error); - goto failed; - } - - /* Verify requested range is mappable */ - if (hint->base > region_size || - (hint->size != RM_MAX_END && - (hint->size > region_size || - region_size - hint->base < hint->size ))) - { - device_printf(dev, - "%s%u.%u region cannot map requested range " - "%#jx+%#jx\n", - bhnd_port_type_name(BHND_PORT_DEVICE), - hint->port, hint->region, hint->base, - hint->size); - } - - /* - * Add child resource. If hint doesn't define the end - * of resource window (RX_MAX_END), use end of region. - */ - - error = bus_set_resource(child, - hint->type, - hint->rid, region_addr + hint->base, - (hint->size == RM_MAX_END) ? - region_size - hint->base : - hint->size); - if (error) { - device_printf(dev, - "bus_set_resource() failed for %s: %d\n", - device_get_nameunit(child), error); - goto failed; - } - break; - default: - device_printf(child, "unknown hint resource type: %d\n", - hint->type); - break; - } - } - return (child); - -failed: - device_delete_child(dev, child); - return (NULL); } static void @@ -705,7 +644,7 @@ chipc_rman_init_regions (struct chipc_so u_int num_regions; int error; - num_regions = bhnd_get_region_count(sc->dev, port, port); + num_regions = bhnd_get_region_count(sc->dev, type, port); for (u_int region = 0; region < num_regions; region++) { /* Allocate new region record */ cr = chipc_alloc_region(sc, type, port, region); @@ -1349,15 +1288,6 @@ chipc_get_caps(device_t dev) return (&sc->caps); } -static uint32_t -chipc_get_flash_cfg(device_t dev) -{ - struct chipc_softc *sc; - - sc = device_get_softc(dev); - return (bhnd_bus_read_4(sc->core, CHIPC_FLASH_CFG)); -} - static device_method_t chipc_methods[] = { /* Device interface */ DEVMETHOD(device_probe, chipc_probe), @@ -1399,7 +1329,6 @@ static device_method_t chipc_methods[] = DEVMETHOD(bhnd_chipc_enable_sprom, chipc_enable_sprom_pins), DEVMETHOD(bhnd_chipc_disable_sprom, chipc_disable_sprom_pins), DEVMETHOD(bhnd_chipc_get_caps, chipc_get_caps), - DEVMETHOD(bhnd_chipc_get_flash_cfg, chipc_get_flash_cfg), DEVMETHOD_END }; Modified: head/sys/dev/bhnd/cores/chipc/chipc_cfi.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc_cfi.c Sat Jun 25 02:09:49 2016 (r302188) +++ head/sys/dev/bhnd/cores/chipc/chipc_cfi.c Sat Jun 25 04:33:00 2016 (r302189) @@ -40,90 +40,39 @@ __FBSDID("$FreeBSD$"); #include -#include #include #include "bhnd_chipc_if.h" -#include "chipc_slicer.h" + #include "chipcreg.h" #include "chipcvar.h" - -/* - * **************************** PROTOTYPES **************************** - */ - -static void chipc_cfi_identify(driver_t *driver, device_t parent); -static int chipc_cfi_probe(device_t dev); -static int chipc_cfi_attach(device_t dev); - -/* - * **************************** IMPLEMENTATION ************************ - */ - -static void -chipc_cfi_identify(driver_t *driver, device_t parent) -{ - struct chipc_caps *caps; - - if (device_find_child(parent, cfi_driver_name, -1) != NULL) - return; - - caps = BHND_CHIPC_GET_CAPS(parent); - if (caps == NULL) - return; - - if (caps->flash_type != CHIPC_PFLASH_CFI) - return; - - BUS_ADD_CHILD(parent, 0, cfi_driver_name, -1); - return; -} +#include "chipc_slicer.h" static int chipc_cfi_probe(device_t dev) { - int error; - int enabled; - int byteswap; - uint32_t flash_config; struct cfi_softc *sc; + int error; sc = device_get_softc(dev); - flash_config = BHND_CHIPC_GET_FLASH_CFG(device_get_parent(dev)); - - enabled = (flash_config & CHIPC_CF_EN); - byteswap = (flash_config & CHIPC_CF_BS); - - if (enabled == 0) - device_disable(dev); - - BHND_DEBUG_DEV(dev, "trying attach flash enabled=%d swapbytes=%d", - enabled, byteswap); - sc->sc_width = 0; - error = cfi_probe(dev); - if (error == 0) - device_set_desc(dev, "ChipCommon CFI"); + if ((error = cfi_probe(dev)) > 0) + return (error); + + device_set_desc(dev, "Broadcom ChipCommon CFI"); return (error); } static int chipc_cfi_attach(device_t dev) { - int error; - - error = cfi_attach(dev); - if (error) - return (error); - - flash_register_slicer(chipc_slicer_cfi); - return (0); + chipc_register_slicer(CHIPC_PFLASH_CFI); + return (cfi_attach(dev)); } static device_method_t chipc_cfi_methods[] = { /* device interface */ - DEVMETHOD(device_identify, chipc_cfi_identify), DEVMETHOD(device_probe, chipc_cfi_probe), DEVMETHOD(device_attach, chipc_cfi_attach), DEVMETHOD(device_detach, cfi_detach), @@ -138,4 +87,3 @@ static driver_t chipc_cfi_driver = { }; DRIVER_MODULE(cfi, bhnd_chipc, chipc_cfi_driver, cfi_devclass, 0, 0); - Modified: head/sys/dev/bhnd/cores/chipc/chipc_private.h ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc_private.h Sat Jun 25 02:09:49 2016 (r302188) +++ head/sys/dev/bhnd/cores/chipc/chipc_private.h Sat Jun 25 04:33:00 2016 (r302189) @@ -55,6 +55,11 @@ int chipc_init_child_resource(struct struct resource *parent, bhnd_size_t offset, bhnd_size_t size); +int chipc_set_resource(struct chipc_softc *sc, + device_t child, int type, int rid, + rman_res_t start, rman_res_t count, u_int port, + u_int region); + struct chipc_region *chipc_alloc_region(struct chipc_softc *sc, bhnd_port_type type, u_int port, u_int region); Modified: head/sys/dev/bhnd/cores/chipc/chipc_slicer.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc_slicer.c Sat Jun 25 02:09:49 2016 (r302188) +++ head/sys/dev/bhnd/cores/chipc/chipc_slicer.c Sat Jun 25 04:33:00 2016 (r302189) @@ -54,58 +54,88 @@ __FBSDID("$FreeBSD$"); #include #include "chipc_spi.h" -static int chipc_slicer_walk(device_t dev, struct resource* res, +static int chipc_slicer_walk(device_t dev, struct resource *res, struct flash_slice *slices, int *nslices); +void +chipc_register_slicer(chipc_flash flash_type) +{ + switch (flash_type) { + case CHIPC_SFLASH_AT: + case CHIPC_SFLASH_ST: + flash_register_slicer(chipc_slicer_spi); + break; + case CHIPC_PFLASH_CFI: + flash_register_slicer(chipc_slicer_cfi); + break; + default: + /* Unsupported */ + break; + } +} + int chipc_slicer_cfi(device_t dev, struct flash_slice *slices, int *nslices) { struct cfi_softc *sc; + device_t parent; - if (strcmp("cfi", device_get_name(dev)) != 0) - return (0); + /* must be CFI flash */ + if (device_get_devclass(dev) != devclass_find("cfi")) + return (ENXIO); + + /* must be attached to chipc */ + if ((parent = device_get_parent(dev)) == NULL) { + BHND_ERROR_DEV(dev, "no found ChipCommon device"); + return (ENXIO); + } - sc = device_get_softc(dev); + if (device_get_devclass(parent) != devclass_find("bhnd_chipc")) { + BHND_ERROR_DEV(dev, "no found ChipCommon device"); + return (ENXIO); + } + sc = device_get_softc(dev); return (chipc_slicer_walk(dev, sc->sc_res, slices, nslices)); } int chipc_slicer_spi(device_t dev, struct flash_slice *slices, int *nslices) { - /* flash(mx25l) <- spibus <- chipc_spi */ - device_t spibus; - device_t chipc_spi; struct chipc_spi_softc *sc; + device_t chipc, spi, spibus; BHND_DEBUG_DEV(dev, "initting SPI slicer: %s", device_get_name(dev)); - if (strcmp("mx25l", device_get_name(dev)) != 0) - return (EINVAL); - + /* must be SPI-attached flash */ spibus = device_get_parent(dev); if (spibus == NULL) { BHND_ERROR_DEV(dev, "no found ChipCommon SPI BUS device"); - return (EINVAL); + return (ENXIO); } - chipc_spi = device_get_parent(spibus); - if (chipc_spi == NULL) { - BHND_ERROR_DEV(spibus, "no found ChipCommon SPI device"); - return (EINVAL); + spi = device_get_parent(spibus); + if (spi == NULL) { + BHND_ERROR_DEV(dev, "no found ChipCommon SPI device"); + return (ENXIO); } - sc = device_get_softc(chipc_spi); + chipc = device_get_parent(spi); + if (device_get_devclass(chipc) != devclass_find("bhnd_chipc")) { + BHND_ERROR_DEV(dev, "no found ChipCommon device"); + return (ENXIO); + } - return (chipc_slicer_walk(dev, sc->sc_res, slices, nslices)); + sc = device_get_softc(spi); + return (chipc_slicer_walk(dev, sc->sc_flash_res, slices, nslices)); } /* * Main processing part */ static int -chipc_slicer_walk(device_t dev, struct resource* res, - struct flash_slice *slices, int *nslices) +chipc_slicer_walk(device_t dev, struct resource *res, + struct flash_slice *slices, int *nslices) { uint32_t fw_len; uint32_t fs_ofs; Modified: head/sys/dev/bhnd/cores/chipc/chipc_slicer.h ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc_slicer.h Sat Jun 25 02:09:49 2016 (r302188) +++ head/sys/dev/bhnd/cores/chipc/chipc_slicer.h Sat Jun 25 04:33:00 2016 (r302189) @@ -34,10 +34,13 @@ #include +#include "chipcvar.h" + #define TRX_MAGIC 0x30524448 #define CFE_MAGIC 0x43464531 #define NVRAM_MAGIC 0x48534C46 +void chipc_register_slicer(chipc_flash flash_type); int chipc_slicer_spi(device_t dev, struct flash_slice *slices, int *nslices); int chipc_slicer_cfi(device_t dev, struct flash_slice *slices, Modified: head/sys/dev/bhnd/cores/chipc/chipc_spi.c ============================================================================== --- head/sys/dev/bhnd/cores/chipc/chipc_spi.c Sat Jun 25 02:09:49 2016 (r302188) +++ head/sys/dev/bhnd/cores/chipc/chipc_spi.c Sat Jun 25 04:33:00 2016 (r302189) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2016 Michael Zhilin + * Copyright (c) 2016 Landon Fuller * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -41,135 +42,134 @@ __FBSDID("$FreeBSD$"); #include #include -/* - * SPI BUS interface - */ + #include +#include "bhnd_chipc_if.h" + #include "spibus_if.h" #include "chipcreg.h" #include "chipcvar.h" -#include "chipc_spi.h" -#include "bhnd_chipc_if.h" - -/* - * Flash slicer - */ #include "chipc_slicer.h" -/* - * **************************** PROTOTYPES **************************** - */ +#include "chipc_spi.h" -static void chipc_spi_identify(driver_t *driver, device_t parent); static int chipc_spi_probe(device_t dev); static int chipc_spi_attach(device_t dev); +static int chipc_spi_detach(device_t dev); static int chipc_spi_transfer(device_t dev, device_t child, struct spi_command *cmd); static int chipc_spi_txrx(struct chipc_spi_softc *sc, uint8_t in, uint8_t* out); static int chipc_spi_wait(struct chipc_spi_softc *sc); -/* - * **************************** IMPLEMENTATION ************************ - */ +static int +chipc_spi_probe(device_t dev) +{ + device_set_desc(dev, "Broadcom ChipCommon SPI"); + return (BUS_PROBE_NOWILDCARD); +} -static void -chipc_spi_identify(driver_t *driver, device_t parent) +static int +chipc_spi_attach(device_t dev) { - struct chipc_caps *caps; - device_t spidev; - device_t spibus; - device_t flash; - char* flash_name; - int err; - - flash_name = NULL; - - if (device_find_child(parent, "spi", -1) != NULL) - return; - - caps = BHND_CHIPC_GET_CAPS(parent); - if (caps == NULL) { - BHND_ERROR_DEV(parent, "can't retrieve ChipCommon capabilities"); - return; - } + struct chipc_spi_softc *sc; + struct chipc_caps *ccaps; + device_t flash_dev; + device_t spibus; + const char *flash_name; + int error; - switch (caps->flash_type) { - case CHIPC_SFLASH_AT: - flash_name = "at45d"; - break; - case CHIPC_SFLASH_ST: - flash_name = "mx25l"; - break; - default: - return; - } + sc = device_get_softc(dev); - spidev = BUS_ADD_CHILD(parent, 0, "spi", -1); - if (spidev == NULL) { - BHND_ERROR_DEV(parent, "can't add chipc_spi to ChipCommon"); - return; + /* Allocate SPI controller registers */ + sc->sc_rid = 1; + sc->sc_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->sc_rid, + RF_ACTIVE); + if (sc->sc_res == NULL) { + device_printf(dev, "failed to allocate device registers\n"); + return (ENXIO); } - err = device_probe_and_attach(spidev); - if (err) { - BHND_ERROR_DEV(spidev, "failed attach chipc_spi: %d", err); - return; + /* Allocate flash shadow region */ + sc->sc_flash_rid = 0; + sc->sc_flash_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->sc_flash_rid, RF_ACTIVE); + if (sc->sc_flash_res == NULL) { + device_printf(dev, "failed to allocate flash region\n"); + error = ENXIO; + goto failed; } - spibus = device_find_child(spidev, "spibus", -1); - if (spibus == NULL) { - BHND_ERROR_DEV(spidev, "can't find spibus under chipc_spi"); - return; + /* + * Add flash device + * + * XXX: This should be replaced with a DEVICE_IDENTIFY implementation + * in chipc-specific subclasses of the mx25l and at45d drivers. + */ + if ((spibus = device_add_child(dev, "spibus", -1)) == NULL) { + device_printf(dev, "failed to add spibus\n"); + error = ENXIO; + goto failed; } - flash = BUS_ADD_CHILD(spibus, 0, flash_name, -1); - if (flash == NULL) { - BHND_ERROR_DEV(spibus, "can't add %s to spibus", flash_name); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Jun 25 04:34:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6B7BB73C5D; Sat, 25 Jun 2016 04:34:56 +0000 (UTC) (envelope-from landonf@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 825D11A22; Sat, 25 Jun 2016 04:34:56 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5P4Yt2b050570; Sat, 25 Jun 2016 04:34:55 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5P4YsKN050557; Sat, 25 Jun 2016 04:34:54 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201606250434.u5P4YsKN050557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 25 Jun 2016 04:34:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302190 - in head/sys/mips: atheros broadcom conf sentry5 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 04:34:56 -0000 Author: landonf Date: Sat Jun 25 04:34:54 2016 New Revision: 302190 URL: https://svnweb.freebsd.org/changeset/base/302190 Log: Replace mips/sentry5 with mips/broadcom The delta between SENTRY5 and BCM was already small due to BCM being derived from SENTRY5; re-integrating the two avoids the maintenance overhead of keeping them both in sync with bhnd(4) changes. - Re-integrate minor SENTRY5 deltas in bcm_machdep.c - Modify uart_cpu_chipc to allow specifying UART debug/console flags via kenv and device hints. - Switch SENTRY5 to std.broadcom - Enabled CFI flash support for SENTRY5 Reviewed by: Michael Zhilin (Broadcom MIPS support) Approved by: re (gjb), adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6897 Deleted: head/sys/mips/sentry5/files.sentry5 head/sys/mips/sentry5/obio.c head/sys/mips/sentry5/obiovar.h head/sys/mips/sentry5/s5_machdep.c head/sys/mips/sentry5/s5reg.h head/sys/mips/sentry5/std.sentry5 head/sys/mips/sentry5/uart_bus_sbusart.c head/sys/mips/sentry5/uart_cpu_sbusart.c Modified: head/sys/mips/atheros/ar71xx_chip.c head/sys/mips/atheros/ar71xx_machdep.c head/sys/mips/atheros/ar724x_chip.c head/sys/mips/atheros/ar91xx_chip.c head/sys/mips/broadcom/bcm_machdep.c head/sys/mips/broadcom/bcm_socinfo.c head/sys/mips/broadcom/bcm_socinfo.h head/sys/mips/broadcom/std.broadcom head/sys/mips/broadcom/uart_cpu_chipc.c head/sys/mips/conf/BCM head/sys/mips/conf/BCM.hints head/sys/mips/conf/SENTRY5 head/sys/mips/conf/SENTRY5.hints Modified: head/sys/mips/atheros/ar71xx_chip.c ============================================================================== --- head/sys/mips/atheros/ar71xx_chip.c Sat Jun 25 04:33:00 2016 (r302189) +++ head/sys/mips/atheros/ar71xx_chip.c Sat Jun 25 04:34:54 2016 (r302190) @@ -55,8 +55,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - /* XXX these should replace the current definitions in ar71xxreg.h */ /* XXX perhaps an ar71xx_chip.h header file? */ #define AR71XX_PLL_REG_CPU_CONFIG AR71XX_PLL_CPU_BASE + 0x00 Modified: head/sys/mips/atheros/ar71xx_machdep.c ============================================================================== --- head/sys/mips/atheros/ar71xx_machdep.c Sat Jun 25 04:33:00 2016 (r302189) +++ head/sys/mips/atheros/ar71xx_machdep.c Sat Jun 25 04:34:54 2016 (r302190) @@ -58,8 +58,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - extern char edata[], end[]; /* 4KB static data aread to keep a copy of the bootload env until Modified: head/sys/mips/atheros/ar724x_chip.c ============================================================================== --- head/sys/mips/atheros/ar724x_chip.c Sat Jun 25 04:33:00 2016 (r302189) +++ head/sys/mips/atheros/ar724x_chip.c Sat Jun 25 04:34:54 2016 (r302190) @@ -59,8 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - static void ar724x_chip_detect_mem_size(void) { Modified: head/sys/mips/atheros/ar91xx_chip.c ============================================================================== --- head/sys/mips/atheros/ar91xx_chip.c Sat Jun 25 04:33:00 2016 (r302189) +++ head/sys/mips/atheros/ar91xx_chip.c Sat Jun 25 04:34:54 2016 (r302190) @@ -57,8 +57,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - static void ar91xx_chip_detect_mem_size(void) { Modified: head/sys/mips/broadcom/bcm_machdep.c ============================================================================== --- head/sys/mips/broadcom/bcm_machdep.c Sat Jun 25 04:33:00 2016 (r302189) +++ head/sys/mips/broadcom/bcm_machdep.c Sat Jun 25 04:34:54 2016 (r302190) @@ -71,7 +71,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include "bcm_socinfo.h" #ifdef CFE @@ -79,7 +78,9 @@ __FBSDID("$FreeBSD$"); #endif #if 0 -#define BROADCOM_TRACE 0 +#define BCM_TRACE(_fmt, ...) printf(_fmt, ##__VA_ARGS__) +#else +#define BCM_TRACE(_fmt, ...) #endif extern int *edata; @@ -109,16 +110,12 @@ mips_init(void) result = cfe_enummem(i / 2, 0, &addr, &len, &type); if (result < 0) { -#ifdef BROADCOM_TRACE - printf("There is no phys memory for: %d\n", i); -#endif + BCM_TRACE("There is no phys memory for: %d\n", i); phys_avail[i] = phys_avail[i + 1] = 0; break; } - if (type != CFE_MI_AVAILABLE){ -#ifdef BROADCOM_TRACE - printf("phys memory is not available: %d\n", i); -#endif + if (type != CFE_MI_AVAILABLE) { + BCM_TRACE("phys memory is not available: %d\n", i); continue; } @@ -131,19 +128,16 @@ mips_init(void) */ phys_avail[i] += MIPS_KSEG0_TO_PHYS(kernel_kseg0_end); } -#ifdef BROADCOM_TRACE - printf("phys memory is available for: %d\n", i); - printf(" => addr = %jx\n", addr); - printf(" => len = %jd\n", len); -#endif + + BCM_TRACE("phys memory is available for: %d\n", i); + BCM_TRACE(" => addr = %jx\n", addr); + BCM_TRACE(" => len = %jd\n", len); + phys_avail[i + 1] = addr + len; physmem += len; } -#ifdef BROADCOM_TRACE - printf("Total phys memory is : %ld\n", physmem); -#endif - + BCM_TRACE("Total phys memory is : %ld\n", physmem); realmem = btoc(physmem); #endif @@ -165,15 +159,25 @@ mips_init(void) #endif } -#define BCM_REG_CHIPC 0x18000000 - - void platform_reset(void) { printf("bcm::platform_reset()\n"); intr_disable(); + +#if defined(CFE) + cfe_exit(0, 0); +#else + /* PMU watchdog reset */ BCM_WRITE_REG32(BCM_REG_CHIPC_PMUWD_OFFS, 2); /* PMU watchdog */ +#endif + +#if 0 + /* Non-PMU reset + * XXX: Need chipc capability flags */ + *((volatile uint8_t *)MIPS_PHYS_TO_KSEG1(SENTRY5_EXTIFADR)) = 0x80; +#endif + for (;;); } @@ -194,6 +198,37 @@ platform_start(__register_t a0, __regist /* Initialize pcpu stuff */ mips_pcpu0_init(); +#if 0 + /* + * Probe the Broadcom on-chip PLL clock registers + * and discover the CPU pipeline clock and bus clock + * multipliers from this. + * XXX: Wrong place. You have to ask the ChipCommon + * or External Interface cores on the SiBa. + */ + uint32_t busmult, cpumult, refclock, clkcfg1; +#define S5_CLKCFG1_REFCLOCK_MASK 0x0000001F +#define S5_CLKCFG1_BUSMULT_MASK 0x000003E0 +#define S5_CLKCFG1_BUSMULT_SHIFT 5 +#define S5_CLKCFG1_CPUMULT_MASK 0xFFFFFC00 +#define S5_CLKCFG1_CPUMULT_SHIFT 10 + + counter_freq = 100000000; /* XXX */ + + clkcfg1 = s5_rd_clkcfg1(); + printf("clkcfg1 = 0x%08x\n", clkcfg1); + + refclock = clkcfg1 & 0x1F; + busmult = ((clkcfg1 & 0x000003E0) >> 5) + 1; + cpumult = ((clkcfg1 & 0xFFFFFC00) >> 10) + 1; + + printf("refclock = %u\n", refclock); + printf("busmult = %u\n", busmult); + printf("cpumult = %u\n", cpumult); + + counter_freq = cpumult * refclock; +#endif + socinfo = bcm_get_socinfo(); platform_counter_freq = socinfo->cpurate * 1000 * 1000; /* BCM4718 is 480MHz */ @@ -212,10 +247,10 @@ platform_start(__register_t a0, __regist if (a3 == CFE_EPTSEAL) cfe_init(a0, a2); #endif + cninit(); mips_init(); - /* BCM471x timer is 1/2 of Clk */ - mips_timer_init_params(platform_counter_freq, 1); + mips_timer_init_params(platform_counter_freq, socinfo->double_count); } Modified: head/sys/mips/broadcom/bcm_socinfo.c ============================================================================== --- head/sys/mips/broadcom/bcm_socinfo.c Sat Jun 25 04:33:00 2016 (r302189) +++ head/sys/mips/broadcom/bcm_socinfo.c Sat Jun 25 04:34:54 2016 (r302190) @@ -33,22 +33,23 @@ __FBSDID("$FreeBSD$"); /* found on https://wireless.wiki.kernel.org/en/users/drivers/b43/soc */ struct bcm_socinfo bcm_socinfos[] = { - {0x00005300, 600, 25000000}, /* BCM4706 to check */ - {0x0022B83A, 300, 20000000}, /* BCM4716B0 ASUS RT-N12 */ - {0x00914716, 354, 20000000}, /* BCM4717A1 to check */ - {0x00A14716, 480, 20000000}, /* BCM4718A1 ASUS RT-N16 */ - {0x00435356, 300, 25000000}, /* BCM5356A1 (RT-N10, WNR1000v3) */ - {0x00825357, 500, 20000000}, /* BCM5358UB0 ASUS RT-N53A1 */ - {0x00845357, 300, 20000000}, /* BCM5357B0 to check */ - {0x00945357, 500, 20000000}, /* BCM5358 */ - {0x00A45357, 500, 20000000}, /* BCM47186B0 Tenda N60 */ - {0x0085D144, 300, 20000000}, /* BCM5356C0 */ - {0x00B5D144, 300, 20000000}, /* BCM5357C0 */ + {0x00005300, 600, 25000000, 1}, /* BCM4706 to check */ + {0x0022B83A, 300, 20000000, 1}, /* BCM4716B0 ASUS RT-N12 */ + {0x00914716, 354, 20000000, 1}, /* BCM4717A1 to check */ + {0x00A14716, 480, 20000000, 1}, /* BCM4718A1 ASUS RT-N16 */ + {0x00435356, 300, 25000000, 1}, /* BCM5356A1 (RT-N10, WNR1000v3) */ + {0x00825357, 500, 20000000, 1}, /* BCM5358UB0 ASUS RT-N53A1 */ + {0x00845357, 300, 20000000, 1}, /* BCM5357B0 to check */ + {0x00945357, 500, 20000000, 1}, /* BCM5358 */ + {0x00A45357, 500, 20000000, 1}, /* BCM47186B0 Tenda N60 */ + {0x0085D144, 300, 20000000, 1}, /* BCM5356C0 */ + {0x00B5D144, 300, 20000000, 1}, /* BCM5357C0 */ + {0x00015365, 200, 0, 1}, /* BCM5365 */ {0,0,0} }; /* Most popular BCM SoC info */ -struct bcm_socinfo BCM_DEFAULT_SOCINFO = {0x0, 300, 20000000}; +struct bcm_socinfo BCM_DEFAULT_SOCINFO = {0x0, 300, 20000000, 0}; struct bcm_socinfo* bcm_get_socinfo_by_socid(uint32_t key) Modified: head/sys/mips/broadcom/bcm_socinfo.h ============================================================================== --- head/sys/mips/broadcom/bcm_socinfo.h Sat Jun 25 04:33:00 2016 (r302189) +++ head/sys/mips/broadcom/bcm_socinfo.h Sat Jun 25 04:34:54 2016 (r302190) @@ -35,9 +35,10 @@ #include struct bcm_socinfo { - uint32_t id; - uint32_t cpurate; /* in MHz */ - uint32_t uartrate; /* in Hz */ + uint32_t id; + uint32_t cpurate; /* in MHz */ + uint32_t uartrate; /* in Hz */ + int double_count; }; struct bcm_socinfo* bcm_get_socinfo_by_socid(uint32_t key); Modified: head/sys/mips/broadcom/std.broadcom ============================================================================== --- head/sys/mips/broadcom/std.broadcom Sat Jun 25 04:33:00 2016 (r302189) +++ head/sys/mips/broadcom/std.broadcom Sat Jun 25 04:34:54 2016 (r302190) @@ -3,5 +3,7 @@ machine mips mipsel -cpu CPU_MIPS74K +makeoptions INTRNG +options INTRNG + files "../broadcom/files.broadcom" Modified: head/sys/mips/broadcom/uart_cpu_chipc.c ============================================================================== --- head/sys/mips/broadcom/uart_cpu_chipc.c Sat Jun 25 04:33:00 2016 (r302189) +++ head/sys/mips/broadcom/uart_cpu_chipc.c Sat Jun 25 04:34:54 2016 (r302190) @@ -39,6 +39,8 @@ __FBSDID("$FreeBSD$"); #include +#include + #include #include #include @@ -48,31 +50,74 @@ __FBSDID("$FreeBSD$"); bus_space_tag_t uart_bus_space_io; bus_space_tag_t uart_bus_space_mem; +static struct uart_class *chipc_uart_class = &uart_ns8250_class; + +#define CHIPC_UART_BAUDRATE 115200 + int uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) { return ((b1->bsh == b2->bsh && b1->bst == b2->bst) ? 1 : 0); } -int -uart_cpu_getdev(int devtype, struct uart_devinfo *di) +static int +uart_cpu_init(struct uart_devinfo *di, int uart, int baudrate) { - struct uart_class *class; struct bcm_socinfo *socinfo; + if (uart >= CHIPC_UART_MAX) + return (EINVAL); + socinfo = bcm_get_socinfo(); - class = &uart_ns8250_class; - di->ops = uart_getops(class); + di->ops = uart_getops(chipc_uart_class); di->bas.chan = 0; - di->bas.bst = mips_bus_space_generic; - di->bas.bsh = (bus_space_handle_t)BCM_SOCREG(BCM_REG_CHIPC_UART); + di->bas.bst = uart_bus_space_mem; + di->bas.bsh = (bus_space_handle_t) BCM_SOCREG(CHIPC_UART(uart)); di->bas.regshft = 0; di->bas.rclk = socinfo->uartrate; /* in Hz */ - di->baudrate = 115200; + di->baudrate = baudrate; di->databits = 8; di->stopbits = 1; di->parity = UART_PARITY_NONE; + + return (0); +} + +int +uart_cpu_getdev(int devtype, struct uart_devinfo *di) +{ + int ivar; + uart_bus_space_io = NULL; uart_bus_space_mem = mips_bus_space_generic; - return (0); + + /* Check the environment. */ + if (uart_getenv(devtype, di, chipc_uart_class) == 0) + return (0); + + /* Scan the device hints for the first matching device */ + for (int i = 0; i < CHIPC_UART_MAX; i++) { + if (resource_int_value("uart", i, "flags", &ivar)) + continue; + + /* Check usability */ + if (devtype == UART_DEV_CONSOLE && !UART_FLAGS_CONSOLE(ivar)) + continue; + + if (devtype == UART_DEV_DBGPORT && !UART_FLAGS_DBGPORT(ivar)) + continue; + + if (resource_int_value("uart", i, "disabled", &ivar) == 0 && + ivar == 0) + continue; + + /* Found */ + if (resource_int_value("uart", i, "baud", &ivar) != 0) + ivar = CHIPC_UART_BAUDRATE; + + return (uart_cpu_init(di, i, ivar)); + } + + /* Default to uart0/115200 */ + return (uart_cpu_init(di, 0, CHIPC_UART_BAUDRATE)); } Modified: head/sys/mips/conf/BCM ============================================================================== --- head/sys/mips/conf/BCM Sat Jun 25 04:33:00 2016 (r302189) +++ head/sys/mips/conf/BCM Sat Jun 25 04:34:54 2016 (r302190) @@ -6,6 +6,7 @@ # ident BCM +cpu CPU_MIPS74K hints "BCM.hints" include "../broadcom/std.broadcom" @@ -16,9 +17,6 @@ options ALT_BREAK_TO_DEBUGGER options BREAK_TO_DEBUGGER options BOOTVERBOSE=0 -makeoptions INTRNG -options INTRNG - makeoptions TRAMPLOADADDR=0x80800000 makeoptions DEBUG="-g3" #Build kernel with gdb(1) debug symbols makeoptions MODULES_OVERRIDE="" Modified: head/sys/mips/conf/BCM.hints ============================================================================== --- head/sys/mips/conf/BCM.hints Sat Jun 25 04:33:00 2016 (r302189) +++ head/sys/mips/conf/BCM.hints Sat Jun 25 04:34:54 2016 (r302190) @@ -2,4 +2,3 @@ hint.bhnd.0.at="nexus0" hint.bhnd.0.maddr="0x18000000" hint.bhnd.0.msize="0x00100000" - Modified: head/sys/mips/conf/SENTRY5 ============================================================================== --- head/sys/mips/conf/SENTRY5 Sat Jun 25 04:33:00 2016 (r302189) +++ head/sys/mips/conf/SENTRY5 Sat Jun 25 04:34:54 2016 (r302190) @@ -25,11 +25,11 @@ # ident SENTRY5 +cpu CPU_MIPS4KC +makeoptions TRAMPLOADADDR=0x807963c0 -# XXX only siba should be hardwired for now; we will use -# bus enumeration there hints "SENTRY5.hints" -include "../sentry5/std.sentry5" +include "../broadcom/std.broadcom" # sentry5 normally ships with cfe firmware; use the console for now options CFE @@ -78,11 +78,10 @@ device usb # USB Bus (required) device uhci # UHCI PCI->USB interface device ehci # EHCI PCI->USB interface (USB 2.0) -# need to teach the code to ignore the bridge.... +device cfi # parallel flash +device cfid - -# XXX notyet; need to be auto probed children of siba_cc. -#device uart +device uart device loop device ether Modified: head/sys/mips/conf/SENTRY5.hints ============================================================================== --- head/sys/mips/conf/SENTRY5.hints Sat Jun 25 04:33:00 2016 (r302189) +++ head/sys/mips/conf/SENTRY5.hints Sat Jun 25 04:34:54 2016 (r302190) @@ -1,5 +1,7 @@ # $FreeBSD$ hint.bhnd.0.at="nexus0" -hint.bhnd.0.maddr="0x18000000" -hint.bhnd.0.msize="0x1000" -# XXX irq? +hint.bhnd.0.maddr="0x18000000" +hint.bhnd.0.msize="0x00100000" + +# console on uart1 +hint.uart.1.flags="0x10" From owner-svn-src-head@freebsd.org Sat Jun 25 04:36:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01FD6B73D45; Sat, 25 Jun 2016 04:36:32 +0000 (UTC) (envelope-from landonf@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 BFDF11C6D; Sat, 25 Jun 2016 04:36:31 +0000 (UTC) (envelope-from landonf@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5P4aVnE050685; Sat, 25 Jun 2016 04:36:31 GMT (envelope-from landonf@FreeBSD.org) Received: (from landonf@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5P4aUWT050676; Sat, 25 Jun 2016 04:36:30 GMT (envelope-from landonf@FreeBSD.org) Message-Id: <201606250436.u5P4aUWT050676@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: landonf set sender to landonf@FreeBSD.org using -f From: "Landon J. Fuller" Date: Sat, 25 Jun 2016 04:36:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302191 - in head/sys/dev/bhnd: . bcma siba X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 04:36:32 -0000 Author: landonf Date: Sat Jun 25 04:36:30 2016 New Revision: 302191 URL: https://svnweb.freebsd.org/changeset/base/302191 Log: bhnd(4): Add devinfo allocation and child addition methods, modeled on pci_if. This allows bhnd(4) to manage per-device state (such as per-core pmu/clock refcounting) on behalf of subclass driver instances. Approved by: re (gjb), adrian (mentor) Differential Revision: https://reviews.freebsd.org/D6959 Modified: head/sys/dev/bhnd/bcma/bcma.c head/sys/dev/bhnd/bcma/bcma_subr.c head/sys/dev/bhnd/bcma/bcmavar.h head/sys/dev/bhnd/bhnd.c head/sys/dev/bhnd/bhnd_bus_if.m head/sys/dev/bhnd/bhndvar.h head/sys/dev/bhnd/siba/siba.c head/sys/dev/bhnd/siba/siba_subr.c head/sys/dev/bhnd/siba/sibavar.h Modified: head/sys/dev/bhnd/bcma/bcma.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma.c Sat Jun 25 04:34:54 2016 (r302190) +++ head/sys/dev/bhnd/bcma/bcma.c Sat Jun 25 04:36:30 2016 (r302191) @@ -181,14 +181,6 @@ bcma_write_ivar(device_t dev, device_t c } } -static void -bcma_child_deleted(device_t dev, device_t child) -{ - struct bcma_devinfo *dinfo = device_get_ivars(child); - if (dinfo != NULL) - bcma_free_dinfo(dev, dinfo); -} - static struct resource_list * bcma_get_resource_list(device_t dev, device_t child) { @@ -415,6 +407,19 @@ bcma_get_region_addr(device_t dev, devic return (ENOENT); } +static struct bhnd_devinfo * +bcma_alloc_bhnd_dinfo(device_t dev) +{ + struct bcma_devinfo *dinfo = bcma_alloc_dinfo(dev); + return ((struct bhnd_devinfo *)dinfo); +} + +static void +bcma_free_bhnd_dinfo(device_t dev, struct bhnd_devinfo *dinfo) +{ + bcma_free_dinfo(dev, (struct bcma_devinfo *)dinfo); +} + /** * Scan a device enumeration ROM table, adding all valid discovered cores to * the bus. @@ -431,8 +436,7 @@ bcma_add_children(device_t bus, struct r struct bcma_devinfo *dinfo; device_t child; int error; - - dinfo = NULL; + corecfg = NULL; /* Initialize our reader */ @@ -450,26 +454,20 @@ bcma_add_children(device_t bus, struct r goto failed; } - /* Allocate per-device bus info */ - dinfo = bcma_alloc_dinfo(bus, corecfg); - if (dinfo == NULL) { - error = ENXIO; - goto failed; - } - - /* The dinfo instance now owns the corecfg value */ - corecfg = NULL; - /* Add the child device */ - child = device_add_child(bus, NULL, -1); + child = BUS_ADD_CHILD(bus, 0, NULL, -1); if (child == NULL) { error = ENXIO; goto failed; } - /* The child device now owns the dinfo pointer */ - device_set_ivars(child, dinfo); - dinfo = NULL; + /* Initialize device ivars */ + dinfo = device_get_ivars(child); + if ((error = bcma_init_dinfo(bus, dinfo, corecfg))) + goto failed; + + /* The dinfo instance now owns the corecfg value */ + corecfg = NULL; /* If pins are floating or the hardware is otherwise * unpopulated, the device shouldn't be used. */ @@ -482,9 +480,6 @@ bcma_add_children(device_t bus, struct r return (0); failed: - if (dinfo != NULL) - bcma_free_dinfo(bus, dinfo); - if (corecfg != NULL) bcma_free_corecfg(corecfg); @@ -499,13 +494,14 @@ static device_method_t bcma_methods[] = DEVMETHOD(device_detach, bcma_detach), /* Bus interface */ - DEVMETHOD(bus_child_deleted, bcma_child_deleted), DEVMETHOD(bus_read_ivar, bcma_read_ivar), DEVMETHOD(bus_write_ivar, bcma_write_ivar), DEVMETHOD(bus_get_resource_list, bcma_get_resource_list), /* BHND interface */ DEVMETHOD(bhnd_bus_find_hostb_device, bcma_find_hostb_device), + DEVMETHOD(bhnd_bus_alloc_devinfo, bcma_alloc_bhnd_dinfo), + DEVMETHOD(bhnd_bus_free_devinfo, bcma_free_bhnd_dinfo), DEVMETHOD(bhnd_bus_reset_core, bcma_reset_core), DEVMETHOD(bhnd_bus_suspend_core, bcma_suspend_core), DEVMETHOD(bhnd_bus_get_port_count, bcma_get_port_count), Modified: head/sys/dev/bhnd/bcma/bcma_subr.c ============================================================================== --- head/sys/dev/bhnd/bcma/bcma_subr.c Sat Jun 25 04:34:54 2016 (r302190) +++ head/sys/dev/bhnd/bcma/bcma_subr.c Sat Jun 25 04:36:30 2016 (r302191) @@ -186,28 +186,54 @@ bcma_dinfo_init_resource_info(device_t b } } + /** - * Allocate and initialize new device info structure, assuming ownership - * of the provided core configuration. + * Allocate and return a new empty device info structure. * * @param bus The requesting bus device. - * @param corecfg Device core configuration. + * + * @retval NULL if allocation failed. */ struct bcma_devinfo * -bcma_alloc_dinfo(device_t bus, struct bcma_corecfg *corecfg) +bcma_alloc_dinfo(device_t bus) { struct bcma_devinfo *dinfo; - dinfo = malloc(sizeof(struct bcma_devinfo), M_BHND, M_NOWAIT); + dinfo = malloc(sizeof(struct bcma_devinfo), M_BHND, M_NOWAIT|M_ZERO); if (dinfo == NULL) - return NULL; + return (NULL); - dinfo->corecfg = corecfg; + dinfo->corecfg = NULL; dinfo->res_agent = NULL; dinfo->rid_agent = -1; resource_list_init(&dinfo->resources); + return (dinfo); +} + +/** + * Initialize a device info structure previously allocated via + * bcma_alloc_dinfo, assuming ownership of the provided core + * configuration. + * + * @param bus The requesting bus device. + * @param dinfo The device info instance. + * @param corecfg Device core configuration; ownership of this value + * will be assumed by @p dinfo. + * + * @retval 0 success + * @retval non-zero initialization failed. + */ +int +bcma_init_dinfo(device_t bus, struct bcma_devinfo *dinfo, + struct bcma_corecfg *corecfg) +{ + KASSERT(dinfo->corecfg == NULL, ("dinfo previously initialized")); + + /* Save core configuration value */ + dinfo->corecfg = corecfg; + /* The device ports must always be initialized first to ensure that * rid 0 maps to the first device port */ bcma_dinfo_init_resource_info(bus, dinfo, &corecfg->dev_ports); @@ -215,7 +241,7 @@ bcma_alloc_dinfo(device_t bus, struct bc bcma_dinfo_init_resource_info(bus, dinfo, &corecfg->bridge_ports); bcma_dinfo_init_resource_info(bus, dinfo, &corecfg->wrapper_ports); - return dinfo; + return (0); } /** @@ -227,9 +253,11 @@ bcma_alloc_dinfo(device_t bus, struct bc void bcma_free_dinfo(device_t bus, struct bcma_devinfo *dinfo) { - bcma_free_corecfg(dinfo->corecfg); resource_list_free(&dinfo->resources); + if (dinfo->corecfg != NULL) + bcma_free_corecfg(dinfo->corecfg); + /* Release agent resource, if any */ if (dinfo->res_agent != NULL) { bhnd_release_resource(bus, SYS_RES_MEMORY, dinfo->rid_agent, Modified: head/sys/dev/bhnd/bcma/bcmavar.h ============================================================================== --- head/sys/dev/bhnd/bcma/bcmavar.h Sat Jun 25 04:34:54 2016 (r302190) +++ head/sys/dev/bhnd/bcma/bcmavar.h Sat Jun 25 04:36:30 2016 (r302191) @@ -69,7 +69,9 @@ int bcma_add_children(device_t bus, struct bcma_sport_list *bcma_corecfg_get_port_list(struct bcma_corecfg *cfg, bhnd_port_type type); -struct bcma_devinfo *bcma_alloc_dinfo(device_t bus, +struct bcma_devinfo *bcma_alloc_dinfo(device_t bus); +int bcma_init_dinfo(device_t bus, + struct bcma_devinfo *dinfo, struct bcma_corecfg *corecfg); void bcma_free_dinfo(device_t bus, struct bcma_devinfo *dinfo); @@ -132,7 +134,9 @@ struct bcma_corecfg { * BCMA per-device info */ struct bcma_devinfo { - struct resource_list resources; /**< Slave port memory regions. */ + struct bhnd_devinfo bhnd_dinfo; /**< superclass device info. */ + + struct resource_list resources; /**< Slave port memory regions. */ struct bcma_corecfg *corecfg; /**< IP core/block config */ struct bhnd_resource *res_agent; /**< Agent (wrapper) resource, or NULL. Not @@ -147,4 +151,4 @@ struct bcma_softc { device_t hostb_dev; /**< host bridge core, or NULL */ }; -#endif /* _BCMA_BCMAVAR_H_ */ \ No newline at end of file +#endif /* _BCMA_BCMAVAR_H_ */ Modified: head/sys/dev/bhnd/bhnd.c ============================================================================== --- head/sys/dev/bhnd/bhnd.c Sat Jun 25 04:34:54 2016 (r302190) +++ head/sys/dev/bhnd/bhnd.c Sat Jun 25 04:36:30 2016 (r302191) @@ -493,6 +493,54 @@ bhnd_child_location_str(device_t dev, de } /** + * Default bhnd(4) bus driver implementation of BUS_ADD_CHILD(). + * + * This implementation manages internal bhnd(4) state, and must be called + * by subclassing drivers. + */ +device_t +bhnd_generic_add_child(device_t dev, u_int order, const char *name, int unit) +{ + struct bhnd_devinfo *dinfo; + device_t child; + + child = device_add_child_ordered(dev, order, name, unit); + if (child == NULL) + return (NULL); + + if ((dinfo = BHND_BUS_ALLOC_DEVINFO(dev)) == NULL) { + device_delete_child(dev, child); + return (NULL); + } + + device_set_ivars(child, dinfo); + + /* Inform concrete bus driver. */ + BHND_BUS_CHILD_ADDED(dev, child); + + return (child); +} + +/** + * Default bhnd(4) bus driver implementation of BUS_CHILD_DELETED(). + * + * This implementation manages internal bhnd(4) state, and must be called + * by subclassing drivers. + */ +void +bhnd_generic_child_deleted(device_t dev, device_t child) +{ + struct bhnd_softc *sc; + struct bhnd_devinfo *dinfo; + + sc = device_get_softc(dev); + + /* Free device info */ + if ((dinfo = device_get_ivars(child)) != NULL) + BHND_BUS_FREE_DEVINFO(dev, dinfo); +} + +/** * Helper function for implementing BUS_SUSPEND_CHILD(). * * TODO: Power management @@ -611,6 +659,8 @@ static device_method_t bhnd_methods[] = DEVMETHOD(device_resume, bhnd_generic_resume), /* Bus interface */ + DEVMETHOD(bus_add_child, bhnd_generic_add_child), + DEVMETHOD(bus_child_deleted, bhnd_generic_child_deleted), DEVMETHOD(bus_probe_nomatch, bhnd_generic_probe_nomatch), DEVMETHOD(bus_print_child, bhnd_generic_print_child), DEVMETHOD(bus_child_pnpinfo_str, bhnd_child_pnpinfo_str), Modified: head/sys/dev/bhnd/bhnd_bus_if.m ============================================================================== --- head/sys/dev/bhnd/bhnd_bus_if.m Sat Jun 25 04:34:54 2016 (r302190) +++ head/sys/dev/bhnd/bhnd_bus_if.m Sat Jun 25 04:36:30 2016 (r302191) @@ -41,6 +41,7 @@ HEADER { struct bhnd_board_info; struct bhnd_core_info; struct bhnd_chipid; + struct bhnd_devinfo; struct bhnd_resource; } @@ -67,6 +68,11 @@ CODE { { panic("bhnd_bus_read_boardinfo unimplemented"); } + + static void + bhnd_bus_null_child_added(device_t dev, device_t child) + { + } static device_t bhnd_bus_null_find_hostb_device(device_t dev) @@ -228,6 +234,46 @@ METHOD int read_board_info { } DEFAULT bhnd_bus_null_read_board_info; /** + * Allocate and zero-initialize a buffer suitably sized and aligned for a + * bhnd_devinfo structure. + * + * @param dev The bhnd bus device. + * + * @retval non-NULL success + * @retval NULL allocation failed + */ +METHOD struct bhnd_devinfo * alloc_devinfo { + device_t dev; +}; + +/** + * Release memory previously allocated for @p devinfo. + * + * @param dev The bhnd bus device. + * @param dinfo A devinfo buffer previously allocated via + * BHND_BUS_ALLOC_DEVINFO(). + */ +METHOD void free_devinfo { + device_t dev; + struct bhnd_devinfo *dinfo; +}; + +/** + * Notify a bhnd bus that a child was added. + * + * Called at the end of BUS_ADD_CHILD() to allow the concrete bhnd(4) + * driver instance to initialize any additional driver-specific state for the + * child. + * + * @param dev The bhnd bus whose child is being added. + * @param child The child added to @p dev. + */ +METHOD void child_added { + device_t dev; + device_t child; +} DEFAULT bhnd_bus_null_child_added; + +/** * Reset the device's hardware core. * * @param dev The parent of @p child. Modified: head/sys/dev/bhnd/bhndvar.h ============================================================================== --- head/sys/dev/bhnd/bhndvar.h Sat Jun 25 04:34:54 2016 (r302190) +++ head/sys/dev/bhnd/bhndvar.h Sat Jun 25 04:36:30 2016 (r302191) @@ -46,6 +46,13 @@ MALLOC_DECLARE(M_BHND); DECLARE_CLASS(bhnd_driver); /** + * bhnd per-device info. Must be first member of all subclass + * devinfo structures. + */ +struct bhnd_devinfo { +}; + +/** * bhnd driver instance state. Must be first member of all subclass * softc structures. */ @@ -66,6 +73,10 @@ int bhnd_generic_print_child(device_t void bhnd_generic_probe_nomatch(device_t dev, device_t child); +device_t bhnd_generic_add_child(device_t dev, u_int order, + const char *name, int unit); +void bhnd_generic_child_deleted(device_t dev, + device_t child); int bhnd_generic_suspend_child(device_t dev, device_t child); int bhnd_generic_resume_child(device_t dev, Modified: head/sys/dev/bhnd/siba/siba.c ============================================================================== --- head/sys/dev/bhnd/siba/siba.c Sat Jun 25 04:34:54 2016 (r302190) +++ head/sys/dev/bhnd/siba/siba.c Sat Jun 25 04:36:30 2016 (r302191) @@ -206,14 +206,6 @@ siba_write_ivar(device_t dev, device_t c } } -static void -siba_child_deleted(device_t dev, device_t child) -{ - struct siba_devinfo *dinfo = device_get_ivars(child); - if (dinfo != NULL) - siba_free_dinfo(dev, dinfo); -} - static struct resource_list * siba_get_resource_list(device_t dev, device_t child) { @@ -436,6 +428,19 @@ siba_register_addrspaces(device_t dev, s return (0); } +static struct bhnd_devinfo * +siba_alloc_bhnd_dinfo(device_t dev) +{ + struct siba_devinfo *dinfo = siba_alloc_dinfo(dev); + return ((struct bhnd_devinfo *)dinfo); +} + +static void +siba_free_bhnd_dinfo(device_t dev, struct bhnd_devinfo *dinfo) +{ + siba_free_dinfo(dev, (struct siba_devinfo *)dinfo); +} + /** * Scan the core table and add all valid discovered cores to * the bus. @@ -556,6 +561,13 @@ siba_add_children(device_t dev, const st goto cleanup; } + /* Add the child device */ + child = BUS_ADD_CHILD(dev, 0, NULL, -1); + if (child == NULL) { + error = ENXIO; + goto cleanup; + } + /* Read the core info */ idhigh = bus_read_4(r, SB0_REG_ABS(SIBA_CFG0_IDHIGH)); idlow = bus_read_4(r, SB0_REG_ABS(SIBA_CFG0_IDLOW)); @@ -570,27 +582,18 @@ siba_add_children(device_t dev, const st cores[i].unit++; } - /* Allocate per-device bus info */ - dinfo = siba_alloc_dinfo(dev, &cid); - if (dinfo == NULL) { + /* Initialize per-device bus info */ + if ((dinfo = device_get_ivars(child)) == NULL) { error = ENXIO; goto cleanup; } - /* Register the core's address space(s). */ - if ((error = siba_register_addrspaces(dev, dinfo, r))) + if ((error = siba_init_dinfo(dev, dinfo, &cid))) goto cleanup; - /* Add the child device */ - child = device_add_child(dev, NULL, -1); - if (child == NULL) { - error = ENXIO; + /* Register the core's address space(s). */ + if ((error = siba_register_addrspaces(dev, dinfo, r))) goto cleanup; - } - - /* The child device now owns the dinfo pointer */ - device_set_ivars(child, dinfo); - dinfo = NULL; /* If pins are floating or the hardware is otherwise * unpopulated, the device shouldn't be used. */ @@ -606,9 +609,6 @@ cleanup: if (cores != NULL) free(cores, M_BHND); - if (dinfo != NULL) - siba_free_dinfo(dev, dinfo); - if (r != NULL) bus_release_resource(dev, SYS_RES_MEMORY, rid, r); @@ -624,13 +624,14 @@ static device_method_t siba_methods[] = DEVMETHOD(device_suspend, siba_suspend), /* Bus interface */ - DEVMETHOD(bus_child_deleted, siba_child_deleted), DEVMETHOD(bus_read_ivar, siba_read_ivar), DEVMETHOD(bus_write_ivar, siba_write_ivar), DEVMETHOD(bus_get_resource_list, siba_get_resource_list), /* BHND interface */ DEVMETHOD(bhnd_bus_find_hostb_device, siba_find_hostb_device), + DEVMETHOD(bhnd_bus_alloc_devinfo, siba_alloc_bhnd_dinfo), + DEVMETHOD(bhnd_bus_free_devinfo, siba_free_bhnd_dinfo), DEVMETHOD(bhnd_bus_reset_core, siba_reset_core), DEVMETHOD(bhnd_bus_suspend_core, siba_suspend_core), DEVMETHOD(bhnd_bus_get_port_count, siba_get_port_count), Modified: head/sys/dev/bhnd/siba/siba_subr.c ============================================================================== --- head/sys/dev/bhnd/siba/siba_subr.c Sat Jun 25 04:34:54 2016 (r302190) +++ head/sys/dev/bhnd/siba/siba_subr.c Sat Jun 25 04:36:30 2016 (r302191) @@ -106,23 +106,21 @@ siba_parse_core_id(uint32_t idhigh, uint } /** - * Allocate and initialize new device info structure, copying the - * provided core id. + * Allocate and return a new empty device info structure. * - * @param dev The requesting bus device. - * @param core Device core info. + * @param bus The requesting bus device. + * + * @retval NULL if allocation failed. */ struct siba_devinfo * -siba_alloc_dinfo(device_t bus, const struct siba_core_id *core_id) +siba_alloc_dinfo(device_t bus) { struct siba_devinfo *dinfo; - dinfo = malloc(sizeof(struct siba_devinfo), M_BHND, M_NOWAIT); + dinfo = malloc(sizeof(struct siba_devinfo), M_BHND, M_NOWAIT|M_ZERO); if (dinfo == NULL) return NULL; - dinfo->core_id = *core_id; - for (u_int i = 0; i < nitems(dinfo->cfg); i++) { dinfo->cfg[i] = NULL; dinfo->cfg_rid[i] = -1; @@ -134,6 +132,25 @@ siba_alloc_dinfo(device_t bus, const str } /** + * Initialize a device info structure previously allocated via + * siba_alloc_dinfo, copying the provided core id. + * + * @param dev The requesting bus device. + * @param dinfo The device info instance. + * @param core Device core info. + * + * @retval 0 success + * @retval non-zero initialization failed. + */ +int +siba_init_dinfo(device_t dev, struct siba_devinfo *dinfo, + const struct siba_core_id *core_id) +{ + dinfo->core_id = *core_id; + return (0); +} + +/** * Map an addrspace index to its corresponding bhnd(4) port number. * * @param addrspace Address space index. Modified: head/sys/dev/bhnd/siba/sibavar.h ============================================================================== --- head/sys/dev/bhnd/siba/sibavar.h Sat Jun 25 04:34:54 2016 (r302190) +++ head/sys/dev/bhnd/siba/sibavar.h Sat Jun 25 04:36:30 2016 (r302191) @@ -63,7 +63,9 @@ struct siba_core_id siba_parse_core_id( int siba_add_children(device_t bus, const struct bhnd_chipid *chipid); -struct siba_devinfo *siba_alloc_dinfo(device_t dev, +struct siba_devinfo *siba_alloc_dinfo(device_t dev); +int siba_init_dinfo(device_t dev, + struct siba_devinfo *dinfo, const struct siba_core_id *core_id); void siba_free_dinfo(device_t dev, struct siba_devinfo *dinfo); @@ -136,6 +138,8 @@ struct siba_core_id { * siba(4) per-device info */ struct siba_devinfo { + struct bhnd_devinfo bhnd_dinfo; /**< superclass device info. */ + struct resource_list resources; /**< per-core memory regions. */ struct siba_core_id core_id; /**< core identification info */ struct siba_addrspace addrspace[SIBA_MAX_ADDRSPACE]; /**< memory map descriptors */ From owner-svn-src-head@freebsd.org Sat Jun 25 11:30:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F132BB80126; Sat, 25 Jun 2016 11:30:41 +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 B12CC1ECE; Sat, 25 Jun 2016 11:30:41 +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 u5PBUeVd001989; Sat, 25 Jun 2016 11:30:40 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5PBUeGC001988; Sat, 25 Jun 2016 11:30:40 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606251130.u5PBUeGC001988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 25 Jun 2016 11:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302194 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 11:30:42 -0000 Author: kib Date: Sat Jun 25 11:30:40 2016 New Revision: 302194 URL: https://svnweb.freebsd.org/changeset/base/302194 Log: For pthread_mutex_trylock() call on owned error-check or non-portable adaptive mutex, return EDEADLK as required by POSIX. The pthread_mutex_lock() is already compliant. Tested by: Guy Yur Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (gjb) Modified: head/lib/libthr/thread/thr_mutex.c Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Sat Jun 25 10:08:04 2016 (r302193) +++ head/lib/libthr/thread/thr_mutex.c Sat Jun 25 11:30:40 2016 (r302194) @@ -850,9 +850,12 @@ mutex_self_trylock(struct pthread_mutex switch (PMUTEX_TYPE(m->m_flags)) { case PTHREAD_MUTEX_ERRORCHECK: - case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_ADAPTIVE_NP: - ret = EBUSY; + ret = EDEADLK; + break; + + case PTHREAD_MUTEX_NORMAL: + ret = EBUSY; break; case PTHREAD_MUTEX_RECURSIVE: From owner-svn-src-head@freebsd.org Sat Jun 25 11:31:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFBD6B80180; Sat, 25 Jun 2016 11:31:26 +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 80E9F20FC; Sat, 25 Jun 2016 11:31:26 +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 u5PBVPkI002644; Sat, 25 Jun 2016 11:31:25 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5PBVPH2002642; Sat, 25 Jun 2016 11:31:25 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606251131.u5PBVPH2002642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 25 Jun 2016 11:31:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302195 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 11:31:26 -0000 Author: kib Date: Sat Jun 25 11:31:25 2016 New Revision: 302195 URL: https://svnweb.freebsd.org/changeset/base/302195 Log: Do not clear robust lists pointers on fork. The forked child thread lists must be functional. Reported by: Daniel Engberg , Guy Yur Tested by: Guy Yur Sponsored by: The FreeBSD Foundation Approved by: re (gjb), including the KBI change Modified: head/sys/kern/kern_thr.c head/sys/sys/proc.h Modified: head/sys/kern/kern_thr.c ============================================================================== --- head/sys/kern/kern_thr.c Sat Jun 25 11:30:40 2016 (r302194) +++ head/sys/kern/kern_thr.c Sat Jun 25 11:31:25 2016 (r302195) @@ -234,6 +234,7 @@ thread_create(struct thread *td, struct bcopy(&td->td_startcopy, &newtd->td_startcopy, __rangeof(struct thread, td_startcopy, td_endcopy)); newtd->td_proc = td->td_proc; + newtd->td_rb_list = newtd->td_rbp_list = newtd->td_rb_inact = 0; thread_cow_get(newtd, td); error = initialize_thread(newtd, thunk); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Sat Jun 25 11:30:40 2016 (r302194) +++ head/sys/sys/proc.h Sat Jun 25 11:31:25 2016 (r302195) @@ -282,9 +282,6 @@ struct thread { int td_no_sleeping; /* (k) Sleeping disabled count. */ int td_dom_rr_idx; /* (k) RR Numa domain selection. */ void *td_su; /* (k) FFS SU private */ - uintptr_t td_rb_list; /* (k) Robust list head. */ - uintptr_t td_rbp_list; /* (k) Robust priv list head. */ - uintptr_t td_rb_inact; /* (k) Current in-action mutex loc. */ #define td_endzero td_sigmask /* Copied during fork1() or create_thread(). */ @@ -298,6 +295,9 @@ struct thread { u_char td_base_user_pri; /* (t) Base user pri */ u_int td_dbg_sc_code; /* (c) Syscall code to debugger. */ u_int td_dbg_sc_narg; /* (c) Syscall arg count to debugger.*/ + uintptr_t td_rb_list; /* (k) Robust list head. */ + uintptr_t td_rbp_list; /* (k) Robust priv list head. */ + uintptr_t td_rb_inact; /* (k) Current in-action mutex loc. */ #define td_endcopy td_pcb /* From owner-svn-src-head@freebsd.org Sat Jun 25 11:34:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D2281B8033A; Sat, 25 Jun 2016 11:34:07 +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 851B625BB; Sat, 25 Jun 2016 11:34:07 +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 u5PBY6Tq005552; Sat, 25 Jun 2016 11:34:06 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5PBY6E2005551; Sat, 25 Jun 2016 11:34:06 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606251134.u5PBY6E2005551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 25 Jun 2016 11:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302196 - head/sys/fs/nfsclient X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 11:34:07 -0000 Author: kib Date: Sat Jun 25 11:34:06 2016 New Revision: 302196 URL: https://svnweb.freebsd.org/changeset/base/302196 Log: Since VOP_INACTIVE() is not guaranteed to be called, all cleanups executed by inactive methods, must be repeated on reclaim. In particular, unlink and free sillyrenamed vnode both on inactivation and reclaim. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (gjb) Modified: head/sys/fs/nfsclient/nfs_clnode.c Modified: head/sys/fs/nfsclient/nfs_clnode.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clnode.c Sat Jun 25 11:31:25 2016 (r302195) +++ head/sys/fs/nfsclient/nfs_clnode.c Sat Jun 25 11:34:06 2016 (r302196) @@ -198,15 +198,41 @@ nfs_freesillyrename(void *arg, __unused free(sp, M_NEWNFSREQ); } -int -ncl_inactive(struct vop_inactive_args *ap) +static void +ncl_releasesillyrename(struct vnode *vp, struct thread *td) { struct nfsnode *np; struct sillyrename *sp; - struct vnode *vp = ap->a_vp; - boolean_t retv; + ASSERT_VOP_ELOCKED(vp, "releasesillyrename"); np = VTONFS(vp); + mtx_lock(&np->n_mtx); + if (vp->v_type != VDIR) { + sp = np->n_sillyrename; + np->n_sillyrename = NULL; + } else + sp = NULL; + if (sp != NULL) { + mtx_unlock(&np->n_mtx); + (void) ncl_vinvalbuf(vp, 0, td, 1); + /* + * Remove the silly file that was rename'd earlier + */ + ncl_removeit(sp, vp); + crfree(sp->s_cred); + TASK_INIT(&sp->s_task, 0, nfs_freesillyrename, sp); + taskqueue_enqueue(taskqueue_thread, &sp->s_task); + mtx_lock(&np->n_mtx); + } + np->n_flag &= NMODIFIED; + mtx_unlock(&np->n_mtx); +} + +int +ncl_inactive(struct vop_inactive_args *ap) +{ + struct vnode *vp = ap->a_vp; + boolean_t retv; if (NFS_ISV4(vp) && vp->v_type == VREG) { /* @@ -228,26 +254,7 @@ ncl_inactive(struct vop_inactive_args *a } } - mtx_lock(&np->n_mtx); - if (vp->v_type != VDIR) { - sp = np->n_sillyrename; - np->n_sillyrename = NULL; - } else - sp = NULL; - if (sp) { - mtx_unlock(&np->n_mtx); - (void) ncl_vinvalbuf(vp, 0, ap->a_td, 1); - /* - * Remove the silly file that was rename'd earlier - */ - ncl_removeit(sp, vp); - crfree(sp->s_cred); - TASK_INIT(&sp->s_task, 0, nfs_freesillyrename, sp); - taskqueue_enqueue(taskqueue_thread, &sp->s_task); - mtx_lock(&np->n_mtx); - } - np->n_flag &= NMODIFIED; - mtx_unlock(&np->n_mtx); + ncl_releasesillyrename(vp, ap->a_td); return (0); } @@ -268,6 +275,8 @@ ncl_reclaim(struct vop_reclaim_args *ap) if (nfs_reclaim_p != NULL) nfs_reclaim_p(ap); + ncl_releasesillyrename(vp, ap->a_td); + /* * Destroy the vm object and flush associated pages. */ From owner-svn-src-head@freebsd.org Sat Jun 25 12:46:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A3E3B80C08; Sat, 25 Jun 2016 12:46:20 +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 D0DE91C2E; Sat, 25 Jun 2016 12:46:19 +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 u5PCkJ64031783; Sat, 25 Jun 2016 12:46:19 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5PCkJkH031782; Sat, 25 Jun 2016 12:46:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201606251246.u5PCkJkH031782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 25 Jun 2016 12:46:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302197 - head/usr.bin/sockstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 12:46:20 -0000 Author: tuexen Date: Sat Jun 25 12:46:18 2016 New Revision: 302197 URL: https://svnweb.freebsd.org/changeset/base/302197 Log: This patch fixes two bugs: * sctp46, tcp46, and udp46 sockets are displayed as such and not as sctp4 6, tcp4 6, udp4 6. This bug was introduced in http://svnweb.freebsd.org/base?view=revision&revision=187915 * For SCTP sockets, the the -4 and -6 flags are honoured as much as possible. This means IPv4 sockets are handled correctly, IPv6 sockets are displayed as sctp46, since it is currently not possible to distinguish between sctp6 and sctp46. Approved by: re (gjb) MFC after: 1 week Modified: head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Sat Jun 25 11:34:06 2016 (r302196) +++ head/usr.bin/sockstat/sockstat.c Sat Jun 25 12:46:18 2016 (r302197) @@ -338,7 +338,12 @@ gather_sctp(void) sock->state = SCTP_LISTEN; if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) { sock->family = AF_INET6; - sock->vflag = INP_IPV6; + /* + * Currently there is no way to distinguish between + * IPv6 only sockets or dual family sockets. + * So mark it as dual socket. + */ + sock->vflag = INP_IPV6 | INP_IPV4; } else { sock->family = AF_INET; sock->vflag = INP_IPV4; @@ -406,6 +411,7 @@ gather_sctp(void) offset += sizeof(struct xsctp_tcb); if (no_stcb) { if (opt_l && + (sock->vflag & vflag) && (!opt_L || !local_all_loopback) && ((xinpcb->flags & SCTP_PCB_FLAGS_UDPTYPE) || (xstcb->last == 1))) { @@ -428,7 +434,12 @@ gather_sctp(void) sock->state = (int)xstcb->state; if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) { sock->family = AF_INET6; - sock->vflag = INP_IPV6; + /* + * Currently there is no way to distinguish + * between IPv6 only sockets or dual family + * sockets. So mark it as dual socket. + */ + sock->vflag = INP_IPV6 | INP_IPV4; } else { sock->family = AF_INET; sock->vflag = INP_IPV4; @@ -519,7 +530,9 @@ gather_sctp(void) prev_faddr = faddr; } if (opt_c) { - if (!opt_L || !(local_all_loopback || foreign_all_loopback)) { + if ((sock->vflag & vflag) && + (!opt_L || + !(local_all_loopback || foreign_all_loopback))) { hash = (int)((uintptr_t)sock->socket % HASHSIZE); sock->next = sockhash[hash]; sockhash[hash] = sock; @@ -963,9 +976,11 @@ displaysock(struct sock *s, int pos) pos += xprintf(" "); pos += xprintf("%s", s->protoname); if (s->vflag & INP_IPV4) - pos += xprintf("4 "); + pos += xprintf("4"); if (s->vflag & INP_IPV6) - pos += xprintf("6 "); + pos += xprintf("6"); + if (s->vflag & (INP_IPV4 | INP_IPV6)) + pos += xprintf(" "); laddr = s->laddr; faddr = s->faddr; first = 1; From owner-svn-src-head@freebsd.org Sat Jun 25 12:54:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18875B80EB4; Sat, 25 Jun 2016 12:54: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 D993712CE; Sat, 25 Jun 2016 12:54:28 +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 u5PCsSpZ035633; Sat, 25 Jun 2016 12:54:28 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5PCsSMD035632; Sat, 25 Jun 2016 12:54:28 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201606251254.u5PCsSMD035632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Sat, 25 Jun 2016 12:54:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302198 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 12:54:29 -0000 Author: bapt Date: Sat Jun 25 12:54:27 2016 New Revision: 302198 URL: https://svnweb.freebsd.org/changeset/base/302198 Log: Remove reference to mroute6d in /etc/netstart. mroute6d has been removed in r298512. PR: 209405 Submitted by: Trond.Endrestol@ximalas.info Approved by: re (gjb) Modified: head/etc/netstart Modified: head/etc/netstart ============================================================================== --- head/etc/netstart Sat Jun 25 12:46:18 2016 (r302197) +++ head/etc/netstart Sat Jun 25 12:54:27 2016 (r302198) @@ -52,7 +52,6 @@ _start=quietstart /etc/rc.d/ppp ${_start} /etc/rc.d/ipfw ${_start} /etc/rc.d/routing ${_start} -/etc/rc.d/mroute6d ${_start} /etc/rc.d/route6d ${_start} /etc/rc.d/routed ${_start} /etc/rc.d/rtsold ${_start} From owner-svn-src-head@freebsd.org Sat Jun 25 13:44:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4964BB818EA; Sat, 25 Jun 2016 13:44:13 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv157.fwdcdn.com (frv157.fwdcdn.com [212.42.77.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0DF6E1D11; Sat, 25 Jun 2016 13:44:12 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=/qXbVfR6fGpdRg5Jh4+WeMz7Mqh3wZFReTq+e5FJSHA=; b=pZTKNgcit1OONo0dhH0msLRxw0tdPJ5P0NarQD/KnxVsAUD+uLetSRyMZCNaxyo+RLnpSFBMHUJhIzD96CeqGHQAsV3r3ea0Ix1Tje8DYjhpZW92P1Jay/80hjwxQx1UkBBDO5IEtexGOkkw0rD6+yhF2LaD3RTJs0HhHWQXdMw=; Received: from [37.229.193.176] (helo=nonamehost.local) by frv157.fwdcdn.com with esmtpsa ID 1bGnsS-0002Tx-6W ; Sat, 25 Jun 2016 16:44:04 +0300 Date: Sat, 25 Jun 2016 16:44:03 +0300 From: Ivan Klymenko To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625164403.70684b3b@nonamehost.local> In-Reply-To: <201606251130.u5PBUeGC001988@repo.freebsd.org> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=37.229.193.176; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 13:44:13 -0000 On Sat, 25 Jun 2016 11:30:40 +0000 (UTC) Konstantin Belousov wrote: > Author: kib > Date: Sat Jun 25 11:30:40 2016 > New Revision: 302194 > URL: https://svnweb.freebsd.org/changeset/base/302194 > > Log: > For pthread_mutex_trylock() call on owned error-check or > non-portable adaptive mutex, return EDEADLK as required by POSIX. The > pthread_mutex_lock() is already compliant. > > Tested by: Guy Yur > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > Approved by: re (gjb) > > Modified: > head/lib/libthr/thread/thr_mutex.c > > Modified: head/lib/libthr/thread/thr_mutex.c > ============================================================================== > --- head/lib/libthr/thread/thr_mutex.c Sat Jun 25 10:08:04 > 2016 (r302193) +++ head/lib/libthr/thread/thr_mutex.c > Sat Jun 25 11:30:40 2016 (r302194) @@ -850,9 +850,12 @@ > mutex_self_trylock(struct pthread_mutex > switch (PMUTEX_TYPE(m->m_flags)) { > case PTHREAD_MUTEX_ERRORCHECK: > - case PTHREAD_MUTEX_NORMAL: > case PTHREAD_MUTEX_ADAPTIVE_NP: > - ret = EBUSY; > + ret = EDEADLK; > + break; > + > + case PTHREAD_MUTEX_NORMAL: > + ret = EBUSY; > break; > > case PTHREAD_MUTEX_RECURSIVE: Update for r302191 to r302196 console-kit-daemon: pid 1496 (console-kit-daemon), uid 0: exited on signal 6 pid 1581 (console-kit-daemon), uid 0: exited on signal 6 pid 5954 (console-kit-daemon), uid 0: exited on signal 6 pid 6010 (console-kit-daemon), uid 0: exited on signal 6 pid 6016 (console-kit-daemon), uid 0: exited on signal 6 Xorg session after authorization not started - black screen. From owner-svn-src-head@freebsd.org Sat Jun 25 13:55:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D53AB81B1F; Sat, 25 Jun 2016 13:55:15 +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 E1CE21689; Sat, 25 Jun 2016 13:55:14 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u5PDt95P061654 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 25 Jun 2016 16:55:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u5PDt95P061654 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u5PDt97L061653; Sat, 25 Jun 2016 16:55:09 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 25 Jun 2016 16:55:09 +0300 From: Konstantin Belousov To: Ivan Klymenko Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625135508.GV38613@kib.kiev.ua> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625164403.70684b3b@nonamehost.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160625164403.70684b3b@nonamehost.local> User-Agent: Mutt/1.6.1 (2016-04-27) 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 13:55:15 -0000 On Sat, Jun 25, 2016 at 04:44:03PM +0300, Ivan Klymenko wrote: > On Sat, 25 Jun 2016 11:30:40 +0000 (UTC) > Konstantin Belousov wrote: > > > Author: kib > > Date: Sat Jun 25 11:30:40 2016 > > New Revision: 302194 > > URL: https://svnweb.freebsd.org/changeset/base/302194 > > > > Log: > > For pthread_mutex_trylock() call on owned error-check or > > non-portable adaptive mutex, return EDEADLK as required by POSIX. The > > pthread_mutex_lock() is already compliant. > > > > Tested by: Guy Yur > > Sponsored by: The FreeBSD Foundation > > MFC after: 2 weeks > > Approved by: re (gjb) > > > > Modified: > > head/lib/libthr/thread/thr_mutex.c > > > > Modified: head/lib/libthr/thread/thr_mutex.c > > ============================================================================== > > --- head/lib/libthr/thread/thr_mutex.c Sat Jun 25 10:08:04 > > 2016 (r302193) +++ head/lib/libthr/thread/thr_mutex.c > > Sat Jun 25 11:30:40 2016 (r302194) @@ -850,9 +850,12 @@ > > mutex_self_trylock(struct pthread_mutex > > switch (PMUTEX_TYPE(m->m_flags)) { > > case PTHREAD_MUTEX_ERRORCHECK: > > - case PTHREAD_MUTEX_NORMAL: > > case PTHREAD_MUTEX_ADAPTIVE_NP: > > - ret = EBUSY; > > + ret = EDEADLK; > > + break; > > + > > + case PTHREAD_MUTEX_NORMAL: > > + ret = EBUSY; > > break; > > > > case PTHREAD_MUTEX_RECURSIVE: > > Update for r302191 to r302196 console-kit-daemon: > pid 1496 (console-kit-daemon), uid 0: exited on signal 6 > pid 1581 (console-kit-daemon), uid 0: exited on signal 6 > pid 5954 (console-kit-daemon), uid 0: exited on signal 6 > pid 6010 (console-kit-daemon), uid 0: exited on signal 6 > pid 6016 (console-kit-daemon), uid 0: exited on signal 6 > > Xorg session after authorization not started - black screen. Why did you replied to r302194 with this information ? Does reverting r302194 (and only this revision) restores console-kit functionality ? From owner-svn-src-head@freebsd.org Sat Jun 25 14:04:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD2BBB81CAD; Sat, 25 Jun 2016 14:04:10 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv157.fwdcdn.com (frv157.fwdcdn.com [212.42.77.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 84CFE1B83; Sat, 25 Jun 2016 14:04:10 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=1aOjvrVOS9EDKIUUtXd4wrvWk2Ibjl4Si3SeHsyUcOk=; b=IVppykzTbnvEQnDXuDqmgvQrYzFqR/YVCtbZTwHmg6l8vhnkkpSi4DW4vN7nL/IkNag/qz+yfXHcez+h7n24YNedjUYdd1CI0vJi3Gkc5Zvx2Y9NoztsJtzkL/i2dNd0thjf7KBzLJBUe/D8PSuxCI4ZyUgw4NeRzpiz5RKonws=; Received: from [37.229.193.176] (helo=nonamehost.local) by frv157.fwdcdn.com with esmtpsa ID 1bGoBr-000A4x-Ac ; Sat, 25 Jun 2016 17:04:07 +0300 Date: Sat, 25 Jun 2016 17:04:06 +0300 From: Ivan Klymenko To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625170406.77c79b2e@nonamehost.local> In-Reply-To: <20160625135508.GV38613@kib.kiev.ua> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625164403.70684b3b@nonamehost.local> <20160625135508.GV38613@kib.kiev.ua> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=37.229.193.176; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 14:04:10 -0000 On Sat, 25 Jun 2016 16:55:09 +0300 Konstantin Belousov wrote: > On Sat, Jun 25, 2016 at 04:44:03PM +0300, Ivan Klymenko wrote: > > On Sat, 25 Jun 2016 11:30:40 +0000 (UTC) > > Konstantin Belousov wrote: > > > > > Author: kib > > > Date: Sat Jun 25 11:30:40 2016 > > > New Revision: 302194 > > > URL: https://svnweb.freebsd.org/changeset/base/302194 > > > > > > Log: > > > For pthread_mutex_trylock() call on owned error-check or > > > non-portable adaptive mutex, return EDEADLK as required by > > > POSIX. The pthread_mutex_lock() is already compliant. > > > > > > Tested by: Guy Yur > > > Sponsored by: The FreeBSD Foundation > > > MFC after: 2 weeks > > > Approved by: re (gjb) > > > > > > Modified: > > > head/lib/libthr/thread/thr_mutex.c > > > > > > Modified: head/lib/libthr/thread/thr_mutex.c > > > ============================================================================== > > > --- head/lib/libthr/thread/thr_mutex.c Sat Jun 25 10:08:04 > > > 2016 (r302193) +++ head/lib/libthr/thread/thr_mutex.c > > > Sat Jun 25 11:30:40 2016 (r302194) @@ -850,9 +850,12 @@ > > > mutex_self_trylock(struct pthread_mutex > > > switch (PMUTEX_TYPE(m->m_flags)) { > > > case PTHREAD_MUTEX_ERRORCHECK: > > > - case PTHREAD_MUTEX_NORMAL: > > > case PTHREAD_MUTEX_ADAPTIVE_NP: > > > - ret = EBUSY; > > > + ret = EDEADLK; > > > + break; > > > + > > > + case PTHREAD_MUTEX_NORMAL: > > > + ret = EBUSY; > > > break; > > > > > > case PTHREAD_MUTEX_RECURSIVE: > > > > Update for r302191 to r302196 console-kit-daemon: > > pid 1496 (console-kit-daemon), uid 0: exited on signal 6 > > pid 1581 (console-kit-daemon), uid 0: exited on signal 6 > > pid 5954 (console-kit-daemon), uid 0: exited on signal 6 > > pid 6010 (console-kit-daemon), uid 0: exited on signal 6 > > pid 6016 (console-kit-daemon), uid 0: exited on signal 6 > > > > Xorg session after authorization not started - black screen. > > Why did you replied to r302194 with this information ? Does reverting > r302194 (and only this revision) restores console-kit functionality ? I do not know which one commits it breaks r302194 or next 302195. I returned to r302191 for restores console-kit functionality. From owner-svn-src-head@freebsd.org Sat Jun 25 14:05:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D37EB81D98; Sat, 25 Jun 2016 14:05:35 +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 4695C1F04; Sat, 25 Jun 2016 14:05:35 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u5PE5TiI064616 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 25 Jun 2016 17:05:30 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u5PE5TiI064616 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u5PE5TrU064615; Sat, 25 Jun 2016 17:05:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 25 Jun 2016 17:05:29 +0300 From: Konstantin Belousov To: Ivan Klymenko Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625140529.GW38613@kib.kiev.ua> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625164403.70684b3b@nonamehost.local> <20160625135508.GV38613@kib.kiev.ua> <20160625170406.77c79b2e@nonamehost.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160625170406.77c79b2e@nonamehost.local> User-Agent: Mutt/1.6.1 (2016-04-27) 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 14:05:35 -0000 On Sat, Jun 25, 2016 at 05:04:06PM +0300, Ivan Klymenko wrote: > On Sat, 25 Jun 2016 16:55:09 +0300 > Konstantin Belousov wrote: > > > On Sat, Jun 25, 2016 at 04:44:03PM +0300, Ivan Klymenko wrote: > > > On Sat, 25 Jun 2016 11:30:40 +0000 (UTC) > > > Konstantin Belousov wrote: > > > > > > > Author: kib > > > > Date: Sat Jun 25 11:30:40 2016 > > > > New Revision: 302194 > > > > URL: https://svnweb.freebsd.org/changeset/base/302194 > > > > > > > > Log: > > > > For pthread_mutex_trylock() call on owned error-check or > > > > non-portable adaptive mutex, return EDEADLK as required by > > > > POSIX. The pthread_mutex_lock() is already compliant. > > > > > > > > Tested by: Guy Yur > > > > Sponsored by: The FreeBSD Foundation > > > > MFC after: 2 weeks > > > > Approved by: re (gjb) > > > > > > > > Modified: > > > > head/lib/libthr/thread/thr_mutex.c > > > > > > > > Modified: head/lib/libthr/thread/thr_mutex.c > > > > ============================================================================== > > > > --- head/lib/libthr/thread/thr_mutex.c Sat Jun 25 10:08:04 > > > > 2016 (r302193) +++ head/lib/libthr/thread/thr_mutex.c > > > > Sat Jun 25 11:30:40 2016 (r302194) @@ -850,9 +850,12 @@ > > > > mutex_self_trylock(struct pthread_mutex > > > > switch (PMUTEX_TYPE(m->m_flags)) { > > > > case PTHREAD_MUTEX_ERRORCHECK: > > > > - case PTHREAD_MUTEX_NORMAL: > > > > case PTHREAD_MUTEX_ADAPTIVE_NP: > > > > - ret = EBUSY; > > > > + ret = EDEADLK; > > > > + break; > > > > + > > > > + case PTHREAD_MUTEX_NORMAL: > > > > + ret = EBUSY; > > > > break; > > > > > > > > case PTHREAD_MUTEX_RECURSIVE: > > > > > > Update for r302191 to r302196 console-kit-daemon: > > > pid 1496 (console-kit-daemon), uid 0: exited on signal 6 > > > pid 1581 (console-kit-daemon), uid 0: exited on signal 6 > > > pid 5954 (console-kit-daemon), uid 0: exited on signal 6 > > > pid 6010 (console-kit-daemon), uid 0: exited on signal 6 > > > pid 6016 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > Xorg session after authorization not started - black screen. > > > > Why did you replied to r302194 with this information ? Does reverting > > r302194 (and only this revision) restores console-kit functionality ? > > I do not know which one commits it breaks r302194 or next 302195. > I returned to r302191 for restores console-kit functionality. Can you test, please ? Use r302195 kernel and previous libthr. From owner-svn-src-head@freebsd.org Sat Jun 25 14:18:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0973B82D97; Sat, 25 Jun 2016 14:18:04 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv157.fwdcdn.com (frv157.fwdcdn.com [212.42.77.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B44131A29; Sat, 25 Jun 2016 14:18:04 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=OKsNQr1PoLb8RRdK8791553T33yZiBVNpWcsZIWtYXs=; b=QZLPbPqmsv11nKaG9HhxfXcsLmZLsgCGI7n9qeTKtCbSPra03gV7kfKYQWBlcUe7f+M1viDxFHUiZaJTywJwiZjqAhfPpweo7dr6zZpcmA996eZSg5O90fnaXWu+tvwMWEIHU4vjoXvdPDhlhKImBfskAoZZvwrhjMe/JBQjvfU=; Received: from [37.229.193.176] (helo=nonamehost.local) by frv157.fwdcdn.com with esmtpsa ID 1bGoPJ-000FGI-Bp ; Sat, 25 Jun 2016 17:18:01 +0300 Date: Sat, 25 Jun 2016 17:18:00 +0300 From: Ivan Klymenko To: Konstantin Belousov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625171800.50a43746@nonamehost.local> In-Reply-To: <20160625140529.GW38613@kib.kiev.ua> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625164403.70684b3b@nonamehost.local> <20160625135508.GV38613@kib.kiev.ua> <20160625170406.77c79b2e@nonamehost.local> <20160625140529.GW38613@kib.kiev.ua> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=37.229.193.176; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 14:18:05 -0000 On Sat, 25 Jun 2016 17:05:29 +0300 Konstantin Belousov wrote: > On Sat, Jun 25, 2016 at 05:04:06PM +0300, Ivan Klymenko wrote: > > On Sat, 25 Jun 2016 16:55:09 +0300 > > Konstantin Belousov wrote: > > > > > On Sat, Jun 25, 2016 at 04:44:03PM +0300, Ivan Klymenko wrote: > > > > On Sat, 25 Jun 2016 11:30:40 +0000 (UTC) > > > > Konstantin Belousov wrote: > > > > > > > > > Author: kib > > > > > Date: Sat Jun 25 11:30:40 2016 > > > > > New Revision: 302194 > > > > > URL: https://svnweb.freebsd.org/changeset/base/302194 > > > > > > > > > > Log: > > > > > For pthread_mutex_trylock() call on owned error-check or > > > > > non-portable adaptive mutex, return EDEADLK as required by > > > > > POSIX. The pthread_mutex_lock() is already compliant. > > > > > > > > > > Tested by: Guy Yur > > > > > Sponsored by: The FreeBSD Foundation > > > > > MFC after: 2 weeks > > > > > Approved by: re (gjb) > > > > > > > > > > Modified: > > > > > head/lib/libthr/thread/thr_mutex.c > > > > > > > > > > Modified: head/lib/libthr/thread/thr_mutex.c > > > > > ============================================================================== > > > > > --- head/lib/libthr/thread/thr_mutex.c Sat Jun 25 > > > > > 10:08:04 2016 (r302193) +++ > > > > > head/lib/libthr/thread/thr_mutex.c Sat Jun 25 11:30:40 > > > > > 2016 (r302194) @@ -850,9 +850,12 @@ > > > > > mutex_self_trylock(struct pthread_mutex switch > > > > > (PMUTEX_TYPE(m->m_flags)) { case PTHREAD_MUTEX_ERRORCHECK: > > > > > - case PTHREAD_MUTEX_NORMAL: > > > > > case PTHREAD_MUTEX_ADAPTIVE_NP: > > > > > - ret = EBUSY; > > > > > + ret = EDEADLK; > > > > > + break; > > > > > + > > > > > + case PTHREAD_MUTEX_NORMAL: > > > > > + ret = EBUSY; > > > > > break; > > > > > > > > > > case PTHREAD_MUTEX_RECURSIVE: > > > > > > > > Update for r302191 to r302196 console-kit-daemon: > > > > pid 1496 (console-kit-daemon), uid 0: exited on signal 6 > > > > pid 1581 (console-kit-daemon), uid 0: exited on signal 6 > > > > pid 5954 (console-kit-daemon), uid 0: exited on signal 6 > > > > pid 6010 (console-kit-daemon), uid 0: exited on signal 6 > > > > pid 6016 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > > > Xorg session after authorization not started - black screen. > > > > > > Why did you replied to r302194 with this information ? Does > > > reverting r302194 (and only this revision) restores console-kit > > > functionality ? > > > > I do not know which one commits it breaks r302194 or next 302195. > > I returned to r302191 for restores console-kit functionality. > Can you test, please ? Use r302195 kernel and previous libthr. Kernel r302195, world r302191 - works fine - the problem can not reproduce. From owner-svn-src-head@freebsd.org Sat Jun 25 14:29:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 805B7B82FE1; Sat, 25 Jun 2016 14:29:21 +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 10BD811F7; Sat, 25 Jun 2016 14:29:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u5PETFmk069892 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 25 Jun 2016 17:29:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u5PETFmk069892 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u5PETFFa069891; Sat, 25 Jun 2016 17:29:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 25 Jun 2016 17:29:15 +0300 From: Konstantin Belousov To: Ivan Klymenko Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625142915.GX38613@kib.kiev.ua> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625164403.70684b3b@nonamehost.local> <20160625135508.GV38613@kib.kiev.ua> <20160625170406.77c79b2e@nonamehost.local> <20160625140529.GW38613@kib.kiev.ua> <20160625171800.50a43746@nonamehost.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160625171800.50a43746@nonamehost.local> User-Agent: Mutt/1.6.1 (2016-04-27) 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 14:29:21 -0000 On Sat, Jun 25, 2016 at 05:18:00PM +0300, Ivan Klymenko wrote: > On Sat, 25 Jun 2016 17:05:29 +0300 > Konstantin Belousov wrote: > > > On Sat, Jun 25, 2016 at 05:04:06PM +0300, Ivan Klymenko wrote: > > > On Sat, 25 Jun 2016 16:55:09 +0300 > > > Konstantin Belousov wrote: > > > > > > > On Sat, Jun 25, 2016 at 04:44:03PM +0300, Ivan Klymenko wrote: > > > > > On Sat, 25 Jun 2016 11:30:40 +0000 (UTC) > > > > > Konstantin Belousov wrote: > > > > > > > > > > > Author: kib > > > > > > Date: Sat Jun 25 11:30:40 2016 > > > > > > New Revision: 302194 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/302194 > > > > > > > > > > > > Log: > > > > > > For pthread_mutex_trylock() call on owned error-check or > > > > > > non-portable adaptive mutex, return EDEADLK as required by > > > > > > POSIX. The pthread_mutex_lock() is already compliant. > > > > > > > > > > > > Tested by: Guy Yur > > > > > > Sponsored by: The FreeBSD Foundation > > > > > > MFC after: 2 weeks > > > > > > Approved by: re (gjb) > > > > > > > > > > > > Modified: > > > > > > head/lib/libthr/thread/thr_mutex.c > > > > > > > > > > > > Modified: head/lib/libthr/thread/thr_mutex.c > > > > > > ============================================================================== > > > > > > --- head/lib/libthr/thread/thr_mutex.c Sat Jun 25 > > > > > > 10:08:04 2016 (r302193) +++ > > > > > > head/lib/libthr/thread/thr_mutex.c Sat Jun 25 11:30:40 > > > > > > 2016 (r302194) @@ -850,9 +850,12 @@ > > > > > > mutex_self_trylock(struct pthread_mutex switch > > > > > > (PMUTEX_TYPE(m->m_flags)) { case PTHREAD_MUTEX_ERRORCHECK: > > > > > > - case PTHREAD_MUTEX_NORMAL: > > > > > > case PTHREAD_MUTEX_ADAPTIVE_NP: > > > > > > - ret = EBUSY; > > > > > > + ret = EDEADLK; > > > > > > + break; > > > > > > + > > > > > > + case PTHREAD_MUTEX_NORMAL: > > > > > > + ret = EBUSY; > > > > > > break; > > > > > > > > > > > > case PTHREAD_MUTEX_RECURSIVE: > > > > > > > > > > Update for r302191 to r302196 console-kit-daemon: > > > > > pid 1496 (console-kit-daemon), uid 0: exited on signal 6 > > > > > pid 1581 (console-kit-daemon), uid 0: exited on signal 6 > > > > > pid 5954 (console-kit-daemon), uid 0: exited on signal 6 > > > > > pid 6010 (console-kit-daemon), uid 0: exited on signal 6 > > > > > pid 6016 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > > > > > Xorg session after authorization not started - black screen. > > > > > > > > Why did you replied to r302194 with this information ? Does > > > > reverting r302194 (and only this revision) restores console-kit > > > > functionality ? > > > > > > I do not know which one commits it breaks r302194 or next 302195. > > > I returned to r302191 for restores console-kit functionality. > > Can you test, please ? Use r302195 kernel and previous libthr. > > Kernel r302195, world r302191 - works fine - the problem can not > reproduce. Thank you. Could you get backtrace from the console-kit-daemon ? Only rebuild libthr: cd src/lib/libthr && make DEBUG_FLAGS=-g WITHOUT_TESTS=yes all install then gather coredump and load it in gdb. Then you can revert the commit and rebuild working libthr. From owner-svn-src-head@freebsd.org Sat Jun 25 14:55:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2009BB80AA8; Sat, 25 Jun 2016 14:55:08 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv157.fwdcdn.com (frv157.fwdcdn.com [212.42.77.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D3F95263A; Sat, 25 Jun 2016 14:55:07 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=zpsAJrRfQKQu83L0VRV2fc4O/f6OiS008GYK89YYPkA=; b=ESOP5dWUzjMAtyb9WaFwbk9CmGCnQH4k2Zi4t0+wt/b1AnQk6JhEYES0Mp0t2iEN0NrFsaLyC0GdVG1wuLyHM+OU+lju28C5yJijSw/3sqOT98LRwmDyW0nE7hl2JLktTzOss00U1iRS9BYhKY57BoBI1G+KcF0JBYtXJ1RnNqc=; Received: from [37.229.193.176] (helo=nonamehost.local) by frv157.fwdcdn.com with esmtpsa ID 1bGozA-0003CX-3e ; Sat, 25 Jun 2016 17:55:04 +0300 Date: Sat, 25 Jun 2016 17:55:03 +0300 From: Ivan Klymenko To: Konstantin Belousov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625175503.7c57d42b@nonamehost.local> In-Reply-To: <20160625142915.GX38613@kib.kiev.ua> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625164403.70684b3b@nonamehost.local> <20160625135508.GV38613@kib.kiev.ua> <20160625170406.77c79b2e@nonamehost.local> <20160625140529.GW38613@kib.kiev.ua> <20160625171800.50a43746@nonamehost.local> <20160625142915.GX38613@kib.kiev.ua> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=37.229.193.176; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 14:55:08 -0000 On Sat, 25 Jun 2016 17:29:15 +0300 Konstantin Belousov wrote: > On Sat, Jun 25, 2016 at 05:18:00PM +0300, Ivan Klymenko wrote: > > On Sat, 25 Jun 2016 17:05:29 +0300 > > Konstantin Belousov wrote: > > > > > On Sat, Jun 25, 2016 at 05:04:06PM +0300, Ivan Klymenko wrote: > > > > On Sat, 25 Jun 2016 16:55:09 +0300 > > > > Konstantin Belousov wrote: > > > > > > > > > On Sat, Jun 25, 2016 at 04:44:03PM +0300, Ivan Klymenko > > > > > wrote: > > > > > > On Sat, 25 Jun 2016 11:30:40 +0000 (UTC) > > > > > > Konstantin Belousov wrote: > > > > > > > > > > > > > Author: kib > > > > > > > Date: Sat Jun 25 11:30:40 2016 > > > > > > > New Revision: 302194 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/302194 > > > > > > > > > > > > > > Log: > > > > > > > For pthread_mutex_trylock() call on owned error-check or > > > > > > > non-portable adaptive mutex, return EDEADLK as required by > > > > > > > POSIX. The pthread_mutex_lock() is already compliant. > > > > > > > > > > > > > > Tested by: Guy Yur > > > > > > > Sponsored by: The FreeBSD Foundation > > > > > > > MFC after: 2 weeks > > > > > > > Approved by: re (gjb) > > > > > > > > > > > > > > Modified: > > > > > > > head/lib/libthr/thread/thr_mutex.c > > > > > > > > > > > > > > Modified: head/lib/libthr/thread/thr_mutex.c > > > > > > > ============================================================================== > > > > > > > --- head/lib/libthr/thread/thr_mutex.c Sat Jun 25 > > > > > > > 10:08:04 2016 (r302193) +++ > > > > > > > head/lib/libthr/thread/thr_mutex.c Sat Jun 25 11:30:40 > > > > > > > 2016 (r302194) @@ -850,9 +850,12 @@ > > > > > > > mutex_self_trylock(struct pthread_mutex switch > > > > > > > (PMUTEX_TYPE(m->m_flags)) { case PTHREAD_MUTEX_ERRORCHECK: > > > > > > > - case PTHREAD_MUTEX_NORMAL: > > > > > > > case PTHREAD_MUTEX_ADAPTIVE_NP: > > > > > > > - ret = EBUSY; > > > > > > > + ret = EDEADLK; > > > > > > > + break; > > > > > > > + > > > > > > > + case PTHREAD_MUTEX_NORMAL: > > > > > > > + ret = EBUSY; > > > > > > > break; > > > > > > > > > > > > > > case PTHREAD_MUTEX_RECURSIVE: > > > > > > > > > > > > Update for r302191 to r302196 console-kit-daemon: > > > > > > pid 1496 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > pid 1581 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > pid 5954 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > pid 6010 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > pid 6016 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > > > > > > > Xorg session after authorization not started - black > > > > > > screen. > > > > > > > > > > Why did you replied to r302194 with this information ? Does > > > > > reverting r302194 (and only this revision) restores > > > > > console-kit functionality ? > > > > > > > > I do not know which one commits it breaks r302194 or next > > > > 302195. I returned to r302191 for restores console-kit > > > > functionality. > > > Can you test, please ? Use r302195 kernel and previous libthr. > > > > Kernel r302195, world r302191 - works fine - the problem can not > > reproduce. > > Thank you. > > Could you get backtrace from the console-kit-daemon ? Only rebuild > libthr: cd src/lib/libthr && make DEBUG_FLAGS=-g WITHOUT_TESTS=yes > all install then gather coredump and load it in gdb. Then you can > revert the commit and rebuild working libthr. > http://pastebin.com/wgmmicC3 If this information will be useful. From owner-svn-src-head@freebsd.org Sat Jun 25 15:20:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2B02B81372; Sat, 25 Jun 2016 15:20:17 +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 6CBCC1736; Sat, 25 Jun 2016 15:20:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u5PFK6eL081925 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 25 Jun 2016 18:20:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u5PFK6eL081925 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u5PFK67o081923; Sat, 25 Jun 2016 18:20:06 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 25 Jun 2016 18:20:06 +0300 From: Konstantin Belousov To: Ivan Klymenko Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625152006.GA38613@kib.kiev.ua> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625164403.70684b3b@nonamehost.local> <20160625135508.GV38613@kib.kiev.ua> <20160625170406.77c79b2e@nonamehost.local> <20160625140529.GW38613@kib.kiev.ua> <20160625171800.50a43746@nonamehost.local> <20160625142915.GX38613@kib.kiev.ua> <20160625175503.7c57d42b@nonamehost.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160625175503.7c57d42b@nonamehost.local> User-Agent: Mutt/1.6.1 (2016-04-27) 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 15:20:17 -0000 On Sat, Jun 25, 2016 at 05:55:03PM +0300, Ivan Klymenko wrote: > On Sat, 25 Jun 2016 17:29:15 +0300 > Konstantin Belousov wrote: > > > On Sat, Jun 25, 2016 at 05:18:00PM +0300, Ivan Klymenko wrote: > > > On Sat, 25 Jun 2016 17:05:29 +0300 > > > Konstantin Belousov wrote: > > > > > > > On Sat, Jun 25, 2016 at 05:04:06PM +0300, Ivan Klymenko wrote: > > > > > On Sat, 25 Jun 2016 16:55:09 +0300 > > > > > Konstantin Belousov wrote: > > > > > > > > > > > On Sat, Jun 25, 2016 at 04:44:03PM +0300, Ivan Klymenko > > > > > > wrote: > > > > > > > On Sat, 25 Jun 2016 11:30:40 +0000 (UTC) > > > > > > > Konstantin Belousov wrote: > > > > > > > > > > > > > > > Author: kib > > > > > > > > Date: Sat Jun 25 11:30:40 2016 > > > > > > > > New Revision: 302194 > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/302194 > > > > > > > > > > > > > > > > Log: > > > > > > > > For pthread_mutex_trylock() call on owned error-check or > > > > > > > > non-portable adaptive mutex, return EDEADLK as required by > > > > > > > > POSIX. The pthread_mutex_lock() is already compliant. > > > > > > > > > > > > > > > > Tested by: Guy Yur > > > > > > > > Sponsored by: The FreeBSD Foundation > > > > > > > > MFC after: 2 weeks > > > > > > > > Approved by: re (gjb) > > > > > > > > > > > > > > > > Modified: > > > > > > > > head/lib/libthr/thread/thr_mutex.c > > > > > > > > > > > > > > > > Modified: head/lib/libthr/thread/thr_mutex.c > > > > > > > > ============================================================================== > > > > > > > > --- head/lib/libthr/thread/thr_mutex.c Sat Jun 25 > > > > > > > > 10:08:04 2016 (r302193) +++ > > > > > > > > head/lib/libthr/thread/thr_mutex.c Sat Jun 25 11:30:40 > > > > > > > > 2016 (r302194) @@ -850,9 +850,12 @@ > > > > > > > > mutex_self_trylock(struct pthread_mutex switch > > > > > > > > (PMUTEX_TYPE(m->m_flags)) { case PTHREAD_MUTEX_ERRORCHECK: > > > > > > > > - case PTHREAD_MUTEX_NORMAL: > > > > > > > > case PTHREAD_MUTEX_ADAPTIVE_NP: > > > > > > > > - ret = EBUSY; > > > > > > > > + ret = EDEADLK; > > > > > > > > + break; > > > > > > > > + > > > > > > > > + case PTHREAD_MUTEX_NORMAL: > > > > > > > > + ret = EBUSY; > > > > > > > > break; > > > > > > > > > > > > > > > > case PTHREAD_MUTEX_RECURSIVE: > > > > > > > > > > > > > > Update for r302191 to r302196 console-kit-daemon: > > > > > > > pid 1496 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > > pid 1581 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > > pid 5954 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > > pid 6010 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > > pid 6016 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > > > > > > > > > Xorg session after authorization not started - black > > > > > > > screen. > > > > > > > > > > > > Why did you replied to r302194 with this information ? Does > > > > > > reverting r302194 (and only this revision) restores > > > > > > console-kit functionality ? > > > > > > > > > > I do not know which one commits it breaks r302194 or next > > > > > 302195. I returned to r302191 for restores console-kit > > > > > functionality. > > > > Can you test, please ? Use r302195 kernel and previous libthr. > > > > > > Kernel r302195, world r302191 - works fine - the problem can not > > > reproduce. > > > > Thank you. > > > > Could you get backtrace from the console-kit-daemon ? Only rebuild > > libthr: cd src/lib/libthr && make DEBUG_FLAGS=-g WITHOUT_TESTS=yes > > all install then gather coredump and load it in gdb. Then you can > > revert the commit and rebuild working libthr. > > > > http://pastebin.com/wgmmicC3 If this information will be useful. Yes, it is useful, thank you. Please try this instead of reverting. diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c index 2ad05ca..1ae75fb 100644 --- a/lib/libthr/thread/thr_mutex.c +++ b/lib/libthr/thread/thr_mutex.c @@ -850,10 +871,10 @@ mutex_self_trylock(struct pthread_mutex *m) switch (PMUTEX_TYPE(m->m_flags)) { case PTHREAD_MUTEX_ERRORCHECK: - case PTHREAD_MUTEX_ADAPTIVE_NP: ret = EDEADLK; break; + case PTHREAD_MUTEX_ADAPTIVE_NP: case PTHREAD_MUTEX_NORMAL: ret = EBUSY; break; From owner-svn-src-head@freebsd.org Sat Jun 25 16:03:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91617B82D5D; Sat, 25 Jun 2016 16:03:51 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv157.fwdcdn.com (frv157.fwdcdn.com [212.42.77.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5451D1978; Sat, 25 Jun 2016 16:03:50 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=Plt2bRyVxEI7fM5DTRYbdhuuhaWnxc4Ro5/69ZKs3NQ=; b=h3OR8fQ5UrIAlsr7mR+cBKheVLNLwRf8mEBV1YhcZAK+56DkVJmXMlOjCJorjVEY8oOiYetBUvojFNRnclQFqunPi1rKRxZBbpYVFyx/qVYbvT+9+lnuOm8gg1q/3n+0bNwLKFzia3oOg1UIqXBUu+pPIFqFYqs++JW5tycqszI=; Received: from [37.229.193.176] (helo=nonamehost.local) by frv157.fwdcdn.com with esmtpsa ID 1bGq3f-0003qw-EK ; Sat, 25 Jun 2016 19:03:47 +0300 Date: Sat, 25 Jun 2016 19:03:46 +0300 From: Ivan Klymenko To: Konstantin Belousov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625190346.19a1ef0d@nonamehost.local> In-Reply-To: <20160625152006.GA38613@kib.kiev.ua> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625164403.70684b3b@nonamehost.local> <20160625135508.GV38613@kib.kiev.ua> <20160625170406.77c79b2e@nonamehost.local> <20160625140529.GW38613@kib.kiev.ua> <20160625171800.50a43746@nonamehost.local> <20160625142915.GX38613@kib.kiev.ua> <20160625175503.7c57d42b@nonamehost.local> <20160625152006.GA38613@kib.kiev.ua> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=37.229.193.176; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 16:03:51 -0000 On Sat, 25 Jun 2016 18:20:06 +0300 Konstantin Belousov wrote: > On Sat, Jun 25, 2016 at 05:55:03PM +0300, Ivan Klymenko wrote: > > On Sat, 25 Jun 2016 17:29:15 +0300 > > Konstantin Belousov wrote: > > > > > On Sat, Jun 25, 2016 at 05:18:00PM +0300, Ivan Klymenko wrote: > > > > On Sat, 25 Jun 2016 17:05:29 +0300 > > > > Konstantin Belousov wrote: > > > > > > > > > On Sat, Jun 25, 2016 at 05:04:06PM +0300, Ivan Klymenko > > > > > wrote: > > > > > > On Sat, 25 Jun 2016 16:55:09 +0300 > > > > > > Konstantin Belousov wrote: > > > > > > > > > > > > > On Sat, Jun 25, 2016 at 04:44:03PM +0300, Ivan Klymenko > > > > > > > wrote: > > > > > > > > On Sat, 25 Jun 2016 11:30:40 +0000 (UTC) > > > > > > > > Konstantin Belousov wrote: > > > > > > > > > > > > > > > > > Author: kib > > > > > > > > > Date: Sat Jun 25 11:30:40 2016 > > > > > > > > > New Revision: 302194 > > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/302194 > > > > > > > > > > > > > > > > > > Log: > > > > > > > > > For pthread_mutex_trylock() call on owned > > > > > > > > > error-check or non-portable adaptive mutex, return > > > > > > > > > EDEADLK as required by POSIX. The > > > > > > > > > pthread_mutex_lock() is already compliant. > > > > > > > > > Tested by: Guy Yur > > > > > > > > > Sponsored by: The FreeBSD Foundation > > > > > > > > > MFC after: 2 weeks > > > > > > > > > Approved by: re (gjb) > > > > > > > > > > > > > > > > > > Modified: > > > > > > > > > head/lib/libthr/thread/thr_mutex.c > > > > > > > > > > > > > > > > > > Modified: head/lib/libthr/thread/thr_mutex.c > > > > > > > > > ============================================================================== > > > > > > > > > --- head/lib/libthr/thread/thr_mutex.c Sat Jun > > > > > > > > > 25 10:08:04 2016 (r302193) +++ > > > > > > > > > head/lib/libthr/thread/thr_mutex.c Sat Jun 25 11:30:40 > > > > > > > > > 2016 (r302194) @@ -850,9 +850,12 @@ > > > > > > > > > mutex_self_trylock(struct pthread_mutex switch > > > > > > > > > (PMUTEX_TYPE(m->m_flags)) { case > > > > > > > > > PTHREAD_MUTEX_ERRORCHECK: > > > > > > > > > - case PTHREAD_MUTEX_NORMAL: > > > > > > > > > case PTHREAD_MUTEX_ADAPTIVE_NP: > > > > > > > > > - ret = EBUSY; > > > > > > > > > + ret = EDEADLK; > > > > > > > > > + break; > > > > > > > > > + > > > > > > > > > + case PTHREAD_MUTEX_NORMAL: > > > > > > > > > + ret = EBUSY; > > > > > > > > > break; > > > > > > > > > > > > > > > > > > case PTHREAD_MUTEX_RECURSIVE: > > > > > > > > > > > > > > > > Update for r302191 to r302196 console-kit-daemon: > > > > > > > > pid 1496 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > > > pid 1581 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > > > pid 5954 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > > > pid 6010 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > > > pid 6016 (console-kit-daemon), uid 0: exited on signal 6 > > > > > > > > > > > > > > > > Xorg session after authorization not started - black > > > > > > > > screen. > > > > > > > > > > > > > > Why did you replied to r302194 with this information ? > > > > > > > Does reverting r302194 (and only this revision) restores > > > > > > > console-kit functionality ? > > > > > > > > > > > > I do not know which one commits it breaks r302194 or next > > > > > > 302195. I returned to r302191 for restores console-kit > > > > > > functionality. > > > > > Can you test, please ? Use r302195 kernel and previous > > > > > libthr. > > > > > > > > Kernel r302195, world r302191 - works fine - the problem can not > > > > reproduce. > > > > > > Thank you. > > > > > > Could you get backtrace from the console-kit-daemon ? Only > > > rebuild libthr: cd src/lib/libthr && make DEBUG_FLAGS=-g > > > WITHOUT_TESTS=yes all install then gather coredump and load it in > > > gdb. Then you can revert the commit and rebuild working libthr. > > > > > > > http://pastebin.com/wgmmicC3 If this information will be useful. > > Yes, it is useful, thank you. Please try this instead of reverting. > > diff --git a/lib/libthr/thread/thr_mutex.c > b/lib/libthr/thread/thr_mutex.c index 2ad05ca..1ae75fb 100644 > --- a/lib/libthr/thread/thr_mutex.c > +++ b/lib/libthr/thread/thr_mutex.c > @@ -850,10 +871,10 @@ mutex_self_trylock(struct pthread_mutex *m) > > switch (PMUTEX_TYPE(m->m_flags)) { > case PTHREAD_MUTEX_ERRORCHECK: > - case PTHREAD_MUTEX_ADAPTIVE_NP: > ret = EDEADLK; > break; > > + case PTHREAD_MUTEX_ADAPTIVE_NP: > case PTHREAD_MUTEX_NORMAL: > ret = EBUSY; > break; Strange, it's not helped http://pastebin.com/jbzP0JW2 From owner-svn-src-head@freebsd.org Sat Jun 25 16:16:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D449BB82F8B; Sat, 25 Jun 2016 16:16:20 +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 535391EB4; Sat, 25 Jun 2016 16:16:20 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u5PGGFb0096030 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 25 Jun 2016 19:16:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u5PGGFb0096030 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u5PGGFc5096029; Sat, 25 Jun 2016 19:16:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 25 Jun 2016 19:16:15 +0300 From: Konstantin Belousov To: Ivan Klymenko Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625161615.GD38613@kib.kiev.ua> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625164403.70684b3b@nonamehost.local> <20160625135508.GV38613@kib.kiev.ua> <20160625170406.77c79b2e@nonamehost.local> <20160625140529.GW38613@kib.kiev.ua> <20160625171800.50a43746@nonamehost.local> <20160625142915.GX38613@kib.kiev.ua> <20160625175503.7c57d42b@nonamehost.local> <20160625152006.GA38613@kib.kiev.ua> <20160625190346.19a1ef0d@nonamehost.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160625190346.19a1ef0d@nonamehost.local> User-Agent: Mutt/1.6.1 (2016-04-27) 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 16:16:20 -0000 On Sat, Jun 25, 2016 at 07:03:46PM +0300, Ivan Klymenko wrote: > On Sat, 25 Jun 2016 18:20:06 +0300 > Konstantin Belousov wrote: > > diff --git a/lib/libthr/thread/thr_mutex.c > > b/lib/libthr/thread/thr_mutex.c index 2ad05ca..1ae75fb 100644 > > --- a/lib/libthr/thread/thr_mutex.c > > +++ b/lib/libthr/thread/thr_mutex.c > > @@ -850,10 +871,10 @@ mutex_self_trylock(struct pthread_mutex *m) > > > > switch (PMUTEX_TYPE(m->m_flags)) { > > case PTHREAD_MUTEX_ERRORCHECK: > > - case PTHREAD_MUTEX_ADAPTIVE_NP: > > ret = EDEADLK; > > break; > > > > + case PTHREAD_MUTEX_ADAPTIVE_NP: > > case PTHREAD_MUTEX_NORMAL: > > ret = EBUSY; > > break; > > Strange, it's not helped http://pastebin.com/jbzP0JW2 Are you sure that the new libthr was installed ? Compile and run the following test, please, and show me the results. On the patched libthr, the program must not output anything and exits with error code 0. /* $Id: pthread_errrecurse.c,v 1.1 2016/06/25 16:12:41 kostik Exp kostik $ */ #include #include #include int main(void) { pthread_mutex_t m; pthread_mutexattr_t ma; int error; error = pthread_mutexattr_init(&ma); if (error != 0) err(1, "mutexattr_init"); error = pthread_mutexattr_settype(&ma, PTHREAD_MUTEX_ADAPTIVE_NP); if (error != 0) err(1, "mutexattr_settype"); error = pthread_mutex_init(&m, &ma); if (error != 0) err(1, "mutex_init"); error = pthread_mutex_trylock(&m); if (error != 0) err(1, "mutex_trylock 1"); error = pthread_mutex_trylock(&m); if (error != EBUSY) err(1, "mutex_trylock 2"); else if (error == 0) errx(1, "mutex_trylock 2 succeeded"); return (0); } From owner-svn-src-head@freebsd.org Sat Jun 25 17:03:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B164AB80C2A; Sat, 25 Jun 2016 17:03:09 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.netplex.net", Issuer "RapidSSL SHA256 CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5DB5316F2; Sat, 25 Jun 2016 17:03:08 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.15.1/8.15.1/NETPLEX) with ESMTP id u5PH317c033643; Sat, 25 Jun 2016 13:03:01 -0400 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.4.3 (mail.netplex.net [204.213.176.9]); Sat, 25 Jun 2016 13:03:01 -0400 (EDT) Date: Sat, 25 Jun 2016 13:03:01 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net Reply-To: Daniel Eischen To: Konstantin Belousov cc: Ivan Klymenko , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread In-Reply-To: <20160625161615.GD38613@kib.kiev.ua> Message-ID: References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625164403.70684b3b@nonamehost.local> <20160625135508.GV38613@kib.kiev.ua> <20160625170406.77c79b2e@nonamehost.local> <20160625140529.GW38613@kib.kiev.ua> <20160625171800.50a43746@nonamehost.local> <20160625142915.GX38613@kib.kiev.ua> <20160625175503.7c57d42b@nonamehost.local> <20160625152006.GA38613@kib.kiev.ua> <20160625190346.19a1ef0d@nonamehost.local> <20160625161615.GD38613@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 17:03:09 -0000 On Sat, 25 Jun 2016, Konstantin Belousov wrote: > On Sat, Jun 25, 2016 at 07:03:46PM +0300, Ivan Klymenko wrote: >> On Sat, 25 Jun 2016 18:20:06 +0300 >> Konstantin Belousov wrote: >>> diff --git a/lib/libthr/thread/thr_mutex.c >>> b/lib/libthr/thread/thr_mutex.c index 2ad05ca..1ae75fb 100644 >>> --- a/lib/libthr/thread/thr_mutex.c >>> +++ b/lib/libthr/thread/thr_mutex.c >>> @@ -850,10 +871,10 @@ mutex_self_trylock(struct pthread_mutex *m) >>> >>> switch (PMUTEX_TYPE(m->m_flags)) { >>> case PTHREAD_MUTEX_ERRORCHECK: >>> - case PTHREAD_MUTEX_ADAPTIVE_NP: >>> ret = EDEADLK; >>> break; >>> >>> + case PTHREAD_MUTEX_ADAPTIVE_NP: >>> case PTHREAD_MUTEX_NORMAL: >>> ret = EBUSY; >>> break; >> >> Strange, it's not helped http://pastebin.com/jbzP0JW2 > > Are you sure that the new libthr was installed ? Compile and run the > following test, please, and show me the results. On the patched libthr, > the program must not output anything and exits with error code 0. Sorry for not noticing and coming in late, but I think the original change is wrong. I don't see in the 2013 POSIX spec or Solaris 11 man page (haven't checked Linux yet) where pthread_mutex_trylock() returns EDEADLK under any circumstance. http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_trylock.html http://docs.oracle.com/cd/E23824_01/html/821-1465/pthread-mutex-trylock-3c.html#scrolltoc -- DE From owner-svn-src-head@freebsd.org Sat Jun 25 17:14:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B36BAB80E57; Sat, 25 Jun 2016 17:14:43 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 803071C02; Sat, 25 Jun 2016 17:14:43 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 5BE55B80B6; Sat, 25 Jun 2016 19:14:39 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 3575B28494; Sat, 25 Jun 2016 19:14:40 +0200 (CEST) Date: Sat, 25 Jun 2016 19:14:40 +0200 From: Jilles Tjoelker To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625171440.GA19698@stack.nl> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201606251130.u5PBUeGC001988@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 17:14:43 -0000 On Sat, Jun 25, 2016 at 11:30:40AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Sat Jun 25 11:30:40 2016 > New Revision: 302194 > URL: https://svnweb.freebsd.org/changeset/base/302194 > Log: > For pthread_mutex_trylock() call on owned error-check or non-portable > adaptive mutex, return EDEADLK as required by POSIX. The > pthread_mutex_lock() is already compliant. > Tested by: Guy Yur > Sponsored by: The FreeBSD Foundation > MFC after: 2 weeks > Approved by: re (gjb) > Modified: > head/lib/libthr/thread/thr_mutex.c > Modified: head/lib/libthr/thread/thr_mutex.c > ============================================================================== > --- head/lib/libthr/thread/thr_mutex.c Sat Jun 25 10:08:04 2016 (r302193) > +++ head/lib/libthr/thread/thr_mutex.c Sat Jun 25 11:30:40 2016 (r302194) > @@ -850,9 +850,12 @@ mutex_self_trylock(struct pthread_mutex > > switch (PMUTEX_TYPE(m->m_flags)) { > case PTHREAD_MUTEX_ERRORCHECK: > - case PTHREAD_MUTEX_NORMAL: > case PTHREAD_MUTEX_ADAPTIVE_NP: > - ret = EBUSY; > + ret = EDEADLK; > + break; > + > + case PTHREAD_MUTEX_NORMAL: > + ret = EBUSY; > break; > > case PTHREAD_MUTEX_RECURSIVE: I think POSIX (SUSv4tc1, XSH 3 pthread_mutex_lock) is clear that only pthread_mutex_lock() can fail with [EDEADLK], not pthread_mutex_trylock(). Instead, the error [EBUSY] listed for pthread_mutex_trylock() applies whenever the mutex could not be acquired because it was already locked. This includes the case where the mutex is owned by the current thread. Note that POSIX intends to allow not storing the owning thread's ID in non-recursive non-robust mutexes. Failing pthread_mutex_trylock() on owned mutexes only with [EBUSY] also matches our code before this commit and NetBSD's code, and is apparently expected by other code. Therefore, I think this commit should be reverted. -- Jilles Tjoelker From owner-svn-src-head@freebsd.org Sat Jun 25 17:30:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50657B81072; Sat, 25 Jun 2016 17:30:03 +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 EEEE112D8; Sat, 25 Jun 2016 17:30:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u5PHTuw6012726 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 25 Jun 2016 20:29:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u5PHTuw6012726 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u5PHTu6q012725; Sat, 25 Jun 2016 20:29:56 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 25 Jun 2016 20:29:56 +0300 From: Konstantin Belousov To: Jilles Tjoelker , Daniel Eischen Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625172956.GE38613@kib.kiev.ua> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625171440.GA19698@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160625171440.GA19698@stack.nl> User-Agent: Mutt/1.6.1 (2016-04-27) 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 17:30:03 -0000 On Sat, Jun 25, 2016 at 07:14:40PM +0200, Jilles Tjoelker wrote: > On Sat, Jun 25, 2016 at 11:30:40AM +0000, Konstantin Belousov wrote: > > Author: kib > > Date: Sat Jun 25 11:30:40 2016 > > New Revision: 302194 > > URL: https://svnweb.freebsd.org/changeset/base/302194 > > > Log: > > For pthread_mutex_trylock() call on owned error-check or non-portable > > adaptive mutex, return EDEADLK as required by POSIX. The > > pthread_mutex_lock() is already compliant. > > > Tested by: Guy Yur > > Sponsored by: The FreeBSD Foundation > > MFC after: 2 weeks > > Approved by: re (gjb) > > > Modified: > > head/lib/libthr/thread/thr_mutex.c > > > Modified: head/lib/libthr/thread/thr_mutex.c > > ============================================================================== > > --- head/lib/libthr/thread/thr_mutex.c Sat Jun 25 10:08:04 2016 (r302193) > > +++ head/lib/libthr/thread/thr_mutex.c Sat Jun 25 11:30:40 2016 (r302194) > > @@ -850,9 +850,12 @@ mutex_self_trylock(struct pthread_mutex > > > > switch (PMUTEX_TYPE(m->m_flags)) { > > case PTHREAD_MUTEX_ERRORCHECK: > > - case PTHREAD_MUTEX_NORMAL: > > case PTHREAD_MUTEX_ADAPTIVE_NP: > > - ret = EBUSY; > > + ret = EDEADLK; > > + break; > > + > > + case PTHREAD_MUTEX_NORMAL: > > + ret = EBUSY; > > break; > > > > case PTHREAD_MUTEX_RECURSIVE: > > I think POSIX (SUSv4tc1, XSH 3 pthread_mutex_lock) is clear that only > pthread_mutex_lock() can fail with [EDEADLK], not > pthread_mutex_trylock(). Instead, the error [EBUSY] listed for > pthread_mutex_trylock() applies whenever the mutex could not be acquired > because it was already locked. This includes the case where the mutex is > owned by the current thread. Note that POSIX intends to allow not > storing the owning thread's ID in non-recursive non-robust mutexes. > > Failing pthread_mutex_trylock() on owned mutexes only with [EBUSY] also > matches our code before this commit and NetBSD's code, and is apparently > expected by other code. > > Therefore, I think this commit should be reverted. > I already asked re for approval of the reversal and got it. But I am still hesitating doing the revert vs. returning EDEADLK for error-checking mutexes. My initial mistake was reading the statement about PTHREAD_MUTEX_ERRORCHECK returning EDEADLK as the requirement for both functions. It was induced by reading the following code in samba: https://github.com/samba-team/samba/blob/master/lib/tdb/common/mutex.c#L928 I did extracted this into stand-alone test and checked that glibc does return EDEADLK in this case. BTW, if somebody has Solaris machine available to test this, I would be grateful. Code is available at https://www.kib.kiev.ua/kib/pshared/pthread_samba.c I.e., plain revert would disable the only known to me consumer of the robust mutexes. The patch which I mailed last time, returns EDEADLK for trylock on ERRORCHECKed mutexes only. And I am tending toward glibc compatibility there, over the literal POSIX compliance, but I want to see the confirmation from the Klimenko' test first. From owner-svn-src-head@freebsd.org Sat Jun 25 17:43:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB958B814D9; Sat, 25 Jun 2016 17:43:21 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv157.fwdcdn.com (frv157.fwdcdn.com [212.42.77.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ADA5D1DC9; Sat, 25 Jun 2016 17:43:21 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=IT5rcQLE7hgKyZnCAqJtt8U6JHe1r8mAlqCXQ2pV2xo=; b=ZqWkAaDqrcOw2rMgqR/qnLrcNpAYrL1Wp39Nme0xRkMiPKBJwbRKSEcbKD0s1bs3asImR/uB4t4KOsA2cvYF8NS9Si0riXgsumdflKoOCwA9xbI2ZnZPnTP2SvUhALL7MIuDlobbowXmjHXxZwfJPFWzOhUBRv/VJPl8rqfp3bg=; Received: from [37.229.193.176] (helo=nonamehost.local) by frv157.fwdcdn.com with esmtpsa ID 1bGrbx-000FWL-Tw ; Sat, 25 Jun 2016 20:43:17 +0300 Date: Sat, 25 Jun 2016 20:43:17 +0300 From: Ivan Klymenko To: Konstantin Belousov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625204317.0aae5c98@nonamehost.local> In-Reply-To: <20160625161615.GD38613@kib.kiev.ua> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625164403.70684b3b@nonamehost.local> <20160625135508.GV38613@kib.kiev.ua> <20160625170406.77c79b2e@nonamehost.local> <20160625140529.GW38613@kib.kiev.ua> <20160625171800.50a43746@nonamehost.local> <20160625142915.GX38613@kib.kiev.ua> <20160625175503.7c57d42b@nonamehost.local> <20160625152006.GA38613@kib.kiev.ua> <20160625190346.19a1ef0d@nonamehost.local> <20160625161615.GD38613@kib.kiev.ua> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Authentication-Result: IP=37.229.193.176; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 17:43:22 -0000 On Sat, 25 Jun 2016 19:16:15 +0300 Konstantin Belousov wrote: > On Sat, Jun 25, 2016 at 07:03:46PM +0300, Ivan Klymenko wrote: > > On Sat, 25 Jun 2016 18:20:06 +0300 > > Konstantin Belousov wrote: > > > diff --git a/lib/libthr/thread/thr_mutex.c > > > b/lib/libthr/thread/thr_mutex.c index 2ad05ca..1ae75fb 100644 > > > --- a/lib/libthr/thread/thr_mutex.c > > > +++ b/lib/libthr/thread/thr_mutex.c > > > @@ -850,10 +871,10 @@ mutex_self_trylock(struct pthread_mutex *m) > > > > > > switch (PMUTEX_TYPE(m->m_flags)) { > > > case PTHREAD_MUTEX_ERRORCHECK: > > > - case PTHREAD_MUTEX_ADAPTIVE_NP: > > > ret = EDEADLK; > > > break; > > > > > > + case PTHREAD_MUTEX_ADAPTIVE_NP: > > > case PTHREAD_MUTEX_NORMAL: > > > ret = EBUSY; > > > break; > > > > Strange, it's not helped http://pastebin.com/jbzP0JW2 > > Are you sure that the new libthr was installed ? Compile and run the > following test, please, and show me the results. On the patched > libthr, the program must not output anything and exits with error > code 0. > > /* $Id: pthread_errrecurse.c,v 1.1 2016/06/25 16:12:41 kostik Exp > kostik $ */ > > #include > #include > #include > > int > main(void) > { > pthread_mutex_t m; > pthread_mutexattr_t ma; > int error; > > error = pthread_mutexattr_init(&ma); > if (error != 0) > err(1, "mutexattr_init"); > error = pthread_mutexattr_settype(&ma, > PTHREAD_MUTEX_ADAPTIVE_NP); if (error != 0) > err(1, "mutexattr_settype"); > error = pthread_mutex_init(&m, &ma); > if (error != 0) > err(1, "mutex_init"); > error = pthread_mutex_trylock(&m); > if (error != 0) > err(1, "mutex_trylock 1"); > error = pthread_mutex_trylock(&m); > if (error != EBUSY) > err(1, "mutex_trylock 2"); > else if (error == 0) > errx(1, "mutex_trylock 2 succeeded"); > return (0); > } > ./thr_mutex_test thr_mutex_test: mutex_trylock 2: No error: 0 From owner-svn-src-head@freebsd.org Sat Jun 25 18:05:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FC39B8188E; Sat, 25 Jun 2016 18:05:53 +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 026BC18F4; Sat, 25 Jun 2016 18:05:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u5PI5iQn021825 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 25 Jun 2016 21:05:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u5PI5iQn021825 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u5PI5its021814; Sat, 25 Jun 2016 21:05:44 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 25 Jun 2016 21:05:43 +0300 From: Konstantin Belousov To: Ivan Klymenko Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625180543.GF38613@kib.kiev.ua> References: <20160625135508.GV38613@kib.kiev.ua> <20160625170406.77c79b2e@nonamehost.local> <20160625140529.GW38613@kib.kiev.ua> <20160625171800.50a43746@nonamehost.local> <20160625142915.GX38613@kib.kiev.ua> <20160625175503.7c57d42b@nonamehost.local> <20160625152006.GA38613@kib.kiev.ua> <20160625190346.19a1ef0d@nonamehost.local> <20160625161615.GD38613@kib.kiev.ua> <20160625204317.0aae5c98@nonamehost.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160625204317.0aae5c98@nonamehost.local> User-Agent: Mutt/1.6.1 (2016-04-27) 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 18:05:53 -0000 On Sat, Jun 25, 2016 at 08:43:17PM +0300, Ivan Klymenko wrote: > ./thr_mutex_test > thr_mutex_test: mutex_trylock 2: No error: 0 Ok, there is a bug in my test, it must use errc(3) and not err(3). Please retest wth the updated code below. But I am sure that you would see EDEADLK (Resource deadlock avoided) error, which means that you have wrong, i.e. unpatched libthr, installed. For me, the output is sandy% ./pthread_errrecurse sandy% echo $? 0 From owner-svn-src-head@freebsd.org Sat Jun 25 18:07:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B29BB818E2; Sat, 25 Jun 2016 18:07:02 +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 8D3A51A9D; Sat, 25 Jun 2016 18:07:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u5PI6vWU022177 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 25 Jun 2016 21:06:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u5PI6vWU022177 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u5PI6vlJ022176; Sat, 25 Jun 2016 21:06:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 25 Jun 2016 21:06:57 +0300 From: Konstantin Belousov To: Ivan Klymenko Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625180657.GG38613@kib.kiev.ua> References: <20160625170406.77c79b2e@nonamehost.local> <20160625140529.GW38613@kib.kiev.ua> <20160625171800.50a43746@nonamehost.local> <20160625142915.GX38613@kib.kiev.ua> <20160625175503.7c57d42b@nonamehost.local> <20160625152006.GA38613@kib.kiev.ua> <20160625190346.19a1ef0d@nonamehost.local> <20160625161615.GD38613@kib.kiev.ua> <20160625204317.0aae5c98@nonamehost.local> <20160625180543.GF38613@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160625180543.GF38613@kib.kiev.ua> User-Agent: Mutt/1.6.1 (2016-04-27) 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-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 18:07:02 -0000 On Sat, Jun 25, 2016 at 09:05:43PM +0300, Konstantin Belousov wrote: > On Sat, Jun 25, 2016 at 08:43:17PM +0300, Ivan Klymenko wrote: > > ./thr_mutex_test > > thr_mutex_test: mutex_trylock 2: No error: 0 > > Ok, there is a bug in my test, it must use errc(3) and not err(3). Please > retest wth the updated code below. But I am sure that you would see > EDEADLK (Resource deadlock avoided) error, which means that you have > wrong, i.e. unpatched libthr, installed. > > For me, the output is > sandy% ./pthread_errrecurse > sandy% echo $? > 0 > Err, the updated test. /* $Id: pthread_errrecurse.c,v 1.2 2016/06/25 18:02:54 kostik Exp kostik $ */ #include #include #include int main(void) { pthread_mutex_t m; pthread_mutexattr_t ma; int error; error = pthread_mutexattr_init(&ma); if (error != 0) errc(1, error, "mutexattr_init"); error = pthread_mutexattr_settype(&ma, PTHREAD_MUTEX_ADAPTIVE_NP); if (error != 0) errc(1, error, "mutexattr_settype"); error = pthread_mutex_init(&m, &ma); if (error != 0) errc(1, error, "mutex_init"); error = pthread_mutex_trylock(&m); if (error != 0) errc(1, error, "mutex_trylock 1"); error = pthread_mutex_trylock(&m); if (error != EBUSY) errc(1, error, "mutex_trylock 2"); else if (error == 0) errx(1, "mutex_trylock 2 succeeded"); return (0); } From owner-svn-src-head@freebsd.org Sat Jun 25 18:25:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E70A3B81CDB; Sat, 25 Jun 2016 18:25:52 +0000 (UTC) (envelope-from fidaj@ukr.net) Received: from frv157.fwdcdn.com (frv157.fwdcdn.com [212.42.77.157]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B6032526; Sat, 25 Jun 2016 18:25:51 +0000 (UTC) (envelope-from fidaj@ukr.net) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ukr.net; s=fsm; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date; bh=RcAXX/GOINFltmJUZNIh5aCeeJPDxSafm2nVRNzdl/c=; b=M4bqp3WUinoyCfKxVKdrotfaH0yAez7enNo1mLN6P0K/9k+vvRpD4aSzaPz4JrEvpQu1ZbF//voYh1Zodw5SIX851jDmjK4GlUICZIAHuaduHGIY9/bPJIyEe9kugmOKfYYnvNi07Ub3JDVFhmgdv4lpbobsm4D12OdgN9v6eN0=; Received: from [37.229.193.176] (helo=nonamehost.local) by frv157.fwdcdn.com with esmtpsa ID 1bGsH7-0004Pc-7T ; Sat, 25 Jun 2016 21:25:49 +0300 Date: Sat, 25 Jun 2016 21:25:48 +0300 From: Ivan Klymenko To: Konstantin Belousov Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625212548.14057aa1@nonamehost.local> In-Reply-To: <20160625180657.GG38613@kib.kiev.ua> References: <20160625170406.77c79b2e@nonamehost.local> <20160625140529.GW38613@kib.kiev.ua> <20160625171800.50a43746@nonamehost.local> <20160625142915.GX38613@kib.kiev.ua> <20160625175503.7c57d42b@nonamehost.local> <20160625152006.GA38613@kib.kiev.ua> <20160625190346.19a1ef0d@nonamehost.local> <20160625161615.GD38613@kib.kiev.ua> <20160625204317.0aae5c98@nonamehost.local> <20160625180543.GF38613@kib.kiev.ua> <20160625180657.GG38613@kib.kiev.ua> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Authentication-Result: IP=37.229.193.176; mail.from=fidaj@ukr.net; dkim=pass; header.d=ukr.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 18:25:53 -0000 On Sat, 25 Jun 2016 21:06:57 +0300 Konstantin Belousov wrote: > On Sat, Jun 25, 2016 at 09:05:43PM +0300, Konstantin Belousov wrote: > > On Sat, Jun 25, 2016 at 08:43:17PM +0300, Ivan Klymenko wrote: =20 > > > ./thr_mutex_test > > > thr_mutex_test: mutex_trylock 2: No error: 0 =20 > >=20 > > Ok, there is a bug in my test, it must use errc(3) and not err(3). > > Please retest wth the updated code below. But I am sure that you > > would see EDEADLK (Resource deadlock avoided) error, which means > > that you have wrong, i.e. unpatched libthr, installed. > >=20 > > For me, the output is=20 > > sandy% ./pthread_errrecurse > > sandy% echo $? > > 0 > > =20 > Err, the updated test. >=20 > /* $Id: pthread_errrecurse.c,v 1.2 2016/06/25 18:02:54 kostik Exp > kostik $ */ >=20 > #include > #include > #include >=20 > int > main(void) > { > pthread_mutex_t m; > pthread_mutexattr_t ma; > int error; >=20 > error =3D pthread_mutexattr_init(&ma); > if (error !=3D 0) > errc(1, error, "mutexattr_init"); > error =3D pthread_mutexattr_settype(&ma, > PTHREAD_MUTEX_ADAPTIVE_NP); if (error !=3D 0) > errc(1, error, "mutexattr_settype"); > error =3D pthread_mutex_init(&m, &ma); > if (error !=3D 0) > errc(1, error, "mutex_init"); > error =3D pthread_mutex_trylock(&m); > if (error !=3D 0) > errc(1, error, "mutex_trylock 1"); > error =3D pthread_mutex_trylock(&m); > if (error !=3D EBUSY) > errc(1, error, "mutex_trylock 2"); > else if (error =3D=3D 0) > errx(1, "mutex_trylock 2 succeeded"); > return (0); > } 1. Patched & installed libthr r302195 2. test for other soft: mousepad=20 GLib (gthread-posix.c): Unexpected error from C library during 'pthread_mutex_trylock': =D0=A3=D0=BD=D0=B8=D0=BA=D0=BD=D1=83=D1=82=D0=BE = =D0=B2=D0=B7=D0=B0=D1=94=D0=BC=D0=BD=D0=B5 =D0=B1=D0=BB=D0=BE=D0=BA=D1=83= =D0=B2=D0=B0=D0=BD=D0=BD=D1=8F =D1=80=D0=B5=D1=81=D1=83=D1=80=D1=81=D1=96= =D0=B2. Aborting. =D0=90=D0=B2=D0=B0=D1=80=D1=96=D0=B9=D0=BD=D0=B5 =D0=B7=D0=B0=D0= =B2=D0=B5=D1=80=D1=88=D0=B5=D0=BD=D0=BD=D1=8F(=D0=B7=D0=B0=D0=BF=D0=B8=D1= =81=D0=B0=D0=BD=D0=BE core) 3.test new ./thr_mutex_test=20 thr_mutex_test: mutex_trylock 2: No error: 0 4. restore patch & install original libthr r302195 5. test for other soft: mousepad GLib (gthread-posix.c): Unexpected error from C library during 'pthread_mutex_trylock': =D0=A3=D0=BD=D0=B8=D0=BA=D0=BD=D1=83=D1=82=D0=BE = =D0=B2=D0=B7=D0=B0=D1=94=D0=BC=D0=BD=D0=B5 =D0=B1=D0=BB=D0=BE=D0=BA=D1=83= =D0=B2=D0=B0=D0=BD=D0=BD=D1=8F =D1=80=D0=B5=D1=81=D1=83=D1=80=D1=81=D1=96= =D0=B2. Aborting. =D0=90=D0=B2=D0=B0=D1=80=D1=96=D0=B9=D0=BD=D0=B5 =D0=B7=D0=B0=D0= =B2=D0=B5=D1=80=D1=88=D0=B5=D0=BD=D0=BD=D1=8F(=D0=B7=D0=B0=D0=BF=D0=B8=D1= =81=D0=B0=D0=BD=D0=BE core) 6. test new ./thr_mutex_test=20 thr_mutex_test: mutex_trylock 2: No error: 0 7. restore & install libthr r302191 8. test for other soft: mousepad - complete run 9. test new ./thr_mutex_test=20 thr_mutex_test: mutex_trylock 2: No error: 0 From owner-svn-src-head@freebsd.org Sat Jun 25 18:36:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B845B81EFC; Sat, 25 Jun 2016 18:36:55 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from mail.netplex.net (mail.netplex.net [204.213.176.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.netplex.net", Issuer "RapidSSL SHA256 CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 187EE2A06; Sat, 25 Jun 2016 18:36:54 +0000 (UTC) (envelope-from deischen@freebsd.org) Received: from sea.ntplx.net (sea.ntplx.net [204.213.176.11]) by mail.netplex.net (8.15.1/8.15.1/NETPLEX) with ESMTP id u5PIaqua011898; Sat, 25 Jun 2016 14:36:52 -0400 X-Virus-Scanned: by AMaViS and Clam AntiVirus (mail.netplex.net) X-Greylist: Message whitelisted by DRAC access database, not delayed by milter-greylist-4.4.3 (mail.netplex.net [204.213.176.9]); Sat, 25 Jun 2016 14:36:52 -0400 (EDT) Date: Sat, 25 Jun 2016 14:36:52 -0400 (EDT) From: Daniel Eischen X-X-Sender: eischen@sea.ntplx.net Reply-To: Daniel Eischen To: Konstantin Belousov cc: Jilles Tjoelker , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread In-Reply-To: <20160625172956.GE38613@kib.kiev.ua> Message-ID: References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625171440.GA19698@stack.nl> <20160625172956.GE38613@kib.kiev.ua> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 18:36:55 -0000 On Sat, 25 Jun 2016, Konstantin Belousov wrote: > On Sat, Jun 25, 2016 at 07:14:40PM +0200, Jilles Tjoelker wrote: >> On Sat, Jun 25, 2016 at 11:30:40AM +0000, Konstantin Belousov wrote: >>> Author: kib >>> Date: Sat Jun 25 11:30:40 2016 >>> New Revision: 302194 >>> URL: https://svnweb.freebsd.org/changeset/base/302194 >> >>> Log: >>> For pthread_mutex_trylock() call on owned error-check or non-portable >>> adaptive mutex, return EDEADLK as required by POSIX. The >>> pthread_mutex_lock() is already compliant. >> >>> Tested by: Guy Yur >>> Sponsored by: The FreeBSD Foundation >>> MFC after: 2 weeks >>> Approved by: re (gjb) >> >>> Modified: >>> head/lib/libthr/thread/thr_mutex.c >> >>> Modified: head/lib/libthr/thread/thr_mutex.c >>> ============================================================================== >>> --- head/lib/libthr/thread/thr_mutex.c Sat Jun 25 10:08:04 2016 (r302193) >>> +++ head/lib/libthr/thread/thr_mutex.c Sat Jun 25 11:30:40 2016 (r302194) >>> @@ -850,9 +850,12 @@ mutex_self_trylock(struct pthread_mutex >>> >>> switch (PMUTEX_TYPE(m->m_flags)) { >>> case PTHREAD_MUTEX_ERRORCHECK: >>> - case PTHREAD_MUTEX_NORMAL: >>> case PTHREAD_MUTEX_ADAPTIVE_NP: >>> - ret = EBUSY; >>> + ret = EDEADLK; >>> + break; >>> + >>> + case PTHREAD_MUTEX_NORMAL: >>> + ret = EBUSY; >>> break; >>> >>> case PTHREAD_MUTEX_RECURSIVE: >> >> I think POSIX (SUSv4tc1, XSH 3 pthread_mutex_lock) is clear that only >> pthread_mutex_lock() can fail with [EDEADLK], not >> pthread_mutex_trylock(). Instead, the error [EBUSY] listed for >> pthread_mutex_trylock() applies whenever the mutex could not be acquired >> because it was already locked. This includes the case where the mutex is >> owned by the current thread. Note that POSIX intends to allow not >> storing the owning thread's ID in non-recursive non-robust mutexes. >> >> Failing pthread_mutex_trylock() on owned mutexes only with [EBUSY] also >> matches our code before this commit and NetBSD's code, and is apparently >> expected by other code. >> >> Therefore, I think this commit should be reverted. >> > > I already asked re for approval of the reversal and got it. But I am still > hesitating doing the revert vs. returning EDEADLK for error-checking > mutexes. > > My initial mistake was reading the statement about PTHREAD_MUTEX_ERRORCHECK > returning EDEADLK as the requirement for both functions. It was induced > by reading the following code in samba: > https://github.com/samba-team/samba/blob/master/lib/tdb/common/mutex.c#L928 > I did extracted this into stand-alone test and checked that glibc does > return EDEADLK in this case. BTW, if somebody has Solaris machine available > to test this, I would be grateful. Code is available at > https://www.kib.kiev.ua/kib/pshared/pthread_samba.c > > I.e., plain revert would disable the only known to me consumer of the > robust mutexes. The patch which I mailed last time, returns EDEADLK for > trylock on ERRORCHECKed mutexes only. And I am tending toward glibc > compatibility there, over the literal POSIX compliance, but I want to > see the confirmation from the Klimenko' test first. That doesn't make glibc correct. Unless the standards change, we should return EBUSY in this case. It is also unexpected if an implementation's default mutex scheme is PTHREAD_MUTEX_ERRORCHECK and it returns EDEADLK in this case. It's not mentioned in the standard, and no portable application will be expecting it. -- DE From owner-svn-src-head@freebsd.org Sat Jun 25 20:20:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D80B3B81554; Sat, 25 Jun 2016 20:20: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 A89BA1418; Sat, 25 Jun 2016 20:20:25 +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 u5PKKO4d000130; Sat, 25 Jun 2016 20:20:24 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5PKKOGr000129; Sat, 25 Jun 2016 20:20:24 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201606252020.u5PKKOGr000129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 25 Jun 2016 20:20:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302201 - head/lib/libthr/thread X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 20:20:25 -0000 Author: kib Date: Sat Jun 25 20:20:24 2016 New Revision: 302201 URL: https://svnweb.freebsd.org/changeset/base/302201 Log: Revert r302194, there are issues with some applications after changing the return value, in particular console-kit-daemon. Reported by: Ivan Klymenko Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Approved by: re (gjb) Modified: head/lib/libthr/thread/thr_mutex.c Modified: head/lib/libthr/thread/thr_mutex.c ============================================================================== --- head/lib/libthr/thread/thr_mutex.c Sat Jun 25 14:20:34 2016 (r302200) +++ head/lib/libthr/thread/thr_mutex.c Sat Jun 25 20:20:24 2016 (r302201) @@ -850,11 +850,8 @@ mutex_self_trylock(struct pthread_mutex switch (PMUTEX_TYPE(m->m_flags)) { case PTHREAD_MUTEX_ERRORCHECK: - case PTHREAD_MUTEX_ADAPTIVE_NP: - ret = EDEADLK; - break; - case PTHREAD_MUTEX_NORMAL: + case PTHREAD_MUTEX_ADAPTIVE_NP: ret = EBUSY; break; From owner-svn-src-head@freebsd.org Sat Jun 25 20:31:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1779BB81729; Sat, 25 Jun 2016 20:31:22 +0000 (UTC) (envelope-from adrian@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 D83661B9E; Sat, 25 Jun 2016 20:31:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5PKVLss007627; Sat, 25 Jun 2016 20:31:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5PKVLFh007626; Sat, 25 Jun 2016 20:31:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201606252031.u5PKVLFh007626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 25 Jun 2016 20:31:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302202 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 20:31:22 -0000 Author: adrian Date: Sat Jun 25 20:31:20 2016 New Revision: 302202 URL: https://svnweb.freebsd.org/changeset/base/302202 Log: [net80211] re-revert the ibss "is this local to the bss" patch. avos@ pointed out to me that this broke IBSS merging because the rest of the input path no longer was called for non-IBSS frames. I committed a change to not input non-IBSS frames, which stopped nodes being created for BSSes that weren't ours. Unfortunately thta stopped the input path for non-IBSS frames in general, so the management input path didn't work. So, I'll revert this until I come up with a better solution. (Hopefully before 11.) Reviewed by: avos Approved by: re (gjb) Modified: head/sys/net80211/ieee80211_adhoc.c Modified: head/sys/net80211/ieee80211_adhoc.c ============================================================================== --- head/sys/net80211/ieee80211_adhoc.c Sat Jun 25 20:20:24 2016 (r302201) +++ head/sys/net80211/ieee80211_adhoc.c Sat Jun 25 20:31:20 2016 (r302202) @@ -371,7 +371,10 @@ adhoc_input(struct ieee80211_node *ni, s /* * Validate the bssid. */ - if (!IEEE80211_ADDR_EQ(bssid, vap->iv_bss->ni_bssid) && + if (!(type == IEEE80211_FC0_TYPE_MGT && + (subtype == IEEE80211_FC0_SUBTYPE_BEACON || + subtype == IEEE80211_FC0_SUBTYPE_PROBE_RESP)) && + !IEEE80211_ADDR_EQ(bssid, vap->iv_bss->ni_bssid) && !IEEE80211_ADDR_EQ(bssid, ifp->if_broadcastaddr)) { /* not interested in */ IEEE80211_DISCARD_MAC(vap, IEEE80211_MSG_INPUT, From owner-svn-src-head@freebsd.org Sat Jun 25 22:24:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BDCFB80937; Sat, 25 Jun 2016 22:24:17 +0000 (UTC) (envelope-from bz@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 1D18226B5; Sat, 25 Jun 2016 22:24:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u5PMOGIC049589; Sat, 25 Jun 2016 22:24:16 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u5PMOGwH049588; Sat, 25 Jun 2016 22:24:16 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201606252224.u5PMOGwH049588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sat, 25 Jun 2016 22:24:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r302204 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 22:24:17 -0000 Author: bz Date: Sat Jun 25 22:24:16 2016 New Revision: 302204 URL: https://svnweb.freebsd.org/changeset/base/302204 Log: Unbreak building of LINT kernels after r302163. Approved by: re (gjb) Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Sat Jun 25 21:39:21 2016 (r302203) +++ head/sys/conf/NOTES Sat Jun 25 22:24:16 2016 (r302204) @@ -1345,7 +1345,7 @@ options CAM_MAX_HIGHPOWER=4 options SCSI_NO_SENSE_STRINGS options SCSI_NO_OP_STRINGS options SCSI_DELAY=5000 # Be pessimistic about Joe SCSI device -options CAM_NETFLIX_IOSCHED +options CAM_IOSCHED_DYNAMIC # Options for the CAM CDROM driver: # CHANGER_MIN_BUSY_SECONDS: Guaranteed minimum time quantum for a changer LUN From owner-svn-src-head@freebsd.org Sat Jun 25 22:33:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECA31B80C4E; Sat, 25 Jun 2016 22:33:42 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [IPv6:2001:610:1108:5010::104]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id B95EE2BF3; Sat, 25 Jun 2016 22:33:42 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 0A609358C61; Sun, 26 Jun 2016 00:33:39 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id DE09428494; Sun, 26 Jun 2016 00:33:38 +0200 (CEST) Date: Sun, 26 Jun 2016 00:33:38 +0200 From: Jilles Tjoelker To: Konstantin Belousov Cc: Daniel Eischen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r302194 - head/lib/libthr/thread Message-ID: <20160625223338.GA22802@stack.nl> References: <201606251130.u5PBUeGC001988@repo.freebsd.org> <20160625171440.GA19698@stack.nl> <20160625172956.GE38613@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160625172956.GE38613@kib.kiev.ua> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2016 22:33:43 -0000 On Sat, Jun 25, 2016 at 08:29:56PM +0300, Konstantin Belousov wrote: > I already asked re for approval of the reversal and got it. But I am still > hesitating doing the revert vs. returning EDEADLK for error-checking > mutexes. > My initial mistake was reading the statement about PTHREAD_MUTEX_ERRORCHECK > returning EDEADLK as the requirement for both functions. It was induced > by reading the following code in samba: > https://github.com/samba-team/samba/blob/master/lib/tdb/common/mutex.c#L928 > I did extracted this into stand-alone test and checked that glibc does > return EDEADLK in this case. BTW, if somebody has Solaris machine available > to test this, I would be grateful. Code is available at > https://www.kib.kiev.ua/kib/pshared/pthread_samba.c > I.e., plain revert would disable the only known to me consumer of the > robust mutexes. The patch which I mailed last time, returns EDEADLK for > trylock on ERRORCHECKed mutexes only. And I am tending toward glibc > compatibility there, over the literal POSIX compliance, but I want to > see the confirmation from the Klimenko' test first. To be bug-compatible with glibc, you'd need to return the wrong [EDEADLK] error for robust errorcheck mutexes only. Robust non-errorcheck and non-robust errorcheck mutexes return the correct [EBUSY]. I have not checked PI and PP mutexes which probably use a different code path. I'm not sure whether we should copy glibc's bug, but if we do it must be documented in the man page. I'm not happy with it because the bug may break applications written to the standard; at least, Samba developers should be contacted first. -- Jilles Tjoelker